Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Update meta files for new release.
James Cole78153c2aa4dc
diff --git a/.ci/php-cs-fixer/composer.lock b/.ci/php-cs-fixer/composer.lockindex f97e8f97ee..e68e86b2d3 100644--- a/.ci/php-cs-fixer/composer.lock+++ b/.ci/php-cs-fixer/composer.lock@@ -226,16 +226,16 @@},{"name": "friendsofphp/php-cs-fixer",- "version": "v3.36.0",+ "version": "v3.37.0","source": {"type": "git","url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",- "reference": "e889301f276c6ce2c391d6aafae9a162e785b064"+ "reference": "d5ccc3807fd496ac2b448e8e5e57aa0772f0d18b"},"dist": {"type": "zip",- "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/e889301f276c6ce2c391d6aafae9a162e785b064",- "reference": "e889301f276c6ce2c391d6aafae9a162e785b064",+ "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d5ccc3807fd496ac2b448e8e5e57aa0772f0d18b",+ "reference": "d5ccc3807fd496ac2b448e8e5e57aa0772f0d18b","shasum": ""},"require": {@@ -307,7 +307,7 @@],"support": {"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",- "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.36.0"+ "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.37.0"},"funding": [{@@ -315,7 +315,7 @@"type": "github"}],- "time": "2023-10-27T10:12:29+00:00"+ "time": "2023-10-28T14:49:50+00:00"},{"name": "psr/container",diff --git a/app/Api/V2/Controllers/Model/Currency/IndexController.php b/app/Api/V2/Controllers/Model/Currency/IndexController.phpindex 0e71ad2d27..e9ceca34d3 100644--- a/app/Api/V2/Controllers/Model/Currency/IndexController.php+++ b/app/Api/V2/Controllers/Model/Currency/IndexController.php@@ -1,4 +1,25 @@<?php++/*+ * IndexController.php+ * Copyright (c) 2023 [email protected]+ *+ * This file is part of Firefly III (https://github.com/firefly-iii).+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <https://www.gnu.org/licenses/>.+ */+declare(strict_types=1);namespace FireflyIII\Api\V2\Controllers\Model\Currency;diff --git a/app/Console/Commands/Upgrade/UpgradeCurrencyPreferences.php b/app/Console/Commands/Upgrade/UpgradeCurrencyPreferences.phpindex b6ee8c2a1c..b78ff5c57b 100644--- a/app/Console/Commands/Upgrade/UpgradeCurrencyPreferences.php+++ b/app/Console/Commands/Upgrade/UpgradeCurrencyPreferences.php@@ -1,5 +1,26 @@<?php++/*+ * UpgradeCurrencyPreferences.php+ * Copyright (c) 2023 [email protected]+ *+ * This file is part of Firefly III (https://github.com/firefly-iii).+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <https://www.gnu.org/licenses/>.+ */+declare(strict_types=1);namespace FireflyIII\Console\Commands\Upgrade;diff --git a/app/Http/Controllers/TransactionCurrency/CreateController.php b/app/Http/Controllers/TransactionCurrency/CreateController.phpindex 8742e45765..c3be3b01f2 100644--- a/app/Http/Controllers/TransactionCurrency/CreateController.php+++ b/app/Http/Controllers/TransactionCurrency/CreateController.php@@ -1,5 +1,26 @@<?php++/*+ * CreateController.php+ * Copyright (c) 2023 [email protected]+ *+ * This file is part of Firefly III (https://github.com/firefly-iii).+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <https://www.gnu.org/licenses/>.+ */+declare(strict_types=1);namespace FireflyIII\Http\Controllers\TransactionCurrency;diff --git a/app/Http/Controllers/TransactionCurrency/DeleteController.php b/app/Http/Controllers/TransactionCurrency/DeleteController.phpindex 00d36900dd..28190f5f49 100644--- a/app/Http/Controllers/TransactionCurrency/DeleteController.php+++ b/app/Http/Controllers/TransactionCurrency/DeleteController.php@@ -1,5 +1,26 @@<?php++/*+ * DeleteController.php+ * Copyright (c) 2023 [email protected]+ *+ * This file is part of Firefly III (https://github.com/firefly-iii).+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <https://www.gnu.org/licenses/>.+ */+declare(strict_types=1);namespace FireflyIII\Http\Controllers\TransactionCurrency;diff --git a/app/Http/Controllers/TransactionCurrency/EditController.php b/app/Http/Controllers/TransactionCurrency/EditController.phpindex 8a38de1fd2..46f3e56272 100644--- a/app/Http/Controllers/TransactionCurrency/EditController.php+++ b/app/Http/Controllers/TransactionCurrency/EditController.php@@ -1,5 +1,26 @@<?php++/*+ * EditController.php+ * Copyright (c) 2023 [email protected]+ *+ * This file is part of Firefly III (https://github.com/firefly-iii).+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <https://www.gnu.org/licenses/>.+ */+declare(strict_types=1);namespace FireflyIII\Http\Controllers\TransactionCurrency;diff --git a/app/Http/Controllers/TransactionCurrency/IndexController.php b/app/Http/Controllers/TransactionCurrency/IndexController.phpindex 35b943e445..d3e00e8952 100644--- a/app/Http/Controllers/TransactionCurrency/IndexController.php+++ b/app/Http/Controllers/TransactionCurrency/IndexController.php@@ -1,5 +1,26 @@<?php++/*+ * IndexController.php+ * Copyright (c) 2023 [email protected]+ *+ * This file is part of Firefly III (https://github.com/firefly-iii).+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <https://www.gnu.org/licenses/>.+ */+declare(strict_types=1);namespace FireflyIII\Http\Controllers\TransactionCurrency;diff --git a/app/Repositories/UserGroups/Currency/CurrencyRepository.php b/app/Repositories/UserGroups/Currency/CurrencyRepository.phpindex 12efef6f58..99c8763d6a 100644--- a/app/Repositories/UserGroups/Currency/CurrencyRepository.php+++ b/app/Repositories/UserGroups/Currency/CurrencyRepository.php@@ -1,5 +1,26 @@<?php++/*+ * CurrencyRepository.php+ * Copyright (c) 2023 [email protected]+ *+ * This file is part of Firefly III (https://github.com/firefly-iii).+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <https://www.gnu.org/licenses/>.+ */+declare(strict_types=1);namespace FireflyIII\Repositories\UserGroups\Currency;diff --git a/app/Repositories/UserGroups/Currency/CurrencyRepositoryInterface.php b/app/Repositories/UserGroups/Currency/CurrencyRepositoryInterface.phpindex 05b9699fe6..d81a11752c 100644--- a/app/Repositories/UserGroups/Currency/CurrencyRepositoryInterface.php+++ b/app/Repositories/UserGroups/Currency/CurrencyRepositoryInterface.php@@ -1,5 +1,26 @@<?php++/*+ * CurrencyRepositoryInterface.php+ * Copyright (c) 2023 [email protected]+ *+ * This file is part of Firefly III (https://github.com/firefly-iii).+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <https://www.gnu.org/licenses/>.+ */+declare(strict_types=1);namespace FireflyIII\Repositories\UserGroups\Currency;diff --git a/app/Support/Amount.php b/app/Support/Amount.phpindex f5f44aafd1..cef4fbb730 100644--- a/app/Support/Amount.php+++ b/app/Support/Amount.php@@ -126,25 +126,12 @@ class Amount/*** @param User $user- *+ * @deprecated use getDefaultCurrencyByUserGroup instead.* @return TransactionCurrency*/public function getDefaultCurrencyByUser(User $user): TransactionCurrency{- $cache = new CacheProperties();- $cache->addProperty('getDefaultCurrency');- $cache->addProperty($user->id);- if ($cache->has()) {- return $cache->get();- }- $default = $user->currencies()->where('user_default', true)->first();- if (null === $default) {- $default = $this->getSystemCurrency();- $user->currencies()->sync([$default->id => ['user_default' => true]]);- }- $cache->store($default);-- return $default;+ return $this->getDefaultCurrencyByUserGroup($user->userGroup);}/**diff --git a/app/Transformers/BillTransformer.php b/app/Transformers/BillTransformer.phpindex 97196f272c..b84222281f 100644--- a/app/Transformers/BillTransformer.php+++ b/app/Transformers/BillTransformer.php@@ -57,11 +57,12 @@ class BillTransformer extends AbstractTransformer*/public function transform(Bill $bill): array{- $paidData = $this->paidData($bill);- $payDates = $this->payDates($bill);- $currency = $bill->transactionCurrency;- $notes = $this->repository->getNoteText($bill);- $notes = '' === $notes ? null : $notes;+ $paidData = $this->paidData($bill);+ $lastPaidDate = $this->getLastPaidDate($paidData);+ $payDates = $this->payDates($bill, $lastPaidDate);+ $currency = $bill->transactionCurrency;+ $notes = $this->repository->getNoteText($bill);+ $notes = '' === $notes ? null : $notes;$this->repository->setUser($bill->user);$objectGroupId = null;@@ -86,8 +87,8 @@ class BillTransformer extends AbstractTransformer$payDatesFormatted[] = Carbon::createFromFormat('!Y-m-d', $string, config('app.timezone'))->toAtomString();}$nextExpectedMatch = null;- if (null !== $paidData['next_expected_match']) {- $nextExpectedMatch = Carbon::createFromFormat('!Y-m-d', $paidData['next_expected_match'], config('app.timezone'))->toAtomString();+ if (null !== ($payDates[0] ?? null)) {+ $nextExpectedMatch = Carbon::createFromFormat('!Y-m-d', $payDates[0], config('app.timezone'))->toAtomString();}$nextExpectedMatchDiff = trans('firefly.not_expected_period');// converting back and forth is bad code but OK.@@ -182,31 +183,6 @@ class BillTransformer extends AbstractTransformer$lastPaidDate = $this->lastPaidDate($set, $start);app('log')->debug(sprintf('Result of lastPaidDate is %s', $lastPaidDate->format('Y-m-d')));- /*- * The next expected match (nextMatch) is, initially, the bill's date.- */- $nextMatch = clone $bill->date;- /*- * Diff in months (or other period) between bill start and last paid date or $start.- */- $steps = app('navigation')->diffInPeriods($bill->repeat_freq, $bill->skip, $start, $nextMatch);- $nextMatch = app('navigation')->addPeriod($nextMatch, $bill->repeat_freq, $steps);-- if ($nextMatch->lt($lastPaidDate)) {- /*- * Add another period because it's before the last paid date- */- app('log')->debug('Because the last paid date was before our next expected match, add another period.');- $nextMatch = app('navigation')->addPeriod($nextMatch, $bill->repeat_freq, $bill->skip);- }-- if ($nextMatch->isSameDay($lastPaidDate)) {- /*- * Add another period because it's the same day as the last paid date.- */- app('log')->debug('Because the last paid date was on the same day as our next expected match, add another day.');- $nextMatch = app('navigation')->addPeriod($nextMatch, $bill->repeat_freq, $bill->skip);- }/** At this point the "next match" is exactly after the last time the bill was paid.*/@@ -219,11 +195,8 @@ class BillTransformer extends AbstractTransformer];}- app('log')->debug(sprintf('Next match: %s', $nextMatch->toIso8601String()));-return [- 'paid_dates' => $result,- 'next_expected_match' => $nextMatch->format('Y-m-d'),+ 'paid_dates' => $result];}@@ -253,12 +226,13 @@ class BillTransformer extends AbstractTransformer/*** @param Bill $bill+ * @param Carbon $lastPaidDate** @return array*/- protected function payDates(Bill $bill): array+ protected function payDates(Bill $bill, ?Carbon $lastPaidDate): array{- app('log')->debug(sprintf('Now in payDates() for bill #%d', $bill->id));+ app('log')->debug(sprintf('Now in payDates(#%d, "%s")', $bill->id, $lastPaidDate?->format('Y-m-d')));if (null === $this->parameters->get('start') || null === $this->parameters->get('end')) {app('log')->debug('No start or end date, give empty array.');@@ -303,7 +277,11 @@ class BillTransformer extends AbstractTransformer}app('log')->debug(sprintf('Next expected match is %s', $nextExpectedMatch->format('Y-m-d')));// add to set, if the date is ON or after the start parameter- if ($nextExpectedMatch->gte($this->parameters->get('start'))) {+ // AND date is after last paid date+ if ($nextExpectedMatch->gte($this->parameters->get('start'))+ && (null === $lastPaidDate || $nextExpectedMatch->gt($lastPaidDate))+ ) {+ app('log')->debug('Add date to set.');$set->push(clone $nextExpectedMatch);}@@ -315,7 +293,7 @@ class BillTransformer extends AbstractTransformer$loop++;- if ($loop > 4) {+ if ($loop > 12) {break;}}@@ -359,4 +337,30 @@ class BillTransformer extends AbstractTransformerapp('log')->debug(sprintf('Number of steps is %d, result is %s', $steps, $result->format('Y-m-d')));return $result;}++ /**+ * @param array $paidData+ *+ * @return Carbon|null+ */+ private function getLastPaidDate(array $paidData): ?Carbon+ {+ app('log')->debug('getLastPaidDate()');+ $return = null;+ foreach ($paidData['paid_dates'] as $entry) {+ if (null !== $return) {+ $current = Carbon::createFromFormat('!Y-m-d', $entry['date'], config('app.timezone'));+ if ($current->gt($return)) {+ $return = clone $current;+ }+ app('log')->debug(sprintf('Last paid date is: %s', $return->format('Y-m-d')));+ }+ if (null === $return) {+ $return = Carbon::createFromFormat('!Y-m-d', $entry['date'], config('app.timezone'));+ app('log')->debug(sprintf('Last paid date is: %s', $return->format('Y-m-d')));+ }+ }+ app('log')->debug(sprintf('Last paid date is: "%s"', $return?->format('Y-m-d')));+ return $return;+ }}diff --git a/app/Transformers/V2/BillTransformer.php b/app/Transformers/V2/BillTransformer.phpindex 5d0ec63965..f5b87e21fe 100644--- a/app/Transformers/V2/BillTransformer.php+++ b/app/Transformers/V2/BillTransformer.php@@ -358,6 +358,8 @@ class BillTransformer extends AbstractTransformer* Given a bill and a date, this method will tell you at which moment this bill expects its next* transaction. Whether or not it is there already, is not relevant.*+ * TODO this method is bad compared to the v1 one.+ ** @param Bill $bill* @param Carbon $date*diff --git a/changelog.md b/changelog.mdindex ae59582ee3..191a048581 100644--- a/changelog.md+++ b/changelog.md@@ -3,40 +3,36 @@All notable changes to this project will be documented in this file.This project adheres to [Semantic Versioning](http://semver.org/).-## 6.0.28 - 2023-10-28+## 6.0.28 - 2023-10-29### Added-- #8076 Clone and edit button-- #7204 ability to+- [Issue 8076](https://github.com/firefly-iii/firefly-iii/issues/8076) Added a "Clone and edit"-button+- [Issue 7204](https://github.com/firefly-iii/firefly-iii/issues/7204) Added the ability to customize the URL protocol types Firefly III accepts+- [Issue 8098](https://github.com/firefly-iii/firefly-iii/issues/8098) More tests in the navigation class, thanks @tonicospinelli!### Changed-- New actions for GitHub-- Currencies are now linked to users, and can be enabled per user-- Refactored upgrade commands+- Refactored the Actions of GitHub+- The transaction currencies are now linked to users, and can be enabled per user+- A few upgrade commands are refactored- You can no longer edit vital parts of reconciled transactions### Deprecated- Remove old v3 layout.-### Removed--- Initial release.-### Fixed- Bad math in the order of piggy banks-- #8084 @JoSchrader fixed an issue with a duplicate button--### Security--- Initial release.+- [Issue 8084](https://github.com/firefly-iii/firefly-iii/issues/8084) @JoSchrader fixed an issue with a duplicate button+- [Issue 8103](https://github.com/firefly-iii/firefly-iii/issues/8103) Bulk edit would not accept transaction descriptions longer than 255 characters+- [Issue 8099](https://github.com/firefly-iii/firefly-iii/issues/8099) The bill index would never skip the number of periods you indicated+- [Issue 8069](https://github.com/firefly-iii/firefly-iii/issues/8069) Rule descriptions would always "1" as description. Thanks @Maxco10!### API-- Initial release.+- API will no longer accept changes to amount and account fields for reconciled transactions## v6.0.27 - 2023-10-16diff --git a/database/migrations/2023_10_21_113213_add_currency_pivot_tables.php b/database/migrations/2023_10_21_113213_add_currency_pivot_tables.phpindex cf8cda85a7..213a714df6 100644--- a/database/migrations/2023_10_21_113213_add_currency_pivot_tables.php+++ b/database/migrations/2023_10_21_113213_add_currency_pivot_tables.php@@ -1,5 +1,26 @@<?php++/*+ * 2023_10_21_113213_add_currency_pivot_tables.php+ * Copyright (c) 2023 [email protected]+ *+ * This file is part of Firefly III (https://github.com/firefly-iii).+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <https://www.gnu.org/licenses/>.+ */+declare(strict_types=1);use Illuminate\Database\Migrations\Migration;diff --git a/package-lock.json b/package-lock.jsonindex 32a140e1b9..c7653edb49 100644--- a/package-lock.json+++ b/package-lock.json@@ -452,9 +452,9 @@"dev": true},"node_modules/axios": {- "version": "1.5.1",- "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz",- "integrity": "sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==",+ "version": "1.6.0",+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz",+ "integrity": "sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==","dev": true,"dependencies": {"follow-redirects": "^1.15.0",@@ -498,9 +498,9 @@}},"node_modules/bootstrap5-autocomplete": {- "version": "1.1.22",- "resolved": "https://registry.npmjs.org/bootstrap5-autocomplete/-/bootstrap5-autocomplete-1.1.22.tgz",- "integrity": "sha512-vn4/+j/MmupcfQB9dwoGFadyk3OorxZh2Eyo8YVSBiaJBcaM1u+FYl0lgOCHQWRqN3MXqM4YCebo8xiyFIW/fw=="+ "version": "1.1.23",+ "resolved": "https://registry.npmjs.org/bootstrap5-autocomplete/-/bootstrap5-autocomplete-1.1.23.tgz",+ "integrity": "sha512-jmqk7muFampKGPNzp6ABCAZWB38rfRpUyqx1vqn4Wssj88X1xODQGI+hnPAPGfePIjMLEK0Xhd1Is4kva1PUrg=="},"node_modules/braces": {"version": "3.0.2",@@ -932,9 +932,9 @@}},"node_modules/sass": {- "version": "1.69.4",- "resolved": "https://registry.npmjs.org/sass/-/sass-1.69.4.tgz",- "integrity": "sha512-+qEreVhqAy8o++aQfCJwp0sklr2xyEzkm9Pp/Igu9wNPoe7EZEQ8X/MBvvXggI2ql607cxKg/RKOwDj6pp2XDA==",+ "version": "1.69.5",+ "resolved": "https://registry.npmjs.org/sass/-/sass-1.69.5.tgz",+ "integrity": "sha512-qg2+UCJibLr2LCVOt3OlPhr/dqVHWOa9XtZf2OjbLs/T4VPSJ00udtgJxH3neXZm+QqX8B+3cU7RaLqp1iVfcQ==","dev": true,"dependencies": {"chokidar": ">=3.0.0 <4.0.0",diff --git a/public/build/assets/create-1321af8a.js b/public/build/assets/create-1321af8a.jsnew file mode 100644index 0000000000..5b6df91c7a--- /dev/null+++ b/public/build/assets/create-1321af8a.js@@ -0,0 +1 @@+var q=Object.defineProperty;var H=(n,e,t)=>e in n?q(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var C=(n,e,t)=>(H(n,typeof e!="symbol"?e+"":e,t),t);import{x as P,w as M,J as j,z as R,I as z,A as $,y as V}from"./load-translations-87b32220.js";function A(){return{id:"",name:""}}function B(){let e=P(new Date,"yyyy-MM-dd HH:mm");return{description:"",amount:"",currency_code:"EUR",source_account:A(),destination_account:A(),date:e}}function W(n,e){let t=[];for(let s in n)if(n.hasOwnProperty(s)){const i=n[s];let o={};o.description=i.description,o.source_name=i.source_account.name,o.destination_name=i.destination_account.name,o.amount=i.amount,o.date=i.date,o.currency_code=i.currency_code,i.source_account.id.toString()!==""&&(o.source_id=i.source_account.id),i.destination_account.id.toString()!==""&&(o.destination_id=i.destination_account.id),o.type=e,t.push(o)}return t}const T={showAllSuggestions:!1,suggestionsThreshold:1,maximumItems:0,autoselectFirst:!0,ignoreEnter:!1,updateOnSelect:!1,highlightTyped:!1,highlightClass:"",fullWidth:!1,fixed:!1,fuzzy:!1,startsWith:!1,preventBrowserAutocomplete:!1,itemClass:"",activeClasses:["bg-primary","text-white"],labelField:"label",valueField:"value",searchFields:["label"],queryParam:"query",items:[],source:null,hiddenInput:!1,hiddenValue:"",clearControl:"",datalist:"",server:"",serverMethod:"GET",serverParams:{},serverDataKey:"data",fetchOptions:{},liveServer:!1,noCache:!0,debounceTime:300,notFoundMessage:"",onRenderItem:(n,e,t)=>e,onSelectItem:(n,e)=>{},onServerResponse:(n,e)=>n.json(),onChange:(n,e)=>{},onBeforeFetch:n=>{},onAfterFetch:n=>{}},x="is-loading",L="is-active",p="show",_="next",b="prev",g=new WeakMap;let k=0,v=0;function U(n,e=300){let t;return(...s)=>{clearTimeout(t),t=setTimeout(()=>{n.apply(this,s)},e)}}function G(n){return n.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function y(n){return n?G(n.toString()).toLowerCase():""}function K(n,e){if(n.indexOf(e)>=0)return!0;let t=0;for(let s=0;s<e.length;s++){const i=e[s];if(i!=" "&&(t=n.indexOf(i,t)+1,t<=0))return!1}return!0}function D(n,e){return n.parentNode.insertBefore(e,n.nextSibling)}function J(n){var e=document.createElement("textarea");return e.innerHTML=n,e.value}function w(n,e){for(const[t,s]of Object.entries(e))n.setAttribute(t,s)}function X(n){n.ariaLabel=n.innerText,n.innerHTML=n.innerText.split("").map(e=>e+"‍").join("")}class I{constructor(e,t={}){C(this,"handleEvent",e=>{["scroll","resize"].includes(e.type)?(this._timer&&window.cancelAnimationFrame(this._timer),this._timer=window.requestAnimationFrame(()=>{this[`on${e.type}`](e)})):this[`on${e.type}`](e)});if(!(e instanceof HTMLElement)){console.error("Invalid element",e);return}g.set(e,this),k++,v++,this._searchInput=e,this._configure(t),this._preventInput=!1,this._keyboardNavigation=!1,this._searchFunc=U(()=>{this._loadFromServer(!0)},this._config.debounceTime),this._configureSearchInput(),this._configureDropElement(),this._config.fixed&&(document.addEventListener("scroll",this,!0),window.addEventListener("resize",this));const s=this._getClearControl();s&&s.addEventListener("click",this),["focus","change","blur","input","keydown"].forEach(i=>{this._searchInput.addEventListener(i,this)}),["mousemove","mouseleave"].forEach(i=>{this._dropElement.addEventListener(i,this)}),this._fetchData()}static init(e="input.autocomplete",t={}){document.querySelectorAll(e).forEach(i=>{this.getOrCreateInstance(i,t)})}static getInstance(e){return g.has(e)?g.get(e):null}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,t)}dispose(){v--,["focus","change","blur","input","keydown"].forEach(t=>{this._searchInput.removeEventListener(t,this)}),["mousemove","mouseleave"].forEach(t=>{this._dropElement.removeEventListener(t,this)});const e=this._getClearControl();e&&e.removeEventListener("click",this),this._config.fixed&&v<=0&&(document.removeEventListener("scroll",this,!0),window.removeEventListener("resize",this)),this._dropElement.parentElement.removeChild(this._dropElement),g.delete(this._searchInput)}_getClearControl(){if(this._config.clearControl)return document.querySelector(this._config.clearControl)}_configure(e={}){this._config=Object.assign({},T);const t={...e,...this._searchInput.dataset},s=i=>["true","false","1","0",!0,!1].includes(i)&&!!JSON.parse(i);for(const[i,o]of Object.entries(T)){if(t[i]===void 0)continue;const a=t[i];switch(typeof o){case"number":this._config[i]=parseInt(a);break;case"boolean":this._config[i]=s(a);break;case"string":this._config[i]=a.toString();break;case"object":if(Array.isArray(o))if(typeof a=="string"){const r=a.includes("|")?"|":",";this._config[i]=a.split(r)}else this._config[i]=a;else this._config[i]=typeof a=="string"?JSON.parse(a):a;break;case"function":this._config[i]=typeof a=="string"?window[a]:a;break;default:this._config[i]=a;break}}}_configureSearchInput(){if(this._searchInput.autocomplete="off",this._searchInput.spellcheck=!1,w(this._searchInput,{"aria-autocomplete":"list","aria-haspopup":"menu","aria-expanded":"false",role:"combobox"}),this._searchInput.id&&this._config.preventBrowserAutocomplete){const e=document.querySelector(`[for="${this._searchInput.id}"]`);e&&X(e)}this._hiddenInput=null,this._config.hiddenInput&&(this._hiddenInput=document.createElement("input"),this._hiddenInput.type="hidden",this._hiddenInput.value=this._config.hiddenValue,this._hiddenInput.name=this._searchInput.name,this._searchInput.name="_"+this._searchInput.name,D(this._searchInput,this._hiddenInput))}_configureDropElement(){this._dropElement=document.createElement("ul"),this._dropElement.id="ac-menu-"+k,this._dropElement.classList.add("dropdown-menu","autocomplete-menu","p-0"),this._dropElement.style.maxHeight="280px",this._config.fullWidth||(this._dropElement.style.maxWidth="360px"),this._config.fixed&&(this._dropElement.style.position="fixed"),this._dropElement.style.overflowY="auto",this._dropElement.style.overscrollBehavior="contain",this._dropElement.style.textAlign="unset",D(this._searchInput,this._dropElement),this._searchInput.setAttribute("aria-controls",this._dropElement.id)}onclick(e){e.target.matches(this._config.clearControl)&&this.clear()}oninput(e){this._preventInput||(this._hiddenInput&&(this._hiddenInput.value=null),this.showOrSearch())}onchange(e){const t=this._searchInput.value,s=Object.values(this._items).find(i=>i.label===t);this._config.onChange(s,this)}onblur(e){this.hideSuggestions()}onfocus(e){this.showOrSearch()}onkeydown(e){switch(e.keyCode||e.key){case 13:case"Enter":if(this.isDropdownVisible()){const s=this.getSelection();s&&s.click(),(s||!this._config.ignoreEnter)&&e.preventDefault()}break;case 38:case"ArrowUp":e.preventDefault(),this._keyboardNavigation=!0,this._moveSelection(b);break;case 40:case"ArrowDown":e.preventDefault(),this._keyboardNavigation=!0,this.isDropdownVisible()?this._moveSelection(_):this.showOrSearch(!1);break;case 27:case"Escape":this.isDropdownVisible()&&(this._searchInput.focus(),this.hideSuggestions());break}}onmousemove(e){this._keyboardNavigation=!1}onmouseleave(e){this.removeSelection()}onscroll(e){this._positionMenu()}onresize(e){this._positionMenu()}getConfig(e=null){return e!==null?this._config[e]:this._config}setConfig(e,t){this._config[e]=t}setData(e){this._items={},this._addItems(e)}enable(){this._searchInput.setAttribute("disabled","")}disable(){this._searchInput.removeAttribute("disabled")}isDisabled(){return this._searchInput.hasAttribute("disabled")||this._searchInput.disabled||this._searchInput.hasAttribute("readonly")}isDropdownVisible(){return this._dropElement.classList.contains(p)}clear(){this._searchInput.value="",this._hiddenInput&&(this._hiddenInput.value="")}getSelection(){return this._dropElement.querySelector("a."+L)}removeSelection(){const e=this.getSelection();e&&e.classList.remove(...this._activeClasses())}_activeClasses(){return[...this._config.activeClasses,L]}_isItemEnabled(e){if(e.style.display==="none")return!1;const t=e.firstElementChild;return t.tagName==="A"&&!t.classList.contains("disabled")}_moveSelection(e=_,t=null){const s=this.getSelection();if(s){const i=e===_?"nextSibling":"previousSibling";t=s.parentNode;do t=t[i];while(t&&!this._isItemEnabled(t));t?(s.classList.remove(...this._activeClasses()),e===b?t.parentNode.scrollTop=t.offsetTop-t.parentNode.offsetTop:t.offsetTop>t.parentNode.offsetHeight-t.offsetHeight&&(t.parentNode.scrollTop+=t.offsetHeight)):s&&(t=s.parentElement)}else{if(e===b)return t;if(!t)for(t=this._dropElement.firstChild;t&&!this._isItemEnabled(t);)t=t.nextSibling}if(t){const i=t.querySelector("a");i.classList.add(...this._activeClasses()),this._searchInput.setAttribute("aria-activedescendant",i.id),this._config.updateOnSelect&&(this._searchInput.value=i.dataset.label)}else this._searchInput.setAttribute("aria-activedescendant","");return t}_shouldShow(){return this.isDisabled()?!1:this._searchInput.value.length>=this._config.suggestionsThreshold}showOrSearch(e=!0){if(e&&!this._shouldShow()){this.hideSuggestions();return}this._config.liveServer?this._searchFunc():this._config.source?this._config.source(this._searchInput.value,t=>{this.setData(t),this._showSuggestions()}):this._showSuggestions()}_createGroup(e){const t=this._createLi(),s=document.createElement("span");return t.append(s),s.classList.add("dropdown-header","text-truncate"),s.innerHTML=e,t}_createItem(e,t){let s=t.label;if(this._config.highlightTyped){const a=y(s).indexOf(e);a!==-1&&(s=s.substring(0,a)+`<mark class="${this._config.highlightClass}">${s.substring(a,a+e.length)}</mark>`+s.substring(a+e.length,s.length))}s=this._config.onRenderItem(t,s,this);const i=this._createLi(),o=document.createElement("a");if(i.append(o),o.id=this._dropElement.id+"-"+this._dropElement.children.length,o.classList.add("dropdown-item","text-truncate"),this._config.itemClass&&o.classList.add(...this._config.itemClass.split(" ")),o.setAttribute("data-value",t.value),o.setAttribute("data-label",t.label),o.setAttribute("tabindex","-1"),o.setAttribute("role","menuitem"),o.setAttribute("href","#"),o.innerHTML=s,t.data)for(const[a,r]of Object.entries(t.data))o.dataset[a]=r;return o.addEventListener("mouseenter",a=>{this._keyboardNavigation||(this.removeSelection(),i.querySelector("a").classList.add(...this._activeClasses()))}),o.addEventListener("mousedown",a=>{a.preventDefault()}),o.addEventListener("click",a=>{a.preventDefault(),this._preventInput=!0,this._searchInput.value=J(t.label),this._hiddenInput&&(this._hiddenInput.value=t.value),this._config.onSelectItem(t,this),this.hideSuggestions(),this._preventInput=!1}),i}_showSuggestions(){if(document.activeElement!=this._searchInput)return;const e=y(this._searchInput.value);this._dropElement.innerHTML="";const t=Object.keys(this._items);let s=0,i=null;const o=[];for(let a=0;a<t.length;a++){const r=t[a],c=this._items[r],h=this._config.showAllSuggestions||e.length===0;let l=e.length==0&&this._config.suggestionsThreshold===0;!h&&e.length>0&&this._config.searchFields.forEach(d=>{const f=y(c[d]);let m=!1;if(this._config.fuzzy)m=K(f,e);else{const E=f.indexOf(e);m=this._config.startsWith?E===0:E>=0}m&&(l=!0)});const N=l||e.length===0;if(h||l){if(s++,c.group&&!o.includes(c.group)){const f=this._createGroup(c.group);this._dropElement.appendChild(f),o.push(c.group)}const d=this._createItem(e,c);if(!i&&N&&(i=d),this._dropElement.appendChild(d),this._config.maximumItems>0&&s>=this._config.maximumItems)break}}if(i&&this._config.autoselectFirst&&(this.removeSelection(),this._moveSelection(_,i)),s===0)if(this._config.notFoundMessage){const a=this._createLi();a.innerHTML=`<span class="dropdown-item">${this._config.notFoundMessage}</span>`,this._dropElement.appendChild(a),this._showDropdown()}else this.hideSuggestions();else this._showDropdown()}_createLi(){const e=document.createElement("li");return e.setAttribute("role","presentation"),e}_showDropdown(){this._dropElement.classList.add(p),this._dropElement.setAttribute("role","menu"),w(this._searchInput,{"aria-expanded":"true"}),this._positionMenu()}toggleSuggestions(e=!0){this._dropElement.classList.contains(p)?this.hideSuggestions():this.showOrSearch(e)}hideSuggestions(){this._dropElement.classList.remove(p),w(this._searchInput,{"aria-expanded":"false"}),this.removeSelection()}getInput(){return this._searchInput}getDropMenu(){return this._dropElement}_positionMenu(){const e=window.getComputedStyle(this._searchInput),t=this._searchInput.getBoundingClientRect(),s=e.direction==="rtl",i=this._config.fullWidth,o=this._config.fixed;let a=null,r=null;o&&(a=t.x,r=t.y+t.height,s&&!i&&(a-=this._dropElement.offsetWidth-t.width)),this._dropElement.style.transform="unset",i&&(this._dropElement.style.width=this._searchInput.offsetWidth+"px"),a!==null&&(this._dropElement.style.left=a+"px"),r!==null&&(this._dropElement.style.top=r+"px");const c=this._dropElement.getBoundingClientRect(),h=window.innerHeight;if(c.y+c.height>h){const l=i?t.height+4:t.height;this._dropElement.style.transform="translateY(calc(-100.1% - "+l+"px))"}}_fetchData(){this._items={},this._addItems(this._config.items);const e=this._config.datalist;if(e){const t=document.querySelector(`#${e}`);if(t){const s=Array.from(t.children).map(i=>{const o=i.getAttribute("value")??i.innerHTML.toLowerCase(),a=i.innerHTML;return{value:o,label:a}});this._addItems(s)}else console.error(`Datalist not found ${e}`)}this._setHiddenVal(),this._config.server&&!this._config.liveServer&&this._loadFromServer()}_setHiddenVal(){if(this._config.hiddenInput&&!this._config.hiddenValue)for(const[e,t]of Object.entries(this._items))t.label==this._searchInput.value&&(this._hiddenInput.value=e)}_addItems(e){const t=Object.keys(e);for(let s=0;s<t.length;s++){const i=t[s],o=e[i];if(o.group&&o.items){o.items.forEach(c=>c.group=o.group),this._addItems(o.items);continue}const a=typeof o=="string"?o:o.label,r=typeof o!="object"?{}:o;r.label=o[this._config.labelField]??a,r.value=o[this._config.valueField]??i,r.label&&(this._items[r.value]=r)}}_loadFromServer(e=!1){this._abortController&&this._abortController.abort(),this._abortController=new AbortController;let t=this._searchInput.dataset.serverParams||{};typeof t=="string"&&(t=JSON.parse(t));const s=Object.assign({},this._config.serverParams,t);if(s[this._config.queryParam]=this._searchInput.value,this._config.noCache&&(s.t=Date.now()),s.related){const r=document.getElementById(s.related);if(r){s.related=r.value;const c=r.getAttribute("name");c&&(s[c]=r.value)}}const i=new URLSearchParams(s);let o=this._config.server,a=Object.assign(this._config.fetchOptions,{method:this._config.serverMethod||"GET",signal:this._abortController.signal});a.method==="POST"?a.body=i:o+="?"+i.toString(),this._searchInput.classList.add(x),this._config.onBeforeFetch(this),fetch(o,a).then(r=>this._config.onServerResponse(r,this)).then(r=>{const c=r[this._config.serverDataKey]||r;this.setData(c),this._setHiddenVal(),this._abortController=null,e&&this._showSuggestions()}).catch(r=>{r.name==="AbortError"||this._abortController.signal.aborted||console.error(r)}).finally(r=>{this._searchInput.classList.remove(x),this._config.onAfterFetch(this)})}}class Y{post(e){let t="/api/v2/transactions";return M.post(t,e)}}class Q{list(e){return M.get("/api/v2/currencies",{params:e})}}let u;const S={description:"/api/v2/autocomplete/transaction-descriptions",account:"/api/v2/autocomplete/accounts"};let Z=function(){return{count:0,totalAmount:0,transactionType:"unknown",showSuccessMessage:!1,showErrorMessage:!1,entries:[],loadingCurrencies:!0,defaultCurrency:{},enabledCurrencies:[],nativeCurrencies:[],foreignCurrencies:[],filters:{source:[],destination:[]},errorMessageText:"",detectTransactionType(){const n=this.entries[0].source_account.type??"unknown",e=this.entries[0].destination_account.type??"unknown";if(n==="unknown"&&e==="unknown"){this.transactionType="unknown",console.warn("Cannot infer transaction type from two unknown accounts.");return}if(n===e&&["Asset account","Loan","Debt","Mortgage"].includes(n)){this.transactionType="transfer",console.log('Transaction type is detected to be "'+this.transactionType+'".');return}if(n==="Asset account"&&["Expense account","Debt","Loan","Mortgage"].includes(e)){this.transactionType="withdrawal",console.log('Transaction type is detected to be "'+this.transactionType+'".');return}if(n==="Asset account"&&e==="unknown"){this.transactionType="withdrawal",console.log('Transaction type is detected to be "'+this.transactionType+'".');return}if(["Debt","Loan","Mortgage"].includes(n)&&e==="Expense account"){this.transactionType="withdrawal",console.log('Transaction type is detected to be "'+this.transactionType+'".');return}if(n==="Revenue account"&&["Asset account","Debt","Loan","Mortgage"].includes(e)){this.transactionType="deposit",console.log('Transaction type is detected to be "'+this.transactionType+'".');return}if(["Debt","Loan","Mortgage"].includes(n)&&e==="Asset account"){this.transactionType="deposit",console.log('Transaction type is detected to be "'+this.transactionType+'".');return}console.warn('Unknown account combination between "'+n+'" and "'+e+'".')},selectSourceAccount(n,e){const t=parseInt(e._searchInput.attributes["data-index"].value);document.querySelector("#form")._x_dataStack[0].$data.entries[t].source_account={id:n.id,name:n.name,type:n.type},console.log("Changed source account into a known "+n.type.toLowerCase())},changedAmount(n){const e=parseInt(n.target.dataset.index);this.entries[e].amount=parseFloat(n.target.value),this.totalAmount=0;for(let t in this.entries)this.entries.hasOwnProperty(t)&&(this.totalAmount=this.totalAmount+parseFloat(this.entries[t].amount));console.log("Changed amount to "+this.totalAmount)},selectDestAccount(n,e){const t=parseInt(e._searchInput.attributes["data-index"].value);document.querySelector("#form")._x_dataStack[0].$data.entries[t].destination_account={id:n.id,name:n.name,type:n.type},console.log("Changed destination account into a known "+n.type.toLowerCase())},loadCurrencies(){console.log("Loading user currencies."),new Q().list({}).then(e=>{for(let t in e.data.data)if(e.data.data.hasOwnProperty(t)){let s=e.data.data[t];if(s.attributes.enabled){let i={id:s.id,name:s.attributes.name,code:s.attributes.code,default:s.attributes.default,symbol:s.attributes.symbol,decimal_places:s.attributes.decimal_places};i.default&&(this.defaultCurrency=i),this.enabledCurrencies.push(i)}}this.loadingCurrencies=!1,console.log(this.enabledCurrencies)})},changeSourceAccount(n,e){if(typeof n>"u"){const t=parseInt(e._searchInput.attributes["data-index"].value);if(document.querySelector("#form")._x_dataStack[0].$data.entries[t].source_account.name===e._searchInput.value){console.warn('Ignore hallucinated source account name change to "'+e._searchInput.value+'"');return}document.querySelector("#form")._x_dataStack[0].$data.entries[t].source_account={name:e._searchInput.value},console.log('Changed source account into a unknown account called "'+e._searchInput.value+'"')}},changeDestAccount(n,e){if(typeof n>"u"){const t=parseInt(e._searchInput.attributes["data-index"].value);if(document.querySelector("#form")._x_dataStack[0].$data.entries[t].destination_account.name===e._searchInput.value){console.warn('Ignore hallucinated destination account name change to "'+e._searchInput.value+'"');return}document.querySelector("#form")._x_dataStack[0].$data.entries[t].destination_account={name:e._searchInput.value},console.log('Changed destination account into a unknown account called "'+e._searchInput.value+'"')}},showError:!1,showSuccess:!1,addedSplit(){console.log("addedSplit"),I.init("input.ac-source",{server:S.account,serverParams:{types:this.filters.source},fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}},hiddenInput:!0,preventBrowserAutocomplete:!0,highlightTyped:!0,liveServer:!0,onChange:this.changeSourceAccount,onSelectItem:this.selectSourceAccount,onRenderItem:function(n,e,t){return n.name_with_balance+'<br><small class="text-muted">'+u.t("firefly.account_type_"+n.type)+"</small>"}}),I.init("input.ac-dest",{server:S.account,serverParams:{types:this.filters.destination},fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}},hiddenInput:!0,preventBrowserAutocomplete:!0,liveServer:!0,highlightTyped:!0,onSelectItem:this.selectDestAccount,onChange:this.changeDestAccount,onRenderItem:function(n,e,t){return n.name_with_balance+'<br><small class="text-muted">'+u.t("firefly.account_type_"+n.type)+"</small>"}}),this.filters.destination=[],I.init("input.ac-description",{server:S.description,fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}},valueField:"id",labelField:"description",highlightTyped:!0,onSelectItem:console.log})},init(){Promise.all([R("language","en_US")]).then(n=>{u=new z;const e=n[0].replace("-","_");u.locale=e,$(u,e).then(()=>{this.addSplit()})}),this.loadCurrencies(),this.filters.source=["Asset account","Loan","Debt","Mortgage","Revenue account"],this.filters.destination=["Expense account","Loan","Debt","Mortgage","Asset account"]},submitTransaction(){this.detectTransactionType();let n=W(this.entries,this.transactionType),e={group_title:null,fire_webhooks:!1,apply_rules:!1,transactions:n};n.length>1&&(e.group_title=n[0].description);let t=new Y;console.log(e),t.post(e).then(s=>{this.showSuccessMessage=!0,console.log(s),window.location="transactions/show/"+s.data.data.id+"?transaction_group_id="+s.data.data.id+"&message=created"}).catch(s=>{this.showErrorMessage=!0,this.errorMessageText=s.response.data.message})},addSplit(){this.entries.push(B())},removeSplit(n){this.entries.splice(n,1),document.querySelector("#split-0-tab").click()},formattedTotalAmount(){return V(this.totalAmount,"EUR")}}},O={transactions:Z,dates:j};function F(){Object.keys(O).forEach(n=>{console.log(`Loading page component "${n}"`);let e=O[n]();Alpine.data(n,()=>e)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),F()});window.bootstrapped&&(console.log("Loaded through window variable."),F());diff --git a/public/build/assets/create-baf83427.js b/public/build/assets/create-baf83427.jsdeleted file mode 100644index b1cd642430..0000000000--- a/public/build/assets/create-baf83427.js+++ /dev/null@@ -1 +0,0 @@-var N=Object.defineProperty;var q=(n,e,t)=>e in n?N(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var C=(n,e,t)=>(q(n,typeof e!="symbol"?e+"":e,t),t);import{x as H,w as P,J as j,z as R,I as z,A as $,y as V}from"./load-translations-9a154502.js";function A(){return{id:"",name:""}}function B(){let e=H(new Date,"yyyy-MM-dd HH:mm");return{description:"",amount:"",source_account:A(),destination_account:A(),date:e}}function W(n,e){let t=[];for(let s in n)if(n.hasOwnProperty(s)){const i=n[s];let o={};o.description=i.description,o.source_name=i.source_account.name,o.destination_name=i.destination_account.name,o.amount=i.amount,o.date=i.date,i.source_account.id.toString()!==""&&(o.source_id=i.source_account.id),i.destination_account.id.toString()!==""&&(o.destination_id=i.destination_account.id),o.type=e,t.push(o)}return t}const T={showAllSuggestions:!1,suggestionsThreshold:1,maximumItems:0,autoselectFirst:!0,ignoreEnter:!1,updateOnSelect:!1,highlightTyped:!1,highlightClass:"",fullWidth:!1,fixed:!1,fuzzy:!1,startsWith:!1,preventBrowserAutocomplete:!1,itemClass:"",activeClasses:["bg-primary","text-white"],labelField:"label",valueField:"value",searchFields:["label"],queryParam:"query",items:[],source:null,hiddenInput:!1,hiddenValue:"",clearControl:"",datalist:"",server:"",serverMethod:"GET",serverParams:{},serverDataKey:"data",fetchOptions:{},liveServer:!1,noCache:!0,debounceTime:300,notFoundMessage:"",onRenderItem:(n,e,t)=>e,onSelectItem:(n,e)=>{},onServerResponse:(n,e)=>n.json(),onChange:(n,e)=>{}},x="is-loading",L="is-active",f="show",_="next",v="prev",g=new WeakMap;let k=0,b=0;function U(n,e=300){let t;return(...s)=>{clearTimeout(t),t=setTimeout(()=>{n.apply(this,s)},e)}}function G(n){return n.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function y(n){return n?G(n.toString()).toLowerCase():""}function K(n,e){if(n.indexOf(e)>=0)return!0;let t=0;for(let s=0;s<e.length;s++){const i=e[s];if(i!=" "&&(t=n.indexOf(i,t)+1,t<=0))return!1}return!0}function D(n,e){return n.parentNode.insertBefore(e,n.nextSibling)}function J(n){var e=document.createElement("textarea");return e.innerHTML=n,e.value}function w(n,e){for(const[t,s]of Object.entries(e))n.setAttribute(t,s)}function X(n){n.ariaLabel=n.innerText,n.innerHTML=n.innerText.split("").map(e=>e+"‍").join("")}class I{constructor(e,t={}){C(this,"handleEvent",e=>{["scroll","resize"].includes(e.type)?(this._timer&&window.cancelAnimationFrame(this._timer),this._timer=window.requestAnimationFrame(()=>{this[`on${e.type}`](e)})):this[`on${e.type}`](e)});if(!(e instanceof HTMLElement)){console.error("Invalid element",e);return}g.set(e,this),k++,b++,this._searchInput=e,this._configure(t),this._preventInput=!1,this._keyboardNavigation=!1,this._searchFunc=U(()=>{this._loadFromServer(!0)},this._config.debounceTime),this._configureSearchInput(),this._configureDropElement(),this._config.fixed&&(document.addEventListener("scroll",this,!0),window.addEventListener("resize",this));const s=this._getClearControl();s&&s.addEventListener("click",this),["focus","change","blur","input","keydown"].forEach(i=>{this._searchInput.addEventListener(i,this)}),["mousemove","mouseleave"].forEach(i=>{this._dropElement.addEventListener(i,this)}),this._fetchData()}static init(e="input.autocomplete",t={}){document.querySelectorAll(e).forEach(i=>{this.getOrCreateInstance(i,t)})}static getInstance(e){return g.has(e)?g.get(e):null}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,t)}dispose(){b--,["focus","change","blur","input","keydown"].forEach(t=>{this._searchInput.removeEventListener(t,this)}),["mousemove","mouseleave"].forEach(t=>{this._dropElement.removeEventListener(t,this)});const e=this._getClearControl();e&&e.removeEventListener("click",this),this._config.fixed&&b<=0&&(document.removeEventListener("scroll",this,!0),window.removeEventListener("resize",this)),this._dropElement.parentElement.removeChild(this._dropElement),g.delete(this._searchInput)}_getClearControl(){if(this._config.clearControl)return document.querySelector(this._config.clearControl)}_configure(e={}){this._config=Object.assign({},T);const t={...e,...this._searchInput.dataset},s=i=>["true","false","1","0",!0,!1].includes(i)&&!!JSON.parse(i);for(const[i,o]of Object.entries(T)){if(t[i]===void 0)continue;const a=t[i];switch(typeof o){case"number":this._config[i]=parseInt(a);break;case"boolean":this._config[i]=s(a);break;case"string":this._config[i]=a.toString();break;case"object":if(Array.isArray(o))if(typeof a=="string"){const r=a.includes("|")?"|":",";this._config[i]=a.split(r)}else this._config[i]=a;else this._config[i]=typeof a=="string"?JSON.parse(a):a;break;case"function":this._config[i]=typeof a=="string"?window[a]:a;break;default:this._config[i]=a;break}}}_configureSearchInput(){if(this._searchInput.autocomplete="off",this._searchInput.spellcheck=!1,w(this._searchInput,{"aria-autocomplete":"list","aria-haspopup":"menu","aria-expanded":"false",role:"combobox"}),this._searchInput.id&&this._config.preventBrowserAutocomplete){const e=document.querySelector(`[for="${this._searchInput.id}"]`);e&&X(e)}this._hiddenInput=null,this._config.hiddenInput&&(this._hiddenInput=document.createElement("input"),this._hiddenInput.type="hidden",this._hiddenInput.value=this._config.hiddenValue,this._hiddenInput.name=this._searchInput.name,this._searchInput.name="_"+this._searchInput.name,D(this._searchInput,this._hiddenInput))}_configureDropElement(){this._dropElement=document.createElement("ul"),this._dropElement.id="ac-menu-"+k,this._dropElement.classList.add("dropdown-menu","autocomplete-menu","p-0"),this._dropElement.style.maxHeight="280px",this._config.fullWidth||(this._dropElement.style.maxWidth="360px"),this._config.fixed&&(this._dropElement.style.position="fixed"),this._dropElement.style.overflowY="auto",this._dropElement.style.overscrollBehavior="contain",this._dropElement.style.textAlign="unset",D(this._searchInput,this._dropElement),this._searchInput.setAttribute("aria-controls",this._dropElement.id)}onclick(e){e.target.matches(this._config.clearControl)&&this.clear()}oninput(e){this._preventInput||(this._hiddenInput&&(this._hiddenInput.value=null),this.showOrSearch())}onchange(e){const t=this._searchInput.value,s=Object.values(this._items).find(i=>i.label===t);this._config.onChange(s,this)}onblur(e){this.hideSuggestions()}onfocus(e){this.showOrSearch()}onkeydown(e){switch(e.keyCode||e.key){case 13:case"Enter":if(this.isDropdownVisible()){const s=this.getSelection();s&&s.click(),(s||!this._config.ignoreEnter)&&e.preventDefault()}break;case 38:case"ArrowUp":e.preventDefault(),this._keyboardNavigation=!0,this._moveSelection(v);break;case 40:case"ArrowDown":e.preventDefault(),this._keyboardNavigation=!0,this.isDropdownVisible()?this._moveSelection(_):this.showOrSearch(!1);break;case 27:case"Escape":this.isDropdownVisible()&&(this._searchInput.focus(),this.hideSuggestions());break}}onmousemove(e){this._keyboardNavigation=!1}onmouseleave(e){this.removeSelection()}onscroll(e){this._positionMenu()}onresize(e){this._positionMenu()}getConfig(e=null){return e!==null?this._config[e]:this._config}setConfig(e,t){this._config[e]=t}setData(e){this._items={},this._addItems(e)}enable(){this._searchInput.setAttribute("disabled","")}disable(){this._searchInput.removeAttribute("disabled")}isDisabled(){return this._searchInput.hasAttribute("disabled")||this._searchInput.disabled||this._searchInput.hasAttribute("readonly")}isDropdownVisible(){return this._dropElement.classList.contains(f)}clear(){this._searchInput.value="",this._hiddenInput&&(this._hiddenInput.value="")}getSelection(){return this._dropElement.querySelector("a."+L)}removeSelection(){const e=this.getSelection();e&&e.classList.remove(...this._activeClasses())}_activeClasses(){return[...this._config.activeClasses,L]}_isItemEnabled(e){if(e.style.display==="none")return!1;const t=e.firstElementChild;return t.tagName==="A"&&!t.classList.contains("disabled")}_moveSelection(e=_,t=null){const s=this.getSelection();if(s){const i=e===_?"nextSibling":"previousSibling";t=s.parentNode;do t=t[i];while(t&&!this._isItemEnabled(t));t?(s.classList.remove(...this._activeClasses()),e===v?t.parentNode.scrollTop=t.offsetTop-t.parentNode.offsetTop:t.offsetTop>t.parentNode.offsetHeight-t.offsetHeight&&(t.parentNode.scrollTop+=t.offsetHeight)):s&&(t=s.parentElement)}else{if(e===v)return t;if(!t)for(t=this._dropElement.firstChild;t&&!this._isItemEnabled(t);)t=t.nextSibling}if(t){const i=t.querySelector("a");i.classList.add(...this._activeClasses()),this._searchInput.setAttribute("aria-activedescendant",i.id),this._config.updateOnSelect&&(this._searchInput.value=i.dataset.label)}else this._searchInput.setAttribute("aria-activedescendant","");return t}_shouldShow(){return this.isDisabled()?!1:this._searchInput.value.length>=this._config.suggestionsThreshold}showOrSearch(e=!0){if(e&&!this._shouldShow()){this.hideSuggestions();return}this._config.liveServer?this._searchFunc():this._config.source?this._config.source(this._searchInput.value,t=>{this.setData(t),this._showSuggestions()}):this._showSuggestions()}_createGroup(e){const t=this._createLi(),s=document.createElement("span");return t.append(s),s.classList.add("dropdown-header","text-truncate"),s.innerHTML=e,t}_createItem(e,t){let s=t.label;if(this._config.highlightTyped){const a=y(s).indexOf(e);s=s.substring(0,a)+`<mark class="${this._config.highlightClass}">${s.substring(a,a+e.length)}</mark>`+s.substring(a+e.length,s.length)}s=this._config.onRenderItem(t,s,this);const i=this._createLi(),o=document.createElement("a");if(i.append(o),o.id=this._dropElement.id+"-"+this._dropElement.children.length,o.classList.add("dropdown-item","text-truncate"),this._config.itemClass&&o.classList.add(...this._config.itemClass.split(" ")),o.setAttribute("data-value",t.value),o.setAttribute("data-label",t.label),o.setAttribute("tabindex","-1"),o.setAttribute("role","menuitem"),o.setAttribute("href","#"),o.innerHTML=s,t.data)for(const[a,r]of Object.entries(t.data))o.dataset[a]=r;return o.addEventListener("mouseenter",a=>{this._keyboardNavigation||(this.removeSelection(),i.querySelector("a").classList.add(...this._activeClasses()))}),o.addEventListener("mousedown",a=>{a.preventDefault()}),o.addEventListener("click",a=>{a.preventDefault(),this._preventInput=!0,this._searchInput.value=J(t.label),this._hiddenInput&&(this._hiddenInput.value=t.value),this._config.onSelectItem(t,this),this.hideSuggestions(),this._preventInput=!1}),i}_showSuggestions(){if(document.activeElement!=this._searchInput)return;const e=y(this._searchInput.value);this._dropElement.innerHTML="";const t=Object.keys(this._items);let s=0,i=null;const o=[];for(let a=0;a<t.length;a++){const r=t[a],c=this._items[r],u=this._config.showAllSuggestions||e.length===0;let l=e.length==0&&this._config.suggestionsThreshold===0;!u&&e.length>0&&this._config.searchFields.forEach(d=>{const p=y(c[d]);let m=!1;if(this._config.fuzzy)m=K(p,e);else{const E=p.indexOf(e);m=this._config.startsWith?E===0:E>=0}m&&(l=!0)});const F=l||e.length===0;if(u||l){if(s++,c.group&&!o.includes(c.group)){const p=this._createGroup(c.group);this._dropElement.appendChild(p),o.push(c.group)}const d=this._createItem(e,c);if(!i&&F&&(i=d),this._dropElement.appendChild(d),this._config.maximumItems>0&&s>=this._config.maximumItems)break}}if(i&&this._config.autoselectFirst&&(this.removeSelection(),this._moveSelection(_,i)),s===0)if(this._config.notFoundMessage){const a=this._createLi();a.innerHTML=`<span class="dropdown-item">${this._config.notFoundMessage}</span>`,this._dropElement.appendChild(a),this._showDropdown()}else this.hideSuggestions();else this._showDropdown()}_createLi(){const e=document.createElement("li");return e.setAttribute("role","presentation"),e}_showDropdown(){this._dropElement.classList.add(f),this._dropElement.setAttribute("role","menu"),w(this._searchInput,{"aria-expanded":"true"}),this._positionMenu()}toggleSuggestions(e=!0){this._dropElement.classList.contains(f)?this.hideSuggestions():this.showOrSearch(e)}hideSuggestions(){this._dropElement.classList.remove(f),w(this._searchInput,{"aria-expanded":"false"}),this.removeSelection()}getInput(){return this._searchInput}getDropMenu(){return this._dropElement}_positionMenu(){const e=window.getComputedStyle(this._searchInput),t=this._searchInput.getBoundingClientRect(),s=e.direction==="rtl",i=this._config.fullWidth,o=this._config.fixed;let a=null,r=null;o&&(a=t.x,r=t.y+t.height,s&&!i&&(a-=this._dropElement.offsetWidth-t.width)),this._dropElement.style.transform="unset",i&&(this._dropElement.style.width=this._searchInput.offsetWidth+"px"),a!==null&&(this._dropElement.style.left=a+"px"),r!==null&&(this._dropElement.style.top=r+"px");const c=this._dropElement.getBoundingClientRect(),u=window.innerHeight;if(c.y+c.height>u){const l=i?t.height+4:t.height;this._dropElement.style.transform="translateY(calc(-100.1% - "+l+"px))"}}_fetchData(){this._items={},this._addItems(this._config.items);const e=this._config.datalist;if(e){const t=document.querySelector(`#${e}`);if(t){const s=Array.from(t.children).map(i=>{const o=i.getAttribute("value")??i.innerHTML.toLowerCase(),a=i.innerHTML;return{value:o,label:a}});this._addItems(s)}else console.error(`Datalist not found ${e}`)}this._setHiddenVal(),this._config.server&&!this._config.liveServer&&this._loadFromServer()}_setHiddenVal(){if(this._config.hiddenInput&&!this._config.hiddenValue)for(const[e,t]of Object.entries(this._items))t.label==this._searchInput.value&&(this._hiddenInput.value=e)}_addItems(e){const t=Object.keys(e);for(let s=0;s<t.length;s++){const i=t[s],o=e[i];if(o.group&&o.items){o.items.forEach(c=>c.group=o.group),this._addItems(o.items);continue}const a=typeof o=="string"?o:o.label,r=typeof o!="object"?{}:o;r.label=o[this._config.labelField]??a,r.value=o[this._config.valueField]??i,r.label&&(this._items[r.value]=r)}}_loadFromServer(e=!1){this._abortController&&this._abortController.abort(),this._abortController=new AbortController;let t=this._searchInput.dataset.serverParams||{};typeof t=="string"&&(t=JSON.parse(t));const s=Object.assign({},this._config.serverParams,t);if(s[this._config.queryParam]=this._searchInput.value,this._config.noCache&&(s.t=Date.now()),s.related){const r=document.getElementById(s.related);if(r){s.related=r.value;const c=r.getAttribute("name");c&&(s[c]=r.value)}}const i=new URLSearchParams(s);let o=this._config.server,a=Object.assign(this._config.fetchOptions,{method:this._config.serverMethod||"GET",signal:this._abortController.signal});a.method==="POST"?a.body=i:o+="?"+i.toString(),this._searchInput.classList.add(x),fetch(o,a).then(r=>this._config.onServerResponse(r,this)).then(r=>{const c=r[this._config.serverDataKey]||r;this.setData(c),this._setHiddenVal(),this._abortController=null,e&&this._showSuggestions()}).catch(r=>{r.name==="AbortError"||this._abortController.signal.aborted||console.error(r)}).finally(r=>{this._searchInput.classList.remove(x)})}}class Y{post(e){let t="/api/v2/transactions";return P.post(t,e)}}let h;const S={description:"/api/v2/autocomplete/transaction-descriptions",account:"/api/v2/autocomplete/accounts"};let Q=function(){return{count:0,totalAmount:0,transactionType:"unknown",showSuccessMessage:!1,showErrorMessage:!1,entries:[],filters:{source:[],destination:[]},detectTransactionType(){const n=this.entries[0].source_account.type??"unknown",e=this.entries[0].destination_account.type??"unknown";if(n==="unknown"&&e==="unknown"){this.transactionType="unknown",console.warn("Cannot infer transaction type from two unknown accounts.");return}if(n===e&&["Asset account","Loan","Debt","Mortgage"].includes(n)){this.transactionType="transfer",console.log('Transaction type is detected to be "'+this.transactionType+'".');return}if(n==="Asset account"&&["Expense account","Debt","Loan","Mortgage"].includes(e)){this.transactionType="withdrawal",console.log('Transaction type is detected to be "'+this.transactionType+'".');return}if(n==="Asset account"&&e==="unknown"){this.transactionType="withdrawal",console.log('Transaction type is detected to be "'+this.transactionType+'".');return}if(["Debt","Loan","Mortgage"].includes(n)&&e==="Expense account"){this.transactionType="withdrawal",console.log('Transaction type is detected to be "'+this.transactionType+'".');return}if(n==="Revenue account"&&["Asset account","Debt","Loan","Mortgage"].includes(e)){this.transactionType="deposit",console.log('Transaction type is detected to be "'+this.transactionType+'".');return}if(["Debt","Loan","Mortgage"].includes(n)&&e==="Asset account"){this.transactionType="deposit",console.log('Transaction type is detected to be "'+this.transactionType+'".');return}console.warn('Unknown account combination between "'+n+'" and "'+e+'".')},selectSourceAccount(n,e){const t=parseInt(e._searchInput.attributes["data-index"].value);document.querySelector("#form")._x_dataStack[0].$data.entries[t].source_account={id:n.id,name:n.name,type:n.type},console.log("Changed source account into a known "+n.type.toLowerCase())},changedAmount(n){const e=parseInt(n.target.dataset.index);this.entries[e].amount=parseFloat(n.target.value),this.totalAmount=0;for(let t in this.entries)this.entries.hasOwnProperty(t)&&(this.totalAmount=this.totalAmount+parseFloat(this.entries[t].amount));console.log("Changed amount to "+this.totalAmount)},selectDestAccount(n,e){const t=parseInt(e._searchInput.attributes["data-index"].value);document.querySelector("#form")._x_dataStack[0].$data.entries[t].destination_account={id:n.id,name:n.name,type:n.type},console.log("Changed destination account into a known "+n.type.toLowerCase())},changeSourceAccount(n,e){if(typeof n>"u"){const t=parseInt(e._searchInput.attributes["data-index"].value);if(document.querySelector("#form")._x_dataStack[0].$data.entries[t].source_account.name===e._searchInput.value){console.warn('Ignore hallucinated source account name change to "'+e._searchInput.value+'"');return}document.querySelector("#form")._x_dataStack[0].$data.entries[t].source_account={name:e._searchInput.value},console.log('Changed source account into a unknown account called "'+e._searchInput.value+'"')}},changeDestAccount(n,e){if(typeof n>"u"){const t=parseInt(e._searchInput.attributes["data-index"].value);if(document.querySelector("#form")._x_dataStack[0].$data.entries[t].destination_account.name===e._searchInput.value){console.warn('Ignore hallucinated destination account name change to "'+e._searchInput.value+'"');return}document.querySelector("#form")._x_dataStack[0].$data.entries[t].destination_account={name:e._searchInput.value},console.log('Changed destination account into a unknown account called "'+e._searchInput.value+'"')}},showError:!1,showSuccess:!1,addedSplit(){console.log("addedSplit"),I.init("input.ac-source",{server:S.account,serverParams:{types:this.filters.source},fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}},hiddenInput:!0,preventBrowserAutocomplete:!0,highlightTyped:!0,liveServer:!0,onChange:this.changeSourceAccount,onSelectItem:this.selectSourceAccount,onRenderItem:function(n,e,t){return n.name_with_balance+'<br><small class="text-muted">'+h.t("firefly.account_type_"+n.type)+"</small>"}}),I.init("input.ac-dest",{server:S.account,serverParams:{types:this.filters.destination},fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}},hiddenInput:!0,preventBrowserAutocomplete:!0,liveServer:!0,highlightTyped:!0,onSelectItem:this.selectDestAccount,onChange:this.changeDestAccount,onRenderItem:function(n,e,t){return n.name_with_balance+'<br><small class="text-muted">'+h.t("firefly.account_type_"+n.type)+"</small>"}}),this.filters.destination=[],I.init("input.ac-description",{server:S.description,fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}},valueField:"id",labelField:"description",highlightTyped:!0,onSelectItem:console.log})},init(){Promise.all([R("language","en_US")]).then(n=>{h=new z;const e=n[0].replace("-","_");h.locale=e,$(h,e).then(()=>{this.addSplit()})}),this.filters.source=["Asset account","Loan","Debt","Mortgage","Revenue account"],this.filters.destination=["Expense account","Loan","Debt","Mortgage","Asset account"]},submitTransaction(){this.detectTransactionType();let n=W(this.entries,this.transactionType),e={group_title:null,fire_webhooks:!1,apply_rules:!1,transactions:n};n.length>1&&(e.group_title=n[0].description);let t=new Y;console.log(e),t.post(e).then(s=>{this.showSuccessMessage=!0,console.log(s),window.location="transactions/show/"+s.data.data.id+"?transaction_group_id="+s.data.data.id+"&message=created"}).catch(s=>{this.showErrorMessage=!0,console.error(s)})},addSplit(){this.entries.push(B())},removeSplit(n){this.entries.splice(n,1),document.querySelector("#split-0-tab").click()},formattedTotalAmount(){return V(this.totalAmount,"EUR")}}},O={transactions:Q,dates:j};function M(){Object.keys(O).forEach(n=>{console.log(`Loading page component "${n}"`);let e=O[n]();Alpine.data(n,()=>e)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),M()});window.bootstrapped&&(console.log("Loaded through window variable."),M());diff --git a/public/build/assets/dashboard-daa2fdbe.js b/public/build/assets/dashboard-42661760.jssimilarity index 96%rename from public/build/assets/dashboard-daa2fdbe.jsrename to public/build/assets/dashboard-42661760.jsindex 08df6f886b..f275765ec7 100644--- a/public/build/assets/dashboard-daa2fdbe.js+++ b/public/build/assets/dashboard-42661760.js@@ -1,4 +1,4 @@-var Sa=Object.defineProperty;var Oa=(n,t,e)=>t in n?Sa(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var k=(n,t,e)=>(Oa(n,typeof t!="symbol"?t+"":t,e),e);import{r as z,a as ai,t as wt,s as Yi,g as ji,b as ls,c as mr,d as j,e as br,f as yr,_ as an,h as Aa,i as Ui,j as _r,k as La,l as Ra,m as xr,n as Fa,o as Os,p as Ia,q as As,u as Ea,v as za,w as vt,x as J,y as V,z as bt,P as Ba,I as li,A as ci,B as Na,C as Wa,D as Ha,E as Va,F as Ls,G as Ya,H as ja,J as Ua}from"./load-translations-9a154502.js";var $a=36e5;function qa(n,t){z(2,arguments);var e=wt(t);return ai(n,e*$a)}var Xa=864e5;function Ka(n,t){z(2,arguments);var e=Yi(n),i=Yi(t),s=e.getTime()-ji(e),o=i.getTime()-ji(i);return Math.round((s-o)/Xa)}var Ga=6e4;function Qa(n,t){z(2,arguments);var e=wt(t);return ai(n,e*Ga)}function Za(n,t){z(2,arguments);var e=wt(t),i=e*3;return ls(n,i)}function Ja(n,t){z(2,arguments);var e=wt(t);return ai(n,e*1e3)}function tl(n,t){z(2,arguments);var e=wt(t),i=e*7;return mr(n,i)}function el(n,t){z(2,arguments);var e=wt(t);return ls(n,e*12)}function tn(n,t){z(2,arguments);var e=j(n),i=j(t),s=e.getTime()-i.getTime();return s<0?-1:s>0?1:s}var ui=6e4,hi=36e5,nl=1e3;function il(n,t){z(2,arguments);var e=j(n),i=j(t),s=e.getFullYear()-i.getFullYear(),o=e.getMonth()-i.getMonth();return s*12+o}function sl(n,t){z(2,arguments);var e=j(n),i=j(t);return e.getFullYear()-i.getFullYear()}function Rs(n,t){var e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function vr(n,t){z(2,arguments);var e=j(n),i=j(t),s=Rs(e,i),o=Math.abs(Ka(e,i));e.setDate(e.getDate()-s*o);var r=+(Rs(e,i)===-s),a=s*(o-r);return a===0?0:a}function di(n,t){return z(2,arguments),j(n).getTime()-j(t).getTime()}var Fs={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},ol="trunc";function bn(n){return n?Fs[n]:Fs[ol]}function rl(n,t,e){z(2,arguments);var i=di(n,t)/hi;return bn(e==null?void 0:e.roundingMethod)(i)}function al(n,t,e){z(2,arguments);var i=di(n,t)/ui;return bn(e==null?void 0:e.roundingMethod)(i)}function ll(n){z(1,arguments);var t=j(n);return br(t).getTime()===yr(t).getTime()}function wr(n,t){z(2,arguments);var e=j(n),i=j(t),s=tn(e,i),o=Math.abs(il(e,i)),r;if(o<1)r=0;else{e.getMonth()===1&&e.getDate()>27&&e.setDate(30),e.setMonth(e.getMonth()-s*o);var a=tn(e,i)===-s;ll(j(n))&&o===1&&tn(n,i)===1&&(a=!1),r=s*(o-Number(a))}return r===0?0:r}function cl(n,t,e){z(2,arguments);var i=wr(n,t)/3;return bn(e==null?void 0:e.roundingMethod)(i)}function ul(n,t,e){z(2,arguments);var i=di(n,t)/1e3;return bn(e==null?void 0:e.roundingMethod)(i)}function hl(n,t,e){z(2,arguments);var i=vr(n,t)/7;return bn(e==null?void 0:e.roundingMethod)(i)}function dl(n,t){z(2,arguments);var e=j(n),i=j(t),s=tn(e,i),o=Math.abs(sl(e,i));e.setFullYear(1584),i.setFullYear(1584);var r=tn(e,i)===-s,a=s*(o-Number(r));return a===0?0:a}function fl(n){z(1,arguments);var t=j(n);return t.setSeconds(0,0),t}function gl(n){z(1,arguments);var t=j(n),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function pl(n){z(1,arguments);var t=j(n);return t.setMinutes(59,59,999),t}function ml(n){z(1,arguments);var t=j(n);return t.setSeconds(59,999),t}function bl(n){z(1,arguments);var t=j(n);return t.setMilliseconds(999),t}function yl(n,t){if(n==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}function Is(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e<t;e++)i[e]=n[e];return i}function _l(n,t){if(n){if(typeof n=="string")return Is(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);if(e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set")return Array.from(n);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Is(n,t)}}function Es(n,t){var e=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=_l(n))||t&&n&&typeof n.length=="number"){e&&(n=e);var i=0,s=function(){};return{s,n:function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(c){throw c},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.+var Sa=Object.defineProperty;var Oa=(n,t,e)=>t in n?Sa(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var k=(n,t,e)=>(Oa(n,typeof t!="symbol"?t+"":t,e),e);import{r as z,a as ai,t as wt,s as Yi,g as ji,b as ls,c as mr,d as j,e as br,f as yr,_ as an,h as Aa,i as Ui,j as _r,k as La,l as Ra,m as xr,n as Fa,o as Os,p as Ia,q as As,u as Ea,v as za,w as vt,x as J,y as V,z as bt,P as Ba,I as li,A as ci,B as Na,C as Wa,D as Ha,E as Va,F as Ls,G as Ya,H as ja,J as Ua}from"./load-translations-87b32220.js";var $a=36e5;function qa(n,t){z(2,arguments);var e=wt(t);return ai(n,e*$a)}var Xa=864e5;function Ka(n,t){z(2,arguments);var e=Yi(n),i=Yi(t),s=e.getTime()-ji(e),o=i.getTime()-ji(i);return Math.round((s-o)/Xa)}var Ga=6e4;function Qa(n,t){z(2,arguments);var e=wt(t);return ai(n,e*Ga)}function Za(n,t){z(2,arguments);var e=wt(t),i=e*3;return ls(n,i)}function Ja(n,t){z(2,arguments);var e=wt(t);return ai(n,e*1e3)}function tl(n,t){z(2,arguments);var e=wt(t),i=e*7;return mr(n,i)}function el(n,t){z(2,arguments);var e=wt(t);return ls(n,e*12)}function tn(n,t){z(2,arguments);var e=j(n),i=j(t),s=e.getTime()-i.getTime();return s<0?-1:s>0?1:s}var ui=6e4,hi=36e5,nl=1e3;function il(n,t){z(2,arguments);var e=j(n),i=j(t),s=e.getFullYear()-i.getFullYear(),o=e.getMonth()-i.getMonth();return s*12+o}function sl(n,t){z(2,arguments);var e=j(n),i=j(t);return e.getFullYear()-i.getFullYear()}function Rs(n,t){var e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function vr(n,t){z(2,arguments);var e=j(n),i=j(t),s=Rs(e,i),o=Math.abs(Ka(e,i));e.setDate(e.getDate()-s*o);var r=+(Rs(e,i)===-s),a=s*(o-r);return a===0?0:a}function di(n,t){return z(2,arguments),j(n).getTime()-j(t).getTime()}var Fs={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},ol="trunc";function bn(n){return n?Fs[n]:Fs[ol]}function rl(n,t,e){z(2,arguments);var i=di(n,t)/hi;return bn(e==null?void 0:e.roundingMethod)(i)}function al(n,t,e){z(2,arguments);var i=di(n,t)/ui;return bn(e==null?void 0:e.roundingMethod)(i)}function ll(n){z(1,arguments);var t=j(n);return br(t).getTime()===yr(t).getTime()}function wr(n,t){z(2,arguments);var e=j(n),i=j(t),s=tn(e,i),o=Math.abs(il(e,i)),r;if(o<1)r=0;else{e.getMonth()===1&&e.getDate()>27&&e.setDate(30),e.setMonth(e.getMonth()-s*o);var a=tn(e,i)===-s;ll(j(n))&&o===1&&tn(n,i)===1&&(a=!1),r=s*(o-Number(a))}return r===0?0:r}function cl(n,t,e){z(2,arguments);var i=wr(n,t)/3;return bn(e==null?void 0:e.roundingMethod)(i)}function ul(n,t,e){z(2,arguments);var i=di(n,t)/1e3;return bn(e==null?void 0:e.roundingMethod)(i)}function hl(n,t,e){z(2,arguments);var i=vr(n,t)/7;return bn(e==null?void 0:e.roundingMethod)(i)}function dl(n,t){z(2,arguments);var e=j(n),i=j(t),s=tn(e,i),o=Math.abs(sl(e,i));e.setFullYear(1584),i.setFullYear(1584);var r=tn(e,i)===-s,a=s*(o-Number(r));return a===0?0:a}function fl(n){z(1,arguments);var t=j(n);return t.setSeconds(0,0),t}function gl(n){z(1,arguments);var t=j(n),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function pl(n){z(1,arguments);var t=j(n);return t.setMinutes(59,59,999),t}function ml(n){z(1,arguments);var t=j(n);return t.setSeconds(59,999),t}function bl(n){z(1,arguments);var t=j(n);return t.setMilliseconds(999),t}function yl(n,t){if(n==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}function Is(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e<t;e++)i[e]=n[e];return i}function _l(n,t){if(n){if(typeof n=="string")return Is(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);if(e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set")return Array.from(n);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Is(n,t)}}function Es(n,t){var e=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=_l(n))||t&&n&&typeof n.length=="number"){e&&(n=e);var i=0,s=function(){};return{s,n:function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(c){throw c},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,r=!1,a;return{s:function(){e=e.call(n)},n:function(){var c=e.next();return o=c.done,c},e:function(c){r=!0,a=c},f:function(){try{!o&&e.return!=null&&e.return()}finally{if(r)throw a}}}}function D(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function $i(n,t){return $i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,s){return i.__proto__=s,i},$i(n,t)}function B(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&$i(n,t)}function Gn(n){return Gn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gn(n)}function xl(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vl(n,t){if(t&&(an(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return D(n)}function N(n){var t=xl();return function(){var i=Gn(n),s;if(t){var o=Gn(this).constructor;s=Reflect.construct(i,arguments,o)}else s=i.apply(this,arguments);return vl(this,s)}}function I(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function wl(n,t){if(an(n)!=="object"||n===null)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var i=e.call(n,t||"default");if(an(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function Mr(n){var t=wl(n,"string");return an(t)==="symbol"?t:String(t)}function zs(n,t){for(var e=0;e<t.length;e++){var i=t[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,Mr(i.key),i)}}function E(n,t,e){return t&&zs(n.prototype,t),e&&zs(n,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function P(n,t,e){return t=Mr(t),t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}var Ml=10,kr=function(){function n(){I(this,n),P(this,"priority",void 0),P(this,"subPriority",0)}return E(n,[{key:"validate",value:function(e,i){return!0}}]),n}(),kl=function(n){B(e,n);var t=N(e);function e(i,s,o,r,a){var l;return I(this,e),l=t.call(this),l.value=i,l.validateValue=s,l.setValue=o,l.priority=r,a&&(l.subPriority=a),l}return E(e,[{key:"validate",value:function(s,o){return this.validateValue(s,this.value,o)}},{key:"set",value:function(s,o,r){return this.setValue(s,o,this.value,r)}}]),e}(kr),Cl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",Ml),P(D(i),"subPriority",-1),i}return E(e,[{key:"set",value:function(s,o){if(o.timestampIsSet)return s;var r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}}]),e}(kr),Y=function(){function n(){I(this,n),P(this,"incompatibleTokens",void 0),P(this,"priority",void 0),P(this,"subPriority",void 0)}return E(n,[{key:"run",value:function(e,i,s,o){var r=this.parse(e,i,s,o);return r?{setter:new kl(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}},{key:"validate",value:function(e,i,s){return!0}}]),n}(),Pl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",140),P(D(i),"incompatibleTokens",["R","u","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){switch(o){case"G":case"GG":case"GGG":return r.era(s,{width:"abbreviated"})||r.era(s,{width:"narrow"});case"GGGGG":return r.era(s,{width:"narrow"});case"GGGG":default:return r.era(s,{width:"wide"})||r.era(s,{width:"abbreviated"})||r.era(s,{width:"narrow"})}}},{key:"set",value:function(s,o,r){return o.era=r,s.setUTCFullYear(r,0,1),s.setUTCHours(0,0,0,0),s}}]),e}(Y),ot={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Et={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function rt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Z(n,t){var e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function zt(n,t){var e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};var i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,o=e[3]?parseInt(e[3],10):0,r=e[5]?parseInt(e[5],10):0;return{value:i*(s*hi+o*ui+r*nl),rest:t.slice(e[0].length)}}function Cr(n){return Z(ot.anyDigitsSigned,n)}function it(n,t){switch(n){case 1:return Z(ot.singleDigit,t);case 2:return Z(ot.twoDigits,t);case 3:return Z(ot.threeDigits,t);case 4:return Z(ot.fourDigits,t);default:return Z(new RegExp("^\\d{1,"+n+"}"),t)}}function Qn(n,t){switch(n){case 1:return Z(ot.singleDigitSigned,t);case 2:return Z(ot.twoDigitsSigned,t);case 3:return Z(ot.threeDigitsSigned,t);case 4:return Z(ot.fourDigitsSigned,t);default:return Z(new RegExp("^-?\\d{1,"+n+"}"),t)}}function cs(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Pr(n,t){var e=t>0,i=e?t:1-t,s;if(i<=50)s=n||100;else{var o=i+50,r=Math.floor(o/100)*100,a=n>=o%100;s=n+r-(a?100:0)}return e?s:1-s}function Dr(n){return n%400===0||n%4===0&&n%100!==0}var Dl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",130),P(D(i),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){var a=function(c){return{year:c,isTwoDigitYear:o==="yy"}};switch(o){case"y":return rt(it(4,s),a);case"yo":return rt(r.ordinalNumber(s,{unit:"year"}),a);default:return rt(it(o.length,s),a)}}},{key:"validate",value:function(s,o){return o.isTwoDigitYear||o.year>0}},{key:"set",value:function(s,o,r){var a=s.getUTCFullYear();if(r.isTwoDigitYear){var l=Pr(r.year,a);return s.setUTCFullYear(l,0,1),s.setUTCHours(0,0,0,0),s}var c=!("era"in o)||o.era===1?r.year:1-r.year;return s.setUTCFullYear(c,0,1),s.setUTCHours(0,0,0,0),s}}]),e}(Y),Tl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",130),P(D(i),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){var a=function(c){return{year:c,isTwoDigitYear:o==="YY"}};switch(o){case"Y":return rt(it(4,s),a);case"Yo":return rt(r.ordinalNumber(s,{unit:"year"}),a);default:return rt(it(o.length,s),a)}}},{key:"validate",value:function(s,o){return o.isTwoDigitYear||o.year>0}},{key:"set",value:function(s,o,r,a){var l=Aa(s,a);if(r.isTwoDigitYear){var c=Pr(r.year,l);return s.setUTCFullYear(c,0,a.firstWeekContainsDate),s.setUTCHours(0,0,0,0),Ui(s,a)}var u=!("era"in o)||o.era===1?r.year:1-r.year;return s.setUTCFullYear(u,0,a.firstWeekContainsDate),s.setUTCHours(0,0,0,0),Ui(s,a)}}]),e}(Y),Sl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",130),P(D(i),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),i}return E(e,[{key:"parse",value:function(s,o){return Qn(o==="R"?4:o.length,s)}},{key:"set",value:function(s,o,r){var a=new Date(0);return a.setUTCFullYear(r,0,4),a.setUTCHours(0,0,0,0),_r(a)}}]),e}(Y),Ol=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",130),P(D(i),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),i}return E(e,[{key:"parse",value:function(s,o){return Qn(o==="u"?4:o.length,s)}},{key:"set",value:function(s,o,r){return s.setUTCFullYear(r,0,1),s.setUTCHours(0,0,0,0),s}}]),e}(Y),Al=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",120),P(D(i),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){switch(o){case"Q":case"QQ":return it(o.length,s);case"Qo":return r.ordinalNumber(s,{unit:"quarter"});case"QQQ":return r.quarter(s,{width:"abbreviated",context:"formatting"})||r.quarter(s,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(s,{width:"wide",context:"formatting"})||r.quarter(s,{width:"abbreviated",context:"formatting"})||r.quarter(s,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(s,o){return o>=1&&o<=4}},{key:"set",value:function(s,o,r){return s.setUTCMonth((r-1)*3,1),s.setUTCHours(0,0,0,0),s}}]),e}(Y),Ll=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",120),P(D(i),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){switch(o){case"q":case"qq":return it(o.length,s);case"qo":return r.ordinalNumber(s,{unit:"quarter"});case"qqq":return r.quarter(s,{width:"abbreviated",context:"standalone"})||r.quarter(s,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(s,{width:"wide",context:"standalone"})||r.quarter(s,{width:"abbreviated",context:"standalone"})||r.quarter(s,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(s,o){return o>=1&&o<=4}},{key:"set",value:function(s,o,r){return s.setUTCMonth((r-1)*3,1),s.setUTCHours(0,0,0,0),s}}]),e}(Y),Rl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),P(D(i),"priority",110),i}return E(e,[{key:"parse",value:function(s,o,r){var a=function(c){return c-1};switch(o){case"M":return rt(Z(ot.month,s),a);case"MM":return rt(it(2,s),a);case"Mo":return rt(r.ordinalNumber(s,{unit:"month"}),a);case"MMM":return r.month(s,{width:"abbreviated",context:"formatting"})||r.month(s,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(s,{width:"wide",context:"formatting"})||r.month(s,{width:"abbreviated",context:"formatting"})||r.month(s,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(s,o){return o>=0&&o<=11}},{key:"set",value:function(s,o,r){return s.setUTCMonth(r,1),s.setUTCHours(0,0,0,0),s}}]),e}(Y),Fl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",110),P(D(i),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){var a=function(c){return c-1};switch(o){case"L":return rt(Z(ot.month,s),a);case"LL":return rt(it(2,s),a);case"Lo":return rt(r.ordinalNumber(s,{unit:"month"}),a);case"LLL":return r.month(s,{width:"abbreviated",context:"standalone"})||r.month(s,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(s,{width:"wide",context:"standalone"})||r.month(s,{width:"abbreviated",context:"standalone"})||r.month(s,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(s,o){return o>=0&&o<=11}},{key:"set",value:function(s,o,r){return s.setUTCMonth(r,1),s.setUTCHours(0,0,0,0),s}}]),e}(Y);function Il(n,t,e){z(2,arguments);var i=j(n),s=wt(t),o=La(i,e)-s;return i.setUTCDate(i.getUTCDate()-o*7),i}var El=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",100),P(D(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){switch(o){case"w":return Z(ot.week,s);case"wo":return r.ordinalNumber(s,{unit:"week"});default:return it(o.length,s)}}},{key:"validate",value:function(s,o){return o>=1&&o<=53}},{key:"set",value:function(s,o,r,a){return Ui(Il(s,r,a),a)}}]),e}(Y);function zl(n,t){z(2,arguments);var e=j(n),i=wt(t),s=Ra(e)-i;return e.setUTCDate(e.getUTCDate()-s*7),e}var Bl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",100),P(D(i),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){switch(o){case"I":return Z(ot.week,s);case"Io":return r.ordinalNumber(s,{unit:"week"});default:return it(o.length,s)}}},{key:"validate",value:function(s,o){return o>=1&&o<=53}},{key:"set",value:function(s,o,r){return _r(zl(s,r))}}]),e}(Y),Nl=[31,28,31,30,31,30,31,31,30,31,30,31],Wl=[31,29,31,30,31,30,31,31,30,31,30,31],Hl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",90),P(D(i),"subPriority",1),P(D(i),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){switch(o){case"d":return Z(ot.date,s);case"do":return r.ordinalNumber(s,{unit:"date"});default:return it(o.length,s)}}},{key:"validate",value:function(s,o){var r=s.getUTCFullYear(),a=Dr(r),l=s.getUTCMonth();return a?o>=1&&o<=Wl[l]:o>=1&&o<=Nl[l]}},{key:"set",value:function(s,o,r){return s.setUTCDate(r),s.setUTCHours(0,0,0,0),s}}]),e}(Y),Vl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",90),P(D(i),"subpriority",1),P(D(i),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){switch(o){case"D":case"DD":return Z(ot.dayOfYear,s);case"Do":return r.ordinalNumber(s,{unit:"date"});default:return it(o.length,s)}}},{key:"validate",value:function(s,o){var r=s.getUTCFullYear(),a=Dr(r);return a?o>=1&&o<=366:o>=1&&o<=365}},{key:"set",value:function(s,o,r){return s.setUTCMonth(0,r),s.setUTCHours(0,0,0,0),s}}]),e}(Y);function us(n,t,e){var i,s,o,r,a,l,c,u;z(2,arguments);var h=xr(),d=wt((i=(s=(o=(r=e==null?void 0:e.weekStartsOn)!==null&&r!==void 0?r:e==null||(a=e.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&o!==void 0?o:h.weekStartsOn)!==null&&s!==void 0?s:(c=h.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&i!==void 0?i:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=j(n),g=wt(t),p=f.getUTCDay(),m=g%7,b=(m+7)%7,y=(b<d?7:0)+g-p;return f.setUTCDate(f.getUTCDate()+y),f}var Yl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",90),P(D(i),"incompatibleTokens",["D","i","e","c","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){switch(o){case"E":case"EE":case"EEE":return r.day(s,{width:"abbreviated",context:"formatting"})||r.day(s,{width:"short",context:"formatting"})||r.day(s,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(s,{width:"short",context:"formatting"})||r.day(s,{width:"narrow",context:"formatting"});case"EEEE":default:return r.day(s,{width:"wide",context:"formatting"})||r.day(s,{width:"abbreviated",context:"formatting"})||r.day(s,{width:"short",context:"formatting"})||r.day(s,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(s,o){return o>=0&&o<=6}},{key:"set",value:function(s,o,r,a){return s=us(s,r,a),s.setUTCHours(0,0,0,0),s}}]),e}(Y),jl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",90),P(D(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r,a){var l=function(u){var h=Math.floor((u-1)/7)*7;return(u+a.weekStartsOn+6)%7+h};switch(o){case"e":case"ee":return rt(it(o.length,s),l);case"eo":return rt(r.ordinalNumber(s,{unit:"day"}),l);case"eee":return r.day(s,{width:"abbreviated",context:"formatting"})||r.day(s,{width:"short",context:"formatting"})||r.day(s,{width:"narrow",context:"formatting"});case"eeeee":return r.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(s,{width:"short",context:"formatting"})||r.day(s,{width:"narrow",context:"formatting"});case"eeee":default:return r.day(s,{width:"wide",context:"formatting"})||r.day(s,{width:"abbreviated",context:"formatting"})||r.day(s,{width:"short",context:"formatting"})||r.day(s,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(s,o){return o>=0&&o<=6}},{key:"set",value:function(s,o,r,a){return s=us(s,r,a),s.setUTCHours(0,0,0,0),s}}]),e}(Y),Ul=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",90),P(D(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r,a){var l=function(u){var h=Math.floor((u-1)/7)*7;return(u+a.weekStartsOn+6)%7+h};switch(o){case"c":case"cc":return rt(it(o.length,s),l);case"co":return rt(r.ordinalNumber(s,{unit:"day"}),l);case"ccc":return r.day(s,{width:"abbreviated",context:"standalone"})||r.day(s,{width:"short",context:"standalone"})||r.day(s,{width:"narrow",context:"standalone"});case"ccccc":return r.day(s,{width:"narrow",context:"standalone"});case"cccccc":return r.day(s,{width:"short",context:"standalone"})||r.day(s,{width:"narrow",context:"standalone"});case"cccc":default:return r.day(s,{width:"wide",context:"standalone"})||r.day(s,{width:"abbreviated",context:"standalone"})||r.day(s,{width:"short",context:"standalone"})||r.day(s,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(s,o){return o>=0&&o<=6}},{key:"set",value:function(s,o,r,a){return s=us(s,r,a),s.setUTCHours(0,0,0,0),s}}]),e}(Y);function $l(n,t){z(2,arguments);var e=wt(t);e%7===0&&(e=e-7);var i=1,s=j(n),o=s.getUTCDay(),r=e%7,a=(r+7)%7,l=(a<i?7:0)+e-o;return s.setUTCDate(s.getUTCDate()+l),s}var ql=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",90),P(D(i),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){var a=function(c){return c===0?7:c};switch(o){case"i":case"ii":return it(o.length,s);case"io":return r.ordinalNumber(s,{unit:"day"});case"iii":return rt(r.day(s,{width:"abbreviated",context:"formatting"})||r.day(s,{width:"short",context:"formatting"})||r.day(s,{width:"narrow",context:"formatting"}),a);case"iiiii":return rt(r.day(s,{width:"narrow",context:"formatting"}),a);case"iiiiii":return rt(r.day(s,{width:"short",context:"formatting"})||r.day(s,{width:"narrow",context:"formatting"}),a);case"iiii":default:return rt(r.day(s,{width:"wide",context:"formatting"})||r.day(s,{width:"abbreviated",context:"formatting"})||r.day(s,{width:"short",context:"formatting"})||r.day(s,{width:"narrow",context:"formatting"}),a)}}},{key:"validate",value:function(s,o){return o>=1&&o<=7}},{key:"set",value:function(s,o,r){return s=$l(s,r),s.setUTCHours(0,0,0,0),s}}]),e}(Y),Xl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",80),P(D(i),"incompatibleTokens",["b","B","H","k","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){switch(o){case"a":case"aa":case"aaa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"})||r.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})||r.dayPeriod(s,{width:"abbreviated",context:"formatting"})||r.dayPeriod(s,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(s,o,r){return s.setUTCHours(cs(r),0,0,0),s}}]),e}(Y),Kl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",80),P(D(i),"incompatibleTokens",["a","B","H","k","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){switch(o){case"b":case"bb":case"bbb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"})||r.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})||r.dayPeriod(s,{width:"abbreviated",context:"formatting"})||r.dayPeriod(s,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(s,o,r){return s.setUTCHours(cs(r),0,0,0),s}}]),e}(Y),Gl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",80),P(D(i),"incompatibleTokens",["a","b","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){switch(o){case"B":case"BB":case"BBB":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"})||r.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})||r.dayPeriod(s,{width:"abbreviated",context:"formatting"})||r.dayPeriod(s,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(s,o,r){return s.setUTCHours(cs(r),0,0,0),s}}]),e}(Y),Ql=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",70),P(D(i),"incompatibleTokens",["H","K","k","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){switch(o){case"h":return Z(ot.hour12h,s);case"ho":return r.ordinalNumber(s,{unit:"hour"});default:return it(o.length,s)}}},{key:"validate",value:function(s,o){return o>=1&&o<=12}},{key:"set",value:function(s,o,r){var a=s.getUTCHours()>=12;return a&&r<12?s.setUTCHours(r+12,0,0,0):!a&&r===12?s.setUTCHours(0,0,0,0):s.setUTCHours(r,0,0,0),s}}]),e}(Y),Zl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",70),P(D(i),"incompatibleTokens",["a","b","h","K","k","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){switch(o){case"H":return Z(ot.hour23h,s);case"Ho":return r.ordinalNumber(s,{unit:"hour"});default:return it(o.length,s)}}},{key:"validate",value:function(s,o){return o>=0&&o<=23}},{key:"set",value:function(s,o,r){return s.setUTCHours(r,0,0,0),s}}]),e}(Y),Jl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",70),P(D(i),"incompatibleTokens",["h","H","k","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){switch(o){case"K":return Z(ot.hour11h,s);case"Ko":return r.ordinalNumber(s,{unit:"hour"});default:return it(o.length,s)}}},{key:"validate",value:function(s,o){return o>=0&&o<=11}},{key:"set",value:function(s,o,r){var a=s.getUTCHours()>=12;return a&&r<12?s.setUTCHours(r+12,0,0,0):s.setUTCHours(r,0,0,0),s}}]),e}(Y),tc=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",70),P(D(i),"incompatibleTokens",["a","b","h","H","K","t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){switch(o){case"k":return Z(ot.hour24h,s);case"ko":return r.ordinalNumber(s,{unit:"hour"});default:return it(o.length,s)}}},{key:"validate",value:function(s,o){return o>=1&&o<=24}},{key:"set",value:function(s,o,r){var a=r<=24?r%24:r;return s.setUTCHours(a,0,0,0),s}}]),e}(Y),ec=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",60),P(D(i),"incompatibleTokens",["t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){switch(o){case"m":return Z(ot.minute,s);case"mo":return r.ordinalNumber(s,{unit:"minute"});default:return it(o.length,s)}}},{key:"validate",value:function(s,o){return o>=0&&o<=59}},{key:"set",value:function(s,o,r){return s.setUTCMinutes(r,0,0),s}}]),e}(Y),nc=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",50),P(D(i),"incompatibleTokens",["t","T"]),i}return E(e,[{key:"parse",value:function(s,o,r){switch(o){case"s":return Z(ot.second,s);case"so":return r.ordinalNumber(s,{unit:"second"});default:return it(o.length,s)}}},{key:"validate",value:function(s,o){return o>=0&&o<=59}},{key:"set",value:function(s,o,r){return s.setUTCSeconds(r,0),s}}]),e}(Y),ic=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",30),P(D(i),"incompatibleTokens",["t","T"]),i}return E(e,[{key:"parse",value:function(s,o){var r=function(l){return Math.floor(l*Math.pow(10,-o.length+3))};return rt(it(o.length,s),r)}},{key:"set",value:function(s,o,r){return s.setUTCMilliseconds(r),s}}]),e}(Y),sc=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",10),P(D(i),"incompatibleTokens",["t","T","x"]),i}return E(e,[{key:"parse",value:function(s,o){switch(o){case"X":return zt(Et.basicOptionalMinutes,s);case"XX":return zt(Et.basic,s);case"XXXX":return zt(Et.basicOptionalSeconds,s);case"XXXXX":return zt(Et.extendedOptionalSeconds,s);case"XXX":default:return zt(Et.extended,s)}}},{key:"set",value:function(s,o,r){return o.timestampIsSet?s:new Date(s.getTime()-r)}}]),e}(Y),oc=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",10),P(D(i),"incompatibleTokens",["t","T","X"]),i}return E(e,[{key:"parse",value:function(s,o){switch(o){case"x":return zt(Et.basicOptionalMinutes,s);case"xx":return zt(Et.basic,s);case"xxxx":return zt(Et.basicOptionalSeconds,s);case"xxxxx":return zt(Et.extendedOptionalSeconds,s);case"xxx":default:return zt(Et.extended,s)}}},{key:"set",value:function(s,o,r){return o.timestampIsSet?s:new Date(s.getTime()-r)}}]),e}(Y),rc=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",40),P(D(i),"incompatibleTokens","*"),i}return E(e,[{key:"parse",value:function(s){return Cr(s)}},{key:"set",value:function(s,o,r){return[new Date(r*1e3),{timestampIsSet:!0}]}}]),e}(Y),ac=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return i=t.call.apply(t,[this].concat(o)),P(D(i),"priority",20),P(D(i),"incompatibleTokens","*"),i}return E(e,[{key:"parse",value:function(s){return Cr(s)}},{key:"set",value:function(s,o,r){return[new Date(r),{timestampIsSet:!0}]}}]),e}(Y),lc={G:new Pl,y:new Dl,Y:new Tl,R:new Sl,u:new Ol,Q:new Al,q:new Ll,M:new Rl,L:new Fl,w:new El,I:new Bl,d:new Hl,D:new Vl,E:new Yl,e:new jl,c:new Ul,i:new ql,a:new Xl,b:new Kl,B:new Gl,h:new Ql,H:new Zl,K:new Jl,k:new tc,m:new ec,s:new nc,S:new ic,X:new sc,x:new oc,t:new rc,T:new ac},cc=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,uc=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,hc=/^'([^]*?)'?$/,dc=/''/g,fc=/\S/,gc=/[a-zA-Z]/;function pc(n,t,e,i){var s,o,r,a,l,c,u,h,d,f,g,p,m,b,y,x,v,_;z(3,arguments);var w=String(n),C=String(t),M=xr(),T=(s=(o=i==null?void 0:i.locale)!==null&&o!==void 0?o:M.locale)!==null&&s!==void 0?s:Fa;if(!T.match)throw new RangeError("locale must contain match property");var A=wt((r=(a=(l=(c=i==null?void 0:i.firstWeekContainsDate)!==null&&c!==void 0?c:i==null||(u=i.locale)===null||u===void 0||(h=u.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&l!==void 0?l:M.firstWeekContainsDate)!==null&&a!==void 0?a:(d=M.locale)===null||d===void 0||(f=d.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&r!==void 0?r:1);if(!(A>=1&&A<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var O=wt((g=(p=(m=(b=i==null?void 0:i.weekStartsOn)!==null&&b!==void 0?b:i==null||(y=i.locale)===null||y===void 0||(x=y.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&m!==void 0?m:M.weekStartsOn)!==null&&p!==void 0?p:(v=M.locale)===null||v===void 0||(_=v.options)===null||_===void 0?void 0:_.weekStartsOn)!==null&&g!==void 0?g:0);if(!(O>=0&&O<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(C==="")return w===""?j(e):new Date(NaN);var R={firstWeekContainsDate:A,weekStartsOn:O,locale:T},st=[new Cl],gt=C.match(uc).map(function(ct){var q=ct[0];if(q in Os){var St=Os[q];return St(ct,T.formatLong)}return ct}).join("").match(cc),W=[],U=Es(gt),Q;try{var Mt=function(){var q=Q.value;!(i!=null&&i.useAdditionalWeekYearTokens)&&Ia(q)&&As(q,C,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&Ea(q)&&As(q,C,n);var St=q[0],wn=lc[St];if(wn){var Ds=wn.incompatibleTokens;if(Array.isArray(Ds)){var Ts=W.find(function(Ss){return Ds.includes(Ss.token)||Ss.token===St});if(Ts)throw new RangeError("The format string mustn't contain `".concat(Ts.fullToken,"` and `").concat(q,"` at the same time"))}else if(wn.incompatibleTokens==="*"&&W.length>0)throw new RangeError("The format string mustn't contain `".concat(q,"` and any other token at the same time"));W.push({token:St,fullToken:q});var xi=wn.run(w,q,T.match,R);if(!xi)return{v:new Date(NaN)};st.push(xi.setter),w=xi.rest}else{if(St.match(gc))throw new RangeError("Format string contains an unescaped latin alphabet character `"+St+"`");if(q==="''"?q="'":St==="'"&&(q=mc(q)),w.indexOf(q)===0)w=w.slice(q.length);else return{v:new Date(NaN)}}};for(U.s();!(Q=U.n()).done;){var lt=Mt();if(an(lt)==="object")return lt.v}}catch(ct){U.e(ct)}finally{U.f()}if(w.length>0&&fc.test(w))return new Date(NaN);var Kt=st.map(function(ct){return ct.priority}).sort(function(ct,q){return q-ct}).filter(function(ct,q,St){return St.indexOf(ct)===q}).map(function(ct){return st.filter(function(q){return q.priority===ct}).sort(function(q,St){return St.subPriority-q.subPriority})}).map(function(ct){return ct[0]}),Gt=j(e);if(isNaN(Gt.getTime()))return new Date(NaN);var Tt=za(Gt,ji(Gt)),Qt={},Rt=Es(Kt),Zt;try{for(Rt.s();!(Zt=Rt.n()).done;){var Jt=Zt.value;if(!Jt.validate(Tt,R))return new Date(NaN);var vn=Jt.set(Tt,Qt,R);Array.isArray(vn)?(Tt=vn[0],yl(Qt,vn[1])):Tt=vn}}catch(ct){Rt.e(ct)}finally{Rt.f()}return Tt}function mc(n){return n.match(hc)[1].replace(dc,"'")}function bc(n){z(1,arguments);var t=j(n);return t.setMinutes(0,0,0),t}function yc(n){z(1,arguments);var t=j(n);return t.setMilliseconds(0),t}function _c(n,t){var e;z(1,arguments);var i=wt((e=t==null?void 0:t.additionalDigits)!==null&&e!==void 0?e:2);if(i!==2&&i!==1&&i!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var s=Mc(n),o;if(s.date){var r=kc(s.date,i);o=Cc(r.restDateString,r.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var a=o.getTime(),l=0,c;if(s.time&&(l=Pc(s.time),isNaN(l)))return new Date(NaN);if(s.timezone){if(c=Dc(s.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(a+l),h=new Date(0);return h.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),h.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),h}return new Date(a+l+c)}var Mn={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},xc=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,vc=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,wc=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Mc(n){var t={},e=n.split(Mn.dateTimeDelimiter),i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Mn.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Mn.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){var s=Mn.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function kc(n,t){var e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};var s=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:o===null?s:o*100,restDateString:n.slice((i[1]||i[2]).length)}}function Cc(n,t){if(t===null)return new Date(NaN);var e=n.match(xc);if(!e)return new Date(NaN);var i=!!e[4],s=Be(e[1]),o=Be(e[2])-1,r=Be(e[3]),a=Be(e[4]),l=Be(e[5])-1;if(i)return Lc(t,a,l)?Tc(t,a,l):new Date(NaN);var c=new Date(0);return!Oc(t,o,r)||!Ac(t,s)?new Date(NaN):(c.setUTCFullYear(t,o,Math.max(s,r)),c)}function Be(n){return n?parseInt(n):1}function Pc(n){var t=n.match(vc);if(!t)return NaN;var e=vi(t[1]),i=vi(t[2]),s=vi(t[3]);return Rc(e,i,s)?e*hi+i*ui+s*1e3:NaN}function vi(n){return n&&parseFloat(n.replace(",","."))||0}function Dc(n){if(n==="Z")return 0;var t=n.match(wc);if(!t)return 0;var e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Fc(i,s)?e*(i*hi+s*ui):NaN}function Tc(n,t,e){var i=new Date(0);i.setUTCFullYear(n,0,4);var s=i.getUTCDay()||7,o=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+o),i}var Sc=[31,null,31,30,31,30,31,31,30,31,30,31];function Tr(n){return n%400===0||n%4===0&&n%100!==0}function Oc(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(Sc[t]||(Tr(n)?29:28))}function Ac(n,t){return t>=1&&t<=(Tr(n)?366:365)}function Lc(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Rc(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Fc(n,t){return t>=0&&t<=59}class Ic{get(t,e,i){return vt.get("/api/v2/summary/basic",{params:{start:t,end:e,code:i}})}}function Nt(n,t,e){const i=J(t,"y-MM-dd")+"_"+J(e,"y-MM-dd")+"_"+n;return console.log("getCacheKey: "+i),String(i)}let wi=!1;const Ec=()=>({balanceBox:{amounts:[],subtitles:[]},billBox:{paid:[],unpaid:[]},leftBox:{left:[],perDay:[]},netBox:{net:[]},autoConversion:!1,loading:!1,boxData:null,boxOptions:null,getFreshData(){const n=new Date(window.store.get("start")),t=new Date(window.store.get("end")),e=Nt("dashboard-boxes-data",n,t),i=window.store.get("cacheValid");let s=window.store.get(e);if(i&&typeof s<"u"){this.boxData=s,this.generateOptions(this.boxData);return}new Ic().get(J(n,"yyyy-MM-dd"),J(t,"yyyy-MM-dd"),null).then(r=>{this.boxData=r.data,window.store.set(e,r.data),this.generateOptions(this.boxData)})},generateOptions(n){this.balanceBox={amounts:[],subtitles:[]},this.billBox={paid:[],unpaid:[]},this.leftBox={left:[],perDay:[]},this.netBox={net:[]};let t={};for(const e in n)if(n.hasOwnProperty(e)){const i=n[e];if(!i.hasOwnProperty("key"))continue;let s=i.key;if(this.autoConversion){if(s.startsWith("balance-in-native")){this.balanceBox.amounts.push(V(i.value,i.currency_code)),t.hasOwnProperty(i.currency_code)||(t[i.currency_code]="");continue}if(s.startsWith("spent-in-native")){t.hasOwnProperty(i.currency_code)||(t[i.currency_code]=""),t[i.currency_code]=t[i.currency_code]+V(i.value,i.currency_code);continue}if(s.startsWith("earned-in-native")){t.hasOwnProperty(i.currency_code)||(t[i.currency_code]=""),t[i.currency_code]=V(i.value,i.currency_code)+" + "+t[i.currency_code];continue}if(s.startsWith("bills-unpaid-in-native")){this.billBox.unpaid.push(V(i.value,i.currency_code));continue}if(s.startsWith("bills-paid-in-native")){this.billBox.paid.push(V(i.value,i.currency_code));continue}if(s.startsWith("left-to-spend-in-native")){this.leftBox.left.push(V(i.value,i.currency_code));continue}if(s.startsWith("left-per-day-to-spend-in-native")){this.leftBox.perDay.push(V(i.value,i.currency_code));continue}if(s.startsWith("net-worth-in-native")){this.netBox.net.push(V(i.value,i.currency_code));continue}}if(!this.autoConversion&&!s.endsWith("native")){if(s.startsWith("balance-in-")){this.balanceBox.amounts.push(V(i.value,i.currency_code));continue}if(s.startsWith("spent-in-")){t.hasOwnProperty(i.currency_code)||(t[i.currency_code]=""),t[i.currency_code]=t[i.currency_code]+V(i.value,i.currency_code);continue}if(s.startsWith("earned-in-")){t.hasOwnProperty(i.currency_code)||(t[i.currency_code]=""),t[i.currency_code]=V(i.value,i.currency_code)+" + "+t[i.currency_code];continue}if(s.startsWith("bills-unpaid-in-")){this.billBox.unpaid.push(V(i.value,i.currency_code));continue}if(s.startsWith("bills-paid-in-")){this.billBox.paid.push(V(i.value,i.currency_code));continue}if(s.startsWith("left-to-spend-in-")){this.leftBox.left.push(V(i.value,i.currency_code));continue}if(s.startsWith("left-per-day-to-spend-in-")){this.leftBox.perDay.push(V(i.value,i.currency_code));continue}s.startsWith("net-worth-in-")&&this.netBox.net.push(V(i.value,i.currency_code))}}for(let e in t)t.hasOwnProperty(e)&&this.balanceBox.subtitles.push(t[e]);this.loading=!1},loadBoxes(){if(this.loading!==!0){if(this.loading=!0,this.boxData===null){this.getFreshData();return}this.generateOptions(this.boxData),this.loading=!1}},init(){Promise.all([bt("viewRange"),bt("autoConversion",!1)]).then(n=>{wi=!0,this.autoConversion=n[1],this.loadBoxes()}),window.store.observe("end",()=>{wi&&(this.boxData=null,this.loadBoxes())}),window.store.observe("autoConversion",n=>{wi&&(this.autoConversion=n,this.loadBoxes())})}});class zc{put(t,e){let i="/api/v1/preferences/"+t;return vt.put(i,{data:e})}}function Bc(n,t=null){window.store.set(n,t),new zc().put(n,t).then(i=>{}).catch(()=>{new Ba().post(n,t).then(s=>{})})}let Nc=class{dashboard(t,e){let i=J(t,"y-MM-dd"),s=J(e,"y-MM-dd");return vt.get("/api/v2/chart/account/dashboard",{params:{start:i,end:s}})}expense(t,e){let i=J(t,"y-MM-dd"),s=J(e,"y-MM-dd");return vt.get("/api/v2/chart/account/expense-dashboard",{params:{start:i,end:s}})}},Bs=class{get(t,e){let i={date:J(e,"y-MM-dd").slice(0,10)};return e?vt.get("/api/v2/accounts/"+t,{params:i}):vt.get("/api/v2/accounts/"+t)}transactions(t,e){const i={page:e.page??1};return e.hasOwnProperty("start")&&(i.start=J(e.start,"y-MM-dd")),e.hasOwnProperty("end")&&(i.end=J(e.end,"y-MM-dd")),vt.get("/api/v2/accounts/"+t+"/transactions",{params:i})}};/*!* @kurkle/color v0.3.2* https://github.com/kurkle/color#readme@@ -16,13 +16,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho* Released under the MIT License*/class Th{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const o=e.listeners[s],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Br.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Yt=new Th;const ro="transparent",Sh={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Ae(n||ro),s=i.valid&&Ae(t||ro);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Oh{constructor(t,e,i,s){const o=e[i];s=Tn([t.to,s,o,t.from]);const r=Tn([t.from,o,s]);this._active=!0,this._fn=t.fn||Sh[t.type||typeof r],this._easing=sn[t.easing]||sn.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Tn([t.to,e,s,t.from]),this._from=Tn([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<i),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=o;return}l=e/i%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}class ea{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!F(t))return;const e=Object.keys(nt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!F(o))return;const r={};for(const a of e)r[a]=o[a];(K(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,e){const i=e.options,s=Lh(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&Ah(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const u=e[c];let h=o[c];const d=i.get(c);if(h)if(d&&h.active()){h.update(d,u,a);continue}else h.cancel();if(!d||!d.duration){t[c]=u;continue}o[c]=h=new Oh(d,t,c,u),s.push(h)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return Yt.add(this._chart,i),!0}}function Ah(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const o=n[i[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Lh(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function ao(n,t){const e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:i?o:s,end:i?s:o}}function Rh(n,t,e){if(e===!1)return!1;const i=ao(n,e),s=ao(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Fh(n){let t,e,i,s;return F(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function na(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,o;for(s=0,o=i.length;s<o;++s)e.push(i[s].index);return e}function lo(n,t,e,i={}){const s=n.keys,o=i.mode==="single";let r,a,l,c;if(t!==null){for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===e){if(i.all)continue;break}c=n.values[l],et(c)&&(o||t===0||Bt(t)===Bt(c))&&(t+=c)}return t}}function Ih(n){const t=Object.keys(n),e=new Array(t.length);let i,s,o;for(i=0,s=t.length;i<s;++i)o=t[i],e[i]={x:o,y:n[o]};return e}function co(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function Eh(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function zh(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function Bh(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function uo(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const o=n[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function ho(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,u=Eh(o,r,i),h=t.length;let d;for(let f=0;f<h;++f){const g=t[f],{[l]:p,[c]:m}=g,b=g._stacks||(g._stacks={});d=b[c]=Bh(s,u,p),d[a]=m,d._top=uo(d,r,!0,i.type),d._bottom=uo(d,r,!1,i.type);const y=d._visualValues||(d._visualValues={});y[a]=m}}function Ci(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Nh(n,t){return he(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Wh(n,t,e){return he(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Ne(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const o=s._stacks;if(!o||o[i]===void 0||o[i][e]===void 0)return;delete o[i][e],o[i]._visualValues!==void 0&&o[i]._visualValues[e]!==void 0&&delete o[i]._visualValues[e]}}}const Pi=n=>n==="reset"||n==="none",fo=(n,t)=>t?n:Object.assign({},n),Hh=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:na(e,!0),values:null};class Xt{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=co(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Ne(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(h,d,f,g)=>h==="x"?d:h==="r"?g:f,o=e.xAxisID=S(i.xAxisID,Ci(t,"x")),r=e.yAxisID=S(i.yAxisID,Ci(t,"y")),a=e.rAxisID=S(i.rAxisID,Ci(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,r,a),u=e.vAxisID=s(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Xs(this._data,this),t._stacked&&Ne(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(F(e))this._data=Ih(e);else if(i!==e){if(i){Xs(i,this);const s=this._cachedMeta;Ne(s),s._parsed=[]}e&&Object.isExtensible(e)&&Mu(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const o=e._stacked;e._stacked=co(e.vScale,e),e.stack!==i.stack&&(s=!0,Ne(e),e.stack=i.stack),this._resyncElements(t),(s||o!==e._stacked)&&ho(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,h,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{K(s[t])?d=this.parseArrayData(i,s,t,e):F(s[t])?d=this.parseObjectData(i,s,t,e):d=this.parsePrimitiveData(i,s,t,e);const f=()=>h[a]===null||c&&h[a]<c[a];for(u=0;u<e;++u)i._parsed[u+t]=h=d[u],l&&(f()&&(l=!1),c=h);i._sorted=l}r&&ho(this,d)}parsePrimitiveData(t,e,i,s){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),u=o===r,h=new Array(s);let d,f,g;for(d=0,f=s;d<f;++d)g=d+i,h[d]={[a]:u||o.parse(c[g],g),[l]:r.parse(e[g],g)};return h}parseArrayData(t,e,i,s){const{xScale:o,yScale:r}=t,a=new Array(s);let l,c,u,h;for(l=0,c=s;l<c;++l)u=l+i,h=e[u],a[l]={x:o.parse(h[0],u),y:r.parse(h[1],u)};return a}parseObjectData(t,e,i,s){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,h,d,f;for(u=0,h=s;u<h;++u)d=u+i,f=e[d],c[u]={x:o.parse(ce(f,a),d),y:r.parse(ce(f,l),d)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:na(s,!0),values:e._stacks[t.axis]._visualValues};return lo(a,r,o.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const o=i[e.axis];let r=o===null?NaN:o;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,r=lo(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,r=s.length,a=this._getOtherScale(t),l=Hh(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=zh(a);let d,f;function g(){f=s[d];const p=f[a.axis];return!et(f[t.axis])||u>p||h<p}for(d=0;d<r&&!(!g()&&(this.updateRangeFromParsed(c,t,f,l),o));++d);if(o){for(d=r-1;d>=0;--d)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,o,r;for(s=0,o=e.length;s<o;++s)r=e[s][t.axis],et(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Fh(S(this.options.clip,Rh(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,o,a,l),u=a;u<a+l;++u){const h=s[u];h.hidden||(h.active&&c?r.push(h):h.draw(t,o))}for(u=0;u<r.length;++u)r[u].draw(t,o)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=Wh(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Nh(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&cn(i);if(a)return fo(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),h=s?[`${t}Hover`,"hover",t,""]:[t,""],d=c.getOptionScopes(this.getDataset(),u),f=Object.keys(nt.elements[t]),g=()=>this.getContext(i,s,e),p=c.resolveNamedOptions(d,f,g,h);return p.$shared&&(p.$shared=l,o[r]=Object.freeze(fo(p,l))),p}_resolveAnimations(t,e,i){const s=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,e),d=u.getOptionScopes(this.getDataset(),h);l=u.createResolver(d,this.getContext(t,i,e))}const c=new ea(s,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Pi(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,i),{sharedOptions:o,includeOptions:r}}updateElement(t,e,i,s){Pi(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Pi(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,o=e.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,e,i=!0){const s=this._cachedMeta,o=s.data,r=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(o,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&Ne(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}k(Xt,"defaults",{}),k(Xt,"datasetElementType",null),k(Xt,"dataElementType",null);function Vh(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,o=e.length;s<o;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=zr(i.sort((s,o)=>s-o))}return n._cache.$bar}function Yh(n){const t=n.iScale,e=Vh(t,n.type);let i=t._length,s,o,r,a;const l=()=>{r===32767||r===-32768||(cn(a)&&(i=Math.min(i,Math.abs(r-a)||i)),a=r)};for(s=0,o=e.length;s<o;++s)r=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,o=t.ticks.length;s<o;++s)r=t.getPixelForTick(s),l();return i}function jh(n,t,e,i){const s=e.barThickness;let o,r;return H(s)?(o=t.min*e.categoryPercentage,r=e.barPercentage):(o=s*i,r=1),{chunk:o/i,ratio:r,start:t.pixels[n]-o/2}}function Uh(n,t,e,i){const s=t.pixels,o=s[n];let r=n>0?s[n-1]:null,a=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);const c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/i,ratio:e.barPercentage,start:c}}function $h(n,t,e,i){const s=e.parse(n[0],i),o=e.parse(n[1],i),r=Math.min(s,o),a=Math.max(s,o);let l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}function ia(n,t,e,i){return K(n)?$h(n,t,e,i):t[e.axis]=e.parse(n,i),t}function go(n,t,e,i){const s=n.iScale,o=n.vScale,r=s.getLabels(),a=s===o,l=[];let c,u,h,d;for(c=e,u=e+i;c<u;++c)d=t[c],h={},h[s.axis]=a||s.parse(r[c],c),l.push(ia(d,h,o,c));return l}function Di(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function qh(n,t,e){return n!==0?Bt(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Xh(n){let t,e,i,s,o;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",o="start"):(s="start",o="end"),{start:e,end:i,reverse:t,top:s,bottom:o}}function Kh(n,t,e,i){let s=t.borderSkipped;const o={};if(!s){n.borderSkipped=o;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:a,reverse:l,top:c,bottom:u}=Xh(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(o[po(u,r,a,l)]=!0,s=c)),o[po(s,r,a,l)]=!0,n.borderSkipped=o}function po(n,t,e,i){return i?(n=Gh(n,t,e),n=mo(n,e,t)):n=mo(n,t,e),n}function Gh(n,t,e){return n===t?e:n===e?t:n}function mo(n,t,e){return n==="start"?t:n==="end"?e:n}function Qh(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Yn extends Xt{parsePrimitiveData(t,e,i,s){return go(t,e,i,s)}parseArrayData(t,e,i,s){return go(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,u=r.axis==="x"?a:l,h=[];let d,f,g,p;for(d=i,f=i+s;d<f;++d)p=e[d],g={},g[o.axis]=o.parse(ce(p,c),d),h.push(ia(ce(p,u),g,r,d));return h}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const o=i._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,o=this.getParsed(t),r=o._custom,a=Di(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const o=s==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,s);for(let f=e;f<e+i;f++){const g=this.getParsed(f),p=o||H(g[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),m=this._calculateBarIndexPixels(f,u),b=(g._stacks||{})[a.axis],y={horizontal:c,base:p.base,enableBorderRadius:!b||Di(g._custom)||r===b._top||r===b._bottom,x:c?p.head:m.center,y:c?m.center:p.head,height:c?m.size:Math.abs(p.size),width:c?Math.abs(p.size):m.size};d&&(y.options=h||this.resolveDataElementOptions(f,t[f].active?"active":s));const x=y.options||t[f].options;Kh(y,x,b,r),Qh(y,x,u.ratio),this.updateElement(t[f],f,y,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),o=i.options.stacked,r=[],a=l=>{const c=l.controller.getParsed(e),u=c&&c[l.vScale.axis];if(H(u)||isNaN(u))return!0};for(const l of s)if(!(e!==void 0&&a(l))&&((o===!1||r.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&r.push(l.stack),l.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),o=e!==void 0?s.indexOf(e):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let o,r;for(o=0,r=e.data.length;o<r;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const a=t.barThickness;return{min:a||Yh(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(t),c=l._custom,u=Di(c);let h=l[e.axis],d=0,f=i?this.applyStack(e,l,i):h,g,p;f!==h&&(d=f-h,f=h),u&&(h=c.barStart,f=c.barEnd-c.barStart,h!==0&&Bt(h)!==Bt(c.barEnd)&&(d=0),d+=h);const m=!H(o)&&!u?o:d;let b=e.getPixelForValue(m);if(this.chart.getDataVisibility(t)?g=e.getPixelForValue(d+f):g=b,p=g-b,Math.abs(p)<r){p=qh(p,e,a)*r,h===a&&(b-=p/2);const y=e.getPixelForDecimal(0),x=e.getPixelForDecimal(1),v=Math.min(y,x),_=Math.max(y,x);b=Math.max(Math.min(b,_),v),g=b+p,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(g)-e.getValueForPixel(b))}if(b===e.getPixelForValue(a)){const y=Bt(p)*e.getLineWidthForValue(a)/2;b+=y,p-=y}return{size:p,base:b,head:g,center:g+p/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,o=s.skipNull,r=S(s.maxBarThickness,1/0);let a,l;if(e.grouped){const c=o?this._getStackCount(t):e.stackCount,u=s.barThickness==="flex"?Uh(t,e,s,c):jh(t,e,s,c),h=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=u.start+u.chunk*h+u.chunk/2,l=Math.min(r,u.chunk*u.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(r,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let o=0;for(;o<s;++o)this.getParsed(o)[e.axis]!==null&&i[o].draw(this._ctx)}}k(Yn,"id","bar"),k(Yn,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),k(Yn,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function Zh(n,t,e){let i=1,s=1,o=0,r=0;if(t<G){const a=n,l=a+t,c=Math.cos(a),u=Math.sin(a),h=Math.cos(l),d=Math.sin(l),f=(x,v,_)=>hn(x,a,l,!0)?1:Math.max(v,v*e,_,_*e),g=(x,v,_)=>hn(x,a,l,!0)?-1:Math.min(v,v*e,_,_*e),p=f(0,c,h),m=f(at,u,d),b=g(tt,c,h),y=g(tt+at,u,d);i=(p-b)/2,s=(m-y)/2,o=-(p+b)/2,r=-(m+y)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:r}}class Le extends Xt{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=l=>+i[l];if(F(i[t])){const{key:l="value"}=this._parsing;o=c=>+ce(i[c],l)}let r,a;for(r=t,a=t+e;r<a;++r)s._parsed[r]=o(r)}}_getRotation(){return At(this.options.rotation-90)}_getCircumference(){return At(this.options.circumference)}_getRotationExtents(){let t=G,e=-G;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,o=s._getRotation(),r=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+r)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-r)/2,0),l=Math.min(cu(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:d,ratioY:f,offsetX:g,offsetY:p}=Zh(h,u,l),m=(i.width-r)/d,b=(i.height-r)/f,y=Math.max(Math.min(m,b)/2,0),x=Lr(this.options.radius,y),v=Math.max(x*l,0),_=(x-v)/this._getVisibleDatasetWeightTotal();this.offsetX=g*x,this.offsetY=p*x,s.total=this.calculateTotal(),this.outerRadius=x-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/G)}updateElements(t,e,i,s){const o=s==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,u=(a.left+a.right)/2,h=(a.top+a.bottom)/2,d=o&&c.animateScale,f=d?0:this.innerRadius,g=d?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(e,s);let b=this._getRotation(),y;for(y=0;y<e;++y)b+=this._circumference(y,o);for(y=e;y<e+i;++y){const x=this._circumference(y,o),v=t[y],_={x:u+this.offsetX,y:h+this.offsetY,startAngle:b,endAngle:b+x,circumference:x,outerRadius:g,innerRadius:f};m&&(_.options=p||this.resolveDataElementOptions(y,v.active?"active":s)),b+=x,this.updateElement(v,y,_,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?G*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=_n(e._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,o,r,a,l;if(!t){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){r=i.getDatasetMeta(s),t=r.data,a=r.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const o=this.resolveDataElementOptions(i);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(S(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}k(Le,"id","doughnut"),k(Le,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),k(Le,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),k(Le,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class jn extends Xt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=Pu(e,s,r);this._drawStart=a,this._drawCount=l,Du(e)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,i,s){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(e,s),d=r.axis,f=a.axis,{spanGaps:g,segment:p}=this.options,m=un(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",y=e+i,x=t.length;let v=e>0&&this.getParsed(e-1);for(let _=0;_<x;++_){const w=t[_],C=b?w:{};if(_<e||_>=y){C.skip=!0;continue}const M=this.getParsed(_),T=H(M[f]),A=C[d]=r.getPixelForValue(M[d],_),O=C[f]=o||T?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[f],_);C.skip=isNaN(A)||isNaN(O)||T,C.stop=_>0&&Math.abs(M[d]-v[d])>m,p&&(C.parsed=M,C.raw=c.data[_]),h&&(C.options=u||this.resolveDataElementOptions(_,w.active?"active":s)),b||this.updateElement(w,_,C,s),v=M}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}k(jn,"id","line"),k(jn,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),k(jn,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Un extends Xt{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=_n(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,i,s){return ih.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),r=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,s){const o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,h=c.yCenter,d=c.getIndexAngle(0)-.5*tt;let f=d,g;const p=360/this.countVisibleElements();for(g=0;g<e;++g)f+=this._computeAngle(g,s,p);for(g=e;g<e+i;g++){const m=t[g];let b=f,y=f+this._computeAngle(g,s,p),x=r.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;f=y,o&&(l.animateScale&&(x=0),l.animateRotate&&(b=y=d));const v={x:u,y:h,innerRadius:0,outerRadius:x,startAngle:b,endAngle:y,options:this.resolveDataElementOptions(g,m.active?"active":s)};this.updateElement(m,g,v,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?At(this.resolveDataElementOptions(t,e).angle||i):0}}k(Un,"id","polarArea"),k(Un,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),k(Un,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Qi extends Le{}k(Qi,"id","pie"),k(Qi,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function ge(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ms{constructor(t){k(this,"options");this.options=t||{}}static override(t){Object.assign(Ms.prototype,t)}init(){}formats(){return ge()}parse(){return ge()}format(){return ge()}add(){return ge()}diff(){return ge()}startOf(){return ge()}endOf(){return ge()}}var sa={_date:Ms};function Jh(n,t,e,i){const{controller:s,data:o,_sorted:r}=n,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?vu:xe;if(i){if(s._sharedOptions){const c=o[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const h=l(o,t,e-u),d=l(o,t,e+u);return{lo:h.lo,hi:d.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function xn(n,t,e,i,s){const o=n.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:u}=o[a],{lo:h,hi:d}=Jh(o[a],t,r,s);for(let f=h;f<=d;++f){const g=u[f];g.skip||i(g,c,f)}}}function td(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const o=t?Math.abs(i.x-s.x):0,r=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Ti(n,t,e,i,s){const o=[];return!s&&!n.isPointInArea(t)||xn(n,e,t,function(a,l,c){!s&&!qt(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function ed(n,t,e,i){let s=[];function o(r,a,l){const{startAngle:c,endAngle:u}=r.getProps(["startAngle","endAngle"],i),{angle:h}=Ir(r,{x:t.x,y:t.y});hn(h,c,u)&&s.push({element:r,datasetIndex:a,index:l})}return xn(n,e,t,o),s}function nd(n,t,e,i,s,o){let r=[];const a=td(e);let l=Number.POSITIVE_INFINITY;function c(u,h,d){const f=u.inRange(t.x,t.y,s);if(i&&!f)return;const g=u.getCenterPoint(s);if(!(!!o||n.isPointInArea(g))&&!f)return;const m=a(t,g);m<l?(r=[{element:u,datasetIndex:h,index:d}],l=m):m===l&&r.push({element:u,datasetIndex:h,index:d})}return xn(n,e,t,c),r}function Si(n,t,e,i,s,o){return!o&&!n.isPointInArea(t)?[]:e==="r"&&!i?ed(n,t,e,s):nd(n,t,e,i,s,o)}function bo(n,t,e,i,s){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return xn(n,e,t,(l,c,u)=>{l[r](t[e],s)&&(o.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:o}var id={evaluateInteractionItems:xn,modes:{index(n,t,e,i){const s=be(t,n),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?Ti(n,s,o,i,r):Si(n,s,o,!1,i,r),l=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,h=c.data[u];h&&!h.skip&&l.push({element:h,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,i){const s=be(t,n),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?Ti(n,s,o,i,r):Si(n,s,o,!1,i,r);if(a.length>0){const l=a[0].datasetIndex,c=n.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(n,t,e,i){const s=be(t,n),o=e.axis||"xy",r=e.includeInvisible||!1;return Ti(n,s,o,i,r)},nearest(n,t,e,i){const s=be(t,n),o=e.axis||"xy",r=e.includeInvisible||!1;return Si(n,s,o,e.intersect,i,r)},x(n,t,e,i){const s=be(t,n);return bo(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=be(t,n);return bo(n,s,"y",e.intersect,i)}}};const oa=["left","top","right","bottom"];function We(n,t){return n.filter(e=>e.pos===t)}function yo(n,t){return n.filter(e=>oa.indexOf(e.pos)===-1&&e.box.axis===t)}function He(n,t){return n.sort((e,i)=>{const s=t?i:e,o=t?e:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function sd(n){const t=[];let e,i,s,o,r,a;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function od(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:o}=e;if(!i||!oa.includes(s))continue;const r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function rd(n,t){const e=od(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let o,r,a;for(o=0,r=n.length;o<r;++o){a=n[o];const{fullSize:l}=a.box,c=e[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return e}function ad(n){const t=sd(n),e=He(t.filter(c=>c.box.fullSize),!0),i=He(We(t,"left"),!0),s=He(We(t,"right")),o=He(We(t,"top"),!0),r=He(We(t,"bottom")),a=yo(t,"x"),l=yo(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:We(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function _o(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function ra(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function ld(n,t,e,i){const{pos:s,box:o}=e,r=n.maxPadding;if(!F(s)){e.size&&(n[s]-=e.size);const h=i[e.stack]||{size:0,count:1};h.size=Math.max(h.size,e.horizontal?o.height:o.width),e.size=h.size/h.count,n[s]+=e.size}o.getPadding&&ra(r,o.getPadding());const a=Math.max(0,t.outerWidth-_o(r,n,"left","right")),l=Math.max(0,t.outerHeight-_o(r,n,"top","bottom")),c=a!==n.w,u=l!==n.h;return n.w=a,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function cd(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function ud(n,t){const e=t.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return i(n?["left","right"]:["top","bottom"])}function Qe(n,t,e,i){const s=[];let o,r,a,l,c,u;for(o=0,r=n.length,c=0;o<r;++o){a=n[o],l=a.box,l.update(a.width||t.w,a.height||t.h,ud(a.horizontal,t));const{same:h,other:d}=ld(t,e,a,i);c|=h&&s.length,u=u||d,l.fullSize||s.push(a)}return c&&Qe(s,t,e,i)||u}function An(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function xo(n,t,e,i){const s=e.padding;let{x:o,y:r}=t;for(const a of n){const l=a.box,c=i[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const h=t.w*u,d=c.size||l.height;cn(c.start)&&(r=c.start),l.fullSize?An(l,s.left,r,e.outerWidth-s.right-s.left,d):An(l,t.left+c.placed,r,h,d),c.start=r,c.placed+=h,r=l.bottom}else{const h=t.h*u,d=c.size||l.width;cn(c.start)&&(o=c.start),l.fullSize?An(l,o,s.top,d,e.outerHeight-s.bottom-s.top):An(l,o,t.top+c.placed,d,h),c.start=o,c.placed+=h,o=l.right}}t.x=o,t.y=r}var se={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const s=yt(n.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(e-s.height,0),a=ad(n.boxes),l=a.vertical,c=a.horizontal;$(n.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const u=l.reduce((p,m)=>m.box.options&&m.box.options.display===!1?p:p+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/u,hBoxMaxHeight:r/2}),d=Object.assign({},s);ra(d,yt(i));const f=Object.assign({maxPadding:d,w:o,h:r,x:s.left,y:s.top},s),g=rd(l.concat(c),h);Qe(a.fullSize,f,h,g),Qe(l,f,h,g),Qe(c,f,h,g)&&Qe(l,f,h,g),cd(f),xo(a.leftAndTop,f,h,g),f.x+=f.w,f.y+=f.h,xo(a.rightAndBottom,f,h,g),n.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},$(a.chartArea,p=>{const m=p.box;Object.assign(m,n.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class aa{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class hd extends aa{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const $n="$chartjs",dd={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},vo=n=>n===null||n==="";function fd(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[$n]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",vo(s)){const o=no(n,"width");o!==void 0&&(n.width=o)}if(vo(i))if(n.style.height==="")n.height=n.width/(t||2);else{const o=no(n,"height");o!==void 0&&(n.height=o)}return n}const la=bh?{passive:!0}:!1;function gd(n,t,e){n.addEventListener(t,e,la)}function pd(n,t,e){n.canvas.removeEventListener(t,e,la)}function md(n,t){const e=dd[n.type]||n.type,{x:i,y:s}=be(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function ii(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function bd(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||ii(a.addedNodes,i),r=r&&!ii(a.removedNodes,i);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function yd(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||ii(a.removedNodes,i),r=r&&!ii(a.addedNodes,i);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const fn=new Map;let wo=0;function ca(){const n=window.devicePixelRatio;n!==wo&&(wo=n,fn.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function _d(n,t){fn.size||window.addEventListener("resize",ca),fn.set(n,t)}function xd(n){fn.delete(n),fn.size||window.removeEventListener("resize",ca)}function vd(n,t,e){const i=n.canvas,s=i&&ws(i);if(!s)return;const o=Nr((a,l)=>{const c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return r.observe(s),_d(n,o),r}function Oi(n,t,e){e&&e.disconnect(),t==="resize"&&xd(n)}function wd(n,t,e){const i=n.canvas,s=Nr(o=>{n.ctx!==null&&e(md(o,n))},n);return gd(i,t,s),s}class Md extends aa{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(fd(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[$n])return!1;const i=e[$n].initial;["height","width"].forEach(o=>{const r=i[o];H(r)?e.removeAttribute(o):e.setAttribute(o,r)});const s=i.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[$n],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),r={attach:bd,detach:yd,resize:vd}[e]||wd;s[e]=r(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Oi,detach:Oi,resize:Oi}[e]||pd)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return mh(t,e,i,s)}isAttached(t){const e=ws(t);return!!(e&&e.isConnected)}}function kd(n){return!Kr()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?hd:Md}class Lt{constructor(){k(this,"x");k(this,"y");k(this,"active",!1);k(this,"options");k(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return un(this.x)&&un(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}}k(Lt,"defaults",{}),k(Lt,"defaultRoutes");function Cd(n,t){const e=n.options.ticks,i=Pd(n),s=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?Td(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return Sd(t,c,o,r/s),c;const u=Dd(o,t,s);if(r>0){let h,d;const f=r>1?Math.round((l-a)/(r-1)):null;for(Ln(t,c,u,H(f)?0:a-f,a),h=0,d=r-1;h<d;h++)Ln(t,c,u,o[h],o[h+1]);return Ln(t,c,u,l,H(f)?t.length:l+f),c}return Ln(t,c,u),c}function Pd(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function Dd(n,t,e){const i=Od(n),s=t.length/e;if(!i)return Math.max(s,1);const o=bu(i);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>s)return l}return Math.max(s,1)}function Td(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function Sd(n,t,e,i){let s=0,o=e[0],r;for(i=Math.ceil(i),r=0;r<n.length;r++)r===o&&(t.push(n[r]),s++,o=e[s*i])}function Ln(n,t,e,i,s){const o=S(i,0),r=Math.min(S(s,n.length),n.length);let a=0,l,c,u;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),u=o;u<0;)a++,u=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===u&&(t.push(n[c]),a++,u=Math.round(o+a*e))}function Od(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const Ad=n=>n==="left"?"right":n==="right"?"left":n,Mo=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,ko=(n,t)=>Math.min(t||n,n);function Co(n,t){const e=[],i=n.length/t,s=n.length;let o=0;for(;o<s;o+=i)e.push(n[Math.floor(o)]);return e}function Ld(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),o=n._startPixel,r=n._endPixel,a=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-o,r-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function Rd(n,t){$(n,e=>{const i=e.gc,s=i.length/2;let o;if(s>t){for(o=0;o<s;++o)delete e.data[i[o]];i.splice(0,s)}})}function Ve(n){return n.drawTicks?n.tickLength:0}function Po(n,t){if(!n.display)return 0;const e=ut(n.font,t),i=yt(n.padding);return(K(n.text)?n.text.length:1)*e.lineHeight+i.height}function Fd(n,t){return he(n,{scale:t,type:"scale"})}function Id(n,t,e){return he(n,{tick:e,index:t,type:"tick"})}function Ed(n,t,e){let i=Wr(n);return(e&&t!=="right"||!e&&t==="right")&&(i=Ad(i)),i}function zd(n,t,e,i){const{top:s,left:o,bottom:r,right:a,chart:l}=n,{chartArea:c,scales:u}=l;let h=0,d,f,g;const p=r-s,m=a-o;if(n.isHorizontal()){if(f=kt(i,o,a),F(e)){const b=Object.keys(e)[0],y=e[b];g=u[b].getPixelForValue(y)+p-t}else e==="center"?g=(c.bottom+c.top)/2+p-t:g=Mo(n,e,t);d=a-o}else{if(F(e)){const b=Object.keys(e)[0],y=e[b];f=u[b].getPixelForValue(y)-m+t}else e==="center"?f=(c.left+c.right)/2-m+t:f=Mo(n,e,t);g=kt(i,r,s),h=e==="left"?-at:at}return{titleX:f,titleY:g,maxWidth:d,rotation:h}}class ke extends Lt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=Pt(t,Number.POSITIVE_INFINITY),e=Pt(e,Number.NEGATIVE_INFINITY),i=Pt(i,Number.POSITIVE_INFINITY),s=Pt(s,Number.NEGATIVE_INFINITY),{min:Pt(t,i),max:Pt(e,s),minDefined:et(t),maxDefined:et(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:e,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,r.min)),o||(i=Math.max(i,r.max));return e=o&&e>i?i:e,i=s&&e>i?e:i,{min:Pt(e,Pt(i,e)),max:Pt(i,Pt(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){X(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=qu(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Co(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Cd(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){X(this.options.afterUpdate,[this])}beforeSetDimensions(){X(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){X(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),X(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){X(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=X(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){X(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){X(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=ko(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let r=s,a,l,c;if(!this._isVisible()||!e.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),h=u.widest.width,d=u.highest.height,f=ft(this.chart.width-h,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),h+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-Ve(t.grid)-e.padding-Po(t.title,this.chart.options.font),c=Math.sqrt(h*h+d*d),r=ps(Math.min(Math.asin(ft((u.highest.height+6)/a,-1,1)),Math.asin(ft(l/c,-1,1))-Math.asin(ft(d/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){X(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){X(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Po(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=Ve(o)+l):(t.height=this.maxHeight,t.width=Ve(o)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:h,highest:d}=this._getLabelSizes(),f=i.padding*2,g=At(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(a){const b=i.mirror?0:m*h.width+p*d.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=i.mirror?0:p*h.width+m*d.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,u,m,p)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,f=0;l?c?(d=s*t.width,f=i*e.height):(d=i*t.height,f=s*e.width):o==="start"?f=e.width:o==="end"?d=t.width:o!=="inner"&&(d=t.width/2,f=e.width/2),this.paddingLeft=Math.max((d-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-h+r)*this.width/(this.width-h),0)}else{let u=e.height/2,h=t.height/2;o==="start"?(u=0,h=t.height):o==="end"&&(u=e.height,h=0),this.paddingTop=u+r,this.paddingBottom=h+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){X(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)H(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Co(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/ko(e,i));let c=0,u=0,h,d,f,g,p,m,b,y,x,v,_;for(h=0;h<e;h+=l){if(g=t[h].label,p=this._resolveTickFontOptions(h),s.font=m=p.string,b=o[m]=o[m]||{data:{},gc:[]},y=p.lineHeight,x=v=0,!H(g)&&!K(g))x=ei(s,b.data,b.gc,x,g),v=y;else if(K(g))for(d=0,f=g.length;d<f;++d)_=g[d],!H(_)&&!K(_)&&(x=ei(s,b.data,b.gc,x,_),v+=y);r.push(x),a.push(v),c=Math.max(x,c),u=Math.max(v,u)}Rd(o,e);const w=r.indexOf(c),C=a.indexOf(u),M=T=>({width:r[T]||0,height:a[T]||0});return{first:M(0),last:M(e-1),widest:M(w),highest:M(C),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return xu(this._alignToPixels?fe(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=Id(this.getContext(),t,i))}return this.$context||(this.$context=Fd(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=At(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),h=this.ticks.length+(l?1:0),d=Ve(o),f=[],g=a.setContext(this.getContext()),p=g.display?g.width:0,m=p/2,b=function(U){return fe(i,U,p)};let y,x,v,_,w,C,M,T,A,O,R,st;if(r==="top")y=b(this.bottom),C=this.bottom-d,T=y-m,O=b(t.top)+m,st=t.bottom;else if(r==="bottom")y=b(this.top),O=t.top,st=b(t.bottom)-m,C=y+m,T=this.top+d;else if(r==="left")y=b(this.right),w=this.right-d,M=y-m,A=b(t.left)+m,R=t.right;else if(r==="right")y=b(this.left),A=t.left,R=b(t.right)-m,w=y+m,M=this.left+d;else if(e==="x"){if(r==="center")y=b((t.top+t.bottom)/2+.5);else if(F(r)){const U=Object.keys(r)[0],Q=r[U];y=b(this.chart.scales[U].getPixelForValue(Q))}O=t.top,st=t.bottom,C=y+m,T=C+d}else if(e==="y"){if(r==="center")y=b((t.left+t.right)/2);else if(F(r)){const U=Object.keys(r)[0],Q=r[U];y=b(this.chart.scales[U].getPixelForValue(Q))}w=y-m,M=w-d,A=t.left,R=t.right}const gt=S(s.ticks.maxTicksLimit,h),W=Math.max(1,Math.ceil(h/gt));for(x=0;x<h;x+=W){const U=this.getContext(x),Q=o.setContext(U),Mt=a.setContext(U),lt=Q.lineWidth,Kt=Q.color,Gt=Mt.dash||[],Tt=Mt.dashOffset,Qt=Q.tickWidth,Rt=Q.tickColor,Zt=Q.tickBorderDash||[],Jt=Q.tickBorderDashOffset;v=Ld(this,x,l),v!==void 0&&(_=fe(i,v,lt),c?w=M=A=R=_:C=T=O=st=_,f.push({tx1:w,ty1:C,tx2:M,ty2:T,x1:A,y1:O,x2:R,y2:st,width:lt,color:Kt,borderDash:Gt,borderDashOffset:Tt,tickWidth:Qt,tickColor:Rt,tickBorderDash:Zt,tickBorderDashOffset:Jt}))}return this._ticksLength=h,this._borderValue=y,f}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:h}=o,d=Ve(i.grid),f=d+u,g=h?-u:f,p=-At(this.labelRotation),m=[];let b,y,x,v,_,w,C,M,T,A,O,R,st="middle";if(s==="top")w=this.bottom-g,C=this._getXAxisLabelAlignment();else if(s==="bottom")w=this.top+g,C=this._getXAxisLabelAlignment();else if(s==="left"){const W=this._getYAxisLabelAlignment(d);C=W.textAlign,_=W.x}else if(s==="right"){const W=this._getYAxisLabelAlignment(d);C=W.textAlign,_=W.x}else if(e==="x"){if(s==="center")w=(t.top+t.bottom)/2+f;else if(F(s)){const W=Object.keys(s)[0],U=s[W];w=this.chart.scales[W].getPixelForValue(U)+f}C=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")_=(t.left+t.right)/2-f;else if(F(s)){const W=Object.keys(s)[0],U=s[W];_=this.chart.scales[W].getPixelForValue(U)}C=this._getYAxisLabelAlignment(d).textAlign}e==="y"&&(l==="start"?st="top":l==="end"&&(st="bottom"));const gt=this._getLabelSizes();for(b=0,y=a.length;b<y;++b){x=a[b],v=x.label;const W=o.setContext(this.getContext(b));M=this.getPixelForTick(b)+o.labelOffset,T=this._resolveTickFontOptions(b),A=T.lineHeight,O=K(v)?v.length:1;const U=O/2,Q=W.color,Mt=W.textStrokeColor,lt=W.textStrokeWidth;let Kt=C;r?(_=M,C==="inner"&&(b===y-1?Kt=this.options.reverse?"left":"right":b===0?Kt=this.options.reverse?"right":"left":Kt="center"),s==="top"?c==="near"||p!==0?R=-O*A+A/2:c==="center"?R=-gt.highest.height/2-U*A+A:R=-gt.highest.height+A/2:c==="near"||p!==0?R=A/2:c==="center"?R=gt.highest.height/2-U*A:R=gt.highest.height-O*A,h&&(R*=-1),p!==0&&!W.showLabelBackdrop&&(_+=A/2*Math.sin(p))):(w=M,R=(1-O)*A/2);let Gt;if(W.showLabelBackdrop){const Tt=yt(W.backdropPadding),Qt=gt.heights[b],Rt=gt.widths[b];let Zt=R-Tt.top,Jt=0-Tt.left;switch(st){case"middle":Zt-=Qt/2;break;case"bottom":Zt-=Qt;break}switch(C){case"center":Jt-=Rt/2;break;case"right":Jt-=Rt;break}Gt={left:Jt,top:Zt,width:Rt+Tt.width,height:Qt+Tt.height,color:W.backdropColor}}m.push({label:v,font:T,textOffset:R,options:{rotation:p,color:Q,strokeColor:Mt,strokeWidth:lt,textAlign:Kt,textBaseline:st,translation:[_,w],backdrop:Gt}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-At(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,u;return e==="left"?s?(u=this.right+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?s?(u=this.left+o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(o=0,r=s.length;o<r;++o){const l=s[o];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,h,d;this.isHorizontal()?(c=fe(t,this.left,r)-r/2,u=fe(t,this.right,a)+a/2,h=d=l):(h=fe(t,this.top,r)-r/2,d=fe(t,this.bottom,a)+a/2,c=u=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,h),e.lineTo(u,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&gi(i,s);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,u=r.textOffset;Ie(i,c,0,u,l,a)}s&&pi(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const o=ut(i.font),r=yt(i.padding),a=i.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||F(e)?(l+=r.bottom,K(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;const{titleX:c,titleY:u,maxWidth:h,rotation:d}=zd(this,l,e,a);Ie(t,i.text,0,0,o,{color:i.color,maxWidth:h,rotation:d,textAlign:Ed(a,e,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=S(t.grid&&t.grid.z,-1),s=S(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==ke.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return ut(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Rn{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;Wd(e)&&(i=this.register(e));const s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,Bd(t,r,i),this.override&&nt.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in nt[s]&&(delete nt[s][i],this.override&&delete Me[i])}}function Bd(n,t,e){const i=ln(Object.create(null),[e?nt.get(e):{},nt.get(t),n.defaults]);nt.set(t,i),n.defaultRoutes&&Nd(t,n.defaultRoutes),n.descriptors&&nt.describe(t,n.descriptors)}function Nd(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),o=[n].concat(i).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");nt.route(o,s,l,a)})}function Wd(n){return"id"in n&&"defaults"in n}class Hd{constructor(){this.controllers=new Rn(Xt,"datasets",!0),this.elements=new Rn(Lt,"elements"),this.plugins=new Rn(Object,"plugins"),this.scales=new Rn(ke,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):$(s,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,i){const s=gs(t);X(i["before"+s],[],i),e[t](i),X(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var It=new Hd;class Vd{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,e,i);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,i,s){s=s||{};for(const o of t){const r=o.plugin,a=r[i],l=[e,s,o.options];if(X(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){H(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=S(i.options&&i.options.plugins,{}),o=Yd(i);return s===!1&&!e?[]:Ud(t,o,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function Yd(n){const t={},e=[],i=Object.keys(It.plugins.items);for(let o=0;o<i.length;o++)e.push(It.getPlugin(i[o]));const s=n.plugins||[];for(let o=0;o<s.length;o++){const r=s[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function jd(n,t){return!t&&n===!1?null:n===!0?{}:n}function Ud(n,{plugins:t,localIds:e},i,s){const o=[],r=n.getContext();for(const a of t){const l=a.id,c=jd(i[l],s);c!==null&&o.push({plugin:a,options:$d(n.config,{plugin:a,local:e[l]},c,r)})}return o}function $d(n,{plugin:t,local:e},i,s){const o=n.pluginScopeKeys(t),r=n.getOptionScopes(i,o);return e&&t.defaults&&r.push(t.defaults),n.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Zi(n,t){const e=nt.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function qd(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Xd(n,t){return n===t?"_index_":"_value_"}function Do(n){if(n==="x"||n==="y"||n==="r")return n}function Kd(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Ji(n,...t){if(Do(n))return n;for(const e of t){const i=e.axis||Kd(e.position)||n.length>1&&Do(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function To(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function Gd(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return To(n,"x",e[0])||To(n,"y",e[0])}return{}}function Qd(n,t){const e=Me[n.type]||{scales:{}},i=t.scales||{},s=Zi(n.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!F(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=Ji(r,a,Gd(r,n),nt.scales[a.type]),c=Xd(l,s),u=e.scales||{};o[r]=en(Object.create(null),[{axis:l},a,u[l],u[c]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,l=r.indexAxis||Zi(a,t),u=(Me[a]||{}).scales||{};Object.keys(u).forEach(h=>{const d=qd(h,l),f=r[d+"AxisID"]||d;o[f]=o[f]||Object.create(null),en(o[f],[{axis:d},i[f],u[h]])})}),Object.keys(o).forEach(r=>{const a=o[r];en(a,[nt.scales[a.type],nt.scale])}),o}function ua(n){const t=n.options||(n.options={});t.plugins=S(t.plugins,{}),t.scales=Qd(n,t)}function ha(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Zd(n){return n=n||{},n.data=ha(n.data),ua(n),n}const So=new Map,da=new Set;function Fn(n,t){let e=So.get(n);return e||(e=t(),So.set(n,e),da.add(e)),e}const Ye=(n,t,e)=>{const i=ce(t,e);i!==void 0&&n.add(i)};class Jd{constructor(t){this._config=Zd(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=ha(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),ua(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Fn(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Fn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Fn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Fn(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(e);if(a)return a;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(h=>Ye(l,t,h))),u.forEach(h=>Ye(l,s,h)),u.forEach(h=>Ye(l,Me[o]||{},h)),u.forEach(h=>Ye(l,nt,h)),u.forEach(h=>Ye(l,Ki,h))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),da.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Me[e]||{},nt.datasets[e]||{},{type:e},nt,Ki]}resolveNamedOptions(t,e,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Oo(this._resolverCache,t,s);let l=r;if(ef(r,e)){o.$shared=!1,i=ue(i)?i():i;const c=this.createResolver(t,i,a);l=Ee(r,i,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,i=[""],s){const{resolver:o}=Oo(this._resolverCache,t,i);return F(e)?Ee(o,e,void 0,s):o}}function Oo(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let o=i.get(s);return o||(o={resolver:_s(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}const tf=n=>F(n)&&Object.getOwnPropertyNames(n).reduce((t,e)=>t||ue(n[e]),!1);function ef(n,t){const{isScriptable:e,isIndexable:i}=jr(n);for(const s of t){const o=e(s),r=i(s),a=(r||o)&&n[s];if(o&&(ue(a)||tf(a))||r&&K(a))return!0}return!1}var nf="4.4.0";const sf=["top","bottom","left","right","chartArea"];function Ao(n,t){return n==="top"||n==="bottom"||sf.indexOf(n)===-1&&t==="x"}function Lo(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Ro(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),X(e&&e.onComplete,[n],t)}function of(n){const t=n.chart,e=t.options.animation;X(e&&e.onProgress,[n],t)}function fa(n){return Kr()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const qn={},Fo=n=>{const t=fa(n);return Object.values(qn).filter(e=>e.canvas===t).pop()};function rf(n,t,e){const i=Object.keys(n);for(const s of i){const o=+s;if(o>=t){const r=n[s];delete n[s],(e>0||o>t)&&(n[o+e]=r)}}}function af(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function In(n,t,e){return n.options.clip?n[e]:t[e]}function lf(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:In(e,t,"left"),right:In(e,t,"right"),top:In(i,t,"top"),bottom:In(i,t,"bottom")}:t}class mt{static register(...t){It.add(...t),Io()}static unregister(...t){It.remove(...t),Io()}constructor(t,e){const i=this.config=new Jd(e),s=fa(t),o=Fo(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||kd(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=lu(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Vd,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ku(h=>this.update(h),r.resizeDelay||0),this._dataChanges=[],qn[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Yt.listen(this,"complete",Ro),Yt.listen(this,"progress",of),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:o}=this;return H(t)?e&&o?o:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return It}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():eo(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Zs(this.canvas,this.ctx),this}stop(){return Yt.stop(this),this}resize(t,e){Yt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,e,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,eo(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),X(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};$(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=Ji(r,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),$(o,r=>{const a=r.options,l=a.id,c=Ji(l,a),u=S(a.type,r.dtype);(a.position===void 0||Ao(a.position,c)!==Ao(r.dposition))&&(a.position=r.dposition),s[l]=!0;let h=null;if(l in i&&i[l].type===u)h=i[l];else{const d=It.getScale(u);h=new d({id:l,type:u,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(a,t)}),$(s,(r,a)=>{r||delete i[a]}),$(i,r=>{se.configure(this,r,r.options),se.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Lo("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const o=e[i];let r=this.getDatasetMeta(i);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=a,r.indexAxis=o.indexAxis||Zi(a,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{const l=It.getController(a),{datasetElementType:c,dataElementType:u}=nt.datasets[a];Object.assign(l,{dataElementType:It.getElement(u),datasetElementType:c&&It.getElement(c)}),r.controller=new l(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){$(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:h}=this.getDatasetMeta(c),d=!s&&o.indexOf(h)===-1;h.buildOrUpdateElements(d),r=Math.max(+h.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||$(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Lo("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){$(this.scales,t=>{se.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!js(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of e){const r=i==="_removeElements"?-o:o;rf(t,s,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=i(0);for(let o=1;o<e;o++)if(!js(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;se.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],$(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,ue(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Yt.has(this)?this.attached&&!Yt.running(this)&&Yt.start(this):(this.draw(),Ro({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resize(i,s),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,o;for(s=0,o=e.length;s<o;++s){const r=e[s];(!t||r.visible)&&i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,o=lf(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&gi(e,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),t.controller.draw(),s&&pi(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return qt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const o=id.modes[e];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(o=>o&&o._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=he(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);cn(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Yt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Zs(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete qn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};$(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){$(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},$(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!Zn(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),r=o(e,t),a=i?t:o(t,e);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const o=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:o}=this,r=e,a=this._getActiveElements(t,s,i,r),l=gu(t),c=af(t,this._lastEvent,i,l);i&&(this._lastEvent=null,X(o.onHover,[t,a,this],this),l&&X(o.onClick,[t,a,this],this));const u=!Zn(a,s);return(u||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}k(mt,"defaults",nt),k(mt,"instances",qn),k(mt,"overrides",Me),k(mt,"registry",It),k(mt,"version",nf),k(mt,"getChart",Fo);function Io(){return $(mt.instances,n=>n._plugins.invalidate())}function cf(n,t,e){const{startAngle:i,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=s/a;n.beginPath(),n.arc(o,r,a,i-c,e+c),l>s?(c=s/l,n.arc(o,r,l,e+c,i-c,!0)):n.arc(o,r,s,e+at,i-at),n.closePath(),n.clip()}function uf(n){return ys(n,["outerStart","outerEnd","innerStart","innerEnd"])}function hf(n,t,e,i){const s=uf(n.options.borderRadius),o=(e-t)/2,r=Math.min(o,i*t/2),a=l=>{const c=(e-Math.min(o,l))*i/2;return ft(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:ft(s.innerStart,0,r),innerEnd:ft(s.innerEnd,0,r)}}function Pe(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function si(n,t,e,i,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,h=Math.max(t.outerRadius+i+e-c,0),d=u>0?u+i+e+c:0;let f=0;const g=s-l;if(i){const W=u>0?u-i:0,U=h>0?h-i:0,Q=(W+U)/2,Mt=Q!==0?g*Q/(Q+i):g;f=(g-Mt)/2}const p=Math.max(.001,g*h-e/tt)/h,m=(g-p)/2,b=l+m+f,y=s-m-f,{outerStart:x,outerEnd:v,innerStart:_,innerEnd:w}=hf(t,d,h,y-b),C=h-x,M=h-v,T=b+x/C,A=y-v/M,O=d+_,R=d+w,st=b+_/O,gt=y-w/R;if(n.beginPath(),o){const W=(T+A)/2;if(n.arc(r,a,h,T,W),n.arc(r,a,h,W,A),v>0){const lt=Pe(M,A,r,a);n.arc(lt.x,lt.y,v,A,y+at)}const U=Pe(R,y,r,a);if(n.lineTo(U.x,U.y),w>0){const lt=Pe(R,gt,r,a);n.arc(lt.x,lt.y,w,y+at,gt+Math.PI)}const Q=(y-w/d+(b+_/d))/2;if(n.arc(r,a,d,y-w/d,Q,!0),n.arc(r,a,d,Q,b+_/d,!0),_>0){const lt=Pe(O,st,r,a);n.arc(lt.x,lt.y,_,st+Math.PI,b-at)}const Mt=Pe(C,b,r,a);if(n.lineTo(Mt.x,Mt.y),x>0){const lt=Pe(C,T,r,a);n.arc(lt.x,lt.y,x,b-at,T)}}else{n.moveTo(r,a);const W=Math.cos(T)*h+r,U=Math.sin(T)*h+a;n.lineTo(W,U);const Q=Math.cos(A)*h+r,Mt=Math.sin(A)*h+a;n.lineTo(Q,Mt)}n.closePath()}function df(n,t,e,i,s){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){si(n,t,e,i,l,s);for(let c=0;c<o;++c)n.fill();isNaN(a)||(l=r+(a%G||G))}return si(n,t,e,i,l,s),n.fill(),l}function ff(n,t,e,i,s){const{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:h,borderDashOffset:d}=l,f=l.borderAlign==="inner";if(!c)return;n.setLineDash(h||[]),n.lineDashOffset=d,f?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let g=t.endAngle;if(o){si(n,t,e,i,g,s);for(let p=0;p<o;++p)n.stroke();isNaN(a)||(g=r+(a%G||G))}f&&cf(n,t,g),o||(si(n,t,e,i,g,s),n.stroke())}class Ze extends Lt{constructor(e){super();k(this,"circumference");k(this,"endAngle");k(this,"fullCircles");k(this,"innerRadius");k(this,"outerRadius");k(this,"pixelMargin");k(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,s){const o=this.getProps(["x","y"],s),{angle:r,distance:a}=Ir(o,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),f=(this.options.spacing+this.options.borderWidth)/2,p=S(d,c-l)>=G||hn(r,l,c),m=$t(a,u+f,h+f);return p&&m}getCenterPoint(e){const{x:i,y:s,startAngle:o,endAngle:r,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,h=(o+r)/2,d=(a+l+u+c)/2;return{x:i+Math.cos(h)*d,y:s+Math.sin(h)*d}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,o=(i.offset||0)/4,r=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>G?Math.floor(s/G):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(tt,s||0)),u=o*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,df(e,this,u,r,a),ff(e,this,u,r,a),e.restore()}}k(Ze,"id","arc"),k(Ze,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),k(Ze,"defaultRoutes",{backgroundColor:"backgroundColor"}),k(Ze,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function ga(n,t,e=t){n.lineCap=S(e.borderCapStyle,t.borderCapStyle),n.setLineDash(S(e.borderDash,t.borderDash)),n.lineDashOffset=S(e.borderDashOffset,t.borderDashOffset),n.lineJoin=S(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=S(e.borderWidth,t.borderWidth),n.strokeStyle=S(e.borderColor,t.borderColor)}function gf(n,t,e){n.lineTo(e.x,e.y)}function pf(n){return n.stepped?Bu:n.tension||n.cubicInterpolationMode==="monotone"?Nu:gf}function pa(n,t,e={}){const i=n.length,{start:s=0,end:o=i-1}=e,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),u=s<r&&o<r||s>a&&o>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function mf(n,t,e,i){const{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=pa(s,e,i),u=pf(o);let{move:h=!0,reverse:d}=i||{},f,g,p;for(f=0;f<=c;++f)g=s[(a+(d?c-f:f))%r],!g.skip&&(h?(n.moveTo(g.x,g.y),h=!1):u(n,p,g,d,o.stepped),p=g);return l&&(g=s[(a+(d?c:0))%r],u(n,p,g,d,o.stepped)),!!l}function bf(n,t,e,i){const s=t.points,{count:o,start:r,ilen:a}=pa(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,h=0,d,f,g,p,m,b;const y=v=>(r+(c?a-v:v))%o,x=()=>{p!==m&&(n.lineTo(u,m),n.lineTo(u,p),n.lineTo(u,b))};for(l&&(f=s[y(0)],n.moveTo(f.x,f.y)),d=0;d<=a;++d){if(f=s[y(d)],f.skip)continue;const v=f.x,_=f.y,w=v|0;w===g?(_<p?p=_:_>m&&(m=_),u=(h*u+v)/++h):(x(),n.lineTo(v,_),g=w,h=0,p=m=_),b=_}x()}function ts(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?bf:mf}function yf(n){return n.stepped?yh:n.tension||n.cubicInterpolationMode==="monotone"?_h:ye}function _f(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),ga(n,t.options),n.stroke(s)}function xf(n,t,e,i){const{segments:s,options:o}=t,r=ts(t);for(const a of s)ga(n,o,a.style),n.beginPath(),r(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const vf=typeof Path2D=="function";function wf(n,t,e,i){vf&&!t.options.segment?_f(n,t,e,i):xf(n,t,e,i)}class oe extends Lt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;uh(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Ch(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],o=this.points,r=ta(this,{property:e,start:s,end:s});if(!r.length)return;const a=[],l=yf(i);let c,u;for(c=0,u=r.length;c<u;++c){const{start:h,end:d}=r[c],f=o[h],g=o[d];if(f===g){a.push(f);continue}const p=Math.abs((s-f[e])/(g[e]-f[e])),m=l(f,g,p,i.stepped);m[e]=t[e],a.push(m)}return a.length===1?a[0]:a}pathSegment(t,e,i){return ts(this)(t,this,e,i)}path(t,e,i){const s=this.segments,o=ts(this);let r=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)r&=o(t,this,a,{start:e,end:e+i-1});return!!r}draw(t,e,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),wf(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}k(oe,"id","line"),k(oe,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),k(oe,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),k(oe,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Eo(n,t,e,i){const s=n.options,{[e]:o}=n.getProps([e],i);return Math.abs(t-o)<s.radius+s.hitRadius}class Xn extends Lt{constructor(e){super();k(this,"parsed");k(this,"skip");k(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,s){const o=this.options,{x:r,y:a}=this.getProps(["x","y"],s);return Math.pow(e-r,2)+Math.pow(i-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,i){return Eo(this,e,"x",i)}inYRange(e,i){return Eo(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!qt(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Gi(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}k(Xn,"id","point"),k(Xn,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),k(Xn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function ma(n,t){const{x:e,y:i,base:s,width:o,height:r}=n.getProps(["x","y","base","width","height"],t);let a,l,c,u,h;return n.horizontal?(h=r/2,a=Math.min(e,s),l=Math.max(e,s),c=i-h,u=i+h):(h=o/2,a=e-h,l=e+h,c=Math.min(i,s),u=Math.max(i,s)),{left:a,top:c,right:l,bottom:u}}function re(n,t,e,i){return n?0:ft(t,e,i)}function Mf(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,o=Yr(i);return{t:re(s.top,o.top,0,e),r:re(s.right,o.right,0,t),b:re(s.bottom,o.bottom,0,e),l:re(s.left,o.left,0,t)}}function kf(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,o=ve(s),r=Math.min(t,e),a=n.borderSkipped,l=i||F(s);return{topLeft:re(!l||a.top||a.left,o.topLeft,0,r),topRight:re(!l||a.top||a.right,o.topRight,0,r),bottomLeft:re(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:re(!l||a.bottom||a.right,o.bottomRight,0,r)}}function Cf(n){const t=ma(n),e=t.right-t.left,i=t.bottom-t.top,s=Mf(n,e/2,i/2),o=kf(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function Ai(n,t,e,i){const s=t===null,o=e===null,a=n&&!(s&&o)&&ma(n,i);return a&&(s||$t(t,a.left,a.right))&&(o||$t(e,a.top,a.bottom))}function Pf(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Df(n,t){n.rect(t.x,t.y,t.w,t.h)}function Li(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,o=(n.x+n.w!==e.x+e.w?t:0)-i,r=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+o,h:n.h+r,radius:n.radius}}class Kn extends Lt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:o,outer:r}=Cf(this),a=Pf(r.radius)?dn:Df;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,Li(r,e,o)),t.clip(),a(t,Li(o,-e,r)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,Li(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return Ai(this,t,e,i)}inXRange(t,e){return Ai(this,t,null,e)}inYRange(t,e){return Ai(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+s)/2:e,y:o?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}k(Kn,"id","bar"),k(Kn,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),k(Kn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const es=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],zo=es.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function ba(n){return es[n%es.length]}function ya(n){return zo[n%zo.length]}function Tf(n,t){return n.borderColor=ba(t),n.backgroundColor=ya(t),++t}function Sf(n,t){return n.backgroundColor=n.data.map(()=>ba(t++)),t}function Of(n,t){return n.backgroundColor=n.data.map(()=>ya(t++)),t}function Af(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof Le?t=Sf(e,t):s instanceof Un?t=Of(e,t):s&&(t=Tf(e,t))}}function Bo(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function Lf(n){return n&&(n.borderColor||n.backgroundColor)}var Rf={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:o}=s;if(!e.forceOverride&&(Bo(i)||Lf(s)||o&&Bo(o)))return;const r=Af(n);i.forEach(r)}};function Ff(n,t,e){const i=n.segments,s=n.points,o=t.points,r=[];for(const a of i){let{start:l,end:c}=a;c=ks(l,c,s);const u=ns(e,s[l],s[c],a.loop);if(!t.segments){r.push({source:a,target:u,start:s[l],end:s[c]});continue}const h=ta(t,u);for(const d of h){const f=ns(e,o[d.start],o[d.end],d.loop),g=Jr(a,s,f);for(const p of g)r.push({source:p,target:d,start:{[e]:No(u,f,"start",Math.max)},end:{[e]:No(u,f,"end",Math.min)}})}}return r}function ns(n,t,e,i){if(i)return;let s=t[n],o=e[n];return n==="angle"&&(s=Dt(s),o=Dt(o)),{property:n,start:s,end:o}}function If(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=ks(r,a,s);const l=s[r],c=s[a];i!==null?(o.push({x:l.x,y:i}),o.push({x:c.x,y:i})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function ks(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function No(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function _a(n,t){let e=[],i=!1;return K(n)?(i=!0,e=n):e=If(n,t),e.length?new oe({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Wo(n){return n&&n.fill!==!1}function Ef(n,t,e){let s=n[t].fill;const o=[t];let r;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!et(s))return s;if(r=n[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function zf(n,t,e){const i=Hf(n);if(F(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return et(s)&&Math.floor(s)===s?Bf(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Bf(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Nf(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:F(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Wf(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:F(n)?i=n.value:i=t.getBaseValue(),i}function Hf(n){const t=n.options,e=t.fill;let i=S(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Vf(n){const{scale:t,index:e,line:i}=n,s=[],o=i.segments,r=i.points,a=Yf(t,e);a.push(_a({x:null,y:t.bottom},i));for(let l=0;l<o.length;l++){const c=o[l];for(let u=c.start;u<=c.end;u++)jf(s,r[u],a)}return new oe({points:s,options:{}})}function Yf(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const o=i[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function jf(n,t,e){const i=[];for(let s=0;s<e.length;s++){const o=e[s],{first:r,last:a,point:l}=Uf(o,t,"x");if(!(!l||r&&a)){if(r)i.unshift(l);else if(n.push(l),!a)break}}n.push(...i)}function Uf(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],o=n.segments,r=n.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const u=o[c],h=r[u.start][e],d=r[u.end][e];if($t(s,h,d)){a=s===h,l=s===d;break}}return{first:a,last:l,point:i}}class xa{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:o,radius:r}=this;return e=e||{start:0,end:G},t.arc(s,o,r,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,o=t.angle;return{x:e+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}}function $f(n){const{chart:t,fill:e,line:i}=n;if(et(e))return qf(t,e);if(e==="stack")return Vf(n);if(e==="shape")return!0;const s=Xf(n);return s instanceof xa?s:_a(s,i)}function qf(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Xf(n){return(n.scale||{}).getPointPositionForValue?Gf(n):Kf(n)}function Kf(n){const{scale:t={},fill:e}=n,i=Nf(e,t);if(et(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Gf(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,o=i.reverse?t.max:t.min,r=Wf(e,t,o),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,o);return new xa({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,r));return a}function Ri(n,t,e){const i=$f(t),{line:s,scale:o,axis:r}=t,a=s.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:h=c}=l||{};i&&s.points.length&&(gi(n,e),Qf(n,{line:s,target:i,above:u,below:h,area:e,scale:o,axis:r}),pi(n))}function Qf(n,t){const{line:e,target:i,above:s,below:o,area:r,scale:a}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&o!==s&&(Ho(n,i,r.top),Vo(n,{line:e,target:i,color:s,scale:a,property:l}),n.restore(),n.save(),Ho(n,i,r.bottom)),Vo(n,{line:e,target:i,color:o,scale:a,property:l}),n.restore()}function Ho(n,t,e){const{segments:i,points:s}=t;let o=!0,r=!1;n.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],h=s[ks(l,c,s)];o?(n.moveTo(u.x,u.y),o=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),r=!!t.pathSegment(n,a,{move:r}),r?n.closePath():n.lineTo(h.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Vo(n,t){const{line:e,target:i,property:s,color:o,scale:r}=t,a=Ff(e,i,s);for(const{source:l,target:c,start:u,end:h}of a){const{style:{backgroundColor:d=o}={}}=l,f=i!==!0;n.save(),n.fillStyle=d,Zf(n,r,f&&ns(s,u,h)),n.beginPath();const g=!!e.pathSegment(n,l);let p;if(f){g?n.closePath():Yo(n,i,h,s);const m=!!i.pathSegment(n,c,{move:g,reverse:!0});p=g&&m,p||Yo(n,i,u,s)}n.closePath(),n.fill(p?"evenodd":"nonzero"),n.restore()}}function Zf(n,t,e){const{top:i,bottom:s}=t.chart.chartArea,{property:o,start:r,end:a}=e||{};o==="x"&&(n.beginPath(),n.rect(r,i,a-r,s-i),n.clip())}function Yo(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Jf={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let o,r,a,l;for(r=0;r<i;++r)o=n.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof oe&&(l={visible:n.isDatasetVisible(r),index:r,fill:zf(a,r,i),chart:n,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,s.push(l);for(r=0;r<i;++r)l=s[r],!(!l||l.fill===!1)&&(l.fill=Ef(s,r,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),o=n.chartArea;for(let r=s.length-1;r>=0;--r){const a=s[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),i&&a.fill&&Ri(n.ctx,a,o))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;Wo(o)&&Ri(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Wo(i)||e.drawTime!=="beforeDatasetDraw"||Ri(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const jo=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},tg=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Uo extends Lt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=X(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=ut(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=jo(i,o);let c,u;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(r,o,a,l)+10):(u=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let h=t;o.textAlign="left",o.textBaseline="middle";let d=-1,f=-u;return this.legendItems.forEach((g,p)=>{const m=i+e/2+o.measureText(g.text).width;(p===0||c[c.length-1]+m+2*a>r)&&(h+=u,c[c.length-(p>0?0:1)]=0,f+=u,d++),l[p]={left:0,top:f,row:d,width:m,height:s},c[c.length-1]+=m+a}),h}_fitCols(t,e,i,s){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=r-t;let h=a,d=0,f=0,g=0,p=0;return this.legendItems.forEach((m,b)=>{const{itemWidth:y,itemHeight:x}=eg(i,e,o,m,s);b>0&&f+x+2*a>u&&(h+=d+a,c.push({width:d,height:f}),g+=d+a,p++,d=f=0),l[b]={left:g,top:f,col:p,width:y,height:x},d=Math.max(d,y),f+=x+a}),h+=d,c.push({width:d,height:f}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,r=Fe(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=kt(i,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=kt(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=kt(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=kt(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;gi(t,this),this._draw(),pi(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=nt.color,l=Fe(t.rtl,this.left,this.width),c=ut(r.font),{padding:u}=r,h=c.size,d=h/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:g,boxHeight:p,itemHeight:m}=jo(r,h),b=function(w,C,M){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;s.save();const T=S(M.lineWidth,1);if(s.fillStyle=S(M.fillStyle,a),s.lineCap=S(M.lineCap,"butt"),s.lineDashOffset=S(M.lineDashOffset,0),s.lineJoin=S(M.lineJoin,"miter"),s.lineWidth=T,s.strokeStyle=S(M.strokeStyle,a),s.setLineDash(S(M.lineDash,[])),r.usePointStyle){const A={radius:p*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:T},O=l.xPlus(w,g/2),R=C+d;Vr(s,A,O,R,r.pointStyleWidth&&g)}else{const A=C+Math.max((h-p)/2,0),O=l.leftForLtr(w,g),R=ve(M.borderRadius);s.beginPath(),Object.values(R).some(st=>st!==0)?dn(s,{x:O,y:A,w:g,h:p,radius:R}):s.rect(O,A,g,p),s.fill(),T!==0&&s.stroke()}s.restore()},y=function(w,C,M){Ie(s,M.text,w,C+m/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},x=this.isHorizontal(),v=this._computeTitleHeight();x?f={x:kt(o,this.left+u,this.right-i[0]),y:this.top+u+v,line:0}:f={x:this.left+u,y:kt(o,this.top+v+u,this.bottom-e[0].height),line:0},Gr(this.ctx,t.textDirection);const _=m+u;this.legendItems.forEach((w,C)=>{s.strokeStyle=w.fontColor,s.fillStyle=w.fontColor;const M=s.measureText(w.text).width,T=l.textAlign(w.textAlign||(w.textAlign=r.textAlign)),A=g+d+M;let O=f.x,R=f.y;l.setWidth(this.width),x?C>0&&O+A+u>this.right&&(R=f.y+=_,f.line++,O=f.x=kt(o,this.left+u,this.right-i[f.line])):C>0&&R+_>this.bottom&&(O=f.x=O+e[f.line].width+u,f.line++,R=f.y=kt(o,this.top+v+u,this.bottom-e[f.line].height));const st=l.x(O);if(b(st,R,w),O=Cu(T,O+g+d,x?O+A:this.right,t.rtl),y(l.x(O),R,w),x)f.x+=A+u;else if(typeof w.text!="string"){const gt=c.lineHeight;f.y+=va(w,gt)+u}else f.y+=_}),Qr(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=ut(e.font),s=yt(e.padding);if(!e.display)return;const o=Fe(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=i.size/2,c=s.top+l;let u,h=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),u=this.top+c,h=kt(t.align,h,this.right-d);else{const g=this.columnSizes.reduce((p,m)=>Math.max(p,m.height),0);u=c+kt(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const f=kt(a,h,h+d);r.textAlign=o.textAlign(Wr(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=i.string,Ie(r,e.text,f,u,i)}_computeTitleHeight(){const t=this.options.title,e=ut(t.font),i=yt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,o;if($t(t,this.left,this.right)&&$t(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],$t(t,s.left,s.left+s.width)&&$t(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!sg(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=tg(s,i);s&&!o&&X(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&X(e.onHover,[t,i,this],this)}else i&&X(e.onClick,[t,i,this],this)}}function eg(n,t,e,i,s){const o=ng(i,n,t,e),r=ig(s,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function ng(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+i.measureText(s).width}function ig(n,t,e){let i=n;return typeof t.text!="string"&&(i=va(t,e)),i}function va(n,t){const e=n.text?n.text.length:0;return t*e}function sg(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var og={id:"legend",_element:Uo,start(n,t,e){const i=n.legend=new Uo({ctx:n.ctx,options:e,chart:n});se.configure(n,i,e),se.addBox(n,i)},stop(n){se.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;se.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=yt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};const Je={average(n){if(!n.length)return!1;let t,e,i=0,s=0,o=0;for(t=0,e=n.length;t<e;++t){const r=n[t].element;if(r&&r.hasValue()){const a=r.tooltipPosition();i+=a.x,s+=a.y,++o}}return{x:i/o,y:s/o}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=n.length;o<r;++o){const l=n[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Xi(t,c);u<s&&(s=u,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Ft(n,t){return t&&(K(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function jt(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(``)>-1?n.split(`-`):n}function rg(n,t){const{element:e,datasetIndex:i,index:s}=t,o=n.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:n,label:r,parsed:o.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function $o(n,t){const e=n.chart.ctx,{body:i,footer:s,title:o}=n,{boxWidth:r,boxHeight:a}=t,l=ut(t.bodyFont),c=ut(t.titleFont),u=ut(t.footerFont),h=o.length,d=s.length,f=i.length,g=yt(t.padding);let p=g.height,m=0,b=i.reduce((v,_)=>v+_.before.length+_.lines.length+_.after.length,0);if(b+=n.beforeBody.length+n.afterBody.length,h&&(p+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),b){const v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=f*v+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}d&&(p+=t.footerMarginTop+d*u.lineHeight+(d-1)*t.footerSpacing);let y=0;const x=function(v){m=Math.max(m,e.measureText(v).width+y)};return e.save(),e.font=c.string,$(n.title,x),e.font=l.string,$(n.beforeBody.concat(n.afterBody),x),y=t.displayColors?r+2+t.boxPadding:0,$(i,v=>{$(v.before,x),$(v.lines,x),$(v.after,x)}),y=0,e.font=u.string,$(n.footer,x),e.restore(),m+=g.width,{width:m,height:p}}function ag(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function lg(n,t,e,i){const{x:s,width:o}=i,r=e.caretSize+e.caretPadding;if(n==="left"&&s+o+r>t.width||n==="right"&&s-o-r<0)return!0}function cg(n,t,e,i){const{x:s,width:o}=e,{width:r,chartArea:{left:a,right:l}}=n;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),lg(c,n,t,e)&&(c="center"),c}function qo(n,t,e){const i=e.yAlign||t.yAlign||ag(n,e);return{xAlign:e.xAlign||t.xAlign||cg(n,t,e,i),yAlign:i}}function ug(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function hg(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function Xo(n,t,e,i){const{caretSize:s,caretPadding:o,cornerRadius:r}=n,{xAlign:a,yAlign:l}=e,c=s+o,{topLeft:u,topRight:h,bottomLeft:d,bottomRight:f}=ve(r);let g=ug(t,a);const p=hg(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(u,d)+s:a==="right"&&(g+=Math.max(h,f)+s),{x:ft(g,0,i.width-t.width),y:ft(p,0,i.height-t.height)}}function En(n,t,e){const i=yt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Ko(n){return Ft([],jt(n))}function dg(n,t,e){return he(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Go(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const wa={beforeTitle:Wt,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Wt,beforeBody:Wt,beforeLabel:Wt,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return H(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Wt,afterBody:Wt,beforeFooter:Wt,footer:Wt,afterFooter:Wt};function _t(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?wa[t].call(e,i):s}class is extends Lt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,o=new ea(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=dg(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=_t(i,"beforeTitle",this,t),o=_t(i,"title",this,t),r=_t(i,"afterTitle",this,t);let a=[];return a=Ft(a,jt(s)),a=Ft(a,jt(o)),a=Ft(a,jt(r)),a}getBeforeBody(t,e){return Ko(_t(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return $(t,o=>{const r={before:[],lines:[],after:[]},a=Go(i,o);Ft(r.before,jt(_t(a,"beforeLabel",this,o))),Ft(r.lines,_t(a,"label",this,o)),Ft(r.after,jt(_t(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,e){return Ko(_t(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=_t(i,"beforeFooter",this,t),o=_t(i,"footer",this,t),r=_t(i,"afterFooter",this,t);let a=[];return a=Ft(a,jt(s)),a=Ft(a,jt(o)),a=Ft(a,jt(r)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(rg(this.chart,e[l]));return t.filter&&(a=a.filter((u,h,d)=>t.filter(u,h,d,i))),t.itemSort&&(a=a.sort((u,h)=>t.itemSort(u,h,i))),$(a,u=>{const h=Go(t.callbacks,u);s.push(_t(h,"labelColor",this,u)),o.push(_t(h,"labelPointStyle",this,u)),r.push(_t(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=Je[i.position].call(this,s,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const l=this._size=$o(this,i),c=Object.assign({},a,l),u=qo(this.chart,i,c),h=Xo(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const o=this.getCaretPosition(t,i,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:h}=ve(a),{x:d,y:f}=t,{width:g,height:p}=e;let m,b,y,x,v,_;return o==="center"?(v=f+p/2,s==="left"?(m=d,b=m-r,x=v+r,_=v-r):(m=d+g,b=m+r,x=v-r,_=v+r),y=m):(s==="left"?b=d+Math.max(l,u)+r:s==="right"?b=d+g-Math.max(c,h)-r:b=this.caretX,o==="top"?(x=f,v=x-r,m=b-r,y=b+r):(x=f+p,v=x+r,m=b+r,y=b-r),_=x),{x1:m,x2:b,x3:y,y1:x,y2:v,y3:_}}drawTitle(t,e,i){const s=this.title,o=s.length;let r,a,l;if(o){const c=Fe(i.rtl,this.x,this.width);for(t.x=En(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",r=ut(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,o){const r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,u=ut(o.bodyFont),h=En(this,"left",o),d=s.x(h),f=l<u.lineHeight?(u.lineHeight-l)/2:0,g=e.y+f;if(o.usePointStyle){const p={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},m=s.leftForLtr(d,c)+c/2,b=g+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Gi(t,p,m,b),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Gi(t,p,m,b)}else{t.lineWidth=F(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const p=s.leftForLtr(d,c),m=s.leftForLtr(s.xPlus(d,1),c-2),b=ve(r.borderRadius);Object.values(b).some(y=>y!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,dn(t,{x:p,y:g,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),dn(t,{x:m,y:g+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(p,g,c,l),t.strokeRect(p,g,c,l),t.fillStyle=r.backgroundColor,t.fillRect(m,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,h=ut(i.bodyFont);let d=h.lineHeight,f=0;const g=Fe(i.rtl,this.x,this.width),p=function(M){e.fillText(M,g.x(t.x+f),t.y+d/2),t.y+=d+o},m=g.textAlign(r);let b,y,x,v,_,w,C;for(e.textAlign=r,e.textBaseline="middle",e.font=h.string,t.x=En(this,m,i),e.fillStyle=i.bodyColor,$(this.beforeBody,p),f=a&&m!=="right"?r==="center"?c/2+u:c+2+u:0,v=0,w=s.length;v<w;++v){for(b=s[v],y=this.labelTextColors[v],e.fillStyle=y,$(b.before,p),x=b.lines,a&&x.length&&(this._drawColorBox(e,t,v,g,i),d=Math.max(h.lineHeight,l)),_=0,C=x.length;_<C;++_)p(x[_]),d=h.lineHeight;$(b.after,p)}f=0,d=h.lineHeight,$(this.afterBody,p),t.y-=o}drawFooter(t,e,i){const s=this.footer,o=s.length;let r,a;if(o){const l=Fe(i.rtl,this.x,this.width);for(t.x=En(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",r=ut(i.footerFont),e.fillStyle=i.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:h,topRight:d,bottomLeft:f,bottomRight:g}=ve(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+h,l),r==="top"&&this.drawCaret(t,e,i,s),e.lineTo(a+c-d,l),e.quadraticCurveTo(a+c,l,a+c,l+d),r==="center"&&o==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+c,l+u-g),e.quadraticCurveTo(a+c,l+u,a+c-g,l+u),r==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+f,l+u),e.quadraticCurveTo(a,l+u,a,l+u-f),r==="center"&&o==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,l+h),e.quadraticCurveTo(a,l,a+h,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const r=Je[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=$o(this,t),l=Object.assign({},r,this._size),c=qo(e,t,l),u=Xo(t,l,c,e);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=yt(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,e),Gr(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Qr(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!Zn(i,s),r=this._positionChanged(s,e);(o||r)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,i),a=this._positionChanged(r,t),l=e||!Zn(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e;const r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:i,caretY:s,options:o}=this,r=Je[o.position].call(this,t,e);return r!==!1&&(i!==r.x||s!==r.y)}}k(is,"positioners",Je);var fg={id:"tooltip",_element:is,positioners:Je,afterInit(n,t,e){e&&(n.tooltip=new is({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:wa},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const gg=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function pg(n,t,e,i){const s=n.indexOf(t);if(s===-1)return gg(n,t,e,i);const o=n.lastIndexOf(t);return s!==o?e:s}const mg=(n,t)=>n===null?null:ft(Math.round(n),0,t);function Qo(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class ss extends ke{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:o}of e)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(H(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:pg(i,t,S(e,t),this._addedLabels),mg(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=t;r<=e;r++)s.push({value:r});return s}getLabelForValue(t){return Qo.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}k(ss,"id","category"),k(ss,"defaults",{ticks:{callback:Qo}});function bg(n,t){const e=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:u,maxDigits:h,includeBounds:d}=n,f=o||1,g=u-1,{min:p,max:m}=t,b=!H(r),y=!H(a),x=!H(c),v=(m-p)/(h+1);let _=$s((m-p)/g/f)*f,w,C,M,T;if(_<1e-14&&!b&&!y)return[{value:p},{value:m}];T=Math.ceil(m/_)-Math.floor(p/_),T>g&&(_=$s(T*_/g/f)*f),H(l)||(w=Math.pow(10,l),_=Math.ceil(_*w)/w),s==="ticks"?(C=Math.floor(p/_)*_,M=Math.ceil(m/_)*_):(C=p,M=m),b&&y&&o&&yu((a-r)/o,_/1e3)?(T=Math.round(Math.min((a-r)/_,u)),_=(a-r)/T,C=r,M=a):x?(C=b?r:C,M=y?a:M,T=c-1,_=(M-C)/T):(T=(M-C)/_,nn(T,Math.round(T),_/1e3)?T=Math.round(T):T=Math.ceil(T));const A=Math.max(qs(_),qs(C));w=Math.pow(10,H(l)?A:l),C=Math.round(C*w)/w,M=Math.round(M*w)/w;let O=0;for(b&&(d&&C!==r?(e.push({value:r}),C<r&&O++,nn(Math.round((C+O*_)*w)/w,r,Zo(r,v,n))&&O++):C<r&&O++);O<T;++O){const R=Math.round((C+O*_)*w)/w;if(y&&R>a)break;e.push({value:R})}return y&&d&&M!==a?e.length&&nn(e[e.length-1].value,a,Zo(a,v,n))?e[e.length-1].value=a:e.push({value:a}):(!y||M===a)&&e.push({value:M}),e}function Zo(n,t,{horizontal:e,minRotation:i}){const s=At(i),o=(e?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+n).length;return Math.min(t/o,r)}class oi extends ke{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return H(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const r=l=>s=e?s:l,a=l=>o=i?o:l;if(t){const l=Bt(s),c=Bt(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=bg(s,o);return t.bounds==="ticks"&&Fr(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return _n(t,this.chart.options.locale,this.options.ticks.format)}}class os extends oi{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=et(t)?t:0,this.max=et(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=At(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}k(os,"id","linear"),k(os,"defaults",{ticks:{callback:fi.formatters.numeric}});const gn=n=>Math.floor(ie(n)),pe=(n,t)=>Math.pow(10,gn(n)+t);function Jo(n){return n/Math.pow(10,gn(n))===1}function tr(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function yg(n,t){const e=t-n;let i=gn(e);for(;tr(n,t,i)>10;)i++;for(;tr(n,t,i)<10;)i--;return Math.min(i,gn(n))}function _g(n,{min:t,max:e}){t=Pt(n.min,t);const i=[],s=gn(t);let o=yg(t,e),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,u=Math.floor((t-l)/a/10)*a*10;let h=Math.floor((c-u)/Math.pow(10,o)),d=Pt(n.min,Math.round((l+u+h*Math.pow(10,o))*r)/r);for(;d<e;)i.push({value:d,major:Jo(d),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,r=o>=0?1:r),d=Math.round((l+u+h*Math.pow(10,o))*r)/r;const f=Pt(n.max,d);return i.push({value:f,major:Jo(f),significand:h}),i}class er extends ke{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=oi.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return et(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=et(t)?Math.max(0,t):null,this.max=et(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!et(this._userMin)&&(this.min=t===pe(this.min,0)?pe(this.min,-1):pe(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const o=a=>i=t?i:a,r=a=>s=e?s:a;i===s&&(i<=0?(o(1),r(10)):(o(pe(i,-1)),r(pe(s,1)))),i<=0&&o(pe(s,-1)),s<=0&&r(pe(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=_g(e,this);return t.bounds==="ticks"&&Fr(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":_n(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ie(t),this._valueRange=ie(this.max)-ie(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ie(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}k(er,"id","logarithmic"),k(er,"defaults",{ticks:{callback:fi.formatters.logarithmic,major:{enabled:!0}}});function rs(n){const t=n.ticks;if(t.display&&n.display){const e=yt(t.backdropPadding);return S(t.font&&t.font.size,nt.font.size)+e.height}return 0}function xg(n,t,e){return e=K(e)?e:[e],{w:zu(n,t.string,e),h:e.length*t.lineHeight}}function nr(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function vg(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],o=n._pointLabels.length,r=n.options.pointLabels,a=r.centerPointLabels?tt/o:0;for(let l=0;l<o;l++){const c=r.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],a),h=ut(c.font),d=xg(n.ctx,h,n._pointLabels[l]);i[l]=d;const f=Dt(n.getIndexAngle(l)+a),g=Math.round(ps(f)),p=nr(g,u.x,d.w,0,180),m=nr(g,u.y,d.h,90,270);wg(e,t,f,p,m)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=Cg(n,i,s)}function wg(n,t,e,i,s){const o=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e));let a=0,l=0;i.start<t.l?(a=(t.l-i.start)/o,n.l=Math.min(n.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/o,n.r=Math.max(n.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,n.b=Math.max(n.b,t.b+l))}function Mg(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=e,l=n.getPointPosition(t,i+s+r,o),c=Math.round(ps(Dt(l.angle+at))),u=Tg(l.y,a.h,c),h=Pg(c),d=Dg(l.x,a.w,h);return{visible:!0,x:l.x,y:u,textAlign:h,left:d,top:u,right:d+a.w,bottom:u+a.h}}function kg(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:o}=n;return!(qt({x:e,y:i},t)||qt({x:e,y:o},t)||qt({x:s,y:i},t)||qt({x:s,y:o},t))}function Cg(n,t,e){const i=[],s=n._pointLabels.length,o=n.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:rs(o)/2,additionalAngle:r?tt/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const h=Mg(n,u,l);i.push(h),a==="auto"&&(h.visible=kg(h,c),h.visible&&(c=h))}return i}function Pg(n){return n===0||n===180?"center":n<180?"left":"right"}function Dg(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function Tg(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function Sg(n,t,e){const{left:i,top:s,right:o,bottom:r}=e,{backdropColor:a}=t;if(!H(a)){const l=ve(t.borderRadius),c=yt(t.backdropPadding);n.fillStyle=a;const u=i-c.left,h=s-c.top,d=o-i+c.width,f=r-s+c.height;Object.values(l).some(g=>g!==0)?(n.beginPath(),dn(n,{x:u,y:h,w:d,h:f,radius:l}),n.fill()):n.fillRect(u,h,d,f)}}function Og(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const o=n._pointLabelItems[s];if(!o.visible)continue;const r=i.setContext(n.getPointLabelContext(s));Sg(e,r,o);const a=ut(r.font),{x:l,y:c,textAlign:u}=o;Ie(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:u,textBaseline:"middle"})}}function Ma(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,G);else{let o=n.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<i;r++)o=n.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function Ag(n,t,e,i,s){const o=n.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!i||!a||!l||e<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash),o.lineDashOffset=s.dashOffset,o.beginPath(),Ma(n,e,r,i),o.closePath(),o.stroke(),o.restore())}function Lg(n,t,e){return he(n,{label:e,index:t,type:"pointLabel"})}class zn extends oi{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=yt(rs(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=et(t)&&!isNaN(t)?t:0,this.max=et(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/rs(this.options))}generateTickLabels(t){oi.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=X(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?vg(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=G/(this._pointLabels.length||1),i=this.options.startAngle||0;return Dt(t*e+At(i))}getDistanceFromCenterForValue(t){if(H(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(H(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return Lg(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-at+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:o}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Ma(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:o}=e,r=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&Og(this,r),s.display&&this.ticks.forEach((u,h)=>{if(h!==0){l=this.getDistanceFromCenterForValue(u.value);const d=this.getContext(h),f=s.setContext(d),g=o.setContext(d);Ag(this,f,l,r,g)}}),i.display){for(t.save(),a=r-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:h,lineWidth:d}=u;!d||!h||(t.lineWidth=d,t.strokeStyle=h,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=ut(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const h=yt(c.backdropPadding);t.fillRect(-r/2-h.left,-o-u.size/2-h.top,r+h.width,u.size+h.height)}Ie(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}k(zn,"id","radialLinear"),k(zn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:fi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),k(zn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),k(zn,"descriptors",{angleLines:{_fallback:"grid"}});const bi={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},xt=Object.keys(bi);function ir(n,t){return n-t}function sr(n,t){if(H(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:o}=n._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),et(r)||(r=typeof i=="string"?e.parse(r,i):e.parse(r)),r===null?null:(s&&(r=s==="week"&&(un(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,s)),+r)}function or(n,t,e,i){const s=xt.length;for(let o=xt.indexOf(n);o<s-1;++o){const r=bi[xt[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=i)return xt[o]}return xt[s-1]}function Rg(n,t,e,i,s){for(let o=xt.length-1;o>=xt.indexOf(e);o--){const r=xt[o];if(bi[r].common&&n._adapter.diff(s,i,r)>=t-1)return r}return xt[e?xt.indexOf(e):0]}function Fg(n){for(let t=xt.indexOf(n)+1,e=xt.length;t<e;++t)if(bi[xt[t]].common)return xt[t]}function rr(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=ms(e,t),o=e[i]>=t?e[i]:e[s];n[o]=!0}}function Ig(n,t,e,i){const s=n._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+s.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function ar(n,t,e){const i=[],s={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,i.push({value:a,major:!1});return o===0||!e?i:Ig(n,i,s,e)}class pn extends ke{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new sa._date(t.adapters.date);s.init(e),en(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:sr(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=et(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),o=et(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,r=this.max,a=wu(s,o,r);return this._unit=e.unit||(i.autoSkip?or(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Rg(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Fg(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),ar(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=ft(e,0,r),i=ft(i,0,r),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||or(o.minUnit,e,i,this._getLabelCapacity(e)),a=S(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=un(l)||l===!0,u={};let h=e,d,f;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":r),t.diff(i,e,r)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+r);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(d=h,f=0;d<i;d=+t.add(d,a,r),f++)rr(u,d,g);return(d===i||s.bounds==="ticks"||f===1)&&rr(u,d,g),Object.keys(u).sort(ir).map(p=>+p)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,o=this._unit,r=e||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,i,s){const o=this.options,r=o.ticks.callback;if(r)return X(r,[t,e,i],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],h=c&&a[c],d=i[e],f=c&&h&&d&&d.major;return this._adapter.format(t,s||(f?h:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=At(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,o=this._tickFormatFunction(t,0,ar(this,[t],this._majorUnit),s),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(sr(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return zr(t.sort(ir))}}k(pn,"id","time"),k(pn,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Bn(n,t,e){let i=0,s=n.length-1,o,r,a,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=xe(n,"pos",t)),{pos:o,time:a}=n[i],{pos:r,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=xe(n,"time",t)),{time:o,pos:a}=n[i],{time:r,pos:l}=n[s]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class lr extends pn{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Bn(e,this.min),this._tableRange=Bn(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],o=[];let r,a,l,c,u;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,a=s.length;r<a;++r)u=s[r+1],l=s[r-1],c=s[r],Math.round((u+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Bn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Bn(this._table,i*this._tableRange+this._minPos,!0)}}k(lr,"id","timeseries"),k(lr,"defaults",pn.defaults);function yi(n){return n==="sankey"?{type:"sankey",data:{datasets:[]},options:{animations:!1}}:n==="pie"?{type:"pie",data:{datasets:[]}}:n==="column"?{type:"bar",data:{labels:[],datasets:[]},options:{plugins:{tooltip:{callbacks:{label:function(t){let e=t.dataset.currency_code;return V(t.raw,e)}}}},maintainAspectRatio:!1,scales:{}}}:n==="line"?{options:{plugins:{tooltip:{callbacks:{label:function(t){let e=t.dataset.currency_code;return V(t.raw,e)}}}},maintainAspectRatio:!1,scales:{x:{type:"time",time:{tooltipFormat:"PP"}}}},type:"line",data:{labels:[],datasets:[]}}:{}}let ri=new dt("#36a2eb"),Re=new dt("#ff6384"),mn=new dt("#4bc0c0"),ka=new dt("#ff9f40"),Eg=new dt("#9966ff"),zg=new dt("#ffcd56"),Bg=new dt("#c9cbcf"),cr=0;window.theme==="dark"&&(Re.darken(.3).desaturate(.3),mn.darken(.3).desaturate(.3),ri.darken(.3).desaturate(.3),ka.darken(.3).desaturate(.3));let Fi=[Re,ka,ri,mn,Eg,zg,Bg,mn];function De(n,t){let e={borderColor:Re.rgbString(),backgroundColor:Re.rgbString()},i;switch(n){default:let o=Math.floor(cr/2)%Fi.length;i=new dt(Fi[o].rgbString()),i.lighten(.38),e={borderColor:Fi[o].hexString(),backgroundColor:i.hexString()};break;case"spent":i=new dt(ri.rgbString()),i.lighten(.38),e={borderColor:ri.rgbString(),backgroundColor:i.rgbString()};break;case"left":i=new dt(mn.rgbString()),i.lighten(.38),e={borderColor:mn.rgbString(),backgroundColor:i.rgbString()};break;case"overspent":i=new dt(Re.rgbString()),i.lighten(.22),e={borderColor:Re.rgbString(),backgroundColor:i.rgbString()};break}return cr++,t==="border"?e.borderColor:t==="background"?e.backgroundColor:"#FF0000"}let me=[],je=null,Ii=null,Ei=!1;const Ng=()=>({loading:!1,loadingAccounts:!1,accountList:[],autoConversion:!1,chartOptions:null,switchAutoConversion(){this.autoConversion=!this.autoConversion,Bc("autoConversion",this.autoConversion)},getFreshData(){const n=new Date(window.store.get("start")),t=new Date(window.store.get("end")),e=Nt("dashboard-accounts-chart",n,t),i=window.store.get("cacheValid");let s=window.store.get(e);if(i&&typeof s<"u"){console.log(s),this.drawChart(this.generateOptions(s)),this.loading=!1;return}new Nc().dashboard(n,t,null).then(r=>{this.chartData=r.data,window.store.set(e,r.data),console.log(r.data),this.drawChart(this.generateOptions(this.chartData)),this.loading=!1})},generateOptions(n){me=[];let t=yi("line");for(let e=0;e<n.length;e++)if(n.hasOwnProperty(e)){let i="y",s=n[e],o={},r=[];e===0&&(t.data.labels=Object.keys(s.entries)),o.label=s.label,this.autoConversion&&(me.push(s.native_currency_code),o.currency_code=s.native_currency_code,r=Object.values(s.native_entries),i="y"+s.native_currency_code),this.autoConversion||(i="y"+s.currency_code,o.currency_code=s.currency_code,me.push(s.currency_code),r=Object.values(s.entries)),o.yAxisID=i,o.data=r,t.data.datasets.push(o)}for(let e in me)if(me.hasOwnProperty(e)){let i="y"+me[e];t.options.scales.hasOwnProperty(i)||(t.options.scales[i]={id:e,type:"linear",position:parseInt(e)===1?"right":"left",ticks:{callback:function(s,o,r){return V(s,me[e])}}})}return t},loadChart(){if(this.loading!==!0){if(this.loading=!0,Ii===null){this.getFreshData();return}this.drawChart(this.generateOptions(Ii)),this.loading=!1}},drawChart(n){if(je!==null){je.options=n.options,je.data=n.data,je.update();return}je=new mt(document.querySelector("#account-chart"),n)},loadAccounts(){if(this.loadingAccounts===!0)return;if(this.loadingAccounts=!0,this.accountList.length>0){this.loadingAccounts=!1;return}const n=new Date(window.store.get("start")),t=new Date(window.store.get("end")),e=Nt("dashboard-accounts-data",n,t),i=window.store.get("cacheValid");let s=window.store.get(e);if(i&&typeof s<"u"){this.accountList=s,this.loadingAccounts=!1;return}const o=10;let r=0,a=0,l=[];Promise.all([bt("frontpageAccounts")]).then(c=>{r=c[0].length;for(let u in c[0]){let h=c[0];if(h.hasOwnProperty(u)){let d=h[u];new Bs().get(d,new Date(window.store.get("end"))).then(f=>{let g=f.data.data;const p={page:1,start:new Date(window.store.get("start")),end:new Date(window.store.get("end"))};new Bs().transactions(g.id,p).then(m=>{let b=[];for(let y=0;y<m.data.data.length&&!(y>=o);y++){let x=m.data.data[y],v={title:x.attributes.group_title===null?"":x.attributes.group_title,id:x.id,transactions:[]};for(let _=0;_<x.attributes.transactions.length;_++){let w=x.attributes.transactions[_];const C=w.type==="withdrawal"?parseFloat(w.native_amount)*-1:parseFloat(w.native_amount),M=w.type==="withdrawal"?parseFloat(w.amount)*-1:parseFloat(w.amount);v.transactions.push({description:w.description,id:x.id,type:w.type,amount_raw:M,amount:V(M,w.currency_code),native_amount_raw:C,native_amount:V(C,w.native_currency_code)})}b.push(v)}l.push({name:g.attributes.name,order:g.attributes.order,id:g.id,balance_raw:parseFloat(g.attributes.current_balance),balance:V(g.attributes.current_balance,g.attributes.currency_code),native_balance_raw:parseFloat(g.attributes.native_current_balance),native_balance:V(g.attributes.native_current_balance,g.attributes.native_currency_code),groups:b}),a++,a===r&&(l.sort((y,x)=>y.order-x.order),this.accountList=l,this.loadingAccounts=!1,window.store.set(e,l))})})}}})},init(){Promise.all([bt("viewRange","1M"),bt("autoConversion",!1),bt("language","en_US")]).then(n=>{this.autoConversion=n[1],Ei=!0,this.loadChart(),this.loadAccounts()}),window.store.observe("end",()=>{Ei&&(Ii=null,this.accountList=[],this.loadChart(),this.loadAccounts())}),window.store.observe("autoConversion",()=>{Ei&&(this.loadChart(),this.loadAccounts())})}});let Wg=class{dashboard(t,e){let i=J(t,"y-MM-dd"),s=J(e,"y-MM-dd");return vt.get("/api/v2/chart/budget/dashboard",{params:{start:i,end:s}})}},Ue=[],Nn=null,te=null,zi=!1,Te;const Hg=()=>({loading:!1,autoConversion:!1,loadChart(){if(this.loading!==!0){if(this.loading=!0,te!==null){this.drawChart(this.generateOptions(te)),this.loading=!1;return}this.getFreshData()}},drawChart(n){if(Nn!==null){Nn.data.datasets=n.data.datasets,Nn.update();return}Nn=new mt(document.querySelector("#budget-chart"),n)},getFreshData(){const n=new Date(window.store.get("start")),t=new Date(window.store.get("end")),e=Nt("dashboard-budgets-chart",n,t),i=window.store.get("cacheValid");let s=window.store.get(e);if(i&&typeof s<"u"){te=s,this.drawChart(this.generateOptions(te)),this.loading=!1;return}new Wg().dashboard(n,t,null).then(r=>{te=r.data,this.drawChart(this.generateOptions(te)),window.store.set(e,te),this.loading=!1})},generateOptions(n){Ue=[];let t=yi("column");t.options.locale=window.store.get("locale").replace("_","-"),t.options.plugins={tooltip:{callbacks:{title:function(e){return e.label},label:function(e){let i=e.dataset.label||"";return i&&(i+=": "),i+" "+V(e.parsed.y,Ue[e.parsed.x]??"EUR")}}}},t.data={labels:[],datasets:[{label:Te.t("firefly.spent"),data:[],borderWidth:1,stack:1,backgroundColor:De("spent","background"),borderColor:De("spent","border")},{label:Te.t("firefly.left"),data:[],borderWidth:1,stack:1,backgroundColor:De("left","background"),borderColor:De("left","border")},{label:Te.t("firefly.overspent"),data:[],borderWidth:1,stack:1,backgroundColor:De("overspent","background"),borderColor:De("overspent","border")}]};for(const e in n)if(n.hasOwnProperty(e)){let i=n[e],s=i.label+" ("+i.currency_code+")";t.data.labels.push(s),this.autoConversion&&(Ue.push(i.native_currency_code),t.data.datasets[0].data.push(parseFloat(i.native_entries.spent)*-1),t.data.datasets[1].data.push(parseFloat(i.native_entries.left)),t.data.datasets[2].data.push(parseFloat(i.native_entries.overspent))),this.autoConversion||(Ue.push(i.currency_code),t.data.datasets[0].data.push(parseFloat(i.entries.spent)*-1),t.data.datasets[1].data.push(parseFloat(i.entries.left)),t.data.datasets[2].data.push(parseFloat(i.entries.overspent)))}return t.options.scales={y:{ticks:{callback:function(e){return V(e,Ue[0]??"EUR")}}}},t},init(){Promise.all([bt("autoConversion",!1),bt("language","en_US")]).then(n=>{Te=new li;const t=n[1].replace("-","_");Te.locale=t,ci(Te,t).then(()=>{this.autoConversion=n[0],zi=!0,this.loading===!1&&this.loadChart()})}),window.store.observe("end",()=>{zi&&this.loading===!1&&(te=null,this.loadChart())}),window.store.observe("autoConversion",n=>{zi&&(this.autoConversion=n,this.loading===!1&&this.loadChart())})}});class Vg{dashboard(t,e){let i=J(t,"y-MM-dd"),s=J(e,"y-MM-dd");return vt.get("/api/v2/chart/category/dashboard",{params:{start:i,end:s}})}}let ur=[],$e=null,Se=null,Bi=!1;const Yg=()=>({loading:!1,autoConversion:!1,generateOptions(n){ur=[];let t=yi("column"),e={};for(const s in n)if(n.hasOwnProperty(s)){let o=n[s],r=o.currency_code;this.autoConversion&&(r=o.native_currency_code),e.hasOwnProperty(r)||(e[r]={name:r,yAxisID:"",data:{}},ur.push(r))}for(const s in n)if(n.hasOwnProperty(s)){let o=n[s],r=o.currency_code;this.autoConversion&&(r=o.native_currency_code);for(const a in e)if(e.hasOwnProperty(a)){let l=0;r===a&&(l=parseFloat(o.amount),""+o.currency_code,this.autoConversion&&(l=parseFloat(o.native_amount),""+o.native_currency_code)),e[a].data.hasOwnProperty(o.label)&&(e[a].data[o.label]=e[a].data[o.label]+l),e[a].data.hasOwnProperty(o.label)||(e[a].data[o.label]=l)}t.data.labels.includes(o.label)||t.data.labels.push(o.label)}let i=0;for(const s in e){let o="y"+s,r={label:s,currency_code:s,yAxisID:o,data:[]};for(const a in e[s].data)r.data.push(e[s].data[a]);t.data.datasets.push(r),t.options.scales.hasOwnProperty(o)||(t.options.scales[o]={beginAtZero:!0,type:"linear",position:i===1?"right":"left",ticks:{callback:function(a,l,c){return V(a,s)}}},i++)}return t},drawChart(n){if($e!==null){$e.options=n.options,$e.data=n.data,$e.update();return}$e=new mt(document.querySelector("#category-chart"),n)},getFreshData(){const n=new Date(window.store.get("start")),t=new Date(window.store.get("end")),e=Nt("dashboard-categories-chart",n,t),i=window.store.get("cacheValid");let s=window.store.get(e);if(i&&typeof s<"u"){Se=s,this.drawChart(this.generateOptions(Se)),this.loading=!1;return}new Vg().dashboard(n,t,null).then(r=>{Se=r.data,this.drawChart(this.generateOptions(r.data)),window.store.set(e,Se),this.loading=!1})},loadChart(){if(this.loading!==!0){if(this.loading=!0,Se!==null){this.drawChart(this.generateOptions(Se)),this.loading=!1;return}this.getFreshData()}},init(){Promise.all([bt("autoConversion",!1)]).then(n=>{this.autoConversion=n[0],Bi=!0,this.loadChart()}),window.store.observe("end",()=>{Bi&&(this.chartData=null,this.loadChart())}),window.store.observe("autoConversion",n=>{Bi&&(this.autoConversion=n,this.loadChart())})}});let jg=class{get(t){return vt.get("/api/v2/transactions",{params:t})}};/*!+`):n}function rg(n,t){const{element:e,datasetIndex:i,index:s}=t,o=n.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:n,label:r,parsed:o.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function $o(n,t){const e=n.chart.ctx,{body:i,footer:s,title:o}=n,{boxWidth:r,boxHeight:a}=t,l=ut(t.bodyFont),c=ut(t.titleFont),u=ut(t.footerFont),h=o.length,d=s.length,f=i.length,g=yt(t.padding);let p=g.height,m=0,b=i.reduce((v,_)=>v+_.before.length+_.lines.length+_.after.length,0);if(b+=n.beforeBody.length+n.afterBody.length,h&&(p+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),b){const v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=f*v+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}d&&(p+=t.footerMarginTop+d*u.lineHeight+(d-1)*t.footerSpacing);let y=0;const x=function(v){m=Math.max(m,e.measureText(v).width+y)};return e.save(),e.font=c.string,$(n.title,x),e.font=l.string,$(n.beforeBody.concat(n.afterBody),x),y=t.displayColors?r+2+t.boxPadding:0,$(i,v=>{$(v.before,x),$(v.lines,x),$(v.after,x)}),y=0,e.font=u.string,$(n.footer,x),e.restore(),m+=g.width,{width:m,height:p}}function ag(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function lg(n,t,e,i){const{x:s,width:o}=i,r=e.caretSize+e.caretPadding;if(n==="left"&&s+o+r>t.width||n==="right"&&s-o-r<0)return!0}function cg(n,t,e,i){const{x:s,width:o}=e,{width:r,chartArea:{left:a,right:l}}=n;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),lg(c,n,t,e)&&(c="center"),c}function qo(n,t,e){const i=e.yAlign||t.yAlign||ag(n,e);return{xAlign:e.xAlign||t.xAlign||cg(n,t,e,i),yAlign:i}}function ug(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function hg(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function Xo(n,t,e,i){const{caretSize:s,caretPadding:o,cornerRadius:r}=n,{xAlign:a,yAlign:l}=e,c=s+o,{topLeft:u,topRight:h,bottomLeft:d,bottomRight:f}=ve(r);let g=ug(t,a);const p=hg(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(u,d)+s:a==="right"&&(g+=Math.max(h,f)+s),{x:ft(g,0,i.width-t.width),y:ft(p,0,i.height-t.height)}}function En(n,t,e){const i=yt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Ko(n){return Ft([],jt(n))}function dg(n,t,e){return he(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Go(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const wa={beforeTitle:Wt,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Wt,beforeBody:Wt,beforeLabel:Wt,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return H(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Wt,afterBody:Wt,beforeFooter:Wt,footer:Wt,afterFooter:Wt};function _t(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?wa[t].call(e,i):s}class is extends Lt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,o=new ea(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=dg(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=_t(i,"beforeTitle",this,t),o=_t(i,"title",this,t),r=_t(i,"afterTitle",this,t);let a=[];return a=Ft(a,jt(s)),a=Ft(a,jt(o)),a=Ft(a,jt(r)),a}getBeforeBody(t,e){return Ko(_t(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return $(t,o=>{const r={before:[],lines:[],after:[]},a=Go(i,o);Ft(r.before,jt(_t(a,"beforeLabel",this,o))),Ft(r.lines,_t(a,"label",this,o)),Ft(r.after,jt(_t(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,e){return Ko(_t(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=_t(i,"beforeFooter",this,t),o=_t(i,"footer",this,t),r=_t(i,"afterFooter",this,t);let a=[];return a=Ft(a,jt(s)),a=Ft(a,jt(o)),a=Ft(a,jt(r)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(rg(this.chart,e[l]));return t.filter&&(a=a.filter((u,h,d)=>t.filter(u,h,d,i))),t.itemSort&&(a=a.sort((u,h)=>t.itemSort(u,h,i))),$(a,u=>{const h=Go(t.callbacks,u);s.push(_t(h,"labelColor",this,u)),o.push(_t(h,"labelPointStyle",this,u)),r.push(_t(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=Je[i.position].call(this,s,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const l=this._size=$o(this,i),c=Object.assign({},a,l),u=qo(this.chart,i,c),h=Xo(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const o=this.getCaretPosition(t,i,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:h}=ve(a),{x:d,y:f}=t,{width:g,height:p}=e;let m,b,y,x,v,_;return o==="center"?(v=f+p/2,s==="left"?(m=d,b=m-r,x=v+r,_=v-r):(m=d+g,b=m+r,x=v-r,_=v+r),y=m):(s==="left"?b=d+Math.max(l,u)+r:s==="right"?b=d+g-Math.max(c,h)-r:b=this.caretX,o==="top"?(x=f,v=x-r,m=b-r,y=b+r):(x=f+p,v=x+r,m=b+r,y=b-r),_=x),{x1:m,x2:b,x3:y,y1:x,y2:v,y3:_}}drawTitle(t,e,i){const s=this.title,o=s.length;let r,a,l;if(o){const c=Fe(i.rtl,this.x,this.width);for(t.x=En(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",r=ut(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,o){const r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,u=ut(o.bodyFont),h=En(this,"left",o),d=s.x(h),f=l<u.lineHeight?(u.lineHeight-l)/2:0,g=e.y+f;if(o.usePointStyle){const p={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},m=s.leftForLtr(d,c)+c/2,b=g+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Gi(t,p,m,b),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Gi(t,p,m,b)}else{t.lineWidth=F(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const p=s.leftForLtr(d,c),m=s.leftForLtr(s.xPlus(d,1),c-2),b=ve(r.borderRadius);Object.values(b).some(y=>y!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,dn(t,{x:p,y:g,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),dn(t,{x:m,y:g+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(p,g,c,l),t.strokeRect(p,g,c,l),t.fillStyle=r.backgroundColor,t.fillRect(m,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,h=ut(i.bodyFont);let d=h.lineHeight,f=0;const g=Fe(i.rtl,this.x,this.width),p=function(M){e.fillText(M,g.x(t.x+f),t.y+d/2),t.y+=d+o},m=g.textAlign(r);let b,y,x,v,_,w,C;for(e.textAlign=r,e.textBaseline="middle",e.font=h.string,t.x=En(this,m,i),e.fillStyle=i.bodyColor,$(this.beforeBody,p),f=a&&m!=="right"?r==="center"?c/2+u:c+2+u:0,v=0,w=s.length;v<w;++v){for(b=s[v],y=this.labelTextColors[v],e.fillStyle=y,$(b.before,p),x=b.lines,a&&x.length&&(this._drawColorBox(e,t,v,g,i),d=Math.max(h.lineHeight,l)),_=0,C=x.length;_<C;++_)p(x[_]),d=h.lineHeight;$(b.after,p)}f=0,d=h.lineHeight,$(this.afterBody,p),t.y-=o}drawFooter(t,e,i){const s=this.footer,o=s.length;let r,a;if(o){const l=Fe(i.rtl,this.x,this.width);for(t.x=En(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",r=ut(i.footerFont),e.fillStyle=i.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:h,topRight:d,bottomLeft:f,bottomRight:g}=ve(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+h,l),r==="top"&&this.drawCaret(t,e,i,s),e.lineTo(a+c-d,l),e.quadraticCurveTo(a+c,l,a+c,l+d),r==="center"&&o==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+c,l+u-g),e.quadraticCurveTo(a+c,l+u,a+c-g,l+u),r==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+f,l+u),e.quadraticCurveTo(a,l+u,a,l+u-f),r==="center"&&o==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,l+h),e.quadraticCurveTo(a,l,a+h,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const r=Je[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=$o(this,t),l=Object.assign({},r,this._size),c=qo(e,t,l),u=Xo(t,l,c,e);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=yt(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,e),Gr(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Qr(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!Zn(i,s),r=this._positionChanged(s,e);(o||r)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,i),a=this._positionChanged(r,t),l=e||!Zn(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e;const r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:i,caretY:s,options:o}=this,r=Je[o.position].call(this,t,e);return r!==!1&&(i!==r.x||s!==r.y)}}k(is,"positioners",Je);var fg={id:"tooltip",_element:is,positioners:Je,afterInit(n,t,e){e&&(n.tooltip=new is({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:wa},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const gg=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function pg(n,t,e,i){const s=n.indexOf(t);if(s===-1)return gg(n,t,e,i);const o=n.lastIndexOf(t);return s!==o?e:s}const mg=(n,t)=>n===null?null:ft(Math.round(n),0,t);function Qo(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class ss extends ke{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:o}of e)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(H(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:pg(i,t,S(e,t),this._addedLabels),mg(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=t;r<=e;r++)s.push({value:r});return s}getLabelForValue(t){return Qo.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}k(ss,"id","category"),k(ss,"defaults",{ticks:{callback:Qo}});function bg(n,t){const e=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:u,maxDigits:h,includeBounds:d}=n,f=o||1,g=u-1,{min:p,max:m}=t,b=!H(r),y=!H(a),x=!H(c),v=(m-p)/(h+1);let _=$s((m-p)/g/f)*f,w,C,M,T;if(_<1e-14&&!b&&!y)return[{value:p},{value:m}];T=Math.ceil(m/_)-Math.floor(p/_),T>g&&(_=$s(T*_/g/f)*f),H(l)||(w=Math.pow(10,l),_=Math.ceil(_*w)/w),s==="ticks"?(C=Math.floor(p/_)*_,M=Math.ceil(m/_)*_):(C=p,M=m),b&&y&&o&&yu((a-r)/o,_/1e3)?(T=Math.round(Math.min((a-r)/_,u)),_=(a-r)/T,C=r,M=a):x?(C=b?r:C,M=y?a:M,T=c-1,_=(M-C)/T):(T=(M-C)/_,nn(T,Math.round(T),_/1e3)?T=Math.round(T):T=Math.ceil(T));const A=Math.max(qs(_),qs(C));w=Math.pow(10,H(l)?A:l),C=Math.round(C*w)/w,M=Math.round(M*w)/w;let O=0;for(b&&(d&&C!==r?(e.push({value:r}),C<r&&O++,nn(Math.round((C+O*_)*w)/w,r,Zo(r,v,n))&&O++):C<r&&O++);O<T;++O){const R=Math.round((C+O*_)*w)/w;if(y&&R>a)break;e.push({value:R})}return y&&d&&M!==a?e.length&&nn(e[e.length-1].value,a,Zo(a,v,n))?e[e.length-1].value=a:e.push({value:a}):(!y||M===a)&&e.push({value:M}),e}function Zo(n,t,{horizontal:e,minRotation:i}){const s=At(i),o=(e?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+n).length;return Math.min(t/o,r)}class oi extends ke{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return H(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const r=l=>s=e?s:l,a=l=>o=i?o:l;if(t){const l=Bt(s),c=Bt(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=bg(s,o);return t.bounds==="ticks"&&Fr(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return _n(t,this.chart.options.locale,this.options.ticks.format)}}class os extends oi{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=et(t)?t:0,this.max=et(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=At(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}k(os,"id","linear"),k(os,"defaults",{ticks:{callback:fi.formatters.numeric}});const gn=n=>Math.floor(ie(n)),pe=(n,t)=>Math.pow(10,gn(n)+t);function Jo(n){return n/Math.pow(10,gn(n))===1}function tr(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function yg(n,t){const e=t-n;let i=gn(e);for(;tr(n,t,i)>10;)i++;for(;tr(n,t,i)<10;)i--;return Math.min(i,gn(n))}function _g(n,{min:t,max:e}){t=Pt(n.min,t);const i=[],s=gn(t);let o=yg(t,e),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,u=Math.floor((t-l)/a/10)*a*10;let h=Math.floor((c-u)/Math.pow(10,o)),d=Pt(n.min,Math.round((l+u+h*Math.pow(10,o))*r)/r);for(;d<e;)i.push({value:d,major:Jo(d),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,r=o>=0?1:r),d=Math.round((l+u+h*Math.pow(10,o))*r)/r;const f=Pt(n.max,d);return i.push({value:f,major:Jo(f),significand:h}),i}class er extends ke{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=oi.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return et(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=et(t)?Math.max(0,t):null,this.max=et(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!et(this._userMin)&&(this.min=t===pe(this.min,0)?pe(this.min,-1):pe(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const o=a=>i=t?i:a,r=a=>s=e?s:a;i===s&&(i<=0?(o(1),r(10)):(o(pe(i,-1)),r(pe(s,1)))),i<=0&&o(pe(s,-1)),s<=0&&r(pe(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=_g(e,this);return t.bounds==="ticks"&&Fr(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":_n(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ie(t),this._valueRange=ie(this.max)-ie(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ie(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}k(er,"id","logarithmic"),k(er,"defaults",{ticks:{callback:fi.formatters.logarithmic,major:{enabled:!0}}});function rs(n){const t=n.ticks;if(t.display&&n.display){const e=yt(t.backdropPadding);return S(t.font&&t.font.size,nt.font.size)+e.height}return 0}function xg(n,t,e){return e=K(e)?e:[e],{w:zu(n,t.string,e),h:e.length*t.lineHeight}}function nr(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function vg(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],o=n._pointLabels.length,r=n.options.pointLabels,a=r.centerPointLabels?tt/o:0;for(let l=0;l<o;l++){const c=r.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],a),h=ut(c.font),d=xg(n.ctx,h,n._pointLabels[l]);i[l]=d;const f=Dt(n.getIndexAngle(l)+a),g=Math.round(ps(f)),p=nr(g,u.x,d.w,0,180),m=nr(g,u.y,d.h,90,270);wg(e,t,f,p,m)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=Cg(n,i,s)}function wg(n,t,e,i,s){const o=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e));let a=0,l=0;i.start<t.l?(a=(t.l-i.start)/o,n.l=Math.min(n.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/o,n.r=Math.max(n.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,n.b=Math.max(n.b,t.b+l))}function Mg(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=e,l=n.getPointPosition(t,i+s+r,o),c=Math.round(ps(Dt(l.angle+at))),u=Tg(l.y,a.h,c),h=Pg(c),d=Dg(l.x,a.w,h);return{visible:!0,x:l.x,y:u,textAlign:h,left:d,top:u,right:d+a.w,bottom:u+a.h}}function kg(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:o}=n;return!(qt({x:e,y:i},t)||qt({x:e,y:o},t)||qt({x:s,y:i},t)||qt({x:s,y:o},t))}function Cg(n,t,e){const i=[],s=n._pointLabels.length,o=n.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:rs(o)/2,additionalAngle:r?tt/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const h=Mg(n,u,l);i.push(h),a==="auto"&&(h.visible=kg(h,c),h.visible&&(c=h))}return i}function Pg(n){return n===0||n===180?"center":n<180?"left":"right"}function Dg(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function Tg(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function Sg(n,t,e){const{left:i,top:s,right:o,bottom:r}=e,{backdropColor:a}=t;if(!H(a)){const l=ve(t.borderRadius),c=yt(t.backdropPadding);n.fillStyle=a;const u=i-c.left,h=s-c.top,d=o-i+c.width,f=r-s+c.height;Object.values(l).some(g=>g!==0)?(n.beginPath(),dn(n,{x:u,y:h,w:d,h:f,radius:l}),n.fill()):n.fillRect(u,h,d,f)}}function Og(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const o=n._pointLabelItems[s];if(!o.visible)continue;const r=i.setContext(n.getPointLabelContext(s));Sg(e,r,o);const a=ut(r.font),{x:l,y:c,textAlign:u}=o;Ie(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:u,textBaseline:"middle"})}}function Ma(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,G);else{let o=n.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<i;r++)o=n.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function Ag(n,t,e,i,s){const o=n.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!i||!a||!l||e<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash),o.lineDashOffset=s.dashOffset,o.beginPath(),Ma(n,e,r,i),o.closePath(),o.stroke(),o.restore())}function Lg(n,t,e){return he(n,{label:e,index:t,type:"pointLabel"})}class zn extends oi{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=yt(rs(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=et(t)&&!isNaN(t)?t:0,this.max=et(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/rs(this.options))}generateTickLabels(t){oi.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=X(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?vg(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=G/(this._pointLabels.length||1),i=this.options.startAngle||0;return Dt(t*e+At(i))}getDistanceFromCenterForValue(t){if(H(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(H(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return Lg(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-at+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:o}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Ma(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:o}=e,r=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&Og(this,r),s.display&&this.ticks.forEach((u,h)=>{if(h!==0){l=this.getDistanceFromCenterForValue(u.value);const d=this.getContext(h),f=s.setContext(d),g=o.setContext(d);Ag(this,f,l,r,g)}}),i.display){for(t.save(),a=r-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:h,lineWidth:d}=u;!d||!h||(t.lineWidth=d,t.strokeStyle=h,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=ut(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const h=yt(c.backdropPadding);t.fillRect(-r/2-h.left,-o-u.size/2-h.top,r+h.width,u.size+h.height)}Ie(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}k(zn,"id","radialLinear"),k(zn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:fi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),k(zn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),k(zn,"descriptors",{angleLines:{_fallback:"grid"}});const bi={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},xt=Object.keys(bi);function ir(n,t){return n-t}function sr(n,t){if(H(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:o}=n._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),et(r)||(r=typeof i=="string"?e.parse(r,i):e.parse(r)),r===null?null:(s&&(r=s==="week"&&(un(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,s)),+r)}function or(n,t,e,i){const s=xt.length;for(let o=xt.indexOf(n);o<s-1;++o){const r=bi[xt[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=i)return xt[o]}return xt[s-1]}function Rg(n,t,e,i,s){for(let o=xt.length-1;o>=xt.indexOf(e);o--){const r=xt[o];if(bi[r].common&&n._adapter.diff(s,i,r)>=t-1)return r}return xt[e?xt.indexOf(e):0]}function Fg(n){for(let t=xt.indexOf(n)+1,e=xt.length;t<e;++t)if(bi[xt[t]].common)return xt[t]}function rr(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=ms(e,t),o=e[i]>=t?e[i]:e[s];n[o]=!0}}function Ig(n,t,e,i){const s=n._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+s.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function ar(n,t,e){const i=[],s={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,i.push({value:a,major:!1});return o===0||!e?i:Ig(n,i,s,e)}class pn extends ke{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new sa._date(t.adapters.date);s.init(e),en(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:sr(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=et(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),o=et(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,r=this.max,a=wu(s,o,r);return this._unit=e.unit||(i.autoSkip?or(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Rg(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Fg(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),ar(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=ft(e,0,r),i=ft(i,0,r),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||or(o.minUnit,e,i,this._getLabelCapacity(e)),a=S(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=un(l)||l===!0,u={};let h=e,d,f;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":r),t.diff(i,e,r)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+r);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(d=h,f=0;d<i;d=+t.add(d,a,r),f++)rr(u,d,g);return(d===i||s.bounds==="ticks"||f===1)&&rr(u,d,g),Object.keys(u).sort(ir).map(p=>+p)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,o=this._unit,r=e||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,i,s){const o=this.options,r=o.ticks.callback;if(r)return X(r,[t,e,i],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],h=c&&a[c],d=i[e],f=c&&h&&d&&d.major;return this._adapter.format(t,s||(f?h:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=At(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,o=this._tickFormatFunction(t,0,ar(this,[t],this._majorUnit),s),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(sr(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return zr(t.sort(ir))}}k(pn,"id","time"),k(pn,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Bn(n,t,e){let i=0,s=n.length-1,o,r,a,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=xe(n,"pos",t)),{pos:o,time:a}=n[i],{pos:r,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=xe(n,"time",t)),{time:o,pos:a}=n[i],{time:r,pos:l}=n[s]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class lr extends pn{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Bn(e,this.min),this._tableRange=Bn(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],o=[];let r,a,l,c,u;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,a=s.length;r<a;++r)u=s[r+1],l=s[r-1],c=s[r],Math.round((u+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Bn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Bn(this._table,i*this._tableRange+this._minPos,!0)}}k(lr,"id","timeseries"),k(lr,"defaults",pn.defaults);function yi(n){return n==="sankey"?{type:"sankey",data:{datasets:[]},options:{animations:!1}}:n==="pie"?{type:"pie",data:{datasets:[]}}:n==="column"?{type:"bar",data:{labels:[],datasets:[]},options:{plugins:{tooltip:{callbacks:{label:function(t){let e=t.dataset.currency_code;return V(t.raw,e)}}}},maintainAspectRatio:!1,scales:{}}}:n==="line"?{options:{plugins:{tooltip:{callbacks:{label:function(t){let e=t.dataset.currency_code;return V(t.raw,e)}}}},maintainAspectRatio:!1,scales:{x:{type:"time",time:{tooltipFormat:"PP"}}}},type:"line",data:{labels:[],datasets:[]}}:{}}let ri=new dt("#36a2eb"),Re=new dt("#ff6384"),mn=new dt("#4bc0c0"),ka=new dt("#ff9f40"),Eg=new dt("#9966ff"),zg=new dt("#ffcd56"),Bg=new dt("#c9cbcf"),cr=0;window.theme==="dark"&&(Re.darken(.3).desaturate(.3),mn.darken(.3).desaturate(.3),ri.darken(.3).desaturate(.3),ka.darken(.3).desaturate(.3));let Fi=[Re,ka,ri,mn,Eg,zg,Bg,mn];function De(n,t){let e={borderColor:Re.rgbString(),backgroundColor:Re.rgbString()},i;switch(n){default:let o=Math.floor(cr/2)%Fi.length;i=new dt(Fi[o].rgbString()),i.lighten(.38),e={borderColor:Fi[o].hexString(),backgroundColor:i.hexString()};break;case"spent":i=new dt(ri.rgbString()),i.lighten(.38),e={borderColor:ri.rgbString(),backgroundColor:i.rgbString()};break;case"left":i=new dt(mn.rgbString()),i.lighten(.38),e={borderColor:mn.rgbString(),backgroundColor:i.rgbString()};break;case"overspent":i=new dt(Re.rgbString()),i.lighten(.22),e={borderColor:Re.rgbString(),backgroundColor:i.rgbString()};break}return cr++,t==="border"?e.borderColor:t==="background"?e.backgroundColor:"#FF0000"}let me=[],je=null,Ii=null,Ei=!1;const Ng=()=>({loading:!1,loadingAccounts:!1,accountList:[],autoConversion:!1,chartOptions:null,switchAutoConversion(){this.autoConversion=!this.autoConversion,Bc("autoConversion",this.autoConversion)},getFreshData(){const n=new Date(window.store.get("start")),t=new Date(window.store.get("end")),e=Nt("dashboard-accounts-chart",n,t),i=window.store.get("cacheValid");let s=window.store.get(e);if(i&&typeof s<"u"){console.log(s),this.drawChart(this.generateOptions(s)),this.loading=!1;return}new Nc().dashboard(n,t,null).then(r=>{this.chartData=r.data,window.store.set(e,r.data),console.log(r.data),this.drawChart(this.generateOptions(this.chartData)),this.loading=!1})},generateOptions(n){me=[];let t=yi("line");for(let e=0;e<n.length;e++)if(n.hasOwnProperty(e)){let i="y",s=n[e],o={},r=[];e===0&&(t.data.labels=Object.keys(s.entries)),o.label=s.label,this.autoConversion&&(me.push(s.native_currency_code),o.currency_code=s.native_currency_code,r=Object.values(s.native_entries),i="y"+s.native_currency_code),this.autoConversion||(i="y"+s.currency_code,o.currency_code=s.currency_code,me.push(s.currency_code),r=Object.values(s.entries)),o.yAxisID=i,o.data=r,t.data.datasets.push(o)}for(let e in me)if(me.hasOwnProperty(e)){let i="y"+me[e];t.options.scales.hasOwnProperty(i)||(t.options.scales[i]={id:e,type:"linear",position:parseInt(e)===1?"right":"left",ticks:{callback:function(s,o,r){return V(s,me[e])}}})}return t},loadChart(){if(this.loading!==!0){if(this.loading=!0,Ii===null){this.getFreshData();return}this.drawChart(this.generateOptions(Ii)),this.loading=!1}},drawChart(n){if(je!==null){je.options=n.options,je.data=n.data,je.update();return}je=new mt(document.querySelector("#account-chart"),n)},loadAccounts(){if(this.loadingAccounts===!0)return;if(this.loadingAccounts=!0,this.accountList.length>0){this.loadingAccounts=!1;return}const n=new Date(window.store.get("start")),t=new Date(window.store.get("end")),e=Nt("dashboard-accounts-data",n,t),i=window.store.get("cacheValid");let s=window.store.get(e);if(i&&typeof s<"u"){this.accountList=s,this.loadingAccounts=!1;return}const o=10;let r=0,a=0,l=[];Promise.all([bt("frontpageAccounts")]).then(c=>{r=c[0].length;for(let u in c[0]){let h=c[0];if(h.hasOwnProperty(u)){let d=h[u];new Bs().get(d,new Date(window.store.get("end"))).then(f=>{let g=f.data.data;const p={page:1,start:new Date(window.store.get("start")),end:new Date(window.store.get("end"))};new Bs().transactions(g.id,p).then(m=>{let b=[];for(let y=0;y<m.data.data.length&&!(y>=o);y++){let x=m.data.data[y],v={title:x.attributes.group_title===null?"":x.attributes.group_title,id:x.id,transactions:[]};for(let _=0;_<x.attributes.transactions.length;_++){let w=x.attributes.transactions[_];const C=w.type==="withdrawal"?parseFloat(w.native_amount)*-1:parseFloat(w.native_amount),M=w.type==="withdrawal"?parseFloat(w.amount)*-1:parseFloat(w.amount);v.transactions.push({description:w.description,id:x.id,type:w.type,amount_raw:M,amount:V(M,w.currency_code),native_amount_raw:C,native_amount:V(C,w.native_currency_code)})}b.push(v)}l.push({name:g.attributes.name,order:g.attributes.order,id:g.id,balance_raw:parseFloat(g.attributes.current_balance),balance:V(g.attributes.current_balance,g.attributes.currency_code),native_balance_raw:parseFloat(g.attributes.native_current_balance),native_balance:V(g.attributes.native_current_balance,g.attributes.native_currency_code),groups:b}),a++,a===r&&(l.sort((y,x)=>y.order-x.order),this.accountList=l,this.loadingAccounts=!1,window.store.set(e,l))})})}}})},init(){Promise.all([bt("viewRange","1M"),bt("autoConversion",!1),bt("language","en_US")]).then(n=>{this.autoConversion=n[1],Ei=!0,this.loadChart(),this.loadAccounts()}),window.store.observe("end",()=>{Ei&&(Ii=null,this.accountList=[],this.loadChart(),this.loadAccounts())}),window.store.observe("autoConversion",()=>{Ei&&(this.loadChart(),this.loadAccounts())})}});let Wg=class{dashboard(t,e){let i=J(t,"y-MM-dd"),s=J(e,"y-MM-dd");return vt.get("/api/v2/chart/budget/dashboard",{params:{start:i,end:s}})}},Ue=[],Nn=null,te=null,zi=!1,Te;const Hg=()=>({loading:!1,autoConversion:!1,loadChart(){if(this.loading!==!0){if(this.loading=!0,te!==null){this.drawChart(this.generateOptions(te)),this.loading=!1;return}this.getFreshData()}},drawChart(n){if(Nn!==null){Nn.data.datasets=n.data.datasets,Nn.update();return}Nn=new mt(document.querySelector("#budget-chart"),n)},getFreshData(){const n=new Date(window.store.get("start")),t=new Date(window.store.get("end")),e=Nt("dashboard-budgets-chart",n,t),i=window.store.get("cacheValid");let s=window.store.get(e);if(i&&typeof s<"u"){te=s,this.drawChart(this.generateOptions(te)),this.loading=!1;return}new Wg().dashboard(n,t,null).then(r=>{te=r.data,this.drawChart(this.generateOptions(te)),window.store.set(e,te),this.loading=!1})},generateOptions(n){Ue=[];let t=yi("column");t.options.locale=window.store.get("locale").replace("_","-"),t.options.plugins={tooltip:{callbacks:{title:function(e){return e.label},label:function(e){let i=e.dataset.label||"";return i&&(i+=": "),i+" "+V(e.parsed.y,Ue[e.parsed.x]??"EUR")}}}},t.data={labels:[],datasets:[{label:Te.t("firefly.spent"),data:[],borderWidth:1,stack:1,backgroundColor:De("spent","background"),borderColor:De("spent","border")},{label:Te.t("firefly.left"),data:[],borderWidth:1,stack:1,backgroundColor:De("left","background"),borderColor:De("left","border")},{label:Te.t("firefly.overspent"),data:[],borderWidth:1,stack:1,backgroundColor:De("overspent","background"),borderColor:De("overspent","border")}]};for(const e in n)if(n.hasOwnProperty(e)){let i=n[e],s=i.label+" ("+i.currency_code+")";t.data.labels.push(s),this.autoConversion&&(Ue.push(i.native_currency_code),t.data.datasets[0].data.push(parseFloat(i.native_entries.spent)*-1),t.data.datasets[1].data.push(parseFloat(i.native_entries.left)),t.data.datasets[2].data.push(parseFloat(i.native_entries.overspent))),this.autoConversion||(Ue.push(i.currency_code),t.data.datasets[0].data.push(parseFloat(i.entries.spent)*-1),t.data.datasets[1].data.push(parseFloat(i.entries.left)),t.data.datasets[2].data.push(parseFloat(i.entries.overspent)))}return t.options.scales={y:{ticks:{callback:function(e){return V(e,Ue[0]??"EUR")}}}},t},init(){Promise.all([bt("autoConversion",!1),bt("language","en_US")]).then(n=>{Te=new li;const t=n[1].replace("-","_");Te.locale=t,ci(Te,t).then(()=>{this.autoConversion=n[0],zi=!0,this.loading===!1&&this.loadChart()})}),window.store.observe("end",()=>{zi&&this.loading===!1&&(te=null,this.loadChart())}),window.store.observe("autoConversion",n=>{zi&&(this.autoConversion=n,this.loading===!1&&this.loadChart())})}});class Vg{dashboard(t,e){let i=J(t,"y-MM-dd"),s=J(e,"y-MM-dd");return vt.get("/api/v2/chart/category/dashboard",{params:{start:i,end:s}})}}let ur=[],$e=null,Se=null,Bi=!1;const Yg=()=>({loading:!1,autoConversion:!1,generateOptions(n){ur=[];let t=yi("column"),e={};for(const s in n)if(n.hasOwnProperty(s)){let o=n[s],r=o.currency_code;this.autoConversion&&(r=o.native_currency_code),e.hasOwnProperty(r)||(e[r]={name:r,yAxisID:"",data:{}},ur.push(r))}for(const s in n)if(n.hasOwnProperty(s)){let o=n[s],r=o.currency_code;this.autoConversion&&(r=o.native_currency_code);for(const a in e)if(e.hasOwnProperty(a)){let l=0;r===a&&(l=parseFloat(o.amount),""+o.currency_code,this.autoConversion&&(l=parseFloat(o.native_amount),""+o.native_currency_code)),e[a].data.hasOwnProperty(o.label)&&(e[a].data[o.label]=e[a].data[o.label]+l),e[a].data.hasOwnProperty(o.label)||(e[a].data[o.label]=l)}t.data.labels.includes(o.label)||t.data.labels.push(o.label)}let i=0;for(const s in e){let o="y"+s,r={label:s,currency_code:s,yAxisID:o,data:[]};for(const a in e[s].data)r.data.push(e[s].data[a]);t.data.datasets.push(r),t.options.scales.hasOwnProperty(o)||(t.options.scales[o]={beginAtZero:!0,type:"linear",position:i===1?"right":"left",ticks:{callback:function(a,l,c){return V(a,s)}}},i++)}return t},drawChart(n){if($e!==null){$e.options=n.options,$e.data=n.data,$e.update();return}$e=new mt(document.querySelector("#category-chart"),n)},getFreshData(){const n=new Date(window.store.get("start")),t=new Date(window.store.get("end")),e=Nt("dashboard-categories-chart",n,t),i=window.store.get("cacheValid");let s=window.store.get(e);if(i&&typeof s<"u"){Se=s,this.drawChart(this.generateOptions(Se)),this.loading=!1;return}new Vg().dashboard(n,t,null).then(r=>{Se=r.data,this.drawChart(this.generateOptions(r.data)),window.store.set(e,Se),this.loading=!1})},loadChart(){if(this.loading!==!0){if(this.loading=!0,Se!==null){this.drawChart(this.generateOptions(Se)),this.loading=!1;return}this.getFreshData()}},init(){Promise.all([bt("autoConversion",!1)]).then(n=>{this.autoConversion=n[0],Bi=!0,this.loadChart()}),window.store.observe("end",()=>{Bi&&(this.chartData=null,this.loadChart())}),window.store.observe("autoConversion",n=>{Bi&&(this.autoConversion=n,this.loadChart())})}});let jg=class{list(t){return vt.get("/api/v2/transactions",{params:t})}};/*!* chartjs-chart-sankey v0.12.0* https://github.com/kurkle/chartjs-chart-sankey#readme* (c) 2022 Jukka Kurkela* Released under the MIT license*/function Ug(n){const t=[],e=K(n)?n:H(n)?[]:[n];for(;e.length;){const i=e.pop();typeof i=="string"?t.unshift.apply(t,i.split(`-`)):Array.isArray(i)?e.push.apply(e,i):H(e)||t.unshift(""+i)}return t}function Ni(n){return!n||["min","max"].indexOf(n)===-1?"max":n}const ae=n=>n!==void 0;function $g(n,t){const e=new Set(t.map(r=>r.to)),i=new Set(t.map(r=>r.from)),s=new Set([...n.keys()]);let o=0;for(;s.size;){const r=qg([...s],e);for(const a of r){const l=n.get(a);ae(l.x)||(l.x=o),s.delete(a)}s.size&&(e.clear(),t.filter(a=>s.has(a.from)).forEach(a=>e.add(a.to)),o++)}return[...n.keys()].filter(r=>!i.has(r)).forEach(r=>{const a=n.get(r);a.column||(a.x=o)}),o}function qg(n,t){const e=n.filter(i=>!t.has(i));return e.length?e:n.slice(0,1)}const Xg=(n,t)=>n.x!==t.x?n.x-t.x:n.y-t.y;let Wn=-1;function Kg(){return Wn=Wn<100?Wn+1:0,Wn}function as(n,t,e=Kg()){let i=0;for(const s of n)s.node._visited!==e&&(s.node._visited=e,i+=s.node[t].length+as(s.node[t],t,e));return i}const Ca=n=>(t,e)=>as(t.node[n],n)-as(e.node[n],n)||t.node[n].length-e.node[n].length;function Cs(n,t){n.from.sort(Ca("from"));for(const e of n.from){const i=e.node;ae(i.y)||(i.y=t,Cs(i,t)),t=Math.max(i.y+i.out,t)}return t}function _e(n,t){n.to.sort(Ca("to"));for(const e of n.to){const i=e.node;ae(i.y)||(i.y=t,_e(i,t)),t=Math.max(i.y+i.in,t)}return t}function qe(n,t){return ae(n.y)?n.y:(n.y=t,t)}function Gg(n,t){const e=n.filter(u=>u.x===0),i=n.filter(u=>u.x===t),s=e.filter(u=>!ae(u.y)),o=i.filter(u=>!ae(u.y)),r=n.filter(u=>u.x>0&&u.x<t&&!ae(u.y));let a=e.reduce((u,h)=>Math.max(u,h.y+h.out||0),0),l=i.reduce((u,h)=>Math.max(u,h.y+h.in||0),0),c=0;return a>=l?(s.forEach(u=>{a=qe(u,a),a=Math.max(a+u.out,_e(u,a))}),o.forEach(u=>{l=qe(u,l),l=Math.max(l+u.in,_e(u,l))})):(o.forEach(u=>{l=qe(u,l),l=Math.max(l+u.in,_e(u,l))}),s.forEach(u=>{a=qe(u,a),a=Math.max(a+u.out,_e(u,a))})),r.forEach(u=>{let h=n.filter(d=>d.x===u.x&&ae(d.y)).reduce((d,f)=>Math.max(d,f.y+Math.max(f.in,f.out)),0);h=qe(u,h),h=Math.max(h+u.in,Cs(u,h)),h=Math.max(h+u.out,_e(u,h)),c=Math.max(c,h)}),Math.max(a,l,c)}function Qg(n,t){n.sort((r,a)=>Math.max(a.in,a.out)-Math.max(r.in,r.out));const e=n[0];e.y=0;const i=Cs(e,0),s=_e(e,0),o=Gg(n,t);return Math.max(i,s,o)}function Zg(n,t){let e=0,i=0;for(let s=0;s<=t;s++){let o=i;const r=n.filter(a=>a.x===s).sort((a,l)=>a.priority-l.priority);i=r[0].to.filter(a=>a.node.x>s+1).reduce((a,l)=>a+l.flow,0)||0;for(const a of r)a.y=o,o+=Math.max(a.out,a.in);e=Math.max(o,e)}return e}function Jg(n,t){let e=1,i=0,s=0,o=0;const r=[];n.sort(Xg);for(const a of n){if(a.y){if(a.x===0)r.push(a.y);else{for(i!==a.x&&(i=a.x,s=0),e=s+1;e<r.length&&!(r[e]>a.y);e++);s=e}a.y+=e*t,e++}o=Math.max(o,a.y+Math.max(a.in,a.out))}return o}function tp(n,t){n.forEach(e=>{const i=Math[t](e.in||e.out,e.out||e.in),s=i<e.in,o=i<e.out;let r=0,a=e.from.length;e.from.sort((l,c)=>l.node.y+l.node.out/2-(c.node.y+c.node.out/2)).forEach((l,c)=>{s?l.addY=c*(i-l.flow)/(a-1):(l.addY=r,r+=l.flow)}),r=0,a=e.to.length,e.to.sort((l,c)=>l.node.y+l.node.in/2-(c.node.y+c.node.in/2)).forEach((l,c)=>{o?l.addY=c*(i-l.flow)/(a-1):(l.addY=r,r+=l.flow)})})}function ep(n,t,e,i){const s=[...n.values()],o=$g(n,t),a=(e?Zg(s,o):Qg(s,o))*.03,l=Jg(s,a);return tp(s,i),{maxX:o,maxY:l}}function np(n){const t=new Map;for(let i=0;i<n.length;i++){const{from:s,to:o,flow:r}=n[i];if(!t.has(s))t.set(s,{key:s,in:0,out:r,from:[],to:[{key:o,flow:r,index:i}]});else{const a=t.get(s);a.out+=r,a.to.push({key:o,flow:r,index:i})}if(!t.has(o))t.set(o,{key:o,in:r,out:0,from:[{key:s,flow:r,index:i}],to:[]});else{const a=t.get(o);a.in+=r,a.from.push({key:s,flow:r,index:i})}}const e=(i,s)=>s.flow-i.flow;return[...t.values()].forEach(i=>{i.from=i.from.sort(e),i.from.forEach(s=>{s.node=t.get(s.key)}),i.to=i.to.sort(e),i.to.forEach(s=>{s.node=t.get(s.key)})}),t}function hr(n,t,e){for(const i of n)if(i.key===t&&i.index===e)return i.addY;return 0}class _i extends Xt{parseObjectData(t,e,i,s){const{from:o="from",to:r="to",flow:a="flow"}=this.options.parsing,l=e.map(({[o]:y,[r]:x,[a]:v})=>({from:y,to:x,flow:v})),{xScale:c,yScale:u}=t,h=[],d=this._nodes=np(l),{column:f,priority:g,size:p}=this.getDataset();if(g)for(const y of d.values())y.key in g&&(y.priority=g[y.key]);if(f)for(const y of d.values())y.key in f&&(y.column=!0,y.x=f[y.key]);const{maxX:m,maxY:b}=ep(d,l,!!g,Ni(p));this._maxX=m,this._maxY=b;for(let y=0,x=l.length;y<x;++y){const v=l[y],_=d.get(v.from),w=d.get(v.to),C=_.y+hr(_.to,v.to,y),M=w.y+hr(w.from,v.from,y);h.push({x:c.parse(_.x,y),y:u.parse(C,y),_custom:{from:_,to:w,x:c.parse(w.x,y),y:u.parse(M,y),height:u.parse(v.flow,y)}})}return h.slice(i,i+s)}getMinMax(t){return{min:0,max:t===this._cachedMeta.xScale?this._maxX:this._maxY}}update(t){const{data:e}=this._cachedMeta;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const{xScale:o,yScale:r}=this._cachedMeta,a=this.resolveDataElementOptions(e,s),l=this.getSharedOptions(s,t[e],a),c=this.getDataset(),u=S(c.borderWidth,1)/2+.5,h=S(c.nodeWidth,10);for(let d=e;d<e+i;d++){const f=this.getParsed(d),g=f._custom,p=r.getPixelForValue(f.y);this.updateElement(t[d],d,{x:o.getPixelForValue(f.x)+h+u,y:p,x2:o.getPixelForValue(g.x)-u,y2:r.getPixelForValue(g.y),from:g.from,to:g.to,progress:s==="reset"?0:1,height:Math.abs(r.getPixelForValue(f.y+g.height)-p),options:this.resolveDataElementOptions(d,s)},s)}this.updateSharedOptions(l,s)}_drawLabels(){const t=this._ctx,e=this._nodes||new Map,i=this.getDataset(),s=Ni(i.size),o=S(i.borderWidth,1),r=S(i.nodeWidth,10),a=i.labels,{xScale:l,yScale:c}=this._cachedMeta;t.save();const u=this.chart.chartArea;for(const h of e.values()){const d=l.getPixelForValue(h.x),f=c.getPixelForValue(h.y),g=Math[s](h.in||h.out,h.out||h.in),p=Math.abs(c.getPixelForValue(h.y+g)-f),m=a&&a[h.key]||h.key;let b=d;t.fillStyle=i.color||"black",t.textBaseline="middle",d<u.width/2?(t.textAlign="left",b+=r+o+4):(t.textAlign="right",b-=o+4),this._drawLabel(m,f,p,t,b)}t.restore()}_drawLabel(t,e,i,s,o){const r=ut(this.options.font,this.chart.options.font),a=H(t)?[]:Ug(t),l=a.length,c=e+i/2,u=r.lineHeight,h=S(this.options.padding,u/2);if(s.font=r.string,l>1){const d=c-u*l/2+h;for(let f=0;f<l;f++)s.fillText(a[f],o,d+f*u)}else s.fillText(t,o,c)}_drawNodes(){const t=this._ctx,e=this._nodes||new Map,i=this.getDataset(),s=Ni(i.size),{xScale:o,yScale:r}=this._cachedMeta,a=S(i.borderWidth,1),l=S(i.nodeWidth,10);t.save(),t.strokeStyle=i.borderColor||"black",t.lineWidth=a;for(const c of e.values()){t.fillStyle=c.color;const u=o.getPixelForValue(c.x),h=r.getPixelForValue(c.y),d=Math[s](c.in||c.out,c.out||c.in),f=Math.abs(r.getPixelForValue(c.y+d)-h);a&&t.strokeRect(u,h,l,f),t.fillRect(u,h,l,f)}t.restore()}draw(){const t=this._ctx,e=this.getMeta().data||[],i=[];for(let s=0,o=e.length;s<o;++s){const r=e[s];r.from.color=r.options.colorFrom,r.to.color=r.options.colorTo,r.active&&i.push(r)}for(const s of i)s.from.color=s.options.colorFrom,s.to.color=s.options.colorTo;this._drawNodes();for(let s=0,o=e.length;s<o;++s)e[s].draw(t);this._drawLabels()}}_i.id="sankey";_i.defaults={dataElementType:"flow",animations:{numbers:{type:"number",properties:["x","y","x2","y2","height"]},progress:{easing:"linear",duration:n=>n.type==="data"?(n.parsed._custom.x-n.parsed.x)*200:void 0,delay:n=>n.type==="data"?n.parsed.x*500+n.dataIndex*20:void 0},colors:{type:"color",properties:["colorFrom","colorTo"]}},transitions:{hide:{animations:{colors:{type:"color",properties:["colorFrom","colorTo"],to:"transparent"}}},show:{animations:{colors:{type:"color",properties:["colorFrom","colorTo"],from:"transparent"}}}}};_i.overrides={interaction:{mode:"nearest",intersect:!0},datasets:{clip:!1,parsing:!0},plugins:{tooltip:{callbacks:{title(){return""},label(n){const t=n.dataset.data[n.dataIndex];return t.from+" -> "+t.to+": "+t.flow}}},legend:{display:!1}},scales:{x:{type:"linear",bounds:"data",display:!1,min:0,offset:!1},y:{type:"linear",bounds:"data",display:!1,min:0,reverse:!0,offset:!1}},layout:{padding:{top:3,left:3,right:13,bottom:3}}};const dr=(n,t,e,i)=>n<e?{cp1:{x:n+(e-n)/3*2,y:t},cp2:{x:n+(e-n)/3,y:i}}:{cp1:{x:n-(n-e)/3,y:0},cp2:{x:e+(n-e)/3,y:0}},Oe=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)});function ip(n,{x:t,x2:e,options:i}){let s;i.colorMode==="from"?s=Ae(i.colorFrom).alpha(.5).rgbString():i.colorMode==="to"?s=Ae(i.colorTo).alpha(.5).rgbString():(s=n.createLinearGradient(t,0,e,0),s.addColorStop(0,Ae(i.colorFrom).alpha(.5).rgbString()),s.addColorStop(1,Ae(i.colorTo).alpha(.5).rgbString())),n.fillStyle=s,n.strokeStyle=s,n.lineWidth=.5}class Ps extends Lt{constructor(t){super(),this.options=void 0,this.x=void 0,this.y=void 0,this.x2=void 0,this.y2=void 0,this.height=void 0,t&&Object.assign(this,t)}draw(t){const e=this,{x:i,x2:s,y:o,y2:r,height:a,progress:l}=e,{cp1:c,cp2:u}=dr(i,o,s,r);l!==0&&(t.save(),l<1&&(t.beginPath(),t.rect(i,Math.min(o,r),(s-i)*l+1,Math.abs(r-o)+a+1),t.clip()),ip(t,e),t.beginPath(),t.moveTo(i,o),t.bezierCurveTo(c.x,c.y,u.x,u.y,s,r),t.lineTo(s,r+a),t.bezierCurveTo(u.x,u.y+a,c.x,c.y+a,i,o+a),t.lineTo(i,o),t.stroke(),t.closePath(),t.fill(),t.restore())}inRange(t,e,i){const{x:s,y:o,x2:r,y2:a,height:l}=this.getProps(["x","y","x2","y2","height"],i);if(t<s||t>r)return!1;const{cp1:c,cp2:u}=dr(s,o,r,a),h=(t-s)/(r-s),d={x:s,y:o},f={x:r,y:a},g=Oe(d,c,h),p=Oe(c,u,h),m=Oe(u,f,h),b=Oe(g,p,h),y=Oe(p,m,h),x=Oe(b,y,h).y;return e>=x&&e<=x+l}inXRange(t,e){const{x:i,x2:s}=this.getProps(["x","x2"],e);return t>=i&&t<=s}inYRange(t,e){const{y:i,y2:s,height:o}=this.getProps(["y","y2","height"],e),r=Math.min(i,s),a=Math.max(i,s)+o;return t>=r&&t<=a}getCenterPoint(t){const{x:e,y:i,x2:s,y2:o,height:r}=this.getProps(["x","y","x2","y2","height"],t);return{x:(e+s)/2,y:(i+o+r)/2}}tooltipPosition(t){return this.getCenterPoint(t)}getRange(t){return t==="x"?this.width/2:this.height/2}}Ps.id="flow";Ps.defaults={colorFrom:"red",colorTo:"green",colorMode:"gradient",hoverColorFrom:(n,t)=>on(t.colorFrom),hoverColorTo:(n,t)=>on(t.colorTo)};mt.register({SankeyController:_i,Flow:Ps});const fr="dashboard-sankey-data";let pt,Wi=!1,Hn=null,Ht=[],ht=!1,L={category:null,unknown_category:null,in:null,out:null,unknown_source:null,unknown_dest:null,unknown_account:null,expense_account:null,revenue_account:null,budget:null,unknown_budget:null,all_money:null};const gr=function(n){return n.includes(L.revenue_account)?"forestgreen":n.includes("("+L.in+",")?"green":n.includes(L.budget)||n.includes(L.unknown_budget)?"Orchid":n.includes("("+L.out+",")?"MediumOrchid":n.includes(L.all_money)?"blue":"red"};function Xe(n,t,e,i){if(n==="category"&&t!==null&&e==="in")return L.category+' "'+t+'" ('+L.in+(ht?", "+i+")":")");if(n==="category"&&t===null&&e==="in")return L.unknown_category+" ("+L.in+(ht?", "+i+")":")");if(n==="category"&&t!==null&&e==="out")return L.category+' "'+t+'" ('+L.out+(ht?", "+i+")":")");if(n==="category"&&t===null&&e==="out")return L.unknown_category+" ("+L.out+(ht?", "+i+")":")");if(n==="account"&&t===null&&e==="in")return L.unknown_source+(ht?" ("+i+")":"");if(n==="account"&&t!==null&&e==="in")return L.revenue_account+'"'+t+'"'+(ht?" ("+i+")":"");if(n==="account"&&t===null&&e==="out")return L.unknown_dest+(ht?" ("+i+")":"");if(n==="account"&&t!==null&&e==="out")return L.expense_account+' "'+t+'"'+(ht?" ("+i+")":"");if(n==="budget"&&t!==null)return L.budget+' "'+t+'"'+(ht?" ("+i+")":"");if(n==="budget"&&t===null)return L.unknown_budget+(ht?" ("+i+")":"");console.error('Cannot handle: type:"'+n+'", dir: "'+e+'"')}function Ke(n,t,e){if(n==="category"&&t!==null)return L.category+' "'+t+'"'+(ht?" ("+e+")":"");if(n==="category"&&t===null)return L.unknown_category+(ht?" ("+e+")":"");if(n==="account"&&t===null)return L.unknown_account+(ht?" ("+e+")":"");if(n==="account"&&t!==null)return t+(ht?" ("+e+")":"");if(n==="budget"&&t!==null)return L.budget+' "'+t+'"'+(ht?" ("+e+")":"");if(n==="budget"&&t===null)return L.unknown_budget+(ht?" ("+e+")":"");console.error('Cannot handle: type:"'+n+'"')}const sp=()=>({loading:!1,autoConversion:!1,generateOptions(){let n=yi("sankey"),t={},e={};for(let s in Ht)if(Ht.hasOwnProperty(s)){let o=Ht[s];for(let r in o.attributes.transactions)if(o.attributes.transactions.hasOwnProperty(r)){let a=o.attributes.transactions[r],l=this.autoConversion?a.native_currency_code:a.currency_code,c=this.autoConversion?parseFloat(a.native_amount):parseFloat(a.amount),u;if(a.type==="deposit"){let h=Xe("category",a.category_name,"in",l),d=Xe("account",a.source_name,"in",l);e[h]=Ke("category",a.category_name,l),e[d]=Ke("account",a.source_name,l),u=d+"-"+h+"-"+l,t.hasOwnProperty(u)||(t[u]={from:d,to:h,amount:0}),t[u].amount+=c,u=h+"-"+L.all_money+"-"+l,t.hasOwnProperty(u)||(t[u]={from:h,to:L.all_money+(this.autoConversion?" ("+l+")":""),amount:0}),t[u].amount+=c}if(a.type==="withdrawal"){let h=Xe("budget",a.budget_name,"out",l);e[h]=Ke("budget",a.budget_name,l),u=L.all_money+"-"+h+"-"+l,t.hasOwnProperty(u)||(t[u]={from:L.all_money+(this.autoConversion?" ("+l+")":""),to:h,amount:0}),t[u].amount+=c;let d=Xe("category",a.category_name,"out",l);e[d]=Ke("category",a.category_name,l),u=h+"-"+d+"-"+l,t.hasOwnProperty(u)||(t[u]={from:h,to:d,amount:0}),t[u].amount+=c;let f=Xe("account",a.destination_name,"out",l);e[f]=Ke("account",a.destination_name,l),u=d+"-"+f+"-"+l,t.hasOwnProperty(u)||(t[u]={from:d,to:f,amount:0}),t[u].amount+=c}}}let i={label:"Firefly III dashboard sankey chart",data:[],colorFrom:s=>gr(s.dataset.data[s.dataIndex]?s.dataset.data[s.dataIndex].from:""),colorTo:s=>gr(s.dataset.data[s.dataIndex]?s.dataset.data[s.dataIndex].to:""),colorMode:"gradient",labels:e,size:"min"};for(let s in t)if(t.hasOwnProperty(s)){let o=t[s];i.data.push({from:o.from,to:o.to,flow:o.amount})}return n.data.datasets.push(i),n},drawChart(n){if(Hn!==null){Hn.data.datasets=n.data.datasets,Hn.update();return}Hn=new mt(document.querySelector("#sankey-chart"),n)},getFreshData(){const n=new Date(window.store.get("start")),t=new Date(window.store.get("end")),e=Nt(fr,n,t),i=window.store.get("cacheValid");let s=window.store.get(e);if(i&&typeof s<"u"){Ht=s,this.drawChart(this.generateOptions()),this.loading=!1;return}let o={start:J(n,"y-MM-dd"),end:J(t,"y-MM-dd"),type:"withdrawal,deposit",page:1};this.downloadTransactions(o)},downloadTransactions(n){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),i=Nt(fr,t,e);new jg().get(n).then(o=>{if(Ht=[...Ht,...o.data.data],parseInt(o.data.meta.pagination.total_pages)>n.page){n.page++,this.downloadTransactions(n);return}window.store.set(i,Ht),this.drawChart(this.generateOptions()),this.loading=!1})},loadChart(){if(this.loading!==!0){if(this.loading=!0,Ht.length!==0){this.drawChart(this.generateOptions()),this.loading=!1;return}this.getFreshData()}},init(){Ht=[],Promise.all([bt("autoConversion",!1),bt("language","en_US")]).then(n=>{this.autoConversion=n[0],ht=n[0],pt=new li;const t=n[1].replace("-","_");pt.locale=t,ci(pt,t).then(()=>{L.all_money=pt.t("firefly.all_money"),L.category=pt.t("firefly.category"),L.in=pt.t("firefly.money_flowing_in"),L.out=pt.t("firefly.money_flowing_out"),L.unknown_category=pt.t("firefly.unknown_category_plain"),L.unknown_source=pt.t("firefly.unknown_source_plain"),L.unknown_dest=pt.t("firefly.unknown_dest_plain"),L.unknown_account=pt.t("firefly.unknown_any_plain"),L.unknown_budget=pt.t("firefly.unknown_budget_plain"),L.expense_account=pt.t("firefly.expense_account"),L.revenue_account=pt.t("firefly.revenue_account"),L.budget=pt.t("firefly.budget"),Wi=!0,this.loadChart()})}),window.store.observe("end",()=>{Wi&&(this.transactions=[],this.loadChart())}),window.store.observe("autoConversion",n=>{Wi&&(this.autoConversion=n,this.loadChart())})}});let op=class{get(t){return vt.get("/api/v2/subscriptions",{params:t})}paid(t){return vt.get("/api/v2/subscriptions/sum/paid",{params:t})}unpaid(t){return vt.get("/api/v2/subscriptions/sum/unpaid",{params:t})}},Hi=!1,ee,Ct={};function Pa(n){return new op().get(n).then(e=>{let i=e.data.data;for(let s in i)if(i.hasOwnProperty(s)){let o=i[s];if(o.attributes.active&&o.attributes.pay_dates.length>0){let r=o.attributes.object_group_id===null?0:o.attributes.object_group_id,a=o.attributes.object_group_title===null?ee.t("firefly.default_group_title_name_plain"):o.attributes.object_group_title,l=o.attributes.object_group_order===null?0:o.attributes.object_group_order;Ct.hasOwnProperty(r)||(Ct[r]={id:r,title:a,order:l,payment_info:{},bills:[]});let c={id:o.id,name:o.attributes.name,amount_min:o.attributes.amount_min,amount_max:o.attributes.amount_max,amount:(parseFloat(o.attributes.amount_max)+parseFloat(o.attributes.amount_min))/2,currency_code:o.attributes.currency_code,native_amount_min:o.attributes.native_amount_min,native_amount_max:o.attributes.native_amount_max,native_amount:(parseFloat(o.attributes.native_amount_max)+parseFloat(o.attributes.native_amount_min))/2,native_currency_code:o.attributes.native_currency_code,transactions:[],pay_dates:o.attributes.pay_dates,paid:o.attributes.paid_dates.length>0};c.expected_amount=n.autoConversion?V(c.native_amount,c.native_currency_code):V(c.amount,c.currency_code),c.expected_times=ee.t("firefly.subscr_expected_x_times",{times:o.attributes.pay_dates.length,amount:c.expected_amount});for(let u in o.attributes.paid_dates)if(o.attributes.paid_dates.hasOwnProperty(u)){const h=o.attributes.paid_dates[u];let d=100;n.autoConversion&&(d=Math.round(-100+parseFloat(h.native_amount)*-1/parseFloat(c.native_amount)*100)),n.autoConversion||(d=Math.round(-100+parseFloat(h.amount)*-1/parseFloat(c.amount)*100));let f={amount:n.autoConversion?V(h.native_amount,h.native_currency_code):V(h.amount,h.currency_code),percentage:d,date:J(new Date(h.date),"PP"),foreign_amount:null};h.foreign_currency_code!==null&&(f.foreign_amount=n.autoConversion?h.foreign_native_amount:h.foreign_amount,f.foreign_currency_code=n.autoConversion?h.native_currency_code:h.foreign_currency_code),c.transactions.push(f)}if(Ct[r].bills.push(c),o.attributes.paid_dates.length===0){const u=o.attributes.pay_dates.length*c.amount,h=o.attributes.pay_dates.length*c.native_amount;Ct[r].payment_info.hasOwnProperty(c.currency_code)||(Ct[r].payment_info[c.currency_code]={currency_code:c.currency_code,paid:0,unpaid:0,native_currency_code:c.native_currency_code,native_paid:0,native_unpaid:0}),Ct[r].payment_info[c.currency_code].unpaid+=u,Ct[r].payment_info[c.currency_code].native_unpaid+=h}if(o.attributes.paid_dates.length>0){for(let u in o.attributes.paid_dates)if(o.attributes.paid_dates.hasOwnProperty(u)){let h=o.attributes.paid_dates[u];Ct[r].payment_info.hasOwnProperty(h.currency_code)||(Ct[r].payment_info[h.currency_code]={currency_code:c.currency_code,paid:0,unpaid:0,native_currency_code:c.native_currency_code,native_paid:0,native_unpaid:0});const d=parseFloat(h.amount)*-1,f=parseFloat(h.native_amount)*-1;Ct[r].payment_info[h.currency_code].paid+=d,Ct[r].payment_info[h.currency_code].native_paid+=f}}}}return parseInt(e.data.meta.pagination.total_pages)>n.page?(n.page++,Pa(n)):Promise.resolve()})}const rp=()=>({loading:!1,autoConversion:!1,subscriptions:[],startSubscriptions(){this.loading=!0;let n=new Date(window.store.get("start")),t=new Date(window.store.get("end"));console.log("here we are");const e=window.store.get("cacheValid");let i=window.store.get(Nt("subscriptions-data-dashboard",n,t));e&&typeof i<"u",Ct={},this.subscriptions=[],console.log("cache is invalid, must download");let s={start:J(n,"y-MM-dd"),end:J(t,"y-MM-dd"),autoConversion:this.autoConversion,page:1};Pa(s).then(()=>{console.log("Done with download!");let o=Object.values(Ct);for(let r in o)if(o.hasOwnProperty(r)){let a=o[r];const l=Object.keys(a.payment_info);a.col_size=l.length===1?"col-6 offset-3":"col-6",a.chart_width=l.length===1?"50%":"100%",a.payment_length=l.length,this.subscriptions.push(a)}this.loading=!1})},drawPieChart(n,t,e){let i="#pie_"+n+"_"+e.currency_code;const s=this.autoConversion?e.native_unpaid:e.unpaid,o=this.autoConversion?e.native_paid:e.paid,r=this.autoConversion?e.native_currency_code:e.currency_code,l={type:"doughnut",data:{labels:[ee.t("firefly.paid"),ee.t("firefly.unpaid")],datasets:[{label:ee.t("firefly.subscriptions_in_group",{title:t}),data:[o,s],backgroundColor:["rgb(54, 162, 235)","rgb(255, 99, 132)"],hoverOffset:4}]},options:{plugins:{tooltip:{callbacks:{label:function(u){return u.dataset.label+": "+V(u.raw,r)}}}}}};var c=mt.getChart(document.querySelector(i));typeof c<"u"&&c.destroy(),new mt(document.querySelector(i),l)},init(){console.log("subscriptions init"),Promise.all([bt("autoConversion",!1),bt("language","en_US")]).then(n=>{console.log("subscriptions after promises"),this.autoConversion=n[0],Hi=!0,ee=new li;const t=n[1].replace("-","_");ee.locale=t,ci(ee,t).then(()=>{this.loading===!1&&this.startSubscriptions()})}),window.store.observe("end",()=>{Hi&&(console.log("subscriptions observe end"),this.loading===!1&&this.startSubscriptions())}),window.store.observe("autoConversion",n=>{Hi&&(console.log("subscriptions observe autoConversion"),this.autoConversion=n,this.loading===!1&&this.startSubscriptions())})}});class ap{get(t){return vt.get("/api/v2/piggy-banks",{params:t})}}let Vt={},Vi=!1,Vn;const pr="dashboard-piggies-data",lp=()=>({loading:!1,autoConversion:!1,sankeyGrouping:"account",piggies:[],getFreshData(){const n=new Date(window.store.get("start")),t=new Date(window.store.get("end")),e=Nt(pr,n,t),i=window.store.get("cacheValid");let s=window.store.get(e);if(i&&typeof s<"u"){Vt=s,this.parsePiggies(),this.loading=!1;return}let o={start:J(n,"y-MM-dd"),end:J(t,"y-MM-dd"),page:1};this.downloadPiggyBanks(o)},downloadPiggyBanks(n){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),i=Nt(pr,t,e);new ap().get(n).then(o=>{if(Vt=[...Vt,...o.data.data],parseInt(o.data.meta.pagination.total_pages)>n.page){n.page++,this.downloadPiggyBanks(n);return}window.store.set(i,Vt),this.parsePiggies(),this.loading=!1})},parsePiggies(){let n=[];for(let t in Vt)if(Vt.hasOwnProperty(t)){let e=Vt[t];if(e.attributes.percentage>=100||e.attributes.percentage===0)continue;let i=e.object_group_title??Vn.t("firefly.default_group_title_name_plain");n.hasOwnProperty(i)||(n[i]={id:e.object_group_id??0,title:i,order:e.object_group_order??0,piggies:[]});let s={id:e.id,name:e.attributes.name,percentage:parseInt(e.attributes.percentage),amount:this.autoConversion?e.attributes.native_current_amount:e.attributes.current_amount,left_to_save:this.autoConversion?e.attributes.native_left_to_save:e.attributes.left_to_save,target_amount:this.autoConversion?e.attributes.native_target_amount:e.attributes.target_amount,save_per_month:this.autoConversion?e.attributes.native_save_per_month:e.attributes.save_per_month,currency_code:this.autoConversion?e.attributes.native_currency_code:e.attributes.currency_code};n[i].piggies.push(s)}this.piggies=Object.values(n)},loadPiggyBanks(){if(this.loading!==!0){if(this.loading=!0,this.piggies.length!==0){this.parsePiggies(),this.loading=!1;return}this.getFreshData()}},init(){Vt=[],Promise.all([bt("autoConversion",!1),bt("language","en_US")]).then(n=>{Vn=new li;const t=n[1].replace("-","_");Vn.locale=t,ci(Vn,t).then(()=>{Vi=!0,this.autoConversion=n[0],this.loadPiggyBanks()})}),window.store.observe("end",()=>{Vi&&(Vt=[],this.loadPiggyBanks())}),window.store.observe("autoConversion",n=>{Vi&&(this.autoConversion=n,this.loadPiggyBanks())})}});/*!+`)):Array.isArray(i)?e.push.apply(e,i):H(e)||t.unshift(""+i)}return t}function Ni(n){return!n||["min","max"].indexOf(n)===-1?"max":n}const ae=n=>n!==void 0;function $g(n,t){const e=new Set(t.map(r=>r.to)),i=new Set(t.map(r=>r.from)),s=new Set([...n.keys()]);let o=0;for(;s.size;){const r=qg([...s],e);for(const a of r){const l=n.get(a);ae(l.x)||(l.x=o),s.delete(a)}s.size&&(e.clear(),t.filter(a=>s.has(a.from)).forEach(a=>e.add(a.to)),o++)}return[...n.keys()].filter(r=>!i.has(r)).forEach(r=>{const a=n.get(r);a.column||(a.x=o)}),o}function qg(n,t){const e=n.filter(i=>!t.has(i));return e.length?e:n.slice(0,1)}const Xg=(n,t)=>n.x!==t.x?n.x-t.x:n.y-t.y;let Wn=-1;function Kg(){return Wn=Wn<100?Wn+1:0,Wn}function as(n,t,e=Kg()){let i=0;for(const s of n)s.node._visited!==e&&(s.node._visited=e,i+=s.node[t].length+as(s.node[t],t,e));return i}const Ca=n=>(t,e)=>as(t.node[n],n)-as(e.node[n],n)||t.node[n].length-e.node[n].length;function Cs(n,t){n.from.sort(Ca("from"));for(const e of n.from){const i=e.node;ae(i.y)||(i.y=t,Cs(i,t)),t=Math.max(i.y+i.out,t)}return t}function _e(n,t){n.to.sort(Ca("to"));for(const e of n.to){const i=e.node;ae(i.y)||(i.y=t,_e(i,t)),t=Math.max(i.y+i.in,t)}return t}function qe(n,t){return ae(n.y)?n.y:(n.y=t,t)}function Gg(n,t){const e=n.filter(u=>u.x===0),i=n.filter(u=>u.x===t),s=e.filter(u=>!ae(u.y)),o=i.filter(u=>!ae(u.y)),r=n.filter(u=>u.x>0&&u.x<t&&!ae(u.y));let a=e.reduce((u,h)=>Math.max(u,h.y+h.out||0),0),l=i.reduce((u,h)=>Math.max(u,h.y+h.in||0),0),c=0;return a>=l?(s.forEach(u=>{a=qe(u,a),a=Math.max(a+u.out,_e(u,a))}),o.forEach(u=>{l=qe(u,l),l=Math.max(l+u.in,_e(u,l))})):(o.forEach(u=>{l=qe(u,l),l=Math.max(l+u.in,_e(u,l))}),s.forEach(u=>{a=qe(u,a),a=Math.max(a+u.out,_e(u,a))})),r.forEach(u=>{let h=n.filter(d=>d.x===u.x&&ae(d.y)).reduce((d,f)=>Math.max(d,f.y+Math.max(f.in,f.out)),0);h=qe(u,h),h=Math.max(h+u.in,Cs(u,h)),h=Math.max(h+u.out,_e(u,h)),c=Math.max(c,h)}),Math.max(a,l,c)}function Qg(n,t){n.sort((r,a)=>Math.max(a.in,a.out)-Math.max(r.in,r.out));const e=n[0];e.y=0;const i=Cs(e,0),s=_e(e,0),o=Gg(n,t);return Math.max(i,s,o)}function Zg(n,t){let e=0,i=0;for(let s=0;s<=t;s++){let o=i;const r=n.filter(a=>a.x===s).sort((a,l)=>a.priority-l.priority);i=r[0].to.filter(a=>a.node.x>s+1).reduce((a,l)=>a+l.flow,0)||0;for(const a of r)a.y=o,o+=Math.max(a.out,a.in);e=Math.max(o,e)}return e}function Jg(n,t){let e=1,i=0,s=0,o=0;const r=[];n.sort(Xg);for(const a of n){if(a.y){if(a.x===0)r.push(a.y);else{for(i!==a.x&&(i=a.x,s=0),e=s+1;e<r.length&&!(r[e]>a.y);e++);s=e}a.y+=e*t,e++}o=Math.max(o,a.y+Math.max(a.in,a.out))}return o}function tp(n,t){n.forEach(e=>{const i=Math[t](e.in||e.out,e.out||e.in),s=i<e.in,o=i<e.out;let r=0,a=e.from.length;e.from.sort((l,c)=>l.node.y+l.node.out/2-(c.node.y+c.node.out/2)).forEach((l,c)=>{s?l.addY=c*(i-l.flow)/(a-1):(l.addY=r,r+=l.flow)}),r=0,a=e.to.length,e.to.sort((l,c)=>l.node.y+l.node.in/2-(c.node.y+c.node.in/2)).forEach((l,c)=>{o?l.addY=c*(i-l.flow)/(a-1):(l.addY=r,r+=l.flow)})})}function ep(n,t,e,i){const s=[...n.values()],o=$g(n,t),a=(e?Zg(s,o):Qg(s,o))*.03,l=Jg(s,a);return tp(s,i),{maxX:o,maxY:l}}function np(n){const t=new Map;for(let i=0;i<n.length;i++){const{from:s,to:o,flow:r}=n[i];if(!t.has(s))t.set(s,{key:s,in:0,out:r,from:[],to:[{key:o,flow:r,index:i}]});else{const a=t.get(s);a.out+=r,a.to.push({key:o,flow:r,index:i})}if(!t.has(o))t.set(o,{key:o,in:r,out:0,from:[{key:s,flow:r,index:i}],to:[]});else{const a=t.get(o);a.in+=r,a.from.push({key:s,flow:r,index:i})}}const e=(i,s)=>s.flow-i.flow;return[...t.values()].forEach(i=>{i.from=i.from.sort(e),i.from.forEach(s=>{s.node=t.get(s.key)}),i.to=i.to.sort(e),i.to.forEach(s=>{s.node=t.get(s.key)})}),t}function hr(n,t,e){for(const i of n)if(i.key===t&&i.index===e)return i.addY;return 0}class _i extends Xt{parseObjectData(t,e,i,s){const{from:o="from",to:r="to",flow:a="flow"}=this.options.parsing,l=e.map(({[o]:y,[r]:x,[a]:v})=>({from:y,to:x,flow:v})),{xScale:c,yScale:u}=t,h=[],d=this._nodes=np(l),{column:f,priority:g,size:p}=this.getDataset();if(g)for(const y of d.values())y.key in g&&(y.priority=g[y.key]);if(f)for(const y of d.values())y.key in f&&(y.column=!0,y.x=f[y.key]);const{maxX:m,maxY:b}=ep(d,l,!!g,Ni(p));this._maxX=m,this._maxY=b;for(let y=0,x=l.length;y<x;++y){const v=l[y],_=d.get(v.from),w=d.get(v.to),C=_.y+hr(_.to,v.to,y),M=w.y+hr(w.from,v.from,y);h.push({x:c.parse(_.x,y),y:u.parse(C,y),_custom:{from:_,to:w,x:c.parse(w.x,y),y:u.parse(M,y),height:u.parse(v.flow,y)}})}return h.slice(i,i+s)}getMinMax(t){return{min:0,max:t===this._cachedMeta.xScale?this._maxX:this._maxY}}update(t){const{data:e}=this._cachedMeta;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const{xScale:o,yScale:r}=this._cachedMeta,a=this.resolveDataElementOptions(e,s),l=this.getSharedOptions(s,t[e],a),c=this.getDataset(),u=S(c.borderWidth,1)/2+.5,h=S(c.nodeWidth,10);for(let d=e;d<e+i;d++){const f=this.getParsed(d),g=f._custom,p=r.getPixelForValue(f.y);this.updateElement(t[d],d,{x:o.getPixelForValue(f.x)+h+u,y:p,x2:o.getPixelForValue(g.x)-u,y2:r.getPixelForValue(g.y),from:g.from,to:g.to,progress:s==="reset"?0:1,height:Math.abs(r.getPixelForValue(f.y+g.height)-p),options:this.resolveDataElementOptions(d,s)},s)}this.updateSharedOptions(l,s)}_drawLabels(){const t=this._ctx,e=this._nodes||new Map,i=this.getDataset(),s=Ni(i.size),o=S(i.borderWidth,1),r=S(i.nodeWidth,10),a=i.labels,{xScale:l,yScale:c}=this._cachedMeta;t.save();const u=this.chart.chartArea;for(const h of e.values()){const d=l.getPixelForValue(h.x),f=c.getPixelForValue(h.y),g=Math[s](h.in||h.out,h.out||h.in),p=Math.abs(c.getPixelForValue(h.y+g)-f),m=a&&a[h.key]||h.key;let b=d;t.fillStyle=i.color||"black",t.textBaseline="middle",d<u.width/2?(t.textAlign="left",b+=r+o+4):(t.textAlign="right",b-=o+4),this._drawLabel(m,f,p,t,b)}t.restore()}_drawLabel(t,e,i,s,o){const r=ut(this.options.font,this.chart.options.font),a=H(t)?[]:Ug(t),l=a.length,c=e+i/2,u=r.lineHeight,h=S(this.options.padding,u/2);if(s.font=r.string,l>1){const d=c-u*l/2+h;for(let f=0;f<l;f++)s.fillText(a[f],o,d+f*u)}else s.fillText(t,o,c)}_drawNodes(){const t=this._ctx,e=this._nodes||new Map,i=this.getDataset(),s=Ni(i.size),{xScale:o,yScale:r}=this._cachedMeta,a=S(i.borderWidth,1),l=S(i.nodeWidth,10);t.save(),t.strokeStyle=i.borderColor||"black",t.lineWidth=a;for(const c of e.values()){t.fillStyle=c.color;const u=o.getPixelForValue(c.x),h=r.getPixelForValue(c.y),d=Math[s](c.in||c.out,c.out||c.in),f=Math.abs(r.getPixelForValue(c.y+d)-h);a&&t.strokeRect(u,h,l,f),t.fillRect(u,h,l,f)}t.restore()}draw(){const t=this._ctx,e=this.getMeta().data||[],i=[];for(let s=0,o=e.length;s<o;++s){const r=e[s];r.from.color=r.options.colorFrom,r.to.color=r.options.colorTo,r.active&&i.push(r)}for(const s of i)s.from.color=s.options.colorFrom,s.to.color=s.options.colorTo;this._drawNodes();for(let s=0,o=e.length;s<o;++s)e[s].draw(t);this._drawLabels()}}_i.id="sankey";_i.defaults={dataElementType:"flow",animations:{numbers:{type:"number",properties:["x","y","x2","y2","height"]},progress:{easing:"linear",duration:n=>n.type==="data"?(n.parsed._custom.x-n.parsed.x)*200:void 0,delay:n=>n.type==="data"?n.parsed.x*500+n.dataIndex*20:void 0},colors:{type:"color",properties:["colorFrom","colorTo"]}},transitions:{hide:{animations:{colors:{type:"color",properties:["colorFrom","colorTo"],to:"transparent"}}},show:{animations:{colors:{type:"color",properties:["colorFrom","colorTo"],from:"transparent"}}}}};_i.overrides={interaction:{mode:"nearest",intersect:!0},datasets:{clip:!1,parsing:!0},plugins:{tooltip:{callbacks:{title(){return""},label(n){const t=n.dataset.data[n.dataIndex];return t.from+" -> "+t.to+": "+t.flow}}},legend:{display:!1}},scales:{x:{type:"linear",bounds:"data",display:!1,min:0,offset:!1},y:{type:"linear",bounds:"data",display:!1,min:0,reverse:!0,offset:!1}},layout:{padding:{top:3,left:3,right:13,bottom:3}}};const dr=(n,t,e,i)=>n<e?{cp1:{x:n+(e-n)/3*2,y:t},cp2:{x:n+(e-n)/3,y:i}}:{cp1:{x:n-(n-e)/3,y:0},cp2:{x:e+(n-e)/3,y:0}},Oe=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)});function ip(n,{x:t,x2:e,options:i}){let s;i.colorMode==="from"?s=Ae(i.colorFrom).alpha(.5).rgbString():i.colorMode==="to"?s=Ae(i.colorTo).alpha(.5).rgbString():(s=n.createLinearGradient(t,0,e,0),s.addColorStop(0,Ae(i.colorFrom).alpha(.5).rgbString()),s.addColorStop(1,Ae(i.colorTo).alpha(.5).rgbString())),n.fillStyle=s,n.strokeStyle=s,n.lineWidth=.5}class Ps extends Lt{constructor(t){super(),this.options=void 0,this.x=void 0,this.y=void 0,this.x2=void 0,this.y2=void 0,this.height=void 0,t&&Object.assign(this,t)}draw(t){const e=this,{x:i,x2:s,y:o,y2:r,height:a,progress:l}=e,{cp1:c,cp2:u}=dr(i,o,s,r);l!==0&&(t.save(),l<1&&(t.beginPath(),t.rect(i,Math.min(o,r),(s-i)*l+1,Math.abs(r-o)+a+1),t.clip()),ip(t,e),t.beginPath(),t.moveTo(i,o),t.bezierCurveTo(c.x,c.y,u.x,u.y,s,r),t.lineTo(s,r+a),t.bezierCurveTo(u.x,u.y+a,c.x,c.y+a,i,o+a),t.lineTo(i,o),t.stroke(),t.closePath(),t.fill(),t.restore())}inRange(t,e,i){const{x:s,y:o,x2:r,y2:a,height:l}=this.getProps(["x","y","x2","y2","height"],i);if(t<s||t>r)return!1;const{cp1:c,cp2:u}=dr(s,o,r,a),h=(t-s)/(r-s),d={x:s,y:o},f={x:r,y:a},g=Oe(d,c,h),p=Oe(c,u,h),m=Oe(u,f,h),b=Oe(g,p,h),y=Oe(p,m,h),x=Oe(b,y,h).y;return e>=x&&e<=x+l}inXRange(t,e){const{x:i,x2:s}=this.getProps(["x","x2"],e);return t>=i&&t<=s}inYRange(t,e){const{y:i,y2:s,height:o}=this.getProps(["y","y2","height"],e),r=Math.min(i,s),a=Math.max(i,s)+o;return t>=r&&t<=a}getCenterPoint(t){const{x:e,y:i,x2:s,y2:o,height:r}=this.getProps(["x","y","x2","y2","height"],t);return{x:(e+s)/2,y:(i+o+r)/2}}tooltipPosition(t){return this.getCenterPoint(t)}getRange(t){return t==="x"?this.width/2:this.height/2}}Ps.id="flow";Ps.defaults={colorFrom:"red",colorTo:"green",colorMode:"gradient",hoverColorFrom:(n,t)=>on(t.colorFrom),hoverColorTo:(n,t)=>on(t.colorTo)};mt.register({SankeyController:_i,Flow:Ps});const fr="dashboard-sankey-data";let pt,Wi=!1,Hn=null,Ht=[],ht=!1,L={category:null,unknown_category:null,in:null,out:null,unknown_source:null,unknown_dest:null,unknown_account:null,expense_account:null,revenue_account:null,budget:null,unknown_budget:null,all_money:null};const gr=function(n){return n.includes(L.revenue_account)?"forestgreen":n.includes("("+L.in+",")?"green":n.includes(L.budget)||n.includes(L.unknown_budget)?"Orchid":n.includes("("+L.out+",")?"MediumOrchid":n.includes(L.all_money)?"blue":"red"};function Xe(n,t,e,i){if(n==="category"&&t!==null&&e==="in")return L.category+' "'+t+'" ('+L.in+(ht?", "+i+")":")");if(n==="category"&&t===null&&e==="in")return L.unknown_category+" ("+L.in+(ht?", "+i+")":")");if(n==="category"&&t!==null&&e==="out")return L.category+' "'+t+'" ('+L.out+(ht?", "+i+")":")");if(n==="category"&&t===null&&e==="out")return L.unknown_category+" ("+L.out+(ht?", "+i+")":")");if(n==="account"&&t===null&&e==="in")return L.unknown_source+(ht?" ("+i+")":"");if(n==="account"&&t!==null&&e==="in")return L.revenue_account+'"'+t+'"'+(ht?" ("+i+")":"");if(n==="account"&&t===null&&e==="out")return L.unknown_dest+(ht?" ("+i+")":"");if(n==="account"&&t!==null&&e==="out")return L.expense_account+' "'+t+'"'+(ht?" ("+i+")":"");if(n==="budget"&&t!==null)return L.budget+' "'+t+'"'+(ht?" ("+i+")":"");if(n==="budget"&&t===null)return L.unknown_budget+(ht?" ("+i+")":"");console.error('Cannot handle: type:"'+n+'", dir: "'+e+'"')}function Ke(n,t,e){if(n==="category"&&t!==null)return L.category+' "'+t+'"'+(ht?" ("+e+")":"");if(n==="category"&&t===null)return L.unknown_category+(ht?" ("+e+")":"");if(n==="account"&&t===null)return L.unknown_account+(ht?" ("+e+")":"");if(n==="account"&&t!==null)return t+(ht?" ("+e+")":"");if(n==="budget"&&t!==null)return L.budget+' "'+t+'"'+(ht?" ("+e+")":"");if(n==="budget"&&t===null)return L.unknown_budget+(ht?" ("+e+")":"");console.error('Cannot handle: type:"'+n+'"')}const sp=()=>({loading:!1,autoConversion:!1,generateOptions(){let n=yi("sankey"),t={},e={};for(let s in Ht)if(Ht.hasOwnProperty(s)){let o=Ht[s];for(let r in o.attributes.transactions)if(o.attributes.transactions.hasOwnProperty(r)){let a=o.attributes.transactions[r],l=this.autoConversion?a.native_currency_code:a.currency_code,c=this.autoConversion?parseFloat(a.native_amount):parseFloat(a.amount),u;if(a.type==="deposit"){let h=Xe("category",a.category_name,"in",l),d=Xe("account",a.source_name,"in",l);e[h]=Ke("category",a.category_name,l),e[d]=Ke("account",a.source_name,l),u=d+"-"+h+"-"+l,t.hasOwnProperty(u)||(t[u]={from:d,to:h,amount:0}),t[u].amount+=c,u=h+"-"+L.all_money+"-"+l,t.hasOwnProperty(u)||(t[u]={from:h,to:L.all_money+(this.autoConversion?" ("+l+")":""),amount:0}),t[u].amount+=c}if(a.type==="withdrawal"){let h=Xe("budget",a.budget_name,"out",l);e[h]=Ke("budget",a.budget_name,l),u=L.all_money+"-"+h+"-"+l,t.hasOwnProperty(u)||(t[u]={from:L.all_money+(this.autoConversion?" ("+l+")":""),to:h,amount:0}),t[u].amount+=c;let d=Xe("category",a.category_name,"out",l);e[d]=Ke("category",a.category_name,l),u=h+"-"+d+"-"+l,t.hasOwnProperty(u)||(t[u]={from:h,to:d,amount:0}),t[u].amount+=c;let f=Xe("account",a.destination_name,"out",l);e[f]=Ke("account",a.destination_name,l),u=d+"-"+f+"-"+l,t.hasOwnProperty(u)||(t[u]={from:d,to:f,amount:0}),t[u].amount+=c}}}let i={label:"Firefly III dashboard sankey chart",data:[],colorFrom:s=>gr(s.dataset.data[s.dataIndex]?s.dataset.data[s.dataIndex].from:""),colorTo:s=>gr(s.dataset.data[s.dataIndex]?s.dataset.data[s.dataIndex].to:""),colorMode:"gradient",labels:e,size:"min"};for(let s in t)if(t.hasOwnProperty(s)){let o=t[s];i.data.push({from:o.from,to:o.to,flow:o.amount})}return n.data.datasets.push(i),n},drawChart(n){if(Hn!==null){Hn.data.datasets=n.data.datasets,Hn.update();return}Hn=new mt(document.querySelector("#sankey-chart"),n)},getFreshData(){const n=new Date(window.store.get("start")),t=new Date(window.store.get("end")),e=Nt(fr,n,t),i=window.store.get("cacheValid");let s=window.store.get(e);if(i&&typeof s<"u"){Ht=s,this.drawChart(this.generateOptions()),this.loading=!1;return}let o={start:J(n,"y-MM-dd"),end:J(t,"y-MM-dd"),type:"withdrawal,deposit",page:1};this.downloadTransactions(o)},downloadTransactions(n){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),i=Nt(fr,t,e);new jg().list(n).then(o=>{if(Ht=[...Ht,...o.data.data],parseInt(o.data.meta.pagination.total_pages)>n.page){n.page++,this.downloadTransactions(n);return}window.store.set(i,Ht),this.drawChart(this.generateOptions()),this.loading=!1})},loadChart(){if(this.loading!==!0){if(this.loading=!0,Ht.length!==0){this.drawChart(this.generateOptions()),this.loading=!1;return}this.getFreshData()}},init(){Ht=[],Promise.all([bt("autoConversion",!1),bt("language","en_US")]).then(n=>{this.autoConversion=n[0],ht=n[0],pt=new li;const t=n[1].replace("-","_");pt.locale=t,ci(pt,t).then(()=>{L.all_money=pt.t("firefly.all_money"),L.category=pt.t("firefly.category"),L.in=pt.t("firefly.money_flowing_in"),L.out=pt.t("firefly.money_flowing_out"),L.unknown_category=pt.t("firefly.unknown_category_plain"),L.unknown_source=pt.t("firefly.unknown_source_plain"),L.unknown_dest=pt.t("firefly.unknown_dest_plain"),L.unknown_account=pt.t("firefly.unknown_any_plain"),L.unknown_budget=pt.t("firefly.unknown_budget_plain"),L.expense_account=pt.t("firefly.expense_account"),L.revenue_account=pt.t("firefly.revenue_account"),L.budget=pt.t("firefly.budget"),Wi=!0,this.loadChart()})}),window.store.observe("end",()=>{Wi&&(this.transactions=[],this.loadChart())}),window.store.observe("autoConversion",n=>{Wi&&(this.autoConversion=n,this.loadChart())})}});let op=class{list(t){return vt.get("/api/v2/subscriptions",{params:t})}paid(t){return vt.get("/api/v2/subscriptions/sum/paid",{params:t})}unpaid(t){return vt.get("/api/v2/subscriptions/sum/unpaid",{params:t})}},Hi=!1,ee,Ct={};function Pa(n){return new op().list(n).then(e=>{let i=e.data.data;for(let s in i)if(i.hasOwnProperty(s)){let o=i[s];if(o.attributes.active&&o.attributes.pay_dates.length>0){let r=o.attributes.object_group_id===null?0:o.attributes.object_group_id,a=o.attributes.object_group_title===null?ee.t("firefly.default_group_title_name_plain"):o.attributes.object_group_title,l=o.attributes.object_group_order===null?0:o.attributes.object_group_order;Ct.hasOwnProperty(r)||(Ct[r]={id:r,title:a,order:l,payment_info:{},bills:[]});let c={id:o.id,name:o.attributes.name,amount_min:o.attributes.amount_min,amount_max:o.attributes.amount_max,amount:(parseFloat(o.attributes.amount_max)+parseFloat(o.attributes.amount_min))/2,currency_code:o.attributes.currency_code,native_amount_min:o.attributes.native_amount_min,native_amount_max:o.attributes.native_amount_max,native_amount:(parseFloat(o.attributes.native_amount_max)+parseFloat(o.attributes.native_amount_min))/2,native_currency_code:o.attributes.native_currency_code,transactions:[],pay_dates:o.attributes.pay_dates,paid:o.attributes.paid_dates.length>0};c.expected_amount=n.autoConversion?V(c.native_amount,c.native_currency_code):V(c.amount,c.currency_code),c.expected_times=ee.t("firefly.subscr_expected_x_times",{times:o.attributes.pay_dates.length,amount:c.expected_amount});for(let u in o.attributes.paid_dates)if(o.attributes.paid_dates.hasOwnProperty(u)){const h=o.attributes.paid_dates[u];let d=100;n.autoConversion&&(d=Math.round(-100+parseFloat(h.native_amount)*-1/parseFloat(c.native_amount)*100)),n.autoConversion||(d=Math.round(-100+parseFloat(h.amount)*-1/parseFloat(c.amount)*100));let f={amount:n.autoConversion?V(h.native_amount,h.native_currency_code):V(h.amount,h.currency_code),percentage:d,date:J(new Date(h.date),"PP"),foreign_amount:null};h.foreign_currency_code!==null&&(f.foreign_amount=n.autoConversion?h.foreign_native_amount:h.foreign_amount,f.foreign_currency_code=n.autoConversion?h.native_currency_code:h.foreign_currency_code),c.transactions.push(f)}if(Ct[r].bills.push(c),o.attributes.paid_dates.length===0){const u=o.attributes.pay_dates.length*c.amount,h=o.attributes.pay_dates.length*c.native_amount;Ct[r].payment_info.hasOwnProperty(c.currency_code)||(Ct[r].payment_info[c.currency_code]={currency_code:c.currency_code,paid:0,unpaid:0,native_currency_code:c.native_currency_code,native_paid:0,native_unpaid:0}),Ct[r].payment_info[c.currency_code].unpaid+=u,Ct[r].payment_info[c.currency_code].native_unpaid+=h}if(o.attributes.paid_dates.length>0){for(let u in o.attributes.paid_dates)if(o.attributes.paid_dates.hasOwnProperty(u)){let h=o.attributes.paid_dates[u];Ct[r].payment_info.hasOwnProperty(h.currency_code)||(Ct[r].payment_info[h.currency_code]={currency_code:c.currency_code,paid:0,unpaid:0,native_currency_code:c.native_currency_code,native_paid:0,native_unpaid:0});const d=parseFloat(h.amount)*-1,f=parseFloat(h.native_amount)*-1;Ct[r].payment_info[h.currency_code].paid+=d,Ct[r].payment_info[h.currency_code].native_paid+=f}}}}return parseInt(e.data.meta.pagination.total_pages)>n.page?(n.page++,Pa(n)):Promise.resolve()})}const rp=()=>({loading:!1,autoConversion:!1,subscriptions:[],startSubscriptions(){this.loading=!0;let n=new Date(window.store.get("start")),t=new Date(window.store.get("end"));console.log("here we are");const e=window.store.get("cacheValid");let i=window.store.get(Nt("subscriptions-data-dashboard",n,t));e&&typeof i<"u",Ct={},this.subscriptions=[],console.log("cache is invalid, must download");let s={start:J(n,"y-MM-dd"),end:J(t,"y-MM-dd"),autoConversion:this.autoConversion,page:1};Pa(s).then(()=>{console.log("Done with download!");let o=Object.values(Ct);for(let r in o)if(o.hasOwnProperty(r)){let a=o[r];const l=Object.keys(a.payment_info);a.col_size=l.length===1?"col-6 offset-3":"col-6",a.chart_width=l.length===1?"50%":"100%",a.payment_length=l.length,this.subscriptions.push(a)}this.loading=!1})},drawPieChart(n,t,e){let i="#pie_"+n+"_"+e.currency_code;const s=this.autoConversion?e.native_unpaid:e.unpaid,o=this.autoConversion?e.native_paid:e.paid,r=this.autoConversion?e.native_currency_code:e.currency_code,l={type:"doughnut",data:{labels:[ee.t("firefly.paid"),ee.t("firefly.unpaid")],datasets:[{label:ee.t("firefly.subscriptions_in_group",{title:t}),data:[o,s],backgroundColor:["rgb(54, 162, 235)","rgb(255, 99, 132)"],hoverOffset:4}]},options:{plugins:{tooltip:{callbacks:{label:function(u){return u.dataset.label+": "+V(u.raw,r)}}}}}};var c=mt.getChart(document.querySelector(i));typeof c<"u"&&c.destroy(),new mt(document.querySelector(i),l)},init(){console.log("subscriptions init"),Promise.all([bt("autoConversion",!1),bt("language","en_US")]).then(n=>{console.log("subscriptions after promises"),this.autoConversion=n[0],Hi=!0,ee=new li;const t=n[1].replace("-","_");ee.locale=t,ci(ee,t).then(()=>{this.loading===!1&&this.startSubscriptions()})}),window.store.observe("end",()=>{Hi&&(console.log("subscriptions observe end"),this.loading===!1&&this.startSubscriptions())}),window.store.observe("autoConversion",n=>{Hi&&(console.log("subscriptions observe autoConversion"),this.autoConversion=n,this.loading===!1&&this.startSubscriptions())})}});class ap{list(t){return vt.get("/api/v2/piggy-banks",{params:t})}}let Vt={},Vi=!1,Vn;const pr="dashboard-piggies-data",lp=()=>({loading:!1,autoConversion:!1,sankeyGrouping:"account",piggies:[],getFreshData(){const n=new Date(window.store.get("start")),t=new Date(window.store.get("end")),e=Nt(pr,n,t),i=window.store.get("cacheValid");let s=window.store.get(e);if(i&&typeof s<"u"){Vt=s,this.parsePiggies(),this.loading=!1;return}let o={start:J(n,"y-MM-dd"),end:J(t,"y-MM-dd"),page:1};this.downloadPiggyBanks(o)},downloadPiggyBanks(n){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),i=Nt(pr,t,e);new ap().list(n).then(o=>{if(Vt=[...Vt,...o.data.data],parseInt(o.data.meta.pagination.total_pages)>n.page){n.page++,this.downloadPiggyBanks(n);return}window.store.set(i,Vt),this.parsePiggies(),this.loading=!1})},parsePiggies(){let n=[];for(let t in Vt)if(Vt.hasOwnProperty(t)){let e=Vt[t];if(e.attributes.percentage>=100||e.attributes.percentage===0)continue;let i=e.object_group_title??Vn.t("firefly.default_group_title_name_plain");n.hasOwnProperty(i)||(n[i]={id:e.object_group_id??0,title:i,order:e.object_group_order??0,piggies:[]});let s={id:e.id,name:e.attributes.name,percentage:parseInt(e.attributes.percentage),amount:this.autoConversion?e.attributes.native_current_amount:e.attributes.current_amount,left_to_save:this.autoConversion?e.attributes.native_left_to_save:e.attributes.left_to_save,target_amount:this.autoConversion?e.attributes.native_target_amount:e.attributes.target_amount,save_per_month:this.autoConversion?e.attributes.native_save_per_month:e.attributes.save_per_month,currency_code:this.autoConversion?e.attributes.native_currency_code:e.attributes.currency_code};n[i].piggies.push(s)}this.piggies=Object.values(n)},loadPiggyBanks(){if(this.loading!==!0){if(this.loading=!0,this.piggies.length!==0){this.parsePiggies(),this.loading=!1;return}this.getFreshData()}},init(){Vt=[],Promise.all([bt("autoConversion",!1),bt("language","en_US")]).then(n=>{Vn=new li;const t=n[1].replace("-","_");Vn.locale=t,ci(Vn,t).then(()=>{Vi=!0,this.autoConversion=n[0],this.loadPiggyBanks()})}),window.store.observe("end",()=>{Vi&&(Vt=[],this.loadPiggyBanks())}),window.store.observe("autoConversion",n=>{Vi&&(this.autoConversion=n,this.loadPiggyBanks())})}});/*!* chartjs-adapter-date-fns v3.0.0* https://www.chartjs.org* (c) 2022 chartjs-adapter-date-fns Contributorsdiff --git a/public/build/assets/load-translations-9a154502.js b/public/build/assets/load-translations-87b32220.jssimilarity index 88%rename from public/build/assets/load-translations-9a154502.jsrename to public/build/assets/load-translations-87b32220.jsindex 4f53dc6dd5..dc6fdafd0c 100644--- a/public/build/assets/load-translations-9a154502.js+++ b/public/build/assets/load-translations-87b32220.js@@ -1,18 +1,18 @@function bind$4(t,e){return function(){return t.apply(e,arguments)}}const{toString:toString$7}=Object.prototype,{getPrototypeOf}=Object,kindOf=(t=>e=>{const a=toString$7.call(e);return t[a]||(t[a]=a.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=t=>(t=t.toLowerCase(),e=>kindOf(e)===t),typeOfTest=t=>e=>typeof e===t,{isArray:isArray$c}=Array,isUndefined=typeOfTest("undefined");function isBuffer$3(t){return t!==null&&!isUndefined(t)&&t.constructor!==null&&!isUndefined(t.constructor)&&isFunction$5(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&isArrayBuffer(t.buffer),e}const isString$1=typeOfTest("string"),isFunction$5=typeOfTest("function"),isNumber=typeOfTest("number"),isObject$b=t=>t!==null&&typeof t=="object",isBoolean=t=>t===!0||t===!1,isPlainObject=t=>{if(kindOf(t)!=="object")return!1;const e=getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},isDate$1=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=t=>isObject$b(t)&&isFunction$5(t.pipe),isFormData=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||isFunction$5(t.append)&&((e=kindOf(t))==="formdata"||e==="object"&&isFunction$5(t.toString)&&t.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),trim$2=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(t,e,{allOwnKeys:a=!1}={}){if(t===null||typeof t>"u")return;let r,n;if(typeof t!="object"&&(t=[t]),isArray$c(t))for(r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else{const i=a?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length;let s;for(r=0;r<o;r++)s=i[r],e.call(null,t[s],s,t)}}function findKey$1(t,e){e=e.toLowerCase();const a=Object.keys(t);let r=a.length,n;for(;r-- >0;)if(n=a[r],e===n.toLowerCase())return n;return null}const _global=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),isContextDefined=t=>!isUndefined(t)&&t!==_global;function merge(){const{caseless:t}=isContextDefined(this)&&this||{},e={},a=(r,n)=>{const i=t&&findKey$1(e,n)||n;isPlainObject(e[i])&&isPlainObject(r)?e[i]=merge(e[i],r):isPlainObject(r)?e[i]=merge({},r):isArray$c(r)?e[i]=r.slice():e[i]=r};for(let r=0,n=arguments.length;r<n;r++)arguments[r]&&forEach(arguments[r],a);return e}const extend=(t,e,a,{allOwnKeys:r}={})=>(forEach(e,(n,i)=>{a&&isFunction$5(n)?t[i]=bind$4(n,a):t[i]=n},{allOwnKeys:r}),t),stripBOM=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),inherits=(t,e,a,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),a&&Object.assign(t.prototype,a)},toFlatObject=(t,e,a,r)=>{let n,i,o;const s={};if(e=e||{},t==null)return e;do{for(n=Object.getOwnPropertyNames(t),i=n.length;i-- >0;)o=n[i],(!r||r(o,t,e))&&!s[o]&&(e[o]=t[o],s[o]=!0);t=a!==!1&&getPrototypeOf(t)}while(t&&(!a||a(t,e))&&t!==Object.prototype);return e},endsWith=(t,e,a)=>{t=String(t),(a===void 0||a>t.length)&&(a=t.length),a-=e.length;const r=t.indexOf(e,a);return r!==-1&&r===a},toArray=t=>{if(!t)return null;if(isArray$c(t))return t;let e=t.length;if(!isNumber(e))return null;const a=new Array(e);for(;e-- >0;)a[e]=t[e];return a},isTypedArray$3=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let n;for(;(n=r.next())&&!n.done;){const i=n.value;e.call(t,i[0],i[1])}},matchAll=(t,e)=>{let a;const r=[];for(;(a=t.exec(e))!==null;)r.push(a);return r},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(a,r,n){return r.toUpperCase()+n}),hasOwnProperty$c=(({hasOwnProperty:t})=>(e,a)=>t.call(e,a))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(t,e)=>{const a=Object.getOwnPropertyDescriptors(t),r={};forEach(a,(n,i)=>{let o;(o=e(n,i,t))!==!1&&(r[i]=o||n)}),Object.defineProperties(t,r)},freezeMethods=t=>{reduceDescriptors(t,(e,a)=>{if(isFunction$5(t)&&["arguments","caller","callee"].indexOf(a)!==-1)return!1;const r=t[a];if(isFunction$5(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+a+"'")})}})},toObjectSet=(t,e)=>{const a={},r=n=>{n.forEach(i=>{a[i]=!0})};return isArray$c(t)?r(t):r(String(t).split(e)),a},noop$3=()=>{},toFiniteNumber=(t,e)=>(t=+t,Number.isFinite(t)?t:e),ALPHA="abcdefghijklmnopqrstuvwxyz",DIGIT="0123456789",ALPHABET={DIGIT,ALPHA,ALPHA_DIGIT:ALPHA+ALPHA.toUpperCase()+DIGIT},generateString=(t=16,e=ALPHABET.ALPHA_DIGIT)=>{let a="";const{length:r}=e;for(;t--;)a+=e[Math.random()*r|0];return a};function isSpecCompliantForm(t){return!!(t&&isFunction$5(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const toJSONObject=t=>{const e=new Array(10),a=(r,n)=>{if(isObject$b(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[n]=r;const i=isArray$c(r)?[]:{};return forEach(r,(o,s)=>{const u=a(o,n+1);!isUndefined(u)&&(i[s]=u)}),e[n]=void 0,i}}return r};return a(t,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=t=>t&&(isObject$b(t)||isFunction$5(t))&&isFunction$5(t.then)&&isFunction$5(t.catch),utils={isArray:isArray$c,isArrayBuffer,isBuffer:isBuffer$3,isFormData,isArrayBufferView,isString:isString$1,isNumber,isBoolean,isObject:isObject$b,isPlainObject,isUndefined,isDate:isDate$1,isFile,isBlob,isRegExp,isFunction:isFunction$5,isStream,isURLSearchParams,isTypedArray:isTypedArray$3,isFileList,forEach,merge,extend,trim:trim$2,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty:hasOwnProperty$c,hasOwnProp:hasOwnProperty$c,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop:noop$3,toFiniteNumber,findKey:findKey$1,global:_global,isContextDefined,ALPHABET,generateString,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable};function AxiosError(t,e,a,r,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),a&&(this.config=a),r&&(this.request=r),n&&(this.response=n)}utils.inherits(AxiosError,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const prototype$1=AxiosError.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{descriptors[t]={value:t}});Object.defineProperties(AxiosError,descriptors);Object.defineProperty(prototype$1,"isAxiosError",{value:!0});AxiosError.from=(t,e,a,r,n,i)=>{const o=Object.create(prototype$1);return utils.toFlatObject(t,o,function(u){return u!==Error.prototype},s=>s!=="isAxiosError"),AxiosError.call(o,t.message,e,a,r,n),o.cause=t,o.name=t.name,i&&Object.assign(o,i),o};const httpAdapter=null;function isVisitable(t){return utils.isPlainObject(t)||utils.isArray(t)}function removeBrackets(t){return utils.endsWith(t,"[]")?t.slice(0,-2):t}function renderKey(t,e,a){return t?t.concat(e).map(function(n,i){return n=removeBrackets(n),!a&&i?"["+n+"]":n}).join(a?".":""):e}function isFlatArray(t){return utils.isArray(t)&&!t.some(isVisitable)}const predicates=utils.toFlatObject(utils,{},null,function(e){return/^is[A-Z]/.test(e)});function toFormData(t,e,a){if(!utils.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,a=utils.toFlatObject(a,{metaTokens:!0,dots:!1,indexes:!1},!1,function(O,M){return!utils.isUndefined(M[O])});const r=a.metaTokens,n=a.visitor||l,i=a.dots,o=a.indexes,u=(a.Blob||typeof Blob<"u"&&Blob)&&utils.isSpecCompliantForm(e);if(!utils.isFunction(n))throw new TypeError("visitor must be a function");function c(T){if(T===null)return"";if(utils.isDate(T))return T.toISOString();if(!u&&utils.isBlob(T))throw new AxiosError("Blob is not supported. Use a Buffer instead.");return utils.isArrayBuffer(T)||utils.isTypedArray(T)?u&&typeof Blob=="function"?new Blob([T]):Buffer.from(T):T}function l(T,O,M){let C=T;if(T&&!M&&typeof T=="object"){if(utils.endsWith(O,"{}"))O=r?O:O.slice(0,-2),T=JSON.stringify(T);else if(utils.isArray(T)&&isFlatArray(T)||(utils.isFileList(T)||utils.endsWith(O,"[]"))&&(C=utils.toArray(T)))return O=removeBrackets(O),C.forEach(function(L,D){!(utils.isUndefined(L)||L===null)&&e.append(o===!0?renderKey([O],D,i):o===null?O:O+"[]",c(L))}),!1}return isVisitable(T)?!0:(e.append(renderKey(M,O,i),c(T)),!1)}const p=[],v=Object.assign(predicates,{defaultVisitor:l,convertValue:c,isVisitable});function S(T,O){if(!utils.isUndefined(T)){if(p.indexOf(T)!==-1)throw Error("Circular reference detected in "+O.join("."));p.push(T),utils.forEach(T,function(C,w){(!(utils.isUndefined(C)||C===null)&&n.call(e,C,utils.isString(w)?w.trim():w,O,v))===!0&&S(C,O?O.concat(w):[w])}),p.pop()}}if(!utils.isObject(t))throw new TypeError("data must be an object");return S(t),e}function encode$1(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function AxiosURLSearchParams(t,e){this._pairs=[],t&&toFormData(t,this,e)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(e,a){this._pairs.push([e,a])};prototype.toString=function(e){const a=e?function(r){return e.call(this,r,encode$1)}:encode$1;return this._pairs.map(function(n){return a(n[0])+"="+a(n[1])},"").join("&")};function encode(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(t,e,a){if(!e)return t;const r=a&&a.encode||encode,n=a&&a.serialize;let i;if(n?i=n(e,a):i=utils.isURLSearchParams(e)?e.toString():new AxiosURLSearchParams(e,a).toString(r),i){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class InterceptorManager{constructor(){this.handlers=[]}use(e,a,r){return this.handlers.push({fulfilled:e,rejected:a,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){utils.forEach(this.handlers,function(r){r!==null&&e(r)})}}const InterceptorManager$1=InterceptorManager,transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,isStandardBrowserEnv=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),isStandardBrowserWebWorkerEnv=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),platform={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},isStandardBrowserEnv,isStandardBrowserWebWorkerEnv,protocols:["http","https","file","blob","url","data"]};function toURLEncodedForm(t,e){return toFormData(t,new platform.classes.URLSearchParams,Object.assign({visitor:function(a,r,n,i){return platform.isNode&&utils.isBuffer(a)?(this.append(r,a.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function parsePropPath(t){return utils.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function arrayToObject(t){const e={},a=Object.keys(t);let r;const n=a.length;let i;for(r=0;r<n;r++)i=a[r],e[i]=t[i];return e}function formDataToJSON(t){function e(a,r,n,i){let o=a[i++];const s=Number.isFinite(+o),u=i>=a.length;return o=!o&&utils.isArray(n)?n.length:o,u?(utils.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!s):((!n[o]||!utils.isObject(n[o]))&&(n[o]=[]),e(a,r,n[o],i)&&utils.isArray(n[o])&&(n[o]=arrayToObject(n[o])),!s)}if(utils.isFormData(t)&&utils.isFunction(t.entries)){const a={};return utils.forEachEntry(t,(r,n)=>{e(parsePropPath(r),n,a,0)}),a}return null}function stringifySafely(t,e,a){if(utils.isString(t))try{return(e||JSON.parse)(t),utils.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(a||JSON.stringify)(t)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http"],transformRequest:[function(e,a){const r=a.getContentType()||"",n=r.indexOf("application/json")>-1,i=utils.isObject(e);if(i&&utils.isHTMLForm(e)&&(e=new FormData(e)),utils.isFormData(e))return n&&n?JSON.stringify(formDataToJSON(e)):e;if(utils.isArrayBuffer(e)||utils.isBuffer(e)||utils.isStream(e)||utils.isFile(e)||utils.isBlob(e))return e;if(utils.isArrayBufferView(e))return e.buffer;if(utils.isURLSearchParams(e))return a.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(e,this.formSerializer).toString();if((s=utils.isFileList(e))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return toFormData(s?{"files[]":e}:e,u&&new u,this.formSerializer)}}return i||n?(a.setContentType("application/json",!1),stringifySafely(e)):e}],transformResponse:[function(e){const a=this.transitional||defaults.transitional,r=a&&a.forcedJSONParsing,n=this.responseType==="json";if(e&&utils.isString(e)&&(r&&!this.responseType||n)){const o=!(a&&a.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(s){if(o)throw s.name==="SyntaxError"?AxiosError.from(s,AxiosError.ERR_BAD_RESPONSE,this,null,this.response):s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils.forEach(["delete","get","head","post","put","patch"],t=>{defaults.headers[t]={}});const defaults$1=defaults,ignoreDuplicateOf=utils.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=t=>{const e={};let a,r,n;return t&&t.split(``).forEach(function(o){n=o.indexOf(":"),a=o.substring(0,n).trim().toLowerCase(),r=o.substring(n+1).trim(),!(!a||e[a]&&ignoreDuplicateOf[a])&&(a==="set-cookie"?e[a]?e[a].push(r):e[a]=[r]:e[a]=e[a]?e[a]+", "+r:r)}),e},$internals=Symbol("internals");function normalizeHeader(t){return t&&String(t).trim().toLowerCase()}function normalizeValue(t){return t===!1||t==null?t:utils.isArray(t)?t.map(normalizeValue):String(t)}function parseTokens(t){const e=Object.create(null),a=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=a.exec(t);)e[r[1]]=r[2];return e}const isValidHeaderName=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function matchHeaderValue(t,e,a,r,n){if(utils.isFunction(r))return r.call(this,e,a);if(n&&(e=a),!!utils.isString(e)){if(utils.isString(r))return e.indexOf(r)!==-1;if(utils.isRegExp(r))return r.test(e)}}function formatHeader(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,a,r)=>a.toUpperCase()+r)}function buildAccessors(t,e){const a=utils.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+a,{value:function(n,i,o){return this[r].call(this,e,n,i,o)},configurable:!0})})}class AxiosHeaders{constructor(e){e&&this.set(e)}set(e,a,r){const n=this;function i(s,u,c){const l=normalizeHeader(u);if(!l)throw new Error("header name must be a non-empty string");const p=utils.findKey(n,l);(!p||n[p]===void 0||c===!0||c===void 0&&n[p]!==!1)&&(n[p||u]=normalizeValue(s))}const o=(s,u)=>utils.forEach(s,(c,l)=>i(c,l,u));return utils.isPlainObject(e)||e instanceof this.constructor?o(e,a):utils.isString(e)&&(e=e.trim())&&!isValidHeaderName(e)?o(parseHeaders(e),a):e!=null&&i(a,e,r),this}get(e,a){if(e=normalizeHeader(e),e){const r=utils.findKey(this,e);if(r){const n=this[r];if(!a)return n;if(a===!0)return parseTokens(n);if(utils.isFunction(a))return a.call(this,n,r);if(utils.isRegExp(a))return a.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,a){if(e=normalizeHeader(e),e){const r=utils.findKey(this,e);return!!(r&&this[r]!==void 0&&(!a||matchHeaderValue(this,this[r],r,a)))}return!1}delete(e,a){const r=this;let n=!1;function i(o){if(o=normalizeHeader(o),o){const s=utils.findKey(r,o);s&&(!a||matchHeaderValue(r,r[s],s,a))&&(delete r[s],n=!0)}}return utils.isArray(e)?e.forEach(i):i(e),n}clear(e){const a=Object.keys(this);let r=a.length,n=!1;for(;r--;){const i=a[r];(!e||matchHeaderValue(this,this[i],i,e,!0))&&(delete this[i],n=!0)}return n}normalize(e){const a=this,r={};return utils.forEach(this,(n,i)=>{const o=utils.findKey(r,i);if(o){a[o]=normalizeValue(n),delete a[i];return}const s=e?formatHeader(i):String(i).trim();s!==i&&delete a[i],a[s]=normalizeValue(n),r[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const a=Object.create(null);return utils.forEach(this,(r,n)=>{r!=null&&r!==!1&&(a[n]=e&&utils.isArray(r)?r.join(", "):r)}),a}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,a])=>e+": "+a).join(`-`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...a){const r=new this(e);return a.forEach(n=>r.set(n)),r}static accessor(e){const r=(this[$internals]=this[$internals]={accessors:{}}).accessors,n=this.prototype;function i(o){const s=normalizeHeader(o);r[s]||(buildAccessors(n,o),r[s]=!0)}return utils.isArray(e)?e.forEach(i):i(e),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils.reduceDescriptors(AxiosHeaders.prototype,({value:t},e)=>{let a=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[a]=r}}});utils.freezeMethods(AxiosHeaders);const AxiosHeaders$1=AxiosHeaders;function transformData(t,e){const a=this||defaults$1,r=e||a,n=AxiosHeaders$1.from(r.headers);let i=r.data;return utils.forEach(t,function(s){i=s.call(a,i,n.normalize(),e?e.status:void 0)}),n.normalize(),i}function isCancel(t){return!!(t&&t.__CANCEL__)}function CanceledError(t,e,a){AxiosError.call(this,t??"canceled",AxiosError.ERR_CANCELED,e,a),this.name="CanceledError"}utils.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function settle(t,e,a){const r=a.config.validateStatus;!a.status||!r||r(a.status)?t(a):e(new AxiosError("Request failed with status code "+a.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}const cookies=platform.isStandardBrowserEnv?function(){return{write:function(a,r,n,i,o,s){const u=[];u.push(a+"="+encodeURIComponent(r)),utils.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),utils.isString(i)&&u.push("path="+i),utils.isString(o)&&u.push("domain="+o),s===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(a){const r=document.cookie.match(new RegExp("(^|;\\s*)("+a+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(a){this.write(a,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function isAbsoluteURL(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function combineURLs(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function buildFullPath(t,e){return t&&!isAbsoluteURL(e)?combineURLs(t,e):e}const isURLSameOrigin=platform.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),a=document.createElement("a");let r;function n(i){let o=i;return e&&(a.setAttribute("href",o),o=a.href),a.setAttribute("href",o),{href:a.href,protocol:a.protocol?a.protocol.replace(/:$/,""):"",host:a.host,search:a.search?a.search.replace(/^\?/,""):"",hash:a.hash?a.hash.replace(/^#/,""):"",hostname:a.hostname,port:a.port,pathname:a.pathname.charAt(0)==="/"?a.pathname:"/"+a.pathname}}return r=n(window.location.href),function(o){const s=utils.isString(o)?n(o):o;return s.protocol===r.protocol&&s.host===r.host}}():function(){return function(){return!0}}();function parseProtocol(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function speedometer(t,e){t=t||10;const a=new Array(t),r=new Array(t);let n=0,i=0,o;return e=e!==void 0?e:1e3,function(u){const c=Date.now(),l=r[i];o||(o=c),a[n]=u,r[n]=c;let p=i,v=0;for(;p!==n;)v+=a[p++],p=p%t;if(n=(n+1)%t,n===i&&(i=(i+1)%t),c-o<e)return;const S=l&&c-l;return S?Math.round(v*1e3/S):void 0}}function progressEventReducer(t,e){let a=0;const r=speedometer(50,250);return n=>{const i=n.loaded,o=n.lengthComputable?n.total:void 0,s=i-a,u=r(s),c=i<=o;a=i;const l={loaded:i,total:o,progress:o?i/o:void 0,bytes:s,rate:u||void 0,estimated:u&&o&&c?(o-i)/u:void 0,event:n};l[e?"download":"upload"]=!0,t(l)}}const isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(t){return new Promise(function(a,r){let n=t.data;const i=AxiosHeaders$1.from(t.headers).normalize(),o=t.responseType;let s;function u(){t.cancelToken&&t.cancelToken.unsubscribe(s),t.signal&&t.signal.removeEventListener("abort",s)}let c;utils.isFormData(n)&&(platform.isStandardBrowserEnv||platform.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.getContentType(/^\s*multipart\/form-data/)?utils.isString(c=i.getContentType())&&i.setContentType(c.replace(/^\s*(multipart\/form-data);+/,"$1")):i.setContentType("multipart/form-data"));let l=new XMLHttpRequest;if(t.auth){const T=t.auth.username||"",O=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(T+":"+O))}const p=buildFullPath(t.baseURL,t.url);l.open(t.method.toUpperCase(),buildURL(p,t.params,t.paramsSerializer),!0),l.timeout=t.timeout;function v(){if(!l)return;const T=AxiosHeaders$1.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),M={data:!o||o==="text"||o==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:T,config:t,request:l};settle(function(w){a(w),u()},function(w){r(w),u()},M),l=null}if("onloadend"in l?l.onloadend=v:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(v)},l.onabort=function(){l&&(r(new AxiosError("Request aborted",AxiosError.ECONNABORTED,t,l)),l=null)},l.onerror=function(){r(new AxiosError("Network Error",AxiosError.ERR_NETWORK,t,l)),l=null},l.ontimeout=function(){let O=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const M=t.transitional||transitionalDefaults;t.timeoutErrorMessage&&(O=t.timeoutErrorMessage),r(new AxiosError(O,M.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,t,l)),l=null},platform.isStandardBrowserEnv){const T=(t.withCredentials||isURLSameOrigin(p))&&t.xsrfCookieName&&cookies.read(t.xsrfCookieName);T&&i.set(t.xsrfHeaderName,T)}n===void 0&&i.setContentType(null),"setRequestHeader"in l&&utils.forEach(i.toJSON(),function(O,M){l.setRequestHeader(M,O)}),utils.isUndefined(t.withCredentials)||(l.withCredentials=!!t.withCredentials),o&&o!=="json"&&(l.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&l.addEventListener("progress",progressEventReducer(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",progressEventReducer(t.onUploadProgress)),(t.cancelToken||t.signal)&&(s=T=>{l&&(r(!T||T.type?new CanceledError(null,t,l):T),l.abort(),l=null)},t.cancelToken&&t.cancelToken.subscribe(s),t.signal&&(t.signal.aborted?s():t.signal.addEventListener("abort",s)));const S=parseProtocol(p);if(S&&platform.protocols.indexOf(S)===-1){r(new AxiosError("Unsupported protocol "+S+":",AxiosError.ERR_BAD_REQUEST,t));return}l.send(n||null)})},knownAdapters={http:httpAdapter,xhr:xhrAdapter};utils.forEach(knownAdapters,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const renderReason=t=>`- ${t}`,isResolvedHandle=t=>utils.isFunction(t)||t===null||t===!1,adapters={getAdapter:t=>{t=utils.isArray(t)?t:[t];const{length:e}=t;let a,r;const n={};for(let i=0;i<e;i++){a=t[i];let o;if(r=a,!isResolvedHandle(a)&&(r=knownAdapters[(o=String(a)).toLowerCase()],r===void 0))throw new AxiosError(`Unknown adapter '${o}'`);if(r)break;n[o||"#"+i]=r}if(!r){const i=Object.entries(n).map(([s,u])=>`adapter ${s} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=e?i.length>1?`since :+`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...a){const r=new this(e);return a.forEach(n=>r.set(n)),r}static accessor(e){const r=(this[$internals]=this[$internals]={accessors:{}}).accessors,n=this.prototype;function i(o){const s=normalizeHeader(o);r[s]||(buildAccessors(n,o),r[s]=!0)}return utils.isArray(e)?e.forEach(i):i(e),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils.reduceDescriptors(AxiosHeaders.prototype,({value:t},e)=>{let a=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[a]=r}}});utils.freezeMethods(AxiosHeaders);const AxiosHeaders$1=AxiosHeaders;function transformData(t,e){const a=this||defaults$1,r=e||a,n=AxiosHeaders$1.from(r.headers);let i=r.data;return utils.forEach(t,function(s){i=s.call(a,i,n.normalize(),e?e.status:void 0)}),n.normalize(),i}function isCancel(t){return!!(t&&t.__CANCEL__)}function CanceledError(t,e,a){AxiosError.call(this,t??"canceled",AxiosError.ERR_CANCELED,e,a),this.name="CanceledError"}utils.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function settle(t,e,a){const r=a.config.validateStatus;!a.status||!r||r(a.status)?t(a):e(new AxiosError("Request failed with status code "+a.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}const cookies=platform.isStandardBrowserEnv?function(){return{write:function(a,r,n,i,o,s){const u=[];u.push(a+"="+encodeURIComponent(r)),utils.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),utils.isString(i)&&u.push("path="+i),utils.isString(o)&&u.push("domain="+o),s===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(a){const r=document.cookie.match(new RegExp("(^|;\\s*)("+a+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(a){this.write(a,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function isAbsoluteURL(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function combineURLs(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function buildFullPath(t,e){return t&&!isAbsoluteURL(e)?combineURLs(t,e):e}const isURLSameOrigin=platform.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),a=document.createElement("a");let r;function n(i){let o=i;return e&&(a.setAttribute("href",o),o=a.href),a.setAttribute("href",o),{href:a.href,protocol:a.protocol?a.protocol.replace(/:$/,""):"",host:a.host,search:a.search?a.search.replace(/^\?/,""):"",hash:a.hash?a.hash.replace(/^#/,""):"",hostname:a.hostname,port:a.port,pathname:a.pathname.charAt(0)==="/"?a.pathname:"/"+a.pathname}}return r=n(window.location.href),function(o){const s=utils.isString(o)?n(o):o;return s.protocol===r.protocol&&s.host===r.host}}():function(){return function(){return!0}}();function parseProtocol(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function speedometer(t,e){t=t||10;const a=new Array(t),r=new Array(t);let n=0,i=0,o;return e=e!==void 0?e:1e3,function(u){const c=Date.now(),l=r[i];o||(o=c),a[n]=u,r[n]=c;let p=i,v=0;for(;p!==n;)v+=a[p++],p=p%t;if(n=(n+1)%t,n===i&&(i=(i+1)%t),c-o<e)return;const S=l&&c-l;return S?Math.round(v*1e3/S):void 0}}function progressEventReducer(t,e){let a=0;const r=speedometer(50,250);return n=>{const i=n.loaded,o=n.lengthComputable?n.total:void 0,s=i-a,u=r(s),c=i<=o;a=i;const l={loaded:i,total:o,progress:o?i/o:void 0,bytes:s,rate:u||void 0,estimated:u&&o&&c?(o-i)/u:void 0,event:n};l[e?"download":"upload"]=!0,t(l)}}const isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(t){return new Promise(function(a,r){let n=t.data;const i=AxiosHeaders$1.from(t.headers).normalize(),o=t.responseType;let s;function u(){t.cancelToken&&t.cancelToken.unsubscribe(s),t.signal&&t.signal.removeEventListener("abort",s)}let c;utils.isFormData(n)&&(platform.isStandardBrowserEnv||platform.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.getContentType(/^\s*multipart\/form-data/)?utils.isString(c=i.getContentType())&&i.setContentType(c.replace(/^\s*(multipart\/form-data);+/,"$1")):i.setContentType("multipart/form-data"));let l=new XMLHttpRequest;if(t.auth){const T=t.auth.username||"",O=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(T+":"+O))}const p=buildFullPath(t.baseURL,t.url);l.open(t.method.toUpperCase(),buildURL(p,t.params,t.paramsSerializer),!0),l.timeout=t.timeout;function v(){if(!l)return;const T=AxiosHeaders$1.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),M={data:!o||o==="text"||o==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:T,config:t,request:l};settle(function(w){a(w),u()},function(w){r(w),u()},M),l=null}if("onloadend"in l?l.onloadend=v:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(v)},l.onabort=function(){l&&(r(new AxiosError("Request aborted",AxiosError.ECONNABORTED,t,l)),l=null)},l.onerror=function(){r(new AxiosError("Network Error",AxiosError.ERR_NETWORK,t,l)),l=null},l.ontimeout=function(){let O=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const M=t.transitional||transitionalDefaults;t.timeoutErrorMessage&&(O=t.timeoutErrorMessage),r(new AxiosError(O,M.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,t,l)),l=null},platform.isStandardBrowserEnv){const T=isURLSameOrigin(p)&&t.xsrfCookieName&&cookies.read(t.xsrfCookieName);T&&i.set(t.xsrfHeaderName,T)}n===void 0&&i.setContentType(null),"setRequestHeader"in l&&utils.forEach(i.toJSON(),function(O,M){l.setRequestHeader(M,O)}),utils.isUndefined(t.withCredentials)||(l.withCredentials=!!t.withCredentials),o&&o!=="json"&&(l.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&l.addEventListener("progress",progressEventReducer(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",progressEventReducer(t.onUploadProgress)),(t.cancelToken||t.signal)&&(s=T=>{l&&(r(!T||T.type?new CanceledError(null,t,l):T),l.abort(),l=null)},t.cancelToken&&t.cancelToken.subscribe(s),t.signal&&(t.signal.aborted?s():t.signal.addEventListener("abort",s)));const S=parseProtocol(p);if(S&&platform.protocols.indexOf(S)===-1){r(new AxiosError("Unsupported protocol "+S+":",AxiosError.ERR_BAD_REQUEST,t));return}l.send(n||null)})},knownAdapters={http:httpAdapter,xhr:xhrAdapter};utils.forEach(knownAdapters,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const renderReason=t=>`- ${t}`,isResolvedHandle=t=>utils.isFunction(t)||t===null||t===!1,adapters={getAdapter:t=>{t=utils.isArray(t)?t:[t];const{length:e}=t;let a,r;const n={};for(let i=0;i<e;i++){a=t[i];let o;if(r=a,!isResolvedHandle(a)&&(r=knownAdapters[(o=String(a)).toLowerCase()],r===void 0))throw new AxiosError(`Unknown adapter '${o}'`);if(r)break;n[o||"#"+i]=r}if(!r){const i=Object.entries(n).map(([s,u])=>`adapter ${s} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=e?i.length>1?`since :`+i.map(renderReason).join(`-`):" "+renderReason(i[0]):"as no adapter specified";throw new AxiosError("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:knownAdapters};function throwIfCancellationRequested(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new CanceledError(null,t)}function dispatchRequest(t){return throwIfCancellationRequested(t),t.headers=AxiosHeaders$1.from(t.headers),t.data=transformData.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(t.adapter||defaults$1.adapter)(t).then(function(r){return throwIfCancellationRequested(t),r.data=transformData.call(t,t.transformResponse,r),r.headers=AxiosHeaders$1.from(r.headers),r},function(r){return isCancel(r)||(throwIfCancellationRequested(t),r&&r.response&&(r.response.data=transformData.call(t,t.transformResponse,r.response),r.response.headers=AxiosHeaders$1.from(r.response.headers))),Promise.reject(r)})}const headersToObject=t=>t instanceof AxiosHeaders$1?t.toJSON():t;function mergeConfig(t,e){e=e||{};const a={};function r(c,l,p){return utils.isPlainObject(c)&&utils.isPlainObject(l)?utils.merge.call({caseless:p},c,l):utils.isPlainObject(l)?utils.merge({},l):utils.isArray(l)?l.slice():l}function n(c,l,p){if(utils.isUndefined(l)){if(!utils.isUndefined(c))return r(void 0,c,p)}else return r(c,l,p)}function i(c,l){if(!utils.isUndefined(l))return r(void 0,l)}function o(c,l){if(utils.isUndefined(l)){if(!utils.isUndefined(c))return r(void 0,c)}else return r(void 0,l)}function s(c,l,p){if(p in e)return r(c,l);if(p in t)return r(void 0,c)}const u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(c,l)=>n(headersToObject(c),headersToObject(l),!0)};return utils.forEach(Object.keys(Object.assign({},t,e)),function(l){const p=u[l]||n,v=p(t[l],e[l],l);utils.isUndefined(v)&&p!==s||(a[l]=v)}),a}const VERSION$1="1.5.1",validators$1={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{validators$1[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const deprecatedWarnings={};validators$1.transitional=function(e,a,r){function n(i,o){return"[Axios v"+VERSION$1+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,s)=>{if(e===!1)throw new AxiosError(n(o," has been removed"+(a?" in "+a:"")),AxiosError.ERR_DEPRECATED);return a&&!deprecatedWarnings[o]&&(deprecatedWarnings[o]=!0,console.warn(n(o," has been deprecated since v"+a+" and will be removed in the near future"))),e?e(i,o,s):!0}};function assertOptions(t,e,a){if(typeof t!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let n=r.length;for(;n-- >0;){const i=r[n],o=e[i];if(o){const s=t[i],u=s===void 0||o(s,i,t);if(u!==!0)throw new AxiosError("option "+i+" must be "+u,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new AxiosError("Unknown option "+i,AxiosError.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;class Axios{constructor(e){this.defaults=e,this.interceptors={request:new InterceptorManager$1,response:new InterceptorManager$1}}request(e,a){typeof e=="string"?(a=a||{},a.url=e):a=e||{},a=mergeConfig(this.defaults,a);const{transitional:r,paramsSerializer:n,headers:i}=a;r!==void 0&&validator.assertOptions(r,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),n!=null&&(utils.isFunction(n)?a.paramsSerializer={serialize:n}:validator.assertOptions(n,{encode:validators.function,serialize:validators.function},!0)),a.method=(a.method||this.defaults.method||"get").toLowerCase();let o=i&&utils.merge(i.common,i[a.method]);i&&utils.forEach(["delete","get","head","post","put","patch","common"],T=>{delete i[T]}),a.headers=AxiosHeaders$1.concat(o,i);const s=[];let u=!0;this.interceptors.request.forEach(function(O){typeof O.runWhen=="function"&&O.runWhen(a)===!1||(u=u&&O.synchronous,s.unshift(O.fulfilled,O.rejected))});const c=[];this.interceptors.response.forEach(function(O){c.push(O.fulfilled,O.rejected)});let l,p=0,v;if(!u){const T=[dispatchRequest.bind(this),void 0];for(T.unshift.apply(T,s),T.push.apply(T,c),v=T.length,l=Promise.resolve(a);p<v;)l=l.then(T[p++],T[p++]);return l}v=s.length;let S=a;for(p=0;p<v;){const T=s[p++],O=s[p++];try{S=T(S)}catch(M){O.call(this,M);break}}try{l=dispatchRequest.call(this,S)}catch(T){return Promise.reject(T)}for(p=0,v=c.length;p<v;)l=l.then(c[p++],c[p++]);return l}getUri(e){e=mergeConfig(this.defaults,e);const a=buildFullPath(e.baseURL,e.url);return buildURL(a,e.params,e.paramsSerializer)}}utils.forEach(["delete","get","head","options"],function(e){Axios.prototype[e]=function(a,r){return this.request(mergeConfig(r||{},{method:e,url:a,data:(r||{}).data}))}});utils.forEach(["post","put","patch"],function(e){function a(r){return function(i,o,s){return this.request(mergeConfig(s||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Axios.prototype[e]=a(),Axios.prototype[e+"Form"]=a(!0)});const Axios$1=Axios;class CancelToken{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(i){a=i});const r=this;this.promise.then(n=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](n);r._listeners=null}),this.promise.then=n=>{let i;const o=new Promise(s=>{r.subscribe(s),i=s}).then(n);return o.cancel=function(){r.unsubscribe(i)},o},e(function(i,o,s){r.reason||(r.reason=new CanceledError(i,o,s),a(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const a=this._listeners.indexOf(e);a!==-1&&this._listeners.splice(a,1)}static source(){let e;return{token:new CancelToken(function(n){e=n}),cancel:e}}}const CancelToken$1=CancelToken;function spread(t){return function(a){return t.apply(null,a)}}function isAxiosError(t){return utils.isObject(t)&&t.isAxiosError===!0}const HttpStatusCode={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode).forEach(([t,e])=>{HttpStatusCode[e]=t});const HttpStatusCode$1=HttpStatusCode;function createInstance(t){const e=new Axios$1(t),a=bind$4(Axios$1.prototype.request,e);return utils.extend(a,Axios$1.prototype,e,{allOwnKeys:!0}),utils.extend(a,e,null,{allOwnKeys:!0}),a.create=function(n){return createInstance(mergeConfig(t,n))},a}const axios=createInstance(defaults$1);axios.Axios=Axios$1;axios.CanceledError=CanceledError;axios.CancelToken=CancelToken$1;axios.isCancel=isCancel;axios.VERSION=VERSION$1;axios.toFormData=toFormData;axios.AxiosError=AxiosError;axios.Cancel=axios.CanceledError;axios.all=function(e){return Promise.all(e)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig;axios.AxiosHeaders=AxiosHeaders$1;axios.formToJSON=t=>formDataToJSON(utils.isHTMLForm(t)?new FormData(t):t);axios.getAdapter=adapters.getAdapter;axios.HttpStatusCode=HttpStatusCode$1;axios.default=axios;const axios$1=axios;var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var assign=make_assign(),create$2=make_create(),trim$1=make_trim(),Global$5=typeof window<"u"?window:commonjsGlobal,util$7={assign,create:create$2,trim:trim$1,bind:bind$3,slice:slice$2,each:each$8,map,pluck:pluck$1,isList:isList$1,isFunction:isFunction$4,isObject:isObject$a,Global:Global$5};function make_assign(){return Object.assign?Object.assign:function(e,a,r,n){for(var i=1;i<arguments.length;i++)each$8(Object(arguments[i]),function(o,s){e[s]=o});return e}}function make_create(){if(Object.create)return function(e,a,r,n){var i=slice$2(arguments,1);return assign.apply(this,[Object.create(e)].concat(i))};{let t=function(){};return function(a,r,n,i){var o=slice$2(arguments,1);return t.prototype=a,assign.apply(this,[new t].concat(o))}}}function make_trim(){return String.prototype.trim?function(e){return String.prototype.trim.call(e)}:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function bind$3(t,e){return function(){return e.apply(t,Array.prototype.slice.call(arguments,0))}}function slice$2(t,e){return Array.prototype.slice.call(t,e||0)}function each$8(t,e){pluck$1(t,function(a,r){return e(a,r),!1})}function map(t,e){var a=isList$1(t)?[]:{};return pluck$1(t,function(r,n){return a[n]=e(r,n),!1}),a}function pluck$1(t,e){if(isList$1(t)){for(var a=0;a<t.length;a++)if(e(t[a],a))return t[a]}else for(var r in t)if(t.hasOwnProperty(r)&&e(t[r],r))return t[r]}function isList$1(t){return t!=null&&typeof t!="function"&&typeof t.length=="number"}function isFunction$4(t){return t&&{}.toString.call(t)==="[object Function]"}function isObject$a(t){return t&&{}.toString.call(t)==="[object Object]"}var util$6=util$7,slice$1=util$6.slice,pluck=util$6.pluck,each$7=util$6.each,bind$2=util$6.bind,create$1=util$6.create,isList=util$6.isList,isFunction$3=util$6.isFunction,isObject$9=util$6.isObject,storeEngine={createStore},storeAPI={version:"2.0.12",enabled:!1,get:function(t,e){var a=this.storage.read(this._namespacePrefix+t);return this._deserialize(a,e)},set:function(t,e){return e===void 0?this.remove(t):(this.storage.write(this._namespacePrefix+t,this._serialize(e)),e)},remove:function(t){this.storage.remove(this._namespacePrefix+t)},each:function(t){var e=this;this.storage.each(function(a,r){t.call(e,e._deserialize(a),(r||"").replace(e._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(t){return this._namespacePrefix=="__storejs_"+t+"_"},createStore:function(){return createStore.apply(this,arguments)},addPlugin:function(t){this._addPlugin(t)},namespace:function(t){return createStore(this.storage,this.plugins,t)}};function _warn(){var t=typeof console>"u"?null:console;if(t){var e=t.warn?t.warn:t.log;e.apply(t,arguments)}}function createStore(t,e,a){a||(a=""),t&&!isList(t)&&(t=[t]),e&&!isList(e)&&(e=[e]);var r=a?"__storejs_"+a+"_":"",n=a?new RegExp("^"+r):null,i=/^[a-zA-Z0-9_\-]*$/;if(!i.test(a))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var o={_namespacePrefix:r,_namespaceRegexp:n,_testStorage:function(u){try{var c="__storejs__test__";u.write(c,c);var l=u.read(c)===c;return u.remove(c),l}catch{return!1}},_assignPluginFnProp:function(u,c){var l=this[c];this[c]=function(){var v=slice$1(arguments,0),S=this;function T(){if(l)return each$7(arguments,function(M,C){v[C]=M}),l.apply(S,v)}var O=[T].concat(v);return u.apply(S,O)}},_serialize:function(u){return JSON.stringify(u)},_deserialize:function(u,c){if(!u)return c;var l="";try{l=JSON.parse(u)}catch{l=u}return l!==void 0?l:c},_addStorage:function(u){this.enabled||this._testStorage(u)&&(this.storage=u,this.enabled=!0)},_addPlugin:function(u){var c=this;if(isList(u)){each$7(u,function(v){c._addPlugin(v)});return}var l=pluck(this.plugins,function(v){return u===v});if(!l){if(this.plugins.push(u),!isFunction$3(u))throw new Error("Plugins must be function values that return objects");var p=u.call(this);if(!isObject$9(p))throw new Error("Plugins must return an object of function properties");each$7(p,function(v,S){if(!isFunction$3(v))throw new Error("Bad plugin property: "+S+" from plugin "+u.name+". Plugins should only return functions.");c._assignPluginFnProp(v,S)})}},addStorage:function(u){_warn("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(u)}},s=create$1(o,storeAPI,{plugins:[]});return s.raw={},each$7(s,function(u,c){isFunction$3(u)&&(s.raw[c]=bind$2(s,u))}),each$7(t,function(u){s._addStorage(u)}),each$7(e,function(u){s._addPlugin(u)}),s}var util$5=util$7,Global$4=util$5.Global,localStorage_1={name:"localStorage",read:read$6,write:write$6,each:each$6,remove:remove$5,clearAll:clearAll$5};function localStorage(){return Global$4.localStorage}function read$6(t){return localStorage().getItem(t)}function write$6(t,e){return localStorage().setItem(t,e)}function each$6(t){for(var e=localStorage().length-1;e>=0;e--){var a=localStorage().key(e);t(read$6(a),a)}}function remove$5(t){return localStorage().removeItem(t)}function clearAll$5(){return localStorage().clear()}var util$4=util$7,Global$3=util$4.Global,oldFFGlobalStorage={name:"oldFF-globalStorage",read:read$5,write:write$5,each:each$5,remove:remove$4,clearAll:clearAll$4},globalStorage=Global$3.globalStorage;function read$5(t){return globalStorage[t]}function write$5(t,e){globalStorage[t]=e}function each$5(t){for(var e=globalStorage.length-1;e>=0;e--){var a=globalStorage.key(e);t(globalStorage[a],a)}}function remove$4(t){return globalStorage.removeItem(t)}function clearAll$4(){each$5(function(t,e){delete globalStorage[t]})}var util$3=util$7,Global$2=util$3.Global,oldIEUserDataStorage={name:"oldIE-userDataStorage",write:write$4,read:read$4,each:each$4,remove:remove$3,clearAll:clearAll$3},storageName="storejs",doc$1=Global$2.document,_withStorageEl=_makeIEStorageElFunction(),disable=(Global$2.navigator?Global$2.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function write$4(t,e){if(!disable){var a=fixKey(t);_withStorageEl(function(r){r.setAttribute(a,e),r.save(storageName)})}}function read$4(t){if(!disable){var e=fixKey(t),a=null;return _withStorageEl(function(r){a=r.getAttribute(e)}),a}}function each$4(t){_withStorageEl(function(e){for(var a=e.XMLDocument.documentElement.attributes,r=a.length-1;r>=0;r--){var n=a[r];t(e.getAttribute(n.name),n.name)}})}function remove$3(t){var e=fixKey(t);_withStorageEl(function(a){a.removeAttribute(e),a.save(storageName)})}function clearAll$3(){_withStorageEl(function(t){var e=t.XMLDocument.documentElement.attributes;t.load(storageName);for(var a=e.length-1;a>=0;a--)t.removeAttribute(e[a].name);t.save(storageName)})}var forbiddenCharsRegex=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function fixKey(t){return t.replace(/^\d/,"___$&").replace(forbiddenCharsRegex,"___")}function _makeIEStorageElFunction(){if(!doc$1||!doc$1.documentElement||!doc$1.documentElement.addBehavior)return null;var t="script",e,a,r;try{a=new ActiveXObject("htmlfile"),a.open(),a.write("<"+t+">document.w=window</"+t+'><iframe src="/favicon.ico"></iframe>'),a.close(),e=a.w.frames[0].document,r=e.createElement("div")}catch{r=doc$1.createElement("div"),e=doc$1.body}return function(n){var i=[].slice.call(arguments,0);i.unshift(r),e.appendChild(r),r.addBehavior("#default#userData"),r.load(storageName),n.apply(this,i),e.removeChild(r)}}var util$2=util$7,Global$1=util$2.Global,trim=util$2.trim,cookieStorage={name:"cookieStorage",read:read$3,write:write$3,each:each$3,remove:remove$2,clearAll:clearAll$2},doc=Global$1.document;function read$3(t){if(!t||!_has(t))return null;var e="(?:^|.*;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(doc.cookie.replace(new RegExp(e),"$1"))}function each$3(t){for(var e=doc.cookie.split(/; ?/g),a=e.length-1;a>=0;a--)if(trim(e[a])){var r=e[a].split("="),n=unescape(r[0]),i=unescape(r[1]);t(i,n)}}function write$3(t,e){t&&(doc.cookie=escape(t)+"="+escape(e)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")}function remove$2(t){!t||!_has(t)||(doc.cookie=escape(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function clearAll$2(){each$3(function(t,e){remove$2(e)})}function _has(t){return new RegExp("(?:^|;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(doc.cookie)}var util$1=util$7,Global=util$1.Global,sessionStorage_1={name:"sessionStorage",read:read$2,write:write$2,each:each$2,remove:remove$1,clearAll:clearAll$1};function sessionStorage(){return Global.sessionStorage}function read$2(t){return sessionStorage().getItem(t)}function write$2(t,e){return sessionStorage().setItem(t,e)}function each$2(t){for(var e=sessionStorage().length-1;e>=0;e--){var a=sessionStorage().key(e);t(read$2(a),a)}}function remove$1(t){return sessionStorage().removeItem(t)}function clearAll$1(){return sessionStorage().clear()}var memoryStorage_1={name:"memoryStorage",read:read$1,write:write$1,each:each$1,remove,clearAll},memoryStorage={};function read$1(t){return memoryStorage[t]}function write$1(t,e){memoryStorage[t]=e}function each$1(t){for(var e in memoryStorage)memoryStorage.hasOwnProperty(e)&&t(memoryStorage[e],e)}function remove(t){delete memoryStorage[t]}function clearAll(t){memoryStorage={}}var all=[localStorage_1,oldFFGlobalStorage,oldIEUserDataStorage,cookieStorage,sessionStorage_1,memoryStorage_1],json2$1={},hasRequiredJson2;function requireJson2(){return hasRequiredJson2||(hasRequiredJson2=1,typeof JSON!="object"&&(JSON={}),function(){var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(t){return t<10?"0"+t:t}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(t){return rx_escapable.lastIndex=0,rx_escapable.test(t)?'"'+t.replace(rx_escapable,function(e){var a=meta[e];return typeof a=="string"?a:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var a,r,n,i,o=gap,s,u=e[t];switch(u&&typeof u=="object"&&typeof u.toJSON=="function"&&(u=u.toJSON(t)),typeof rep=="function"&&(u=rep.call(e,t,u)),typeof u){case"string":return quote(u);case"number":return isFinite(u)?String(u):"null";case"boolean":case"null":return String(u);case"object":if(!u)return"null";if(gap+=indent,s=[],Object.prototype.toString.apply(u)==="[object Array]"){for(i=u.length,a=0;a<i;a+=1)s[a]=str(a,u)||"null";return n=s.length===0?"[]":gap?`[+`):" "+renderReason(i[0]):"as no adapter specified";throw new AxiosError("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:knownAdapters};function throwIfCancellationRequested(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new CanceledError(null,t)}function dispatchRequest(t){return throwIfCancellationRequested(t),t.headers=AxiosHeaders$1.from(t.headers),t.data=transformData.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(t.adapter||defaults$1.adapter)(t).then(function(r){return throwIfCancellationRequested(t),r.data=transformData.call(t,t.transformResponse,r),r.headers=AxiosHeaders$1.from(r.headers),r},function(r){return isCancel(r)||(throwIfCancellationRequested(t),r&&r.response&&(r.response.data=transformData.call(t,t.transformResponse,r.response),r.response.headers=AxiosHeaders$1.from(r.response.headers))),Promise.reject(r)})}const headersToObject=t=>t instanceof AxiosHeaders$1?t.toJSON():t;function mergeConfig(t,e){e=e||{};const a={};function r(c,l,p){return utils.isPlainObject(c)&&utils.isPlainObject(l)?utils.merge.call({caseless:p},c,l):utils.isPlainObject(l)?utils.merge({},l):utils.isArray(l)?l.slice():l}function n(c,l,p){if(utils.isUndefined(l)){if(!utils.isUndefined(c))return r(void 0,c,p)}else return r(c,l,p)}function i(c,l){if(!utils.isUndefined(l))return r(void 0,l)}function o(c,l){if(utils.isUndefined(l)){if(!utils.isUndefined(c))return r(void 0,c)}else return r(void 0,l)}function s(c,l,p){if(p in e)return r(c,l);if(p in t)return r(void 0,c)}const u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(c,l)=>n(headersToObject(c),headersToObject(l),!0)};return utils.forEach(Object.keys(Object.assign({},t,e)),function(l){const p=u[l]||n,v=p(t[l],e[l],l);utils.isUndefined(v)&&p!==s||(a[l]=v)}),a}const VERSION$1="1.6.0",validators$1={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{validators$1[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const deprecatedWarnings={};validators$1.transitional=function(e,a,r){function n(i,o){return"[Axios v"+VERSION$1+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,s)=>{if(e===!1)throw new AxiosError(n(o," has been removed"+(a?" in "+a:"")),AxiosError.ERR_DEPRECATED);return a&&!deprecatedWarnings[o]&&(deprecatedWarnings[o]=!0,console.warn(n(o," has been deprecated since v"+a+" and will be removed in the near future"))),e?e(i,o,s):!0}};function assertOptions(t,e,a){if(typeof t!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let n=r.length;for(;n-- >0;){const i=r[n],o=e[i];if(o){const s=t[i],u=s===void 0||o(s,i,t);if(u!==!0)throw new AxiosError("option "+i+" must be "+u,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new AxiosError("Unknown option "+i,AxiosError.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;class Axios{constructor(e){this.defaults=e,this.interceptors={request:new InterceptorManager$1,response:new InterceptorManager$1}}request(e,a){typeof e=="string"?(a=a||{},a.url=e):a=e||{},a=mergeConfig(this.defaults,a);const{transitional:r,paramsSerializer:n,headers:i}=a;r!==void 0&&validator.assertOptions(r,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),n!=null&&(utils.isFunction(n)?a.paramsSerializer={serialize:n}:validator.assertOptions(n,{encode:validators.function,serialize:validators.function},!0)),a.method=(a.method||this.defaults.method||"get").toLowerCase();let o=i&&utils.merge(i.common,i[a.method]);i&&utils.forEach(["delete","get","head","post","put","patch","common"],T=>{delete i[T]}),a.headers=AxiosHeaders$1.concat(o,i);const s=[];let u=!0;this.interceptors.request.forEach(function(O){typeof O.runWhen=="function"&&O.runWhen(a)===!1||(u=u&&O.synchronous,s.unshift(O.fulfilled,O.rejected))});const c=[];this.interceptors.response.forEach(function(O){c.push(O.fulfilled,O.rejected)});let l,p=0,v;if(!u){const T=[dispatchRequest.bind(this),void 0];for(T.unshift.apply(T,s),T.push.apply(T,c),v=T.length,l=Promise.resolve(a);p<v;)l=l.then(T[p++],T[p++]);return l}v=s.length;let S=a;for(p=0;p<v;){const T=s[p++],O=s[p++];try{S=T(S)}catch(M){O.call(this,M);break}}try{l=dispatchRequest.call(this,S)}catch(T){return Promise.reject(T)}for(p=0,v=c.length;p<v;)l=l.then(c[p++],c[p++]);return l}getUri(e){e=mergeConfig(this.defaults,e);const a=buildFullPath(e.baseURL,e.url);return buildURL(a,e.params,e.paramsSerializer)}}utils.forEach(["delete","get","head","options"],function(e){Axios.prototype[e]=function(a,r){return this.request(mergeConfig(r||{},{method:e,url:a,data:(r||{}).data}))}});utils.forEach(["post","put","patch"],function(e){function a(r){return function(i,o,s){return this.request(mergeConfig(s||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Axios.prototype[e]=a(),Axios.prototype[e+"Form"]=a(!0)});const Axios$1=Axios;class CancelToken{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(i){a=i});const r=this;this.promise.then(n=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](n);r._listeners=null}),this.promise.then=n=>{let i;const o=new Promise(s=>{r.subscribe(s),i=s}).then(n);return o.cancel=function(){r.unsubscribe(i)},o},e(function(i,o,s){r.reason||(r.reason=new CanceledError(i,o,s),a(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const a=this._listeners.indexOf(e);a!==-1&&this._listeners.splice(a,1)}static source(){let e;return{token:new CancelToken(function(n){e=n}),cancel:e}}}const CancelToken$1=CancelToken;function spread(t){return function(a){return t.apply(null,a)}}function isAxiosError(t){return utils.isObject(t)&&t.isAxiosError===!0}const HttpStatusCode={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode).forEach(([t,e])=>{HttpStatusCode[e]=t});const HttpStatusCode$1=HttpStatusCode;function createInstance(t){const e=new Axios$1(t),a=bind$4(Axios$1.prototype.request,e);return utils.extend(a,Axios$1.prototype,e,{allOwnKeys:!0}),utils.extend(a,e,null,{allOwnKeys:!0}),a.create=function(n){return createInstance(mergeConfig(t,n))},a}const axios=createInstance(defaults$1);axios.Axios=Axios$1;axios.CanceledError=CanceledError;axios.CancelToken=CancelToken$1;axios.isCancel=isCancel;axios.VERSION=VERSION$1;axios.toFormData=toFormData;axios.AxiosError=AxiosError;axios.Cancel=axios.CanceledError;axios.all=function(e){return Promise.all(e)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig;axios.AxiosHeaders=AxiosHeaders$1;axios.formToJSON=t=>formDataToJSON(utils.isHTMLForm(t)?new FormData(t):t);axios.getAdapter=adapters.getAdapter;axios.HttpStatusCode=HttpStatusCode$1;axios.default=axios;const axios$1=axios;var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var assign=make_assign(),create$2=make_create(),trim$1=make_trim(),Global$5=typeof window<"u"?window:commonjsGlobal,util$7={assign,create:create$2,trim:trim$1,bind:bind$3,slice:slice$2,each:each$8,map,pluck:pluck$1,isList:isList$1,isFunction:isFunction$4,isObject:isObject$a,Global:Global$5};function make_assign(){return Object.assign?Object.assign:function(e,a,r,n){for(var i=1;i<arguments.length;i++)each$8(Object(arguments[i]),function(o,s){e[s]=o});return e}}function make_create(){if(Object.create)return function(e,a,r,n){var i=slice$2(arguments,1);return assign.apply(this,[Object.create(e)].concat(i))};{let t=function(){};return function(a,r,n,i){var o=slice$2(arguments,1);return t.prototype=a,assign.apply(this,[new t].concat(o))}}}function make_trim(){return String.prototype.trim?function(e){return String.prototype.trim.call(e)}:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function bind$3(t,e){return function(){return e.apply(t,Array.prototype.slice.call(arguments,0))}}function slice$2(t,e){return Array.prototype.slice.call(t,e||0)}function each$8(t,e){pluck$1(t,function(a,r){return e(a,r),!1})}function map(t,e){var a=isList$1(t)?[]:{};return pluck$1(t,function(r,n){return a[n]=e(r,n),!1}),a}function pluck$1(t,e){if(isList$1(t)){for(var a=0;a<t.length;a++)if(e(t[a],a))return t[a]}else for(var r in t)if(t.hasOwnProperty(r)&&e(t[r],r))return t[r]}function isList$1(t){return t!=null&&typeof t!="function"&&typeof t.length=="number"}function isFunction$4(t){return t&&{}.toString.call(t)==="[object Function]"}function isObject$a(t){return t&&{}.toString.call(t)==="[object Object]"}var util$6=util$7,slice$1=util$6.slice,pluck=util$6.pluck,each$7=util$6.each,bind$2=util$6.bind,create$1=util$6.create,isList=util$6.isList,isFunction$3=util$6.isFunction,isObject$9=util$6.isObject,storeEngine={createStore},storeAPI={version:"2.0.12",enabled:!1,get:function(t,e){var a=this.storage.read(this._namespacePrefix+t);return this._deserialize(a,e)},set:function(t,e){return e===void 0?this.remove(t):(this.storage.write(this._namespacePrefix+t,this._serialize(e)),e)},remove:function(t){this.storage.remove(this._namespacePrefix+t)},each:function(t){var e=this;this.storage.each(function(a,r){t.call(e,e._deserialize(a),(r||"").replace(e._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(t){return this._namespacePrefix=="__storejs_"+t+"_"},createStore:function(){return createStore.apply(this,arguments)},addPlugin:function(t){this._addPlugin(t)},namespace:function(t){return createStore(this.storage,this.plugins,t)}};function _warn(){var t=typeof console>"u"?null:console;if(t){var e=t.warn?t.warn:t.log;e.apply(t,arguments)}}function createStore(t,e,a){a||(a=""),t&&!isList(t)&&(t=[t]),e&&!isList(e)&&(e=[e]);var r=a?"__storejs_"+a+"_":"",n=a?new RegExp("^"+r):null,i=/^[a-zA-Z0-9_\-]*$/;if(!i.test(a))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var o={_namespacePrefix:r,_namespaceRegexp:n,_testStorage:function(u){try{var c="__storejs__test__";u.write(c,c);var l=u.read(c)===c;return u.remove(c),l}catch{return!1}},_assignPluginFnProp:function(u,c){var l=this[c];this[c]=function(){var v=slice$1(arguments,0),S=this;function T(){if(l)return each$7(arguments,function(M,C){v[C]=M}),l.apply(S,v)}var O=[T].concat(v);return u.apply(S,O)}},_serialize:function(u){return JSON.stringify(u)},_deserialize:function(u,c){if(!u)return c;var l="";try{l=JSON.parse(u)}catch{l=u}return l!==void 0?l:c},_addStorage:function(u){this.enabled||this._testStorage(u)&&(this.storage=u,this.enabled=!0)},_addPlugin:function(u){var c=this;if(isList(u)){each$7(u,function(v){c._addPlugin(v)});return}var l=pluck(this.plugins,function(v){return u===v});if(!l){if(this.plugins.push(u),!isFunction$3(u))throw new Error("Plugins must be function values that return objects");var p=u.call(this);if(!isObject$9(p))throw new Error("Plugins must return an object of function properties");each$7(p,function(v,S){if(!isFunction$3(v))throw new Error("Bad plugin property: "+S+" from plugin "+u.name+". Plugins should only return functions.");c._assignPluginFnProp(v,S)})}},addStorage:function(u){_warn("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(u)}},s=create$1(o,storeAPI,{plugins:[]});return s.raw={},each$7(s,function(u,c){isFunction$3(u)&&(s.raw[c]=bind$2(s,u))}),each$7(t,function(u){s._addStorage(u)}),each$7(e,function(u){s._addPlugin(u)}),s}var util$5=util$7,Global$4=util$5.Global,localStorage_1={name:"localStorage",read:read$6,write:write$6,each:each$6,remove:remove$5,clearAll:clearAll$5};function localStorage(){return Global$4.localStorage}function read$6(t){return localStorage().getItem(t)}function write$6(t,e){return localStorage().setItem(t,e)}function each$6(t){for(var e=localStorage().length-1;e>=0;e--){var a=localStorage().key(e);t(read$6(a),a)}}function remove$5(t){return localStorage().removeItem(t)}function clearAll$5(){return localStorage().clear()}var util$4=util$7,Global$3=util$4.Global,oldFFGlobalStorage={name:"oldFF-globalStorage",read:read$5,write:write$5,each:each$5,remove:remove$4,clearAll:clearAll$4},globalStorage=Global$3.globalStorage;function read$5(t){return globalStorage[t]}function write$5(t,e){globalStorage[t]=e}function each$5(t){for(var e=globalStorage.length-1;e>=0;e--){var a=globalStorage.key(e);t(globalStorage[a],a)}}function remove$4(t){return globalStorage.removeItem(t)}function clearAll$4(){each$5(function(t,e){delete globalStorage[t]})}var util$3=util$7,Global$2=util$3.Global,oldIEUserDataStorage={name:"oldIE-userDataStorage",write:write$4,read:read$4,each:each$4,remove:remove$3,clearAll:clearAll$3},storageName="storejs",doc$1=Global$2.document,_withStorageEl=_makeIEStorageElFunction(),disable=(Global$2.navigator?Global$2.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function write$4(t,e){if(!disable){var a=fixKey(t);_withStorageEl(function(r){r.setAttribute(a,e),r.save(storageName)})}}function read$4(t){if(!disable){var e=fixKey(t),a=null;return _withStorageEl(function(r){a=r.getAttribute(e)}),a}}function each$4(t){_withStorageEl(function(e){for(var a=e.XMLDocument.documentElement.attributes,r=a.length-1;r>=0;r--){var n=a[r];t(e.getAttribute(n.name),n.name)}})}function remove$3(t){var e=fixKey(t);_withStorageEl(function(a){a.removeAttribute(e),a.save(storageName)})}function clearAll$3(){_withStorageEl(function(t){var e=t.XMLDocument.documentElement.attributes;t.load(storageName);for(var a=e.length-1;a>=0;a--)t.removeAttribute(e[a].name);t.save(storageName)})}var forbiddenCharsRegex=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function fixKey(t){return t.replace(/^\d/,"___$&").replace(forbiddenCharsRegex,"___")}function _makeIEStorageElFunction(){if(!doc$1||!doc$1.documentElement||!doc$1.documentElement.addBehavior)return null;var t="script",e,a,r;try{a=new ActiveXObject("htmlfile"),a.open(),a.write("<"+t+">document.w=window</"+t+'><iframe src="/favicon.ico"></iframe>'),a.close(),e=a.w.frames[0].document,r=e.createElement("div")}catch{r=doc$1.createElement("div"),e=doc$1.body}return function(n){var i=[].slice.call(arguments,0);i.unshift(r),e.appendChild(r),r.addBehavior("#default#userData"),r.load(storageName),n.apply(this,i),e.removeChild(r)}}var util$2=util$7,Global$1=util$2.Global,trim=util$2.trim,cookieStorage={name:"cookieStorage",read:read$3,write:write$3,each:each$3,remove:remove$2,clearAll:clearAll$2},doc=Global$1.document;function read$3(t){if(!t||!_has(t))return null;var e="(?:^|.*;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(doc.cookie.replace(new RegExp(e),"$1"))}function each$3(t){for(var e=doc.cookie.split(/; ?/g),a=e.length-1;a>=0;a--)if(trim(e[a])){var r=e[a].split("="),n=unescape(r[0]),i=unescape(r[1]);t(i,n)}}function write$3(t,e){t&&(doc.cookie=escape(t)+"="+escape(e)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")}function remove$2(t){!t||!_has(t)||(doc.cookie=escape(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function clearAll$2(){each$3(function(t,e){remove$2(e)})}function _has(t){return new RegExp("(?:^|;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(doc.cookie)}var util$1=util$7,Global=util$1.Global,sessionStorage_1={name:"sessionStorage",read:read$2,write:write$2,each:each$2,remove:remove$1,clearAll:clearAll$1};function sessionStorage(){return Global.sessionStorage}function read$2(t){return sessionStorage().getItem(t)}function write$2(t,e){return sessionStorage().setItem(t,e)}function each$2(t){for(var e=sessionStorage().length-1;e>=0;e--){var a=sessionStorage().key(e);t(read$2(a),a)}}function remove$1(t){return sessionStorage().removeItem(t)}function clearAll$1(){return sessionStorage().clear()}var memoryStorage_1={name:"memoryStorage",read:read$1,write:write$1,each:each$1,remove,clearAll},memoryStorage={};function read$1(t){return memoryStorage[t]}function write$1(t,e){memoryStorage[t]=e}function each$1(t){for(var e in memoryStorage)memoryStorage.hasOwnProperty(e)&&t(memoryStorage[e],e)}function remove(t){delete memoryStorage[t]}function clearAll(t){memoryStorage={}}var all=[localStorage_1,oldFFGlobalStorage,oldIEUserDataStorage,cookieStorage,sessionStorage_1,memoryStorage_1],json2$1={},hasRequiredJson2;function requireJson2(){return hasRequiredJson2||(hasRequiredJson2=1,typeof JSON!="object"&&(JSON={}),function(){var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(t){return t<10?"0"+t:t}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(t){return rx_escapable.lastIndex=0,rx_escapable.test(t)?'"'+t.replace(rx_escapable,function(e){var a=meta[e];return typeof a=="string"?a:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var a,r,n,i,o=gap,s,u=e[t];switch(u&&typeof u=="object"&&typeof u.toJSON=="function"&&(u=u.toJSON(t)),typeof rep=="function"&&(u=rep.call(e,t,u)),typeof u){case"string":return quote(u);case"number":return isFinite(u)?String(u):"null";case"boolean":case"null":return String(u);case"object":if(!u)return"null";if(gap+=indent,s=[],Object.prototype.toString.apply(u)==="[object Array]"){for(i=u.length,a=0;a<i;a+=1)s[a]=str(a,u)||"null";return n=s.length===0?"[]":gap?`[`+gap+s.join(`,`+gap)+``+o+"]":"["+s.join(",")+"]",gap=o,n}if(rep&&typeof rep=="object")for(i=rep.length,a=0;a<i;a+=1)typeof rep[a]=="string"&&(r=rep[a],n=str(r,u),n&&s.push(quote(r)+(gap?": ":":")+n));else for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(n=str(r,u),n&&s.push(quote(r)+(gap?": ":":")+n));return n=s.length===0?"{}":gap?`{`+gap+s.join(`,`+gap)+`-`+o+"}":"{"+s.join(",")+"}",gap=o,n}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(t,e,a){var r;if(gap="",indent="",typeof a=="number")for(r=0;r<a;r+=1)indent+=" ";else typeof a=="string"&&(indent=a);if(rep=e,e&&typeof e!="function"&&(typeof e!="object"||typeof e.length!="number"))throw new Error("JSON.stringify");return str("",{"":t})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(t,e){var a,r,n=t[e];if(n&&typeof n=="object")for(a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r=walk(n,a),r!==void 0?n[a]=r:delete n[a]);return reviver.call(t,e,n)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()),json2$1}var json2=json2Plugin;function json2Plugin(){return requireJson2(),{}}var engine=storeEngine,storages=all,plugins=[json2],store_legacy=engine.createStore(storages,plugins);const store$1=getDefaultExportFromCjs(store_legacy);var util=util$7,bind$1=util.bind,each=util.each,create=util.create,slice=util.slice,events=eventsPlugin$1;function eventsPlugin$1(){var t=_newPubSub();return{watch:e,unwatch:a,once:r,set:n,remove:i,clearAll:o};function e(s,u,c){return t.on(u,bind$1(this,c))}function a(s,u){t.off(u)}function r(s,u,c){t.once(u,bind$1(this,c))}function n(s,u,c){var l=this.get(u);s(),t.fire(u,c,l)}function i(s,u){var c=this.get(u);s(),t.fire(u,void 0,c)}function o(s){var u={};this.each(function(c,l){u[l]=c}),s(),each(u,function(c,l){t.fire(l,void 0,c)})}}function _newPubSub(){return create(_pubSubBase,{_id:0,_subSignals:{},_subCallbacks:{}})}var _pubSubBase={_id:null,_subCallbacks:null,_subSignals:null,on:function(t,e){return this._subCallbacks[t]||(this._subCallbacks[t]={}),this._id+=1,this._subCallbacks[t][this._id]=e,this._subSignals[this._id]=t,this._id},off:function(t){var e=this._subSignals[t];delete this._subCallbacks[e][t],delete this._subSignals[t]},once:function(t,e){var a=this.on(t,bind$1(this,function(){e.apply(this,arguments),this.off(a)}))},fire:function(t){var e=slice(arguments,1);each(this._subCallbacks[t],function(a){a.apply(this,e)})}},eventsPlugin=events,observe=[eventsPlugin,observePlugin];function observePlugin(){return{observe:t,unobserve:e};function t(a,r,n){var i=this.watch(r,n);return n(this.get(r)),i}function e(a,r){this.unwatch(r)}}const observePlugin$1=getDefaultExportFromCjs(observe);var flushPending=!1,flushing=!1,queue=[],lastFlushedIndex=-1;function scheduler(t){queueJob(t)}function queueJob(t){queue.includes(t)||queue.push(t),queueFlush()}function dequeueJob(t){let e=queue.indexOf(t);e!==-1&&e>lastFlushedIndex&&queue.splice(e,1)}function queueFlush(){!flushing&&!flushPending&&(flushPending=!0,queueMicrotask(flushJobs))}function flushJobs(){flushPending=!1,flushing=!0;for(let t=0;t<queue.length;t++)queue[t](),lastFlushedIndex=t;queue.length=0,lastFlushedIndex=-1,flushing=!1}var reactive,effect$3,release,raw,shouldSchedule=!0;function disableEffectScheduling(t){shouldSchedule=!1,t(),shouldSchedule=!0}function setReactivityEngine(t){reactive=t.reactive,release=t.release,effect$3=e=>t.effect(e,{scheduler:a=>{shouldSchedule?scheduler(a):a()}}),raw=t.raw}function overrideEffect(t){effect$3=t}function elementBoundEffect(t){let e=()=>{};return[r=>{let n=effect$3(r);return t._x_effects||(t._x_effects=new Set,t._x_runEffects=()=>{t._x_effects.forEach(i=>i())}),t._x_effects.add(n),e=()=>{n!==void 0&&(t._x_effects.delete(n),release(n))},n},()=>{e()}]}function dispatch(t,e,a={}){t.dispatchEvent(new CustomEvent(e,{detail:a,bubbles:!0,composed:!0,cancelable:!0}))}function walk(t,e){if(typeof ShadowRoot=="function"&&t instanceof ShadowRoot){Array.from(t.children).forEach(n=>walk(n,e));return}let a=!1;if(e(t,()=>a=!0),a)return;let r=t.firstElementChild;for(;r;)walk(r,e),r=r.nextElementSibling}function warn(t,...e){console.warn(`Alpine Warning: ${t}`,...e)}var started=!1;function start$1(){started&&warn("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),started=!0,document.body||warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),dispatch(document,"alpine:init"),dispatch(document,"alpine:initializing"),startObservingMutations(),onElAdded(e=>initTree(e,walk)),onElRemoved(e=>destroyTree(e)),onAttributesAdded((e,a)=>{directives(e,a).forEach(r=>r())});let t=e=>!closestRoot(e.parentElement,!0);Array.from(document.querySelectorAll(allSelectors())).filter(t).forEach(e=>{initTree(e)}),dispatch(document,"alpine:initialized")}var rootSelectorCallbacks=[],initSelectorCallbacks=[];function rootSelectors(){return rootSelectorCallbacks.map(t=>t())}function allSelectors(){return rootSelectorCallbacks.concat(initSelectorCallbacks).map(t=>t())}function addRootSelector(t){rootSelectorCallbacks.push(t)}function addInitSelector(t){initSelectorCallbacks.push(t)}function closestRoot(t,e=!1){return findClosest(t,a=>{if((e?allSelectors():rootSelectors()).some(n=>a.matches(n)))return!0})}function findClosest(t,e){if(t){if(e(t))return t;if(t._x_teleportBack&&(t=t._x_teleportBack),!!t.parentElement)return findClosest(t.parentElement,e)}}function isRoot(t){return rootSelectors().some(e=>t.matches(e))}var initInterceptors=[];function interceptInit(t){initInterceptors.push(t)}function initTree(t,e=walk,a=()=>{}){deferHandlingDirectives(()=>{e(t,(r,n)=>{a(r,n),initInterceptors.forEach(i=>i(r,n)),directives(r,r.attributes).forEach(i=>i()),r._x_ignore&&n()})})}function destroyTree(t){walk(t,e=>{cleanupAttributes(e),cleanupElement(e)})}var onAttributeAddeds=[],onElRemoveds=[],onElAddeds=[];function onElAdded(t){onElAddeds.push(t)}function onElRemoved(t,e){typeof e=="function"?(t._x_cleanups||(t._x_cleanups=[]),t._x_cleanups.push(e)):(e=t,onElRemoveds.push(e))}function onAttributesAdded(t){onAttributeAddeds.push(t)}function onAttributeRemoved(t,e,a){t._x_attributeCleanups||(t._x_attributeCleanups={}),t._x_attributeCleanups[e]||(t._x_attributeCleanups[e]=[]),t._x_attributeCleanups[e].push(a)}function cleanupAttributes(t,e){t._x_attributeCleanups&&Object.entries(t._x_attributeCleanups).forEach(([a,r])=>{(e===void 0||e.includes(a))&&(r.forEach(n=>n()),delete t._x_attributeCleanups[a])})}function cleanupElement(t){if(t._x_cleanups)for(;t._x_cleanups.length;)t._x_cleanups.pop()()}var observer=new MutationObserver(onMutate),currentlyObserving=!1;function startObservingMutations(){observer.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),currentlyObserving=!0}function stopObservingMutations(){flushObserver(),observer.disconnect(),currentlyObserving=!1}var recordQueue=[],willProcessRecordQueue=!1;function flushObserver(){recordQueue=recordQueue.concat(observer.takeRecords()),recordQueue.length&&!willProcessRecordQueue&&(willProcessRecordQueue=!0,queueMicrotask(()=>{processRecordQueue(),willProcessRecordQueue=!1}))}function processRecordQueue(){onMutate(recordQueue),recordQueue.length=0}function mutateDom(t){if(!currentlyObserving)return t();stopObservingMutations();let e=t();return startObservingMutations(),e}var isCollecting=!1,deferredMutations=[];function deferMutations(){isCollecting=!0}function flushAndStopDeferringMutations(){isCollecting=!1,onMutate(deferredMutations),deferredMutations=[]}function onMutate(t){if(isCollecting){deferredMutations=deferredMutations.concat(t);return}let e=[],a=[],r=new Map,n=new Map;for(let i=0;i<t.length;i++)if(!t[i].target._x_ignoreMutationObserver&&(t[i].type==="childList"&&(t[i].addedNodes.forEach(o=>o.nodeType===1&&e.push(o)),t[i].removedNodes.forEach(o=>o.nodeType===1&&a.push(o))),t[i].type==="attributes")){let o=t[i].target,s=t[i].attributeName,u=t[i].oldValue,c=()=>{r.has(o)||r.set(o,[]),r.get(o).push({name:s,value:o.getAttribute(s)})},l=()=>{n.has(o)||n.set(o,[]),n.get(o).push(s)};o.hasAttribute(s)&&u===null?c():o.hasAttribute(s)?(l(),c()):l()}n.forEach((i,o)=>{cleanupAttributes(o,i)}),r.forEach((i,o)=>{onAttributeAddeds.forEach(s=>s(o,i))});for(let i of a)e.includes(i)||(onElRemoveds.forEach(o=>o(i)),destroyTree(i));e.forEach(i=>{i._x_ignoreSelf=!0,i._x_ignore=!0});for(let i of e)a.includes(i)||i.isConnected&&(delete i._x_ignoreSelf,delete i._x_ignore,onElAddeds.forEach(o=>o(i)),i._x_ignore=!0,i._x_ignoreSelf=!0);e.forEach(i=>{delete i._x_ignoreSelf,delete i._x_ignore}),e=null,a=null,r=null,n=null}function scope(t){return mergeProxies(closestDataStack(t))}function addScopeToNode(t,e,a){return t._x_dataStack=[e,...closestDataStack(a||t)],()=>{t._x_dataStack=t._x_dataStack.filter(r=>r!==e)}}function closestDataStack(t){return t._x_dataStack?t._x_dataStack:typeof ShadowRoot=="function"&&t instanceof ShadowRoot?closestDataStack(t.host):t.parentNode?closestDataStack(t.parentNode):[]}function mergeProxies(t){return new Proxy({objects:t},mergeProxyTrap)}var mergeProxyTrap={ownKeys({objects:t}){return Array.from(new Set(t.flatMap(e=>Object.keys(e))))},has({objects:t},e){return e==Symbol.unscopables?!1:t.some(a=>Object.prototype.hasOwnProperty.call(a,e))},get({objects:t},e,a){return e=="toJSON"?collapseProxies:Reflect.get(t.find(r=>Object.prototype.hasOwnProperty.call(r,e))||{},e,a)},set({objects:t},e,a){return Reflect.set(t.find(r=>Object.prototype.hasOwnProperty.call(r,e))||t[t.length-1],e,a)}};function collapseProxies(){return Reflect.ownKeys(this).reduce((e,a)=>(e[a]=Reflect.get(this,a),e),{})}function initInterceptors2(t){let e=r=>typeof r=="object"&&!Array.isArray(r)&&r!==null,a=(r,n="")=>{Object.entries(Object.getOwnPropertyDescriptors(r)).forEach(([i,{value:o,enumerable:s}])=>{if(s===!1||o===void 0)return;let u=n===""?i:`${n}.${i}`;typeof o=="object"&&o!==null&&o._x_interceptor?r[i]=o.initialize(t,u,i):e(o)&&o!==r&&!(o instanceof Element)&&a(o,u)})};return a(t)}function interceptor(t,e=()=>{}){let a={initialValue:void 0,_x_interceptor:!0,initialize(r,n,i){return t(this.initialValue,()=>get$3(r,n),o=>set$2(r,n,o),n,i)}};return e(a),r=>{if(typeof r=="object"&&r!==null&&r._x_interceptor){let n=a.initialize.bind(a);a.initialize=(i,o,s)=>{let u=r.initialize(i,o,s);return a.initialValue=u,n(i,o,s)}}else a.initialValue=r;return a}}function get$3(t,e){return e.split(".").reduce((a,r)=>a[r],t)}function set$2(t,e,a){if(typeof e=="string"&&(e=e.split(".")),e.length===1)t[e[0]]=a;else{if(e.length===0)throw error;return t[e[0]]||(t[e[0]]={}),set$2(t[e[0]],e.slice(1),a)}}var magics={};function magic(t,e){magics[t]=e}function injectMagics(t,e){return Object.entries(magics).forEach(([a,r])=>{let n=null;function i(){if(n)return n;{let[o,s]=getElementBoundUtilities(e);return n={interceptor,...o},onElRemoved(e,s),n}}Object.defineProperty(t,`$${a}`,{get(){return r(e,i())},enumerable:!1})}),t}function tryCatch(t,e,a,...r){try{return a(...r)}catch(n){handleError(n,t,e)}}function handleError(t,e,a=void 0){Object.assign(t,{el:e,expression:a}),console.warn(`Alpine Expression Error: ${t.message}+`+o+"}":"{"+s.join(",")+"}",gap=o,n}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(t,e,a){var r;if(gap="",indent="",typeof a=="number")for(r=0;r<a;r+=1)indent+=" ";else typeof a=="string"&&(indent=a);if(rep=e,e&&typeof e!="function"&&(typeof e!="object"||typeof e.length!="number"))throw new Error("JSON.stringify");return str("",{"":t})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(t,e){var a,r,n=t[e];if(n&&typeof n=="object")for(a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r=walk(n,a),r!==void 0?n[a]=r:delete n[a]);return reviver.call(t,e,n)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()),json2$1}var json2=json2Plugin;function json2Plugin(){return requireJson2(),{}}var engine=storeEngine,storages=all,plugins=[json2],store_legacy=engine.createStore(storages,plugins);const store$1=getDefaultExportFromCjs(store_legacy);var util=util$7,bind$1=util.bind,each=util.each,create=util.create,slice=util.slice,events=eventsPlugin$1;function eventsPlugin$1(){var t=_newPubSub();return{watch:e,unwatch:a,once:r,set:n,remove:i,clearAll:o};function e(s,u,c){return t.on(u,bind$1(this,c))}function a(s,u){t.off(u)}function r(s,u,c){t.once(u,bind$1(this,c))}function n(s,u,c){var l=this.get(u);s(),t.fire(u,c,l)}function i(s,u){var c=this.get(u);s(),t.fire(u,void 0,c)}function o(s){var u={};this.each(function(c,l){u[l]=c}),s(),each(u,function(c,l){t.fire(l,void 0,c)})}}function _newPubSub(){return create(_pubSubBase,{_id:0,_subSignals:{},_subCallbacks:{}})}var _pubSubBase={_id:null,_subCallbacks:null,_subSignals:null,on:function(t,e){return this._subCallbacks[t]||(this._subCallbacks[t]={}),this._id+=1,this._subCallbacks[t][this._id]=e,this._subSignals[this._id]=t,this._id},off:function(t){var e=this._subSignals[t];delete this._subCallbacks[e][t],delete this._subSignals[t]},once:function(t,e){var a=this.on(t,bind$1(this,function(){e.apply(this,arguments),this.off(a)}))},fire:function(t){var e=slice(arguments,1);each(this._subCallbacks[t],function(a){a.apply(this,e)})}},eventsPlugin=events,observe=[eventsPlugin,observePlugin];function observePlugin(){return{observe:t,unobserve:e};function t(a,r,n){var i=this.watch(r,n);return n(this.get(r)),i}function e(a,r){this.unwatch(r)}}const observePlugin$1=getDefaultExportFromCjs(observe);var flushPending=!1,flushing=!1,queue=[],lastFlushedIndex=-1;function scheduler(t){queueJob(t)}function queueJob(t){queue.includes(t)||queue.push(t),queueFlush()}function dequeueJob(t){let e=queue.indexOf(t);e!==-1&&e>lastFlushedIndex&&queue.splice(e,1)}function queueFlush(){!flushing&&!flushPending&&(flushPending=!0,queueMicrotask(flushJobs))}function flushJobs(){flushPending=!1,flushing=!0;for(let t=0;t<queue.length;t++)queue[t](),lastFlushedIndex=t;queue.length=0,lastFlushedIndex=-1,flushing=!1}var reactive,effect$3,release,raw,shouldSchedule=!0;function disableEffectScheduling(t){shouldSchedule=!1,t(),shouldSchedule=!0}function setReactivityEngine(t){reactive=t.reactive,release=t.release,effect$3=e=>t.effect(e,{scheduler:a=>{shouldSchedule?scheduler(a):a()}}),raw=t.raw}function overrideEffect(t){effect$3=t}function elementBoundEffect(t){let e=()=>{};return[r=>{let n=effect$3(r);return t._x_effects||(t._x_effects=new Set,t._x_runEffects=()=>{t._x_effects.forEach(i=>i())}),t._x_effects.add(n),e=()=>{n!==void 0&&(t._x_effects.delete(n),release(n))},n},()=>{e()}]}function dispatch(t,e,a={}){t.dispatchEvent(new CustomEvent(e,{detail:a,bubbles:!0,composed:!0,cancelable:!0}))}function walk(t,e){if(typeof ShadowRoot=="function"&&t instanceof ShadowRoot){Array.from(t.children).forEach(n=>walk(n,e));return}let a=!1;if(e(t,()=>a=!0),a)return;let r=t.firstElementChild;for(;r;)walk(r,e),r=r.nextElementSibling}function warn(t,...e){console.warn(`Alpine Warning: ${t}`,...e)}var started=!1;function start$1(){started&&warn("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),started=!0,document.body||warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),dispatch(document,"alpine:init"),dispatch(document,"alpine:initializing"),startObservingMutations(),onElAdded(e=>initTree(e,walk)),onElRemoved(e=>destroyTree(e)),onAttributesAdded((e,a)=>{directives(e,a).forEach(r=>r())});let t=e=>!closestRoot(e.parentElement,!0);Array.from(document.querySelectorAll(allSelectors())).filter(t).forEach(e=>{initTree(e)}),dispatch(document,"alpine:initialized")}var rootSelectorCallbacks=[],initSelectorCallbacks=[];function rootSelectors(){return rootSelectorCallbacks.map(t=>t())}function allSelectors(){return rootSelectorCallbacks.concat(initSelectorCallbacks).map(t=>t())}function addRootSelector(t){rootSelectorCallbacks.push(t)}function addInitSelector(t){initSelectorCallbacks.push(t)}function closestRoot(t,e=!1){return findClosest(t,a=>{if((e?allSelectors():rootSelectors()).some(n=>a.matches(n)))return!0})}function findClosest(t,e){if(t){if(e(t))return t;if(t._x_teleportBack&&(t=t._x_teleportBack),!!t.parentElement)return findClosest(t.parentElement,e)}}function isRoot(t){return rootSelectors().some(e=>t.matches(e))}var initInterceptors=[];function interceptInit(t){initInterceptors.push(t)}function initTree(t,e=walk,a=()=>{}){deferHandlingDirectives(()=>{e(t,(r,n)=>{a(r,n),initInterceptors.forEach(i=>i(r,n)),directives(r,r.attributes).forEach(i=>i()),r._x_ignore&&n()})})}function destroyTree(t){walk(t,e=>{cleanupAttributes(e),cleanupElement(e)})}var onAttributeAddeds=[],onElRemoveds=[],onElAddeds=[];function onElAdded(t){onElAddeds.push(t)}function onElRemoved(t,e){typeof e=="function"?(t._x_cleanups||(t._x_cleanups=[]),t._x_cleanups.push(e)):(e=t,onElRemoveds.push(e))}function onAttributesAdded(t){onAttributeAddeds.push(t)}function onAttributeRemoved(t,e,a){t._x_attributeCleanups||(t._x_attributeCleanups={}),t._x_attributeCleanups[e]||(t._x_attributeCleanups[e]=[]),t._x_attributeCleanups[e].push(a)}function cleanupAttributes(t,e){t._x_attributeCleanups&&Object.entries(t._x_attributeCleanups).forEach(([a,r])=>{(e===void 0||e.includes(a))&&(r.forEach(n=>n()),delete t._x_attributeCleanups[a])})}function cleanupElement(t){if(t._x_cleanups)for(;t._x_cleanups.length;)t._x_cleanups.pop()()}var observer=new MutationObserver(onMutate),currentlyObserving=!1;function startObservingMutations(){observer.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),currentlyObserving=!0}function stopObservingMutations(){flushObserver(),observer.disconnect(),currentlyObserving=!1}var recordQueue=[],willProcessRecordQueue=!1;function flushObserver(){recordQueue=recordQueue.concat(observer.takeRecords()),recordQueue.length&&!willProcessRecordQueue&&(willProcessRecordQueue=!0,queueMicrotask(()=>{processRecordQueue(),willProcessRecordQueue=!1}))}function processRecordQueue(){onMutate(recordQueue),recordQueue.length=0}function mutateDom(t){if(!currentlyObserving)return t();stopObservingMutations();let e=t();return startObservingMutations(),e}var isCollecting=!1,deferredMutations=[];function deferMutations(){isCollecting=!0}function flushAndStopDeferringMutations(){isCollecting=!1,onMutate(deferredMutations),deferredMutations=[]}function onMutate(t){if(isCollecting){deferredMutations=deferredMutations.concat(t);return}let e=[],a=[],r=new Map,n=new Map;for(let i=0;i<t.length;i++)if(!t[i].target._x_ignoreMutationObserver&&(t[i].type==="childList"&&(t[i].addedNodes.forEach(o=>o.nodeType===1&&e.push(o)),t[i].removedNodes.forEach(o=>o.nodeType===1&&a.push(o))),t[i].type==="attributes")){let o=t[i].target,s=t[i].attributeName,u=t[i].oldValue,c=()=>{r.has(o)||r.set(o,[]),r.get(o).push({name:s,value:o.getAttribute(s)})},l=()=>{n.has(o)||n.set(o,[]),n.get(o).push(s)};o.hasAttribute(s)&&u===null?c():o.hasAttribute(s)?(l(),c()):l()}n.forEach((i,o)=>{cleanupAttributes(o,i)}),r.forEach((i,o)=>{onAttributeAddeds.forEach(s=>s(o,i))});for(let i of a)e.includes(i)||(onElRemoveds.forEach(o=>o(i)),destroyTree(i));e.forEach(i=>{i._x_ignoreSelf=!0,i._x_ignore=!0});for(let i of e)a.includes(i)||i.isConnected&&(delete i._x_ignoreSelf,delete i._x_ignore,onElAddeds.forEach(o=>o(i)),i._x_ignore=!0,i._x_ignoreSelf=!0);e.forEach(i=>{delete i._x_ignoreSelf,delete i._x_ignore}),e=null,a=null,r=null,n=null}function scope(t){return mergeProxies(closestDataStack(t))}function addScopeToNode(t,e,a){return t._x_dataStack=[e,...closestDataStack(a||t)],()=>{t._x_dataStack=t._x_dataStack.filter(r=>r!==e)}}function closestDataStack(t){return t._x_dataStack?t._x_dataStack:typeof ShadowRoot=="function"&&t instanceof ShadowRoot?closestDataStack(t.host):t.parentNode?closestDataStack(t.parentNode):[]}function mergeProxies(t){return new Proxy({objects:t},mergeProxyTrap)}var mergeProxyTrap={ownKeys({objects:t}){return Array.from(new Set(t.flatMap(e=>Object.keys(e))))},has({objects:t},e){return e==Symbol.unscopables?!1:t.some(a=>Object.prototype.hasOwnProperty.call(a,e))},get({objects:t},e,a){return e=="toJSON"?collapseProxies:Reflect.get(t.find(r=>Object.prototype.hasOwnProperty.call(r,e))||{},e,a)},set({objects:t},e,a,r){const n=t.find(o=>Object.prototype.hasOwnProperty.call(o,e))||t[t.length-1],i=Object.getOwnPropertyDescriptor(n,e);return i!=null&&i.set&&(i!=null&&i.get)?Reflect.set(n,e,a,r):Reflect.set(n,e,a)}};function collapseProxies(){return Reflect.ownKeys(this).reduce((e,a)=>(e[a]=Reflect.get(this,a),e),{})}function initInterceptors2(t){let e=r=>typeof r=="object"&&!Array.isArray(r)&&r!==null,a=(r,n="")=>{Object.entries(Object.getOwnPropertyDescriptors(r)).forEach(([i,{value:o,enumerable:s}])=>{if(s===!1||o===void 0)return;let u=n===""?i:`${n}.${i}`;typeof o=="object"&&o!==null&&o._x_interceptor?r[i]=o.initialize(t,u,i):e(o)&&o!==r&&!(o instanceof Element)&&a(o,u)})};return a(t)}function interceptor(t,e=()=>{}){let a={initialValue:void 0,_x_interceptor:!0,initialize(r,n,i){return t(this.initialValue,()=>get$3(r,n),o=>set$2(r,n,o),n,i)}};return e(a),r=>{if(typeof r=="object"&&r!==null&&r._x_interceptor){let n=a.initialize.bind(a);a.initialize=(i,o,s)=>{let u=r.initialize(i,o,s);return a.initialValue=u,n(i,o,s)}}else a.initialValue=r;return a}}function get$3(t,e){return e.split(".").reduce((a,r)=>a[r],t)}function set$2(t,e,a){if(typeof e=="string"&&(e=e.split(".")),e.length===1)t[e[0]]=a;else{if(e.length===0)throw error;return t[e[0]]||(t[e[0]]={}),set$2(t[e[0]],e.slice(1),a)}}var magics={};function magic(t,e){magics[t]=e}function injectMagics(t,e){return Object.entries(magics).forEach(([a,r])=>{let n=null;function i(){if(n)return n;{let[o,s]=getElementBoundUtilities(e);return n={interceptor,...o},onElRemoved(e,s),n}}Object.defineProperty(t,`$${a}`,{get(){return r(e,i())},enumerable:!1})}),t}function tryCatch(t,e,a,...r){try{return a(...r)}catch(n){handleError(n,t,e)}}function handleError(t,e,a=void 0){Object.assign(t,{el:e,expression:a}),console.warn(`Alpine Expression Error: ${t.message}${a?'Expression: "'+a+`"-`:""}`,e),setTimeout(()=>{throw t},0)}var shouldAutoEvaluateFunctions=!0;function dontAutoEvaluateFunctions(t){let e=shouldAutoEvaluateFunctions;shouldAutoEvaluateFunctions=!1;let a=t();return shouldAutoEvaluateFunctions=e,a}function evaluate(t,e,a={}){let r;return evaluateLater(t,e)(n=>r=n,a),r}function evaluateLater(...t){return theEvaluatorFunction(...t)}var theEvaluatorFunction=normalEvaluator;function setEvaluator(t){theEvaluatorFunction=t}function normalEvaluator(t,e){let a={};injectMagics(a,t);let r=[a,...closestDataStack(t)],n=typeof e=="function"?generateEvaluatorFromFunction(r,e):generateEvaluatorFromString(r,e,t);return tryCatch.bind(null,t,e,n)}function generateEvaluatorFromFunction(t,e){return(a=()=>{},{scope:r={},params:n=[]}={})=>{let i=e.apply(mergeProxies([r,...t]),n);runIfTypeOfFunction(a,i)}}var evaluatorMemo={};function generateFunctionFromString(t,e){if(evaluatorMemo[t])return evaluatorMemo[t];let a=Object.getPrototypeOf(async function(){}).constructor,r=/^[\n\s]*if.*\(.*\)/.test(t.trim())||/^(let|const)\s/.test(t.trim())?`(async()=>{ ${t} })()`:t,i=(()=>{try{let o=new a(["__self","scope"],`with (scope) { __self.result = ${r} }; __self.finished = true; return __self.result;`);return Object.defineProperty(o,"name",{value:`[Alpine] ${t}`}),o}catch(o){return handleError(o,e,t),Promise.resolve()}})();return evaluatorMemo[t]=i,i}function generateEvaluatorFromString(t,e,a){let r=generateFunctionFromString(e,a);return(n=()=>{},{scope:i={},params:o=[]}={})=>{r.result=void 0,r.finished=!1;let s=mergeProxies([i,...t]);if(typeof r=="function"){let u=r(r,s).catch(c=>handleError(c,a,e));r.finished?(runIfTypeOfFunction(n,r.result,s,o,a),r.result=void 0):u.then(c=>{runIfTypeOfFunction(n,c,s,o,a)}).catch(c=>handleError(c,a,e)).finally(()=>r.result=void 0)}}}function runIfTypeOfFunction(t,e,a,r,n){if(shouldAutoEvaluateFunctions&&typeof e=="function"){let i=e.apply(a,r);i instanceof Promise?i.then(o=>runIfTypeOfFunction(t,o,a,r)).catch(o=>handleError(o,n,e)):t(i)}else typeof e=="object"&&e instanceof Promise?e.then(i=>t(i)):t(e)}var prefixAsString="x-";function prefix(t=""){return prefixAsString+t}function setPrefix(t){prefixAsString=t}var directiveHandlers={};function directive(t,e){return directiveHandlers[t]=e,{before(a){if(!directiveHandlers[a]){console.warn("Cannot find directive `${directive}`. `${name}` will use the default order of execution");return}const r=directiveOrder.indexOf(a);directiveOrder.splice(r>=0?r:directiveOrder.indexOf("DEFAULT"),0,t)}}}function directives(t,e,a){if(e=Array.from(e),t._x_virtualDirectives){let i=Object.entries(t._x_virtualDirectives).map(([s,u])=>({name:s,value:u})),o=attributesOnly(i);i=i.map(s=>o.find(u=>u.name===s.name)?{name:`x-bind:${s.name}`,value:`"${s.value}"`}:s),e=e.concat(i)}let r={};return e.map(toTransformedAttributes((i,o)=>r[i]=o)).filter(outNonAlpineAttributes).map(toParsedDirectives(r,a)).sort(byPriority).map(i=>getDirectiveHandler(t,i))}function attributesOnly(t){return Array.from(t).map(toTransformedAttributes()).filter(e=>!outNonAlpineAttributes(e))}var isDeferringHandlers=!1,directiveHandlerStacks=new Map,currentHandlerStackKey=Symbol();function deferHandlingDirectives(t){isDeferringHandlers=!0;let e=Symbol();currentHandlerStackKey=e,directiveHandlerStacks.set(e,[]);let a=()=>{for(;directiveHandlerStacks.get(e).length;)directiveHandlerStacks.get(e).shift()();directiveHandlerStacks.delete(e)},r=()=>{isDeferringHandlers=!1,a()};t(a),r()}function getElementBoundUtilities(t){let e=[],a=s=>e.push(s),[r,n]=elementBoundEffect(t);return e.push(n),[{Alpine:alpine_default,effect:r,cleanup:a,evaluateLater:evaluateLater.bind(evaluateLater,t),evaluate:evaluate.bind(evaluate,t)},()=>e.forEach(s=>s())]}function getDirectiveHandler(t,e){let a=()=>{},r=directiveHandlers[e.type]||a,[n,i]=getElementBoundUtilities(t);onAttributeRemoved(t,e.original,i);let o=()=>{t._x_ignore||t._x_ignoreSelf||(r.inline&&r.inline(t,e,n),r=r.bind(r,t,e,n),isDeferringHandlers?directiveHandlerStacks.get(currentHandlerStackKey).push(r):r())};return o.runCleanups=i,o}var startingWith=(t,e)=>({name:a,value:r})=>(a.startsWith(t)&&(a=a.replace(t,e)),{name:a,value:r}),into=t=>t;function toTransformedAttributes(t=()=>{}){return({name:e,value:a})=>{let{name:r,value:n}=attributeTransformers.reduce((i,o)=>o(i),{name:e,value:a});return r!==e&&t(r,e),{name:r,value:n}}}var attributeTransformers=[];function mapAttributes(t){attributeTransformers.push(t)}function outNonAlpineAttributes({name:t}){return alpineAttributeRegex().test(t)}var alpineAttributeRegex=()=>new RegExp(`^${prefixAsString}([^:^.]+)\\b`);function toParsedDirectives(t,e){return({name:a,value:r})=>{let n=a.match(alpineAttributeRegex()),i=a.match(/:([a-zA-Z0-9\-:]+)/),o=a.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],s=e||t[a]||a;return{type:n?n[1]:null,value:i?i[1]:null,modifiers:o.map(u=>u.replace(".","")),expression:r,original:s}}}var DEFAULT="DEFAULT",directiveOrder=["ignore","ref","data","id","bind","init","for","model","modelable","transition","show","if",DEFAULT,"teleport"];function byPriority(t,e){let a=directiveOrder.indexOf(t.type)===-1?DEFAULT:t.type,r=directiveOrder.indexOf(e.type)===-1?DEFAULT:e.type;return directiveOrder.indexOf(a)-directiveOrder.indexOf(r)}var tickStack=[],isHolding=!1;function nextTick(t=()=>{}){return queueMicrotask(()=>{isHolding||setTimeout(()=>{releaseNextTicks()})}),new Promise(e=>{tickStack.push(()=>{t(),e()})})}function releaseNextTicks(){for(isHolding=!1;tickStack.length;)tickStack.shift()()}function holdNextTicks(){isHolding=!0}function setClasses(t,e){return Array.isArray(e)?setClassesFromString(t,e.join(" ")):typeof e=="object"&&e!==null?setClassesFromObject(t,e):typeof e=="function"?setClasses(t,e()):setClassesFromString(t,e)}function setClassesFromString(t,e){let a=n=>n.split(" ").filter(i=>!t.classList.contains(i)).filter(Boolean),r=n=>(t.classList.add(...n),()=>{t.classList.remove(...n)});return e=e===!0?e="":e||"",r(a(e))}function setClassesFromObject(t,e){let a=s=>s.split(" ").filter(Boolean),r=Object.entries(e).flatMap(([s,u])=>u?a(s):!1).filter(Boolean),n=Object.entries(e).flatMap(([s,u])=>u?!1:a(s)).filter(Boolean),i=[],o=[];return n.forEach(s=>{t.classList.contains(s)&&(t.classList.remove(s),o.push(s))}),r.forEach(s=>{t.classList.contains(s)||(t.classList.add(s),i.push(s))}),()=>{o.forEach(s=>t.classList.add(s)),i.forEach(s=>t.classList.remove(s))}}function setStyles(t,e){return typeof e=="object"&&e!==null?setStylesFromObject(t,e):setStylesFromString(t,e)}function setStylesFromObject(t,e){let a={};return Object.entries(e).forEach(([r,n])=>{a[r]=t.style[r],r.startsWith("--")||(r=kebabCase(r)),t.style.setProperty(r,n)}),setTimeout(()=>{t.style.length===0&&t.removeAttribute("style")}),()=>{setStyles(t,a)}}function setStylesFromString(t,e){let a=t.getAttribute("style",e);return t.setAttribute("style",e),()=>{t.setAttribute("style",a||"")}}function kebabCase(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function once(t,e=()=>{}){let a=!1;return function(){a?e.apply(this,arguments):(a=!0,t.apply(this,arguments))}}directive("transition",(t,{value:e,modifiers:a,expression:r},{evaluate:n})=>{typeof r=="function"&&(r=n(r)),r!==!1&&(!r||typeof r=="boolean"?registerTransitionsFromHelper(t,a,e):registerTransitionsFromClassString(t,r,e))});function registerTransitionsFromClassString(t,e,a){registerTransitionObject(t,setClasses,""),{enter:n=>{t._x_transition.enter.during=n},"enter-start":n=>{t._x_transition.enter.start=n},"enter-end":n=>{t._x_transition.enter.end=n},leave:n=>{t._x_transition.leave.during=n},"leave-start":n=>{t._x_transition.leave.start=n},"leave-end":n=>{t._x_transition.leave.end=n}}[a](e)}function registerTransitionsFromHelper(t,e,a){registerTransitionObject(t,setStyles);let r=!e.includes("in")&&!e.includes("out")&&!a,n=r||e.includes("in")||["enter"].includes(a),i=r||e.includes("out")||["leave"].includes(a);e.includes("in")&&!r&&(e=e.filter((C,w)=>w<e.indexOf("out"))),e.includes("out")&&!r&&(e=e.filter((C,w)=>w>e.indexOf("out")));let o=!e.includes("opacity")&&!e.includes("scale"),s=o||e.includes("opacity"),u=o||e.includes("scale"),c=s?0:1,l=u?modifierValue(e,"scale",95)/100:1,p=modifierValue(e,"delay",0)/1e3,v=modifierValue(e,"origin","center"),S="opacity, transform",T=modifierValue(e,"duration",150)/1e3,O=modifierValue(e,"duration",75)/1e3,M="cubic-bezier(0.4, 0.0, 0.2, 1)";n&&(t._x_transition.enter.during={transformOrigin:v,transitionDelay:`${p}s`,transitionProperty:S,transitionDuration:`${T}s`,transitionTimingFunction:M},t._x_transition.enter.start={opacity:c,transform:`scale(${l})`},t._x_transition.enter.end={opacity:1,transform:"scale(1)"}),i&&(t._x_transition.leave.during={transformOrigin:v,transitionDelay:`${p}s`,transitionProperty:S,transitionDuration:`${O}s`,transitionTimingFunction:M},t._x_transition.leave.start={opacity:1,transform:"scale(1)"},t._x_transition.leave.end={opacity:c,transform:`scale(${l})`})}function registerTransitionObject(t,e,a={}){t._x_transition||(t._x_transition={enter:{during:a,start:a,end:a},leave:{during:a,start:a,end:a},in(r=()=>{},n=()=>{}){transition(t,e,{during:this.enter.during,start:this.enter.start,end:this.enter.end},r,n)},out(r=()=>{},n=()=>{}){transition(t,e,{during:this.leave.during,start:this.leave.start,end:this.leave.end},r,n)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(t,e,a,r){const n=document.visibilityState==="visible"?requestAnimationFrame:setTimeout;let i=()=>n(a);if(e){t._x_transition&&(t._x_transition.enter||t._x_transition.leave)?t._x_transition.enter&&(Object.entries(t._x_transition.enter.during).length||Object.entries(t._x_transition.enter.start).length||Object.entries(t._x_transition.enter.end).length)?t._x_transition.in(a):i():t._x_transition?t._x_transition.in(a):i();return}t._x_hidePromise=t._x_transition?new Promise((o,s)=>{t._x_transition.out(()=>{},()=>o(r)),t._x_transitioning.beforeCancel(()=>s({isFromCancelledTransition:!0}))}):Promise.resolve(r),queueMicrotask(()=>{let o=closestHide(t);o?(o._x_hideChildren||(o._x_hideChildren=[]),o._x_hideChildren.push(t)):n(()=>{let s=u=>{let c=Promise.all([u._x_hidePromise,...(u._x_hideChildren||[]).map(s)]).then(([l])=>l());return delete u._x_hidePromise,delete u._x_hideChildren,c};s(t).catch(u=>{if(!u.isFromCancelledTransition)throw u})})})};function closestHide(t){let e=t.parentNode;if(e)return e._x_hidePromise?e:closestHide(e)}function transition(t,e,{during:a,start:r,end:n}={},i=()=>{},o=()=>{}){if(t._x_transitioning&&t._x_transitioning.cancel(),Object.keys(a).length===0&&Object.keys(r).length===0&&Object.keys(n).length===0){i(),o();return}let s,u,c;performTransition(t,{start(){s=e(t,r)},during(){u=e(t,a)},before:i,end(){s(),c=e(t,n)},after:o,cleanup(){u(),c()}})}function performTransition(t,e){let a,r,n,i=once(()=>{mutateDom(()=>{a=!0,r||e.before(),n||(e.end(),releaseNextTicks()),e.after(),t.isConnected&&e.cleanup(),delete t._x_transitioning})});t._x_transitioning={beforeCancels:[],beforeCancel(o){this.beforeCancels.push(o)},cancel:once(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();i()}),finish:i},mutateDom(()=>{e.start(),e.during()}),holdNextTicks(),requestAnimationFrame(()=>{if(a)return;let o=Number(getComputedStyle(t).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,s=Number(getComputedStyle(t).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;o===0&&(o=Number(getComputedStyle(t).animationDuration.replace("s",""))*1e3),mutateDom(()=>{e.before()}),r=!0,requestAnimationFrame(()=>{a||(mutateDom(()=>{e.end()}),releaseNextTicks(),setTimeout(t._x_transitioning.finish,o+s),n=!0)})})}function modifierValue(t,e,a){if(t.indexOf(e)===-1)return a;const r=t[t.indexOf(e)+1];if(!r||e==="scale"&&isNaN(r))return a;if(e==="duration"||e==="delay"){let n=r.match(/([0-9]+)ms/);if(n)return n[1]}return e==="origin"&&["top","right","left","center","bottom"].includes(t[t.indexOf(e)+2])?[r,t[t.indexOf(e)+2]].join(" "):r}var isCloning=!1;function skipDuringClone(t,e=()=>{}){return(...a)=>isCloning?e(...a):t(...a)}function onlyDuringClone(t){return(...e)=>isCloning&&t(...e)}function cloneNode(t,e){t._x_dataStack&&(e._x_dataStack=t._x_dataStack,e.setAttribute("data-has-alpine-state",!0)),isCloning=!0,dontRegisterReactiveSideEffects(()=>{initTree(e,(a,r)=>{r(a,()=>{})})}),isCloning=!1}var isCloningLegacy=!1;function clone$1(t,e){e._x_dataStack||(e._x_dataStack=t._x_dataStack),isCloning=!0,isCloningLegacy=!0,dontRegisterReactiveSideEffects(()=>{cloneTree(e)}),isCloning=!1,isCloningLegacy=!1}function cloneTree(t){let e=!1;initTree(t,(r,n)=>{walk(r,(i,o)=>{if(e&&isRoot(i))return o();e=!0,n(i,o)})})}function dontRegisterReactiveSideEffects(t){let e=effect$3;overrideEffect((a,r)=>{let n=e(a);return release(n),()=>{}}),t(),overrideEffect(e)}function shouldSkipRegisteringDataDuringClone(t){return isCloning?isCloningLegacy?!0:t.hasAttribute("data-has-alpine-state"):!1}function bind(t,e,a,r=[]){switch(t._x_bindings||(t._x_bindings=reactive({})),t._x_bindings[e]=a,e=r.includes("camel")?camelCase$2(e):e,e){case"value":bindInputValue(t,a);break;case"style":bindStyles(t,a);break;case"class":bindClasses(t,a);break;case"selected":case"checked":bindAttributeAndProperty(t,e,a);break;default:bindAttribute(t,e,a);break}}function bindInputValue(t,e){if(t.type==="radio")t.attributes.value===void 0&&(t.value=e),window.fromModel&&(t.checked=checkedAttrLooseCompare(t.value,e));else if(t.type==="checkbox")Number.isInteger(e)?t.value=e:!Array.isArray(e)&&typeof e!="boolean"&&![null,void 0].includes(e)?t.value=String(e):Array.isArray(e)?t.checked=e.some(a=>checkedAttrLooseCompare(a,t.value)):t.checked=!!e;else if(t.tagName==="SELECT")updateSelect(t,e);else{if(t.value===e)return;t.value=e===void 0?"":e}}function bindClasses(t,e){t._x_undoAddedClasses&&t._x_undoAddedClasses(),t._x_undoAddedClasses=setClasses(t,e)}function bindStyles(t,e){t._x_undoAddedStyles&&t._x_undoAddedStyles(),t._x_undoAddedStyles=setStyles(t,e)}function bindAttributeAndProperty(t,e,a){bindAttribute(t,e,a),setPropertyIfChanged(t,e,a)}function bindAttribute(t,e,a){[null,void 0,!1].includes(a)&&attributeShouldntBePreservedIfFalsy(e)?t.removeAttribute(e):(isBooleanAttr(e)&&(a=e),setIfChanged(t,e,a))}function setIfChanged(t,e,a){t.getAttribute(e)!=a&&t.setAttribute(e,a)}function setPropertyIfChanged(t,e,a){t[e]!==a&&(t[e]=a)}function updateSelect(t,e){const a=[].concat(e).map(r=>r+"");Array.from(t.options).forEach(r=>{r.selected=a.includes(r.value)})}function camelCase$2(t){return t.toLowerCase().replace(/-(\w)/g,(e,a)=>a.toUpperCase())}function checkedAttrLooseCompare(t,e){return t==e}function isBooleanAttr(t){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(t)}function attributeShouldntBePreservedIfFalsy(t){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(t)}function getBinding(t,e,a){return t._x_bindings&&t._x_bindings[e]!==void 0?t._x_bindings[e]:getAttributeBinding(t,e,a)}function extractProp(t,e,a,r=!0){if(t._x_bindings&&t._x_bindings[e]!==void 0)return t._x_bindings[e];if(t._x_inlineBindings&&t._x_inlineBindings[e]!==void 0){let n=t._x_inlineBindings[e];return n.extract=r,dontAutoEvaluateFunctions(()=>evaluate(t,n.expression))}return getAttributeBinding(t,e,a)}function getAttributeBinding(t,e,a){let r=t.getAttribute(e);return r===null?typeof a=="function"?a():a:r===""?!0:isBooleanAttr(e)?!![e,"true"].includes(r):r}function debounce$1(t,e){var a;return function(){var r=this,n=arguments,i=function(){a=null,t.apply(r,n)};clearTimeout(a),a=setTimeout(i,e)}}function throttle(t,e){let a;return function(){let r=this,n=arguments;a||(t.apply(r,n),a=!0,setTimeout(()=>a=!1,e))}}function entangle({get:t,set:e},{get:a,set:r}){let n=!0,i,o,s,u=effect$3(()=>{let c,l;n?(c=t(),r(JSON.parse(JSON.stringify(c))),l=a(),n=!1):(c=t(),l=a(),o=JSON.stringify(c),s=JSON.stringify(l),o!==i?(l=a(),r(c),l=c):(e(JSON.parse(s??null)),c=l)),i=JSON.stringify(c),JSON.stringify(l)});return()=>{release(u)}}function plugin(t){(Array.isArray(t)?t:[t]).forEach(a=>a(alpine_default))}var stores={},isReactive=!1;function store(t,e){if(isReactive||(stores=reactive(stores),isReactive=!0),e===void 0)return stores[t];stores[t]=e,typeof e=="object"&&e!==null&&e.hasOwnProperty("init")&&typeof e.init=="function"&&stores[t].init(),initInterceptors2(stores[t])}function getStores(){return stores}var binds={};function bind2(t,e){let a=typeof e!="function"?()=>e:e;return t instanceof Element?applyBindingsObject(t,a()):(binds[t]=a,()=>{})}function injectBindingProviders(t){return Object.entries(binds).forEach(([e,a])=>{Object.defineProperty(t,e,{get(){return(...r)=>a(...r)}})}),t}function applyBindingsObject(t,e,a){let r=[];for(;r.length;)r.pop()();let n=Object.entries(e).map(([o,s])=>({name:o,value:s})),i=attributesOnly(n);return n=n.map(o=>i.find(s=>s.name===o.name)?{name:`x-bind:${o.name}`,value:`"${o.value}"`}:o),directives(t,n,a).map(o=>{r.push(o.runCleanups),o()}),()=>{for(;r.length;)r.pop()()}}var datas={};function data(t,e){datas[t]=e}function injectDataProviders(t,e){return Object.entries(datas).forEach(([a,r])=>{Object.defineProperty(t,a,{get(){return(...n)=>r.bind(e)(...n)},enumerable:!1})}),t}var Alpine={get reactive(){return reactive},get release(){return release},get effect(){return effect$3},get raw(){return raw},version:"3.13.1",flushAndStopDeferringMutations,dontAutoEvaluateFunctions,disableEffectScheduling,startObservingMutations,stopObservingMutations,setReactivityEngine,onAttributeRemoved,onAttributesAdded,closestDataStack,skipDuringClone,onlyDuringClone,addRootSelector,addInitSelector,addScopeToNode,deferMutations,mapAttributes,evaluateLater,interceptInit,setEvaluator,mergeProxies,extractProp,findClosest,onElRemoved,closestRoot,destroyTree,interceptor,transition,setStyles,mutateDom,directive,entangle,throttle,debounce:debounce$1,evaluate,initTree,nextTick,prefixed:prefix,prefix:setPrefix,plugin,magic,store,start:start$1,clone:clone$1,cloneNode,bound:getBinding,$data:scope,walk,data,bind:bind2},alpine_default=Alpine;function makeMap(t,e){const a=Object.create(null),r=t.split(",");for(let n=0;n<r.length;n++)a[r[n]]=!0;return e?n=>!!a[n.toLowerCase()]:n=>!!a[n]}var EMPTY_OBJ=Object.freeze({}),hasOwnProperty$b=Object.prototype.hasOwnProperty,hasOwn=(t,e)=>hasOwnProperty$b.call(t,e),isArray$b=Array.isArray,isMap=t=>toTypeString(t)==="[object Map]",isString=t=>typeof t=="string",isSymbol$6=t=>typeof t=="symbol",isObject$8=t=>t!==null&&typeof t=="object",objectToString$2=Object.prototype.toString,toTypeString=t=>objectToString$2.call(t),toRawType=t=>toTypeString(t).slice(8,-1),isIntegerKey=t=>isString(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,cacheStringFunction=t=>{const e=Object.create(null);return a=>e[a]||(e[a]=t(a))},capitalize$2=cacheStringFunction(t=>t.charAt(0).toUpperCase()+t.slice(1)),hasChanged=(t,e)=>t!==e&&(t===t||e===e),targetMap=new WeakMap,effectStack=[],activeEffect,ITERATE_KEY=Symbol("iterate"),MAP_KEY_ITERATE_KEY=Symbol("Map key iterate");function isEffect(t){return t&&t._isEffect===!0}function effect2(t,e=EMPTY_OBJ){isEffect(t)&&(t=t.raw);const a=createReactiveEffect(t,e);return e.lazy||a(),a}function stop(t){t.active&&(cleanup(t),t.options.onStop&&t.options.onStop(),t.active=!1)}var uid=0;function createReactiveEffect(t,e){const a=function(){if(!a.active)return t();if(!effectStack.includes(a)){cleanup(a);try{return enableTracking(),effectStack.push(a),activeEffect=a,t()}finally{effectStack.pop(),resetTracking(),activeEffect=effectStack[effectStack.length-1]}}};return a.id=uid++,a.allowRecurse=!!e.allowRecurse,a._isEffect=!0,a.active=!0,a.raw=t,a.deps=[],a.options=e,a}function cleanup(t){const{deps:e}=t;if(e.length){for(let a=0;a<e.length;a++)e[a].delete(t);e.length=0}}var shouldTrack=!0,trackStack=[];function pauseTracking(){trackStack.push(shouldTrack),shouldTrack=!1}function enableTracking(){trackStack.push(shouldTrack),shouldTrack=!0}function resetTracking(){const t=trackStack.pop();shouldTrack=t===void 0?!0:t}function track(t,e,a){if(!shouldTrack||activeEffect===void 0)return;let r=targetMap.get(t);r||targetMap.set(t,r=new Map);let n=r.get(a);n||r.set(a,n=new Set),n.has(activeEffect)||(n.add(activeEffect),activeEffect.deps.push(n),activeEffect.options.onTrack&&activeEffect.options.onTrack({effect:activeEffect,target:t,type:e,key:a}))}function trigger(t,e,a,r,n,i){const o=targetMap.get(t);if(!o)return;const s=new Set,u=l=>{l&&l.forEach(p=>{(p!==activeEffect||p.allowRecurse)&&s.add(p)})};if(e==="clear")o.forEach(u);else if(a==="length"&&isArray$b(t))o.forEach((l,p)=>{(p==="length"||p>=r)&&u(l)});else switch(a!==void 0&&u(o.get(a)),e){case"add":isArray$b(t)?isIntegerKey(a)&&u(o.get("length")):(u(o.get(ITERATE_KEY)),isMap(t)&&u(o.get(MAP_KEY_ITERATE_KEY)));break;case"delete":isArray$b(t)||(u(o.get(ITERATE_KEY)),isMap(t)&&u(o.get(MAP_KEY_ITERATE_KEY)));break;case"set":isMap(t)&&u(o.get(ITERATE_KEY));break}const c=l=>{l.options.onTrigger&&l.options.onTrigger({effect:l,target:t,key:a,type:e,newValue:r,oldValue:n,oldTarget:i}),l.options.scheduler?l.options.scheduler(l):l()};s.forEach(c)}var isNonTrackableKeys=makeMap("__proto__,__v_isRef,__isVue"),builtInSymbols=new Set(Object.getOwnPropertyNames(Symbol).map(t=>Symbol[t]).filter(isSymbol$6)),get2=createGetter(),readonlyGet=createGetter(!0),arrayInstrumentations=createArrayInstrumentations();function createArrayInstrumentations(){const t={};return["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...a){const r=toRaw(this);for(let i=0,o=this.length;i<o;i++)track(r,"get",i+"");const n=r[e](...a);return n===-1||n===!1?r[e](...a.map(toRaw)):n}}),["push","pop","shift","unshift","splice"].forEach(e=>{t[e]=function(...a){pauseTracking();const r=toRaw(this)[e].apply(this,a);return resetTracking(),r}}),t}function createGetter(t=!1,e=!1){return function(r,n,i){if(n==="__v_isReactive")return!t;if(n==="__v_isReadonly")return t;if(n==="__v_raw"&&i===(t?e?shallowReadonlyMap:readonlyMap:e?shallowReactiveMap:reactiveMap).get(r))return r;const o=isArray$b(r);if(!t&&o&&hasOwn(arrayInstrumentations,n))return Reflect.get(arrayInstrumentations,n,i);const s=Reflect.get(r,n,i);return(isSymbol$6(n)?builtInSymbols.has(n):isNonTrackableKeys(n))||(t||track(r,"get",n),e)?s:isRef(s)?!o||!isIntegerKey(n)?s.value:s:isObject$8(s)?t?readonly(s):reactive2(s):s}}var set2=createSetter();function createSetter(t=!1){return function(a,r,n,i){let o=a[r];if(!t&&(n=toRaw(n),o=toRaw(o),!isArray$b(a)&&isRef(o)&&!isRef(n)))return o.value=n,!0;const s=isArray$b(a)&&isIntegerKey(r)?Number(r)<a.length:hasOwn(a,r),u=Reflect.set(a,r,n,i);return a===toRaw(i)&&(s?hasChanged(n,o)&&trigger(a,"set",r,n,o):trigger(a,"add",r,n)),u}}function deleteProperty(t,e){const a=hasOwn(t,e),r=t[e],n=Reflect.deleteProperty(t,e);return n&&a&&trigger(t,"delete",e,void 0,r),n}function has$2(t,e){const a=Reflect.has(t,e);return(!isSymbol$6(e)||!builtInSymbols.has(e))&&track(t,"has",e),a}function ownKeys(t){return track(t,"iterate",isArray$b(t)?"length":ITERATE_KEY),Reflect.ownKeys(t)}var mutableHandlers={get:get2,set:set2,deleteProperty,has:has$2,ownKeys},readonlyHandlers={get:readonlyGet,set(t,e){return console.warn(`Set operation on key "${String(e)}" failed: target is readonly.`,t),!0},deleteProperty(t,e){return console.warn(`Delete operation on key "${String(e)}" failed: target is readonly.`,t),!0}},toReactive=t=>isObject$8(t)?reactive2(t):t,toReadonly=t=>isObject$8(t)?readonly(t):t,toShallow=t=>t,getProto=t=>Reflect.getPrototypeOf(t);function get$1$1(t,e,a=!1,r=!1){t=t.__v_raw;const n=toRaw(t),i=toRaw(e);e!==i&&!a&&track(n,"get",e),!a&&track(n,"get",i);const{has:o}=getProto(n),s=r?toShallow:a?toReadonly:toReactive;if(o.call(n,e))return s(t.get(e));if(o.call(n,i))return s(t.get(i));t!==n&&t.get(e)}function has$1$1(t,e=!1){const a=this.__v_raw,r=toRaw(a),n=toRaw(t);return t!==n&&!e&&track(r,"has",t),!e&&track(r,"has",n),t===n?a.has(t):a.has(t)||a.has(n)}function size(t,e=!1){return t=t.__v_raw,!e&&track(toRaw(t),"iterate",ITERATE_KEY),Reflect.get(t,"size",t)}function add(t){t=toRaw(t);const e=toRaw(this);return getProto(e).has.call(e,t)||(e.add(t),trigger(e,"add",t,t)),this}function set$1$1(t,e){e=toRaw(e);const a=toRaw(this),{has:r,get:n}=getProto(a);let i=r.call(a,t);i?checkIdentityKeys(a,r,t):(t=toRaw(t),i=r.call(a,t));const o=n.call(a,t);return a.set(t,e),i?hasChanged(e,o)&&trigger(a,"set",t,e,o):trigger(a,"add",t,e),this}function deleteEntry(t){const e=toRaw(this),{has:a,get:r}=getProto(e);let n=a.call(e,t);n?checkIdentityKeys(e,a,t):(t=toRaw(t),n=a.call(e,t));const i=r?r.call(e,t):void 0,o=e.delete(t);return n&&trigger(e,"delete",t,void 0,i),o}function clear(){const t=toRaw(this),e=t.size!==0,a=isMap(t)?new Map(t):new Set(t),r=t.clear();return e&&trigger(t,"clear",void 0,void 0,a),r}function createForEach(t,e){return function(r,n){const i=this,o=i.__v_raw,s=toRaw(o),u=e?toShallow:t?toReadonly:toReactive;return!t&&track(s,"iterate",ITERATE_KEY),o.forEach((c,l)=>r.call(n,u(c),u(l),i))}}function createIterableMethod(t,e,a){return function(...r){const n=this.__v_raw,i=toRaw(n),o=isMap(i),s=t==="entries"||t===Symbol.iterator&&o,u=t==="keys"&&o,c=n[t](...r),l=a?toShallow:e?toReadonly:toReactive;return!e&&track(i,"iterate",u?MAP_KEY_ITERATE_KEY:ITERATE_KEY),{next(){const{value:p,done:v}=c.next();return v?{value:p,done:v}:{value:s?[l(p[0]),l(p[1])]:l(p),done:v}},[Symbol.iterator](){return this}}}}function createReadonlyMethod(t){return function(...e){{const a=e[0]?`on key "${e[0]}" `:"";console.warn(`${capitalize$2(t)} operation ${a}failed: target is readonly.`,toRaw(this))}return t==="delete"?!1:this}}function createInstrumentations(){const t={get(i){return get$1$1(this,i)},get size(){return size(this)},has:has$1$1,add,set:set$1$1,delete:deleteEntry,clear,forEach:createForEach(!1,!1)},e={get(i){return get$1$1(this,i,!1,!0)},get size(){return size(this)},has:has$1$1,add,set:set$1$1,delete:deleteEntry,clear,forEach:createForEach(!1,!0)},a={get(i){return get$1$1(this,i,!0)},get size(){return size(this,!0)},has(i){return has$1$1.call(this,i,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!1)},r={get(i){return get$1$1(this,i,!0,!0)},get size(){return size(this,!0)},has(i){return has$1$1.call(this,i,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=createIterableMethod(i,!1,!1),a[i]=createIterableMethod(i,!0,!1),e[i]=createIterableMethod(i,!1,!0),r[i]=createIterableMethod(i,!0,!0)}),[t,a,e,r]}var[mutableInstrumentations,readonlyInstrumentations,shallowInstrumentations,shallowReadonlyInstrumentations]=createInstrumentations();function createInstrumentationGetter(t,e){const a=e?t?shallowReadonlyInstrumentations:shallowInstrumentations:t?readonlyInstrumentations:mutableInstrumentations;return(r,n,i)=>n==="__v_isReactive"?!t:n==="__v_isReadonly"?t:n==="__v_raw"?r:Reflect.get(hasOwn(a,n)&&n in r?a:r,n,i)}var mutableCollectionHandlers={get:createInstrumentationGetter(!1,!1)},readonlyCollectionHandlers={get:createInstrumentationGetter(!0,!1)};function checkIdentityKeys(t,e,a){const r=toRaw(a);if(r!==a&&e.call(t,r)){const n=toRawType(t);console.warn(`Reactive ${n} contains both the raw and reactive versions of the same object${n==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var reactiveMap=new WeakMap,shallowReactiveMap=new WeakMap,readonlyMap=new WeakMap,shallowReadonlyMap=new WeakMap;function targetTypeMap(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function getTargetType(t){return t.__v_skip||!Object.isExtensible(t)?0:targetTypeMap(toRawType(t))}function reactive2(t){return t&&t.__v_isReadonly?t:createReactiveObject(t,!1,mutableHandlers,mutableCollectionHandlers,reactiveMap)}function readonly(t){return createReactiveObject(t,!0,readonlyHandlers,readonlyCollectionHandlers,readonlyMap)}function createReactiveObject(t,e,a,r,n){if(!isObject$8(t))return console.warn(`value cannot be made reactive: ${String(t)}`),t;if(t.__v_raw&&!(e&&t.__v_isReactive))return t;const i=n.get(t);if(i)return i;const o=getTargetType(t);if(o===0)return t;const s=new Proxy(t,o===2?r:a);return n.set(t,s),s}function toRaw(t){return t&&toRaw(t.__v_raw)||t}function isRef(t){return!!(t&&t.__v_isRef===!0)}magic("nextTick",()=>nextTick);magic("dispatch",t=>dispatch.bind(dispatch,t));magic("watch",(t,{evaluateLater:e,effect:a})=>(r,n)=>{let i=e(r),o=!0,s,u=a(()=>i(c=>{JSON.stringify(c),o?s=c:queueMicrotask(()=>{n(c,s),s=c}),o=!1}));t._x_effects.delete(u)});magic("store",getStores);magic("data",t=>scope(t));magic("root",t=>closestRoot(t));magic("refs",t=>(t._x_refs_proxy||(t._x_refs_proxy=mergeProxies(getArrayOfRefObject(t))),t._x_refs_proxy));function getArrayOfRefObject(t){let e=[],a=t;for(;a;)a._x_refs&&e.push(a._x_refs),a=a.parentNode;return e}var globalIdMemo={};function findAndIncrementId(t){return globalIdMemo[t]||(globalIdMemo[t]=0),++globalIdMemo[t]}function closestIdRoot(t,e){return findClosest(t,a=>{if(a._x_ids&&a._x_ids[e])return!0})}function setIdRoot(t,e){t._x_ids||(t._x_ids={}),t._x_ids[e]||(t._x_ids[e]=findAndIncrementId(e))}magic("id",t=>(e,a=null)=>{let r=closestIdRoot(t,e),n=r?r._x_ids[e]:findAndIncrementId(e);return a?`${e}-${n}-${a}`:`${e}-${n}`});magic("el",t=>t);warnMissingPluginMagic("Focus","focus","focus");warnMissingPluginMagic("Persist","persist","persist");function warnMissingPluginMagic(t,e,a){magic(e,r=>warn(`You can't use [$${e}] without first installing the "${t}" plugin here: https://alpinejs.dev/plugins/${a}`,r))}directive("modelable",(t,{expression:e},{effect:a,evaluateLater:r,cleanup:n})=>{let i=r(e),o=()=>{let l;return i(p=>l=p),l},s=r(`${e} = __placeholder`),u=l=>s(()=>{},{scope:{__placeholder:l}}),c=o();u(c),queueMicrotask(()=>{if(!t._x_model)return;t._x_removeModelListeners.default();let l=t._x_model.get,p=t._x_model.set,v=entangle({get(){return l()},set(S){p(S)}},{get(){return o()},set(S){u(S)}});n(v)})});directive("teleport",(t,{modifiers:e,expression:a},{cleanup:r})=>{t.tagName.toLowerCase()!=="template"&&warn("x-teleport can only be used on a <template> tag",t);let n=getTarget(a),i=t.content.cloneNode(!0).firstElementChild;t._x_teleport=i,i._x_teleportBack=t,t.setAttribute("data-teleport-template",!0),i.setAttribute("data-teleport-target",!0),t._x_forwardEvents&&t._x_forwardEvents.forEach(s=>{i.addEventListener(s,u=>{u.stopPropagation(),t.dispatchEvent(new u.constructor(u.type,u))})}),addScopeToNode(i,{},t);let o=(s,u,c)=>{c.includes("prepend")?u.parentNode.insertBefore(s,u):c.includes("append")?u.parentNode.insertBefore(s,u.nextSibling):u.appendChild(s)};mutateDom(()=>{o(i,n,e),initTree(i),i._x_ignore=!0}),t._x_teleportPutBack=()=>{let s=getTarget(a);mutateDom(()=>{o(t._x_teleport,s,e)})},r(()=>i.remove())});var teleportContainerDuringClone=document.createElement("div");function getTarget(t){let e=skipDuringClone(()=>document.querySelector(t),()=>teleportContainerDuringClone)();return e||warn(`Cannot find x-teleport element for selector: "${t}"`),e}var handler=()=>{};handler.inline=(t,{modifiers:e},{cleanup:a})=>{e.includes("self")?t._x_ignoreSelf=!0:t._x_ignore=!0,a(()=>{e.includes("self")?delete t._x_ignoreSelf:delete t._x_ignore})};directive("ignore",handler);directive("effect",(t,{expression:e},{effect:a})=>a(evaluateLater(t,e)));function on(t,e,a,r){let n=t,i=u=>r(u),o={},s=(u,c)=>l=>c(u,l);if(a.includes("dot")&&(e=dotSyntax(e)),a.includes("camel")&&(e=camelCase2(e)),a.includes("passive")&&(o.passive=!0),a.includes("capture")&&(o.capture=!0),a.includes("window")&&(n=window),a.includes("document")&&(n=document),a.includes("debounce")){let u=a[a.indexOf("debounce")+1]||"invalid-wait",c=isNumeric$1(u.split("ms")[0])?Number(u.split("ms")[0]):250;i=debounce$1(i,c)}if(a.includes("throttle")){let u=a[a.indexOf("throttle")+1]||"invalid-wait",c=isNumeric$1(u.split("ms")[0])?Number(u.split("ms")[0]):250;i=throttle(i,c)}return a.includes("prevent")&&(i=s(i,(u,c)=>{c.preventDefault(),u(c)})),a.includes("stop")&&(i=s(i,(u,c)=>{c.stopPropagation(),u(c)})),a.includes("self")&&(i=s(i,(u,c)=>{c.target===t&&u(c)})),(a.includes("away")||a.includes("outside"))&&(n=document,i=s(i,(u,c)=>{t.contains(c.target)||c.target.isConnected!==!1&&(t.offsetWidth<1&&t.offsetHeight<1||t._x_isShown!==!1&&u(c))})),a.includes("once")&&(i=s(i,(u,c)=>{u(c),n.removeEventListener(e,i,o)})),i=s(i,(u,c)=>{isKeyEvent(e)&&isListeningForASpecificKeyThatHasntBeenPressed(c,a)||u(c)}),n.addEventListener(e,i,o),()=>{n.removeEventListener(e,i,o)}}function dotSyntax(t){return t.replace(/-/g,".")}function camelCase2(t){return t.toLowerCase().replace(/-(\w)/g,(e,a)=>a.toUpperCase())}function isNumeric$1(t){return!Array.isArray(t)&&!isNaN(t)}function kebabCase2(t){return[" ","_"].includes(t)?t:t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function isKeyEvent(t){return["keydown","keyup"].includes(t)}function isListeningForASpecificKeyThatHasntBeenPressed(t,e){let a=e.filter(i=>!["window","document","prevent","stop","once","capture"].includes(i));if(a.includes("debounce")){let i=a.indexOf("debounce");a.splice(i,isNumeric$1((a[i+1]||"invalid-wait").split("ms")[0])?2:1)}if(a.includes("throttle")){let i=a.indexOf("throttle");a.splice(i,isNumeric$1((a[i+1]||"invalid-wait").split("ms")[0])?2:1)}if(a.length===0||a.length===1&&keyToModifiers(t.key).includes(a[0]))return!1;const n=["ctrl","shift","alt","meta","cmd","super"].filter(i=>a.includes(i));return a=a.filter(i=>!n.includes(i)),!(n.length>0&&n.filter(o=>((o==="cmd"||o==="super")&&(o="meta"),t[`${o}Key`])).length===n.length&&keyToModifiers(t.key).includes(a[0]))}function keyToModifiers(t){if(!t)return[];t=kebabCase2(t);let e={ctrl:"control",slash:"/",space:" ",spacebar:" ",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",equal:"=",minus:"-",underscore:"_"};return e[t]=t,Object.keys(e).map(a=>{if(e[a]===t)return a}).filter(a=>a)}directive("model",(t,{modifiers:e,expression:a},{effect:r,cleanup:n})=>{let i=t;e.includes("parent")&&(i=t.parentNode);let o=evaluateLater(i,a),s;typeof a=="string"?s=evaluateLater(i,`${a} = __placeholder`):typeof a=="function"&&typeof a()=="string"?s=evaluateLater(i,`${a()} = __placeholder`):s=()=>{};let u=()=>{let v;return o(S=>v=S),isGetterSetter(v)?v.get():v},c=v=>{let S;o(T=>S=T),isGetterSetter(S)?S.set(v):s(()=>{},{scope:{__placeholder:v}})};typeof a=="string"&&t.type==="radio"&&mutateDom(()=>{t.hasAttribute("name")||t.setAttribute("name",a)});var l=t.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(t.type)||e.includes("lazy")?"change":"input";let p=isCloning?()=>{}:on(t,l,e,v=>{c(getInputValue(t,e,v,u()))});if(e.includes("fill")&&([null,""].includes(u())||t.type==="checkbox"&&Array.isArray(u()))&&t.dispatchEvent(new Event(l,{})),t._x_removeModelListeners||(t._x_removeModelListeners={}),t._x_removeModelListeners.default=p,n(()=>t._x_removeModelListeners.default()),t.form){let v=on(t.form,"reset",[],S=>{nextTick(()=>t._x_model&&t._x_model.set(t.value))});n(()=>v())}t._x_model={get(){return u()},set(v){c(v)}},t._x_forceModelUpdate=v=>{v===void 0&&typeof a=="string"&&a.match(/\./)&&(v=""),window.fromModel=!0,mutateDom(()=>bind(t,"value",v)),delete window.fromModel},r(()=>{let v=u();e.includes("unintrusive")&&document.activeElement.isSameNode(t)||t._x_forceModelUpdate(v)})});function getInputValue(t,e,a,r){return mutateDom(()=>{if(a instanceof CustomEvent&&a.detail!==void 0)return a.detail!==null&&a.detail!==void 0?a.detail:a.target.value;if(t.type==="checkbox")if(Array.isArray(r)){let n=e.includes("number")?safeParseNumber(a.target.value):a.target.value;return a.target.checked?r.concat([n]):r.filter(i=>!checkedAttrLooseCompare2(i,n))}else return a.target.checked;else{if(t.tagName.toLowerCase()==="select"&&t.multiple)return e.includes("number")?Array.from(a.target.selectedOptions).map(n=>{let i=n.value||n.text;return safeParseNumber(i)}):Array.from(a.target.selectedOptions).map(n=>n.value||n.text);{let n=a.target.value;return e.includes("number")?safeParseNumber(n):e.includes("trim")?n.trim():n}}})}function safeParseNumber(t){let e=t?parseFloat(t):null;return isNumeric2(e)?e:t}function checkedAttrLooseCompare2(t,e){return t==e}function isNumeric2(t){return!Array.isArray(t)&&!isNaN(t)}function isGetterSetter(t){return t!==null&&typeof t=="object"&&typeof t.get=="function"&&typeof t.set=="function"}directive("cloak",t=>queueMicrotask(()=>mutateDom(()=>t.removeAttribute(prefix("cloak")))));addInitSelector(()=>`[${prefix("init")}]`);directive("init",skipDuringClone((t,{expression:e},{evaluate:a})=>typeof e=="string"?!!e.trim()&&a(e,{},!1):a(e,{},!1)));directive("text",(t,{expression:e},{effect:a,evaluateLater:r})=>{let n=r(e);a(()=>{n(i=>{mutateDom(()=>{t.textContent=i})})})});directive("html",(t,{expression:e},{effect:a,evaluateLater:r})=>{let n=r(e);a(()=>{n(i=>{mutateDom(()=>{t.innerHTML=i,t._x_ignoreSelf=!0,initTree(t),delete t._x_ignoreSelf})})})});mapAttributes(startingWith(":",into(prefix("bind:"))));var handler2=(t,{value:e,modifiers:a,expression:r,original:n},{effect:i})=>{if(!e){let s={};injectBindingProviders(s),evaluateLater(t,r)(c=>{applyBindingsObject(t,c,n)},{scope:s});return}if(e==="key")return storeKeyForXFor(t,r);if(t._x_inlineBindings&&t._x_inlineBindings[e]&&t._x_inlineBindings[e].extract)return;let o=evaluateLater(t,r);i(()=>o(s=>{s===void 0&&typeof r=="string"&&r.match(/\./)&&(s=""),mutateDom(()=>bind(t,e,s,a))}))};handler2.inline=(t,{value:e,modifiers:a,expression:r})=>{e&&(t._x_inlineBindings||(t._x_inlineBindings={}),t._x_inlineBindings[e]={expression:r,extract:!1})};directive("bind",handler2);function storeKeyForXFor(t,e){t._x_keyExpression=e}addRootSelector(()=>`[${prefix("data")}]`);directive("data",(t,{expression:e},{cleanup:a})=>{if(shouldSkipRegisteringDataDuringClone(t))return;e=e===""?"{}":e;let r={};injectMagics(r,t);let n={};injectDataProviders(n,r);let i=evaluate(t,e,{scope:n});(i===void 0||i===!0)&&(i={}),injectMagics(i,t);let o=reactive(i);initInterceptors2(o);let s=addScopeToNode(t,o);o.init&&evaluate(t,o.init),a(()=>{o.destroy&&evaluate(t,o.destroy),s()})});directive("show",(t,{modifiers:e,expression:a},{effect:r})=>{let n=evaluateLater(t,a);t._x_doHide||(t._x_doHide=()=>{mutateDom(()=>{t.style.setProperty("display","none",e.includes("important")?"important":void 0)})}),t._x_doShow||(t._x_doShow=()=>{mutateDom(()=>{t.style.length===1&&t.style.display==="none"?t.removeAttribute("style"):t.style.removeProperty("display")})});let i=()=>{t._x_doHide(),t._x_isShown=!1},o=()=>{t._x_doShow(),t._x_isShown=!0},s=()=>setTimeout(o),u=once(p=>p?o():i(),p=>{typeof t._x_toggleAndCascadeWithTransitions=="function"?t._x_toggleAndCascadeWithTransitions(t,p,o,i):p?s():i()}),c,l=!0;r(()=>n(p=>{!l&&p===c||(e.includes("immediate")&&(p?s():i()),u(p),c=p,l=!1)}))});directive("for",(t,{expression:e},{effect:a,cleanup:r})=>{let n=parseForExpression(e),i=evaluateLater(t,n.items),o=evaluateLater(t,t._x_keyExpression||"index");t._x_prevKeys=[],t._x_lookup={},a(()=>loop(t,n,i,o)),r(()=>{Object.values(t._x_lookup).forEach(s=>s.remove()),delete t._x_prevKeys,delete t._x_lookup})});function loop(t,e,a,r){let n=o=>typeof o=="object"&&!Array.isArray(o),i=t;a(o=>{isNumeric3(o)&&o>=0&&(o=Array.from(Array(o).keys(),M=>M+1)),o===void 0&&(o=[]);let s=t._x_lookup,u=t._x_prevKeys,c=[],l=[];if(n(o))o=Object.entries(o).map(([M,C])=>{let w=getIterationScopeVariables(e,C,M,o);r(L=>l.push(L),{scope:{index:M,...w}}),c.push(w)});else for(let M=0;M<o.length;M++){let C=getIterationScopeVariables(e,o[M],M,o);r(w=>l.push(w),{scope:{index:M,...C}}),c.push(C)}let p=[],v=[],S=[],T=[];for(let M=0;M<u.length;M++){let C=u[M];l.indexOf(C)===-1&&S.push(C)}u=u.filter(M=>!S.includes(M));let O="template";for(let M=0;M<l.length;M++){let C=l[M],w=u.indexOf(C);if(w===-1)u.splice(M,0,C),p.push([O,M]);else if(w!==M){let L=u.splice(M,1)[0],D=u.splice(w-1,1)[0];u.splice(M,0,D),u.splice(w,0,L),v.push([L,D])}else T.push(C);O=C}for(let M=0;M<S.length;M++){let C=S[M];s[C]._x_effects&&s[C]._x_effects.forEach(dequeueJob),s[C].remove(),s[C]=null,delete s[C]}for(let M=0;M<v.length;M++){let[C,w]=v[M],L=s[C],D=s[w],R=document.createElement("div");mutateDom(()=>{D||warn('x-for ":key" is undefined or invalid',i),D.after(R),L.after(D),D._x_currentIfEl&&D.after(D._x_currentIfEl),R.before(L),L._x_currentIfEl&&L.after(L._x_currentIfEl),R.remove()}),D._x_refreshXForScope(c[l.indexOf(w)])}for(let M=0;M<p.length;M++){let[C,w]=p[M],L=C==="template"?i:s[C];L._x_currentIfEl&&(L=L._x_currentIfEl);let D=c[w],R=l[w],F=document.importNode(i.content,!0).firstElementChild,W=reactive(D);addScopeToNode(F,W,i),F._x_refreshXForScope=d=>{Object.entries(d).forEach(([m,h])=>{W[m]=h})},mutateDom(()=>{L.after(F),initTree(F)}),typeof R=="object"&&warn("x-for key cannot be an object, it must be a string or an integer",i),s[R]=F}for(let M=0;M<T.length;M++)s[T[M]]._x_refreshXForScope(c[l.indexOf(T[M])]);i._x_prevKeys=l})}function parseForExpression(t){let e=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,a=/^\s*\(|\)\s*$/g,r=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,n=t.match(r);if(!n)return;let i={};i.items=n[2].trim();let o=n[1].replace(a,"").trim(),s=o.match(e);return s?(i.item=o.replace(e,"").trim(),i.index=s[1].trim(),s[2]&&(i.collection=s[2].trim())):i.item=o,i}function getIterationScopeVariables(t,e,a,r){let n={};return/^\[.*\]$/.test(t.item)&&Array.isArray(e)?t.item.replace("[","").replace("]","").split(",").map(o=>o.trim()).forEach((o,s)=>{n[o]=e[s]}):/^\{.*\}$/.test(t.item)&&!Array.isArray(e)&&typeof e=="object"?t.item.replace("{","").replace("}","").split(",").map(o=>o.trim()).forEach(o=>{n[o]=e[o]}):n[t.item]=e,t.index&&(n[t.index]=a),t.collection&&(n[t.collection]=r),n}function isNumeric3(t){return!Array.isArray(t)&&!isNaN(t)}function handler3(){}handler3.inline=(t,{expression:e},{cleanup:a})=>{let r=closestRoot(t);r._x_refs||(r._x_refs={}),r._x_refs[e]=t,a(()=>delete r._x_refs[e])};directive("ref",handler3);directive("if",(t,{expression:e},{effect:a,cleanup:r})=>{t.tagName.toLowerCase()!=="template"&&warn("x-if can only be used on a <template> tag",t);let n=evaluateLater(t,e),i=()=>{if(t._x_currentIfEl)return t._x_currentIfEl;let s=t.content.cloneNode(!0).firstElementChild;return addScopeToNode(s,{},t),mutateDom(()=>{t.after(s),initTree(s)}),t._x_currentIfEl=s,t._x_undoIf=()=>{walk(s,u=>{u._x_effects&&u._x_effects.forEach(dequeueJob)}),s.remove(),delete t._x_currentIfEl},s},o=()=>{t._x_undoIf&&(t._x_undoIf(),delete t._x_undoIf)};a(()=>n(s=>{s?i():o()})),r(()=>t._x_undoIf&&t._x_undoIf())});directive("id",(t,{expression:e},{evaluate:a})=>{a(e).forEach(n=>setIdRoot(t,n))});mapAttributes(startingWith("@",into(prefix("on:"))));directive("on",skipDuringClone((t,{value:e,modifiers:a,expression:r},{cleanup:n})=>{let i=r?evaluateLater(t,r):()=>{};t.tagName.toLowerCase()==="template"&&(t._x_forwardEvents||(t._x_forwardEvents=[]),t._x_forwardEvents.includes(e)||t._x_forwardEvents.push(e));let o=on(t,e,a,s=>{i(()=>{},{scope:{$event:s},params:[s]})});n(()=>o())}));warnMissingPluginDirective("Collapse","collapse","collapse");warnMissingPluginDirective("Intersect","intersect","intersect");warnMissingPluginDirective("Focus","trap","focus");warnMissingPluginDirective("Mask","mask","mask");function warnMissingPluginDirective(t,e,a){directive(e,r=>warn(`You can't use [x-${e}] without first installing the "${t}" plugin here: https://alpinejs.dev/plugins/${a}`,r))}alpine_default.setEvaluator(normalEvaluator);alpine_default.setReactivityEngine({reactive:reactive2,effect:effect2,release:stop,raw:toRaw});var src_default=alpine_default,module_default=src_default,top="top",bottom="bottom",right="right",left="left",auto="auto",basePlacements=[top,bottom,right,left],start="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference="reference",variationPlacements=basePlacements.reduce(function(t,e){return t.concat([e+"-"+start,e+"-"+end])},[]),placements=[].concat(basePlacements,[auto]).reduce(function(t,e){return t.concat([e,e+"-"+start,e+"-"+end])},[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function getNodeName(t){return t?(t.nodeName||"").toLowerCase():null}function getWindow(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function isElement$1(t){var e=getWindow(t).Element;return t instanceof e||t instanceof Element}function isHTMLElement(t){var e=getWindow(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function isShadowRoot(t){if(typeof ShadowRoot>"u")return!1;var e=getWindow(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function applyStyles(t){var e=t.state;Object.keys(e.elements).forEach(function(a){var r=e.styles[a]||{},n=e.attributes[a]||{},i=e.elements[a];!isHTMLElement(i)||!getNodeName(i)||(Object.assign(i.style,r),Object.keys(n).forEach(function(o){var s=n[o];s===!1?i.removeAttribute(o):i.setAttribute(o,s===!0?"":s)}))})}function effect$2(t){var e=t.state,a={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,a.popper),e.styles=a,e.elements.arrow&&Object.assign(e.elements.arrow.style,a.arrow),function(){Object.keys(e.elements).forEach(function(r){var n=e.elements[r],i=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:a[r]),s=o.reduce(function(u,c){return u[c]="",u},{});!isHTMLElement(n)||!getNodeName(n)||(Object.assign(n.style,s),Object.keys(i).forEach(function(u){n.removeAttribute(u)}))})}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(t){return t.split("-")[0]}var max=Math.max,min=Math.min,round=Math.round;function getUAString(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect(t,e,a){e===void 0&&(e=!1),a===void 0&&(a=!1);var r=t.getBoundingClientRect(),n=1,i=1;e&&isHTMLElement(t)&&(n=t.offsetWidth>0&&round(r.width)/t.offsetWidth||1,i=t.offsetHeight>0&&round(r.height)/t.offsetHeight||1);var o=isElement$1(t)?getWindow(t):window,s=o.visualViewport,u=!isLayoutViewport()&&a,c=(r.left+(u&&s?s.offsetLeft:0))/n,l=(r.top+(u&&s?s.offsetTop:0))/i,p=r.width/n,v=r.height/i;return{width:p,height:v,top:l,right:c+p,bottom:l+v,left:c,x:c,y:l}}function getLayoutRect(t){var e=getBoundingClientRect(t),a=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-a)<=1&&(a=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:a,height:r}}function contains(t,e){var a=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(a&&isShadowRoot(a)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function getComputedStyle$1(t){return getWindow(t).getComputedStyle(t)}function isTableElement(t){return["table","td","th"].indexOf(getNodeName(t))>=0}function getDocumentElement(t){return((isElement$1(t)?t.ownerDocument:t.document)||window.document).documentElement}function getParentNode(t){return getNodeName(t)==="html"?t:t.assignedSlot||t.parentNode||(isShadowRoot(t)?t.host:null)||getDocumentElement(t)}function getTrueOffsetParent(t){return!isHTMLElement(t)||getComputedStyle$1(t).position==="fixed"?null:t.offsetParent}function getContainingBlock(t){var e=/firefox/i.test(getUAString()),a=/Trident/i.test(getUAString());if(a&&isHTMLElement(t)){var r=getComputedStyle$1(t);if(r.position==="fixed")return null}var n=getParentNode(t);for(isShadowRoot(n)&&(n=n.host);isHTMLElement(n)&&["html","body"].indexOf(getNodeName(n))<0;){var i=getComputedStyle$1(n);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return n;n=n.parentNode}return null}function getOffsetParent(t){for(var e=getWindow(t),a=getTrueOffsetParent(t);a&&isTableElement(a)&&getComputedStyle$1(a).position==="static";)a=getTrueOffsetParent(a);return a&&(getNodeName(a)==="html"||getNodeName(a)==="body"&&getComputedStyle$1(a).position==="static")?e:a||getContainingBlock(t)||e}function getMainAxisFromPlacement(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function within$1(t,e,a){return max(t,min(e,a))}function withinMaxClamp(t,e,a){var r=within$1(t,e,a);return r>a?a:r}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(t){return Object.assign({},getFreshSideObject(),t)}function expandToHashMap(t,e){return e.reduce(function(a,r){return a[r]=t,a},{})}var toPaddingObject=function t(e,a){return e=typeof e=="function"?e(Object.assign({},a.rects,{placement:a.placement})):e,mergePaddingObject(typeof e!="number"?e:expandToHashMap(e,basePlacements))};function arrow(t){var e,a=t.state,r=t.name,n=t.options,i=a.elements.arrow,o=a.modifiersData.popperOffsets,s=getBasePlacement(a.placement),u=getMainAxisFromPlacement(s),c=[left,right].indexOf(s)>=0,l=c?"height":"width";if(!(!i||!o)){var p=toPaddingObject(n.padding,a),v=getLayoutRect(i),S=u==="y"?top:left,T=u==="y"?bottom:right,O=a.rects.reference[l]+a.rects.reference[u]-o[u]-a.rects.popper[l],M=o[u]-a.rects.reference[u],C=getOffsetParent(i),w=C?u==="y"?C.clientHeight||0:C.clientWidth||0:0,L=O/2-M/2,D=p[S],R=w-v[l]-p[T],F=w/2-v[l]/2+L,W=within$1(D,F,R),d=u;a.modifiersData[r]=(e={},e[d]=W,e.centerOffset=W-F,e)}}function effect$1(t){var e=t.state,a=t.options,r=a.element,n=r===void 0?"[data-popper-arrow]":r;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||contains(e.elements.popper,n)&&(e.elements.arrow=n))}const arrow$1={name:"arrow",enabled:!0,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(t){return t.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(t,e){var a=t.x,r=t.y,n=e.devicePixelRatio||1;return{x:round(a*n)/n||0,y:round(r*n)/n||0}}function mapToStyles(t){var e,a=t.popper,r=t.popperRect,n=t.placement,i=t.variation,o=t.offsets,s=t.position,u=t.gpuAcceleration,c=t.adaptive,l=t.roundOffsets,p=t.isFixed,v=o.x,S=v===void 0?0:v,T=o.y,O=T===void 0?0:T,M=typeof l=="function"?l({x:S,y:O}):{x:S,y:O};S=M.x,O=M.y;var C=o.hasOwnProperty("x"),w=o.hasOwnProperty("y"),L=left,D=top,R=window;if(c){var F=getOffsetParent(a),W="clientHeight",d="clientWidth";if(F===getWindow(a)&&(F=getDocumentElement(a),getComputedStyle$1(F).position!=="static"&&s==="absolute"&&(W="scrollHeight",d="scrollWidth")),F=F,n===top||(n===left||n===right)&&i===end){D=bottom;var m=p&&F===R&&R.visualViewport?R.visualViewport.height:F[W];O-=m-r.height,O*=u?1:-1}if(n===left||(n===top||n===bottom)&&i===end){L=right;var h=p&&F===R&&R.visualViewport?R.visualViewport.width:F[d];S-=h-r.width,S*=u?1:-1}}var _=Object.assign({position:s},c&&unsetSides),b=l===!0?roundOffsetsByDPR({x:S,y:O},getWindow(a)):{x:S,y:O};if(S=b.x,O=b.y,u){var y;return Object.assign({},_,(y={},y[D]=w?"0":"",y[L]=C?"0":"",y.transform=(R.devicePixelRatio||1)<=1?"translate("+S+"px, "+O+"px)":"translate3d("+S+"px, "+O+"px, 0)",y))}return Object.assign({},_,(e={},e[D]=w?O+"px":"",e[L]=C?S+"px":"",e.transform="",e))}function computeStyles(t){var e=t.state,a=t.options,r=a.gpuAcceleration,n=r===void 0?!0:r,i=a.adaptive,o=i===void 0?!0:i,s=a.roundOffsets,u=s===void 0?!0:s,c={placement:getBasePlacement(e.placement),variation:getVariation(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,mapToStyles(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,mapToStyles(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect(t){var e=t.state,a=t.instance,r=t.options,n=r.scroll,i=n===void 0?!0:n,o=r.resize,s=o===void 0?!0:o,u=getWindow(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(l){l.addEventListener("scroll",a.update,passive)}),s&&u.addEventListener("resize",a.update,passive),function(){i&&c.forEach(function(l){l.removeEventListener("scroll",a.update,passive)}),s&&u.removeEventListener("resize",a.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function t(){},effect,data:{}};var hash$1={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(t){return t.replace(/left|right|bottom|top/g,function(e){return hash$1[e]})}var hash={start:"end",end:"start"};function getOppositeVariationPlacement(t){return t.replace(/start|end/g,function(e){return hash[e]})}function getWindowScroll(t){var e=getWindow(t),a=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:a,scrollTop:r}}function getWindowScrollBarX(t){return getBoundingClientRect(getDocumentElement(t)).left+getWindowScroll(t).scrollLeft}function getViewportRect(t,e){var a=getWindow(t),r=getDocumentElement(t),n=a.visualViewport,i=r.clientWidth,o=r.clientHeight,s=0,u=0;if(n){i=n.width,o=n.height;var c=isLayoutViewport();(c||!c&&e==="fixed")&&(s=n.offsetLeft,u=n.offsetTop)}return{width:i,height:o,x:s+getWindowScrollBarX(t),y:u}}function getDocumentRect(t){var e,a=getDocumentElement(t),r=getWindowScroll(t),n=(e=t.ownerDocument)==null?void 0:e.body,i=max(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=max(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),s=-r.scrollLeft+getWindowScrollBarX(t),u=-r.scrollTop;return getComputedStyle$1(n||a).direction==="rtl"&&(s+=max(a.clientWidth,n?n.clientWidth:0)-i),{width:i,height:o,x:s,y:u}}function isScrollParent(t){var e=getComputedStyle$1(t),a=e.overflow,r=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+r)}function getScrollParent(t){return["html","body","#document"].indexOf(getNodeName(t))>=0?t.ownerDocument.body:isHTMLElement(t)&&isScrollParent(t)?t:getScrollParent(getParentNode(t))}function listScrollParents(t,e){var a;e===void 0&&(e=[]);var r=getScrollParent(t),n=r===((a=t.ownerDocument)==null?void 0:a.body),i=getWindow(r),o=n?[i].concat(i.visualViewport||[],isScrollParent(r)?r:[]):r,s=e.concat(o);return n?s:s.concat(listScrollParents(getParentNode(o)))}function rectToClientRect(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function getInnerBoundingClientRect(t,e){var a=getBoundingClientRect(t,!1,e==="fixed");return a.top=a.top+t.clientTop,a.left=a.left+t.clientLeft,a.bottom=a.top+t.clientHeight,a.right=a.left+t.clientWidth,a.width=t.clientWidth,a.height=t.clientHeight,a.x=a.left,a.y=a.top,a}function getClientRectFromMixedType(t,e,a){return e===viewport?rectToClientRect(getViewportRect(t,a)):isElement$1(e)?getInnerBoundingClientRect(e,a):rectToClientRect(getDocumentRect(getDocumentElement(t)))}function getClippingParents(t){var e=listScrollParents(getParentNode(t)),a=["absolute","fixed"].indexOf(getComputedStyle$1(t).position)>=0,r=a&&isHTMLElement(t)?getOffsetParent(t):t;return isElement$1(r)?e.filter(function(n){return isElement$1(n)&&contains(n,r)&&getNodeName(n)!=="body"}):[]}function getClippingRect(t,e,a,r){var n=e==="clippingParents"?getClippingParents(t):[].concat(e),i=[].concat(n,[a]),o=i[0],s=i.reduce(function(u,c){var l=getClientRectFromMixedType(t,c,r);return u.top=max(l.top,u.top),u.right=min(l.right,u.right),u.bottom=min(l.bottom,u.bottom),u.left=max(l.left,u.left),u},getClientRectFromMixedType(t,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function computeOffsets(t){var e=t.reference,a=t.element,r=t.placement,n=r?getBasePlacement(r):null,i=r?getVariation(r):null,o=e.x+e.width/2-a.width/2,s=e.y+e.height/2-a.height/2,u;switch(n){case top:u={x:o,y:e.y-a.height};break;case bottom:u={x:o,y:e.y+e.height};break;case right:u={x:e.x+e.width,y:s};break;case left:u={x:e.x-a.width,y:s};break;default:u={x:e.x,y:e.y}}var c=n?getMainAxisFromPlacement(n):null;if(c!=null){var l=c==="y"?"height":"width";switch(i){case start:u[c]=u[c]-(e[l]/2-a[l]/2);break;case end:u[c]=u[c]+(e[l]/2-a[l]/2);break}}return u}function detectOverflow(t,e){e===void 0&&(e={});var a=e,r=a.placement,n=r===void 0?t.placement:r,i=a.strategy,o=i===void 0?t.strategy:i,s=a.boundary,u=s===void 0?clippingParents:s,c=a.rootBoundary,l=c===void 0?viewport:c,p=a.elementContext,v=p===void 0?popper:p,S=a.altBoundary,T=S===void 0?!1:S,O=a.padding,M=O===void 0?0:O,C=mergePaddingObject(typeof M!="number"?M:expandToHashMap(M,basePlacements)),w=v===popper?reference:popper,L=t.rects.popper,D=t.elements[T?w:v],R=getClippingRect(isElement$1(D)?D:D.contextElement||getDocumentElement(t.elements.popper),u,l,o),F=getBoundingClientRect(t.elements.reference),W=computeOffsets({reference:F,element:L,strategy:"absolute",placement:n}),d=rectToClientRect(Object.assign({},L,W)),m=v===popper?d:F,h={top:R.top-m.top+C.top,bottom:m.bottom-R.bottom+C.bottom,left:R.left-m.left+C.left,right:m.right-R.right+C.right},_=t.modifiersData.offset;if(v===popper&&_){var b=_[n];Object.keys(h).forEach(function(y){var A=[right,bottom].indexOf(y)>=0?1:-1,g=[top,bottom].indexOf(y)>=0?"y":"x";h[y]+=b[g]*A})}return h}function computeAutoPlacement(t,e){e===void 0&&(e={});var a=e,r=a.placement,n=a.boundary,i=a.rootBoundary,o=a.padding,s=a.flipVariations,u=a.allowedAutoPlacements,c=u===void 0?placements:u,l=getVariation(r),p=l?s?variationPlacements:variationPlacements.filter(function(T){return getVariation(T)===l}):basePlacements,v=p.filter(function(T){return c.indexOf(T)>=0});v.length===0&&(v=p);var S=v.reduce(function(T,O){return T[O]=detectOverflow(t,{placement:O,boundary:n,rootBoundary:i,padding:o})[getBasePlacement(O)],T},{});return Object.keys(S).sort(function(T,O){return S[T]-S[O]})}function getExpandedFallbackPlacements(t){if(getBasePlacement(t)===auto)return[];var e=getOppositePlacement(t);return[getOppositeVariationPlacement(t),e,getOppositeVariationPlacement(e)]}function flip(t){var e=t.state,a=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var n=a.mainAxis,i=n===void 0?!0:n,o=a.altAxis,s=o===void 0?!0:o,u=a.fallbackPlacements,c=a.padding,l=a.boundary,p=a.rootBoundary,v=a.altBoundary,S=a.flipVariations,T=S===void 0?!0:S,O=a.allowedAutoPlacements,M=e.options.placement,C=getBasePlacement(M),w=C===M,L=u||(w||!T?[getOppositePlacement(M)]:getExpandedFallbackPlacements(M)),D=[M].concat(L).reduce(function(B,I){return B.concat(getBasePlacement(I)===auto?computeAutoPlacement(e,{placement:I,boundary:l,rootBoundary:p,padding:c,flipVariations:T,allowedAutoPlacements:O}):I)},[]),R=e.rects.reference,F=e.rects.popper,W=new Map,d=!0,m=D[0],h=0;h<D.length;h++){var _=D[h],b=getBasePlacement(_),y=getVariation(_)===start,A=[top,bottom].indexOf(b)>=0,g=A?"width":"height",$=detectOverflow(e,{placement:_,boundary:l,rootBoundary:p,altBoundary:v,padding:c}),E=A?y?right:left:y?bottom:top;R[g]>F[g]&&(E=getOppositePlacement(E));var P=getOppositePlacement(E),k=[];if(i&&k.push($[b]<=0),s&&k.push($[E]<=0,$[P]<=0),k.every(function(B){return B})){m=_,d=!1;break}W.set(_,k)}if(d)for(var N=T?3:1,x=function(I){var V=D.find(function(U){var X=W.get(U);if(X)return X.slice(0,I).every(function(Q){return Q})});if(V)return m=V,"break"},z=N;z>0;z--){var H=x(z);if(H==="break")break}e.placement!==m&&(e.modifiersData[r]._skip=!0,e.placement=m,e.reset=!0)}}const flip$1={name:"flip",enabled:!0,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets(t,e,a){return a===void 0&&(a={x:0,y:0}),{top:t.top-e.height-a.y,right:t.right-e.width+a.x,bottom:t.bottom-e.height+a.y,left:t.left-e.width-a.x}}function isAnySideFullyClipped(t){return[top,right,bottom,left].some(function(e){return t[e]>=0})}function hide(t){var e=t.state,a=t.name,r=e.rects.reference,n=e.rects.popper,i=e.modifiersData.preventOverflow,o=detectOverflow(e,{elementContext:"reference"}),s=detectOverflow(e,{altBoundary:!0}),u=getSideOffsets(o,r),c=getSideOffsets(s,n,i),l=isAnySideFullyClipped(u),p=isAnySideFullyClipped(c);e.modifiersData[a]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":p})}const hide$1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY(t,e,a){var r=getBasePlacement(t),n=[left,top].indexOf(r)>=0?-1:1,i=typeof a=="function"?a(Object.assign({},e,{placement:t})):a,o=i[0],s=i[1];return o=o||0,s=(s||0)*n,[left,right].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function offset(t){var e=t.state,a=t.options,r=t.name,n=a.offset,i=n===void 0?[0,0]:n,o=placements.reduce(function(l,p){return l[p]=distanceAndSkiddingToXY(p,e.rects,i),l},{}),s=o[e.placement],u=s.x,c=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}const offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets(t){var e=t.state,a=t.name;e.modifiersData[a]=computeOffsets({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(t){return t==="x"?"y":"x"}function preventOverflow(t){var e=t.state,a=t.options,r=t.name,n=a.mainAxis,i=n===void 0?!0:n,o=a.altAxis,s=o===void 0?!1:o,u=a.boundary,c=a.rootBoundary,l=a.altBoundary,p=a.padding,v=a.tether,S=v===void 0?!0:v,T=a.tetherOffset,O=T===void 0?0:T,M=detectOverflow(e,{boundary:u,rootBoundary:c,padding:p,altBoundary:l}),C=getBasePlacement(e.placement),w=getVariation(e.placement),L=!w,D=getMainAxisFromPlacement(C),R=getAltAxis(D),F=e.modifiersData.popperOffsets,W=e.rects.reference,d=e.rects.popper,m=typeof O=="function"?O(Object.assign({},e.rects,{placement:e.placement})):O,h=typeof m=="number"?{mainAxis:m,altAxis:m}:Object.assign({mainAxis:0,altAxis:0},m),_=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,b={x:0,y:0};if(F){if(i){var y,A=D==="y"?top:left,g=D==="y"?bottom:right,$=D==="y"?"height":"width",E=F[D],P=E+M[A],k=E-M[g],N=S?-d[$]/2:0,x=w===start?W[$]:d[$],z=w===start?-d[$]:-W[$],H=e.elements.arrow,B=S&&H?getLayoutRect(H):{width:0,height:0},I=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:getFreshSideObject(),V=I[A],U=I[g],X=within$1(0,W[$],B[$]),Q=L?W[$]/2-N-X-V-h.mainAxis:x-X-V-h.mainAxis,ee=L?-W[$]/2+N+X+U+h.mainAxis:z+X+U+h.mainAxis,Y=e.elements.arrow&&getOffsetParent(e.elements.arrow),J=Y?D==="y"?Y.clientTop||0:Y.clientLeft||0:0,q=(y=_==null?void 0:_[D])!=null?y:0,K=E+Q-q-J,G=E+ee-q,re=within$1(S?min(P,K):P,E,S?max(k,G):k);F[D]=re,b[D]=re-E}if(s){var ne,me=D==="x"?top:left,fe=D==="x"?bottom:right,Z=F[R],te=R==="y"?"height":"width",ie=Z+M[me],oe=Z-M[fe],ae=[top,left].indexOf(C)!==-1,se=(ne=_==null?void 0:_[R])!=null?ne:0,ue=ae?ie:Z-W[te]-d[te]-se+h.altAxis,le=ae?Z+W[te]+d[te]-se-h.altAxis:oe,ce=S&&ae?withinMaxClamp(ue,Z,le):within$1(S?ue:ie,Z,S?le:oe);F[R]=ce,b[R]=ce-Z}e.modifiersData[r]=b}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function getNodeScroll(t){return t===getWindow(t)||!isHTMLElement(t)?getWindowScroll(t):getHTMLElementScroll(t)}function isElementScaled(t){var e=t.getBoundingClientRect(),a=round(e.width)/t.offsetWidth||1,r=round(e.height)/t.offsetHeight||1;return a!==1||r!==1}function getCompositeRect(t,e,a){a===void 0&&(a=!1);var r=isHTMLElement(e),n=isHTMLElement(e)&&isElementScaled(e),i=getDocumentElement(e),o=getBoundingClientRect(t,n,a),s={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!a)&&((getNodeName(e)!=="body"||isScrollParent(i))&&(s=getNodeScroll(e)),isHTMLElement(e)?(u=getBoundingClientRect(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):i&&(u.x=getWindowScrollBarX(i))),{x:o.left+s.scrollLeft-u.x,y:o.top+s.scrollTop-u.y,width:o.width,height:o.height}}function order(t){var e=new Map,a=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function n(i){a.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(s){if(!a.has(s)){var u=e.get(s);u&&n(u)}}),r.push(i)}return t.forEach(function(i){a.has(i.name)||n(i)}),r}function orderModifiers(t){var e=order(t);return modifierPhases.reduce(function(a,r){return a.concat(e.filter(function(n){return n.phase===r}))},[])}function debounce(t){var e;return function(){return e||(e=new Promise(function(a){Promise.resolve().then(function(){e=void 0,a(t())})})),e}}function mergeByName(t){var e=t.reduce(function(a,r){var n=a[r.name];return a[r.name]=n?Object.assign({},n,r,{options:Object.assign({},n.options,r.options),data:Object.assign({},n.data,r.data)}):r,a},{});return Object.keys(e).map(function(a){return e[a]})}var DEFAULT_OPTIONS$1={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var t=arguments.length,e=new Array(t),a=0;a<t;a++)e[a]=arguments[a];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function popperGenerator(t){t===void 0&&(t={});var e=t,a=e.defaultModifiers,r=a===void 0?[]:a,n=e.defaultOptions,i=n===void 0?DEFAULT_OPTIONS$1:n;return function(s,u,c){c===void 0&&(c=i);var l={placement:"bottom",orderedModifiers:[],options:Object.assign({},DEFAULT_OPTIONS$1,i),modifiersData:{},elements:{reference:s,popper:u},attributes:{},styles:{}},p=[],v=!1,S={state:l,setOptions:function(C){var w=typeof C=="function"?C(l.options):C;O(),l.options=Object.assign({},i,l.options,w),l.scrollParents={reference:isElement$1(s)?listScrollParents(s):s.contextElement?listScrollParents(s.contextElement):[],popper:listScrollParents(u)};var L=orderModifiers(mergeByName([].concat(r,l.options.modifiers)));return l.orderedModifiers=L.filter(function(D){return D.enabled}),T(),S.update()},forceUpdate:function(){if(!v){var C=l.elements,w=C.reference,L=C.popper;if(areValidElements(w,L)){l.rects={reference:getCompositeRect(w,getOffsetParent(L),l.options.strategy==="fixed"),popper:getLayoutRect(L)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach(function(h){return l.modifiersData[h.name]=Object.assign({},h.data)});for(var D=0;D<l.orderedModifiers.length;D++){if(l.reset===!0){l.reset=!1,D=-1;continue}var R=l.orderedModifiers[D],F=R.fn,W=R.options,d=W===void 0?{}:W,m=R.name;typeof F=="function"&&(l=F({state:l,options:d,name:m,instance:S})||l)}}}},update:debounce(function(){return new Promise(function(M){S.forceUpdate(),M(l)})}),destroy:function(){O(),v=!0}};if(!areValidElements(s,u))return S;S.setOptions(c).then(function(M){!v&&c.onFirstUpdate&&c.onFirstUpdate(M)});function T(){l.orderedModifiers.forEach(function(M){var C=M.name,w=M.options,L=w===void 0?{}:w,D=M.effect;if(typeof D=="function"){var R=D({state:l,name:C,instance:S,options:L}),F=function(){};p.push(R||F)}})}function O(){p.forEach(function(M){return M()}),p=[]}return S}}var createPopper$2=popperGenerator(),defaultModifiers$1=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1],createPopper$1=popperGenerator({defaultModifiers:defaultModifiers$1}),defaultModifiers=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$1,flip$1,preventOverflow$1,arrow$1,hide$1],createPopper=popperGenerator({defaultModifiers});const Popper=Object.freeze(Object.defineProperty({__proto__:null,afterMain,afterRead,afterWrite,applyStyles:applyStyles$1,arrow:arrow$1,auto,basePlacements,beforeMain,beforeRead,beforeWrite,bottom,clippingParents,computeStyles:computeStyles$1,createPopper,createPopperBase:createPopper$2,createPopperLite:createPopper$1,detectOverflow,end,eventListeners,flip:flip$1,hide:hide$1,left,main,modifierPhases,offset:offset$1,placements,popper,popperGenerator,popperOffsets:popperOffsets$1,preventOverflow:preventOverflow$1,read,reference,right,start,top,variationPlacements,viewport,write},Symbol.toStringTag,{value:"Module"}));/*!+`:""}`,e),setTimeout(()=>{throw t},0)}var shouldAutoEvaluateFunctions=!0;function dontAutoEvaluateFunctions(t){let e=shouldAutoEvaluateFunctions;shouldAutoEvaluateFunctions=!1;let a=t();return shouldAutoEvaluateFunctions=e,a}function evaluate(t,e,a={}){let r;return evaluateLater(t,e)(n=>r=n,a),r}function evaluateLater(...t){return theEvaluatorFunction(...t)}var theEvaluatorFunction=normalEvaluator;function setEvaluator(t){theEvaluatorFunction=t}function normalEvaluator(t,e){let a={};injectMagics(a,t);let r=[a,...closestDataStack(t)],n=typeof e=="function"?generateEvaluatorFromFunction(r,e):generateEvaluatorFromString(r,e,t);return tryCatch.bind(null,t,e,n)}function generateEvaluatorFromFunction(t,e){return(a=()=>{},{scope:r={},params:n=[]}={})=>{let i=e.apply(mergeProxies([r,...t]),n);runIfTypeOfFunction(a,i)}}var evaluatorMemo={};function generateFunctionFromString(t,e){if(evaluatorMemo[t])return evaluatorMemo[t];let a=Object.getPrototypeOf(async function(){}).constructor,r=/^[\n\s]*if.*\(.*\)/.test(t.trim())||/^(let|const)\s/.test(t.trim())?`(async()=>{ ${t} })()`:t,i=(()=>{try{let o=new a(["__self","scope"],`with (scope) { __self.result = ${r} }; __self.finished = true; return __self.result;`);return Object.defineProperty(o,"name",{value:`[Alpine] ${t}`}),o}catch(o){return handleError(o,e,t),Promise.resolve()}})();return evaluatorMemo[t]=i,i}function generateEvaluatorFromString(t,e,a){let r=generateFunctionFromString(e,a);return(n=()=>{},{scope:i={},params:o=[]}={})=>{r.result=void 0,r.finished=!1;let s=mergeProxies([i,...t]);if(typeof r=="function"){let u=r(r,s).catch(c=>handleError(c,a,e));r.finished?(runIfTypeOfFunction(n,r.result,s,o,a),r.result=void 0):u.then(c=>{runIfTypeOfFunction(n,c,s,o,a)}).catch(c=>handleError(c,a,e)).finally(()=>r.result=void 0)}}}function runIfTypeOfFunction(t,e,a,r,n){if(shouldAutoEvaluateFunctions&&typeof e=="function"){let i=e.apply(a,r);i instanceof Promise?i.then(o=>runIfTypeOfFunction(t,o,a,r)).catch(o=>handleError(o,n,e)):t(i)}else typeof e=="object"&&e instanceof Promise?e.then(i=>t(i)):t(e)}var prefixAsString="x-";function prefix(t=""){return prefixAsString+t}function setPrefix(t){prefixAsString=t}var directiveHandlers={};function directive(t,e){return directiveHandlers[t]=e,{before(a){if(!directiveHandlers[a]){console.warn("Cannot find directive `${directive}`. `${name}` will use the default order of execution");return}const r=directiveOrder.indexOf(a);directiveOrder.splice(r>=0?r:directiveOrder.indexOf("DEFAULT"),0,t)}}}function directives(t,e,a){if(e=Array.from(e),t._x_virtualDirectives){let i=Object.entries(t._x_virtualDirectives).map(([s,u])=>({name:s,value:u})),o=attributesOnly(i);i=i.map(s=>o.find(u=>u.name===s.name)?{name:`x-bind:${s.name}`,value:`"${s.value}"`}:s),e=e.concat(i)}let r={};return e.map(toTransformedAttributes((i,o)=>r[i]=o)).filter(outNonAlpineAttributes).map(toParsedDirectives(r,a)).sort(byPriority).map(i=>getDirectiveHandler(t,i))}function attributesOnly(t){return Array.from(t).map(toTransformedAttributes()).filter(e=>!outNonAlpineAttributes(e))}var isDeferringHandlers=!1,directiveHandlerStacks=new Map,currentHandlerStackKey=Symbol();function deferHandlingDirectives(t){isDeferringHandlers=!0;let e=Symbol();currentHandlerStackKey=e,directiveHandlerStacks.set(e,[]);let a=()=>{for(;directiveHandlerStacks.get(e).length;)directiveHandlerStacks.get(e).shift()();directiveHandlerStacks.delete(e)},r=()=>{isDeferringHandlers=!1,a()};t(a),r()}function getElementBoundUtilities(t){let e=[],a=s=>e.push(s),[r,n]=elementBoundEffect(t);return e.push(n),[{Alpine:alpine_default,effect:r,cleanup:a,evaluateLater:evaluateLater.bind(evaluateLater,t),evaluate:evaluate.bind(evaluate,t)},()=>e.forEach(s=>s())]}function getDirectiveHandler(t,e){let a=()=>{},r=directiveHandlers[e.type]||a,[n,i]=getElementBoundUtilities(t);onAttributeRemoved(t,e.original,i);let o=()=>{t._x_ignore||t._x_ignoreSelf||(r.inline&&r.inline(t,e,n),r=r.bind(r,t,e,n),isDeferringHandlers?directiveHandlerStacks.get(currentHandlerStackKey).push(r):r())};return o.runCleanups=i,o}var startingWith=(t,e)=>({name:a,value:r})=>(a.startsWith(t)&&(a=a.replace(t,e)),{name:a,value:r}),into=t=>t;function toTransformedAttributes(t=()=>{}){return({name:e,value:a})=>{let{name:r,value:n}=attributeTransformers.reduce((i,o)=>o(i),{name:e,value:a});return r!==e&&t(r,e),{name:r,value:n}}}var attributeTransformers=[];function mapAttributes(t){attributeTransformers.push(t)}function outNonAlpineAttributes({name:t}){return alpineAttributeRegex().test(t)}var alpineAttributeRegex=()=>new RegExp(`^${prefixAsString}([^:^.]+)\\b`);function toParsedDirectives(t,e){return({name:a,value:r})=>{let n=a.match(alpineAttributeRegex()),i=a.match(/:([a-zA-Z0-9\-_:]+)/),o=a.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],s=e||t[a]||a;return{type:n?n[1]:null,value:i?i[1]:null,modifiers:o.map(u=>u.replace(".","")),expression:r,original:s}}}var DEFAULT="DEFAULT",directiveOrder=["ignore","ref","data","id","bind","init","for","model","modelable","transition","show","if",DEFAULT,"teleport"];function byPriority(t,e){let a=directiveOrder.indexOf(t.type)===-1?DEFAULT:t.type,r=directiveOrder.indexOf(e.type)===-1?DEFAULT:e.type;return directiveOrder.indexOf(a)-directiveOrder.indexOf(r)}var tickStack=[],isHolding=!1;function nextTick(t=()=>{}){return queueMicrotask(()=>{isHolding||setTimeout(()=>{releaseNextTicks()})}),new Promise(e=>{tickStack.push(()=>{t(),e()})})}function releaseNextTicks(){for(isHolding=!1;tickStack.length;)tickStack.shift()()}function holdNextTicks(){isHolding=!0}function setClasses(t,e){return Array.isArray(e)?setClassesFromString(t,e.join(" ")):typeof e=="object"&&e!==null?setClassesFromObject(t,e):typeof e=="function"?setClasses(t,e()):setClassesFromString(t,e)}function setClassesFromString(t,e){let a=n=>n.split(" ").filter(i=>!t.classList.contains(i)).filter(Boolean),r=n=>(t.classList.add(...n),()=>{t.classList.remove(...n)});return e=e===!0?e="":e||"",r(a(e))}function setClassesFromObject(t,e){let a=s=>s.split(" ").filter(Boolean),r=Object.entries(e).flatMap(([s,u])=>u?a(s):!1).filter(Boolean),n=Object.entries(e).flatMap(([s,u])=>u?!1:a(s)).filter(Boolean),i=[],o=[];return n.forEach(s=>{t.classList.contains(s)&&(t.classList.remove(s),o.push(s))}),r.forEach(s=>{t.classList.contains(s)||(t.classList.add(s),i.push(s))}),()=>{o.forEach(s=>t.classList.add(s)),i.forEach(s=>t.classList.remove(s))}}function setStyles(t,e){return typeof e=="object"&&e!==null?setStylesFromObject(t,e):setStylesFromString(t,e)}function setStylesFromObject(t,e){let a={};return Object.entries(e).forEach(([r,n])=>{a[r]=t.style[r],r.startsWith("--")||(r=kebabCase(r)),t.style.setProperty(r,n)}),setTimeout(()=>{t.style.length===0&&t.removeAttribute("style")}),()=>{setStyles(t,a)}}function setStylesFromString(t,e){let a=t.getAttribute("style",e);return t.setAttribute("style",e),()=>{t.setAttribute("style",a||"")}}function kebabCase(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function once(t,e=()=>{}){let a=!1;return function(){a?e.apply(this,arguments):(a=!0,t.apply(this,arguments))}}directive("transition",(t,{value:e,modifiers:a,expression:r},{evaluate:n})=>{typeof r=="function"&&(r=n(r)),r!==!1&&(!r||typeof r=="boolean"?registerTransitionsFromHelper(t,a,e):registerTransitionsFromClassString(t,r,e))});function registerTransitionsFromClassString(t,e,a){registerTransitionObject(t,setClasses,""),{enter:n=>{t._x_transition.enter.during=n},"enter-start":n=>{t._x_transition.enter.start=n},"enter-end":n=>{t._x_transition.enter.end=n},leave:n=>{t._x_transition.leave.during=n},"leave-start":n=>{t._x_transition.leave.start=n},"leave-end":n=>{t._x_transition.leave.end=n}}[a](e)}function registerTransitionsFromHelper(t,e,a){registerTransitionObject(t,setStyles);let r=!e.includes("in")&&!e.includes("out")&&!a,n=r||e.includes("in")||["enter"].includes(a),i=r||e.includes("out")||["leave"].includes(a);e.includes("in")&&!r&&(e=e.filter((C,w)=>w<e.indexOf("out"))),e.includes("out")&&!r&&(e=e.filter((C,w)=>w>e.indexOf("out")));let o=!e.includes("opacity")&&!e.includes("scale"),s=o||e.includes("opacity"),u=o||e.includes("scale"),c=s?0:1,l=u?modifierValue(e,"scale",95)/100:1,p=modifierValue(e,"delay",0)/1e3,v=modifierValue(e,"origin","center"),S="opacity, transform",T=modifierValue(e,"duration",150)/1e3,O=modifierValue(e,"duration",75)/1e3,M="cubic-bezier(0.4, 0.0, 0.2, 1)";n&&(t._x_transition.enter.during={transformOrigin:v,transitionDelay:`${p}s`,transitionProperty:S,transitionDuration:`${T}s`,transitionTimingFunction:M},t._x_transition.enter.start={opacity:c,transform:`scale(${l})`},t._x_transition.enter.end={opacity:1,transform:"scale(1)"}),i&&(t._x_transition.leave.during={transformOrigin:v,transitionDelay:`${p}s`,transitionProperty:S,transitionDuration:`${O}s`,transitionTimingFunction:M},t._x_transition.leave.start={opacity:1,transform:"scale(1)"},t._x_transition.leave.end={opacity:c,transform:`scale(${l})`})}function registerTransitionObject(t,e,a={}){t._x_transition||(t._x_transition={enter:{during:a,start:a,end:a},leave:{during:a,start:a,end:a},in(r=()=>{},n=()=>{}){transition(t,e,{during:this.enter.during,start:this.enter.start,end:this.enter.end},r,n)},out(r=()=>{},n=()=>{}){transition(t,e,{during:this.leave.during,start:this.leave.start,end:this.leave.end},r,n)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(t,e,a,r){const n=document.visibilityState==="visible"?requestAnimationFrame:setTimeout;let i=()=>n(a);if(e){t._x_transition&&(t._x_transition.enter||t._x_transition.leave)?t._x_transition.enter&&(Object.entries(t._x_transition.enter.during).length||Object.entries(t._x_transition.enter.start).length||Object.entries(t._x_transition.enter.end).length)?t._x_transition.in(a):i():t._x_transition?t._x_transition.in(a):i();return}t._x_hidePromise=t._x_transition?new Promise((o,s)=>{t._x_transition.out(()=>{},()=>o(r)),t._x_transitioning.beforeCancel(()=>s({isFromCancelledTransition:!0}))}):Promise.resolve(r),queueMicrotask(()=>{let o=closestHide(t);o?(o._x_hideChildren||(o._x_hideChildren=[]),o._x_hideChildren.push(t)):n(()=>{let s=u=>{let c=Promise.all([u._x_hidePromise,...(u._x_hideChildren||[]).map(s)]).then(([l])=>l());return delete u._x_hidePromise,delete u._x_hideChildren,c};s(t).catch(u=>{if(!u.isFromCancelledTransition)throw u})})})};function closestHide(t){let e=t.parentNode;if(e)return e._x_hidePromise?e:closestHide(e)}function transition(t,e,{during:a,start:r,end:n}={},i=()=>{},o=()=>{}){if(t._x_transitioning&&t._x_transitioning.cancel(),Object.keys(a).length===0&&Object.keys(r).length===0&&Object.keys(n).length===0){i(),o();return}let s,u,c;performTransition(t,{start(){s=e(t,r)},during(){u=e(t,a)},before:i,end(){s(),c=e(t,n)},after:o,cleanup(){u(),c()}})}function performTransition(t,e){let a,r,n,i=once(()=>{mutateDom(()=>{a=!0,r||e.before(),n||(e.end(),releaseNextTicks()),e.after(),t.isConnected&&e.cleanup(),delete t._x_transitioning})});t._x_transitioning={beforeCancels:[],beforeCancel(o){this.beforeCancels.push(o)},cancel:once(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();i()}),finish:i},mutateDom(()=>{e.start(),e.during()}),holdNextTicks(),requestAnimationFrame(()=>{if(a)return;let o=Number(getComputedStyle(t).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,s=Number(getComputedStyle(t).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;o===0&&(o=Number(getComputedStyle(t).animationDuration.replace("s",""))*1e3),mutateDom(()=>{e.before()}),r=!0,requestAnimationFrame(()=>{a||(mutateDom(()=>{e.end()}),releaseNextTicks(),setTimeout(t._x_transitioning.finish,o+s),n=!0)})})}function modifierValue(t,e,a){if(t.indexOf(e)===-1)return a;const r=t[t.indexOf(e)+1];if(!r||e==="scale"&&isNaN(r))return a;if(e==="duration"||e==="delay"){let n=r.match(/([0-9]+)ms/);if(n)return n[1]}return e==="origin"&&["top","right","left","center","bottom"].includes(t[t.indexOf(e)+2])?[r,t[t.indexOf(e)+2]].join(" "):r}var isCloning=!1;function skipDuringClone(t,e=()=>{}){return(...a)=>isCloning?e(...a):t(...a)}function onlyDuringClone(t){return(...e)=>isCloning&&t(...e)}function cloneNode(t,e){t._x_dataStack&&(e._x_dataStack=t._x_dataStack,e.setAttribute("data-has-alpine-state",!0)),isCloning=!0,dontRegisterReactiveSideEffects(()=>{initTree(e,(a,r)=>{r(a,()=>{})})}),isCloning=!1}var isCloningLegacy=!1;function clone$1(t,e){e._x_dataStack||(e._x_dataStack=t._x_dataStack),isCloning=!0,isCloningLegacy=!0,dontRegisterReactiveSideEffects(()=>{cloneTree(e)}),isCloning=!1,isCloningLegacy=!1}function cloneTree(t){let e=!1;initTree(t,(r,n)=>{walk(r,(i,o)=>{if(e&&isRoot(i))return o();e=!0,n(i,o)})})}function dontRegisterReactiveSideEffects(t){let e=effect$3;overrideEffect((a,r)=>{let n=e(a);return release(n),()=>{}}),t(),overrideEffect(e)}function shouldSkipRegisteringDataDuringClone(t){return isCloning?isCloningLegacy?!0:t.hasAttribute("data-has-alpine-state"):!1}function bind(t,e,a,r=[]){switch(t._x_bindings||(t._x_bindings=reactive({})),t._x_bindings[e]=a,e=r.includes("camel")?camelCase$2(e):e,e){case"value":bindInputValue(t,a);break;case"style":bindStyles(t,a);break;case"class":bindClasses(t,a);break;case"selected":case"checked":bindAttributeAndProperty(t,e,a);break;default:bindAttribute(t,e,a);break}}function bindInputValue(t,e){if(t.type==="radio")t.attributes.value===void 0&&(t.value=e),window.fromModel&&(t.checked=checkedAttrLooseCompare(t.value,e));else if(t.type==="checkbox")Number.isInteger(e)?t.value=e:!Array.isArray(e)&&typeof e!="boolean"&&![null,void 0].includes(e)?t.value=String(e):Array.isArray(e)?t.checked=e.some(a=>checkedAttrLooseCompare(a,t.value)):t.checked=!!e;else if(t.tagName==="SELECT")updateSelect(t,e);else{if(t.value===e)return;t.value=e===void 0?"":e}}function bindClasses(t,e){t._x_undoAddedClasses&&t._x_undoAddedClasses(),t._x_undoAddedClasses=setClasses(t,e)}function bindStyles(t,e){t._x_undoAddedStyles&&t._x_undoAddedStyles(),t._x_undoAddedStyles=setStyles(t,e)}function bindAttributeAndProperty(t,e,a){bindAttribute(t,e,a),setPropertyIfChanged(t,e,a)}function bindAttribute(t,e,a){[null,void 0,!1].includes(a)&&attributeShouldntBePreservedIfFalsy(e)?t.removeAttribute(e):(isBooleanAttr(e)&&(a=e),setIfChanged(t,e,a))}function setIfChanged(t,e,a){t.getAttribute(e)!=a&&t.setAttribute(e,a)}function setPropertyIfChanged(t,e,a){t[e]!==a&&(t[e]=a)}function updateSelect(t,e){const a=[].concat(e).map(r=>r+"");Array.from(t.options).forEach(r=>{r.selected=a.includes(r.value)})}function camelCase$2(t){return t.toLowerCase().replace(/-(\w)/g,(e,a)=>a.toUpperCase())}function checkedAttrLooseCompare(t,e){return t==e}function isBooleanAttr(t){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(t)}function attributeShouldntBePreservedIfFalsy(t){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(t)}function getBinding(t,e,a){return t._x_bindings&&t._x_bindings[e]!==void 0?t._x_bindings[e]:getAttributeBinding(t,e,a)}function extractProp(t,e,a,r=!0){if(t._x_bindings&&t._x_bindings[e]!==void 0)return t._x_bindings[e];if(t._x_inlineBindings&&t._x_inlineBindings[e]!==void 0){let n=t._x_inlineBindings[e];return n.extract=r,dontAutoEvaluateFunctions(()=>evaluate(t,n.expression))}return getAttributeBinding(t,e,a)}function getAttributeBinding(t,e,a){let r=t.getAttribute(e);return r===null?typeof a=="function"?a():a:r===""?!0:isBooleanAttr(e)?!![e,"true"].includes(r):r}function debounce$1(t,e){var a;return function(){var r=this,n=arguments,i=function(){a=null,t.apply(r,n)};clearTimeout(a),a=setTimeout(i,e)}}function throttle(t,e){let a;return function(){let r=this,n=arguments;a||(t.apply(r,n),a=!0,setTimeout(()=>a=!1,e))}}function entangle({get:t,set:e},{get:a,set:r}){let n=!0,i,o=effect$3(()=>{const s=t(),u=a();if(n)r(cloneIfObject(s)),n=!1,i=JSON.stringify(s);else{const c=JSON.stringify(s);c!==i?(r(cloneIfObject(s)),i=c):(e(cloneIfObject(u)),i=JSON.stringify(u))}JSON.stringify(a()),JSON.stringify(t())});return()=>{release(o)}}function cloneIfObject(t){return typeof t=="object"?JSON.parse(JSON.stringify(t)):t}function plugin(t){(Array.isArray(t)?t:[t]).forEach(a=>a(alpine_default))}var stores={},isReactive=!1;function store(t,e){if(isReactive||(stores=reactive(stores),isReactive=!0),e===void 0)return stores[t];stores[t]=e,typeof e=="object"&&e!==null&&e.hasOwnProperty("init")&&typeof e.init=="function"&&stores[t].init(),initInterceptors2(stores[t])}function getStores(){return stores}var binds={};function bind2(t,e){let a=typeof e!="function"?()=>e:e;return t instanceof Element?applyBindingsObject(t,a()):(binds[t]=a,()=>{})}function injectBindingProviders(t){return Object.entries(binds).forEach(([e,a])=>{Object.defineProperty(t,e,{get(){return(...r)=>a(...r)}})}),t}function applyBindingsObject(t,e,a){let r=[];for(;r.length;)r.pop()();let n=Object.entries(e).map(([o,s])=>({name:o,value:s})),i=attributesOnly(n);return n=n.map(o=>i.find(s=>s.name===o.name)?{name:`x-bind:${o.name}`,value:`"${o.value}"`}:o),directives(t,n,a).map(o=>{r.push(o.runCleanups),o()}),()=>{for(;r.length;)r.pop()()}}var datas={};function data(t,e){datas[t]=e}function injectDataProviders(t,e){return Object.entries(datas).forEach(([a,r])=>{Object.defineProperty(t,a,{get(){return(...n)=>r.bind(e)(...n)},enumerable:!1})}),t}var Alpine={get reactive(){return reactive},get release(){return release},get effect(){return effect$3},get raw(){return raw},version:"3.13.2",flushAndStopDeferringMutations,dontAutoEvaluateFunctions,disableEffectScheduling,startObservingMutations,stopObservingMutations,setReactivityEngine,onAttributeRemoved,onAttributesAdded,closestDataStack,skipDuringClone,onlyDuringClone,addRootSelector,addInitSelector,addScopeToNode,deferMutations,mapAttributes,evaluateLater,interceptInit,setEvaluator,mergeProxies,extractProp,findClosest,onElRemoved,closestRoot,destroyTree,interceptor,transition,setStyles,mutateDom,directive,entangle,throttle,debounce:debounce$1,evaluate,initTree,nextTick,prefixed:prefix,prefix:setPrefix,plugin,magic,store,start:start$1,clone:clone$1,cloneNode,bound:getBinding,$data:scope,walk,data,bind:bind2},alpine_default=Alpine;function makeMap(t,e){const a=Object.create(null),r=t.split(",");for(let n=0;n<r.length;n++)a[r[n]]=!0;return e?n=>!!a[n.toLowerCase()]:n=>!!a[n]}var EMPTY_OBJ=Object.freeze({}),hasOwnProperty$b=Object.prototype.hasOwnProperty,hasOwn=(t,e)=>hasOwnProperty$b.call(t,e),isArray$b=Array.isArray,isMap=t=>toTypeString(t)==="[object Map]",isString=t=>typeof t=="string",isSymbol$6=t=>typeof t=="symbol",isObject$8=t=>t!==null&&typeof t=="object",objectToString$2=Object.prototype.toString,toTypeString=t=>objectToString$2.call(t),toRawType=t=>toTypeString(t).slice(8,-1),isIntegerKey=t=>isString(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,cacheStringFunction=t=>{const e=Object.create(null);return a=>e[a]||(e[a]=t(a))},capitalize$2=cacheStringFunction(t=>t.charAt(0).toUpperCase()+t.slice(1)),hasChanged=(t,e)=>t!==e&&(t===t||e===e),targetMap=new WeakMap,effectStack=[],activeEffect,ITERATE_KEY=Symbol("iterate"),MAP_KEY_ITERATE_KEY=Symbol("Map key iterate");function isEffect(t){return t&&t._isEffect===!0}function effect2(t,e=EMPTY_OBJ){isEffect(t)&&(t=t.raw);const a=createReactiveEffect(t,e);return e.lazy||a(),a}function stop(t){t.active&&(cleanup(t),t.options.onStop&&t.options.onStop(),t.active=!1)}var uid=0;function createReactiveEffect(t,e){const a=function(){if(!a.active)return t();if(!effectStack.includes(a)){cleanup(a);try{return enableTracking(),effectStack.push(a),activeEffect=a,t()}finally{effectStack.pop(),resetTracking(),activeEffect=effectStack[effectStack.length-1]}}};return a.id=uid++,a.allowRecurse=!!e.allowRecurse,a._isEffect=!0,a.active=!0,a.raw=t,a.deps=[],a.options=e,a}function cleanup(t){const{deps:e}=t;if(e.length){for(let a=0;a<e.length;a++)e[a].delete(t);e.length=0}}var shouldTrack=!0,trackStack=[];function pauseTracking(){trackStack.push(shouldTrack),shouldTrack=!1}function enableTracking(){trackStack.push(shouldTrack),shouldTrack=!0}function resetTracking(){const t=trackStack.pop();shouldTrack=t===void 0?!0:t}function track(t,e,a){if(!shouldTrack||activeEffect===void 0)return;let r=targetMap.get(t);r||targetMap.set(t,r=new Map);let n=r.get(a);n||r.set(a,n=new Set),n.has(activeEffect)||(n.add(activeEffect),activeEffect.deps.push(n),activeEffect.options.onTrack&&activeEffect.options.onTrack({effect:activeEffect,target:t,type:e,key:a}))}function trigger(t,e,a,r,n,i){const o=targetMap.get(t);if(!o)return;const s=new Set,u=l=>{l&&l.forEach(p=>{(p!==activeEffect||p.allowRecurse)&&s.add(p)})};if(e==="clear")o.forEach(u);else if(a==="length"&&isArray$b(t))o.forEach((l,p)=>{(p==="length"||p>=r)&&u(l)});else switch(a!==void 0&&u(o.get(a)),e){case"add":isArray$b(t)?isIntegerKey(a)&&u(o.get("length")):(u(o.get(ITERATE_KEY)),isMap(t)&&u(o.get(MAP_KEY_ITERATE_KEY)));break;case"delete":isArray$b(t)||(u(o.get(ITERATE_KEY)),isMap(t)&&u(o.get(MAP_KEY_ITERATE_KEY)));break;case"set":isMap(t)&&u(o.get(ITERATE_KEY));break}const c=l=>{l.options.onTrigger&&l.options.onTrigger({effect:l,target:t,key:a,type:e,newValue:r,oldValue:n,oldTarget:i}),l.options.scheduler?l.options.scheduler(l):l()};s.forEach(c)}var isNonTrackableKeys=makeMap("__proto__,__v_isRef,__isVue"),builtInSymbols=new Set(Object.getOwnPropertyNames(Symbol).map(t=>Symbol[t]).filter(isSymbol$6)),get2=createGetter(),readonlyGet=createGetter(!0),arrayInstrumentations=createArrayInstrumentations();function createArrayInstrumentations(){const t={};return["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...a){const r=toRaw(this);for(let i=0,o=this.length;i<o;i++)track(r,"get",i+"");const n=r[e](...a);return n===-1||n===!1?r[e](...a.map(toRaw)):n}}),["push","pop","shift","unshift","splice"].forEach(e=>{t[e]=function(...a){pauseTracking();const r=toRaw(this)[e].apply(this,a);return resetTracking(),r}}),t}function createGetter(t=!1,e=!1){return function(r,n,i){if(n==="__v_isReactive")return!t;if(n==="__v_isReadonly")return t;if(n==="__v_raw"&&i===(t?e?shallowReadonlyMap:readonlyMap:e?shallowReactiveMap:reactiveMap).get(r))return r;const o=isArray$b(r);if(!t&&o&&hasOwn(arrayInstrumentations,n))return Reflect.get(arrayInstrumentations,n,i);const s=Reflect.get(r,n,i);return(isSymbol$6(n)?builtInSymbols.has(n):isNonTrackableKeys(n))||(t||track(r,"get",n),e)?s:isRef(s)?!o||!isIntegerKey(n)?s.value:s:isObject$8(s)?t?readonly(s):reactive2(s):s}}var set2=createSetter();function createSetter(t=!1){return function(a,r,n,i){let o=a[r];if(!t&&(n=toRaw(n),o=toRaw(o),!isArray$b(a)&&isRef(o)&&!isRef(n)))return o.value=n,!0;const s=isArray$b(a)&&isIntegerKey(r)?Number(r)<a.length:hasOwn(a,r),u=Reflect.set(a,r,n,i);return a===toRaw(i)&&(s?hasChanged(n,o)&&trigger(a,"set",r,n,o):trigger(a,"add",r,n)),u}}function deleteProperty(t,e){const a=hasOwn(t,e),r=t[e],n=Reflect.deleteProperty(t,e);return n&&a&&trigger(t,"delete",e,void 0,r),n}function has$2(t,e){const a=Reflect.has(t,e);return(!isSymbol$6(e)||!builtInSymbols.has(e))&&track(t,"has",e),a}function ownKeys(t){return track(t,"iterate",isArray$b(t)?"length":ITERATE_KEY),Reflect.ownKeys(t)}var mutableHandlers={get:get2,set:set2,deleteProperty,has:has$2,ownKeys},readonlyHandlers={get:readonlyGet,set(t,e){return console.warn(`Set operation on key "${String(e)}" failed: target is readonly.`,t),!0},deleteProperty(t,e){return console.warn(`Delete operation on key "${String(e)}" failed: target is readonly.`,t),!0}},toReactive=t=>isObject$8(t)?reactive2(t):t,toReadonly=t=>isObject$8(t)?readonly(t):t,toShallow=t=>t,getProto=t=>Reflect.getPrototypeOf(t);function get$1$1(t,e,a=!1,r=!1){t=t.__v_raw;const n=toRaw(t),i=toRaw(e);e!==i&&!a&&track(n,"get",e),!a&&track(n,"get",i);const{has:o}=getProto(n),s=r?toShallow:a?toReadonly:toReactive;if(o.call(n,e))return s(t.get(e));if(o.call(n,i))return s(t.get(i));t!==n&&t.get(e)}function has$1$1(t,e=!1){const a=this.__v_raw,r=toRaw(a),n=toRaw(t);return t!==n&&!e&&track(r,"has",t),!e&&track(r,"has",n),t===n?a.has(t):a.has(t)||a.has(n)}function size(t,e=!1){return t=t.__v_raw,!e&&track(toRaw(t),"iterate",ITERATE_KEY),Reflect.get(t,"size",t)}function add(t){t=toRaw(t);const e=toRaw(this);return getProto(e).has.call(e,t)||(e.add(t),trigger(e,"add",t,t)),this}function set$1$1(t,e){e=toRaw(e);const a=toRaw(this),{has:r,get:n}=getProto(a);let i=r.call(a,t);i?checkIdentityKeys(a,r,t):(t=toRaw(t),i=r.call(a,t));const o=n.call(a,t);return a.set(t,e),i?hasChanged(e,o)&&trigger(a,"set",t,e,o):trigger(a,"add",t,e),this}function deleteEntry(t){const e=toRaw(this),{has:a,get:r}=getProto(e);let n=a.call(e,t);n?checkIdentityKeys(e,a,t):(t=toRaw(t),n=a.call(e,t));const i=r?r.call(e,t):void 0,o=e.delete(t);return n&&trigger(e,"delete",t,void 0,i),o}function clear(){const t=toRaw(this),e=t.size!==0,a=isMap(t)?new Map(t):new Set(t),r=t.clear();return e&&trigger(t,"clear",void 0,void 0,a),r}function createForEach(t,e){return function(r,n){const i=this,o=i.__v_raw,s=toRaw(o),u=e?toShallow:t?toReadonly:toReactive;return!t&&track(s,"iterate",ITERATE_KEY),o.forEach((c,l)=>r.call(n,u(c),u(l),i))}}function createIterableMethod(t,e,a){return function(...r){const n=this.__v_raw,i=toRaw(n),o=isMap(i),s=t==="entries"||t===Symbol.iterator&&o,u=t==="keys"&&o,c=n[t](...r),l=a?toShallow:e?toReadonly:toReactive;return!e&&track(i,"iterate",u?MAP_KEY_ITERATE_KEY:ITERATE_KEY),{next(){const{value:p,done:v}=c.next();return v?{value:p,done:v}:{value:s?[l(p[0]),l(p[1])]:l(p),done:v}},[Symbol.iterator](){return this}}}}function createReadonlyMethod(t){return function(...e){{const a=e[0]?`on key "${e[0]}" `:"";console.warn(`${capitalize$2(t)} operation ${a}failed: target is readonly.`,toRaw(this))}return t==="delete"?!1:this}}function createInstrumentations(){const t={get(i){return get$1$1(this,i)},get size(){return size(this)},has:has$1$1,add,set:set$1$1,delete:deleteEntry,clear,forEach:createForEach(!1,!1)},e={get(i){return get$1$1(this,i,!1,!0)},get size(){return size(this)},has:has$1$1,add,set:set$1$1,delete:deleteEntry,clear,forEach:createForEach(!1,!0)},a={get(i){return get$1$1(this,i,!0)},get size(){return size(this,!0)},has(i){return has$1$1.call(this,i,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!1)},r={get(i){return get$1$1(this,i,!0,!0)},get size(){return size(this,!0)},has(i){return has$1$1.call(this,i,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=createIterableMethod(i,!1,!1),a[i]=createIterableMethod(i,!0,!1),e[i]=createIterableMethod(i,!1,!0),r[i]=createIterableMethod(i,!0,!0)}),[t,a,e,r]}var[mutableInstrumentations,readonlyInstrumentations,shallowInstrumentations,shallowReadonlyInstrumentations]=createInstrumentations();function createInstrumentationGetter(t,e){const a=e?t?shallowReadonlyInstrumentations:shallowInstrumentations:t?readonlyInstrumentations:mutableInstrumentations;return(r,n,i)=>n==="__v_isReactive"?!t:n==="__v_isReadonly"?t:n==="__v_raw"?r:Reflect.get(hasOwn(a,n)&&n in r?a:r,n,i)}var mutableCollectionHandlers={get:createInstrumentationGetter(!1,!1)},readonlyCollectionHandlers={get:createInstrumentationGetter(!0,!1)};function checkIdentityKeys(t,e,a){const r=toRaw(a);if(r!==a&&e.call(t,r)){const n=toRawType(t);console.warn(`Reactive ${n} contains both the raw and reactive versions of the same object${n==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var reactiveMap=new WeakMap,shallowReactiveMap=new WeakMap,readonlyMap=new WeakMap,shallowReadonlyMap=new WeakMap;function targetTypeMap(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function getTargetType(t){return t.__v_skip||!Object.isExtensible(t)?0:targetTypeMap(toRawType(t))}function reactive2(t){return t&&t.__v_isReadonly?t:createReactiveObject(t,!1,mutableHandlers,mutableCollectionHandlers,reactiveMap)}function readonly(t){return createReactiveObject(t,!0,readonlyHandlers,readonlyCollectionHandlers,readonlyMap)}function createReactiveObject(t,e,a,r,n){if(!isObject$8(t))return console.warn(`value cannot be made reactive: ${String(t)}`),t;if(t.__v_raw&&!(e&&t.__v_isReactive))return t;const i=n.get(t);if(i)return i;const o=getTargetType(t);if(o===0)return t;const s=new Proxy(t,o===2?r:a);return n.set(t,s),s}function toRaw(t){return t&&toRaw(t.__v_raw)||t}function isRef(t){return!!(t&&t.__v_isRef===!0)}magic("nextTick",()=>nextTick);magic("dispatch",t=>dispatch.bind(dispatch,t));magic("watch",(t,{evaluateLater:e,effect:a})=>(r,n)=>{let i=e(r),o=!0,s,u=a(()=>i(c=>{JSON.stringify(c),o?s=c:queueMicrotask(()=>{n(c,s),s=c}),o=!1}));t._x_effects.delete(u)});magic("store",getStores);magic("data",t=>scope(t));magic("root",t=>closestRoot(t));magic("refs",t=>(t._x_refs_proxy||(t._x_refs_proxy=mergeProxies(getArrayOfRefObject(t))),t._x_refs_proxy));function getArrayOfRefObject(t){let e=[],a=t;for(;a;)a._x_refs&&e.push(a._x_refs),a=a.parentNode;return e}var globalIdMemo={};function findAndIncrementId(t){return globalIdMemo[t]||(globalIdMemo[t]=0),++globalIdMemo[t]}function closestIdRoot(t,e){return findClosest(t,a=>{if(a._x_ids&&a._x_ids[e])return!0})}function setIdRoot(t,e){t._x_ids||(t._x_ids={}),t._x_ids[e]||(t._x_ids[e]=findAndIncrementId(e))}magic("id",t=>(e,a=null)=>{let r=closestIdRoot(t,e),n=r?r._x_ids[e]:findAndIncrementId(e);return a?`${e}-${n}-${a}`:`${e}-${n}`});magic("el",t=>t);warnMissingPluginMagic("Focus","focus","focus");warnMissingPluginMagic("Persist","persist","persist");function warnMissingPluginMagic(t,e,a){magic(e,r=>warn(`You can't use [$${e}] without first installing the "${t}" plugin here: https://alpinejs.dev/plugins/${a}`,r))}directive("modelable",(t,{expression:e},{effect:a,evaluateLater:r,cleanup:n})=>{let i=r(e),o=()=>{let l;return i(p=>l=p),l},s=r(`${e} = __placeholder`),u=l=>s(()=>{},{scope:{__placeholder:l}}),c=o();u(c),queueMicrotask(()=>{if(!t._x_model)return;t._x_removeModelListeners.default();let l=t._x_model.get,p=t._x_model.set,v=entangle({get(){return l()},set(S){p(S)}},{get(){return o()},set(S){u(S)}});n(v)})});directive("teleport",(t,{modifiers:e,expression:a},{cleanup:r})=>{t.tagName.toLowerCase()!=="template"&&warn("x-teleport can only be used on a <template> tag",t);let n=getTarget(a),i=t.content.cloneNode(!0).firstElementChild;t._x_teleport=i,i._x_teleportBack=t,t.setAttribute("data-teleport-template",!0),i.setAttribute("data-teleport-target",!0),t._x_forwardEvents&&t._x_forwardEvents.forEach(s=>{i.addEventListener(s,u=>{u.stopPropagation(),t.dispatchEvent(new u.constructor(u.type,u))})}),addScopeToNode(i,{},t);let o=(s,u,c)=>{c.includes("prepend")?u.parentNode.insertBefore(s,u):c.includes("append")?u.parentNode.insertBefore(s,u.nextSibling):u.appendChild(s)};mutateDom(()=>{o(i,n,e),initTree(i),i._x_ignore=!0}),t._x_teleportPutBack=()=>{let s=getTarget(a);mutateDom(()=>{o(t._x_teleport,s,e)})},r(()=>i.remove())});var teleportContainerDuringClone=document.createElement("div");function getTarget(t){let e=skipDuringClone(()=>document.querySelector(t),()=>teleportContainerDuringClone)();return e||warn(`Cannot find x-teleport element for selector: "${t}"`),e}var handler=()=>{};handler.inline=(t,{modifiers:e},{cleanup:a})=>{e.includes("self")?t._x_ignoreSelf=!0:t._x_ignore=!0,a(()=>{e.includes("self")?delete t._x_ignoreSelf:delete t._x_ignore})};directive("ignore",handler);directive("effect",(t,{expression:e},{effect:a})=>a(evaluateLater(t,e)));function on(t,e,a,r){let n=t,i=u=>r(u),o={},s=(u,c)=>l=>c(u,l);if(a.includes("dot")&&(e=dotSyntax(e)),a.includes("camel")&&(e=camelCase2(e)),a.includes("passive")&&(o.passive=!0),a.includes("capture")&&(o.capture=!0),a.includes("window")&&(n=window),a.includes("document")&&(n=document),a.includes("debounce")){let u=a[a.indexOf("debounce")+1]||"invalid-wait",c=isNumeric$1(u.split("ms")[0])?Number(u.split("ms")[0]):250;i=debounce$1(i,c)}if(a.includes("throttle")){let u=a[a.indexOf("throttle")+1]||"invalid-wait",c=isNumeric$1(u.split("ms")[0])?Number(u.split("ms")[0]):250;i=throttle(i,c)}return a.includes("prevent")&&(i=s(i,(u,c)=>{c.preventDefault(),u(c)})),a.includes("stop")&&(i=s(i,(u,c)=>{c.stopPropagation(),u(c)})),a.includes("self")&&(i=s(i,(u,c)=>{c.target===t&&u(c)})),(a.includes("away")||a.includes("outside"))&&(n=document,i=s(i,(u,c)=>{t.contains(c.target)||c.target.isConnected!==!1&&(t.offsetWidth<1&&t.offsetHeight<1||t._x_isShown!==!1&&u(c))})),a.includes("once")&&(i=s(i,(u,c)=>{u(c),n.removeEventListener(e,i,o)})),i=s(i,(u,c)=>{isKeyEvent(e)&&isListeningForASpecificKeyThatHasntBeenPressed(c,a)||u(c)}),n.addEventListener(e,i,o),()=>{n.removeEventListener(e,i,o)}}function dotSyntax(t){return t.replace(/-/g,".")}function camelCase2(t){return t.toLowerCase().replace(/-(\w)/g,(e,a)=>a.toUpperCase())}function isNumeric$1(t){return!Array.isArray(t)&&!isNaN(t)}function kebabCase2(t){return[" ","_"].includes(t)?t:t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function isKeyEvent(t){return["keydown","keyup"].includes(t)}function isListeningForASpecificKeyThatHasntBeenPressed(t,e){let a=e.filter(i=>!["window","document","prevent","stop","once","capture"].includes(i));if(a.includes("debounce")){let i=a.indexOf("debounce");a.splice(i,isNumeric$1((a[i+1]||"invalid-wait").split("ms")[0])?2:1)}if(a.includes("throttle")){let i=a.indexOf("throttle");a.splice(i,isNumeric$1((a[i+1]||"invalid-wait").split("ms")[0])?2:1)}if(a.length===0||a.length===1&&keyToModifiers(t.key).includes(a[0]))return!1;const n=["ctrl","shift","alt","meta","cmd","super"].filter(i=>a.includes(i));return a=a.filter(i=>!n.includes(i)),!(n.length>0&&n.filter(o=>((o==="cmd"||o==="super")&&(o="meta"),t[`${o}Key`])).length===n.length&&keyToModifiers(t.key).includes(a[0]))}function keyToModifiers(t){if(!t)return[];t=kebabCase2(t);let e={ctrl:"control",slash:"/",space:" ",spacebar:" ",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",equal:"=",minus:"-",underscore:"_"};return e[t]=t,Object.keys(e).map(a=>{if(e[a]===t)return a}).filter(a=>a)}directive("model",(t,{modifiers:e,expression:a},{effect:r,cleanup:n})=>{let i=t;e.includes("parent")&&(i=t.parentNode);let o=evaluateLater(i,a),s;typeof a=="string"?s=evaluateLater(i,`${a} = __placeholder`):typeof a=="function"&&typeof a()=="string"?s=evaluateLater(i,`${a()} = __placeholder`):s=()=>{};let u=()=>{let v;return o(S=>v=S),isGetterSetter(v)?v.get():v},c=v=>{let S;o(T=>S=T),isGetterSetter(S)?S.set(v):s(()=>{},{scope:{__placeholder:v}})};typeof a=="string"&&t.type==="radio"&&mutateDom(()=>{t.hasAttribute("name")||t.setAttribute("name",a)});var l=t.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(t.type)||e.includes("lazy")?"change":"input";let p=isCloning?()=>{}:on(t,l,e,v=>{c(getInputValue(t,e,v,u()))});if(e.includes("fill")&&([null,""].includes(u())||t.type==="checkbox"&&Array.isArray(u()))&&t.dispatchEvent(new Event(l,{})),t._x_removeModelListeners||(t._x_removeModelListeners={}),t._x_removeModelListeners.default=p,n(()=>t._x_removeModelListeners.default()),t.form){let v=on(t.form,"reset",[],S=>{nextTick(()=>t._x_model&&t._x_model.set(t.value))});n(()=>v())}t._x_model={get(){return u()},set(v){c(v)}},t._x_forceModelUpdate=v=>{v===void 0&&typeof a=="string"&&a.match(/\./)&&(v=""),window.fromModel=!0,mutateDom(()=>bind(t,"value",v)),delete window.fromModel},r(()=>{let v=u();e.includes("unintrusive")&&document.activeElement.isSameNode(t)||t._x_forceModelUpdate(v)})});function getInputValue(t,e,a,r){return mutateDom(()=>{if(a instanceof CustomEvent&&a.detail!==void 0)return a.detail!==null&&a.detail!==void 0?a.detail:a.target.value;if(t.type==="checkbox")if(Array.isArray(r)){let n=e.includes("number")?safeParseNumber(a.target.value):a.target.value;return a.target.checked?r.concat([n]):r.filter(i=>!checkedAttrLooseCompare2(i,n))}else return a.target.checked;else{if(t.tagName.toLowerCase()==="select"&&t.multiple)return e.includes("number")?Array.from(a.target.selectedOptions).map(n=>{let i=n.value||n.text;return safeParseNumber(i)}):Array.from(a.target.selectedOptions).map(n=>n.value||n.text);{let n=a.target.value;return e.includes("number")?safeParseNumber(n):e.includes("trim")?n.trim():n}}})}function safeParseNumber(t){let e=t?parseFloat(t):null;return isNumeric2(e)?e:t}function checkedAttrLooseCompare2(t,e){return t==e}function isNumeric2(t){return!Array.isArray(t)&&!isNaN(t)}function isGetterSetter(t){return t!==null&&typeof t=="object"&&typeof t.get=="function"&&typeof t.set=="function"}directive("cloak",t=>queueMicrotask(()=>mutateDom(()=>t.removeAttribute(prefix("cloak")))));addInitSelector(()=>`[${prefix("init")}]`);directive("init",skipDuringClone((t,{expression:e},{evaluate:a})=>typeof e=="string"?!!e.trim()&&a(e,{},!1):a(e,{},!1)));directive("text",(t,{expression:e},{effect:a,evaluateLater:r})=>{let n=r(e);a(()=>{n(i=>{mutateDom(()=>{t.textContent=i})})})});directive("html",(t,{expression:e},{effect:a,evaluateLater:r})=>{let n=r(e);a(()=>{n(i=>{mutateDom(()=>{t.innerHTML=i,t._x_ignoreSelf=!0,initTree(t),delete t._x_ignoreSelf})})})});mapAttributes(startingWith(":",into(prefix("bind:"))));var handler2=(t,{value:e,modifiers:a,expression:r,original:n},{effect:i})=>{if(!e){let s={};injectBindingProviders(s),evaluateLater(t,r)(c=>{applyBindingsObject(t,c,n)},{scope:s});return}if(e==="key")return storeKeyForXFor(t,r);if(t._x_inlineBindings&&t._x_inlineBindings[e]&&t._x_inlineBindings[e].extract)return;let o=evaluateLater(t,r);i(()=>o(s=>{s===void 0&&typeof r=="string"&&r.match(/\./)&&(s=""),mutateDom(()=>bind(t,e,s,a))}))};handler2.inline=(t,{value:e,modifiers:a,expression:r})=>{e&&(t._x_inlineBindings||(t._x_inlineBindings={}),t._x_inlineBindings[e]={expression:r,extract:!1})};directive("bind",handler2);function storeKeyForXFor(t,e){t._x_keyExpression=e}addRootSelector(()=>`[${prefix("data")}]`);directive("data",(t,{expression:e},{cleanup:a})=>{if(shouldSkipRegisteringDataDuringClone(t))return;e=e===""?"{}":e;let r={};injectMagics(r,t);let n={};injectDataProviders(n,r);let i=evaluate(t,e,{scope:n});(i===void 0||i===!0)&&(i={}),injectMagics(i,t);let o=reactive(i);initInterceptors2(o);let s=addScopeToNode(t,o);o.init&&evaluate(t,o.init),a(()=>{o.destroy&&evaluate(t,o.destroy),s()})});directive("show",(t,{modifiers:e,expression:a},{effect:r})=>{let n=evaluateLater(t,a);t._x_doHide||(t._x_doHide=()=>{mutateDom(()=>{t.style.setProperty("display","none",e.includes("important")?"important":void 0)})}),t._x_doShow||(t._x_doShow=()=>{mutateDom(()=>{t.style.length===1&&t.style.display==="none"?t.removeAttribute("style"):t.style.removeProperty("display")})});let i=()=>{t._x_doHide(),t._x_isShown=!1},o=()=>{t._x_doShow(),t._x_isShown=!0},s=()=>setTimeout(o),u=once(p=>p?o():i(),p=>{typeof t._x_toggleAndCascadeWithTransitions=="function"?t._x_toggleAndCascadeWithTransitions(t,p,o,i):p?s():i()}),c,l=!0;r(()=>n(p=>{!l&&p===c||(e.includes("immediate")&&(p?s():i()),u(p),c=p,l=!1)}))});directive("for",(t,{expression:e},{effect:a,cleanup:r})=>{let n=parseForExpression(e),i=evaluateLater(t,n.items),o=evaluateLater(t,t._x_keyExpression||"index");t._x_prevKeys=[],t._x_lookup={},a(()=>loop(t,n,i,o)),r(()=>{Object.values(t._x_lookup).forEach(s=>s.remove()),delete t._x_prevKeys,delete t._x_lookup})});function loop(t,e,a,r){let n=o=>typeof o=="object"&&!Array.isArray(o),i=t;a(o=>{isNumeric3(o)&&o>=0&&(o=Array.from(Array(o).keys(),M=>M+1)),o===void 0&&(o=[]);let s=t._x_lookup,u=t._x_prevKeys,c=[],l=[];if(n(o))o=Object.entries(o).map(([M,C])=>{let w=getIterationScopeVariables(e,C,M,o);r(L=>l.push(L),{scope:{index:M,...w}}),c.push(w)});else for(let M=0;M<o.length;M++){let C=getIterationScopeVariables(e,o[M],M,o);r(w=>l.push(w),{scope:{index:M,...C}}),c.push(C)}let p=[],v=[],S=[],T=[];for(let M=0;M<u.length;M++){let C=u[M];l.indexOf(C)===-1&&S.push(C)}u=u.filter(M=>!S.includes(M));let O="template";for(let M=0;M<l.length;M++){let C=l[M],w=u.indexOf(C);if(w===-1)u.splice(M,0,C),p.push([O,M]);else if(w!==M){let L=u.splice(M,1)[0],D=u.splice(w-1,1)[0];u.splice(M,0,D),u.splice(w,0,L),v.push([L,D])}else T.push(C);O=C}for(let M=0;M<S.length;M++){let C=S[M];s[C]._x_effects&&s[C]._x_effects.forEach(dequeueJob),s[C].remove(),s[C]=null,delete s[C]}for(let M=0;M<v.length;M++){let[C,w]=v[M],L=s[C],D=s[w],R=document.createElement("div");mutateDom(()=>{D||warn('x-for ":key" is undefined or invalid',i),D.after(R),L.after(D),D._x_currentIfEl&&D.after(D._x_currentIfEl),R.before(L),L._x_currentIfEl&&L.after(L._x_currentIfEl),R.remove()}),D._x_refreshXForScope(c[l.indexOf(w)])}for(let M=0;M<p.length;M++){let[C,w]=p[M],L=C==="template"?i:s[C];L._x_currentIfEl&&(L=L._x_currentIfEl);let D=c[w],R=l[w],F=document.importNode(i.content,!0).firstElementChild,W=reactive(D);addScopeToNode(F,W,i),F._x_refreshXForScope=d=>{Object.entries(d).forEach(([m,h])=>{W[m]=h})},mutateDom(()=>{L.after(F),initTree(F)}),typeof R=="object"&&warn("x-for key cannot be an object, it must be a string or an integer",i),s[R]=F}for(let M=0;M<T.length;M++)s[T[M]]._x_refreshXForScope(c[l.indexOf(T[M])]);i._x_prevKeys=l})}function parseForExpression(t){let e=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,a=/^\s*\(|\)\s*$/g,r=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,n=t.match(r);if(!n)return;let i={};i.items=n[2].trim();let o=n[1].replace(a,"").trim(),s=o.match(e);return s?(i.item=o.replace(e,"").trim(),i.index=s[1].trim(),s[2]&&(i.collection=s[2].trim())):i.item=o,i}function getIterationScopeVariables(t,e,a,r){let n={};return/^\[.*\]$/.test(t.item)&&Array.isArray(e)?t.item.replace("[","").replace("]","").split(",").map(o=>o.trim()).forEach((o,s)=>{n[o]=e[s]}):/^\{.*\}$/.test(t.item)&&!Array.isArray(e)&&typeof e=="object"?t.item.replace("{","").replace("}","").split(",").map(o=>o.trim()).forEach(o=>{n[o]=e[o]}):n[t.item]=e,t.index&&(n[t.index]=a),t.collection&&(n[t.collection]=r),n}function isNumeric3(t){return!Array.isArray(t)&&!isNaN(t)}function handler3(){}handler3.inline=(t,{expression:e},{cleanup:a})=>{let r=closestRoot(t);r._x_refs||(r._x_refs={}),r._x_refs[e]=t,a(()=>delete r._x_refs[e])};directive("ref",handler3);directive("if",(t,{expression:e},{effect:a,cleanup:r})=>{t.tagName.toLowerCase()!=="template"&&warn("x-if can only be used on a <template> tag",t);let n=evaluateLater(t,e),i=()=>{if(t._x_currentIfEl)return t._x_currentIfEl;let s=t.content.cloneNode(!0).firstElementChild;return addScopeToNode(s,{},t),mutateDom(()=>{t.after(s),initTree(s)}),t._x_currentIfEl=s,t._x_undoIf=()=>{walk(s,u=>{u._x_effects&&u._x_effects.forEach(dequeueJob)}),s.remove(),delete t._x_currentIfEl},s},o=()=>{t._x_undoIf&&(t._x_undoIf(),delete t._x_undoIf)};a(()=>n(s=>{s?i():o()})),r(()=>t._x_undoIf&&t._x_undoIf())});directive("id",(t,{expression:e},{evaluate:a})=>{a(e).forEach(n=>setIdRoot(t,n))});mapAttributes(startingWith("@",into(prefix("on:"))));directive("on",skipDuringClone((t,{value:e,modifiers:a,expression:r},{cleanup:n})=>{let i=r?evaluateLater(t,r):()=>{};t.tagName.toLowerCase()==="template"&&(t._x_forwardEvents||(t._x_forwardEvents=[]),t._x_forwardEvents.includes(e)||t._x_forwardEvents.push(e));let o=on(t,e,a,s=>{i(()=>{},{scope:{$event:s},params:[s]})});n(()=>o())}));warnMissingPluginDirective("Collapse","collapse","collapse");warnMissingPluginDirective("Intersect","intersect","intersect");warnMissingPluginDirective("Focus","trap","focus");warnMissingPluginDirective("Mask","mask","mask");function warnMissingPluginDirective(t,e,a){directive(e,r=>warn(`You can't use [x-${e}] without first installing the "${t}" plugin here: https://alpinejs.dev/plugins/${a}`,r))}alpine_default.setEvaluator(normalEvaluator);alpine_default.setReactivityEngine({reactive:reactive2,effect:effect2,release:stop,raw:toRaw});var src_default=alpine_default,module_default=src_default,top="top",bottom="bottom",right="right",left="left",auto="auto",basePlacements=[top,bottom,right,left],start="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference="reference",variationPlacements=basePlacements.reduce(function(t,e){return t.concat([e+"-"+start,e+"-"+end])},[]),placements=[].concat(basePlacements,[auto]).reduce(function(t,e){return t.concat([e,e+"-"+start,e+"-"+end])},[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function getNodeName(t){return t?(t.nodeName||"").toLowerCase():null}function getWindow(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function isElement$1(t){var e=getWindow(t).Element;return t instanceof e||t instanceof Element}function isHTMLElement(t){var e=getWindow(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function isShadowRoot(t){if(typeof ShadowRoot>"u")return!1;var e=getWindow(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function applyStyles(t){var e=t.state;Object.keys(e.elements).forEach(function(a){var r=e.styles[a]||{},n=e.attributes[a]||{},i=e.elements[a];!isHTMLElement(i)||!getNodeName(i)||(Object.assign(i.style,r),Object.keys(n).forEach(function(o){var s=n[o];s===!1?i.removeAttribute(o):i.setAttribute(o,s===!0?"":s)}))})}function effect$2(t){var e=t.state,a={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,a.popper),e.styles=a,e.elements.arrow&&Object.assign(e.elements.arrow.style,a.arrow),function(){Object.keys(e.elements).forEach(function(r){var n=e.elements[r],i=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:a[r]),s=o.reduce(function(u,c){return u[c]="",u},{});!isHTMLElement(n)||!getNodeName(n)||(Object.assign(n.style,s),Object.keys(i).forEach(function(u){n.removeAttribute(u)}))})}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(t){return t.split("-")[0]}var max=Math.max,min=Math.min,round=Math.round;function getUAString(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect(t,e,a){e===void 0&&(e=!1),a===void 0&&(a=!1);var r=t.getBoundingClientRect(),n=1,i=1;e&&isHTMLElement(t)&&(n=t.offsetWidth>0&&round(r.width)/t.offsetWidth||1,i=t.offsetHeight>0&&round(r.height)/t.offsetHeight||1);var o=isElement$1(t)?getWindow(t):window,s=o.visualViewport,u=!isLayoutViewport()&&a,c=(r.left+(u&&s?s.offsetLeft:0))/n,l=(r.top+(u&&s?s.offsetTop:0))/i,p=r.width/n,v=r.height/i;return{width:p,height:v,top:l,right:c+p,bottom:l+v,left:c,x:c,y:l}}function getLayoutRect(t){var e=getBoundingClientRect(t),a=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-a)<=1&&(a=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:a,height:r}}function contains(t,e){var a=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(a&&isShadowRoot(a)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function getComputedStyle$1(t){return getWindow(t).getComputedStyle(t)}function isTableElement(t){return["table","td","th"].indexOf(getNodeName(t))>=0}function getDocumentElement(t){return((isElement$1(t)?t.ownerDocument:t.document)||window.document).documentElement}function getParentNode(t){return getNodeName(t)==="html"?t:t.assignedSlot||t.parentNode||(isShadowRoot(t)?t.host:null)||getDocumentElement(t)}function getTrueOffsetParent(t){return!isHTMLElement(t)||getComputedStyle$1(t).position==="fixed"?null:t.offsetParent}function getContainingBlock(t){var e=/firefox/i.test(getUAString()),a=/Trident/i.test(getUAString());if(a&&isHTMLElement(t)){var r=getComputedStyle$1(t);if(r.position==="fixed")return null}var n=getParentNode(t);for(isShadowRoot(n)&&(n=n.host);isHTMLElement(n)&&["html","body"].indexOf(getNodeName(n))<0;){var i=getComputedStyle$1(n);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return n;n=n.parentNode}return null}function getOffsetParent(t){for(var e=getWindow(t),a=getTrueOffsetParent(t);a&&isTableElement(a)&&getComputedStyle$1(a).position==="static";)a=getTrueOffsetParent(a);return a&&(getNodeName(a)==="html"||getNodeName(a)==="body"&&getComputedStyle$1(a).position==="static")?e:a||getContainingBlock(t)||e}function getMainAxisFromPlacement(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function within$1(t,e,a){return max(t,min(e,a))}function withinMaxClamp(t,e,a){var r=within$1(t,e,a);return r>a?a:r}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(t){return Object.assign({},getFreshSideObject(),t)}function expandToHashMap(t,e){return e.reduce(function(a,r){return a[r]=t,a},{})}var toPaddingObject=function t(e,a){return e=typeof e=="function"?e(Object.assign({},a.rects,{placement:a.placement})):e,mergePaddingObject(typeof e!="number"?e:expandToHashMap(e,basePlacements))};function arrow(t){var e,a=t.state,r=t.name,n=t.options,i=a.elements.arrow,o=a.modifiersData.popperOffsets,s=getBasePlacement(a.placement),u=getMainAxisFromPlacement(s),c=[left,right].indexOf(s)>=0,l=c?"height":"width";if(!(!i||!o)){var p=toPaddingObject(n.padding,a),v=getLayoutRect(i),S=u==="y"?top:left,T=u==="y"?bottom:right,O=a.rects.reference[l]+a.rects.reference[u]-o[u]-a.rects.popper[l],M=o[u]-a.rects.reference[u],C=getOffsetParent(i),w=C?u==="y"?C.clientHeight||0:C.clientWidth||0:0,L=O/2-M/2,D=p[S],R=w-v[l]-p[T],F=w/2-v[l]/2+L,W=within$1(D,F,R),d=u;a.modifiersData[r]=(e={},e[d]=W,e.centerOffset=W-F,e)}}function effect$1(t){var e=t.state,a=t.options,r=a.element,n=r===void 0?"[data-popper-arrow]":r;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||contains(e.elements.popper,n)&&(e.elements.arrow=n))}const arrow$1={name:"arrow",enabled:!0,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(t){return t.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(t,e){var a=t.x,r=t.y,n=e.devicePixelRatio||1;return{x:round(a*n)/n||0,y:round(r*n)/n||0}}function mapToStyles(t){var e,a=t.popper,r=t.popperRect,n=t.placement,i=t.variation,o=t.offsets,s=t.position,u=t.gpuAcceleration,c=t.adaptive,l=t.roundOffsets,p=t.isFixed,v=o.x,S=v===void 0?0:v,T=o.y,O=T===void 0?0:T,M=typeof l=="function"?l({x:S,y:O}):{x:S,y:O};S=M.x,O=M.y;var C=o.hasOwnProperty("x"),w=o.hasOwnProperty("y"),L=left,D=top,R=window;if(c){var F=getOffsetParent(a),W="clientHeight",d="clientWidth";if(F===getWindow(a)&&(F=getDocumentElement(a),getComputedStyle$1(F).position!=="static"&&s==="absolute"&&(W="scrollHeight",d="scrollWidth")),F=F,n===top||(n===left||n===right)&&i===end){D=bottom;var m=p&&F===R&&R.visualViewport?R.visualViewport.height:F[W];O-=m-r.height,O*=u?1:-1}if(n===left||(n===top||n===bottom)&&i===end){L=right;var h=p&&F===R&&R.visualViewport?R.visualViewport.width:F[d];S-=h-r.width,S*=u?1:-1}}var _=Object.assign({position:s},c&&unsetSides),b=l===!0?roundOffsetsByDPR({x:S,y:O},getWindow(a)):{x:S,y:O};if(S=b.x,O=b.y,u){var y;return Object.assign({},_,(y={},y[D]=w?"0":"",y[L]=C?"0":"",y.transform=(R.devicePixelRatio||1)<=1?"translate("+S+"px, "+O+"px)":"translate3d("+S+"px, "+O+"px, 0)",y))}return Object.assign({},_,(e={},e[D]=w?O+"px":"",e[L]=C?S+"px":"",e.transform="",e))}function computeStyles(t){var e=t.state,a=t.options,r=a.gpuAcceleration,n=r===void 0?!0:r,i=a.adaptive,o=i===void 0?!0:i,s=a.roundOffsets,u=s===void 0?!0:s,c={placement:getBasePlacement(e.placement),variation:getVariation(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,mapToStyles(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,mapToStyles(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect(t){var e=t.state,a=t.instance,r=t.options,n=r.scroll,i=n===void 0?!0:n,o=r.resize,s=o===void 0?!0:o,u=getWindow(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(l){l.addEventListener("scroll",a.update,passive)}),s&&u.addEventListener("resize",a.update,passive),function(){i&&c.forEach(function(l){l.removeEventListener("scroll",a.update,passive)}),s&&u.removeEventListener("resize",a.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function t(){},effect,data:{}};var hash$1={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(t){return t.replace(/left|right|bottom|top/g,function(e){return hash$1[e]})}var hash={start:"end",end:"start"};function getOppositeVariationPlacement(t){return t.replace(/start|end/g,function(e){return hash[e]})}function getWindowScroll(t){var e=getWindow(t),a=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:a,scrollTop:r}}function getWindowScrollBarX(t){return getBoundingClientRect(getDocumentElement(t)).left+getWindowScroll(t).scrollLeft}function getViewportRect(t,e){var a=getWindow(t),r=getDocumentElement(t),n=a.visualViewport,i=r.clientWidth,o=r.clientHeight,s=0,u=0;if(n){i=n.width,o=n.height;var c=isLayoutViewport();(c||!c&&e==="fixed")&&(s=n.offsetLeft,u=n.offsetTop)}return{width:i,height:o,x:s+getWindowScrollBarX(t),y:u}}function getDocumentRect(t){var e,a=getDocumentElement(t),r=getWindowScroll(t),n=(e=t.ownerDocument)==null?void 0:e.body,i=max(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=max(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),s=-r.scrollLeft+getWindowScrollBarX(t),u=-r.scrollTop;return getComputedStyle$1(n||a).direction==="rtl"&&(s+=max(a.clientWidth,n?n.clientWidth:0)-i),{width:i,height:o,x:s,y:u}}function isScrollParent(t){var e=getComputedStyle$1(t),a=e.overflow,r=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+r)}function getScrollParent(t){return["html","body","#document"].indexOf(getNodeName(t))>=0?t.ownerDocument.body:isHTMLElement(t)&&isScrollParent(t)?t:getScrollParent(getParentNode(t))}function listScrollParents(t,e){var a;e===void 0&&(e=[]);var r=getScrollParent(t),n=r===((a=t.ownerDocument)==null?void 0:a.body),i=getWindow(r),o=n?[i].concat(i.visualViewport||[],isScrollParent(r)?r:[]):r,s=e.concat(o);return n?s:s.concat(listScrollParents(getParentNode(o)))}function rectToClientRect(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function getInnerBoundingClientRect(t,e){var a=getBoundingClientRect(t,!1,e==="fixed");return a.top=a.top+t.clientTop,a.left=a.left+t.clientLeft,a.bottom=a.top+t.clientHeight,a.right=a.left+t.clientWidth,a.width=t.clientWidth,a.height=t.clientHeight,a.x=a.left,a.y=a.top,a}function getClientRectFromMixedType(t,e,a){return e===viewport?rectToClientRect(getViewportRect(t,a)):isElement$1(e)?getInnerBoundingClientRect(e,a):rectToClientRect(getDocumentRect(getDocumentElement(t)))}function getClippingParents(t){var e=listScrollParents(getParentNode(t)),a=["absolute","fixed"].indexOf(getComputedStyle$1(t).position)>=0,r=a&&isHTMLElement(t)?getOffsetParent(t):t;return isElement$1(r)?e.filter(function(n){return isElement$1(n)&&contains(n,r)&&getNodeName(n)!=="body"}):[]}function getClippingRect(t,e,a,r){var n=e==="clippingParents"?getClippingParents(t):[].concat(e),i=[].concat(n,[a]),o=i[0],s=i.reduce(function(u,c){var l=getClientRectFromMixedType(t,c,r);return u.top=max(l.top,u.top),u.right=min(l.right,u.right),u.bottom=min(l.bottom,u.bottom),u.left=max(l.left,u.left),u},getClientRectFromMixedType(t,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function computeOffsets(t){var e=t.reference,a=t.element,r=t.placement,n=r?getBasePlacement(r):null,i=r?getVariation(r):null,o=e.x+e.width/2-a.width/2,s=e.y+e.height/2-a.height/2,u;switch(n){case top:u={x:o,y:e.y-a.height};break;case bottom:u={x:o,y:e.y+e.height};break;case right:u={x:e.x+e.width,y:s};break;case left:u={x:e.x-a.width,y:s};break;default:u={x:e.x,y:e.y}}var c=n?getMainAxisFromPlacement(n):null;if(c!=null){var l=c==="y"?"height":"width";switch(i){case start:u[c]=u[c]-(e[l]/2-a[l]/2);break;case end:u[c]=u[c]+(e[l]/2-a[l]/2);break}}return u}function detectOverflow(t,e){e===void 0&&(e={});var a=e,r=a.placement,n=r===void 0?t.placement:r,i=a.strategy,o=i===void 0?t.strategy:i,s=a.boundary,u=s===void 0?clippingParents:s,c=a.rootBoundary,l=c===void 0?viewport:c,p=a.elementContext,v=p===void 0?popper:p,S=a.altBoundary,T=S===void 0?!1:S,O=a.padding,M=O===void 0?0:O,C=mergePaddingObject(typeof M!="number"?M:expandToHashMap(M,basePlacements)),w=v===popper?reference:popper,L=t.rects.popper,D=t.elements[T?w:v],R=getClippingRect(isElement$1(D)?D:D.contextElement||getDocumentElement(t.elements.popper),u,l,o),F=getBoundingClientRect(t.elements.reference),W=computeOffsets({reference:F,element:L,strategy:"absolute",placement:n}),d=rectToClientRect(Object.assign({},L,W)),m=v===popper?d:F,h={top:R.top-m.top+C.top,bottom:m.bottom-R.bottom+C.bottom,left:R.left-m.left+C.left,right:m.right-R.right+C.right},_=t.modifiersData.offset;if(v===popper&&_){var b=_[n];Object.keys(h).forEach(function(y){var A=[right,bottom].indexOf(y)>=0?1:-1,g=[top,bottom].indexOf(y)>=0?"y":"x";h[y]+=b[g]*A})}return h}function computeAutoPlacement(t,e){e===void 0&&(e={});var a=e,r=a.placement,n=a.boundary,i=a.rootBoundary,o=a.padding,s=a.flipVariations,u=a.allowedAutoPlacements,c=u===void 0?placements:u,l=getVariation(r),p=l?s?variationPlacements:variationPlacements.filter(function(T){return getVariation(T)===l}):basePlacements,v=p.filter(function(T){return c.indexOf(T)>=0});v.length===0&&(v=p);var S=v.reduce(function(T,O){return T[O]=detectOverflow(t,{placement:O,boundary:n,rootBoundary:i,padding:o})[getBasePlacement(O)],T},{});return Object.keys(S).sort(function(T,O){return S[T]-S[O]})}function getExpandedFallbackPlacements(t){if(getBasePlacement(t)===auto)return[];var e=getOppositePlacement(t);return[getOppositeVariationPlacement(t),e,getOppositeVariationPlacement(e)]}function flip(t){var e=t.state,a=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var n=a.mainAxis,i=n===void 0?!0:n,o=a.altAxis,s=o===void 0?!0:o,u=a.fallbackPlacements,c=a.padding,l=a.boundary,p=a.rootBoundary,v=a.altBoundary,S=a.flipVariations,T=S===void 0?!0:S,O=a.allowedAutoPlacements,M=e.options.placement,C=getBasePlacement(M),w=C===M,L=u||(w||!T?[getOppositePlacement(M)]:getExpandedFallbackPlacements(M)),D=[M].concat(L).reduce(function(B,I){return B.concat(getBasePlacement(I)===auto?computeAutoPlacement(e,{placement:I,boundary:l,rootBoundary:p,padding:c,flipVariations:T,allowedAutoPlacements:O}):I)},[]),R=e.rects.reference,F=e.rects.popper,W=new Map,d=!0,m=D[0],h=0;h<D.length;h++){var _=D[h],b=getBasePlacement(_),y=getVariation(_)===start,A=[top,bottom].indexOf(b)>=0,g=A?"width":"height",$=detectOverflow(e,{placement:_,boundary:l,rootBoundary:p,altBoundary:v,padding:c}),E=A?y?right:left:y?bottom:top;R[g]>F[g]&&(E=getOppositePlacement(E));var P=getOppositePlacement(E),k=[];if(i&&k.push($[b]<=0),s&&k.push($[E]<=0,$[P]<=0),k.every(function(B){return B})){m=_,d=!1;break}W.set(_,k)}if(d)for(var N=T?3:1,x=function(I){var V=D.find(function(U){var X=W.get(U);if(X)return X.slice(0,I).every(function(Q){return Q})});if(V)return m=V,"break"},z=N;z>0;z--){var H=x(z);if(H==="break")break}e.placement!==m&&(e.modifiersData[r]._skip=!0,e.placement=m,e.reset=!0)}}const flip$1={name:"flip",enabled:!0,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets(t,e,a){return a===void 0&&(a={x:0,y:0}),{top:t.top-e.height-a.y,right:t.right-e.width+a.x,bottom:t.bottom-e.height+a.y,left:t.left-e.width-a.x}}function isAnySideFullyClipped(t){return[top,right,bottom,left].some(function(e){return t[e]>=0})}function hide(t){var e=t.state,a=t.name,r=e.rects.reference,n=e.rects.popper,i=e.modifiersData.preventOverflow,o=detectOverflow(e,{elementContext:"reference"}),s=detectOverflow(e,{altBoundary:!0}),u=getSideOffsets(o,r),c=getSideOffsets(s,n,i),l=isAnySideFullyClipped(u),p=isAnySideFullyClipped(c);e.modifiersData[a]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":p})}const hide$1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY(t,e,a){var r=getBasePlacement(t),n=[left,top].indexOf(r)>=0?-1:1,i=typeof a=="function"?a(Object.assign({},e,{placement:t})):a,o=i[0],s=i[1];return o=o||0,s=(s||0)*n,[left,right].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function offset(t){var e=t.state,a=t.options,r=t.name,n=a.offset,i=n===void 0?[0,0]:n,o=placements.reduce(function(l,p){return l[p]=distanceAndSkiddingToXY(p,e.rects,i),l},{}),s=o[e.placement],u=s.x,c=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}const offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets(t){var e=t.state,a=t.name;e.modifiersData[a]=computeOffsets({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(t){return t==="x"?"y":"x"}function preventOverflow(t){var e=t.state,a=t.options,r=t.name,n=a.mainAxis,i=n===void 0?!0:n,o=a.altAxis,s=o===void 0?!1:o,u=a.boundary,c=a.rootBoundary,l=a.altBoundary,p=a.padding,v=a.tether,S=v===void 0?!0:v,T=a.tetherOffset,O=T===void 0?0:T,M=detectOverflow(e,{boundary:u,rootBoundary:c,padding:p,altBoundary:l}),C=getBasePlacement(e.placement),w=getVariation(e.placement),L=!w,D=getMainAxisFromPlacement(C),R=getAltAxis(D),F=e.modifiersData.popperOffsets,W=e.rects.reference,d=e.rects.popper,m=typeof O=="function"?O(Object.assign({},e.rects,{placement:e.placement})):O,h=typeof m=="number"?{mainAxis:m,altAxis:m}:Object.assign({mainAxis:0,altAxis:0},m),_=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,b={x:0,y:0};if(F){if(i){var y,A=D==="y"?top:left,g=D==="y"?bottom:right,$=D==="y"?"height":"width",E=F[D],P=E+M[A],k=E-M[g],N=S?-d[$]/2:0,x=w===start?W[$]:d[$],z=w===start?-d[$]:-W[$],H=e.elements.arrow,B=S&&H?getLayoutRect(H):{width:0,height:0},I=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:getFreshSideObject(),V=I[A],U=I[g],X=within$1(0,W[$],B[$]),Q=L?W[$]/2-N-X-V-h.mainAxis:x-X-V-h.mainAxis,ee=L?-W[$]/2+N+X+U+h.mainAxis:z+X+U+h.mainAxis,Y=e.elements.arrow&&getOffsetParent(e.elements.arrow),J=Y?D==="y"?Y.clientTop||0:Y.clientLeft||0:0,q=(y=_==null?void 0:_[D])!=null?y:0,K=E+Q-q-J,G=E+ee-q,re=within$1(S?min(P,K):P,E,S?max(k,G):k);F[D]=re,b[D]=re-E}if(s){var ne,me=D==="x"?top:left,fe=D==="x"?bottom:right,Z=F[R],te=R==="y"?"height":"width",ie=Z+M[me],oe=Z-M[fe],ae=[top,left].indexOf(C)!==-1,se=(ne=_==null?void 0:_[R])!=null?ne:0,ue=ae?ie:Z-W[te]-d[te]-se+h.altAxis,le=ae?Z+W[te]+d[te]-se-h.altAxis:oe,ce=S&&ae?withinMaxClamp(ue,Z,le):within$1(S?ue:ie,Z,S?le:oe);F[R]=ce,b[R]=ce-Z}e.modifiersData[r]=b}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function getNodeScroll(t){return t===getWindow(t)||!isHTMLElement(t)?getWindowScroll(t):getHTMLElementScroll(t)}function isElementScaled(t){var e=t.getBoundingClientRect(),a=round(e.width)/t.offsetWidth||1,r=round(e.height)/t.offsetHeight||1;return a!==1||r!==1}function getCompositeRect(t,e,a){a===void 0&&(a=!1);var r=isHTMLElement(e),n=isHTMLElement(e)&&isElementScaled(e),i=getDocumentElement(e),o=getBoundingClientRect(t,n,a),s={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!a)&&((getNodeName(e)!=="body"||isScrollParent(i))&&(s=getNodeScroll(e)),isHTMLElement(e)?(u=getBoundingClientRect(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):i&&(u.x=getWindowScrollBarX(i))),{x:o.left+s.scrollLeft-u.x,y:o.top+s.scrollTop-u.y,width:o.width,height:o.height}}function order(t){var e=new Map,a=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function n(i){a.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(s){if(!a.has(s)){var u=e.get(s);u&&n(u)}}),r.push(i)}return t.forEach(function(i){a.has(i.name)||n(i)}),r}function orderModifiers(t){var e=order(t);return modifierPhases.reduce(function(a,r){return a.concat(e.filter(function(n){return n.phase===r}))},[])}function debounce(t){var e;return function(){return e||(e=new Promise(function(a){Promise.resolve().then(function(){e=void 0,a(t())})})),e}}function mergeByName(t){var e=t.reduce(function(a,r){var n=a[r.name];return a[r.name]=n?Object.assign({},n,r,{options:Object.assign({},n.options,r.options),data:Object.assign({},n.data,r.data)}):r,a},{});return Object.keys(e).map(function(a){return e[a]})}var DEFAULT_OPTIONS$1={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var t=arguments.length,e=new Array(t),a=0;a<t;a++)e[a]=arguments[a];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function popperGenerator(t){t===void 0&&(t={});var e=t,a=e.defaultModifiers,r=a===void 0?[]:a,n=e.defaultOptions,i=n===void 0?DEFAULT_OPTIONS$1:n;return function(s,u,c){c===void 0&&(c=i);var l={placement:"bottom",orderedModifiers:[],options:Object.assign({},DEFAULT_OPTIONS$1,i),modifiersData:{},elements:{reference:s,popper:u},attributes:{},styles:{}},p=[],v=!1,S={state:l,setOptions:function(C){var w=typeof C=="function"?C(l.options):C;O(),l.options=Object.assign({},i,l.options,w),l.scrollParents={reference:isElement$1(s)?listScrollParents(s):s.contextElement?listScrollParents(s.contextElement):[],popper:listScrollParents(u)};var L=orderModifiers(mergeByName([].concat(r,l.options.modifiers)));return l.orderedModifiers=L.filter(function(D){return D.enabled}),T(),S.update()},forceUpdate:function(){if(!v){var C=l.elements,w=C.reference,L=C.popper;if(areValidElements(w,L)){l.rects={reference:getCompositeRect(w,getOffsetParent(L),l.options.strategy==="fixed"),popper:getLayoutRect(L)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach(function(h){return l.modifiersData[h.name]=Object.assign({},h.data)});for(var D=0;D<l.orderedModifiers.length;D++){if(l.reset===!0){l.reset=!1,D=-1;continue}var R=l.orderedModifiers[D],F=R.fn,W=R.options,d=W===void 0?{}:W,m=R.name;typeof F=="function"&&(l=F({state:l,options:d,name:m,instance:S})||l)}}}},update:debounce(function(){return new Promise(function(M){S.forceUpdate(),M(l)})}),destroy:function(){O(),v=!0}};if(!areValidElements(s,u))return S;S.setOptions(c).then(function(M){!v&&c.onFirstUpdate&&c.onFirstUpdate(M)});function T(){l.orderedModifiers.forEach(function(M){var C=M.name,w=M.options,L=w===void 0?{}:w,D=M.effect;if(typeof D=="function"){var R=D({state:l,name:C,instance:S,options:L}),F=function(){};p.push(R||F)}})}function O(){p.forEach(function(M){return M()}),p=[]}return S}}var createPopper$2=popperGenerator(),defaultModifiers$1=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1],createPopper$1=popperGenerator({defaultModifiers:defaultModifiers$1}),defaultModifiers=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$1,flip$1,preventOverflow$1,arrow$1,hide$1],createPopper=popperGenerator({defaultModifiers});const Popper=Object.freeze(Object.defineProperty({__proto__:null,afterMain,afterRead,afterWrite,applyStyles:applyStyles$1,arrow:arrow$1,auto,basePlacements,beforeMain,beforeRead,beforeWrite,bottom,clippingParents,computeStyles:computeStyles$1,createPopper,createPopperBase:createPopper$2,createPopperLite:createPopper$1,detectOverflow,end,eventListeners,flip:flip$1,hide:hide$1,left,main,modifierPhases,offset:offset$1,placements,popper,popperGenerator,popperOffsets:popperOffsets$1,preventOverflow:preventOverflow$1,read,reference,right,start,top,variationPlacements,viewport,write},Symbol.toStringTag,{value:"Module"}));/*!* Bootstrap v5.3.2 (https://getbootstrap.com/)* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)diff --git a/public/build/manifest.json b/public/build/manifest.jsonindex 81aa9dd0a1..341c9e1ec6 100644--- a/public/build/manifest.json+++ b/public/build/manifest.json@@ -1,7 +1,7 @@{- "_load-translations-9a154502.js": {- "file": "assets/load-translations-9a154502.js",- "integrity": "sha384-itMUG9zYhmhBh14Fji0Z+b58lSGbj9NiOxl9TLL5hBuysuuj5MW45/qYEAoQnTuf"+ "_load-translations-87b32220.js": {+ "file": "assets/load-translations-87b32220.js",+ "integrity": "sha384-LUgquSUz4wVrMfbb+2ydJ62mkgPPdNzpRUho5uNkTiYfVX2htuR3SALdplVf/PkK"},"node_modules/@fortawesome/fontawesome-free/webfonts/fa-brands-400.ttf": {"file": "assets/fa-brands-400-003f1154.ttf",@@ -34,22 +34,22 @@"integrity": "sha384-B73JAwYNSgI4rwb14zwxigHgAkg1Ms+j6+9sJoDpiL11+VW5RjQCLfIh0RVoi0h6"},"resources/assets/v2/pages/dashboard/dashboard.js": {- "file": "assets/dashboard-daa2fdbe.js",+ "file": "assets/dashboard-42661760.js","imports": [- "_load-translations-9a154502.js"+ "_load-translations-87b32220.js"],"isEntry": true,"src": "resources/assets/v2/pages/dashboard/dashboard.js",- "integrity": "sha384-nf4KZ2V1EMO9ibJQVNxubCV1Mu6ZBoHiikFCS4qxGDEb8RgVOrHwiPsYz5IBAN/E"+ "integrity": "sha384-YDUMtay8vqXg8UEhHKPzu4HAobu10REigb/p5ljIF+hGupVods6Vc/wqxUxx0fqy"},"resources/assets/v2/pages/transactions/create.js": {- "file": "assets/create-baf83427.js",+ "file": "assets/create-1321af8a.js","imports": [- "_load-translations-9a154502.js"+ "_load-translations-87b32220.js"],"isEntry": true,"src": "resources/assets/v2/pages/transactions/create.js",- "integrity": "sha384-GOua2oSQz4NG3Qzo673cdZhVsMZflu6vIgRlkZpHK4yqqbpyCoMdLOyQvWUoJpA0"+ "integrity": "sha384-IhP3MrZwa0yb46MNueQyisca3xFP0rXA14CDqZyFuZTj4SWixSkGcMpjxGIBz6QO"},"resources/assets/v2/sass/app.scss": {"file": "assets/app-28a195fd.css",diff --git a/public/v2/i18n/ca_ES.json b/public/v2/i18n/ca_ES.jsonindex 7009729bf4..23f9ad86e5 100644--- a/public/v2/i18n/ca_ES.json+++ b/public/v2/i18n/ca_ES.json@@ -24,9 +24,9 @@"expense_account": "Compte de despeses","revenue_account": "Compte d'ingressos","budget": "Pressupost",- "account_type_Asset account": "Asset account",- "account_type_Expense account": "Expense account",- "account_type_Revenue account": "Revenue account",+ "account_type_Asset account": "Compte d'actius",+ "account_type_Expense account": "Compte de despeses",+ "account_type_Revenue account": "Compte d'ingressos","account_type_Debt": "Deute","account_type_Loan": "Cr\u00e8dit","account_type_Mortgage": "Hipoteca"diff --git a/public/v2/i18n/es_ES.json b/public/v2/i18n/es_ES.jsonindex b4064d230a..4c07d690a1 100644--- a/public/v2/i18n/es_ES.json+++ b/public/v2/i18n/es_ES.json@@ -24,9 +24,9 @@"expense_account": "Cuenta de gastos","revenue_account": "Cuenta de ingresos","budget": "Presupuesto",- "account_type_Asset account": "Asset account",- "account_type_Expense account": "Expense account",- "account_type_Revenue account": "Revenue account",+ "account_type_Asset account": "Cuenta de activos",+ "account_type_Expense account": "Cuenta de gastos",+ "account_type_Revenue account": "Cuenta de ingresos","account_type_Debt": "Deuda","account_type_Loan": "Pr\u00e9stamo","account_type_Mortgage": "Hipoteca"diff --git a/public/v2/i18n/fr_FR.json b/public/v2/i18n/fr_FR.jsonindex cb1e9bc0f0..9ec05893c0 100644--- a/public/v2/i18n/fr_FR.json+++ b/public/v2/i18n/fr_FR.json@@ -24,9 +24,9 @@"expense_account": "Compte de d\u00e9penses","revenue_account": "Compte de recettes","budget": "Budget",- "account_type_Asset account": "Asset account",- "account_type_Expense account": "Expense account",- "account_type_Revenue account": "Revenue account",+ "account_type_Asset account": "Compte d\u2019actif",+ "account_type_Expense account": "Compte de d\u00e9penses",+ "account_type_Revenue account": "Compte de recettes","account_type_Debt": "Dette","account_type_Loan": "Pr\u00eat","account_type_Mortgage": "Pr\u00eat hypoth\u00e9caire"diff --git a/public/v2/i18n/it_IT.json b/public/v2/i18n/it_IT.jsonindex 753645ac5d..b5be69d9a2 100644--- a/public/v2/i18n/it_IT.json+++ b/public/v2/i18n/it_IT.json@@ -9,7 +9,7 @@"paid": "Pagati","unpaid": "Da pagare","default_group_title_name_plain": "ungrouped",- "subscriptions_in_group": "Subscriptions in group \"%{title}\"",+ "subscriptions_in_group": "Abbonamenti nel gruppo \"%{title}\"","subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period","overspent": "Speso troppo","money_flowing_in": "Entrate",diff --git a/public/v2/i18n/ja_JP.json b/public/v2/i18n/ja_JP.jsonindex 689b0f519f..8217259a40 100644--- a/public/v2/i18n/ja_JP.json+++ b/public/v2/i18n/ja_JP.json@@ -24,9 +24,9 @@"expense_account": "\u652f\u51fa\u53e3\u5ea7","revenue_account": "\u53ce\u5165\u53e3\u5ea7","budget": "\u4e88\u7b97",- "account_type_Asset account": "Asset account",- "account_type_Expense account": "Expense account",- "account_type_Revenue account": "Revenue account",+ "account_type_Asset account": "\u8cc7\u7523\u53e3\u5ea7",+ "account_type_Expense account": "\u652f\u51fa\u53e3\u5ea7",+ "account_type_Revenue account": "\u53ce\u5165\u53e3\u5ea7","account_type_Debt": "\u501f\u91d1","account_type_Loan": "\u30ed\u30fc\u30f3","account_type_Mortgage": "\u4f4f\u5b85\u30ed\u30fc\u30f3"diff --git a/public/v2/i18n/pt_BR.json b/public/v2/i18n/pt_BR.jsonindex d8f019a865..41ac2fb3d7 100644--- a/public/v2/i18n/pt_BR.json+++ b/public/v2/i18n/pt_BR.json@@ -24,9 +24,9 @@"expense_account": "Conta de despesas","revenue_account": "Conta de Receitas","budget": "Or\u00e7amento",- "account_type_Asset account": "Asset account",- "account_type_Expense account": "Expense account",- "account_type_Revenue account": "Revenue account",+ "account_type_Asset account": "Conta de ativos",+ "account_type_Expense account": "Conta de despesas",+ "account_type_Revenue account": "Conta de receitas","account_type_Debt": "D\u00edvida","account_type_Loan": "Empr\u00e9stimo","account_type_Mortgage": "Hipoteca"diff --git a/resources/assets/v2/api/v2/model/currency/get.js b/resources/assets/v2/api/v2/model/currency/get.jsnew file mode 100644index 0000000000..576df40041--- /dev/null+++ b/resources/assets/v2/api/v2/model/currency/get.js@@ -0,0 +1,35 @@+/*+ * list.js+ * Copyright (c) 2022 [email protected]+ *+ * This file is part of Firefly III (https://github.com/firefly-iii).+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <https://www.gnu.org/licenses/>.+ */++import {api} from "../../../../boot/axios";+import format from "date-fns/format";++export default class Get {++ /**+ *+ * @param params+ * @returns {Promise<AxiosResponse<any>>}+ */+ list(params) {+ return api.get('/api/v2/currencies', {params: params});+ }++}diff --git a/resources/assets/v2/api/v2/model/piggy-bank/get.js b/resources/assets/v2/api/v2/model/piggy-bank/get.jsindex 9ecf33fff6..22ab0af115 100644--- a/resources/assets/v2/api/v2/model/piggy-bank/get.js+++ b/resources/assets/v2/api/v2/model/piggy-bank/get.js@@ -28,7 +28,7 @@ export default class Get {* @param params* @returns {Promise<AxiosResponse<any>>}*/- get(params) {+ list(params) {return api.get('/api/v2/piggy-banks', {params: params});}diff --git a/resources/assets/v2/api/v2/model/subscription/get.js b/resources/assets/v2/api/v2/model/subscription/get.jsindex af4308c7f4..c66f7bd155 100644--- a/resources/assets/v2/api/v2/model/subscription/get.js+++ b/resources/assets/v2/api/v2/model/subscription/get.js@@ -28,7 +28,7 @@ export default class Get {* @param params* @returns {Promise<AxiosResponse<any>>}*/- get(params) {+ list(params) {return api.get('/api/v2/subscriptions', {params: params});}diff --git a/resources/assets/v2/api/v2/model/transaction/get.js b/resources/assets/v2/api/v2/model/transaction/get.jsindex 45dc7817b6..f7e010637d 100644--- a/resources/assets/v2/api/v2/model/transaction/get.js+++ b/resources/assets/v2/api/v2/model/transaction/get.js@@ -28,7 +28,7 @@ export default class Get {* @param params* @returns {Promise<AxiosResponse<any>>}*/- get(params) {+ list(params) {return api.get('/api/v2/transactions', {params: params});}}diff --git a/resources/assets/v2/pages/dashboard/piggies.js b/resources/assets/v2/pages/dashboard/piggies.jsindex c6058e7c2b..a3001a43c5 100644--- a/resources/assets/v2/pages/dashboard/piggies.js+++ b/resources/assets/v2/pages/dashboard/piggies.js@@ -61,7 +61,7 @@ export default () => ({const end = new Date(window.store.get('end'));const cacheKey = getCacheKey(PIGGY_CACHE_KEY, start, end);const getter = new Get();- getter.get(params).then((response) => {+ getter.list(params).then((response) => {apiData = [...apiData, ...response.data.data];if (parseInt(response.data.meta.pagination.total_pages) > params.page) {params.page++;diff --git a/resources/assets/v2/pages/dashboard/sankey.js b/resources/assets/v2/pages/dashboard/sankey.jsindex 370314492e..c3aca8d4ae 100644--- a/resources/assets/v2/pages/dashboard/sankey.js+++ b/resources/assets/v2/pages/dashboard/sankey.js@@ -318,7 +318,7 @@ export default () => ({//console.log('Downloading page ' + params.page + '...');const getter = new Get();- getter.get(params).then((response) => {+ getter.list(params).then((response) => {transactions = [...transactions, ...response.data.data];//this.drawChart(this.generateOptions(response.data));//this.loading = false;diff --git a/resources/assets/v2/pages/dashboard/subscriptions.js b/resources/assets/v2/pages/dashboard/subscriptions.jsindex b98320e6ef..03e410551c 100644--- a/resources/assets/v2/pages/dashboard/subscriptions.js+++ b/resources/assets/v2/pages/dashboard/subscriptions.js@@ -36,7 +36,7 @@ let subscriptionData = {};function downloadSubscriptions(params) {const getter = new Get();- return getter.get(params)+ return getter.list(params)// first promise: parse the data:.then((response) => {let data = response.data.data;diff --git a/resources/assets/v2/pages/transactions/create.js b/resources/assets/v2/pages/transactions/create.jsindex a6288f9df8..54d819f7d8 100644--- a/resources/assets/v2/pages/transactions/create.js+++ b/resources/assets/v2/pages/transactions/create.js@@ -25,6 +25,7 @@ import {parseFromEntries} from "./shared/parse-from-entries.js";import formatMoney from "../../util/format-money.js";import Autocomplete from "bootstrap5-autocomplete";import Post from "../../api/v2/model/transaction/post.js";+import Get from "../../api/v2/model/currency/get.js";import {getVariable} from "../../store/get-variable.js";import {I18n} from "i18n-js";import {loadTranslations} from "../../support/load-translations.js";@@ -45,6 +46,7 @@ let transactions = function () {showErrorMessage: false,entries: [],loadingCurrencies: true,+ defaultCurrency: {},enabledCurrencies: [],nativeCurrencies: [],foreignCurrencies: [],@@ -52,6 +54,7 @@ let transactions = function () {source: [],destination: [],},+ errorMessageText: '',detectTransactionType() {const sourceType = this.entries[0].source_account.type ?? 'unknown';const destType = this.entries[0].destination_account.type ?? 'unknown';@@ -129,6 +132,37 @@ let transactions = function () {},loadCurrencies() {console.log('Loading user currencies.');+ let params = {+ page: 1,+ limit: 1337+ };+ let getter = new Get();+ getter.list({}).then((response) => {+ for(let i in response.data.data) {+ if(response.data.data.hasOwnProperty(i)) {+ let current = response.data.data[i];+ if(current.attributes.enabled) {+ let obj =++ {+ id: current.id,+ name: current.attributes.name,+ code: current.attributes.code,+ default: current.attributes.default,+ symbol: current.attributes.symbol,+ decimal_places: current.attributes.decimal_places,++ };+ if(obj.default) {+ this.defaultCurrency = obj;+ }+ this.enabledCurrencies.push(obj);+ }+ }+ }+ this.loadingCurrencies = false;+ console.log(this.enabledCurrencies);+ });},changeSourceAccount(item, ac) {if (typeof item === 'undefined') {@@ -275,7 +309,7 @@ let transactions = function () {this.showErrorMessage = true;// todo create error banner.// todo release form- console.error(error);+ this.errorMessageText = error.response.data.message;});},addSplit() {diff --git a/resources/assets/v2/pages/transactions/shared/create-empty-split.js b/resources/assets/v2/pages/transactions/shared/create-empty-split.jsindex b28997f7d2..be4c43f466 100644--- a/resources/assets/v2/pages/transactions/shared/create-empty-split.js+++ b/resources/assets/v2/pages/transactions/shared/create-empty-split.js@@ -33,9 +33,16 @@ export function createEmptySplit() {let formatted = format(now, 'yyyy-MM-dd HH:mm');return {description: '',++ // amount information:amount: '',+ currency_code: 'EUR',++ // source and destinationsource_account: getAccount(),destination_account: getAccount(),++ // date and timedate: formatted};}diff --git a/resources/assets/v2/pages/transactions/shared/parse-from-entries.js b/resources/assets/v2/pages/transactions/shared/parse-from-entries.jsindex fb49b9fb25..388f6fbfda 100644--- a/resources/assets/v2/pages/transactions/shared/parse-from-entries.js+++ b/resources/assets/v2/pages/transactions/shared/parse-from-entries.js@@ -35,6 +35,7 @@ export function parseFromEntries(entries, transactionType) {current.destination_name = entry.destination_account.name;current.amount = entry.amount;current.date = entry.date;+ current.currency_code = entry.currency_code;// if ID is set:if ('' !== entry.source_account.id.toString()) {diff --git a/resources/views/v2/transactions/create.blade.php b/resources/views/v2/transactions/create.blade.phpindex 561b194413..288abe5bac 100644--- a/resources/views/v2/transactions/create.blade.php+++ b/resources/views/v2/transactions/create.blade.php@@ -17,10 +17,7 @@</div></template><template x-if="showErrorMessage">- <div class="alert alert-danger alert-dismissible fade show" role="alert">- A simple ERROR alert with <a href="#" class="alert-link">an example link</a>. Give it a- click- if you like.+ <div class="alert alert-danger alert-dismissible fade show" role="alert" x-text="errorMessageText"><button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button></div></template>@@ -38,7 +35,7 @@type="button" role="tab":aria-controls="'split-'+index+'-pane'"aria-selected="true">{{ __('firefly.single_split') }} #- <span x-text="index"></span>+ <span x-text="index+1"></span></button></li></template>@@ -125,7 +122,7 @@<i class="fa-solid fa-calendar"></i></label><div class="col-sm-10">- <input type="datetime-local" class="form-control" id="date_0"+ <input type="datetime-local" class="form-control" :id="'date_' + index"@change="detectTransactionType"x-model="transaction.date">@@ -148,16 +145,12 @@<span class="form-control-plaintext"><em class="fa-solid fa-spinner fa-spin"></em></span></template><template x-if="!loadingCurrencies">- <select class="form-control">- <option>- Euro- </option>- <option>- Euro- </option>- <option>- Euro- </option>+ <select class="form-control" :id="'currency_code_' + index"+ x-model="transaction.currency_code"+ >+ <template x-for="currency in enabledCurrencies">+ <option :selected="currency.id == defaultCurrency.id" :label="currency.name" :value="currency.code" x-text="currency.name"></option>+ </template></select></template></div>diff --git a/routes/api.php b/routes/api.phpindex f69558e311..95a278a3bf 100644--- a/routes/api.php+++ b/routes/api.php@@ -22,18 +22,6 @@declare(strict_types=1);-/**- * V2 API route for TransactionSum API endpoints- * TODO what to do with these routes- */-//Route::group(-// ['namespace' => 'FireflyIII\Api\V2\Controllers\Transaction\Sum', 'prefix' => 'v2/transaction/sum',-// 'as' => 'api.v2.transaction.sum.',],-// static function () {-// Route::get('bills/paid', ['uses' => 'BillController@paid', 'as' => 'bills.paid']);-// }-//);-/*** V2 API route for Summary boxes*/@@ -134,7 +122,7 @@ Route::group('as' => 'api.v2.subscriptions.',],static function () {- Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']);+ Route::get('', ['uses' => 'IndexController@index', 'as' => 'index']);Route::get('{userGroupBill}', ['uses' => 'ShowController@show', 'as' => 'show']);Route::get('sum/paid', ['uses' => 'SumController@paid', 'as' => 'sum.paid']);Route::get('sum/unpaid', ['uses' => 'SumController@unpaid', 'as' => 'sum.unpaid']);@@ -151,7 +139,21 @@ Route::group('as' => 'api.v2.piggy-banks.',],static function () {- Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']);+ Route::get('', ['uses' => 'IndexController@index', 'as' => 'index']);+ }+);++/**+ * V2 API route for transaction currencies+ */+Route::group(+ [+ 'namespace' => 'FireflyIII\Api\V2\Controllers\Model\Currency',+ 'prefix' => 'v2/currencies',+ 'as' => 'api.v2.currencies.',+ ],+ static function () {+ Route::get('', ['uses' => 'IndexController@index', 'as' => 'index']);});@@ -179,12 +181,12 @@ Route::group('as' => 'api.v2.budgets',],static function () {- Route::get('', ['uses' => 'Budget\ListController@index', 'as' => 'index']);+ Route::get('', ['uses' => 'Budget\IndexController@index', 'as' => 'index']);Route::get('{budget}', ['uses' => 'Budget\ShowController@show', 'as' => 'show']);- Route::get('{budget}/limits', ['uses' => 'BudgetLimit\ListController@index', 'as' => 'budget-limits.index']);- Route::get('sum/budgeted', ['uses' => 'Budget\ShowController@budgeted', 'as' => 'sum.budgeted']);- Route::get('sum/spent', ['uses' => 'Budget\SumController@spent', 'as' => 'sum.spent']);- Route::get('{budget}/budgeted', ['uses' => 'Budget\SumController@budgeted', 'as' => 'budget.budgeted']);+ Route::get('{budget}/limits', ['uses' => 'BudgetLimit\IndexController@index', 'as' => 'budget-limits.index']);+ Route::get('sum/budgeted', ['uses' => 'Budget\IndexController@budgeted', 'as' => 'sum.budgeted']);+ Route::get('sum/spent', ['uses' => 'Budget\IndexController@spent', 'as' => 'sum.spent']);+ Route::get('{budget}/budgeted', ['uses' => 'Budget\ShowController@budgeted', 'as' => 'budget.budgeted']);Route::get('{budget}/spent', ['uses' => 'Budget\ShowController@spent', 'as' => 'budget.spent']);});@@ -213,7 +215,7 @@ Route::group('as' => 'api.v2.user-groups.',],static function () {- Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']);+ Route::get('', ['uses' => 'IndexController@index', 'as' => 'index']);Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']);Route::get('{userGroup}', ['uses' => 'ShowController@show', 'as' => 'show']);Route::put('{userGroup}', ['uses' => 'UpdateController@update', 'as' => 'update']);diff --git a/tests/integration/Support/NavigationCustomEndOfPeriodTest.php b/tests/integration/Support/NavigationCustomEndOfPeriodTest.phpindex 412b9cf4fc..258629f741 100644--- a/tests/integration/Support/NavigationCustomEndOfPeriodTest.php+++ b/tests/integration/Support/NavigationCustomEndOfPeriodTest.php@@ -1,5 +1,26 @@<?php++/*+ * NavigationCustomEndOfPeriodTest.php+ * Copyright (c) 2023 [email protected]+ *+ * This file is part of Firefly III (https://github.com/firefly-iii).+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <https://www.gnu.org/licenses/>.+ */+declare(strict_types=1);namespace Tests\integration\Support;