From c16a224472816c1ce81931ad61bb1613b4a6a4ab Mon Sep 17 00:00:00 2001
From: Pisarev Alexei <6171687+xiregroup@users.noreply.github.com>
Date: Wed, 18 Nov 2026 12:30:00 +0300
Subject: [PATCH 1/3] feat(monitoring): server timings, Web Vitals and uptime
checks on the site's own server
A new module, alveby/atrium-monitoring, with no outside service.
- Server timings: a middleware measures time to the first byte, database
queries and their time, cache hits and misses and peak memory by route,
site and language; slow queries are kept with their values replaced.
One line per request goes to a buffer file after the response and to
the database once a minute, with a sample rate. About 0.15 ms per
request with 20 queries, checked by atrium:monitoring:benchmark.
- Web Vitals (LCP, INP, CLS, TTFB, FCP) from a script under 2 KB sent with
sendBeacon: no cookies, no IP, Do Not Track respected, a sample rate;
malformed, oversized and too frequent beacons are refused.
- Uptime checks every minute, an incident after N failures in a row,
e-mail and Telegram alerts (token from settings or .env).
- Admin: "Speed and uptime" in the "Site health" group shared with the
error log, p50/p75/p95 by day, week or month, the slowest routes,
queries and pages, links to a page's errors when the error log is
installed, a dashboard tile. Charts read without colour: markers,
dashes, labels and a table of the numbers.
- Raw data 7 days, daily aggregates 13 months (atrium:monitoring:prune).
- Docs in English and Russian, labels in 15 languages.
---
.ci/coverage/monitoring | 1 +
CHANGELOG.md | 1 +
README.md | 2 +
composer.json | 3 +
composer.lock | 129 +-
config/atrium.php | 1 +
docs/monitoring.md | 220 ++++
docs/monitoring.ru.md | 221 ++++
docs/readme/README.be.md | 2 +
docs/readme/README.de.md | 2 +
docs/readme/README.es.md | 2 +
docs/readme/README.fr.md | 2 +
docs/readme/README.it.md | 2 +
docs/readme/README.ja.md | 2 +
docs/readme/README.kk.md | 2 +
docs/readme/README.pl.md | 2 +
docs/readme/README.pt-BR.md | 2 +
docs/readme/README.ru.md | 2 +
docs/readme/README.tr.md | 2 +
docs/readme/README.uk.md | 2 +
docs/readme/README.uz.md | 2 +
docs/readme/README.zh-CN.md | 2 +
.../Admin/Dashboard/MonitoringGadget.vue | 62 +
.../Admin/Monitoring/MonitoringChart.vue | 114 ++
.../js/Components/Admin/Monitoring/labels.js | 30 +
.../resources/js/Pages/Admin/Dashboard.vue | 2 +
.../js/Pages/Admin/Monitoring/Index.vue | 304 +++++
.../js/Pages/Admin/Monitoring/Query.vue | 74 ++
packages/monitoring/.gitattributes | 4 +
packages/monitoring/LICENSE | 21 +
packages/monitoring/README.md | 34 +
packages/monitoring/composer.json | 72 ++
.../monitoring/config/atrium-monitoring.php | 122 ++
...17_300001_create_monitoring_raw_tables.php | 81 ++
...7_300002_create_monitoring_daily_table.php | 49 +
...300003_create_monitoring_uptime_tables.php | 62 +
packages/monitoring/lang/be/monitoring.php | 167 +++
packages/monitoring/lang/de/monitoring.php | 167 +++
packages/monitoring/lang/en/monitoring.php | 167 +++
packages/monitoring/lang/es/monitoring.php | 167 +++
packages/monitoring/lang/fr/monitoring.php | 167 +++
packages/monitoring/lang/it/monitoring.php | 167 +++
packages/monitoring/lang/ja/monitoring.php | 167 +++
packages/monitoring/lang/kk/monitoring.php | 167 +++
packages/monitoring/lang/pl/monitoring.php | 167 +++
packages/monitoring/lang/pt_BR/monitoring.php | 167 +++
packages/monitoring/lang/ru/monitoring.php | 167 +++
packages/monitoring/lang/tr/monitoring.php | 167 +++
packages/monitoring/lang/uk/monitoring.php | 167 +++
packages/monitoring/lang/uz/monitoring.php | 167 +++
packages/monitoring/lang/zh_CN/monitoring.php | 167 +++
packages/monitoring/phpunit.xml.dist | 16 +
packages/monitoring/resources/js/rum.js | 46 +
.../resources/views/components/rum.blade.php | 6 +
packages/monitoring/routes/admin.php | 14 +
packages/monitoring/routes/web.php | 14 +
packages/monitoring/src/Admin/Menu.php | 66 +
.../src/Admin/MonitoringController.php | 338 +++++
.../monitoring/src/Admin/MonitoringGadget.php | 78 ++
packages/monitoring/src/Admin/SvgChart.php | 224 ++++
packages/monitoring/src/Buffer/Buffer.php | 126 ++
.../monitoring/src/Buffer/FlushBuffer.php | 28 +
packages/monitoring/src/Buffer/Flusher.php | 182 +++
.../monitoring/src/Collector/Benchmark.php | 135 ++
.../src/Collector/CollectMetrics.php | 39 +
.../monitoring/src/Collector/Recorder.php | 257 ++++
.../src/Collector/SqlNormalizer.php | 44 +
.../src/Console/BenchmarkCommand.php | 36 +
.../monitoring/src/Console/FlushCommand.php | 27 +
.../monitoring/src/Console/PruneCommand.php | 59 +
.../monitoring/src/Console/UptimeCommand.php | 34 +
packages/monitoring/src/Models/Incident.php | 123 ++
.../monitoring/src/Models/UptimeCheck.php | 147 +++
.../src/MonitoringServiceProvider.php | 150 +++
.../monitoring/src/MonitoringSettings.php | 47 +
packages/monitoring/src/Rum/Beacon.php | 87 ++
.../monitoring/src/Rum/BeaconController.php | 101 ++
packages/monitoring/src/Rum/RumScript.php | 73 ++
packages/monitoring/src/Stats/Aggregator.php | 224 ++++
packages/monitoring/src/Stats/Histogram.php | 223 ++++
packages/monitoring/src/Stats/Report.php | 205 +++
packages/monitoring/src/Stats/Vitals.php | 81 ++
packages/monitoring/src/Uptime/Notifier.php | 123 ++
packages/monitoring/src/Uptime/Transition.php | 46 +
.../monitoring/src/Uptime/UptimeChecker.php | 186 +++
packages/monitoring/tests/AdminTest.php | 268 ++++
packages/monitoring/tests/AggregatorTest.php | 389 ++++++
packages/monitoring/tests/BenchmarkTest.php | 353 ++++++
packages/monitoring/tests/BufferTest.php | 228 ++++
packages/monitoring/tests/BufferWriteTest.php | 277 +++++
.../tests/CollectorMiddlewareTest.php | 65 +
packages/monitoring/tests/ConsoleTest.php | 42 +
packages/monitoring/tests/ControllerTest.php | 1100 +++++++++++++++++
packages/monitoring/tests/GadgetTest.php | 181 +++
packages/monitoring/tests/HistogramTest.php | 280 +++++
packages/monitoring/tests/MenuTest.php | 102 ++
packages/monitoring/tests/ModelsTest.php | 207 ++++
.../monitoring/tests/NotInstalledTest.php | 40 +
packages/monitoring/tests/NotifierTest.php | 162 +++
packages/monitoring/tests/ProviderTest.php | 127 ++
.../monitoring/tests/ProviderWiringTest.php | 236 ++++
packages/monitoring/tests/PruneTest.php | 205 +++
.../monitoring/tests/RecorderCostsTest.php | 562 +++++++++
packages/monitoring/tests/RecorderTest.php | 207 ++++
packages/monitoring/tests/ReportTest.php | 250 ++++
packages/monitoring/tests/RumTest.php | 462 +++++++
.../monitoring/tests/SettingsFieldsTest.php | 115 ++
packages/monitoring/tests/SettingsTest.php | 73 ++
.../monitoring/tests/SqlNormalizerTest.php | 59 +
packages/monitoring/tests/SvgChartTest.php | 325 +++++
packages/monitoring/tests/TestCase.php | 89 ++
.../monitoring/tests/UptimeCheckerTest.php | 403 ++++++
packages/monitoring/tests/UptimeTest.php | 268 ++++
packages/monitoring/tests/VitalsTest.php | 101 ++
phpstan.neon | 3 +
phpunit.xml | 2 +
tests/Browser/Admin/MonitoringTest.php | 142 +++
117 files changed, 15027 insertions(+), 23 deletions(-)
create mode 100644 .ci/coverage/monitoring
create mode 100644 docs/monitoring.md
create mode 100644 docs/monitoring.ru.md
create mode 100644 packages/admin/resources/js/Components/Admin/Dashboard/MonitoringGadget.vue
create mode 100644 packages/admin/resources/js/Components/Admin/Monitoring/MonitoringChart.vue
create mode 100644 packages/admin/resources/js/Components/Admin/Monitoring/labels.js
create mode 100644 packages/admin/resources/js/Pages/Admin/Monitoring/Index.vue
create mode 100644 packages/admin/resources/js/Pages/Admin/Monitoring/Query.vue
create mode 100644 packages/monitoring/.gitattributes
create mode 100644 packages/monitoring/LICENSE
create mode 100644 packages/monitoring/README.md
create mode 100644 packages/monitoring/composer.json
create mode 100644 packages/monitoring/config/atrium-monitoring.php
create mode 100644 packages/monitoring/database/migrations/2026_11_17_300001_create_monitoring_raw_tables.php
create mode 100644 packages/monitoring/database/migrations/2026_11_17_300002_create_monitoring_daily_table.php
create mode 100644 packages/monitoring/database/migrations/2026_11_17_300003_create_monitoring_uptime_tables.php
create mode 100644 packages/monitoring/lang/be/monitoring.php
create mode 100644 packages/monitoring/lang/de/monitoring.php
create mode 100644 packages/monitoring/lang/en/monitoring.php
create mode 100644 packages/monitoring/lang/es/monitoring.php
create mode 100644 packages/monitoring/lang/fr/monitoring.php
create mode 100644 packages/monitoring/lang/it/monitoring.php
create mode 100644 packages/monitoring/lang/ja/monitoring.php
create mode 100644 packages/monitoring/lang/kk/monitoring.php
create mode 100644 packages/monitoring/lang/pl/monitoring.php
create mode 100644 packages/monitoring/lang/pt_BR/monitoring.php
create mode 100644 packages/monitoring/lang/ru/monitoring.php
create mode 100644 packages/monitoring/lang/tr/monitoring.php
create mode 100644 packages/monitoring/lang/uk/monitoring.php
create mode 100644 packages/monitoring/lang/uz/monitoring.php
create mode 100644 packages/monitoring/lang/zh_CN/monitoring.php
create mode 100644 packages/monitoring/phpunit.xml.dist
create mode 100644 packages/monitoring/resources/js/rum.js
create mode 100644 packages/monitoring/resources/views/components/rum.blade.php
create mode 100644 packages/monitoring/routes/admin.php
create mode 100644 packages/monitoring/routes/web.php
create mode 100644 packages/monitoring/src/Admin/Menu.php
create mode 100644 packages/monitoring/src/Admin/MonitoringController.php
create mode 100644 packages/monitoring/src/Admin/MonitoringGadget.php
create mode 100644 packages/monitoring/src/Admin/SvgChart.php
create mode 100644 packages/monitoring/src/Buffer/Buffer.php
create mode 100644 packages/monitoring/src/Buffer/FlushBuffer.php
create mode 100644 packages/monitoring/src/Buffer/Flusher.php
create mode 100644 packages/monitoring/src/Collector/Benchmark.php
create mode 100644 packages/monitoring/src/Collector/CollectMetrics.php
create mode 100644 packages/monitoring/src/Collector/Recorder.php
create mode 100644 packages/monitoring/src/Collector/SqlNormalizer.php
create mode 100644 packages/monitoring/src/Console/BenchmarkCommand.php
create mode 100644 packages/monitoring/src/Console/FlushCommand.php
create mode 100644 packages/monitoring/src/Console/PruneCommand.php
create mode 100644 packages/monitoring/src/Console/UptimeCommand.php
create mode 100644 packages/monitoring/src/Models/Incident.php
create mode 100644 packages/monitoring/src/Models/UptimeCheck.php
create mode 100644 packages/monitoring/src/MonitoringServiceProvider.php
create mode 100644 packages/monitoring/src/MonitoringSettings.php
create mode 100644 packages/monitoring/src/Rum/Beacon.php
create mode 100644 packages/monitoring/src/Rum/BeaconController.php
create mode 100644 packages/monitoring/src/Rum/RumScript.php
create mode 100644 packages/monitoring/src/Stats/Aggregator.php
create mode 100644 packages/monitoring/src/Stats/Histogram.php
create mode 100644 packages/monitoring/src/Stats/Report.php
create mode 100644 packages/monitoring/src/Stats/Vitals.php
create mode 100644 packages/monitoring/src/Uptime/Notifier.php
create mode 100644 packages/monitoring/src/Uptime/Transition.php
create mode 100644 packages/monitoring/src/Uptime/UptimeChecker.php
create mode 100644 packages/monitoring/tests/AdminTest.php
create mode 100644 packages/monitoring/tests/AggregatorTest.php
create mode 100644 packages/monitoring/tests/BenchmarkTest.php
create mode 100644 packages/monitoring/tests/BufferTest.php
create mode 100644 packages/monitoring/tests/BufferWriteTest.php
create mode 100644 packages/monitoring/tests/CollectorMiddlewareTest.php
create mode 100644 packages/monitoring/tests/ConsoleTest.php
create mode 100644 packages/monitoring/tests/ControllerTest.php
create mode 100644 packages/monitoring/tests/GadgetTest.php
create mode 100644 packages/monitoring/tests/HistogramTest.php
create mode 100644 packages/monitoring/tests/MenuTest.php
create mode 100644 packages/monitoring/tests/ModelsTest.php
create mode 100644 packages/monitoring/tests/NotInstalledTest.php
create mode 100644 packages/monitoring/tests/NotifierTest.php
create mode 100644 packages/monitoring/tests/ProviderTest.php
create mode 100644 packages/monitoring/tests/ProviderWiringTest.php
create mode 100644 packages/monitoring/tests/PruneTest.php
create mode 100644 packages/monitoring/tests/RecorderCostsTest.php
create mode 100644 packages/monitoring/tests/RecorderTest.php
create mode 100644 packages/monitoring/tests/ReportTest.php
create mode 100644 packages/monitoring/tests/RumTest.php
create mode 100644 packages/monitoring/tests/SettingsFieldsTest.php
create mode 100644 packages/monitoring/tests/SettingsTest.php
create mode 100644 packages/monitoring/tests/SqlNormalizerTest.php
create mode 100644 packages/monitoring/tests/SvgChartTest.php
create mode 100644 packages/monitoring/tests/TestCase.php
create mode 100644 packages/monitoring/tests/UptimeCheckerTest.php
create mode 100644 packages/monitoring/tests/UptimeTest.php
create mode 100644 packages/monitoring/tests/VitalsTest.php
create mode 100644 tests/Browser/Admin/MonitoringTest.php
diff --git a/.ci/coverage/monitoring b/.ci/coverage/monitoring
new file mode 100644
index 00000000..e46029e7
--- /dev/null
+++ b/.ci/coverage/monitoring
@@ -0,0 +1 @@
+100.00% of lines, 0 not covered
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 62ec91ce..969e352d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@ All notable changes are listed here. The format follows [Keep a Changelog](https
### Added
- Error tracking (`alveby/atrium-errors`, `atrium:module:install alveby/atrium-errors`), kept in the site's own database: PHP exceptions, queue jobs that failed for good, failed scheduled tasks and, when switched on, JavaScript errors of the site and the admin (a small script the module adds to the pages itself, reported to a rate-limited endpoint). Grouped by class and the first five frames of the app's own code, line numbers and changing values left out. **Site health → Errors**: the list with status buttons, search and filters by site, release, level, source and address; an error's page with its trace and code, the request, what happened before, a chart by hour or by day with the number on every bar, the addresses and releases it happens in, every event; resolve, **resolve in next release** (comes back only in another release), ignore, reopen. An **Errors in 24 hours** dashboard tile. E-mail and Telegram alerts for new errors, errors that came back and spikes, once per reason and ten in ten minutes at most. Secrets and personal data scrubbed before anything is stored (no headers, cookies, body or IP; filtered keys, e-mails, cards checked with Luhn, phones). Sampling, a per-minute cap, writing after the response or through a queue, a fallback log when the database is down, 90 days kept (`atrium:errors:prune`). Drivers: `database`, `sentry` (Sentry, self-hosted Sentry or GlitchTip with only a DSN, no SDK), `log`, and your own through `Atrium\Errors\Contracts\ErrorReporter` (Bugsnag, Rollbar, a webhook). Rights `errors.view` and `errors.settings`; an administrator of some sites sees only their errors. `atrium:errors:test` sends a test error everywhere. Guide in `docs/errors.md`. Labels in 15 languages; the chart's colours measured in all five themes.
+- Monitoring (`alveby/atrium-monitoring`, `atrium:module:install alveby/atrium-monitoring`), on the site's own server with no outside service. Server timings of every request (time to the first byte, database queries and their time, cache hits and misses, peak memory, 5xx share) by route, site and language, slow queries kept with their values replaced by `?`; written to a file after the response and to the database once a minute in one transaction, with a sample rate and an early flush through a queue; about 0.15 ms added to a request with 20 queries, checked by `atrium:monitoring:benchmark`. Visitors' Web Vitals (LCP, INP, CLS, TTFB, FCP) from a script under 2 KB sent with `sendBeacon`: no cookies, no IP stored, no query strings, Do Not Track and Global Privacy Control respected, a sample rate, 30 beacons a minute from one address, malformed or oversized beacons refused. Uptime checks of every site's front page and added addresses every minute; an incident after N failures in a row (a setting), e-mail and Telegram alerts (token in the settings or `.env`), hooks `atrium.monitoring.incident.opened` / `.resolved`. **Site health → Speed and uptime**: p50, p75 and p95 by day, week or month from mergeable daily histograms, filters by site, language and device, the slowest routes, queries (each with its own page) and pages, links to the error log of a page, checks and incidents; a **Speed and uptime** dashboard tile; charts told apart without colour (markers, dashes, labels, a table of the numbers), colours measured in every theme. Raw data 7 days, daily aggregates 13 months (`atrium:monitoring:prune`). Right `monitoring.view`. Guide in `docs/monitoring.md`. Labels in 15 languages.
- Custom fields (`alveby/atrium-custom-fields`, `atrium:module:install alveby/atrium-custom-fields`): editors add fields to any module from a **Fields** button on its list, with no migration: line, text, integer, decimal, yes/no, date, list, multiple choice, link to a record, file and image, with a name and hint per content language, a tab of the module's form, and the flags required, show in the list, filterable, sortable, searchable, translatable and per site (or shown on one site only). Values live in a JSON column `custom` added with the first field; the filterable and sortable ones are also kept in a typed index table (`custom_field_index`), updated on every save and delete and rebuilt by `atrium:custom-fields:reindex`. `whereCustom()`, `whereCustomBetween()`, `whereCustomFilters()` and `orderByCustom()` on every Eloquent query, and `CustomFacets::for(Product::class, $query)->filters($filters)->counts([...])` / `->ranges([...])` for a filter panel (each field counted with every filter but its own). `atrium:custom-fields:promote` moves a hot field into a real indexed column of the module's table. The fields are in the API (`filter[code]=`, `sort=`, `search=`), its documentation and the MCP tool `describe_module`. On 100 000 records a filtered page of 24 takes 54–185 ms and its three facets 76–374 ms (SQLite, PostgreSQL 17, MySQL 8.4). With `atrium:install --demo` the catalog's products get five filterable fields (weight, battery life, waterproof, connectivity, warranty), named in all 15 languages and weighed in pounds for an English (US) shop, in kilograms elsewhere. Guide in `docs/custom-fields.md`. Admin labels in 15 languages.
- Ready-made sites (`alveby/atrium-solutions`): `php artisan atrium:solution:install law` turns a fresh project into a whole site: the modules it needs on and the others off (their data kept), the migrations, its content languages, the brand as the site name, its names for the modules in the admin and on the site, their addresses and the site menu, and its content in English, German and Russian; a second run doubles nothing. `atrium:solution:list` lists the solutions and the modules each still lacks; `--json` is the catalogue (texts in every language, modules, palette, fonts, screenshots, pages, install command). A solution is a folder with a `solution.json` and a seeder extending `SolutionSeeder`; other packages add their folders to `atrium-solutions.paths`. The first one is `law`: Vellmar Oake, a made-up law firm with six practice areas, six lawyers in two departments, insights, two offices, a consultation form, a fees FAQ and client reviews.
- Backup module (`alveby/atrium-backup`, on spatie/laravel-backup): the databases (MySQL, MariaDB, PostgreSQL, SQLite) in a consistent dump and the chosen disks and folders in one zip, encrypted with `ATRIUM_BACKUP_PASSWORD`, copied to a local folder, S3 or S3-compatible storage, FTP, SFTP or Google Drive, daily or weekly, with daily/weekly/monthly/yearly retention and a size cap. An e-mail to superadmins when a backup or a destination fails, the newest archive is too old or its size jumps. A **Backups** screen for superadmins only: the archives on every destination, **Back up now**, download, delete, destination health, and a restore that first shows what the archive will change (dumps, target databases, new/changed/extra files, warnings), asks for the archive's name and makes a safety backup; the same from `atrium:backup:restore` with `--dry-run`. Runs after the response or on a queue, one at a time, logged with who did it. See [docs/backup.md](docs/backup.md).
diff --git a/README.md b/README.md
index 5e7af0f4..d4de7424 100644
--- a/README.md
+++ b/README.md
@@ -123,6 +123,7 @@ The Bitrix database is only read. The tabs, field order and list columns come ou
- [Moving from 1C-Bitrix, step by step](docs/bitrix.md)
- [Backups: databases and files to several places, schedules, health checks, restore](docs/backup.md)
- [Errors: PHP, queue and JavaScript errors in the site's database, alerts, Sentry and your own drivers](docs/errors.md)
+- [Speed and uptime: server timings, visitors' Web Vitals, uptime checks with alerts](docs/monitoring.md)
- [CDN: pictures, resized copies and WebP/AVIF, cache purge, uploads to S3](docs/cdn.md)
- [Two-factor sign-in: authenticator apps, passkeys, codes, the sign-in log](docs/two-factor.md)
- [Social sign-in: providers, app registration, redirect URLs](docs/social-login.md)
@@ -140,6 +141,7 @@ The Bitrix database is only read. The tabs, field order and list columns come ou
| [`alveby/atrium-docs`](packages/docs/README.md) | Documentation pages from Markdown, with versions and search |
| [`alveby/atrium-backup`](packages/backup/README.md) | Backups of the databases and files, restore from the admin |
| [`alveby/atrium-errors`](packages/errors/README.md) | Error tracking in the site's database, alerts, Sentry |
+| [`alveby/atrium-monitoring`](packages/monitoring/README.md) | Server and visitor speed, uptime and alerts, with no outside service |
| [`alveby/atrium-news`](packages/news/README.md) | News |
| [`alveby/atrium-pages`](packages/pages/README.md) | Static pages, with an import of 1C-Bitrix pages |
| [`alveby/atrium-catalog`](packages/catalog/README.md) | Product catalog with nested sections |
diff --git a/composer.json b/composer.json
index 9ad7a84f..1cba4813 100644
--- a/composer.json
+++ b/composer.json
@@ -25,6 +25,7 @@
"alveby/atrium-errors": "@dev",
"alveby/atrium-faq": "@dev",
"alveby/atrium-forms": "@dev",
+ "alveby/atrium-monitoring": "@dev",
"alveby/atrium-news": "@dev",
"alveby/atrium-pages": "@dev",
"alveby/atrium-reviews": "@dev",
@@ -77,6 +78,7 @@
"Atrium\\Errors\\Tests\\": "packages/errors/tests/",
"Atrium\\Faq\\Tests\\": "packages/faq/tests/",
"Atrium\\Forms\\Tests\\": "packages/forms/tests/",
+ "Atrium\\Monitoring\\Tests\\": "packages/monitoring/tests/",
"Atrium\\News\\Tests\\": "packages/news/tests/",
"Atrium\\Pages\\Tests\\": "packages/pages/tests/",
"Atrium\\Reviews\\Tests\\": "packages/reviews/tests/",
@@ -169,6 +171,7 @@
"alveby/atrium-errors": "0.1.x-dev",
"alveby/atrium-faq": "0.1.x-dev",
"alveby/atrium-forms": "0.1.x-dev",
+ "alveby/atrium-monitoring": "0.1.x-dev",
"alveby/atrium-news": "0.1.x-dev",
"alveby/atrium-pages": "0.1.x-dev",
"alveby/atrium-reviews": "0.1.x-dev",
diff --git a/composer.lock b/composer.lock
index 23ef77ff..c51be0ca 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "0e6dc885b5d747dac2fe3141fe781260",
+ "content-hash": "dbd60fbccc75816edd9c238451c3c0df",
"packages": [
{
"name": "alveby/atrium",
@@ -12,7 +12,7 @@
"dist": {
"type": "path",
"url": "packages/admin",
- "reference": "4f925755003390f651058c88303838daa3f239a4"
+ "reference": "89ceadefaa8e0b685b229aa2cb90a0290ba1e836"
},
"require": {
"illuminate/database": "^13.0",
@@ -79,7 +79,7 @@
"dist": {
"type": "path",
"url": "packages/two-factor",
- "reference": "69c1be51c773088af110ad9c2d3b34ba1d1839e9"
+ "reference": "715b990ee2a6e5056e55f8602c1529062dec3edc"
},
"require": {
"alveby/atrium": "^0.1",
@@ -152,7 +152,7 @@
"dist": {
"type": "path",
"url": "packages/ai",
- "reference": "f3fd3c28faeba0a00162138a47c2610dffe51205"
+ "reference": "0130abf54a712f588bbd8a9cf720198d6ac8a732"
},
"require": {
"alveby/atrium": "^0.1",
@@ -219,7 +219,7 @@
"dist": {
"type": "path",
"url": "packages/backup",
- "reference": "66f1dba5a4d7d3f32cb3c3930cfaa0da298cf712"
+ "reference": "1f8af76ad584c044106f501c14b075f9fd8c1c84"
},
"require": {
"alveby/atrium": "^0.1",
@@ -293,7 +293,7 @@
"dist": {
"type": "path",
"url": "packages/brands",
- "reference": "72791048383e904d3eecb482ca53f9631833c197"
+ "reference": "1d55cfa306e48efa5d11e7173d43c9f76c91fdbb"
},
"require": {
"alveby/atrium": "^0.1",
@@ -359,7 +359,7 @@
"dist": {
"type": "path",
"url": "packages/catalog",
- "reference": "e496239e03faad46990cb4e022aa792fcd3cb35e"
+ "reference": "e852f0df3e3f43303c6a7bc7964b545654ddd5eb"
},
"require": {
"alveby/atrium": "^0.1",
@@ -448,7 +448,7 @@
"dist": {
"type": "path",
"url": "packages/custom-fields",
- "reference": "eb1b79bd24ede1ae7c8acd49a0d454212070d2cf"
+ "reference": "7e41183d0537f09c4fdacd15ca54c7e1e98d762d"
},
"require": {
"alveby/atrium": "^0.1",
@@ -521,7 +521,7 @@
"dist": {
"type": "path",
"url": "packages/docs",
- "reference": "98a06714746d959af086dddfd000d757fcb74a58"
+ "reference": "fcbc61909824fb66ebf0011123fc84ed66ed2ee2"
},
"require": {
"alveby/atrium": "^0.1",
@@ -585,7 +585,7 @@
"dist": {
"type": "path",
"url": "packages/errors",
- "reference": "d29b8df0555b34f989e35601139a93ed79e1452b"
+ "reference": "f8906b5402066476713082cc8f82e6aa6b28e4c8"
},
"require": {
"alveby/atrium": "^0.1",
@@ -662,7 +662,7 @@
"dist": {
"type": "path",
"url": "packages/faq",
- "reference": "d1565935218104d15eb3a5d221d8d04c2b0ef886"
+ "reference": "ac7ea5e20d0557c3463d357935c43368b514cb20"
},
"require": {
"alveby/atrium": "^0.1",
@@ -740,7 +740,7 @@
"dist": {
"type": "path",
"url": "packages/forms",
- "reference": "699975b6ac11473e7539de3aa9499e9a80706640"
+ "reference": "11e05579ca0a018a2149f0060d39ddb3eca7a3c1"
},
"require": {
"alveby/atrium": "^0.1",
@@ -802,13 +802,95 @@
"relative": true
}
},
+ {
+ "name": "alveby/atrium-monitoring",
+ "version": "0.1.x-dev",
+ "dist": {
+ "type": "path",
+ "url": "packages/monitoring",
+ "reference": "a116d93909c1ca241fc5bb5dc38809ed9f63981c"
+ },
+ "require": {
+ "alveby/atrium": "^0.1",
+ "illuminate/support": "^13.0",
+ "php": "^8.3"
+ },
+ "require-dev": {
+ "orchestra/testbench": "^11.0",
+ "phpunit/phpunit": "^12.5"
+ },
+ "suggest": {
+ "alveby/atrium-mail": "Sends the incident letters through the mail module's accounts and history",
+ "alveby/atrium-theme": "Puts the Web Vitals script into the public pages by itself"
+ },
+ "type": "atrium-module",
+ "extra": {
+ "atrium": {
+ "key": "monitoring",
+ "title": "atrium-monitoring::monitoring.title",
+ "settings": "Atrium\\Monitoring\\MonitoringSettings",
+ "permissions": {
+ "view": {
+ "label": "atrium-monitoring::monitoring.permissions.view",
+ "with": "uptime_checks.view"
+ }
+ },
+ "resources": [
+ "Atrium\\Monitoring\\Models\\UptimeCheck",
+ "Atrium\\Monitoring\\Models\\Incident"
+ ],
+ "migrations": "database/migrations"
+ },
+ "laravel": {
+ "providers": [
+ "Atrium\\Monitoring\\MonitoringServiceProvider"
+ ]
+ },
+ "branch-alias": {
+ "dev-main": "0.1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Atrium\\Monitoring\\": "src/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Atrium\\Monitoring\\Tests\\": "tests/"
+ }
+ },
+ "license": [
+ "MIT"
+ ],
+ "description": "Load monitoring for Atrium: server timings, real user Web Vitals and uptime checks with alerts, all on your own server",
+ "homepage": "https://github.com/AlveBy/atrium",
+ "keywords": [
+ "admin",
+ "cms",
+ "laravel",
+ "monitoring",
+ "multisite",
+ "performance",
+ "uptime",
+ "web-vitals"
+ ],
+ "support": {
+ "issues": "https://github.com/AlveBy/atrium/issues",
+ "source": "https://github.com/AlveBy/atrium"
+ },
+ "transport-options": {
+ "symlink": true,
+ "relative": true
+ }
+ },
{
"name": "alveby/atrium-news",
"version": "0.1.x-dev",
"dist": {
"type": "path",
"url": "packages/news",
- "reference": "5066371aff93dc118eee5875c6d8f78c77b304b6"
+ "reference": "53280a13948c78d056407b2ea4cdd9f3fa13ae1c"
},
"require": {
"alveby/atrium": "^0.1",
@@ -881,7 +963,7 @@
"dist": {
"type": "path",
"url": "packages/pages",
- "reference": "a6965ef11be2495d5a834c53042aa6742a7b1edb"
+ "reference": "643b81bfb41ba929b04dd22ad160c28415eec642"
},
"require": {
"alveby/atrium": "^0.1",
@@ -957,7 +1039,7 @@
"dist": {
"type": "path",
"url": "packages/reviews",
- "reference": "32803cbcbe5a56f35594f13e65b9cc9622a89015"
+ "reference": "8537499128872b3f5fe486c087fbdf288c9c53b4"
},
"require": {
"alveby/atrium": "^0.1",
@@ -1027,7 +1109,7 @@
"dist": {
"type": "path",
"url": "packages/seo",
- "reference": "9b03717a22cd8a886cf2a9c5b222fb074c9bbba5"
+ "reference": "98626c8e2e84d908d4ede70b16ce30b0cf723ada"
},
"require": {
"alveby/atrium": "^0.1",
@@ -1120,7 +1202,7 @@
"dist": {
"type": "path",
"url": "packages/social-login",
- "reference": "af5b0489019d706516fe43da8d9414f9ab10691f"
+ "reference": "627162ee96fd5f67c94afd31127ec2549c967ddd"
},
"require": {
"alveby/atrium": "^0.1",
@@ -1198,7 +1280,7 @@
"dist": {
"type": "path",
"url": "packages/solutions",
- "reference": "e87c079d6ef7ae818e246929ed4f598ce715cf22"
+ "reference": "71a9ee9f8898be2c19c0089f34c87b8251fca439"
},
"require": {
"alveby/atrium": "^0.1",
@@ -1273,7 +1355,7 @@
"dist": {
"type": "path",
"url": "packages/stores",
- "reference": "208bef5ab7a53b7f30028de14fba4da01318f2f0"
+ "reference": "5f82b6fcaf54944dade609f1877f3eae5f904eb5"
},
"require": {
"alveby/atrium": "^0.1",
@@ -1345,7 +1427,7 @@
"dist": {
"type": "path",
"url": "packages/team",
- "reference": "cdaadf5f35685d722eac18ea61c1449294d24105"
+ "reference": "1644d0b0ffdd1ecae6a76d3fb78a7a7e34e7c67d"
},
"require": {
"alveby/atrium": "^0.1",
@@ -1423,7 +1505,7 @@
"dist": {
"type": "path",
"url": "packages/theme",
- "reference": "b04ef49e254ae590df471bc038aa6db8e2e9e72c"
+ "reference": "47a7410da882b83dc1fa24d06058c85f289688d3"
},
"require": {
"alveby/atrium": "^0.1",
@@ -9679,7 +9761,7 @@
"dist": {
"type": "path",
"url": "packages/bitrix",
- "reference": "16c2ad4cf3372b0b013bc0a449a6fe8ab843cab2"
+ "reference": "62c4b46ed022f6010729dcf88473caac2d332676"
},
"require": {
"alveby/atrium": "^0.1",
@@ -9743,7 +9825,7 @@
"dist": {
"type": "path",
"url": "packages/wordpress",
- "reference": "bd8bbf61c8d395b8f84c405e26a36b8f0bb940b5"
+ "reference": "ba7b630ad449a57424fc1548933ee7d52cd8cd10"
},
"require": {
"alveby/atrium": "^0.1",
@@ -14838,6 +14920,7 @@
"alveby/atrium-errors": 20,
"alveby/atrium-faq": 20,
"alveby/atrium-forms": 20,
+ "alveby/atrium-monitoring": 20,
"alveby/atrium-news": 20,
"alveby/atrium-pages": 20,
"alveby/atrium-reviews": 20,
diff --git a/config/atrium.php b/config/atrium.php
index f6bb77a9..90cad7c6 100644
--- a/config/atrium.php
+++ b/config/atrium.php
@@ -67,6 +67,7 @@
'alveby/atrium-social-login',
'alveby/atrium-seo',
'alveby/atrium-errors',
+ 'alveby/atrium-monitoring',
],
/*
diff --git a/docs/monitoring.md b/docs/monitoring.md
new file mode 100644
index 00000000..95693869
--- /dev/null
+++ b/docs/monitoring.md
@@ -0,0 +1,220 @@
+# Monitoring: speed and uptime
+
+[English](monitoring.md) · [Русский](monitoring.ru.md)
+
+`alveby/atrium-monitoring` measures how fast the site answers and whether it answers at all, on your own server, with no outside service. It does three things:
+
+- **server timings** of every request: time to the first byte, database queries and their time, cache hits and misses, peak memory, slow queries with their SQL;
+- **visitors' Web Vitals** (LCP, INP, CLS, TTFB, FCP) from real browsers, through a script under 2 KB, without cookies or personal data;
+- **uptime**: the front page of every site and the addresses you add are opened every minute; after a few failures in a row an incident is opened and an e-mail and a Telegram message go out.
+
+The numbers are on the **Site health → Speed and uptime** screen, by day, week or month, as p50, p75 and p95, and in a tile on the dashboard.
+
+- [Install](#install)
+- [What is measured](#what-is-measured)
+- [The screen](#the-screen)
+- [Uptime and alerts](#uptime-and-alerts)
+- [Privacy](#privacy)
+- [How it stays cheap](#how-it-stays-cheap)
+- [Percentiles](#percentiles)
+- [Retention](#retention)
+- [Configuration](#configuration)
+- [Commands](#commands)
+- [For other packages](#for-other-packages)
+- [Contrast and charts without colour](#contrast-and-charts-without-colour)
+
+## Install
+
+```bash
+composer require alveby/atrium-monitoring
+php artisan atrium:module:install alveby/atrium-monitoring
+```
+
+The command creates the tables and turns the module on. Until then the package does nothing: no middleware, no script, no checks. The flush, the uptime checks and the cleanup run from Laravel's scheduler, so cron must call `php artisan schedule:run` every minute.
+
+Defaults are in `config/atrium-monitoring.php` (`php artisan vendor:publish --tag=atrium-monitoring-config`). The alert settings are in the panel, in **Modules → Monitoring**.
+
+The screen is open to every role with the **View speed and uptime reports** permission (`monitoring.view`). On install it is given to every role that may see the uptime checks; superadmins always have it.
+
+## What is measured
+
+**On the server**, a middleware in the `web` group records one line per request:
+
+| Value | What it is |
+|---|---|
+| Time to the first byte | from the start of the request to the response being ready |
+| Database | number of queries and their total time |
+| Cache | hits and misses (from the cache module when it is there, see [below](#for-other-packages)) |
+| Memory | peak memory of the request |
+| Errors | the share of answers with a 5xx status |
+
+Requests are grouped by **route** (its name, or its pattern such as `/catalog/{slug}` when it has none), by **site** and by **language**. A query slower than 100 ms (`slow_query_ms`) is kept with its SQL, with every value replaced by `?`, so no e-mail, password or id ends up in the log; the same query from different places is one row. At most 20 slow queries are kept per request.
+
+**In the browser**, the public theme gets a script that waits for the page to be hidden and then sends, once, with `navigator.sendBeacon`:
+
+| Metric | Good up to | Poor above |
+|---|---|---|
+| LCP, Largest Contentful Paint | 2.5 s | 4 s |
+| INP, Interaction to Next Paint | 200 ms | 500 ms |
+| CLS, Cumulative Layout Shift | 0.1 | 0.25 |
+| TTFB, Time to First Byte | 800 ms | 1.8 s |
+| FCP, First Contentful Paint | 1.8 s | 3 s |
+
+These are Google's thresholds, applied to the 75th percentile, as Google does. With the page, it sends the kind of device (phone, tablet, computer, from the screen width) and the connection type when the browser knows it (`4g`, `3g`…).
+
+Another theme adds the script with one tag in its layout:
+
+```blade
+
+```
+
+## The screen
+
+**Site health → Speed and uptime** (`/admin/monitoring`) has three parts.
+
+- **Server**: requests measured, time to the first byte (p50, p75, p95), the share of server errors, cache hits, queries per request and memory at p95; charts of the time to the first byte and of the database time; the slowest routes and the slowest queries. A route opens the same screen filtered to that route; a query opens its own page, with its time by day and the routes it runs on.
+- **Visitors**: the five Web Vitals at p75 with their rating written out (Good, Needs improvement, Poor), a chart of each, and the slowest pages by LCP. A page opens the screen filtered to it.
+- **Uptime**: every check with its status, uptime and last response, and the recent incidents.
+
+Filters: the period (30 days by day, 26 weeks by week, 13 months by month), the site, the language and the device. The table of pages counts every device and language, so it is hidden while one of those filters is on.
+
+With the error log (`alveby/atrium-errors`) installed, a page in the slowest pages table, and a page on a query's own screen, also link to the errors of that address (for an administrator who may read the log). The sidebar group "Site health" holds the report, the uptime checks and the incidents, next to the error log.
+
+Numbers are written the way the panel's language writes them: `2.91 s` in English, `2,91 с` in Russian.
+
+The dashboard tile **Speed and uptime** shows the Web Vitals at p75 over 7 days, uptime over 30 days, what is down right now and the five slowest routes. It is shown only to those who may open the screen.
+
+## Uptime and alerts
+
+Every minute (`atrium:monitoring:uptime`):
+
+1. Each active site gets a check of its front page, following its domain and folder (`https://shop.example.com/`, `https://example.com/blog/`). A switched-off site's check is switched off too. Other addresses are added under **Site health → Uptime checks**.
+2. Every active address is opened, ten at a time, with a 10-second timeout. An answer below 400 is up; 4xx, 5xx, a timeout or a refused connection is a failure.
+3. A check moves through four states:
+
+| Now | Result | Next | What happens |
+|---|---|---|---|
+| any | up | Up | an open incident is closed, «back up» alert |
+| Up / Not checked | failure, fewer than N in a row | Failing | nothing yet |
+| Failing | the N-th failure in a row | Down | an incident is opened, «down» alert |
+| Down | failure | Down | the incident counts the failures, no new alert |
+
+N is **Failed checks before an incident** in the settings (3 by default: three minutes without an answer).
+
+Alerts go:
+
+- **by e-mail** to the addresses in **Alert e-mails** (commas or new lines). They go through Laravel's mailer; with the mail module installed it takes them over, with its accounts and history.
+- **by Telegram**: create a bot with @BotFather, add it to a chat or channel, and fill in **Telegram bot token** and **Telegram chat** (`-1001234567890` or `@site_alerts`). The token is kept in the settings table, never in the code; `ATRIUM_MONITORING_TELEGRAM_TOKEN` and `ATRIUM_MONITORING_TELEGRAM_CHAT_ID` in `.env` win over it. Never commit a token.
+
+The alert is written in the application's language. A failed alert is logged, without the token, and does not stop the checks.
+
+## Privacy
+
+- No cookies, no local storage, no fingerprint.
+- The IP address is not stored anywhere: it is only used, in memory, to limit beacons to 30 a minute from one address.
+- The page address is kept without its query string and its `#fragment`, so `?email=` or a campaign id never reach the database.
+- Visitors with **Do Not Track** or **Global Privacy Control** on are not measured at all: the script is not even printed.
+- `rum.sample_rate` measures only a share of page views (0.1 = one in ten).
+- Slow queries are kept with every value replaced by `?`.
+
+Nothing of this needs a cookie banner.
+
+## How it stays cheap
+
+A measured request does not touch the database. The middleware appends one short JSON line to a file under `storage/app/atrium-monitoring`, after the response has been sent. Once a minute `atrium:monitoring:flush` takes the file by renaming it, writes the raw rows in chunks and adds every request to its day's histogram, in one transaction under a lock. When the file passes 256 KB before the minute is up, the request that notices it flushes, or hands the flush to a queue when `buffer.queue` names a queue connection. `server.sample_rate` measures only a share of requests.
+
+`php artisan atrium:monitoring:benchmark` measures what the middleware adds. It runs the same simulated request (20 queries, two cache reads, through the real event dispatcher) without and with the middleware, in rounds, writing to a real file, and reports the median round. It fails when the middleware adds 1 ms or more. On PHP 8.4 in Docker (`php:8.4-apache`, Linux, no Xdebug):
+
+| Queries per request | Added per request |
+|---|---|
+| 20 | 0.14–0.20 ms |
+| 0 | 0.04 ms |
+
+Xdebug, in any mode, slows PHP down several times; measure without it.
+
+## Percentiles
+
+p50 is the value half of the requests (or page views) were faster than; p75, three in four; p95, all but one in twenty. p75 is what Google rates a site by; p95 shows the slow tail that an average hides.
+
+Each day is kept as a histogram per value with buckets 5% apart (a log scale from 1 µs), so a percentile read from it is within about 2.5% of the exact one. Histograms add up, so a week or a month is the sum of its days, and the percentiles of a month are those of all its requests, not an average of daily percentiles.
+
+## Retention
+
+| Data | Kept | Table |
+|---|---|---|
+| Raw requests, slow queries, page views, check results | 7 days | `monitoring_requests`, `monitoring_queries`, `monitoring_vitals`, `monitoring_check_results` |
+| Daily histograms | 13 months | `monitoring_daily` |
+| SQL of slow queries | as long as their daily rows | `monitoring_query_texts` |
+| Closed incidents | 13 months | `monitoring_incidents` |
+
+`atrium:monitoring:prune` deletes the rest every night at 03:17, in slices of 5,000 rows so a big table is never locked for long. Both periods are in `retention`.
+
+## Configuration
+
+| Key | `.env` | Default | |
+|---|---|---|---|
+| `server.enabled` | `ATRIUM_MONITORING_SERVER` | `true` | server timings |
+| `server.sample_rate` | `ATRIUM_MONITORING_SAMPLE_RATE` | `1.0` | share of requests measured |
+| `server.slow_query_ms` | `ATRIUM_MONITORING_SLOW_QUERY_MS` | `100` | a slower query is kept |
+| `server.except` | | `up`, `atrium/rum`, `vendor/*`, `build/*`, `storage/*` | paths never measured |
+| `buffer.path` | `ATRIUM_MONITORING_BUFFER` | `storage/app/atrium-monitoring` | the buffer file |
+| `buffer.max_bytes` | | `262144` | flush early above this |
+| `buffer.queue` | `ATRIUM_MONITORING_QUEUE` | — | queue connection for an early flush |
+| `buffer.lock_store` | `ATRIUM_MONITORING_LOCK_STORE` | default cache | the flush lock; use a shared store with several servers |
+| `rum.enabled` | `ATRIUM_MONITORING_RUM` | `true` | the visitors' script |
+| `rum.sample_rate` | `ATRIUM_MONITORING_RUM_SAMPLE_RATE` | `1.0` | share of page views measured |
+| `rum.rate_limit` | | `30` | beacons a minute from one address |
+| `rum.theme` | | `true` | the public theme prints the script by itself |
+| `uptime.enabled` | `ATRIUM_MONITORING_UPTIME` | `true` | uptime checks |
+| `uptime.scheme` | `ATRIUM_MONITORING_UPTIME_SCHEME` | `https` | scheme of the front-page checks |
+| `uptime.timeout` | | `10` | seconds per check |
+| `uptime.failures` | | `3` | default for the setting |
+| `retention.raw_days` | | `7` | |
+| `retention.aggregate_months` | | `13` | |
+| `schedule` | | `true` | add the tasks to the scheduler |
+
+## Commands
+
+| Command | |
+|---|---|
+| `atrium:monitoring:flush` | write the buffer to the database (every minute) |
+| `atrium:monitoring:uptime` | check every address (every minute) |
+| `atrium:monitoring:prune` | delete old data (daily, 03:17) |
+| `atrium:monitoring:benchmark --requests=2000 --queries=20 --rounds=5` | measure the middleware's cost |
+
+With `schedule` set to `false`, schedule them yourself.
+
+## For other packages
+
+**Cache counters.** When a filter `atrium.cache.stats` is registered, the module takes the request's cache hits and misses from it instead of counting Laravel's cache events. The filter gets `['hits' => 0, 'misses' => 0]` and returns the numbers of the current request:
+
+```php
+Hook::filter('atrium.cache.stats', fn (array $stats): array => [
+ 'hits' => $this->hits,
+ 'misses' => $this->misses,
+]);
+```
+
+The module reads it when the request terminates. Anything else than an array falls back to the events.
+
+**Incidents.** `atrium.monitoring.incident.opened` and `atrium.monitoring.incident.resolved` fire with the `Incident` model (its `check` loaded), for a third channel such as Slack or an SMS:
+
+```php
+Hook::on('atrium.monitoring.incident.opened', function (Incident $incident): void {
+ // $incident->check->url, $incident->started_at, $incident->last_error
+});
+```
+
+## Contrast and charts without colour
+
+Each chart draws p50, p75 and p95, told apart without colour: p50 has circles and a solid line, p75 squares and a dashed line, p95 triangles and a dotted line, and each line has its name written at its end. Under every chart the same numbers are in a table, and the SVG carries them in its `
` and `` for screen readers. A rating is written out in words; an uptime status has its name and a sign (● up, ◐ failing, ○ down).
+
+The line colours, against the panel's surface (WCAG 2 contrast ratio; 4.5:1 is the minimum for text, 3:1 for lines):
+
+| Line | Light themes | on white | on the darkest light page (#f7f3ec) | Night | on #161d27 |
+|---|---|---|---|---|---|
+| p50 | #0B5FA5 | 6.57:1 | 5.94:1 | #6CB4F0 | 7.61:1 |
+| p75 | #B34700 | 5.50:1 | 4.97:1 | #F5A05B | 8.12:1 |
+| p95 | #374151 | 10.31:1 | 9.32:1 | #E5E7EB | 13.69:1 |
+
+The High contrast theme draws all three in black (21:1) and leaves them to the markers and dashes. Axis text uses the theme's muted colour (7.56:1 on white in Graphite, 7.13:1 on #161d27 in Night).
diff --git a/docs/monitoring.ru.md b/docs/monitoring.ru.md
new file mode 100644
index 00000000..768ee302
--- /dev/null
+++ b/docs/monitoring.ru.md
@@ -0,0 +1,221 @@
+# Мониторинг: скорость и доступность
+
+[English](monitoring.md) · [Русский](monitoring.ru.md)
+
+`alveby/atrium-monitoring` меряет, как быстро сайт отвечает и отвечает ли вообще. Всё на своём сервере, без внешних сервисов. Модуль делает три вещи:
+
+- **замеры сервера** по каждому запросу: время до первого байта, запросы к базе и их время, попадания в кеш и промахи, пиковая память, медленные запросы с их SQL;
+- **Web Vitals посетителей** (LCP, INP, CLS, TTFB, FCP) из настоящих браузеров, скриптом меньше 2 КБ, без cookies и личных данных;
+- **доступность**: главная каждого сайта и адреса, которые вы добавите, открываются раз в минуту; после нескольких отказов подряд открывается инцидент и уходят письмо и сообщение в Telegram.
+
+Цифры — на экране **Состояние сайта → Скорость и доступность**, по дням, неделям или месяцам, как p50, p75 и p95, и в плитке на рабочем столе.
+
+- [Установка](#установка)
+- [Что меряется](#что-меряется)
+- [Экран](#экран)
+- [Доступность и оповещения](#доступность-и-оповещения)
+- [Приватность](#приватность)
+- [Почему это дёшево](#почему-это-дёшево)
+- [Перцентили](#перцентили)
+- [Сколько хранится](#сколько-хранится)
+- [Настройки](#настройки)
+- [Команды](#команды)
+- [Для других пакетов](#для-других-пакетов)
+- [Контраст и графики без цвета](#контраст-и-графики-без-цвета)
+
+## Установка
+
+```bash
+composer require alveby/atrium-monitoring
+php artisan atrium:module:install alveby/atrium-monitoring
+```
+
+Команда создаёт таблицы и включает модуль. До этого пакет ничего не делает: ни посредника, ни скрипта, ни проверок. Сброс буфера, проверки и чистка идут из планировщика Laravel, так что cron должен раз в минуту вызывать `php artisan schedule:run`.
+
+Значения по умолчанию — в `config/atrium-monitoring.php` (`php artisan vendor:publish --tag=atrium-monitoring-config`). Настройки оповещений — в панели, **Модули → Мониторинг**.
+
+Экран открыт каждой роли с правом **Смотреть отчёты о скорости и доступности** (`monitoring.view`). При установке его получают все роли, которым видны проверки доступности; суперадмину оно есть всегда.
+
+## Что меряется
+
+**На сервере** посредник в группе `web` пишет одну строку на запрос:
+
+| Значение | Что это |
+|---|---|
+| Время до первого байта | от начала запроса до готового ответа |
+| База | число запросов и их общее время |
+| Кеш | попадания и промахи (из модуля кеша, если он стоит, см. [ниже](#для-других-пакетов)) |
+| Память | пик памяти запроса |
+| Ошибки | доля ответов с кодом 5xx |
+
+Запросы группируются по **маршруту** (по имени, а если его нет — по шаблону вроде `/catalog/{slug}`), по **сайту** и по **языку**. Запрос к базе дольше 100 мс (`slow_query_ms`) сохраняется со своим SQL, где каждое значение заменено на `?`, так что в журнал не попадают ни почта, ни пароль, ни id; один и тот же запрос из разных мест — одна строка. На один запрос сохраняется не больше 20 медленных.
+
+**В браузере** публичная тема получает скрипт. Он ждёт, пока страницу скроют, и один раз отправляет через `navigator.sendBeacon`:
+
+| Метрика | Хорошо до | Плохо после |
+|---|---|---|
+| LCP, отрисовка крупнейшего элемента | 2,5 с | 4 с |
+| INP, отклик на действие | 200 мс | 500 мс |
+| CLS, сдвиг вёрстки | 0,1 | 0,25 |
+| TTFB, время до первого байта | 800 мс | 1,8 с |
+| FCP, первая отрисовка | 1,8 с | 3 с |
+
+Это пороги Google, и, как у Google, они применяются к 75-му перцентилю. Вместе со страницей уходит тип устройства (телефон, планшет, компьютер — по ширине экрана) и тип связи, если браузер его знает (`4g`, `3g`…).
+
+Другая тема подключает скрипт одним тегом в своём шаблоне:
+
+```blade
+
+```
+
+## Экран
+
+**Состояние сайта → Скорость и доступность** (`/admin/monitoring`) состоит из трёх частей.
+
+- **Сервер**: сколько запросов измерено, время до первого байта (p50, p75, p95), доля ошибок сервера, попадания в кеш, запросов к базе на запрос и память на p95; графики времени до первого байта и времени базы; самые медленные маршруты и запросы. Маршрут открывает этот же экран с фильтром по нему; запрос — свою страницу с его временем по дням и маршрутами, где он выполняется.
+- **Посетители**: пять Web Vitals на p75 с оценкой словами (Хорошо, Требует улучшения, Плохо), график каждой и самые медленные страницы по LCP. Страница открывает экран с фильтром по ней.
+- **Доступность**: каждая проверка со статусом, долей времени в строю и последним ответом, и недавние инциденты.
+
+Фильтры: период (30 дней по дням, 26 недель по неделям, 13 месяцев по месяцам), сайт, язык и устройство. Таблица страниц считает все устройства и языки, поэтому при этих фильтрах она скрыта.
+
+Если стоит журнал ошибок (`alveby/atrium-errors`), у страницы в таблице самых медленных и у страницы на экране запроса есть ссылка на ошибки этого адреса (если администратору можно читать журнал). Группа «Состояние сайта» в боковом меню собирает отчёт, проверки доступности и инциденты рядом с журналом ошибок.
+
+Числа пишутся так, как принято в языке панели: `2.91 s` по-английски, `2,91 с` по-русски.
+
+Плитка рабочего стола **Скорость и доступность** показывает Web Vitals на p75 за 7 дней, доступность за 30 дней, что лежит прямо сейчас, и пять самых медленных маршрутов. Её видят только те, кому открыт экран.
+
+## Доступность и оповещения
+
+Каждую минуту (`atrium:monitoring:uptime`):
+
+1. У каждого включённого сайта есть проверка его главной, по его домену и папке (`https://shop.example.com/`, `https://example.com/blog/`). Выключили сайт — выключается и проверка. Другие адреса добавляются в **Состояние сайта → Проверки доступности**.
+2. Каждый включённый адрес открывается, по десять одновременно, с таймаутом 10 секунд. Ответ меньше 400 — в строю; 4xx, 5xx, таймаут или отказ в соединении — отказ.
+3. Проверка проходит четыре состояния:
+
+| Сейчас | Результат | Дальше | Что происходит |
+|---|---|---|---|
+| любое | в строю | В строю | открытый инцидент закрывается, оповещение «снова работает» |
+| В строю / Не проверялась | отказ, меньше N подряд | Сбоит | пока ничего |
+| Сбоит | N-й отказ подряд | Лежит | открывается инцидент, оповещение «не отвечает» |
+| Лежит | отказ | Лежит | инцидент считает отказы, нового оповещения нет |
+
+N — это **Отказов подряд до инцидента** в настройках (по умолчанию 3: три минуты без ответа).
+
+Оповещения уходят:
+
+- **письмом** на адреса из **Почта для оповещений** (через запятую или с новой строки). Письма идут через почту Laravel; если стоит почтовый модуль, он их перехватывает, со своими ящиками и историей.
+- **в Telegram**: создайте бота у @BotFather, добавьте его в чат или канал и заполните **Токен бота Telegram** и **Чат Telegram** (`-1001234567890` или `@site_alerts`). Токен хранится в таблице настроек, а не в коде; `ATRIUM_MONITORING_TELEGRAM_TOKEN` и `ATRIUM_MONITORING_TELEGRAM_CHAT_ID` в `.env` главнее. Токен никогда не коммитьте.
+
+Оповещение пишется на языке приложения. Неудачное оповещение пишется в лог, без токена, и проверки не останавливает.
+
+## Приватность
+
+- Ни cookies, ни локального хранилища, ни отпечатка браузера.
+- IP-адрес нигде не хранится: он нужен только в памяти, чтобы пускать не больше 30 замеров в минуту с одного адреса.
+- Адрес страницы хранится без строки запроса и `#фрагмента`, так что `?email=` или метка кампании в базу не попадают.
+- Посетителей с **Do Not Track** или **Global Privacy Control** не меряют вовсе: скрипт им даже не выводится.
+- `rum.sample_rate` меряет только часть просмотров (0.1 — каждый десятый).
+- Медленные запросы хранятся со значениями, заменёнными на `?`.
+
+Ничего из этого не требует баннера про cookies.
+
+## Почему это дёшево
+
+Измеренный запрос не трогает базу. Посредник дописывает одну короткую JSON-строку в файл в `storage/app/atrium-monitoring` — уже после того, как ответ отправлен. Раз в минуту `atrium:monitoring:flush` забирает файл переименованием, пишет сырые строки пачками и добавляет каждый запрос в гистограмму его дня, одной транзакцией под блокировкой. Если файл перевалил за 256 КБ раньше, сбрасывает тот запрос, который это заметил, или отдаёт сброс в очередь, если `buffer.queue` называет соединение очереди. `server.sample_rate` меряет только часть запросов.
+
+`php artisan atrium:monitoring:benchmark` меряет, сколько добавляет посредник. Он гоняет один и тот же имитированный запрос (20 запросов к базе, два чтения кеша, через настоящий диспетчер событий) без посредника и с ним, раундами, с записью в настоящий файл, и показывает медианный раунд. Команда падает, если посредник добавляет 1 мс или больше. На PHP 8.4 в Docker (`php:8.4-apache`, Linux, без Xdebug):
+
+| Запросов к базе на запрос | Добавляется на запрос |
+|---|---|
+| 20 | 0,14–0,20 мс |
+| 0 | 0,04 мс |
+
+Xdebug в любом режиме замедляет PHP в разы; мерьте без него.
+
+## Перцентили
+
+p50 — значение, быстрее которого была половина запросов (или просмотров); p75 — три из четырёх; p95 — все, кроме одного из двадцати. По p75 Google оценивает сайт; p95 показывает медленный хвост, который среднее прячет.
+
+Каждый день хранится гистограммой по каждому значению с корзинами через 5% (логарифмическая шкала от 1 мкс), так что перцентиль из неё отличается от точного не больше чем примерно на 2,5%. Гистограммы складываются, поэтому неделя или месяц — это сумма их дней, и перцентили месяца — это перцентили всех его запросов, а не среднее дневных.
+
+## Сколько хранится
+
+| Данные | Сколько | Таблица |
+|---|---|---|
+| Сырые запросы, медленные запросы, просмотры, результаты проверок | 7 дней | `monitoring_requests`, `monitoring_queries`, `monitoring_vitals`, `monitoring_check_results` |
+| Дневные гистограммы | 13 месяцев | `monitoring_daily` |
+| SQL медленных запросов | пока живут их дневные строки | `monitoring_query_texts` |
+| Закрытые инциденты | 13 месяцев | `monitoring_incidents` |
+
+`atrium:monitoring:prune` удаляет остальное каждую ночь в 03:17, кусками по 5000 строк, чтобы большая таблица надолго не блокировалась. Оба срока — в `retention`.
+
+## Настройки
+
+| Ключ | `.env` | По умолчанию | |
+|---|---|---|---|
+| `server.enabled` | `ATRIUM_MONITORING_SERVER` | `true` | замеры сервера |
+| `server.sample_rate` | `ATRIUM_MONITORING_SAMPLE_RATE` | `1.0` | доля измеряемых запросов |
+| `server.slow_query_ms` | `ATRIUM_MONITORING_SLOW_QUERY_MS` | `100` | запрос дольше этого сохраняется |
+| `server.except` | | `up`, `atrium/rum`, `vendor/*`, `build/*`, `storage/*` | пути, которые не меряются |
+| `buffer.path` | `ATRIUM_MONITORING_BUFFER` | `storage/app/atrium-monitoring` | файл буфера |
+| `buffer.max_bytes` | | `262144` | выше — сброс раньше времени |
+| `buffer.queue` | `ATRIUM_MONITORING_QUEUE` | — | соединение очереди для раннего сброса |
+| `buffer.lock_store` | `ATRIUM_MONITORING_LOCK_STORE` | кеш по умолчанию | блокировка сброса; на нескольких серверах — общее хранилище |
+| `rum.enabled` | `ATRIUM_MONITORING_RUM` | `true` | скрипт посетителей |
+| `rum.sample_rate` | `ATRIUM_MONITORING_RUM_SAMPLE_RATE` | `1.0` | доля измеряемых просмотров |
+| `rum.rate_limit` | | `30` | замеров в минуту с одного адреса |
+| `rum.theme` | | `true` | публичная тема выводит скрипт сама |
+| `uptime.enabled` | `ATRIUM_MONITORING_UPTIME` | `true` | проверки доступности |
+| `uptime.scheme` | `ATRIUM_MONITORING_UPTIME_SCHEME` | `https` | схема проверок главных |
+| `uptime.timeout` | | `10` | секунд на проверку |
+| `uptime.failures` | | `3` | значение настройки по умолчанию |
+| `uptime.concurrency` | | `10` | проверок одновременно |
+| `retention.raw_days` | | `7` | |
+| `retention.aggregate_months` | | `13` | |
+| `schedule` | | `true` | ставить задачи в планировщик |
+
+## Команды
+
+| Команда | |
+|---|---|
+| `atrium:monitoring:flush` | записать буфер в базу (каждую минуту) |
+| `atrium:monitoring:uptime` | проверить все адреса (каждую минуту) |
+| `atrium:monitoring:prune` | удалить старые данные (каждый день, 03:17) |
+| `atrium:monitoring:benchmark --requests=2000 --queries=20 --rounds=5` | измерить цену посредника |
+
+С `schedule` = `false` запускайте их по своему расписанию.
+
+## Для других пакетов
+
+**Счётчики кеша.** Если зарегистрирован фильтр `atrium.cache.stats`, модуль берёт попадания и промахи запроса из него, а не считает события кеша Laravel. Фильтр получает `['hits' => 0, 'misses' => 0]` и возвращает числа текущего запроса:
+
+```php
+Hook::filter('atrium.cache.stats', fn (array $stats): array => [
+ 'hits' => $this->hits,
+ 'misses' => $this->misses,
+]);
+```
+
+Модуль читает его, когда запрос завершается. Если вернулся не массив — берутся события.
+
+**Инциденты.** `atrium.monitoring.incident.opened` и `atrium.monitoring.incident.resolved` срабатывают с моделью `Incident` (с загруженной `check`) — для третьего канала вроде Slack или SMS:
+
+```php
+Hook::on('atrium.monitoring.incident.opened', function (Incident $incident): void {
+ // $incident->check->url, $incident->started_at, $incident->last_error
+});
+```
+
+## Контраст и графики без цвета
+
+Каждый график рисует p50, p75 и p95, и их можно различить без цвета: у p50 кружки и сплошная линия, у p75 квадраты и пунктир, у p95 треугольники и точки, а в конце каждой линии подписано её имя. Под каждым графиком те же числа таблицей, а SVG несёт их в `` и `` для экранных чтецов. Оценка написана словами; у статуса доступности есть название и знак (● в строю, ◐ сбоит, ○ лежит).
+
+Цвета линий на фоне панели (контраст по WCAG 2; для текста минимум 4,5:1, для линий 3:1):
+
+| Линия | Светлые темы | на белом | на самом тёмном светлом фоне (#f7f3ec) | Ночь | на #161d27 |
+|---|---|---|---|---|---|
+| p50 | #0B5FA5 | 6,57:1 | 5,94:1 | #6CB4F0 | 7,61:1 |
+| p75 | #B34700 | 5,50:1 | 4,97:1 | #F5A05B | 8,12:1 |
+| p95 | #374151 | 10,31:1 | 9,32:1 | #E5E7EB | 13,69:1 |
+
+Тема «Высокий контраст» рисует все три чёрным (21:1) и различает их только значками и штрихами. Подписи осей — приглушённым цветом темы (7,56:1 на белом в «Графите», 7,13:1 на #161d27 в «Ночи»).
diff --git a/docs/readme/README.be.md b/docs/readme/README.be.md
index 1da7b3ab..881b5286 100644
--- a/docs/readme/README.be.md
+++ b/docs/readme/README.be.md
@@ -124,6 +124,7 @@ php artisan atrium:bitrix:parity
- [Пераезд з 1С-Бітрыкс крок за крокам](../bitrix.md)
- [Рэзервовыя копіі: базы і файлы ў некалькі месцаў, расклад, праверкі, аднаўленне](../backup.md)
- [Памылкі: памылкі PHP, чэргаў і JavaScript у базе сайта, абвесткі, Sentry і свае драйверы](../errors.md)
+- [Хуткасць і даступнасць: таймінгі сервера, Web Vitals наведвальнікаў, праверкі даступнасці з абвесткамі](../monitoring.md)
- [CDN: выявы, паменшаныя копіі і WebP/AVIF, ачыстка кэша, загрузкі ў S3](../cdn.md)
## Пакеты
@@ -138,6 +139,7 @@ php artisan atrium:bitrix:parity
| [`alveby/atrium-docs`](../../packages/docs/README.md) | Дакументацыя з Markdown: версіі і пошук |
| [`alveby/atrium-backup`](../../packages/backup/README.md) | Рэзервовыя копіі баз і файлаў, аднаўленне з адмінкі |
| [`alveby/atrium-errors`](../../packages/errors/README.md) | Улік памылак у базе сайта, абвесткі, Sentry |
+| [`alveby/atrium-monitoring`](../../packages/monitoring/README.md) | Хуткасць сервера і наведвальнікаў, даступнасць і абвесткі, без вонкавых сэрвісаў |
Калі 0.1 з'явіцца на Packagist, у гатовую праграму на Laravel 13 Atrium будзе ўсталёўвацца так:
diff --git a/docs/readme/README.de.md b/docs/readme/README.de.md
index 856515d4..99293f45 100644
--- a/docs/readme/README.de.md
+++ b/docs/readme/README.de.md
@@ -124,6 +124,7 @@ Die Bitrix-Datenbank wird nur gelesen. Tabs, Feldreihenfolge und Listenspalten k
- [Umzug von 1C-Bitrix, Schritt für Schritt](../bitrix.md)
- [Backups: Datenbanken und Dateien an mehrere Orte, Zeitpläne, Prüfungen, Wiederherstellung](../backup.md)
- [Fehler: PHP-, Warteschlangen- und JavaScript-Fehler in der Datenbank der Website, Benachrichtigungen, Sentry und eigene Treiber](../errors.md)
+- [Geschwindigkeit und Erreichbarkeit: Server-Timings, Web Vitals der Besucher, Erreichbarkeitsprüfungen mit Benachrichtigungen](../monitoring.md)
- [CDN: Bilder, verkleinerte Kopien und WebP/AVIF, Cache leeren, Uploads zu S3](../cdn.md)
## Pakete
@@ -138,6 +139,7 @@ Die Bitrix-Datenbank wird nur gelesen. Tabs, Feldreihenfolge und Listenspalten k
| [`alveby/atrium-docs`](../../packages/docs/README.md) | Dokumentation aus Markdown, mit Versionen und Suche |
| [`alveby/atrium-backup`](../../packages/backup/README.md) | Backups der Datenbanken und Dateien, Wiederherstellung im Admin-Bereich |
| [`alveby/atrium-errors`](../../packages/errors/README.md) | Fehlererfassung in der Datenbank der Website, Benachrichtigungen, Sentry |
+| [`alveby/atrium-monitoring`](../../packages/monitoring/README.md) | Geschwindigkeit von Server und Besuchern, Erreichbarkeit und Benachrichtigungen, ohne externe Dienste |
Sobald 0.1 auf Packagist ist, bekommt eine bestehende Laravel-13-Anwendung Atrium so:
diff --git a/docs/readme/README.es.md b/docs/readme/README.es.md
index 68cbee78..4ab5e462 100644
--- a/docs/readme/README.es.md
+++ b/docs/readme/README.es.md
@@ -124,6 +124,7 @@ La base de datos de Bitrix solo se lee. Las pestañas, el orden de los campos y
- [Migrar desde 1C-Bitrix, paso a paso](../bitrix.md)
- [Copias de seguridad: bases de datos y archivos en varios destinos, horarios, comprobaciones, restauración](../backup.md)
- [Errores: errores de PHP, de colas y de JavaScript en la base de datos del sitio, alertas, Sentry y controladores propios](../errors.md)
+- [Velocidad y disponibilidad: tiempos del servidor, Web Vitals de los visitantes, comprobaciones de disponibilidad con avisos](../monitoring.md)
- [CDN: imágenes, copias redimensionadas y WebP/AVIF, purga de caché, subidas a S3](../cdn.md)
## Paquetes
@@ -138,6 +139,7 @@ La base de datos de Bitrix solo se lee. Las pestañas, el orden de los campos y
| [`alveby/atrium-docs`](../../packages/docs/README.md) | Documentación desde Markdown, con versiones y búsqueda |
| [`alveby/atrium-backup`](../../packages/backup/README.md) | Copias de seguridad de bases de datos y archivos, restauración desde el panel |
| [`alveby/atrium-errors`](../../packages/errors/README.md) | Registro de errores en la base de datos del sitio, alertas, Sentry |
+| [`alveby/atrium-monitoring`](../../packages/monitoring/README.md) | Velocidad del servidor y de los visitantes, disponibilidad y avisos, sin servicios externos |
Cuando la 0.1 esté en Packagist, una aplicación Laravel 13 existente podrá añadir Atrium con:
diff --git a/docs/readme/README.fr.md b/docs/readme/README.fr.md
index 41ed5600..3494fd0b 100644
--- a/docs/readme/README.fr.md
+++ b/docs/readme/README.fr.md
@@ -124,6 +124,7 @@ La base de données Bitrix est uniquement lue. Les onglets, l'ordre des champs e
- [Migrer depuis 1C-Bitrix, pas à pas](../bitrix.md)
- [Sauvegardes : bases de données et fichiers vers plusieurs destinations, planification, contrôles, restauration](../backup.md)
- [Erreurs : erreurs PHP, de file d'attente et JavaScript dans la base du site, alertes, Sentry et vos propres pilotes](../errors.md)
+- [Vitesse et disponibilité : temps du serveur, Web Vitals des visiteurs, contrôles de disponibilité avec alertes](../monitoring.md)
- [CDN : images, copies redimensionnées et WebP/AVIF, purge du cache, envois vers S3](../cdn.md)
## Paquets
@@ -138,6 +139,7 @@ La base de données Bitrix est uniquement lue. Les onglets, l'ordre des champs e
| [`alveby/atrium-docs`](../../packages/docs/README.md) | Documentation à partir de Markdown, avec versions et recherche |
| [`alveby/atrium-backup`](../../packages/backup/README.md) | Sauvegardes des bases de données et des fichiers, restauration depuis l'administration |
| [`alveby/atrium-errors`](../../packages/errors/README.md) | Suivi des erreurs dans la base du site, alertes, Sentry |
+| [`alveby/atrium-monitoring`](../../packages/monitoring/README.md) | Vitesse du serveur et des visiteurs, disponibilité et alertes, sans service externe |
Une fois la 0.1 publiée sur Packagist, une application Laravel 13 existante obtiendra Atrium avec :
diff --git a/docs/readme/README.it.md b/docs/readme/README.it.md
index 119671e6..b103f021 100644
--- a/docs/readme/README.it.md
+++ b/docs/readme/README.it.md
@@ -124,6 +124,7 @@ Il database di Bitrix viene solo letto. Le schede, l'ordine dei campi e le colon
- [Migrare da 1C-Bitrix, passo per passo](../bitrix.md)
- [Backup: database e file in più destinazioni, pianificazione, controlli, ripristino](../backup.md)
- [Errori: errori PHP, delle code e JavaScript nel database del sito, avvisi, Sentry e driver propri](../errors.md)
+- [Velocità e disponibilità: tempi del server, Web Vitals dei visitatori, controlli di disponibilità con avvisi](../monitoring.md)
- [CDN: immagini, copie ridimensionate e WebP/AVIF, svuotamento della cache, caricamenti su S3](../cdn.md)
## Pacchetti
@@ -138,6 +139,7 @@ Il database di Bitrix viene solo letto. Le schede, l'ordine dei campi e le colon
| [`alveby/atrium-docs`](../../packages/docs/README.md) | Documentazione da Markdown, con versioni e ricerca |
| [`alveby/atrium-backup`](../../packages/backup/README.md) | Backup di database e file, ripristino dal pannello |
| [`alveby/atrium-errors`](../../packages/errors/README.md) | Tracciamento degli errori nel database del sito, avvisi, Sentry |
+| [`alveby/atrium-monitoring`](../../packages/monitoring/README.md) | Velocità del server e dei visitatori, disponibilità e avvisi, senza servizi esterni |
Quando la 0.1 sarà su Packagist, un'app Laravel 13 esistente potrà aggiungere Atrium con:
diff --git a/docs/readme/README.ja.md b/docs/readme/README.ja.md
index ad073e2d..bcd3737f 100644
--- a/docs/readme/README.ja.md
+++ b/docs/readme/README.ja.md
@@ -124,6 +124,7 @@ Bitrix のデータベースは読み取るだけです。タブ、フィール
- [1C-Bitrix からの移行(手順)](../bitrix.md)
- [バックアップ:データベースとファイルを複数の保存先へ、スケジュール、ヘルスチェック、復元](../backup.md)
- [エラー:PHP・キュー・JavaScript のエラーをサイトのデータベースに保存、通知、Sentry、独自ドライバー](../errors.md)
+- [速度と稼働状況:サーバーの計測、訪問者の Web Vitals、通知付きの死活監視](../monitoring.md)
- [CDN:画像、リサイズしたコピーと WebP/AVIF、キャッシュの削除、S3 へのアップロード](../cdn.md)
## パッケージ
@@ -138,6 +139,7 @@ Bitrix のデータベースは読み取るだけです。タブ、フィール
| [`alveby/atrium-docs`](../../packages/docs/README.md) | Markdownから作るドキュメント(バージョンと検索つき) |
| [`alveby/atrium-backup`](../../packages/backup/README.md) | データベースとファイルのバックアップ、管理画面からの復元 |
| [`alveby/atrium-errors`](../../packages/errors/README.md) | サイトのデータベースでのエラー追跡、通知、Sentry |
+| [`alveby/atrium-monitoring`](../../packages/monitoring/README.md) | サーバーと訪問者の速度、稼働状況と通知、外部サービスなし |
0.1 が Packagist に公開されたら、既存の Laravel 13 アプリには次のコマンドで Atrium を導入できます。
diff --git a/docs/readme/README.kk.md b/docs/readme/README.kk.md
index e2009b59..c648ff32 100644
--- a/docs/readme/README.kk.md
+++ b/docs/readme/README.kk.md
@@ -124,6 +124,7 @@ php artisan atrium:bitrix:parity
- [1С-Битрикстен көшу, қадам-қадаммен](../bitrix.md)
- [Сақтық көшірмелер: дерекқорлар мен файлдар бірнеше орынға, кесте, тексерулер, қалпына келтіру](../backup.md)
- [Қателер: PHP, кезек және JavaScript қателері сайт дерекқорында, хабарламалар, Sentry және өз драйверлеріңіз](../errors.md)
+- [Жылдамдық пен қолжетімділік: сервер уақыттары, келушілердің Web Vitals көрсеткіштері, хабарламалары бар қолжетімділік тексерулері](../monitoring.md)
- [CDN: суреттер, кішірейтілген көшірмелер және WebP/AVIF, кэшті тазалау, S3-ке жүктеу](../cdn.md)
## Пакеттер
@@ -138,6 +139,7 @@ php artisan atrium:bitrix:parity
| [`alveby/atrium-docs`](../../packages/docs/README.md) | Markdown-тан құжаттама: нұсқалар мен іздеу |
| [`alveby/atrium-backup`](../../packages/backup/README.md) | Дерекқорлар мен файлдардың сақтық көшірмелері, әкімшілік панельден қалпына келтіру |
| [`alveby/atrium-errors`](../../packages/errors/README.md) | Сайт дерекқорындағы қателер есебі, хабарламалар, Sentry |
+| [`alveby/atrium-monitoring`](../../packages/monitoring/README.md) | Сервер мен келушілердің жылдамдығы, қолжетімділік пен хабарламалар, сыртқы қызметтерсіз |
0.1 Packagist-те пайда болғанда, Laravel 13-тегі дайын қосымшаға Atrium былай орнатылады:
diff --git a/docs/readme/README.pl.md b/docs/readme/README.pl.md
index 7851dcc2..87c22d73 100644
--- a/docs/readme/README.pl.md
+++ b/docs/readme/README.pl.md
@@ -124,6 +124,7 @@ Baza danych Bitrixa jest tylko odczytywana. Karty, kolejność pól i kolumny li
- [Przeprowadzka z 1C-Bitrix krok po kroku](../bitrix.md)
- [Kopie zapasowe: bazy danych i pliki w kilku miejscach, harmonogram, kontrole, przywracanie](../backup.md)
- [Błędy: błędy PHP, kolejek i JavaScriptu w bazie strony, powiadomienia, Sentry i własne sterowniki](../errors.md)
+- [Szybkość i dostępność: czasy serwera, Web Vitals odwiedzających, kontrole dostępności z powiadomieniami](../monitoring.md)
- [CDN: obrazy, pomniejszone kopie i WebP/AVIF, czyszczenie pamięci podręcznej, przesyłanie do S3](../cdn.md)
## Pakiety
@@ -138,6 +139,7 @@ Baza danych Bitrixa jest tylko odczytywana. Karty, kolejność pól i kolumny li
| [`alveby/atrium-docs`](../../packages/docs/README.md) | Dokumentacja z Markdown, z wersjami i wyszukiwaniem |
| [`alveby/atrium-backup`](../../packages/backup/README.md) | Kopie zapasowe baz danych i plików, przywracanie z panelu |
| [`alveby/atrium-errors`](../../packages/errors/README.md) | Rejestr błędów w bazie strony, powiadomienia, Sentry |
+| [`alveby/atrium-monitoring`](../../packages/monitoring/README.md) | Szybkość serwera i odwiedzających, dostępność i powiadomienia, bez zewnętrznych usług |
Gdy 0.1 trafi na Packagist, do istniejącej aplikacji na Laravel 13 dodasz Atrium tak:
diff --git a/docs/readme/README.pt-BR.md b/docs/readme/README.pt-BR.md
index f72cda63..b846679a 100644
--- a/docs/readme/README.pt-BR.md
+++ b/docs/readme/README.pt-BR.md
@@ -124,6 +124,7 @@ O banco de dados do Bitrix é apenas lido. As abas, a ordem dos campos e as colu
- [Migrar do 1C-Bitrix, passo a passo](../bitrix.md)
- [Backups: bancos de dados e arquivos em vários destinos, agendamento, verificações, restauração](../backup.md)
- [Erros: erros de PHP, de filas e de JavaScript no banco do site, alertas, Sentry e drivers próprios](../errors.md)
+- [Velocidade e disponibilidade: tempos do servidor, Web Vitals dos visitantes, verificações de disponibilidade com alertas](../monitoring.md)
- [CDN: imagens, cópias redimensionadas e WebP/AVIF, limpeza de cache, uploads para S3](../cdn.md)
## Pacotes
@@ -138,6 +139,7 @@ O banco de dados do Bitrix é apenas lido. As abas, a ordem dos campos e as colu
| [`alveby/atrium-docs`](../../packages/docs/README.md) | Documentação a partir de Markdown, com versões e busca |
| [`alveby/atrium-backup`](../../packages/backup/README.md) | Backups dos bancos de dados e arquivos, restauração pelo painel |
| [`alveby/atrium-errors`](../../packages/errors/README.md) | Registro de erros no banco do site, alertas, Sentry |
+| [`alveby/atrium-monitoring`](../../packages/monitoring/README.md) | Velocidade do servidor e dos visitantes, disponibilidade e alertas, sem serviços externos |
Quando a 0.1 estiver no Packagist, uma aplicação Laravel 13 existente poderá receber o Atrium com:
diff --git a/docs/readme/README.ru.md b/docs/readme/README.ru.md
index 079ef9fa..8e5f0608 100644
--- a/docs/readme/README.ru.md
+++ b/docs/readme/README.ru.md
@@ -122,6 +122,7 @@ php artisan atrium:bitrix:parity
- [Переезд с 1С-Битрикс по шагам](../bitrix.ru.md)
- [Резервные копии: базы и файлы в несколько мест, расписание, проверки, восстановление](../backup.ru.md)
- [Ошибки: ошибки PHP, очередей и JavaScript в базе сайта, оповещения, Sentry и свои драйверы](../errors.ru.md)
+- [Скорость и доступность: замеры сервера, Web Vitals посетителей, проверки доступности с оповещениями](../monitoring.ru.md)
- [CDN: картинки, уменьшенные копии и WebP/AVIF, сброс кеша, загрузки в S3](../cdn.ru.md)
## Пакеты
@@ -136,6 +137,7 @@ php artisan atrium:bitrix:parity
| [`alveby/atrium-docs`](../../packages/docs/README.md) | Документация из Markdown: версии и поиск |
| [`alveby/atrium-backup`](../../packages/backup/README.md) | Резервные копии баз и файлов, восстановление из админки |
| [`alveby/atrium-errors`](../../packages/errors/README.md) | Учёт ошибок в базе сайта, оповещения, Sentry |
+| [`alveby/atrium-monitoring`](../../packages/monitoring/README.md) | Скорость сервера и посетителей, доступность и оповещения, без внешних сервисов |
Когда 0.1 появится на Packagist, в готовое приложение на Laravel 13 Atrium будет ставиться так:
diff --git a/docs/readme/README.tr.md b/docs/readme/README.tr.md
index f3ccd41a..12e8f650 100644
--- a/docs/readme/README.tr.md
+++ b/docs/readme/README.tr.md
@@ -124,6 +124,7 @@ Bitrix veritabanından yalnızca okuma yapılır. Sekmeler, alan sırası ve lis
- [1C-Bitrix’ten adım adım taşınma](../bitrix.md)
- [Yedekler: veritabanları ve dosyalar birden çok yere, zamanlama, sağlık kontrolleri, geri yükleme](../backup.md)
- [Hatalar: PHP, kuyruk ve JavaScript hataları sitenin veritabanında, uyarılar, Sentry ve kendi sürücüleriniz](../errors.md)
+- [Hız ve erişilebilirlik: sunucu süreleri, ziyaretçilerin Web Vitals değerleri, uyarılı erişilebilirlik kontrolleri](../monitoring.md)
- [CDN: görseller, küçültülmüş kopyalar ve WebP/AVIF, önbellek temizleme, S3'e yükleme](../cdn.md)
## Paketler
@@ -138,6 +139,7 @@ Bitrix veritabanından yalnızca okuma yapılır. Sekmeler, alan sırası ve lis
| [`alveby/atrium-docs`](../../packages/docs/README.md) | Markdown’dan belgeler, sürümler ve arama ile |
| [`alveby/atrium-backup`](../../packages/backup/README.md) | Veritabanı ve dosya yedekleri, yönetim panelinden geri yükleme |
| [`alveby/atrium-errors`](../../packages/errors/README.md) | Sitenin veritabanında hata takibi, uyarılar, Sentry |
+| [`alveby/atrium-monitoring`](../../packages/monitoring/README.md) | Sunucu ve ziyaretçi hızı, erişilebilirlik ve uyarılar, dış hizmet olmadan |
0.1 Packagist'te yayımlandığında, mevcut bir Laravel 13 uygulamasına Atrium şu şekilde eklenecek:
diff --git a/docs/readme/README.uk.md b/docs/readme/README.uk.md
index d7c1e544..decf227a 100644
--- a/docs/readme/README.uk.md
+++ b/docs/readme/README.uk.md
@@ -124,6 +124,7 @@ php artisan atrium:bitrix:parity
- [Переїзд з 1С-Бітрікс крок за кроком](../bitrix.md)
- [Резервні копії: бази й файли в кілька місць, розклад, перевірки, відновлення](../backup.md)
- [Помилки: помилки PHP, черг і JavaScript у базі сайту, сповіщення, Sentry і власні драйвери](../errors.md)
+- [Швидкість і доступність: заміри сервера, Web Vitals відвідувачів, перевірки доступності зі сповіщеннями](../monitoring.md)
- [CDN: зображення, зменшені копії й WebP/AVIF, очищення кешу, завантаження в S3](../cdn.md)
## Пакети
@@ -138,6 +139,7 @@ php artisan atrium:bitrix:parity
| [`alveby/atrium-docs`](../../packages/docs/README.md) | Документація з Markdown: версії та пошук |
| [`alveby/atrium-backup`](../../packages/backup/README.md) | Резервні копії баз і файлів, відновлення з адмінки |
| [`alveby/atrium-errors`](../../packages/errors/README.md) | Облік помилок у базі сайту, сповіщення, Sentry |
+| [`alveby/atrium-monitoring`](../../packages/monitoring/README.md) | Швидкість сервера й відвідувачів, доступність і сповіщення, без зовнішніх сервісів |
Коли 0.1 з'явиться на Packagist, у готовий застосунок на Laravel 13 Atrium встановлюватиметься так:
diff --git a/docs/readme/README.uz.md b/docs/readme/README.uz.md
index 7777a42f..b0f0ab32 100644
--- a/docs/readme/README.uz.md
+++ b/docs/readme/README.uz.md
@@ -124,6 +124,7 @@ Bitrix maʼlumotlar bazasi faqat oʻqiladi. Yorliqlar, maydonlar tartibi va roʻ
- [1C-Bitrixdan koʻchish, qadamma-qadam](../bitrix.md)
- [Zaxira nusxalar: bazalar va fayllar bir nechta joyga, jadval, tekshiruvlar, tiklash](../backup.md)
- [Xatolar: PHP, navbat va JavaScript xatolari sayt bazasida, ogohlantirishlar, Sentry va oʻz drayverlaringiz](../errors.md)
+- [Tezlik va mavjudlik: server o‘lchovlari, tashrifchilarning Web Vitals ko‘rsatkichlari, xabarnomali mavjudlik tekshiruvlari](../monitoring.md)
- [CDN: rasmlar, kichraytirilgan nusxalar va WebP/AVIF, keshni tozalash, S3 ga yuklash](../cdn.md)
## Paketlar
@@ -138,6 +139,7 @@ Bitrix maʼlumotlar bazasi faqat oʻqiladi. Yorliqlar, maydonlar tartibi va roʻ
| [`alveby/atrium-docs`](../../packages/docs/README.md) | Markdown’dan hujjatlar: versiyalar va qidiruv |
| [`alveby/atrium-backup`](../../packages/backup/README.md) | Bazalar va fayllarning zaxira nusxalari, admin paneldan tiklash |
| [`alveby/atrium-errors`](../../packages/errors/README.md) | Sayt bazasida xatolar hisobi, ogohlantirishlar, Sentry |
+| [`alveby/atrium-monitoring`](../../packages/monitoring/README.md) | Server va tashrifchilar tezligi, mavjudlik va xabarnomalar, tashqi xizmatlarsiz |
0.1 versiyasi Packagist saytida paydo boʻlgach, mavjud Laravel 13 ilovasiga Atrium quyidagicha oʻrnatiladi:
diff --git a/docs/readme/README.zh-CN.md b/docs/readme/README.zh-CN.md
index 707ad241..caa81e48 100644
--- a/docs/readme/README.zh-CN.md
+++ b/docs/readme/README.zh-CN.md
@@ -124,6 +124,7 @@ Bitrix 数据库只读不写。标签页、字段顺序和列表列会保持编
- [从 1C-Bitrix 迁移,分步说明](../bitrix.md)
- [备份:数据库和文件同时存到多个位置、计划任务、健康检查、恢复](../backup.md)
- [错误:PHP、队列和 JavaScript 错误保存在站点数据库中,告警、Sentry 和自定义驱动](../errors.md)
+- [速度与可用性:服务器耗时、访客的 Web Vitals、带告警的可用性检查](../monitoring.md)
- [CDN:图片、缩放副本与 WebP/AVIF、清除缓存、上传到 S3](../cdn.md)
## 软件包
@@ -138,6 +139,7 @@ Bitrix 数据库只读不写。标签页、字段顺序和列表列会保持编
| [`alveby/atrium-docs`](../../packages/docs/README.md) | 由 Markdown 生成的文档,支持版本和搜索 |
| [`alveby/atrium-backup`](../../packages/backup/README.md) | 数据库和文件的备份,可在后台恢复 |
| [`alveby/atrium-errors`](../../packages/errors/README.md) | 在站点数据库中跟踪错误,告警、Sentry |
+| [`alveby/atrium-monitoring`](../../packages/monitoring/README.md) | 服务器与访客的速度、可用性与告警,无需外部服务 |
0.1 上架 Packagist 后,现有的 Laravel 13 应用可以这样安装 Atrium:
diff --git a/packages/admin/resources/js/Components/Admin/Dashboard/MonitoringGadget.vue b/packages/admin/resources/js/Components/Admin/Dashboard/MonitoringGadget.vue
new file mode 100644
index 00000000..9c126ee1
--- /dev/null
+++ b/packages/admin/resources/js/Components/Admin/Dashboard/MonitoringGadget.vue
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+ {{ data.labels.down }}: {{ data.down.join(', ') }}
+
+
+
+
+
{{ data.labels.uptime }}
+
{{ data.uptime === null ? '—' : `${number(data.uptime, page.props.locale)}%` }}
+
+
+
{{ data.labels.slowest }}
+
+
+ {{ row.route }}
+ {{ row.p75 }}
+
+ —
+
+
+
+
+
{{ data.labels.vitals }}
+
+
+
{{ vital.key.toUpperCase() }}
+ {{ vital.value }}
+ {{ rating(vital.rating) }}
+
+
+
+
diff --git a/packages/admin/resources/js/Components/Admin/Monitoring/MonitoringChart.vue b/packages/admin/resources/js/Components/Admin/Monitoring/MonitoringChart.vue
new file mode 100644
index 00000000..d63f8bcf
--- /dev/null
+++ b/packages/admin/resources/js/Components/Admin/Monitoring/MonitoringChart.vue
@@ -0,0 +1,114 @@
+
+
+
+
+ {{ title }}
+ {{ l('charts.legend') }}
+
+
+
+ {{ l('charts.table') }}
+
+
+
+
+ {{ l('columns.period') }}
+ {{ l('columns.count') }}
+ p50
+ p75
+ p95
+
+
+
+
+ {{ point.label }}
+ {{ point.count }}
+ {{ point.p50 }}
+ {{ point.p75 }}
+ {{ point.p95 }}
+
+
+
+
+
+
+
+
+
diff --git a/packages/admin/resources/js/Components/Admin/Monitoring/labels.js b/packages/admin/resources/js/Components/Admin/Monitoring/labels.js
new file mode 100644
index 00000000..fe6d1263
--- /dev/null
+++ b/packages/admin/resources/js/Components/Admin/Monitoring/labels.js
@@ -0,0 +1,30 @@
+/*
+ * This file is part of Atrium (https://github.com/AlveBy/atrium).
+ * Copyright (c) 2026 AlveBy. Licensed under the MIT License, see LICENSE.
+ */
+
+/**
+ * A string of the monitoring module by its dotted key, with :placeholders
+ * filled in. The strings come from the server in a `t` prop: they are the
+ * module's, not in the panel's own dictionary.
+ */
+export function label(strings, key, params = {}) {
+ let line = key.split('.').reduce((node, part) => (node && typeof node === 'object' ? node[part] : undefined), strings)
+
+ if (typeof line !== 'string') {
+ return key
+ }
+
+ for (const [name, value] of Object.entries(params)) {
+ line = line.replaceAll(`:${name}`, String(value ?? ''))
+ }
+
+ return line
+}
+
+/**
+ * A number in the panel's language: 99,5 in Russian, 99.5 in English.
+ */
+export function number(value, locale) {
+ return Number(value).toLocaleString(String(locale || 'en').replace('_', '-'), { maximumFractionDigits: 2 })
+}
diff --git a/packages/admin/resources/js/Pages/Admin/Dashboard.vue b/packages/admin/resources/js/Pages/Admin/Dashboard.vue
index 346e7905..315f4fbf 100644
--- a/packages/admin/resources/js/Pages/Admin/Dashboard.vue
+++ b/packages/admin/resources/js/Pages/Admin/Dashboard.vue
@@ -16,12 +16,14 @@ import SiteSpeedGadget from '@atrium/Components/Admin/Dashboard/SiteSpeedGadget.
import PerformanceGadget from '@atrium/Components/Admin/Dashboard/PerformanceGadget.vue'
import RecentElementsGadget from '@atrium/Components/Admin/Dashboard/RecentElementsGadget.vue'
import ErrorsGadget from '@atrium/Components/Admin/Dashboard/ErrorsGadget.vue'
+import MonitoringGadget from '@atrium/Components/Admin/Dashboard/MonitoringGadget.vue'
const COMPONENTS = {
SiteSpeedGadget,
PerformanceGadget,
RecentElementsGadget,
ErrorsGadget,
+ MonitoringGadget,
}
const props = defineProps({
diff --git a/packages/admin/resources/js/Pages/Admin/Monitoring/Index.vue b/packages/admin/resources/js/Pages/Admin/Monitoring/Index.vue
new file mode 100644
index 00000000..cad13d91
--- /dev/null
+++ b/packages/admin/resources/js/Pages/Admin/Monitoring/Index.vue
@@ -0,0 +1,304 @@
+
+
+
+
+
+
{{ l('title') }}
+
{{ l('privacy') }}
+
+
+
+
+
+
+ {{ l('sections.server') }}
+
+
+
+
{{ l('summary.requests') }}
+ {{ server.summary.requests }}
+
+
+
{{ l('summary.ttfb') }}, p75
+ {{ server.summary.ttfb.p75 }}
+ p50 {{ server.summary.ttfb.p50 }} · p95 {{ server.summary.ttfb.p95 }}
+
+
+
{{ l('summary.errors') }}
+ {{ percent(server.summary.errors) }}
+
+
+
{{ l('summary.cache_ratio') }}
+ {{ percent(server.summary.cache_ratio) }}
+
+
+
{{ l('summary.queries') }}
+ {{ server.summary.queries === null ? '—' : num(server.summary.queries) }}
+
+
+
{{ l('summary.memory_p95') }}
+ {{ server.summary.memory_p95 === null ? '—' : `${num(server.summary.memory_p95)} ${l('summary.mb')}` }}
+
+
+
+
+
+
+
+
+
+ {{ l('no_data') }}
+
+
+
+
+ {{ l('columns.route') }}
+ {{ l('columns.count') }}
+ p50
+ p75
+ p95
+
+
+
+
+
+ {{ row.route }}
+ {{ row.sample }}
+
+ {{ row.count }}
+ {{ row.p50 }}
+ {{ row.p75 }}
+ {{ row.p95 }}
+
+
+
+
+
+
+
+ {{ l('no_data') }}
+
+
+
+
+ {{ l('columns.query') }}
+ {{ l('columns.count') }}
+ p75
+ p95
+
+
+
+
+
+ {{ row.sql }}
+
+ {{ row.count }}
+ {{ row.p75 }}
+ {{ row.p95 }}
+
+
+
+
+
+
+
+
+
+ {{ l('sections.vitals') }}
+
+
+
+
{{ l(`vitals.${metric.key}`) }} ({{ metric.key.toUpperCase() }}), p75
+ {{ metric.p75 }}
+ {{ rating(metric.rating) }}
+ {{ l('vitals.thresholds', { good: metric.thresholds[0], poor: metric.thresholds[1] }) }}
+ {{ l('columns.count') }}: {{ metric.count }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ l('columns.page') }}
+ {{ l('columns.rating') }}
+ {{ l('columns.count') }}
+ p75
+ p95
+
+
+
+
+
+ {{ row.page }}
+ {{ l('links.errors') }}
+
+ {{ rating(row.rating) }}
+ {{ row.count }}
+ {{ row.p75 }}
+ {{ row.p95 }}
+
+
+
+
+
+
+
+
+ {{ l('sections.uptime') }}
+
+
+
+ {{ l('no_data') }}
+
+
+
+
+ {{ l('columns.check') }}
+ {{ l('columns.status') }}
+ {{ l('columns.uptime') }}
+ {{ l('columns.response') }}
+
+
+
+
+
+ {{ check.name }}
+ {{ check.url }}
+ {{ check.error }}
+
+
+ {{ { up: '●', failing: '◐', down: '○', unknown: '·' }[check.status] }}
+ {{ l(`status.${check.status}`) }}
+ {{ check.checked_at }}
+
+ {{ percent(check.uptime) }}
+ {{ check.response ?? '—' }}
+
+
+
+
+
+
+
+ {{ l('no_data') }}
+
+
+
+
+ {{ l('columns.check') }}
+ {{ l('fields.started_at') }}
+ {{ l('fields.duration') }}
+
+
+
+
+
+ {{ incident.check }}
+ {{ incident.error }}
+
+ {{ incident.started_at }}
+
+ {{ incident.duration }}
+ ({{ l('ongoing') }})
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/admin/resources/js/Pages/Admin/Monitoring/Query.vue b/packages/admin/resources/js/Pages/Admin/Monitoring/Query.vue
new file mode 100644
index 00000000..9be27db8
--- /dev/null
+++ b/packages/admin/resources/js/Pages/Admin/Monitoring/Query.vue
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+ {{ query.sql }}
+
+
{{ l('columns.connection') }}: {{ query.connection }}
+
{{ l('columns.last_seen') }}: {{ query.last_seen }}
+
+
+
+
+
+
+ {{ l('no_data') }}
+
+
+
+
+ {{ l('columns.route') }}
+ {{ l('columns.times') }}
+ {{ l('columns.average') }}
+ {{ l('columns.slowest') }}
+
+
+
+
+
+ {{ row.route }}
+ {{ row.path }}
+ {{ l('links.errors') }}
+
+ {{ row.times }}
+ {{ row.average }}
+ {{ row.slowest }}
+
+
+
+
+
+
+
+
diff --git a/packages/monitoring/.gitattributes b/packages/monitoring/.gitattributes
new file mode 100644
index 00000000..412f37e8
--- /dev/null
+++ b/packages/monitoring/.gitattributes
@@ -0,0 +1,4 @@
+/tests export-ignore
+/phpunit.xml.dist export-ignore
+/.gitattributes export-ignore
+/.gitignore export-ignore
diff --git a/packages/monitoring/LICENSE b/packages/monitoring/LICENSE
new file mode 100644
index 00000000..27de5bfc
--- /dev/null
+++ b/packages/monitoring/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 AlveBy
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/packages/monitoring/README.md b/packages/monitoring/README.md
new file mode 100644
index 00000000..cbd7b91d
--- /dev/null
+++ b/packages/monitoring/README.md
@@ -0,0 +1,34 @@
+# Atrium Monitoring
+
+Speed and uptime for the [Atrium](https://github.com/AlveBy/atrium) admin, on your own server, with no outside service:
+
+- **server timings** of every request: time to the first byte, database queries and their time, cache hits and misses, peak memory, slow queries with their SQL (values replaced by `?`), by route, site and language;
+- **visitors' Web Vitals** (LCP, INP, CLS, TTFB, FCP) through a script under 2 KB sent with `sendBeacon`: no cookies, no IP stored, no query strings, Do Not Track and Global Privacy Control respected, a sample rate;
+- **uptime** of every site's front page and the addresses you add, every minute; an incident after a number of failures in a row, with an e-mail and a Telegram message;
+- **Site health → Speed and uptime**: p50, p75 and p95 by day, week or month, the slowest routes, queries and pages, the checks and incidents, and a dashboard tile.
+
+Measurements go to a file and reach the database once a minute, in one transaction: the middleware adds about 0.15 ms to a request with 20 queries (`php artisan atrium:monitoring:benchmark`). Raw data is kept 7 days, daily percentiles 13 months.
+
+## Install
+
+```bash
+composer require alveby/atrium-monitoring
+php artisan atrium:module:install alveby/atrium-monitoring
+```
+
+Cron must call `php artisan schedule:run` every minute. Alerts are set in **Modules → Monitoring**; the Telegram token can also come from `ATRIUM_MONITORING_TELEGRAM_TOKEN`.
+
+## Commands
+
+```bash
+php artisan atrium:monitoring:flush
+php artisan atrium:monitoring:uptime
+php artisan atrium:monitoring:prune
+php artisan atrium:monitoring:benchmark
+```
+
+Everything else, including privacy, the percentile maths, the configuration and the hooks for other packages: [docs/monitoring.md](https://github.com/AlveBy/atrium/blob/main/docs/monitoring.md).
+
+## License
+
+MIT
diff --git a/packages/monitoring/composer.json b/packages/monitoring/composer.json
new file mode 100644
index 00000000..384eec2d
--- /dev/null
+++ b/packages/monitoring/composer.json
@@ -0,0 +1,72 @@
+{
+ "name": "alveby/atrium-monitoring",
+ "description": "Load monitoring for Atrium: server timings, real user Web Vitals and uptime checks with alerts, all on your own server",
+ "type": "atrium-module",
+ "license": "MIT",
+ "homepage": "https://github.com/AlveBy/atrium",
+ "support": {
+ "issues": "https://github.com/AlveBy/atrium/issues",
+ "source": "https://github.com/AlveBy/atrium"
+ },
+ "keywords": [
+ "laravel",
+ "admin",
+ "cms",
+ "monitoring",
+ "web-vitals",
+ "uptime",
+ "performance",
+ "multisite"
+ ],
+ "require": {
+ "php": "^8.3",
+ "illuminate/support": "^13.0",
+ "alveby/atrium": "^0.1"
+ },
+ "require-dev": {
+ "orchestra/testbench": "^11.0",
+ "phpunit/phpunit": "^12.5"
+ },
+ "suggest": {
+ "alveby/atrium-theme": "Puts the Web Vitals script into the public pages by itself",
+ "alveby/atrium-mail": "Sends the incident letters through the mail module's accounts and history"
+ },
+ "autoload": {
+ "psr-4": {
+ "Atrium\\Monitoring\\": "src/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Atrium\\Monitoring\\Tests\\": "tests/"
+ }
+ },
+ "extra": {
+ "atrium": {
+ "key": "monitoring",
+ "title": "atrium-monitoring::monitoring.title",
+ "settings": "Atrium\\Monitoring\\MonitoringSettings",
+ "permissions": {
+ "view": {
+ "label": "atrium-monitoring::monitoring.permissions.view",
+ "with": "uptime_checks.view"
+ }
+ },
+ "resources": [
+ "Atrium\\Monitoring\\Models\\UptimeCheck",
+ "Atrium\\Monitoring\\Models\\Incident"
+ ],
+ "migrations": "database/migrations"
+ },
+ "laravel": {
+ "providers": [
+ "Atrium\\Monitoring\\MonitoringServiceProvider"
+ ]
+ },
+ "branch-alias": {
+ "dev-main": "0.1.x-dev"
+ }
+ },
+ "minimum-stability": "dev",
+ "prefer-stable": true
+}
diff --git a/packages/monitoring/config/atrium-monitoring.php b/packages/monitoring/config/atrium-monitoring.php
new file mode 100644
index 00000000..26aeba20
--- /dev/null
+++ b/packages/monitoring/config/atrium-monitoring.php
@@ -0,0 +1,122 @@
+ [
+ 'enabled' => (bool) env('ATRIUM_MONITORING_SERVER', true),
+ 'sample_rate' => (float) env('ATRIUM_MONITORING_SAMPLE_RATE', 1.0),
+ 'slow_query_ms' => (float) env('ATRIUM_MONITORING_SLOW_QUERY_MS', 100),
+ 'except' => ['up', 'atrium/rum', 'vendor/*', 'build/*', 'storage/*'],
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Buffer
+ |--------------------------------------------------------------------------
+ |
+ | Measurements are appended to a file (one short line each) and written
+ | to the database in batches: by `atrium:monitoring:flush` every minute,
+ | or as soon as the file passes `max_bytes`. With `queue` set to a queue
+ | connection, that early flush runs on the queue instead of at the end of
+ | the request that noticed it.
+ |
+ */
+ 'buffer' => [
+ 'path' => env('ATRIUM_MONITORING_BUFFER', storage_path('app/atrium-monitoring')),
+ 'max_bytes' => 262144,
+ 'queue' => env('ATRIUM_MONITORING_QUEUE'),
+ 'lock_store' => env('ATRIUM_MONITORING_LOCK_STORE'),
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Real user monitoring
+ |--------------------------------------------------------------------------
+ |
+ | A script under 2 KB in the public pages sends LCP, INP, CLS, TTFB and
+ | FCP once per page view with navigator.sendBeacon. No cookies, nothing
+ | personal; the address is kept without its query string and IPs are not
+ | stored. Visitors with Do Not Track or Global Privacy Control are not
+ | measured at all. `rate_limit` is beacons per minute from one address.
+ |
+ */
+ 'rum' => [
+ 'enabled' => (bool) env('ATRIUM_MONITORING_RUM', true),
+ 'sample_rate' => (float) env('ATRIUM_MONITORING_RUM_SAMPLE_RATE', 1.0),
+ 'max_bytes' => 2048,
+ 'rate_limit' => 30,
+ // The public theme gets the script by itself; other themes put
+ // in their layout.
+ 'theme' => true,
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Uptime
+ |--------------------------------------------------------------------------
+ |
+ | Every minute the front page of each active site and the addresses
+ | added under "Uptime checks" are opened. After `failures` failed checks
+ | in a row an incident is opened and the alerts go out; the first good
+ | check closes it. The number, the e-mail addresses and the Telegram bot
+ | are set on the module's settings screen.
+ |
+ */
+ 'uptime' => [
+ 'enabled' => (bool) env('ATRIUM_MONITORING_UPTIME', true),
+ 'scheme' => env('ATRIUM_MONITORING_UPTIME_SCHEME', 'https'),
+ 'timeout' => 10,
+ 'failures' => 3,
+ 'concurrency' => 10,
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Retention
+ |--------------------------------------------------------------------------
+ |
+ | Raw measurements are kept `raw_days`, daily aggregates (percentiles of
+ | every day) `aggregate_months`. `atrium:monitoring:prune` runs daily.
+ |
+ */
+ 'retention' => [
+ 'raw_days' => 7,
+ 'aggregate_months' => 13,
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Telegram
+ |--------------------------------------------------------------------------
+ |
+ | The bot's token and chat may be set on the settings screen; these win
+ | when set. Never commit a token.
+ |
+ */
+ 'telegram' => [
+ 'token' => env('ATRIUM_MONITORING_TELEGRAM_TOKEN'),
+ 'chat_id' => env('ATRIUM_MONITORING_TELEGRAM_CHAT_ID'),
+ ],
+
+ // Whether the module adds its tasks to Laravel's scheduler.
+ 'schedule' => true,
+];
diff --git a/packages/monitoring/database/migrations/2026_11_17_300001_create_monitoring_raw_tables.php b/packages/monitoring/database/migrations/2026_11_17_300001_create_monitoring_raw_tables.php
new file mode 100644
index 00000000..c050a94f
--- /dev/null
+++ b/packages/monitoring/database/migrations/2026_11_17_300001_create_monitoring_raw_tables.php
@@ -0,0 +1,81 @@
+id();
+ $table->timestamp('created_at')->index();
+ $table->unsignedBigInteger('site_id')->default(0);
+ $table->string('locale', 12)->default('');
+ $table->string('route', 191);
+ $table->string('path', 255);
+ $table->string('method', 8);
+ $table->unsignedSmallInteger('status');
+ $table->double('duration_ms');
+ $table->unsignedInteger('db_queries');
+ $table->double('db_ms');
+ $table->unsignedInteger('cache_hits');
+ $table->unsignedInteger('cache_misses');
+ $table->unsignedInteger('memory_kb');
+ $table->index(['route', 'created_at']);
+ });
+
+ Schema::create('monitoring_queries', function (Blueprint $table): void {
+ $table->id();
+ $table->timestamp('created_at')->index();
+ $table->unsignedBigInteger('site_id')->default(0);
+ $table->string('route', 191);
+ $table->string('path', 255);
+ $table->char('sql_hash', 40)->index();
+ $table->double('duration_ms');
+ });
+
+ // The SQL of a slow query by its hash, as long as its daily rows live.
+ Schema::create('monitoring_query_texts', function (Blueprint $table): void {
+ $table->char('hash', 40)->primary();
+ $table->text('sql');
+ $table->string('connection', 64)->default('');
+ $table->timestamp('last_seen_at')->index();
+ });
+
+ Schema::create('monitoring_vitals', function (Blueprint $table): void {
+ $table->id();
+ $table->timestamp('created_at')->index();
+ $table->unsignedBigInteger('site_id')->default(0);
+ $table->string('locale', 12)->default('');
+ $table->string('path', 255);
+ $table->string('device', 8);
+ $table->string('connection', 8);
+ $table->double('lcp')->nullable();
+ $table->double('inp')->nullable();
+ $table->double('cls')->nullable();
+ $table->double('ttfb')->nullable();
+ $table->double('fcp')->nullable();
+ });
+ }
+
+ public function down(): void
+ {
+ Schema::dropIfExists('monitoring_vitals');
+ Schema::dropIfExists('monitoring_query_texts');
+ Schema::dropIfExists('monitoring_queries');
+ Schema::dropIfExists('monitoring_requests');
+ }
+};
diff --git a/packages/monitoring/database/migrations/2026_11_17_300002_create_monitoring_daily_table.php b/packages/monitoring/database/migrations/2026_11_17_300002_create_monitoring_daily_table.php
new file mode 100644
index 00000000..5ad1f232
--- /dev/null
+++ b/packages/monitoring/database/migrations/2026_11_17_300002_create_monitoring_daily_table.php
@@ -0,0 +1,49 @@
+id();
+ $table->date('day');
+ $table->string('source', 12);
+ $table->string('metric', 12);
+ $table->unsignedBigInteger('site_id')->default(0);
+ $table->string('locale', 12)->default('*');
+ $table->string('subject', 191)->default('*');
+ $table->string('device', 8)->default('*');
+ $table->unsignedBigInteger('count');
+ $table->double('sum');
+ $table->double('min');
+ $table->double('max');
+ $table->text('buckets');
+ $table->unique(['day', 'source', 'metric', 'site_id', 'locale', 'subject', 'device'], 'monitoring_daily_key');
+ $table->index(['source', 'metric', 'day']);
+ });
+ }
+
+ public function down(): void
+ {
+ Schema::dropIfExists('monitoring_daily');
+ }
+};
diff --git a/packages/monitoring/database/migrations/2026_11_17_300003_create_monitoring_uptime_tables.php b/packages/monitoring/database/migrations/2026_11_17_300003_create_monitoring_uptime_tables.php
new file mode 100644
index 00000000..cfa6c134
--- /dev/null
+++ b/packages/monitoring/database/migrations/2026_11_17_300003_create_monitoring_uptime_tables.php
@@ -0,0 +1,62 @@
+id();
+ $table->foreignId('site_id')->nullable()->index();
+ $table->string('name');
+ $table->string('url', 2048);
+ // The front page of a site: made and kept up to date by itself.
+ $table->boolean('is_home')->default(false);
+ $table->boolean('active')->default(true);
+ $table->string('status', 8)->default('unknown');
+ $table->unsignedInteger('failures')->default(0);
+ $table->timestamp('last_checked_at')->nullable();
+ $table->unsignedSmallInteger('last_status_code')->nullable();
+ $table->double('last_response_ms')->nullable();
+ $table->string('last_error')->nullable();
+ $table->timestamps();
+ });
+
+ Schema::create('monitoring_check_results', function (Blueprint $table): void {
+ $table->id();
+ $table->foreignId('check_id')->index();
+ $table->timestamp('checked_at')->index();
+ $table->boolean('ok');
+ $table->unsignedSmallInteger('status_code')->nullable();
+ $table->double('response_ms')->nullable();
+ $table->string('error')->nullable();
+ });
+
+ Schema::create('monitoring_incidents', function (Blueprint $table): void {
+ $table->id();
+ $table->foreignId('check_id')->index();
+ $table->timestamp('started_at');
+ $table->timestamp('resolved_at')->nullable();
+ $table->unsignedInteger('failures')->default(0);
+ $table->string('last_error')->nullable();
+ $table->timestamps();
+ });
+ }
+
+ public function down(): void
+ {
+ Schema::dropIfExists('monitoring_incidents');
+ Schema::dropIfExists('monitoring_check_results');
+ Schema::dropIfExists('monitoring_checks');
+ }
+};
diff --git a/packages/monitoring/lang/be/monitoring.php b/packages/monitoring/lang/be/monitoring.php
new file mode 100644
index 00000000..a1289048
--- /dev/null
+++ b/packages/monitoring/lang/be/monitoring.php
@@ -0,0 +1,167 @@
+ 'Маніторынг',
+ 'menu' => 'Хуткасць і даступнасць',
+ 'health' => 'Стан сайта',
+ 'no_data' => 'Даных пакуль няма',
+ 'minutes' => ':count хвіліна|:count хвіліны|:count хвілін',
+
+ 'modules' => [
+ 'checks' => 'Праверкі даступнасці',
+ 'incidents' => 'Інцыдэнты',
+ ],
+ 'create' => [
+ 'check' => 'Дадаць праверку',
+ ],
+ 'fields' => [
+ 'name' => 'Назва',
+ 'url' => 'Адрас',
+ 'status' => 'Стан',
+ 'last_error' => 'Апошняя памылка',
+ 'response_ms' => 'Адказ',
+ 'checked_at' => 'Праверана',
+ 'check' => 'Праверка',
+ 'started_at' => 'Пачатак',
+ 'resolved_at' => 'Канец',
+ 'duration' => 'Працягласць',
+ 'failures' => 'Няўдалых праверак',
+ ],
+ 'hints' => [
+ 'url' => 'Адкрываецца раз на хвіліну. Галоўная старонка кожнага сайта правяраецца сама.',
+ ],
+ 'status' => [
+ 'unknown' => 'Яшчэ не правяралася',
+ 'up' => 'Працуе',
+ 'failing' => 'Збоіць',
+ 'down' => 'Не працуе',
+ ],
+
+ 'settings' => [
+ 'description' => 'Каго апавяшчаць, калі сайт перастаў адказваць, і пасля колькіх няўдалых праверак запар.',
+ 'failures' => 'Няўдалых праверак да інцыдэнту',
+ 'failures_hint' => 'Праверка ідзе раз на хвіліну: 3 — гэта тры хвіліны без адказу.',
+ 'alert_emails' => 'Пошта для апавяшчэнняў',
+ 'alert_emails_hint' => 'Адзін або некалькі адрасоў праз коску або з новага радка.',
+ 'telegram_token' => 'Токен Telegram-бота',
+ 'telegram_token_hint' => 'Выдае @BotFather. Захоўваецца ў базе, а не ў кодзе; ATRIUM_MONITORING_TELEGRAM_TOKEN у .env мае перавагу.',
+ 'telegram_chat_id' => 'Чат Telegram',
+ 'telegram_chat_id_hint' => 'Нумар чата накшталт -1001234567890 або канал накшталт @site_alerts. Бот павінен быць яго ўдзельнікам.',
+ ],
+
+ 'alert' => [
+ 'opened_subject' => 'Не працуе: :name',
+ 'opened_body' => ":url не адказвае :failures праверак запар, з :since.\nАпошняя памылка: :error",
+ 'resolved_subject' => 'Зноў працуе: :name',
+ 'resolved_body' => ':url зноў адказвае, прастой доўжыўся :duration.',
+ ],
+
+ 'filters' => [
+ 'period' => 'Перыяд',
+ 'site' => 'Сайт',
+ 'locale' => 'Мова',
+ 'device' => 'Прылада',
+ 'all' => 'Усе',
+ 'route' => 'Маршрут',
+ 'page' => 'Старонка',
+ 'clear' => 'Паказаць усё',
+ ],
+ 'periods' => [
+ 'day' => 'Па днях, 30 дзён',
+ 'week' => 'Па тыднях, 26 тыдняў',
+ 'month' => 'Па месяцах, 13 месяцаў',
+ ],
+ 'devices' => [
+ 'mobile' => 'Тэлефон',
+ 'tablet' => 'Планшэт',
+ 'desktop' => 'Камп\'ютар',
+ ],
+
+ 'sections' => [
+ 'server' => 'Сервер',
+ 'vitals' => 'Наведвальнікі (Web Vitals)',
+ 'uptime' => 'Даступнасць',
+ 'routes' => 'Самыя павольныя маршруты',
+ 'queries' => 'Самыя павольныя запыты',
+ 'pages' => 'Самыя павольныя старонкі (LCP)',
+ 'incidents' => 'Апошнія інцыдэнты',
+ 'routes_of_query' => 'Дзе выконваецца (апошнія 7 дзён)',
+ ],
+ 'summary' => [
+ 'requests' => 'Вымерана запытаў',
+ 'ttfb' => 'Час да першага байта',
+ 'errors' => 'Памылкі сервера',
+ 'cache_ratio' => 'Трапленні ў кэш',
+ 'queries' => 'Запытаў да базы на старонку',
+ 'memory_p95' => 'Памяць, p95',
+ 'mb' => 'МБ',
+ ],
+ 'charts' => [
+ 'ttfb' => 'Час да першага байта',
+ 'db_ms' => 'Час базы на запыт',
+ 'query_time' => 'Час запыту',
+ 'table' => 'Лікі графіка',
+ 'legend' => 'p50: палова запытаў была хутчэйшай (круг, суцэльная лінія). p75: тры з чатырох (квадрат, пункцір). p95: усе, акрамя аднаго з дваццаці (трохкутнік, кропкі).',
+ ],
+ 'columns' => [
+ 'period' => 'Перыяд',
+ 'count' => 'Вымерана',
+ 'route' => 'Маршрут',
+ 'page' => 'Старонка',
+ 'query' => 'Запыт',
+ 'open' => 'Адкрыць',
+ 'check' => 'Адрас',
+ 'status' => 'Стан',
+ 'uptime' => 'Даступнасць',
+ 'response' => 'Адказ',
+ 'checked_at' => 'Праверана',
+ 'times' => 'Разоў',
+ 'average' => 'У сярэднім',
+ 'slowest' => 'Даўжэй за ўсё',
+ 'connection' => 'Сувязь',
+ 'last_seen' => 'Апошні раз',
+ 'rating' => 'Ацэнка',
+ ],
+ 'vitals' => [
+ 'lcp' => 'Адмалёўка галоўнага блока (LCP)',
+ 'inp' => 'Водгук на дзеянне (INP)',
+ 'cls' => 'Зрух вёрсткі (CLS)',
+ 'ttfb' => 'Першы байт (TTFB)',
+ 'fcp' => 'Першая адмалёўка (FCP)',
+ 'thresholds' => 'Добра да :good, дрэнна вышэй за :poor',
+ ],
+ 'ratings' => [
+ 'good' => 'Добра',
+ 'needs_improvement' => 'Прымальна',
+ 'poor' => 'Дрэнна',
+ ],
+ 'links' => [
+ 'errors' => 'Памылкі гэтай старонкі',
+ ],
+ 'gadget' => [
+ 'title' => 'Хуткасць і даступнасць',
+ 'vitals' => 'Наведвальнікі, p75 за 7 дзён',
+ 'uptime' => 'Даступнасць за 30 дзён',
+ 'down' => 'Цяпер не працуе',
+ 'slowest' => 'Павольныя маршруты, p75',
+ 'open' => 'Адкрыць маніторынг',
+ ],
+ 'privacy' => 'Вымяраецца без cookie і асабістых даных; наведвальнікі з Do Not Track не ўлічваюцца.',
+ 'back' => 'Назад да маніторынгу',
+ 'ongoing' => 'працягваецца',
+ 'units' => [
+ 'decimal' => ',',
+ 'ms' => ':value мс',
+ 's' => ':value с',
+ ],
+ 'permissions' => [
+ 'view' => 'Прагляд справаздач пра хуткасць і даступнасць',
+ ],
+];
diff --git a/packages/monitoring/lang/de/monitoring.php b/packages/monitoring/lang/de/monitoring.php
new file mode 100644
index 00000000..fed3d4a4
--- /dev/null
+++ b/packages/monitoring/lang/de/monitoring.php
@@ -0,0 +1,167 @@
+ 'Monitoring',
+ 'menu' => 'Geschwindigkeit und Erreichbarkeit',
+ 'health' => 'Website-Zustand',
+ 'no_data' => 'Noch keine Daten',
+ 'minutes' => ':count Minute|:count Minuten',
+
+ 'modules' => [
+ 'checks' => 'Erreichbarkeitsprüfungen',
+ 'incidents' => 'Vorfälle',
+ ],
+ 'create' => [
+ 'check' => 'Prüfung hinzufügen',
+ ],
+ 'fields' => [
+ 'name' => 'Name',
+ 'url' => 'Adresse',
+ 'status' => 'Status',
+ 'last_error' => 'Letzter Fehler',
+ 'response_ms' => 'Antwort',
+ 'checked_at' => 'Geprüft',
+ 'check' => 'Prüfung',
+ 'started_at' => 'Beginn',
+ 'resolved_at' => 'Ende',
+ 'duration' => 'Dauer',
+ 'failures' => 'Fehlgeschlagene Prüfungen',
+ ],
+ 'hints' => [
+ 'url' => 'Wird jede Minute aufgerufen. Die Startseite jeder Website wird automatisch geprüft.',
+ ],
+ 'status' => [
+ 'unknown' => 'Noch nicht geprüft',
+ 'up' => 'Erreichbar',
+ 'failing' => 'Gestört',
+ 'down' => 'Nicht erreichbar',
+ ],
+
+ 'settings' => [
+ 'description' => 'Wer benachrichtigt wird, wenn eine Website nicht mehr antwortet, und nach wie vielen fehlgeschlagenen Prüfungen in Folge.',
+ 'failures' => 'Fehlgeschlagene Prüfungen bis zum Vorfall',
+ 'failures_hint' => 'Geprüft wird jede Minute: 3 bedeutet drei Minuten ohne Antwort.',
+ 'alert_emails' => 'E-Mail-Adressen für Warnungen',
+ 'alert_emails_hint' => 'Eine oder mehrere Adressen, getrennt durch Kommas oder Zeilenumbrüche.',
+ 'telegram_token' => 'Telegram-Bot-Token',
+ 'telegram_token_hint' => 'Von @BotFather. Wird in der Datenbank gespeichert, nicht im Code; ATRIUM_MONITORING_TELEGRAM_TOKEN in der .env hat Vorrang.',
+ 'telegram_chat_id' => 'Telegram-Chat',
+ 'telegram_chat_id_hint' => 'Eine Chat-ID wie -1001234567890 oder ein Kanal wie @site_alerts. Der Bot muss Mitglied sein.',
+ ],
+
+ 'alert' => [
+ 'opened_subject' => 'Nicht erreichbar: :name',
+ 'opened_body' => ":url antwortet seit :since auf :failures Prüfungen in Folge nicht.\nLetzter Fehler: :error",
+ 'resolved_subject' => 'Wieder erreichbar: :name',
+ 'resolved_body' => ':url antwortet nach :duration wieder.',
+ ],
+
+ 'filters' => [
+ 'period' => 'Zeitraum',
+ 'site' => 'Website',
+ 'locale' => 'Sprache',
+ 'device' => 'Gerät',
+ 'all' => 'Alle',
+ 'route' => 'Route',
+ 'page' => 'Seite',
+ 'clear' => 'Alles anzeigen',
+ ],
+ 'periods' => [
+ 'day' => 'Pro Tag, 30 Tage',
+ 'week' => 'Pro Woche, 26 Wochen',
+ 'month' => 'Pro Monat, 13 Monate',
+ ],
+ 'devices' => [
+ 'mobile' => 'Smartphone',
+ 'tablet' => 'Tablet',
+ 'desktop' => 'Computer',
+ ],
+
+ 'sections' => [
+ 'server' => 'Server',
+ 'vitals' => 'Besucher (Web Vitals)',
+ 'uptime' => 'Erreichbarkeit',
+ 'routes' => 'Langsamste Routen',
+ 'queries' => 'Langsamste Abfragen',
+ 'pages' => 'Langsamste Seiten (LCP)',
+ 'incidents' => 'Letzte Vorfälle',
+ 'routes_of_query' => 'Wo sie läuft (letzte 7 Tage)',
+ ],
+ 'summary' => [
+ 'requests' => 'Gemessene Anfragen',
+ 'ttfb' => 'Zeit bis zum ersten Byte',
+ 'errors' => 'Serverfehler',
+ 'cache_ratio' => 'Cache-Treffer',
+ 'queries' => 'Abfragen pro Anfrage',
+ 'memory_p95' => 'Arbeitsspeicher, p95',
+ 'mb' => 'MB',
+ ],
+ 'charts' => [
+ 'ttfb' => 'Zeit bis zum ersten Byte',
+ 'db_ms' => 'Datenbankzeit pro Anfrage',
+ 'query_time' => 'Abfragezeit',
+ 'table' => 'Die Zahlen zum Diagramm',
+ 'legend' => 'p50: Die Hälfte der Anfragen war schneller (Kreis, durchgezogene Linie). p75: drei von vier (Quadrat, gestrichelt). p95: alle bis auf eine von zwanzig (Dreieck, gepunktet).',
+ ],
+ 'columns' => [
+ 'period' => 'Zeitraum',
+ 'count' => 'Gemessen',
+ 'route' => 'Route',
+ 'page' => 'Seite',
+ 'query' => 'Abfrage',
+ 'open' => 'Öffnen',
+ 'check' => 'Adresse',
+ 'status' => 'Status',
+ 'uptime' => 'Erreichbarkeit',
+ 'response' => 'Antwort',
+ 'checked_at' => 'Geprüft',
+ 'times' => 'Anzahl',
+ 'average' => 'Durchschnitt',
+ 'slowest' => 'Am langsamsten',
+ 'connection' => 'Verbindung',
+ 'last_seen' => 'Zuletzt gesehen',
+ 'rating' => 'Bewertung',
+ ],
+ 'vitals' => [
+ 'lcp' => 'Größtes Element sichtbar (LCP)',
+ 'inp' => 'Reaktion auf Eingabe (INP)',
+ 'cls' => 'Layoutverschiebung (CLS)',
+ 'ttfb' => 'Zeit bis zum ersten Byte (TTFB)',
+ 'fcp' => 'Erster sichtbarer Inhalt (FCP)',
+ 'thresholds' => 'Gut bis :good, schlecht über :poor',
+ ],
+ 'ratings' => [
+ 'good' => 'Gut',
+ 'needs_improvement' => 'Verbesserungswürdig',
+ 'poor' => 'Schlecht',
+ ],
+ 'links' => [
+ 'errors' => 'Fehler dieser Seite',
+ ],
+ 'gadget' => [
+ 'title' => 'Geschwindigkeit und Erreichbarkeit',
+ 'vitals' => 'Besucher, p75 über 7 Tage',
+ 'uptime' => 'Erreichbarkeit über 30 Tage',
+ 'down' => 'Aktuell nicht erreichbar',
+ 'slowest' => 'Langsamste Routen, p75',
+ 'open' => 'Monitoring öffnen',
+ ],
+ 'privacy' => 'Gemessen ohne Cookies und personenbezogene Daten; Besucher mit Do Not Track werden nicht erfasst.',
+ 'back' => 'Zurück zum Monitoring',
+ 'ongoing' => 'laufend',
+ 'units' => [
+ 'decimal' => ',',
+ 'ms' => ':value ms',
+ 's' => ':value s',
+ ],
+ 'permissions' => [
+ 'view' => 'Berichte zu Geschwindigkeit und Erreichbarkeit ansehen',
+ ],
+];
diff --git a/packages/monitoring/lang/en/monitoring.php b/packages/monitoring/lang/en/monitoring.php
new file mode 100644
index 00000000..71a0cfa1
--- /dev/null
+++ b/packages/monitoring/lang/en/monitoring.php
@@ -0,0 +1,167 @@
+ 'Monitoring',
+ 'menu' => 'Speed and uptime',
+ 'health' => 'Site health',
+ 'no_data' => 'No data yet',
+ 'minutes' => ':count minute|:count minutes',
+
+ 'modules' => [
+ 'checks' => 'Uptime checks',
+ 'incidents' => 'Incidents',
+ ],
+ 'create' => [
+ 'check' => 'Add a check',
+ ],
+ 'fields' => [
+ 'name' => 'Name',
+ 'url' => 'Address',
+ 'status' => 'Status',
+ 'last_error' => 'Last error',
+ 'response_ms' => 'Response',
+ 'checked_at' => 'Checked',
+ 'check' => 'Check',
+ 'started_at' => 'Started',
+ 'resolved_at' => 'Resolved',
+ 'duration' => 'Duration',
+ 'failures' => 'Failed checks',
+ ],
+ 'hints' => [
+ 'url' => 'Opened every minute. The front page of each site is checked by itself.',
+ ],
+ 'status' => [
+ 'unknown' => 'Not checked yet',
+ 'up' => 'Up',
+ 'failing' => 'Failing',
+ 'down' => 'Down',
+ ],
+
+ 'settings' => [
+ 'description' => 'Who is told when a site stops answering, and after how many failed checks in a row.',
+ 'failures' => 'Failed checks before an incident',
+ 'failures_hint' => 'Checks run every minute: 3 means three minutes without an answer.',
+ 'alert_emails' => 'Alert e-mails',
+ 'alert_emails_hint' => 'One or more addresses, separated by commas or new lines.',
+ 'telegram_token' => 'Telegram bot token',
+ 'telegram_token_hint' => 'From @BotFather. Kept in the database, never in the code; ATRIUM_MONITORING_TELEGRAM_TOKEN in .env wins.',
+ 'telegram_chat_id' => 'Telegram chat',
+ 'telegram_chat_id_hint' => 'A chat id such as -1001234567890 or a channel such as @site_alerts. The bot must be a member.',
+ ],
+
+ 'alert' => [
+ 'opened_subject' => 'Down: :name',
+ 'opened_body' => ":url has not answered :failures checks in a row since :since.\nLast error: :error",
+ 'resolved_subject' => 'Back up: :name',
+ 'resolved_body' => ':url answers again after :duration.',
+ ],
+
+ 'filters' => [
+ 'period' => 'Period',
+ 'site' => 'Site',
+ 'locale' => 'Language',
+ 'device' => 'Device',
+ 'all' => 'All',
+ 'route' => 'Route',
+ 'page' => 'Page',
+ 'clear' => 'Show everything',
+ ],
+ 'periods' => [
+ 'day' => 'By day, 30 days',
+ 'week' => 'By week, 26 weeks',
+ 'month' => 'By month, 13 months',
+ ],
+ 'devices' => [
+ 'mobile' => 'Phone',
+ 'tablet' => 'Tablet',
+ 'desktop' => 'Computer',
+ ],
+
+ 'sections' => [
+ 'server' => 'Server',
+ 'vitals' => 'Visitors (Web Vitals)',
+ 'uptime' => 'Uptime',
+ 'routes' => 'Slowest routes',
+ 'queries' => 'Slowest queries',
+ 'pages' => 'Slowest pages (LCP)',
+ 'incidents' => 'Recent incidents',
+ 'routes_of_query' => 'Where it runs (last 7 days)',
+ ],
+ 'summary' => [
+ 'requests' => 'Requests measured',
+ 'ttfb' => 'Time to first byte',
+ 'errors' => 'Server errors',
+ 'cache_ratio' => 'Cache hits',
+ 'queries' => 'Queries per request',
+ 'memory_p95' => 'Memory, p95',
+ 'mb' => 'MB',
+ ],
+ 'charts' => [
+ 'ttfb' => 'Time to first byte',
+ 'db_ms' => 'Database time per request',
+ 'query_time' => 'Query time',
+ 'table' => 'The numbers of the chart',
+ 'legend' => 'p50: half of the requests were faster (circle, solid line). p75: three in four (square, dashed). p95: all but one in twenty (triangle, dotted).',
+ ],
+ 'columns' => [
+ 'period' => 'Period',
+ 'count' => 'Measured',
+ 'route' => 'Route',
+ 'page' => 'Page',
+ 'query' => 'Query',
+ 'open' => 'Open',
+ 'check' => 'Address',
+ 'status' => 'Status',
+ 'uptime' => 'Uptime',
+ 'response' => 'Response',
+ 'checked_at' => 'Checked',
+ 'times' => 'Times',
+ 'average' => 'Average',
+ 'slowest' => 'Slowest',
+ 'connection' => 'Connection',
+ 'last_seen' => 'Last seen',
+ 'rating' => 'Rating',
+ ],
+ 'vitals' => [
+ 'lcp' => 'Largest Contentful Paint',
+ 'inp' => 'Interaction to Next Paint',
+ 'cls' => 'Cumulative Layout Shift',
+ 'ttfb' => 'Time to First Byte',
+ 'fcp' => 'First Contentful Paint',
+ 'thresholds' => 'Good up to :good, poor above :poor',
+ ],
+ 'ratings' => [
+ 'good' => 'Good',
+ 'needs_improvement' => 'Needs improvement',
+ 'poor' => 'Poor',
+ ],
+ 'links' => [
+ 'errors' => 'Errors on this page',
+ ],
+ 'gadget' => [
+ 'title' => 'Speed and uptime',
+ 'vitals' => 'Visitors, p75 over 7 days',
+ 'uptime' => 'Uptime over 30 days',
+ 'down' => 'Down now',
+ 'slowest' => 'Slowest routes, p75',
+ 'open' => 'Open monitoring',
+ ],
+ 'privacy' => 'Measured without cookies or personal data; visitors with Do Not Track are left out.',
+ 'back' => 'Back to monitoring',
+ 'ongoing' => 'ongoing',
+ 'units' => [
+ 'decimal' => '.',
+ 'ms' => ':value ms',
+ 's' => ':value s',
+ ],
+ 'permissions' => [
+ 'view' => 'View speed and uptime reports',
+ ],
+];
diff --git a/packages/monitoring/lang/es/monitoring.php b/packages/monitoring/lang/es/monitoring.php
new file mode 100644
index 00000000..b78df5fc
--- /dev/null
+++ b/packages/monitoring/lang/es/monitoring.php
@@ -0,0 +1,167 @@
+ 'Monitorización',
+ 'menu' => 'Velocidad y disponibilidad',
+ 'health' => 'Estado del sitio',
+ 'no_data' => 'Aún no hay datos',
+ 'minutes' => ':count minuto|:count minutos',
+
+ 'modules' => [
+ 'checks' => 'Comprobaciones de disponibilidad',
+ 'incidents' => 'Incidencias',
+ ],
+ 'create' => [
+ 'check' => 'Añadir una comprobación',
+ ],
+ 'fields' => [
+ 'name' => 'Nombre',
+ 'url' => 'Dirección',
+ 'status' => 'Estado',
+ 'last_error' => 'Último error',
+ 'response_ms' => 'Respuesta',
+ 'checked_at' => 'Comprobado',
+ 'check' => 'Comprobación',
+ 'started_at' => 'Inicio',
+ 'resolved_at' => 'Fin',
+ 'duration' => 'Duración',
+ 'failures' => 'Comprobaciones fallidas',
+ ],
+ 'hints' => [
+ 'url' => 'Se abre cada minuto. La página principal de cada sitio se comprueba sola.',
+ ],
+ 'status' => [
+ 'unknown' => 'Aún sin comprobar',
+ 'up' => 'Funciona',
+ 'failing' => 'Con fallos',
+ 'down' => 'No funciona',
+ ],
+
+ 'settings' => [
+ 'description' => 'A quién avisar cuando un sitio deja de responder y tras cuántas comprobaciones fallidas seguidas.',
+ 'failures' => 'Comprobaciones fallidas antes de una incidencia',
+ 'failures_hint' => 'Se comprueba cada minuto: 3 son tres minutos sin respuesta.',
+ 'alert_emails' => 'Correos de alerta',
+ 'alert_emails_hint' => 'Una o varias direcciones, separadas por comas o saltos de línea.',
+ 'telegram_token' => 'Token del bot de Telegram',
+ 'telegram_token_hint' => 'Lo entrega @BotFather. Se guarda en la base de datos, no en el código; ATRIUM_MONITORING_TELEGRAM_TOKEN en .env tiene prioridad.',
+ 'telegram_chat_id' => 'Chat de Telegram',
+ 'telegram_chat_id_hint' => 'Un ID de chat como -1001234567890 o un canal como @site_alerts. El bot debe ser miembro.',
+ ],
+
+ 'alert' => [
+ 'opened_subject' => 'Caído: :name',
+ 'opened_body' => ":url no responde desde :since, tras :failures comprobaciones seguidas.\nÚltimo error: :error",
+ 'resolved_subject' => 'Recuperado: :name',
+ 'resolved_body' => ':url vuelve a responder tras :duration.',
+ ],
+
+ 'filters' => [
+ 'period' => 'Periodo',
+ 'site' => 'Sitio',
+ 'locale' => 'Idioma',
+ 'device' => 'Dispositivo',
+ 'all' => 'Todos',
+ 'route' => 'Ruta',
+ 'page' => 'Página',
+ 'clear' => 'Mostrar todo',
+ ],
+ 'periods' => [
+ 'day' => 'Por día, 30 días',
+ 'week' => 'Por semana, 26 semanas',
+ 'month' => 'Por mes, 13 meses',
+ ],
+ 'devices' => [
+ 'mobile' => 'Teléfono',
+ 'tablet' => 'Tableta',
+ 'desktop' => 'Ordenador',
+ ],
+
+ 'sections' => [
+ 'server' => 'Servidor',
+ 'vitals' => 'Visitantes (Web Vitals)',
+ 'uptime' => 'Disponibilidad',
+ 'routes' => 'Rutas más lentas',
+ 'queries' => 'Consultas más lentas',
+ 'pages' => 'Páginas más lentas (LCP)',
+ 'incidents' => 'Incidencias recientes',
+ 'routes_of_query' => 'Dónde se ejecuta (últimos 7 días)',
+ ],
+ 'summary' => [
+ 'requests' => 'Peticiones medidas',
+ 'ttfb' => 'Tiempo hasta el primer byte',
+ 'errors' => 'Errores del servidor',
+ 'cache_ratio' => 'Aciertos de caché',
+ 'queries' => 'Consultas por petición',
+ 'memory_p95' => 'Memoria, p95',
+ 'mb' => 'MB',
+ ],
+ 'charts' => [
+ 'ttfb' => 'Tiempo hasta el primer byte',
+ 'db_ms' => 'Tiempo de base de datos por petición',
+ 'query_time' => 'Tiempo de la consulta',
+ 'table' => 'Los números del gráfico',
+ 'legend' => 'p50: la mitad de las peticiones fue más rápida (círculo, línea continua). p75: tres de cada cuatro (cuadrado, línea discontinua). p95: todas menos una de cada veinte (triángulo, línea de puntos).',
+ ],
+ 'columns' => [
+ 'period' => 'Periodo',
+ 'count' => 'Medido',
+ 'route' => 'Ruta',
+ 'page' => 'Página',
+ 'query' => 'Consulta',
+ 'open' => 'Abrir',
+ 'check' => 'Dirección',
+ 'status' => 'Estado',
+ 'uptime' => 'Disponibilidad',
+ 'response' => 'Respuesta',
+ 'checked_at' => 'Comprobado',
+ 'times' => 'Veces',
+ 'average' => 'Media',
+ 'slowest' => 'Más lento',
+ 'connection' => 'Conexión',
+ 'last_seen' => 'Visto por última vez',
+ 'rating' => 'Valoración',
+ ],
+ 'vitals' => [
+ 'lcp' => 'Elemento más grande visible (LCP)',
+ 'inp' => 'Respuesta a la interacción (INP)',
+ 'cls' => 'Desplazamiento del diseño (CLS)',
+ 'ttfb' => 'Tiempo hasta el primer byte (TTFB)',
+ 'fcp' => 'Primer contenido visible (FCP)',
+ 'thresholds' => 'Bueno hasta :good, malo por encima de :poor',
+ ],
+ 'ratings' => [
+ 'good' => 'Bueno',
+ 'needs_improvement' => 'Mejorable',
+ 'poor' => 'Malo',
+ ],
+ 'links' => [
+ 'errors' => 'Errores de esta página',
+ ],
+ 'gadget' => [
+ 'title' => 'Velocidad y disponibilidad',
+ 'vitals' => 'Visitantes, p75 en 7 días',
+ 'uptime' => 'Disponibilidad en 30 días',
+ 'down' => 'Caído ahora',
+ 'slowest' => 'Rutas más lentas, p75',
+ 'open' => 'Abrir la monitorización',
+ ],
+ 'privacy' => 'Se mide sin cookies ni datos personales; los visitantes con Do Not Track quedan fuera.',
+ 'back' => 'Volver a la monitorización',
+ 'ongoing' => 'en curso',
+ 'units' => [
+ 'decimal' => ',',
+ 'ms' => ':value ms',
+ 's' => ':value s',
+ ],
+ 'permissions' => [
+ 'view' => 'Ver los informes de velocidad y disponibilidad',
+ ],
+];
diff --git a/packages/monitoring/lang/fr/monitoring.php b/packages/monitoring/lang/fr/monitoring.php
new file mode 100644
index 00000000..0f32abad
--- /dev/null
+++ b/packages/monitoring/lang/fr/monitoring.php
@@ -0,0 +1,167 @@
+ 'Supervision',
+ 'menu' => 'Vitesse et disponibilité',
+ 'health' => 'État du site',
+ 'no_data' => 'Aucune donnée pour l\'instant',
+ 'minutes' => ':count minute|:count minutes',
+
+ 'modules' => [
+ 'checks' => 'Vérifications de disponibilité',
+ 'incidents' => 'Incidents',
+ ],
+ 'create' => [
+ 'check' => 'Ajouter une vérification',
+ ],
+ 'fields' => [
+ 'name' => 'Nom',
+ 'url' => 'Adresse',
+ 'status' => 'État',
+ 'last_error' => 'Dernière erreur',
+ 'response_ms' => 'Réponse',
+ 'checked_at' => 'Vérifié',
+ 'check' => 'Vérification',
+ 'started_at' => 'Début',
+ 'resolved_at' => 'Fin',
+ 'duration' => 'Durée',
+ 'failures' => 'Vérifications échouées',
+ ],
+ 'hints' => [
+ 'url' => 'Ouverte chaque minute. La page d\'accueil de chaque site est vérifiée d\'office.',
+ ],
+ 'status' => [
+ 'unknown' => 'Pas encore vérifié',
+ 'up' => 'En ligne',
+ 'failing' => 'Instable',
+ 'down' => 'Hors service',
+ ],
+
+ 'settings' => [
+ 'description' => 'Qui prévenir lorsqu\'un site ne répond plus, et après combien de vérifications échouées d\'affilée.',
+ 'failures' => 'Vérifications échouées avant un incident',
+ 'failures_hint' => 'Une vérification par minute : 3 signifie trois minutes sans réponse.',
+ 'alert_emails' => 'E-mails d\'alerte',
+ 'alert_emails_hint' => 'Une ou plusieurs adresses, séparées par des virgules ou des retours à la ligne.',
+ 'telegram_token' => 'Jeton du bot Telegram',
+ 'telegram_token_hint' => 'Fourni par @BotFather. Conservé en base de données, jamais dans le code ; ATRIUM_MONITORING_TELEGRAM_TOKEN dans .env a la priorité.',
+ 'telegram_chat_id' => 'Conversation Telegram',
+ 'telegram_chat_id_hint' => 'Un identifiant de conversation comme -1001234567890 ou un canal comme @site_alerts. Le bot doit en être membre.',
+ ],
+
+ 'alert' => [
+ 'opened_subject' => 'Hors service : :name',
+ 'opened_body' => ":url ne répond plus depuis :since, après :failures vérifications consécutives.\nDernière erreur : :error",
+ 'resolved_subject' => 'De nouveau en ligne : :name',
+ 'resolved_body' => ':url répond de nouveau après :duration.',
+ ],
+
+ 'filters' => [
+ 'period' => 'Période',
+ 'site' => 'Site',
+ 'locale' => 'Langue',
+ 'device' => 'Appareil',
+ 'all' => 'Tous',
+ 'route' => 'Route',
+ 'page' => 'Page',
+ 'clear' => 'Tout afficher',
+ ],
+ 'periods' => [
+ 'day' => 'Par jour, 30 jours',
+ 'week' => 'Par semaine, 26 semaines',
+ 'month' => 'Par mois, 13 mois',
+ ],
+ 'devices' => [
+ 'mobile' => 'Téléphone',
+ 'tablet' => 'Tablette',
+ 'desktop' => 'Ordinateur',
+ ],
+
+ 'sections' => [
+ 'server' => 'Serveur',
+ 'vitals' => 'Visiteurs (Web Vitals)',
+ 'uptime' => 'Disponibilité',
+ 'routes' => 'Routes les plus lentes',
+ 'queries' => 'Requêtes les plus lentes',
+ 'pages' => 'Pages les plus lentes (LCP)',
+ 'incidents' => 'Incidents récents',
+ 'routes_of_query' => 'Où elle s\'exécute (7 derniers jours)',
+ ],
+ 'summary' => [
+ 'requests' => 'Requêtes mesurées',
+ 'ttfb' => 'Temps jusqu\'au premier octet',
+ 'errors' => 'Erreurs serveur',
+ 'cache_ratio' => 'Succès du cache',
+ 'queries' => 'Requêtes SQL par requête',
+ 'memory_p95' => 'Mémoire, p95',
+ 'mb' => 'Mo',
+ ],
+ 'charts' => [
+ 'ttfb' => 'Temps jusqu\'au premier octet',
+ 'db_ms' => 'Temps de base de données par requête',
+ 'query_time' => 'Durée de la requête',
+ 'table' => 'Les chiffres du graphique',
+ 'legend' => 'p50 : la moitié des requêtes était plus rapide (cercle, trait plein). p75 : trois sur quatre (carré, tirets). p95 : toutes sauf une sur vingt (triangle, pointillés).',
+ ],
+ 'columns' => [
+ 'period' => 'Période',
+ 'count' => 'Mesures',
+ 'route' => 'Route',
+ 'page' => 'Page',
+ 'query' => 'Requête',
+ 'open' => 'Ouvrir',
+ 'check' => 'Adresse',
+ 'status' => 'État',
+ 'uptime' => 'Disponibilité',
+ 'response' => 'Réponse',
+ 'checked_at' => 'Vérifié',
+ 'times' => 'Fois',
+ 'average' => 'Moyenne',
+ 'slowest' => 'Le plus lent',
+ 'connection' => 'Connexion',
+ 'last_seen' => 'Dernière fois',
+ 'rating' => 'Évaluation',
+ ],
+ 'vitals' => [
+ 'lcp' => 'Affichage du plus grand élément (LCP)',
+ 'inp' => 'Réactivité à l\'interaction (INP)',
+ 'cls' => 'Décalage de mise en page (CLS)',
+ 'ttfb' => 'Temps jusqu\'au premier octet (TTFB)',
+ 'fcp' => 'Premier affichage (FCP)',
+ 'thresholds' => 'Bon jusqu\'à :good, mauvais au-delà de :poor',
+ ],
+ 'ratings' => [
+ 'good' => 'Bon',
+ 'needs_improvement' => 'À améliorer',
+ 'poor' => 'Mauvais',
+ ],
+ 'links' => [
+ 'errors' => 'Erreurs de cette page',
+ ],
+ 'gadget' => [
+ 'title' => 'Vitesse et disponibilité',
+ 'vitals' => 'Visiteurs, p75 sur 7 jours',
+ 'uptime' => 'Disponibilité sur 30 jours',
+ 'down' => 'Hors service actuellement',
+ 'slowest' => 'Routes les plus lentes, p75',
+ 'open' => 'Ouvrir la supervision',
+ ],
+ 'privacy' => 'Mesuré sans cookies ni données personnelles ; les visiteurs avec Do Not Track sont exclus.',
+ 'back' => 'Retour à la supervision',
+ 'ongoing' => 'en cours',
+ 'units' => [
+ 'decimal' => ',',
+ 'ms' => ':value ms',
+ 's' => ':value s',
+ ],
+ 'permissions' => [
+ 'view' => 'Voir les rapports de vitesse et de disponibilité',
+ ],
+];
diff --git a/packages/monitoring/lang/it/monitoring.php b/packages/monitoring/lang/it/monitoring.php
new file mode 100644
index 00000000..37b7b445
--- /dev/null
+++ b/packages/monitoring/lang/it/monitoring.php
@@ -0,0 +1,167 @@
+ 'Monitoraggio',
+ 'menu' => 'Velocità e disponibilità',
+ 'health' => 'Stato del sito',
+ 'no_data' => 'Ancora nessun dato',
+ 'minutes' => ':count minuto|:count minuti',
+
+ 'modules' => [
+ 'checks' => 'Controlli di disponibilità',
+ 'incidents' => 'Incidenti',
+ ],
+ 'create' => [
+ 'check' => 'Aggiungi un controllo',
+ ],
+ 'fields' => [
+ 'name' => 'Nome',
+ 'url' => 'Indirizzo',
+ 'status' => 'Stato',
+ 'last_error' => 'Ultimo errore',
+ 'response_ms' => 'Risposta',
+ 'checked_at' => 'Controllato',
+ 'check' => 'Controllo',
+ 'started_at' => 'Inizio',
+ 'resolved_at' => 'Fine',
+ 'duration' => 'Durata',
+ 'failures' => 'Controlli falliti',
+ ],
+ 'hints' => [
+ 'url' => 'Aperto ogni minuto. La home page di ogni sito viene controllata automaticamente.',
+ ],
+ 'status' => [
+ 'unknown' => 'Non ancora controllato',
+ 'up' => 'Attivo',
+ 'failing' => 'Instabile',
+ 'down' => 'Non raggiungibile',
+ ],
+
+ 'settings' => [
+ 'description' => 'Chi avvisare quando un sito smette di rispondere e dopo quanti controlli falliti di fila.',
+ 'failures' => 'Controlli falliti prima di un incidente',
+ 'failures_hint' => 'Il controllo avviene ogni minuto: 3 significa tre minuti senza risposta.',
+ 'alert_emails' => 'E-mail di avviso',
+ 'alert_emails_hint' => 'Uno o più indirizzi, separati da virgole o da a capo.',
+ 'telegram_token' => 'Token del bot Telegram',
+ 'telegram_token_hint' => 'Fornito da @BotFather. Salvato nel database, mai nel codice; ATRIUM_MONITORING_TELEGRAM_TOKEN in .env ha la precedenza.',
+ 'telegram_chat_id' => 'Chat Telegram',
+ 'telegram_chat_id_hint' => 'Un ID chat come -1001234567890 o un canale come @site_alerts. Il bot deve esserne membro.',
+ ],
+
+ 'alert' => [
+ 'opened_subject' => 'Non raggiungibile: :name',
+ 'opened_body' => ":url non risponde da :failures controlli di fila, dal :since.\nUltimo errore: :error",
+ 'resolved_subject' => 'Di nuovo attivo: :name',
+ 'resolved_body' => ':url risponde di nuovo dopo :duration.',
+ ],
+
+ 'filters' => [
+ 'period' => 'Periodo',
+ 'site' => 'Sito',
+ 'locale' => 'Lingua',
+ 'device' => 'Dispositivo',
+ 'all' => 'Tutti',
+ 'route' => 'Percorso',
+ 'page' => 'Pagina',
+ 'clear' => 'Mostra tutto',
+ ],
+ 'periods' => [
+ 'day' => 'Per giorno, 30 giorni',
+ 'week' => 'Per settimana, 26 settimane',
+ 'month' => 'Per mese, 13 mesi',
+ ],
+ 'devices' => [
+ 'mobile' => 'Telefono',
+ 'tablet' => 'Tablet',
+ 'desktop' => 'Computer',
+ ],
+
+ 'sections' => [
+ 'server' => 'Server',
+ 'vitals' => 'Visitatori (Web Vitals)',
+ 'uptime' => 'Disponibilità',
+ 'routes' => 'Percorsi più lenti',
+ 'queries' => 'Query più lente',
+ 'pages' => 'Pagine più lente (LCP)',
+ 'incidents' => 'Incidenti recenti',
+ 'routes_of_query' => 'Dove viene eseguita (ultimi 7 giorni)',
+ ],
+ 'summary' => [
+ 'requests' => 'Richieste misurate',
+ 'ttfb' => 'Tempo al primo byte',
+ 'errors' => 'Errori del server',
+ 'cache_ratio' => 'Hit della cache',
+ 'queries' => 'Query per richiesta',
+ 'memory_p95' => 'Memoria, p95',
+ 'mb' => 'MB',
+ ],
+ 'charts' => [
+ 'ttfb' => 'Tempo al primo byte',
+ 'db_ms' => 'Tempo del database per richiesta',
+ 'query_time' => 'Tempo della query',
+ 'table' => 'I numeri del grafico',
+ 'legend' => 'p50: metà delle richieste è stata più veloce (cerchio, linea continua). p75: tre su quattro (quadrato, tratteggiata). p95: tutte tranne una su venti (triangolo, punteggiata).',
+ ],
+ 'columns' => [
+ 'period' => 'Periodo',
+ 'count' => 'Misurato',
+ 'route' => 'Percorso',
+ 'page' => 'Pagina',
+ 'query' => 'Query',
+ 'open' => 'Apri',
+ 'check' => 'Indirizzo',
+ 'status' => 'Stato',
+ 'uptime' => 'Disponibilità',
+ 'response' => 'Risposta',
+ 'checked_at' => 'Controllato',
+ 'times' => 'Volte',
+ 'average' => 'Media',
+ 'slowest' => 'Più lento',
+ 'connection' => 'Connessione',
+ 'last_seen' => 'Visto l\'ultima volta',
+ 'rating' => 'Valutazione',
+ ],
+ 'vitals' => [
+ 'lcp' => 'Elemento più grande visibile (LCP)',
+ 'inp' => 'Reattività all\'interazione (INP)',
+ 'cls' => 'Spostamento del layout (CLS)',
+ 'ttfb' => 'Tempo al primo byte (TTFB)',
+ 'fcp' => 'Primo contenuto visibile (FCP)',
+ 'thresholds' => 'Buono fino a :good, scarso oltre :poor',
+ ],
+ 'ratings' => [
+ 'good' => 'Buono',
+ 'needs_improvement' => 'Da migliorare',
+ 'poor' => 'Scarso',
+ ],
+ 'links' => [
+ 'errors' => 'Errori di questa pagina',
+ ],
+ 'gadget' => [
+ 'title' => 'Velocità e disponibilità',
+ 'vitals' => 'Visitatori, p75 su 7 giorni',
+ 'uptime' => 'Disponibilità su 30 giorni',
+ 'down' => 'Non raggiungibile ora',
+ 'slowest' => 'Percorsi più lenti, p75',
+ 'open' => 'Apri il monitoraggio',
+ ],
+ 'privacy' => 'Misurato senza cookie né dati personali; i visitatori con Do Not Track sono esclusi.',
+ 'back' => 'Torna al monitoraggio',
+ 'ongoing' => 'in corso',
+ 'units' => [
+ 'decimal' => ',',
+ 'ms' => ':value ms',
+ 's' => ':value s',
+ ],
+ 'permissions' => [
+ 'view' => 'Vedere i rapporti su velocità e disponibilità',
+ ],
+];
diff --git a/packages/monitoring/lang/ja/monitoring.php b/packages/monitoring/lang/ja/monitoring.php
new file mode 100644
index 00000000..cb5143a1
--- /dev/null
+++ b/packages/monitoring/lang/ja/monitoring.php
@@ -0,0 +1,167 @@
+ 'モニタリング',
+ 'menu' => '速度と稼働率',
+ 'health' => 'サイトの状態',
+ 'no_data' => 'まだデータがありません',
+ 'minutes' => ':count 分',
+
+ 'modules' => [
+ 'checks' => '稼働チェック',
+ 'incidents' => 'インシデント',
+ ],
+ 'create' => [
+ 'check' => 'チェックを追加',
+ ],
+ 'fields' => [
+ 'name' => '名前',
+ 'url' => 'アドレス',
+ 'status' => '状態',
+ 'last_error' => '最後のエラー',
+ 'response_ms' => '応答',
+ 'checked_at' => 'チェック日時',
+ 'check' => 'チェック',
+ 'started_at' => '開始',
+ 'resolved_at' => '終了',
+ 'duration' => '継続時間',
+ 'failures' => '失敗したチェック',
+ ],
+ 'hints' => [
+ 'url' => '1 分ごとに開きます。各サイトのトップページは自動でチェックされます。',
+ ],
+ 'status' => [
+ 'unknown' => 'まだチェックされていません',
+ 'up' => '稼働中',
+ 'failing' => '不安定',
+ 'down' => '停止中',
+ ],
+
+ 'settings' => [
+ 'description' => 'サイトが応答しなくなったときの通知先と、連続何回チェックに失敗したら通知するかを設定します。',
+ 'failures' => 'インシデントとみなす失敗回数',
+ 'failures_hint' => 'チェックは 1 分ごとです。3 なら 3 分間応答がないことを意味します。',
+ 'alert_emails' => 'アラートのメールアドレス',
+ 'alert_emails_hint' => '1 件以上のアドレスをカンマまたは改行で区切って入力します。',
+ 'telegram_token' => 'Telegram ボットのトークン',
+ 'telegram_token_hint' => '@BotFather が発行します。コードではなくデータベースに保存されます。.env の ATRIUM_MONITORING_TELEGRAM_TOKEN が優先されます。',
+ 'telegram_chat_id' => 'Telegram チャット',
+ 'telegram_chat_id_hint' => '-1001234567890 のようなチャット ID、または @site_alerts のようなチャンネル。ボットがメンバーである必要があります。',
+ ],
+
+ 'alert' => [
+ 'opened_subject' => '停止中: :name',
+ 'opened_body' => ":url は :since から :failures 回連続で応答していません。\n最後のエラー: :error",
+ 'resolved_subject' => '復旧しました: :name',
+ 'resolved_body' => ':url は :duration 後に再び応答しています。',
+ ],
+
+ 'filters' => [
+ 'period' => '期間',
+ 'site' => 'サイト',
+ 'locale' => '言語',
+ 'device' => 'デバイス',
+ 'all' => 'すべて',
+ 'route' => 'ルート',
+ 'page' => 'ページ',
+ 'clear' => 'すべて表示',
+ ],
+ 'periods' => [
+ 'day' => '日別、30 日',
+ 'week' => '週別、26 週',
+ 'month' => '月別、13 か月',
+ ],
+ 'devices' => [
+ 'mobile' => 'スマートフォン',
+ 'tablet' => 'タブレット',
+ 'desktop' => 'パソコン',
+ ],
+
+ 'sections' => [
+ 'server' => 'サーバー',
+ 'vitals' => '訪問者 (Web Vitals)',
+ 'uptime' => '稼働率',
+ 'routes' => '遅いルート',
+ 'queries' => '遅いクエリ',
+ 'pages' => '遅いページ (LCP)',
+ 'incidents' => '最近のインシデント',
+ 'routes_of_query' => '実行されている場所(過去 7 日)',
+ ],
+ 'summary' => [
+ 'requests' => '計測したリクエスト',
+ 'ttfb' => '最初のバイトまでの時間',
+ 'errors' => 'サーバーエラー',
+ 'cache_ratio' => 'キャッシュヒット',
+ 'queries' => 'リクエストあたりのクエリ数',
+ 'memory_p95' => 'メモリ、p95',
+ 'mb' => 'MB',
+ ],
+ 'charts' => [
+ 'ttfb' => '最初のバイトまでの時間',
+ 'db_ms' => 'リクエストあたりのデータベース時間',
+ 'query_time' => 'クエリ時間',
+ 'table' => 'グラフの数値',
+ 'legend' => 'p50: リクエストの半分はこれより速かった(丸、実線)。p75: 4 分の 3(四角、破線)。p95: 20 分の 1 を除くすべて(三角、点線)。',
+ ],
+ 'columns' => [
+ 'period' => '期間',
+ 'count' => '計測数',
+ 'route' => 'ルート',
+ 'page' => 'ページ',
+ 'query' => 'クエリ',
+ 'open' => '開く',
+ 'check' => 'アドレス',
+ 'status' => '状態',
+ 'uptime' => '稼働率',
+ 'response' => '応答',
+ 'checked_at' => 'チェック日時',
+ 'times' => '回数',
+ 'average' => '平均',
+ 'slowest' => '最も遅い',
+ 'connection' => '接続',
+ 'last_seen' => '最終確認',
+ 'rating' => '評価',
+ ],
+ 'vitals' => [
+ 'lcp' => '最大要素の表示 (LCP)',
+ 'inp' => '操作への反応 (INP)',
+ 'cls' => 'レイアウトのずれ (CLS)',
+ 'ttfb' => '最初のバイトまでの時間 (TTFB)',
+ 'fcp' => '最初の表示 (FCP)',
+ 'thresholds' => ':good まで良好、:poor を超えると不良',
+ ],
+ 'ratings' => [
+ 'good' => '良好',
+ 'needs_improvement' => '要改善',
+ 'poor' => '不良',
+ ],
+ 'links' => [
+ 'errors' => 'このページのエラー',
+ ],
+ 'gadget' => [
+ 'title' => '速度と稼働率',
+ 'vitals' => '訪問者、7 日間の p75',
+ 'uptime' => '30 日間の稼働率',
+ 'down' => '現在停止中',
+ 'slowest' => '遅いルート、p75',
+ 'open' => 'モニタリングを開く',
+ ],
+ 'privacy' => 'Cookie や個人データを使わずに計測します。Do Not Track を有効にしている訪問者は除外されます。',
+ 'back' => 'モニタリングに戻る',
+ 'ongoing' => '継続中',
+ 'units' => [
+ 'decimal' => '.',
+ 'ms' => ':valueミリ秒',
+ 's' => ':value秒',
+ ],
+ 'permissions' => [
+ 'view' => '速度と稼働状況のレポートを表示',
+ ],
+];
diff --git a/packages/monitoring/lang/kk/monitoring.php b/packages/monitoring/lang/kk/monitoring.php
new file mode 100644
index 00000000..203563aa
--- /dev/null
+++ b/packages/monitoring/lang/kk/monitoring.php
@@ -0,0 +1,167 @@
+ 'Мониторинг',
+ 'menu' => 'Жылдамдық және қолжетімділік',
+ 'health' => 'Сайт жағдайы',
+ 'no_data' => 'Деректер әлі жоқ',
+ 'minutes' => ':count минут',
+
+ 'modules' => [
+ 'checks' => 'Қолжетімділікті тексеру',
+ 'incidents' => 'Инциденттер',
+ ],
+ 'create' => [
+ 'check' => 'Тексеру қосу',
+ ],
+ 'fields' => [
+ 'name' => 'Атауы',
+ 'url' => 'Мекенжай',
+ 'status' => 'Күйі',
+ 'last_error' => 'Соңғы қате',
+ 'response_ms' => 'Жауап',
+ 'checked_at' => 'Тексерілді',
+ 'check' => 'Тексеру',
+ 'started_at' => 'Басталуы',
+ 'resolved_at' => 'Аяқталуы',
+ 'duration' => 'Ұзақтығы',
+ 'failures' => 'Сәтсіз тексерулер',
+ ],
+ 'hints' => [
+ 'url' => 'Минутына бір рет ашылады. Әр сайттың басты беті өздігінен тексеріледі.',
+ ],
+ 'status' => [
+ 'unknown' => 'Әлі тексерілген жоқ',
+ 'up' => 'Жұмыс істеп тұр',
+ 'failing' => 'Ақаулы',
+ 'down' => 'Жұмыс істемейді',
+ ],
+
+ 'settings' => [
+ 'description' => 'Сайт жауап беруді тоқтатса, кімге және қатарынан неше сәтсіз тексеруден кейін хабарлау керек.',
+ 'failures' => 'Инцидентке дейінгі сәтсіз тексерулер',
+ 'failures_hint' => 'Тексеру минутына бір рет жүреді: 3 — жауапсыз үш минут.',
+ 'alert_emails' => 'Хабарландыру поштасы',
+ 'alert_emails_hint' => 'Бір немесе бірнеше мекенжай, үтір арқылы немесе жаңа жолдан.',
+ 'telegram_token' => 'Telegram боты токені',
+ 'telegram_token_hint' => '@BotFather береді. Кодта емес, дерекқорда сақталады; .env ішіндегі ATRIUM_MONITORING_TELEGRAM_TOKEN басым.',
+ 'telegram_chat_id' => 'Telegram чаты',
+ 'telegram_chat_id_hint' => 'Чат нөмірі, мысалы -1001234567890, немесе арна, мысалы @site_alerts. Бот оның мүшесі болуы керек.',
+ ],
+
+ 'alert' => [
+ 'opened_subject' => 'Жұмыс істемейді: :name',
+ 'opened_body' => ":url :since бастап қатарынан :failures тексеру бойы жауап бермеді.\nСоңғы қате: :error",
+ 'resolved_subject' => 'Қайта жұмыс істеп тұр: :name',
+ 'resolved_body' => ':url қайта жауап беріп тұр, тоқтап қалу :duration созылды.',
+ ],
+
+ 'filters' => [
+ 'period' => 'Кезең',
+ 'site' => 'Сайт',
+ 'locale' => 'Тіл',
+ 'device' => 'Құрылғы',
+ 'all' => 'Барлығы',
+ 'route' => 'Маршрут',
+ 'page' => 'Бет',
+ 'clear' => 'Барлығын көрсету',
+ ],
+ 'periods' => [
+ 'day' => 'Күндер бойынша, 30 күн',
+ 'week' => 'Апталар бойынша, 26 апта',
+ 'month' => 'Айлар бойынша, 13 ай',
+ ],
+ 'devices' => [
+ 'mobile' => 'Телефон',
+ 'tablet' => 'Планшет',
+ 'desktop' => 'Компьютер',
+ ],
+
+ 'sections' => [
+ 'server' => 'Сервер',
+ 'vitals' => 'Келушілер (Web Vitals)',
+ 'uptime' => 'Қолжетімділік',
+ 'routes' => 'Ең баяу маршруттар',
+ 'queries' => 'Ең баяу сұраулар',
+ 'pages' => 'Ең баяу беттер (LCP)',
+ 'incidents' => 'Соңғы инциденттер',
+ 'routes_of_query' => 'Қайда орындалады (соңғы 7 күн)',
+ ],
+ 'summary' => [
+ 'requests' => 'Өлшенген сұраулар',
+ 'ttfb' => 'Бірінші байтқа дейінгі уақыт',
+ 'errors' => 'Сервер қателері',
+ 'cache_ratio' => 'Кэшке тию',
+ 'queries' => 'Бетке дерекқорға сұраулар',
+ 'memory_p95' => 'Жады, p95',
+ 'mb' => 'МБ',
+ ],
+ 'charts' => [
+ 'ttfb' => 'Бірінші байтқа дейінгі уақыт',
+ 'db_ms' => 'Сұрауға дерекқор уақыты',
+ 'query_time' => 'Сұрау уақыты',
+ 'table' => 'График сандары',
+ 'legend' => 'p50: сұраулардың жартысы жылдамырақ болды (шеңбер, тұтас сызық). p75: төртеуінің үшеуі (шаршы, үзік сызық). p95: жиырмасының біреуінен басқасының бәрі (үшбұрыш, нүктелер).',
+ ],
+ 'columns' => [
+ 'period' => 'Кезең',
+ 'count' => 'Өлшенді',
+ 'route' => 'Маршрут',
+ 'page' => 'Бет',
+ 'query' => 'Сұрау',
+ 'open' => 'Ашу',
+ 'check' => 'Мекенжай',
+ 'status' => 'Күйі',
+ 'uptime' => 'Қолжетімділік',
+ 'response' => 'Жауап',
+ 'checked_at' => 'Тексерілді',
+ 'times' => 'Рет',
+ 'average' => 'Орта есеппен',
+ 'slowest' => 'Ең ұзақ',
+ 'connection' => 'Байланыс',
+ 'last_seen' => 'Соңғы рет',
+ 'rating' => 'Баға',
+ ],
+ 'vitals' => [
+ 'lcp' => 'Басты блоктың салынуы (LCP)',
+ 'inp' => 'Әрекетке жауап (INP)',
+ 'cls' => 'Беттің жылжуы (CLS)',
+ 'ttfb' => 'Бірінші байт (TTFB)',
+ 'fcp' => 'Алғашқы салыну (FCP)',
+ 'thresholds' => ':good дейін жақсы, :poor жоғары нашар',
+ ],
+ 'ratings' => [
+ 'good' => 'Жақсы',
+ 'needs_improvement' => 'Қанағаттанарлық',
+ 'poor' => 'Нашар',
+ ],
+ 'links' => [
+ 'errors' => 'Осы беттің қателері',
+ ],
+ 'gadget' => [
+ 'title' => 'Жылдамдық және қолжетімділік',
+ 'vitals' => 'Келушілер, 7 күндегі p75',
+ 'uptime' => '30 күндегі қолжетімділік',
+ 'down' => 'Қазір жұмыс істемейді',
+ 'slowest' => 'Баяу маршруттар, p75',
+ 'open' => 'Мониторингті ашу',
+ ],
+ 'privacy' => 'Cookie мен жеке деректерсіз өлшенеді; Do Not Track қосқан келушілер ескерілмейді.',
+ 'back' => 'Мониторингке оралу',
+ 'ongoing' => 'жалғасуда',
+ 'units' => [
+ 'decimal' => ',',
+ 'ms' => ':value мс',
+ 's' => ':value с',
+ ],
+ 'permissions' => [
+ 'view' => 'Жылдамдық пен қолжетімділік есептерін көру',
+ ],
+];
diff --git a/packages/monitoring/lang/pl/monitoring.php b/packages/monitoring/lang/pl/monitoring.php
new file mode 100644
index 00000000..4e1d365f
--- /dev/null
+++ b/packages/monitoring/lang/pl/monitoring.php
@@ -0,0 +1,167 @@
+ 'Monitoring',
+ 'menu' => 'Szybkość i dostępność',
+ 'health' => 'Stan witryny',
+ 'no_data' => 'Brak danych',
+ 'minutes' => ':count minuta|:count minuty|:count minut',
+
+ 'modules' => [
+ 'checks' => 'Sprawdzenia dostępności',
+ 'incidents' => 'Incydenty',
+ ],
+ 'create' => [
+ 'check' => 'Dodaj sprawdzenie',
+ ],
+ 'fields' => [
+ 'name' => 'Nazwa',
+ 'url' => 'Adres',
+ 'status' => 'Stan',
+ 'last_error' => 'Ostatni błąd',
+ 'response_ms' => 'Odpowiedź',
+ 'checked_at' => 'Sprawdzono',
+ 'check' => 'Sprawdzenie',
+ 'started_at' => 'Początek',
+ 'resolved_at' => 'Koniec',
+ 'duration' => 'Czas trwania',
+ 'failures' => 'Nieudane sprawdzenia',
+ ],
+ 'hints' => [
+ 'url' => 'Otwierany co minutę. Strona główna każdej witryny jest sprawdzana automatycznie.',
+ ],
+ 'status' => [
+ 'unknown' => 'Jeszcze nie sprawdzano',
+ 'up' => 'Działa',
+ 'failing' => 'Zawodzi',
+ 'down' => 'Nie działa',
+ ],
+
+ 'settings' => [
+ 'description' => 'Kogo powiadamiać, gdy witryna przestaje odpowiadać, i po ilu nieudanych sprawdzeniach z rzędu.',
+ 'failures' => 'Nieudane sprawdzenia do incydentu',
+ 'failures_hint' => 'Sprawdzenie co minutę: 3 oznacza trzy minuty bez odpowiedzi.',
+ 'alert_emails' => 'E-maile z alertami',
+ 'alert_emails_hint' => 'Jeden lub kilka adresów, oddzielonych przecinkami lub nowymi wierszami.',
+ 'telegram_token' => 'Token bota Telegram',
+ 'telegram_token_hint' => 'Wydaje go @BotFather. Przechowywany w bazie, nie w kodzie; ATRIUM_MONITORING_TELEGRAM_TOKEN w .env ma pierwszeństwo.',
+ 'telegram_chat_id' => 'Czat Telegram',
+ 'telegram_chat_id_hint' => 'Numer czatu, np. -1001234567890, lub kanał, np. @site_alerts. Bot musi być jego członkiem.',
+ ],
+
+ 'alert' => [
+ 'opened_subject' => 'Nie działa: :name',
+ 'opened_body' => ":url nie odpowiada na :failures sprawdzeń z rzędu, od :since.\nOstatni błąd: :error",
+ 'resolved_subject' => 'Znów działa: :name',
+ 'resolved_body' => ':url znów odpowiada, przerwa trwała :duration.',
+ ],
+
+ 'filters' => [
+ 'period' => 'Okres',
+ 'site' => 'Witryna',
+ 'locale' => 'Język',
+ 'device' => 'Urządzenie',
+ 'all' => 'Wszystkie',
+ 'route' => 'Trasa',
+ 'page' => 'Strona',
+ 'clear' => 'Pokaż wszystko',
+ ],
+ 'periods' => [
+ 'day' => 'Dziennie, 30 dni',
+ 'week' => 'Tygodniowo, 26 tygodni',
+ 'month' => 'Miesięcznie, 13 miesięcy',
+ ],
+ 'devices' => [
+ 'mobile' => 'Telefon',
+ 'tablet' => 'Tablet',
+ 'desktop' => 'Komputer',
+ ],
+
+ 'sections' => [
+ 'server' => 'Serwer',
+ 'vitals' => 'Odwiedzający (Web Vitals)',
+ 'uptime' => 'Dostępność',
+ 'routes' => 'Najwolniejsze trasy',
+ 'queries' => 'Najwolniejsze zapytania',
+ 'pages' => 'Najwolniejsze strony (LCP)',
+ 'incidents' => 'Ostatnie incydenty',
+ 'routes_of_query' => 'Gdzie jest wykonywane (ostatnie 7 dni)',
+ ],
+ 'summary' => [
+ 'requests' => 'Zmierzone żądania',
+ 'ttfb' => 'Czas do pierwszego bajtu',
+ 'errors' => 'Błędy serwera',
+ 'cache_ratio' => 'Trafienia w pamięci podręcznej',
+ 'queries' => 'Zapytania do bazy na żądanie',
+ 'memory_p95' => 'Pamięć, p95',
+ 'mb' => 'MB',
+ ],
+ 'charts' => [
+ 'ttfb' => 'Czas do pierwszego bajtu',
+ 'db_ms' => 'Czas bazy danych na żądanie',
+ 'query_time' => 'Czas zapytania',
+ 'table' => 'Liczby z wykresu',
+ 'legend' => 'p50: połowa żądań była szybsza (koło, linia ciągła). p75: trzy z czterech (kwadrat, linia przerywana). p95: wszystkie poza jednym na dwadzieścia (trójkąt, linia kropkowana).',
+ ],
+ 'columns' => [
+ 'period' => 'Okres',
+ 'count' => 'Zmierzono',
+ 'route' => 'Trasa',
+ 'page' => 'Strona',
+ 'query' => 'Zapytanie',
+ 'open' => 'Otwórz',
+ 'check' => 'Adres',
+ 'status' => 'Stan',
+ 'uptime' => 'Dostępność',
+ 'response' => 'Odpowiedź',
+ 'checked_at' => 'Sprawdzono',
+ 'times' => 'Razy',
+ 'average' => 'Średnio',
+ 'slowest' => 'Najdłużej',
+ 'connection' => 'Połączenie',
+ 'last_seen' => 'Ostatnio widziano',
+ 'rating' => 'Ocena',
+ ],
+ 'vitals' => [
+ 'lcp' => 'Wyrenderowanie głównego elementu (LCP)',
+ 'inp' => 'Reakcja na działanie (INP)',
+ 'cls' => 'Przesunięcie układu (CLS)',
+ 'ttfb' => 'Czas do pierwszego bajtu (TTFB)',
+ 'fcp' => 'Pierwsze wyrenderowanie (FCP)',
+ 'thresholds' => 'Dobrze do :good, źle powyżej :poor',
+ ],
+ 'ratings' => [
+ 'good' => 'Dobrze',
+ 'needs_improvement' => 'Do poprawy',
+ 'poor' => 'Źle',
+ ],
+ 'links' => [
+ 'errors' => 'Błędy tej strony',
+ ],
+ 'gadget' => [
+ 'title' => 'Szybkość i dostępność',
+ 'vitals' => 'Odwiedzający, p75 z 7 dni',
+ 'uptime' => 'Dostępność z 30 dni',
+ 'down' => 'Teraz nie działa',
+ 'slowest' => 'Najwolniejsze trasy, p75',
+ 'open' => 'Otwórz monitoring',
+ ],
+ 'privacy' => 'Mierzone bez plików cookie i danych osobowych; odwiedzający z Do Not Track są pomijani.',
+ 'back' => 'Wróć do monitoringu',
+ 'ongoing' => 'trwa',
+ 'units' => [
+ 'decimal' => ',',
+ 'ms' => ':value ms',
+ 's' => ':value s',
+ ],
+ 'permissions' => [
+ 'view' => 'Podgląd raportów szybkości i dostępności',
+ ],
+];
diff --git a/packages/monitoring/lang/pt_BR/monitoring.php b/packages/monitoring/lang/pt_BR/monitoring.php
new file mode 100644
index 00000000..147f713b
--- /dev/null
+++ b/packages/monitoring/lang/pt_BR/monitoring.php
@@ -0,0 +1,167 @@
+ 'Monitoramento',
+ 'menu' => 'Velocidade e disponibilidade',
+ 'health' => 'Saúde do site',
+ 'no_data' => 'Ainda não há dados',
+ 'minutes' => ':count minuto|:count minutos',
+
+ 'modules' => [
+ 'checks' => 'Verificações de disponibilidade',
+ 'incidents' => 'Incidentes',
+ ],
+ 'create' => [
+ 'check' => 'Adicionar verificação',
+ ],
+ 'fields' => [
+ 'name' => 'Nome',
+ 'url' => 'Endereço',
+ 'status' => 'Status',
+ 'last_error' => 'Último erro',
+ 'response_ms' => 'Resposta',
+ 'checked_at' => 'Verificado',
+ 'check' => 'Verificação',
+ 'started_at' => 'Início',
+ 'resolved_at' => 'Fim',
+ 'duration' => 'Duração',
+ 'failures' => 'Verificações com falha',
+ ],
+ 'hints' => [
+ 'url' => 'Aberto a cada minuto. A página inicial de cada site é verificada automaticamente.',
+ ],
+ 'status' => [
+ 'unknown' => 'Ainda não verificado',
+ 'up' => 'No ar',
+ 'failing' => 'Instável',
+ 'down' => 'Fora do ar',
+ ],
+
+ 'settings' => [
+ 'description' => 'Quem é avisado quando um site para de responder e após quantas verificações com falha seguidas.',
+ 'failures' => 'Verificações com falha antes de um incidente',
+ 'failures_hint' => 'A verificação roda a cada minuto: 3 significa três minutos sem resposta.',
+ 'alert_emails' => 'E-mails de alerta',
+ 'alert_emails_hint' => 'Um ou mais endereços, separados por vírgulas ou quebras de linha.',
+ 'telegram_token' => 'Token do bot do Telegram',
+ 'telegram_token_hint' => 'Fornecido pelo @BotFather. Fica guardado no banco de dados, nunca no código; ATRIUM_MONITORING_TELEGRAM_TOKEN no .env tem prioridade.',
+ 'telegram_chat_id' => 'Chat do Telegram',
+ 'telegram_chat_id_hint' => 'Um ID de chat como -1001234567890 ou um canal como @site_alerts. O bot precisa ser membro.',
+ ],
+
+ 'alert' => [
+ 'opened_subject' => 'Fora do ar: :name',
+ 'opened_body' => ":url não responde há :failures verificações seguidas, desde :since.\nÚltimo erro: :error",
+ 'resolved_subject' => 'De volta ao ar: :name',
+ 'resolved_body' => ':url voltou a responder após :duration.',
+ ],
+
+ 'filters' => [
+ 'period' => 'Período',
+ 'site' => 'Site',
+ 'locale' => 'Idioma',
+ 'device' => 'Dispositivo',
+ 'all' => 'Todos',
+ 'route' => 'Rota',
+ 'page' => 'Página',
+ 'clear' => 'Mostrar tudo',
+ ],
+ 'periods' => [
+ 'day' => 'Por dia, 30 dias',
+ 'week' => 'Por semana, 26 semanas',
+ 'month' => 'Por mês, 13 meses',
+ ],
+ 'devices' => [
+ 'mobile' => 'Celular',
+ 'tablet' => 'Tablet',
+ 'desktop' => 'Computador',
+ ],
+
+ 'sections' => [
+ 'server' => 'Servidor',
+ 'vitals' => 'Visitantes (Web Vitals)',
+ 'uptime' => 'Disponibilidade',
+ 'routes' => 'Rotas mais lentas',
+ 'queries' => 'Consultas mais lentas',
+ 'pages' => 'Páginas mais lentas (LCP)',
+ 'incidents' => 'Incidentes recentes',
+ 'routes_of_query' => 'Onde é executada (últimos 7 dias)',
+ ],
+ 'summary' => [
+ 'requests' => 'Requisições medidas',
+ 'ttfb' => 'Tempo até o primeiro byte',
+ 'errors' => 'Erros do servidor',
+ 'cache_ratio' => 'Acertos de cache',
+ 'queries' => 'Consultas por requisição',
+ 'memory_p95' => 'Memória, p95',
+ 'mb' => 'MB',
+ ],
+ 'charts' => [
+ 'ttfb' => 'Tempo até o primeiro byte',
+ 'db_ms' => 'Tempo de banco de dados por requisição',
+ 'query_time' => 'Tempo da consulta',
+ 'table' => 'Os números do gráfico',
+ 'legend' => 'p50: metade das requisições foi mais rápida (círculo, linha contínua). p75: três em cada quatro (quadrado, tracejada). p95: todas menos uma em vinte (triângulo, pontilhada).',
+ ],
+ 'columns' => [
+ 'period' => 'Período',
+ 'count' => 'Medido',
+ 'route' => 'Rota',
+ 'page' => 'Página',
+ 'query' => 'Consulta',
+ 'open' => 'Abrir',
+ 'check' => 'Endereço',
+ 'status' => 'Status',
+ 'uptime' => 'Disponibilidade',
+ 'response' => 'Resposta',
+ 'checked_at' => 'Verificado',
+ 'times' => 'Vezes',
+ 'average' => 'Média',
+ 'slowest' => 'Mais lento',
+ 'connection' => 'Conexão',
+ 'last_seen' => 'Visto pela última vez',
+ 'rating' => 'Avaliação',
+ ],
+ 'vitals' => [
+ 'lcp' => 'Maior elemento visível (LCP)',
+ 'inp' => 'Resposta à interação (INP)',
+ 'cls' => 'Mudança de layout (CLS)',
+ 'ttfb' => 'Tempo até o primeiro byte (TTFB)',
+ 'fcp' => 'Primeiro conteúdo visível (FCP)',
+ 'thresholds' => 'Bom até :good, ruim acima de :poor',
+ ],
+ 'ratings' => [
+ 'good' => 'Bom',
+ 'needs_improvement' => 'Precisa melhorar',
+ 'poor' => 'Ruim',
+ ],
+ 'links' => [
+ 'errors' => 'Erros desta página',
+ ],
+ 'gadget' => [
+ 'title' => 'Velocidade e disponibilidade',
+ 'vitals' => 'Visitantes, p75 em 7 dias',
+ 'uptime' => 'Disponibilidade em 30 dias',
+ 'down' => 'Fora do ar agora',
+ 'slowest' => 'Rotas mais lentas, p75',
+ 'open' => 'Abrir monitoramento',
+ ],
+ 'privacy' => 'Medido sem cookies nem dados pessoais; visitantes com Do Not Track ficam de fora.',
+ 'back' => 'Voltar ao monitoramento',
+ 'ongoing' => 'em andamento',
+ 'units' => [
+ 'decimal' => ',',
+ 'ms' => ':value ms',
+ 's' => ':value s',
+ ],
+ 'permissions' => [
+ 'view' => 'Ver relatórios de velocidade e disponibilidade',
+ ],
+];
diff --git a/packages/monitoring/lang/ru/monitoring.php b/packages/monitoring/lang/ru/monitoring.php
new file mode 100644
index 00000000..7a73f986
--- /dev/null
+++ b/packages/monitoring/lang/ru/monitoring.php
@@ -0,0 +1,167 @@
+ 'Мониторинг',
+ 'menu' => 'Скорость и доступность',
+ 'health' => 'Состояние сайта',
+ 'no_data' => 'Данных пока нет',
+ 'minutes' => ':count минута|:count минуты|:count минут',
+
+ 'modules' => [
+ 'checks' => 'Проверки доступности',
+ 'incidents' => 'Инциденты',
+ ],
+ 'create' => [
+ 'check' => 'Добавить проверку',
+ ],
+ 'fields' => [
+ 'name' => 'Название',
+ 'url' => 'Адрес',
+ 'status' => 'Состояние',
+ 'last_error' => 'Последняя ошибка',
+ 'response_ms' => 'Ответ',
+ 'checked_at' => 'Проверено',
+ 'check' => 'Проверка',
+ 'started_at' => 'Начало',
+ 'resolved_at' => 'Конец',
+ 'duration' => 'Длительность',
+ 'failures' => 'Неудачных проверок',
+ ],
+ 'hints' => [
+ 'url' => 'Открывается раз в минуту. Главная каждого сайта проверяется сама.',
+ ],
+ 'status' => [
+ 'unknown' => 'Ещё не проверялось',
+ 'up' => 'Работает',
+ 'failing' => 'Сбоит',
+ 'down' => 'Не работает',
+ ],
+
+ 'settings' => [
+ 'description' => 'Кому сообщать, если сайт перестал отвечать, и после скольких неудачных проверок подряд.',
+ 'failures' => 'Неудачных проверок до инцидента',
+ 'failures_hint' => 'Проверка идёт раз в минуту: 3 — это три минуты без ответа.',
+ 'alert_emails' => 'Почта для оповещений',
+ 'alert_emails_hint' => 'Один или несколько адресов через запятую или с новой строки.',
+ 'telegram_token' => 'Токен Telegram-бота',
+ 'telegram_token_hint' => 'Выдаёт @BotFather. Хранится в базе, а не в коде; ATRIUM_MONITORING_TELEGRAM_TOKEN в .env главнее.',
+ 'telegram_chat_id' => 'Чат Telegram',
+ 'telegram_chat_id_hint' => 'Номер чата вроде -1001234567890 или канал вроде @site_alerts. Бот должен в нём состоять.',
+ ],
+
+ 'alert' => [
+ 'opened_subject' => 'Не работает: :name',
+ 'opened_body' => ":url не отвечает :failures проверок подряд, с :since.\nПоследняя ошибка: :error",
+ 'resolved_subject' => 'Снова работает: :name',
+ 'resolved_body' => ':url снова отвечает, простой длился :duration.',
+ ],
+
+ 'filters' => [
+ 'period' => 'Период',
+ 'site' => 'Сайт',
+ 'locale' => 'Язык',
+ 'device' => 'Устройство',
+ 'all' => 'Все',
+ 'route' => 'Маршрут',
+ 'page' => 'Страница',
+ 'clear' => 'Показать всё',
+ ],
+ 'periods' => [
+ 'day' => 'По дням, 30 дней',
+ 'week' => 'По неделям, 26 недель',
+ 'month' => 'По месяцам, 13 месяцев',
+ ],
+ 'devices' => [
+ 'mobile' => 'Телефон',
+ 'tablet' => 'Планшет',
+ 'desktop' => 'Компьютер',
+ ],
+
+ 'sections' => [
+ 'server' => 'Сервер',
+ 'vitals' => 'Посетители (Web Vitals)',
+ 'uptime' => 'Доступность',
+ 'routes' => 'Самые медленные маршруты',
+ 'queries' => 'Самые медленные запросы',
+ 'pages' => 'Самые медленные страницы (LCP)',
+ 'incidents' => 'Последние инциденты',
+ 'routes_of_query' => 'Где выполняется (последние 7 дней)',
+ ],
+ 'summary' => [
+ 'requests' => 'Измерено запросов',
+ 'ttfb' => 'Время до первого байта',
+ 'errors' => 'Ошибки сервера',
+ 'cache_ratio' => 'Попадания в кеш',
+ 'queries' => 'Запросов к базе на страницу',
+ 'memory_p95' => 'Память, p95',
+ 'mb' => 'МБ',
+ ],
+ 'charts' => [
+ 'ttfb' => 'Время до первого байта',
+ 'db_ms' => 'Время базы на запрос',
+ 'query_time' => 'Время запроса',
+ 'table' => 'Числа графика',
+ 'legend' => 'p50: половина запросов была быстрее (круг, сплошная линия). p75: три из четырёх (квадрат, пунктир). p95: все, кроме одного из двадцати (треугольник, точки).',
+ ],
+ 'columns' => [
+ 'period' => 'Период',
+ 'count' => 'Измерено',
+ 'route' => 'Маршрут',
+ 'page' => 'Страница',
+ 'query' => 'Запрос',
+ 'open' => 'Открыть',
+ 'check' => 'Адрес',
+ 'status' => 'Состояние',
+ 'uptime' => 'Доступность',
+ 'response' => 'Ответ',
+ 'checked_at' => 'Проверено',
+ 'times' => 'Раз',
+ 'average' => 'В среднем',
+ 'slowest' => 'Дольше всего',
+ 'connection' => 'Связь',
+ 'last_seen' => 'Последний раз',
+ 'rating' => 'Оценка',
+ ],
+ 'vitals' => [
+ 'lcp' => 'Отрисовка главного блока (LCP)',
+ 'inp' => 'Отклик на действие (INP)',
+ 'cls' => 'Сдвиг вёрстки (CLS)',
+ 'ttfb' => 'Первый байт (TTFB)',
+ 'fcp' => 'Первая отрисовка (FCP)',
+ 'thresholds' => 'Хорошо до :good, плохо выше :poor',
+ ],
+ 'ratings' => [
+ 'good' => 'Хорошо',
+ 'needs_improvement' => 'Терпимо',
+ 'poor' => 'Плохо',
+ ],
+ 'links' => [
+ 'errors' => 'Ошибки этой страницы',
+ ],
+ 'gadget' => [
+ 'title' => 'Скорость и доступность',
+ 'vitals' => 'Посетители, p75 за 7 дней',
+ 'uptime' => 'Доступность за 30 дней',
+ 'down' => 'Сейчас не работает',
+ 'slowest' => 'Медленные маршруты, p75',
+ 'open' => 'Открыть мониторинг',
+ ],
+ 'privacy' => 'Меряется без cookie и личных данных; посетители с Do Not Track не учитываются.',
+ 'back' => 'Назад к мониторингу',
+ 'ongoing' => 'продолжается',
+ 'units' => [
+ 'decimal' => ',',
+ 'ms' => ':value мс',
+ 's' => ':value с',
+ ],
+ 'permissions' => [
+ 'view' => 'Просмотр отчётов о скорости и доступности',
+ ],
+];
diff --git a/packages/monitoring/lang/tr/monitoring.php b/packages/monitoring/lang/tr/monitoring.php
new file mode 100644
index 00000000..0a8abf85
--- /dev/null
+++ b/packages/monitoring/lang/tr/monitoring.php
@@ -0,0 +1,167 @@
+ 'İzleme',
+ 'menu' => 'Hız ve erişilebilirlik',
+ 'health' => 'Site sağlığı',
+ 'no_data' => 'Henüz veri yok',
+ 'minutes' => ':count dakika',
+
+ 'modules' => [
+ 'checks' => 'Erişilebilirlik kontrolleri',
+ 'incidents' => 'Olaylar',
+ ],
+ 'create' => [
+ 'check' => 'Kontrol ekle',
+ ],
+ 'fields' => [
+ 'name' => 'Ad',
+ 'url' => 'Adres',
+ 'status' => 'Durum',
+ 'last_error' => 'Son hata',
+ 'response_ms' => 'Yanıt',
+ 'checked_at' => 'Kontrol edildi',
+ 'check' => 'Kontrol',
+ 'started_at' => 'Başlangıç',
+ 'resolved_at' => 'Bitiş',
+ 'duration' => 'Süre',
+ 'failures' => 'Başarısız kontroller',
+ ],
+ 'hints' => [
+ 'url' => 'Dakikada bir açılır. Her sitenin ana sayfası kendiliğinden kontrol edilir.',
+ ],
+ 'status' => [
+ 'unknown' => 'Henüz kontrol edilmedi',
+ 'up' => 'Çalışıyor',
+ 'failing' => 'Aksıyor',
+ 'down' => 'Çalışmıyor',
+ ],
+
+ 'settings' => [
+ 'description' => 'Bir site yanıt vermeyi bıraktığında kime haber verileceği ve art arda kaç başarısız kontrolden sonra.',
+ 'failures' => 'Olaydan önceki başarısız kontroller',
+ 'failures_hint' => 'Kontrol dakikada bir yapılır: 3, yanıtsız üç dakika demektir.',
+ 'alert_emails' => 'Uyarı e-postaları',
+ 'alert_emails_hint' => 'Bir veya birkaç adres; virgülle veya yeni satırla ayırın.',
+ 'telegram_token' => 'Telegram bot belirteci',
+ 'telegram_token_hint' => '@BotFather verir. Kodda değil, veritabanında saklanır; .env içindeki ATRIUM_MONITORING_TELEGRAM_TOKEN önceliklidir.',
+ 'telegram_chat_id' => 'Telegram sohbeti',
+ 'telegram_chat_id_hint' => '-1001234567890 gibi bir sohbet numarası veya @site_alerts gibi bir kanal. Bot üyesi olmalıdır.',
+ ],
+
+ 'alert' => [
+ 'opened_subject' => 'Çalışmıyor: :name',
+ 'opened_body' => ":url, :since tarihinden beri art arda :failures kontrolde yanıt vermedi.\nSon hata: :error",
+ 'resolved_subject' => 'Yeniden çalışıyor: :name',
+ 'resolved_body' => ':url yeniden yanıt veriyor, kesinti :duration sürdü.',
+ ],
+
+ 'filters' => [
+ 'period' => 'Dönem',
+ 'site' => 'Site',
+ 'locale' => 'Dil',
+ 'device' => 'Cihaz',
+ 'all' => 'Tümü',
+ 'route' => 'Rota',
+ 'page' => 'Sayfa',
+ 'clear' => 'Tümünü göster',
+ ],
+ 'periods' => [
+ 'day' => 'Günlük, 30 gün',
+ 'week' => 'Haftalık, 26 hafta',
+ 'month' => 'Aylık, 13 ay',
+ ],
+ 'devices' => [
+ 'mobile' => 'Telefon',
+ 'tablet' => 'Tablet',
+ 'desktop' => 'Bilgisayar',
+ ],
+
+ 'sections' => [
+ 'server' => 'Sunucu',
+ 'vitals' => 'Ziyaretçiler (Web Vitals)',
+ 'uptime' => 'Erişilebilirlik',
+ 'routes' => 'En yavaş rotalar',
+ 'queries' => 'En yavaş sorgular',
+ 'pages' => 'En yavaş sayfalar (LCP)',
+ 'incidents' => 'Son olaylar',
+ 'routes_of_query' => 'Nerede çalışıyor (son 7 gün)',
+ ],
+ 'summary' => [
+ 'requests' => 'Ölçülen istekler',
+ 'ttfb' => 'İlk bayta kadar süre',
+ 'errors' => 'Sunucu hataları',
+ 'cache_ratio' => 'Önbellek isabetleri',
+ 'queries' => 'İstek başına sorgu',
+ 'memory_p95' => 'Bellek, p95',
+ 'mb' => 'MB',
+ ],
+ 'charts' => [
+ 'ttfb' => 'İlk bayta kadar süre',
+ 'db_ms' => 'İstek başına veritabanı süresi',
+ 'query_time' => 'Sorgu süresi',
+ 'table' => 'Grafiğin sayıları',
+ 'legend' => 'p50: isteklerin yarısı daha hızlıydı (daire, düz çizgi). p75: dörtte üçü (kare, kesikli çizgi). p95: yirmide biri dışındakilerin hepsi (üçgen, noktalı çizgi).',
+ ],
+ 'columns' => [
+ 'period' => 'Dönem',
+ 'count' => 'Ölçülen',
+ 'route' => 'Rota',
+ 'page' => 'Sayfa',
+ 'query' => 'Sorgu',
+ 'open' => 'Aç',
+ 'check' => 'Adres',
+ 'status' => 'Durum',
+ 'uptime' => 'Erişilebilirlik',
+ 'response' => 'Yanıt',
+ 'checked_at' => 'Kontrol edildi',
+ 'times' => 'Kez',
+ 'average' => 'Ortalama',
+ 'slowest' => 'En yavaş',
+ 'connection' => 'Bağlantı',
+ 'last_seen' => 'Son görülme',
+ 'rating' => 'Değerlendirme',
+ ],
+ 'vitals' => [
+ 'lcp' => 'En büyük öğenin görünmesi (LCP)',
+ 'inp' => 'Etkileşime yanıt (INP)',
+ 'cls' => 'Düzen kayması (CLS)',
+ 'ttfb' => 'İlk bayta kadar süre (TTFB)',
+ 'fcp' => 'İlk içeriğin görünmesi (FCP)',
+ 'thresholds' => ':good değerine kadar iyi, :poor üzeri kötü',
+ ],
+ 'ratings' => [
+ 'good' => 'İyi',
+ 'needs_improvement' => 'Geliştirilmeli',
+ 'poor' => 'Kötü',
+ ],
+ 'links' => [
+ 'errors' => 'Bu sayfanın hataları',
+ ],
+ 'gadget' => [
+ 'title' => 'Hız ve erişilebilirlik',
+ 'vitals' => 'Ziyaretçiler, 7 günde p75',
+ 'uptime' => '30 günde erişilebilirlik',
+ 'down' => 'Şu an çalışmıyor',
+ 'slowest' => 'En yavaş rotalar, p75',
+ 'open' => 'İzlemeyi aç',
+ ],
+ 'privacy' => 'Çerez ve kişisel veri olmadan ölçülür; Do Not Track kullanan ziyaretçiler dışarıda bırakılır.',
+ 'back' => 'İzlemeye dön',
+ 'ongoing' => 'devam ediyor',
+ 'units' => [
+ 'decimal' => ',',
+ 'ms' => ':value ms',
+ 's' => ':value sn',
+ ],
+ 'permissions' => [
+ 'view' => 'Hız ve erişilebilirlik raporlarını görüntüleme',
+ ],
+];
diff --git a/packages/monitoring/lang/uk/monitoring.php b/packages/monitoring/lang/uk/monitoring.php
new file mode 100644
index 00000000..87fb33eb
--- /dev/null
+++ b/packages/monitoring/lang/uk/monitoring.php
@@ -0,0 +1,167 @@
+ 'Моніторинг',
+ 'menu' => 'Швидкість і доступність',
+ 'health' => 'Стан сайту',
+ 'no_data' => 'Даних поки немає',
+ 'minutes' => ':count хвилина|:count хвилини|:count хвилин',
+
+ 'modules' => [
+ 'checks' => 'Перевірки доступності',
+ 'incidents' => 'Інциденти',
+ ],
+ 'create' => [
+ 'check' => 'Додати перевірку',
+ ],
+ 'fields' => [
+ 'name' => 'Назва',
+ 'url' => 'Адреса',
+ 'status' => 'Стан',
+ 'last_error' => 'Остання помилка',
+ 'response_ms' => 'Відповідь',
+ 'checked_at' => 'Перевірено',
+ 'check' => 'Перевірка',
+ 'started_at' => 'Початок',
+ 'resolved_at' => 'Кінець',
+ 'duration' => 'Тривалість',
+ 'failures' => 'Невдалих перевірок',
+ ],
+ 'hints' => [
+ 'url' => 'Відкривається раз на хвилину. Головна сторінка кожного сайту перевіряється сама.',
+ ],
+ 'status' => [
+ 'unknown' => 'Ще не перевірялося',
+ 'up' => 'Працює',
+ 'failing' => 'Збоїть',
+ 'down' => 'Не працює',
+ ],
+
+ 'settings' => [
+ 'description' => 'Кого сповіщати, коли сайт перестав відповідати, і після скількох невдалих перевірок поспіль.',
+ 'failures' => 'Невдалих перевірок до інциденту',
+ 'failures_hint' => 'Перевірка йде раз на хвилину: 3 — це три хвилини без відповіді.',
+ 'alert_emails' => 'Пошта для сповіщень',
+ 'alert_emails_hint' => 'Одна або кілька адрес через кому або з нового рядка.',
+ 'telegram_token' => 'Токен Telegram-бота',
+ 'telegram_token_hint' => 'Видає @BotFather. Зберігається в базі, а не в коді; ATRIUM_MONITORING_TELEGRAM_TOKEN у .env головніший.',
+ 'telegram_chat_id' => 'Чат Telegram',
+ 'telegram_chat_id_hint' => 'Номер чату на кшталт -1001234567890 або канал на кшталт @site_alerts. Бот має бути його учасником.',
+ ],
+
+ 'alert' => [
+ 'opened_subject' => 'Не працює: :name',
+ 'opened_body' => ":url не відповідає :failures перевірок поспіль, з :since.\nОстання помилка: :error",
+ 'resolved_subject' => 'Знову працює: :name',
+ 'resolved_body' => ':url знову відповідає, простій тривав :duration.',
+ ],
+
+ 'filters' => [
+ 'period' => 'Період',
+ 'site' => 'Сайт',
+ 'locale' => 'Мова',
+ 'device' => 'Пристрій',
+ 'all' => 'Усі',
+ 'route' => 'Маршрут',
+ 'page' => 'Сторінка',
+ 'clear' => 'Показати все',
+ ],
+ 'periods' => [
+ 'day' => 'За днями, 30 днів',
+ 'week' => 'За тижнями, 26 тижнів',
+ 'month' => 'За місяцями, 13 місяців',
+ ],
+ 'devices' => [
+ 'mobile' => 'Телефон',
+ 'tablet' => 'Планшет',
+ 'desktop' => 'Комп\'ютер',
+ ],
+
+ 'sections' => [
+ 'server' => 'Сервер',
+ 'vitals' => 'Відвідувачі (Web Vitals)',
+ 'uptime' => 'Доступність',
+ 'routes' => 'Найповільніші маршрути',
+ 'queries' => 'Найповільніші запити',
+ 'pages' => 'Найповільніші сторінки (LCP)',
+ 'incidents' => 'Останні інциденти',
+ 'routes_of_query' => 'Де виконується (останні 7 днів)',
+ ],
+ 'summary' => [
+ 'requests' => 'Виміряно запитів',
+ 'ttfb' => 'Час до першого байта',
+ 'errors' => 'Помилки сервера',
+ 'cache_ratio' => 'Влучання в кеш',
+ 'queries' => 'Запитів до бази на сторінку',
+ 'memory_p95' => 'Пам\'ять, p95',
+ 'mb' => 'МБ',
+ ],
+ 'charts' => [
+ 'ttfb' => 'Час до першого байта',
+ 'db_ms' => 'Час бази на запит',
+ 'query_time' => 'Час запиту',
+ 'table' => 'Числа графіка',
+ 'legend' => 'p50: половина запитів була швидшою (коло, суцільна лінія). p75: три з чотирьох (квадрат, пунктир). p95: усі, крім одного з двадцяти (трикутник, крапки).',
+ ],
+ 'columns' => [
+ 'period' => 'Період',
+ 'count' => 'Виміряно',
+ 'route' => 'Маршрут',
+ 'page' => 'Сторінка',
+ 'query' => 'Запит',
+ 'open' => 'Відкрити',
+ 'check' => 'Адреса',
+ 'status' => 'Стан',
+ 'uptime' => 'Доступність',
+ 'response' => 'Відповідь',
+ 'checked_at' => 'Перевірено',
+ 'times' => 'Разів',
+ 'average' => 'У середньому',
+ 'slowest' => 'Найдовше',
+ 'connection' => 'Зв\'язок',
+ 'last_seen' => 'Востаннє',
+ 'rating' => 'Оцінка',
+ ],
+ 'vitals' => [
+ 'lcp' => 'Відмальовування головного блоку (LCP)',
+ 'inp' => 'Відгук на дію (INP)',
+ 'cls' => 'Зсув верстки (CLS)',
+ 'ttfb' => 'Перший байт (TTFB)',
+ 'fcp' => 'Перше відмальовування (FCP)',
+ 'thresholds' => 'Добре до :good, погано вище :poor',
+ ],
+ 'ratings' => [
+ 'good' => 'Добре',
+ 'needs_improvement' => 'Терпимо',
+ 'poor' => 'Погано',
+ ],
+ 'links' => [
+ 'errors' => 'Помилки цієї сторінки',
+ ],
+ 'gadget' => [
+ 'title' => 'Швидкість і доступність',
+ 'vitals' => 'Відвідувачі, p75 за 7 днів',
+ 'uptime' => 'Доступність за 30 днів',
+ 'down' => 'Зараз не працює',
+ 'slowest' => 'Повільні маршрути, p75',
+ 'open' => 'Відкрити моніторинг',
+ ],
+ 'privacy' => 'Вимірюється без cookie та особистих даних; відвідувачі з Do Not Track не враховуються.',
+ 'back' => 'Назад до моніторингу',
+ 'ongoing' => 'триває',
+ 'units' => [
+ 'decimal' => ',',
+ 'ms' => ':value мс',
+ 's' => ':value с',
+ ],
+ 'permissions' => [
+ 'view' => 'Перегляд звітів про швидкість і доступність',
+ ],
+];
diff --git a/packages/monitoring/lang/uz/monitoring.php b/packages/monitoring/lang/uz/monitoring.php
new file mode 100644
index 00000000..299ed431
--- /dev/null
+++ b/packages/monitoring/lang/uz/monitoring.php
@@ -0,0 +1,167 @@
+ 'Monitoring',
+ 'menu' => 'Tezlik va mavjudlik',
+ 'health' => 'Sayt holati',
+ 'no_data' => 'Hozircha maʼlumot yoʻq',
+ 'minutes' => ':count daqiqa',
+
+ 'modules' => [
+ 'checks' => 'Mavjudlik tekshiruvlari',
+ 'incidents' => 'Hodisalar',
+ ],
+ 'create' => [
+ 'check' => 'Tekshiruv qoʻshish',
+ ],
+ 'fields' => [
+ 'name' => 'Nomi',
+ 'url' => 'Manzil',
+ 'status' => 'Holati',
+ 'last_error' => 'Oxirgi xato',
+ 'response_ms' => 'Javob',
+ 'checked_at' => 'Tekshirilgan',
+ 'check' => 'Tekshiruv',
+ 'started_at' => 'Boshlanishi',
+ 'resolved_at' => 'Tugashi',
+ 'duration' => 'Davomiyligi',
+ 'failures' => 'Muvaffaqiyatsiz tekshiruvlar',
+ ],
+ 'hints' => [
+ 'url' => 'Daqiqada bir marta ochiladi. Har bir saytning bosh sahifasi oʻzi tekshiriladi.',
+ ],
+ 'status' => [
+ 'unknown' => 'Hali tekshirilmagan',
+ 'up' => 'Ishlayapti',
+ 'failing' => 'Nosoz',
+ 'down' => 'Ishlamayapti',
+ ],
+
+ 'settings' => [
+ 'description' => 'Sayt javob berishni toʻxtatsa kimga va ketma-ket nechta muvaffaqiyatsiz tekshiruvdan keyin xabar berilsin.',
+ 'failures' => 'Hodisagacha muvaffaqiyatsiz tekshiruvlar',
+ 'failures_hint' => 'Tekshiruv daqiqada bir marta ishlaydi: 3 — javobsiz uch daqiqa.',
+ 'alert_emails' => 'Ogohlantirish pochtasi',
+ 'alert_emails_hint' => 'Bir yoki bir nechta manzil, vergul bilan yoki yangi qatordan.',
+ 'telegram_token' => 'Telegram bot tokeni',
+ 'telegram_token_hint' => '@BotFather beradi. Kodda emas, bazada saqlanadi; .env dagi ATRIUM_MONITORING_TELEGRAM_TOKEN ustun turadi.',
+ 'telegram_chat_id' => 'Telegram chati',
+ 'telegram_chat_id_hint' => 'Chat raqami, masalan -1001234567890, yoki kanal, masalan @site_alerts. Bot uning aʼzosi boʻlishi kerak.',
+ ],
+
+ 'alert' => [
+ 'opened_subject' => 'Ishlamayapti: :name',
+ 'opened_body' => ":url :since dan beri ketma-ket :failures marta tekshiruvda javob bermadi.\nOxirgi xato: :error",
+ 'resolved_subject' => 'Yana ishlayapti: :name',
+ 'resolved_body' => ':url yana javob bermoqda, uzilish :duration davom etdi.',
+ ],
+
+ 'filters' => [
+ 'period' => 'Davr',
+ 'site' => 'Sayt',
+ 'locale' => 'Til',
+ 'device' => 'Qurilma',
+ 'all' => 'Hammasi',
+ 'route' => 'Marshrut',
+ 'page' => 'Sahifa',
+ 'clear' => 'Hammasini koʻrsatish',
+ ],
+ 'periods' => [
+ 'day' => 'Kunlar boʻyicha, 30 kun',
+ 'week' => 'Haftalar boʻyicha, 26 hafta',
+ 'month' => 'Oylar boʻyicha, 13 oy',
+ ],
+ 'devices' => [
+ 'mobile' => 'Telefon',
+ 'tablet' => 'Planshet',
+ 'desktop' => 'Kompyuter',
+ ],
+
+ 'sections' => [
+ 'server' => 'Server',
+ 'vitals' => 'Tashrif buyuruvchilar (Web Vitals)',
+ 'uptime' => 'Mavjudlik',
+ 'routes' => 'Eng sekin marshrutlar',
+ 'queries' => 'Eng sekin soʻrovlar',
+ 'pages' => 'Eng sekin sahifalar (LCP)',
+ 'incidents' => 'Oxirgi hodisalar',
+ 'routes_of_query' => 'Qayerda bajariladi (oxirgi 7 kun)',
+ ],
+ 'summary' => [
+ 'requests' => 'Oʻlchangan soʻrovlar',
+ 'ttfb' => 'Birinchi baytgacha vaqt',
+ 'errors' => 'Server xatolari',
+ 'cache_ratio' => 'Keshga tushishlar',
+ 'queries' => 'Sahifaga bazaga soʻrovlar',
+ 'memory_p95' => 'Xotira, p95',
+ 'mb' => 'MB',
+ ],
+ 'charts' => [
+ 'ttfb' => 'Birinchi baytgacha vaqt',
+ 'db_ms' => 'Soʻrovga baza vaqti',
+ 'query_time' => 'Soʻrov vaqti',
+ 'table' => 'Grafik raqamlari',
+ 'legend' => 'p50: soʻrovlarning yarmi tezroq boʻldi (doira, yaxlit chiziq). p75: toʻrttadan uchtasi (kvadrat, uzuq chiziq). p95: yigirmatadan bittasidan tashqari hammasi (uchburchak, nuqtalar).',
+ ],
+ 'columns' => [
+ 'period' => 'Davr',
+ 'count' => 'Oʻlchangan',
+ 'route' => 'Marshrut',
+ 'page' => 'Sahifa',
+ 'query' => 'Soʻrov',
+ 'open' => 'Ochish',
+ 'check' => 'Manzil',
+ 'status' => 'Holati',
+ 'uptime' => 'Mavjudlik',
+ 'response' => 'Javob',
+ 'checked_at' => 'Tekshirilgan',
+ 'times' => 'Marta',
+ 'average' => 'Oʻrtacha',
+ 'slowest' => 'Eng uzoq',
+ 'connection' => 'Aloqa',
+ 'last_seen' => 'Oxirgi marta',
+ 'rating' => 'Baho',
+ ],
+ 'vitals' => [
+ 'lcp' => 'Asosiy blokning chizilishi (LCP)',
+ 'inp' => 'Harakatga javob (INP)',
+ 'cls' => 'Maket siljishi (CLS)',
+ 'ttfb' => 'Birinchi bayt (TTFB)',
+ 'fcp' => 'Birinchi chizilish (FCP)',
+ 'thresholds' => ':good gacha yaxshi, :poor dan yuqori yomon',
+ ],
+ 'ratings' => [
+ 'good' => 'Yaxshi',
+ 'needs_improvement' => 'Qoniqarli',
+ 'poor' => 'Yomon',
+ ],
+ 'links' => [
+ 'errors' => 'Shu sahifa xatolari',
+ ],
+ 'gadget' => [
+ 'title' => 'Tezlik va mavjudlik',
+ 'vitals' => 'Tashrif buyuruvchilar, 7 kunlik p75',
+ 'uptime' => '30 kunlik mavjudlik',
+ 'down' => 'Hozir ishlamayapti',
+ 'slowest' => 'Sekin marshrutlar, p75',
+ 'open' => 'Monitoringni ochish',
+ ],
+ 'privacy' => 'Cookie va shaxsiy maʼlumotlarsiz oʻlchanadi; Do Not Track yoqilgan tashrif buyuruvchilar hisobga olinmaydi.',
+ 'back' => 'Monitoringga qaytish',
+ 'ongoing' => 'davom etmoqda',
+ 'units' => [
+ 'decimal' => ',',
+ 'ms' => ':value ms',
+ 's' => ':value s',
+ ],
+ 'permissions' => [
+ 'view' => 'Tezlik va ishlash hisobotlarini koʻrish',
+ ],
+];
diff --git a/packages/monitoring/lang/zh_CN/monitoring.php b/packages/monitoring/lang/zh_CN/monitoring.php
new file mode 100644
index 00000000..53e2fe8e
--- /dev/null
+++ b/packages/monitoring/lang/zh_CN/monitoring.php
@@ -0,0 +1,167 @@
+ '监控',
+ 'menu' => '速度与可用性',
+ 'health' => '站点健康',
+ 'no_data' => '暂无数据',
+ 'minutes' => ':count 分钟',
+
+ 'modules' => [
+ 'checks' => '可用性检查',
+ 'incidents' => '事件',
+ ],
+ 'create' => [
+ 'check' => '添加检查',
+ ],
+ 'fields' => [
+ 'name' => '名称',
+ 'url' => '地址',
+ 'status' => '状态',
+ 'last_error' => '最近错误',
+ 'response_ms' => '响应',
+ 'checked_at' => '检查时间',
+ 'check' => '检查',
+ 'started_at' => '开始',
+ 'resolved_at' => '结束',
+ 'duration' => '持续时间',
+ 'failures' => '失败的检查',
+ ],
+ 'hints' => [
+ 'url' => '每分钟访问一次。每个站点的首页会自动检查。',
+ ],
+ 'status' => [
+ 'unknown' => '尚未检查',
+ 'up' => '正常运行',
+ 'failing' => '不稳定',
+ 'down' => '无法访问',
+ ],
+
+ 'settings' => [
+ 'description' => '站点停止响应时通知谁,以及连续失败多少次检查后通知。',
+ 'failures' => '触发事件前的失败检查次数',
+ 'failures_hint' => '每分钟检查一次:3 表示连续三分钟无响应。',
+ 'alert_emails' => '告警邮箱',
+ 'alert_emails_hint' => '可填一个或多个地址,用逗号或换行分隔。',
+ 'telegram_token' => 'Telegram 机器人令牌',
+ 'telegram_token_hint' => '由 @BotFather 提供。保存在数据库中,不写入代码;.env 中的 ATRIUM_MONITORING_TELEGRAM_TOKEN 优先。',
+ 'telegram_chat_id' => 'Telegram 聊天',
+ 'telegram_chat_id_hint' => '聊天 ID(如 -1001234567890)或频道(如 @site_alerts)。机器人必须是其成员。',
+ ],
+
+ 'alert' => [
+ 'opened_subject' => '无法访问::name',
+ 'opened_body' => ":url 自 :since 起连续 :failures 次检查无响应。\n最近错误::error",
+ 'resolved_subject' => '已恢复::name',
+ 'resolved_body' => ':url 已恢复响应,故障持续了 :duration。',
+ ],
+
+ 'filters' => [
+ 'period' => '时间段',
+ 'site' => '站点',
+ 'locale' => '语言',
+ 'device' => '设备',
+ 'all' => '全部',
+ 'route' => '路由',
+ 'page' => '页面',
+ 'clear' => '显示全部',
+ ],
+ 'periods' => [
+ 'day' => '按天,30 天',
+ 'week' => '按周,26 周',
+ 'month' => '按月,13 个月',
+ ],
+ 'devices' => [
+ 'mobile' => '手机',
+ 'tablet' => '平板',
+ 'desktop' => '电脑',
+ ],
+
+ 'sections' => [
+ 'server' => '服务器',
+ 'vitals' => '访客 (Web Vitals)',
+ 'uptime' => '可用性',
+ 'routes' => '最慢的路由',
+ 'queries' => '最慢的查询',
+ 'pages' => '最慢的页面 (LCP)',
+ 'incidents' => '最近的事件',
+ 'routes_of_query' => '执行位置(最近 7 天)',
+ ],
+ 'summary' => [
+ 'requests' => '已测量的请求',
+ 'ttfb' => '首字节时间',
+ 'errors' => '服务器错误',
+ 'cache_ratio' => '缓存命中',
+ 'queries' => '每次请求的查询数',
+ 'memory_p95' => '内存,p95',
+ 'mb' => 'MB',
+ ],
+ 'charts' => [
+ 'ttfb' => '首字节时间',
+ 'db_ms' => '每次请求的数据库耗时',
+ 'query_time' => '查询耗时',
+ 'table' => '图表数据',
+ 'legend' => 'p50:一半的请求更快(圆形,实线)。p75:四分之三(方形,虚线)。p95:除二十分之一外的全部(三角形,点线)。',
+ ],
+ 'columns' => [
+ 'period' => '时间段',
+ 'count' => '已测量',
+ 'route' => '路由',
+ 'page' => '页面',
+ 'query' => '查询',
+ 'open' => '打开',
+ 'check' => '地址',
+ 'status' => '状态',
+ 'uptime' => '可用性',
+ 'response' => '响应',
+ 'checked_at' => '检查时间',
+ 'times' => '次数',
+ 'average' => '平均',
+ 'slowest' => '最慢',
+ 'connection' => '连接',
+ 'last_seen' => '最近出现',
+ 'rating' => '评级',
+ ],
+ 'vitals' => [
+ 'lcp' => '最大元素显示 (LCP)',
+ 'inp' => '交互响应 (INP)',
+ 'cls' => '布局偏移 (CLS)',
+ 'ttfb' => '首字节时间 (TTFB)',
+ 'fcp' => '首次内容显示 (FCP)',
+ 'thresholds' => '不超过 :good 为良好,超过 :poor 为较差',
+ ],
+ 'ratings' => [
+ 'good' => '良好',
+ 'needs_improvement' => '需改进',
+ 'poor' => '较差',
+ ],
+ 'links' => [
+ 'errors' => '此页面的错误',
+ ],
+ 'gadget' => [
+ 'title' => '速度与可用性',
+ 'vitals' => '访客,7 天 p75',
+ 'uptime' => '30 天可用性',
+ 'down' => '当前无法访问',
+ 'slowest' => '最慢的路由,p75',
+ 'open' => '打开监控',
+ ],
+ 'privacy' => '统计不使用 cookie,也不收集个人数据;开启 Do Not Track 的访客不计入。',
+ 'back' => '返回监控',
+ 'ongoing' => '进行中',
+ 'units' => [
+ 'decimal' => '.',
+ 'ms' => ':value毫秒',
+ 's' => ':value秒',
+ ],
+ 'permissions' => [
+ 'view' => '查看速度和可用性报告',
+ ],
+];
diff --git a/packages/monitoring/phpunit.xml.dist b/packages/monitoring/phpunit.xml.dist
new file mode 100644
index 00000000..13734531
--- /dev/null
+++ b/packages/monitoring/phpunit.xml.dist
@@ -0,0 +1,16 @@
+
+
+
+
+ tests
+
+
+
+
+ src
+
+
+
diff --git a/packages/monitoring/resources/js/rum.js b/packages/monitoring/resources/js/rum.js
new file mode 100644
index 00000000..b6f8fec3
--- /dev/null
+++ b/packages/monitoring/resources/js/rum.js
@@ -0,0 +1,46 @@
+/*
+ * This file is part of Atrium (https://github.com/AlveBy/atrium).
+ * Copyright (c) 2026 AlveBy. Licensed under the MIT License, see LICENSE.
+ */
+/*
+ * Web Vitals of real visitors, one beacon per page view. No cookies, no
+ * storage, nothing about the person: the page address without its query,
+ * the kind of device by screen width and the connection type. Inlined into
+ * the page by RumScript, which strips these comments; it must stay under
+ * 2 KB (RumScriptTest checks).
+ */
+(function (w, d, n) {
+ var s = d.currentScript, e = s && s.dataset.endpoint, r = +(s && s.dataset.rate);
+ if (!e || !w.PerformanceObserver || !n.sendBeacon || n.doNotTrack == '1' || w.doNotTrack == '1' || n.globalPrivacyControl || !(Math.random() < r)) return;
+ var v = {}, sent = 0, win = 0, first = 0, last = 0, inp = {};
+ function watch(type, cb, extra) {
+ try {
+ new PerformanceObserver(function (l) { l.getEntries().forEach(cb) }).observe(Object.assign({ type: type, buffered: true }, extra));
+ } catch (x) {}
+ }
+ watch('paint', function (x) { if (x.name == 'first-contentful-paint') v.fcp = x.startTime });
+ watch('largest-contentful-paint', function (x) { v.lcp = x.startTime });
+ // CLS: the largest burst of shifts (gaps under 1 s, at most 5 s long).
+ watch('layout-shift', function (x) {
+ if (x.hadRecentInput) return;
+ if (x.startTime - last > 1000 || x.startTime - first > 5000) { win = 0; first = x.startTime }
+ win += x.value; last = x.startTime;
+ if (!(v.cls >= win)) v.cls = win;
+ });
+ // INP: the slowest interaction, one in fifty forgiven on busy pages.
+ watch('event', function (x) { if (x.interactionId) inp[x.interactionId] = Math.max(inp[x.interactionId] || 0, x.duration) }, { durationThreshold: 40 });
+ var nav = performance.getEntriesByType('navigation')[0];
+ if (nav) v.ttfb = Math.max(0, nav.responseStart - (nav.activationStart || 0));
+ function send() {
+ if (sent) return;
+ sent = 1;
+ var a = Object.keys(inp).map(function (k) { return inp[k] }).sort(function (x, y) { return y - x });
+ if (a.length) v.inp = a[Math.min(a.length - 1, Math.floor(a.length / 50))];
+ if (!Object.keys(v).length) return;
+ for (var k in v) v[k] = k == 'cls' ? Math.round(v[k] * 1e4) / 1e4 : Math.round(v[k] * 10) / 10;
+ var c = n.connection && n.connection.effectiveType, x = w.innerWidth, t = w.matchMedia && w.matchMedia('(pointer:coarse)').matches;
+ n.sendBeacon(e, JSON.stringify({ p: location.pathname, d: x < 768 ? 'mobile' : t && x < 1280 ? 'tablet' : 'desktop', c: ['slow-2g', '2g', '3g', '4g'].indexOf(c) < 0 ? 'unknown' : c, v: v }));
+ }
+ d.addEventListener('visibilitychange', function () { if (d.visibilityState == 'hidden') send() });
+ w.addEventListener('pagehide', send);
+})(window, document, navigator);
diff --git a/packages/monitoring/resources/views/components/rum.blade.php b/packages/monitoring/resources/views/components/rum.blade.php
new file mode 100644
index 00000000..dc8ed306
--- /dev/null
+++ b/packages/monitoring/resources/views/components/rum.blade.php
@@ -0,0 +1,6 @@
+{{--
+ This file is part of Atrium (https://github.com/AlveBy/atrium).
+ Copyright (c) 2026 AlveBy. Licensed under the MIT License, see LICENSE.
+--}}
+{{-- The Web Vitals script, for a theme of your own: in the . --}}
+{!! app(\Atrium\Monitoring\Rum\RumScript::class)->tag(request()) !!}
diff --git a/packages/monitoring/routes/admin.php b/packages/monitoring/routes/admin.php
new file mode 100644
index 00000000..aefc3de4
--- /dev/null
+++ b/packages/monitoring/routes/admin.php
@@ -0,0 +1,14 @@
+name('admin.monitoring.index');
+Route::get('monitoring/queries/{hash}', [MonitoringController::class, 'query'])->name('admin.monitoring.query');
diff --git a/packages/monitoring/routes/web.php b/packages/monitoring/routes/web.php
new file mode 100644
index 00000000..8614ceb7
--- /dev/null
+++ b/packages/monitoring/routes/web.php
@@ -0,0 +1,14 @@
+name('atrium-monitoring.rum');
diff --git a/packages/monitoring/src/Admin/Menu.php b/packages/monitoring/src/Admin/Menu.php
new file mode 100644
index 00000000..0231e6af
--- /dev/null
+++ b/packages/monitoring/src/Admin/Menu.php
@@ -0,0 +1,66 @@
+
+ * `site-health`), the other adds its entry to it. Each carries the group's
+ * label, so either works alone. The module's own lists (uptime checks,
+ * incidents) follow the report into the group instead of sitting on top.
+ */
+final class Menu
+{
+ public const GROUP = 'site-health';
+
+ public const ROUTE = 'admin.monitoring.index';
+
+ /** The module's resources, which the core menu puts on top by themselves. */
+ public const LISTS = ['admin.uptime_checks.index', 'admin.monitoring_incidents.index'];
+
+ /**
+ * @param array> $menu
+ * @return array>
+ */
+ public static function add(array $menu): array
+ {
+ $entries = [['label' => 'atrium-monitoring::monitoring.menu', 'route' => self::ROUTE, 'icon' => 'chart']];
+
+ foreach ($menu as $index => $item) {
+ if (in_array($item['route'] ?? null, self::LISTS, true)) {
+ $entries[] = $item;
+ unset($menu[$index]);
+ }
+ }
+
+ $menu = array_values($menu);
+
+ foreach ($menu as $index => $item) {
+ if (($item['key'] ?? null) === self::GROUP) {
+ $menu[$index]['children'] = [...($item['children'] ?? []), ...$entries];
+
+ return $menu;
+ }
+ }
+
+ $group = ['key' => self::GROUP, 'label' => 'atrium-monitoring::monitoring.health', 'icon' => 'chart', 'children' => $entries];
+
+ // Before "Modules", which stays last.
+ $modules = array_search('admin.modules.index', array_map(static fn (array $item): mixed => $item['route'] ?? null, $menu), true);
+
+ if ($modules === false) {
+ $menu[] = $group;
+ } else {
+ array_splice($menu, $modules, 0, [$group]);
+ }
+
+ return $menu;
+ }
+}
diff --git a/packages/monitoring/src/Admin/MonitoringController.php b/packages/monitoring/src/Admin/MonitoringController.php
new file mode 100644
index 00000000..a502b0f2
--- /dev/null
+++ b/packages/monitoring/src/Admin/MonitoringController.php
@@ -0,0 +1,338 @@
+authorize($request);
+
+ $granularity = $this->choice($request, 'period', array_keys(Report::GRANULARITIES), 'day');
+ $site = $this->siteFilter($request, $sites);
+ $locale = $this->stringFilter($request, 'locale', 12);
+ $route = $this->stringFilter($request, 'route', 191);
+ $page = $this->stringFilter($request, 'page', 191);
+ $device = $this->choice($request, 'device', ['mobile', 'tablet', 'desktop'], Aggregator::TOTAL);
+ $periods = $this->report->periods($granularity);
+ [$from, $to] = [$periods[0]['from'], $periods[count($periods) - 1]['to']];
+
+ // Route and language are separate totals (see Aggregator): with a route, the language is all.
+ $server = ['site' => $site, 'locale' => $route === Aggregator::TOTAL ? $locale : Aggregator::TOTAL, 'subject' => $route];
+ $visitors = $this->vitalsFilter($site, $locale, $page, $device);
+
+ return Inertia::render('Admin/Monitoring/Index', [
+ 't' => trans('atrium-monitoring::monitoring'),
+ 'filters' => [
+ 'period' => $granularity,
+ 'site' => $site,
+ 'locale' => $locale,
+ 'route' => $route,
+ 'page' => $page,
+ 'device' => $device,
+ ],
+ 'options' => [
+ 'sites' => $sites->all()->map(fn ($s): array => ['value' => $s->getKey(), 'label' => $s->name])->values(),
+ 'locales' => $languages->codes(),
+ ],
+ 'range' => ['from' => $from, 'to' => $to],
+ 'server' => $this->server($granularity, $server, $from, $to, $site),
+ // Pages are summed per site only: the table would ignore a page, language or device filter.
+ 'vitals' => $this->vitals($granularity, $visitors, $from, $to, $site, $visitors === $this->vitalsFilter($site, Aggregator::TOTAL, Aggregator::TOTAL, Aggregator::TOTAL), $this->errorsLink($request)),
+ 'uptime' => $this->uptime($from, $to, $site),
+ ]);
+ }
+
+ public function query(Request $request, string $hash): Response
+ {
+ $this->authorize($request);
+ abort_unless(preg_match('/\A[a-f0-9]{40}\z/', $hash) === 1, 404);
+
+ $text = DB::table('monitoring_query_texts')->where('hash', $hash)->first();
+ abort_if($text === null, 404);
+
+ $points = self::labelled($this->report->series('query', 'time', 'day', ['subject' => $hash]), 'day');
+ $errors = $this->errorsLink($request);
+ $routes = DB::table('monitoring_queries')
+ ->where('sql_hash', $hash)
+ ->selectRaw('route, max(path) as path, count(*) as times, max(duration_ms) as slowest, avg(duration_ms) as average')
+ ->groupBy('route')
+ ->orderByDesc('times')
+ ->limit(20)
+ ->get()
+ ->map(fn (object $row): array => [
+ 'route' => $row->route,
+ 'path' => $row->path,
+ 'errors_url' => $errors === null ? null : $errors($row->path, null),
+ 'times' => $row->times,
+ 'slowest' => self::ms((float) $row->slowest),
+ 'average' => self::ms((float) $row->average),
+ ]);
+
+ return Inertia::render('Admin/Monitoring/Query', [
+ 't' => trans('atrium-monitoring::monitoring'),
+ 'query' => ['hash' => $hash, 'sql' => $text->sql, 'connection' => $text->connection, 'last_seen' => $text->last_seen_at],
+ 'chart' => SvgChart::render(__('atrium-monitoring::monitoring.charts.query_time'), $points, self::ms(...)),
+ 'points' => self::formatted($points, self::ms(...)),
+ 'routes' => $routes,
+ ]);
+ }
+
+ /**
+ * @param array{site:int|null,locale:string,subject:string} $filter
+ * @return array
+ */
+ private function server(string $granularity, array $filter, string $from, string $to, ?int $site): array
+ {
+ $ttfb = self::labelled($this->report->series('request', 'ttfb', $granularity, $filter), $granularity);
+ $db = self::labelled($this->report->series('request', 'db_ms', $granularity, $filter), $granularity);
+ $total = $this->report->total('request', 'ttfb', $from, $to, $filter);
+ $errors = $this->report->total('request', 'error', $from, $to, $filter);
+ $hits = $this->report->total('request', 'cache_hit', $from, $to, $filter)->sum();
+ $misses = $this->report->total('request', 'cache_miss', $from, $to, $filter)->sum();
+ $queries = $this->report->total('request', 'db_count', $from, $to, $filter);
+ $memory = $this->report->total('request', 'memory', $from, $to, $filter);
+
+ return [
+ 'summary' => [
+ 'requests' => $total->count(),
+ 'ttfb' => self::formattedPercentiles(Report::percentiles($total), self::ms(...)),
+ 'errors' => $errors->count() === 0 ? null : round($errors->sum() / $errors->count() * 100, 2),
+ 'cache_ratio' => $hits + $misses <= 0 ? null : round($hits / ($hits + $misses) * 100, 1),
+ 'queries' => $queries->mean() === null ? null : round($queries->mean(), 1),
+ 'memory_p95' => $memory->quantile(0.95) === null ? null : round((float) $memory->quantile(0.95), 1),
+ ],
+ 'charts' => [
+ ['key' => 'ttfb', 'svg' => SvgChart::render(__('atrium-monitoring::monitoring.charts.ttfb'), $ttfb, self::ms(...)), 'points' => self::formatted($ttfb, self::ms(...))],
+ ['key' => 'db_ms', 'svg' => SvgChart::render(__('atrium-monitoring::monitoring.charts.db_ms'), $db, self::ms(...)), 'points' => self::formatted($db, self::ms(...))],
+ ],
+ 'routes' => array_map(fn (array $row): array => [
+ 'route' => $row['subject'],
+ 'sample' => $this->samplePath($row['subject']),
+ ] + self::formattedPercentiles($row, self::ms(...)), $this->report->top('request', 'ttfb', $from, $to, ['site' => $site])),
+ 'queries' => array_map(fn (array $row): array => [
+ 'hash' => $row['subject'],
+ 'sql' => mb_strimwidth((string) DB::table('monitoring_query_texts')->where('hash', $row['subject'])->value('sql'), 0, 160, '…'),
+ ] + self::formattedPercentiles($row, self::ms(...)), $this->report->top('query', 'time', $from, $to, ['site' => $site])),
+ ];
+ }
+
+ /**
+ * @param array{site:int|null,locale:string,subject:string,device:string} $filter
+ * @return array
+ */
+ /**
+ * Links to the error log's list for one address, when that module is
+ * installed and the administrator may open it.
+ *
+ * @return (\Closure(string,int|null):string)|null
+ */
+ private function errorsLink(Request $request): ?\Closure
+ {
+ $user = $request->user((string) config('atrium.auth.guard', 'admin'));
+
+ if (! Route::has('admin.errors.index') || ! $user instanceof AdminUser || ! $user->hasAdminPermission('errors.view')) {
+ return null;
+ }
+
+ return static fn (string $path, ?int $site): string => route('admin.errors.index', ['status' => 'all', 'path' => $path] + ($site === null ? [] : ['site' => $site]));
+ }
+
+ private function vitals(string $granularity, array $filter, string $from, string $to, ?int $site, bool $withPages, ?\Closure $errors): array
+ {
+ $metrics = [];
+
+ foreach (Aggregator::VITALS as $metric) {
+ $points = self::labelled($this->report->series('vital', $metric, $granularity, $filter), $granularity);
+ $total = Report::percentiles($this->report->total('vital', $metric, $from, $to, $filter));
+ $format = fn (float $v): string => Vitals::format($metric, $v);
+
+ $metrics[] = [
+ 'key' => $metric,
+ 'p75' => $total['p75'] === null ? '—' : $format((float) $total['p75']),
+ 'raw' => $total['p75'],
+ 'rating' => Vitals::rating($metric, $total['p75']),
+ 'count' => $total['count'],
+ 'thresholds' => [Vitals::format($metric, (float) Vitals::THRESHOLDS[$metric][0]), Vitals::format($metric, (float) Vitals::THRESHOLDS[$metric][1])],
+ 'svg' => SvgChart::render(__('atrium-monitoring::monitoring.vitals.'.$metric), $points, $format),
+ 'points' => self::formatted($points, $format),
+ ];
+ }
+
+ $pages = ! $withPages ? [] : array_map(fn (array $row): array => [
+ 'page' => $row['subject'],
+ 'rating' => Vitals::rating('lcp', $row['p75']),
+ 'errors_url' => $errors === null ? null : $errors($row['subject'], $site),
+ ] + self::formattedPercentiles($row, fn (float $v): string => Vitals::format('lcp', $v)), $this->report->top('vital', 'lcp', $from, $to, ['site' => $site]));
+
+ return ['metrics' => $metrics, 'pages' => $pages];
+ }
+
+ /**
+ * @return array
+ */
+ private function uptime(string $from, string $to, ?int $site): array
+ {
+ $ratios = $this->report->uptime($from, $to, $site);
+ $checks = UptimeCheck::query()->withoutGlobalScopes()
+ ->when($site !== null, fn ($q) => $q->where('site_id', $site))
+ ->orderByDesc('is_home')->orderBy('id')->get();
+
+ // Like the checks above, every site's: the panel's current site would hide the name.
+ $incidents = Incident::query()->with(['check' => fn ($q) => $q->withoutGlobalScopes()])
+ ->when($site !== null, fn ($q) => $q->whereHas('check', fn ($c) => $c->withoutGlobalScopes()->where('site_id', $site)))
+ ->latest('started_at')->limit(10)->get();
+
+ return [
+ 'checks' => $checks->map(fn (UptimeCheck $check): array => [
+ 'id' => $check->id,
+ 'name' => $check->name,
+ 'url' => $check->url,
+ 'active' => $check->active,
+ 'status' => $check->status,
+ 'uptime' => isset($ratios[$check->id]) ? round($ratios[$check->id]['ratio'] * 100, 2) : null,
+ 'response' => $check->last_response_ms === null ? null : self::ms($check->last_response_ms),
+ 'checked_at' => $check->last_checked_at?->format('Y-m-d H:i'),
+ 'error' => $check->last_error,
+ ])->values(),
+ 'incidents' => $incidents->map(fn (Incident $incident): array => [
+ 'id' => $incident->id,
+ 'check' => (string) $incident->check?->name,
+ 'started_at' => $incident->started_at->format('Y-m-d H:i'),
+ 'resolved_at' => $incident->resolved_at?->format('Y-m-d H:i'),
+ 'duration' => $incident->duration,
+ 'error' => $incident->last_error,
+ ])->values(),
+ ];
+ }
+
+ private function authorize(Request $request): void
+ {
+ $user = $request->user((string) config('atrium.auth.guard', 'admin'));
+
+ abort_unless($user instanceof AdminUser && $user->hasAdminPermission(self::PERMISSION), 403);
+ }
+
+ private function siteFilter(Request $request, Sites $sites): ?int
+ {
+ $site = $request->query('site');
+
+ return is_numeric($site) && $sites->find((int) $site) !== null ? (int) $site : null;
+ }
+
+ /**
+ * @param list $allowed
+ */
+ private function choice(Request $request, string $key, array $allowed, string $default): string
+ {
+ $value = $request->query($key);
+
+ return is_string($value) && in_array($value, $allowed, true) ? $value : $default;
+ }
+
+ private function stringFilter(Request $request, string $key, int $length): string
+ {
+ $value = $request->query($key);
+
+ return is_string($value) && $value !== '' ? mb_substr($value, 0, $length) : Aggregator::TOTAL;
+ }
+
+ /**
+ * Vitals are summed by language, by page or by device, not by their
+ * pairs: the narrowest filter given wins.
+ *
+ * @return array{site:int|null,locale:string,subject:string,device:string}
+ */
+ private function vitalsFilter(?int $site, string $locale, string $page, string $device): array
+ {
+ return match (true) {
+ $page !== Aggregator::TOTAL => ['site' => $site, 'locale' => Aggregator::TOTAL, 'subject' => $page, 'device' => Aggregator::TOTAL],
+ $device !== Aggregator::TOTAL => ['site' => $site, 'locale' => Aggregator::TOTAL, 'subject' => Aggregator::TOTAL, 'device' => $device],
+ default => ['site' => $site, 'locale' => $locale, 'subject' => Aggregator::TOTAL, 'device' => Aggregator::TOTAL],
+ };
+ }
+
+ /** An address the route answered lately, for a link to the live page. */
+ private function samplePath(string $route): ?string
+ {
+ $path = DB::table('monitoring_requests')->where('route', $route)->where('method', 'GET')->where('status', '<', 400)->orderByDesc('id')->value('path');
+
+ return is_string($path) ? $path : null;
+ }
+
+ /**
+ * @param array> $points
+ * @return array>
+ */
+ private static function labelled(array $points, string $granularity): array
+ {
+ return array_map(static function (array $point) use ($granularity): array {
+ $from = Carbon::parse($point['from']);
+ $point['label'] = $granularity === 'month' ? $from->translatedFormat('M Y') : $from->format('d.m');
+
+ return $point;
+ }, $points);
+ }
+
+ /**
+ * @param array> $points
+ * @return array>
+ */
+ private static function formatted(array $points, callable $format): array
+ {
+ return array_map(static fn (array $point): array => ['label' => $point['label'], 'count' => $point['count']] + self::formattedPercentiles($point, $format), $points);
+ }
+
+ /**
+ * @param array{count:int,p50?:float|null,p75?:float|null,p95?:float|null} $row
+ * @return array{count:int,p50:string,p75:string,p95:string}
+ */
+ private static function formattedPercentiles(array $row, callable $format): array
+ {
+ $result = ['count' => $row['count']];
+
+ foreach (array_keys(Report::QUANTILES) as $name) {
+ $result[$name] = isset($row[$name]) ? $format((float) $row[$name]) : '—';
+ }
+
+ return $result;
+ }
+
+ public static function ms(float $value): string
+ {
+ return Vitals::format('ttfb', $value);
+ }
+}
diff --git a/packages/monitoring/src/Admin/MonitoringGadget.php b/packages/monitoring/src/Admin/MonitoringGadget.php
new file mode 100644
index 00000000..0bd22b85
--- /dev/null
+++ b/packages/monitoring/src/Admin/MonitoringGadget.php
@@ -0,0 +1,78 @@
+option('title', __('atrium-monitoring::monitoring.gadget.title'));
+ }
+
+ /** Only for those who may open the monitoring page it links to. */
+ public function isVisible(): bool
+ {
+ $user = auth((string) config('atrium.auth.guard', 'admin'))->user();
+
+ return parent::isVisible() && $user instanceof AdminUser && $user->hasAdminPermission(MonitoringController::PERMISSION);
+ }
+
+ public function data(): array
+ {
+ $report = app(Report::class);
+ [$weekFrom, $to] = $report->lastDays(7);
+ [$monthFrom] = $report->lastDays(30);
+
+ $vitals = [];
+
+ foreach (Aggregator::VITALS as $metric) {
+ $p75 = $report->total('vital', $metric, $weekFrom, $to)->quantile(0.75);
+ $vitals[] = [
+ 'key' => $metric,
+ 'label' => __('atrium-monitoring::monitoring.vitals.'.$metric),
+ 'value' => Vitals::format($metric, $p75),
+ 'rating' => Vitals::rating($metric, $p75),
+ ];
+ }
+
+ $uptime = $report->uptime($monthFrom, $to);
+ $checks = array_sum(array_column($uptime, 'checks'));
+ $up = array_sum(array_column($uptime, 'up'));
+
+ return [
+ 'vitals' => $vitals,
+ 'uptime' => $checks === 0 ? null : round($up / $checks * 100, 2),
+ 'down' => UptimeCheck::query()->withoutGlobalScopes()->where('active', true)->where('status', UptimeCheck::DOWN)->pluck('name')->all(),
+ 'slowest' => array_map(static fn (array $row): array => [
+ 'route' => $row['subject'],
+ 'p75' => MonitoringController::ms((float) $row['p75']),
+ ], $report->top('request', 'ttfb', $weekFrom, $to, [], 5)),
+ 'url' => route('admin.monitoring.index'),
+ 'labels' => trans('atrium-monitoring::monitoring.gadget'),
+ 'ratings' => trans('atrium-monitoring::monitoring.ratings'),
+ ];
+ }
+}
diff --git a/packages/monitoring/src/Admin/SvgChart.php b/packages/monitoring/src/Admin/SvgChart.php
new file mode 100644
index 00000000..79dd54b9
--- /dev/null
+++ b/packages/monitoring/src/Admin/SvgChart.php
@@ -0,0 +1,224 @@
+ and carry the data for screen readers, and
+ * the page shows the same numbers as a table under the chart.
+ */
+final class SvgChart
+{
+ public const WIDTH = 720;
+
+ public const HEIGHT = 260;
+
+ private const LEFT = 64;
+
+ private const RIGHT = 56;
+
+ private const TOP = 16;
+
+ private const BOTTOM = 40;
+
+ /** The size of the labels' text, as the panel's style sheet sets it. */
+ private const FONT_SIZE = 12;
+
+ /** series => [marker, dash] */
+ public const STYLES = [
+ 'p50' => ['circle', ''],
+ 'p75' => ['square', '7 4'],
+ 'p95' => ['triangle', '2 4'],
+ ];
+
+ /**
+ * @param array> $points each with 'label' and the series keys
+ * @param callable(float):string $format axis and title values
+ */
+ public static function render(string $title, array $points, callable $format, array $series = ['p50', 'p75', 'p95']): string
+ {
+ $values = [];
+
+ foreach ($points as $point) {
+ foreach ($series as $name) {
+ if (isset($point[$name])) {
+ $values[] = (float) $point[$name];
+ }
+ }
+ }
+
+ $id = 'c'.substr(md5($title.json_encode($points)), 0, 8);
+ $plotWidth = self::WIDTH - self::LEFT - self::RIGHT;
+ $plotHeight = self::HEIGHT - self::TOP - self::BOTTOM;
+ $max = self::niceMax(max([0.0, ...$values]));
+ $count = count($points);
+ $x = static fn (int $i): float => self::LEFT + ($count === 1 ? $plotWidth / 2 : $i * $plotWidth / ($count - 1));
+ $y = static fn (float $v): float => self::TOP + $plotHeight - $v / $max * $plotHeight;
+
+ $svg = sprintf(
+ '',
+ self::WIDTH, self::HEIGHT, $id, $id,
+ );
+ $svg .= ''.e($title).' ';
+ $svg .= ''.e(self::describe($points, $series, $format)).' ';
+
+ // Grid and the value axis: four steps.
+ for ($step = 0; $step <= 4; $step++) {
+ $value = $max * $step / 4;
+ $lineY = self::TOP + $plotHeight * (4 - $step) / 4;
+ $svg .= ' ';
+ $svg .= ''.e($format($value)).' ';
+ }
+
+ // Time axis: at most eight labels; the last one always, and no other
+ // closer to it than the regular step, so the two do not run together.
+ $every = intdiv($count + 7, 8);
+
+ foreach ($points as $i => $point) {
+ if ($i === $count - 1 || ($i % $every === 0 && $count - 1 - $i >= $every)) {
+ $svg .= ''.e((string) ($point['label'] ?? '')).' ';
+ }
+ }
+
+ if ($values === []) {
+ $svg .= ''.e(__('atrium-monitoring::monitoring.no_data')).' ';
+
+ return $svg.' ';
+ }
+
+ $groups = [];
+ $lastX = [];
+ $lastY = [];
+
+ foreach ($series as $n => $name) {
+ [$marker, $dash] = self::STYLES[$name] ?? ['circle', ''];
+ $path = '';
+ $markers = '';
+ $pen = 'M';
+
+ foreach ($points as $i => $point) {
+ if (! isset($point[$name])) {
+ $pen = 'M';
+
+ continue;
+ }
+
+ $px = round($x($i), 1);
+ $py = round($y((float) $point[$name]), 1);
+ $path .= $pen.$px.' '.$py.' ';
+ $pen = 'L';
+ $markers .= self::marker($marker, $px, $py, $name.' '.($point['label'] ?? '').': '.$format((float) $point[$name]));
+ $lastX[$n] = $px;
+ $lastY[$n] = $py;
+ }
+
+ $groups[$n] = ''
+ .' '
+ .$markers;
+ }
+
+ $labelY = self::stack($lastY);
+
+ foreach ($groups as $n => $group) {
+ $svg .= $group;
+
+ if (isset($lastX[$n])) {
+ $svg .= ''.$series[$n].' ';
+ }
+
+ $svg .= ' ';
+ }
+
+ return $svg.'';
+ }
+
+ /** A round top for the value axis: 1, 2, 2.5 or 5 times a power of ten. */
+ public static function niceMax(float $value): float
+ {
+ if ($value <= 0) {
+ return 1.0;
+ }
+
+ $power = 10 ** floor(log10($value));
+
+ foreach ([1, 2, 2.5, 5] as $step) {
+ if ($value <= $step * $power) {
+ return $step * $power;
+ }
+ }
+
+ return 10 * $power;
+ }
+
+ /**
+ * Keeps the names at the ends of the lines apart: from the top down, each
+ * one at its own height or, when that would be closer than a line of text
+ * to the one above, just below it. Equal heights keep the series' order.
+ *
+ * @param array $heights series => the end of its line
+ * @return array series => where its name goes
+ */
+ private static function stack(array $heights): array
+ {
+ asort($heights);
+
+ $stacked = [];
+ $floor = -INF;
+
+ foreach ($heights as $n => $height) {
+ $floor = max($height, $floor + self::FONT_SIZE);
+ $stacked[$n] = $floor;
+ }
+
+ return $stacked;
+ }
+
+ private static function marker(string $shape, float $x, float $y, string $title): string
+ {
+ $tip = ''.e($title).' ';
+
+ return match ($shape) {
+ 'square' => ''.$tip.' ',
+ 'triangle' => ''.$tip.' ',
+ default => ''.$tip.' ',
+ };
+ }
+
+ /**
+ * @param array> $points
+ * @param array $series
+ */
+ private static function describe(array $points, array $series, callable $format): string
+ {
+ $parts = [];
+
+ foreach ($points as $point) {
+ $values = [];
+
+ foreach ($series as $name) {
+ if (isset($point[$name])) {
+ $values[] = $name.' '.$format((float) $point[$name]);
+ }
+ }
+
+ if ($values !== []) {
+ $parts[] = ($point['label'] ?? '').': '.implode(', ', $values);
+ }
+ }
+
+ return implode('; ', $parts);
+ }
+}
diff --git a/packages/monitoring/src/Buffer/Buffer.php b/packages/monitoring/src/Buffer/Buffer.php
new file mode 100644
index 00000000..9f84e5a3
--- /dev/null
+++ b/packages/monitoring/src/Buffer/Buffer.php
@@ -0,0 +1,126 @@
+> $records
+ */
+ public function push(array $records): bool
+ {
+ if ($records === []) {
+ return false;
+ }
+
+ $lines = '';
+
+ foreach ($records as $record) {
+ $lines .= json_encode($record, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_INVALID_UTF8_SUBSTITUTE)."\n";
+ }
+
+ if (! is_dir($this->directory)) {
+ // A parallel request may make it first: writing tells whether it is there.
+ @mkdir($this->directory, 0775, true);
+ }
+
+ if (@file_put_contents($this->path(), $lines, FILE_APPEND | LOCK_EX) === false) {
+ return false;
+ }
+
+ return $this->size() > $this->maxBytes;
+ }
+
+ /**
+ * Takes the current file and any left by a flush that died half way.
+ *
+ * @return array the files to read, oldest first
+ */
+ public function claim(): array
+ {
+ $file = $this->path();
+
+ if (is_file($file)) {
+ $work = $this->directory.'/work-'.str_replace('.', '', uniqid('', true)).'.ndjson';
+
+ if (@rename($file, $work)) {
+ // Wait for a writer that opened the file before the rename.
+ $handle = @fopen($work, 'r');
+
+ if ($handle !== false) {
+ flock($handle, LOCK_EX);
+ fclose($handle);
+ }
+ }
+ }
+
+ // glob() sorts by name, and the names start with the time.
+ return glob($this->directory.'/work-*.ndjson') ?: [];
+ }
+
+ /**
+ * The records of a claimed file; broken lines are skipped.
+ *
+ * @return Generator>
+ */
+ public function read(string $file): Generator
+ {
+ $handle = @fopen($file, 'r');
+
+ if ($handle === false) {
+ return;
+ }
+
+ try {
+ while (($line = fgets($handle)) !== false) {
+ $record = json_decode($line, true);
+
+ if (is_array($record) && isset($record['k'])) {
+ yield $record;
+ }
+ }
+ } finally {
+ fclose($handle);
+ }
+ }
+
+ public function path(): string
+ {
+ return $this->directory.'/'.self::FILE;
+ }
+
+ public function size(): int
+ {
+ clearstatcache(true, $this->path());
+
+ return (int) @filesize($this->path());
+ }
+}
diff --git a/packages/monitoring/src/Buffer/FlushBuffer.php b/packages/monitoring/src/Buffer/FlushBuffer.php
new file mode 100644
index 00000000..07990022
--- /dev/null
+++ b/packages/monitoring/src/Buffer/FlushBuffer.php
@@ -0,0 +1,28 @@
+flush();
+ }
+}
diff --git a/packages/monitoring/src/Buffer/Flusher.php b/packages/monitoring/src/Buffer/Flusher.php
new file mode 100644
index 00000000..b57420ac
--- /dev/null
+++ b/packages/monitoring/src/Buffer/Flusher.php
@@ -0,0 +1,182 @@
+getStore();
+ $lock = $locks->lock('atrium-monitoring:flush', 300);
+
+ if (! $lock->get()) {
+ return 0;
+ }
+
+ try {
+ $written = 0;
+
+ foreach ($this->buffer->claim() as $file) {
+ $chunk = [];
+
+ foreach ($this->buffer->read($file) as $record) {
+ $chunk[] = $record;
+
+ if (count($chunk) >= self::CHUNK) {
+ $written += $this->write($chunk);
+ $chunk = [];
+ }
+ }
+
+ $written += $this->write($chunk);
+ @unlink($file);
+ }
+
+ return $written;
+ } finally {
+ $lock->release();
+ }
+ }
+
+ /**
+ * Writes records straight away, past the file: the uptime checks and
+ * the tests use it.
+ *
+ * @param array> $records
+ */
+ public function write(array $records): int
+ {
+ if ($records === []) {
+ return 0;
+ }
+
+ $requests = $queries = $texts = $vitals = [];
+ $aggregator = new Aggregator;
+
+ foreach ($records as $record) {
+ $at = Carbon::createFromTimestamp((int) ($record['at'] ?? time()), (string) config('app.timezone', 'UTC'));
+
+ switch ($record['k'] ?? null) {
+ case 'r':
+ $requests[] = [
+ 'created_at' => $at,
+ 'site_id' => (int) ($record['site'] ?? 0),
+ 'locale' => mb_substr((string) ($record['loc'] ?? ''), 0, 12),
+ 'route' => mb_substr((string) ($record['route'] ?? ''), 0, 191),
+ 'path' => mb_substr((string) ($record['path'] ?? '/'), 0, 255),
+ 'method' => mb_substr((string) ($record['m'] ?? 'GET'), 0, 8),
+ 'status' => (int) ($record['s'] ?? 0),
+ 'duration_ms' => (float) ($record['d'] ?? 0),
+ 'db_queries' => (int) ($record['q'] ?? 0),
+ 'db_ms' => (float) ($record['qm'] ?? 0),
+ 'cache_hits' => (int) ($record['ch'] ?? 0),
+ 'cache_misses' => (int) ($record['cm'] ?? 0),
+ 'memory_kb' => (int) ($record['mem'] ?? 0),
+ ];
+ $aggregator->addRequest($record, $at);
+ break;
+
+ case 'q':
+ $hash = (string) ($record['h'] ?? '');
+
+ if (strlen($hash) !== 40) {
+ break;
+ }
+
+ $queries[] = [
+ 'created_at' => $at,
+ 'site_id' => (int) ($record['site'] ?? 0),
+ 'route' => mb_substr((string) ($record['route'] ?? ''), 0, 191),
+ 'path' => mb_substr((string) ($record['path'] ?? '/'), 0, 255),
+ 'sql_hash' => $hash,
+ 'duration_ms' => (float) ($record['d'] ?? 0),
+ ];
+ $texts[$hash] = [
+ 'hash' => $hash,
+ 'sql' => $record['sql'] ?? '',
+ 'connection' => mb_substr((string) ($record['c'] ?? ''), 0, 64),
+ 'last_seen_at' => $at,
+ ];
+ $aggregator->addQuery($record, $at);
+ break;
+
+ case 'v':
+ $vitals[] = [
+ 'created_at' => $at,
+ 'site_id' => (int) ($record['site'] ?? 0),
+ 'locale' => mb_substr((string) ($record['loc'] ?? ''), 0, 12),
+ 'path' => mb_substr((string) ($record['path'] ?? '/'), 0, 255),
+ 'device' => mb_substr((string) ($record['dev'] ?? ''), 0, 8),
+ 'connection' => mb_substr((string) ($record['con'] ?? ''), 0, 8),
+ 'lcp' => self::number($record, 'lcp'),
+ 'inp' => self::number($record, 'inp'),
+ 'cls' => self::number($record, 'cls'),
+ 'ttfb' => self::number($record, 'ttfb'),
+ 'fcp' => self::number($record, 'fcp'),
+ ];
+ $aggregator->addVitals($record, $at);
+ break;
+ }
+ }
+
+ DB::transaction(function () use ($requests, $queries, $texts, $vitals, $aggregator): void {
+ foreach (array_chunk($requests, 200) as $rows) {
+ DB::table('monitoring_requests')->insert($rows);
+ }
+
+ foreach (array_chunk($queries, 200) as $rows) {
+ DB::table('monitoring_queries')->insert($rows);
+ }
+
+ if ($texts !== []) {
+ DB::table('monitoring_query_texts')->upsert($texts, ['hash'], ['sql', 'connection', 'last_seen_at']);
+ }
+
+ foreach (array_chunk($vitals, 200) as $rows) {
+ DB::table('monitoring_vitals')->insert($rows);
+ }
+
+ $aggregator->save();
+ });
+
+ return count($requests) + count($queries) + count($vitals);
+ }
+
+ /**
+ * @param array $record
+ */
+ private static function number(array $record, string $key): ?float
+ {
+ return isset($record[$key]) && is_numeric($record[$key]) ? (float) $record[$key] : null;
+ }
+}
diff --git a/packages/monitoring/src/Collector/Benchmark.php b/packages/monitoring/src/Collector/Benchmark.php
new file mode 100644
index 00000000..eea2902f
--- /dev/null
+++ b/packages/monitoring/src/Collector/Benchmark.php
@@ -0,0 +1,135 @@
+scratch ?? sys_get_temp_dir()).'/atrium-monitoring-bench-'.bin2hex(random_bytes(4));
+ $previous = app(Recorder::class);
+ $recorder = new Recorder(new Buffer($directory, PHP_INT_MAX));
+ app()->instance(Recorder::class, $recorder);
+
+ $sample = config('atrium-monitoring.server.sample_rate');
+ $enabled = config('atrium-monitoring.server.enabled');
+ config(['atrium-monitoring.server.sample_rate' => 1.0, 'atrium-monitoring.server.enabled' => true]);
+
+ $baseline = $measured = [];
+
+ try {
+ $middleware = new CollectMetrics($recorder);
+ $request = Request::create('/bench/hello-world', 'GET');
+ $route = (new Route('GET', 'bench/{slug}', fn () => null))->name('bench.page');
+ $request->setRouteResolver(fn () => $route);
+ $response = new Response('ok');
+ /** @var Connection $connection */
+ $connection = DB::connection();
+ $app = fn (): Response => $this->simulate($response, $connection, $queries);
+
+ // Warm up both paths: autoloading and the first file open are not the per-request cost.
+ for ($i = 0; $i < 50; $i++) {
+ $app();
+ $middleware->terminate($request, $middleware->handle($request, $app));
+ }
+
+ for ($round = 0; $round < $rounds; $round++) {
+ $start = $this->nanoseconds();
+ for ($i = 0; $i < $perRound; $i++) {
+ $app();
+ }
+ $baseline[] = ($this->nanoseconds() - $start) / 1e6 / $perRound;
+
+ $start = $this->nanoseconds();
+ for ($i = 0; $i < $perRound; $i++) {
+ $middleware->terminate($request, $middleware->handle($request, $app));
+ }
+ $measured[] = ($this->nanoseconds() - $start) / 1e6 / $perRound;
+ }
+ } finally {
+ config(['atrium-monitoring.server.sample_rate' => $sample, 'atrium-monitoring.server.enabled' => $enabled]);
+ app()->instance(Recorder::class, $previous);
+ File::deleteDirectory($directory);
+ }
+
+ $overhead = array_map(static fn (float $with, float $without): float => $with - $without, $measured, $baseline);
+
+ return [
+ 'requests' => $perRound * $rounds,
+ 'queries' => $queries,
+ 'rounds' => $rounds,
+ 'baseline_ms' => self::median($baseline),
+ 'measured_ms' => self::median($measured),
+ 'overhead_ms' => max(0.0, self::median($overhead)),
+ ];
+ }
+
+ /** @param array $values */
+ public static function median(array $values): float
+ {
+ if ($values === []) {
+ return 0.0;
+ }
+
+ sort($values);
+ $middle = intdiv(count($values), 2);
+
+ return count($values) % 2 === 1 ? $values[$middle] : ($values[$middle - 1] + $values[$middle]) / 2;
+ }
+
+ /** The clock of the measurement: the one thing a test replaces to know the exact numbers. */
+ protected function nanoseconds(): int
+ {
+ return hrtime(true);
+ }
+
+ private function simulate(Response $response, Connection $connection, int $queries): Response
+ {
+ foreach (array_keys(array_fill(0, max(0, $queries), null)) as $q) {
+ $this->events->dispatch(new QueryExecuted('select * from "pages" where "id" = ? limit 1', [$q], 0.4, $connection));
+ }
+
+ $this->events->dispatch(new CacheHit('array', 'settings', 'value'));
+ $this->events->dispatch(new CacheMissed('array', 'menu'));
+
+ return $response;
+ }
+}
diff --git a/packages/monitoring/src/Collector/CollectMetrics.php b/packages/monitoring/src/Collector/CollectMetrics.php
new file mode 100644
index 00000000..a04ba1ce
--- /dev/null
+++ b/packages/monitoring/src/Collector/CollectMetrics.php
@@ -0,0 +1,39 @@
+recorder->start($request);
+
+ $response = $next($request);
+ $this->recorder->responded();
+
+ return $response;
+ }
+
+ public function terminate(Request $request, Response $response): void
+ {
+ $this->recorder->finish($request, $response);
+ }
+}
diff --git a/packages/monitoring/src/Collector/Recorder.php b/packages/monitoring/src/Collector/Recorder.php
new file mode 100644
index 00000000..c6db2cdb
--- /dev/null
+++ b/packages/monitoring/src/Collector/Recorder.php
@@ -0,0 +1,257 @@
+ */
+ private array $slow = [];
+
+ private int $hits = 0;
+
+ private int $misses = 0;
+
+ private float $slowMs = 100.0;
+
+ public function __construct(private readonly Buffer $buffer) {}
+
+ /**
+ * Starts measuring unless the request is left out or not in the sample.
+ */
+ public function start(Request $request): bool
+ {
+ $this->active = false;
+
+ if (! config('atrium-monitoring.server.enabled', true)) {
+ return false;
+ }
+
+ $rate = (float) config('atrium-monitoring.server.sample_rate', 1.0);
+
+ if ($rate <= 0.0 || ($rate < 1.0 && $this->lottery() >= $rate)) {
+ return false;
+ }
+
+ $except = (array) config('atrium-monitoring.server.except', []);
+
+ if ($except !== [] && $request->is(...$except)) {
+ return false;
+ }
+
+ $this->active = true;
+ $this->slowMs = (float) config('atrium-monitoring.server.slow_query_ms', 100);
+ // public/index.php defines LARAVEL_START; a worker or a test does not.
+ $this->start = defined('LARAVEL_START') ? LARAVEL_START : $this->now();
+ $this->ttfb = null;
+ $this->queries = 0;
+ $this->dbMs = 0.0;
+ $this->slow = [];
+ $this->hits = 0;
+ $this->misses = 0;
+
+ return true;
+ }
+
+ public function query(QueryExecuted $event): void
+ {
+ if (! $this->active) {
+ return;
+ }
+
+ $this->queries++;
+ $this->dbMs += $event->time;
+
+ if ($event->time >= $this->slowMs && count($this->slow) < self::MAX_SLOW) {
+ $this->slow[] = ['sql' => $event->sql, 'connection' => $event->connectionName, 'ms' => $event->time];
+ }
+ }
+
+ public function hit(): void
+ {
+ if ($this->active) {
+ $this->hits++;
+ }
+ }
+
+ public function miss(): void
+ {
+ if ($this->active) {
+ $this->misses++;
+ }
+ }
+
+ /** The response is ready: this is the time to the first byte. */
+ public function responded(): void
+ {
+ if ($this->active && $this->ttfb === null) {
+ $this->ttfb = ($this->now() - $this->start) * 1000;
+ }
+ }
+
+ public function finish(Request $request, Response $response): void
+ {
+ if (! $this->active) {
+ return;
+ }
+
+ $this->active = false;
+
+ try {
+ if ($this->buffer->push($this->records($request, $response))) {
+ $this->flushEarly();
+ }
+ } catch (Throwable) {
+ // A measurement is never worth an error page.
+ }
+ }
+
+ /**
+ * @return array>
+ */
+ public function records(Request $request, Response $response): array
+ {
+ $at = time();
+ $site = $this->siteId();
+ $route = self::routeName($request);
+ $path = mb_substr('/'.ltrim($request->path(), '/'), 0, 255);
+ [$hits, $misses] = $this->cacheStats();
+
+ $records = [[
+ 'k' => 'r',
+ 'at' => $at,
+ 'site' => $site,
+ 'loc' => app()->getLocale(),
+ 'route' => $route,
+ 'path' => $path,
+ 'm' => $request->getMethod(),
+ 's' => $response->getStatusCode(),
+ 'd' => round((float) $this->ttfb, 3),
+ 'q' => $this->queries,
+ 'qm' => round($this->dbMs, 3),
+ 'ch' => $hits,
+ 'cm' => $misses,
+ 'mem' => intdiv(memory_get_peak_usage(), 1024),
+ ]];
+
+ foreach ($this->slow as $query) {
+ $sql = SqlNormalizer::normalize($query['sql']);
+ $records[] = [
+ 'k' => 'q',
+ 'at' => $at,
+ 'site' => $site,
+ 'route' => $route,
+ 'path' => $path,
+ 'h' => SqlNormalizer::hash($sql, $query['connection']),
+ 'sql' => $sql,
+ 'c' => $query['connection'],
+ 'd' => round($query['ms'], 3),
+ ];
+ }
+
+ return $records;
+ }
+
+ /**
+ * The route's name, else its URI pattern, so /news/a and /news/b are one
+ * line of the report; a request no route matched groups by its status.
+ */
+ public static function routeName(Request $request): string
+ {
+ $route = $request->route();
+
+ if (! $route instanceof Route) {
+ return '(none)';
+ }
+
+ return mb_substr($route->getName() ?? '/'.ltrim($route->uri(), '/'), 0, 191);
+ }
+
+ /**
+ * The cache module reports its own hits and misses through the filter;
+ * without it, Laravel's cache events are counted.
+ *
+ * @return array{0:int,1:int}
+ */
+ private function cacheStats(): array
+ {
+ if (Hook::has('atrium.cache.stats')) {
+ $stats = Hook::apply('atrium.cache.stats', ['hits' => 0, 'misses' => 0]);
+
+ if (is_array($stats)) {
+ return [max(0, (int) ($stats['hits'] ?? null)), max(0, (int) ($stats['misses'] ?? null))];
+ }
+ }
+
+ return [$this->hits, $this->misses];
+ }
+
+ /** The clock; a test sets it to know the time to the first byte to the last digit. */
+ protected function now(): float
+ {
+ return microtime(true);
+ }
+
+ /** The dice of the sample: 0 to 1, a request is measured when it falls below the rate. */
+ protected function lottery(): float
+ {
+ return mt_rand() / mt_getrandmax();
+ }
+
+ private function siteId(): int
+ {
+ $sites = app(Sites::class);
+
+ return $sites->isResolved() ? (int) $sites->current()->getKey() : 0;
+ }
+
+ private function flushEarly(): void
+ {
+ $queue = config('atrium-monitoring.buffer.queue');
+
+ if (is_string($queue) && $queue !== '') {
+ FlushBuffer::dispatch()->onConnection($queue);
+
+ return;
+ }
+
+ app(Flusher::class)->flush();
+ }
+}
diff --git a/packages/monitoring/src/Collector/SqlNormalizer.php b/packages/monitoring/src/Collector/SqlNormalizer.php
new file mode 100644
index 00000000..72c45abb
--- /dev/null
+++ b/packages/monitoring/src/Collector/SqlNormalizer.php
@@ -0,0 +1,44 @@
+run(max(1, (int) $this->option('requests')), max(0, (int) $this->option('queries')), max(1, (int) $this->option('rounds')));
+
+ $this->table(['Requests', 'Queries each', 'Rounds', 'Without, ms', 'With, ms', 'Added per request, ms'], [[
+ $result['requests'],
+ $result['queries'],
+ $result['rounds'],
+ number_format($result['baseline_ms'], 4),
+ number_format($result['measured_ms'], 4),
+ number_format($result['overhead_ms'], 4),
+ ]]);
+
+ return $result['overhead_ms'] < 1.0 ? self::SUCCESS : self::FAILURE;
+ }
+}
diff --git a/packages/monitoring/src/Console/FlushCommand.php b/packages/monitoring/src/Console/FlushCommand.php
new file mode 100644
index 00000000..5b2aadea
--- /dev/null
+++ b/packages/monitoring/src/Console/FlushCommand.php
@@ -0,0 +1,27 @@
+info('Written: '.$flusher->flush());
+
+ return self::SUCCESS;
+ }
+}
diff --git a/packages/monitoring/src/Console/PruneCommand.php b/packages/monitoring/src/Console/PruneCommand.php
new file mode 100644
index 00000000..e235b02c
--- /dev/null
+++ b/packages/monitoring/src/Console/PruneCommand.php
@@ -0,0 +1,59 @@
+subDays(max(1, (int) config('atrium-monitoring.retention.raw_days', 7)));
+ $aggregates = now()->startOfDay()->subMonths(max(1, (int) config('atrium-monitoring.retention.aggregate_months', 13)));
+
+ $deleted = 0;
+
+ foreach (['monitoring_requests' => 'created_at', 'monitoring_queries' => 'created_at', 'monitoring_vitals' => 'created_at', 'monitoring_check_results' => 'checked_at'] as $table => $column) {
+ $deleted += $this->prune($table, $column, $raw);
+ }
+
+ $deleted += $this->prune('monitoring_daily', 'day', $aggregates->toDateString());
+ $deleted += $this->prune('monitoring_query_texts', 'last_seen_at', $aggregates);
+ $deleted += $this->prune('monitoring_incidents', 'resolved_at', $aggregates);
+
+ $this->info('Deleted: '.$deleted);
+
+ return self::SUCCESS;
+ }
+
+ private function prune(string $table, string $column, mixed $before): int
+ {
+ $total = 0;
+
+ do {
+ $deleted = DB::table($table)->where($column, '<', $before)->limit(self::SLICE)->delete();
+ $total += $deleted;
+ } while ($deleted >= self::SLICE);
+
+ return $total;
+ }
+}
diff --git a/packages/monitoring/src/Console/UptimeCommand.php b/packages/monitoring/src/Console/UptimeCommand.php
new file mode 100644
index 00000000..6255f907
--- /dev/null
+++ b/packages/monitoring/src/Console/UptimeCommand.php
@@ -0,0 +1,34 @@
+line('Uptime checks are off.');
+
+ return self::SUCCESS;
+ }
+
+ $checker->syncHomes();
+ $this->info('Checked: '.$checker->run());
+
+ return self::SUCCESS;
+ }
+}
diff --git a/packages/monitoring/src/Models/Incident.php b/packages/monitoring/src/Models/Incident.php
new file mode 100644
index 00000000..54e8ddb5
--- /dev/null
+++ b/packages/monitoring/src/Models/Incident.php
@@ -0,0 +1,123 @@
+ 'integer',
+ 'started_at' => 'datetime',
+ 'resolved_at' => 'datetime',
+ 'failures' => 'integer',
+ ];
+ }
+
+ /**
+ * @return BelongsTo
+ */
+ public function check(): BelongsTo
+ {
+ return $this->belongsTo(UptimeCheck::class, 'check_id');
+ }
+
+ /** How long it lasted, or has lasted so far, in whole minutes. */
+ public function minutes(?Carbon $now = null): int
+ {
+ $end = $this->resolved_at ?? $now ?? now();
+
+ return (int) floor($this->started_at->diffInSeconds($end, true) / 60);
+ }
+
+ public function getDurationAttribute(): string
+ {
+ return trans_choice('atrium-monitoring::monitoring.minutes', $this->minutes());
+ }
+
+ public function getCheckNameAttribute(): string
+ {
+ return (string) $this->check?->name;
+ }
+
+ public static function isCreatableInAdmin(): bool
+ {
+ return false;
+ }
+
+ public static function isEditableInAdmin(): bool
+ {
+ return false;
+ }
+
+ public static function getAdminLabel(): string
+ {
+ return __('atrium-monitoring::monitoring.modules.incidents');
+ }
+
+ public static function getAdminRoutePrefix(): string
+ {
+ return 'monitoring_incidents';
+ }
+
+ public static function getDefaultSortColumn(): string
+ {
+ return 'started_at';
+ }
+
+ public static function getDefaultSortDirection(): string
+ {
+ return 'desc';
+ }
+
+ /** Read-only: everything worth reading is in the list. */
+ public static function getAdministrationFields(): array
+ {
+ return [];
+ }
+
+ public static function getAdministrationListColumns(): array
+ {
+ return [
+ TextColumn::make('id')->label(__('atrium::fields.standard.id'))->sortable(),
+ TextColumn::make('check.name')->label(__('atrium-monitoring::monitoring.fields.check')),
+ DateColumn::make('started_at')->label(__('atrium-monitoring::monitoring.fields.started_at'))->sortable(),
+ DateColumn::make('resolved_at')->label(__('atrium-monitoring::monitoring.fields.resolved_at'))->sortable(),
+ TextColumn::make('duration')->label(__('atrium-monitoring::monitoring.fields.duration')),
+ TextColumn::make('last_error')->label(__('atrium-monitoring::monitoring.fields.last_error')),
+ ];
+ }
+}
diff --git a/packages/monitoring/src/Models/UptimeCheck.php b/packages/monitoring/src/Models/UptimeCheck.php
new file mode 100644
index 00000000..7e2f216f
--- /dev/null
+++ b/packages/monitoring/src/Models/UptimeCheck.php
@@ -0,0 +1,147 @@
+ self::UNKNOWN, 'failures' => 0, 'active' => true, 'is_home' => false];
+
+ protected function casts(): array
+ {
+ return [
+ 'is_home' => 'boolean',
+ 'active' => 'boolean',
+ 'failures' => 'integer',
+ 'last_checked_at' => 'datetime',
+ 'last_status_code' => 'integer',
+ 'last_response_ms' => 'float',
+ ];
+ }
+
+ /**
+ * @return HasMany
+ */
+ public function incidents(): HasMany
+ {
+ return $this->hasMany(Incident::class, 'check_id');
+ }
+
+ public function openIncident(): ?Incident
+ {
+ return $this->incidents()->whereNull('resolved_at')->latest('started_at')->first();
+ }
+
+ public function getStatusLabelAttribute(): string
+ {
+ return __('atrium-monitoring::monitoring.status.'.$this->status);
+ }
+
+ public static function getAdminLabel(): string
+ {
+ return __('atrium-monitoring::monitoring.modules.checks');
+ }
+
+ public static function getAdminCreateLabel(): string
+ {
+ return __('atrium-monitoring::monitoring.create.check');
+ }
+
+ public static function getAdminRoutePrefix(): string
+ {
+ return 'uptime_checks';
+ }
+
+ public static function getDefaultSortColumn(): string
+ {
+ return 'id';
+ }
+
+ public static function getDefaultSortDirection(): string
+ {
+ return 'asc';
+ }
+
+ /** A front page comes back at the next check; switch it off instead. */
+ public function canDelete(): bool
+ {
+ return ! $this->is_home;
+ }
+
+ public static function getAdministrationFields(): array
+ {
+ return [
+ CheckboxField::make('active')->label(__('atrium::fields.standard.active'))->default(true),
+ TextField::make('name')->label(__('atrium-monitoring::monitoring.fields.name'))->required(),
+ TextField::make('url')->label(__('atrium-monitoring::monitoring.fields.url'))
+ ->required()->rules(['url:http,https', 'max:2048'])
+ ->placeholder('https://example.com/contacts')
+ ->hint(__('atrium-monitoring::monitoring.hints.url')),
+ TextField::make('status_label')->label(__('atrium-monitoring::monitoring.fields.status'))->readonly()->hideOnCreate(),
+ TextField::make('last_error')->label(__('atrium-monitoring::monitoring.fields.last_error'))->readonly()->hideOnCreate(),
+ ];
+ }
+
+ public static function getAdministrationListColumns(): array
+ {
+ return [
+ TextColumn::make('id')->label(__('atrium::fields.standard.id'))->sortable(),
+ TextColumn::make('name')->label(__('atrium-monitoring::monitoring.fields.name'))->sortable()->searchable(),
+ TextColumn::make('url')->label(__('atrium-monitoring::monitoring.fields.url'))->searchable(),
+ TextColumn::make('status_label')->label(__('atrium-monitoring::monitoring.fields.status')),
+ TextColumn::make('last_response_ms')->label(__('atrium-monitoring::monitoring.fields.response_ms'))->alignRight(),
+ DateColumn::make('last_checked_at')->label(__('atrium-monitoring::monitoring.fields.checked_at'))->sortable(),
+ BooleanColumn::make('active')->label(__('atrium::fields.standard.active')),
+ ];
+ }
+}
diff --git a/packages/monitoring/src/MonitoringServiceProvider.php b/packages/monitoring/src/MonitoringServiceProvider.php
new file mode 100644
index 00000000..646f91f5
--- /dev/null
+++ b/packages/monitoring/src/MonitoringServiceProvider.php
@@ -0,0 +1,150 @@
+mergeConfigFrom(__DIR__.'/../config/atrium-monitoring.php', 'atrium-monitoring');
+
+ $this->app->singleton(Buffer::class, fn (): Buffer => new Buffer(
+ (string) config('atrium-monitoring.buffer.path'),
+ max(1024, (int) config('atrium-monitoring.buffer.max_bytes', 262144)),
+ ));
+ // Per request, so a long-running worker starts every request clean.
+ $this->app->scoped(Recorder::class);
+ $this->app->singleton(Flusher::class);
+ $this->app->singleton(RumScript::class);
+ }
+
+ public function boot(): void
+ {
+ $this->loadTranslationsFrom(__DIR__.'/../lang', 'atrium-monitoring');
+ $this->loadViewsFrom(__DIR__.'/../resources/views', 'atrium-monitoring');
+ Blade::anonymousComponentPath(__DIR__.'/../resources/views/components', 'atrium-monitoring');
+
+ $this->publishes([
+ __DIR__.'/../config/atrium-monitoring.php' => config_path('atrium-monitoring.php'),
+ ], 'atrium-monitoring-config');
+
+ // Required but not installed: no tables, so nothing to measure into.
+ if (! $this->app->make(Modules::class)->isInstalled(self::MODULE)) {
+ return;
+ }
+
+ $this->registerCollector();
+ $this->registerRoutes();
+ $this->registerAdmin();
+ $this->registerTheme();
+ $this->registerConsole();
+ }
+
+ private function registerCollector(): void
+ {
+ if (! config('atrium-monitoring.server.enabled', true)) {
+ return;
+ }
+
+ $this->app->make(HttpKernel::class)->appendMiddlewareToGroup('web', CollectMetrics::class);
+
+ Event::listen(QueryExecuted::class, fn (QueryExecuted $event) => $this->app->make(Recorder::class)->query($event));
+ Event::listen(CacheHit::class, fn () => $this->app->make(Recorder::class)->hit());
+ Event::listen(CacheMissed::class, fn () => $this->app->make(Recorder::class)->miss());
+ }
+
+ private function registerRoutes(): void
+ {
+ $this->loadRoutesFrom(__DIR__.'/../routes/web.php');
+
+ Route::prefix((string) config('atrium.prefix', 'admin'))
+ ->middleware([...config('atrium.middleware', ['web']), 'atrium.inertia', 'admin.auth', 'admin.can'])
+ ->group(__DIR__.'/../routes/admin.php');
+ }
+
+ private function registerAdmin(): void
+ {
+ config()->push('atrium.dashboard.gadgets', MonitoringGadget::class);
+
+ Hook::filter('atrium.admin.menu', function (array $items, ?AdminUser $user = null): array {
+ if ($user !== null && ! $user->hasAdminPermission(MonitoringController::PERMISSION)) {
+ return $items;
+ }
+
+ return Menu::add($items);
+ });
+ }
+
+ private function registerTheme(): void
+ {
+ if (! config('atrium-monitoring.rum.enabled', true) || ! config('atrium-monitoring.rum.theme', true)) {
+ return;
+ }
+
+ View::composer('atrium-theme::layout', function (ViewInstance $view): void {
+ $tag = $this->app->make(RumScript::class)->tag(request());
+
+ if ($tag !== '') {
+ $view->getFactory()->startPush('head', $tag);
+ }
+ });
+ }
+
+ private function registerConsole(): void
+ {
+ $this->commands([
+ Console\FlushCommand::class,
+ Console\UptimeCommand::class,
+ Console\PruneCommand::class,
+ Console\BenchmarkCommand::class,
+ ]);
+
+ if (! config('atrium-monitoring.schedule', true)) {
+ return;
+ }
+
+ $this->callAfterResolving(Schedule::class, function (Schedule $schedule): void {
+ $schedule->command('atrium:monitoring:flush')->everyMinute()->withoutOverlapping(10);
+ $schedule->command('atrium:monitoring:uptime')->everyMinute()->withoutOverlapping(5);
+ $schedule->command('atrium:monitoring:prune')->dailyAt('03:17')->withoutOverlapping(60);
+ });
+ }
+}
diff --git a/packages/monitoring/src/MonitoringSettings.php b/packages/monitoring/src/MonitoringSettings.php
new file mode 100644
index 00000000..2ddb5807
--- /dev/null
+++ b/packages/monitoring/src/MonitoringSettings.php
@@ -0,0 +1,47 @@
+label(__('atrium-monitoring::monitoring.settings.failures'))
+ ->hint(__('atrium-monitoring::monitoring.settings.failures_hint'))
+ ->default((int) config('atrium-monitoring.uptime.failures', 3))
+ ->rules(['integer', 'min:1', 'max:60']),
+ TextareaField::make('alert_emails')->label(__('atrium-monitoring::monitoring.settings.alert_emails'))
+ ->hint(__('atrium-monitoring::monitoring.settings.alert_emails_hint'))
+ ->placeholder('ops@example.com')
+ ->rules(['max:2000']),
+ TextField::make('telegram_token')->label(__('atrium-monitoring::monitoring.settings.telegram_token'))
+ ->hint(__('atrium-monitoring::monitoring.settings.telegram_token_hint'))
+ ->rules(['regex:/^\d+:[A-Za-z0-9_-]{20,}$/']),
+ TextField::make('telegram_chat_id')->label(__('atrium-monitoring::monitoring.settings.telegram_chat_id'))
+ ->hint(__('atrium-monitoring::monitoring.settings.telegram_chat_id_hint'))
+ ->rules(['regex:/^(-?\d+|@[A-Za-z0-9_]{5,})$/']),
+ ];
+ }
+}
diff --git a/packages/monitoring/src/Rum/Beacon.php b/packages/monitoring/src/Rum/Beacon.php
new file mode 100644
index 00000000..da14e377
--- /dev/null
+++ b/packages/monitoring/src/Rum/Beacon.php
@@ -0,0 +1,87 @@
+}|null
+ */
+ public static function parse(string $body): ?array
+ {
+ $data = json_decode($body, true);
+
+ if (! is_array($data) || array_is_list($data) || array_diff(array_keys($data), self::KEYS) !== []) {
+ return null;
+ }
+
+ $path = self::path($data['p'] ?? null);
+ $device = $data['d'] ?? null;
+ $connection = $data['c'] ?? 'unknown';
+ $values = $data['v'] ?? null;
+
+ if ($path === null || ! in_array($device, self::DEVICES, true) || ! in_array($connection, self::CONNECTIONS, true)) {
+ return null;
+ }
+
+ if (! is_array($values) || $values === []) {
+ return null;
+ }
+
+ $vitals = [];
+
+ foreach ($values as $metric => $value) {
+ if (! is_string($metric) || ! isset(Vitals::LIMITS[$metric]) || ! (is_int($value) || is_float($value))) {
+ return null;
+ }
+
+ if (! is_finite($value) || $value < 0 || $value > Vitals::LIMITS[$metric]) {
+ return null;
+ }
+
+ $vitals[$metric] = round($value, $metric === 'cls' ? 4 : 1);
+ }
+
+ return ['path' => $path, 'device' => $device, 'connection' => $connection, 'vitals' => $vitals];
+ }
+
+ private static function path(mixed $path): ?string
+ {
+ if (! is_string($path) || $path === '' || $path[0] !== '/' || str_starts_with($path, '//') || strlen($path) > 2048) {
+ return null;
+ }
+
+ $path = substr($path, 0, strcspn($path, '?#'));
+
+ if (preg_match('/[\x00-\x1F\x7F]/', $path) === 1 || ! mb_check_encoding($path, 'UTF-8')) {
+ return null;
+ }
+
+ return mb_substr($path, 0, 255);
+ }
+}
diff --git a/packages/monitoring/src/Rum/BeaconController.php b/packages/monitoring/src/Rum/BeaconController.php
new file mode 100644
index 00000000..ee56e848
--- /dev/null
+++ b/packages/monitoring/src/Rum/BeaconController.php
@@ -0,0 +1,101 @@
+noContent();
+ }
+
+ $max = (int) config('atrium-monitoring.rum.max_bytes', 2048);
+
+ if ((int) $request->header('Content-Length', '0') > $max) {
+ return response()->noContent(413);
+ }
+
+ $key = 'atrium-monitoring:rum:'.hash_hmac('sha256', (string) $request->ip(), (string) config('app.key'));
+
+ if (RateLimiter::tooManyAttempts($key, (int) config('atrium-monitoring.rum.rate_limit', 30))) {
+ return response()->noContent(429);
+ }
+
+ RateLimiter::hit($key, 60);
+
+ $body = $request->getContent();
+
+ if (strlen($body) > $max) {
+ return response()->noContent(413);
+ }
+
+ $origin = $request->header('Origin');
+
+ if (is_string($origin) && $origin !== '' && $origin !== 'null' && parse_url($origin, PHP_URL_HOST) !== $request->getHost()) {
+ return response()->noContent(403);
+ }
+
+ $beacon = Beacon::parse($body);
+
+ if ($beacon === null) {
+ return response()->noContent(422);
+ }
+
+ try {
+ $site = $sites->forRequest($request->getHost(), $beacon['path']);
+ $buffer->push([[
+ 'k' => 'v',
+ 'at' => time(),
+ 'site' => $site->getKey(),
+ 'loc' => self::locale($beacon['path'], (string) $site->folder, $languages),
+ 'path' => $beacon['path'],
+ 'dev' => $beacon['device'],
+ 'con' => $beacon['connection'],
+ ] + $beacon['vitals']]);
+ } catch (Throwable) {
+ // No sites table yet, a full disk: the visitor's page does not care.
+ }
+
+ return response()->noContent();
+ }
+
+ /** The content language from the page address: /de/… or the default one. */
+ private static function locale(string $path, string $folder, ContentLanguages $languages): string
+ {
+ // A site in a folder only ever gets the addresses inside it.
+ $path = ltrim(substr(trim($path, '/'), strlen($folder)), '/');
+ $first = explode('/', $path)[0];
+
+ return $first !== '' && $languages->has($first) ? $first : $languages->default();
+ }
+}
diff --git a/packages/monitoring/src/Rum/RumScript.php b/packages/monitoring/src/Rum/RumScript.php
new file mode 100644
index 00000000..37bea556
--- /dev/null
+++ b/packages/monitoring/src/Rum/RumScript.php
@@ -0,0 +1,73 @@
+ tag with the Web Vitals script inlined: no extra request, and
+ * under 2 KB. Not printed at all for a visitor who sent Do Not Track or
+ * Global Privacy Control, or when real user monitoring is off.
+ */
+final class RumScript
+{
+ private ?string $source = null;
+
+ public function __construct(private readonly string $path = __DIR__.'/../../resources/js/rum.js') {}
+
+ public function tag(Request $request): string
+ {
+ $rate = (float) config('atrium-monitoring.rum.sample_rate', 1.0);
+
+ if (! config('atrium-monitoring.rum.enabled', true) || $rate <= 0.0 || self::optedOut($request)) {
+ return '';
+ }
+
+ $nonce = Vite::cspNonce();
+
+ return sprintf(
+ '',
+ e(route('atrium-monitoring.rum', [], false)),
+ e((string) min(1.0, $rate)),
+ $nonce ? ' nonce="'.e($nonce).'"' : '',
+ $this->source(),
+ );
+ }
+
+ /** The script without comments and needless spaces. */
+ public function source(): string
+ {
+ return $this->source ??= self::minify(File::get($this->path));
+ }
+
+ public static function optedOut(Request $request): bool
+ {
+ return $request->header('DNT') === '1' || $request->header('Sec-GPC') === '1';
+ }
+
+ private static function minify(string $js): string
+ {
+ $js = self::replace('~/\*.*?\*/~s', '', $js);
+ // Outside the quoted strings, line comments and the spaces around punctuation go too.
+ $string = "'(?:[^'\\\\]|\\\\.)*'(*SKIP)(*FAIL)|";
+ $js = self::replace('~'.$string.'//.*~', '', $js);
+ $js = self::replace('~'.$string.'\s*([{}()\[\]=,;:<>|&+\-?!*/])\s*~', '$1', $js);
+ $js = self::replace('~'.$string.'\s+~', ' ', $js);
+
+ return trim($js);
+ }
+
+ private static function replace(string $pattern, string $replacement, string $subject): string
+ {
+ return preg_replace($pattern, $replacement, $subject) ?? $subject;
+ }
+}
diff --git a/packages/monitoring/src/Stats/Aggregator.php b/packages/monitoring/src/Stats/Aggregator.php
new file mode 100644
index 00000000..b2814601
--- /dev/null
+++ b/packages/monitoring/src/Stats/Aggregator.php
@@ -0,0 +1,224 @@
+ metric. */
+ public const REQUEST_METRICS = [
+ 'd' => 'ttfb',
+ 'q' => 'db_count',
+ 'qm' => 'db_ms',
+ 'ch' => 'cache_hit',
+ 'cm' => 'cache_miss',
+ ];
+
+ public const VITALS = ['lcp', 'inp', 'cls', 'ttfb', 'fcp'];
+
+ /** @var array,histogram:Histogram}> */
+ private array $pending = [];
+
+ /**
+ * @param array $record
+ */
+ public function addRequest(array $record, Carbon $at): void
+ {
+ $site = (int) ($record['site'] ?? 0);
+ $groups = [
+ [$site, self::TOTAL, self::TOTAL],
+ [$site, self::cut((string) ($record['loc'] ?? ''), 12), self::TOTAL],
+ [$site, self::TOTAL, self::cut((string) ($record['route'] ?? ''), 191)],
+ ];
+
+ $values = [];
+
+ foreach (self::REQUEST_METRICS as $field => $metric) {
+ $values[$metric] = (float) ($record[$field] ?? 0.0);
+ }
+
+ $values['memory'] = (float) ($record['mem'] ?? 0.0) / 1024;
+ $status = $record['s'] ?? null;
+ $values['error'] = is_numeric($status) && $status >= 500 ? 1.0 : 0.0;
+
+ foreach ($values as $metric => $value) {
+ foreach ($groups as [$siteId, $locale, $subject]) {
+ $this->put($at, 'request', $metric, $siteId, $locale, $subject, self::TOTAL, $value);
+ }
+ }
+ }
+
+ /**
+ * @param array $record
+ */
+ public function addVitals(array $record, Carbon $at): void
+ {
+ $site = (int) ($record['site'] ?? 0);
+ $groups = [
+ [self::TOTAL, self::TOTAL, self::TOTAL],
+ [self::cut((string) ($record['loc'] ?? ''), 12), self::TOTAL, self::TOTAL],
+ [self::TOTAL, self::cut((string) ($record['path'] ?? '/'), 191), self::TOTAL],
+ [self::TOTAL, self::TOTAL, self::cut((string) ($record['dev'] ?? ''), 8)],
+ ];
+
+ foreach (self::VITALS as $metric) {
+ if (! isset($record[$metric]) || ! is_numeric($record[$metric])) {
+ continue;
+ }
+
+ foreach ($groups as [$locale, $subject, $device]) {
+ $this->put($at, 'vital', $metric, $site, $locale, $subject, $device, (float) $record[$metric]);
+ }
+ }
+ }
+
+ /**
+ * @param array $record
+ */
+ public function addQuery(array $record, Carbon $at): void
+ {
+ $site = (int) ($record['site'] ?? 0);
+ $value = (float) ($record['d'] ?? 0.0);
+
+ $this->put($at, 'query', 'time', $site, self::TOTAL, self::TOTAL, self::TOTAL, $value);
+ $this->put($at, 'query', 'time', $site, self::TOTAL, (string) ($record['h'] ?? ''), self::TOTAL, $value);
+ }
+
+ public function addUptime(int $siteId, int $checkId, bool $ok, ?float $responseMs, Carbon $at): void
+ {
+ $this->put($at, 'uptime', 'up', $siteId, self::TOTAL, (string) $checkId, self::TOTAL, $ok ? 1.0 : 0.0);
+
+ if ($responseMs !== null) {
+ $this->put($at, 'uptime', 'response', $siteId, self::TOTAL, (string) $checkId, self::TOTAL, $responseMs);
+ }
+ }
+
+ /**
+ * Rows touched by this batch, by their key.
+ *
+ * @return array,histogram:Histogram}>
+ */
+ public function pending(): array
+ {
+ return $this->pending;
+ }
+
+ /**
+ * Merges the batch into the table.
+ */
+ public function save(): void
+ {
+ $byDaySource = [];
+
+ foreach ($this->pending as $id => $entry) {
+ $byDaySource[$entry['key']['day']][$entry['key']['source']][$id] = $entry;
+ }
+
+ foreach ($byDaySource as $sources) {
+ foreach ($sources as $entries) {
+ foreach (array_chunk($entries, 200, true) as $chunk) {
+ $this->saveChunk($chunk);
+ }
+ }
+ }
+
+ $this->pending = [];
+ }
+
+ /**
+ * @param array,histogram:Histogram}> $chunk
+ */
+ private function saveChunk(array $chunk): void
+ {
+ $first = reset($chunk)['key'];
+ $subjects = array_unique(array_map(static fn (array $entry): string => $entry['key']['subject'], $chunk));
+
+ $existing = DB::table('monitoring_daily')
+ ->where('day', $first['day'])
+ ->where('source', $first['source'])
+ ->whereIn('subject', $subjects)
+ ->get();
+
+ foreach ($existing as $row) {
+ $id = self::id((array) $row);
+
+ if (isset($chunk[$id])) {
+ $chunk[$id]['histogram']->merge(Histogram::fromRow($row));
+ }
+ }
+
+ $rows = [];
+
+ foreach ($chunk as $entry) {
+ $histogram = $entry['histogram'];
+ $rows[] = $entry['key'] + [
+ 'count' => $histogram->count(),
+ 'sum' => $histogram->sum(),
+ 'min' => (float) $histogram->min(),
+ 'max' => (float) $histogram->max(),
+ 'buckets' => $histogram->toJson(),
+ ];
+ }
+
+ DB::table('monitoring_daily')->upsert(
+ $rows,
+ ['day', 'source', 'metric', 'site_id', 'locale', 'subject', 'device'],
+ ['count', 'sum', 'min', 'max', 'buckets'],
+ );
+ }
+
+ private function put(Carbon $at, string $source, string $metric, int $site, string $locale, string $subject, string $device, float $value): void
+ {
+ $key = [
+ 'day' => $at->toDateString(),
+ 'source' => $source,
+ 'metric' => $metric,
+ 'site_id' => $site,
+ 'locale' => $locale === '' ? self::TOTAL : $locale,
+ 'subject' => $subject === '' ? self::TOTAL : $subject,
+ 'device' => $device === '' ? self::TOTAL : $device,
+ ];
+ $id = self::id($key);
+
+ $this->pending[$id] ??= ['key' => $key, 'histogram' => new Histogram];
+ $this->pending[$id]['histogram']->add($value);
+ }
+
+ /**
+ * @param array $row
+ */
+ private static function id(array $row): string
+ {
+ return implode("\0", [$row['day'], $row['source'], $row['metric'], $row['site_id'], $row['locale'], $row['subject'], $row['device']]);
+ }
+
+ private static function cut(string $value, int $length): string
+ {
+ return mb_substr($value, 0, $length);
+ }
+}
diff --git a/packages/monitoring/src/Stats/Histogram.php b/packages/monitoring/src/Stats/Histogram.php
new file mode 100644
index 00000000..7032d17f
--- /dev/null
+++ b/packages/monitoring/src/Stats/Histogram.php
@@ -0,0 +1,223 @@
+ bucket index => count */
+ private array $buckets = [];
+
+ private int $count = 0;
+
+ private float $sum = 0.0;
+
+ private float $min = INF;
+
+ private float $max = -INF;
+
+ /**
+ * @param iterable $values
+ */
+ public static function of(iterable $values): self
+ {
+ $histogram = new self;
+
+ foreach ($values as $value) {
+ $histogram->add((float) $value);
+ }
+
+ return $histogram;
+ }
+
+ /**
+ * @param array{n?:int|string|null,s?:float|int|string,lo?:float|int|string,hi?:float|int|string,b?:array} $data
+ */
+ public static function fromArray(array $data): self
+ {
+ $histogram = new self;
+
+ if (! isset($data['n']) || (int) $data['n'] < 1) {
+ return $histogram;
+ }
+
+ $histogram->count = (int) $data['n'];
+ $histogram->sum = (float) ($data['s'] ?? 0);
+ $histogram->min = (float) ($data['lo'] ?? 0);
+ $histogram->max = (float) ($data['hi'] ?? 0);
+
+ foreach ($data['b'] ?? [] as $index => $stored) {
+ $count = (int) $stored;
+
+ if ($count > 0) {
+ $histogram->buckets[(int) $index] = $count;
+ }
+ }
+
+ return $histogram;
+ }
+
+ /**
+ * A row of monitoring_daily: count, sum, min, max and the buckets as JSON.
+ */
+ public static function fromRow(object $row): self
+ {
+ $buckets = json_decode((string) ($row->buckets ?? '{}'), true);
+
+ return self::fromArray([
+ 'n' => $row->count ?? null,
+ 's' => $row->sum ?? 0,
+ 'lo' => $row->min ?? 0,
+ 'hi' => $row->max ?? 0,
+ 'b' => is_array($buckets) ? $buckets : [],
+ ]);
+ }
+
+ public function add(float $value, int $times = 1): void
+ {
+ if ($times < 1 || is_nan($value) || is_infinite($value)) {
+ return;
+ }
+
+ $value = max(0.0, $value);
+ $index = self::index($value);
+ $this->buckets[$index] = ($this->buckets[$index] ?? 0) + $times;
+ $this->count += $times;
+ $this->sum += $value * $times;
+ $this->min = min($this->min, $value);
+ $this->max = max($this->max, $value);
+ }
+
+ public function merge(self $other): void
+ {
+ foreach ($other->buckets as $index => $count) {
+ $this->buckets[$index] = ($this->buckets[$index] ?? 0) + $count;
+ }
+
+ $this->count += $other->count;
+ $this->sum += $other->sum;
+ $this->min = min($this->min, $other->min);
+ $this->max = max($this->max, $other->max);
+ }
+
+ /**
+ * The value at rank q·(n−1) in the sorted measurements, q from 0 to 1
+ * (0.5 is the median, 0.95 the 95th percentile); null when empty.
+ */
+ public function quantile(float $q): ?float
+ {
+ if ($this->count === 0) {
+ return null;
+ }
+
+ $q = min(1.0, max(0.0, $q));
+ $rank = $q * ($this->count - 1);
+ $seen = 0;
+ $buckets = $this->buckets;
+ ksort($buckets);
+
+ foreach ($buckets as $index => $count) {
+ $seen += $count;
+
+ if ($seen > $rank) {
+ return min($this->max, max($this->min, self::value($index)));
+ }
+ }
+
+ return $this->max;
+ }
+
+ public function count(): int
+ {
+ return $this->count;
+ }
+
+ public function sum(): float
+ {
+ return $this->sum;
+ }
+
+ public function mean(): ?float
+ {
+ return $this->count === 0 ? null : $this->sum / $this->count;
+ }
+
+ public function min(): ?float
+ {
+ return $this->count === 0 ? null : $this->min;
+ }
+
+ public function max(): ?float
+ {
+ return $this->count === 0 ? null : $this->max;
+ }
+
+ /**
+ * @return array{n:int,s:float,lo:float,hi:float,b:array}
+ */
+ public function toArray(): array
+ {
+ $buckets = $this->buckets;
+ ksort($buckets);
+
+ return [
+ 'n' => $this->count,
+ 's' => round($this->sum, 6),
+ 'lo' => $this->count === 0 ? 0.0 : $this->min,
+ 'hi' => $this->count === 0 ? 0.0 : $this->max,
+ 'b' => $buckets,
+ ];
+ }
+
+ public function toJson(): string
+ {
+ return (string) json_encode($this->toArray()['b'], JSON_FORCE_OBJECT);
+ }
+
+ /** The bucket a value falls in. */
+ public static function index(float $value): int
+ {
+ if ($value < self::MIN) {
+ return self::ZERO;
+ }
+
+ return (int) ceil(log($value) / log(self::GAMMA) - 1e-9);
+ }
+
+ /** The value a bucket is read back as: the middle of its range. */
+ public static function value(int $index): float
+ {
+ if ($index === self::ZERO) {
+ return 0.0;
+ }
+
+ return 2 * self::GAMMA ** $index / (self::GAMMA + 1);
+ }
+}
diff --git a/packages/monitoring/src/Stats/Report.php b/packages/monitoring/src/Stats/Report.php
new file mode 100644
index 00000000..38584dac
--- /dev/null
+++ b/packages/monitoring/src/Stats/Report.php
@@ -0,0 +1,205 @@
+ 30, 'week' => 26, 'month' => 13];
+
+ public const QUANTILES = ['p50' => 0.5, 'p75' => 0.75, 'p95' => 0.95];
+
+ public function __construct(private readonly ?CarbonImmutable $today = null) {}
+
+ /**
+ * One point per day (the last 30), week (26) or month (13), oldest first;
+ * a point without measurements has null percentiles.
+ *
+ * @param array{site?:int|null,locale?:string,subject?:string,device?:string} $filter
+ * @return array
+ */
+ public function series(string $source, string $metric, string $granularity, array $filter = []): array
+ {
+ $periods = $this->periods($granularity);
+ $from = $periods[0]['from'];
+ $to = $periods[count($periods) - 1]['to'];
+
+ $histograms = [];
+ $i = 0;
+
+ // The rows come oldest day first, and so do the periods.
+ foreach ($this->rows($source, $metric, $from, $to, $filter) as $row) {
+ while ($row->day > $periods[$i]['to']) {
+ $i++;
+ }
+
+ ($histograms[$i] ??= new Histogram)->merge(Histogram::fromRow($row));
+ }
+
+ $points = [];
+
+ foreach ($periods as $i => $period) {
+ $points[] = $period + self::percentiles($histograms[$i] ?? new Histogram);
+ }
+
+ return $points;
+ }
+
+ /**
+ * Everything measured between the two days, inclusive.
+ *
+ * @param array{site?:int|null,locale?:string,subject?:string,device?:string} $filter
+ */
+ public function total(string $source, string $metric, string $from, string $to, array $filter = []): Histogram
+ {
+ $histogram = new Histogram;
+
+ foreach ($this->rows($source, $metric, $from, $to, $filter) as $row) {
+ $histogram->merge(Histogram::fromRow($row));
+ }
+
+ return $histogram;
+ }
+
+ /**
+ * The slowest subjects (routes, pages, queries, checks) by a percentile.
+ *
+ * @param array{site?:int|null,locale?:string,device?:string} $filter
+ * @return array
+ */
+ public function top(string $source, string $metric, string $from, string $to, array $filter = [], int $limit = 10, string $by = 'p75'): array
+ {
+ $histograms = [];
+
+ foreach ($this->rows($source, $metric, $from, $to, $filter + ['subject' => null]) as $row) {
+ ($histograms[$row->subject] ??= new Histogram)->merge(Histogram::fromRow($row));
+ }
+
+ $top = [];
+
+ foreach ($histograms as $subject => $histogram) {
+ $top[] = ['subject' => (string) $subject] + self::percentiles($histogram);
+ }
+
+ $by = isset(self::QUANTILES[$by]) ? $by : 'p75';
+ usort($top, static fn (array $a, array $b): int => [$b[$by], $b['count']] <=> [$a[$by], $a['count']]);
+
+ return array_slice($top, 0, max(1, $limit));
+ }
+
+ /**
+ * Share of good checks per check: check id => ratio 0…1.
+ *
+ * @return array
+ */
+ public function uptime(string $from, string $to, ?int $site = null): array
+ {
+ $uptime = [];
+
+ foreach ($this->rows('uptime', 'up', $from, $to, ['site' => $site, 'subject' => null]) as $row) {
+ $entry = $uptime[$row->subject] ?? ['checks' => 0, 'up' => 0];
+ $checks = $entry['checks'] + $row->count;
+ $up = $entry['up'] + (int) round((float) $row->sum);
+ $uptime[$row->subject] = ['checks' => $checks, 'up' => $up, 'ratio' => $checks === 0 ? 0.0 : $up / $checks];
+ }
+
+ return $uptime;
+ }
+
+ /**
+ * @return array{count:int,p50:float|null,p75:float|null,p95:float|null}
+ */
+ public static function percentiles(Histogram $histogram): array
+ {
+ $result = ['count' => $histogram->count()];
+
+ foreach (self::QUANTILES as $name => $q) {
+ $value = $histogram->quantile($q);
+ $result[$name] = $value === null ? null : round($value, 3);
+ }
+
+ return $result;
+ }
+
+ /**
+ * The periods of a chart, oldest first, each with its first and last day.
+ *
+ * @return array
+ */
+ public function periods(string $granularity): array
+ {
+ $count = self::GRANULARITIES[$granularity] ?? self::GRANULARITIES['day'];
+ $today = $this->today();
+ $periods = [];
+
+ for ($i = $count - 1; $i >= 0; $i--) {
+ [$from, $to] = match ($granularity) {
+ 'week' => [$today->subWeeks($i)->startOfWeek(), $today->subWeeks($i)->endOfWeek()],
+ 'month' => [$today->startOfMonth()->subMonths($i), $today->startOfMonth()->subMonths($i)->endOfMonth()],
+ default => [$today->subDays($i), $today->subDays($i)],
+ };
+
+ $periods[] = ['from' => $from->toDateString(), 'to' => $to->toDateString()];
+ }
+
+ return $periods;
+ }
+
+ private function today(): CarbonImmutable
+ {
+ return $this->today ?? CarbonImmutable::now((string) config('app.timezone', 'UTC'))->startOfDay();
+ }
+
+ /**
+ * @param array{site?:int|null,locale?:string,subject?:string|null,device?:string} $filter
+ * @return iterable
+ */
+ private function rows(string $source, string $metric, string $from, string $to, array $filter): iterable
+ {
+ $query = DB::table('monitoring_daily')
+ ->where('source', $source)
+ ->where('metric', $metric)
+ ->whereBetween('day', [$from, $to])
+ ->where('locale', $filter['locale'] ?? Aggregator::TOTAL)
+ ->where('device', $filter['device'] ?? Aggregator::TOTAL);
+
+ if (array_key_exists('subject', $filter) && $filter['subject'] === null) {
+ $query->where('subject', '!=', Aggregator::TOTAL);
+ } else {
+ $query->where('subject', $filter['subject'] ?? Aggregator::TOTAL);
+ }
+
+ if (isset($filter['site'])) {
+ $query->where('site_id', (int) $filter['site']);
+ }
+
+ return $query->orderBy('day')->select(['day', 'subject', 'count', 'sum', 'min', 'max', 'buckets'])->cursor();
+ }
+
+ /**
+ * The last N days up to today, as the first and the last date.
+ *
+ * @return array{0:string,1:string}
+ */
+ public function lastDays(int $days): array
+ {
+ $today = $this->today();
+
+ return [$today->subDays(max(1, $days) - 1)->toDateString(), $today->toDateString()];
+ }
+}
diff --git a/packages/monitoring/src/Stats/Vitals.php b/packages/monitoring/src/Stats/Vitals.php
new file mode 100644
index 00000000..0c3840a4
--- /dev/null
+++ b/packages/monitoring/src/Stats/Vitals.php
@@ -0,0 +1,81 @@
+ [good up to, poor from, unit] */
+ public const THRESHOLDS = [
+ 'lcp' => [2500, 4000, 'ms'],
+ 'inp' => [200, 500, 'ms'],
+ 'cls' => [0.1, 0.25, ''],
+ 'ttfb' => [800, 1800, 'ms'],
+ 'fcp' => [1800, 3000, 'ms'],
+ ];
+
+ /** The largest value a beacon may carry per metric; anything above is junk. */
+ public const LIMITS = [
+ 'lcp' => 120000,
+ 'inp' => 60000,
+ 'cls' => 50,
+ 'ttfb' => 120000,
+ 'fcp' => 120000,
+ ];
+
+ public static function rating(string $metric, ?float $value): ?string
+ {
+ if ($value === null || ! isset(self::THRESHOLDS[$metric])) {
+ return null;
+ }
+
+ [$good, $poor] = self::THRESHOLDS[$metric];
+
+ return match (true) {
+ $value <= $good => self::GOOD,
+ $value > $poor => self::POOR,
+ default => self::NEEDS_IMPROVEMENT,
+ };
+ }
+
+ public static function format(string $metric, ?float $value): string
+ {
+ if ($value === null) {
+ return '—';
+ }
+
+ if ($metric === 'cls') {
+ return number_format($value, 3, self::decimal(), '');
+ }
+
+ if ($value >= 1000) {
+ return __('atrium-monitoring::monitoring.units.s', ['value' => number_format($value / 1000, 2, self::decimal(), '')]);
+ }
+
+ // Under 10 ms a tenth tells apart what whole milliseconds would not
+ // (a database time of 2.5 against 3, the steps of a small axis).
+ return __('atrium-monitoring::monitoring.units.ms', ['value' => number_format($value, $value < 10 ? 1 : 0, self::decimal(), '')]);
+ }
+
+ /** The decimal separator of the panel's language: 2,91 s in Russian, 2.91 s in English. */
+ private static function decimal(): string
+ {
+ return __('atrium-monitoring::monitoring.units.decimal');
+ }
+}
diff --git a/packages/monitoring/src/Uptime/Notifier.php b/packages/monitoring/src/Uptime/Notifier.php
new file mode 100644
index 00000000..85dfb666
--- /dev/null
+++ b/packages/monitoring/src/Uptime/Notifier.php
@@ -0,0 +1,123 @@
+send('opened', $incident);
+ }
+
+ public function resolved(Incident $incident): void
+ {
+ Hook::fire('atrium.monitoring.incident.resolved', $incident);
+ $this->send('resolved', $incident);
+ }
+
+ /**
+ * @return array{subject:string,body:string}
+ */
+ public function message(string $kind, Incident $incident): array
+ {
+ $check = $incident->check;
+ $replace = [
+ 'name' => $check?->name,
+ 'url' => $check?->url,
+ 'error' => $incident->last_error ?: '—',
+ 'since' => $incident->started_at->format('Y-m-d H:i'),
+ 'duration' => $incident->duration,
+ 'failures' => $incident->failures,
+ ];
+
+ return [
+ 'subject' => __('atrium-monitoring::monitoring.alert.'.$kind.'_subject', $replace),
+ 'body' => __('atrium-monitoring::monitoring.alert.'.$kind.'_body', $replace),
+ ];
+ }
+
+ /**
+ * @return array
+ */
+ public function emails(): array
+ {
+ $raw = (string) Setting::get('monitoring.alert_emails', '');
+ $emails = preg_split('/[\s,;]+/', $raw, -1, PREG_SPLIT_NO_EMPTY) ?: [];
+
+ return array_values(array_unique(array_filter($emails, static fn (string $email): bool => filter_var($email, FILTER_VALIDATE_EMAIL) !== false)));
+ }
+
+ /**
+ * @return array{0:string,1:string}|null token and chat
+ */
+ public function telegram(): ?array
+ {
+ $token = (string) (config('atrium-monitoring.telegram.token') ?: Setting::get('monitoring.telegram_token', ''));
+ $chat = (string) (config('atrium-monitoring.telegram.chat_id') ?: Setting::get('monitoring.telegram_chat_id', ''));
+
+ return $token !== '' && $chat !== '' ? [$token, $chat] : null;
+ }
+
+ private function send(string $kind, Incident $incident): void
+ {
+ $message = $this->message($kind, $incident);
+
+ if (($emails = $this->emails()) !== []) {
+ $this->attempt('mail', fn () => $this->mail($emails, $message));
+ }
+
+ if (($telegram = $this->telegram()) !== null) {
+ $this->attempt('telegram', fn () => Http::timeout(10)->asForm()
+ ->post('https://api.telegram.org/bot'.$telegram[0].'/sendMessage', [
+ 'chat_id' => $telegram[1],
+ 'text' => $message['subject']."\n\n".$message['body'],
+ 'disable_web_page_preview' => 'true',
+ ])->throw());
+ }
+ }
+
+ /**
+ * @param array $emails
+ * @param array{subject:string,body:string} $message
+ */
+ private function mail(array $emails, array $message): void
+ {
+ Mail::raw($message['body'], function ($mail) use ($emails, $message): void {
+ $mail->to($emails)->subject($message['subject']);
+ });
+ }
+
+ private function attempt(string $channel, callable $send): void
+ {
+ try {
+ $send();
+ } catch (Throwable $e) {
+ // The token is part of the address: never log the exception text as is.
+ Log::warning('Atrium monitoring could not send an alert by '.$channel.': '.class_basename($e));
+ }
+ }
+}
diff --git a/packages/monitoring/src/Uptime/Transition.php b/packages/monitoring/src/Uptime/Transition.php
new file mode 100644
index 00000000..babe04c8
--- /dev/null
+++ b/packages/monitoring/src/Uptime/Transition.php
@@ -0,0 +1,46 @@
+= $threshold) {
+ return new self(UptimeCheck::DOWN, $failures, ! $incidentOpen, false);
+ }
+
+ return new self($incidentOpen ? UptimeCheck::DOWN : UptimeCheck::FAILING, $failures, false, false);
+ }
+}
diff --git a/packages/monitoring/src/Uptime/UptimeChecker.php b/packages/monitoring/src/Uptime/UptimeChecker.php
new file mode 100644
index 00000000..8947fb9f
--- /dev/null
+++ b/packages/monitoring/src/Uptime/UptimeChecker.php
@@ -0,0 +1,186 @@
+sites->flush();
+
+ foreach ($this->sites->all() as $site) {
+ $check = UptimeCheck::query()->withoutGlobalScopes()
+ ->where('site_id', $site->getKey())
+ ->where('is_home', true)
+ ->first() ?? new UptimeCheck;
+
+ $check->forceFill([
+ 'site_id' => $site->getKey(),
+ 'is_home' => true,
+ 'name' => $site->name,
+ 'url' => $this->homeUrl($site),
+ 'active' => $site->active,
+ ]);
+
+ if ($check->isDirty()) {
+ $check->save();
+ }
+ }
+ }
+
+ public function homeUrl(Site $site): string
+ {
+ $domain = $site->domains[0] ?? null;
+ $app = rtrim((string) config('app.url', 'http://localhost'), '/');
+ // The application's own host keeps its scheme: http://localhost stays http.
+ $scheme = $domain !== null && parse_url($app, PHP_URL_HOST) === $domain
+ ? parse_url($app, PHP_URL_SCHEME)
+ : config('atrium-monitoring.uptime.scheme', 'https');
+ $root = $domain !== null ? $scheme.'://'.$domain : $app;
+ $folder = trim((string) $site->folder, '/');
+
+ return $folder === '' ? $root.'/' : $root.'/'.$folder.'/';
+ }
+
+ /**
+ * @return int the addresses checked
+ */
+ public function run(): int
+ {
+ $checks = UptimeCheck::query()->withoutGlobalScopes()->where('active', true)->orderBy('id')->get();
+ $concurrency = max(1, (int) config('atrium-monitoring.uptime.concurrency', 10));
+ $timeout = max(1, (int) config('atrium-monitoring.uptime.timeout', 10));
+
+ foreach ($checks->chunk($concurrency) as $chunk) {
+ $results = Http::pool(fn (Pool $pool): array => $chunk->map(
+ fn (UptimeCheck $check) => $pool->as((string) $check->id)
+ ->timeout($timeout)
+ ->connectTimeout($timeout)
+ ->withHeaders(['User-Agent' => 'AtriumMonitoring/1.0 (+uptime)'])
+ ->get($check->url)
+ )->all());
+
+ foreach ($chunk as $check) {
+ $result = $results[$check->id] ?? null;
+
+ if ($result instanceof Response) {
+ $ms = isset($result->handlerStats()['total_time']) ? round((float) $result->handlerStats()['total_time'] * 1000, 1) : null;
+ $ok = $result->status() < 400;
+ $this->record($check, $ok, $result->status(), $ms, $ok ? null : 'HTTP '.$result->status());
+ } else {
+ $this->record($check, false, null, null, self::error($result));
+ }
+ }
+ }
+
+ return $checks->count();
+ }
+
+ /**
+ * Applies one result: the check's state, the raw result, the daily
+ * uptime, the incident and its alert.
+ */
+ public function record(UptimeCheck $check, bool $ok, ?int $status, ?float $ms, ?string $error, ?Carbon $at = null): Transition
+ {
+ $at ??= now();
+ $incident = $check->openIncident();
+ $transition = Transition::next((int) $check->failures, $incident !== null, $ok, $this->threshold());
+
+ DB::transaction(function () use ($check, $ok, $status, $ms, $error, $at, $transition, &$incident): void {
+ $check->forceFill([
+ 'status' => $transition->status,
+ 'failures' => $transition->failures,
+ 'last_checked_at' => $at,
+ 'last_status_code' => $status,
+ 'last_response_ms' => $ms,
+ 'last_error' => $error === null ? null : Str::limit($error, 250),
+ ])->save();
+
+ DB::table('monitoring_check_results')->insert([
+ 'check_id' => $check->id,
+ 'checked_at' => $at,
+ 'ok' => $ok,
+ 'status_code' => $status,
+ 'response_ms' => $ms,
+ 'error' => $error === null ? null : Str::limit($error, 250),
+ ]);
+
+ $aggregator = new Aggregator;
+ $aggregator->addUptime((int) $check->site_id, (int) $check->id, $ok, $ms, $at);
+ $aggregator->save();
+
+ if ($transition->opensIncident) {
+ $incident = Incident::query()->create([
+ 'check_id' => $check->id,
+ 'started_at' => $at,
+ 'failures' => $transition->failures,
+ 'last_error' => $check->last_error,
+ ]);
+ } elseif ($incident !== null && $transition->resolvesIncident) {
+ $incident->forceFill(['resolved_at' => $at])->save();
+ } elseif ($incident !== null && ! $ok) {
+ $incident->forceFill(['failures' => $transition->failures, 'last_error' => $check->last_error])->save();
+ }
+ });
+
+ if ($incident !== null && ($transition->opensIncident || $transition->resolvesIncident)) {
+ $incident->setRelation('check', $check);
+ $transition->opensIncident ? $this->notifier->opened($incident) : $this->notifier->resolved($incident);
+ }
+
+ return $transition;
+ }
+
+ public function threshold(): int
+ {
+ $setting = Setting::get('monitoring.failures');
+
+ return max(1, (int) (is_numeric($setting) ? $setting : config('atrium-monitoring.uptime.failures', 3)));
+ }
+
+ public static function error(mixed $result): string
+ {
+ if (! $result instanceof Throwable) {
+ return 'No response';
+ }
+
+ // cURL error 28: Operation timed out after 10001 milliseconds…
+ $message = $result->getMessage();
+
+ return preg_match('/cURL error (\d+): ([^(]+)/', $message, $match) === 1
+ ? 'cURL '.$match[1].': '.trim($match[2])
+ : Str::limit(class_basename($result).': '.$message, 250);
+ }
+}
diff --git a/packages/monitoring/tests/AdminTest.php b/packages/monitoring/tests/AdminTest.php
new file mode 100644
index 00000000..cdaa0e86
--- /dev/null
+++ b/packages/monitoring/tests/AdminTest.php
@@ -0,0 +1,268 @@
+ 100 order by "name"');
+ $this->hash = SqlNormalizer::hash($sql, 'testing');
+ $now = Carbon::now()->getTimestamp();
+ $records = [];
+
+ foreach ([['catalog.show', '/catalog/blue-mug', 'de', 640.0], ['home', '/', 'en', 90.0], ['news.show', '/news/opening', 'en', 210.0]] as [$route, $path, $locale, $ms]) {
+ foreach (range(1, 4) as $n) {
+ $records[] = ['k' => 'r', 'at' => $now - $n * 3600, 'site' => 1, 'loc' => $locale, 'route' => $route, 'path' => $path, 'm' => 'GET', 's' => 200, 'd' => $ms + $n, 'q' => 6, 'qm' => 4.0, 'ch' => 3, 'cm' => 1, 'mem' => 18432];
+ }
+ }
+
+ $records[] = ['k' => 'r', 'at' => $now, 'site' => 1, 'loc' => 'en', 'route' => 'catalog.show', 'path' => '/catalog/broken', 'm' => 'GET', 's' => 500, 'd' => 900.0, 'q' => 1, 'qm' => 1, 'ch' => 0, 'cm' => 0, 'mem' => 18432];
+ $records[] = ['k' => 'q', 'at' => $now, 'site' => 1, 'route' => 'catalog.show', 'path' => '/catalog/blue-mug', 'h' => $this->hash, 'sql' => $sql, 'c' => 'testing', 'd' => 340.0];
+ $records[] = ['k' => 'q', 'at' => $now, 'site' => 1, 'route' => 'catalog.show', 'path' => '/catalog/red-mug', 'h' => $this->hash, 'sql' => $sql, 'c' => 'testing', 'd' => 260.0];
+
+ foreach ([['/', 'mobile', 1800], ['/catalog/blue-mug', 'mobile', 4600], ['/catalog/blue-mug', 'desktop', 2900]] as [$path, $device, $lcp]) {
+ $records[] = ['k' => 'v', 'at' => $now, 'site' => 1, 'loc' => 'en', 'path' => $path, 'dev' => $device, 'con' => '4g', 'lcp' => $lcp, 'inp' => 150, 'cls' => 0.04, 'ttfb' => 500, 'fcp' => 1200];
+ }
+
+ app(Flusher::class)->write($records);
+
+ $check = new UptimeCheck;
+ $check->forceFill(['site_id' => 1, 'name' => 'Demo shop', 'url' => 'https://shop.example.test/'])->save();
+ config(['atrium-monitoring.uptime.failures' => 1]);
+ app(UptimeChecker::class)->record($check, false, 503, 40.0, 'HTTP 503', Carbon::now()->subMinutes(30));
+ app(UptimeChecker::class)->record($check, true, 200, 120.0, null, Carbon::now()->subMinutes(10));
+ }
+
+ protected function tearDown(): void
+ {
+ Carbon::setTestNow();
+
+ parent::tearDown();
+ }
+
+ private function reader(array $permissions): AdminUser
+ {
+ $user = $this->admin(false);
+ $user->roles()->attach(AdminRole::query()->create(['name' => 'Role '.random_int(1, 99999), 'permissions' => $permissions])->id);
+
+ return $user->fresh();
+ }
+
+ public function test_the_page_shows_server_visitors_and_uptime(): void
+ {
+ $this->actingAs($this->admin(), 'admin')
+ ->get('/admin/monitoring')
+ ->assertOk()
+ ->assertInertia(fn (Assert $page) => $page
+ ->component('Admin/Monitoring/Index', false)
+ ->where('filters.period', 'day')
+ ->where('range.to', '2026-11-17')
+ ->where('server.summary.requests', 13)
+ ->where('server.summary.errors', fn ($value) => abs($value - 7.69) < 0.01)
+ ->where('server.summary.cache_ratio', fn ($value) => abs($value - 75.0) < 0.1)
+ ->where('server.routes.0.route', 'catalog.show')
+ ->where('server.routes.0.sample', '/catalog/blue-mug')
+ ->where('server.queries.0.hash', $this->hash)
+ ->where('server.queries.0.sql', 'select * from "products" where "price" > ? order by "name"')
+ ->has('server.charts', 2)
+ ->where('server.charts.0.svg', fn (string $svg) => str_contains($svg, 'has('server.charts.0.points', 30)
+ ->has('vitals.metrics', 5)
+ ->where('vitals.metrics.0.key', 'lcp')
+ ->where('vitals.metrics.0.rating', 'needs_improvement')
+ ->where('vitals.pages.0.page', '/catalog/blue-mug')
+ ->where('uptime.checks.0.uptime', fn ($value) => (float) $value === 50.0)
+ ->where('uptime.incidents.0.duration', '20 minutes')
+ ->where('t.title', 'Monitoring'));
+ }
+
+ public function test_filters_narrow_the_report_and_bad_values_are_ignored(): void
+ {
+ $admin = $this->admin();
+
+ $this->actingAs($admin, 'admin')
+ ->get('/admin/monitoring?period=month&route=home&site=1')
+ ->assertInertia(fn (Assert $page) => $page
+ ->where('filters.period', 'month')
+ ->where('filters.route', 'home')
+ ->where('filters.site', 1)
+ ->where('server.summary.requests', 4)
+ ->has('server.charts.0.points', 13));
+
+ $this->actingAs($admin, 'admin')
+ ->get('/admin/monitoring?period=decade&site=999&device=fridge&locale=')
+ ->assertInertia(fn (Assert $page) => $page
+ ->where('filters.period', 'day')
+ ->where('filters.site', null)
+ ->where('filters.device', '*')
+ ->where('filters.locale', '*'));
+
+ $this->actingAs($admin, 'admin')
+ ->get('/admin/monitoring?device=mobile')
+ ->assertInertia(fn (Assert $page) => $page
+ ->where('vitals.metrics.0.raw', fn ($value) => abs($value - 1800) / 1800 < 0.025)
+ ->where('vitals.pages', []));
+
+ $this->actingAs($admin, 'admin')
+ ->get('/admin/monitoring?page=/&period=week&locale=de')
+ ->assertInertia(fn (Assert $page) => $page
+ ->where('vitals.metrics.0.count', 1)
+ ->where('vitals.metrics.1.p75', '150 ms')
+ ->where('vitals.pages', [])
+ ->where('server.summary.requests', 4)
+ ->has('server.charts.0.points', 26));
+
+ $this->actingAs($admin, 'admin')
+ ->get('/admin/monitoring?locale=en')
+ ->assertInertia(fn (Assert $page) => $page->where('vitals.metrics.0.count', 3)->where('vitals.pages', []));
+
+ $this->actingAs($admin, 'admin')
+ ->get('/admin/monitoring?page=/nothing-here')
+ ->assertInertia(fn (Assert $page) => $page
+ ->where('vitals.metrics.0.p75', '—')
+ ->where('vitals.metrics.0.rating', null));
+ }
+
+ public function test_a_query_page_shows_where_it_runs(): void
+ {
+ $this->actingAs($this->admin(), 'admin')
+ ->get('/admin/monitoring/queries/'.$this->hash)
+ ->assertOk()
+ ->assertInertia(fn (Assert $page) => $page
+ ->component('Admin/Monitoring/Query', false)
+ ->where('query.sql', 'select * from "products" where "price" > ? order by "name"')
+ ->where('routes.0.route', 'catalog.show')
+ ->where('routes.0.times', 2)
+ ->where('routes.0.slowest', '340 ms')
+ ->where('routes.0.average', '300 ms')
+ ->has('points', 30));
+
+ $this->actingAs($this->admin(), 'admin')->get('/admin/monitoring/queries/'.str_repeat('0', 40))->assertNotFound();
+ $this->actingAs($this->admin(), 'admin')->get('/admin/monitoring/queries/not-a-hash')->assertNotFound();
+ }
+
+ public function test_only_those_with_the_permission_get_in(): void
+ {
+ $this->get('/admin/monitoring')->assertRedirect();
+
+ $this->actingAs($this->reader(['news.view']), 'admin')->get('/admin/monitoring')->assertForbidden();
+ $this->actingAs($this->reader(['news.view']), 'admin')->get('/admin/monitoring/queries/'.$this->hash)->assertForbidden();
+ $this->actingAs($this->reader(['monitoring.view']), 'admin')->get('/admin/monitoring')->assertOk();
+ }
+
+ private function withErrorLog(): void
+ {
+ Route::get('admin/errors', static fn () => 'errors')->name('admin.errors.index');
+ app('router')->getRoutes()->refreshNameLookups();
+ }
+
+ public function test_pages_link_to_their_errors_when_the_error_log_is_there(): void
+ {
+ $this->withErrorLog();
+
+ $this->actingAs($this->reader(['monitoring.view', 'errors.view']), 'admin')->get('/admin/monitoring?site=1')
+ ->assertInertia(fn (Assert $page) => $page
+ ->where('vitals.pages.0.page', '/catalog/blue-mug')
+ ->where('vitals.pages.0.errors_url', 'http://localhost/admin/errors?status=all&path=%2Fcatalog%2Fblue-mug&site=1'));
+
+ $this->actingAs($this->admin(), 'admin')->get('/admin/monitoring')
+ ->assertInertia(fn (Assert $page) => $page->where('vitals.pages.0.errors_url', 'http://localhost/admin/errors?status=all&path=%2Fcatalog%2Fblue-mug'));
+
+ $this->actingAs($this->admin(), 'admin')->get('/admin/monitoring/queries/'.$this->hash)
+ ->assertInertia(fn (Assert $page) => $page
+ ->where('routes.0.path', fn ($path) => in_array($path, ['/catalog/blue-mug', '/catalog/red-mug'], true))
+ ->where('routes.0.errors_url', fn ($url) => str_starts_with((string) $url, 'http://localhost/admin/errors?status=all&path=%2Fcatalog%2F')));
+ }
+
+ public function test_no_errors_link_without_the_error_log_or_its_permission(): void
+ {
+ $this->actingAs($this->admin(), 'admin')->get('/admin/monitoring')
+ ->assertInertia(fn (Assert $page) => $page->where('vitals.pages.0.errors_url', null));
+ $this->actingAs($this->admin(), 'admin')->get('/admin/monitoring/queries/'.$this->hash)
+ ->assertInertia(fn (Assert $page) => $page->where('routes.0.errors_url', null));
+
+ $this->withErrorLog();
+
+ $this->actingAs($this->reader(['monitoring.view']), 'admin')->get('/admin/monitoring')
+ ->assertInertia(fn (Assert $page) => $page->where('vitals.pages.0.errors_url', null));
+ $this->actingAs($this->reader(['monitoring.view']), 'admin')->get('/admin/monitoring/queries/'.$this->hash)
+ ->assertInertia(fn (Assert $page) => $page->where('routes.0.errors_url', null));
+ }
+
+ public function test_the_menu_entry_follows_the_permission(): void
+ {
+ $this->actingAs($this->reader(['monitoring.view']), 'admin')->get('/admin/monitoring')
+ ->assertInertia(fn (Assert $page) => $page->where('menu', fn ($menu) => str_contains(json_encode($menu), 'admin.monitoring.index')));
+ $this->actingAs($this->reader(['uptime_checks.view']), 'admin')->get('/admin/uptime_checks')
+ ->assertInertia(fn (Assert $page) => $page->where('menu', fn ($menu) => ! str_contains(json_encode($menu), 'admin.monitoring.index')));
+ }
+
+ public function test_the_gadget_shows_vitals_uptime_and_slow_routes(): void
+ {
+ $gadget = new MonitoringGadget;
+ $this->assertFalse($gadget->isVisible(), 'nobody signed in');
+
+ $this->actingAs($this->reader(['news.view']), 'admin');
+ $this->assertFalse($gadget->isVisible());
+
+ $this->actingAs($this->admin(), 'admin');
+ $this->assertTrue($gadget->isVisible());
+ $this->assertSame('Speed and uptime', $gadget->title());
+ $data = $gadget->data();
+ $this->assertSame('lcp', $data['vitals'][0]['key']);
+ $this->assertSame('needs_improvement', $data['vitals'][0]['rating']);
+ $this->assertSame(50.0, $data['uptime']);
+ $this->assertSame([], $data['down']);
+ $this->assertSame('catalog.show', $data['slowest'][0]['route']);
+ $this->assertStringEndsWith('/admin/monitoring', $data['url']);
+
+ $this->actingAs($this->admin(), 'admin')->get('/admin')
+ ->assertInertia(fn (Assert $page) => $page->where('gadgets', fn ($gadgets) => collect($gadgets)->contains('component', 'MonitoringGadget')));
+ }
+
+ public function test_incidents_are_listed_read_only_and_checks_are_managed_in_the_panel(): void
+ {
+ $admin = $this->admin();
+
+ $this->actingAs($admin, 'admin')->get('/admin/monitoring_incidents')->assertOk();
+ $this->actingAs($admin, 'admin')->get('/admin/monitoring_incidents/create')->assertForbidden();
+ $this->actingAs($admin, 'admin')->get('/admin/uptime_checks')->assertOk();
+
+ $this->actingAs($admin, 'admin')->post('/admin/uptime_checks', ['name' => 'Price list', 'url' => 'ftp://files.example.test/', 'active' => true])
+ ->assertSessionHasErrors('url');
+ $this->actingAs($admin, 'admin')->post('/admin/uptime_checks', ['name' => 'Price list', 'url' => 'https://shop.example.test/prices', 'active' => true])
+ ->assertSessionHasNoErrors();
+ $this->assertSame(UptimeCheck::UNKNOWN, UptimeCheck::query()->withoutGlobalScopes()->where('name', 'Price list')->value('status'));
+
+ $this->assertSame([], Incident::getAdministrationFields(), 'nothing to edit');
+ $this->assertFalse(Incident::isEditableInAdmin());
+ $incident = Incident::query()->firstOrFail();
+ $this->assertSame('Demo shop', $incident->check_name);
+ $this->assertSame(20, $incident->minutes());
+ }
+}
diff --git a/packages/monitoring/tests/AggregatorTest.php b/packages/monitoring/tests/AggregatorTest.php
new file mode 100644
index 00000000..34934e78
--- /dev/null
+++ b/packages/monitoring/tests/AggregatorTest.php
@@ -0,0 +1,389 @@
+ [count, sum].
+ *
+ * @return array
+ */
+ private function held(Aggregator $aggregator): array
+ {
+ $held = [];
+
+ foreach ($aggregator->pending() as $entry) {
+ $key = $entry['key'];
+ $held[implode('|', [$key['source'], $key['metric'], $key['site_id'], $key['locale'], $key['subject'], $key['device']])] = [$entry['histogram']->count(), $entry['histogram']->sum()];
+ }
+
+ ksort($held);
+
+ return $held;
+ }
+
+ /** @return array */
+ private function sums(Aggregator $aggregator, string $label): array
+ {
+ return array_filter($this->held($aggregator), fn (string $key): bool => $key === $label, ARRAY_FILTER_USE_KEY);
+ }
+
+ public function test_a_request_goes_to_the_site_the_language_and_the_route(): void
+ {
+ $aggregator = new Aggregator;
+ $aggregator->addRequest(['site' => 7, 'loc' => 'en', 'route' => 'blog.show', 'd' => 12.5, 'q' => 3, 'qm' => 4.5, 'ch' => 2, 'cm' => 1, 'mem' => 2048, 's' => 200], $this->at());
+
+ $expected = [];
+ foreach (['ttfb' => 12.5, 'db_count' => 3.0, 'db_ms' => 4.5, 'cache_hit' => 2.0, 'cache_miss' => 1.0, 'memory' => 2.0, 'error' => 0.0] as $metric => $value) {
+ $expected["request|$metric|7|*|*|*"] = [1, $value];
+ $expected["request|$metric|7|en|*|*"] = [1, $value];
+ $expected["request|$metric|7|*|blog.show|*"] = [1, $value];
+ }
+ ksort($expected);
+
+ $this->assertSame($expected, $this->held($aggregator));
+ foreach ($aggregator->pending() as $entry) {
+ $this->assertSame('2026-11-16', $entry['key']['day']);
+ }
+ }
+
+ public function test_a_record_without_figures_counts_as_zeros_for_the_first_site(): void
+ {
+ $aggregator = new Aggregator;
+ $aggregator->addRequest([], $this->at());
+
+ $held = $this->held($aggregator);
+ $this->assertCount(7, $held, 'seven measures, all of them for the whole site');
+ foreach ($held as $label => [$count, $sum]) {
+ $this->assertStringStartsWith('request|', $label);
+ $this->assertStringEndsWith('|0|*|*|*', substr($label, strpos($label, '|', 8) ?: 0));
+ $this->assertSame(0.0, $sum, $label);
+ }
+ }
+
+ public function test_numbers_written_as_text_are_numbers(): void
+ {
+ $aggregator = new Aggregator;
+ $aggregator->addRequest(['site' => '7', 'loc' => 'en', 'route' => 'r', 'd' => '12.5', 'q' => '3', 'qm' => '4.5', 'ch' => '2', 'cm' => '1', 'mem' => '1024', 's' => '503'], $this->at());
+
+ $this->assertSame([1, 12.5], $this->held($aggregator)['request|ttfb|7|*|*|*']);
+ $this->assertSame([1, 3.0], $this->held($aggregator)['request|db_count|7|*|*|*']);
+ $this->assertSame([1, 4.5], $this->held($aggregator)['request|db_ms|7|*|*|*']);
+ $this->assertSame([1, 2.0], $this->held($aggregator)['request|cache_hit|7|*|*|*']);
+ $this->assertSame([1, 1.0], $this->held($aggregator)['request|cache_miss|7|*|*|*']);
+ $this->assertSame([1, 1.0], $this->held($aggregator)['request|memory|7|*|*|*']);
+ $this->assertSame([1, 1.0], $this->held($aggregator)['request|error|7|*|*|*']);
+ }
+
+ /** @return array */
+ public static function statuses(): array
+ {
+ return [
+ '200' => [200, 0.0],
+ '404' => [404, 0.0],
+ '499' => [499, 0.0],
+ '500' => [500, 1.0],
+ '503' => [503, 1.0],
+ 'text' => ['502', 1.0],
+ 'text below' => ['302', 0.0],
+ 'nothing' => [null, 0.0],
+ 'garbage' => ['abc', 0.0],
+ ];
+ }
+
+ #[DataProvider('statuses')]
+ public function test_server_errors_are_counted_from_500(mixed $status, float $error): void
+ {
+ $aggregator = new Aggregator;
+ $aggregator->addRequest(['site' => 1, 'loc' => 'en', 'route' => 'r', 's' => $status], $this->at());
+
+ $this->assertSame([[1, $error]], array_values($this->sums($aggregator, 'request|error|1|*|*|*')));
+ }
+
+ public function test_a_record_with_no_status_is_no_error(): void
+ {
+ $aggregator = new Aggregator;
+ $aggregator->addRequest(['site' => 1, 'loc' => 'en', 'route' => 'r'], $this->at());
+
+ $this->assertSame([[1, 0.0]], array_values($this->sums($aggregator, 'request|error|1|*|*|*')));
+ }
+
+ /** @return array */
+ public static function memories(): array
+ {
+ return ['two megabytes' => [2048, 2.0], 'one' => [1024, 1.0], 'half' => [512, 0.5], 'none' => [0, 0.0]];
+ }
+
+ #[DataProvider('memories')]
+ public function test_memory_is_in_megabytes(int $kilobytes, float $megabytes): void
+ {
+ $aggregator = new Aggregator;
+ $aggregator->addRequest(['site' => 1, 'loc' => 'en', 'route' => 'r', 'mem' => $kilobytes], $this->at());
+
+ $this->assertSame([[1, $megabytes]], array_values($this->sums($aggregator, 'request|memory|1|*|*|*')));
+ }
+
+ public function test_a_missing_memory_is_zero(): void
+ {
+ $aggregator = new Aggregator;
+ $aggregator->addRequest(['site' => 1, 'loc' => 'en', 'route' => 'r'], $this->at());
+
+ $this->assertSame([[1, 0.0]], array_values($this->sums($aggregator, 'request|memory|1|*|*|*')));
+ }
+
+ public function test_language_and_route_are_cut_to_the_width_of_their_columns(): void
+ {
+ $aggregator = new Aggregator;
+ $aggregator->addRequest(['site' => 1, 'loc' => 'abcdefghijklm', 'route' => str_repeat('é', 200), 'd' => 1], $this->at());
+
+ $held = $this->held($aggregator);
+ $this->assertArrayHasKey('request|ttfb|1|abcdefghijkl|*|*', $held);
+ $this->assertArrayHasKey('request|ttfb|1|*|'.str_repeat('é', 191).'|*', $held);
+
+ $exact = new Aggregator;
+ $exact->addRequest(['site' => 1, 'loc' => 'abcdefghijkl', 'route' => str_repeat('r', 191), 'd' => 1], $this->at());
+ $this->assertArrayHasKey('request|ttfb|1|abcdefghijkl|*|*', $this->held($exact));
+ $this->assertArrayHasKey('request|ttfb|1|*|'.str_repeat('r', 191).'|*', $this->held($exact));
+ }
+
+ public function test_the_same_measure_of_the_same_day_adds_up_and_another_day_is_another_row(): void
+ {
+ $aggregator = new Aggregator;
+ $record = ['site' => 1, 'loc' => 'en', 'route' => 'r', 'd' => 10];
+ $aggregator->addRequest($record, $this->at('2026-11-16 08:00:00'));
+ $aggregator->addRequest(['d' => 30] + $record, $this->at('2026-11-16 23:59:59'));
+ $aggregator->addRequest(['d' => 5] + $record, $this->at('2026-11-17 00:00:01'));
+
+ $days = [];
+ foreach ($aggregator->pending() as $entry) {
+ if ($entry['key']['metric'] === 'ttfb' && $entry['key']['locale'] === '*' && $entry['key']['subject'] === '*') {
+ $days[$entry['key']['day']] = [$entry['histogram']->count(), $entry['histogram']->sum()];
+ }
+ }
+
+ $this->assertSame(['2026-11-16' => [2, 40.0], '2026-11-17' => [1, 5.0]], $days);
+ $this->assertCount(2 * 21, $aggregator->pending());
+ }
+
+ public function test_vitals_go_to_the_site_the_language_the_page_and_the_device(): void
+ {
+ $aggregator = new Aggregator;
+ $aggregator->addVitals(['site' => 3, 'loc' => 'de', 'path' => '/shop', 'dev' => 'mobile', 'lcp' => 2500.5, 'cls' => 0.25, 'inp' => '200', 'fcp' => null, 'ttfb' => 'n/a'], $this->at());
+
+ $expected = [];
+ foreach (['lcp' => 2500.5, 'cls' => 0.25, 'inp' => 200.0] as $metric => $value) {
+ $expected["vital|$metric|3|*|*|*"] = [1, $value];
+ $expected["vital|$metric|3|de|*|*"] = [1, $value];
+ $expected["vital|$metric|3|*|/shop|*"] = [1, $value];
+ $expected["vital|$metric|3|*|*|mobile"] = [1, $value];
+ }
+ ksort($expected);
+
+ $this->assertSame($expected, $this->held($aggregator));
+ }
+
+ public function test_vitals_without_a_site_belong_to_the_first_one_and_the_text_of_a_site_is_a_number(): void
+ {
+ $bare = new Aggregator;
+ $bare->addVitals(['lcp' => 1.5], $this->at());
+
+ // No language and no device is the whole site, so those lines add up with the total.
+ $this->assertSame(['vital|lcp|0|*|*|*' => [3, 4.5], 'vital|lcp|0|*|/|*' => [1, 1.5]], $this->held($bare));
+
+ $text = new Aggregator;
+ $text->addVitals(['site' => '3', 'lcp' => 1.5], $this->at());
+
+ $this->assertSame(['vital|lcp|3|*|*|*', 'vital|lcp|3|*|/|*'], array_keys($this->held($text)));
+ }
+
+ public function test_vitals_are_cut_to_the_width_of_their_columns_and_not_before(): void
+ {
+ $cut = new Aggregator;
+ $cut->addVitals(['site' => 1, 'loc' => 'abcdefghijklm', 'path' => '/'.str_repeat('é', 191), 'dev' => 'abcdefghi', 'lcp' => 1], $this->at());
+
+ $this->assertSame([
+ 'vital|lcp|1|*|*|*',
+ 'vital|lcp|1|*|*|abcdefgh',
+ 'vital|lcp|1|*|/'.str_repeat('é', 190).'|*',
+ 'vital|lcp|1|abcdefghijkl|*|*',
+ ], array_keys($this->held($cut)));
+
+ $exact = new Aggregator;
+ $exact->addVitals(['site' => 1, 'loc' => 'abcdefghijkl', 'path' => '/'.str_repeat('p', 190), 'dev' => 'abcdefgh', 'lcp' => 1], $this->at());
+
+ $this->assertSame([
+ 'vital|lcp|1|*|*|*',
+ 'vital|lcp|1|*|*|abcdefgh',
+ 'vital|lcp|1|*|/'.str_repeat('p', 190).'|*',
+ 'vital|lcp|1|abcdefghijkl|*|*',
+ ], array_keys($this->held($exact)));
+ }
+
+ public function test_a_vital_missing_in_front_does_not_stop_the_ones_behind(): void
+ {
+ $aggregator = new Aggregator;
+ $aggregator->addVitals(['site' => 1, 'lcp' => 'n/a', 'inp' => null, 'fcp' => 0.9], $this->at());
+
+ $metrics = array_unique(array_map(static fn (array $entry): string => $entry['key']['metric'], $aggregator->pending()));
+
+ $this->assertSame(['fcp'], array_values($metrics));
+ }
+
+ public function test_a_slow_query_goes_to_the_site_and_to_its_own_line(): void
+ {
+ $aggregator = new Aggregator;
+ $aggregator->addQuery(['site' => 2, 'd' => 150.0, 'h' => 'abc123'], $this->at());
+
+ $this->assertSame(['query|time|2|*|*|*' => [1, 150.0], 'query|time|2|*|abc123|*' => [1, 150.0]], $this->held($aggregator));
+ }
+
+ public function test_a_query_without_a_site_or_a_time_is_zero_and_text_is_a_number(): void
+ {
+ $bare = new Aggregator;
+ $bare->addQuery([], $this->at());
+
+ $this->assertSame(['query|time|0|*|*|*' => [2, 0.0]], $this->held($bare), 'no query hash is the whole site');
+
+ $text = new Aggregator;
+ $text->addQuery(['site' => '2', 'd' => '12.5', 'h' => 'abc'], $this->at());
+
+ $this->assertSame(['query|time|2|*|*|*' => [1, 12.5], 'query|time|2|*|abc|*' => [1, 12.5]], $this->held($text));
+ }
+
+ public function test_uptime_counts_up_and_the_response_time_when_there_is_one(): void
+ {
+ $aggregator = new Aggregator;
+ $aggregator->addUptime(4, 9, true, 120.5, $this->at());
+ $aggregator->addUptime(4, 9, false, null, $this->at());
+
+ $this->assertSame(['uptime|response|4|*|9|*' => [1, 120.5], 'uptime|up|4|*|9|*' => [2, 1.0]], $this->held($aggregator));
+ }
+
+ public function test_the_batch_is_merged_into_the_daily_rows_and_emptied(): void
+ {
+ $first = new Aggregator;
+ $first->addRequest(['site' => 1, 'loc' => 'en', 'route' => 'r', 'd' => 10, 's' => 200], $this->at());
+ $first->save();
+ $this->assertSame([], $first->pending());
+
+ $row = DB::table('monitoring_daily')->where(['source' => 'request', 'metric' => 'ttfb', 'site_id' => 1, 'locale' => '*', 'subject' => '*'])->first();
+ $this->assertSame('2026-11-16', $row->day);
+ $this->assertEquals([1, 10.0, 10.0, 10.0], [$row->count, $row->sum, $row->min, $row->max]);
+ $this->assertSame(21, DB::table('monitoring_daily')->count());
+
+ $second = new Aggregator;
+ $second->addRequest(['site' => 1, 'loc' => 'en', 'route' => 'r', 'd' => 30, 's' => 200], $this->at('2026-11-16 20:00:00'));
+ $second->addRequest(['site' => 1, 'loc' => 'en', 'route' => 'r', 'd' => 2, 's' => 200], $this->at('2026-11-17 01:00:00'));
+ $second->save();
+
+ $this->assertSame(42, DB::table('monitoring_daily')->count(), 'one more day of 21 rows, the first day merged');
+ $merged = DB::table('monitoring_daily')->where(['day' => '2026-11-16', 'metric' => 'ttfb', 'site_id' => 1, 'locale' => '*', 'subject' => '*'])->first();
+ $this->assertEquals([2, 40.0, 10.0, 30.0], [$merged->count, $merged->sum, $merged->min, $merged->max]);
+ $next = DB::table('monitoring_daily')->where(['day' => '2026-11-17', 'metric' => 'ttfb', 'site_id' => 1, 'locale' => '*', 'subject' => '*'])->first();
+ $this->assertEquals([1, 2.0, 2.0, 2.0], [$next->count, $next->sum, $next->min, $next->max]);
+ }
+
+ public function test_saving_nothing_touches_nothing(): void
+ {
+ $queries = [];
+ DB::listen(function ($query) use (&$queries): void {
+ $queries[] = $query->sql;
+ });
+
+ (new Aggregator)->save();
+
+ $this->assertSame([], $queries);
+ }
+
+ public function test_a_figure_that_is_not_a_number_leaves_an_empty_row_of_zeros(): void
+ {
+ $aggregator = new Aggregator;
+ $aggregator->addUptime(1, 5, true, NAN, $this->at());
+ $aggregator->save();
+
+ $row = DB::table('monitoring_daily')->where(['source' => 'uptime', 'metric' => 'response'])->first();
+ $this->assertEquals([0, 0.0, 0.0, 0.0], [$row->count, $row->sum, $row->min, $row->max]);
+ }
+
+ public function test_the_day_and_the_source_are_read_and_written_in_batches_of_two_hundred_rows(): void
+ {
+ $queries = [];
+ DB::listen(function ($query) use (&$queries): void {
+ $queries[] = strtok(ltrim($query->sql), ' ');
+ });
+
+ foreach ([[200, 1], [201, 2]] as [$rows, $batches]) {
+ DB::table('monitoring_daily')->delete();
+ $aggregator = new Aggregator;
+ for ($check = 1; $check <= $rows; $check++) {
+ $aggregator->addUptime(1, $check, true, null, $this->at());
+ }
+ $this->assertCount($rows, $aggregator->pending());
+
+ $queries = [];
+ $aggregator->save();
+
+ $verbs = array_values(array_filter($queries, fn ($verb) => $verb === 'select' || $verb === 'insert'));
+ sort($verbs);
+ $this->assertSame(array_merge(array_fill(0, $batches, 'insert'), array_fill(0, $batches, 'select')), $verbs, "$rows rows");
+ $this->assertSame($rows, DB::table('monitoring_daily')->count());
+ }
+ }
+
+ public function test_the_subjects_asked_for_are_listed_once(): void
+ {
+ $aggregator = new Aggregator;
+ $aggregator->addRequest(['site' => 7, 'loc' => 'en', 'route' => 'blog.show', 'd' => 1], $this->at());
+
+ $selects = [];
+ DB::listen(function ($query) use (&$selects): void {
+ if (str_starts_with(ltrim($query->sql), 'select')) {
+ $selects[] = $query->bindings;
+ }
+ });
+ $aggregator->save();
+
+ $this->assertSame([['2026-11-16', 'request', '*', 'blog.show']], $selects);
+ }
+
+ public function test_sources_of_a_day_are_saved_apart(): void
+ {
+ $aggregator = new Aggregator;
+ $aggregator->addRequest(['site' => 1, 'loc' => 'en', 'route' => 'r', 'd' => 1], $this->at());
+ $aggregator->addUptime(1, 5, true, 10.0, $this->at());
+ $aggregator->addVitals(['site' => 1, 'lcp' => 1000], $this->at());
+
+ $selects = [];
+ DB::listen(function ($query) use (&$selects): void {
+ if (str_starts_with(ltrim($query->sql), 'select')) {
+ $selects[] = array_slice($query->bindings, 0, 2);
+ }
+ });
+ $aggregator->save();
+
+ $this->assertSame([['2026-11-16', 'request'], ['2026-11-16', 'uptime'], ['2026-11-16', 'vital']], $selects);
+ $this->assertSame(21 + 2 + 2, DB::table('monitoring_daily')->count());
+ }
+}
diff --git a/packages/monitoring/tests/BenchmarkTest.php b/packages/monitoring/tests/BenchmarkTest.php
new file mode 100644
index 00000000..9ed671e7
--- /dev/null
+++ b/packages/monitoring/tests/BenchmarkTest.php
@@ -0,0 +1,353 @@
+scratch = sys_get_temp_dir().'/atrium-monitoring-benchtest-'.getmypid().'-'.bin2hex(random_bytes(4));
+ File::ensureDirectoryExists($this->scratch);
+ }
+
+ protected function tearDown(): void
+ {
+ File::deleteDirectory($this->scratch);
+
+ parent::tearDown();
+ }
+
+ public function test_the_middleware_adds_less_than_a_millisecond(): void
+ {
+ $result = app(Benchmark::class)->run(1000, 20, 5);
+
+ $this->assertSame(1000, $result['requests']);
+ $this->assertSame(20, $result['queries']);
+ $this->assertSame(5, $result['rounds']);
+ $this->assertGreaterThan(0.0, $result['baseline_ms']);
+ $this->assertGreaterThan($result['baseline_ms'], $result['measured_ms'], 'measuring is not free');
+ $this->assertGreaterThanOrEqual(0.0, $result['overhead_ms']);
+
+ // Xdebug in any mode slows PHP down several times: the budget is for production PHP.
+ if (! function_exists('xdebug_info') || xdebug_info('mode') === []) {
+ $this->assertLessThan(1.0, $result['overhead_ms']);
+ }
+ }
+
+ public function test_it_leaves_the_app_as_it_found_it(): void
+ {
+ config(['atrium-monitoring.server.sample_rate' => 0.25, 'atrium-monitoring.server.enabled' => false]);
+ $recorder = app(Recorder::class);
+ $before = glob($this->scratch.'/atrium-monitoring-bench-*') ?: [];
+
+ $result = (new Benchmark(app('events'), $this->scratch))->run(10, 0, 3);
+
+ $this->assertSame(9, $result['requests'], 'three rounds of three');
+ $this->assertSame(0.25, config('atrium-monitoring.server.sample_rate'));
+ $this->assertFalse(config('atrium-monitoring.server.enabled'));
+ $this->assertSame($recorder, app(Recorder::class));
+ $this->assertSame($before, glob($this->scratch.'/atrium-monitoring-bench-*') ?: []);
+ $this->assertSame(0, app(Buffer::class)->size(), 'the real buffer was not touched');
+ }
+
+ /** @return array,1:float}> */
+ public static function medians(): array
+ {
+ return [
+ 'none' => [[], 0.0],
+ 'one' => [[3.5], 3.5],
+ 'odd, unsorted' => [[9.0, 1.0, 5.0], 5.0],
+ 'even' => [[4.0, 1.0, 3.0, 2.0], 2.5],
+ 'an outlier does not move it' => [[1.0, 1.1, 1.2, 1.3, 90.0], 1.2],
+ ];
+ }
+
+ /** @param array $values */
+ #[DataProvider('medians')]
+ public function test_median(array $values, float $median): void
+ {
+ $this->assertEqualsWithDelta($median, Benchmark::median($values), 1e-9);
+ }
+
+ public function test_the_command_prints_the_numbers_and_passes_under_a_millisecond(): void
+ {
+ $this->app->instance(Benchmark::class, $this->fake(0.25));
+
+ $this->artisan('atrium:monitoring:benchmark', ['--requests' => 300, '--queries' => 7, '--rounds' => 3])
+ ->expectsTable(['Requests', 'Queries each', 'Rounds', 'Without, ms', 'With, ms', 'Added per request, ms'], [[300, 7, 3, '1.0000', '1.2500', '0.2500']])
+ ->assertSuccessful();
+ }
+
+ public function test_the_command_fails_at_a_millisecond_or_more(): void
+ {
+ $this->app->instance(Benchmark::class, $this->fake(1.0));
+ $this->artisan('atrium:monitoring:benchmark')->assertFailed();
+ }
+
+ public function test_the_command_clamps_nonsense_options(): void
+ {
+ $fake = $this->fake(0.1);
+ $this->app->instance(Benchmark::class, $fake);
+
+ $this->artisan('atrium:monitoring:benchmark', ['--requests' => -5, '--queries' => -1, '--rounds' => 0])->assertSuccessful();
+ $this->assertSame([1, 0, 1], $fake->asked);
+
+ $this->artisan('atrium:monitoring:benchmark')->assertSuccessful();
+ $this->assertSame([2000, 20, 5], $fake->asked, 'the defaults');
+ }
+
+ /**
+ * A Benchmark whose clock reads the given nanoseconds one by one, so every
+ * figure of the result is known to the last digit; reading it more often
+ * than the script allows is an error.
+ *
+ * @param array $ticks
+ */
+ private function clocked(array $ticks): Benchmark
+ {
+ return new class(app('events'), $ticks, $this->scratch) extends Benchmark
+ {
+ public int $reads = 0;
+
+ /** @param array $ticks */
+ public function __construct(Dispatcher $events, private readonly array $ticks, string $scratch)
+ {
+ parent::__construct($events, $scratch);
+ }
+
+ protected function nanoseconds(): int
+ {
+ return $this->ticks[$this->reads++] ?? throw new RuntimeException('the clock was read more often than expected');
+ }
+ };
+ }
+
+ public function test_the_figures_are_milliseconds_per_request_and_the_median_of_the_rounds(): void
+ {
+ $bench = $this->clocked([
+ 0, 6_000_000, 6_000_000, 15_000_000,
+ 100_000_000, 112_000_000, 112_000_000, 133_000_000,
+ 200_000_000, 209_000_000, 209_000_000, 254_000_000,
+ ]);
+
+ // Without: 2, 4, 3 ms; with: 3, 7, 15 ms; added: 1, 3, 12 ms.
+ $this->assertSame([
+ 'requests' => 9,
+ 'queries' => 2,
+ 'rounds' => 3,
+ 'baseline_ms' => 3.0,
+ 'measured_ms' => 7.0,
+ 'overhead_ms' => 3.0,
+ ], $bench->run(9, 2, 3));
+ $this->assertSame(12, $bench->reads, 'two readings around each of the two loops of a round');
+ }
+
+ public function test_measuring_cheaper_than_not_measuring_adds_nothing(): void
+ {
+ $bench = $this->clocked([0, 6_000_000, 6_000_000, 8_000_000]);
+
+ $result = $bench->run(3, 0, 1);
+
+ $this->assertSame(2.0, $result['baseline_ms']);
+ $this->assertSame(0.6666666666666666, $result['measured_ms']);
+ $this->assertSame(0.0, $result['overhead_ms'], 'never negative');
+ }
+
+ /** @return array */
+ public static function shapes(): array
+ {
+ return [
+ // requests, rounds asked, requests run, rounds run
+ 'nothing asked' => [0, 0, 1, 1],
+ 'fewer requests than rounds' => [2, 3, 3, 3],
+ 'more rounds than requests' => [5, 10, 10, 10],
+ 'the rest is dropped' => [7, 2, 6, 2],
+ 'negative' => [-4, -2, 1, 1],
+ 'even' => [12, 4, 12, 4],
+ ];
+ }
+
+ #[DataProvider('shapes')]
+ public function test_the_loops_run_whole_rounds_of_at_least_one_request(int $requests, int $rounds, int $ran, int $roundsRan): void
+ {
+ $queries = 0;
+ app('events')->listen(QueryExecuted::class, function () use (&$queries): void {
+ $queries++;
+ });
+ $calls = 0;
+ app('events')->listen(CacheHit::class, function () use (&$calls): void {
+ $calls++;
+ });
+
+ $result = $this->clocked(array_fill(0, 4 * $roundsRan, 1_000_000))->run($requests, 0, $rounds);
+
+ $this->assertSame($ran, $result['requests']);
+ $this->assertSame($roundsRan, $result['rounds']);
+ $this->assertSame(0, $queries);
+ $this->assertSame(2 * 50 + 2 * $ran, $calls, 'fifty warm-up requests of each kind, then every request of every round');
+ }
+
+ public function test_every_request_runs_its_queries_then_the_cache_reads(): void
+ {
+ $events = [];
+ $counts = [];
+ $record = function (object $event) use (&$events, &$counts): void {
+ $counts[$event::class] = ($counts[$event::class] ?? 0) + 1;
+
+ if (count($events) < 5) {
+ $events[] = $event;
+ }
+ };
+ foreach ([QueryExecuted::class, CacheHit::class, CacheMissed::class] as $class) {
+ app('events')->listen($class, $record);
+ }
+
+ $this->clocked(array_fill(0, 4, 0))->run(1, 3, 1);
+
+ $this->assertSame([QueryExecuted::class => 3 * 102, CacheHit::class => 102, CacheMissed::class => 102], $counts, 'two requests on each of 50 warm-ups and the two loops of the round');
+ [$q0, $q1, $q2, $hit, $miss] = $events;
+ $this->assertInstanceOf(QueryExecuted::class, $q0);
+ $this->assertInstanceOf(QueryExecuted::class, $q1);
+ $this->assertInstanceOf(QueryExecuted::class, $q2);
+ $this->assertSame('select * from "pages" where "id" = ? limit 1', $q0->sql);
+ $this->assertSame([[0], [1], [2]], [$q0->bindings, $q1->bindings, $q2->bindings]);
+ $this->assertSame(0.4, $q0->time);
+ $this->assertSame(DB::connection(), $q0->connection);
+ $this->assertInstanceOf(CacheHit::class, $hit);
+ $this->assertSame(['array', 'settings', 'value'], [$hit->storeName, $hit->key, $hit->value]);
+ $this->assertInstanceOf(CacheMissed::class, $miss);
+ $this->assertSame(['array', 'menu'], [$miss->storeName, $miss->key]);
+ }
+
+ public function test_a_negative_number_of_queries_is_none(): void
+ {
+ $queries = 0;
+ app('events')->listen(QueryExecuted::class, function () use (&$queries): void {
+ $queries++;
+ });
+
+ $result = $this->clocked(array_fill(0, 4, 0))->run(1, -3, 1);
+
+ $this->assertSame(0, $queries);
+ $this->assertSame(-3, $result['queries'], 'reported as asked');
+ }
+
+ public function test_the_simulated_requests_are_measured_for_real_into_a_scratch_directory(): void
+ {
+ $seen = [];
+ $before = glob($this->scratch.'/atrium-monitoring-bench-*') ?: [];
+ app('events')->listen(CacheMissed::class, function () use (&$seen, $before): void {
+ $directories = array_values(array_diff(glob($this->scratch.'/atrium-monitoring-bench-*') ?: [], $before));
+ $seen = [
+ 'directories' => $directories,
+ 'sample_rate' => config('atrium-monitoring.server.sample_rate'),
+ 'enabled' => config('atrium-monitoring.server.enabled'),
+ 'recorder' => app(Recorder::class),
+ 'lines' => $directories === [] ? [] : (file($directories[0].'/buffer.ndjson', FILE_IGNORE_NEW_LINES) ?: []),
+ ];
+ });
+ config(['atrium-monitoring.server.sample_rate' => 0.5, 'atrium-monitoring.server.enabled' => false]);
+ $recorder = app(Recorder::class);
+
+ $this->clocked(array_fill(0, 8, 0))->run(4, 3, 2);
+
+ $this->assertCount(1, $seen['directories']);
+ $this->assertMatchesRegularExpression('#/atrium-monitoring-bench-[0-9a-f]{8}$#', $seen['directories'][0]);
+ $this->assertSame(1.0, $seen['sample_rate']);
+ $this->assertTrue($seen['enabled']);
+ $this->assertNotSame($recorder, $seen['recorder']);
+ $this->assertInstanceOf(Recorder::class, $seen['recorder']);
+
+ // Fifty warm-up requests and the first three of the four of the rounds had been written.
+ $this->assertCount(53, $seen['lines']);
+ foreach ($seen['lines'] as $line) {
+ $record = json_decode($line, true, 512, JSON_THROW_ON_ERROR);
+ $this->assertSame(['k', 'at', 'site', 'loc', 'route', 'path', 'm', 's', 'd', 'q', 'qm', 'ch', 'cm', 'mem'], array_keys($record));
+ $this->assertSame(['r', 0, 'en', 'bench.page', '/bench/hello-world', 'GET', 200, 3, 1.2, 1, 1], [$record['k'], $record['site'], $record['loc'], $record['route'], $record['path'], $record['m'], $record['s'], $record['q'], $record['qm'], $record['ch'], $record['cm']]);
+ }
+ }
+
+ public function test_a_clock_that_fails_still_leaves_the_app_as_it_was(): void
+ {
+ config(['atrium-monitoring.server.sample_rate' => 0.25, 'atrium-monitoring.server.enabled' => false]);
+ $recorder = app(Recorder::class);
+ $before = glob($this->scratch.'/atrium-monitoring-bench-*') ?: [];
+
+ try {
+ $this->clocked([0])->run(4, 1, 2);
+ $this->fail('the clock should have run out');
+ } catch (RuntimeException $e) {
+ $this->assertSame('the clock was read more often than expected', $e->getMessage());
+ }
+
+ $this->assertSame(0.25, config('atrium-monitoring.server.sample_rate'));
+ $this->assertFalse(config('atrium-monitoring.server.enabled'));
+ $this->assertSame($recorder, app(Recorder::class));
+ $this->assertSame($before, glob($this->scratch.'/atrium-monitoring-bench-*') ?: []);
+ }
+
+ public function test_the_real_clock_counts_nanoseconds_up(): void
+ {
+ $clock = new class(app('events')) extends Benchmark
+ {
+ public function read(): int
+ {
+ return $this->nanoseconds();
+ }
+ };
+
+ $before = hrtime(true);
+ $read = $clock->read();
+ $after = hrtime(true);
+
+ $this->assertGreaterThanOrEqual($before, $read);
+ $this->assertLessThanOrEqual($after, $read);
+ }
+
+ private function fake(float $overhead): Benchmark
+ {
+ return new class($overhead) extends Benchmark
+ {
+ /** @var array */
+ public array $asked = [];
+
+ public function __construct(private readonly float $overhead) {}
+
+ public function run(int $requests = 2000, int $queries = 20, int $rounds = 5): array
+ {
+ $this->asked = [$requests, $queries, $rounds];
+
+ return ['requests' => $requests, 'queries' => $queries, 'rounds' => $rounds, 'baseline_ms' => 1.0, 'measured_ms' => 1.0 + $this->overhead, 'overhead_ms' => $this->overhead];
+ }
+ };
+ }
+}
diff --git a/packages/monitoring/tests/BufferTest.php b/packages/monitoring/tests/BufferTest.php
new file mode 100644
index 00000000..274826f0
--- /dev/null
+++ b/packages/monitoring/tests/BufferTest.php
@@ -0,0 +1,228 @@
+ 'r', 'at' => time(), 'site' => 0, 'loc' => 'en', 'route' => 'home', 'path' => '/', 'm' => 'GET', 's' => 200, 'd' => 12.5, 'q' => 1, 'qm' => 0.4, 'ch' => 0, 'cm' => 0, 'mem' => 4096];
+ }
+
+ public function test_push_appends_lines_and_says_when_the_file_is_full(): void
+ {
+ $buffer = new Buffer($this->bufferPath, 400);
+
+ $this->assertFalse($buffer->push([]));
+ $this->assertSame(0, $buffer->size());
+ $this->assertFalse($buffer->push([$this->record()]));
+ $this->assertTrue($buffer->push([$this->record(), $this->record(), $this->record()]));
+ $this->assertCount(4, file($buffer->path()));
+ }
+
+ public function test_push_gives_up_quietly_when_the_folder_cannot_be_made(): void
+ {
+ $file = $this->bufferPath.'-file';
+ file_put_contents($file, 'x');
+
+ try {
+ $this->assertFalse((new Buffer($file.'/sub', 10))->push([$this->record()]));
+ } finally {
+ unlink($file);
+ }
+ }
+
+ public function test_claim_takes_the_file_and_leftovers_and_reading_skips_broken_lines(): void
+ {
+ $buffer = new Buffer($this->bufferPath, 1_000_000);
+ $buffer->push([$this->record(['route' => 'first'])]);
+ // A flush that died earlier left its file behind.
+ file_put_contents($this->bufferPath.'/work-0000.ndjson', json_encode($this->record(['route' => 'left over']))."\n{broken\n\"no kind\"\n".json_encode(['x' => 1])."\n");
+
+ $files = $buffer->claim();
+ $this->assertCount(2, $files);
+ $this->assertSame(0, $buffer->size(), 'writers start a new file');
+ $this->assertMatchesRegularExpression('~/work-[0-9a-f]+\.ndjson$~', $files[1], 'no dots in the name of the claimed file');
+ // Only the one good line of the leftover file: not the broken one, the bare string or the record without a kind.
+ $this->assertSame(['left over'], array_column(iterator_to_array($buffer->read($files[0]), false), 'route'));
+ $this->assertCount(1, iterator_to_array($buffer->read($files[0]), false));
+ $this->assertSame(['first'], array_column(iterator_to_array($buffer->read($files[1]), false), 'route'));
+ $this->assertSame([], iterator_to_array($buffer->read($this->bufferPath.'/missing.ndjson')));
+ $this->assertSame([], (new Buffer($this->bufferPath.'/empty', 10))->claim());
+ }
+
+ public function test_flush_writes_raw_rows_and_aggregates_and_empties_the_buffer(): void
+ {
+ $buffer = app(Buffer::class);
+ $hash = sha1('x');
+ $records = [];
+
+ for ($i = 0; $i < 1100; $i++) {
+ $records[] = $this->record(['d' => (float) $i]);
+ }
+
+ $records[] = ['k' => 'q', 'at' => time(), 'site' => 0, 'route' => 'home', 'path' => '/', 'h' => $hash, 'sql' => 'select * from "pages" where "id" = ?', 'c' => 'testing', 'd' => 150.0];
+ $records[] = ['k' => 'q', 'h' => 'short', 'd' => 1.0];
+ $records[] = ['k' => 'v', 'at' => time(), 'site' => 0, 'loc' => 'en', 'path' => '/', 'dev' => 'mobile', 'con' => '4g', 'lcp' => 2100, 'cls' => 0.05];
+ $records[] = ['k' => 'unknown'];
+ $buffer->push($records);
+
+ $this->assertSame(1102, app(Flusher::class)->flush());
+ $this->assertSame(1100, DB::table('monitoring_requests')->count());
+ $this->assertSame(1, DB::table('monitoring_queries')->count());
+ $this->assertSame('select * from "pages" where "id" = ?', DB::table('monitoring_query_texts')->where('hash', $hash)->value('sql'));
+ $vital = DB::table('monitoring_vitals')->first();
+ $this->assertEqualsWithDelta(2100, (float) $vital->lcp, 1e-9);
+ $this->assertNull($vital->inp);
+ $this->assertSame(1100, (int) DB::table('monitoring_daily')->where('metric', 'ttfb')->where('locale', '*')->where('subject', '*')->value('count'));
+ $this->assertSame([], glob($this->bufferPath.'/*.ndjson'));
+
+ $this->assertSame(0, app(Flusher::class)->flush(), 'nothing left');
+ $this->assertSame(0, app(Flusher::class)->write([]));
+ }
+
+ public function test_only_one_flush_at_a_time(): void
+ {
+ app(Buffer::class)->push([$this->record()]);
+ $lock = Cache::lock('atrium-monitoring:flush', 60);
+ $this->assertTrue($lock->get());
+
+ try {
+ $this->assertSame(0, app(Flusher::class)->flush());
+ $this->assertSame(0, DB::table('monitoring_requests')->count());
+ } finally {
+ $lock->release();
+ }
+
+ $this->artisan('atrium:monitoring:flush')->expectsOutput('Written: 1')->assertSuccessful();
+ $this->assertSame(1, DB::table('monitoring_requests')->count());
+ }
+
+ public function test_the_queued_job_flushes(): void
+ {
+ app(Buffer::class)->push([$this->record()]);
+
+ (new FlushBuffer)->handle(app(Flusher::class));
+
+ $this->assertSame(1, DB::table('monitoring_requests')->count());
+ }
+
+ public function test_push_gives_up_quietly_when_the_file_cannot_be_written(): void
+ {
+ $buffer = new Buffer($this->bufferPath, 0);
+ // A folder where the file should be: appending fails.
+ mkdir($buffer->path(), 0775, true);
+
+ try {
+ $this->assertFalse($buffer->push([$this->record()]));
+ $this->assertTrue(is_dir($buffer->path()));
+ } finally {
+ rmdir($buffer->path());
+ }
+ }
+
+ public function test_an_empty_push_touches_nothing(): void
+ {
+ $buffer = new Buffer($this->bufferPath.'/never', 10);
+
+ $this->assertFalse($buffer->push([]));
+ $this->assertDirectoryDoesNotExist($this->bufferPath.'/never');
+ }
+
+ public function test_a_line_is_json_with_slashes_and_unicode_left_as_they_are(): void
+ {
+ $buffer = new Buffer($this->bufferPath, 1_000_000);
+
+ $buffer->push([['k' => 'r', 'path' => '/a/b', 'route' => 'é€'], ['k' => 'r', 'bad' => "x\xB1y"]]);
+
+ $this->assertSame("{\"k\":\"r\",\"path\":\"/a/b\",\"route\":\"é€\"}\n{\"k\":\"r\",\"bad\":\"x\u{FFFD}y\"}\n", file_get_contents($buffer->path()));
+ }
+
+ public function test_the_folder_is_made_with_its_parents_and_group_access(): void
+ {
+ $umask = umask(0);
+
+ try {
+ $buffer = new Buffer($this->bufferPath.'/a/b', 1_000_000);
+ $this->assertFalse($buffer->push([['k' => 'r']]));
+ } finally {
+ umask($umask);
+ }
+
+ $this->assertSame('0775', substr(sprintf('%o', fileperms($this->bufferPath.'/a/b')), -4));
+ $this->assertSame('0775', substr(sprintf('%o', fileperms($this->bufferPath.'/a')), -4));
+ $this->assertSame("{\"k\":\"r\"}\n", file_get_contents($buffer->path()));
+ }
+
+ public function test_the_file_is_full_only_when_it_is_past_the_limit(): void
+ {
+ // One line is {"k":"r"} and a newline: 10 bytes.
+ $this->assertFalse((new Buffer($this->bufferPath.'/exact', 10))->push([['k' => 'r']]), 'as big as the limit is not past it');
+ $this->assertTrue((new Buffer($this->bufferPath.'/over', 9))->push([['k' => 'r']]));
+ }
+
+ public function test_the_size_is_read_afresh_every_time(): void
+ {
+ $buffer = new Buffer($this->bufferPath, 15);
+
+ $this->assertFalse($buffer->push([['k' => 'r']]));
+ // A size seen earlier in this process must not hide the growth.
+ $this->assertSame(10, filesize($buffer->path()));
+ $this->assertTrue($buffer->push([['k' => 'r']]));
+ $this->assertSame(20, $buffer->size());
+
+ $this->assertSame(20, filesize($buffer->path()));
+ file_put_contents($buffer->path(), "{\"k\":\"r\"}\n", FILE_APPEND);
+ $this->assertSame(30, $buffer->size());
+ }
+
+ public function test_a_writer_that_had_the_file_open_before_the_flush_finishes_its_line(): void
+ {
+ $buffer = new Buffer($this->bufferPath, 1_000_000);
+ $buffer->push([$this->record(['route' => 'first'])]);
+ // Another process opens the file, locks it, and writes its line a moment after the flush has renamed it.
+ $script = '$h = fopen('.var_export($buffer->path(), true).', "a"); flock($h, LOCK_EX); fwrite(STDOUT, "locked\n"); fflush(STDOUT); usleep(700000); fwrite($h, json_encode(["k" => "r", "route" => "late"])."\n"); fflush($h); flock($h, LOCK_UN); fclose($h);';
+ $process = proc_open([PHP_BINARY, '-n', '-r', $script], [1 => ['pipe', 'w'], 2 => ['pipe', 'w']], $pipes);
+ $this->assertIsResource($process);
+
+ try {
+ $this->assertSame("locked\n", fgets($pipes[1]));
+ $files = $buffer->claim();
+ } finally {
+ fclose($pipes[1]);
+ fclose($pipes[2]);
+ proc_close($process);
+ }
+
+ $this->assertCount(1, $files);
+ $this->assertSame(['first', 'late'], array_column(iterator_to_array($buffer->read($files[0]), false), 'route'));
+ }
+
+ public function test_reading_gives_the_file_back_even_when_the_reader_stops_early(): void
+ {
+ $buffer = new Buffer($this->bufferPath, 1_000_000);
+ $buffer->push([$this->record(), $this->record()]);
+ $files = $buffer->claim();
+ $before = count(get_resources('stream'));
+
+ $records = $buffer->read($files[0]);
+ $this->assertSame('home', $records->current()['route']);
+ $this->assertCount($before + 1, get_resources('stream'), 'open while reading');
+
+ unset($records);
+ $this->assertCount($before, get_resources('stream'), 'closed when the reader is gone');
+ }
+}
diff --git a/packages/monitoring/tests/BufferWriteTest.php b/packages/monitoring/tests/BufferWriteTest.php
new file mode 100644
index 00000000..d23bceba
--- /dev/null
+++ b/packages/monitoring/tests/BufferWriteTest.php
@@ -0,0 +1,277 @@
+sql, $match) === 1) {
+ $this->inserts[$match[1]][] = substr_count($query->sql, '), (') + 1;
+ }
+ });
+ }
+
+ protected function tearDown(): void
+ {
+ Carbon::setTestNow();
+
+ parent::tearDown();
+ }
+
+ /** @return array */
+ private function row(string $table): array
+ {
+ return Arr::except((array) DB::table($table)->first(), ['id', 'created_at']);
+ }
+
+ private function wide(int $width): string
+ {
+ // The first character tells where the cut starts; é takes two bytes.
+ return 'Z'.str_repeat('é', $width * 2);
+ }
+
+ public function test_rows_go_to_the_database_two_hundred_at_a_time(): void
+ {
+ $records = [];
+
+ for ($i = 0; $i < 250; $i++) {
+ $records[] = ['k' => 'r'];
+ $records[] = ['k' => 'q', 'h' => sha1((string) $i)];
+ $records[] = ['k' => 'v'];
+ }
+
+ $this->assertSame(750, app(Flusher::class)->write($records));
+ $this->assertSame(['monitoring_requests' => [200, 50], 'monitoring_queries' => [200, 50], 'monitoring_vitals' => [200, 50]], $this->inserts);
+ $this->assertSame(250, DB::table('monitoring_query_texts')->count());
+ }
+
+ public function test_a_file_is_written_in_slices_of_five_hundred_records(): void
+ {
+ app(Buffer::class)->push(array_fill(0, 501, ['k' => 'r']));
+
+ $this->assertSame(501, app(Flusher::class)->flush());
+ $this->assertSame(['monitoring_requests' => [200, 200, 100, 1]], $this->inserts);
+ }
+
+ public function test_a_record_with_nothing_but_its_kind_gets_the_defaults(): void
+ {
+ $hash = sha1('bare');
+
+ $this->assertSame(3, app(Flusher::class)->write([['k' => 'r'], ['k' => 'q', 'h' => $hash], ['k' => 'v']]));
+
+ $this->assertEquals(['site_id' => 0, 'locale' => '', 'route' => '', 'path' => '/', 'method' => 'GET', 'status' => 0, 'duration_ms' => 0, 'db_queries' => 0, 'db_ms' => 0, 'cache_hits' => 0, 'cache_misses' => 0, 'memory_kb' => 0], $this->row('monitoring_requests'));
+ $this->assertEquals(['site_id' => 0, 'route' => '', 'path' => '/', 'sql_hash' => $hash, 'duration_ms' => 0], $this->row('monitoring_queries'));
+ $this->assertEquals(['hash' => $hash, 'sql' => '', 'connection' => '', 'last_seen_at' => DB::table('monitoring_query_texts')->value('last_seen_at')], $this->row('monitoring_query_texts'));
+ $this->assertEquals(['site_id' => 0, 'locale' => '', 'path' => '/', 'device' => '', 'connection' => '', 'lcp' => null, 'inp' => null, 'cls' => null, 'ttfb' => null, 'fcp' => null], $this->row('monitoring_vitals'));
+ }
+
+ public function test_every_field_is_stored_and_the_texts_are_cut_to_their_columns(): void
+ {
+ $at = Carbon::parse('2026-11-17 10:30:00', 'UTC')->getTimestamp();
+ $hash = sha1('full');
+
+ app(Flusher::class)->write([
+ ['k' => 'r', 'at' => $at, 'site' => 7, 'loc' => $this->wide(20), 'route' => $this->wide(300), 'path' => $this->wide(300), 'm' => $this->wide(20), 's' => 503, 'd' => 12.5, 'q' => 3, 'qm' => 4.5, 'ch' => 5, 'cm' => 6, 'mem' => 7000],
+ ['k' => 'q', 'at' => $at, 'site' => 8, 'route' => $this->wide(300), 'path' => $this->wide(300), 'h' => $hash, 'd' => 150.5, 'sql' => 'select 1', 'c' => $this->wide(100)],
+ ['k' => 'v', 'at' => $at, 'site' => 9, 'loc' => $this->wide(20), 'path' => $this->wide(300), 'dev' => $this->wide(20), 'con' => $this->wide(20), 'lcp' => 2100, 'inp' => 90.5, 'cls' => 0.05, 'ttfb' => 300, 'fcp' => 900],
+ ]);
+
+ $this->assertEquals(['site_id' => 7, 'locale' => 'Z'.str_repeat('é', 11), 'route' => 'Z'.str_repeat('é', 190), 'path' => 'Z'.str_repeat('é', 254), 'method' => 'Z'.str_repeat('é', 7), 'status' => 503, 'duration_ms' => 12.5, 'db_queries' => 3, 'db_ms' => 4.5, 'cache_hits' => 5, 'cache_misses' => 6, 'memory_kb' => 7000], $this->row('monitoring_requests'));
+ $this->assertEquals(['site_id' => 8, 'route' => 'Z'.str_repeat('é', 190), 'path' => 'Z'.str_repeat('é', 254), 'sql_hash' => $hash, 'duration_ms' => 150.5], $this->row('monitoring_queries'));
+ $this->assertSame('Z'.str_repeat('é', 63), DB::table('monitoring_query_texts')->value('connection'));
+ $this->assertEquals(['site_id' => 9, 'locale' => 'Z'.str_repeat('é', 11), 'path' => 'Z'.str_repeat('é', 254), 'device' => 'Z'.str_repeat('é', 7), 'connection' => 'Z'.str_repeat('é', 7), 'lcp' => 2100, 'inp' => 90.5, 'cls' => 0.05, 'ttfb' => 300, 'fcp' => 900], $this->row('monitoring_vitals'));
+ $this->assertSame('2026-11-17 10:30:00', substr((string) DB::table('monitoring_requests')->value('created_at'), 0, 19));
+ }
+
+ public function test_numbers_are_numbers_whatever_the_record_holds(): void
+ {
+ app(Flusher::class)->write([
+ ['k' => 'r', 'site' => 'abc', 's' => 'abc', 'd' => 'abc', 'q' => 'abc', 'qm' => 'abc', 'ch' => 'abc', 'cm' => 'abc', 'mem' => 'abc'],
+ ['k' => 'r', 'site' => 3.9, 's' => 200.9, 'd' => '12.5ms', 'q' => 2.5, 'qm' => '0.5s', 'ch' => 7.7, 'cm' => 8.8, 'mem' => 9.9],
+ ['k' => 'q', 'h' => sha1('a'), 'site' => 'abc', 'd' => 'abc'],
+ ['k' => 'q', 'h' => sha1('b'), 'site' => 4.9, 'd' => '1.5ms'],
+ ['k' => 'v', 'site' => 'abc'],
+ ['k' => 'v', 'site' => 5.9],
+ ]);
+
+ $zeros = ['site_id' => 0, 'status' => 0, 'duration_ms' => 0, 'db_queries' => 0, 'db_ms' => 0, 'cache_hits' => 0, 'cache_misses' => 0, 'memory_kb' => 0];
+ $parts = ['site_id' => 3, 'status' => 200, 'duration_ms' => 12.5, 'db_queries' => 2, 'db_ms' => 0.5, 'cache_hits' => 7, 'cache_misses' => 8, 'memory_kb' => 9];
+ $requests = DB::table('monitoring_requests')->orderBy('id')->get(array_keys($zeros))->map(fn (object $row): array => (array) $row)->all();
+ $this->assertEquals([$zeros, $parts], $requests);
+ $this->assertEquals([['site_id' => 0, 'duration_ms' => 0], ['site_id' => 4, 'duration_ms' => 1.5]], DB::table('monitoring_queries')->orderBy('id')->get(['site_id', 'duration_ms'])->map(fn (object $row): array => (array) $row)->all());
+ $this->assertEquals([0, 5], DB::table('monitoring_vitals')->orderBy('id')->pluck('site_id')->all());
+ }
+
+ public function test_a_vital_is_a_number_or_nothing(): void
+ {
+ app(Flusher::class)->write([['k' => 'v', 'lcp' => '2100.5', 'inp' => 'abc', 'cls' => 0.0, 'ttfb' => null, 'fcp' => '']]);
+
+ $this->assertSame(['lcp' => 2100.5, 'inp' => null, 'cls' => 0.0, 'ttfb' => null, 'fcp' => null], Arr::only($this->row('monitoring_vitals'), ['lcp', 'inp', 'cls', 'ttfb', 'fcp']));
+ }
+
+ public function test_a_query_needs_a_real_hash(): void
+ {
+ $written = app(Flusher::class)->write([
+ ['k' => 'q', 'h' => 1234567890],
+ ['k' => 'q', 'h' => substr(sha1('x'), 1)],
+ ['k' => 'q', 'h' => sha1('x').'0'],
+ ['k' => 'q'],
+ ]);
+
+ $this->assertSame(0, $written);
+ $this->assertSame(0, DB::table('monitoring_queries')->count());
+ $this->assertSame(0, DB::table('monitoring_query_texts')->count());
+ }
+
+ public function test_the_text_of_a_query_follows_its_latest_sighting(): void
+ {
+ $hash = sha1('same');
+ $flusher = app(Flusher::class);
+
+ $flusher->write([['k' => 'q', 'h' => $hash, 'at' => Carbon::parse('2026-11-16 10:00:00', 'UTC')->getTimestamp(), 'sql' => 'select 1', 'c' => 'first']]);
+ $flusher->write([['k' => 'q', 'h' => $hash, 'at' => Carbon::parse('2026-11-17 11:00:00', 'UTC')->getTimestamp(), 'sql' => 'select 2', 'c' => 'second'], ['k' => 'q', 'h' => sha1('other'), 'sql' => 'select 3']]);
+
+ $row = DB::table('monitoring_query_texts')->where('hash', $hash)->first();
+ $this->assertSame(['select 2', 'second', '2026-11-17 11:00:00'], [$row->sql, $row->connection, substr((string) $row->last_seen_at, 0, 19)]);
+ $this->assertSame(2, DB::table('monitoring_query_texts')->count());
+ }
+
+ public function test_queries_and_vitals_are_added_to_the_daily_histograms(): void
+ {
+ $hash = sha1('slow');
+ $at = Carbon::parse('2026-11-17 10:30:00', 'UTC')->getTimestamp();
+
+ app(Flusher::class)->write([
+ ['k' => 'q', 'at' => $at, 'site' => 2, 'h' => $hash, 'd' => 150.0],
+ ['k' => 'v', 'at' => $at, 'site' => 2, 'loc' => 'en', 'path' => '/a', 'dev' => 'mobile', 'lcp' => 2100],
+ ]);
+
+ $query = DB::table('monitoring_daily')->where('source', 'query')->orderBy('subject')->get();
+ $this->assertSame(['*', $hash], $query->pluck('subject')->all());
+ $this->assertSame([150.0, 150.0], $query->map(fn (object $row): float => (float) $row->sum)->all());
+ $this->assertSame([2, 2], $query->map(fn (object $row): int => (int) $row->site_id)->all());
+
+ $vital = DB::table('monitoring_daily')->where('source', 'vital')->where('metric', 'lcp')->get();
+ $this->assertCount(4, $vital, 'overall, per locale, per page and per device');
+ $this->assertSame([1], $vital->pluck('count')->map(fn ($count): int => (int) $count)->unique()->values()->all());
+ $this->assertSame([2100.0], $vital->pluck('sum')->map(fn ($sum): float => (float) $sum)->unique()->values()->all());
+ }
+
+ public function test_nothing_to_write_opens_no_transaction(): void
+ {
+ $began = 0;
+ Event::listen(TransactionBeginning::class, function () use (&$began): void {
+ $began++;
+ });
+
+ $this->assertSame(0, app(Flusher::class)->write([]));
+ $this->assertSame(0, $began);
+
+ $this->assertSame(1, app(Flusher::class)->write([['k' => 'r']]));
+ $this->assertSame(1, $began);
+ }
+
+ public function test_the_flush_lock_lives_in_the_store_of_the_settings(): void
+ {
+ config(['cache.stores.flush-lock' => ['driver' => 'array'], 'atrium-monitoring.buffer.lock_store' => 'flush-lock']);
+ app(Buffer::class)->push([['k' => 'r']]);
+ $held = Cache::store('flush-lock')->lock('atrium-monitoring:flush', 60);
+ $this->assertTrue($held->get());
+
+ $this->assertSame(0, app(Flusher::class)->flush(), 'held in that store');
+ $this->assertSame(0, DB::table('monitoring_requests')->count());
+
+ $held->release();
+ $this->assertSame(1, app(Flusher::class)->flush());
+ }
+
+ public function test_without_a_store_in_the_settings_the_default_one_holds_the_lock(): void
+ {
+ foreach ([null, '', 42] as $setting) {
+ config(['atrium-monitoring.buffer.lock_store' => $setting]);
+ app(Buffer::class)->push([['k' => 'r']]);
+ $held = Cache::lock('atrium-monitoring:flush', 60);
+ $this->assertTrue($held->get());
+
+ $this->assertSame(0, app(Flusher::class)->flush(), var_export($setting, true));
+
+ $held->release();
+ $this->assertSame(1, app(Flusher::class)->flush());
+ }
+ }
+
+ public function test_the_lock_is_held_for_five_minutes_and_let_go_after_the_flush(): void
+ {
+ Carbon::setTestNow('2026-11-17 12:00:00');
+ $seen = null;
+ $buffer = new class($this->bufferPath, 1000, $seen) extends Buffer
+ {
+ public function __construct(string $directory, int $maxBytes, private mixed &$seen)
+ {
+ parent::__construct($directory, $maxBytes);
+ }
+
+ public function claim(): array
+ {
+ $this->seen = Cache::getStore()->locks['atrium-monitoring:flush'] ?? null;
+
+ return parent::claim();
+ }
+ };
+
+ $this->assertSame(0, (new Flusher($buffer))->flush());
+
+ $this->assertNotNull($seen, 'held while the files are read');
+ $this->assertSame('2026-11-17 12:05:00', $seen['expiresAt']->toDateTimeString());
+ $free = Cache::lock('atrium-monitoring:flush', 60);
+ $this->assertTrue($free->get(), 'let go afterwards');
+ $free->release();
+ }
+
+ public function test_the_lock_is_let_go_when_the_flush_fails(): void
+ {
+ $buffer = new class($this->bufferPath, 1000) extends Buffer
+ {
+ public function claim(): array
+ {
+ throw new RuntimeException('disk gone');
+ }
+ };
+
+ try {
+ (new Flusher($buffer))->flush();
+ $this->fail('the failure must not be swallowed');
+ } catch (RuntimeException $e) {
+ $this->assertSame('disk gone', $e->getMessage());
+ }
+
+ $free = Cache::lock('atrium-monitoring:flush', 60);
+ $this->assertTrue($free->get());
+ $free->release();
+ }
+}
diff --git a/packages/monitoring/tests/CollectorMiddlewareTest.php b/packages/monitoring/tests/CollectorMiddlewareTest.php
new file mode 100644
index 00000000..bb846334
--- /dev/null
+++ b/packages/monitoring/tests/CollectorMiddlewareTest.php
@@ -0,0 +1,65 @@
+ false]);
+ $calls = 0;
+ $response = new Response('ok');
+
+ $returned = (new CollectMetrics(app(Recorder::class)))->handle(Request::create('/hello'), function () use (&$calls, $response): Response {
+ $calls++;
+
+ return $response;
+ });
+
+ $this->assertSame(1, $calls);
+ $this->assertSame($response, $returned);
+ }
+
+ public function test_a_measured_request_runs_the_application_once_and_is_written_after_the_response(): void
+ {
+ $calls = 0;
+ $response = new Response('ok', 201);
+ $middleware = new CollectMetrics(app(Recorder::class));
+ $request = Request::create('/hello');
+
+ $returned = $middleware->handle($request, function () use (&$calls, $response): Response {
+ $calls++;
+ usleep(2000);
+
+ return $response;
+ });
+
+ $this->assertSame(1, $calls);
+ $this->assertSame($response, $returned);
+ $this->assertFileDoesNotExist($this->bufferPath.'/buffer.ndjson', 'nothing is written before the response has gone');
+
+ $middleware->terminate($request, $returned);
+
+ $lines = file($this->bufferPath.'/buffer.ndjson', FILE_IGNORE_NEW_LINES) ?: [];
+ $this->assertCount(1, $lines);
+ $record = json_decode($lines[0], true, 512, JSON_THROW_ON_ERROR);
+ $this->assertSame(['r', '/hello', 201], [$record['k'], $record['path'], $record['s']]);
+ $this->assertGreaterThanOrEqual(2.0, $record['d'], 'the time to the first byte is taken when the response is ready');
+ }
+}
diff --git a/packages/monitoring/tests/ConsoleTest.php b/packages/monitoring/tests/ConsoleTest.php
new file mode 100644
index 00000000..3e774d0d
--- /dev/null
+++ b/packages/monitoring/tests/ConsoleTest.php
@@ -0,0 +1,42 @@
+ Http::response('ok', 200)]);
+
+ foreach (['One' => true, 'Two' => true, 'Off' => false] as $name => $active) {
+ (new UptimeCheck)->forceFill(['site_id' => 1, 'name' => $name, 'url' => 'https://'.strtolower($name).'.example.test/', 'active' => $active])->save();
+ }
+
+ // Two addresses of its own and the front page of the site.
+ $this->artisan('atrium:monitoring:uptime')->expectsOutput('Checked: 3')->assertSuccessful();
+ }
+
+ public function test_the_uptime_command_does_nothing_when_the_checks_are_off(): void
+ {
+ config(['atrium-monitoring.uptime.enabled' => false]);
+
+ $this->artisan('atrium:monitoring:uptime')->expectsOutput('Uptime checks are off.')->assertSuccessful();
+ $this->assertSame(0, UptimeCheck::query()->withoutGlobalScopes()->count(), 'not even the front pages');
+ Http::assertNothingSent();
+ }
+
+ public function test_the_flush_command_says_how_many_records_it_wrote(): void
+ {
+ $this->artisan('atrium:monitoring:flush')->expectsOutput('Written: 0')->assertSuccessful();
+ }
+}
diff --git a/packages/monitoring/tests/ControllerTest.php b/packages/monitoring/tests/ControllerTest.php
new file mode 100644
index 00000000..e80172f2
--- /dev/null
+++ b/packages/monitoring/tests/ControllerTest.php
@@ -0,0 +1,1100 @@
+forceFill(['id' => 2, 'code' => 'shop', 'name' => 'Demo shop', 'domains' => ['shop.example.test'], 'active' => true])->save();
+ }
+
+ protected function tearDown(): void
+ {
+ Carbon::setTestNow();
+
+ parent::tearDown();
+ }
+
+ /** @return array */
+ private function props(string $url): array
+ {
+ $response = $this->actingAs($this->admin(), 'admin')->get($url)->assertOk();
+
+ return self::plain($response->original->getData()['page']['props']);
+ }
+
+ /** Collections to arrays, scalars untouched: 25.0 stays a float, which JSON would make 25. */
+ private static function plain(mixed $value): mixed
+ {
+ if ($value instanceof Collection) {
+ $value = $value->all();
+ }
+
+ return is_array($value) ? array_map(self::plain(...), $value) : $value;
+ }
+
+ /** @param array $overrides */
+ private function request(int $site, string $route, string $path, array $overrides = []): array
+ {
+ return $overrides + [
+ 'k' => 'r', 'at' => Carbon::now()->subHours(3)->getTimestamp(), 'site' => $site, 'loc' => 'en', 'route' => $route,
+ 'path' => $path, 'm' => 'GET', 's' => 200, 'd' => 100.0, 'q' => 1, 'qm' => 1.0, 'ch' => 0, 'cm' => 0, 'mem' => 1024,
+ ];
+ }
+
+ /** @param array $overrides */
+ private function vital(int $site, string $path, string $device, string $locale, array $overrides = []): array
+ {
+ return $overrides + [
+ 'k' => 'v', 'at' => Carbon::now()->subHours(3)->getTimestamp(), 'site' => $site, 'loc' => $locale, 'path' => $path,
+ 'dev' => $device, 'con' => '4g', 'lcp' => 2000, 'inp' => 100, 'cls' => 0.05, 'ttfb' => 500, 'fcp' => 1000,
+ ];
+ }
+
+ private function seedData(): void
+ {
+ $records = [];
+
+ // Site 1: seven requests, one failed; 2 cache hits and 1 miss; 32 queries.
+ foreach ([[3, 1, 1, 19456], [4, 1, 0, 20480], [4, 0, 0, 21504], [5, 0, 0, 22528], [5, 0, 0, 23552], [5, 0, 0, 24576], [6, 0, 0, 25600]] as $n => [$q, $ch, $cm, $mem]) {
+ $records[] = $this->request(1, 'home', '/', ['d' => 100.0 + $n * 20, 'q' => $q, 'ch' => $ch, 'cm' => $cm, 'mem' => $mem, 's' => $n === 6 ? 500 : 200, 'loc' => $n < 4 ? 'en' : 'de']);
+ }
+
+ // Site 2: two requests, 1 hit and 3 misses.
+ $records[] = $this->request(2, 'shop.index', '/shop', ['d' => 900.0, 'q' => 10, 'ch' => 1, 'cm' => 1, 'loc' => 'de']);
+ $records[] = $this->request(2, 'shop.index', '/shop', ['d' => 1000.0, 'q' => 10, 'ch' => 0, 'cm' => 2, 'loc' => 'de']);
+
+ foreach ([100.0, 200.0, 300.0] as $ms) {
+ $records[] = ['k' => 'q', 'at' => Carbon::now()->subHours(3)->getTimestamp(), 'site' => 1, 'route' => 'home', 'path' => '/', 'h' => self::HASH, 'sql' => 'select '.str_repeat('x', 250), 'c' => 'testing', 'd' => $ms];
+ }
+
+ $records[] = ['k' => 'q', 'at' => Carbon::now()->subHours(3)->getTimestamp(), 'site' => 2, 'route' => 'shop.index', 'path' => '/shop', 'h' => str_repeat('b', 40), 'sql' => 'select 2', 'c' => 'testing', 'd' => 50.0];
+
+ $records[] = $this->vital(1, '/', 'mobile', 'en', ['lcp' => 1800, 'inp' => 150, 'cls' => 0.04, 'ttfb' => 500, 'fcp' => 1200]);
+ $records[] = $this->vital(1, '/catalog', 'mobile', 'en', ['lcp' => 4600, 'inp' => 250, 'cls' => 0.3, 'ttfb' => 900, 'fcp' => 3500]);
+ $records[] = $this->vital(1, '/catalog', 'desktop', 'de', ['lcp' => 2900, 'inp' => 80, 'cls' => 0.12, 'ttfb' => 1900, 'fcp' => 2000]);
+ $records[] = $this->vital(2, '/', 'mobile', 'de', ['lcp' => 3000, 'inp' => 600, 'cls' => 0.2, 'ttfb' => 100, 'fcp' => 300]);
+ $records[] = $this->vital(2, '/shop', 'desktop', 'de', ['lcp' => 100, 'inp' => 10, 'cls' => 0.0, 'ttfb' => 50, 'fcp' => 60]);
+ app(Flusher::class)->write($records);
+
+ config(['atrium-monitoring.uptime.failures' => 1]);
+ $home = new UptimeCheck;
+ $home->forceFill(['site_id' => 1, 'name' => 'Demo home', 'url' => 'https://demo.example.test/', 'is_home' => true])->save();
+ $idle = new UptimeCheck;
+ $idle->forceFill(['site_id' => 1, 'name' => 'Idle', 'url' => 'https://idle.example.test/'])->save();
+ $other = new UptimeCheck;
+ $other->forceFill(['site_id' => 2, 'name' => 'Shop home', 'url' => 'https://shop.example.test/'])->save();
+ $checker = app(UptimeChecker::class);
+ $checker->record($home, true, 200, 100.0, null, Carbon::now()->subMinutes(50));
+ $checker->record($home, true, 200, 110.0, null, Carbon::now()->subMinutes(40));
+ $checker->record($home, false, 503, 40.0, 'HTTP 503', Carbon::now()->subMinutes(30));
+ $checker->record($other, true, 200, 80.0, null, Carbon::now()->subMinutes(5));
+ }
+
+ /**
+ * Checks and incidents numbered from 1 in the order they were made: the
+ * database's own ids go on from earlier tests on MySQL and PostgreSQL.
+ *
+ * @param array{checks:array>,incidents:array>} $uptime
+ * @return array{checks:array>,incidents:array>}
+ */
+ private static function numbered(array $uptime): array
+ {
+ $checks = (int) UptimeCheck::query()->withoutGlobalScopes()->min('id') - 1;
+ $incidents = (int) Incident::query()->withoutGlobalScopes()->min('id') - 1;
+
+ $uptime['checks'] = array_map(static fn (array $c): array => ['id' => $c['id'] - $checks] + $c, $uptime['checks']);
+ $uptime['incidents'] = array_map(static fn (array $i): array => ['id' => $i['id'] - $incidents] + $i, $uptime['incidents']);
+
+ return $uptime;
+ }
+
+ /** @param array $props */
+ private static function digest(array $props): array
+ {
+ return [
+ 'filters' => $props['filters'],
+ 'range' => $props['range'],
+ 'charts' => array_map(static fn (array $c): array => [$c['key'], count($c['points']), $c['points'][0]['label'], end($c['points'])], $props['server']['charts']),
+ 'summary' => $props['server']['summary'],
+ 'routes' => $props['server']['routes'],
+ 'queries' => array_map(static fn (array $q): array => [$q['hash'][0], $q['count'], $q['p50']], $props['server']['queries']),
+ 'vitals' => array_map(static fn (array $m): array => [$m['key'], $m['p75'], $m['raw'], $m['rating'], $m['count']], $props['vitals']['metrics']),
+ 'pages' => $props['vitals']['pages'],
+ 'uptime' => self::numbered($props['uptime']),
+ ];
+ }
+
+ public function test_each_filter_narrows_the_page(): void
+ {
+ $this->seedData();
+
+ foreach (self::expected() as $query => $expected) {
+ $this->assertSame($expected, array_intersect_key(self::digest($this->props('/admin/monitoring'.$query)), $expected), 'filter "'.$query.'"');
+ }
+ }
+
+ public function test_the_page_describes_its_sites_charts_and_thresholds(): void
+ {
+ $this->seedData();
+ $props = $this->props('/admin/monitoring');
+
+ $this->assertSame(['t', 'filters', 'options', 'range', 'server', 'vitals', 'uptime'], array_slice(array_keys($props), -7));
+ $this->assertSame('Monitoring', $props['t']['title']);
+ $this->assertSame([['value' => 1, 'label' => 'Demo site'], ['value' => 2, 'label' => 'Demo shop']], $props['options']['sites']);
+ $this->assertSame(['en'], $props['options']['locales']);
+ $this->assertSame(['summary', 'charts', 'routes', 'queries'], array_keys($props['server']));
+ $this->assertSame(['metrics', 'pages'], array_keys($props['vitals']));
+ $this->assertSame(['checks', 'incidents'], array_keys($props['uptime']));
+
+ $ttfb = $props['server']['charts'][0];
+ $this->assertSame(['key', 'svg', 'points'], array_keys($ttfb));
+ $this->assertSame(['label' => '19.10', 'count' => 0, 'p50' => '—', 'p75' => '—', 'p95' => '—'], $ttfb['points'][0]);
+ $this->assertSame(['label' => '17.11', 'count' => 9, 'p50' => '181 ms', 'p75' => '219 ms', 'p95' => '903 ms'], $ttfb['points'][29]);
+ $this->assertStringContainsString('>Time to first byte ', $ttfb['svg']);
+ $this->assertStringContainsString('>Database time per request ', $props['server']['charts'][1]['svg']);
+
+ $titles = ['lcp' => 'Largest Contentful Paint', 'inp' => 'Interaction to Next Paint', 'cls' => 'Cumulative Layout Shift', 'ttfb' => 'Time to First Byte', 'fcp' => 'First Contentful Paint'];
+ $thresholds = ['lcp' => ['2.50 s', '4.00 s'], 'inp' => ['200 ms', '500 ms'], 'cls' => ['0.100', '0.250'], 'ttfb' => ['800 ms', '1.80 s'], 'fcp' => ['1.80 s', '3.00 s']];
+
+ foreach ($props['vitals']['metrics'] as $metric) {
+ $this->assertSame(['key', 'p75', 'raw', 'rating', 'count', 'thresholds', 'svg', 'points'], array_keys($metric));
+ $this->assertSame($thresholds[$metric['key']], $metric['thresholds'], $metric['key']);
+ $this->assertStringContainsString('>'.$titles[$metric['key']].'', $metric['svg']);
+ $this->assertCount(30, $metric['points']);
+ $this->assertSame(['label' => '19.10', 'count' => 0, 'p50' => '—', 'p75' => '—', 'p95' => '—'], $metric['points'][0]);
+ $this->assertSame(['label', 'count', 'p50', 'p75', 'p95'], array_keys($metric['points'][29]));
+ $this->assertSame(5, $metric['points'][29]['count']);
+ $this->assertSame($metric['p75'], $metric['points'][29]['p75']);
+ }
+ }
+
+ public function test_a_page_filter_keeps_the_site(): void
+ {
+ $this->seedData();
+
+ $this->assertSame([2, 1, 1], array_map(
+ fn (string $query): int => $this->props('/admin/monitoring?'.$query)['vitals']['metrics'][0]['count'],
+ ['page=%2F', 'page=%2F&site=1', 'site=2&page=%2F'],
+ ));
+ }
+
+ public function test_the_page_asked_for_by_month_labels_its_points_by_month(): void
+ {
+ $this->seedData();
+ $props = $this->props('/admin/monitoring?period=month');
+
+ $this->assertSame('Nov 2025', $props['vitals']['metrics'][0]['points'][0]['label']);
+ $this->assertSame('Nov 2026', $props['vitals']['metrics'][0]['points'][12]['label']);
+ }
+
+ public function test_filters_are_cut_to_their_length_and_junk_is_dropped(): void
+ {
+ $filters = fn (string $query): array => $this->props('/admin/monitoring?'.$query)['filters'];
+
+ $this->assertSame(str_repeat('é', 12), $filters('locale='.str_repeat('é', 20))['locale']);
+ $this->assertSame(str_repeat('é', 12), $filters('locale='.str_repeat('é', 12))['locale']);
+ $this->assertSame(str_repeat('r', 191), $filters('route='.str_repeat('r', 200))['route']);
+ $this->assertSame(str_repeat('é', 191), $filters('route='.str_repeat('é', 191))['route']);
+ $this->assertSame(str_repeat('p', 191), $filters('page='.str_repeat('p', 200))['page']);
+ $this->assertSame(str_repeat('é', 191), $filters('page='.str_repeat('é', 191))['page']);
+
+ $this->assertSame('*', $filters('locale[]=de')['locale']);
+ $this->assertSame('*', $filters('route[]=home')['route']);
+ $this->assertSame('*', $filters('page[]=x')['page']);
+ $this->assertSame('*', $filters('device[]=mobile')['device']);
+ $this->assertSame('day', $filters('period[]=week')['period']);
+ $this->assertSame(['day', 'week', 'month'], array_map(fn (string $p): string => $filters('period='.$p)['period'], ['day', 'week', 'month']));
+ $this->assertSame(['mobile', 'tablet', 'desktop', '*'], array_map(fn (string $d): string => $filters('device='.$d)['device'], ['mobile', 'tablet', 'desktop', 'phone']));
+ $this->assertSame([2, null, null, 1], array_map(fn (string $s): ?int => $filters('site='.$s)['site'], ['2', 'abc', '99', '1.5']));
+ $this->assertNull($filters('site[]=1')['site']);
+ $this->assertSame('de', $filters('locale=de')['locale']);
+ }
+
+ public function test_a_long_query_text_is_cut_and_a_missing_one_is_blank(): void
+ {
+ $hashes = [str_repeat('1', 40) => 160, str_repeat('2', 40) => 161, str_repeat('3', 40) => 5];
+ $records = [];
+
+ foreach ($hashes as $hash => $length) {
+ $records[] = ['k' => 'q', 'at' => Carbon::now()->subHour()->getTimestamp(), 'site' => 1, 'route' => 'home', 'path' => '/', 'h' => $hash, 'sql' => 'é'.str_repeat('x', $length - 1), 'c' => 'testing', 'd' => 10.0];
+ }
+
+ app(Flusher::class)->write($records);
+ DB::table('monitoring_query_texts')->where('hash', str_repeat('3', 40))->delete();
+
+ $sql = [];
+
+ foreach ($this->props('/admin/monitoring')['server']['queries'] as $query) {
+ $sql[$query['hash'][0]] = $query['sql'];
+ }
+
+ $this->assertSame(['1' => 'é'.str_repeat('x', 159), '2' => 'é'.str_repeat('x', 158).'…', '3' => ''], $sql);
+ }
+
+ public function test_a_route_links_to_its_latest_good_page(): void
+ {
+ $at = Carbon::now()->subHour()->getTimestamp();
+ $records = [];
+
+ foreach ([['/older', 'GET', 200], ['/newest', 'GET', 399], ['/boom', 'GET', 500], ['/posted', 'POST', 200], ['/missing', 'GET', 400]] as [$path, $method, $status]) {
+ $records[] = $this->request(1, 'home', $path, ['m' => $method, 's' => $status, 'at' => $at]);
+ }
+
+ $records[] = $this->request(1, 'broken', '/broken', ['s' => 500, 'at' => $at]);
+ $records[] = $this->request(1, 'broken', '/broken', ['s' => 500, 'at' => $at]);
+ app(Flusher::class)->write($records);
+
+ $samples = [];
+
+ foreach ($this->props('/admin/monitoring')['server']['routes'] as $route) {
+ $samples[$route['route']] = $route['sample'];
+ }
+
+ $this->assertSame(['home' => '/newest', 'broken' => null], $samples);
+ }
+
+ public function test_a_query_page_lists_the_twenty_routes_that_run_it(): void
+ {
+ $at = Carbon::now()->subHour()->getTimestamp();
+ $records = [];
+
+ foreach (range(1, 21) as $i) {
+ foreach (range(1, $i) as $n) {
+ $records[] = ['k' => 'q', 'at' => $at, 'site' => 1, 'route' => sprintf('r%02d', $i), 'path' => '/p'.$i, 'h' => self::HASH, 'sql' => 'select 1', 'c' => 'testing', 'd' => 10.0 * $n];
+ }
+ }
+
+ app(Flusher::class)->write($records);
+ $props = $this->props('/admin/monitoring/queries/'.self::HASH);
+
+ $this->assertSame(array_map(fn (int $i): string => sprintf('r%02d', $i), range(21, 2)), array_column($props['routes'], 'route'));
+ $this->assertSame(['route' => 'r21', 'path' => '/p21', 'errors_url' => null, 'times' => 21, 'slowest' => '210 ms', 'average' => '110 ms'], $props['routes'][0]);
+ $this->assertSame(['route' => 'r02', 'path' => '/p2', 'errors_url' => null, 'times' => 2, 'slowest' => '20 ms', 'average' => '15 ms'], $props['routes'][19]);
+ }
+
+ /** @return array> */
+ private static function expected(): array
+ {
+ return [
+ '' => [
+ 'filters' => ['period' => 'day', 'site' => null, 'locale' => '*', 'route' => '*', 'page' => '*', 'device' => '*'],
+ 'range' => ['from' => '2026-10-19', 'to' => '2026-11-17'],
+ 'charts' => [
+ [
+ 'ttfb',
+ 30,
+ '19.10',
+ ['label' => '17.11', 'count' => 9, 'p50' => '181 ms', 'p75' => '219 ms', 'p95' => '903 ms'],
+ ],
+ ['db_ms', 30, '19.10', ['label' => '17.11', 'count' => 9, 'p50' => '1.0 ms', 'p75' => '1.0 ms', 'p95' => '1.0 ms']],
+ ],
+ 'summary' => [
+ 'requests' => 9,
+ 'ttfb' => ['count' => 9, 'p50' => '181 ms', 'p75' => '219 ms', 'p95' => '903 ms'],
+ 'errors' => 11.11,
+ 'cache_ratio' => 42.9,
+ 'queries' => 5.8,
+ 'memory_p95' => 24.4,
+ ],
+ 'routes' => [
+ [
+ 'route' => 'shop.index',
+ 'sample' => '/shop',
+ 'count' => 2,
+ 'p50' => '903 ms',
+ 'p75' => '903 ms',
+ 'p95' => '903 ms',
+ ],
+ ['route' => 'home', 'sample' => '/', 'count' => 7, 'p50' => '164 ms', 'p75' => '181 ms', 'p95' => '199 ms'],
+ ],
+ 'queries' => [['a', 3, '199 ms'], ['b', 1, '50 ms']],
+ 'vitals' => [
+ ['lcp', '3.06 s', 3058.514, 'needs_improvement', 5],
+ ['inp', '254 ms', 254.013, 'needs_improvement', 5],
+ ['cls', '0.205', 0.205, 'needs_improvement', 5],
+ ['ttfb', '903 ms', 903.188, 'needs_improvement', 5],
+ ['fcp', '1.97 s', 1971.545, 'needs_improvement', 5],
+ ],
+ 'pages' => [
+ [
+ 'page' => '/catalog',
+ 'rating' => 'needs_improvement',
+ 'errors_url' => null,
+ 'count' => 2,
+ 'p50' => '2.91 s',
+ 'p75' => '2.91 s',
+ 'p95' => '2.91 s',
+ ],
+ [
+ 'page' => '/',
+ 'rating' => 'good',
+ 'errors_url' => null,
+ 'count' => 2,
+ 'p50' => '1.80 s',
+ 'p75' => '1.80 s',
+ 'p95' => '1.80 s',
+ ],
+ [
+ 'page' => '/shop',
+ 'rating' => 'good',
+ 'errors_url' => null,
+ 'count' => 1,
+ 'p50' => '100 ms',
+ 'p75' => '100 ms',
+ 'p95' => '100 ms',
+ ],
+ ],
+ 'uptime' => [
+ 'checks' => [
+ [
+ 'id' => 1,
+ 'name' => 'Demo home',
+ 'url' => 'https://demo.example.test/',
+ 'active' => true,
+ 'status' => 'down',
+ 'uptime' => 66.67,
+ 'response' => '40 ms',
+ 'checked_at' => '2026-11-17 11:30',
+ 'error' => 'HTTP 503',
+ ],
+ [
+ 'id' => 2,
+ 'name' => 'Idle',
+ 'url' => 'https://idle.example.test/',
+ 'active' => true,
+ 'status' => 'unknown',
+ 'uptime' => null,
+ 'response' => null,
+ 'checked_at' => null,
+ 'error' => null,
+ ],
+ [
+ 'id' => 3,
+ 'name' => 'Shop home',
+ 'url' => 'https://shop.example.test/',
+ 'active' => true,
+ 'status' => 'up',
+ 'uptime' => 100.0,
+ 'response' => '80 ms',
+ 'checked_at' => '2026-11-17 11:55',
+ 'error' => null,
+ ],
+ ],
+ 'incidents' => [
+ [
+ 'id' => 1,
+ 'check' => 'Demo home',
+ 'started_at' => '2026-11-17 11:30',
+ 'resolved_at' => null,
+ 'duration' => '30 minutes',
+ 'error' => 'HTTP 503',
+ ],
+ ],
+ ],
+ ],
+ '?site=1' => [
+ 'filters' => ['period' => 'day', 'site' => 1, 'locale' => '*', 'route' => '*', 'page' => '*', 'device' => '*'],
+ 'charts' => [
+ [
+ 'ttfb',
+ 30,
+ '19.10',
+ ['label' => '17.11', 'count' => 7, 'p50' => '164 ms', 'p75' => '181 ms', 'p95' => '199 ms'],
+ ],
+ ['db_ms', 30, '19.10', ['label' => '17.11', 'count' => 7, 'p50' => '1.0 ms', 'p75' => '1.0 ms', 'p95' => '1.0 ms']],
+ ],
+ 'summary' => [
+ 'requests' => 7,
+ 'ttfb' => ['count' => 7, 'p50' => '164 ms', 'p75' => '181 ms', 'p95' => '199 ms'],
+ 'errors' => 14.29,
+ 'cache_ratio' => 66.7,
+ 'queries' => 4.6,
+ 'memory_p95' => 24.4,
+ ],
+ 'routes' => [['route' => 'home', 'sample' => '/', 'count' => 7, 'p50' => '164 ms', 'p75' => '181 ms', 'p95' => '199 ms']],
+ 'queries' => [['a', 3, '199 ms']],
+ 'vitals' => [
+ ['lcp', '2.91 s', 2912.871, 'needs_improvement', 3],
+ ['inp', '149 ms', 148.516, 'good', 3],
+ ['cls', '0.120', 0.12, 'needs_improvement', 3],
+ ['ttfb', '903 ms', 903.188, 'needs_improvement', 3],
+ ['fcp', '1.97 s', 1971.545, 'needs_improvement', 3],
+ ],
+ 'pages' => [
+ [
+ 'page' => '/catalog',
+ 'rating' => 'needs_improvement',
+ 'errors_url' => null,
+ 'count' => 2,
+ 'p50' => '2.91 s',
+ 'p75' => '2.91 s',
+ 'p95' => '2.91 s',
+ ],
+ [
+ 'page' => '/',
+ 'rating' => 'good',
+ 'errors_url' => null,
+ 'count' => 1,
+ 'p50' => '1.80 s',
+ 'p75' => '1.80 s',
+ 'p95' => '1.80 s',
+ ],
+ ],
+ 'uptime' => [
+ 'checks' => [
+ [
+ 'id' => 1,
+ 'name' => 'Demo home',
+ 'url' => 'https://demo.example.test/',
+ 'active' => true,
+ 'status' => 'down',
+ 'uptime' => 66.67,
+ 'response' => '40 ms',
+ 'checked_at' => '2026-11-17 11:30',
+ 'error' => 'HTTP 503',
+ ],
+ [
+ 'id' => 2,
+ 'name' => 'Idle',
+ 'url' => 'https://idle.example.test/',
+ 'active' => true,
+ 'status' => 'unknown',
+ 'uptime' => null,
+ 'response' => null,
+ 'checked_at' => null,
+ 'error' => null,
+ ],
+ ],
+ 'incidents' => [
+ [
+ 'id' => 1,
+ 'check' => 'Demo home',
+ 'started_at' => '2026-11-17 11:30',
+ 'resolved_at' => null,
+ 'duration' => '30 minutes',
+ 'error' => 'HTTP 503',
+ ],
+ ],
+ ],
+ ],
+ '?site=2' => [
+ 'filters' => ['period' => 'day', 'site' => 2, 'locale' => '*', 'route' => '*', 'page' => '*', 'device' => '*'],
+ 'charts' => [
+ [
+ 'ttfb',
+ 30,
+ '19.10',
+ ['label' => '17.11', 'count' => 2, 'p50' => '903 ms', 'p75' => '903 ms', 'p95' => '903 ms'],
+ ],
+ ['db_ms', 30, '19.10', ['label' => '17.11', 'count' => 2, 'p50' => '1.0 ms', 'p75' => '1.0 ms', 'p95' => '1.0 ms']],
+ ],
+ 'summary' => [
+ 'requests' => 2,
+ 'ttfb' => ['count' => 2, 'p50' => '903 ms', 'p75' => '903 ms', 'p95' => '903 ms'],
+ 'errors' => 0.0,
+ 'cache_ratio' => 25.0,
+ 'queries' => 10.0,
+ 'memory_p95' => 1.0,
+ ],
+ 'routes' => [
+ [
+ 'route' => 'shop.index',
+ 'sample' => '/shop',
+ 'count' => 2,
+ 'p50' => '903 ms',
+ 'p75' => '903 ms',
+ 'p95' => '903 ms',
+ ],
+ ],
+ 'queries' => [['b', 1, '50 ms']],
+ 'vitals' => [
+ ['lcp', '101 ms', 100.522, 'good', 2],
+ ['inp', '10 ms', 10.148, 'good', 2],
+ ['cls', '0.000', 0.0, 'good', 2],
+ ['ttfb', '51 ms', 50.77, 'good', 2],
+ ['fcp', '60 ms', 60.0, 'good', 2],
+ ],
+ 'pages' => [
+ [
+ 'page' => '/',
+ 'rating' => 'needs_improvement',
+ 'errors_url' => null,
+ 'count' => 1,
+ 'p50' => '3.00 s',
+ 'p75' => '3.00 s',
+ 'p95' => '3.00 s',
+ ],
+ [
+ 'page' => '/shop',
+ 'rating' => 'good',
+ 'errors_url' => null,
+ 'count' => 1,
+ 'p50' => '100 ms',
+ 'p75' => '100 ms',
+ 'p95' => '100 ms',
+ ],
+ ],
+ 'uptime' => [
+ 'checks' => [
+ [
+ 'id' => 3,
+ 'name' => 'Shop home',
+ 'url' => 'https://shop.example.test/',
+ 'active' => true,
+ 'status' => 'up',
+ 'uptime' => 100.0,
+ 'response' => '80 ms',
+ 'checked_at' => '2026-11-17 11:55',
+ 'error' => null,
+ ],
+ ],
+ 'incidents' => [],
+ ],
+ ],
+ '?route=ghost' => [
+ 'filters' => ['period' => 'day', 'site' => null, 'locale' => '*', 'route' => 'ghost', 'page' => '*', 'device' => '*'],
+ 'charts' => [
+ ['ttfb', 30, '19.10', ['label' => '17.11', 'count' => 0, 'p50' => '—', 'p75' => '—', 'p95' => '—']],
+ ['db_ms', 30, '19.10', ['label' => '17.11', 'count' => 0, 'p50' => '—', 'p75' => '—', 'p95' => '—']],
+ ],
+ 'summary' => [
+ 'requests' => 0,
+ 'ttfb' => ['count' => 0, 'p50' => '—', 'p75' => '—', 'p95' => '—'],
+ 'errors' => null,
+ 'cache_ratio' => null,
+ 'queries' => null,
+ 'memory_p95' => null,
+ ],
+ 'routes' => [
+ [
+ 'route' => 'shop.index',
+ 'sample' => '/shop',
+ 'count' => 2,
+ 'p50' => '903 ms',
+ 'p75' => '903 ms',
+ 'p95' => '903 ms',
+ ],
+ ['route' => 'home', 'sample' => '/', 'count' => 7, 'p50' => '164 ms', 'p75' => '181 ms', 'p95' => '199 ms'],
+ ],
+ 'queries' => [['a', 3, '199 ms'], ['b', 1, '50 ms']],
+ 'vitals' => [
+ ['lcp', '3.06 s', 3058.514, 'needs_improvement', 5],
+ ['inp', '254 ms', 254.013, 'needs_improvement', 5],
+ ['cls', '0.205', 0.205, 'needs_improvement', 5],
+ ['ttfb', '903 ms', 903.188, 'needs_improvement', 5],
+ ['fcp', '1.97 s', 1971.545, 'needs_improvement', 5],
+ ],
+ 'pages' => [
+ [
+ 'page' => '/catalog',
+ 'rating' => 'needs_improvement',
+ 'errors_url' => null,
+ 'count' => 2,
+ 'p50' => '2.91 s',
+ 'p75' => '2.91 s',
+ 'p95' => '2.91 s',
+ ],
+ [
+ 'page' => '/',
+ 'rating' => 'good',
+ 'errors_url' => null,
+ 'count' => 2,
+ 'p50' => '1.80 s',
+ 'p75' => '1.80 s',
+ 'p95' => '1.80 s',
+ ],
+ [
+ 'page' => '/shop',
+ 'rating' => 'good',
+ 'errors_url' => null,
+ 'count' => 1,
+ 'p50' => '100 ms',
+ 'p75' => '100 ms',
+ 'p95' => '100 ms',
+ ],
+ ],
+ ],
+ '?site=1&device=mobile' => [
+ 'filters' => ['period' => 'day', 'site' => 1, 'locale' => '*', 'route' => '*', 'page' => '*', 'device' => 'mobile'],
+ 'charts' => [
+ [
+ 'ttfb',
+ 30,
+ '19.10',
+ ['label' => '17.11', 'count' => 7, 'p50' => '164 ms', 'p75' => '181 ms', 'p95' => '199 ms'],
+ ],
+ ['db_ms', 30, '19.10', ['label' => '17.11', 'count' => 7, 'p50' => '1.0 ms', 'p75' => '1.0 ms', 'p95' => '1.0 ms']],
+ ],
+ 'summary' => [
+ 'requests' => 7,
+ 'ttfb' => ['count' => 7, 'p50' => '164 ms', 'p75' => '181 ms', 'p95' => '199 ms'],
+ 'errors' => 14.29,
+ 'cache_ratio' => 66.7,
+ 'queries' => 4.6,
+ 'memory_p95' => 24.4,
+ ],
+ 'routes' => [['route' => 'home', 'sample' => '/', 'count' => 7, 'p50' => '164 ms', 'p75' => '181 ms', 'p95' => '199 ms']],
+ 'queries' => [['a', 3, '199 ms']],
+ 'vitals' => [
+ ['lcp', '1.80 s', 1800.0, 'good', 2],
+ ['inp', '150 ms', 150.0, 'good', 2],
+ ['cls', '0.041', 0.041, 'good', 2],
+ ['ttfb', '503 ms', 502.929, 'good', 2],
+ ['fcp', '1.21 s', 1210.358, 'good', 2],
+ ],
+ 'pages' => [],
+ ],
+ '?site=1&locale=de' => [
+ 'filters' => ['period' => 'day', 'site' => 1, 'locale' => 'de', 'route' => '*', 'page' => '*', 'device' => '*'],
+ 'charts' => [
+ [
+ 'ttfb',
+ 30,
+ '19.10',
+ ['label' => '17.11', 'count' => 3, 'p50' => '199 ms', 'p75' => '199 ms', 'p95' => '199 ms'],
+ ],
+ ['db_ms', 30, '19.10', ['label' => '17.11', 'count' => 3, 'p50' => '1.0 ms', 'p75' => '1.0 ms', 'p95' => '1.0 ms']],
+ ],
+ 'summary' => [
+ 'requests' => 3,
+ 'ttfb' => ['count' => 3, 'p50' => '199 ms', 'p75' => '199 ms', 'p95' => '199 ms'],
+ 'errors' => 33.33,
+ 'cache_ratio' => null,
+ 'queries' => 5.3,
+ 'memory_p95' => 24.4,
+ ],
+ 'routes' => [['route' => 'home', 'sample' => '/', 'count' => 7, 'p50' => '164 ms', 'p75' => '181 ms', 'p95' => '199 ms']],
+ 'queries' => [['a', 3, '199 ms']],
+ 'vitals' => [
+ ['lcp', '2.90 s', 2900.0, 'needs_improvement', 1],
+ ['inp', '80 ms', 80.0, 'good', 1],
+ ['cls', '0.120', 0.12, 'needs_improvement', 1],
+ ['ttfb', '1.90 s', 1900.0, 'poor', 1],
+ ['fcp', '2.00 s', 2000.0, 'needs_improvement', 1],
+ ],
+ 'pages' => [],
+ ],
+ '?route=home&locale=de' => [
+ 'filters' => ['period' => 'day', 'site' => null, 'locale' => 'de', 'route' => 'home', 'page' => '*', 'device' => '*'],
+ 'charts' => [
+ [
+ 'ttfb',
+ 30,
+ '19.10',
+ ['label' => '17.11', 'count' => 7, 'p50' => '164 ms', 'p75' => '181 ms', 'p95' => '199 ms'],
+ ],
+ ['db_ms', 30, '19.10', ['label' => '17.11', 'count' => 7, 'p50' => '1.0 ms', 'p75' => '1.0 ms', 'p95' => '1.0 ms']],
+ ],
+ 'summary' => [
+ 'requests' => 7,
+ 'ttfb' => ['count' => 7, 'p50' => '164 ms', 'p75' => '181 ms', 'p95' => '199 ms'],
+ 'errors' => 14.29,
+ 'cache_ratio' => 66.7,
+ 'queries' => 4.6,
+ 'memory_p95' => 24.4,
+ ],
+ 'routes' => [
+ [
+ 'route' => 'shop.index',
+ 'sample' => '/shop',
+ 'count' => 2,
+ 'p50' => '903 ms',
+ 'p75' => '903 ms',
+ 'p95' => '903 ms',
+ ],
+ ['route' => 'home', 'sample' => '/', 'count' => 7, 'p50' => '164 ms', 'p75' => '181 ms', 'p95' => '199 ms'],
+ ],
+ 'queries' => [['a', 3, '199 ms'], ['b', 1, '50 ms']],
+ 'vitals' => [
+ ['lcp', '2.91 s', 2912.871, 'needs_improvement', 3],
+ ['inp', '79 ms', 78.761, 'good', 3],
+ ['cls', '0.120', 0.12, 'needs_improvement', 3],
+ ['ttfb', '101 ms', 100.522, 'good', 3],
+ ['fcp', '294 ms', 294.052, 'good', 3],
+ ],
+ 'pages' => [],
+ ],
+ '?site=1&route=home' => [
+ 'filters' => ['period' => 'day', 'site' => 1, 'locale' => '*', 'route' => 'home', 'page' => '*', 'device' => '*'],
+ 'charts' => [
+ [
+ 'ttfb',
+ 30,
+ '19.10',
+ ['label' => '17.11', 'count' => 7, 'p50' => '164 ms', 'p75' => '181 ms', 'p95' => '199 ms'],
+ ],
+ ['db_ms', 30, '19.10', ['label' => '17.11', 'count' => 7, 'p50' => '1.0 ms', 'p75' => '1.0 ms', 'p95' => '1.0 ms']],
+ ],
+ 'summary' => [
+ 'requests' => 7,
+ 'ttfb' => ['count' => 7, 'p50' => '164 ms', 'p75' => '181 ms', 'p95' => '199 ms'],
+ 'errors' => 14.29,
+ 'cache_ratio' => 66.7,
+ 'queries' => 4.6,
+ 'memory_p95' => 24.4,
+ ],
+ 'routes' => [['route' => 'home', 'sample' => '/', 'count' => 7, 'p50' => '164 ms', 'p75' => '181 ms', 'p95' => '199 ms']],
+ 'queries' => [['a', 3, '199 ms']],
+ 'vitals' => [
+ ['lcp', '2.91 s', 2912.871, 'needs_improvement', 3],
+ ['inp', '149 ms', 148.516, 'good', 3],
+ ['cls', '0.120', 0.12, 'needs_improvement', 3],
+ ['ttfb', '903 ms', 903.188, 'needs_improvement', 3],
+ ['fcp', '1.97 s', 1971.545, 'needs_improvement', 3],
+ ],
+ 'pages' => [
+ [
+ 'page' => '/catalog',
+ 'rating' => 'needs_improvement',
+ 'errors_url' => null,
+ 'count' => 2,
+ 'p50' => '2.91 s',
+ 'p75' => '2.91 s',
+ 'p95' => '2.91 s',
+ ],
+ [
+ 'page' => '/',
+ 'rating' => 'good',
+ 'errors_url' => null,
+ 'count' => 1,
+ 'p50' => '1.80 s',
+ 'p75' => '1.80 s',
+ 'p95' => '1.80 s',
+ ],
+ ],
+ ],
+ '?page=%2Fcatalog&device=mobile&locale=de&site=1' => [
+ 'filters' => ['period' => 'day', 'site' => 1, 'locale' => 'de', 'route' => '*', 'page' => '/catalog', 'device' => 'mobile'],
+ 'charts' => [
+ [
+ 'ttfb',
+ 30,
+ '19.10',
+ ['label' => '17.11', 'count' => 3, 'p50' => '199 ms', 'p75' => '199 ms', 'p95' => '199 ms'],
+ ],
+ ['db_ms', 30, '19.10', ['label' => '17.11', 'count' => 3, 'p50' => '1.0 ms', 'p75' => '1.0 ms', 'p95' => '1.0 ms']],
+ ],
+ 'summary' => [
+ 'requests' => 3,
+ 'ttfb' => ['count' => 3, 'p50' => '199 ms', 'p75' => '199 ms', 'p95' => '199 ms'],
+ 'errors' => 33.33,
+ 'cache_ratio' => null,
+ 'queries' => 5.3,
+ 'memory_p95' => 24.4,
+ ],
+ 'routes' => [['route' => 'home', 'sample' => '/', 'count' => 7, 'p50' => '164 ms', 'p75' => '181 ms', 'p95' => '199 ms']],
+ 'queries' => [['a', 3, '199 ms']],
+ 'vitals' => [
+ ['lcp', '2.91 s', 2912.871, 'needs_improvement', 2],
+ ['inp', '80 ms', 80.0, 'good', 2],
+ ['cls', '0.120', 0.12, 'needs_improvement', 2],
+ ['ttfb', '903 ms', 903.188, 'needs_improvement', 2],
+ ['fcp', '2.00 s', 2000.0, 'needs_improvement', 2],
+ ],
+ 'pages' => [],
+ ],
+ '?device=mobile&locale=de&site=1' => [
+ 'filters' => ['period' => 'day', 'site' => 1, 'locale' => 'de', 'route' => '*', 'page' => '*', 'device' => 'mobile'],
+ 'charts' => [
+ [
+ 'ttfb',
+ 30,
+ '19.10',
+ ['label' => '17.11', 'count' => 3, 'p50' => '199 ms', 'p75' => '199 ms', 'p95' => '199 ms'],
+ ],
+ ['db_ms', 30, '19.10', ['label' => '17.11', 'count' => 3, 'p50' => '1.0 ms', 'p75' => '1.0 ms', 'p95' => '1.0 ms']],
+ ],
+ 'summary' => [
+ 'requests' => 3,
+ 'ttfb' => ['count' => 3, 'p50' => '199 ms', 'p75' => '199 ms', 'p95' => '199 ms'],
+ 'errors' => 33.33,
+ 'cache_ratio' => null,
+ 'queries' => 5.3,
+ 'memory_p95' => 24.4,
+ ],
+ 'routes' => [['route' => 'home', 'sample' => '/', 'count' => 7, 'p50' => '164 ms', 'p75' => '181 ms', 'p95' => '199 ms']],
+ 'queries' => [['a', 3, '199 ms']],
+ 'vitals' => [
+ ['lcp', '1.80 s', 1800.0, 'good', 2],
+ ['inp', '150 ms', 150.0, 'good', 2],
+ ['cls', '0.041', 0.041, 'good', 2],
+ ['ttfb', '503 ms', 502.929, 'good', 2],
+ ['fcp', '1.21 s', 1210.358, 'good', 2],
+ ],
+ 'pages' => [],
+ ],
+ '?locale=de&site=2' => [
+ 'filters' => ['period' => 'day', 'site' => 2, 'locale' => 'de', 'route' => '*', 'page' => '*', 'device' => '*'],
+ 'charts' => [
+ [
+ 'ttfb',
+ 30,
+ '19.10',
+ ['label' => '17.11', 'count' => 2, 'p50' => '903 ms', 'p75' => '903 ms', 'p95' => '903 ms'],
+ ],
+ ['db_ms', 30, '19.10', ['label' => '17.11', 'count' => 2, 'p50' => '1.0 ms', 'p75' => '1.0 ms', 'p95' => '1.0 ms']],
+ ],
+ 'summary' => [
+ 'requests' => 2,
+ 'ttfb' => ['count' => 2, 'p50' => '903 ms', 'p75' => '903 ms', 'p95' => '903 ms'],
+ 'errors' => 0.0,
+ 'cache_ratio' => 25.0,
+ 'queries' => 10.0,
+ 'memory_p95' => 1.0,
+ ],
+ 'routes' => [
+ [
+ 'route' => 'shop.index',
+ 'sample' => '/shop',
+ 'count' => 2,
+ 'p50' => '903 ms',
+ 'p75' => '903 ms',
+ 'p95' => '903 ms',
+ ],
+ ],
+ 'queries' => [['b', 1, '50 ms']],
+ 'vitals' => [
+ ['lcp', '101 ms', 100.522, 'good', 2],
+ ['inp', '10 ms', 10.148, 'good', 2],
+ ['cls', '0.000', 0.0, 'good', 2],
+ ['ttfb', '51 ms', 50.77, 'good', 2],
+ ['fcp', '60 ms', 60.0, 'good', 2],
+ ],
+ 'pages' => [],
+ ],
+ '?locale=de' => [
+ 'filters' => ['period' => 'day', 'site' => null, 'locale' => 'de', 'route' => '*', 'page' => '*', 'device' => '*'],
+ 'charts' => [
+ [
+ 'ttfb',
+ 30,
+ '19.10',
+ ['label' => '17.11', 'count' => 5, 'p50' => '219 ms', 'p75' => '903 ms', 'p95' => '903 ms'],
+ ],
+ ['db_ms', 30, '19.10', ['label' => '17.11', 'count' => 5, 'p50' => '1.0 ms', 'p75' => '1.0 ms', 'p95' => '1.0 ms']],
+ ],
+ 'summary' => [
+ 'requests' => 5,
+ 'ttfb' => ['count' => 5, 'p50' => '219 ms', 'p75' => '903 ms', 'p95' => '903 ms'],
+ 'errors' => 20.0,
+ 'cache_ratio' => 25.0,
+ 'queries' => 7.2,
+ 'memory_p95' => 24.4,
+ ],
+ 'routes' => [
+ [
+ 'route' => 'shop.index',
+ 'sample' => '/shop',
+ 'count' => 2,
+ 'p50' => '903 ms',
+ 'p75' => '903 ms',
+ 'p95' => '903 ms',
+ ],
+ ['route' => 'home', 'sample' => '/', 'count' => 7, 'p50' => '164 ms', 'p75' => '181 ms', 'p95' => '199 ms'],
+ ],
+ 'queries' => [['a', 3, '199 ms'], ['b', 1, '50 ms']],
+ 'vitals' => [
+ ['lcp', '2.91 s', 2912.871, 'needs_improvement', 3],
+ ['inp', '79 ms', 78.761, 'good', 3],
+ ['cls', '0.120', 0.12, 'needs_improvement', 3],
+ ['ttfb', '101 ms', 100.522, 'good', 3],
+ ['fcp', '294 ms', 294.052, 'good', 3],
+ ],
+ 'pages' => [],
+ ],
+ '?page=%2Fcatalog' => [
+ 'filters' => ['period' => 'day', 'site' => null, 'locale' => '*', 'route' => '*', 'page' => '/catalog', 'device' => '*'],
+ 'charts' => [
+ [
+ 'ttfb',
+ 30,
+ '19.10',
+ ['label' => '17.11', 'count' => 9, 'p50' => '181 ms', 'p75' => '219 ms', 'p95' => '903 ms'],
+ ],
+ ['db_ms', 30, '19.10', ['label' => '17.11', 'count' => 9, 'p50' => '1.0 ms', 'p75' => '1.0 ms', 'p95' => '1.0 ms']],
+ ],
+ 'summary' => [
+ 'requests' => 9,
+ 'ttfb' => ['count' => 9, 'p50' => '181 ms', 'p75' => '219 ms', 'p95' => '903 ms'],
+ 'errors' => 11.11,
+ 'cache_ratio' => 42.9,
+ 'queries' => 5.8,
+ 'memory_p95' => 24.4,
+ ],
+ 'routes' => [
+ [
+ 'route' => 'shop.index',
+ 'sample' => '/shop',
+ 'count' => 2,
+ 'p50' => '903 ms',
+ 'p75' => '903 ms',
+ 'p95' => '903 ms',
+ ],
+ ['route' => 'home', 'sample' => '/', 'count' => 7, 'p50' => '164 ms', 'p75' => '181 ms', 'p95' => '199 ms'],
+ ],
+ 'queries' => [['a', 3, '199 ms'], ['b', 1, '50 ms']],
+ 'vitals' => [
+ ['lcp', '2.91 s', 2912.871, 'needs_improvement', 2],
+ ['inp', '80 ms', 80.0, 'good', 2],
+ ['cls', '0.120', 0.12, 'needs_improvement', 2],
+ ['ttfb', '903 ms', 903.188, 'needs_improvement', 2],
+ ['fcp', '2.00 s', 2000.0, 'needs_improvement', 2],
+ ],
+ 'pages' => [],
+ ],
+ '?period=week' => [
+ 'filters' => ['period' => 'week', 'site' => null, 'locale' => '*', 'route' => '*', 'page' => '*', 'device' => '*'],
+ 'range' => ['from' => '2026-05-25', 'to' => '2026-11-22'],
+ 'charts' => [
+ [
+ 'ttfb',
+ 26,
+ '25.05',
+ ['label' => '16.11', 'count' => 9, 'p50' => '181 ms', 'p75' => '219 ms', 'p95' => '903 ms'],
+ ],
+ ['db_ms', 26, '25.05', ['label' => '16.11', 'count' => 9, 'p50' => '1.0 ms', 'p75' => '1.0 ms', 'p95' => '1.0 ms']],
+ ],
+ ],
+ '?period=month' => [
+ 'filters' => ['period' => 'month', 'site' => null, 'locale' => '*', 'route' => '*', 'page' => '*', 'device' => '*'],
+ 'range' => ['from' => '2025-11-01', 'to' => '2026-11-30'],
+ 'charts' => [
+ [
+ 'ttfb',
+ 13,
+ 'Nov 2025',
+ ['label' => 'Nov 2026', 'count' => 9, 'p50' => '181 ms', 'p75' => '219 ms', 'p95' => '903 ms'],
+ ],
+ [
+ 'db_ms',
+ 13,
+ 'Nov 2025',
+ ['label' => 'Nov 2026', 'count' => 9, 'p50' => '1.0 ms', 'p75' => '1.0 ms', 'p95' => '1.0 ms'],
+ ],
+ ],
+ ],
+ ];
+ }
+
+ public function test_the_query_page_shows_the_text_and_its_chart(): void
+ {
+ $this->seedData();
+ $props = $this->props('/admin/monitoring/queries/'.self::HASH);
+
+ $this->assertSame(['t', 'query', 'chart', 'points', 'routes'], array_slice(array_keys($props), -5));
+ $this->assertSame('Monitoring', $props['t']['title']);
+ $this->assertSame(['hash' => self::HASH, 'sql' => 'select '.str_repeat('x', 250), 'connection' => 'testing', 'last_seen' => '2026-11-17 09:00:00'], $props['query']);
+ $this->assertStringContainsString('>Query time', $props['chart']);
+ $this->assertCount(30, $props['points']);
+ $this->assertSame(['label' => '19.10', 'count' => 0, 'p50' => '—', 'p75' => '—', 'p95' => '—'], $props['points'][0]);
+ $this->assertSame(['label' => '17.11', 'count' => 3, 'p50' => '199 ms', 'p75' => '199 ms', 'p95' => '199 ms'], $props['points'][29]);
+ $this->assertSame([['route' => 'home', 'path' => '/', 'errors_url' => null, 'times' => 3, 'slowest' => '300 ms', 'average' => '200 ms']], $props['routes']);
+ }
+
+ public function test_only_a_lowercase_hex_hash_of_forty_characters_opens_a_query(): void
+ {
+ $bad = [str_repeat('A', 40), str_repeat('a', 39), str_repeat('a', 41), 'x'.str_repeat('a', 40), str_repeat('a', 40).'x', str_repeat('a', 39).'g', str_repeat('a', 39).'-'];
+
+ // A row for every refused address, so that only the check of the address
+ // can refuse it. SQLite holds them all; on MySQL "AAA…" is the same key
+ // as the lower-case hash (which is there) and PostgreSQL's char(40) takes
+ // no 41st character, so there the address check has the hash row alone.
+ $rows = DB::getDriverName() === 'sqlite' ? [self::HASH, ...$bad] : [self::HASH];
+
+ foreach ($rows as $hash) {
+ DB::table('monitoring_query_texts')->insert(['hash' => $hash, 'sql' => 'select 1', 'connection' => 'testing', 'last_seen_at' => Carbon::now()]);
+ }
+
+ $admin = $this->admin();
+ $this->actingAs($admin, 'admin')->get('/admin/monitoring/queries/'.self::HASH)->assertOk();
+ $this->actingAs($admin, 'admin')->get('/admin/monitoring/queries/'.str_repeat('0123456789', 4))->assertNotFound();
+
+ foreach ($bad as $hash) {
+ $this->actingAs($admin, 'admin')->get('/admin/monitoring/queries/'.$hash)->assertNotFound();
+ }
+
+ DB::table('monitoring_query_texts')->insert(['hash' => str_repeat('0123456789', 4), 'sql' => 'select 1', 'connection' => 'testing', 'last_seen_at' => Carbon::now()]);
+ $this->actingAs($admin, 'admin')->get('/admin/monitoring/queries/'.str_repeat('0123456789', 4))->assertOk();
+ }
+
+ /** @param array $attributes */
+ private function check(int $site, string $name, array $attributes = []): UptimeCheck
+ {
+ $check = new UptimeCheck;
+ $check->forceFill(['site_id' => $site, 'name' => $name, 'url' => 'https://'.strtolower($name).'.example.test/'] + $attributes)->save();
+
+ return $check;
+ }
+
+ public function test_uptime_lists_the_home_check_first_and_the_ten_latest_incidents(): void
+ {
+ $alpha = $this->check(1, 'Alpha', ['active' => false]);
+ $this->check(1, 'Bravo', ['is_home' => true]);
+ $charlie = $this->check(2, 'Charlie');
+
+ $made = [];
+
+ foreach (range(1, 12) as $n) {
+ $started = Carbon::now()->subHours($n);
+ $made[$n] = Incident::query()->create(['check_id' => $alpha->id, 'started_at' => $started, 'resolved_at' => $n === 1 ? null : $started->copy()->addMinutes(10), 'failures' => 3, 'last_error' => 'Error '.$n]);
+ }
+
+ $shop = Incident::query()->create(['check_id' => $charlie->id, 'started_at' => Carbon::now()->subMinutes(30), 'resolved_at' => Carbon::now()->subMinutes(5), 'failures' => 3, 'last_error' => 'Shop error']);
+
+ $all = $this->props('/admin/monitoring')['uptime'];
+ $this->assertSame(['Bravo', 'Alpha', 'Charlie'], array_column($all['checks'], 'name'));
+ $this->assertSame(['id' => $alpha->id, 'name' => 'Alpha', 'url' => 'https://alpha.example.test/', 'active' => false, 'status' => 'unknown', 'uptime' => null, 'response' => null, 'checked_at' => null, 'error' => null], $all['checks'][1]);
+ $this->assertSame(['Shop error', 'Error 1', 'Error 2', 'Error 3', 'Error 4', 'Error 5', 'Error 6', 'Error 7', 'Error 8', 'Error 9'], array_column($all['incidents'], 'error'));
+ // The second site's check keeps its name though the panel stands on the first.
+ $this->assertSame(['id' => $shop->id, 'check' => 'Charlie', 'started_at' => '2026-11-17 11:30', 'resolved_at' => '2026-11-17 11:55', 'duration' => '25 minutes', 'error' => 'Shop error'], $all['incidents'][0]);
+ $this->assertSame(['id' => $made[1]->id, 'check' => 'Alpha', 'started_at' => '2026-11-17 11:00', 'resolved_at' => null, 'duration' => '60 minutes', 'error' => 'Error 1'], $all['incidents'][1]);
+ $this->assertSame(['id' => $made[2]->id, 'check' => 'Alpha', 'started_at' => '2026-11-17 10:00', 'resolved_at' => '2026-11-17 10:10', 'duration' => '10 minutes', 'error' => 'Error 2'], $all['incidents'][2]);
+
+ $first = $this->props('/admin/monitoring?site=1')['uptime'];
+ $this->assertSame(['Bravo', 'Alpha'], array_column($first['checks'], 'name'));
+ $this->assertSame(array_map(fn (int $n): string => 'Error '.$n, range(1, 10)), array_column($first['incidents'], 'error'));
+
+ $second = $this->props('/admin/monitoring?site=2')['uptime'];
+ $this->assertSame(['Charlie'], array_column($second['checks'], 'name'));
+ $this->assertSame(['Shop error'], array_column($second['incidents'], 'error'));
+ }
+
+ public function test_an_incident_whose_check_is_gone_has_a_blank_name_and_shows_for_all_sites_only(): void
+ {
+ Schema::disableForeignKeyConstraints();
+ $orphan = Incident::query()->create(['check_id' => 999, 'started_at' => Carbon::now()->subMinutes(5), 'failures' => 1, 'last_error' => 'Orphan']);
+
+ $this->assertSame([['id' => $orphan->id, 'check' => '', 'started_at' => '2026-11-17 11:55', 'resolved_at' => null, 'duration' => '5 minutes', 'error' => 'Orphan']], $this->props('/admin/monitoring')['uptime']['incidents']);
+ $this->assertSame([], $this->props('/admin/monitoring?site=1')['uptime']['incidents']);
+ }
+}
diff --git a/packages/monitoring/tests/GadgetTest.php b/packages/monitoring/tests/GadgetTest.php
new file mode 100644
index 00000000..ba4f5f4c
--- /dev/null
+++ b/packages/monitoring/tests/GadgetTest.php
@@ -0,0 +1,181 @@
+ $vitals */
+ private function visit(string $day, array $vitals): void
+ {
+ app(Flusher::class)->write([['k' => 'v', 'at' => Carbon::parse($day.' 09:00:00')->getTimestamp(), 'site' => 1, 'loc' => 'en', 'path' => '/', 'dev' => 'mobile', 'con' => '4g'] + $vitals]);
+ }
+
+ private function request(string $day, string $route, float $ms): void
+ {
+ app(Flusher::class)->write([['k' => 'r', 'at' => Carbon::parse($day.' 09:00:00')->getTimestamp(), 'site' => 1, 'loc' => 'en', 'route' => $route, 'path' => '/', 'm' => 'GET', 's' => 200, 'd' => $ms, 'q' => 1, 'qm' => 1.0, 'ch' => 0, 'cm' => 0, 'mem' => 1024]]);
+ }
+
+ private function check(string $name, array $attributes = []): UptimeCheck
+ {
+ $check = new UptimeCheck;
+ $check->forceFill($attributes + ['site_id' => 1, 'name' => $name, 'url' => 'https://'.str_replace(' ', '-', strtolower($name)).'.example.test/', 'active' => true])->save();
+
+ return $check;
+ }
+
+ private function checkResult(UptimeCheck $check, bool $ok, string $day): void
+ {
+ app(UptimeChecker::class)->record($check, $ok, $ok ? 200 : 503, 50.0, $ok ? null : 'HTTP 503', Carbon::parse($day.' 08:00:00'));
+ }
+
+ public function test_it_is_the_monitoring_tile(): void
+ {
+ $gadget = new MonitoringGadget;
+
+ $this->assertSame('MonitoringGadget', $gadget->component());
+ $this->assertSame('Speed and uptime', $gadget->title());
+ }
+
+ public function test_the_title_can_be_set_in_the_options(): void
+ {
+ $gadget = new MonitoringGadget(['title' => 'Site health']);
+
+ $this->assertSame('Site health', $gadget->title());
+ }
+
+ public function test_it_is_for_those_who_may_open_the_page_it_links_to(): void
+ {
+ $gadget = new MonitoringGadget;
+
+ $this->assertFalse($gadget->isVisible(), 'nobody signed in');
+
+ $this->actingAs($this->admin(false), 'admin');
+ $this->assertFalse($gadget->isVisible(), 'signed in without the permission');
+
+ $this->actingAs($this->admin(), 'admin');
+ $this->assertTrue($gadget->isVisible());
+ }
+
+ public function test_the_visitors_vitals_are_the_75th_percentile_of_the_last_seven_days(): void
+ {
+ // Seven days end today: the 11th is the first, the 10th is out.
+ $this->visit('2026-11-10', ['lcp' => 4000, 'inp' => 900, 'cls' => 0.4, 'ttfb' => 2500, 'fcp' => 4000]);
+ $this->visit('2026-11-11', ['lcp' => 1000, 'inp' => 100, 'cls' => 0.05, 'ttfb' => 400, 'fcp' => 1200]);
+ $this->visit('2026-11-17', ['lcp' => 1000, 'inp' => 100, 'cls' => 0.05, 'ttfb' => 400, 'fcp' => 1200]);
+
+ $vitals = (new MonitoringGadget)->data()['vitals'];
+
+ $this->assertSame([
+ ['key' => 'lcp', 'label' => 'Largest Contentful Paint', 'value' => '1.00 s', 'rating' => 'good'],
+ ['key' => 'inp', 'label' => 'Interaction to Next Paint', 'value' => '100 ms', 'rating' => 'good'],
+ ['key' => 'cls', 'label' => 'Cumulative Layout Shift', 'value' => '0.050', 'rating' => 'good'],
+ ['key' => 'ttfb', 'label' => 'Time to First Byte', 'value' => '400 ms', 'rating' => 'good'],
+ ['key' => 'fcp', 'label' => 'First Contentful Paint', 'value' => '1.20 s', 'rating' => 'good'],
+ ], $vitals);
+ }
+
+ public function test_the_seventh_day_back_is_counted_and_a_day_before_the_window_is_not(): void
+ {
+ $this->visit('2026-11-11', ['lcp' => 4800]);
+
+ $this->assertSame(['key' => 'lcp', 'label' => 'Largest Contentful Paint', 'value' => '4.80 s', 'rating' => 'poor'], (new MonitoringGadget)->data()['vitals'][0]);
+
+ Carbon::setTestNow('2026-11-18 12:00:00');
+ $this->assertSame(['key' => 'lcp', 'label' => 'Largest Contentful Paint', 'value' => '—', 'rating' => null], (new MonitoringGadget)->data()['vitals'][0]);
+ }
+
+ public function test_uptime_is_the_share_of_good_checks_over_thirty_days_to_two_decimals(): void
+ {
+ $shop = $this->check('Shop');
+ // Thirty days end today: 19 October is the first, the 18th is out.
+ $this->checkResult($shop, false, '2026-10-18');
+ $this->checkResult($shop, true, '2026-10-19');
+ $this->checkResult($shop, true, '2026-11-01');
+ $this->checkResult($shop, false, '2026-11-17');
+
+ $this->assertSame(66.67, (new MonitoringGadget)->data()['uptime']);
+ }
+
+ public function test_the_thirtieth_day_back_is_counted_and_the_one_before_is_not(): void
+ {
+ $shop = $this->check('Shop');
+ $this->checkResult($shop, false, '2026-10-18');
+ $this->checkResult($shop, true, '2026-10-19');
+
+ $this->assertSame(100.0, (new MonitoringGadget)->data()['uptime']);
+
+ $this->checkResult($shop, true, '2026-10-20');
+ $this->assertSame(100.0, (new MonitoringGadget)->data()['uptime']);
+ }
+
+ public function test_uptime_has_no_number_before_the_first_check(): void
+ {
+ $this->assertNull((new MonitoringGadget)->data()['uptime']);
+ $this->assertSame([], (new MonitoringGadget)->data()['down']);
+ }
+
+ public function test_it_names_the_active_addresses_that_are_down_now(): void
+ {
+ config(['atrium-monitoring.uptime.failures' => 1]);
+ $this->checkResult($this->check('Shop'), false, '2026-11-17');
+ $this->checkResult($this->check('Blog'), true, '2026-11-17');
+ $this->checkResult($this->check('Old shop', ['active' => false]), false, '2026-11-17');
+ $this->checkResult($this->check('Docs', ['site_id' => 2]), false, '2026-11-17');
+
+ $this->assertSame(['Shop', 'Docs'], (new MonitoringGadget)->data()['down']);
+ }
+
+ public function test_it_lists_the_five_slowest_routes_by_p75_of_the_last_week(): void
+ {
+ foreach (['alpha' => 100.0, 'bravo' => 200.0, 'charlie' => 300.0, 'delta' => 400.0, 'echo' => 500.0, 'foxtrot' => 600.0] as $route => $ms) {
+ $this->request('2026-11-17', $route, $ms);
+ }
+
+ $this->request('2026-11-10', 'golf', 9000.0);
+
+ $slowest = (new MonitoringGadget)->data()['slowest'];
+
+ $this->assertSame(['foxtrot', 'echo', 'delta', 'charlie', 'bravo'], array_column($slowest, 'route'));
+ $this->assertSame(['600 ms', '500 ms', '400 ms', '300 ms', '200 ms'], array_column($slowest, 'p75'));
+ $this->assertSame(['route', 'p75'], array_keys($slowest[0]));
+ }
+
+ public function test_it_links_to_the_page_and_carries_its_wording(): void
+ {
+ $data = (new MonitoringGadget)->data();
+
+ $this->assertSame(['vitals', 'uptime', 'down', 'slowest', 'url', 'labels', 'ratings'], array_keys($data));
+ $this->assertSame(route('admin.monitoring.index'), $data['url']);
+ $this->assertSame(trans('atrium-monitoring::monitoring.gadget'), $data['labels']);
+ $this->assertSame('Speed and uptime', $data['labels']['title']);
+ $this->assertSame(trans('atrium-monitoring::monitoring.ratings'), $data['ratings']);
+ $this->assertNotSame([], $data['ratings']);
+ }
+}
diff --git a/packages/monitoring/tests/HistogramTest.php b/packages/monitoring/tests/HistogramTest.php
new file mode 100644
index 00000000..7ceffc05
--- /dev/null
+++ b/packages/monitoring/tests/HistogramTest.php
@@ -0,0 +1,280 @@
+ $values
+ */
+ private static function exact(array $values, float $q): float
+ {
+ sort($values);
+
+ return $values[(int) floor($q * (count($values) - 1))];
+ }
+
+ /** @return array}> */
+ public static function distributions(): array
+ {
+ mt_srand(20261117);
+ $uniform = $lognormal = $bimodal = $exponential = [];
+
+ for ($i = 0; $i < 5000; $i++) {
+ $uniform[] = mt_rand(1, 200_000) / 100;
+ // Box–Muller: response times are roughly log-normal.
+ $u = max(1e-9, mt_rand() / mt_getrandmax());
+ $v = mt_rand() / mt_getrandmax();
+ $lognormal[] = exp(5 + 0.8 * sqrt(-2 * log($u)) * cos(2 * M_PI * $v));
+ // Cached pages fast, the rest slow.
+ $bimodal[] = (float) ($i % 4 === 0 ? 900 + mt_rand(0, 400) : 20 + mt_rand(0, 30));
+ $exponential[] = -log(max(1e-9, mt_rand() / mt_getrandmax())) * 120;
+ }
+
+ return [
+ 'uniform' => [$uniform],
+ 'log-normal' => [$lognormal],
+ 'bimodal' => [$bimodal],
+ 'exponential' => [$exponential],
+ 'layout shift scores' => [[0.0, 0.0, 0.01, 0.02, 0.05, 0.08, 0.1, 0.12, 0.3, 0.5, 0.0, 0.004]],
+ 'single value' => [[42.0]],
+ ];
+ }
+
+ /**
+ * @param array $values
+ */
+ #[DataProvider('distributions')]
+ public function test_percentiles_are_within_the_bucket_error_of_the_exact_ones(array $values): void
+ {
+ $histogram = Histogram::of($values);
+
+ foreach ([0.0, 0.25, 0.5, 0.75, 0.9, 0.95, 0.99, 1.0] as $q) {
+ $exact = self::exact($values, $q);
+ $estimate = $histogram->quantile($q);
+ $this->assertNotNull($estimate);
+
+ if ($exact < Histogram::MIN) {
+ $this->assertSame(0.0, $estimate, "q=$q of zeros");
+
+ continue;
+ }
+
+ $this->assertEqualsWithDelta($exact, $estimate, $exact * 0.025, "q=$q");
+ }
+
+ $this->assertSame(count($values), $histogram->count());
+ $this->assertEqualsWithDelta(array_sum($values), $histogram->sum(), 1e-6 * max(1, array_sum($values)));
+ $this->assertSame(min($values), $histogram->min());
+ $this->assertSame(max($values), $histogram->max());
+ }
+
+ public function test_merged_days_give_the_percentiles_of_the_whole_week(): void
+ {
+ mt_srand(7);
+ $all = [];
+ $week = new Histogram;
+
+ for ($day = 0; $day < 7; $day++) {
+ // Each day slower than the one before: merging must not average percentiles.
+ $values = array_map(static fn (): float => mt_rand(100, 1000) * (1 + $day / 2), range(1, 300 + $day * 50));
+ $all = [...$all, ...$values];
+ // Through the database format, as the report reads it back.
+ $stored = Histogram::of($values)->toArray();
+ $row = (object) ['count' => $stored['n'], 'sum' => $stored['s'], 'min' => $stored['lo'], 'max' => $stored['hi'], 'buckets' => Histogram::of($values)->toJson()];
+ $week->merge(Histogram::fromRow($row));
+ }
+
+ $direct = Histogram::of($all);
+
+ foreach ([0.5, 0.75, 0.95] as $q) {
+ $this->assertSame($direct->quantile($q), $week->quantile($q));
+ $this->assertEqualsWithDelta(self::exact($all, $q), $week->quantile($q), self::exact($all, $q) * 0.025);
+ }
+
+ $this->assertSame(count($all), $week->count());
+ }
+
+ public function test_an_empty_histogram_has_no_percentiles(): void
+ {
+ $histogram = new Histogram;
+
+ $this->assertNull($histogram->quantile(0.5));
+ $this->assertNull($histogram->mean());
+ $this->assertNull($histogram->min());
+ $this->assertNull($histogram->max());
+ $this->assertSame(['n' => 0, 's' => 0.0, 'lo' => 0.0, 'hi' => 0.0, 'b' => []], $histogram->toArray());
+ $this->assertSame('{}', $histogram->toJson());
+
+ $histogram->merge(new Histogram);
+ $this->assertSame(0, $histogram->count());
+ }
+
+ public function test_bad_values_are_ignored_and_negative_ones_count_as_zero(): void
+ {
+ $histogram = new Histogram;
+ $histogram->add(NAN);
+ $histogram->add(INF);
+ $histogram->add(-INF);
+ $histogram->add(5.0, 0);
+ $this->assertSame(0, $histogram->count());
+
+ $histogram->add(-3.0);
+ $histogram->add(10.0, 3);
+
+ $this->assertSame(4, $histogram->count());
+ $this->assertSame(0.0, $histogram->min());
+ $this->assertSame(30.0, $histogram->sum());
+ $this->assertSame(7.5, $histogram->mean());
+ $this->assertSame(0.0, $histogram->quantile(0));
+ $this->assertSame(10.0, $histogram->quantile(1));
+ // Out-of-range q is clamped, not an error.
+ $this->assertSame(10.0, $histogram->quantile(7));
+ $this->assertSame(0.0, $histogram->quantile(-1));
+ }
+
+ public function test_reading_back_rejects_broken_stored_data(): void
+ {
+ $this->assertSame(0, Histogram::fromArray(['n' => -5, 'b' => [3 => 5]])->count());
+ $this->assertSame(0, Histogram::fromRow((object) ['count' => 0, 'buckets' => 'not json'])->count());
+
+ $broken = Histogram::fromRow((object) ['count' => 2, 'sum' => 3, 'min' => 1, 'max' => 2, 'buckets' => 'not json']);
+ $this->assertSame(2, $broken->count());
+ // No buckets survive, so the percentile falls back to the maximum.
+ $this->assertSame(2.0, $broken->quantile(0.5));
+
+ $kept = Histogram::fromArray(['n' => 3, 's' => 6, 'lo' => 1, 'hi' => 3, 'b' => ['0' => 1, '14' => 2, '20' => 0, '22' => -4]]);
+ $this->assertSame([0 => 1, 14 => 2], $kept->toArray()['b']);
+ }
+
+ public function test_bucket_values_stay_within_their_bounds(): void
+ {
+ foreach ([0.001, 0.0042, 1.0, 1.04, 1.05, 199.99, 2500.0, 123456.0] as $value) {
+ $read = Histogram::value(Histogram::index($value));
+ $this->assertEqualsWithDelta($value, $read, $value * 0.0244 + 1e-12, (string) $value);
+ }
+
+ $this->assertSame(0.0, Histogram::value(Histogram::index(0.0)));
+ $this->assertSame(0.0, Histogram::value(Histogram::index(0.0009)));
+ $this->assertSame(Histogram::index(1.0), Histogram::index(1.0 + 1e-12));
+ }
+
+ public function test_a_stored_histogram_is_read_back_whole(): void
+ {
+ $one = Histogram::fromArray(['n' => 1, 's' => 5, 'lo' => 5, 'hi' => 5, 'b' => [Histogram::index(5.0) => 1]]);
+ $this->assertSame(1, $one->count());
+ $this->assertSame(5.0, $one->sum());
+ $this->assertSame(5.0, $one->min());
+ $this->assertSame(5.0, $one->max());
+
+ // Without the numbers, zeros.
+ $bare = Histogram::fromArray(['n' => 2]);
+ $this->assertSame(2, $bare->count());
+ $this->assertSame(0.0, $bare->sum());
+ $this->assertSame(0.0, $bare->min());
+ $this->assertSame(0.0, $bare->max());
+ $this->assertSame([], $bare->toArray()['b']);
+ }
+
+ public function test_a_stored_histogram_without_a_count_is_empty_whatever_else_it_holds(): void
+ {
+ foreach ([[], ['n' => null], ['n' => 0], ['n' => -3], ['n' => 'abc']] as $count) {
+ $histogram = Histogram::fromArray($count + ['s' => 5, 'lo' => 1, 'hi' => 4, 'b' => [3 => 2]]);
+
+ $this->assertSame(0, $histogram->count(), var_export($count, true));
+ $this->assertSame(0.0, $histogram->sum());
+ $this->assertNull($histogram->min());
+ $this->assertSame(['n' => 0, 's' => 0.0, 'lo' => 0.0, 'hi' => 0.0, 'b' => []], $histogram->toArray());
+ }
+ }
+
+ public function test_numbers_stored_as_text_are_read_as_numbers(): void
+ {
+ $histogram = Histogram::fromArray(['n' => '3', 's' => '6.5', 'lo' => '1.5', 'hi' => '3.5', 'b' => ['3' => '4', '5.5' => 2, '9' => 0.5, '10' => '0', 'abc' => 1]]);
+
+ $this->assertSame(3, $histogram->count());
+ $this->assertSame(6.5, $histogram->sum());
+ $this->assertSame(1.5, $histogram->min());
+ $this->assertSame(3.5, $histogram->max());
+ $this->assertSame([0 => 1, 3 => 4, 5 => 2], $histogram->toArray()['b']);
+ }
+
+ public function test_a_database_row_is_read_back_whole(): void
+ {
+ // As a driver hands it over: everything as text.
+ $row = Histogram::fromRow((object) ['count' => '3', 'sum' => '6.5', 'min' => '1.5', 'max' => '3.5', 'buckets' => '{"0":1,"14":2}']);
+
+ $this->assertSame(3, $row->count());
+ $this->assertSame(6.5, $row->sum());
+ $this->assertSame(1.5, $row->min());
+ $this->assertSame(3.5, $row->max());
+ $this->assertSame([0 => 1, 14 => 2], $row->toArray()['b']);
+
+ $bare = Histogram::fromRow((object) ['count' => 2]);
+ $this->assertSame([2, 0.0, 0.0, 0.0, []], [$bare->count(), $bare->sum(), $bare->min(), $bare->max(), $bare->toArray()['b']]);
+
+ foreach ([(object) ['sum' => 5, 'min' => 1, 'max' => 4, 'buckets' => '{"3":2}'], (object) ['count' => null, 'sum' => 5], (object) ['count' => 0, 'sum' => 5]] as $empty) {
+ $this->assertSame(0, Histogram::fromRow($empty)->count());
+ $this->assertSame(0.0, Histogram::fromRow($empty)->sum());
+ }
+ }
+
+ public function test_merging_an_empty_histogram_changes_nothing_and_merging_into_one_takes_everything(): void
+ {
+ $histogram = Histogram::of([5.0, 7.0]);
+ $histogram->merge(new Histogram);
+
+ $this->assertSame(2, $histogram->count());
+ $this->assertSame(12.0, $histogram->sum());
+ $this->assertSame(5.0, $histogram->min());
+ $this->assertSame(7.0, $histogram->max());
+
+ $empty = new Histogram;
+ $empty->merge($histogram);
+ $this->assertSame($histogram->toArray(), $empty->toArray());
+ }
+
+ public function test_buckets_come_out_in_order_whatever_order_they_came_in(): void
+ {
+ $histogram = new Histogram;
+
+ foreach ([1000.0, 10.0, 1.0] as $value) {
+ $histogram->add($value);
+ }
+
+ $this->assertSame([Histogram::index(1.0), Histogram::index(10.0), Histogram::index(1000.0)], array_keys($histogram->toArray()['b']));
+ $this->assertSame('{"0":1,"48":1,"142":1}', $histogram->toJson());
+ $this->assertSame(1.0, $histogram->quantile(0.0));
+ $this->assertEqualsWithDelta(1000.0, $histogram->quantile(1.0), 25.0);
+ }
+
+ public function test_the_sum_is_kept_to_six_decimals(): void
+ {
+ $histogram = new Histogram;
+ $histogram->add(1.23456789);
+
+ $this->assertSame(1.234568, $histogram->toArray()['s']);
+ $this->assertSame(1.23456789, $histogram->sum());
+ }
+
+ public function test_a_value_on_the_edge_of_a_bucket_belongs_to_the_bucket_below(): void
+ {
+ $this->assertSame(0, Histogram::index(1.0));
+ $this->assertSame(1, Histogram::index(1.05));
+ $this->assertSame(10, Histogram::index(1.05 ** 10));
+ $this->assertSame(11, Histogram::index(1.05 ** 10 * 1.0001));
+ }
+}
diff --git a/packages/monitoring/tests/MenuTest.php b/packages/monitoring/tests/MenuTest.php
new file mode 100644
index 00000000..a4e33691
--- /dev/null
+++ b/packages/monitoring/tests/MenuTest.php
@@ -0,0 +1,102 @@
+ 'atrium-monitoring::monitoring.menu', 'route' => 'admin.monitoring.index', 'icon' => 'chart'];
+
+ private const GROUP = ['key' => 'site-health', 'label' => 'atrium-monitoring::monitoring.health', 'icon' => 'chart', 'children' => [self::ENTRY]];
+
+ public function test_alone_it_creates_the_group_before_modules(): void
+ {
+ $home = ['label' => 'Home', 'route' => 'admin.dashboard'];
+ $news = ['label' => 'News'];
+ $modules = ['label' => 'Modules', 'route' => 'admin.modules.index'];
+
+ $this->assertSame([$home, $news, self::GROUP, $modules], Menu::add([$home, $news, $modules]));
+ }
+
+ public function test_without_modules_the_group_goes_last(): void
+ {
+ $home = ['label' => 'Home', 'route' => 'admin.dashboard'];
+
+ $this->assertSame([$home, self::GROUP], Menu::add([$home]));
+ $this->assertSame([self::GROUP], Menu::add([]));
+ }
+
+ public function test_it_joins_the_group_the_error_log_made(): void
+ {
+ $home = ['label' => 'Home', 'route' => 'admin.dashboard'];
+ $errors = ['label' => 'atrium-errors::errors.title', 'route' => 'admin.errors.index', 'icon' => 'info'];
+ $group = ['key' => 'site-health', 'label' => 'atrium-errors::errors.health', 'icon' => 'chart', 'children' => [$errors]];
+ $modules = ['label' => 'Modules', 'route' => 'admin.modules.index'];
+
+ $expected = $group;
+ $expected['children'] = [$errors, self::ENTRY];
+
+ $this->assertSame([$home, $expected, $modules], Menu::add([$home, $group, $modules]));
+ }
+
+ public function test_a_group_with_no_children_yet_gets_the_entry(): void
+ {
+ $group = ['key' => 'site-health', 'label' => 'Site health'];
+ $other = ['key' => 'content', 'label' => 'Content', 'children' => [['label' => 'News']]];
+
+ $this->assertSame([$other, $group + ['children' => [self::ENTRY]]], Menu::add([$other, $group]));
+ }
+
+ public function test_what_follows_modules_stays_after_it(): void
+ {
+ $home = ['label' => 'Home', 'route' => 'admin.dashboard'];
+ $modules = ['label' => 'Modules', 'route' => 'admin.modules.index'];
+ $after = ['label' => 'After', 'route' => 'admin.after'];
+
+ $this->assertSame([$home, self::GROUP, $modules, $after], Menu::add([$home, $modules, $after]));
+ }
+
+ public function test_the_modules_own_lists_move_into_the_group_after_the_report(): void
+ {
+ $home = ['label' => 'Home', 'route' => 'admin.dashboard'];
+ $checks = ['label' => 'Uptime checks', 'route' => 'admin.uptime_checks.index', 'icon' => 'folder'];
+ $news = ['label' => 'News', 'route' => 'admin.news.index', 'icon' => 'folder'];
+ $incidents = ['label' => 'Incidents', 'route' => 'admin.monitoring_incidents.index', 'icon' => 'folder'];
+ $modules = ['label' => 'Modules', 'route' => 'admin.modules.index'];
+
+ $group = self::GROUP;
+ $group['children'] = [self::ENTRY, $checks, $incidents];
+
+ $this->assertSame([$home, $news, $group, $modules], Menu::add([$home, $checks, $news, $incidents, $modules]));
+ }
+
+ public function test_the_lists_follow_the_report_into_the_error_logs_group(): void
+ {
+ $errors = ['label' => 'Errors', 'route' => 'admin.errors.index'];
+ $group = ['key' => 'site-health', 'label' => 'Site health', 'children' => [$errors]];
+ $incidents = ['label' => 'Incidents', 'route' => 'admin.monitoring_incidents.index'];
+ $modules = ['label' => 'Modules', 'route' => 'admin.modules.index'];
+
+ $expected = $group;
+ $expected['children'] = [$errors, self::ENTRY, $incidents];
+
+ $this->assertSame([$expected, $modules], Menu::add([$incidents, $group, $modules]));
+ }
+
+ public function test_a_list_someone_already_put_in_a_group_stays_there(): void
+ {
+ $checks = ['label' => 'Uptime checks', 'route' => 'admin.uptime_checks.index'];
+ $content = ['key' => 'content', 'label' => 'Content', 'children' => [$checks]];
+
+ $this->assertSame([$content, self::GROUP], Menu::add([$content]));
+ }
+}
diff --git a/packages/monitoring/tests/ModelsTest.php b/packages/monitoring/tests/ModelsTest.php
new file mode 100644
index 00000000..0789ea85
--- /dev/null
+++ b/packages/monitoring/tests/ModelsTest.php
@@ -0,0 +1,207 @@
+forceFill($attributes + ['site_id' => null, 'name' => 'Demo shop', 'url' => 'https://shop.example.test/'])->save();
+
+ return $check;
+ }
+
+ /** @return array started, until, in whole minutes */
+ public static function lengths(): array
+ {
+ return [
+ 'nothing' => ['2026-11-16 10:00:00', '2026-11-16 10:00:00', '0'],
+ 'under a minute' => ['2026-11-16 10:00:00', '2026-11-16 10:00:59', '0'],
+ 'a minute' => ['2026-11-16 10:00:00', '2026-11-16 10:01:00', '1'],
+ 'a minute and a half' => ['2026-11-16 10:00:00', '2026-11-16 10:01:30', '1'],
+ 'two minutes less a second' => ['2026-11-16 10:00:00', '2026-11-16 10:01:59', '1'],
+ 'a day' => ['2026-11-16 10:00:00', '2026-11-17 10:00:00', '1440'],
+ 'the end before the start counts the same' => ['2026-11-16 10:05:00', '2026-11-16 10:00:00', '5'],
+ ];
+ }
+
+ #[DataProvider('lengths')]
+ public function test_an_incident_lasts_in_whole_minutes(string $started, string $until, string $minutes): void
+ {
+ $incident = new Incident(['started_at' => $started]);
+
+ $this->assertSame((int) $minutes, $incident->minutes(Carbon::parse($until)));
+ }
+
+ public function test_a_closed_incident_stops_at_its_resolution(): void
+ {
+ Carbon::setTestNow('2026-11-16 12:00:00');
+ $incident = new Incident(['started_at' => '2026-11-16 10:00:00', 'resolved_at' => '2026-11-16 10:07:30']);
+
+ $this->assertSame(7, $incident->minutes());
+ $this->assertSame(7, $incident->minutes(Carbon::parse('2026-11-16 11:00:00')), 'a later "now" changes nothing');
+ }
+
+ public function test_an_open_incident_runs_up_to_the_given_moment_or_to_now(): void
+ {
+ Carbon::setTestNow('2026-11-16 12:00:00');
+ $incident = new Incident(['started_at' => '2026-11-16 10:00:00']);
+
+ $this->assertSame(120, $incident->minutes());
+ $this->assertSame(30, $incident->minutes(Carbon::parse('2026-11-16 10:30:00')), 'the moment given, not now');
+ }
+
+ public function test_the_duration_is_worded_in_minutes(): void
+ {
+ $incident = new Incident(['started_at' => '2026-11-16 10:00:00', 'resolved_at' => '2026-11-16 10:00:20']);
+ $this->assertSame('0 minutes', $incident->getDurationAttribute());
+
+ $incident->resolved_at = Carbon::parse('2026-11-16 10:01:00');
+ $this->assertSame('1 minute', $incident->getDurationAttribute());
+ $this->assertSame('1 minute', $incident->duration);
+
+ $incident->resolved_at = Carbon::parse('2026-11-16 10:12:00');
+ $this->assertSame('12 minutes', $incident->getDurationAttribute());
+ }
+
+ public function test_an_incident_names_its_check_or_nothing(): void
+ {
+ $check = $this->check(['name' => 'Price list']);
+ $incident = Incident::query()->create(['check_id' => $check->id, 'started_at' => '2026-11-16 10:00:00', 'failures' => 3]);
+
+ $this->assertSame('Price list', $incident->getCheckNameAttribute());
+ $this->assertSame('Price list', $incident->check_name);
+ $this->assertTrue($incident->check->is($check));
+
+ $this->assertSame('', (new Incident(['started_at' => '2026-11-16 10:00:00']))->getCheckNameAttribute());
+ }
+
+ public function test_incident_values_come_back_typed(): void
+ {
+ $incident = new Incident(['check_id' => '5', 'failures' => '3', 'started_at' => '2026-11-16 10:00:00', 'resolved_at' => '2026-11-16 10:05:00']);
+
+ $this->assertSame(5, $incident->check_id);
+ $this->assertSame(3, $incident->failures);
+ $this->assertInstanceOf(Carbon::class, $incident->started_at);
+ $this->assertInstanceOf(Carbon::class, $incident->resolved_at);
+ $this->assertNull((new Incident)->resolved_at);
+ }
+
+ public function test_incidents_are_read_only_and_listed_newest_first(): void
+ {
+ $this->assertFalse(Incident::isCreatableInAdmin());
+ $this->assertFalse(Incident::isEditableInAdmin());
+ // Public as the panel's controller calls them from outside; a protected one would still answer through the model's __callStatic.
+ $this->assertTrue((new ReflectionMethod(Incident::class, 'isCreatableInAdmin'))->isPublic());
+ $this->assertTrue((new ReflectionMethod(Incident::class, 'isEditableInAdmin'))->isPublic());
+ $this->assertSame('Incidents', Incident::getAdminLabel());
+ $this->assertSame('monitoring_incidents', Incident::getAdminRoutePrefix());
+ $this->assertSame('started_at', Incident::getDefaultSortColumn());
+ $this->assertSame('desc', Incident::getDefaultSortDirection());
+ $this->assertSame([], Incident::getAdministrationFields());
+
+ $columns = Incident::getAdministrationListColumns();
+ $this->assertSame(['id', 'check.name', 'started_at', 'resolved_at', 'duration', 'last_error'], array_map(fn ($column) => $column->getName(), $columns));
+ $this->assertSame([true, false, true, true, false, false], array_map(fn ($column) => $column->toArray()['sortable'], $columns));
+ $this->assertSame(['ID', 'Check', 'Started', 'Resolved', 'Duration', 'Last error'], array_map(fn ($column) => $column->toArray()['label'], $columns));
+ }
+
+ public function test_an_address_starts_unknown_active_and_not_a_front_page(): void
+ {
+ $check = $this->check()->fresh();
+
+ $this->assertSame(UptimeCheck::UNKNOWN, $check->status);
+ $this->assertSame(0, $check->failures);
+ $this->assertSame(true, $check->active);
+ $this->assertSame(false, $check->is_home);
+ $this->assertNull($check->last_checked_at);
+ }
+
+ public function test_address_values_come_back_typed(): void
+ {
+ $check = new UptimeCheck;
+ $check->forceFill(['is_home' => 1, 'active' => 0, 'failures' => '2', 'last_status_code' => '503', 'last_response_ms' => '12.5', 'last_checked_at' => '2026-11-16 10:00:00']);
+
+ $this->assertSame(true, $check->is_home);
+ $this->assertSame(false, $check->active);
+ $this->assertSame(2, $check->failures);
+ $this->assertSame(503, $check->last_status_code);
+ $this->assertSame(12.5, $check->last_response_ms);
+ $this->assertInstanceOf(Carbon::class, $check->last_checked_at);
+ }
+
+ public function test_the_status_is_worded(): void
+ {
+ $check = new UptimeCheck;
+
+ foreach ([UptimeCheck::UNKNOWN => 'Not checked yet', UptimeCheck::UP => 'Up', UptimeCheck::FAILING => 'Failing', UptimeCheck::DOWN => 'Down'] as $status => $label) {
+ $check->status = $status;
+
+ $this->assertSame($label, $check->getStatusLabelAttribute());
+ $this->assertSame($label, $check->status_label);
+ }
+ }
+
+ public function test_an_address_finds_its_open_incident(): void
+ {
+ $check = $this->check();
+ $other = $this->check(['name' => 'Other']);
+ $this->assertNull($check->openIncident());
+
+ Incident::query()->create(['check_id' => $check->id, 'started_at' => '2026-11-10 10:00:00', 'resolved_at' => '2026-11-10 11:00:00', 'failures' => 3]);
+ Incident::query()->create(['check_id' => $other->id, 'started_at' => '2026-11-15 10:00:00', 'failures' => 3]);
+ $this->assertNull($check->openIncident(), 'closed ones and other addresses do not count');
+
+ Incident::query()->create(['check_id' => $check->id, 'started_at' => '2026-11-12 10:00:00', 'failures' => 3]);
+ $newer = Incident::query()->create(['check_id' => $check->id, 'started_at' => '2026-11-14 10:00:00', 'failures' => 3]);
+
+ $this->assertTrue($check->openIncident()->is($newer));
+ $this->assertSame(3, $check->incidents()->count());
+ $this->assertSame(1, $other->incidents()->count());
+ }
+
+ public function test_only_a_front_page_cannot_be_deleted(): void
+ {
+ $this->assertFalse($this->check(['is_home' => true])->canDelete());
+ $this->assertTrue($this->check(['is_home' => false])->canDelete());
+ }
+
+ public function test_the_checks_are_listed_oldest_first_and_edited_with_four_fields(): void
+ {
+ $this->assertSame('Uptime checks', UptimeCheck::getAdminLabel());
+ $this->assertSame('uptime_checks', UptimeCheck::getAdminRoutePrefix());
+ $this->assertSame('id', UptimeCheck::getDefaultSortColumn());
+ $this->assertSame('asc', UptimeCheck::getDefaultSortDirection());
+
+ $fields = UptimeCheck::getAdministrationFields();
+ $this->assertSame(['active', 'name', 'url', 'status_label', 'last_error'], array_map(fn ($field) => $field->getName(), $fields));
+ $this->assertTrue($fields[0]->getDefault(), 'a new address is checked at once');
+ $this->assertNull($fields[1]->getDefault());
+
+ $columns = UptimeCheck::getAdministrationListColumns();
+ $this->assertSame(['id', 'name', 'url', 'status_label', 'last_response_ms', 'last_checked_at', 'active'], array_map(fn ($column) => $column->getName(), $columns));
+ $this->assertSame([true, true, false, false, false, true, false], array_map(fn ($column) => $column->toArray()['sortable'], $columns));
+ $this->assertSame([false, true, true, false, false, false, false], array_map(fn ($column) => $column->toArray()['searchable'], $columns));
+ }
+}
diff --git a/packages/monitoring/tests/NotInstalledTest.php b/packages/monitoring/tests/NotInstalledTest.php
new file mode 100644
index 00000000..7998bb6a
--- /dev/null
+++ b/packages/monitoring/tests/NotInstalledTest.php
@@ -0,0 +1,40 @@
+set('atrium.modules', []);
+ }
+
+ public function test_nothing_is_measured_shown_or_scheduled(): void
+ {
+ $this->assertNotContains(CollectMetrics::class, app('router')->getMiddlewareGroups()['web'] ?? []);
+ $this->assertFalse(Route::has('atrium-monitoring.rum'));
+ $this->assertFalse(Route::has('admin.monitoring.index'));
+ $this->assertNotContains(MonitoringGadget::class, (array) config('atrium.dashboard.gadgets'));
+ $this->assertArrayNotHasKey('atrium:monitoring:flush', Artisan::all());
+ $this->assertSame([], app(Schedule::class)->events());
+ // The translations and the config are there for the install screen.
+ $this->assertSame('Monitoring', __('atrium-monitoring::monitoring.title'));
+ $this->assertSame(1.0, config('atrium-monitoring.server.sample_rate'));
+ }
+}
diff --git a/packages/monitoring/tests/NotifierTest.php b/packages/monitoring/tests/NotifierTest.php
new file mode 100644
index 00000000..d425f95b
--- /dev/null
+++ b/packages/monitoring/tests/NotifierTest.php
@@ -0,0 +1,162 @@
+ Carbon::parse('2026-11-16 10:00:00'),
+ 'resolved_at' => Carbon::parse('2026-11-16 10:05:00'),
+ 'failures' => 3,
+ 'last_error' => $error,
+ ]);
+
+ if ($withCheck) {
+ $incident->setRelation('check', (new UptimeCheck)->forceFill(['name' => 'Demo shop', 'url' => 'https://shop.example.test/']));
+ }
+
+ return $incident;
+ }
+
+ public function test_the_alert_says_what_went_down_since_when_and_why(): void
+ {
+ $notifier = app(Notifier::class);
+
+ $this->assertSame([
+ 'subject' => 'Down: Demo shop',
+ 'body' => "https://shop.example.test/ has not answered 3 checks in a row since 2026-11-16 10:00.\nLast error: HTTP 500",
+ ], $notifier->message('opened', $this->incident()));
+ $this->assertSame([
+ 'subject' => 'Back up: Demo shop',
+ 'body' => 'https://shop.example.test/ answers again after 5 minutes.',
+ ], $notifier->message('resolved', $this->incident()));
+ }
+
+ public function test_a_missing_or_empty_error_is_a_dash(): void
+ {
+ $notifier = app(Notifier::class);
+
+ $this->assertStringEndsWith('Last error: —', $notifier->message('opened', $this->incident(null))['body']);
+ $this->assertStringEndsWith('Last error: —', $notifier->message('opened', $this->incident(''))['body']);
+ }
+
+ public function test_an_incident_whose_address_is_gone_is_still_announced(): void
+ {
+ $message = app(Notifier::class)->message('opened', $this->incident('HTTP 500', false));
+
+ $this->assertSame('Down: ', $message['subject']);
+ $this->assertSame(" has not answered 3 checks in a row since 2026-11-16 10:00.\nLast error: HTTP 500", $message['body']);
+ }
+
+ public function test_addresses_are_split_cleaned_and_listed_once_without_gaps(): void
+ {
+ $notifier = app(Notifier::class);
+ $this->assertSame([], $notifier->emails());
+
+ Setting::save('monitoring', ['alert_emails' => "a@example.test, a@example.test\nb@example.test;bad@@x c@example.test,b@example.test"]);
+ $this->assertSame(['a@example.test', 'b@example.test', 'c@example.test'], $notifier->emails());
+
+ Setting::save('monitoring', ['alert_emails' => 12345]);
+ $this->assertSame([], $notifier->emails(), 'a number is not an address');
+
+ Setting::save('monitoring', ['alert_emails' => " \n ,; "]);
+ $this->assertSame([], $notifier->emails());
+ }
+
+ public function test_telegram_parts_are_text_whatever_they_were_stored_as(): void
+ {
+ config(['atrium-monitoring.telegram.token' => 123456, 'atrium-monitoring.telegram.chat_id' => 42]);
+
+ $this->assertSame(['123456', '42'], app(Notifier::class)->telegram());
+
+ config(['atrium-monitoring.telegram.token' => null, 'atrium-monitoring.telegram.chat_id' => null]);
+ Setting::save('monitoring', ['telegram_token' => '777:'.str_repeat('S', 30), 'telegram_chat_id' => 99]);
+ $this->assertSame(['777:'.str_repeat('S', 30), '99'], app(Notifier::class)->telegram());
+ }
+
+ public function test_the_telegram_message_is_one_form_post_to_the_bot(): void
+ {
+ $sent = [];
+ Http::fake(function (Request $request, array $options) use (&$sent) {
+ $sent[] = ['url' => $request->url(), 'data' => $request->data(), 'form' => $request->isForm(), 'method' => $request->method(), 'timeout' => $options['timeout'] ?? null];
+
+ return Http::response(['ok' => true]);
+ });
+ Setting::save('monitoring', ['telegram_token' => '123456:'.str_repeat('A', 30), 'telegram_chat_id' => '-1001234567890']);
+
+ app(Notifier::class)->opened($this->incident());
+
+ $this->assertSame([[
+ 'url' => 'https://api.telegram.org/bot123456:'.str_repeat('A', 30).'/sendMessage',
+ 'data' => [
+ 'chat_id' => '-1001234567890',
+ 'text' => "Down: Demo shop\n\nhttps://shop.example.test/ has not answered 3 checks in a row since 2026-11-16 10:00.\nLast error: HTTP 500",
+ 'disable_web_page_preview' => 'true',
+ ],
+ 'form' => true,
+ 'method' => 'POST',
+ 'timeout' => 10,
+ ]], $sent);
+ }
+
+ public function test_nothing_is_sent_where_nobody_is_listening(): void
+ {
+ Http::fake();
+ Mail::fake();
+
+ app(Notifier::class)->opened($this->incident());
+ app(Notifier::class)->resolved($this->incident());
+
+ Http::assertNothingSent();
+ Mail::assertNothingOutgoing();
+ }
+
+ public function test_a_failed_telegram_alert_is_logged_by_channel_and_kind_of_error_only(): void
+ {
+ Http::fake(['api.telegram.org/*' => Http::response(['ok' => false], 401)]);
+ Setting::save('monitoring', ['telegram_token' => '777:'.str_repeat('S', 30), 'telegram_chat_id' => '42']);
+ Log::spy();
+
+ app(Notifier::class)->resolved($this->incident());
+
+ Log::shouldHaveReceived('warning')->once()->with('Atrium monitoring could not send an alert by telegram: RequestException');
+ }
+
+ public function test_a_failed_mail_does_not_stop_the_telegram_alert(): void
+ {
+ Http::fake(['api.telegram.org/*' => Http::response(['ok' => true])]);
+ Setting::save('monitoring', ['alert_emails' => 'ops@example.test', 'telegram_token' => '777:'.str_repeat('S', 30), 'telegram_chat_id' => '42']);
+ Mail::shouldReceive('raw')->once()->andThrow(new RuntimeException('smtp is down'));
+ Log::spy();
+
+ app(Notifier::class)->opened($this->incident());
+
+ Log::shouldHaveReceived('warning')->once()->with('Atrium monitoring could not send an alert by mail: RuntimeException');
+ Http::assertSentCount(1);
+ }
+}
diff --git a/packages/monitoring/tests/ProviderTest.php b/packages/monitoring/tests/ProviderTest.php
new file mode 100644
index 00000000..eb9a41a0
--- /dev/null
+++ b/packages/monitoring/tests/ProviderTest.php
@@ -0,0 +1,127 @@
+themeViews = sys_get_temp_dir().'/atrium-monitoring-theme-'.getmypid();
+ File::ensureDirectoryExists($this->themeViews);
+ File::put($this->themeViews.'/layout.blade.php', '@stack(\'head\')');
+ View::addNamespace('atrium-theme', $this->themeViews);
+ }
+
+ protected function tearDown(): void
+ {
+ File::deleteDirectory($this->themeViews);
+
+ parent::tearDown();
+ }
+
+ protected function serverOff($app): void
+ {
+ $app['config']->set('atrium-monitoring.server.enabled', false);
+ }
+
+ protected function themeOff($app): void
+ {
+ $app['config']->set('atrium-monitoring.rum.theme', false);
+ }
+
+ protected function rumOff($app): void
+ {
+ $app['config']->set('atrium-monitoring.rum.enabled', false);
+ }
+
+ protected function scheduleOff($app): void
+ {
+ $app['config']->set('atrium-monitoring.schedule', false);
+ }
+
+ /** @return array */
+ private function scheduled(): array
+ {
+ return array_map(static fn ($event): string => preg_replace('/^.*artisan.? /', '', (string) $event->command).' '.$event->expression.' lock '.($event->withoutOverlapping ? $event->expiresAt : 'none'), app(Schedule::class)->events());
+ }
+
+ public function test_an_installed_module_measures_shows_and_schedules(): void
+ {
+ $this->assertContains(CollectMetrics::class, app('router')->getMiddlewareGroups()['web']);
+ $this->assertTrue(Route::has('atrium-monitoring.rum'));
+ $this->assertTrue(Route::has('admin.monitoring.index'));
+ $this->assertContains(MonitoringGadget::class, config('atrium.dashboard.gadgets'));
+ $this->assertArrayHasKey('atrium:monitoring:prune', Artisan::all());
+ $this->assertArrayHasKey('atrium:monitoring:benchmark', Artisan::all());
+ $this->assertSame([
+ 'atrium:monitoring:flush * * * * * lock 10',
+ 'atrium:monitoring:uptime * * * * * lock 5',
+ 'atrium:monitoring:prune 17 3 * * * lock 60',
+ ], $this->scheduled());
+ $this->assertArrayHasKey(MonitoringServiceProvider::class, ServiceProvider::$publishes);
+ }
+
+ public function test_the_theme_layout_gets_the_script(): void
+ {
+ $html = View::make('atrium-theme::layout')->render();
+
+ $this->assertStringContainsString('', $tag);
+ $this->assertLessThan(2048 + 120, strlen($tag));
+ }
+
+ public function test_no_tag_for_visitors_who_opted_out_or_when_switched_off(): void
+ {
+ $dnt = Request::create('/', 'GET', [], [], [], ['HTTP_DNT' => '1']);
+ $gpc = Request::create('/', 'GET', [], [], [], ['HTTP_SEC_GPC' => '1']);
+
+ $this->assertSame('', app(RumScript::class)->tag($dnt));
+ $this->assertSame('', app(RumScript::class)->tag($gpc));
+ $this->assertStringContainsString('data-rate="1"', app(RumScript::class)->tag(Request::create('/')));
+
+ config(['atrium-monitoring.rum.sample_rate' => 0]);
+ $this->assertSame('', app(RumScript::class)->tag(Request::create('/')));
+
+ config(['atrium-monitoring.rum.sample_rate' => 1, 'atrium-monitoring.rum.enabled' => false]);
+ $this->assertSame('', app(RumScript::class)->tag(Request::create('/')));
+ }
+
+ /**
+ * The minified script, run in Node against a fake browser: what it sends
+ * must be a beacon the endpoint accepts.
+ *
+ * @param array $browser
+ */
+ private function runScript(array $browser): ?string
+ {
+ $node = (new ExecutableFinder)->find('node');
+
+ if ($node === null) {
+ $this->markTestSkipped('Node is not installed.');
+ }
+
+ $harness = <<<'JS'
+ const b = JSON.parse(process.argv[1]); let sent = null; const obs = {}; const on = {};
+ global.window = { PerformanceObserver: function (cb) { this.observe = (o) => { obs[o.type] = cb } }, innerWidth: b.width,
+ matchMedia: () => ({ matches: b.coarse }), doNotTrack: null, addEventListener: (t, f) => { on[t] = f } };
+ global.PerformanceObserver = window.PerformanceObserver;
+ global.document = { currentScript: { dataset: { endpoint: '/atrium/rum', rate: b.rate } }, visibilityState: 'visible',
+ addEventListener: (t, f) => { on[t] = f } };
+ global.navigator = { sendBeacon: (u, body) => { sent = body; return true }, doNotTrack: b.dnt, connection: { effectiveType: b.connection } };
+ global.performance = { getEntriesByType: () => b.nav ? [{ responseStart: 380.44, activationStart: 0 }] : [] };
+ global.location = { pathname: '/news/hello' };
+ eval(process.argv[2]);
+ const feed = (t, list) => obs[t] && obs[t]({ getEntries: () => list });
+ feed('paint', [{ name: 'first-paint', startTime: 300 }, { name: 'first-contentful-paint', startTime: 812.36 }]);
+ feed('largest-contentful-paint', [{ startTime: 1500 }, { startTime: 2210.55 }]);
+ feed('layout-shift', [{ startTime: 100, value: 0.05 }, { startTime: 600, value: 0.04 }, { startTime: 900, value: 0.5, hadRecentInput: true }, { startTime: 4000, value: 0.02 }]);
+ feed('event', (b.clicks || []).map((d, i) => ({ interactionId: i + 1, duration: d })));
+ on.pagehide && on.pagehide(); on.pagehide && on.pagehide();
+ process.stdout.write(sent === null ? 'null' : sent);
+ JS;
+
+ $process = new Process([$node, '-e', $harness, json_encode($browser), app(RumScript::class)->source()]);
+ $process->mustRun();
+
+ return $process->getOutput() === 'null' ? null : $process->getOutput();
+ }
+
+ public function test_the_script_sends_a_beacon_the_endpoint_accepts(): void
+ {
+ $body = $this->runScript(['width' => 390, 'coarse' => true, 'rate' => '1', 'dnt' => null, 'connection' => '3g', 'nav' => true, 'clicks' => [48, 120, 64]]);
+
+ $this->assertNotNull($body);
+ $beacon = Beacon::parse($body);
+ ksort($beacon['vitals']);
+ // CLS: the 0.05 + 0.04 burst; the shift after input and the late one do not add to it.
+ $this->assertSame([
+ 'path' => '/news/hello',
+ 'device' => 'mobile',
+ 'connection' => '3g',
+ 'vitals' => ['cls' => 0.09, 'fcp' => 812.4, 'inp' => 120.0, 'lcp' => 2210.6, 'ttfb' => 380.4],
+ ], $beacon);
+ $this->beacon($body)->assertNoContent();
+
+ $tablet = Beacon::parse((string) $this->runScript(['width' => 1024, 'coarse' => true, 'rate' => '1', 'dnt' => null, 'connection' => '5g', 'nav' => true]));
+ $this->assertSame(['tablet', 'unknown'], [$tablet['device'], $tablet['connection']]);
+ $this->assertArrayNotHasKey('inp', $tablet['vitals'], 'no interaction, no INP');
+ $this->assertSame('desktop', Beacon::parse((string) $this->runScript(['width' => 1440, 'coarse' => false, 'rate' => '1', 'dnt' => null, 'connection' => '4g', 'nav' => false]))['device']);
+ }
+
+ public function test_the_script_sends_nothing_with_do_not_track_or_outside_the_sample(): void
+ {
+ $this->assertNull($this->runScript(['width' => 390, 'coarse' => true, 'rate' => '1', 'dnt' => '1', 'connection' => '4g', 'nav' => true]));
+ $this->assertNull($this->runScript(['width' => 390, 'coarse' => true, 'rate' => '0', 'dnt' => null, 'connection' => '4g', 'nav' => true]));
+ }
+
+ public function test_a_folder_site_gets_its_visits_with_the_language_after_the_folder(): void
+ {
+ Language::query()->create(['code' => 'de', 'name' => 'Deutsch', 'active' => true, 'is_default' => false]);
+ $blog = Site::query()->create(['code' => 'blog', 'name' => 'Demo blog', 'domains' => ['localhost'], 'folder' => 'blog', 'active' => true]);
+ app(Sites::class)->flush();
+ app(ContentLanguages::class)->flush();
+
+ $this->beacon('{"p":"/blog/de/post","d":"desktop","v":{"lcp":900}}')->assertNoContent();
+ $this->beacon('{"p":"/blog/post","d":"desktop","v":{"lcp":900}}')->assertNoContent();
+ $this->beacon('{"p":"/de/kontakt","d":"desktop","v":{"lcp":900}}')->assertNoContent();
+ $this->beacon('{"p":"/blogger/de","d":"desktop","v":{"lcp":900}}')->assertNoContent();
+
+ $records = $this->buffered();
+ $this->assertSame([$blog->id, $blog->id, 1, 1], array_column($records, 'site'));
+ $this->assertSame(['de', 'en', 'de', 'en'], array_column($records, 'loc'));
+ }
+
+ protected function tearDown(): void
+ {
+ Carbon::setTestNow();
+
+ parent::tearDown();
+ }
+
+ /** The config as if the key had never been published: only the code's own default is left. */
+ private function forgetConfig(string ...$keys): void
+ {
+ $all = config('atrium-monitoring');
+
+ foreach ($keys as $key) {
+ Arr::forget($all, $key);
+ }
+
+ config(['atrium-monitoring' => $all]);
+ }
+
+ /** A valid beacon of exactly this many bytes. */
+ private function beaconOf(int $bytes): string
+ {
+ $body = '{"p":"/'.str_repeat('a', $bytes - 39).'","d":"desktop","v":{"lcp":900}}';
+ $this->assertSame($bytes, strlen($body));
+
+ return $body;
+ }
+
+ public function test_a_value_on_its_limit_is_accepted_and_one_past_it_is_not(): void
+ {
+ $this->assertSame(['lcp' => 120000.0], Beacon::parse('{"p":"/","d":"desktop","v":{"lcp":120000}}')['vitals']);
+ $this->assertNull(Beacon::parse('{"p":"/","d":"desktop","v":{"lcp":120000.1}}'));
+ $this->assertSame(['cls' => 50.0], Beacon::parse('{"p":"/","d":"desktop","v":{"cls":50}}')['vitals']);
+ $this->assertNull(Beacon::parse('{"p":"/","d":"desktop","v":{"cls":50.5}}'));
+ $this->assertSame(['inp' => 0.0], Beacon::parse('{"p":"/","d":"desktop","v":{"inp":0}}')['vitals']);
+ }
+
+ public function test_an_address_of_2048_characters_is_kept_and_one_more_is_refused(): void
+ {
+ $this->assertSame(255, mb_strlen(Beacon::parse(json_encode(['p' => '/'.str_repeat('a', 2047), 'd' => 'desktop', 'v' => ['ttfb' => 1]]))['path']));
+ $this->assertNull(Beacon::parse(json_encode(['p' => '/'.str_repeat('a', 2048), 'd' => 'desktop', 'v' => ['ttfb' => 1]])));
+ }
+
+ public function test_the_default_body_limit_is_2048_bytes(): void
+ {
+ $this->forgetConfig('rum.max_bytes');
+
+ $this->beacon($this->beaconOf(2048))->assertNoContent();
+ $this->assertCount(1, $this->buffered());
+ $this->beacon($this->beaconOf(2049))->assertStatus(413);
+ $this->assertCount(1, $this->buffered());
+ }
+
+ public function test_the_body_limit_is_inclusive(): void
+ {
+ $body = $this->beaconOf(39);
+
+ config(['atrium-monitoring.rum.max_bytes' => 39]);
+ $this->beacon($body)->assertNoContent();
+
+ config(['atrium-monitoring.rum.max_bytes' => 38]);
+ $this->beacon($body)->assertStatus(413);
+ }
+
+ public function test_a_limit_that_is_not_a_number_refuses_everything(): void
+ {
+ config(['atrium-monitoring.rum.max_bytes' => 'plenty']);
+
+ $this->beacon($this->beaconOf(39))->assertStatus(413);
+ $this->assertSame([], $this->buffered());
+ }
+
+ public function test_the_declared_length_is_checked_as_a_number_and_inclusively(): void
+ {
+ $body = $this->beaconOf(39);
+ config(['atrium-monitoring.rum.max_bytes' => 100]);
+
+ $this->beacon($body, ['Content-Length' => '100'])->assertNoContent();
+ $this->beacon($body, ['Content-Length' => '101'])->assertStatus(413);
+ $this->beacon($body, ['Content-Length' => 'lots'])->assertNoContent();
+ $this->assertCount(2, $this->buffered());
+ }
+
+ public function test_thirty_beacons_a_minute_are_allowed_by_default(): void
+ {
+ $this->forgetConfig('rum.rate_limit');
+ $body = $this->beaconOf(39);
+
+ for ($i = 0; $i < 30; $i++) {
+ $this->beacon($body)->assertNoContent();
+ }
+
+ $this->beacon($body)->assertStatus(429);
+ $this->assertCount(30, $this->buffered());
+ }
+
+ public function test_a_rate_limit_below_one_still_lets_one_beacon_through(): void
+ {
+ $body = $this->beaconOf(39);
+
+ foreach ([0, 1, -4] as $limit) {
+ RateLimiter::clear('atrium-monitoring:rum:'.hash_hmac('sha256', '127.0.0.1', (string) config('app.key')));
+ config(['atrium-monitoring.rum.rate_limit' => $limit]);
+
+ $this->beacon($body)->assertNoContent();
+ $this->beacon($body)->assertStatus(429);
+ }
+ }
+
+ public function test_the_rate_limit_counts_a_minute_under_a_key_of_its_own(): void
+ {
+ config(['atrium-monitoring.rum.rate_limit' => 1]);
+ Carbon::setTestNow('2026-11-17 12:00:00');
+ $body = $this->beaconOf(39);
+
+ $this->beacon($body)->assertNoContent();
+ $this->assertSame(1, RateLimiter::attempts('atrium-monitoring:rum:'.hash_hmac('sha256', '127.0.0.1', (string) config('app.key'))));
+
+ Carbon::setTestNow('2026-11-17 12:00:59');
+ $this->beacon($body)->assertStatus(429);
+
+ Carbon::setTestNow('2026-11-17 12:01:00');
+ $this->beacon($body)->assertNoContent();
+ }
+
+ public function test_the_tag_defaults_to_every_visit_and_ignores_a_rate_that_is_not_a_number(): void
+ {
+ $this->forgetConfig('rum.sample_rate');
+ $this->assertStringContainsString('data-rate="1"', app(RumScript::class)->tag(Request::create('/')));
+
+ config(['atrium-monitoring.rum.sample_rate' => 'often']);
+ $this->assertSame('', app(RumScript::class)->tag(Request::create('/')));
+
+ config(['atrium-monitoring.rum.sample_rate' => 7]);
+ $this->assertStringContainsString('data-rate="1"', app(RumScript::class)->tag(Request::create('/')));
+ }
+
+ public function test_the_script_is_read_once_and_minified_outside_its_strings(): void
+ {
+ $file = tempnam(sys_get_temp_dir(), 'rum');
+ file_put_contents($file, "\n /* header\n comment */\n var url = 'http://example.test/a b' ; // the address\n var sum = a + b , c = 'x = y' ;\n if ( a ) { go( 'two spaces', 1 ) }\n");
+
+ try {
+ $script = new RumScript($file);
+ $expected = "var url='http://example.test/a b';var sum=a+b,c='x = y';if(a){go('two spaces',1)}";
+
+ $this->assertSame($expected, $script->source());
+
+ unlink($file);
+ $this->assertSame($expected, $script->source(), 'read once');
+ } finally {
+ @unlink($file);
+ }
+ }
+}
diff --git a/packages/monitoring/tests/SettingsFieldsTest.php b/packages/monitoring/tests/SettingsFieldsTest.php
new file mode 100644
index 00000000..47ccd4e6
--- /dev/null
+++ b/packages/monitoring/tests/SettingsFieldsTest.php
@@ -0,0 +1,115 @@
+fields()['failures']->getDefault();
+ }
+
+ /** @return array */
+ private function fields(): array
+ {
+ $fields = [];
+
+ foreach ((new MonitoringSettings)->fields() as $field) {
+ $fields[$field->getName()] = $field;
+ }
+
+ return $fields;
+ }
+
+ public function test_the_four_fields_come_in_order(): void
+ {
+ $this->assertSame(['failures', 'alert_emails', 'telegram_token', 'telegram_chat_id'], array_keys($this->fields()));
+ }
+
+ public function test_failures_start_at_what_the_config_says(): void
+ {
+ config(['atrium-monitoring.uptime.failures' => 7]);
+
+ $this->assertSame(7, $this->failuresDefault());
+ }
+
+ public function test_failures_start_at_three_when_the_config_is_silent(): void
+ {
+ $uptime = config('atrium-monitoring.uptime');
+ unset($uptime['failures']);
+ config(['atrium-monitoring.uptime' => $uptime]);
+
+ $this->assertSame(3, $this->failuresDefault());
+ }
+
+ public function test_the_shipped_config_asks_for_three_failures(): void
+ {
+ $this->assertSame(3, $this->failuresDefault());
+ }
+
+ public function test_failures_in_the_config_are_read_as_a_number(): void
+ {
+ config(['atrium-monitoring.uptime.failures' => '5']);
+
+ $this->assertSame(5, $this->failuresDefault());
+ }
+
+ /** @return array */
+ public static function optional(): array
+ {
+ return [
+ 'failures' => ['failures'],
+ 'alert_emails' => ['alert_emails'],
+ 'telegram_token' => ['telegram_token'],
+ 'telegram_chat_id' => ['telegram_chat_id'],
+ ];
+ }
+
+ #[DataProvider('optional')]
+ public function test_every_field_may_be_left_empty(string $field): void
+ {
+ $this->actingAs($this->admin(), 'admin')
+ ->put('/admin/modules/monitoring/settings', [$field => null])
+ ->assertSessionHasNoErrors();
+
+ $this->actingAs($this->admin(), 'admin')
+ ->put('/admin/modules/monitoring/settings', [$field => ''])
+ ->assertSessionHasNoErrors();
+
+ $this->assertSame($field === 'failures' ? 3 : null, Setting::get('monitoring.'.$field));
+ }
+
+ /** @return array */
+ public static function notText(): array
+ {
+ return [
+ 'emails as a list' => ['alert_emails', ['ops@example.com']],
+ 'emails as a number' => ['alert_emails', 5],
+ 'chat as a number' => ['telegram_chat_id', 123456789],
+ 'token as a list' => ['telegram_token', ['123456:'.str_repeat('a', 20)]],
+ 'token as a number' => ['telegram_token', 123456],
+ ];
+ }
+
+ #[DataProvider('notText')]
+ public function test_the_text_fields_refuse_what_is_not_text(string $field, mixed $value): void
+ {
+ $this->actingAs($this->admin(), 'admin')
+ ->put('/admin/modules/monitoring/settings', [$field => $value])
+ ->assertSessionHasErrors($field);
+
+ $this->assertNull(Setting::get('monitoring.'.$field));
+ }
+}
diff --git a/packages/monitoring/tests/SettingsTest.php b/packages/monitoring/tests/SettingsTest.php
new file mode 100644
index 00000000..65d21478
--- /dev/null
+++ b/packages/monitoring/tests/SettingsTest.php
@@ -0,0 +1,73 @@
+actingAs($this->admin(), 'admin')
+ ->get('/admin/modules/monitoring/settings')
+ ->assertOk()
+ ->assertSee('Telegram')
+ ->assertSee(json_encode(__('atrium-monitoring::monitoring.settings.description'), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES), false);
+ }
+
+ /** @return array */
+ public static function values(): array
+ {
+ return [
+ 'failures: one' => ['failures', 1, true],
+ 'failures: an hour of minutes' => ['failures', 60, true],
+ 'failures: empty means the default' => ['failures', '', true],
+ 'failures: zero' => ['failures', 0, false],
+ 'failures: too many' => ['failures', 61, false],
+ 'failures: not a number' => ['failures', 'three', false],
+ 'failures: a fraction' => ['failures', 2.5, false],
+ 'emails: two' => ['alert_emails', "ops@example.com\nlead@example.org", true],
+ 'emails: too long' => ['alert_emails', str_repeat('a', 2001), false],
+ 'token: a bot token' => ['telegram_token', '123456:'.str_repeat('Ab_-', 6), true],
+ 'token: no number' => ['telegram_token', 'bot:'.str_repeat('a', 24), false],
+ 'token: too short' => ['telegram_token', '123:abc', false],
+ 'token: with spaces' => ['telegram_token', '123456:'.str_repeat('a', 20).' x', false],
+ 'chat: a person' => ['telegram_chat_id', '123456789', true],
+ 'chat: a group' => ['telegram_chat_id', '-1001234567890', true],
+ 'chat: a channel' => ['telegram_chat_id', '@demo_alerts', true],
+ 'chat: a short name' => ['telegram_chat_id', '@abc', false],
+ 'chat: a link' => ['telegram_chat_id', 'https://t.me/demo', false],
+ ];
+ }
+
+ #[DataProvider('values')]
+ public function test_each_field_keeps_what_is_right_and_refuses_the_rest(string $field, mixed $value, bool $valid): void
+ {
+ // An unset number reads back as the configured default.
+ $default = $field === 'failures' ? 3 : null;
+ $response = $this->actingAs($this->admin(), 'admin')->put('/admin/modules/monitoring/settings', [$field => $value]);
+
+ if ($valid) {
+ $response->assertSessionHasNoErrors();
+ $this->assertEquals($value === '' ? $default : $value, Setting::get('monitoring.'.$field));
+ } else {
+ $response->assertSessionHasErrors($field);
+ $this->assertSame($default, Setting::get('monitoring.'.$field));
+ }
+ }
+
+ public function test_only_a_superadmin_changes_them(): void
+ {
+ $this->actingAs($this->admin(false), 'admin')->get('/admin/modules/monitoring/settings')->assertForbidden();
+ $this->actingAs($this->admin(false), 'admin')->put('/admin/modules/monitoring/settings', ['failures' => 5])->assertForbidden();
+ $this->assertSame(3, Setting::get('monitoring.failures'));
+ }
+}
diff --git a/packages/monitoring/tests/SqlNormalizerTest.php b/packages/monitoring/tests/SqlNormalizerTest.php
new file mode 100644
index 00000000..f916bf8b
--- /dev/null
+++ b/packages/monitoring/tests/SqlNormalizerTest.php
@@ -0,0 +1,59 @@
+ */
+ public static function queries(): array
+ {
+ return [
+ 'bindings stay' => ['select * from "users" where "id" = ?', 'select * from "users" where "id" = ?'],
+ 'string literal' => ["select * from users where email = 'anna@example.com'", 'select * from users where email = ?'],
+ 'escaped quotes' => ["select 'it''s', 'a\\'b' from t", 'select ?, ... from t'],
+ 'numbers and lists' => ['select * from t where id in (1, 2, 3, 4) limit 10 offset -5', 'select * from t where id in (?, ...) limit ? offset ?'],
+ 'decimals' => ['update t set price = 12.50 where id = 3', 'update t set price = ? where id = ?'],
+ 'identifiers with digits stay' => ['select col2, t1.x3 from table_2024 as t1', 'select col2, t1.x3 from table_2024 as t1'],
+ 'placeholders of a list' => ['insert into t (a, b) values (?, ?), (?, ?)', 'insert into t (a, b) values (?, ...), (?, ...)'],
+ 'whitespace' => ["select\n\t*\n from t", 'select * from t'],
+ 'whitespace around' => ["\n select 1 \t", 'select ?'],
+ 'postgres positional' => ['select * from t where a = $1', 'select * from t where a = $1'],
+ ];
+ }
+
+ #[DataProvider('queries')]
+ public function test_values_are_taken_out(string $sql, string $expected): void
+ {
+ $this->assertSame($expected, SqlNormalizer::normalize($sql));
+ }
+
+ public function test_long_queries_are_cut_and_hashes_depend_on_the_connection(): void
+ {
+ $this->assertSame(SqlNormalizer::MAX_LENGTH, mb_strlen(SqlNormalizer::normalize('select '.str_repeat('abc, ', 2000))));
+ $this->assertSame(40, strlen(SqlNormalizer::hash('select ?')));
+ $this->assertSame(sha1("mysql\nselect ?"), SqlNormalizer::hash('select ?', 'mysql'));
+ $this->assertSame(sha1("\nselect ?"), SqlNormalizer::hash('select ?'));
+ $this->assertNotSame(SqlNormalizer::hash('a', 'bc'), SqlNormalizer::hash('ab', 'c'), 'the connection and the query do not run together');
+ $this->assertNotSame(SqlNormalizer::hash('select ?', 'mysql'), SqlNormalizer::hash('select ?', 'pgsql'));
+ $this->assertSame(SqlNormalizer::hash('select ?', 'mysql'), SqlNormalizer::hash('select ?', 'mysql'));
+ }
+
+ public function test_the_cut_counts_characters_not_bytes(): void
+ {
+ $normalized = SqlNormalizer::normalize('select '.str_repeat('é', 4100));
+
+ $this->assertSame('select '.str_repeat('é', SqlNormalizer::MAX_LENGTH - 7), $normalized);
+ $this->assertSame(SqlNormalizer::MAX_LENGTH, mb_strlen($normalized));
+ }
+}
diff --git a/packages/monitoring/tests/SvgChartTest.php b/packages/monitoring/tests/SvgChartTest.php
new file mode 100644
index 00000000..b8aa84a1
--- /dev/null
+++ b/packages/monitoring/tests/SvgChartTest.php
@@ -0,0 +1,325 @@
+ */
+ public static function tops(): array
+ {
+ return [
+ 'zero' => [0.0, 1.0],
+ 'negative' => [-5.0, 1.0],
+ 'exactly a power of ten' => [100.0, 100.0],
+ 'just over' => [101.0, 200.0],
+ 'two' => [180.0, 200.0],
+ 'two and a half' => [240.0, 250.0],
+ 'five' => [260.0, 500.0],
+ 'ten' => [501.0, 1000.0],
+ 'just under the next power' => [999.0, 1000.0],
+ 'small' => [0.07, 0.1],
+ 'a CLS score' => [0.23, 0.25],
+ ];
+ }
+
+ #[DataProvider('tops')]
+ public function test_the_axis_ends_on_a_round_number(float $value, float $top): void
+ {
+ $this->assertEqualsWithDelta($top, SvgChart::niceMax($value), 1e-9);
+ }
+
+ public function test_each_line_is_told_apart_without_colour(): void
+ {
+ $points = [
+ ['label' => 'Mon', 'p50' => 100.0, 'p75' => 150.0, 'p95' => 400.0],
+ ['label' => 'Tue', 'p50' => 120.0, 'p75' => 180.0, 'p95' => 380.0],
+ ['label' => 'Wed'],
+ ['label' => 'Thu', 'p50' => 90.0, 'p75' => 140.0, 'p95' => 300.0],
+ ];
+
+ $svg = SvgChart::render('Response ', $points, fn (float $v): string => round($v).' ms');
+
+ $this->assertStringStartsWith('assertStringEndsWith(' ', $svg);
+ $this->assertStringContainsString('assertStringContainsString('stroke-dasharray="2 4"', $svg);
+ $this->assertSame(1, substr_count($svg, 'stroke-dasharray="'.'7 4"'));
+ foreach (['p50', 'p75', 'p95'] as $name) {
+ $this->assertMatchesRegularExpression('~'.$name.' ~', $svg);
+ }
+ // The gap on Wednesday breaks the line instead of joining over it.
+ $this->assertSame(2, preg_match_all('~ M~', ' '.preg_replace('~.*.*?d="([^"]+)".*~s', '$1', $svg)));
+ $this->assertStringContainsString('p95 Thu: 300 ms ', $svg);
+ // The axis: 0 to 500 in four steps, the days below.
+ foreach (['0 ms', '125 ms', '250 ms', '375 ms', '500 ms', '>Mon<', '>Thu<'] as $text) {
+ $this->assertStringContainsString($text, $svg);
+ }
+ }
+
+ public function test_the_points_are_placed_by_value(): void
+ {
+ $svg = SvgChart::render('One', [['label' => 'A', 'p50' => 0.0], ['label' => 'B', 'p50' => 10.0]], fn (float $v): string => (string) $v, ['p50']);
+
+ // Plot from x 64 to 664 and y 220 (zero) to 16 (top).
+ $this->assertStringContainsString('d="M64 220 L664 16"', $svg);
+ $this->assertStringContainsString('', $svg);
+ $this->assertStringNotContainsString('p75', $svg);
+ }
+
+ public function test_one_point_sits_in_the_middle(): void
+ {
+ $svg = SvgChart::render('One', [['label' => 'Today', 'p50' => 5.0]], fn (float $v): string => (string) $v, ['p50']);
+
+ $this->assertStringContainsString('', $svg);
+ }
+
+ public function test_long_periods_label_every_few_points_and_the_last(): void
+ {
+ $points = array_map(fn (int $i): array => ['label' => 'd'.$i, 'p50' => 1.0], range(1, 30));
+ $svg = SvgChart::render('Month', $points, fn (float $v): string => (string) $v, ['p50']);
+
+ $labels = [];
+ preg_match_all('~text-anchor="middle">(d\d+)~', $svg, $labels);
+ $this->assertSame(['d1', 'd5', 'd9', 'd13', 'd17', 'd21', 'd25', 'd30'], $labels[1]);
+ }
+
+ public function test_no_data_says_so(): void
+ {
+ $svg = SvgChart::render('Empty', [['label' => 'Mon'], ['label' => 'Tue']], fn (float $v): string => (string) $v);
+
+ $this->assertStringStartsWith('assertStringEndsWith('No data yet ', $svg);
+ $this->assertStringNotContainsString('No data yet', SvgChart::render('Nothing', [], fn (float $v): string => (string) $v));
+ }
+
+ public function test_an_unknown_series_gets_circles_and_a_solid_line(): void
+ {
+ $svg = SvgChart::render('Other', [['label' => 'A', 'p99' => 3.0], ['label' => 'B', 'p99' => 4.0]], fn (float $v): string => (string) $v, ['p99']);
+
+ $this->assertSame(2, substr_count($svg, 'assertStringNotContainsString('stroke-dasharray', $svg);
+ }
+
+ /** @return array}> points => the ones labelled, by position */
+ public static function axisLabels(): array
+ {
+ return [
+ 'one' => [1, [0]],
+ 'two' => [2, [0, 1]],
+ 'eight, every one' => [8, [0, 1, 2, 3, 4, 5, 6, 7]],
+ 'nine, every second, the last falls on the step' => [9, [0, 2, 4, 6, 8]],
+ 'ten, the one before the last gives way' => [10, [0, 2, 4, 6, 9]],
+ 'sixteen' => [16, [0, 2, 4, 6, 8, 10, 12, 15]],
+ 'seventeen, every third' => [17, [0, 3, 6, 9, 12, 16]],
+ 'twenty-four' => [24, [0, 3, 6, 9, 12, 15, 18, 23]],
+ 'twenty-five, every fourth' => [25, [0, 4, 8, 12, 16, 20, 24]],
+ ];
+ }
+
+ /** @param list $shown */
+ #[DataProvider('axisLabels')]
+ public function test_the_time_axis_has_at_most_eight_labels(int $count, array $shown): void
+ {
+ $points = array_map(fn (int $i): array => ['label' => 'd'.$i, 'p50' => 1.0], range(0, $count - 1));
+ $svg = SvgChart::render('Axis', $points, fn (float $v): string => (string) $v, ['p50']);
+
+ $labels = [];
+ preg_match_all('~(d\d+) ~', $svg, $labels);
+ $this->assertSame(array_map(fn (int $i): string => 'd'.$i, $shown), $labels[1]);
+ }
+
+ public function test_the_whole_chart_is_drawn_as_the_panel_expects(): void
+ {
+ $points = [
+ ['label' => 'Mon', 'p50' => 100.0, 'p75' => 150.0, 'p95' => 400.0],
+ ['label' => 'Tue ', 'p50' => 120.5, 'p75' => 180.25, 'p95' => 380.0],
+ ['label' => 'Wed', 'p50' => null],
+ ['label' => 'Thu', 'p50' => 90.0, 'p75' => 140.0, 'p95' => 333.0],
+ ['p50' => 95.0],
+ ];
+
+ $svg = SvgChart::render('Time & "load"', $points, fn (float $v): string => round($v, 1).' ms');
+
+ $this->assertSame(implode('', [
+ '',
+ 'Time & "load" ',
+ 'Mon: p50 100 ms, p75 150 ms, p95 400 ms; Tue<br>: p50 120.5 ms, p75 180.3 ms, p95 380 ms; Thu: p50 90 ms, p75 140 ms, p95 333 ms; : p50 95 ms ',
+ '0 ms ',
+ '125 ms ',
+ '250 ms ',
+ '375 ms ',
+ '500 ms ',
+ 'Mon ',
+ 'Tue<br> ',
+ 'Wed ',
+ 'Thu ',
+ ' ',
+ ' ',
+ 'p50 Mon: 100 ms ',
+ 'p50 Tue<br>: 120.5 ms ',
+ 'p50 Thu: 90 ms ',
+ 'p50 : 95 ms ',
+ 'p50 ',
+ ' ',
+ 'p75 Mon: 150 ms ',
+ 'p75 Tue<br>: 180.3 ms ',
+ 'p75 Thu: 140 ms ',
+ 'p75 ',
+ ' ',
+ 'p95 Mon: 400 ms ',
+ 'p95 Tue<br>: 380 ms ',
+ 'p95 Thu: 333 ms ',
+ 'p95 ',
+ ' ',
+ ]), str_replace('cID', 'ID', preg_replace('~c[0-9a-f]{8}-~', 'ID-', $svg)));
+ }
+
+ public function test_the_ids_tie_the_chart_to_its_title_and_data(): void
+ {
+ $points = [['label' => 'A', 'p50' => 1.0]];
+ $svg = SvgChart::render('Response', $points, fn (float $v): string => (string) $v, ['p50']);
+
+ $this->assertSame(1, preg_match('~aria-labelledby="(c[0-9a-f]{8})-t \\1-d"~', $svg, $m));
+ $this->assertSame('c'.substr(md5('Response[{"label":"A","p50":1}]'), 0, 8), $m[1]);
+ $this->assertStringContainsString('Response A: p50 1 ', $svg);
+ $this->assertNotSame($m[1], $this->idOf(SvgChart::render('Other', $points, fn (float $v): string => (string) $v, ['p50'])));
+ $this->assertNotSame($m[1], $this->idOf(SvgChart::render('Response', [['label' => 'A', 'p50' => 2.0]], fn (float $v): string => (string) $v, ['p50'])));
+ }
+
+ private function idOf(string $svg): string
+ {
+ preg_match('~aria-labelledby="(c[0-9a-f]{8})-t~', $svg, $m);
+
+ return $m[1];
+ }
+
+ public function test_series_without_values_get_a_group_but_no_name(): void
+ {
+ $svg = SvgChart::render('Gaps', [['label' => 'A', 'p50' => 4.0]], fn (float $v): string => (string) $v, ['p50', 'p75']);
+
+ $this->assertStringContainsString(' ', $svg);
+ $this->assertSame(1, substr_count($svg, ' 'A', 'p50' => 4.0, 'p75' => 5.0, 'p95' => 6.0, 'p99' => 7.0]], fn (float $v): string => (string) $v);
+
+ preg_match_all('~~', $svg, $groups);
+ $this->assertSame(['p50', 'p75', 'p95'], $groups[1]);
+ $this->assertStringNotContainsString('p99', $svg);
+ }
+
+ public function test_the_axis_follows_the_top_of_small_values(): void
+ {
+ $svg = SvgChart::render('Small', [['label' => 'A', 'p50' => 0.23]], fn (float $v): string => (string) $v, ['p50']);
+
+ foreach (['0', '0.0625', '0.125', '0.1875', '0.25'] as $label) {
+ $this->assertStringContainsString('text-anchor="end">'.$label.' ', $svg);
+ }
+
+ // 0.23 of 0.25 of a 204 high plot, from the bottom at 220.
+ $this->assertStringContainsString('', $svg);
+ }
+
+ public function test_values_that_arrive_as_text_are_read_as_numbers(): void
+ {
+ $numbers = SvgChart::render('Text', [['label' => 'A', 'p50' => 100.0], ['label' => 'B', 'p50' => 250.5]], fn (float $v): string => (string) $v, ['p50']);
+ $text = SvgChart::render('Text', [['label' => 'A', 'p50' => '100'], ['label' => 'B', 'p50' => '250.5']], fn (float $v): string => (string) $v, ['p50']);
+
+ $this->assertSame(preg_replace('~c[0-9a-f]{8}~', 'ID', $numbers), preg_replace('~c[0-9a-f]{8}~', 'ID', $text));
+ }
+
+ public function test_a_flat_zero_line_sits_on_the_bottom_of_the_plot(): void
+ {
+ $svg = SvgChart::render('Zero', [['label' => 'A', 'p50' => 0.0], ['label' => 'B', 'p50' => 0.0]], fn (float $v): string => (string) $v, ['p50']);
+
+ $this->assertStringContainsString('d="M64 220 L664 220"', $svg);
+ $this->assertStringContainsString('text-anchor="end">1', $svg);
+ }
+
+ /** @return array series => [x, y] of its name at the end of the line */
+ private function names(string $svg): array
+ {
+ preg_match_all('~(p\d+) ~', $svg, $found, PREG_SET_ORDER);
+
+ return array_column(array_map(fn (array $f): array => [$f[3], [$f[1], $f[2]]], $found), 1, 0);
+ }
+
+ public function test_names_at_the_line_ends_are_stacked_when_the_lines_end_together(): void
+ {
+ $svg = SvgChart::render('Equal', [['label' => 'A', 'p50' => 5.0, 'p75' => 5.0, 'p95' => 5.0]], fn (float $v): string => (string) $v);
+
+ // One line of text (12) apart, in the order of the series.
+ $this->assertSame(['p50' => ['374', '20'], 'p75' => ['374', '32'], 'p95' => ['374', '44']], $this->names($svg));
+ $this->assertSame(1, preg_match('~.*?y="20">p50 .*?y="32">p75 .*?y="44">p95 $~', $svg));
+ }
+
+ public function test_names_of_close_lines_keep_the_order_of_the_lines_not_of_the_series(): void
+ {
+ // Ends at 16 (p95), 18 (p50) and 20.1 (p75): the highest value is on top.
+ $svg = SvgChart::render('Close', [['label' => 'A', 'p50' => 495.0, 'p75' => 490.0, 'p95' => 500.0]], fn (float $v): string => (string) $v);
+
+ $this->assertStringContainsString('', $svg);
+ $this->assertStringContainsString('', $svg);
+ $this->assertStringContainsString('', $svg);
+
+ $this->assertSame(['p50' => ['374', '32'], 'p75' => ['374', '44'], 'p95' => ['374', '20']], $this->names($svg));
+ }
+
+ public function test_names_of_lines_far_enough_apart_stay_where_they_are(): void
+ {
+ $svg = SvgChart::render('Apart', [['label' => 'A', 'p50' => 100.0, 'p75' => 470.6, 'p95' => 500.0]], fn (float $v): string => (string) $v);
+
+ // 28 and 16: exactly a line of text apart; 179.2 is far below.
+ $this->assertSame(['p50' => ['374', '183.2'], 'p75' => ['374', '32'], 'p95' => ['374', '20']], $this->names($svg));
+ }
+
+ public function test_only_lines_that_end_near_each_other_are_moved(): void
+ {
+ $svg = SvgChart::render('Mixed', [['label' => 'A', 'p50' => 500.0, 'p75' => 500.0, 'p95' => 100.0]], fn (float $v): string => (string) $v);
+
+ $this->assertSame(['p50' => ['374', '20'], 'p75' => ['374', '32'], 'p95' => ['374', '183.2']], $this->names($svg));
+ }
+
+ public function test_a_line_without_values_takes_no_room_for_its_name(): void
+ {
+ $svg = SvgChart::render('Gap', [['label' => 'A', 'p50' => 5.0, 'p95' => 5.0]], fn (float $v): string => (string) $v);
+
+ $this->assertSame(['p50' => ['374', '20'], 'p95' => ['374', '32']], $this->names($svg));
+ }
+
+ public function test_no_two_time_labels_run_together(): void
+ {
+ $points = array_map(fn (int $i): array => ['label' => 'd'.$i, 'p50' => 1.0], range(1, 30));
+ $svg = SvgChart::render('Month', $points, fn (float $v): string => (string) $v, ['p50']);
+
+ preg_match_all('~~', $svg, $found);
+ $xs = array_map('floatval', $found[1]);
+ $gaps = array_map(fn (float $a, float $b): float => $b - $a, array_slice($xs, 0, -1), array_slice($xs, 1));
+
+ // Every fourth of 29 steps of 600/29 apart, the last 5 steps after the one before.
+ $this->assertSame([64.0, 146.8, 229.5, 312.3, 395.0, 477.8, 560.6, 664.0], $xs);
+ $this->assertStringContainsString('', $svg);
+ $this->assertStringContainsString('', $svg);
+ $this->assertGreaterThanOrEqual(4 * 600 / 29 - 0.1, min($gaps));
+ }
+}
diff --git a/packages/monitoring/tests/TestCase.php b/packages/monitoring/tests/TestCase.php
new file mode 100644
index 00000000..febfb9ed
--- /dev/null
+++ b/packages/monitoring/tests/TestCase.php
@@ -0,0 +1,89 @@
+set('app.key', 'base64:'.base64_encode(str_repeat('a', 32)));
+ $config->set('app.name', 'Demo site');
+ $config->set('app.url', 'http://localhost');
+ // CI runs the suite against MySQL and PostgreSQL too.
+ $target = env('DB_CONNECTION');
+ $config->set('database.default', in_array($target, ['mysql', 'pgsql'], true) ? $target : 'testing');
+ $config->set('atrium.demo', false);
+ $config->set('atrium.auth.two_factor.enabled', false);
+ $config->set('atrium.dashboard.timings.enabled', false);
+ // Installed, as atrium:module:install leaves it.
+ $config->set('atrium.modules', [MonitoringServiceProvider::MODULE]);
+
+ $this->bufferPath = sys_get_temp_dir().'/atrium-monitoring-test-'.getmypid();
+ $config->set('atrium-monitoring.buffer.path', $this->bufferPath);
+ $config->set('atrium-monitoring.server.sample_rate', 1.0);
+ $config->set('atrium-monitoring.rum.sample_rate', 1.0);
+ $config->set('atrium-monitoring.telegram.token', null);
+ $config->set('atrium-monitoring.telegram.chat_id', null);
+ }
+
+ protected function setUp(): void
+ {
+ parent::setUp();
+
+ $this->withoutVite();
+ Http::preventStrayRequests();
+ }
+
+ protected function tearDown(): void
+ {
+ File::deleteDirectory($this->bufferPath);
+
+ parent::tearDown();
+ }
+
+ protected function admin(bool $super = true): AdminUser
+ {
+ $admin = AdminUser::query()->create([
+ 'name' => 'Admin',
+ 'email' => 'admin'.random_int(1, 1_000_000).'@example.com',
+ 'password' => 'secret-password',
+ 'is_active' => true,
+ ]);
+
+ $admin->forceFill(['is_superadmin' => $super])->save();
+
+ return $admin;
+ }
+}
diff --git a/packages/monitoring/tests/UptimeCheckerTest.php b/packages/monitoring/tests/UptimeCheckerTest.php
new file mode 100644
index 00000000..4b894fc3
--- /dev/null
+++ b/packages/monitoring/tests/UptimeCheckerTest.php
@@ -0,0 +1,403 @@
+forceFill($attributes + ['site_id' => null, 'name' => 'Demo shop', 'url' => 'https://shop.example.test/', 'active' => true])->save();
+
+ return $check;
+ }
+
+ /** A setting of the uptime checks; null removes it, as if the config never had it. */
+ private function uptimeSetting(string $key, mixed $value): void
+ {
+ $uptime = (array) config('atrium-monitoring.uptime');
+
+ if ($value === null) {
+ unset($uptime[$key]);
+ } else {
+ $uptime[$key] = $value;
+ }
+
+ config(['atrium-monitoring.uptime' => $uptime]);
+ }
+
+ /** @return ArrayObject how many addresses each pool opened, filled as they run */
+ private function watchPools(): ArrayObject
+ {
+ $sizes = new ArrayObject;
+ $real = Http::getFacadeRoot();
+ Http::swap(new class($real, $sizes)
+ {
+ /** @param ArrayObject $sizes */
+ public function __construct(private readonly object $real, private readonly ArrayObject $sizes) {}
+
+ /** @param array $arguments */
+ public function __call(string $method, array $arguments): mixed
+ {
+ if ($method !== 'pool') {
+ return $this->real->$method(...$arguments);
+ }
+
+ return $this->real->pool(function (Pool $pool) use ($arguments): array {
+ $requests = $arguments[0]($pool);
+ $this->sizes->append(count($requests));
+
+ return $requests;
+ });
+ }
+ });
+
+ return $sizes;
+ }
+
+ /**
+ * Laravel's fake reports a transfer without timings right after the stub
+ * answers; the stats of a real transfer arrive when the promise is chained
+ * on, so the stub's promise reports them then.
+ */
+ private function answerWithStats(PsrResponse $response, Request $request, callable $onStats, mixed $total): FulfilledPromise
+ {
+ return new class($response, $request, $onStats, $total) extends FulfilledPromise
+ {
+ private bool $reported = false;
+
+ public function __construct(private readonly PsrResponse $response, private readonly Request $request, private $onStats, private readonly mixed $total)
+ {
+ parent::__construct($response);
+ }
+
+ public function then(?callable $onFulfilled = null, ?callable $onRejected = null): PromiseInterface
+ {
+ if (! $this->reported && $this->total !== null) {
+ $this->reported = true;
+ ($this->onStats)(new TransferStats($this->request->toPsrRequest(), $this->response, 0.1, null, ['total_time' => $this->total]));
+ }
+
+ return parent::then($onFulfilled, $onRejected);
+ }
+ };
+ }
+
+ // ---- home addresses -------------------------------------------------
+
+ /** @return array,2:?string,3:?string,4:string}> */
+ public static function homes(): array
+ {
+ return [
+ // app.url, domains, folder, scheme setting => address
+ 'the application itself' => ['http://localhost', [], null, null, 'http://localhost/'],
+ 'a trailing slash is not doubled' => ['http://localhost/', [], null, null, 'http://localhost/'],
+ 'a folder, slashes and all' => ['http://localhost/', [], '/blog/', null, 'http://localhost/blog/'],
+ 'a folder without slashes' => ['http://localhost', [], 'blog', null, 'http://localhost/blog/'],
+ 'another domain is https' => ['http://localhost', ['shop.example.test'], null, null, 'https://shop.example.test/'],
+ 'another domain follows the setting' => ['http://localhost', ['shop.example.test'], null, 'http', 'http://shop.example.test/'],
+ 'the first domain counts' => ['http://localhost', ['shop.example.test', 'www.shop.example.test'], null, null, 'https://shop.example.test/'],
+ 'the application domain keeps its scheme' => ['http://localhost', ['localhost'], null, 'https', 'http://localhost/'],
+ 'a domain and a folder' => ['https://app.example.test', ['shop.example.test'], '/de/', null, 'https://shop.example.test/de/'],
+ ];
+ }
+
+ /** @param array $domains */
+ #[DataProvider('homes')]
+ public function test_the_address_of_a_front_page(string $app, array $domains, ?string $folder, ?string $scheme, string $expected): void
+ {
+ config(['app.url' => $app]);
+ $this->uptimeSetting('scheme', $scheme);
+ $site = (new Site)->forceFill(['code' => 'x', 'name' => 'X', 'domains' => $domains, 'folder' => $folder]);
+
+ $this->assertSame($expected, app(UptimeChecker::class)->homeUrl($site));
+ }
+
+ public function test_a_site_added_since_the_last_look_gets_its_check(): void
+ {
+ $checker = app(UptimeChecker::class);
+ $checker->syncHomes();
+ $this->assertSame(['http://localhost/'], UptimeCheck::query()->withoutGlobalScopes()->pluck('url')->all());
+
+ // Written without the model's events, which would flush the list of sites themselves.
+ Site::query()->insert(['code' => 'shop', 'name' => 'Demo shop', 'domains' => json_encode(['shop.example.test']), 'active' => true, 'created_at' => now(), 'updated_at' => now()]);
+ $this->assertCount(1, app(Sites::class)->all(), 'the list of sites is stale until the checker flushes it');
+ // No flush here: the checker takes a fresh list of sites itself.
+ $checker->syncHomes();
+
+ $this->assertSame(['http://localhost/', 'https://shop.example.test/'], UptimeCheck::query()->withoutGlobalScopes()->orderBy('id')->pluck('url')->all());
+ }
+
+ // ---- batches and timeouts -------------------------------------------
+
+ /** @return array}> */
+ public static function batches(): array
+ {
+ return [
+ // concurrency setting, addresses => pools
+ 'ten by default' => [null, 11, [10, 1]],
+ 'as set' => [3, 7, [3, 3, 1]],
+ 'one' => [1, 2, [1, 1]],
+ 'two' => [2, 3, [2, 1]],
+ 'zero is one' => [0, 2, [1, 1]],
+ 'negative is one' => [-5, 2, [1, 1]],
+ 'text' => ['4', 5, [4, 1]],
+ 'fewer than a batch' => [10, 3, [3]],
+ ];
+ }
+
+ #[DataProvider('batches')]
+ public function test_addresses_are_opened_in_batches(mixed $concurrency, int $addresses, array $expected): void
+ {
+ $this->uptimeSetting('concurrency', $concurrency);
+ for ($i = 1; $i <= $addresses; $i++) {
+ $this->check(['name' => 'Site '.$i, 'url' => 'https://s'.$i.'.example.test/']);
+ }
+ Http::fake(['*' => Http::response('ok')]);
+ $sizes = $this->watchPools();
+
+ $this->assertSame($addresses, app(UptimeChecker::class)->run());
+
+ $this->assertSame($expected, $sizes->getArrayCopy());
+ }
+
+ public function test_nothing_to_check_opens_nothing(): void
+ {
+ Http::fake();
+ $sizes = $this->watchPools();
+
+ $this->assertSame(0, app(UptimeChecker::class)->run());
+ $this->assertSame([], $sizes->getArrayCopy());
+ }
+
+ /** @return array */
+ public static function timeouts(): array
+ {
+ return [
+ 'ten by default' => [null, 10],
+ 'as set' => [25, 25],
+ 'one second' => [1, 1],
+ 'zero is one' => [0, 1],
+ 'negative is one' => [-3, 1],
+ 'text' => ['7', 7],
+ ];
+ }
+
+ #[DataProvider('timeouts')]
+ public function test_every_address_gets_the_same_timeout_for_connecting_and_waiting(mixed $setting, int $seconds): void
+ {
+ $this->uptimeSetting('timeout', $setting);
+ $this->check();
+ $options = [];
+ Http::fake(function (Request $request, array $given) use (&$options) {
+ $options[] = [$given['timeout'] ?? null, $given['connect_timeout'] ?? null];
+
+ return Http::response('ok');
+ });
+
+ app(UptimeChecker::class)->run();
+
+ $this->assertSame([[$seconds, $seconds]], $options);
+ }
+
+ public function test_the_address_and_the_user_agent_are_sent(): void
+ {
+ $this->check(['url' => 'https://shop.example.test/health']);
+ $sent = [];
+ Http::fake(function (Request $request) use (&$sent) {
+ $sent[] = [$request->method(), $request->url(), $request->header('User-Agent')];
+
+ return Http::response('ok');
+ });
+
+ app(UptimeChecker::class)->run();
+
+ $this->assertSame([['GET', 'https://shop.example.test/health', ['AtriumMonitoring/1.0 (+uptime)']]], $sent);
+ }
+
+ // ---- what the answer says ---------------------------------------------
+
+ /** @return array */
+ public static function timings(): array
+ {
+ return [
+ 'a tenth of a second, to a tenth of a millisecond' => [0.12345, 123.5],
+ 'a whole number' => [2, 2000.0],
+ 'text' => ['0.25', 250.0],
+ 'garbage' => ['n/a', 0.0],
+ 'nothing measured' => [null, null],
+ ];
+ }
+
+ #[DataProvider('timings')]
+ public function test_the_response_time_is_what_the_transfer_took(mixed $total, ?float $ms): void
+ {
+ $check = $this->check();
+ Http::fake(function (Request $request, array $options) use ($total) {
+ return $this->answerWithStats(new PsrResponse(200, [], 'ok'), $request, $options['on_stats'], $total);
+ });
+
+ app(UptimeChecker::class)->run();
+
+ $stored = DB::table('monitoring_check_results')->where('check_id', $check->id)->value('response_ms');
+ $this->assertSame($ms, $check->fresh()->last_response_ms);
+ $this->assertSame($ms, $stored === null ? null : (float) $stored);
+ }
+
+ /** @return array */
+ public static function codes(): array
+ {
+ return [
+ '200' => [200, true],
+ '301' => [301, true],
+ '399' => [399, true],
+ '400' => [400, false],
+ '404' => [404, false],
+ '503' => [503, false],
+ ];
+ }
+
+ #[DataProvider('codes')]
+ public function test_an_answer_below_400_is_good(int $code, bool $good): void
+ {
+ $check = $this->check();
+ Http::fake(['*' => Http::response('', $code)]);
+
+ app(UptimeChecker::class)->run();
+
+ $fresh = $check->fresh();
+ $this->assertSame($good ? UptimeCheck::UP : UptimeCheck::FAILING, $fresh->status);
+ $this->assertSame($code, $fresh->last_status_code);
+ $this->assertSame($good ? null : 'HTTP '.$code, $fresh->last_error);
+ $this->assertSame($good, (bool) DB::table('monitoring_check_results')->where('check_id', $check->id)->value('ok'));
+ }
+
+ // ---- recording --------------------------------------------------------
+
+ /** @return array */
+ public static function lengths(): array
+ {
+ return ['short' => [10], 'just under' => [249], 'exactly the limit' => [250], 'one over' => [251], 'far over' => [600]];
+ }
+
+ #[DataProvider('lengths')]
+ public function test_errors_are_kept_to_250_characters_in_the_check_and_in_the_result(int $length): void
+ {
+ $error = str_repeat('é', $length);
+ $check = $this->check();
+
+ app(UptimeChecker::class)->record($check, false, 500, 5.0, $error);
+
+ $expected = Str::limit($error, 250);
+ $this->assertSame($expected, $check->fresh()->last_error);
+ $this->assertSame($expected, DB::table('monitoring_check_results')->where('check_id', $check->id)->value('error'));
+ $this->assertSame($length > 250 ? 253 : $length, mb_strlen($expected));
+ }
+
+ public function test_a_good_result_keeps_no_error(): void
+ {
+ $check = $this->check();
+ $checker = app(UptimeChecker::class);
+ $checker->record($check, false, 500, 5.0, 'HTTP 500');
+
+ $checker->record($check, true, 200, 5.0, null);
+
+ $this->assertNull($check->fresh()->last_error);
+ $this->assertSame([null, 'HTTP 500'], DB::table('monitoring_check_results')->where('check_id', $check->id)->orderByDesc('id')->pluck('error')->all());
+ }
+
+ public function test_an_open_incident_follows_the_failures_and_the_last_error(): void
+ {
+ Setting::save('monitoring', ['failures' => 1]);
+ $check = $this->check();
+ $checker = app(UptimeChecker::class);
+
+ $checker->record($check, false, 500, 5.0, 'HTTP 500', Carbon::parse('2026-11-16 10:00:00'));
+ $incident = Incident::query()->sole();
+ $this->assertSame([1, 'HTTP 500'], [$incident->failures, $incident->last_error]);
+
+ $checker->record($check, false, 502, 5.0, 'HTTP 502', Carbon::parse('2026-11-16 10:01:00'));
+ $checker->record($check, false, null, null, 'cURL 28: Operation timed out', Carbon::parse('2026-11-16 10:02:00'));
+
+ $incident = Incident::query()->sole();
+ $this->assertSame([3, 'cURL 28: Operation timed out'], [$incident->failures, $incident->last_error]);
+ $this->assertNull($incident->resolved_at);
+ }
+
+ public function test_the_alert_knows_the_address_even_when_the_current_site_is_another(): void
+ {
+ config(['mail.default' => 'array']);
+ Setting::save('monitoring', ['failures' => 1, 'alert_emails' => 'ops@example.test']);
+ $shop = Site::query()->create(['code' => 'shop', 'name' => 'Demo shop', 'domains' => ['shop.example.test'], 'active' => true]);
+ $blog = Site::query()->create(['code' => 'blog', 'name' => 'Demo blog', 'domains' => ['blog.example.test'], 'active' => true]);
+ $check = $this->check(['site_id' => $shop->id, 'name' => 'Shop home']);
+ app(Sites::class)->setCurrent($blog);
+
+ app(UptimeChecker::class)->record($check, false, 500, 5.0, 'HTTP 500');
+
+ $mails = app('mail.manager')->mailer('array')->getSymfonyTransport()->messages();
+ $this->assertCount(1, $mails);
+ $this->assertSame('Down: Shop home', $mails[0]->getOriginalMessage()->getSubject());
+ }
+
+ // ---- the number of failures ------------------------------------------
+
+ /** @return array */
+ public static function thresholds(): array
+ {
+ return [
+ // setting, config => failures
+ 'the setting' => [5, 9, 5],
+ 'text setting' => ['4', 9, 4],
+ 'the config without a setting' => [null, 6, 6],
+ 'a text that is no number' => ['often', 6, 6],
+ 'three when nothing is said' => [null, null, 3],
+ 'three when the setting is no number and the config is silent' => ['often', null, 3],
+ 'at least one: setting' => [0, 6, 1],
+ 'at least one: negative' => [-2, 6, 1],
+ 'at least one: config' => [null, 0, 1],
+ 'one' => [1, 6, 1],
+ ];
+ }
+
+ #[DataProvider('thresholds')]
+ public function test_failures_in_a_row_before_an_incident(mixed $setting, mixed $config, int $expected): void
+ {
+ $this->uptimeSetting('failures', $config);
+ if ($setting !== null) {
+ Setting::save('monitoring', ['failures' => $setting]);
+ }
+
+ $this->assertSame($expected, app(UptimeChecker::class)->threshold());
+ }
+}
diff --git a/packages/monitoring/tests/UptimeTest.php b/packages/monitoring/tests/UptimeTest.php
new file mode 100644
index 00000000..4a84c3b2
--- /dev/null
+++ b/packages/monitoring/tests/UptimeTest.php
@@ -0,0 +1,268 @@
+ */
+ public static function transitions(): array
+ {
+ // failures before, incident open, result ok, threshold => status, failures, opens, resolves
+ return [
+ 'first good result' => [0, false, true, 3, UptimeCheck::UP, 0, false, false],
+ 'good after failing' => [2, false, true, 3, UptimeCheck::UP, 0, false, false],
+ 'good while down resolves' => [7, true, true, 3, UptimeCheck::UP, 0, false, true],
+ 'first failure' => [0, false, false, 3, UptimeCheck::FAILING, 1, false, false],
+ 'second failure' => [1, false, false, 3, UptimeCheck::FAILING, 2, false, false],
+ 'third failure opens' => [2, false, false, 3, UptimeCheck::DOWN, 3, true, false],
+ 'still down, no second alert' => [3, true, false, 3, UptimeCheck::DOWN, 4, false, false],
+ 'threshold one opens at once' => [0, false, false, 1, UptimeCheck::DOWN, 1, true, false],
+ 'threshold zero acts as one' => [0, false, false, 0, UptimeCheck::DOWN, 1, true, false],
+ 'threshold raised while down' => [1, true, false, 5, UptimeCheck::DOWN, 2, false, false],
+ 'negative failures counted from zero' => [-4, false, false, 3, UptimeCheck::FAILING, 1, false, false],
+ ];
+ }
+
+ #[DataProvider('transitions')]
+ public function test_transition_table(int $failures, bool $open, bool $ok, int $threshold, string $status, int $after, bool $opens, bool $resolves): void
+ {
+ $transition = Transition::next($failures, $open, $ok, $threshold);
+
+ $this->assertSame([$status, $after, $opens, $resolves], [$transition->status, $transition->failures, $transition->opensIncident, $transition->resolvesIncident]);
+ }
+
+ private function check(array $attributes = []): UptimeCheck
+ {
+ $check = new UptimeCheck;
+ $check->forceFill($attributes + ['site_id' => null, 'name' => 'Demo shop', 'url' => 'https://shop.example.test/', 'active' => true])->save();
+
+ return $check;
+ }
+
+ public function test_an_outage_opens_one_incident_alerts_once_and_resolves(): void
+ {
+ config(['mail.default' => 'array']);
+ Http::fake(['api.telegram.org/*' => Http::response(['ok' => true])]);
+ Setting::save('monitoring', [
+ 'failures' => 2,
+ 'alert_emails' => "ops@example.test, not-an-email\nlead@example.test ops@example.test",
+ 'telegram_token' => '123456:'.str_repeat('A', 30),
+ 'telegram_chat_id' => '-1001234567890',
+ ]);
+ $fired = [];
+ Hook::on('atrium.monitoring.incident.opened', function (Incident $incident) use (&$fired): void {
+ $fired[] = 'opened:'.$incident->check_id;
+ });
+ Hook::on('atrium.monitoring.incident.resolved', function (Incident $incident) use (&$fired): void {
+ $fired[] = 'resolved:'.$incident->check_id;
+ });
+
+ $check = $this->check();
+ $checker = app(UptimeChecker::class);
+ $start = Carbon::parse('2026-11-16 10:00:00');
+
+ $checker->record($check, false, 502, 80.0, 'HTTP 502', $start);
+ $this->assertSame(UptimeCheck::FAILING, $check->fresh()->status);
+ $this->assertSame(0, Incident::query()->count());
+
+ $checker->record($check, false, null, null, 'cURL 28: Operation timed out', $start->copy()->addMinute());
+ $checker->record($check, false, null, null, 'cURL 28: Operation timed out', $start->copy()->addMinutes(2));
+ $incident = Incident::query()->sole();
+ $this->assertSame(UptimeCheck::DOWN, $check->fresh()->status);
+ $this->assertSame(3, $incident->failures);
+ $this->assertNull($incident->resolved_at);
+ $this->assertSame('cURL 28: Operation timed out', $incident->last_error);
+
+ $checker->record($check, true, 200, 95.0, null, $start->copy()->addMinutes(12));
+ $incident->refresh();
+ $this->assertSame('2026-11-16 10:12', $incident->resolved_at->format('Y-m-d H:i'));
+ $this->assertSame(11, $incident->minutes());
+ $this->assertSame(UptimeCheck::UP, $check->fresh()->status);
+ $this->assertSame(0, $check->fresh()->failures);
+ $this->assertNull($check->fresh()->last_error);
+
+ $this->assertSame(['opened:'.$check->id, 'resolved:'.$check->id], $fired);
+ $this->assertSame(4, DB::table('monitoring_check_results')->where('check_id', $check->id)->count());
+
+ $mails = app('mail.manager')->mailer('array')->getSymfonyTransport()->messages();
+ $this->assertCount(2, $mails);
+ $first = $mails[0]->getOriginalMessage();
+ $this->assertSame(['ops@example.test', 'lead@example.test'], array_map(fn ($address) => $address->getAddress(), $first->getTo()));
+ $this->assertSame('Down: Demo shop', $first->getSubject());
+ $this->assertSame('Back up: Demo shop', $mails[1]->getOriginalMessage()->getSubject());
+ Http::assertSentCount(2);
+ Http::assertSent(function (Request $request) use ($check): bool {
+ return str_contains($request->url(), '/bot123456:')
+ && $request['chat_id'] === '-1001234567890'
+ && str_contains($request['text'], 'Down: Demo shop')
+ && str_contains($request['text'], $check->url);
+ });
+ Http::assertSent(fn (Request $request): bool => str_contains($request['text'], 'Back up: Demo shop') && str_contains($request['text'], '11 minutes'));
+
+ $uptime = (new Report(Carbon::parse('2026-11-17')->toImmutable()))->uptime('2026-11-16', '2026-11-16');
+ $this->assertSame(['checks' => 4, 'up' => 1, 'ratio' => 0.25], $uptime[$check->id]);
+ }
+
+ public function test_the_alert_text_is_translated_and_the_addresses_cleaned(): void
+ {
+ app()->setLocale('ru');
+ $incident = new Incident(['started_at' => Carbon::parse('2026-11-16 10:00'), 'resolved_at' => Carbon::parse('2026-11-16 10:05'), 'failures' => 3, 'last_error' => null]);
+ $incident->setRelation('check', $this->check(['name' => 'Магазин']));
+
+ $message = app(Notifier::class)->message('opened', $incident);
+ $this->assertSame('Не работает: Магазин', $message['subject']);
+ $this->assertStringContainsString('Последняя ошибка: —', $message['body']);
+ $this->assertStringContainsString('5 минут', app(Notifier::class)->message('resolved', $incident)['body']);
+
+ Setting::save('monitoring', ['alert_emails' => 'a@example.test;b@example.test, a@example.test bad@@x']);
+ $this->assertSame(['a@example.test', 'b@example.test'], app(Notifier::class)->emails());
+ }
+
+ public function test_telegram_settings_come_from_env_first_and_need_both_parts(): void
+ {
+ $notifier = app(Notifier::class);
+ $this->assertNull($notifier->telegram());
+
+ Setting::save('monitoring', ['telegram_token' => '1:'.str_repeat('b', 25)]);
+ $this->assertNull($notifier->telegram(), 'no chat');
+
+ Setting::save('monitoring', ['telegram_token' => '1:'.str_repeat('b', 25), 'telegram_chat_id' => '@site_alerts']);
+ $this->assertSame(['1:'.str_repeat('b', 25), '@site_alerts'], $notifier->telegram());
+
+ config(['atrium-monitoring.telegram.token' => '9:from-env-token-xxxxxxxxxxxx']);
+ $this->assertSame(['9:from-env-token-xxxxxxxxxxxx', '@site_alerts'], $notifier->telegram());
+ }
+
+ public function test_a_failing_alert_is_logged_without_the_token(): void
+ {
+ Http::fake(['api.telegram.org/*' => Http::response(['ok' => false], 401)]);
+ Setting::save('monitoring', ['failures' => 1, 'telegram_token' => '777:'.str_repeat('S', 30), 'telegram_chat_id' => '42']);
+ Log::spy();
+
+ app(UptimeChecker::class)->record($this->check(), false, 500, 10.0, 'HTTP 500');
+
+ $this->assertSame(1, Incident::query()->count(), 'the incident is opened anyway');
+ Log::shouldHaveReceived('warning')->withArgs(fn (string $message): bool => str_contains($message, 'telegram') && ! str_contains($message, 'SSSS'));
+ }
+
+ public function test_run_checks_every_active_address_and_records_errors(): void
+ {
+ Setting::save('monitoring', ['failures' => 1]);
+ $up = $this->check(['name' => 'Up', 'url' => 'https://up.example.test/']);
+ $missing = $this->check(['name' => 'Missing', 'url' => 'https://up.example.test/gone']);
+ $timeout = $this->check(['name' => 'Timeout', 'url' => 'https://slow.example.test/']);
+ $off = $this->check(['name' => 'Off', 'url' => 'https://off.example.test/', 'active' => false]);
+
+ Http::fake([
+ 'up.example.test/gone' => Http::response('', 404),
+ 'up.example.test/*' => Http::response('ok', 200),
+ 'localhost/*' => Http::response('home', 200),
+ 'slow.example.test/*' => fn (Request $request) => throw new ConnectException('cURL error 28: Operation timed out after 10001 milliseconds (see https://curl.haxx.se)', new PsrRequest('GET', $request->url())),
+ ]);
+
+ $this->artisan('atrium:monitoring:uptime')->assertSuccessful();
+
+ $this->assertSame(UptimeCheck::UP, $up->fresh()->status);
+ $this->assertSame(200, $up->fresh()->last_status_code);
+ $this->assertSame(UptimeCheck::DOWN, $missing->fresh()->status);
+ $this->assertSame('HTTP 404', $missing->fresh()->last_error);
+ $this->assertSame('cURL 28: Operation timed out after 10001 milliseconds', $timeout->fresh()->last_error);
+ $this->assertNull($timeout->fresh()->last_status_code);
+ $this->assertSame(UptimeCheck::UNKNOWN, $off->fresh()->status);
+ Http::assertNotSent(fn (Request $request): bool => str_contains($request->url(), 'off.example.test'));
+ Http::assertSent(fn (Request $request): bool => $request->hasHeader('User-Agent', 'AtriumMonitoring/1.0 (+uptime)'));
+ $this->assertSame(2, Incident::query()->count());
+ // The command added the front page of the site and checked it too.
+ $this->assertSame(UptimeCheck::UP, UptimeCheck::query()->withoutGlobalScopes()->where('is_home', true)->value('status'));
+ }
+
+ public function test_front_pages_of_every_site_are_checked_by_themselves(): void
+ {
+ Http::fake(['*' => Http::response('ok')]);
+ $checker = app(UptimeChecker::class);
+
+ // The site the installation starts with, on the application's address.
+ $checker->syncHomes();
+ $checker->syncHomes();
+ $this->assertSame(['http://localhost/'], UptimeCheck::query()->withoutGlobalScopes()->pluck('url')->all());
+
+ $shop = Site::query()->create(['code' => 'shop', 'name' => 'Demo shop', 'domains' => ['shop.example.test', 'www.shop.example.test'], 'active' => true]);
+ $blog = Site::query()->create(['code' => 'blog', 'name' => 'Demo blog', 'domains' => [], 'folder' => 'blog', 'active' => false]);
+ app(Sites::class)->flush();
+
+ $checker->syncHomes();
+ $homes = UptimeCheck::query()->withoutGlobalScopes()->where('is_home', true)->orderBy('id')->get();
+ $this->assertSame(['http://localhost/', 'https://shop.example.test/', 'http://localhost/blog/'], $homes->pluck('url')->all());
+ $this->assertSame([true, true, false], $homes->pluck('active')->all(), 'a switched-off site is not checked');
+ $this->assertFalse($homes[1]->canDelete());
+ $this->assertTrue($this->check()->canDelete());
+
+ $shop->update(['name' => 'Demo store']);
+ $checker->syncHomes();
+ $this->assertSame('Demo store', UptimeCheck::query()->withoutGlobalScopes()->where('site_id', $shop->id)->value('name'));
+ $this->assertSame(3, UptimeCheck::query()->withoutGlobalScopes()->where('is_home', true)->count());
+ $this->assertSame((int) $blog->id, (int) $homes[2]->site_id);
+ }
+
+ public function test_status_labels_are_translated(): void
+ {
+ $check = $this->check();
+ $this->assertSame('Not checked yet', $check->status_label);
+ app()->setLocale('de');
+ $check->status = UptimeCheck::DOWN;
+ $this->assertNotSame('Down', $check->status_label);
+ }
+
+ public function test_the_command_does_nothing_when_checks_are_off(): void
+ {
+ config(['atrium-monitoring.uptime.enabled' => false]);
+
+ $this->artisan('atrium:monitoring:uptime')->expectsOutput('Uptime checks are off.')->assertSuccessful();
+ $this->assertSame(0, UptimeCheck::query()->withoutGlobalScopes()->count(), 'not even the front pages');
+ Http::assertNothingSent();
+ }
+
+ /** @return array */
+ public static function errors(): array
+ {
+ return [
+ 'no result at all' => [null, 'No response'],
+ 'something odd' => ['oops', 'No response'],
+ 'a cURL timeout' => [new \RuntimeException('cURL error 28: Operation timed out after 10001 milliseconds (see https://curl.haxx.se)'), 'cURL 28: Operation timed out after 10001 milliseconds'],
+ 'another exception' => [new \LogicException('Broken pipe'), 'LogicException: Broken pipe'],
+ 'a long message' => [new \RuntimeException(str_repeat('x', 400)), 'RuntimeException: '.str_repeat('x', 232).'...'],
+ ];
+ }
+
+ #[DataProvider('errors')]
+ public function test_the_error_is_short_and_readable(mixed $result, string $expected): void
+ {
+ $this->assertSame($expected, UptimeChecker::error($result));
+ }
+}
diff --git a/packages/monitoring/tests/VitalsTest.php b/packages/monitoring/tests/VitalsTest.php
new file mode 100644
index 00000000..b21d9899
--- /dev/null
+++ b/packages/monitoring/tests/VitalsTest.php
@@ -0,0 +1,101 @@
+ */
+ public static function ratings(): iterable
+ {
+ foreach ([
+ 'lcp' => [2500.0, 4000.0], 'inp' => [200.0, 500.0], 'cls' => [0.1, 0.25], 'ttfb' => [800.0, 1800.0], 'fcp' => [1800.0, 3000.0],
+ ] as $metric => [$good, $poor]) {
+ yield $metric.' zero' => [$metric, 0.0, 'good'];
+ yield $metric.' on the good limit' => [$metric, $good, 'good'];
+ yield $metric.' past the good limit' => [$metric, $good * 1.001, 'needs_improvement'];
+ yield $metric.' on the poor limit' => [$metric, $poor, 'needs_improvement'];
+ yield $metric.' past the poor limit' => [$metric, $poor * 1.001, 'poor'];
+ }
+ }
+
+ #[DataProvider('ratings')]
+ public function test_a_value_is_rated_against_its_metric(string $metric, float $value, string $rating): void
+ {
+ $this->assertSame($rating, Vitals::rating($metric, $value));
+ }
+
+ public function test_nothing_measured_or_an_unknown_metric_has_no_rating(): void
+ {
+ $this->assertNull(Vitals::rating('lcp', null));
+ $this->assertNull(Vitals::rating('tbt', 100.0));
+ $this->assertNull(Vitals::rating('tbt', null));
+ }
+
+ public function test_the_constants_name_every_rating_and_limit(): void
+ {
+ $this->assertSame(['good', 'needs_improvement', 'poor'], [Vitals::GOOD, Vitals::NEEDS_IMPROVEMENT, Vitals::POOR]);
+ $this->assertSame(['lcp', 'inp', 'cls', 'ttfb', 'fcp'], array_keys(Vitals::THRESHOLDS));
+ $this->assertSame(['lcp', 'inp', 'cls', 'ttfb', 'fcp'], array_keys(Vitals::LIMITS));
+ $this->assertSame(['lcp' => [2500, 4000, 'ms'], 'inp' => [200, 500, 'ms'], 'cls' => [0.1, 0.25, ''], 'ttfb' => [800, 1800, 'ms'], 'fcp' => [1800, 3000, 'ms']], Vitals::THRESHOLDS);
+ $this->assertSame(['lcp' => 120000, 'inp' => 60000, 'cls' => 50, 'ttfb' => 120000, 'fcp' => 120000], Vitals::LIMITS);
+ }
+
+ /** @return iterable */
+ public static function formats(): iterable
+ {
+ yield 'nothing' => ['lcp', null, '—'];
+ yield 'nothing, shift' => ['cls', null, '—'];
+ yield 'zero' => ['ttfb', 0.0, '0.0 ms'];
+ yield 'a tenth under ten' => ['ttfb', 7.5, '7.5 ms'];
+ yield 'a whole number under ten keeps its tenth' => ['ttfb', 5.0, '5.0 ms'];
+ yield 'tenths rounded' => ['ttfb', 2.46, '2.5 ms'];
+ yield 'just under ten' => ['ttfb', 9.94, '9.9 ms'];
+ yield 'ten is whole' => ['ttfb', 10.0, '10 ms'];
+ yield 'over ten is whole' => ['ttfb', 10.4, '10 ms'];
+ yield 'rounded down' => ['lcp', 999.4, '999 ms'];
+ yield 'rounded up' => ['lcp', 120.6, '121 ms'];
+ yield 'rounded up to a thousand' => ['lcp', 999.6, '1000 ms'];
+ yield 'a second' => ['lcp', 1000.0, '1.00 s'];
+ yield 'seconds to two places' => ['inp', 1234.567, '1.23 s'];
+ yield 'seconds rounded up' => ['fcp', 1239.0, '1.24 s'];
+ yield 'many seconds' => ['ttfb', 1234567.0, '1234.57 s'];
+ yield 'shift' => ['cls', 0.12, '0.120'];
+ yield 'shift to three places' => ['cls', 0.12349, '0.123'];
+ yield 'shift rounded up' => ['cls', 0.1235, '0.124'];
+ yield 'large shift' => ['cls', 1234.5, '1234.500'];
+ yield 'shift is never seconds' => ['cls', 2000.0, '2000.000'];
+ }
+
+ #[DataProvider('formats')]
+ public function test_a_value_is_written_for_its_metric(string $metric, ?float $value, string $text): void
+ {
+ $this->assertSame($text, Vitals::format($metric, $value));
+ }
+
+ public function test_numbers_use_the_decimal_separator_of_the_panel_language(): void
+ {
+ app()->setLocale('ru');
+ $this->assertSame('2,91 с', Vitals::format('lcp', 2905.0));
+ $this->assertSame('0,038', Vitals::format('cls', 0.0375));
+ $this->assertSame('150 мс', Vitals::format('inp', 150.0));
+ $this->assertSame('7,5 мс', Vitals::format('ttfb', 7.5));
+
+ app()->setLocale('en');
+ $this->assertSame('2.91 s', Vitals::format('lcp', 2905.0));
+ $this->assertSame('0.038', Vitals::format('cls', 0.0375));
+ }
+}
diff --git a/phpstan.neon b/phpstan.neon
index a066db10..a8493b0c 100644
--- a/phpstan.neon
+++ b/phpstan.neon
@@ -25,6 +25,7 @@ parameters:
- packages/errors/src
- packages/faq/src
- packages/forms/src
+ - packages/monitoring/src
- packages/news/src
- packages/pages/src
- packages/reviews/src
@@ -47,6 +48,7 @@ parameters:
- packages/docs/config
- packages/errors/config
- packages/forms/config
+ - packages/monitoring/config
- packages/seo/config
- packages/solutions/config
- packages/two-factor/config
@@ -63,6 +65,7 @@ parameters:
- packages/errors/database/migrations
- packages/faq/database/migrations
- packages/forms/database/migrations
+ - packages/monitoring/database/migrations
- packages/news/database/migrations
- packages/pages/database/migrations
- packages/reviews/database/migrations
diff --git a/phpunit.xml b/phpunit.xml
index b743a513..29c47c59 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -23,6 +23,7 @@
packages/errors/tests
packages/faq/tests
packages/forms/tests
+ packages/monitoring/tests
packages/news/tests
packages/pages/tests
packages/reviews/tests
@@ -50,6 +51,7 @@
packages/errors/src
packages/faq/src
packages/forms/src
+ packages/monitoring/src
packages/news/src
packages/pages/src
packages/reviews/src
diff --git a/tests/Browser/Admin/MonitoringTest.php b/tests/Browser/Admin/MonitoringTest.php
new file mode 100644
index 00000000..95ffb247
--- /dev/null
+++ b/tests/Browser/Admin/MonitoringTest.php
@@ -0,0 +1,142 @@
+getTimestamp();
+ $sql = SqlNormalizer::normalize('select * from "products" where "price" > 100');
+ $this->hash = SqlNormalizer::hash($sql, 'sqlite');
+ $records = [];
+
+ foreach ([['catalog.show', '/catalog/blue-mug', 640.0], ['home', '/', 90.0]] as [$route, $path, $ms]) {
+ foreach (range(1, 4) as $n) {
+ $records[] = ['k' => 'r', 'at' => $now - $n * 60, 'site' => 1, 'loc' => 'en', 'route' => $route, 'path' => $path, 'm' => 'GET', 's' => 200, 'd' => $ms + $n, 'q' => 6, 'qm' => 4.0, 'ch' => 3, 'cm' => 1, 'mem' => 18432];
+ }
+ }
+
+ $records[] = ['k' => 'q', 'at' => $now, 'site' => 1, 'route' => 'catalog.show', 'path' => '/catalog/blue-mug', 'h' => $this->hash, 'sql' => $sql, 'c' => 'sqlite', 'd' => 340.0];
+
+ foreach ([['/', 'mobile', 1800], ['/catalog/blue-mug', 'mobile', 4600], ['/catalog/blue-mug', 'desktop', 2900]] as [$path, $device, $lcp]) {
+ $records[] = ['k' => 'v', 'at' => $now, 'site' => 1, 'loc' => 'en', 'path' => $path, 'dev' => $device, 'con' => '4g', 'lcp' => $lcp, 'inp' => 150, 'cls' => 0.04, 'ttfb' => 500, 'fcp' => 1200];
+ }
+
+ app(Flusher::class)->write($records);
+
+ $check = new UptimeCheck;
+ $check->forceFill(['name' => 'Demo shop', 'url' => 'https://shop.example.test/'])->save();
+ config(['atrium-monitoring.uptime.failures' => 1]);
+ app(UptimeChecker::class)->record($check, false, 503, 40.0, 'HTTP 503', Carbon::now()->subMinute());
+ }
+
+ public function test_the_tile_leads_to_the_report_and_the_filters_narrow_it(): void
+ {
+ $admin = $this->admin();
+
+ $this->browse(function (Browser $browser) use ($admin): void {
+ $browser->loginAs($admin, 'admin')
+ ->visit('/admin')
+ ->waitFor('[data-gadget="monitoring"]')
+ ->assertSeeIn('@monitoring-down', 'Demo shop')
+ ->assertSeeIn('[data-gadget="monitoring"]', 'catalog.show')
+ ->click('@monitoring-open')
+ ->waitFor('@monitoring-server')
+ ->assertSeeIn('@summary-requests', '8')
+ ->assertSeeIn('@slow-routes', 'catalog.show')
+ ->assertSeeIn('@slow-pages', '/catalog/blue-mug')
+ ->assertSeeIn('@uptime-checks', 'Demo shop')
+ ->assertSeeIn('@incidents', 'HTTP 503')
+ // Each chart carries its numbers as a table too.
+ ->assertPresent('@chart-lcp table')
+ ->assertMissing('@filter-route')
+ ->click('@slow-routes @route-filter')
+ ->waitFor('@filter-route')
+ ->assertSeeIn('@filter-route', 'catalog.show')
+ ->assertQueryStringHas('route', 'catalog.show')
+ ->assertSeeIn('@summary-requests', '4')
+ ->click('@filter-clear')
+ ->waitUntilMissing('@filter-route')
+ ->select('@filter-device', 'desktop')
+ // The pages table counts every device: hidden while one is chosen.
+ ->waitUntilMissing('@slow-pages')
+ ->assertQueryStringHas('device', 'desktop')
+ ->select('@filter-device', '*')
+ ->waitFor('@slow-pages')
+ ->click('@slow-pages @page-filter')
+ ->waitFor('@filter-page')
+ ->assertSeeIn('@filter-page', '/catalog/blue-mug');
+ });
+ }
+
+ public function test_a_slow_query_opens_its_own_page(): void
+ {
+ $admin = $this->admin();
+
+ $this->browse(function (Browser $browser) use ($admin): void {
+ $browser->loginAs($admin, 'admin')
+ ->visit('/admin/monitoring')
+ ->waitFor('@slow-queries')
+ ->click('@slow-queries @query-link')
+ ->waitFor('@query-sql')
+ ->assertPathIs('/admin/monitoring/queries/'.$this->hash)
+ ->assertSeeIn('@query-sql', 'select * from "products" where "price" > ?')
+ ->assertSeeIn('@query-routes', 'catalog.show')
+ ->assertSeeIn('@query-routes', '/catalog/blue-mug')
+ ->assertPresent('@chart-query table')
+ ->click('@monitoring-back')
+ ->waitFor('@monitoring-server')
+ ->assertPathIs('/admin/monitoring');
+ });
+ }
+
+ public function test_the_menu_entry_sits_in_site_health(): void
+ {
+ $admin = $this->admin();
+
+ $this->browse(function (Browser $browser) use ($admin): void {
+ $browser->loginAs($admin, 'admin')
+ ->visit('/admin')
+ ->waitForText('Site health')
+ // The module's lists live in the folded group, not on top of the sidebar.
+ ->assertMissing('[data-menu-route="admin.uptime_checks.index"]')
+ ->assertMissing('[data-menu-route="admin.monitoring_incidents.index"]')
+ ->press('Site health')
+ ->waitFor('[data-menu-route="admin.monitoring.index"]')
+ ->assertVisible('[data-menu-route="admin.uptime_checks.index"]')
+ ->assertVisible('[data-menu-route="admin.monitoring_incidents.index"]')
+ ->click('[data-menu-route="admin.monitoring.index"]')
+ ->waitFor('@monitoring-server')
+ ->assertPathIs('/admin/monitoring');
+ });
+ }
+}
From 6502819634c7691d05e8000020558b468f75f2b3 Mon Sep 17 00:00:00 2001
From: Pisarev Alexei <6171687+xiregroup@users.noreply.github.com>
Date: Thu, 19 Nov 2026 00:26:47 +0300
Subject: [PATCH 2/3] test(monitoring): keep the module's cache counters apart
from the core's filter
---
.../tests/CoreCacheCountersTest.php | 91 +++++++++++++++++++
packages/monitoring/tests/TestCase.php | 25 +++++
2 files changed, 116 insertions(+)
create mode 100644 packages/monitoring/tests/CoreCacheCountersTest.php
diff --git a/packages/monitoring/tests/CoreCacheCountersTest.php b/packages/monitoring/tests/CoreCacheCountersTest.php
new file mode 100644
index 00000000..3e147476
--- /dev/null
+++ b/packages/monitoring/tests/CoreCacheCountersTest.php
@@ -0,0 +1,91 @@
+records(Request::create('/hello'), new Response)[0], ['ch' => 0, 'cm' => 0]);
+ }
+
+ public function test_the_request_line_carries_the_core_caches_hits_and_misses(): void
+ {
+ $recorder = new Recorder(new Buffer($this->bufferPath, PHP_INT_MAX));
+ $recorder->start(Request::create('/hello'));
+ $cache = app(RecordCache::class);
+
+ $this->assertSame(['ch' => 0, 'cm' => 0], $this->line($recorder));
+
+ $cache->remember([], 'demo', fn (): int => 1);
+ $cache->remember([], 'demo', fn (): int => 1);
+ $cache->remember([], 'demo', fn (): int => 1);
+
+ $this->assertSame(['ch' => 2, 'cm' => 1], $this->line($recorder));
+ }
+
+ public function test_laravels_own_events_are_not_added_on_top(): void
+ {
+ $recorder = new Recorder(new Buffer($this->bufferPath, PHP_INT_MAX));
+ $recorder->start(Request::create('/hello'));
+ $recorder->hit();
+ $recorder->hit();
+ $recorder->miss();
+
+ $this->assertSame(['ch' => 0, 'cm' => 0], $this->line($recorder));
+ }
+
+ /** @return array */
+ public static function whetherTheCoreClosedTheRequestFirst(): array
+ {
+ return ['the line is written before the core resets' => [false], 'the core has already reset when the line is written' => [true]];
+ }
+
+ #[DataProvider('whetherTheCoreClosedTheRequestFirst')]
+ public function test_a_whole_request_through_the_middleware_writes_the_cores_counters(bool $coreResetsFirst): void
+ {
+ $middleware = new CollectMetrics(app(Recorder::class));
+ $request = Request::create('/hello');
+
+ $response = $middleware->handle($request, function (): Response {
+ $cache = app(RecordCache::class);
+ $cache->remember([], 'demo', fn (): int => 1);
+ $cache->remember([], 'demo', fn (): int => 1);
+ $cache->remember([], 'demo', fn (): int => 1);
+
+ return new Response('ok');
+ });
+
+ if ($coreResetsFirst) {
+ app(RecordCache::class)->persistStats();
+ app(RecordCache::class)->reset();
+ }
+
+ $middleware->terminate($request, $response);
+
+ $lines = file($this->bufferPath.'/buffer.ndjson', FILE_IGNORE_NEW_LINES) ?: [];
+ $record = json_decode($lines[0], true, 512, JSON_THROW_ON_ERROR);
+ $this->assertSame(['ch' => 2, 'cm' => 1], ['ch' => $record['ch'], 'cm' => $record['cm']]);
+ }
+}
diff --git a/packages/monitoring/tests/TestCase.php b/packages/monitoring/tests/TestCase.php
index febfb9ed..c6aaec96 100644
--- a/packages/monitoring/tests/TestCase.php
+++ b/packages/monitoring/tests/TestCase.php
@@ -10,6 +10,7 @@
namespace Atrium\Monitoring\Tests;
use Atrium\Admin\AtriumServiceProvider;
+use Atrium\Admin\Hooks\Hooks;
use Atrium\Admin\Models\AdminUser;
use Atrium\Monitoring\MonitoringServiceProvider;
use Illuminate\Foundation\Testing\RefreshDatabase;
@@ -17,6 +18,7 @@
use Illuminate\Support\Facades\Http;
use Inertia\ServiceProvider as InertiaServiceProvider;
use Orchestra\Testbench\TestCase as Orchestra;
+use ReflectionProperty;
use Tighten\Ziggy\ZiggyServiceProvider;
abstract class TestCase extends Orchestra
@@ -25,6 +27,9 @@ abstract class TestCase extends Orchestra
protected string $bufferPath;
+ /** A test of the module with the core's own cache counters, as they are on a real site. */
+ protected bool $coreCacheCounters = false;
+
protected function getPackageProviders($app): array
{
return [
@@ -64,6 +69,26 @@ protected function setUp(): void
$this->withoutVite();
Http::preventStrayRequests();
+ if (! $this->coreCacheCounters) {
+ $this->withoutCacheCounters();
+ }
+ }
+
+ /**
+ * The core registers an `atrium.cache.stats` filter of its own cache; the
+ * module's own counting of Laravel's cache events (the case of a site
+ * with no such filter) is the default of these tests. A test of the two
+ * working together sets $coreCacheCounters.
+ */
+ protected function withoutCacheCounters(): void
+ {
+ $hooks = app(Hooks::class);
+ $filters = new ReflectionProperty($hooks, 'filters');
+
+ $all = $filters->getValue($hooks);
+ unset($all['atrium.cache.stats']);
+ $filters->setValue($hooks, $all);
+
}
protected function tearDown(): void
From 48df15efa29b523e0b7f24b1bc1e2b314ba30f8f Mon Sep 17 00:00:00 2001
From: Pisarev Alexei <6171687+xiregroup@users.noreply.github.com>
Date: Thu, 19 Nov 2026 00:26:47 +0300
Subject: [PATCH 3/3] build(admin): rebuild the bundle with the monitoring
screens
---
...ut-DBeSErmz.js => AdminLayout-D_QE0gy-.js} | 2 +-
...{Create-CbxIXc0Q.js => Create-CJxinjjT.js} | 2 +-
...{Create-DutDQiBS.js => Create-kOifSpfZ.js} | 2 +-
.../admin/dist/assets/Dashboard-C9RqcuE0.js | 1 -
.../admin/dist/assets/Dashboard-DkBuI6d2.js | 1 +
.../{Edit-Bm3W6F3v.js => Edit-B4rBMOtq.js} | 2 +-
.../{Edit-Cp-LIO0D.js => Edit-BB6QBa8T.js} | 2 +-
.../{Edit-CyzBsvwt.js => Edit-BtQ-5Jec.js} | 2 +-
.../{Edit-BEWPbBmM.js => Edit-CG7aI-oj.js} | 2 +-
...ield-B-XX4VFv.js => FormField-WE0R-1uV.js} | 2 +-
.../{Index-B9KqS9R5.js => Index-0in3vE-5.js} | 2 +-
packages/admin/dist/assets/Index-BYxAQoR9.js | 1 +
.../{Index-CG3NSbtt.js => Index-BjHeDb5k.js} | 2 +-
.../{Index-D_2Ij5S1.js => Index-BzKcFwHs.js} | 2 +-
.../{Index-DsLgvcm0.js => Index-CRJysQbh.js} | 2 +-
.../{Index-ZYMbBsuF.js => Index-Cl336b7A.js} | 2 +-
.../{Index-C63EL5RF.js => Index-ClSNZWUj.js} | 2 +-
.../{Index-BNmU5PEL.js => Index-CrHgEVrS.js} | 2 +-
.../{Index-DaeZ92GY.js => Index-DywV1SDR.js} | 2 +-
.../dist/assets/MonitoringChart-DLuy45XH.js | 1 +
.../dist/assets/MonitoringChart-QzapWRK7.css | 1 +
packages/admin/dist/assets/Query-CxDUw4Nd.js | 1 +
...tings-BrbOStcv.js => Settings-7h1Ram2n.js} | 2 +-
.../{Show-CS6rq4RP.js => Show-BBgM4LS_.js} | 2 +-
.../{app-BCJOqmKO.js => app-Cdw8k5No.js} | 4 +-
packages/admin/dist/assets/app-DBhrvJI0.css | 2 +
packages/admin/dist/assets/app-XteR4oRF.css | 2 -
packages/admin/dist/assets/labels-DbKc85RH.js | 1 +
packages/admin/dist/manifest.json | 142 ++++++++++++------
29 files changed, 123 insertions(+), 70 deletions(-)
rename packages/admin/dist/assets/{AdminLayout-DBeSErmz.js => AdminLayout-D_QE0gy-.js} (99%)
rename packages/admin/dist/assets/{Create-CbxIXc0Q.js => Create-CJxinjjT.js} (96%)
rename packages/admin/dist/assets/{Create-DutDQiBS.js => Create-kOifSpfZ.js} (96%)
delete mode 100644 packages/admin/dist/assets/Dashboard-C9RqcuE0.js
create mode 100644 packages/admin/dist/assets/Dashboard-DkBuI6d2.js
rename packages/admin/dist/assets/{Edit-Bm3W6F3v.js => Edit-B4rBMOtq.js} (95%)
rename packages/admin/dist/assets/{Edit-Cp-LIO0D.js => Edit-BB6QBa8T.js} (96%)
rename packages/admin/dist/assets/{Edit-CyzBsvwt.js => Edit-BtQ-5Jec.js} (98%)
rename packages/admin/dist/assets/{Edit-BEWPbBmM.js => Edit-CG7aI-oj.js} (97%)
rename packages/admin/dist/assets/{FormField-B-XX4VFv.js => FormField-WE0R-1uV.js} (99%)
rename packages/admin/dist/assets/{Index-B9KqS9R5.js => Index-0in3vE-5.js} (98%)
create mode 100644 packages/admin/dist/assets/Index-BYxAQoR9.js
rename packages/admin/dist/assets/{Index-CG3NSbtt.js => Index-BjHeDb5k.js} (99%)
rename packages/admin/dist/assets/{Index-D_2Ij5S1.js => Index-BzKcFwHs.js} (99%)
rename packages/admin/dist/assets/{Index-DsLgvcm0.js => Index-CRJysQbh.js} (98%)
rename packages/admin/dist/assets/{Index-ZYMbBsuF.js => Index-Cl336b7A.js} (99%)
rename packages/admin/dist/assets/{Index-C63EL5RF.js => Index-ClSNZWUj.js} (97%)
rename packages/admin/dist/assets/{Index-BNmU5PEL.js => Index-CrHgEVrS.js} (97%)
rename packages/admin/dist/assets/{Index-DaeZ92GY.js => Index-DywV1SDR.js} (96%)
create mode 100644 packages/admin/dist/assets/MonitoringChart-DLuy45XH.js
create mode 100644 packages/admin/dist/assets/MonitoringChart-QzapWRK7.css
create mode 100644 packages/admin/dist/assets/Query-CxDUw4Nd.js
rename packages/admin/dist/assets/{Settings-BrbOStcv.js => Settings-7h1Ram2n.js} (88%)
rename packages/admin/dist/assets/{Show-CS6rq4RP.js => Show-BBgM4LS_.js} (99%)
rename packages/admin/dist/assets/{app-BCJOqmKO.js => app-Cdw8k5No.js} (86%)
create mode 100644 packages/admin/dist/assets/app-DBhrvJI0.css
delete mode 100644 packages/admin/dist/assets/app-XteR4oRF.css
create mode 100644 packages/admin/dist/assets/labels-DbKc85RH.js
diff --git a/packages/admin/dist/assets/AdminLayout-DBeSErmz.js b/packages/admin/dist/assets/AdminLayout-D_QE0gy-.js
similarity index 99%
rename from packages/admin/dist/assets/AdminLayout-DBeSErmz.js
rename to packages/admin/dist/assets/AdminLayout-D_QE0gy-.js
index d8a04ddb..ca9737d2 100644
--- a/packages/admin/dist/assets/AdminLayout-DBeSErmz.js
+++ b/packages/admin/dist/assets/AdminLayout-D_QE0gy-.js
@@ -1 +1 @@
-import{$ as e,C as t,E as n,F as r,G as i,H as a,I as o,M as s,P as c,Q as l,R as u,S as d,T as f,W as p,X as m,_ as h,b as g,c as _,h as v,i as y,m as b,o as x,r as S,s as C,tt as w,v as T,w as E,x as D,z as O}from"./dist-Bie52OmN.js";import{n as k,r as A,t as j}from"./LocaleSwitcher-DAWnmZni.js";import{n as M,t as N}from"./app-BCJOqmKO.js";var P=[`aria-expanded`,`title`],F={class:`flex items-center`},I=[`innerHTML`],L={key:0},R=[`innerHTML`],z={key:0,class:`mt-1 ml-4 space-y-1 border-l border-sidebar-line pl-3`},B=[`innerHTML`],V={key:0},H=`flex items-center px-3 py-2 text-sm rounded-lg transition-colors duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-accent`,U=`bg-sidebar-active text-sidebar-active-fg font-semibold shadow-[inset_3px_0_0_var(--atrium-sidebar-accent)]`,W=`text-sidebar-fg font-medium hover:bg-sidebar-hover`,G={__name:`AdminMenuItem`,props:{item:{type:Object,required:!0},collapsed:Boolean},setup(r){let a=r,s=x(),c=m(!1),h=g(()=>a.item.children&&a.item.children.length>0),_=e=>{let t=route(e,void 0,!1),n=s.url.split(`?`)[0];return n===t||t!==route(`admin.dashboard`,void 0,!1)&&n.startsWith(t+`/`)},b=g(()=>!!a.item.route&&_(a.item.route)),S=g(()=>h.value?a.item.children.some(e=>e.route&&_(e.route)):!1),C=()=>{h.value&&(c.value=!c.value)};S.value&&(c.value=!0);let O={home:` `,users:` `,settings:` `,folder:` `,document:` `,chart:` `,"file-text":` `,package:` `,"help-circle":` `,briefcase:` `,star:` `,tool:` `,info:` `,image:` `,inbox:` `,"shopping-cart":` `,globe:` `,shield:` `,chevronDown:` `,default:` `},k=e=>_(e.route),A=g(()=>O[a.item.icon]||O.default);return(a,s)=>(o(),E(`li`,null,[h.value?(o(),E(T,{key:0},[D(`button`,{onClick:C,class:e([`w-full flex items-center px-3 py-2 text-sm rounded-lg transition-colors duration-200 hover:bg-sidebar-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-accent`,[S.value?`text-sidebar-fg font-semibold`:`text-sidebar-fg font-medium`,r.collapsed?`justify-center`:`justify-between`]]),"aria-expanded":c.value?`true`:`false`,title:r.collapsed?r.item.label:``},[D(`span`,F,[(o(),E(`svg`,{class:e([`w-5 h-5 flex-shrink-0 text-sidebar-muted`,r.collapsed?``:`mr-3`]),fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`,innerHTML:A.value},null,10,I)),r.collapsed?t(``,!0):(o(),E(`span`,L,w(r.item.label),1))]),r.collapsed?t(``,!0):(o(),E(`svg`,{key:0,class:e([`w-4 h-4 text-sidebar-muted transition-transform duration-200`,{"rotate-180":c.value}]),"aria-hidden":`true`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,innerHTML:O.chevronDown},null,10,R))],10,P),r.collapsed?t(``,!0):i((o(),E(`ul`,z,[(o(!0),E(T,null,u(r.item.children,t=>(o(),E(`li`,{key:t.route},[n(l(y),{"data-menu-route":t.route,href:a.route(t.route),class:e([H,k(t)?U:W]),"aria-current":k(t)?`page`:void 0},{default:p(()=>[f(w(t.label),1)]),_:2},1032,[`data-menu-route`,`href`,`class`,`aria-current`])]))),128))],512)),[[v,c.value]])],64)):(o(),d(l(y),{key:1,"data-menu-route":r.item.route,href:a.route(r.item.route),class:e([H,b.value?U:W,r.collapsed?`justify-center`:``]),"aria-current":b.value?`page`:void 0,title:r.collapsed?r.item.label:``},{default:p(()=>[(o(),E(`svg`,{class:e([`w-5 h-5 flex-shrink-0`,[r.collapsed?``:`mr-3`,b.value?``:`text-sidebar-muted`]]),fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`,innerHTML:A.value},null,10,B)),r.collapsed?t(``,!0):(o(),E(`span`,V,w(r.item.label),1))]),_:1},8,[`data-menu-route`,`href`,`class`,`aria-current`,`title`]))]))}},K={class:`h-16 flex items-center justify-between px-4 border-b border-sidebar-line`},q=[`src`,`alt`],J={key:1,class:`text-xl font-bold truncate`},Y={class:`flex-1 overflow-y-auto py-4 px-3`},ee={class:`space-y-1`},te={class:`lg:hidden border-t border-sidebar-line p-4`},ne={class:`flex items-center space-x-3`},re={class:`w-10 h-10 rounded-full bg-sidebar-active text-sidebar-active-fg flex items-center justify-center`},ie={class:`text-lg font-medium`},ae={key:0},oe={class:`text-sm font-medium`},se={class:`text-xs text-sidebar-muted`},ce={__name:`AdminSidebar`,props:{open:Boolean,collapsed:Boolean,menu:{type:Array,default:()=>[]},branding:{type:Object,default:()=>({})}},emits:[`close`],setup(r,{emit:i}){let a=x();return g(()=>a.url),(i,a)=>(o(),E(`aside`,{class:e([`fixed inset-y-0 left-0 z-50 flex flex-col bg-sidebar text-sidebar-fg border-r border-sidebar-line transform transition-transform duration-300 lg:translate-x-0`,[r.open?`translate-x-0`:`-translate-x-full`,r.collapsed?`lg:w-20`:`lg:w-64`,`w-64`]])},[D(`div`,K,[n(l(y),{href:i.route(`admin.dashboard`),"data-sidebar-brand":``,class:`flex min-w-0 items-center space-x-3 rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-accent`},{default:p(()=>[r.branding.logo?(o(),E(`img`,{key:0,src:r.branding.logo,alt:r.branding.name,class:`h-8 w-auto`},null,8,q)):t(``,!0),r.branding.logo&&!r.collapsed?(o(),E(`span`,J,w(r.branding.name||i.$t(`layout.brand_short`)),1)):t(``,!0),r.branding.logo?t(``,!0):(o(),d(A,{key:2,name:r.branding.name||`Atrium`,wordmark:!r.collapsed,size:28},null,8,[`name`,`wordmark`]))]),_:1},8,[`href`]),D(`button`,{onClick:a[0]||=e=>i.$emit(`close`),class:`lg:hidden p-2 rounded-md text-sidebar-muted hover:text-sidebar-fg hover:bg-sidebar-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-accent`},[...a[1]||=[D(`svg`,{class:`w-6 h-6`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[D(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])]),D(`nav`,Y,[D(`ul`,ee,[(o(!0),E(T,null,u(r.menu,e=>(o(),d(G,{key:e.route,item:e,collapsed:r.collapsed},null,8,[`item`,`collapsed`]))),128))])]),D(`div`,te,[D(`div`,ne,[D(`div`,re,[D(`span`,ie,w(i.$page.props.auth?.user?.name?.charAt(0)||`A`),1)]),r.collapsed?t(``,!0):(o(),E(`div`,ae,[D(`p`,oe,w(i.$page.props.auth?.user?.name),1),D(`p`,se,w(i.$page.props.auth?.user?.email),1)]))])]),n(k,{on:`sidebar`,compact:r.collapsed,class:e([`border-t border-sidebar-line px-4 py-3`,r.collapsed?`lg:px-2 lg:text-center`:``])},null,8,[`compact`,`class`])],2))}},le=[`aria-expanded`],ue={class:`w-8 h-8 rounded-full bg-accent-soft flex items-center justify-center text-accent-soft-fg font-semibold`},de={class:`hidden md:block text-left`},fe={class:`text-sm font-medium text-fg`},pe={class:`text-xs text-muted`},me={key:0,class:`absolute right-0 mt-2 w-56 bg-surface rounded-lg shadow-lg border border-line py-1 z-50`},he={class:`px-4 py-3 border-b border-line`},ge={class:`text-sm font-medium text-fg`},_e={class:`text-xs text-muted truncate`},ve={class:`py-1`},ye=[`aria-label`],be={class:`px-4 pt-2 pb-1 text-xs font-semibold uppercase tracking-wide text-muted`},xe=[`aria-checked`,`data-theme-option`,`onClick`],Se=[`data-theme`],Ce={key:1,class:`flex h-4 w-6 flex-none overflow-hidden rounded-sm ring-1 ring-field`,"aria-hidden":`true`},we={class:`flex-1 text-left`},Te={key:2,class:`h-4 w-4 flex-none text-accent`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`},Ee={class:`border-t border-line py-1`},De={__name:`AdminUserDropdown`,props:{user:{type:Object,default:()=>({})}},setup(i){let a=m(!1),s=m(null),d=()=>{a.value=!a.value},h=()=>{a.value=!1},v=x(),b=g(()=>v.props.themes||[]),S=g(()=>v.props.theme),O=e=>{N(e),C.put(route(`admin.profile.theme`),{theme:e},{preserveScroll:!0,preserveState:!0})},k=()=>{C.post(route(`admin.logout`))},A=e=>{s.value&&!s.value.contains(e.target)&&h()};return c(()=>{document.addEventListener(`click`,A)}),r(()=>{document.removeEventListener(`click`,A)}),(r,c)=>(o(),E(`div`,{ref_key:`dropdownRef`,ref:s,class:`relative`},[D(`button`,{"data-action":`user-menu`,onClick:d,"aria-expanded":a.value?`true`:`false`,class:`flex items-center gap-3 p-2 rounded-lg hover:bg-hover transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-focus`},[D(`div`,ue,w(i.user.name?.charAt(0)?.toUpperCase()||`A`),1),D(`div`,de,[D(`p`,fe,w(i.user.name),1),D(`p`,pe,w(i.user.email),1)]),c[0]||=D(`svg`,{class:`hidden sm:block w-4 h-4 text-muted`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[D(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19 9l-7 7-7-7`})],-1)],8,le),n(_,{"enter-active-class":`transition ease-out duration-100`,"enter-from-class":`transform opacity-0 scale-95`,"enter-to-class":`transform opacity-100 scale-100`,"leave-active-class":`transition ease-in duration-75`,"leave-from-class":`transform opacity-100 scale-100`,"leave-to-class":`transform opacity-0 scale-95`},{default:p(()=>[a.value?(o(),E(`div`,me,[D(`div`,he,[D(`p`,ge,w(i.user.name),1),D(`p`,_e,w(i.user.email),1)]),D(`div`,ve,[n(l(y),{href:r.route(`admin.profile.edit`),class:`flex items-center px-4 py-2 text-sm text-fg hover:bg-hover`,onClick:h},{default:p(()=>[c[1]||=D(`svg`,{class:`w-4 h-4 mr-3 text-muted`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[D(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})],-1),f(` `+w(r.$t(`layout.user_menu.profile`)),1)]),_:1},8,[`href`])]),D(`div`,{class:`border-t border-line py-1`,role:`radiogroup`,"aria-label":r.$t(`layout.theme.label`)},[D(`p`,be,w(r.$t(`layout.theme.label`)),1),(o(!0),E(T,null,u(b.value,n=>(o(),E(`button`,{key:n,type:`button`,role:`radio`,"aria-checked":n===S.value?`true`:`false`,"data-theme-option":n,class:e([`flex items-center w-full gap-3 px-4 py-2 text-sm text-fg hover:bg-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus`,n===S.value?`font-semibold`:``]),onClick:e=>O(n)},[n===`system`?(o(),E(`span`,Ce,[...c[3]||=[D(`span`,{"data-theme":`graphite`,class:`flex-1 bg-page`},null,-1),D(`span`,{"data-theme":`night`,class:`flex-1 bg-page`},null,-1)]])):(o(),E(`span`,{key:0,"data-theme":n,class:`flex h-4 w-6 flex-none overflow-hidden rounded-sm ring-1 ring-field`,"aria-hidden":`true`},[...c[2]||=[D(`span`,{class:`w-2 bg-sidebar`},null,-1),D(`span`,{class:`flex flex-1 items-center justify-center bg-page`},[D(`span`,{class:`h-1.5 w-1.5 rounded-full bg-accent`})],-1)]],8,Se)),D(`span`,we,w(r.$t(`layout.theme.${n}`)),1),n===S.value?(o(),E(`svg`,Te,[...c[4]||=[D(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2.5`,d:`M5 13l4 4L19 7`},null,-1)]])):t(``,!0)],10,xe))),128))],8,ye),D(`div`,Ee,[D(`button`,{"data-action":`logout`,onClick:k,class:`flex items-center w-full px-4 py-2 text-sm text-danger hover:bg-danger-soft`},[c[5]||=D(`svg`,{class:`w-4 h-4 mr-3`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[D(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1`})],-1),f(` `+w(r.$t(`layout.user_menu.logout`)),1)])])])):t(``,!0)]),_:1})],512))}},Oe={key:0,class:`relative flex min-w-0 items-center gap-1 rounded-lg px-1 py-1 text-muted hover:bg-hover hover:text-fg sm:gap-2 sm:px-2`},ke={class:`flex min-w-0 flex-col text-left leading-tight`,"aria-hidden":`true`},Ae={"data-switcher-caption":``,class:`truncate text-[11px] sm:text-xs`},je={class:`max-w-14 truncate text-sm font-medium text-fg sm:max-w-32 xl:max-w-48`},Me=[`aria-label`,`aria-description`,`title`,`value`],Ne=[`value`],Pe={__name:`SiteSwitcher`,setup(e){let n=x(),r=g(()=>n.props.sites||[]),i=g(()=>n.props.currentSite?.id),a=g(()=>n.props.currentSite?.name??``),s=e=>{C.post(route(`admin.site`),{site_id:e.target.value},{preserveScroll:!0,preserveState:!1})};return(e,n)=>r.value.length>1?(o(),E(`div`,Oe,[n[0]||=D(`svg`,{class:`h-5 w-5 shrink-0`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`},[D(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 8.25V18a2.25 2.25 0 002.25 2.25h13.5A2.25 2.25 0 0021 18V8.25m-18 0V6a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 6v2.25m-18 0h18M5.25 6h.008v.008H5.25V6zm2.25 0h.008v.008H7.5V6zm2.25 0h.008v.008H9.75V6z`})],-1),D(`span`,ke,[D(`span`,Ae,w(e.$t(`layout.site`)),1),D(`span`,je,w(a.value),1)]),n[1]||=D(`svg`,{class:`hidden h-4 w-4 shrink-0 sm:block`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`},[D(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19 9l-7 7-7-7`})],-1),D(`select`,{"data-site-switcher":``,name:`site_id`,"aria-label":e.$t(`layout.site`),"aria-description":e.$t(`layout.site_hint`),title:e.$t(`layout.site_hint`),value:i.value,class:`absolute inset-0 h-full w-full cursor-pointer appearance-none rounded-lg bg-transparent text-transparent focus:outline-none focus-visible:ring-2 focus-visible:ring-focus`,onChange:s},[(o(!0),E(T,null,u(r.value,e=>(o(),E(`option`,{key:e.id,value:e.id,class:`bg-surface text-fg`},w(e.name),9,Ne))),128))],40,Me)])):t(``,!0)}},Fe={class:`sticky top-0 z-30 transform-gpu h-16 bg-surface border-b border-line flex items-center justify-between gap-1 px-3 sm:gap-2 sm:px-4 lg:px-6`},Ie={class:`flex shrink-0 items-center gap-1 sm:gap-4`},Le=[`href`,`title`],Re={class:`hidden sm:inline`},ze={class:`flex min-w-0 items-center gap-1 sm:gap-2 lg:gap-3`},Be={__name:`AdminHeader`,props:{user:{type:Object,default:()=>({})},branding:{type:Object,default:()=>({})}},emits:[`toggle-sidebar`,`toggle-collapse`],setup(e,{emit:t}){return(t,r)=>(o(),E(`header`,Fe,[D(`div`,Ie,[D(`button`,{onClick:r[0]||=e=>t.$emit(`toggle-sidebar`),class:`lg:hidden p-2 rounded-md text-muted hover:text-fg hover:bg-hover`},[...r[2]||=[D(`svg`,{class:`w-6 h-6`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[D(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 6h16M4 12h16M4 18h16`})],-1)]]),D(`button`,{"data-action":`collapse-sidebar`,onClick:r[1]||=e=>t.$emit(`toggle-collapse`),class:`hidden lg:block p-2 rounded-md text-muted hover:text-fg hover:bg-hover`},[...r[3]||=[D(`svg`,{class:`w-5 h-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[D(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 6h16M4 12h8m-8 6h16`})],-1)]]),D(`a`,{"data-action":`visit-site`,href:t.$page.props.currentSite?.url||`/`,target:`_blank`,rel:`noopener`,class:`flex items-center gap-2 rounded-md px-2 py-2 text-sm text-muted hover:bg-hover hover:text-fg`,title:t.$t(`layout.visit_site_hint`)},[r[4]||=D(`svg`,{class:`w-5 h-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[D(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M21 12a9 9 0 11-18 0 9 9 0 0118 0zM3.6 9h16.8M3.6 15h16.8M12 3a15 15 0 010 18M12 3a15 15 0 000 18`})],-1),D(`span`,Re,w(t.$t(`layout.visit_site`)),1)],8,Le)]),D(`div`,ze,[n(Pe),n(j),n(De,{user:e.user},null,8,[`user`])])]))}};function X(){return M(`fields.upload.session_expired`)}function Ve(e){let t=document.cookie.match(RegExp(`(?:^|;\\s*)`+e+`=([^;]*)`));if(!t)return null;try{return decodeURIComponent(t[1])}catch{return t[1]}}function He(){let e=Ve(`XSRF-TOKEN`);if(e)return{"X-XSRF-TOKEN":e};let t=document.querySelector(`meta[name="csrf-token"]`)?.getAttribute(`content`);return t?{"X-CSRF-TOKEN":t}:{}}function Z(e={}){return{Accept:`application/json`,"X-Requested-With":`XMLHttpRequest`,...He(),...e}}async function Q(e,t=M(`fields.upload.request_failed`)){return e.status===419?X():e.status===413?M(`fields.upload.too_large`):(await e.json().catch(()=>({}))).message||t}var Ue=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},We=[`aria-label`],Ge={class:`flex items-center justify-between gap-2 border-b border-line px-4 py-2.5`},Ke={class:`text-sm font-semibold`},qe={class:`flex items-center gap-3 text-xs`},Je=[`aria-label`],Ye={class:`rounded-lg bg-surface-alt px-3 py-2`},Xe={key:0,class:`max-w-[85%] whitespace-pre-wrap rounded-lg bg-accent-soft px-3 py-2 text-accent-soft-fg`,dusk:`ai-question`},Ze=[`dusk`,`innerHTML`],Qe={key:0,class:`text-muted`,dusk:`ai-thinking`},$e={class:`flex items-end gap-2`},et=[`placeholder`,`aria-label`],tt=[`disabled`],$={class:`mt-2 text-xs text-muted`},nt=[`aria-label`,`aria-expanded`,`title`],rt={viewBox:`0 0 48 52`,class:`h-full w-full overflow-visible`,"aria-hidden":`true`},it={class:`ai-mascot-body`},at={class:`ai-mascot-eyes`},ot=[`cx`,`cy`],st=[`cx`,`cy`],ct=Ue({__name:`AiHelper`,setup(n){let l=x(),d=g(()=>l.props.ai?.help||null),f=g(()=>d.value?.labels||{}),p=g(()=>l.props.ai?.url||``),_=g(()=>`atrium-ai-help:${l.props.auth?.user?.id??``}`),v=m(!1),y=m(!1),S=m(``),O=m([]),k=m(null),A=m(null),j=m({x:0,y:0}),M=m(null),N=null,P=0;c(()=>{try{O.value=JSON.parse(sessionStorage.getItem(_.value)||`[]`)}catch{O.value=[]}window.addEventListener(`pointermove`,F)}),r(()=>{I(),window.removeEventListener(`pointermove`,F)}),a(O,e=>{try{sessionStorage.setItem(_.value,JSON.stringify(e.slice(-20)))}catch{}},{deep:!0});function F(e){let t=M.value?.getBoundingClientRect();if(!t)return;let n=e.clientX-(t.left+t.width/2),r=e.clientY-(t.top+t.height/3),i=Math.hypot(n,r)||1;j.value={x:n/i*.9,y:r/i*.9}}function I(){clearTimeout(N),N=null,P++}async function L(){v.value=!v.value,v.value&&(await s(),z(),A.value?.focus())}function R(){I(),y.value=!1,O.value=[],A.value?.focus()}async function z(){await s(),k.value&&(k.value.scrollTop=k.value.scrollHeight)}async function B(){let e=S.value.trim();if(e===``||y.value)return;let t=O.value.filter(e=>!e.error).slice(-10).map(({role:e,text:t})=>({role:e,text:t}));O.value.push({role:`user`,text:e}),S.value=``,y.value=!0,z(),I();let n=P;try{let r=await fetch(d.value.url,{method:`POST`,credentials:`same-origin`,headers:Z({"Content-Type":`application/json`}),body:JSON.stringify({question:e,history:t})});if(!r.ok)throw Error(await Q(r,f.value.error));V(await r.json(),n)}catch(e){n===P&&U(e.message)}}function V(e,t){t===P&&(e.status===`done`?(y.value=!1,O.value.push({role:`assistant`,text:e.value||``}),z()):e.status===`failed`?U(e.message):N=setTimeout(()=>H(e.id,t),1500))}async function H(e,t){try{let n=await fetch(`${p.value}/${e}`,{credentials:`same-origin`,headers:Z()});if(!n.ok)throw Error(await Q(n,f.value.error));V(await n.json(),t)}catch(e){t===P&&U(e.message)}}function U(e){y.value=!1,O.value.push({role:`assistant`,text:e||f.value.error,error:!0}),z()}function W(e){e.key===`Enter`&&!e.shiftKey&&!e.isComposing&&(e.preventDefault(),B())}let G={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},K=e=>String(e).replace(/[&<>"']/g,e=>G[e]);function q(e){let t=e=>K(e).replace(/\*\*(.+?)\*\*/g,`$1 `).replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,(e,t,n)=>n.startsWith(`/`)&&!n.startsWith(`//`)?`${t} `:t),n=[],r=[],i=()=>{r.length&&(n.push(`${r.map(e=>`${e} `).join(``)} `),r=[])};for(let a of String(e).split(/\r?\n/)){let e=a.match(/^\s*[-*]\s+(.*)$/);e?r.push(t(e[1])):(i(),a.trim()!==``&&n.push(`${t(a)}
`))}return i(),n.join(``)}function J(e){let t=e.target.closest?.(`a[data-ai-link]`);t&&(e.preventDefault(),C.visit(t.getAttribute(`href`)))}function Y(e){e.key===`Escape`&&v.value&&(v.value=!1)}return(n,r)=>d.value?(o(),E(`div`,{key:0,class:`fixed bottom-4 right-4 z-40 flex flex-col items-end gap-3`,dusk:`ai-helper`,onKeydown:Y},[v.value?(o(),E(`section`,{key:0,class:`flex w-[22rem] max-w-[calc(100vw-2rem)] max-h-[min(36rem,calc(100vh-8rem))] flex-col rounded-lg border border-line bg-surface text-fg shadow-xl`,role:`dialog`,"aria-label":f.value.title,dusk:`ai-chat`},[D(`header`,Ge,[D(`h2`,Ke,w(f.value.title),1),D(`div`,qe,[O.value.length?(o(),E(`button`,{key:0,type:`button`,class:`text-muted hover:text-fg`,dusk:`ai-clear`,onClick:R},w(f.value.clear),1)):t(``,!0),D(`button`,{type:`button`,class:`text-muted hover:text-fg`,"aria-label":f.value.close,dusk:`ai-close`,onClick:r[0]||=e=>v.value=!1},[...r[2]||=[D(`svg`,{class:`h-4 w-4`,viewBox:`0 0 20 20`,fill:`currentColor`,"aria-hidden":`true`},[D(`path`,{d:`M5.3 4.3 10 9l4.7-4.7 1 1L11 10l4.7 4.7-1 1L10 11l-4.7 4.7-1-1L9 10 4.3 5.3z`})],-1)]],8,Je)])]),D(`div`,{ref_key:`list`,ref:k,class:`flex-1 space-y-3 overflow-y-auto px-4 py-3 text-sm`,"aria-live":`polite`,onClick:J},[D(`p`,Ye,w(f.value.hello),1),(o(!0),E(T,null,u(O.value,(t,n)=>(o(),E(`div`,{key:n,class:e([`flex`,t.role===`user`?`justify-end`:`justify-start`])},[t.role===`user`?(o(),E(`p`,Xe,w(t.text),1)):(o(),E(`div`,{key:1,class:e([`max-w-[90%] space-y-2 rounded-lg px-3 py-2`,t.error?`border border-danger bg-danger-soft text-danger-soft-fg`:`bg-surface-alt`]),dusk:t.error?`ai-error`:`ai-answer`,innerHTML:q(t.text)},null,10,Ze))],2))),128)),y.value?(o(),E(`p`,Qe,w(f.value.thinking),1)):t(``,!0)],512),D(`form`,{class:`border-t border-line p-3`,onSubmit:h(B,[`prevent`])},[D(`div`,$e,[i(D(`textarea`,{ref_key:`input`,ref:A,"onUpdate:modelValue":r[1]||=e=>S.value=e,rows:`2`,maxlength:`2000`,class:`flex-1 resize-none rounded-md border border-field bg-surface px-3 py-2 text-sm text-fg focus:border-focus focus:outline-none focus:ring-1 focus:ring-focus`,placeholder:f.value.placeholder,"aria-label":f.value.placeholder,dusk:`ai-input`,onKeydown:W},null,40,et),[[b,S.value]]),D(`button`,{type:`submit`,class:`rounded-md bg-accent px-3 py-2 text-sm font-medium text-on-accent hover:bg-accent-hover disabled:opacity-50`,disabled:y.value||S.value.trim()===``,dusk:`ai-send`},w(f.value.send),9,tt)]),D(`p`,$,w(f.value.note),1)],32)],8,We)):t(``,!0),D(`button`,{ref_key:`mascot`,ref:M,type:`button`,class:e([`ai-mascot group relative h-16 w-16 rounded-full focus:outline-none focus-visible:ring-2 focus-visible:ring-focus`,{"is-thinking":y.value,"is-open":v.value}]),"aria-label":f.value.open,"aria-expanded":v.value,title:f.value.open,dusk:`ai-mascot`,onClick:L},[(o(),E(`svg`,rt,[r[9]||=D(`ellipse`,{class:`ai-mascot-shadow fill-fg`,cx:`24`,cy:`49`,rx:`15`,ry:`2.2`,opacity:`0.15`},null,-1),D(`g`,it,[r[5]||=D(`path`,{class:`fill-fg`,d:`M6 42V22a18 18 0 0 1 36 0v20H32V22a8 8 0 0 0-16 0v20z`},null,-1),r[6]||=D(`rect`,{class:`ai-mascot-belt fill-accent`,x:`16`,y:`28`,width:`16`,height:`5`},null,-1),r[7]||=D(`rect`,{class:`fill-fg`,x:`4`,y:`41`,width:`13`,height:`3.5`,rx:`1.75`},null,-1),r[8]||=D(`rect`,{class:`fill-fg`,x:`31`,y:`41`,width:`13`,height:`3.5`,rx:`1.75`},null,-1),D(`g`,at,[r[3]||=D(`circle`,{class:`fill-surface`,cx:`19`,cy:`10.5`,r:`3`},null,-1),r[4]||=D(`circle`,{class:`fill-surface`,cx:`29`,cy:`10.5`,r:`3`},null,-1),D(`circle`,{class:`fill-fg`,cx:19+j.value.x,cy:10.5+j.value.y,r:`1.4`},null,8,ot),D(`circle`,{class:`fill-fg`,cx:29+j.value.x,cy:10.5+j.value.y,r:`1.4`},null,8,st)])])]))],10,nt)],32)):t(``,!0)}},[[`__scopeId`,`data-v-6928fa25`]]),lt={class:`min-h-screen bg-page`},ut={"data-page-content":`true`,class:`p-4 lg:p-6`},dt={key:0,"data-flash":`success`,class:`mb-4 p-4 bg-success-soft border border-success text-success-soft-fg rounded`},ft={key:1,"data-flash":`error`,class:`mb-4 p-4 bg-danger-soft border border-danger text-danger-soft-fg rounded`},pt={__name:`AdminLayout`,props:{title:{type:String,default:``}},setup(r){let i=x(),a=m(!1),s=m(!1),c=g(()=>i.props.branding||{}),u=g(()=>i.props.menu||[]),d=g(()=>i.props.auth?.user||{}),f=()=>{a.value=!a.value},p=()=>{s.value=!s.value},h=()=>{a.value=!1};return(i,m)=>(o(),E(T,null,[n(l(S),{title:r.title||``},null,8,[`title`]),D(`div`,lt,[a.value?(o(),E(`div`,{key:0,class:`fixed inset-0 z-40 bg-black/50 lg:hidden`,onClick:h})):t(``,!0),n(ce,{open:a.value,collapsed:s.value,menu:u.value,branding:c.value,onClose:h},null,8,[`open`,`collapsed`,`menu`,`branding`]),D(`div`,{class:e([`transition-all duration-300`,s.value?`lg:pl-20`:`lg:pl-64`])},[n(Be,{user:d.value,branding:c.value,onToggleSidebar:f,onToggleCollapse:p},null,8,[`user`,`branding`]),D(`main`,ut,[i.$page.props.flash?.success?(o(),E(`div`,dt,w(i.$page.props.flash.success),1)):t(``,!0),i.$page.props.flash?.error?(o(),E(`div`,ft,w(i.$page.props.flash.error),1)):t(``,!0),O(i.$slots,`default`)])],2),n(ct)])],64))}};export{X as i,Z as n,Q as r,pt as t};
\ No newline at end of file
+import{$ as e,C as t,E as n,F as r,G as i,H as a,I as o,M as s,P as c,Q as l,R as u,S as d,T as f,W as p,X as m,_ as h,b as g,c as _,h as v,i as y,m as b,o as x,r as S,s as C,tt as w,v as T,w as E,x as D,z as O}from"./dist-Bie52OmN.js";import{n as k,r as A,t as j}from"./LocaleSwitcher-DAWnmZni.js";import{n as M,t as N}from"./app-Cdw8k5No.js";var P=[`aria-expanded`,`title`],F={class:`flex items-center`},I=[`innerHTML`],L={key:0},R=[`innerHTML`],z={key:0,class:`mt-1 ml-4 space-y-1 border-l border-sidebar-line pl-3`},B=[`innerHTML`],V={key:0},H=`flex items-center px-3 py-2 text-sm rounded-lg transition-colors duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-accent`,U=`bg-sidebar-active text-sidebar-active-fg font-semibold shadow-[inset_3px_0_0_var(--atrium-sidebar-accent)]`,W=`text-sidebar-fg font-medium hover:bg-sidebar-hover`,G={__name:`AdminMenuItem`,props:{item:{type:Object,required:!0},collapsed:Boolean},setup(r){let a=r,s=x(),c=m(!1),h=g(()=>a.item.children&&a.item.children.length>0),_=e=>{let t=route(e,void 0,!1),n=s.url.split(`?`)[0];return n===t||t!==route(`admin.dashboard`,void 0,!1)&&n.startsWith(t+`/`)},b=g(()=>!!a.item.route&&_(a.item.route)),S=g(()=>h.value?a.item.children.some(e=>e.route&&_(e.route)):!1),C=()=>{h.value&&(c.value=!c.value)};S.value&&(c.value=!0);let O={home:` `,users:` `,settings:` `,folder:` `,document:` `,chart:` `,"file-text":` `,package:` `,"help-circle":` `,briefcase:` `,star:` `,tool:` `,info:` `,image:` `,inbox:` `,"shopping-cart":` `,globe:` `,shield:` `,chevronDown:` `,default:` `},k=e=>_(e.route),A=g(()=>O[a.item.icon]||O.default);return(a,s)=>(o(),E(`li`,null,[h.value?(o(),E(T,{key:0},[D(`button`,{onClick:C,class:e([`w-full flex items-center px-3 py-2 text-sm rounded-lg transition-colors duration-200 hover:bg-sidebar-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-accent`,[S.value?`text-sidebar-fg font-semibold`:`text-sidebar-fg font-medium`,r.collapsed?`justify-center`:`justify-between`]]),"aria-expanded":c.value?`true`:`false`,title:r.collapsed?r.item.label:``},[D(`span`,F,[(o(),E(`svg`,{class:e([`w-5 h-5 flex-shrink-0 text-sidebar-muted`,r.collapsed?``:`mr-3`]),fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`,innerHTML:A.value},null,10,I)),r.collapsed?t(``,!0):(o(),E(`span`,L,w(r.item.label),1))]),r.collapsed?t(``,!0):(o(),E(`svg`,{key:0,class:e([`w-4 h-4 text-sidebar-muted transition-transform duration-200`,{"rotate-180":c.value}]),"aria-hidden":`true`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,innerHTML:O.chevronDown},null,10,R))],10,P),r.collapsed?t(``,!0):i((o(),E(`ul`,z,[(o(!0),E(T,null,u(r.item.children,t=>(o(),E(`li`,{key:t.route},[n(l(y),{"data-menu-route":t.route,href:a.route(t.route),class:e([H,k(t)?U:W]),"aria-current":k(t)?`page`:void 0},{default:p(()=>[f(w(t.label),1)]),_:2},1032,[`data-menu-route`,`href`,`class`,`aria-current`])]))),128))],512)),[[v,c.value]])],64)):(o(),d(l(y),{key:1,"data-menu-route":r.item.route,href:a.route(r.item.route),class:e([H,b.value?U:W,r.collapsed?`justify-center`:``]),"aria-current":b.value?`page`:void 0,title:r.collapsed?r.item.label:``},{default:p(()=>[(o(),E(`svg`,{class:e([`w-5 h-5 flex-shrink-0`,[r.collapsed?``:`mr-3`,b.value?``:`text-sidebar-muted`]]),fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`,innerHTML:A.value},null,10,B)),r.collapsed?t(``,!0):(o(),E(`span`,V,w(r.item.label),1))]),_:1},8,[`data-menu-route`,`href`,`class`,`aria-current`,`title`]))]))}},K={class:`h-16 flex items-center justify-between px-4 border-b border-sidebar-line`},q=[`src`,`alt`],J={key:1,class:`text-xl font-bold truncate`},Y={class:`flex-1 overflow-y-auto py-4 px-3`},ee={class:`space-y-1`},te={class:`lg:hidden border-t border-sidebar-line p-4`},ne={class:`flex items-center space-x-3`},re={class:`w-10 h-10 rounded-full bg-sidebar-active text-sidebar-active-fg flex items-center justify-center`},ie={class:`text-lg font-medium`},ae={key:0},oe={class:`text-sm font-medium`},se={class:`text-xs text-sidebar-muted`},ce={__name:`AdminSidebar`,props:{open:Boolean,collapsed:Boolean,menu:{type:Array,default:()=>[]},branding:{type:Object,default:()=>({})}},emits:[`close`],setup(r,{emit:i}){let a=x();return g(()=>a.url),(i,a)=>(o(),E(`aside`,{class:e([`fixed inset-y-0 left-0 z-50 flex flex-col bg-sidebar text-sidebar-fg border-r border-sidebar-line transform transition-transform duration-300 lg:translate-x-0`,[r.open?`translate-x-0`:`-translate-x-full`,r.collapsed?`lg:w-20`:`lg:w-64`,`w-64`]])},[D(`div`,K,[n(l(y),{href:i.route(`admin.dashboard`),"data-sidebar-brand":``,class:`flex min-w-0 items-center space-x-3 rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-accent`},{default:p(()=>[r.branding.logo?(o(),E(`img`,{key:0,src:r.branding.logo,alt:r.branding.name,class:`h-8 w-auto`},null,8,q)):t(``,!0),r.branding.logo&&!r.collapsed?(o(),E(`span`,J,w(r.branding.name||i.$t(`layout.brand_short`)),1)):t(``,!0),r.branding.logo?t(``,!0):(o(),d(A,{key:2,name:r.branding.name||`Atrium`,wordmark:!r.collapsed,size:28},null,8,[`name`,`wordmark`]))]),_:1},8,[`href`]),D(`button`,{onClick:a[0]||=e=>i.$emit(`close`),class:`lg:hidden p-2 rounded-md text-sidebar-muted hover:text-sidebar-fg hover:bg-sidebar-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-accent`},[...a[1]||=[D(`svg`,{class:`w-6 h-6`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[D(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])]),D(`nav`,Y,[D(`ul`,ee,[(o(!0),E(T,null,u(r.menu,e=>(o(),d(G,{key:e.route,item:e,collapsed:r.collapsed},null,8,[`item`,`collapsed`]))),128))])]),D(`div`,te,[D(`div`,ne,[D(`div`,re,[D(`span`,ie,w(i.$page.props.auth?.user?.name?.charAt(0)||`A`),1)]),r.collapsed?t(``,!0):(o(),E(`div`,ae,[D(`p`,oe,w(i.$page.props.auth?.user?.name),1),D(`p`,se,w(i.$page.props.auth?.user?.email),1)]))])]),n(k,{on:`sidebar`,compact:r.collapsed,class:e([`border-t border-sidebar-line px-4 py-3`,r.collapsed?`lg:px-2 lg:text-center`:``])},null,8,[`compact`,`class`])],2))}},le=[`aria-expanded`],ue={class:`w-8 h-8 rounded-full bg-accent-soft flex items-center justify-center text-accent-soft-fg font-semibold`},de={class:`hidden md:block text-left`},fe={class:`text-sm font-medium text-fg`},pe={class:`text-xs text-muted`},me={key:0,class:`absolute right-0 mt-2 w-56 bg-surface rounded-lg shadow-lg border border-line py-1 z-50`},he={class:`px-4 py-3 border-b border-line`},ge={class:`text-sm font-medium text-fg`},_e={class:`text-xs text-muted truncate`},ve={class:`py-1`},ye=[`aria-label`],be={class:`px-4 pt-2 pb-1 text-xs font-semibold uppercase tracking-wide text-muted`},xe=[`aria-checked`,`data-theme-option`,`onClick`],Se=[`data-theme`],Ce={key:1,class:`flex h-4 w-6 flex-none overflow-hidden rounded-sm ring-1 ring-field`,"aria-hidden":`true`},we={class:`flex-1 text-left`},Te={key:2,class:`h-4 w-4 flex-none text-accent`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`},Ee={class:`border-t border-line py-1`},De={__name:`AdminUserDropdown`,props:{user:{type:Object,default:()=>({})}},setup(i){let a=m(!1),s=m(null),d=()=>{a.value=!a.value},h=()=>{a.value=!1},v=x(),b=g(()=>v.props.themes||[]),S=g(()=>v.props.theme),O=e=>{N(e),C.put(route(`admin.profile.theme`),{theme:e},{preserveScroll:!0,preserveState:!0})},k=()=>{C.post(route(`admin.logout`))},A=e=>{s.value&&!s.value.contains(e.target)&&h()};return c(()=>{document.addEventListener(`click`,A)}),r(()=>{document.removeEventListener(`click`,A)}),(r,c)=>(o(),E(`div`,{ref_key:`dropdownRef`,ref:s,class:`relative`},[D(`button`,{"data-action":`user-menu`,onClick:d,"aria-expanded":a.value?`true`:`false`,class:`flex items-center gap-3 p-2 rounded-lg hover:bg-hover transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-focus`},[D(`div`,ue,w(i.user.name?.charAt(0)?.toUpperCase()||`A`),1),D(`div`,de,[D(`p`,fe,w(i.user.name),1),D(`p`,pe,w(i.user.email),1)]),c[0]||=D(`svg`,{class:`hidden sm:block w-4 h-4 text-muted`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[D(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19 9l-7 7-7-7`})],-1)],8,le),n(_,{"enter-active-class":`transition ease-out duration-100`,"enter-from-class":`transform opacity-0 scale-95`,"enter-to-class":`transform opacity-100 scale-100`,"leave-active-class":`transition ease-in duration-75`,"leave-from-class":`transform opacity-100 scale-100`,"leave-to-class":`transform opacity-0 scale-95`},{default:p(()=>[a.value?(o(),E(`div`,me,[D(`div`,he,[D(`p`,ge,w(i.user.name),1),D(`p`,_e,w(i.user.email),1)]),D(`div`,ve,[n(l(y),{href:r.route(`admin.profile.edit`),class:`flex items-center px-4 py-2 text-sm text-fg hover:bg-hover`,onClick:h},{default:p(()=>[c[1]||=D(`svg`,{class:`w-4 h-4 mr-3 text-muted`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[D(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})],-1),f(` `+w(r.$t(`layout.user_menu.profile`)),1)]),_:1},8,[`href`])]),D(`div`,{class:`border-t border-line py-1`,role:`radiogroup`,"aria-label":r.$t(`layout.theme.label`)},[D(`p`,be,w(r.$t(`layout.theme.label`)),1),(o(!0),E(T,null,u(b.value,n=>(o(),E(`button`,{key:n,type:`button`,role:`radio`,"aria-checked":n===S.value?`true`:`false`,"data-theme-option":n,class:e([`flex items-center w-full gap-3 px-4 py-2 text-sm text-fg hover:bg-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus`,n===S.value?`font-semibold`:``]),onClick:e=>O(n)},[n===`system`?(o(),E(`span`,Ce,[...c[3]||=[D(`span`,{"data-theme":`graphite`,class:`flex-1 bg-page`},null,-1),D(`span`,{"data-theme":`night`,class:`flex-1 bg-page`},null,-1)]])):(o(),E(`span`,{key:0,"data-theme":n,class:`flex h-4 w-6 flex-none overflow-hidden rounded-sm ring-1 ring-field`,"aria-hidden":`true`},[...c[2]||=[D(`span`,{class:`w-2 bg-sidebar`},null,-1),D(`span`,{class:`flex flex-1 items-center justify-center bg-page`},[D(`span`,{class:`h-1.5 w-1.5 rounded-full bg-accent`})],-1)]],8,Se)),D(`span`,we,w(r.$t(`layout.theme.${n}`)),1),n===S.value?(o(),E(`svg`,Te,[...c[4]||=[D(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2.5`,d:`M5 13l4 4L19 7`},null,-1)]])):t(``,!0)],10,xe))),128))],8,ye),D(`div`,Ee,[D(`button`,{"data-action":`logout`,onClick:k,class:`flex items-center w-full px-4 py-2 text-sm text-danger hover:bg-danger-soft`},[c[5]||=D(`svg`,{class:`w-4 h-4 mr-3`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[D(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1`})],-1),f(` `+w(r.$t(`layout.user_menu.logout`)),1)])])])):t(``,!0)]),_:1})],512))}},Oe={key:0,class:`relative flex min-w-0 items-center gap-1 rounded-lg px-1 py-1 text-muted hover:bg-hover hover:text-fg sm:gap-2 sm:px-2`},ke={class:`flex min-w-0 flex-col text-left leading-tight`,"aria-hidden":`true`},Ae={"data-switcher-caption":``,class:`truncate text-[11px] sm:text-xs`},je={class:`max-w-14 truncate text-sm font-medium text-fg sm:max-w-32 xl:max-w-48`},Me=[`aria-label`,`aria-description`,`title`,`value`],Ne=[`value`],Pe={__name:`SiteSwitcher`,setup(e){let n=x(),r=g(()=>n.props.sites||[]),i=g(()=>n.props.currentSite?.id),a=g(()=>n.props.currentSite?.name??``),s=e=>{C.post(route(`admin.site`),{site_id:e.target.value},{preserveScroll:!0,preserveState:!1})};return(e,n)=>r.value.length>1?(o(),E(`div`,Oe,[n[0]||=D(`svg`,{class:`h-5 w-5 shrink-0`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`},[D(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 8.25V18a2.25 2.25 0 002.25 2.25h13.5A2.25 2.25 0 0021 18V8.25m-18 0V6a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 6v2.25m-18 0h18M5.25 6h.008v.008H5.25V6zm2.25 0h.008v.008H7.5V6zm2.25 0h.008v.008H9.75V6z`})],-1),D(`span`,ke,[D(`span`,Ae,w(e.$t(`layout.site`)),1),D(`span`,je,w(a.value),1)]),n[1]||=D(`svg`,{class:`hidden h-4 w-4 shrink-0 sm:block`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`},[D(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19 9l-7 7-7-7`})],-1),D(`select`,{"data-site-switcher":``,name:`site_id`,"aria-label":e.$t(`layout.site`),"aria-description":e.$t(`layout.site_hint`),title:e.$t(`layout.site_hint`),value:i.value,class:`absolute inset-0 h-full w-full cursor-pointer appearance-none rounded-lg bg-transparent text-transparent focus:outline-none focus-visible:ring-2 focus-visible:ring-focus`,onChange:s},[(o(!0),E(T,null,u(r.value,e=>(o(),E(`option`,{key:e.id,value:e.id,class:`bg-surface text-fg`},w(e.name),9,Ne))),128))],40,Me)])):t(``,!0)}},Fe={class:`sticky top-0 z-30 transform-gpu h-16 bg-surface border-b border-line flex items-center justify-between gap-1 px-3 sm:gap-2 sm:px-4 lg:px-6`},Ie={class:`flex shrink-0 items-center gap-1 sm:gap-4`},Le=[`href`,`title`],Re={class:`hidden sm:inline`},ze={class:`flex min-w-0 items-center gap-1 sm:gap-2 lg:gap-3`},Be={__name:`AdminHeader`,props:{user:{type:Object,default:()=>({})},branding:{type:Object,default:()=>({})}},emits:[`toggle-sidebar`,`toggle-collapse`],setup(e,{emit:t}){return(t,r)=>(o(),E(`header`,Fe,[D(`div`,Ie,[D(`button`,{onClick:r[0]||=e=>t.$emit(`toggle-sidebar`),class:`lg:hidden p-2 rounded-md text-muted hover:text-fg hover:bg-hover`},[...r[2]||=[D(`svg`,{class:`w-6 h-6`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[D(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 6h16M4 12h16M4 18h16`})],-1)]]),D(`button`,{"data-action":`collapse-sidebar`,onClick:r[1]||=e=>t.$emit(`toggle-collapse`),class:`hidden lg:block p-2 rounded-md text-muted hover:text-fg hover:bg-hover`},[...r[3]||=[D(`svg`,{class:`w-5 h-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[D(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 6h16M4 12h8m-8 6h16`})],-1)]]),D(`a`,{"data-action":`visit-site`,href:t.$page.props.currentSite?.url||`/`,target:`_blank`,rel:`noopener`,class:`flex items-center gap-2 rounded-md px-2 py-2 text-sm text-muted hover:bg-hover hover:text-fg`,title:t.$t(`layout.visit_site_hint`)},[r[4]||=D(`svg`,{class:`w-5 h-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[D(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M21 12a9 9 0 11-18 0 9 9 0 0118 0zM3.6 9h16.8M3.6 15h16.8M12 3a15 15 0 010 18M12 3a15 15 0 000 18`})],-1),D(`span`,Re,w(t.$t(`layout.visit_site`)),1)],8,Le)]),D(`div`,ze,[n(Pe),n(j),n(De,{user:e.user},null,8,[`user`])])]))}};function X(){return M(`fields.upload.session_expired`)}function Ve(e){let t=document.cookie.match(RegExp(`(?:^|;\\s*)`+e+`=([^;]*)`));if(!t)return null;try{return decodeURIComponent(t[1])}catch{return t[1]}}function He(){let e=Ve(`XSRF-TOKEN`);if(e)return{"X-XSRF-TOKEN":e};let t=document.querySelector(`meta[name="csrf-token"]`)?.getAttribute(`content`);return t?{"X-CSRF-TOKEN":t}:{}}function Z(e={}){return{Accept:`application/json`,"X-Requested-With":`XMLHttpRequest`,...He(),...e}}async function Q(e,t=M(`fields.upload.request_failed`)){return e.status===419?X():e.status===413?M(`fields.upload.too_large`):(await e.json().catch(()=>({}))).message||t}var Ue=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},We=[`aria-label`],Ge={class:`flex items-center justify-between gap-2 border-b border-line px-4 py-2.5`},Ke={class:`text-sm font-semibold`},qe={class:`flex items-center gap-3 text-xs`},Je=[`aria-label`],Ye={class:`rounded-lg bg-surface-alt px-3 py-2`},Xe={key:0,class:`max-w-[85%] whitespace-pre-wrap rounded-lg bg-accent-soft px-3 py-2 text-accent-soft-fg`,dusk:`ai-question`},Ze=[`dusk`,`innerHTML`],Qe={key:0,class:`text-muted`,dusk:`ai-thinking`},$e={class:`flex items-end gap-2`},et=[`placeholder`,`aria-label`],tt=[`disabled`],$={class:`mt-2 text-xs text-muted`},nt=[`aria-label`,`aria-expanded`,`title`],rt={viewBox:`0 0 48 52`,class:`h-full w-full overflow-visible`,"aria-hidden":`true`},it={class:`ai-mascot-body`},at={class:`ai-mascot-eyes`},ot=[`cx`,`cy`],st=[`cx`,`cy`],ct=Ue({__name:`AiHelper`,setup(n){let l=x(),d=g(()=>l.props.ai?.help||null),f=g(()=>d.value?.labels||{}),p=g(()=>l.props.ai?.url||``),_=g(()=>`atrium-ai-help:${l.props.auth?.user?.id??``}`),v=m(!1),y=m(!1),S=m(``),O=m([]),k=m(null),A=m(null),j=m({x:0,y:0}),M=m(null),N=null,P=0;c(()=>{try{O.value=JSON.parse(sessionStorage.getItem(_.value)||`[]`)}catch{O.value=[]}window.addEventListener(`pointermove`,F)}),r(()=>{I(),window.removeEventListener(`pointermove`,F)}),a(O,e=>{try{sessionStorage.setItem(_.value,JSON.stringify(e.slice(-20)))}catch{}},{deep:!0});function F(e){let t=M.value?.getBoundingClientRect();if(!t)return;let n=e.clientX-(t.left+t.width/2),r=e.clientY-(t.top+t.height/3),i=Math.hypot(n,r)||1;j.value={x:n/i*.9,y:r/i*.9}}function I(){clearTimeout(N),N=null,P++}async function L(){v.value=!v.value,v.value&&(await s(),z(),A.value?.focus())}function R(){I(),y.value=!1,O.value=[],A.value?.focus()}async function z(){await s(),k.value&&(k.value.scrollTop=k.value.scrollHeight)}async function B(){let e=S.value.trim();if(e===``||y.value)return;let t=O.value.filter(e=>!e.error).slice(-10).map(({role:e,text:t})=>({role:e,text:t}));O.value.push({role:`user`,text:e}),S.value=``,y.value=!0,z(),I();let n=P;try{let r=await fetch(d.value.url,{method:`POST`,credentials:`same-origin`,headers:Z({"Content-Type":`application/json`}),body:JSON.stringify({question:e,history:t})});if(!r.ok)throw Error(await Q(r,f.value.error));V(await r.json(),n)}catch(e){n===P&&U(e.message)}}function V(e,t){t===P&&(e.status===`done`?(y.value=!1,O.value.push({role:`assistant`,text:e.value||``}),z()):e.status===`failed`?U(e.message):N=setTimeout(()=>H(e.id,t),1500))}async function H(e,t){try{let n=await fetch(`${p.value}/${e}`,{credentials:`same-origin`,headers:Z()});if(!n.ok)throw Error(await Q(n,f.value.error));V(await n.json(),t)}catch(e){t===P&&U(e.message)}}function U(e){y.value=!1,O.value.push({role:`assistant`,text:e||f.value.error,error:!0}),z()}function W(e){e.key===`Enter`&&!e.shiftKey&&!e.isComposing&&(e.preventDefault(),B())}let G={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},K=e=>String(e).replace(/[&<>"']/g,e=>G[e]);function q(e){let t=e=>K(e).replace(/\*\*(.+?)\*\*/g,`$1 `).replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,(e,t,n)=>n.startsWith(`/`)&&!n.startsWith(`//`)?`${t} `:t),n=[],r=[],i=()=>{r.length&&(n.push(`${r.map(e=>`${e} `).join(``)} `),r=[])};for(let a of String(e).split(/\r?\n/)){let e=a.match(/^\s*[-*]\s+(.*)$/);e?r.push(t(e[1])):(i(),a.trim()!==``&&n.push(`${t(a)}
`))}return i(),n.join(``)}function J(e){let t=e.target.closest?.(`a[data-ai-link]`);t&&(e.preventDefault(),C.visit(t.getAttribute(`href`)))}function Y(e){e.key===`Escape`&&v.value&&(v.value=!1)}return(n,r)=>d.value?(o(),E(`div`,{key:0,class:`fixed bottom-4 right-4 z-40 flex flex-col items-end gap-3`,dusk:`ai-helper`,onKeydown:Y},[v.value?(o(),E(`section`,{key:0,class:`flex w-[22rem] max-w-[calc(100vw-2rem)] max-h-[min(36rem,calc(100vh-8rem))] flex-col rounded-lg border border-line bg-surface text-fg shadow-xl`,role:`dialog`,"aria-label":f.value.title,dusk:`ai-chat`},[D(`header`,Ge,[D(`h2`,Ke,w(f.value.title),1),D(`div`,qe,[O.value.length?(o(),E(`button`,{key:0,type:`button`,class:`text-muted hover:text-fg`,dusk:`ai-clear`,onClick:R},w(f.value.clear),1)):t(``,!0),D(`button`,{type:`button`,class:`text-muted hover:text-fg`,"aria-label":f.value.close,dusk:`ai-close`,onClick:r[0]||=e=>v.value=!1},[...r[2]||=[D(`svg`,{class:`h-4 w-4`,viewBox:`0 0 20 20`,fill:`currentColor`,"aria-hidden":`true`},[D(`path`,{d:`M5.3 4.3 10 9l4.7-4.7 1 1L11 10l4.7 4.7-1 1L10 11l-4.7 4.7-1-1L9 10 4.3 5.3z`})],-1)]],8,Je)])]),D(`div`,{ref_key:`list`,ref:k,class:`flex-1 space-y-3 overflow-y-auto px-4 py-3 text-sm`,"aria-live":`polite`,onClick:J},[D(`p`,Ye,w(f.value.hello),1),(o(!0),E(T,null,u(O.value,(t,n)=>(o(),E(`div`,{key:n,class:e([`flex`,t.role===`user`?`justify-end`:`justify-start`])},[t.role===`user`?(o(),E(`p`,Xe,w(t.text),1)):(o(),E(`div`,{key:1,class:e([`max-w-[90%] space-y-2 rounded-lg px-3 py-2`,t.error?`border border-danger bg-danger-soft text-danger-soft-fg`:`bg-surface-alt`]),dusk:t.error?`ai-error`:`ai-answer`,innerHTML:q(t.text)},null,10,Ze))],2))),128)),y.value?(o(),E(`p`,Qe,w(f.value.thinking),1)):t(``,!0)],512),D(`form`,{class:`border-t border-line p-3`,onSubmit:h(B,[`prevent`])},[D(`div`,$e,[i(D(`textarea`,{ref_key:`input`,ref:A,"onUpdate:modelValue":r[1]||=e=>S.value=e,rows:`2`,maxlength:`2000`,class:`flex-1 resize-none rounded-md border border-field bg-surface px-3 py-2 text-sm text-fg focus:border-focus focus:outline-none focus:ring-1 focus:ring-focus`,placeholder:f.value.placeholder,"aria-label":f.value.placeholder,dusk:`ai-input`,onKeydown:W},null,40,et),[[b,S.value]]),D(`button`,{type:`submit`,class:`rounded-md bg-accent px-3 py-2 text-sm font-medium text-on-accent hover:bg-accent-hover disabled:opacity-50`,disabled:y.value||S.value.trim()===``,dusk:`ai-send`},w(f.value.send),9,tt)]),D(`p`,$,w(f.value.note),1)],32)],8,We)):t(``,!0),D(`button`,{ref_key:`mascot`,ref:M,type:`button`,class:e([`ai-mascot group relative h-16 w-16 rounded-full focus:outline-none focus-visible:ring-2 focus-visible:ring-focus`,{"is-thinking":y.value,"is-open":v.value}]),"aria-label":f.value.open,"aria-expanded":v.value,title:f.value.open,dusk:`ai-mascot`,onClick:L},[(o(),E(`svg`,rt,[r[9]||=D(`ellipse`,{class:`ai-mascot-shadow fill-fg`,cx:`24`,cy:`49`,rx:`15`,ry:`2.2`,opacity:`0.15`},null,-1),D(`g`,it,[r[5]||=D(`path`,{class:`fill-fg`,d:`M6 42V22a18 18 0 0 1 36 0v20H32V22a8 8 0 0 0-16 0v20z`},null,-1),r[6]||=D(`rect`,{class:`ai-mascot-belt fill-accent`,x:`16`,y:`28`,width:`16`,height:`5`},null,-1),r[7]||=D(`rect`,{class:`fill-fg`,x:`4`,y:`41`,width:`13`,height:`3.5`,rx:`1.75`},null,-1),r[8]||=D(`rect`,{class:`fill-fg`,x:`31`,y:`41`,width:`13`,height:`3.5`,rx:`1.75`},null,-1),D(`g`,at,[r[3]||=D(`circle`,{class:`fill-surface`,cx:`19`,cy:`10.5`,r:`3`},null,-1),r[4]||=D(`circle`,{class:`fill-surface`,cx:`29`,cy:`10.5`,r:`3`},null,-1),D(`circle`,{class:`fill-fg`,cx:19+j.value.x,cy:10.5+j.value.y,r:`1.4`},null,8,ot),D(`circle`,{class:`fill-fg`,cx:29+j.value.x,cy:10.5+j.value.y,r:`1.4`},null,8,st)])])]))],10,nt)],32)):t(``,!0)}},[[`__scopeId`,`data-v-6928fa25`]]),lt={class:`min-h-screen bg-page`},ut={"data-page-content":`true`,class:`p-4 lg:p-6`},dt={key:0,"data-flash":`success`,class:`mb-4 p-4 bg-success-soft border border-success text-success-soft-fg rounded`},ft={key:1,"data-flash":`error`,class:`mb-4 p-4 bg-danger-soft border border-danger text-danger-soft-fg rounded`},pt={__name:`AdminLayout`,props:{title:{type:String,default:``}},setup(r){let i=x(),a=m(!1),s=m(!1),c=g(()=>i.props.branding||{}),u=g(()=>i.props.menu||[]),d=g(()=>i.props.auth?.user||{}),f=()=>{a.value=!a.value},p=()=>{s.value=!s.value},h=()=>{a.value=!1};return(i,m)=>(o(),E(T,null,[n(l(S),{title:r.title||``},null,8,[`title`]),D(`div`,lt,[a.value?(o(),E(`div`,{key:0,class:`fixed inset-0 z-40 bg-black/50 lg:hidden`,onClick:h})):t(``,!0),n(ce,{open:a.value,collapsed:s.value,menu:u.value,branding:c.value,onClose:h},null,8,[`open`,`collapsed`,`menu`,`branding`]),D(`div`,{class:e([`transition-all duration-300`,s.value?`lg:pl-20`:`lg:pl-64`])},[n(Be,{user:d.value,branding:c.value,onToggleSidebar:f,onToggleCollapse:p},null,8,[`user`,`branding`]),D(`main`,ut,[i.$page.props.flash?.success?(o(),E(`div`,dt,w(i.$page.props.flash.success),1)):t(``,!0),i.$page.props.flash?.error?(o(),E(`div`,ft,w(i.$page.props.flash.error),1)):t(``,!0),O(i.$slots,`default`)])],2),n(ct)])],64))}};export{X as i,Z as n,Q as r,pt as t};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/Create-CbxIXc0Q.js b/packages/admin/dist/assets/Create-CJxinjjT.js
similarity index 96%
rename from packages/admin/dist/assets/Create-CbxIXc0Q.js
rename to packages/admin/dist/assets/Create-CJxinjjT.js
index 945aeb7e..edab12d8 100644
--- a/packages/admin/dist/assets/Create-CbxIXc0Q.js
+++ b/packages/admin/dist/assets/Create-CJxinjjT.js
@@ -1 +1 @@
-import{$ as e,C as t,E as n,G as r,I as i,Q as a,R as o,S as s,T as c,W as l,_ as u,a as d,d as f,i as p,tt as m,u as h,v as g,w as _,x as v}from"./dist-Bie52OmN.js";import{t as y}from"./AdminLayout-DBeSErmz.js";import{t as b}from"./AdminButton-KiIJ2sLW.js";import{t as x}from"./AdminCard-YbEwPtJz.js";import{t as S}from"./FormField-B-XX4VFv.js";var C={class:`mb-6`},w={class:`flex`,"aria-label":`Breadcrumb`},T={class:`inline-flex items-center space-x-1 md:space-x-3`},E={class:`inline-flex items-center`},D={class:`flex items-center`},O={class:`ml-1 text-muted`},k={class:`max-w-2xl`},A={class:`text-2xl font-bold text-fg mb-6`},j={key:1},M={key:0,class:`flex items-center`},N=[`id`,`onUpdate:modelValue`],P=[`for`],F=[`for`],I={key:0,class:`text-danger`},L=[`id`,`onUpdate:modelValue`,`type`,`placeholder`,`required`],R={key:2,class:`mt-1 text-sm text-muted`},z={key:3,class:`mt-1 text-sm text-danger`},B={class:`flex items-center justify-end space-x-3 pt-4 border-t`},V={__name:`Create`,props:{fields:Array,title:String},setup(V){let H=V,U={};H.fields.forEach(e=>{U[e.name]=e.default??``});let W=d(U),G=()=>{W.post(route(`admin.users.store`))},K=e=>[`text`,`email`,`password`,`checkbox`].includes(e.type);return(d,H)=>(i(),s(y,{title:V.title},{default:l(()=>[v(`div`,C,[v(`nav`,w,[v(`ol`,T,[v(`li`,E,[n(a(p),{href:d.route(`admin.users.index`),class:`text-muted hover:text-accent`},{default:l(()=>[c(m(d.$t(`menu.administrators`)),1)]),_:1},8,[`href`])]),v(`li`,null,[v(`div`,D,[H[0]||=v(`svg`,{class:`w-4 h-4 text-muted`,fill:`currentColor`,viewBox:`0 0 20 20`},[v(`path`,{"fill-rule":`evenodd`,d:`M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z`,"clip-rule":`evenodd`})],-1),v(`span`,O,m(d.$t(`account.users.creating`)),1)])])])])]),v(`div`,k,[v(`h1`,A,m(V.title),1),n(x,null,{default:l(()=>[v(`form`,{onSubmit:u(G,[`prevent`]),class:`space-y-6`},[(i(!0),_(g,null,o(V.fields,n=>(i(),_(g,{key:n.name},[K(n)?(i(),_(`div`,j,[n.type===`checkbox`?(i(),_(`div`,M,[r(v(`input`,{id:n.name,"onUpdate:modelValue":e=>a(W)[n.name]=e,type:`checkbox`,class:`h-4 w-4 text-accent focus:ring-focus border-field rounded`},null,8,N),[[h,a(W)[n.name]]]),v(`label`,{for:n.name,class:`ml-2 text-sm text-fg`},m(n.label),9,P)])):(i(),_(g,{key:1},[v(`label`,{for:n.name,class:`block text-sm font-medium text-fg mb-1`},[c(m(n.label)+` `,1),n.required?(i(),_(`span`,I,`*`)):t(``,!0)],8,F),r(v(`input`,{id:n.name,"onUpdate:modelValue":e=>a(W)[n.name]=e,type:n.type===`password`?`password`:n.type===`email`?`email`:`text`,placeholder:n.placeholder,required:n.required,class:e([`w-full px-3 py-2 border border-field rounded-md shadow-sm focus:ring-focus focus:border-focus`,{"border-danger":a(W).errors[n.name]}])},null,10,L),[[f,a(W)[n.name]]])],64)),n.hint?(i(),_(`p`,R,m(n.hint),1)):t(``,!0),a(W).errors[n.name]?(i(),_(`p`,z,m(a(W).errors[n.name]),1)):t(``,!0)])):(i(),s(S,{key:0,field:n,modelValue:a(W)[n.name],"onUpdate:modelValue":e=>a(W)[n.name]=e,errors:a(W).errors},null,8,[`field`,`modelValue`,`onUpdate:modelValue`,`errors`]))],64))),128)),v(`div`,B,[n(b,{href:d.route(`admin.users.index`),variant:`secondary`},{default:l(()=>[c(m(d.$t(`common.cancel`)),1)]),_:1},8,[`href`]),n(b,{"data-action":`save`,type:`submit`,loading:a(W).processing},{default:l(()=>[c(m(d.$t(`common.create`)),1)]),_:1},8,[`loading`])])],32)]),_:1})])]),_:1},8,[`title`]))}};export{V as default};
\ No newline at end of file
+import{$ as e,C as t,E as n,G as r,I as i,Q as a,R as o,S as s,T as c,W as l,_ as u,a as d,d as f,i as p,tt as m,u as h,v as g,w as _,x as v}from"./dist-Bie52OmN.js";import{t as y}from"./AdminLayout-D_QE0gy-.js";import{t as b}from"./AdminButton-KiIJ2sLW.js";import{t as x}from"./AdminCard-YbEwPtJz.js";import{t as S}from"./FormField-WE0R-1uV.js";var C={class:`mb-6`},w={class:`flex`,"aria-label":`Breadcrumb`},T={class:`inline-flex items-center space-x-1 md:space-x-3`},E={class:`inline-flex items-center`},D={class:`flex items-center`},O={class:`ml-1 text-muted`},k={class:`max-w-2xl`},A={class:`text-2xl font-bold text-fg mb-6`},j={key:1},M={key:0,class:`flex items-center`},N=[`id`,`onUpdate:modelValue`],P=[`for`],F=[`for`],I={key:0,class:`text-danger`},L=[`id`,`onUpdate:modelValue`,`type`,`placeholder`,`required`],R={key:2,class:`mt-1 text-sm text-muted`},z={key:3,class:`mt-1 text-sm text-danger`},B={class:`flex items-center justify-end space-x-3 pt-4 border-t`},V={__name:`Create`,props:{fields:Array,title:String},setup(V){let H=V,U={};H.fields.forEach(e=>{U[e.name]=e.default??``});let W=d(U),G=()=>{W.post(route(`admin.users.store`))},K=e=>[`text`,`email`,`password`,`checkbox`].includes(e.type);return(d,H)=>(i(),s(y,{title:V.title},{default:l(()=>[v(`div`,C,[v(`nav`,w,[v(`ol`,T,[v(`li`,E,[n(a(p),{href:d.route(`admin.users.index`),class:`text-muted hover:text-accent`},{default:l(()=>[c(m(d.$t(`menu.administrators`)),1)]),_:1},8,[`href`])]),v(`li`,null,[v(`div`,D,[H[0]||=v(`svg`,{class:`w-4 h-4 text-muted`,fill:`currentColor`,viewBox:`0 0 20 20`},[v(`path`,{"fill-rule":`evenodd`,d:`M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z`,"clip-rule":`evenodd`})],-1),v(`span`,O,m(d.$t(`account.users.creating`)),1)])])])])]),v(`div`,k,[v(`h1`,A,m(V.title),1),n(x,null,{default:l(()=>[v(`form`,{onSubmit:u(G,[`prevent`]),class:`space-y-6`},[(i(!0),_(g,null,o(V.fields,n=>(i(),_(g,{key:n.name},[K(n)?(i(),_(`div`,j,[n.type===`checkbox`?(i(),_(`div`,M,[r(v(`input`,{id:n.name,"onUpdate:modelValue":e=>a(W)[n.name]=e,type:`checkbox`,class:`h-4 w-4 text-accent focus:ring-focus border-field rounded`},null,8,N),[[h,a(W)[n.name]]]),v(`label`,{for:n.name,class:`ml-2 text-sm text-fg`},m(n.label),9,P)])):(i(),_(g,{key:1},[v(`label`,{for:n.name,class:`block text-sm font-medium text-fg mb-1`},[c(m(n.label)+` `,1),n.required?(i(),_(`span`,I,`*`)):t(``,!0)],8,F),r(v(`input`,{id:n.name,"onUpdate:modelValue":e=>a(W)[n.name]=e,type:n.type===`password`?`password`:n.type===`email`?`email`:`text`,placeholder:n.placeholder,required:n.required,class:e([`w-full px-3 py-2 border border-field rounded-md shadow-sm focus:ring-focus focus:border-focus`,{"border-danger":a(W).errors[n.name]}])},null,10,L),[[f,a(W)[n.name]]])],64)),n.hint?(i(),_(`p`,R,m(n.hint),1)):t(``,!0),a(W).errors[n.name]?(i(),_(`p`,z,m(a(W).errors[n.name]),1)):t(``,!0)])):(i(),s(S,{key:0,field:n,modelValue:a(W)[n.name],"onUpdate:modelValue":e=>a(W)[n.name]=e,errors:a(W).errors},null,8,[`field`,`modelValue`,`onUpdate:modelValue`,`errors`]))],64))),128)),v(`div`,B,[n(b,{href:d.route(`admin.users.index`),variant:`secondary`},{default:l(()=>[c(m(d.$t(`common.cancel`)),1)]),_:1},8,[`href`]),n(b,{"data-action":`save`,type:`submit`,loading:a(W).processing},{default:l(()=>[c(m(d.$t(`common.create`)),1)]),_:1},8,[`loading`])])],32)]),_:1})])]),_:1},8,[`title`]))}};export{V as default};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/Create-DutDQiBS.js b/packages/admin/dist/assets/Create-kOifSpfZ.js
similarity index 96%
rename from packages/admin/dist/assets/Create-DutDQiBS.js
rename to packages/admin/dist/assets/Create-kOifSpfZ.js
index d809074f..1884cd55 100644
--- a/packages/admin/dist/assets/Create-DutDQiBS.js
+++ b/packages/admin/dist/assets/Create-kOifSpfZ.js
@@ -1 +1 @@
-import{C as e,E as t,I as n,L as r,Q as i,R as a,S as o,T as s,W as c,X as l,_ as u,a as d,b as f,i as p,q as m,tt as h,v as g,w as _,x as v}from"./dist-Bie52OmN.js";import{t as y}from"./AdminLayout-DBeSErmz.js";import{t as b}from"./AdminButton-KiIJ2sLW.js";import{t as x}from"./AdminCard-YbEwPtJz.js";import{n as S,r as C,t as w}from"./ContentLocaleSwitcher-HJzbB87a.js";import{t as T}from"./FormField-B-XX4VFv.js";import{n as E,r as D,t as O}from"./contentLocale-BV_E0iGS.js";var k={class:`mb-6`},A={class:`flex`,"aria-label":`Breadcrumb`},j={class:`inline-flex items-center space-x-1 md:space-x-3`},M={class:`inline-flex items-center`},N={class:`flex items-center`},P={class:`ml-1 text-muted`},F={class:`max-w-4xl`},I={class:`text-2xl font-bold text-fg mb-6`},L=[`data-resource`],R={class:`space-y-6`},z={key:0,class:`text-center py-12 text-muted`},B={key:2,class:`space-y-6`},V={class:`flex items-center justify-end space-x-3 pt-6 mt-6 border-t`},H={__name:`Create`,props:{routeName:String,createLabel:String,fields:Array,fieldsByTab:Object,tabs:Array,useTabs:Boolean,title:String,adminLabel:String},setup(H){let U=H,W=l(U.tabs?.[0]?.name||`main`),G={};U.useTabs&&U.fieldsByTab?Object.values(U.fieldsByTab).flat().forEach(e=>{G[e.name]=E(e,void 0)}):U.fields.forEach(e=>{G[e.name]=E(e,void 0)});let K=d(G),q=()=>(U.useTabs&&U.fieldsByTab?Object.values(U.fieldsByTab).flat():U.fields)||[],{locale:J,locales:Y,showSwitcher:X}=D(q),Z=f(()=>({...K.data()}));r(`formData`,Z),r(`aiModule`,U.routeName?.replace(/^admin\./,``)||null);let Q=()=>{K.submit(`post`,route(`${U.routeName}.store`))},$=e=>U.fieldsByTab?.[e]?U.fieldsByTab[e].filter(e=>O(K.errors,e)).length:0,ee=f(()=>U.tabs?U.tabs.map(e=>({...e,badge:$(e.name)>0?String($(e.name)):null})):[]);return(r,l)=>(n(),o(y,{title:H.title},{default:c(()=>[v(`div`,k,[v(`nav`,A,[v(`ol`,j,[v(`li`,M,[t(i(p),{href:r.route(`${U.routeName}.index`),class:`text-muted hover:text-accent`},{default:c(()=>[s(h(H.adminLabel),1)]),_:1},8,[`href`])]),v(`li`,null,[v(`div`,N,[l[2]||=v(`svg`,{class:`w-4 h-4 text-muted`,fill:`currentColor`,viewBox:`0 0 20 20`},[v(`path`,{"fill-rule":`evenodd`,d:`M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z`,"clip-rule":`evenodd`})],-1),v(`span`,P,h(r.$t(`resource.form.breadcrumb_create`)),1)])])])])]),v(`div`,F,[v(`h1`,I,h(H.title),1),t(x,null,{default:c(()=>[v(`form`,{onSubmit:u(Q,[`prevent`]),"data-admin-form":`true`,"data-resource":H.routeName,"data-context":`create`},[i(X)?(n(),o(w,{key:0,modelValue:i(J),"onUpdate:modelValue":l[0]||=e=>m(J)?J.value=e:null,locales:i(Y),fields:q(),errors:i(K).errors},null,8,[`modelValue`,`locales`,`fields`,`errors`])):e(``,!0),H.useTabs&&H.tabs&&H.fieldsByTab?(n(),o(C,{key:1,tabs:ee.value,modelValue:W.value,"onUpdate:modelValue":l[1]||=e=>W.value=e},{default:c(({activeTab:t})=>[(n(!0),_(g,null,a(H.tabs,s=>(n(),o(S,{key:s.name,name:s.name,activeTab:t},{default:c(()=>[v(`div`,R,[(n(!0),_(g,null,a(H.fieldsByTab[s.name],e=>(n(),o(T,{key:e.name,field:e,modelValue:i(K)[e.name],"onUpdate:modelValue":t=>i(K)[e.name]=t,errors:i(K).errors},null,8,[`field`,`modelValue`,`onUpdate:modelValue`,`errors`]))),128)),H.fieldsByTab[s.name]?.length?e(``,!0):(n(),_(`div`,z,[v(`p`,null,h(r.$t(`resource.form.empty_tab`)),1)]))])]),_:2},1032,[`name`,`activeTab`]))),128))]),_:1},8,[`tabs`,`modelValue`])):(n(),_(`div`,B,[(n(!0),_(g,null,a(H.fields,e=>(n(),o(T,{key:e.name,field:e,modelValue:i(K)[e.name],"onUpdate:modelValue":t=>i(K)[e.name]=t,errors:i(K).errors},null,8,[`field`,`modelValue`,`onUpdate:modelValue`,`errors`]))),128))])),v(`div`,V,[t(b,{"data-action":`cancel`,href:r.route(`${U.routeName}.index`),variant:`secondary`},{default:c(()=>[s(h(r.$t(`common.cancel`)),1)]),_:1},8,[`href`]),t(b,{"data-action":`save`,type:`submit`,loading:i(K).processing},{default:c(()=>[s(h(r.$t(`common.create`)),1)]),_:1},8,[`loading`])])],40,L)]),_:1})])]),_:1},8,[`title`]))}};export{H as default};
\ No newline at end of file
+import{C as e,E as t,I as n,L as r,Q as i,R as a,S as o,T as s,W as c,X as l,_ as u,a as d,b as f,i as p,q as m,tt as h,v as g,w as _,x as v}from"./dist-Bie52OmN.js";import{t as y}from"./AdminLayout-D_QE0gy-.js";import{t as b}from"./AdminButton-KiIJ2sLW.js";import{t as x}from"./AdminCard-YbEwPtJz.js";import{n as S,r as C,t as w}from"./ContentLocaleSwitcher-HJzbB87a.js";import{t as T}from"./FormField-WE0R-1uV.js";import{n as E,r as D,t as O}from"./contentLocale-BV_E0iGS.js";var k={class:`mb-6`},A={class:`flex`,"aria-label":`Breadcrumb`},j={class:`inline-flex items-center space-x-1 md:space-x-3`},M={class:`inline-flex items-center`},N={class:`flex items-center`},P={class:`ml-1 text-muted`},F={class:`max-w-4xl`},I={class:`text-2xl font-bold text-fg mb-6`},L=[`data-resource`],R={class:`space-y-6`},z={key:0,class:`text-center py-12 text-muted`},B={key:2,class:`space-y-6`},V={class:`flex items-center justify-end space-x-3 pt-6 mt-6 border-t`},H={__name:`Create`,props:{routeName:String,createLabel:String,fields:Array,fieldsByTab:Object,tabs:Array,useTabs:Boolean,title:String,adminLabel:String},setup(H){let U=H,W=l(U.tabs?.[0]?.name||`main`),G={};U.useTabs&&U.fieldsByTab?Object.values(U.fieldsByTab).flat().forEach(e=>{G[e.name]=E(e,void 0)}):U.fields.forEach(e=>{G[e.name]=E(e,void 0)});let K=d(G),q=()=>(U.useTabs&&U.fieldsByTab?Object.values(U.fieldsByTab).flat():U.fields)||[],{locale:J,locales:Y,showSwitcher:X}=D(q),Z=f(()=>({...K.data()}));r(`formData`,Z),r(`aiModule`,U.routeName?.replace(/^admin\./,``)||null);let Q=()=>{K.submit(`post`,route(`${U.routeName}.store`))},$=e=>U.fieldsByTab?.[e]?U.fieldsByTab[e].filter(e=>O(K.errors,e)).length:0,ee=f(()=>U.tabs?U.tabs.map(e=>({...e,badge:$(e.name)>0?String($(e.name)):null})):[]);return(r,l)=>(n(),o(y,{title:H.title},{default:c(()=>[v(`div`,k,[v(`nav`,A,[v(`ol`,j,[v(`li`,M,[t(i(p),{href:r.route(`${U.routeName}.index`),class:`text-muted hover:text-accent`},{default:c(()=>[s(h(H.adminLabel),1)]),_:1},8,[`href`])]),v(`li`,null,[v(`div`,N,[l[2]||=v(`svg`,{class:`w-4 h-4 text-muted`,fill:`currentColor`,viewBox:`0 0 20 20`},[v(`path`,{"fill-rule":`evenodd`,d:`M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z`,"clip-rule":`evenodd`})],-1),v(`span`,P,h(r.$t(`resource.form.breadcrumb_create`)),1)])])])])]),v(`div`,F,[v(`h1`,I,h(H.title),1),t(x,null,{default:c(()=>[v(`form`,{onSubmit:u(Q,[`prevent`]),"data-admin-form":`true`,"data-resource":H.routeName,"data-context":`create`},[i(X)?(n(),o(w,{key:0,modelValue:i(J),"onUpdate:modelValue":l[0]||=e=>m(J)?J.value=e:null,locales:i(Y),fields:q(),errors:i(K).errors},null,8,[`modelValue`,`locales`,`fields`,`errors`])):e(``,!0),H.useTabs&&H.tabs&&H.fieldsByTab?(n(),o(C,{key:1,tabs:ee.value,modelValue:W.value,"onUpdate:modelValue":l[1]||=e=>W.value=e},{default:c(({activeTab:t})=>[(n(!0),_(g,null,a(H.tabs,s=>(n(),o(S,{key:s.name,name:s.name,activeTab:t},{default:c(()=>[v(`div`,R,[(n(!0),_(g,null,a(H.fieldsByTab[s.name],e=>(n(),o(T,{key:e.name,field:e,modelValue:i(K)[e.name],"onUpdate:modelValue":t=>i(K)[e.name]=t,errors:i(K).errors},null,8,[`field`,`modelValue`,`onUpdate:modelValue`,`errors`]))),128)),H.fieldsByTab[s.name]?.length?e(``,!0):(n(),_(`div`,z,[v(`p`,null,h(r.$t(`resource.form.empty_tab`)),1)]))])]),_:2},1032,[`name`,`activeTab`]))),128))]),_:1},8,[`tabs`,`modelValue`])):(n(),_(`div`,B,[(n(!0),_(g,null,a(H.fields,e=>(n(),o(T,{key:e.name,field:e,modelValue:i(K)[e.name],"onUpdate:modelValue":t=>i(K)[e.name]=t,errors:i(K).errors},null,8,[`field`,`modelValue`,`onUpdate:modelValue`,`errors`]))),128))])),v(`div`,V,[t(b,{"data-action":`cancel`,href:r.route(`${U.routeName}.index`),variant:`secondary`},{default:c(()=>[s(h(r.$t(`common.cancel`)),1)]),_:1},8,[`href`]),t(b,{"data-action":`save`,type:`submit`,loading:i(K).processing},{default:c(()=>[s(h(r.$t(`common.create`)),1)]),_:1},8,[`loading`])])],40,L)]),_:1})])]),_:1},8,[`title`]))}};export{H as default};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/Dashboard-C9RqcuE0.js b/packages/admin/dist/assets/Dashboard-C9RqcuE0.js
deleted file mode 100644
index 970f4d54..00000000
--- a/packages/admin/dist/assets/Dashboard-C9RqcuE0.js
+++ /dev/null
@@ -1 +0,0 @@
-import{$ as e,C as t,E as n,I as r,Q as i,R as a,S as o,T as s,V as c,W as l,X as ee,b as u,et as d,i as f,tt as p,v as m,w as h,x as g}from"./dist-Bie52OmN.js";import{t as _}from"./AdminLayout-DBeSErmz.js";import{t as v}from"./BarChart-wks0RLo_.js";var y={class:`bg-surface rounded-lg shadow px-5 py-4`,"data-gadget":`site-speed`},b={class:`text-sm font-semibold text-fg`},x={class:`mt-3 flex items-baseline gap-2`},S={class:`text-3xl font-semibold text-fg tabular-nums`},C={class:`text-sm text-muted`},w={class:`mt-4`},T={class:`relative h-2 rounded-full bg-off overflow-hidden`},E={class:`mt-1.5 grid grid-cols-5 gap-1 text-xs text-muted`},D={class:`mt-1 flex justify-between text-xs text-muted tabular-nums`},O={class:`mt-3 text-xs text-muted`},k={__name:`SiteSpeedGadget`,props:{title:{type:String,default:``},data:{type:Object,required:!0}},setup(n){let i=n,o=u(()=>i.data.bands.indexOf(i.data.label));return(i,c)=>(r(),h(`div`,y,[g(`h2`,b,p(n.title||i.$t(`dashboard.site_speed.title`)),1),g(`div`,x,[n.data.seconds?(r(),h(m,{key:0},[g(`span`,S,p(n.data.seconds),1),g(`span`,C,p(n.data.unit),1)],64)):t(``,!0),g(`span`,{class:e([`text-sm font-medium text-fg`,{"ml-2":n.data.seconds}]),"data-speed-band":``},p(n.data.label),3)]),g(`div`,w,[g(`div`,T,[n.data.percent===null?t(``,!0):(r(),h(`div`,{key:0,class:`absolute inset-y-0 left-0 bg-accent`,style:d({width:n.data.percent+`%`})},null,4)),(r(),h(m,null,a([20,40,60,80],e=>g(`span`,{key:e,class:`absolute inset-y-0 w-0.5 bg-surface`,style:d({left:e+`%`})},null,4)),64))]),g(`div`,E,[(r(!0),h(m,null,a(n.data.bands,(t,n)=>(r(),h(`span`,{key:t,class:e([`text-center leading-tight`,{"font-semibold text-fg":n===o.value}])},p(t),3))),128))]),g(`div`,D,[c[0]||=g(`span`,null,`0`,-1),g(`span`,null,p(n.data.scaleSeconds)+` `+p(n.data.unit),1)])]),g(`p`,O,[n.data.samples?(r(),h(m,{key:0},[s(p(i.$t(`dashboard.site_speed.samples_note`,{samples:n.data.samples,days:n.data.windowDays})),1)],64)):(r(),h(m,{key:1},[s(p(i.$t(`dashboard.site_speed.no_samples`)),1)],64))])]))}},A={class:`bg-surface rounded-lg shadow px-5 py-4`,"data-gadget":`performance`},j={class:`flex items-start justify-between gap-4`},M={class:`text-sm font-semibold text-fg`},N=[`aria-expanded`],P={key:0,class:`mt-3`},F={class:`flex items-baseline gap-2`},I={class:`text-3xl font-semibold text-fg tabular-nums`},L={class:`text-sm text-muted`},R={class:`text-xs text-muted`},z={key:1,class:`mt-3 text-sm text-muted`},B={key:2,class:`mt-3 text-xs text-muted`},V={key:3,class:`mt-3 border-t border-line pt-3`,"data-performance-details":``},H={class:`text-xs font-semibold text-fg`},U={class:`mt-1 divide-y divide-line text-sm`},W=[`title`],te={class:`whitespace-nowrap text-muted tabular-nums`},G={__name:`PerformanceGadget`,props:{title:{type:String,default:``},data:{type:Object,required:!0}},setup(e){let n=ee(!1);return(i,o)=>(r(),h(`div`,A,[g(`div`,j,[g(`h2`,M,p(e.title||i.$t(`dashboard.performance.title`)),1),e.data.slowest.length?(r(),h(`button`,{key:0,type:`button`,class:`rounded-md border border-field bg-surface px-3 py-1 text-sm text-fg hover:bg-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-focus`,"aria-expanded":n.value?`true`:`false`,"data-action":`performance-details`,onClick:o[0]||=e=>n.value=!n.value},p(n.value?i.$t(`dashboard.performance.collapse`):i.$t(`dashboard.performance.details`)),9,N)):t(``,!0)]),e.data.rate?(r(),h(`div`,P,[g(`div`,F,[g(`span`,I,p(e.data.rate),1),g(`span`,L,p(e.data.unit),1)]),g(`div`,R,p(e.data.caption),1)])):(r(),h(`p`,z,p(i.$t(`dashboard.performance.pending`)),1)),e.data.rate?(r(),h(`p`,B,p(i.$t(`dashboard.performance.note`,{seconds:e.data.averageSeconds,pages:e.data.samples,days:e.data.windowDays})),1)):t(``,!0),n.value?(r(),h(`div`,V,[g(`h3`,H,p(i.$t(`dashboard.performance.slowest_title`)),1),g(`ul`,U,[(r(!0),h(m,null,a(e.data.slowest,e=>(r(),h(`li`,{key:e.path,class:`flex justify-between gap-3 py-1.5`},[g(`span`,{class:`truncate text-fg`,title:e.path},p(e.path),9,W),g(`span`,te,p(i.$t(`dashboard.performance.slowest_row`,{ms:e.ms,hits:e.hits})),1)]))),128))])])):t(``,!0)]))}},K={class:`bg-surface rounded-lg shadow px-5 py-4`,"data-gadget":`recent`},q={class:`text-sm font-semibold text-fg`},J={key:0,class:`mt-3 divide-y divide-line`},Y=[`src`],X={key:1,class:`h-12 w-12 flex-none rounded bg-off`},Z={class:`min-w-0`},Q={key:0,class:`text-xs text-muted`},ne=[`href`],re={key:2,class:`text-sm text-fg line-clamp-2`},ie={key:1,class:`mt-3 text-sm text-muted`},ae=[`href`],oe={__name:`RecentElementsGadget`,props:{title:{type:String,default:``},data:{type:Object,required:!0}},setup(e){return(n,i)=>(r(),h(`div`,K,[g(`h2`,q,p(e.title||n.$t(`dashboard.recent.title`)),1),e.data.items.length?(r(),h(`ul`,J,[(r(!0),h(m,null,a(e.data.items,e=>(r(),h(`li`,{key:e.id,class:`flex gap-3 py-2`},[e.image?(r(),h(`img`,{key:0,src:e.image,alt:``,class:`h-12 w-12 flex-none rounded object-cover bg-off`},null,8,Y)):(r(),h(`div`,X)),g(`div`,Z,[e.date?(r(),h(`div`,Q,p(e.date),1)):t(``,!0),e.url?(r(),h(`a`,{key:1,href:e.url,class:`text-sm text-accent hover:underline line-clamp-2`},p(e.name),9,ne)):(r(),h(`span`,re,p(e.name),1))])]))),128))])):(r(),h(`p`,ie,p(n.$t(`dashboard.recent.empty`)),1)),e.data.allUrl?(r(),h(`a`,{key:2,href:e.data.allUrl,class:`mt-3 inline-block text-sm text-accent hover:underline`},p(e.data.allLabel),9,ae)):t(``,!0)]))}},se={class:`bg-surface rounded-lg shadow px-5 py-4`,"data-gadget":`errors`,dusk:`errors-gadget`},ce={class:`flex items-baseline justify-between gap-3`},le={class:`text-sm font-semibold text-fg`},ue={class:`mt-3 grid grid-cols-2 sm:grid-cols-4 gap-3`},de=[`data-count`],fe={class:`text-xs text-muted`},pe={class:`text-2xl font-semibold text-fg tabular-nums`},$={key:0,class:`mt-4 text-sm text-muted`},me={class:`mt-4`},he={class:`mt-4 text-xs font-semibold uppercase tracking-wide text-muted`},ge={class:`mt-2 divide-y divide-line`},_e={class:`w-10 shrink-0 text-right font-semibold text-fg tabular-nums`},ve={class:`font-medium`},ye={__name:`ErrorsGadget`,props:{title:{type:String,default:``},data:{type:Object,required:!0}},setup(e){return(t,o)=>(r(),h(`div`,se,[g(`div`,ce,[g(`h2`,le,p(e.title||e.data.strings.title),1),n(i(f),{href:e.data.url,class:`text-sm text-accent hover:text-accent-hover hover:underline`,dusk:`errors-gadget-all`},{default:l(()=>[s(p(e.data.strings.all),1)]),_:1},8,[`href`])]),g(`dl`,ue,[(r(),h(m,null,a([`events`,`new`,`regressed`,`unresolved`],t=>g(`div`,{key:t,class:`flex flex-col-reverse`,"data-count":t},[g(`dt`,fe,p(e.data.strings[t]),1),g(`dd`,pe,p(e.data[t]),1)],8,de)),64))]),e.data.events?(r(),h(m,{key:1},[g(`div`,me,[n(v,{points:e.data.chart,every:6,height:72,label:e.data.strings.chart},null,8,[`points`,`label`])]),g(`h3`,he,p(e.data.strings.top),1),g(`ul`,ge,[(r(!0),h(m,null,a(e.data.top,e=>(r(),h(`li`,{key:e.id,class:`py-1.5 flex items-baseline gap-3 text-sm`},[g(`span`,_e,p(e.count),1),n(i(f),{href:e.url,class:`min-w-0 truncate text-accent hover:text-accent-hover hover:underline`,dusk:`errors-gadget-issue`},{default:l(()=>[g(`span`,ve,p(e.class),1),s(`: `+p(e.title),1)]),_:2},1032,[`href`])]))),128))])],64)):(r(),h(`p`,$,p(e.data.strings.none),1))]))}},be={class:`mb-6`},xe={class:`text-2xl font-bold text-fg`},Se={class:`grid grid-cols-1 gap-6 lg:grid-cols-2`},Ce={__name:`Dashboard`,props:{gadgets:{type:Array,default:()=>[]}},setup(t){let n={SiteSpeedGadget:k,PerformanceGadget:G,RecentElementsGadget:oe,ErrorsGadget:ye},i=t,s=u(()=>i.gadgets.filter(e=>n[e.component]));return(t,i)=>(r(),o(_,{title:t.$t(`dashboard.title`)},{default:l(()=>[g(`div`,be,[g(`h1`,xe,p(t.$t(`dashboard.title`)),1)]),g(`div`,Se,[(r(!0),h(m,null,a(s.value,t=>(r(),o(c(n[t.component]),{key:t.key,title:t.title,data:t.data,class:e(t.width===`full`?`lg:col-span-2`:``)},null,8,[`title`,`data`,`class`]))),128))])]),_:1},8,[`title`]))}};export{Ce as default};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/Dashboard-DkBuI6d2.js b/packages/admin/dist/assets/Dashboard-DkBuI6d2.js
new file mode 100644
index 00000000..e7a2a67d
--- /dev/null
+++ b/packages/admin/dist/assets/Dashboard-DkBuI6d2.js
@@ -0,0 +1 @@
+import{$ as e,C as t,E as n,I as r,Q as i,R as a,S as o,T as s,V as c,W as l,X as ee,b as u,et as d,i as f,o as te,tt as p,v as m,w as h,x as g}from"./dist-Bie52OmN.js";import{t as _}from"./AdminLayout-D_QE0gy-.js";import{t as v}from"./BarChart-wks0RLo_.js";import{n as y}from"./labels-DbKc85RH.js";var b={class:`bg-surface rounded-lg shadow px-5 py-4`,"data-gadget":`site-speed`},x={class:`text-sm font-semibold text-fg`},S={class:`mt-3 flex items-baseline gap-2`},C={class:`text-3xl font-semibold text-fg tabular-nums`},w={class:`text-sm text-muted`},T={class:`mt-4`},E={class:`relative h-2 rounded-full bg-off overflow-hidden`},D={class:`mt-1.5 grid grid-cols-5 gap-1 text-xs text-muted`},O={class:`mt-1 flex justify-between text-xs text-muted tabular-nums`},k={class:`mt-3 text-xs text-muted`},A={__name:`SiteSpeedGadget`,props:{title:{type:String,default:``},data:{type:Object,required:!0}},setup(n){let i=n,o=u(()=>i.data.bands.indexOf(i.data.label));return(i,c)=>(r(),h(`div`,b,[g(`h2`,x,p(n.title||i.$t(`dashboard.site_speed.title`)),1),g(`div`,S,[n.data.seconds?(r(),h(m,{key:0},[g(`span`,C,p(n.data.seconds),1),g(`span`,w,p(n.data.unit),1)],64)):t(``,!0),g(`span`,{class:e([`text-sm font-medium text-fg`,{"ml-2":n.data.seconds}]),"data-speed-band":``},p(n.data.label),3)]),g(`div`,T,[g(`div`,E,[n.data.percent===null?t(``,!0):(r(),h(`div`,{key:0,class:`absolute inset-y-0 left-0 bg-accent`,style:d({width:n.data.percent+`%`})},null,4)),(r(),h(m,null,a([20,40,60,80],e=>g(`span`,{key:e,class:`absolute inset-y-0 w-0.5 bg-surface`,style:d({left:e+`%`})},null,4)),64))]),g(`div`,D,[(r(!0),h(m,null,a(n.data.bands,(t,n)=>(r(),h(`span`,{key:t,class:e([`text-center leading-tight`,{"font-semibold text-fg":n===o.value}])},p(t),3))),128))]),g(`div`,O,[c[0]||=g(`span`,null,`0`,-1),g(`span`,null,p(n.data.scaleSeconds)+` `+p(n.data.unit),1)])]),g(`p`,k,[n.data.samples?(r(),h(m,{key:0},[s(p(i.$t(`dashboard.site_speed.samples_note`,{samples:n.data.samples,days:n.data.windowDays})),1)],64)):(r(),h(m,{key:1},[s(p(i.$t(`dashboard.site_speed.no_samples`)),1)],64))])]))}},j={class:`bg-surface rounded-lg shadow px-5 py-4`,"data-gadget":`performance`},M={class:`flex items-start justify-between gap-4`},N={class:`text-sm font-semibold text-fg`},P=[`aria-expanded`],F={key:0,class:`mt-3`},I={class:`flex items-baseline gap-2`},L={class:`text-3xl font-semibold text-fg tabular-nums`},R={class:`text-sm text-muted`},z={class:`text-xs text-muted`},B={key:1,class:`mt-3 text-sm text-muted`},V={key:2,class:`mt-3 text-xs text-muted`},H={key:3,class:`mt-3 border-t border-line pt-3`,"data-performance-details":``},U={class:`text-xs font-semibold text-fg`},W={class:`mt-1 divide-y divide-line text-sm`},G=[`title`],K={class:`whitespace-nowrap text-muted tabular-nums`},q={__name:`PerformanceGadget`,props:{title:{type:String,default:``},data:{type:Object,required:!0}},setup(e){let n=ee(!1);return(i,o)=>(r(),h(`div`,j,[g(`div`,M,[g(`h2`,N,p(e.title||i.$t(`dashboard.performance.title`)),1),e.data.slowest.length?(r(),h(`button`,{key:0,type:`button`,class:`rounded-md border border-field bg-surface px-3 py-1 text-sm text-fg hover:bg-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-focus`,"aria-expanded":n.value?`true`:`false`,"data-action":`performance-details`,onClick:o[0]||=e=>n.value=!n.value},p(n.value?i.$t(`dashboard.performance.collapse`):i.$t(`dashboard.performance.details`)),9,P)):t(``,!0)]),e.data.rate?(r(),h(`div`,F,[g(`div`,I,[g(`span`,L,p(e.data.rate),1),g(`span`,R,p(e.data.unit),1)]),g(`div`,z,p(e.data.caption),1)])):(r(),h(`p`,B,p(i.$t(`dashboard.performance.pending`)),1)),e.data.rate?(r(),h(`p`,V,p(i.$t(`dashboard.performance.note`,{seconds:e.data.averageSeconds,pages:e.data.samples,days:e.data.windowDays})),1)):t(``,!0),n.value?(r(),h(`div`,H,[g(`h3`,U,p(i.$t(`dashboard.performance.slowest_title`)),1),g(`ul`,W,[(r(!0),h(m,null,a(e.data.slowest,e=>(r(),h(`li`,{key:e.path,class:`flex justify-between gap-3 py-1.5`},[g(`span`,{class:`truncate text-fg`,title:e.path},p(e.path),9,G),g(`span`,K,p(i.$t(`dashboard.performance.slowest_row`,{ms:e.ms,hits:e.hits})),1)]))),128))])])):t(``,!0)]))}},J={class:`bg-surface rounded-lg shadow px-5 py-4`,"data-gadget":`recent`},Y={class:`text-sm font-semibold text-fg`},X={key:0,class:`mt-3 divide-y divide-line`},Z=[`src`],Q={key:1,class:`h-12 w-12 flex-none rounded bg-off`},ne={class:`min-w-0`},re={key:0,class:`text-xs text-muted`},ie=[`href`],ae={key:2,class:`text-sm text-fg line-clamp-2`},oe={key:1,class:`mt-3 text-sm text-muted`},se=[`href`],ce={__name:`RecentElementsGadget`,props:{title:{type:String,default:``},data:{type:Object,required:!0}},setup(e){return(n,i)=>(r(),h(`div`,J,[g(`h2`,Y,p(e.title||n.$t(`dashboard.recent.title`)),1),e.data.items.length?(r(),h(`ul`,X,[(r(!0),h(m,null,a(e.data.items,e=>(r(),h(`li`,{key:e.id,class:`flex gap-3 py-2`},[e.image?(r(),h(`img`,{key:0,src:e.image,alt:``,class:`h-12 w-12 flex-none rounded object-cover bg-off`},null,8,Z)):(r(),h(`div`,Q)),g(`div`,ne,[e.date?(r(),h(`div`,re,p(e.date),1)):t(``,!0),e.url?(r(),h(`a`,{key:1,href:e.url,class:`text-sm text-accent hover:underline line-clamp-2`},p(e.name),9,ie)):(r(),h(`span`,ae,p(e.name),1))])]))),128))])):(r(),h(`p`,oe,p(n.$t(`dashboard.recent.empty`)),1)),e.data.allUrl?(r(),h(`a`,{key:2,href:e.data.allUrl,class:`mt-3 inline-block text-sm text-accent hover:underline`},p(e.data.allLabel),9,se)):t(``,!0)]))}},le={class:`bg-surface rounded-lg shadow px-5 py-4`,"data-gadget":`errors`,dusk:`errors-gadget`},ue={class:`flex items-baseline justify-between gap-3`},de={class:`text-sm font-semibold text-fg`},fe={class:`mt-3 grid grid-cols-2 sm:grid-cols-4 gap-3`},pe=[`data-count`],me={class:`text-xs text-muted`},he={class:`text-2xl font-semibold text-fg tabular-nums`},ge={key:0,class:`mt-4 text-sm text-muted`},_e={class:`mt-4`},ve={class:`mt-4 text-xs font-semibold uppercase tracking-wide text-muted`},ye={class:`mt-2 divide-y divide-line`},be={class:`w-10 shrink-0 text-right font-semibold text-fg tabular-nums`},xe={class:`font-medium`},Se={__name:`ErrorsGadget`,props:{title:{type:String,default:``},data:{type:Object,required:!0}},setup(e){return(t,o)=>(r(),h(`div`,le,[g(`div`,ue,[g(`h2`,de,p(e.title||e.data.strings.title),1),n(i(f),{href:e.data.url,class:`text-sm text-accent hover:text-accent-hover hover:underline`,dusk:`errors-gadget-all`},{default:l(()=>[s(p(e.data.strings.all),1)]),_:1},8,[`href`])]),g(`dl`,fe,[(r(),h(m,null,a([`events`,`new`,`regressed`,`unresolved`],t=>g(`div`,{key:t,class:`flex flex-col-reverse`,"data-count":t},[g(`dt`,me,p(e.data.strings[t]),1),g(`dd`,he,p(e.data[t]),1)],8,pe)),64))]),e.data.events?(r(),h(m,{key:1},[g(`div`,_e,[n(v,{points:e.data.chart,every:6,height:72,label:e.data.strings.chart},null,8,[`points`,`label`])]),g(`h3`,ve,p(e.data.strings.top),1),g(`ul`,ye,[(r(!0),h(m,null,a(e.data.top,e=>(r(),h(`li`,{key:e.id,class:`py-1.5 flex items-baseline gap-3 text-sm`},[g(`span`,be,p(e.count),1),n(i(f),{href:e.url,class:`min-w-0 truncate text-accent hover:text-accent-hover hover:underline`,dusk:`errors-gadget-issue`},{default:l(()=>[g(`span`,xe,p(e.class),1),s(`: `+p(e.title),1)]),_:2},1032,[`href`])]))),128))])],64)):(r(),h(`p`,ge,p(e.data.strings.none),1))]))}},Ce={class:`bg-surface rounded-lg shadow px-5 py-4`,"data-gadget":`monitoring`},we={class:`flex items-baseline justify-between gap-3`},Te={class:`text-sm font-semibold text-fg`},Ee=[`href`],De={key:0,dusk:`monitoring-down`,role:`status`,class:`mt-3 rounded border border-danger bg-danger-soft px-3 py-2 text-sm font-medium text-danger-soft-fg`},Oe={class:`mt-3 grid grid-cols-2 gap-4`},ke={class:`text-xs text-muted`},Ae={class:`mt-1 text-2xl font-semibold text-fg tabular-nums`,dusk:`monitoring-uptime`},je={class:`text-xs text-muted`},Me={class:`mt-1 space-y-0.5 text-xs`},Ne={class:`font-mono text-fg truncate`},Pe={class:`text-fg tabular-nums whitespace-nowrap`},$={key:0,class:`text-muted`},Fe={class:`mt-4 text-xs text-muted`},Ie={class:`mt-1 grid grid-cols-5 gap-2`},Le=[`data-vital`,`title`],Re={class:`text-xs font-medium text-muted`},ze={class:`text-sm font-semibold text-fg tabular-nums`},Be={class:`text-xs text-fg leading-tight`},Ve={__name:`MonitoringGadget`,props:{title:{type:String,default:``},data:{type:Object,required:!0}},setup(e){let n=e,o=te(),s=e=>e?n.data.ratings[e]:`—`;return(n,c)=>(r(),h(`div`,Ce,[g(`div`,we,[g(`h2`,Te,p(e.title||e.data.labels.title),1),g(`a`,{href:e.data.url,dusk:`monitoring-open`,class:`text-xs text-accent underline`},p(e.data.labels.open),9,Ee)]),e.data.down.length?(r(),h(`p`,De,p(e.data.labels.down)+`: `+p(e.data.down.join(`, `)),1)):t(``,!0),g(`div`,Oe,[g(`div`,null,[g(`h3`,ke,p(e.data.labels.uptime),1),g(`p`,Ae,p(e.data.uptime===null?`—`:`${i(y)(e.data.uptime,i(o).props.locale)}%`),1)]),g(`div`,null,[g(`h3`,je,p(e.data.labels.slowest),1),g(`ol`,Me,[(r(!0),h(m,null,a(e.data.slowest,e=>(r(),h(`li`,{key:e.route,class:`flex justify-between gap-2`},[g(`span`,Ne,p(e.route),1),g(`span`,Pe,p(e.p75),1)]))),128)),e.data.slowest.length?t(``,!0):(r(),h(`li`,$,`—`))])])]),g(`h3`,Fe,p(e.data.labels.vitals),1),g(`dl`,Ie,[(r(!0),h(m,null,a(e.data.vitals,e=>(r(),h(`div`,{key:e.key,"data-vital":e.key,title:e.label},[g(`dt`,Re,p(e.key.toUpperCase()),1),g(`dd`,ze,p(e.value),1),g(`dd`,Be,p(s(e.rating)),1)],8,Le))),128))])]))}},He={class:`mb-6`},Ue={class:`text-2xl font-bold text-fg`},We={class:`grid grid-cols-1 gap-6 lg:grid-cols-2`},Ge={__name:`Dashboard`,props:{gadgets:{type:Array,default:()=>[]}},setup(t){let n={SiteSpeedGadget:A,PerformanceGadget:q,RecentElementsGadget:ce,ErrorsGadget:Se,MonitoringGadget:Ve},i=t,s=u(()=>i.gadgets.filter(e=>n[e.component]));return(t,i)=>(r(),o(_,{title:t.$t(`dashboard.title`)},{default:l(()=>[g(`div`,He,[g(`h1`,Ue,p(t.$t(`dashboard.title`)),1)]),g(`div`,We,[(r(!0),h(m,null,a(s.value,t=>(r(),o(c(n[t.component]),{key:t.key,title:t.title,data:t.data,class:e(t.width===`full`?`lg:col-span-2`:``)},null,8,[`title`,`data`,`class`]))),128))])]),_:1},8,[`title`]))}};export{Ge as default};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/Edit-Bm3W6F3v.js b/packages/admin/dist/assets/Edit-B4rBMOtq.js
similarity index 95%
rename from packages/admin/dist/assets/Edit-Bm3W6F3v.js
rename to packages/admin/dist/assets/Edit-B4rBMOtq.js
index ce6b8979..22079404 100644
--- a/packages/admin/dist/assets/Edit-Bm3W6F3v.js
+++ b/packages/admin/dist/assets/Edit-B4rBMOtq.js
@@ -1 +1 @@
-import{C as e,E as t,G as n,I as r,Q as i,R as a,S as o,T as s,W as c,_ as l,a as u,i as d,m as f,tt as p,v as m,w as h,x as g}from"./dist-Bie52OmN.js";import{t as _}from"./AdminLayout-DBeSErmz.js";import{t as v}from"./AdminButton-KiIJ2sLW.js";import{t as y}from"./AdminCard-YbEwPtJz.js";import{n as b}from"./app-BCJOqmKO.js";var x={class:`mb-6`},S={class:`max-w-4xl`},ee={class:`text-2xl font-bold text-fg mb-6`},te={for:`role-name`,class:`block text-sm font-medium text-fg mb-1`},ne={key:0,class:`mt-1 text-sm text-danger`},re={class:`flex flex-wrap items-center justify-between gap-2`},ie={class:`text-sm font-medium text-fg`},C={class:`flex gap-2`},w={class:`mt-1 text-sm text-muted`},T={key:0,class:`mt-1 text-sm text-danger`},E={class:`mt-2 overflow-x-auto border border-line rounded-md`},D={class:`min-w-full text-sm`},O={class:`bg-surface-alt`},k={class:`px-3 py-2 text-left font-medium text-fg`},A={key:0,class:`px-3 py-2 text-left font-medium text-fg`},j={class:`px-3 py-2 w-20 text-center font-medium text-fg`},M={class:`divide-y divide-line`},N=[`data-section`],P={class:`px-3 py-1.5`},F={class:`ml-1 text-xs text-muted font-mono`},I=[`data-permission`,`aria-label`,`checked`,`onChange`],L={key:0,class:`px-3 py-1.5`},ae=[`data-permission`,`checked`,`onChange`],R=[`colspan`],z=[`data-permission`,`checked`,`onChange`],B={class:`px-3 py-1.5 text-center`},V=[`aria-label`,`checked`,`onChange`],H={class:`flex items-center justify-end space-x-3 pt-4 border-t`},U={__name:`Edit`,props:{role:{type:Object,default:null},sections:{type:Array,required:!0},title:String},setup(U){let W=U,G=[`view`,`create`,`update`,`delete`],K=u({name:W.role?.name??``,permissions:[...W.role?.permissions??[]]}),q=(e,t)=>K.permissions.includes(`${e.key}.${t}`),J=e=>G.every(t=>e.actions.includes(t)),Y=e=>J(e)?e.actions.filter(e=>!G.includes(e)):[],X=W.sections.some(e=>Y(e).length>0),Z=(e,t)=>e.labels?.[t]??b(`permissions.actions.${t}`),Q=(e,t)=>{let n=new Set(K.permissions),r=`${e.key}.${t}`;n.has(r)?(n.delete(r),t===`view`&&G.forEach(t=>n.delete(`${e.key}.${t}`))):(n.add(r),J(e)&&G.includes(t)&&t!==`view`&&n.add(`${e.key}.view`)),K.permissions=[...n]},$=e=>e.actions.every(t=>q(e,t)),oe=e=>{let t=new Set(K.permissions),n=$(e);e.actions.forEach(r=>n?t.delete(`${e.key}.${r}`):t.add(`${e.key}.${r}`)),K.permissions=[...t]},se=()=>{K.permissions=W.sections.flatMap(e=>e.actions.map(t=>`${e.key}.${t}`))},ce=()=>{W.role?K.put(route(`admin.roles.update`,W.role.id)):K.post(route(`admin.roles.store`))};return(u,b)=>(r(),o(_,{title:U.title},{default:c(()=>[g(`div`,x,[t(i(d),{href:u.route(`admin.roles.index`),class:`text-muted hover:text-accent`},{default:c(()=>[s(p(u.$t(`menu.roles`)),1)]),_:1},8,[`href`])]),g(`div`,S,[g(`h1`,ee,p(U.title),1),t(y,null,{default:c(()=>[g(`form`,{class:`space-y-6`,"data-role-form":``,onSubmit:l(ce,[`prevent`])},[g(`div`,null,[g(`label`,te,[s(p(u.$t(`permissions.name`))+` `,1),b[2]||=g(`span`,{class:`text-danger`},`*`,-1)]),n(g(`input`,{id:`role-name`,"onUpdate:modelValue":b[0]||=e=>i(K).name=e,type:`text`,required:``,class:`w-full px-3 py-2 border border-field rounded-md shadow-sm focus:ring-focus focus:border-focus`},null,512),[[f,i(K).name]]),i(K).errors.name?(r(),h(`p`,ne,p(i(K).errors.name),1)):e(``,!0)]),g(`div`,null,[g(`div`,re,[g(`span`,ie,p(u.$t(`permissions.permissions`)),1),g(`div`,C,[t(v,{type:`button`,size:`sm`,variant:`outline`,onClick:se},{default:c(()=>[s(p(u.$t(`permissions.select_all`)),1)]),_:1}),t(v,{type:`button`,size:`sm`,variant:`outline`,onClick:b[1]||=e=>i(K).permissions=[]},{default:c(()=>[s(p(u.$t(`permissions.clear`)),1)]),_:1})])]),g(`p`,w,p(u.$t(`permissions.matrix_hint`)),1),i(K).errors.permissions?(r(),h(`p`,T,p(i(K).errors.permissions),1)):e(``,!0),g(`div`,E,[g(`table`,D,[g(`thead`,O,[g(`tr`,null,[g(`th`,k,p(u.$t(`permissions.section`)),1),(r(),h(m,null,a(G,e=>g(`th`,{key:e,class:`px-3 py-2 w-24 text-center font-medium text-fg`},p(u.$t(`permissions.actions.${e}`)),1)),64)),i(X)?(r(),h(`th`,A,p(u.$t(`permissions.other`)),1)):e(``,!0),g(`th`,j,p(u.$t(`permissions.all`)),1)])]),g(`tbody`,M,[(r(!0),h(m,null,a(U.sections,t=>(r(),h(`tr`,{key:t.key,"data-section":t.key},[g(`td`,P,[s(p(t.label)+` `,1),g(`span`,F,p(t.key),1)]),J(t)?(r(),h(m,{key:0},[(r(),h(m,null,a(G,e=>g(`td`,{key:e,class:`px-3 py-1.5 text-center`},[g(`input`,{type:`checkbox`,class:`h-4 w-4`,"data-permission":`${t.key}.${e}`,"aria-label":`${t.label}: ${u.$t(`permissions.actions.${e}`)}`,checked:q(t,e),onChange:n=>Q(t,e)},null,40,I)])),64)),i(X)?(r(),h(`td`,L,[(r(!0),h(m,null,a(Y(t),e=>(r(),h(`label`,{key:e,class:`inline-flex items-center gap-2 mr-3`},[g(`input`,{type:`checkbox`,class:`h-4 w-4`,"data-permission":`${t.key}.${e}`,checked:q(t,e),onChange:n=>Q(t,e)},null,40,ae),s(` `+p(Z(t,e)),1)]))),128))])):e(``,!0)],64)):(r(),h(`td`,{key:1,colspan:i(X)?5:4,class:`px-3 py-1.5`},[(r(!0),h(m,null,a(t.actions,e=>(r(),h(`label`,{key:e,class:`inline-flex items-center gap-2 mr-3`},[g(`input`,{type:`checkbox`,class:`h-4 w-4`,"data-permission":`${t.key}.${e}`,checked:q(t,e),onChange:n=>Q(t,e)},null,40,z),s(` `+p(Z(t,e)),1)]))),128))],8,R)),g(`td`,B,[g(`input`,{type:`checkbox`,class:`h-4 w-4`,"aria-label":`${t.label}: ${u.$t(`permissions.all`)}`,checked:$(t),onChange:e=>oe(t)},null,40,V)])],8,N))),128))])])])]),g(`div`,H,[t(v,{href:u.route(`admin.roles.index`),variant:`secondary`},{default:c(()=>[s(p(u.$t(`common.cancel`)),1)]),_:1},8,[`href`]),t(v,{"data-action":`save`,type:`submit`,loading:i(K).processing},{default:c(()=>[s(p(u.$t(`common.save`)),1)]),_:1},8,[`loading`])])],32)]),_:1})])]),_:1},8,[`title`]))}};export{U as default};
\ No newline at end of file
+import{C as e,E as t,G as n,I as r,Q as i,R as a,S as o,T as s,W as c,_ as l,a as u,i as d,m as f,tt as p,v as m,w as h,x as g}from"./dist-Bie52OmN.js";import{t as _}from"./AdminLayout-D_QE0gy-.js";import{t as v}from"./AdminButton-KiIJ2sLW.js";import{t as y}from"./AdminCard-YbEwPtJz.js";import{n as b}from"./app-Cdw8k5No.js";var x={class:`mb-6`},S={class:`max-w-4xl`},ee={class:`text-2xl font-bold text-fg mb-6`},te={for:`role-name`,class:`block text-sm font-medium text-fg mb-1`},ne={key:0,class:`mt-1 text-sm text-danger`},re={class:`flex flex-wrap items-center justify-between gap-2`},ie={class:`text-sm font-medium text-fg`},C={class:`flex gap-2`},w={class:`mt-1 text-sm text-muted`},T={key:0,class:`mt-1 text-sm text-danger`},E={class:`mt-2 overflow-x-auto border border-line rounded-md`},D={class:`min-w-full text-sm`},O={class:`bg-surface-alt`},k={class:`px-3 py-2 text-left font-medium text-fg`},A={key:0,class:`px-3 py-2 text-left font-medium text-fg`},j={class:`px-3 py-2 w-20 text-center font-medium text-fg`},M={class:`divide-y divide-line`},N=[`data-section`],P={class:`px-3 py-1.5`},F={class:`ml-1 text-xs text-muted font-mono`},I=[`data-permission`,`aria-label`,`checked`,`onChange`],L={key:0,class:`px-3 py-1.5`},ae=[`data-permission`,`checked`,`onChange`],R=[`colspan`],z=[`data-permission`,`checked`,`onChange`],B={class:`px-3 py-1.5 text-center`},V=[`aria-label`,`checked`,`onChange`],H={class:`flex items-center justify-end space-x-3 pt-4 border-t`},U={__name:`Edit`,props:{role:{type:Object,default:null},sections:{type:Array,required:!0},title:String},setup(U){let W=U,G=[`view`,`create`,`update`,`delete`],K=u({name:W.role?.name??``,permissions:[...W.role?.permissions??[]]}),q=(e,t)=>K.permissions.includes(`${e.key}.${t}`),J=e=>G.every(t=>e.actions.includes(t)),Y=e=>J(e)?e.actions.filter(e=>!G.includes(e)):[],X=W.sections.some(e=>Y(e).length>0),Z=(e,t)=>e.labels?.[t]??b(`permissions.actions.${t}`),Q=(e,t)=>{let n=new Set(K.permissions),r=`${e.key}.${t}`;n.has(r)?(n.delete(r),t===`view`&&G.forEach(t=>n.delete(`${e.key}.${t}`))):(n.add(r),J(e)&&G.includes(t)&&t!==`view`&&n.add(`${e.key}.view`)),K.permissions=[...n]},$=e=>e.actions.every(t=>q(e,t)),oe=e=>{let t=new Set(K.permissions),n=$(e);e.actions.forEach(r=>n?t.delete(`${e.key}.${r}`):t.add(`${e.key}.${r}`)),K.permissions=[...t]},se=()=>{K.permissions=W.sections.flatMap(e=>e.actions.map(t=>`${e.key}.${t}`))},ce=()=>{W.role?K.put(route(`admin.roles.update`,W.role.id)):K.post(route(`admin.roles.store`))};return(u,b)=>(r(),o(_,{title:U.title},{default:c(()=>[g(`div`,x,[t(i(d),{href:u.route(`admin.roles.index`),class:`text-muted hover:text-accent`},{default:c(()=>[s(p(u.$t(`menu.roles`)),1)]),_:1},8,[`href`])]),g(`div`,S,[g(`h1`,ee,p(U.title),1),t(y,null,{default:c(()=>[g(`form`,{class:`space-y-6`,"data-role-form":``,onSubmit:l(ce,[`prevent`])},[g(`div`,null,[g(`label`,te,[s(p(u.$t(`permissions.name`))+` `,1),b[2]||=g(`span`,{class:`text-danger`},`*`,-1)]),n(g(`input`,{id:`role-name`,"onUpdate:modelValue":b[0]||=e=>i(K).name=e,type:`text`,required:``,class:`w-full px-3 py-2 border border-field rounded-md shadow-sm focus:ring-focus focus:border-focus`},null,512),[[f,i(K).name]]),i(K).errors.name?(r(),h(`p`,ne,p(i(K).errors.name),1)):e(``,!0)]),g(`div`,null,[g(`div`,re,[g(`span`,ie,p(u.$t(`permissions.permissions`)),1),g(`div`,C,[t(v,{type:`button`,size:`sm`,variant:`outline`,onClick:se},{default:c(()=>[s(p(u.$t(`permissions.select_all`)),1)]),_:1}),t(v,{type:`button`,size:`sm`,variant:`outline`,onClick:b[1]||=e=>i(K).permissions=[]},{default:c(()=>[s(p(u.$t(`permissions.clear`)),1)]),_:1})])]),g(`p`,w,p(u.$t(`permissions.matrix_hint`)),1),i(K).errors.permissions?(r(),h(`p`,T,p(i(K).errors.permissions),1)):e(``,!0),g(`div`,E,[g(`table`,D,[g(`thead`,O,[g(`tr`,null,[g(`th`,k,p(u.$t(`permissions.section`)),1),(r(),h(m,null,a(G,e=>g(`th`,{key:e,class:`px-3 py-2 w-24 text-center font-medium text-fg`},p(u.$t(`permissions.actions.${e}`)),1)),64)),i(X)?(r(),h(`th`,A,p(u.$t(`permissions.other`)),1)):e(``,!0),g(`th`,j,p(u.$t(`permissions.all`)),1)])]),g(`tbody`,M,[(r(!0),h(m,null,a(U.sections,t=>(r(),h(`tr`,{key:t.key,"data-section":t.key},[g(`td`,P,[s(p(t.label)+` `,1),g(`span`,F,p(t.key),1)]),J(t)?(r(),h(m,{key:0},[(r(),h(m,null,a(G,e=>g(`td`,{key:e,class:`px-3 py-1.5 text-center`},[g(`input`,{type:`checkbox`,class:`h-4 w-4`,"data-permission":`${t.key}.${e}`,"aria-label":`${t.label}: ${u.$t(`permissions.actions.${e}`)}`,checked:q(t,e),onChange:n=>Q(t,e)},null,40,I)])),64)),i(X)?(r(),h(`td`,L,[(r(!0),h(m,null,a(Y(t),e=>(r(),h(`label`,{key:e,class:`inline-flex items-center gap-2 mr-3`},[g(`input`,{type:`checkbox`,class:`h-4 w-4`,"data-permission":`${t.key}.${e}`,checked:q(t,e),onChange:n=>Q(t,e)},null,40,ae),s(` `+p(Z(t,e)),1)]))),128))])):e(``,!0)],64)):(r(),h(`td`,{key:1,colspan:i(X)?5:4,class:`px-3 py-1.5`},[(r(!0),h(m,null,a(t.actions,e=>(r(),h(`label`,{key:e,class:`inline-flex items-center gap-2 mr-3`},[g(`input`,{type:`checkbox`,class:`h-4 w-4`,"data-permission":`${t.key}.${e}`,checked:q(t,e),onChange:n=>Q(t,e)},null,40,z),s(` `+p(Z(t,e)),1)]))),128))],8,R)),g(`td`,B,[g(`input`,{type:`checkbox`,class:`h-4 w-4`,"aria-label":`${t.label}: ${u.$t(`permissions.all`)}`,checked:$(t),onChange:e=>oe(t)},null,40,V)])],8,N))),128))])])])]),g(`div`,H,[t(v,{href:u.route(`admin.roles.index`),variant:`secondary`},{default:c(()=>[s(p(u.$t(`common.cancel`)),1)]),_:1},8,[`href`]),t(v,{"data-action":`save`,type:`submit`,loading:i(K).processing},{default:c(()=>[s(p(u.$t(`common.save`)),1)]),_:1},8,[`loading`])])],32)]),_:1})])]),_:1},8,[`title`]))}};export{U as default};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/Edit-Cp-LIO0D.js b/packages/admin/dist/assets/Edit-BB6QBa8T.js
similarity index 96%
rename from packages/admin/dist/assets/Edit-Cp-LIO0D.js
rename to packages/admin/dist/assets/Edit-BB6QBa8T.js
index f15a7b11..987c2a21 100644
--- a/packages/admin/dist/assets/Edit-Cp-LIO0D.js
+++ b/packages/admin/dist/assets/Edit-BB6QBa8T.js
@@ -1 +1 @@
-import{$ as e,C as t,E as n,G as r,I as i,L as a,Q as o,R as s,S as c,T as l,W as u,_ as d,a as f,b as p,d as m,i as h,tt as g,u as _,v,w as y,x as b}from"./dist-Bie52OmN.js";import{t as x}from"./AdminLayout-DBeSErmz.js";import{t as S}from"./AdminButton-KiIJ2sLW.js";import{t as C}from"./AdminCard-YbEwPtJz.js";import{t as w}from"./FormField-B-XX4VFv.js";var T={class:`mb-6`},E={class:`flex`,"aria-label":`Breadcrumb`},D={class:`inline-flex items-center space-x-1 md:space-x-3`},O={class:`inline-flex items-center`},k={class:`flex items-center`},A={class:`ml-1 text-muted`},j={class:`max-w-2xl`},M={class:`text-2xl font-bold text-fg mb-6`},N={key:0,"data-read-only":``,class:`mb-6 rounded-md border border-field bg-surface-alt px-4 py-3 text-sm text-fg`},P=[`disabled`],F={key:1},I=[`for`],L={key:0,class:`text-danger`},R={key:0,class:`flex items-center`},z=[`id`,`onUpdate:modelValue`],B=[`for`],V=[`id`,`onUpdate:modelValue`,`type`,`placeholder`,`required`],H={key:2,class:`mt-1 text-sm text-muted`},U={key:3,class:`mt-1 text-sm text-muted`},W={key:4,class:`mt-1 text-sm text-danger`},G={class:`flex items-center justify-end space-x-3 pt-4 border-t`},K={__name:`Edit`,props:{item:Object,fields:Array,title:String,can:{type:Object,default:()=>({})}},setup(K){let q=K,J=e=>[`text`,`email`,`password`,`checkbox`].includes(e.type),Y=p(()=>q.can.update===!1),X={};q.fields.forEach(e=>{X[e.name]=q.item[e.name]??e.default??``}),X.password=``,X.password_confirmation=``;let Z=f(X),Q=p(()=>({...q.item,...Z.data()}));a(`formData`,Q);let $=()=>{Z.put(route(`admin.users.update`,q.item.id))};return(a,f)=>(i(),c(x,{title:K.title},{default:u(()=>[b(`div`,T,[b(`nav`,E,[b(`ol`,D,[b(`li`,O,[n(o(h),{href:a.route(`admin.users.index`),class:`text-muted hover:text-accent`},{default:u(()=>[l(g(a.$t(`menu.administrators`)),1)]),_:1},8,[`href`])]),b(`li`,null,[b(`div`,k,[f[0]||=b(`svg`,{class:`w-4 h-4 text-muted`,fill:`currentColor`,viewBox:`0 0 20 20`},[b(`path`,{"fill-rule":`evenodd`,d:`M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z`,"clip-rule":`evenodd`})],-1),b(`span`,A,g(K.item.name),1)])])])])]),b(`div`,j,[b(`h1`,M,g(K.title),1),n(C,null,{default:u(()=>[Y.value?(i(),y(`p`,N,g(a.$t(`resource.form.read_only`)),1)):t(``,!0),b(`form`,{onSubmit:d($,[`prevent`]),class:`space-y-6`},[b(`fieldset`,{disabled:Y.value,class:`space-y-6`},[(i(!0),y(v,null,s(K.fields,n=>(i(),y(v,{key:n.name},[J(n)?(i(),y(`div`,F,[b(`label`,{for:n.name,class:`block text-sm font-medium text-fg mb-1`},[l(g(n.label)+` `,1),n.required&&n.type!==`password`?(i(),y(`span`,L,`*`)):t(``,!0)],8,I),n.type===`checkbox`?(i(),y(`div`,R,[r(b(`input`,{id:n.name,"onUpdate:modelValue":e=>o(Z)[n.name]=e,type:`checkbox`,class:`h-4 w-4 text-accent focus:ring-focus border-field rounded`},null,8,z),[[_,o(Z)[n.name]]]),b(`label`,{for:n.name,class:`ml-2 text-sm text-fg`},g(n.label),9,B)])):r((i(),y(`input`,{key:1,id:n.name,"onUpdate:modelValue":e=>o(Z)[n.name]=e,type:n.type===`password`?`password`:n.type===`email`?`email`:`text`,placeholder:n.type===`password`?a.$t(`account.users.password_keep_placeholder`):n.placeholder,required:n.required&&n.type!==`password`,class:e([`w-full px-3 py-2 border border-field rounded-md shadow-sm focus:ring-focus focus:border-focus`,{"border-danger":o(Z).errors[n.name]}])},null,10,V)),[[m,o(Z)[n.name]]]),n.hint?(i(),y(`p`,H,g(n.hint),1)):t(``,!0),n.type===`password`&&n.name===`password`?(i(),y(`p`,U,g(a.$t(`account.users.password_keep_hint`)),1)):t(``,!0),o(Z).errors[n.name]?(i(),y(`p`,W,g(o(Z).errors[n.name]),1)):t(``,!0)])):(i(),c(w,{key:0,field:n,modelValue:o(Z)[n.name],"onUpdate:modelValue":e=>o(Z)[n.name]=e,errors:o(Z).errors},null,8,[`field`,`modelValue`,`onUpdate:modelValue`,`errors`]))],64))),128))],8,P),b(`div`,G,[n(S,{href:a.route(`admin.users.index`),variant:`secondary`},{default:u(()=>[l(g(Y.value?a.$t(`common.back`):a.$t(`common.cancel`)),1)]),_:1},8,[`href`]),Y.value?t(``,!0):(i(),c(S,{key:0,"data-action":`save`,type:`submit`,loading:o(Z).processing},{default:u(()=>[l(g(a.$t(`common.save`)),1)]),_:1},8,[`loading`]))])],32)]),_:1})])]),_:1},8,[`title`]))}};export{K as default};
\ No newline at end of file
+import{$ as e,C as t,E as n,G as r,I as i,L as a,Q as o,R as s,S as c,T as l,W as u,_ as d,a as f,b as p,d as m,i as h,tt as g,u as _,v,w as y,x as b}from"./dist-Bie52OmN.js";import{t as x}from"./AdminLayout-D_QE0gy-.js";import{t as S}from"./AdminButton-KiIJ2sLW.js";import{t as C}from"./AdminCard-YbEwPtJz.js";import{t as w}from"./FormField-WE0R-1uV.js";var T={class:`mb-6`},E={class:`flex`,"aria-label":`Breadcrumb`},D={class:`inline-flex items-center space-x-1 md:space-x-3`},O={class:`inline-flex items-center`},k={class:`flex items-center`},A={class:`ml-1 text-muted`},j={class:`max-w-2xl`},M={class:`text-2xl font-bold text-fg mb-6`},N={key:0,"data-read-only":``,class:`mb-6 rounded-md border border-field bg-surface-alt px-4 py-3 text-sm text-fg`},P=[`disabled`],F={key:1},I=[`for`],L={key:0,class:`text-danger`},R={key:0,class:`flex items-center`},z=[`id`,`onUpdate:modelValue`],B=[`for`],V=[`id`,`onUpdate:modelValue`,`type`,`placeholder`,`required`],H={key:2,class:`mt-1 text-sm text-muted`},U={key:3,class:`mt-1 text-sm text-muted`},W={key:4,class:`mt-1 text-sm text-danger`},G={class:`flex items-center justify-end space-x-3 pt-4 border-t`},K={__name:`Edit`,props:{item:Object,fields:Array,title:String,can:{type:Object,default:()=>({})}},setup(K){let q=K,J=e=>[`text`,`email`,`password`,`checkbox`].includes(e.type),Y=p(()=>q.can.update===!1),X={};q.fields.forEach(e=>{X[e.name]=q.item[e.name]??e.default??``}),X.password=``,X.password_confirmation=``;let Z=f(X),Q=p(()=>({...q.item,...Z.data()}));a(`formData`,Q);let $=()=>{Z.put(route(`admin.users.update`,q.item.id))};return(a,f)=>(i(),c(x,{title:K.title},{default:u(()=>[b(`div`,T,[b(`nav`,E,[b(`ol`,D,[b(`li`,O,[n(o(h),{href:a.route(`admin.users.index`),class:`text-muted hover:text-accent`},{default:u(()=>[l(g(a.$t(`menu.administrators`)),1)]),_:1},8,[`href`])]),b(`li`,null,[b(`div`,k,[f[0]||=b(`svg`,{class:`w-4 h-4 text-muted`,fill:`currentColor`,viewBox:`0 0 20 20`},[b(`path`,{"fill-rule":`evenodd`,d:`M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z`,"clip-rule":`evenodd`})],-1),b(`span`,A,g(K.item.name),1)])])])])]),b(`div`,j,[b(`h1`,M,g(K.title),1),n(C,null,{default:u(()=>[Y.value?(i(),y(`p`,N,g(a.$t(`resource.form.read_only`)),1)):t(``,!0),b(`form`,{onSubmit:d($,[`prevent`]),class:`space-y-6`},[b(`fieldset`,{disabled:Y.value,class:`space-y-6`},[(i(!0),y(v,null,s(K.fields,n=>(i(),y(v,{key:n.name},[J(n)?(i(),y(`div`,F,[b(`label`,{for:n.name,class:`block text-sm font-medium text-fg mb-1`},[l(g(n.label)+` `,1),n.required&&n.type!==`password`?(i(),y(`span`,L,`*`)):t(``,!0)],8,I),n.type===`checkbox`?(i(),y(`div`,R,[r(b(`input`,{id:n.name,"onUpdate:modelValue":e=>o(Z)[n.name]=e,type:`checkbox`,class:`h-4 w-4 text-accent focus:ring-focus border-field rounded`},null,8,z),[[_,o(Z)[n.name]]]),b(`label`,{for:n.name,class:`ml-2 text-sm text-fg`},g(n.label),9,B)])):r((i(),y(`input`,{key:1,id:n.name,"onUpdate:modelValue":e=>o(Z)[n.name]=e,type:n.type===`password`?`password`:n.type===`email`?`email`:`text`,placeholder:n.type===`password`?a.$t(`account.users.password_keep_placeholder`):n.placeholder,required:n.required&&n.type!==`password`,class:e([`w-full px-3 py-2 border border-field rounded-md shadow-sm focus:ring-focus focus:border-focus`,{"border-danger":o(Z).errors[n.name]}])},null,10,V)),[[m,o(Z)[n.name]]]),n.hint?(i(),y(`p`,H,g(n.hint),1)):t(``,!0),n.type===`password`&&n.name===`password`?(i(),y(`p`,U,g(a.$t(`account.users.password_keep_hint`)),1)):t(``,!0),o(Z).errors[n.name]?(i(),y(`p`,W,g(o(Z).errors[n.name]),1)):t(``,!0)])):(i(),c(w,{key:0,field:n,modelValue:o(Z)[n.name],"onUpdate:modelValue":e=>o(Z)[n.name]=e,errors:o(Z).errors},null,8,[`field`,`modelValue`,`onUpdate:modelValue`,`errors`]))],64))),128))],8,P),b(`div`,G,[n(S,{href:a.route(`admin.users.index`),variant:`secondary`},{default:u(()=>[l(g(Y.value?a.$t(`common.back`):a.$t(`common.cancel`)),1)]),_:1},8,[`href`]),Y.value?t(``,!0):(i(),c(S,{key:0,"data-action":`save`,type:`submit`,loading:o(Z).processing},{default:u(()=>[l(g(a.$t(`common.save`)),1)]),_:1},8,[`loading`]))])],32)]),_:1})])]),_:1},8,[`title`]))}};export{K as default};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/Edit-CyzBsvwt.js b/packages/admin/dist/assets/Edit-BtQ-5Jec.js
similarity index 98%
rename from packages/admin/dist/assets/Edit-CyzBsvwt.js
rename to packages/admin/dist/assets/Edit-BtQ-5Jec.js
index ff7eef0e..4322c435 100644
--- a/packages/admin/dist/assets/Edit-CyzBsvwt.js
+++ b/packages/admin/dist/assets/Edit-BtQ-5Jec.js
@@ -1 +1 @@
-import{$ as e,C as t,G as n,I as r,Q as i,S as a,W as o,_ as s,a as c,m as l,tt as u,w as d,x as f}from"./dist-Bie52OmN.js";import{t as p}from"./AdminLayout-DBeSErmz.js";var m={class:`mb-8`},h={class:`text-2xl font-bold text-fg`},g={class:`mt-1 text-sm text-muted`},_={class:`max-w-2xl space-y-6`},v={class:`bg-surface rounded-lg shadow`},y={class:`p-6 border-b border-line`},b={class:`text-lg font-medium text-fg`},x={class:`mt-1 text-sm text-muted`},S={for:`name`,class:`block text-sm font-medium text-fg`},C={key:0,class:`mt-1 text-sm text-danger`},w={for:`email`,class:`block text-sm font-medium text-fg`},T={key:0,class:`mt-1 text-sm text-danger`},E={class:`flex justify-end`},D=[`disabled`],O={class:`bg-surface rounded-lg shadow`},k={class:`p-6 border-b border-line`},A={class:`text-lg font-medium text-fg`},j={class:`mt-1 text-sm text-muted`},M={for:`current_password`,class:`block text-sm font-medium text-fg`},N={key:0,class:`mt-1 text-sm text-danger`},P={for:`password`,class:`block text-sm font-medium text-fg`},F={key:0,class:`mt-1 text-sm text-danger`},I={for:`password_confirmation`,class:`block text-sm font-medium text-fg`},L={class:`flex justify-end`},R=[`disabled`],z={__name:`Edit`,props:{user:{type:Object,required:!0}},setup(z){let B=z,V=c({name:B.user.name,email:B.user.email}),H=c({current_password:``,password:``,password_confirmation:``}),U=()=>{V.put(route(`admin.profile.update`),{preserveScroll:!0})},W=()=>{H.put(route(`admin.profile.password`),{preserveScroll:!0,onSuccess:()=>H.reset()})};return(c,z)=>(r(),a(p,{title:c.$t(`account.profile.title`)},{default:o(()=>[f(`div`,m,[f(`h1`,h,u(c.$t(`account.profile.title`)),1),f(`p`,g,u(c.$t(`account.profile.subtitle`)),1)]),f(`div`,_,[f(`div`,v,[f(`div`,y,[f(`h2`,b,u(c.$t(`account.profile.info_title`)),1),f(`p`,x,u(c.$t(`account.profile.info_subtitle`)),1)]),f(`form`,{onSubmit:s(U,[`prevent`]),class:`p-6 space-y-4`},[f(`div`,null,[f(`label`,S,u(c.$t(`account.profile.name`)),1),n(f(`input`,{id:`name`,"onUpdate:modelValue":z[0]||=e=>i(V).name=e,type:`text`,class:e([`mt-1 block w-full px-3 py-2 border border-field rounded-md shadow-sm focus:outline-none focus:ring-focus focus:border-focus sm:text-sm`,{"border-danger":i(V).errors.name}])},null,2),[[l,i(V).name]]),i(V).errors.name?(r(),d(`p`,C,u(i(V).errors.name),1)):t(``,!0)]),f(`div`,null,[f(`label`,w,u(c.$t(`account.profile.email`)),1),n(f(`input`,{id:`email`,"onUpdate:modelValue":z[1]||=e=>i(V).email=e,type:`email`,class:e([`mt-1 block w-full px-3 py-2 border border-field rounded-md shadow-sm focus:outline-none focus:ring-focus focus:border-focus sm:text-sm`,{"border-danger":i(V).errors.email}])},null,2),[[l,i(V).email]]),i(V).errors.email?(r(),d(`p`,T,u(i(V).errors.email),1)):t(``,!0)]),f(`div`,E,[f(`button`,{type:`submit`,disabled:i(V).processing,class:`px-4 py-2 bg-accent text-on-accent text-sm font-medium rounded-md hover:bg-accent-hover focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-focus disabled:opacity-50`},u(i(V).processing?c.$t(`common.saving`):c.$t(`common.save`)),9,D)])],32)]),f(`div`,O,[f(`div`,k,[f(`h2`,A,u(c.$t(`account.profile.password_title`)),1),f(`p`,j,u(c.$t(`account.profile.password_subtitle`)),1)]),f(`form`,{onSubmit:s(W,[`prevent`]),class:`p-6 space-y-4`},[f(`div`,null,[f(`label`,M,u(c.$t(`account.profile.current_password`)),1),n(f(`input`,{id:`current_password`,"onUpdate:modelValue":z[2]||=e=>i(H).current_password=e,type:`password`,class:e([`mt-1 block w-full px-3 py-2 border border-field rounded-md shadow-sm focus:outline-none focus:ring-focus focus:border-focus sm:text-sm`,{"border-danger":i(H).errors.current_password}])},null,2),[[l,i(H).current_password]]),i(H).errors.current_password?(r(),d(`p`,N,u(i(H).errors.current_password),1)):t(``,!0)]),f(`div`,null,[f(`label`,P,u(c.$t(`account.profile.new_password`)),1),n(f(`input`,{id:`password`,"onUpdate:modelValue":z[3]||=e=>i(H).password=e,type:`password`,class:e([`mt-1 block w-full px-3 py-2 border border-field rounded-md shadow-sm focus:outline-none focus:ring-focus focus:border-focus sm:text-sm`,{"border-danger":i(H).errors.password}])},null,2),[[l,i(H).password]]),i(H).errors.password?(r(),d(`p`,F,u(i(H).errors.password),1)):t(``,!0)]),f(`div`,null,[f(`label`,I,u(c.$t(`account.profile.password_confirmation`)),1),n(f(`input`,{id:`password_confirmation`,"onUpdate:modelValue":z[4]||=e=>i(H).password_confirmation=e,type:`password`,class:`mt-1 block w-full px-3 py-2 border border-field rounded-md shadow-sm focus:outline-none focus:ring-focus focus:border-focus sm:text-sm`},null,512),[[l,i(H).password_confirmation]])]),f(`div`,L,[f(`button`,{type:`submit`,disabled:i(H).processing,class:`px-4 py-2 bg-accent text-on-accent text-sm font-medium rounded-md hover:bg-accent-hover focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-focus disabled:opacity-50`},u(i(H).processing?c.$t(`common.saving`):c.$t(`account.profile.change_password`)),9,R)])],32)])])]),_:1},8,[`title`]))}};export{z as default};
\ No newline at end of file
+import{$ as e,C as t,G as n,I as r,Q as i,S as a,W as o,_ as s,a as c,m as l,tt as u,w as d,x as f}from"./dist-Bie52OmN.js";import{t as p}from"./AdminLayout-D_QE0gy-.js";var m={class:`mb-8`},h={class:`text-2xl font-bold text-fg`},g={class:`mt-1 text-sm text-muted`},_={class:`max-w-2xl space-y-6`},v={class:`bg-surface rounded-lg shadow`},y={class:`p-6 border-b border-line`},b={class:`text-lg font-medium text-fg`},x={class:`mt-1 text-sm text-muted`},S={for:`name`,class:`block text-sm font-medium text-fg`},C={key:0,class:`mt-1 text-sm text-danger`},w={for:`email`,class:`block text-sm font-medium text-fg`},T={key:0,class:`mt-1 text-sm text-danger`},E={class:`flex justify-end`},D=[`disabled`],O={class:`bg-surface rounded-lg shadow`},k={class:`p-6 border-b border-line`},A={class:`text-lg font-medium text-fg`},j={class:`mt-1 text-sm text-muted`},M={for:`current_password`,class:`block text-sm font-medium text-fg`},N={key:0,class:`mt-1 text-sm text-danger`},P={for:`password`,class:`block text-sm font-medium text-fg`},F={key:0,class:`mt-1 text-sm text-danger`},I={for:`password_confirmation`,class:`block text-sm font-medium text-fg`},L={class:`flex justify-end`},R=[`disabled`],z={__name:`Edit`,props:{user:{type:Object,required:!0}},setup(z){let B=z,V=c({name:B.user.name,email:B.user.email}),H=c({current_password:``,password:``,password_confirmation:``}),U=()=>{V.put(route(`admin.profile.update`),{preserveScroll:!0})},W=()=>{H.put(route(`admin.profile.password`),{preserveScroll:!0,onSuccess:()=>H.reset()})};return(c,z)=>(r(),a(p,{title:c.$t(`account.profile.title`)},{default:o(()=>[f(`div`,m,[f(`h1`,h,u(c.$t(`account.profile.title`)),1),f(`p`,g,u(c.$t(`account.profile.subtitle`)),1)]),f(`div`,_,[f(`div`,v,[f(`div`,y,[f(`h2`,b,u(c.$t(`account.profile.info_title`)),1),f(`p`,x,u(c.$t(`account.profile.info_subtitle`)),1)]),f(`form`,{onSubmit:s(U,[`prevent`]),class:`p-6 space-y-4`},[f(`div`,null,[f(`label`,S,u(c.$t(`account.profile.name`)),1),n(f(`input`,{id:`name`,"onUpdate:modelValue":z[0]||=e=>i(V).name=e,type:`text`,class:e([`mt-1 block w-full px-3 py-2 border border-field rounded-md shadow-sm focus:outline-none focus:ring-focus focus:border-focus sm:text-sm`,{"border-danger":i(V).errors.name}])},null,2),[[l,i(V).name]]),i(V).errors.name?(r(),d(`p`,C,u(i(V).errors.name),1)):t(``,!0)]),f(`div`,null,[f(`label`,w,u(c.$t(`account.profile.email`)),1),n(f(`input`,{id:`email`,"onUpdate:modelValue":z[1]||=e=>i(V).email=e,type:`email`,class:e([`mt-1 block w-full px-3 py-2 border border-field rounded-md shadow-sm focus:outline-none focus:ring-focus focus:border-focus sm:text-sm`,{"border-danger":i(V).errors.email}])},null,2),[[l,i(V).email]]),i(V).errors.email?(r(),d(`p`,T,u(i(V).errors.email),1)):t(``,!0)]),f(`div`,E,[f(`button`,{type:`submit`,disabled:i(V).processing,class:`px-4 py-2 bg-accent text-on-accent text-sm font-medium rounded-md hover:bg-accent-hover focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-focus disabled:opacity-50`},u(i(V).processing?c.$t(`common.saving`):c.$t(`common.save`)),9,D)])],32)]),f(`div`,O,[f(`div`,k,[f(`h2`,A,u(c.$t(`account.profile.password_title`)),1),f(`p`,j,u(c.$t(`account.profile.password_subtitle`)),1)]),f(`form`,{onSubmit:s(W,[`prevent`]),class:`p-6 space-y-4`},[f(`div`,null,[f(`label`,M,u(c.$t(`account.profile.current_password`)),1),n(f(`input`,{id:`current_password`,"onUpdate:modelValue":z[2]||=e=>i(H).current_password=e,type:`password`,class:e([`mt-1 block w-full px-3 py-2 border border-field rounded-md shadow-sm focus:outline-none focus:ring-focus focus:border-focus sm:text-sm`,{"border-danger":i(H).errors.current_password}])},null,2),[[l,i(H).current_password]]),i(H).errors.current_password?(r(),d(`p`,N,u(i(H).errors.current_password),1)):t(``,!0)]),f(`div`,null,[f(`label`,P,u(c.$t(`account.profile.new_password`)),1),n(f(`input`,{id:`password`,"onUpdate:modelValue":z[3]||=e=>i(H).password=e,type:`password`,class:e([`mt-1 block w-full px-3 py-2 border border-field rounded-md shadow-sm focus:outline-none focus:ring-focus focus:border-focus sm:text-sm`,{"border-danger":i(H).errors.password}])},null,2),[[l,i(H).password]]),i(H).errors.password?(r(),d(`p`,F,u(i(H).errors.password),1)):t(``,!0)]),f(`div`,null,[f(`label`,I,u(c.$t(`account.profile.password_confirmation`)),1),n(f(`input`,{id:`password_confirmation`,"onUpdate:modelValue":z[4]||=e=>i(H).password_confirmation=e,type:`password`,class:`mt-1 block w-full px-3 py-2 border border-field rounded-md shadow-sm focus:outline-none focus:ring-focus focus:border-focus sm:text-sm`},null,512),[[l,i(H).password_confirmation]])]),f(`div`,L,[f(`button`,{type:`submit`,disabled:i(H).processing,class:`px-4 py-2 bg-accent text-on-accent text-sm font-medium rounded-md hover:bg-accent-hover focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-focus disabled:opacity-50`},u(i(H).processing?c.$t(`common.saving`):c.$t(`account.profile.change_password`)),9,R)])],32)])])]),_:1},8,[`title`]))}};export{z as default};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/Edit-BEWPbBmM.js b/packages/admin/dist/assets/Edit-CG7aI-oj.js
similarity index 97%
rename from packages/admin/dist/assets/Edit-BEWPbBmM.js
rename to packages/admin/dist/assets/Edit-CG7aI-oj.js
index 0634b700..e66f2d9a 100644
--- a/packages/admin/dist/assets/Edit-BEWPbBmM.js
+++ b/packages/admin/dist/assets/Edit-CG7aI-oj.js
@@ -1 +1 @@
-import{C as e,E as t,I as n,L as r,Q as i,R as a,S as o,T as s,W as c,X as l,_ as u,a as d,b as f,i as p,q as m,tt as h,v as g,w as _,x as v}from"./dist-Bie52OmN.js";import{t as y}from"./AdminLayout-DBeSErmz.js";import{t as b}from"./AdminButton-KiIJ2sLW.js";import{t as x}from"./AdminCard-YbEwPtJz.js";import{n as S,r as C,t as w}from"./ContentLocaleSwitcher-HJzbB87a.js";import{t as T}from"./FormField-B-XX4VFv.js";import{n as E,r as D,t as ee}from"./contentLocale-BV_E0iGS.js";import{t as O}from"./recordActions-CtRs42tG.js";var k={class:`mb-6`},A={class:`flex`,"aria-label":`Breadcrumb`},j={class:`inline-flex items-center space-x-1 md:space-x-3`},M={class:`inline-flex items-center`},N={class:`flex items-center`},P={class:`ml-1 text-muted`},F={class:`max-w-4xl`},I={class:`mb-6 flex flex-wrap items-center justify-between gap-4`},L={class:`text-2xl font-bold text-fg`},R={key:0,class:`flex gap-2`},z={key:0,"data-read-only":``,class:`mb-6 rounded-md border border-field bg-surface-alt px-4 py-3 text-sm text-fg`},B=[`data-resource`,`data-item-id`],V=[`disabled`],H={class:`space-y-6`},te={key:0,class:`text-center py-12 text-muted`},U={key:2,class:`space-y-6`},W={class:`flex items-center justify-end space-x-3 pt-6 mt-6 border-t`},G={__name:`Edit`,props:{routeName:String,createLabel:String,item:Object,itemTitle:String,fields:Array,fieldsByTab:Object,tabs:Array,useTabs:Boolean,title:String,adminLabel:String,can:{type:Object,default:()=>({})},actions:{type:Array,default:()=>[]}},setup(G){let K=G,q=f(()=>K.can.update===!1),J=l(K.tabs?.[0]?.name||`main`),Y={};K.useTabs&&K.fieldsByTab?Object.values(K.fieldsByTab).flat().forEach(e=>{Y[e.name]=E(e,K.item[e.name])}):K.fields.forEach(e=>{Y[e.name]=E(e,K.item[e.name])});let X=d(Y),Z=()=>(K.useTabs&&K.fieldsByTab?Object.values(K.fieldsByTab).flat():K.fields)||[],{locale:Q,locales:ne,showSwitcher:re}=D(Z),ie=f(()=>({...K.item,...X.data()}));r(`formData`,ie),r(`aiModule`,K.routeName?.replace(/^admin\./,``)||null);let ae=()=>{X.submit(`put`,route(`${K.routeName}.update`,K.item.id))},$=e=>K.fieldsByTab?.[e]?K.fieldsByTab[e].filter(e=>ee(X.errors,e)).length:0,oe=f(()=>K.tabs?K.tabs.map(e=>({...e,badge:$(e.name)>0?String($(e.name)):null})):[]);return(r,l)=>(n(),o(y,{title:G.title},{default:c(()=>[v(`div`,k,[v(`nav`,A,[v(`ol`,j,[v(`li`,M,[t(i(p),{href:r.route(`${K.routeName}.index`),class:`text-muted hover:text-accent`},{default:c(()=>[s(h(G.adminLabel),1)]),_:1},8,[`href`])]),v(`li`,null,[v(`div`,N,[l[2]||=v(`svg`,{class:`w-4 h-4 text-muted`,fill:`currentColor`,viewBox:`0 0 20 20`},[v(`path`,{"fill-rule":`evenodd`,d:`M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z`,"clip-rule":`evenodd`})],-1),v(`span`,P,h(G.itemTitle||`#`+G.item.id),1)])])])])]),v(`div`,F,[v(`div`,I,[v(`h1`,L,h(G.title),1),G.actions.length?(n(),_(`div`,R,[(n(!0),_(g,null,a(G.actions,e=>(n(),o(b,{key:e.name,"data-action":e.name,variant:`secondary`,href:i(O)(G.routeName,e,G.item)},{default:c(()=>[s(h(e.label),1)]),_:2},1032,[`data-action`,`href`]))),128))])):e(``,!0)]),t(x,null,{default:c(()=>[q.value?(n(),_(`p`,z,h(r.$t(`resource.form.read_only`)),1)):e(``,!0),v(`form`,{onSubmit:u(ae,[`prevent`]),"data-admin-form":`true`,"data-resource":G.routeName,"data-context":`edit`,"data-item-id":G.item.id},[v(`fieldset`,{disabled:q.value,class:`contents`},[i(re)?(n(),o(w,{key:0,modelValue:i(Q),"onUpdate:modelValue":l[0]||=e=>m(Q)?Q.value=e:null,locales:i(ne),fields:Z(),errors:i(X).errors},null,8,[`modelValue`,`locales`,`fields`,`errors`])):e(``,!0),G.useTabs&&G.tabs&&G.fieldsByTab?(n(),o(C,{key:1,tabs:oe.value,modelValue:J.value,"onUpdate:modelValue":l[1]||=e=>J.value=e},{default:c(({activeTab:t})=>[(n(!0),_(g,null,a(G.tabs,s=>(n(),o(S,{key:s.name,name:s.name,activeTab:t},{default:c(()=>[v(`div`,H,[(n(!0),_(g,null,a(G.fieldsByTab[s.name],e=>(n(),o(T,{key:e.name,field:e,modelValue:i(X)[e.name],"onUpdate:modelValue":t=>i(X)[e.name]=t,errors:i(X).errors},null,8,[`field`,`modelValue`,`onUpdate:modelValue`,`errors`]))),128)),G.fieldsByTab[s.name]?.length?e(``,!0):(n(),_(`div`,te,[v(`p`,null,h(r.$t(`resource.form.empty_tab`)),1)]))])]),_:2},1032,[`name`,`activeTab`]))),128))]),_:1},8,[`tabs`,`modelValue`])):(n(),_(`div`,U,[(n(!0),_(g,null,a(G.fields,e=>(n(),o(T,{key:e.name,field:e,modelValue:i(X)[e.name],"onUpdate:modelValue":t=>i(X)[e.name]=t,errors:i(X).errors},null,8,[`field`,`modelValue`,`onUpdate:modelValue`,`errors`]))),128))]))],8,V),v(`div`,W,[t(b,{"data-action":`cancel`,href:r.route(`${K.routeName}.index`),variant:`secondary`},{default:c(()=>[s(h(q.value?r.$t(`common.back`):r.$t(`common.cancel`)),1)]),_:1},8,[`href`]),q.value?e(``,!0):(n(),o(b,{key:0,"data-action":`save`,type:`submit`,loading:i(X).processing},{default:c(()=>[s(h(r.$t(`common.save`)),1)]),_:1},8,[`loading`]))])],40,B)]),_:1})])]),_:1},8,[`title`]))}};export{G as default};
\ No newline at end of file
+import{C as e,E as t,I as n,L as r,Q as i,R as a,S as o,T as s,W as c,X as l,_ as u,a as d,b as f,i as p,q as m,tt as h,v as g,w as _,x as v}from"./dist-Bie52OmN.js";import{t as y}from"./AdminLayout-D_QE0gy-.js";import{t as b}from"./AdminButton-KiIJ2sLW.js";import{t as x}from"./AdminCard-YbEwPtJz.js";import{n as S,r as C,t as w}from"./ContentLocaleSwitcher-HJzbB87a.js";import{t as T}from"./FormField-WE0R-1uV.js";import{n as E,r as D,t as ee}from"./contentLocale-BV_E0iGS.js";import{t as O}from"./recordActions-CtRs42tG.js";var k={class:`mb-6`},A={class:`flex`,"aria-label":`Breadcrumb`},j={class:`inline-flex items-center space-x-1 md:space-x-3`},M={class:`inline-flex items-center`},N={class:`flex items-center`},P={class:`ml-1 text-muted`},F={class:`max-w-4xl`},I={class:`mb-6 flex flex-wrap items-center justify-between gap-4`},L={class:`text-2xl font-bold text-fg`},R={key:0,class:`flex gap-2`},z={key:0,"data-read-only":``,class:`mb-6 rounded-md border border-field bg-surface-alt px-4 py-3 text-sm text-fg`},B=[`data-resource`,`data-item-id`],V=[`disabled`],H={class:`space-y-6`},te={key:0,class:`text-center py-12 text-muted`},U={key:2,class:`space-y-6`},W={class:`flex items-center justify-end space-x-3 pt-6 mt-6 border-t`},G={__name:`Edit`,props:{routeName:String,createLabel:String,item:Object,itemTitle:String,fields:Array,fieldsByTab:Object,tabs:Array,useTabs:Boolean,title:String,adminLabel:String,can:{type:Object,default:()=>({})},actions:{type:Array,default:()=>[]}},setup(G){let K=G,q=f(()=>K.can.update===!1),J=l(K.tabs?.[0]?.name||`main`),Y={};K.useTabs&&K.fieldsByTab?Object.values(K.fieldsByTab).flat().forEach(e=>{Y[e.name]=E(e,K.item[e.name])}):K.fields.forEach(e=>{Y[e.name]=E(e,K.item[e.name])});let X=d(Y),Z=()=>(K.useTabs&&K.fieldsByTab?Object.values(K.fieldsByTab).flat():K.fields)||[],{locale:Q,locales:ne,showSwitcher:re}=D(Z),ie=f(()=>({...K.item,...X.data()}));r(`formData`,ie),r(`aiModule`,K.routeName?.replace(/^admin\./,``)||null);let ae=()=>{X.submit(`put`,route(`${K.routeName}.update`,K.item.id))},$=e=>K.fieldsByTab?.[e]?K.fieldsByTab[e].filter(e=>ee(X.errors,e)).length:0,oe=f(()=>K.tabs?K.tabs.map(e=>({...e,badge:$(e.name)>0?String($(e.name)):null})):[]);return(r,l)=>(n(),o(y,{title:G.title},{default:c(()=>[v(`div`,k,[v(`nav`,A,[v(`ol`,j,[v(`li`,M,[t(i(p),{href:r.route(`${K.routeName}.index`),class:`text-muted hover:text-accent`},{default:c(()=>[s(h(G.adminLabel),1)]),_:1},8,[`href`])]),v(`li`,null,[v(`div`,N,[l[2]||=v(`svg`,{class:`w-4 h-4 text-muted`,fill:`currentColor`,viewBox:`0 0 20 20`},[v(`path`,{"fill-rule":`evenodd`,d:`M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z`,"clip-rule":`evenodd`})],-1),v(`span`,P,h(G.itemTitle||`#`+G.item.id),1)])])])])]),v(`div`,F,[v(`div`,I,[v(`h1`,L,h(G.title),1),G.actions.length?(n(),_(`div`,R,[(n(!0),_(g,null,a(G.actions,e=>(n(),o(b,{key:e.name,"data-action":e.name,variant:`secondary`,href:i(O)(G.routeName,e,G.item)},{default:c(()=>[s(h(e.label),1)]),_:2},1032,[`data-action`,`href`]))),128))])):e(``,!0)]),t(x,null,{default:c(()=>[q.value?(n(),_(`p`,z,h(r.$t(`resource.form.read_only`)),1)):e(``,!0),v(`form`,{onSubmit:u(ae,[`prevent`]),"data-admin-form":`true`,"data-resource":G.routeName,"data-context":`edit`,"data-item-id":G.item.id},[v(`fieldset`,{disabled:q.value,class:`contents`},[i(re)?(n(),o(w,{key:0,modelValue:i(Q),"onUpdate:modelValue":l[0]||=e=>m(Q)?Q.value=e:null,locales:i(ne),fields:Z(),errors:i(X).errors},null,8,[`modelValue`,`locales`,`fields`,`errors`])):e(``,!0),G.useTabs&&G.tabs&&G.fieldsByTab?(n(),o(C,{key:1,tabs:oe.value,modelValue:J.value,"onUpdate:modelValue":l[1]||=e=>J.value=e},{default:c(({activeTab:t})=>[(n(!0),_(g,null,a(G.tabs,s=>(n(),o(S,{key:s.name,name:s.name,activeTab:t},{default:c(()=>[v(`div`,H,[(n(!0),_(g,null,a(G.fieldsByTab[s.name],e=>(n(),o(T,{key:e.name,field:e,modelValue:i(X)[e.name],"onUpdate:modelValue":t=>i(X)[e.name]=t,errors:i(X).errors},null,8,[`field`,`modelValue`,`onUpdate:modelValue`,`errors`]))),128)),G.fieldsByTab[s.name]?.length?e(``,!0):(n(),_(`div`,te,[v(`p`,null,h(r.$t(`resource.form.empty_tab`)),1)]))])]),_:2},1032,[`name`,`activeTab`]))),128))]),_:1},8,[`tabs`,`modelValue`])):(n(),_(`div`,U,[(n(!0),_(g,null,a(G.fields,e=>(n(),o(T,{key:e.name,field:e,modelValue:i(X)[e.name],"onUpdate:modelValue":t=>i(X)[e.name]=t,errors:i(X).errors},null,8,[`field`,`modelValue`,`onUpdate:modelValue`,`errors`]))),128))]))],8,V),v(`div`,W,[t(b,{"data-action":`cancel`,href:r.route(`${K.routeName}.index`),variant:`secondary`},{default:c(()=>[s(h(q.value?r.$t(`common.back`):r.$t(`common.cancel`)),1)]),_:1},8,[`href`]),q.value?e(``,!0):(n(),o(b,{key:0,"data-action":`save`,type:`submit`,loading:i(X).processing},{default:c(()=>[s(h(r.$t(`common.save`)),1)]),_:1},8,[`loading`]))])],40,B)]),_:1})])]),_:1},8,[`title`]))}};export{G as default};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/FormField-B-XX4VFv.js b/packages/admin/dist/assets/FormField-WE0R-1uV.js
similarity index 99%
rename from packages/admin/dist/assets/FormField-B-XX4VFv.js
rename to packages/admin/dist/assets/FormField-WE0R-1uV.js
index c4ca012a..544717fa 100644
--- a/packages/admin/dist/assets/FormField-B-XX4VFv.js
+++ b/packages/admin/dist/assets/FormField-WE0R-1uV.js
@@ -1,4 +1,4 @@
-import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,M as f,N as p,O as m,P as h,Q as g,R as _,S as v,T as y,U as b,V as x,W as S,X as C,Z as w,_ as T,b as E,c as ee,d as te,et as ne,f as re,g as D,h as ie,j as ae,k as oe,m as se,o as ce,p as le,tt as O,u as ue,v as k,w as A,x as j,y as de,z as M}from"./dist-Bie52OmN.js";import{n as N}from"./app-BCJOqmKO.js";import{i as fe,n as pe,r as me}from"./AdminLayout-DBeSErmz.js";import{t as he}from"./AdminModal-DKazeNNa.js";import{t as ge}from"./AdminButton-KiIJ2sLW.js";var _e=Object.defineProperty,ve=(e,t)=>{let n={};for(var r in e)_e(n,r,{get:e[r],enumerable:!0});return t||_e(n,Symbol.toStringTag,{value:`Module`}),n};function ye(e){this.content=e}ye.prototype={constructor:ye,find:function(e){for(var t=0;t>1}},ye.from=function(e){if(e instanceof ye)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new ye(t)};function be(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a)n+=i.nodeSize;else{if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i=56320&&e<57344}function Ce(e){return e>=55296&&e<56320}var P=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;te&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);at)for(let e=0,a=0;at&&((an)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Te(t+1,i):Te(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;ethis.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;te.type.rank-t.type.rank),n}};F.none=[];var De=class extends Error{},I=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=ke(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Oe(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(P.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};I.empty=new I(P.empty,0,0);function Oe(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Oe(a.content,t-i-1,n-i-1)))}function ke(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=ke(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function Ae(e,t,n){if(n.openStart>e.depth)throw new De(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new De(`Inconsistent open depths`);return je(e,t,n,0)}function je(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Fe(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Pe(e.nodeAfter,r),a++));for(let e=a;ei&&Ne(e,t,i+1),o=r.depth>i&&Ne(n,r,i+1),s=[];return Fe(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Me(a,o),Pe(Ie(a,Le(e,t,n,r,i+1)),s)):(a&&Pe(Ie(a,Re(e,t,i+1)),s),Fe(t,n,i,s),o&&Pe(Ie(o,Re(n,r,i+1)),s)),Fe(r,null,i,s),new P(s)}function Re(e,t,n){let r=[];return Fe(null,e,n,r),e.depth>n&&Pe(Ie(Ne(e,t,n+1),Re(e,t,n+1)),r),Fe(t,null,n,r),new P(r)}function ze(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(P.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Be=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new We(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Ue.get(t);if(r)for(let e=0;ee&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),Ye(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=P.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;ee.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=P.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}};Ke.prototype.text=void 0;var qe=(()=>{let{stack:e}=Error(`/`);if(!e||!/\n\s*at\s/.test(e))return e=>e;let t=Object.create(null);return e=>(t[e],e)})(),Je=class e extends Ke{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ye(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return qe(this.text.slice(e,t))}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(qe(this.text.slice(e,t)))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Ye(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function Xe(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}var Ze=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Qe(t,n);if(r.next==null)return e.empty;let i=$e(r);r.next&&r.err(`Unexpected trailing text`);let a=lt(ot(i));return ut(a,r),a}matchType(e){for(let t=0;te.createAndFill()));for(let e=0;e=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n`+e.indexOf(t.next[n].next);return r}).join(`
+import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,M as f,N as p,O as m,P as h,Q as g,R as _,S as v,T as y,U as b,V as x,W as S,X as C,Z as w,_ as T,b as E,c as ee,d as te,et as ne,f as re,g as D,h as ie,j as ae,k as oe,m as se,o as ce,p as le,tt as O,u as ue,v as k,w as A,x as j,y as de,z as M}from"./dist-Bie52OmN.js";import{n as N}from"./app-Cdw8k5No.js";import{i as fe,n as pe,r as me}from"./AdminLayout-D_QE0gy-.js";import{t as he}from"./AdminModal-DKazeNNa.js";import{t as ge}from"./AdminButton-KiIJ2sLW.js";var _e=Object.defineProperty,ve=(e,t)=>{let n={};for(var r in e)_e(n,r,{get:e[r],enumerable:!0});return t||_e(n,Symbol.toStringTag,{value:`Module`}),n};function ye(e){this.content=e}ye.prototype={constructor:ye,find:function(e){for(var t=0;t>1}},ye.from=function(e){if(e instanceof ye)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new ye(t)};function be(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a)n+=i.nodeSize;else{if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i=56320&&e<57344}function Ce(e){return e>=55296&&e<56320}var P=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;te&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);at)for(let e=0,a=0;at&&((an)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Te(t+1,i):Te(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;ethis.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;te.type.rank-t.type.rank),n}};F.none=[];var De=class extends Error{},I=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=ke(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Oe(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(P.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};I.empty=new I(P.empty,0,0);function Oe(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Oe(a.content,t-i-1,n-i-1)))}function ke(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=ke(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function Ae(e,t,n){if(n.openStart>e.depth)throw new De(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new De(`Inconsistent open depths`);return je(e,t,n,0)}function je(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Fe(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Pe(e.nodeAfter,r),a++));for(let e=a;ei&&Ne(e,t,i+1),o=r.depth>i&&Ne(n,r,i+1),s=[];return Fe(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Me(a,o),Pe(Ie(a,Le(e,t,n,r,i+1)),s)):(a&&Pe(Ie(a,Re(e,t,i+1)),s),Fe(t,n,i,s),o&&Pe(Ie(o,Re(n,r,i+1)),s)),Fe(r,null,i,s),new P(s)}function Re(e,t,n){let r=[];return Fe(null,e,n,r),e.depth>n&&Pe(Ie(Ne(e,t,n+1),Re(e,t,n+1)),r),Fe(t,null,n,r),new P(r)}function ze(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(P.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Be=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new We(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Ue.get(t);if(r)for(let e=0;ee&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),Ye(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=P.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;ee.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=P.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}};Ke.prototype.text=void 0;var qe=(()=>{let{stack:e}=Error(`/`);if(!e||!/\n\s*at\s/.test(e))return e=>e;let t=Object.create(null);return e=>(t[e],e)})(),Je=class e extends Ke{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ye(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return qe(this.text.slice(e,t))}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(qe(this.text.slice(e,t)))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Ye(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function Xe(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}var Ze=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Qe(t,n);if(r.next==null)return e.empty;let i=$e(r);r.next&&r.err(`Unexpected trailing text`);let a=lt(ot(i));return ut(a,r),a}matchType(e){for(let t=0;te.createAndFill()));for(let e=0;e=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n`+e.indexOf(t.next[n].next);return r}).join(`
`)}};Ze.empty=new Ze(!0);var Qe=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function $e(e){let t=[];do t.push(et(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function et(e){let t=[];do t.push(tt(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function tt(e){let t=at(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=rt(e,t);else break;return t}function nt(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function rt(e,t){let n=nt(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:nt(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function it(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function at(e){if(e.eat(`(`)){let t=$e(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=it(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function ot(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Ze(r.indexOf(e.length-1)>-1);for(let e=0;e-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:ft(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new Ke(this,this.computeAttrs(e),P.from(t),F.setFrom(n))}createChecked(e=null,t,n){return t=P.from(t),this.checkContent(t),new Ke(this,this.computeAttrs(e),t,F.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=P.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(P.empty,!0);return i?new Ke(this,e,t.append(i),F.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;tr[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function ht(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var gt=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?ht(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},_t=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=pt(e,r.attrs),this.excluded=null;let i=dt(this.attrs);this.instance=i?new F(this,i):null}create(e=null){return!e&&this.instance?this.instance:new F(this,ft(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t-1}},vt=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=ye.from(e.nodes),t.marks=ye.from(e.marks||{}),this.nodes=mt.compile(this.spec.nodes,this),this.marks=_t.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Ze.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?yt(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:yt(this,n.split(` `))}this.nodeFromJSON=e=>Ke.fromJSON(this,e),this.markFromJSON=e=>F.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof mt))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Je(n,n.defaultAttrs,e,F.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function yt(e,t){let n=[];for(let r=0;r-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function bt(e){return e.tag!=null}function xt(e){return e.style!=null}var St=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(bt(e))this.tags.push(e);else if(xt(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new jt(this,t,!1);return n.addAll(e,F.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new jt(this,t,!0);return n.addAll(e,F.none,t.from,t.to),I.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;re.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r{n(e=Pt(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Pt(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},Ct={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},wt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Tt={ol:!0,ul:!0},Et=1,Dt=2,Ot=4;function kt(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?Et:0)|(t===`full`?Dt:0)}var At=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=F.none,this.match=i||(a&Ot?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(P.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Et)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=P.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(P.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ct.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},jt=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=kt(null,t.preserveWhitespace,0)|(n?Ot:0);i=r?new At(r.type,r.attrs,F.none,!0,t.topMatch||r.type.contentMatch,a):n?new At(null,null,F.none,!0,null,a):new At(e.schema.topNodeType,null,F.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&Dt?`full`:this.localPreserveWS||(r.options&Et)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node){if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e!(a.type?a.type.allowsMarkType(t.type):Ft(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new At(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=Et);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function Mt(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&Tt.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function Nt(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Pt(e){let t={};for(let n in e)t[n]=e[n];return t}function Ft(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n{if(i.length||e.marks.length){let n=0,a=0;for(;n=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Ht(Rt(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:Ht(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Lt(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Lt(e.marks)}};function Lt(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Rt(e){return e.document||window.document}var zt=new WeakMap;function Bt(e){let t=zt.get(e);return t===void 0&&zt.set(e,t=Vt(e)),t}function Vt(e){let t=null;function n(e){if(e&&typeof e==`object`){if(Array.isArray(e)){if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;iu)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=Ht(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var Ut=65535,Wt=2**16;function Gt(e,t){return e+t*Wt}function Kt(e){return e&Ut}function qt(e){return(e-(e&Ut))/Wt}var Jt=1,Yt=2,Xt=4,Zt=8,Qt=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Zt)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&Xt)>0}},$t=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=Kt(e);if(!this.inverted)for(let e=0;ee)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:Gt(o/3,e-s),f=0;return c&&(f|=e==s?Yt:e==u?Jt:Xt,(t<0?e!=s:e!=u)&&(f|=Zt)),new Qt(a,f,d)}r+=l-c}return n?e+r:new Qt(e+r,0,null)}touches(e,t){let n=0,r=Kt(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;te)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;nn&&t!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return rn.fromReplace(e,this.from,this.to,i)}invert(t){let n=[];return t.nodesBetween(this.from,this.to,(t,r)=>{if(t.isInline&&t.isAtom){let i=this.mark.addToSet(t.marks);if(!F.sameSet(i,t.marks)){let a=Math.max(this.from,r),o=Math.min(this.to,r+t.nodeSize);cn(sn,a,o,this.mark,n);for(let r of t.marks)r.isInSet(i)||cn(e,a,o,r,n)}}}),n.length==1?n[0]:new ln(n)}map(t){let n=t.map(this.from,1),r=t.map(this.to,-1);return n>=r?null:new e(n,r,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};nn.jsonID(`addMark`,on);var sn=class e extends nn{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new I(an(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return rn.fromReplace(e,this.from,this.to,n)}invert(e){let t=[];return e.nodesBetween(this.from,this.to,(e,n)=>{e.isInline&&e.isAtom&&this.mark.isInSet(e.marks)&&cn(on,Math.max(this.from,n),Math.min(this.to,n+e.nodeSize),this.mark,t)}),t.length==1?t[0]:new ln(t)}map(t){let n=t.map(this.from,1),r=t.map(this.to,-1);return n>=r?null:new e(n,r,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};nn.jsonID(`removeMark`,sn);function cn(e,t,n,r,i){let a=i.length?i[i.length-1]:null;a&&a instanceof e&&a.to==t&&a.mark.eq(r)?i[i.length-1]=new e(a.from,n,r):i.push(new e(t,n,r))}var ln=class e extends nn{constructor(e){super(),this.steps=e}apply(e){for(let t of this.steps){let n=t.apply(e);if(!n.doc)return n;e=n.doc}return new rn(e,null)}invert(t){return new e(this.steps.map(e=>e.invert(t)))}map(t){let n=[];for(let e of this.steps){let r=e.map(t);r&&n.push(r)}return n.length?new e(n):null}toJSON(){return{stepType:`markSet`,steps:this.steps.map(e=>e.toJSON())}}static fromJSON(t,n){if(!Array.isArray(n.steps)||!n.steps.every(e=>e.stepType==`addMark`||e.stepType==`removeMark`))throw RangeError(`Invalid JSON for MarkSetStep`);return new e(n.steps.map(e=>nn.fromJSON(t,e)))}};nn.jsonID(`markSet`,ln);var un=class e extends nn{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return rn.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return rn.fromReplace(e,this.pos,this.pos+1,new I(P.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;rr.pos||i>a?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,I.fromJSON(t,n.slice),n.insert,!!n.structure)}};nn.jsonID(`replaceAround`,pn);function mn(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function hn(e,t,n,r){let i=[];e.doc.nodesBetween(t,n,(e,a,o)=>{if(!e.isInline)return;let s=e.marks;!r.isInSet(s)&&o.type.allowsMarkType(r.type)&&cn(on,Math.max(a,t),Math.min(a+e.nodeSize,n),r,i)}),i.forEach(t=>e.step(t))}function gn(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline||!e.isAtom)return;a++;let s=null;if(r instanceof _t){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;ee.step(new sn(t.from,t.to,t.style)))}function _n(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t=0;t--)e.step(o[t])}function vn(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function yn(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(nn;e--)t||r.index(e)>0?(t=!0,u=P.from(r.node(e).copy(u)),d++):c--;let f=P.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=P.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new pn(i,a,i,a,new I(r,0,0),n.length,!0))}function En(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&kn(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&On(e,t,n,a),_n(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new pn(c,l,c+1,l-1,new I(P.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Dn(e,t,n,a),!1}})}function Dn(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function On(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
diff --git a/packages/admin/dist/assets/Index-B9KqS9R5.js b/packages/admin/dist/assets/Index-0in3vE-5.js
similarity index 98%
rename from packages/admin/dist/assets/Index-B9KqS9R5.js
rename to packages/admin/dist/assets/Index-0in3vE-5.js
index e50a4fe1..c988654e 100644
--- a/packages/admin/dist/assets/Index-B9KqS9R5.js
+++ b/packages/admin/dist/assets/Index-0in3vE-5.js
@@ -1 +1 @@
-import{$ as e,C as t,E as n,I as r,Q as i,R as a,S as o,T as s,W as c,n as ee,s as l,tt as u,v as d,w as f,x as p}from"./dist-Bie52OmN.js";import{t as te}from"./AdminLayout-DBeSErmz.js";import{t as m}from"./AdminButton-KiIJ2sLW.js";var h={class:`mb-6`},g={"data-page-title":`admin.modules`,class:`text-2xl font-bold text-fg`},_={class:`mt-1 text-sm text-muted`},v={class:`bg-surface rounded-lg shadow overflow-hidden`},y={key:0,class:`p-6 text-sm text-muted`},b={key:1,class:`min-w-full text-sm`},x={class:`bg-surface-alt`},S={class:`px-4 py-2 text-left font-medium text-fg`},C={class:`px-4 py-2 text-left font-medium text-fg`},w={class:`divide-y divide-line`},T=[`data-module`,`data-parent`,`data-enabled`],E={key:0,"aria-hidden":`true`,class:`mr-1 text-muted`},D={key:1,class:`ml-2 rounded bg-surface-alt px-1.5 py-0.5 text-xs font-normal text-muted`},O={key:0,class:`text-muted`},k={class:`px-4 py-2 font-mono text-xs text-muted`},A={class:`px-4 py-2 text-right whitespace-nowrap space-x-2`},j={key:0,"data-section":`required`,class:`mt-8`},M={class:`text-lg font-semibold text-fg`},N={class:`mt-1 text-sm text-muted`},P={class:`mt-3 bg-surface rounded-lg shadow divide-y divide-line text-sm`},ne=[`data-required`],F={class:`font-medium text-fg`},I={key:0,class:`text-muted`},L={class:`mt-1 block font-mono text-xs text-fg select-all`},R={key:1,"data-section":`catalogue`,class:`mt-8`},z={class:`text-lg font-semibold text-fg`},B={class:`mt-1 text-sm text-muted`},V={class:`mt-3 text-sm text-muted`},H={key:0,"data-catalogue":`unavailable`,class:`mt-3 text-sm text-muted`},U={key:1,class:`mt-3 text-sm text-muted`},W={key:2,class:`mt-3 bg-surface rounded-lg shadow divide-y divide-line text-sm`},G=[`data-package`,`data-status`],K={class:`flex flex-wrap items-baseline gap-x-3`},q=[`href`],J={key:0,class:`rounded bg-surface-alt px-1.5 py-0.5 text-xs text-muted`},Y={class:`text-xs text-muted`},X={key:0,class:`text-muted`},Z={key:0,class:`mt-1 block font-mono text-xs text-fg select-all`},re={class:`mt-1 block font-mono text-xs text-fg select-all`},Q={__name:`Index`,props:{modules:Array,required:Array,canManage:Boolean,catalogue:Object,title:String},setup(Q){let ie=e=>{l.post(route(e.enabled?`admin.modules.disable`:`admin.modules.enable`,e.key),{},{preserveScroll:!0})},$=e=>`php artisan atrium:module:install ${e}`;return(l,ae)=>(r(),o(te,{title:Q.title},{default:c(()=>[p(`div`,h,[p(`h1`,g,u(Q.title),1),p(`p`,_,u(l.$t(`modules.index_hint`)),1)]),p(`div`,v,[Q.modules.length===0?(r(),f(`p`,y,u(l.$t(`modules.empty`)),1)):(r(),f(`table`,b,[p(`thead`,x,[p(`tr`,null,[p(`th`,S,u(l.$t(`modules.module`)),1),p(`th`,C,u(l.$t(`modules.package`)),1),ae[0]||=p(`th`,{class:`px-4 py-2`},null,-1)])]),p(`tbody`,w,[(r(!0),f(d,null,a(Q.modules,n=>(r(),f(`tr`,{key:n.name,"data-module":n.name,"data-parent":n.parent,"data-enabled":n.enabled?`true`:`false`},[p(`td`,{class:e([`py-2 pr-4`,n.parent?`pl-10`:`pl-4`])},[p(`div`,{class:e([`font-medium`,n.enabled?`text-fg`:`text-muted`])},[n.parent?(r(),f(`span`,E,`↳`)):t(``,!0),s(u(n.label)+` `,1),n.enabled?t(``,!0):(r(),f(`span`,D,u(l.$t(`modules.status_disabled`)),1))],2),n.description?(r(),f(`div`,O,u(n.description),1)):t(``,!0)],2),p(`td`,k,u(n.name),1),p(`td`,A,[n.settings?(r(),o(m,{key:0,size:`sm`,variant:`outline`,"data-action":`settings`,href:l.route(`admin.modules.settings`,n.key)},{default:c(()=>[s(u(l.$t(`modules.settings`)),1)]),_:1},8,[`href`])):t(``,!0),Q.canManage?(r(),o(m,{key:1,size:`sm`,variant:n.enabled?`secondary`:`success`,"data-action":n.enabled?`disable`:`enable`,onClick:e=>ie(n)},{default:c(()=>[s(u(n.enabled?l.$t(`modules.disable`):l.$t(`modules.enable`)),1)]),_:2},1032,[`variant`,`data-action`,`onClick`])):t(``,!0)])],8,T))),128))])]))]),Q.canManage&&Q.required.length?(r(),f(`section`,j,[p(`h2`,M,u(l.$t(`modules.required_title`)),1),p(`p`,N,u(l.$t(`modules.required_hint`)),1),p(`ul`,P,[(r(!0),f(d,null,a(Q.required,e=>(r(),f(`li`,{key:e.name,"data-required":e.name,class:`px-4 py-3`},[p(`div`,F,u(e.label),1),e.description?(r(),f(`div`,I,u(e.description),1)):t(``,!0),p(`code`,L,u($(e.name)),1)],8,ne))),128))])])):t(``,!0),Q.canManage?(r(),f(`section`,R,[p(`h2`,z,u(l.$t(`modules.catalogue_title`)),1),p(`p`,B,u(l.$t(`modules.catalogue_hint`)),1),n(i(ee),{data:`catalogue`},{fallback:c(()=>[p(`p`,V,u(l.$t(`modules.catalogue_loading`)),1)]),default:c(()=>[Q.catalogue.packages===null?(r(),f(`p`,H,u(l.$t(`modules.catalogue_unavailable`)),1)):Q.catalogue.packages.length===0?(r(),f(`p`,U,u(l.$t(`modules.catalogue_empty`)),1)):(r(),f(`ul`,W,[(r(!0),f(d,null,a(Q.catalogue.packages,e=>(r(),f(`li`,{key:e.name,"data-package":e.name,"data-status":e.status,class:`px-4 py-3`},[p(`div`,K,[p(`a`,{href:e.url,target:`_blank`,rel:`noopener`,class:`font-mono text-sm font-medium text-fg hover:underline`},u(e.name),9,q),e.status===`available`?t(``,!0):(r(),f(`span`,J,u(l.$t(`modules.status_${e.status}`)),1)),p(`span`,Y,u(l.$t(`modules.downloads`,{count:e.downloads})),1)]),e.description?(r(),f(`div`,X,u(e.description),1)):t(``,!0),e.status===`available`||e.status===`required`?(r(),f(d,{key:1},[e.status===`available`?(r(),f(`code`,Z,`composer require `+u(e.name),1)):t(``,!0),p(`code`,re,u($(e.name)),1)],64)):t(``,!0)],8,G))),128))]))]),_:1})])):t(``,!0)]),_:1},8,[`title`]))}};export{Q as default};
\ No newline at end of file
+import{$ as e,C as t,E as n,I as r,Q as i,R as a,S as o,T as s,W as c,n as ee,s as l,tt as u,v as d,w as f,x as p}from"./dist-Bie52OmN.js";import{t as te}from"./AdminLayout-D_QE0gy-.js";import{t as m}from"./AdminButton-KiIJ2sLW.js";var h={class:`mb-6`},g={"data-page-title":`admin.modules`,class:`text-2xl font-bold text-fg`},_={class:`mt-1 text-sm text-muted`},v={class:`bg-surface rounded-lg shadow overflow-hidden`},y={key:0,class:`p-6 text-sm text-muted`},b={key:1,class:`min-w-full text-sm`},x={class:`bg-surface-alt`},S={class:`px-4 py-2 text-left font-medium text-fg`},C={class:`px-4 py-2 text-left font-medium text-fg`},w={class:`divide-y divide-line`},T=[`data-module`,`data-parent`,`data-enabled`],E={key:0,"aria-hidden":`true`,class:`mr-1 text-muted`},D={key:1,class:`ml-2 rounded bg-surface-alt px-1.5 py-0.5 text-xs font-normal text-muted`},O={key:0,class:`text-muted`},k={class:`px-4 py-2 font-mono text-xs text-muted`},A={class:`px-4 py-2 text-right whitespace-nowrap space-x-2`},j={key:0,"data-section":`required`,class:`mt-8`},M={class:`text-lg font-semibold text-fg`},N={class:`mt-1 text-sm text-muted`},P={class:`mt-3 bg-surface rounded-lg shadow divide-y divide-line text-sm`},ne=[`data-required`],F={class:`font-medium text-fg`},I={key:0,class:`text-muted`},L={class:`mt-1 block font-mono text-xs text-fg select-all`},R={key:1,"data-section":`catalogue`,class:`mt-8`},z={class:`text-lg font-semibold text-fg`},B={class:`mt-1 text-sm text-muted`},V={class:`mt-3 text-sm text-muted`},H={key:0,"data-catalogue":`unavailable`,class:`mt-3 text-sm text-muted`},U={key:1,class:`mt-3 text-sm text-muted`},W={key:2,class:`mt-3 bg-surface rounded-lg shadow divide-y divide-line text-sm`},G=[`data-package`,`data-status`],K={class:`flex flex-wrap items-baseline gap-x-3`},q=[`href`],J={key:0,class:`rounded bg-surface-alt px-1.5 py-0.5 text-xs text-muted`},Y={class:`text-xs text-muted`},X={key:0,class:`text-muted`},Z={key:0,class:`mt-1 block font-mono text-xs text-fg select-all`},re={class:`mt-1 block font-mono text-xs text-fg select-all`},Q={__name:`Index`,props:{modules:Array,required:Array,canManage:Boolean,catalogue:Object,title:String},setup(Q){let ie=e=>{l.post(route(e.enabled?`admin.modules.disable`:`admin.modules.enable`,e.key),{},{preserveScroll:!0})},$=e=>`php artisan atrium:module:install ${e}`;return(l,ae)=>(r(),o(te,{title:Q.title},{default:c(()=>[p(`div`,h,[p(`h1`,g,u(Q.title),1),p(`p`,_,u(l.$t(`modules.index_hint`)),1)]),p(`div`,v,[Q.modules.length===0?(r(),f(`p`,y,u(l.$t(`modules.empty`)),1)):(r(),f(`table`,b,[p(`thead`,x,[p(`tr`,null,[p(`th`,S,u(l.$t(`modules.module`)),1),p(`th`,C,u(l.$t(`modules.package`)),1),ae[0]||=p(`th`,{class:`px-4 py-2`},null,-1)])]),p(`tbody`,w,[(r(!0),f(d,null,a(Q.modules,n=>(r(),f(`tr`,{key:n.name,"data-module":n.name,"data-parent":n.parent,"data-enabled":n.enabled?`true`:`false`},[p(`td`,{class:e([`py-2 pr-4`,n.parent?`pl-10`:`pl-4`])},[p(`div`,{class:e([`font-medium`,n.enabled?`text-fg`:`text-muted`])},[n.parent?(r(),f(`span`,E,`↳`)):t(``,!0),s(u(n.label)+` `,1),n.enabled?t(``,!0):(r(),f(`span`,D,u(l.$t(`modules.status_disabled`)),1))],2),n.description?(r(),f(`div`,O,u(n.description),1)):t(``,!0)],2),p(`td`,k,u(n.name),1),p(`td`,A,[n.settings?(r(),o(m,{key:0,size:`sm`,variant:`outline`,"data-action":`settings`,href:l.route(`admin.modules.settings`,n.key)},{default:c(()=>[s(u(l.$t(`modules.settings`)),1)]),_:1},8,[`href`])):t(``,!0),Q.canManage?(r(),o(m,{key:1,size:`sm`,variant:n.enabled?`secondary`:`success`,"data-action":n.enabled?`disable`:`enable`,onClick:e=>ie(n)},{default:c(()=>[s(u(n.enabled?l.$t(`modules.disable`):l.$t(`modules.enable`)),1)]),_:2},1032,[`variant`,`data-action`,`onClick`])):t(``,!0)])],8,T))),128))])]))]),Q.canManage&&Q.required.length?(r(),f(`section`,j,[p(`h2`,M,u(l.$t(`modules.required_title`)),1),p(`p`,N,u(l.$t(`modules.required_hint`)),1),p(`ul`,P,[(r(!0),f(d,null,a(Q.required,e=>(r(),f(`li`,{key:e.name,"data-required":e.name,class:`px-4 py-3`},[p(`div`,F,u(e.label),1),e.description?(r(),f(`div`,I,u(e.description),1)):t(``,!0),p(`code`,L,u($(e.name)),1)],8,ne))),128))])])):t(``,!0),Q.canManage?(r(),f(`section`,R,[p(`h2`,z,u(l.$t(`modules.catalogue_title`)),1),p(`p`,B,u(l.$t(`modules.catalogue_hint`)),1),n(i(ee),{data:`catalogue`},{fallback:c(()=>[p(`p`,V,u(l.$t(`modules.catalogue_loading`)),1)]),default:c(()=>[Q.catalogue.packages===null?(r(),f(`p`,H,u(l.$t(`modules.catalogue_unavailable`)),1)):Q.catalogue.packages.length===0?(r(),f(`p`,U,u(l.$t(`modules.catalogue_empty`)),1)):(r(),f(`ul`,W,[(r(!0),f(d,null,a(Q.catalogue.packages,e=>(r(),f(`li`,{key:e.name,"data-package":e.name,"data-status":e.status,class:`px-4 py-3`},[p(`div`,K,[p(`a`,{href:e.url,target:`_blank`,rel:`noopener`,class:`font-mono text-sm font-medium text-fg hover:underline`},u(e.name),9,q),e.status===`available`?t(``,!0):(r(),f(`span`,J,u(l.$t(`modules.status_${e.status}`)),1)),p(`span`,Y,u(l.$t(`modules.downloads`,{count:e.downloads})),1)]),e.description?(r(),f(`div`,X,u(e.description),1)):t(``,!0),e.status===`available`||e.status===`required`?(r(),f(d,{key:1},[e.status===`available`?(r(),f(`code`,Z,`composer require `+u(e.name),1)):t(``,!0),p(`code`,re,u($(e.name)),1)],64)):t(``,!0)],8,G))),128))]))]),_:1})])):t(``,!0)]),_:1},8,[`title`]))}};export{Q as default};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/Index-BYxAQoR9.js b/packages/admin/dist/assets/Index-BYxAQoR9.js
new file mode 100644
index 00000000..7aa6bd0f
--- /dev/null
+++ b/packages/admin/dist/assets/Index-BYxAQoR9.js
@@ -0,0 +1 @@
+import{C as e,E as t,I as n,R as r,S as i,T as a,W as o,_ as ee,o as s,s as c,tt as l,v as u,w as d,x as f}from"./dist-Bie52OmN.js";import{t as te}from"./AdminLayout-D_QE0gy-.js";import{t as p}from"./AdminCard-YbEwPtJz.js";import{t as m}from"./MonitoringChart-DLuy45XH.js";import{n as ne,t as re}from"./labels-DbKc85RH.js";var ie={class:`mb-6`},ae={class:`text-2xl font-bold text-fg`},oe={class:`mt-1 text-sm text-muted`},se={class:`text-sm text-fg`},ce={class:`block mb-1 font-medium`},le=[`value`],h=[`value`],g={key:0,class:`text-sm text-fg`},_={class:`block mb-1 font-medium`},v=[`value`],y={value:``},b=[`value`],x={key:1,class:`text-sm text-fg`},S={class:`block mb-1 font-medium`},C=[`value`],w=[`value`],T={class:`text-sm text-fg`},E={class:`block mb-1 font-medium`},D=[`value`],O=[`value`],k={key:2,class:`text-sm text-fg`},A={key:0,dusk:`filter-route`},j={class:`font-mono`},M={key:1,dusk:`filter-page`,class:`ml-3`},N={class:`font-mono`},P={class:`ml-auto text-sm text-muted tabular-nums`},F={class:`space-y-8`},I={dusk:`monitoring-server`,"aria-labelledby":`monitoring-server`},L={id:`monitoring-server`,class:`mb-3 text-lg font-semibold text-fg`},R={class:`mb-4 grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-6`},z={class:`bg-surface rounded-lg shadow px-4 py-3`},B={class:`text-xs text-muted`},V={class:`mt-1 text-xl font-semibold text-fg tabular-nums`,dusk:`summary-requests`},H={class:`bg-surface rounded-lg shadow px-4 py-3`},U={class:`text-xs text-muted`},W={class:`mt-1 text-xl font-semibold text-fg tabular-nums`},ue={class:`text-xs text-muted tabular-nums`},de={class:`bg-surface rounded-lg shadow px-4 py-3`},fe={class:`text-xs text-muted`},pe={class:`mt-1 text-xl font-semibold text-fg tabular-nums`},me={class:`bg-surface rounded-lg shadow px-4 py-3`},he={class:`text-xs text-muted`},ge={class:`mt-1 text-xl font-semibold text-fg tabular-nums`},_e={class:`bg-surface rounded-lg shadow px-4 py-3`},ve={class:`text-xs text-muted`},ye={class:`mt-1 text-xl font-semibold text-fg tabular-nums`},be={class:`bg-surface rounded-lg shadow px-4 py-3`},xe={class:`text-xs text-muted`},Se={class:`mt-1 text-xl font-semibold text-fg tabular-nums`},Ce={class:`grid gap-6 xl:grid-cols-2`},we={class:`mt-6 grid gap-6 xl:grid-cols-2`},Te={key:0,class:`p-4 text-sm text-muted`},Ee={key:1,class:`overflow-x-auto`},De={dusk:`slow-routes`,class:`min-w-full text-sm`},Oe={class:`bg-surface-alt`},ke={class:`px-3 py-2 text-left font-medium text-fg`},Ae={class:`px-3 py-2 text-right font-medium text-fg`},je={class:`divide-y divide-line`},Me={class:`px-3 py-2`},Ne=[`onClick`],Pe={key:0,class:`block text-xs text-muted font-mono break-all`},Fe={class:`px-3 py-2 text-right text-fg tabular-nums`},Ie={class:`px-3 py-2 text-right text-fg tabular-nums whitespace-nowrap`},Le={class:`px-3 py-2 text-right text-fg tabular-nums whitespace-nowrap font-semibold`},Re={class:`px-3 py-2 text-right text-fg tabular-nums whitespace-nowrap`},ze={key:0,class:`p-4 text-sm text-muted`},Be={key:1,class:`overflow-x-auto`},Ve={dusk:`slow-queries`,class:`min-w-full text-sm`},He={class:`bg-surface-alt`},Ue={class:`px-3 py-2 text-left font-medium text-fg`},We={class:`px-3 py-2 text-right font-medium text-fg`},Ge={class:`divide-y divide-line`},Ke={class:`px-3 py-2`},qe=[`href`],Je={class:`px-3 py-2 text-right text-fg tabular-nums`},Ye={class:`px-3 py-2 text-right text-fg tabular-nums whitespace-nowrap font-semibold`},Xe={class:`px-3 py-2 text-right text-fg tabular-nums whitespace-nowrap`},Ze={dusk:`monitoring-vitals`,"aria-labelledby":`monitoring-vitals`},Qe={id:`monitoring-vitals`,class:`mb-3 text-lg font-semibold text-fg`},$e={class:`mb-4 grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-5`},et=[`data-vital`],tt={class:`text-xs text-muted`},nt={class:`mt-1 text-xl font-semibold text-fg tabular-nums`},rt={class:`text-sm font-medium text-fg`,"data-rating":``},it={class:`mt-1 text-xs text-muted`},at={class:`text-xs text-muted tabular-nums`},ot={class:`grid gap-6 xl:grid-cols-2`},st={class:`overflow-x-auto`},ct={dusk:`slow-pages`,class:`min-w-full text-sm`},lt={class:`bg-surface-alt`},ut={class:`px-3 py-2 text-left font-medium text-fg`},dt={class:`px-3 py-2 text-left font-medium text-fg`},ft={class:`px-3 py-2 text-right font-medium text-fg`},pt={class:`divide-y divide-line`},mt={class:`px-3 py-2`},ht=[`onClick`],gt=[`href`],_t={class:`px-3 py-2 text-fg`},vt={class:`px-3 py-2 text-right text-fg tabular-nums`},yt={class:`px-3 py-2 text-right text-fg tabular-nums whitespace-nowrap font-semibold`},bt={class:`px-3 py-2 text-right text-fg tabular-nums whitespace-nowrap`},xt={dusk:`monitoring-uptime`,"aria-labelledby":`monitoring-uptime`},St={id:`monitoring-uptime`,class:`mb-3 text-lg font-semibold text-fg`},Ct={class:`grid gap-6 xl:grid-cols-2`},wt={key:0,class:`p-4 text-sm text-muted`},Tt={key:1,class:`overflow-x-auto`},Et={dusk:`uptime-checks`,class:`min-w-full text-sm`},Dt={class:`bg-surface-alt`},Ot={class:`px-3 py-2 text-left font-medium text-fg`},kt={class:`px-3 py-2 text-left font-medium text-fg`},At={class:`px-3 py-2 text-right font-medium text-fg`},jt={class:`px-3 py-2 text-right font-medium text-fg`},Mt={class:`divide-y divide-line`},Nt=[`data-status`],Pt={class:`px-3 py-2`},Ft={class:`font-medium text-fg`},It={class:`block text-xs text-muted font-mono break-all`},Lt={key:0,class:`block text-xs text-fg`},Rt={class:`px-3 py-2 text-fg whitespace-nowrap`},zt={"aria-hidden":`true`},Bt={key:0,class:`block text-xs text-muted tabular-nums`},Vt={class:`px-3 py-2 text-right text-fg tabular-nums`},Ht={class:`px-3 py-2 text-right text-fg tabular-nums whitespace-nowrap`},Ut={key:0,class:`p-4 text-sm text-muted`},Wt={key:1,class:`overflow-x-auto`},Gt={dusk:`incidents`,class:`min-w-full text-sm`},Kt={class:`bg-surface-alt`},qt={class:`px-3 py-2 text-left font-medium text-fg`},Jt={class:`px-3 py-2 text-left font-medium text-fg`},G={class:`px-3 py-2 text-left font-medium text-fg`},Yt={class:`divide-y divide-line`},Xt={class:`px-3 py-2 text-fg`},Zt={key:0,class:`block text-xs text-muted`},Qt={class:`px-3 py-2 text-fg tabular-nums whitespace-nowrap`},$t={class:`px-3 py-2 text-fg whitespace-nowrap`},en={key:0,class:`font-semibold`},K=`*`,q={__name:`Index`,props:{t:{type:Object,required:!0},filters:{type:Object,required:!0},options:{type:Object,required:!0},range:{type:Object,required:!0},server:{type:Object,required:!0},vitals:{type:Object,required:!0},uptime:{type:Object,required:!0}},setup(q){let J=q,Y=(e,t={})=>re(J.t,e,t);function X(e){let t={...J.filters,...e},n={};for(let[e,r]of Object.entries(t))r!==null&&r!==``&&r!==K&&(e!==`period`||r!==`day`)&&(n[e]=r);c.get(route(`admin.monitoring.index`),n,{preserveScroll:!0,preserveState:!0})}let tn=s(),Z=e=>ne(e,tn.props.locale),Q=e=>e===null?`—`:`${Z(e)}%`,$=e=>e?Y(`ratings.${e}`):`—`;return(s,c)=>(n(),i(te,{title:Y(`title`)},{default:o(()=>[f(`div`,ie,[f(`h1`,ae,l(Y(`title`)),1),f(`p`,oe,l(Y(`privacy`)),1)]),f(`form`,{dusk:`monitoring-filters`,class:`mb-6 flex flex-wrap items-end gap-4`,onSubmit:c[5]||=ee(()=>{},[`prevent`])},[f(`label`,se,[f(`span`,ce,l(Y(`filters.period`)),1),f(`select`,{dusk:`filter-period`,class:`rounded border border-line bg-surface px-2 py-1.5`,value:q.filters.period,onChange:c[0]||=e=>X({period:e.target.value})},[(n(),d(u,null,r([`day`,`week`,`month`],e=>f(`option`,{key:e,value:e},l(Y(`periods.${e}`)),9,h)),64))],40,le)]),q.options.sites.length>1?(n(),d(`label`,g,[f(`span`,_,l(Y(`filters.site`)),1),f(`select`,{dusk:`filter-site`,class:`rounded border border-line bg-surface px-2 py-1.5`,value:q.filters.site??``,onChange:c[1]||=e=>X({site:e.target.value})},[f(`option`,y,l(Y(`filters.all`)),1),(n(!0),d(u,null,r(q.options.sites,e=>(n(),d(`option`,{key:e.value,value:e.value},l(e.label),9,b))),128))],40,v)])):e(``,!0),q.options.locales.length>1?(n(),d(`label`,x,[f(`span`,S,l(Y(`filters.locale`)),1),f(`select`,{dusk:`filter-locale`,class:`rounded border border-line bg-surface px-2 py-1.5`,value:q.filters.locale,onChange:c[2]||=e=>X({locale:e.target.value})},[f(`option`,{value:K},l(Y(`filters.all`)),1),(n(!0),d(u,null,r(q.options.locales,e=>(n(),d(`option`,{key:e,value:e},l(e),9,w))),128))],40,C)])):e(``,!0),f(`label`,T,[f(`span`,E,l(Y(`filters.device`)),1),f(`select`,{dusk:`filter-device`,class:`rounded border border-line bg-surface px-2 py-1.5`,value:q.filters.device,onChange:c[3]||=e=>X({device:e.target.value})},[f(`option`,{value:K},l(Y(`filters.all`)),1),(n(),d(u,null,r([`mobile`,`tablet`,`desktop`],e=>f(`option`,{key:e,value:e},l(Y(`devices.${e}`)),9,O)),64))],40,D)]),q.filters.route!==K||q.filters.page!==K?(n(),d(`p`,k,[q.filters.route===K?e(``,!0):(n(),d(`span`,A,[a(l(Y(`filters.route`))+`: `,1),f(`code`,j,l(q.filters.route),1)])),q.filters.page===K?e(``,!0):(n(),d(`span`,M,[a(l(Y(`filters.page`))+`: `,1),f(`code`,N,l(q.filters.page),1)])),f(`button`,{type:`button`,dusk:`filter-clear`,class:`ml-3 text-accent underline`,onClick:c[4]||=e=>X({route:K,page:K})},l(Y(`filters.clear`)),1)])):e(``,!0),f(`p`,P,l(q.range.from)+` — `+l(q.range.to),1)],32),f(`div`,F,[f(`section`,I,[f(`h2`,L,l(Y(`sections.server`)),1),f(`dl`,R,[f(`div`,z,[f(`dt`,B,l(Y(`summary.requests`)),1),f(`dd`,V,l(q.server.summary.requests),1)]),f(`div`,H,[f(`dt`,U,l(Y(`summary.ttfb`))+`, p75`,1),f(`dd`,W,l(q.server.summary.ttfb.p75),1),f(`dd`,ue,`p50 `+l(q.server.summary.ttfb.p50)+` · p95 `+l(q.server.summary.ttfb.p95),1)]),f(`div`,de,[f(`dt`,fe,l(Y(`summary.errors`)),1),f(`dd`,pe,l(Q(q.server.summary.errors)),1)]),f(`div`,me,[f(`dt`,he,l(Y(`summary.cache_ratio`)),1),f(`dd`,ge,l(Q(q.server.summary.cache_ratio)),1)]),f(`div`,_e,[f(`dt`,ve,l(Y(`summary.queries`)),1),f(`dd`,ye,l(q.server.summary.queries===null?`—`:Z(q.server.summary.queries)),1)]),f(`div`,be,[f(`dt`,xe,l(Y(`summary.memory_p95`)),1),f(`dd`,Se,l(q.server.summary.memory_p95===null?`—`:`${Z(q.server.summary.memory_p95)} ${Y(`summary.mb`)}`),1)])]),f(`div`,Ce,[(n(!0),d(u,null,r(q.server.charts,e=>(n(),i(m,{key:e.key,title:Y(`charts.${e.key}`),svg:e.svg,points:e.points,t:q.t,dusk:`chart-${e.key}`},null,8,[`title`,`svg`,`points`,`t`,`dusk`]))),128))]),f(`div`,we,[t(p,{"no-padding":``,title:Y(`sections.routes`)},{default:o(()=>[q.server.routes.length?(n(),d(`div`,Ee,[f(`table`,De,[f(`thead`,Oe,[f(`tr`,null,[f(`th`,ke,l(Y(`columns.route`)),1),f(`th`,Ae,l(Y(`columns.count`)),1),c[6]||=f(`th`,{class:`px-3 py-2 text-right font-medium text-fg`},`p50`,-1),c[7]||=f(`th`,{class:`px-3 py-2 text-right font-medium text-fg`},`p75`,-1),c[8]||=f(`th`,{class:`px-3 py-2 text-right font-medium text-fg`},`p95`,-1)])]),f(`tbody`,je,[(n(!0),d(u,null,r(q.server.routes,t=>(n(),d(`tr`,{key:t.route},[f(`td`,Me,[f(`button`,{type:`button`,dusk:`route-filter`,class:`font-mono text-accent underline text-left`,onClick:e=>X({route:t.route})},l(t.route),9,Ne),t.sample?(n(),d(`span`,Pe,l(t.sample),1)):e(``,!0)]),f(`td`,Fe,l(t.count),1),f(`td`,Ie,l(t.p50),1),f(`td`,Le,l(t.p75),1),f(`td`,Re,l(t.p95),1)]))),128))])])])):(n(),d(`p`,Te,l(Y(`no_data`)),1))]),_:1},8,[`title`]),t(p,{"no-padding":``,title:Y(`sections.queries`)},{default:o(()=>[q.server.queries.length?(n(),d(`div`,Be,[f(`table`,Ve,[f(`thead`,He,[f(`tr`,null,[f(`th`,Ue,l(Y(`columns.query`)),1),f(`th`,We,l(Y(`columns.count`)),1),c[9]||=f(`th`,{class:`px-3 py-2 text-right font-medium text-fg`},`p75`,-1),c[10]||=f(`th`,{class:`px-3 py-2 text-right font-medium text-fg`},`p95`,-1)])]),f(`tbody`,Ge,[(n(!0),d(u,null,r(q.server.queries,e=>(n(),d(`tr`,{key:e.hash},[f(`td`,Ke,[f(`a`,{href:s.route(`admin.monitoring.query`,e.hash),dusk:`query-link`,class:`font-mono text-xs text-accent underline break-all`},l(e.sql),9,qe)]),f(`td`,Je,l(e.count),1),f(`td`,Ye,l(e.p75),1),f(`td`,Xe,l(e.p95),1)]))),128))])])])):(n(),d(`p`,ze,l(Y(`no_data`)),1))]),_:1},8,[`title`])])]),f(`section`,Ze,[f(`h2`,Qe,l(Y(`sections.vitals`)),1),f(`dl`,$e,[(n(!0),d(u,null,r(q.vitals.metrics,e=>(n(),d(`div`,{key:e.key,class:`bg-surface rounded-lg shadow px-4 py-3`,"data-vital":e.key},[f(`dt`,tt,l(Y(`vitals.${e.key}`))+` (`+l(e.key.toUpperCase())+`), p75`,1),f(`dd`,nt,l(e.p75),1),f(`dd`,rt,l($(e.rating)),1),f(`dd`,it,l(Y(`vitals.thresholds`,{good:e.thresholds[0],poor:e.thresholds[1]})),1),f(`dd`,at,l(Y(`columns.count`))+`: `+l(e.count),1)],8,et))),128))]),f(`div`,ot,[(n(!0),d(u,null,r(q.vitals.metrics,e=>(n(),i(m,{key:e.key,title:Y(`vitals.${e.key}`),svg:e.svg,points:e.points,t:q.t,dusk:`chart-${e.key}`},null,8,[`title`,`svg`,`points`,`t`,`dusk`]))),128))]),q.vitals.pages.length?(n(),i(p,{key:0,"no-padding":``,title:Y(`sections.pages`),class:`mt-6`},{default:o(()=>[f(`div`,st,[f(`table`,ct,[f(`thead`,lt,[f(`tr`,null,[f(`th`,ut,l(Y(`columns.page`)),1),f(`th`,dt,l(Y(`columns.rating`)),1),f(`th`,ft,l(Y(`columns.count`)),1),c[11]||=f(`th`,{class:`px-3 py-2 text-right font-medium text-fg`},`p75`,-1),c[12]||=f(`th`,{class:`px-3 py-2 text-right font-medium text-fg`},`p95`,-1)])]),f(`tbody`,pt,[(n(!0),d(u,null,r(q.vitals.pages,t=>(n(),d(`tr`,{key:t.page},[f(`td`,mt,[f(`button`,{type:`button`,dusk:`page-filter`,class:`font-mono text-accent underline text-left break-all`,onClick:e=>X({page:t.page})},l(t.page),9,ht),t.errors_url?(n(),d(`a`,{key:0,href:t.errors_url,class:`block text-xs text-accent underline`,dusk:`page-errors`},l(Y(`links.errors`)),9,gt)):e(``,!0)]),f(`td`,_t,l($(t.rating)),1),f(`td`,vt,l(t.count),1),f(`td`,yt,l(t.p75),1),f(`td`,bt,l(t.p95),1)]))),128))])])])]),_:1},8,[`title`])):e(``,!0)]),f(`section`,xt,[f(`h2`,St,l(Y(`sections.uptime`)),1),f(`div`,Ct,[t(p,{"no-padding":``,title:Y(`modules.checks`)},{default:o(()=>[q.uptime.checks.length?(n(),d(`div`,Tt,[f(`table`,Et,[f(`thead`,Dt,[f(`tr`,null,[f(`th`,Ot,l(Y(`columns.check`)),1),f(`th`,kt,l(Y(`columns.status`)),1),f(`th`,At,l(Y(`columns.uptime`)),1),f(`th`,jt,l(Y(`columns.response`)),1)])]),f(`tbody`,Mt,[(n(!0),d(u,null,r(q.uptime.checks,t=>(n(),d(`tr`,{key:t.id,"data-status":t.status},[f(`td`,Pt,[f(`span`,Ft,l(t.name),1),f(`span`,It,l(t.url),1),t.error&&t.status!==`up`?(n(),d(`span`,Lt,l(t.error),1)):e(``,!0)]),f(`td`,Rt,[f(`span`,zt,l({up:`●`,failing:`◐`,down:`○`,unknown:`·`}[t.status]),1),a(` `+l(Y(`status.${t.status}`))+` `,1),t.checked_at?(n(),d(`span`,Bt,l(t.checked_at),1)):e(``,!0)]),f(`td`,Vt,l(Q(t.uptime)),1),f(`td`,Ht,l(t.response??`—`),1)],8,Nt))),128))])])])):(n(),d(`p`,wt,l(Y(`no_data`)),1))]),_:1},8,[`title`]),t(p,{"no-padding":``,title:Y(`sections.incidents`)},{default:o(()=>[q.uptime.incidents.length?(n(),d(`div`,Wt,[f(`table`,Gt,[f(`thead`,Kt,[f(`tr`,null,[f(`th`,qt,l(Y(`columns.check`)),1),f(`th`,Jt,l(Y(`fields.started_at`)),1),f(`th`,G,l(Y(`fields.duration`)),1)])]),f(`tbody`,Yt,[(n(!0),d(u,null,r(q.uptime.incidents,t=>(n(),d(`tr`,{key:t.id},[f(`td`,Xt,[a(l(t.check)+` `,1),t.error?(n(),d(`span`,Zt,l(t.error),1)):e(``,!0)]),f(`td`,Qt,l(t.started_at),1),f(`td`,$t,[a(l(t.duration)+` `,1),t.resolved_at?e(``,!0):(n(),d(`span`,en,`(`+l(Y(`ongoing`))+`)`,1))])]))),128))])])])):(n(),d(`p`,Ut,l(Y(`no_data`)),1))]),_:1},8,[`title`])])])])]),_:1},8,[`title`]))}};export{q as default};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/Index-CG3NSbtt.js b/packages/admin/dist/assets/Index-BjHeDb5k.js
similarity index 99%
rename from packages/admin/dist/assets/Index-CG3NSbtt.js
rename to packages/admin/dist/assets/Index-BjHeDb5k.js
index e2c7b270..842593ed 100644
--- a/packages/admin/dist/assets/Index-CG3NSbtt.js
+++ b/packages/admin/dist/assets/Index-BjHeDb5k.js
@@ -1 +1 @@
-import{$ as e,C as t,E as n,G as r,H as i,I as a,N as o,R as s,S as ee,T as c,W as l,X as u,b as d,m as f,o as te,s as p,tt as m,u as h,v as g,w as _,x as v}from"./dist-Bie52OmN.js";import{n as y,r as ne,t as re}from"./AdminLayout-DBeSErmz.js";import{t as b}from"./AdminButton-KiIJ2sLW.js";import{t as x}from"./AdminCard-YbEwPtJz.js";import{t as S}from"./AdminModal-DKazeNNa.js";var ie={class:`mb-6 flex flex-wrap items-start justify-between gap-4`},ae={class:`text-2xl font-bold text-fg`},oe={class:`mt-1 text-sm text-muted`},se={class:`flex flex-wrap gap-2`},ce={key:0,dusk:`backup-running`,role:`status`,class:`mb-6 flex items-center gap-3 p-4 bg-accent-soft text-accent-soft-fg border border-line rounded-lg text-sm`},le={class:`space-y-6`},ue={key:0,class:`p-6 text-sm text-muted`},de={key:1,class:`overflow-x-auto`},fe={dusk:`backups`,class:`min-w-full text-sm`},pe={class:`bg-surface-alt`},me={class:`px-4 py-2 text-left font-medium text-fg`},he={class:`px-4 py-2 text-left font-medium text-fg`},ge={class:`px-4 py-2 text-left font-medium text-fg`},_e={class:`px-4 py-2 text-right font-medium text-fg`},ve={class:`divide-y divide-line`},ye=[`data-backup`],be={class:`px-4 py-2 font-mono text-fg`},xe={class:`px-4 py-2 text-fg`},C={class:`px-4 py-2 text-fg`},w={class:`px-4 py-2 text-right text-fg whitespace-nowrap`},T={class:`px-4 py-2 text-right whitespace-nowrap space-x-2`},E=[`href`],D=[`disabled`,`onClick`],O=[`onClick`],k={class:`grid gap-6 lg:grid-cols-2`},A={class:`space-y-4`},j=[`data-destination`,`dusk`],M={class:`flex flex-wrap items-center gap-2`},Se={class:`font-medium text-fg`},Ce={key:0,class:`mt-1 text-sm text-fg`},we={key:1,class:`mt-1 list-disc pl-5 text-sm text-danger`},Te={class:`grid grid-cols-1 sm:grid-cols-3 gap-x-4 gap-y-3 text-sm`},Ee={class:`font-medium text-fg`},De={class:`sm:col-span-2 text-fg`},Oe={class:`font-medium text-fg`},ke={class:`sm:col-span-2 text-fg break-all`},Ae={class:`font-medium text-fg`},je={class:`sm:col-span-2 text-fg`},Me={class:`font-medium text-fg`},Ne={class:`sm:col-span-2 text-fg`},Pe={key:0},Fe={class:`font-medium text-fg`},Ie={class:`sm:col-span-2 text-fg`},Le={class:`font-medium text-fg`},Re={class:`sm:col-span-2 text-fg`},ze={key:0,class:`p-6 text-sm text-muted`},Be={key:1,class:`overflow-x-auto`},Ve={dusk:`backup-log`,class:`min-w-full text-sm`},He={class:`bg-surface-alt`},Ue={class:`px-4 py-2 text-left font-medium text-fg`},We={class:`px-4 py-2 text-left font-medium text-fg`},Ge={class:`px-4 py-2 text-left font-medium text-fg`},Ke={class:`px-4 py-2 text-left font-medium text-fg`},qe={class:`divide-y divide-line`},Je={class:`px-4 py-2 text-fg whitespace-nowrap`},Ye={class:`px-4 py-2 text-fg`},Xe={class:`px-4 py-2`},Ze={class:`px-4 py-2 text-fg break-words`},Qe={class:`p-6`},$e={class:`text-fg`},et={class:`mt-6 flex justify-end gap-2`},tt={key:0,dusk:`restore-dialog`,class:`p-6 space-y-5 text-sm`},nt={class:`text-fg`},rt={class:`flex flex-wrap items-end gap-3`},it={class:`flex-1 min-w-48`},N={for:`backup-password`,class:`block font-medium text-fg`},at={class:`mt-1 text-xs text-muted`},ot={key:0,"data-error":``,class:`text-danger`,role:`alert`},st={key:0,class:`text-fg`},ct={key:1,class:`overflow-x-auto border border-line rounded-md`},lt={dusk:`plan-databases`,class:`min-w-full`},ut={class:`bg-surface-alt`},dt={class:`px-3 py-2 text-left font-medium text-fg`},ft={class:`px-3 py-2 text-left font-medium text-fg`},pt={class:`px-3 py-2 text-right font-medium text-fg`},mt={class:`px-3 py-2 text-left font-medium text-fg`},ht={class:`divide-y divide-line`},gt={class:`px-3 py-1.5 text-fg`},_t={class:`px-3 py-1.5 text-fg`},vt={class:`px-3 py-1.5 text-right text-fg`},yt={class:`px-3 py-1.5 text-fg break-all`},bt={key:2,class:`overflow-x-auto border border-line rounded-md`},xt={dusk:`plan-folders`,class:`min-w-full`},St={class:`bg-surface-alt`},Ct={class:`px-3 py-2 text-left font-medium text-fg`},wt={class:`px-3 py-2 text-right font-medium text-fg`},Tt={class:`px-3 py-2 text-right font-medium text-fg`},Et={class:`px-3 py-2 text-right font-medium text-fg`},Dt={class:`px-3 py-2 text-right font-medium text-fg`},Ot={class:`px-3 py-2 text-right font-medium text-fg`},kt={class:`divide-y divide-line`},At={class:`px-3 py-1.5 text-fg break-all`},jt={class:`px-3 py-1.5 text-right text-fg`},Mt={class:`px-3 py-1.5 text-right text-fg`},Nt={class:`px-3 py-1.5 text-right text-fg`},Pt={class:`px-3 py-1.5 text-right text-fg`},Ft={class:`px-3 py-1.5 text-right text-fg`},It={key:3,class:`list-disc pl-5 bg-warning-soft text-warning-soft-fg border border-line rounded-md p-3 space-y-1`},Lt={class:`space-y-2`},Rt={class:`flex items-center gap-2 text-fg`},zt={class:`flex items-center gap-2 text-fg`},Bt={class:`flex items-center gap-2 text-fg ml-6`},Vt=[`disabled`],Ht={class:`flex items-center gap-2 text-fg`},Ut={class:`p-4 bg-surface text-fg border-2 border-danger rounded-lg`},Wt={class:`font-medium`},Gt={class:`mt-2 list-disc pl-5 space-y-1`},Kt={key:0},qt={key:1},Jt={key:2},Yt={for:`backup-confirm`,class:`block font-medium text-fg`},Xt={key:0,"data-error":``,class:`mt-1 text-danger`},Zt={class:`flex justify-end gap-2`},P={__name:`Index`,props:{backups:Array,running:Object,log:Array,health:Array,settings:Object,labels:Object},setup(P){let F=P,Qt=te(),I=d(()=>String(Qt.props.locale||`en`).replace(`_`,`-`));function L(e,t={}){let n=F.labels?.[e]??e;for(let[e,r]of Object.entries(t))n=n.replaceAll(`:${e}`,String(r??``));return n}function R(e){let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=Number(e)||0,r=0;for(;n>=1024&&r1)})} ${t[r]}`}function z(e){return e?new Date(e).toLocaleString(I.value,{dateStyle:`medium`,timeStyle:`short`}):``}let B=u({backups:F.backups,running:F.running,log:F.log}),V=null;i(()=>[F.backups,F.running,F.log],()=>{B.value={backups:F.backups,running:F.running,log:F.log}});async function H(){let e=await fetch(route(`admin.backups.status`),{headers:y()}).catch(()=>null);if(e?.ok){let t=await e.json(),n=B.value.running&&!t.running;B.value=t,n&&p.reload({only:[`health`,`backups`,`running`,`log`]})}}i(()=>B.value.running,e=>{clearInterval(V),V=e?setInterval(H,3e3):null},{immediate:!0}),o(()=>clearInterval(V));let U=u(!1);function W(e=null){U.value=!0,p.post(route(`admin.backups.store`),{only:e},{preserveScroll:!0,onSuccess:()=>H(),onFinish:()=>{U.value=!1}})}let G=u(null);function $t(){p.delete(route(`admin.backups.destroy`,G.value.id),{preserveScroll:!0,onFinish:()=>{G.value=null}})}let K=u(null),q=u(null),J=u(``),Y=u(!1),X=u({}),Z=u({}),Q=u(!1);function en(e){K.value=e,q.value=null,J.value=``,Z.value={},X.value={password:``,database:!0,files:!0,delete_extra:!1,safety_backup:!0,confirm:``}}async function tn(){Y.value=!0,J.value=``;try{let e=await fetch(route(`admin.backups.plan`,K.value.id),{method:`POST`,headers:y({"Content-Type":`application/json`}),body:JSON.stringify({password:X.value.password||null})});if(!e.ok){J.value=await ne(e,L(`preview_failed`)),q.value=null;return}q.value=(await e.json()).plan}catch{J.value=L(`preview_failed`)}finally{Y.value=!1}}let nn=d(()=>q.value&&(X.value.database||X.value.files)&&X.value.confirm.trim()===K.value?.file);function rn(){Q.value=!0,p.post(route(`admin.backups.restore`,K.value.id),{...X.value,confirm:X.value.confirm.trim(),password:X.value.password||null},{preserveScroll:!0,onSuccess:()=>{K.value=null,H()},onError:e=>{Z.value=e},onFinish:()=>{Q.value=!1}})}let an=d(()=>{let e=F.settings?.schedule||{};return e.frequency===`daily`?L(`schedule_daily`,{time:e.time}):e.frequency===`weekly`?L(`schedule_weekly`,{weekday:F.settings.weekday,time:e.time}):L(`schedule_off`)}),on=d(()=>{let e=F.settings?.retention||{};return L(`retention_text`,{all:e.keep_all_days,daily:e.daily,weekly:e.weekly,monthly:e.monthly,yearly:e.yearly})}),$={ok:`bg-success-soft text-success-soft-fg`,partial:`bg-warning-soft text-warning-soft-fg`,failed:`bg-danger-soft text-danger-soft-fg`};function sn(e){let t=[];return e.trigger&&t.push(L(`trigger_${e.trigger}`)),e.by&&t.push(e.by),e.file&&t.push(e.disk?`${e.file} (${e.disk})`:e.file),e.disks?.length&&t.push(L(`copied_to`,{disks:e.disks.join(`, `)})),e.failed?.length&&t.push(L(`not_copied_to`,{disks:e.failed.map(e=>e.disk??e).join(`, `)})),e.action===`restore`&&e.status===`ok`&&t.push(L(`restored`,{databases:(e.databases||[]).join(`, `)||`—`,files:e.files??0,deleted:e.deleted??0})),e.seconds!==void 0&&t.push(L(`seconds`,{seconds:e.seconds})),e.message&&t.push(e.message),t.join(` · `)}return(i,o)=>(a(),ee(re,{title:L(`menu`)},{default:l(()=>[v(`div`,ie,[v(`div`,null,[v(`h1`,ae,m(P.labels.menu),1),v(`p`,oe,m(L(`subtitle`)),1)]),v(`div`,se,[n(b,{dusk:`backup-now`,loading:U.value,disabled:!!B.value.running,onClick:o[0]||=e=>W()},{default:l(()=>[c(m(L(`back_up_now`)),1)]),_:1},8,[`loading`,`disabled`]),n(b,{variant:`secondary`,disabled:U.value||!!B.value.running,onClick:o[1]||=e=>W(`database`)},{default:l(()=>[c(m(L(`only_database`)),1)]),_:1},8,[`disabled`]),n(b,{variant:`secondary`,disabled:U.value||!!B.value.running,onClick:o[2]||=e=>W(`files`)},{default:l(()=>[c(m(L(`only_files`)),1)]),_:1},8,[`disabled`])])]),B.value.running?(a(),_(`div`,ce,[o[13]||=v(`svg`,{class:`animate-spin h-5 w-5`,fill:`none`,viewBox:`0 0 24 24`,"aria-hidden":`true`},[v(`circle`,{class:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,"stroke-width":`4`}),v(`path`,{class:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})],-1),c(` `+m(L(B.value.running.action===`restore`?`running_restore`:`running_backup`,{time:z(B.value.running.started_at)})),1)])):t(``,!0),v(`div`,le,[n(x,{title:L(`archives`),"no-padding":``},{default:l(()=>[B.value.backups.length?(a(),_(`div`,de,[v(`table`,fe,[v(`thead`,pe,[v(`tr`,null,[v(`th`,me,m(L(`file`)),1),v(`th`,he,m(L(`destination`)),1),v(`th`,ge,m(L(`date`)),1),v(`th`,_e,m(L(`size`)),1),o[14]||=v(`th`,{class:`px-4 py-2`},null,-1)])]),v(`tbody`,ve,[(a(!0),_(g,null,s(B.value.backups,e=>(a(),_(`tr`,{key:e.id,"data-backup":e.file,dusk:`backup`},[v(`td`,be,m(e.file),1),v(`td`,xe,m(e.disk),1),v(`td`,C,m(z(e.date)),1),v(`td`,w,m(R(e.size)),1),v(`td`,T,[v(`a`,{href:e.download_url,class:`text-accent underline`},m(L(`download`)),9,E),v(`button`,{type:`button`,dusk:`restore`,class:`text-accent underline`,disabled:!!B.value.running,onClick:t=>en(e)},m(L(`restore`)),9,D),v(`button`,{type:`button`,dusk:`delete`,class:`text-danger underline`,onClick:t=>G.value=e},m(L(`delete`)),9,O)])],8,ye))),128))])])])):(a(),_(`p`,ue,m(L(`empty`)),1))]),_:1},8,[`title`]),v(`div`,k,[n(x,{title:L(`destinations`)},{default:l(()=>[v(`ul`,A,[(a(!0),_(g,null,s(P.health,n=>(a(),_(`li`,{key:n.disk,"data-destination":n.disk,dusk:`destination-${n.disk}`},[v(`div`,M,[v(`span`,Se,m(n.disk),1),v(`span`,{class:e([`px-2 py-0.5 rounded text-xs font-medium`,!n.reachable||!n.healthy?$.failed:$.ok])},m(n.reachable?n.healthy?L(`healthy`):L(`unhealthy`):L(`unreachable`)),3)]),n.reachable?(a(),_(`p`,Ce,m(L(`stored`,{count:n.count,size:R(n.used)}))+` · `+m(n.newest?L(`newest`,{date:z(n.newest)}):L(`no_archive`)),1)):t(``,!0),n.problems.length?(a(),_(`ul`,we,[(a(!0),_(g,null,s(n.problems,e=>(a(),_(`li`,{key:e},m(e),1))),128))])):t(``,!0)],8,j))),128))])]),_:1},8,[`title`]),n(x,{title:L(`settings`),subtitle:L(`settings_note`)},{default:l(()=>[v(`dl`,Te,[v(`dt`,Ee,m(L(`databases`)),1),v(`dd`,De,m(P.settings.databases.map(e=>`${e.connection} (${e.driver})`).join(`, `)||L(`nothing`)),1),v(`dt`,Oe,m(L(`folders`)),1),v(`dd`,ke,m(P.settings.folders.join(`, `)||L(`nothing`)),1),v(`dt`,Ae,m(L(`destinations`)),1),v(`dd`,je,m(P.settings.destinations.join(`, `)),1),v(`dt`,Me,m(L(`schedule`)),1),v(`dd`,Ne,[c(m(an.value),1),P.settings.queue?(a(),_(`span`,Pe,`. `+m(L(`queue`,{queue:P.settings.queue})),1)):t(``,!0)]),v(`dt`,Fe,m(L(`retention`)),1),v(`dd`,Ie,m(on.value),1),v(`dt`,Le,m(L(`encryption`)),1),v(`dd`,Re,m(P.settings.encrypted?L(`encrypted`):L(`not_encrypted`)),1)])]),_:1},8,[`title`,`subtitle`])]),n(x,{title:L(`log`),"no-padding":``},{default:l(()=>[B.value.log.length?(a(),_(`div`,Be,[v(`table`,Ve,[v(`thead`,He,[v(`tr`,null,[v(`th`,Ue,m(L(`when`)),1),v(`th`,We,m(L(`what`)),1),v(`th`,Ge,m(L(`result`)),1),v(`th`,Ke,m(L(`details`)),1)])]),v(`tbody`,qe,[(a(!0),_(g,null,s(B.value.log,(t,n)=>(a(),_(`tr`,{key:n},[v(`td`,Je,m(z(t.at)),1),v(`td`,Ye,m(L(`action_${t.action}`)),1),v(`td`,Xe,[v(`span`,{class:e([`px-2 py-0.5 rounded text-xs font-medium`,$[t.status]||$.failed])},m(L(`status_${t.status}`)),3)]),v(`td`,Ze,m(sn(t)),1)]))),128))])])])):(a(),_(`p`,ze,m(L(`log_empty`)),1))]),_:1},8,[`title`])]),n(S,{show:!!G.value,title:L(`delete`),onClose:o[4]||=e=>G.value=null},{default:l(()=>[v(`div`,Qe,[v(`p`,$e,m(G.value?L(`delete_confirm`,{file:G.value.file,disk:G.value.disk}):``),1),v(`div`,et,[n(b,{variant:`secondary`,onClick:o[3]||=e=>G.value=null},{default:l(()=>[c(m(L(`cancel`)),1)]),_:1}),n(b,{dusk:`confirm-delete`,variant:`danger`,onClick:$t},{default:l(()=>[c(m(L(`delete`)),1)]),_:1})])])]),_:1},8,[`show`,`title`]),n(S,{show:!!K.value,"max-width":`2xl`,title:K.value?L(`restore_title`,{file:K.value.file}):``,onClose:o[12]||=e=>K.value=null},{default:l(()=>[K.value?(a(),_(`div`,tt,[v(`p`,nt,m(L(`restore_intro`)),1),v(`div`,rt,[v(`div`,it,[v(`label`,N,m(L(`password`)),1),r(v(`input`,{id:`backup-password`,"onUpdate:modelValue":o[5]||=e=>X.value.password=e,type:`password`,autocomplete:`off`,class:`mt-1 block w-full px-3 py-2 border border-field rounded-md shadow-sm focus:outline-none focus:ring-focus focus:border-focus`},null,512),[[f,X.value.password]]),v(`p`,at,m(L(`password_hint`)),1)]),n(b,{dusk:`preview`,variant:`secondary`,loading:Y.value,onClick:tn},{default:l(()=>[c(m(L(`preview`)),1)]),_:1},8,[`loading`])]),J.value?(a(),_(`p`,ot,m(J.value),1)):t(``,!0),q.value?(a(),_(g,{key:1},[q.value.created_at?(a(),_(`p`,st,m(L(`made`,{date:z(q.value.created_at)})),1)):t(``,!0),q.value.databases.length?(a(),_(`div`,ct,[v(`table`,lt,[v(`thead`,ut,[v(`tr`,null,[v(`th`,dt,m(L(`connection`)),1),v(`th`,ft,m(L(`driver`)),1),v(`th`,pt,m(L(`dump`)),1),v(`th`,mt,m(L(`replaces`)),1)])]),v(`tbody`,ht,[(a(!0),_(g,null,s(q.value.databases,e=>(a(),_(`tr`,{key:e.connection},[v(`td`,gt,m(e.connection),1),v(`td`,_t,m(e.driver),1),v(`td`,vt,m(R(e.size)),1),v(`td`,yt,m(e.restorable?e.target:L(`skipped`)),1)]))),128))])])])):t(``,!0),q.value.folders.length?(a(),_(`div`,bt,[v(`table`,xt,[v(`thead`,St,[v(`tr`,null,[v(`th`,Ct,m(L(`into`)),1),v(`th`,wt,m(L(`files`)),1),v(`th`,Tt,m(L(`new`)),1),v(`th`,Et,m(L(`changed`)),1),v(`th`,Dt,m(L(`unchanged`)),1),v(`th`,Ot,m(L(`extra`)),1)])]),v(`tbody`,kt,[(a(!0),_(g,null,s(q.value.folders,e=>(a(),_(`tr`,{key:e.prefix},[v(`td`,At,m(e.target),1),v(`td`,jt,m(e.files),1),v(`td`,Mt,m(e.new),1),v(`td`,Nt,m(e.changed),1),v(`td`,Pt,m(e.unchanged),1),v(`td`,Ft,m(e.extra),1)]))),128))])])])):t(``,!0),q.value.warnings.length?(a(),_(`ul`,It,[(a(!0),_(g,null,s(q.value.warnings,e=>(a(),_(`li`,{key:e,class:`ml-3`},m(e),1))),128))])):t(``,!0),v(`fieldset`,Lt,[v(`label`,Rt,[r(v(`input`,{"onUpdate:modelValue":o[6]||=e=>X.value.database=e,type:`checkbox`,class:`h-4 w-4 text-accent border-field rounded focus:ring-focus`},null,512),[[h,X.value.database]]),c(` `+m(L(`restore_database`)),1)]),v(`label`,zt,[r(v(`input`,{"onUpdate:modelValue":o[7]||=e=>X.value.files=e,type:`checkbox`,class:`h-4 w-4 text-accent border-field rounded focus:ring-focus`},null,512),[[h,X.value.files]]),c(` `+m(L(`restore_files`)),1)]),v(`label`,Bt,[r(v(`input`,{"onUpdate:modelValue":o[8]||=e=>X.value.delete_extra=e,type:`checkbox`,class:`h-4 w-4 text-accent border-field rounded focus:ring-focus`,disabled:!X.value.files},null,8,Vt),[[h,X.value.delete_extra]]),c(` `+m(L(`delete_extra`)),1)]),v(`label`,Ht,[r(v(`input`,{"onUpdate:modelValue":o[9]||=e=>X.value.safety_backup=e,type:`checkbox`,class:`h-4 w-4 text-accent border-field rounded focus:ring-focus`},null,512),[[h,X.value.safety_backup]]),c(` `+m(L(`safety_backup`)),1)])]),v(`div`,Ut,[v(`p`,Wt,m(L(`risks`)),1),v(`ul`,Gt,[X.value.database?(a(),_(`li`,Kt,m(L(`risk_database`,{date:z(q.value.created_at||K.value.date)})),1)):t(``,!0),X.value.database?(a(),_(`li`,qt,m(L(`risk_sessions`)),1)):t(``,!0),X.value.files?(a(),_(`li`,Jt,m(L(`risk_files`)),1)):t(``,!0),v(`li`,null,m(L(`risk_site`)),1)])]),v(`div`,null,[v(`label`,Yt,m(L(`confirm`,{file:K.value.file})),1),r(v(`input`,{id:`backup-confirm`,dusk:`restore-confirm`,"onUpdate:modelValue":o[10]||=e=>X.value.confirm=e,type:`text`,autocomplete:`off`,spellcheck:`false`,class:`mt-1 block w-full px-3 py-2 font-mono border border-field rounded-md shadow-sm focus:outline-none focus:ring-focus focus:border-focus`},null,512),[[f,X.value.confirm]]),Z.value.confirm?(a(),_(`p`,Xt,m(Z.value.confirm),1)):t(``,!0)])],64)):t(``,!0),v(`div`,Zt,[n(b,{dusk:`cancel-restore`,variant:`secondary`,onClick:o[11]||=e=>K.value=null},{default:l(()=>[c(m(L(`cancel`)),1)]),_:1}),n(b,{dusk:`start-restore`,variant:`danger`,loading:Q.value,disabled:!nn.value,onClick:rn},{default:l(()=>[c(m(L(`start_restore`)),1)]),_:1},8,[`loading`,`disabled`])])])):t(``,!0)]),_:1},8,[`show`,`title`])]),_:1},8,[`title`]))}};export{P as default};
\ No newline at end of file
+import{$ as e,C as t,E as n,G as r,H as i,I as a,N as o,R as s,S as ee,T as c,W as l,X as u,b as d,m as f,o as te,s as p,tt as m,u as h,v as g,w as _,x as v}from"./dist-Bie52OmN.js";import{n as y,r as ne,t as re}from"./AdminLayout-D_QE0gy-.js";import{t as b}from"./AdminButton-KiIJ2sLW.js";import{t as x}from"./AdminCard-YbEwPtJz.js";import{t as S}from"./AdminModal-DKazeNNa.js";var ie={class:`mb-6 flex flex-wrap items-start justify-between gap-4`},ae={class:`text-2xl font-bold text-fg`},oe={class:`mt-1 text-sm text-muted`},se={class:`flex flex-wrap gap-2`},ce={key:0,dusk:`backup-running`,role:`status`,class:`mb-6 flex items-center gap-3 p-4 bg-accent-soft text-accent-soft-fg border border-line rounded-lg text-sm`},le={class:`space-y-6`},ue={key:0,class:`p-6 text-sm text-muted`},de={key:1,class:`overflow-x-auto`},fe={dusk:`backups`,class:`min-w-full text-sm`},pe={class:`bg-surface-alt`},me={class:`px-4 py-2 text-left font-medium text-fg`},he={class:`px-4 py-2 text-left font-medium text-fg`},ge={class:`px-4 py-2 text-left font-medium text-fg`},_e={class:`px-4 py-2 text-right font-medium text-fg`},ve={class:`divide-y divide-line`},ye=[`data-backup`],be={class:`px-4 py-2 font-mono text-fg`},xe={class:`px-4 py-2 text-fg`},C={class:`px-4 py-2 text-fg`},w={class:`px-4 py-2 text-right text-fg whitespace-nowrap`},T={class:`px-4 py-2 text-right whitespace-nowrap space-x-2`},E=[`href`],D=[`disabled`,`onClick`],O=[`onClick`],k={class:`grid gap-6 lg:grid-cols-2`},A={class:`space-y-4`},j=[`data-destination`,`dusk`],M={class:`flex flex-wrap items-center gap-2`},Se={class:`font-medium text-fg`},Ce={key:0,class:`mt-1 text-sm text-fg`},we={key:1,class:`mt-1 list-disc pl-5 text-sm text-danger`},Te={class:`grid grid-cols-1 sm:grid-cols-3 gap-x-4 gap-y-3 text-sm`},Ee={class:`font-medium text-fg`},De={class:`sm:col-span-2 text-fg`},Oe={class:`font-medium text-fg`},ke={class:`sm:col-span-2 text-fg break-all`},Ae={class:`font-medium text-fg`},je={class:`sm:col-span-2 text-fg`},Me={class:`font-medium text-fg`},Ne={class:`sm:col-span-2 text-fg`},Pe={key:0},Fe={class:`font-medium text-fg`},Ie={class:`sm:col-span-2 text-fg`},Le={class:`font-medium text-fg`},Re={class:`sm:col-span-2 text-fg`},ze={key:0,class:`p-6 text-sm text-muted`},Be={key:1,class:`overflow-x-auto`},Ve={dusk:`backup-log`,class:`min-w-full text-sm`},He={class:`bg-surface-alt`},Ue={class:`px-4 py-2 text-left font-medium text-fg`},We={class:`px-4 py-2 text-left font-medium text-fg`},Ge={class:`px-4 py-2 text-left font-medium text-fg`},Ke={class:`px-4 py-2 text-left font-medium text-fg`},qe={class:`divide-y divide-line`},Je={class:`px-4 py-2 text-fg whitespace-nowrap`},Ye={class:`px-4 py-2 text-fg`},Xe={class:`px-4 py-2`},Ze={class:`px-4 py-2 text-fg break-words`},Qe={class:`p-6`},$e={class:`text-fg`},et={class:`mt-6 flex justify-end gap-2`},tt={key:0,dusk:`restore-dialog`,class:`p-6 space-y-5 text-sm`},nt={class:`text-fg`},rt={class:`flex flex-wrap items-end gap-3`},it={class:`flex-1 min-w-48`},N={for:`backup-password`,class:`block font-medium text-fg`},at={class:`mt-1 text-xs text-muted`},ot={key:0,"data-error":``,class:`text-danger`,role:`alert`},st={key:0,class:`text-fg`},ct={key:1,class:`overflow-x-auto border border-line rounded-md`},lt={dusk:`plan-databases`,class:`min-w-full`},ut={class:`bg-surface-alt`},dt={class:`px-3 py-2 text-left font-medium text-fg`},ft={class:`px-3 py-2 text-left font-medium text-fg`},pt={class:`px-3 py-2 text-right font-medium text-fg`},mt={class:`px-3 py-2 text-left font-medium text-fg`},ht={class:`divide-y divide-line`},gt={class:`px-3 py-1.5 text-fg`},_t={class:`px-3 py-1.5 text-fg`},vt={class:`px-3 py-1.5 text-right text-fg`},yt={class:`px-3 py-1.5 text-fg break-all`},bt={key:2,class:`overflow-x-auto border border-line rounded-md`},xt={dusk:`plan-folders`,class:`min-w-full`},St={class:`bg-surface-alt`},Ct={class:`px-3 py-2 text-left font-medium text-fg`},wt={class:`px-3 py-2 text-right font-medium text-fg`},Tt={class:`px-3 py-2 text-right font-medium text-fg`},Et={class:`px-3 py-2 text-right font-medium text-fg`},Dt={class:`px-3 py-2 text-right font-medium text-fg`},Ot={class:`px-3 py-2 text-right font-medium text-fg`},kt={class:`divide-y divide-line`},At={class:`px-3 py-1.5 text-fg break-all`},jt={class:`px-3 py-1.5 text-right text-fg`},Mt={class:`px-3 py-1.5 text-right text-fg`},Nt={class:`px-3 py-1.5 text-right text-fg`},Pt={class:`px-3 py-1.5 text-right text-fg`},Ft={class:`px-3 py-1.5 text-right text-fg`},It={key:3,class:`list-disc pl-5 bg-warning-soft text-warning-soft-fg border border-line rounded-md p-3 space-y-1`},Lt={class:`space-y-2`},Rt={class:`flex items-center gap-2 text-fg`},zt={class:`flex items-center gap-2 text-fg`},Bt={class:`flex items-center gap-2 text-fg ml-6`},Vt=[`disabled`],Ht={class:`flex items-center gap-2 text-fg`},Ut={class:`p-4 bg-surface text-fg border-2 border-danger rounded-lg`},Wt={class:`font-medium`},Gt={class:`mt-2 list-disc pl-5 space-y-1`},Kt={key:0},qt={key:1},Jt={key:2},Yt={for:`backup-confirm`,class:`block font-medium text-fg`},Xt={key:0,"data-error":``,class:`mt-1 text-danger`},Zt={class:`flex justify-end gap-2`},P={__name:`Index`,props:{backups:Array,running:Object,log:Array,health:Array,settings:Object,labels:Object},setup(P){let F=P,Qt=te(),I=d(()=>String(Qt.props.locale||`en`).replace(`_`,`-`));function L(e,t={}){let n=F.labels?.[e]??e;for(let[e,r]of Object.entries(t))n=n.replaceAll(`:${e}`,String(r??``));return n}function R(e){let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=Number(e)||0,r=0;for(;n>=1024&&r1)})} ${t[r]}`}function z(e){return e?new Date(e).toLocaleString(I.value,{dateStyle:`medium`,timeStyle:`short`}):``}let B=u({backups:F.backups,running:F.running,log:F.log}),V=null;i(()=>[F.backups,F.running,F.log],()=>{B.value={backups:F.backups,running:F.running,log:F.log}});async function H(){let e=await fetch(route(`admin.backups.status`),{headers:y()}).catch(()=>null);if(e?.ok){let t=await e.json(),n=B.value.running&&!t.running;B.value=t,n&&p.reload({only:[`health`,`backups`,`running`,`log`]})}}i(()=>B.value.running,e=>{clearInterval(V),V=e?setInterval(H,3e3):null},{immediate:!0}),o(()=>clearInterval(V));let U=u(!1);function W(e=null){U.value=!0,p.post(route(`admin.backups.store`),{only:e},{preserveScroll:!0,onSuccess:()=>H(),onFinish:()=>{U.value=!1}})}let G=u(null);function $t(){p.delete(route(`admin.backups.destroy`,G.value.id),{preserveScroll:!0,onFinish:()=>{G.value=null}})}let K=u(null),q=u(null),J=u(``),Y=u(!1),X=u({}),Z=u({}),Q=u(!1);function en(e){K.value=e,q.value=null,J.value=``,Z.value={},X.value={password:``,database:!0,files:!0,delete_extra:!1,safety_backup:!0,confirm:``}}async function tn(){Y.value=!0,J.value=``;try{let e=await fetch(route(`admin.backups.plan`,K.value.id),{method:`POST`,headers:y({"Content-Type":`application/json`}),body:JSON.stringify({password:X.value.password||null})});if(!e.ok){J.value=await ne(e,L(`preview_failed`)),q.value=null;return}q.value=(await e.json()).plan}catch{J.value=L(`preview_failed`)}finally{Y.value=!1}}let nn=d(()=>q.value&&(X.value.database||X.value.files)&&X.value.confirm.trim()===K.value?.file);function rn(){Q.value=!0,p.post(route(`admin.backups.restore`,K.value.id),{...X.value,confirm:X.value.confirm.trim(),password:X.value.password||null},{preserveScroll:!0,onSuccess:()=>{K.value=null,H()},onError:e=>{Z.value=e},onFinish:()=>{Q.value=!1}})}let an=d(()=>{let e=F.settings?.schedule||{};return e.frequency===`daily`?L(`schedule_daily`,{time:e.time}):e.frequency===`weekly`?L(`schedule_weekly`,{weekday:F.settings.weekday,time:e.time}):L(`schedule_off`)}),on=d(()=>{let e=F.settings?.retention||{};return L(`retention_text`,{all:e.keep_all_days,daily:e.daily,weekly:e.weekly,monthly:e.monthly,yearly:e.yearly})}),$={ok:`bg-success-soft text-success-soft-fg`,partial:`bg-warning-soft text-warning-soft-fg`,failed:`bg-danger-soft text-danger-soft-fg`};function sn(e){let t=[];return e.trigger&&t.push(L(`trigger_${e.trigger}`)),e.by&&t.push(e.by),e.file&&t.push(e.disk?`${e.file} (${e.disk})`:e.file),e.disks?.length&&t.push(L(`copied_to`,{disks:e.disks.join(`, `)})),e.failed?.length&&t.push(L(`not_copied_to`,{disks:e.failed.map(e=>e.disk??e).join(`, `)})),e.action===`restore`&&e.status===`ok`&&t.push(L(`restored`,{databases:(e.databases||[]).join(`, `)||`—`,files:e.files??0,deleted:e.deleted??0})),e.seconds!==void 0&&t.push(L(`seconds`,{seconds:e.seconds})),e.message&&t.push(e.message),t.join(` · `)}return(i,o)=>(a(),ee(re,{title:L(`menu`)},{default:l(()=>[v(`div`,ie,[v(`div`,null,[v(`h1`,ae,m(P.labels.menu),1),v(`p`,oe,m(L(`subtitle`)),1)]),v(`div`,se,[n(b,{dusk:`backup-now`,loading:U.value,disabled:!!B.value.running,onClick:o[0]||=e=>W()},{default:l(()=>[c(m(L(`back_up_now`)),1)]),_:1},8,[`loading`,`disabled`]),n(b,{variant:`secondary`,disabled:U.value||!!B.value.running,onClick:o[1]||=e=>W(`database`)},{default:l(()=>[c(m(L(`only_database`)),1)]),_:1},8,[`disabled`]),n(b,{variant:`secondary`,disabled:U.value||!!B.value.running,onClick:o[2]||=e=>W(`files`)},{default:l(()=>[c(m(L(`only_files`)),1)]),_:1},8,[`disabled`])])]),B.value.running?(a(),_(`div`,ce,[o[13]||=v(`svg`,{class:`animate-spin h-5 w-5`,fill:`none`,viewBox:`0 0 24 24`,"aria-hidden":`true`},[v(`circle`,{class:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,"stroke-width":`4`}),v(`path`,{class:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})],-1),c(` `+m(L(B.value.running.action===`restore`?`running_restore`:`running_backup`,{time:z(B.value.running.started_at)})),1)])):t(``,!0),v(`div`,le,[n(x,{title:L(`archives`),"no-padding":``},{default:l(()=>[B.value.backups.length?(a(),_(`div`,de,[v(`table`,fe,[v(`thead`,pe,[v(`tr`,null,[v(`th`,me,m(L(`file`)),1),v(`th`,he,m(L(`destination`)),1),v(`th`,ge,m(L(`date`)),1),v(`th`,_e,m(L(`size`)),1),o[14]||=v(`th`,{class:`px-4 py-2`},null,-1)])]),v(`tbody`,ve,[(a(!0),_(g,null,s(B.value.backups,e=>(a(),_(`tr`,{key:e.id,"data-backup":e.file,dusk:`backup`},[v(`td`,be,m(e.file),1),v(`td`,xe,m(e.disk),1),v(`td`,C,m(z(e.date)),1),v(`td`,w,m(R(e.size)),1),v(`td`,T,[v(`a`,{href:e.download_url,class:`text-accent underline`},m(L(`download`)),9,E),v(`button`,{type:`button`,dusk:`restore`,class:`text-accent underline`,disabled:!!B.value.running,onClick:t=>en(e)},m(L(`restore`)),9,D),v(`button`,{type:`button`,dusk:`delete`,class:`text-danger underline`,onClick:t=>G.value=e},m(L(`delete`)),9,O)])],8,ye))),128))])])])):(a(),_(`p`,ue,m(L(`empty`)),1))]),_:1},8,[`title`]),v(`div`,k,[n(x,{title:L(`destinations`)},{default:l(()=>[v(`ul`,A,[(a(!0),_(g,null,s(P.health,n=>(a(),_(`li`,{key:n.disk,"data-destination":n.disk,dusk:`destination-${n.disk}`},[v(`div`,M,[v(`span`,Se,m(n.disk),1),v(`span`,{class:e([`px-2 py-0.5 rounded text-xs font-medium`,!n.reachable||!n.healthy?$.failed:$.ok])},m(n.reachable?n.healthy?L(`healthy`):L(`unhealthy`):L(`unreachable`)),3)]),n.reachable?(a(),_(`p`,Ce,m(L(`stored`,{count:n.count,size:R(n.used)}))+` · `+m(n.newest?L(`newest`,{date:z(n.newest)}):L(`no_archive`)),1)):t(``,!0),n.problems.length?(a(),_(`ul`,we,[(a(!0),_(g,null,s(n.problems,e=>(a(),_(`li`,{key:e},m(e),1))),128))])):t(``,!0)],8,j))),128))])]),_:1},8,[`title`]),n(x,{title:L(`settings`),subtitle:L(`settings_note`)},{default:l(()=>[v(`dl`,Te,[v(`dt`,Ee,m(L(`databases`)),1),v(`dd`,De,m(P.settings.databases.map(e=>`${e.connection} (${e.driver})`).join(`, `)||L(`nothing`)),1),v(`dt`,Oe,m(L(`folders`)),1),v(`dd`,ke,m(P.settings.folders.join(`, `)||L(`nothing`)),1),v(`dt`,Ae,m(L(`destinations`)),1),v(`dd`,je,m(P.settings.destinations.join(`, `)),1),v(`dt`,Me,m(L(`schedule`)),1),v(`dd`,Ne,[c(m(an.value),1),P.settings.queue?(a(),_(`span`,Pe,`. `+m(L(`queue`,{queue:P.settings.queue})),1)):t(``,!0)]),v(`dt`,Fe,m(L(`retention`)),1),v(`dd`,Ie,m(on.value),1),v(`dt`,Le,m(L(`encryption`)),1),v(`dd`,Re,m(P.settings.encrypted?L(`encrypted`):L(`not_encrypted`)),1)])]),_:1},8,[`title`,`subtitle`])]),n(x,{title:L(`log`),"no-padding":``},{default:l(()=>[B.value.log.length?(a(),_(`div`,Be,[v(`table`,Ve,[v(`thead`,He,[v(`tr`,null,[v(`th`,Ue,m(L(`when`)),1),v(`th`,We,m(L(`what`)),1),v(`th`,Ge,m(L(`result`)),1),v(`th`,Ke,m(L(`details`)),1)])]),v(`tbody`,qe,[(a(!0),_(g,null,s(B.value.log,(t,n)=>(a(),_(`tr`,{key:n},[v(`td`,Je,m(z(t.at)),1),v(`td`,Ye,m(L(`action_${t.action}`)),1),v(`td`,Xe,[v(`span`,{class:e([`px-2 py-0.5 rounded text-xs font-medium`,$[t.status]||$.failed])},m(L(`status_${t.status}`)),3)]),v(`td`,Ze,m(sn(t)),1)]))),128))])])])):(a(),_(`p`,ze,m(L(`log_empty`)),1))]),_:1},8,[`title`])]),n(S,{show:!!G.value,title:L(`delete`),onClose:o[4]||=e=>G.value=null},{default:l(()=>[v(`div`,Qe,[v(`p`,$e,m(G.value?L(`delete_confirm`,{file:G.value.file,disk:G.value.disk}):``),1),v(`div`,et,[n(b,{variant:`secondary`,onClick:o[3]||=e=>G.value=null},{default:l(()=>[c(m(L(`cancel`)),1)]),_:1}),n(b,{dusk:`confirm-delete`,variant:`danger`,onClick:$t},{default:l(()=>[c(m(L(`delete`)),1)]),_:1})])])]),_:1},8,[`show`,`title`]),n(S,{show:!!K.value,"max-width":`2xl`,title:K.value?L(`restore_title`,{file:K.value.file}):``,onClose:o[12]||=e=>K.value=null},{default:l(()=>[K.value?(a(),_(`div`,tt,[v(`p`,nt,m(L(`restore_intro`)),1),v(`div`,rt,[v(`div`,it,[v(`label`,N,m(L(`password`)),1),r(v(`input`,{id:`backup-password`,"onUpdate:modelValue":o[5]||=e=>X.value.password=e,type:`password`,autocomplete:`off`,class:`mt-1 block w-full px-3 py-2 border border-field rounded-md shadow-sm focus:outline-none focus:ring-focus focus:border-focus`},null,512),[[f,X.value.password]]),v(`p`,at,m(L(`password_hint`)),1)]),n(b,{dusk:`preview`,variant:`secondary`,loading:Y.value,onClick:tn},{default:l(()=>[c(m(L(`preview`)),1)]),_:1},8,[`loading`])]),J.value?(a(),_(`p`,ot,m(J.value),1)):t(``,!0),q.value?(a(),_(g,{key:1},[q.value.created_at?(a(),_(`p`,st,m(L(`made`,{date:z(q.value.created_at)})),1)):t(``,!0),q.value.databases.length?(a(),_(`div`,ct,[v(`table`,lt,[v(`thead`,ut,[v(`tr`,null,[v(`th`,dt,m(L(`connection`)),1),v(`th`,ft,m(L(`driver`)),1),v(`th`,pt,m(L(`dump`)),1),v(`th`,mt,m(L(`replaces`)),1)])]),v(`tbody`,ht,[(a(!0),_(g,null,s(q.value.databases,e=>(a(),_(`tr`,{key:e.connection},[v(`td`,gt,m(e.connection),1),v(`td`,_t,m(e.driver),1),v(`td`,vt,m(R(e.size)),1),v(`td`,yt,m(e.restorable?e.target:L(`skipped`)),1)]))),128))])])])):t(``,!0),q.value.folders.length?(a(),_(`div`,bt,[v(`table`,xt,[v(`thead`,St,[v(`tr`,null,[v(`th`,Ct,m(L(`into`)),1),v(`th`,wt,m(L(`files`)),1),v(`th`,Tt,m(L(`new`)),1),v(`th`,Et,m(L(`changed`)),1),v(`th`,Dt,m(L(`unchanged`)),1),v(`th`,Ot,m(L(`extra`)),1)])]),v(`tbody`,kt,[(a(!0),_(g,null,s(q.value.folders,e=>(a(),_(`tr`,{key:e.prefix},[v(`td`,At,m(e.target),1),v(`td`,jt,m(e.files),1),v(`td`,Mt,m(e.new),1),v(`td`,Nt,m(e.changed),1),v(`td`,Pt,m(e.unchanged),1),v(`td`,Ft,m(e.extra),1)]))),128))])])])):t(``,!0),q.value.warnings.length?(a(),_(`ul`,It,[(a(!0),_(g,null,s(q.value.warnings,e=>(a(),_(`li`,{key:e,class:`ml-3`},m(e),1))),128))])):t(``,!0),v(`fieldset`,Lt,[v(`label`,Rt,[r(v(`input`,{"onUpdate:modelValue":o[6]||=e=>X.value.database=e,type:`checkbox`,class:`h-4 w-4 text-accent border-field rounded focus:ring-focus`},null,512),[[h,X.value.database]]),c(` `+m(L(`restore_database`)),1)]),v(`label`,zt,[r(v(`input`,{"onUpdate:modelValue":o[7]||=e=>X.value.files=e,type:`checkbox`,class:`h-4 w-4 text-accent border-field rounded focus:ring-focus`},null,512),[[h,X.value.files]]),c(` `+m(L(`restore_files`)),1)]),v(`label`,Bt,[r(v(`input`,{"onUpdate:modelValue":o[8]||=e=>X.value.delete_extra=e,type:`checkbox`,class:`h-4 w-4 text-accent border-field rounded focus:ring-focus`,disabled:!X.value.files},null,8,Vt),[[h,X.value.delete_extra]]),c(` `+m(L(`delete_extra`)),1)]),v(`label`,Ht,[r(v(`input`,{"onUpdate:modelValue":o[9]||=e=>X.value.safety_backup=e,type:`checkbox`,class:`h-4 w-4 text-accent border-field rounded focus:ring-focus`},null,512),[[h,X.value.safety_backup]]),c(` `+m(L(`safety_backup`)),1)])]),v(`div`,Ut,[v(`p`,Wt,m(L(`risks`)),1),v(`ul`,Gt,[X.value.database?(a(),_(`li`,Kt,m(L(`risk_database`,{date:z(q.value.created_at||K.value.date)})),1)):t(``,!0),X.value.database?(a(),_(`li`,qt,m(L(`risk_sessions`)),1)):t(``,!0),X.value.files?(a(),_(`li`,Jt,m(L(`risk_files`)),1)):t(``,!0),v(`li`,null,m(L(`risk_site`)),1)])]),v(`div`,null,[v(`label`,Yt,m(L(`confirm`,{file:K.value.file})),1),r(v(`input`,{id:`backup-confirm`,dusk:`restore-confirm`,"onUpdate:modelValue":o[10]||=e=>X.value.confirm=e,type:`text`,autocomplete:`off`,spellcheck:`false`,class:`mt-1 block w-full px-3 py-2 font-mono border border-field rounded-md shadow-sm focus:outline-none focus:ring-focus focus:border-focus`},null,512),[[f,X.value.confirm]]),Z.value.confirm?(a(),_(`p`,Xt,m(Z.value.confirm),1)):t(``,!0)])],64)):t(``,!0),v(`div`,Zt,[n(b,{dusk:`cancel-restore`,variant:`secondary`,onClick:o[11]||=e=>K.value=null},{default:l(()=>[c(m(L(`cancel`)),1)]),_:1}),n(b,{dusk:`start-restore`,variant:`danger`,loading:Q.value,disabled:!nn.value,onClick:rn},{default:l(()=>[c(m(L(`start_restore`)),1)]),_:1},8,[`loading`,`disabled`])])])):t(``,!0)]),_:1},8,[`show`,`title`])]),_:1},8,[`title`]))}};export{P as default};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/Index-D_2Ij5S1.js b/packages/admin/dist/assets/Index-BzKcFwHs.js
similarity index 99%
rename from packages/admin/dist/assets/Index-D_2Ij5S1.js
rename to packages/admin/dist/assets/Index-BzKcFwHs.js
index af1c68ae..7b15e372 100644
--- a/packages/admin/dist/assets/Index-D_2Ij5S1.js
+++ b/packages/admin/dist/assets/Index-BzKcFwHs.js
@@ -1 +1 @@
-import{$ as e,C as t,E as n,G as r,I as i,Q as ee,R as a,S as o,T as s,W as c,Y as te,_ as ne,b as l,i as re,m as u,o as ie,p as d,s as f,tt as p,v as m,w as h,x as g}from"./dist-Bie52OmN.js";import{t as ae}from"./AdminLayout-DBeSErmz.js";import{t as _}from"./AdminButton-KiIJ2sLW.js";import{t as v}from"./AdminPagination-D7rwNfhd.js";var y={class:`mb-6`},b={class:`text-2xl font-bold text-fg`},x={class:`mt-1 text-sm text-muted`},S=[`aria-label`],C=[`aria-pressed`,`dusk`,`onClick`],w={class:`sm:col-span-2 text-sm text-fg`},T={class:`sr-only`},E=[`placeholder`],D={class:`text-sm text-fg`},O={class:`block mb-1 text-muted`},k={value:``},A=[`value`],j={class:`text-sm text-fg`},M={class:`block mb-1 text-muted`},N={value:``},P=[`value`],F={class:`text-sm text-fg`},I={class:`block mb-1 text-muted`},L={value:``},R=[`value`],z={class:`text-sm text-fg`},B={class:`block mb-1 text-muted`},V={value:``},H=[`value`],U={class:`text-sm text-fg`},W={class:`block mb-1 text-muted`},G=[`placeholder`],oe={class:`text-sm text-fg`},K={class:`block mb-1 text-muted`},q=[`value`],se={class:`sm:col-span-2 lg:col-span-4 flex gap-2`},ce={class:`bg-surface rounded-lg shadow overflow-hidden`},le={key:0,class:`px-6 py-10 text-center text-sm text-muted`,dusk:`errors-empty`},ue={key:1,class:`min-w-full divide-y divide-line text-sm`,dusk:`errors-table`},de={class:`bg-surface-alt`},fe={scope:`col`,class:`px-4 py-3 text-left font-medium text-fg`},pe={scope:`col`,class:`px-4 py-3 text-left font-medium text-fg`},me={scope:`col`,class:`px-4 py-3 text-right font-medium text-fg`},he={scope:`col`,class:`px-4 py-3 text-right font-medium text-fg`},ge={scope:`col`,class:`px-4 py-3 text-left font-medium text-fg`},_e={class:`divide-y divide-line`},ve={class:`px-4 py-3 max-w-xl`},ye={key:0,class:`ml-2 inline-block px-1.5 py-0.5 rounded text-xs bg-off text-off-fg`},be={class:`mt-0.5 text-fg break-words`},xe={key:1,class:`mt-0.5 text-xs text-muted font-mono break-all`},Se={class:`px-4 py-3 whitespace-nowrap text-fg`},Ce={class:`block text-xs text-muted`},we={class:`px-4 py-3 text-right tabular-nums text-fg`},Te={class:`px-4 py-3 text-right tabular-nums text-fg`},J={class:`px-4 py-3 whitespace-nowrap text-fg`},Ee={key:0,class:`block text-xs text-muted`},Y=`block w-full rounded-md border border-field bg-surface text-fg text-sm px-3 py-2 focus:outline-none focus:ring-2 focus:ring-focus`,X={__name:`Index`,props:{issues:{type:Object,required:!0},filters:{type:Object,required:!0},options:{type:Object,required:!0},strings:{type:Object,required:!0}},setup(X){let Z=X,De=ie(),Oe=l(()=>String(De.props.locale||`en`).replace(`_`,`-`)),Q=te({...Z.filters,site:Z.filters.site??``}),ke=l(()=>[...Z.options.statuses,`all`]);function $(){let e=Object.fromEntries(Object.entries(Q).filter(([,e])=>e!==``&&e!==null));f.get(route(`admin.errors.index`),e,{preserveState:!0,preserveScroll:!0})}function Ae(e){Q.status=e,$()}function je(){f.get(route(`admin.errors.index`))}function Me(e){return e?new Date(e).toLocaleString(Oe.value,{dateStyle:`medium`,timeStyle:`short`}):Z.strings.issue.none}return(te,l)=>(i(),o(ae,{title:X.strings.title},{default:c(()=>[g(`div`,y,[g(`h1`,b,p(X.strings.title),1),g(`p`,x,p(X.strings.subtitle),1)]),g(`nav`,{class:`mb-4 flex flex-wrap gap-2`,"aria-label":X.strings.list.status},[(i(!0),h(m,null,a(ke.value,t=>(i(),h(`button`,{key:t,type:`button`,class:e([`px-3 py-1.5 rounded-md text-sm font-medium border`,Q.status===t?`bg-accent text-on-accent border-accent`:`bg-surface text-fg border-field hover:bg-hover`]),"aria-pressed":Q.status===t,dusk:`errors-status-${t}`,onClick:e=>Ae(t)},p(X.strings.statuses[t]),11,C))),128))],8,S),g(`form`,{class:`bg-surface rounded-lg shadow p-4 mb-6 grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,dusk:`errors-filters`,onSubmit:ne($,[`prevent`])},[g(`label`,w,[g(`span`,T,p(X.strings.list.search),1),r(g(`input`,{"onUpdate:modelValue":l[0]||=e=>Q.q=e,type:`search`,placeholder:X.strings.list.search,class:e(Y),dusk:`errors-search`},null,8,E),[[u,Q.q]])]),g(`label`,D,[g(`span`,O,p(X.strings.list.site),1),r(g(`select`,{"onUpdate:modelValue":l[1]||=e=>Q.site=e,class:e(Y),dusk:`errors-site`},[g(`option`,k,p(X.strings.list.all_sites),1),(i(!0),h(m,null,a(X.options.sites,e=>(i(),h(`option`,{key:e.id,value:e.id},p(e.name),9,A))),128))],512),[[d,Q.site]])]),g(`label`,j,[g(`span`,M,p(X.strings.list.release),1),r(g(`select`,{"onUpdate:modelValue":l[2]||=e=>Q.release=e,class:e(Y),dusk:`errors-release`},[g(`option`,N,p(X.strings.list.any_release),1),(i(!0),h(m,null,a(X.options.releases,e=>(i(),h(`option`,{key:e,value:e},p(e),9,P))),128))],512),[[d,Q.release]])]),g(`label`,F,[g(`span`,I,p(X.strings.list.level),1),r(g(`select`,{"onUpdate:modelValue":l[3]||=e=>Q.level=e,class:e(Y),dusk:`errors-level`},[g(`option`,L,p(X.strings.list.any_level),1),(i(!0),h(m,null,a(X.options.levels,e=>(i(),h(`option`,{key:e,value:e},p(X.strings.levels[e]),9,R))),128))],512),[[d,Q.level]])]),g(`label`,z,[g(`span`,B,p(X.strings.list.kind),1),r(g(`select`,{"onUpdate:modelValue":l[4]||=e=>Q.kind=e,class:e(Y),dusk:`errors-kind`},[g(`option`,V,p(X.strings.list.any_kind),1),(i(!0),h(m,null,a(X.options.kinds,e=>(i(),h(`option`,{key:e,value:e},p(X.strings.kinds[e]),9,H))),128))],512),[[d,Q.kind]])]),g(`label`,U,[g(`span`,W,p(X.strings.list.path),1),r(g(`input`,{"onUpdate:modelValue":l[5]||=e=>Q.path=e,type:`text`,placeholder:X.strings.list.path_placeholder,class:e(Y),dusk:`errors-path`},null,8,G),[[u,Q.path]])]),g(`label`,oe,[g(`span`,K,p(X.strings.list.sort),1),r(g(`select`,{"onUpdate:modelValue":l[6]||=e=>Q.sort=e,class:e(Y),dusk:`errors-sort`},[(i(!0),h(m,null,a(X.strings.list.sorts,(e,t)=>(i(),h(`option`,{key:t,value:t},p(e),9,q))),128))],512),[[d,Q.sort]])]),g(`div`,se,[n(_,{type:`submit`,dusk:`errors-apply`},{default:c(()=>[s(p(X.strings.list.filter),1)]),_:1}),n(_,{type:`button`,variant:`secondary`,dusk:`errors-reset`,onClick:je},{default:c(()=>[s(p(X.strings.list.reset),1)]),_:1})])],32),g(`div`,ce,[X.issues.data.length?(i(),h(`table`,ue,[g(`thead`,de,[g(`tr`,null,[g(`th`,fe,p(X.strings.list.issue),1),g(`th`,pe,p(X.strings.list.level),1),g(`th`,me,p(X.strings.list.events),1),g(`th`,he,p(X.strings.list.users),1),g(`th`,ge,p(X.strings.list.last_seen),1)])]),g(`tbody`,_e,[(i(!0),h(m,null,a(X.issues.data,e=>(i(),h(`tr`,{key:e.id,class:`hover:bg-hover`,dusk:`errors-row`},[g(`td`,ve,[n(ee(re),{href:e.url,class:`font-semibold text-accent hover:text-accent-hover hover:underline`,dusk:`errors-open`},{default:c(()=>[s(p(e.short_class),1)]),_:2},1032,[`href`]),e.status===`new`?t(``,!0):(i(),h(`span`,ye,p(X.strings.statuses[e.status]),1)),g(`p`,be,p(e.title),1),e.culprit?(i(),h(`p`,xe,p(e.culprit),1)):t(``,!0)]),g(`td`,Se,[s(p(X.strings.levels[e.level]??e.level)+` `,1),g(`span`,Ce,p(X.strings.kinds[e.kind]??e.kind),1)]),g(`td`,we,p(e.times_seen),1),g(`td`,Te,p(e.users_seen),1),g(`td`,J,[s(p(Me(e.last_seen_at))+` `,1),e.last_release?(i(),h(`span`,Ee,p(e.last_release),1)):t(``,!0)])]))),128))])])):(i(),h(`p`,le,p(X.strings.list.empty),1)),X.issues.last_page>1?(i(),o(v,{key:2,paginator:X.issues},null,8,[`paginator`])):t(``,!0)])]),_:1},8,[`title`]))}};export{X as default};
\ No newline at end of file
+import{$ as e,C as t,E as n,G as r,I as i,Q as ee,R as a,S as o,T as s,W as c,Y as te,_ as ne,b as l,i as re,m as u,o as ie,p as d,s as f,tt as p,v as m,w as h,x as g}from"./dist-Bie52OmN.js";import{t as ae}from"./AdminLayout-D_QE0gy-.js";import{t as _}from"./AdminButton-KiIJ2sLW.js";import{t as v}from"./AdminPagination-D7rwNfhd.js";var y={class:`mb-6`},b={class:`text-2xl font-bold text-fg`},x={class:`mt-1 text-sm text-muted`},S=[`aria-label`],C=[`aria-pressed`,`dusk`,`onClick`],w={class:`sm:col-span-2 text-sm text-fg`},T={class:`sr-only`},E=[`placeholder`],D={class:`text-sm text-fg`},O={class:`block mb-1 text-muted`},k={value:``},A=[`value`],j={class:`text-sm text-fg`},M={class:`block mb-1 text-muted`},N={value:``},P=[`value`],F={class:`text-sm text-fg`},I={class:`block mb-1 text-muted`},L={value:``},R=[`value`],z={class:`text-sm text-fg`},B={class:`block mb-1 text-muted`},V={value:``},H=[`value`],U={class:`text-sm text-fg`},W={class:`block mb-1 text-muted`},G=[`placeholder`],oe={class:`text-sm text-fg`},K={class:`block mb-1 text-muted`},q=[`value`],se={class:`sm:col-span-2 lg:col-span-4 flex gap-2`},ce={class:`bg-surface rounded-lg shadow overflow-hidden`},le={key:0,class:`px-6 py-10 text-center text-sm text-muted`,dusk:`errors-empty`},ue={key:1,class:`min-w-full divide-y divide-line text-sm`,dusk:`errors-table`},de={class:`bg-surface-alt`},fe={scope:`col`,class:`px-4 py-3 text-left font-medium text-fg`},pe={scope:`col`,class:`px-4 py-3 text-left font-medium text-fg`},me={scope:`col`,class:`px-4 py-3 text-right font-medium text-fg`},he={scope:`col`,class:`px-4 py-3 text-right font-medium text-fg`},ge={scope:`col`,class:`px-4 py-3 text-left font-medium text-fg`},_e={class:`divide-y divide-line`},ve={class:`px-4 py-3 max-w-xl`},ye={key:0,class:`ml-2 inline-block px-1.5 py-0.5 rounded text-xs bg-off text-off-fg`},be={class:`mt-0.5 text-fg break-words`},xe={key:1,class:`mt-0.5 text-xs text-muted font-mono break-all`},Se={class:`px-4 py-3 whitespace-nowrap text-fg`},Ce={class:`block text-xs text-muted`},we={class:`px-4 py-3 text-right tabular-nums text-fg`},Te={class:`px-4 py-3 text-right tabular-nums text-fg`},J={class:`px-4 py-3 whitespace-nowrap text-fg`},Ee={key:0,class:`block text-xs text-muted`},Y=`block w-full rounded-md border border-field bg-surface text-fg text-sm px-3 py-2 focus:outline-none focus:ring-2 focus:ring-focus`,X={__name:`Index`,props:{issues:{type:Object,required:!0},filters:{type:Object,required:!0},options:{type:Object,required:!0},strings:{type:Object,required:!0}},setup(X){let Z=X,De=ie(),Oe=l(()=>String(De.props.locale||`en`).replace(`_`,`-`)),Q=te({...Z.filters,site:Z.filters.site??``}),ke=l(()=>[...Z.options.statuses,`all`]);function $(){let e=Object.fromEntries(Object.entries(Q).filter(([,e])=>e!==``&&e!==null));f.get(route(`admin.errors.index`),e,{preserveState:!0,preserveScroll:!0})}function Ae(e){Q.status=e,$()}function je(){f.get(route(`admin.errors.index`))}function Me(e){return e?new Date(e).toLocaleString(Oe.value,{dateStyle:`medium`,timeStyle:`short`}):Z.strings.issue.none}return(te,l)=>(i(),o(ae,{title:X.strings.title},{default:c(()=>[g(`div`,y,[g(`h1`,b,p(X.strings.title),1),g(`p`,x,p(X.strings.subtitle),1)]),g(`nav`,{class:`mb-4 flex flex-wrap gap-2`,"aria-label":X.strings.list.status},[(i(!0),h(m,null,a(ke.value,t=>(i(),h(`button`,{key:t,type:`button`,class:e([`px-3 py-1.5 rounded-md text-sm font-medium border`,Q.status===t?`bg-accent text-on-accent border-accent`:`bg-surface text-fg border-field hover:bg-hover`]),"aria-pressed":Q.status===t,dusk:`errors-status-${t}`,onClick:e=>Ae(t)},p(X.strings.statuses[t]),11,C))),128))],8,S),g(`form`,{class:`bg-surface rounded-lg shadow p-4 mb-6 grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,dusk:`errors-filters`,onSubmit:ne($,[`prevent`])},[g(`label`,w,[g(`span`,T,p(X.strings.list.search),1),r(g(`input`,{"onUpdate:modelValue":l[0]||=e=>Q.q=e,type:`search`,placeholder:X.strings.list.search,class:e(Y),dusk:`errors-search`},null,8,E),[[u,Q.q]])]),g(`label`,D,[g(`span`,O,p(X.strings.list.site),1),r(g(`select`,{"onUpdate:modelValue":l[1]||=e=>Q.site=e,class:e(Y),dusk:`errors-site`},[g(`option`,k,p(X.strings.list.all_sites),1),(i(!0),h(m,null,a(X.options.sites,e=>(i(),h(`option`,{key:e.id,value:e.id},p(e.name),9,A))),128))],512),[[d,Q.site]])]),g(`label`,j,[g(`span`,M,p(X.strings.list.release),1),r(g(`select`,{"onUpdate:modelValue":l[2]||=e=>Q.release=e,class:e(Y),dusk:`errors-release`},[g(`option`,N,p(X.strings.list.any_release),1),(i(!0),h(m,null,a(X.options.releases,e=>(i(),h(`option`,{key:e,value:e},p(e),9,P))),128))],512),[[d,Q.release]])]),g(`label`,F,[g(`span`,I,p(X.strings.list.level),1),r(g(`select`,{"onUpdate:modelValue":l[3]||=e=>Q.level=e,class:e(Y),dusk:`errors-level`},[g(`option`,L,p(X.strings.list.any_level),1),(i(!0),h(m,null,a(X.options.levels,e=>(i(),h(`option`,{key:e,value:e},p(X.strings.levels[e]),9,R))),128))],512),[[d,Q.level]])]),g(`label`,z,[g(`span`,B,p(X.strings.list.kind),1),r(g(`select`,{"onUpdate:modelValue":l[4]||=e=>Q.kind=e,class:e(Y),dusk:`errors-kind`},[g(`option`,V,p(X.strings.list.any_kind),1),(i(!0),h(m,null,a(X.options.kinds,e=>(i(),h(`option`,{key:e,value:e},p(X.strings.kinds[e]),9,H))),128))],512),[[d,Q.kind]])]),g(`label`,U,[g(`span`,W,p(X.strings.list.path),1),r(g(`input`,{"onUpdate:modelValue":l[5]||=e=>Q.path=e,type:`text`,placeholder:X.strings.list.path_placeholder,class:e(Y),dusk:`errors-path`},null,8,G),[[u,Q.path]])]),g(`label`,oe,[g(`span`,K,p(X.strings.list.sort),1),r(g(`select`,{"onUpdate:modelValue":l[6]||=e=>Q.sort=e,class:e(Y),dusk:`errors-sort`},[(i(!0),h(m,null,a(X.strings.list.sorts,(e,t)=>(i(),h(`option`,{key:t,value:t},p(e),9,q))),128))],512),[[d,Q.sort]])]),g(`div`,se,[n(_,{type:`submit`,dusk:`errors-apply`},{default:c(()=>[s(p(X.strings.list.filter),1)]),_:1}),n(_,{type:`button`,variant:`secondary`,dusk:`errors-reset`,onClick:je},{default:c(()=>[s(p(X.strings.list.reset),1)]),_:1})])],32),g(`div`,ce,[X.issues.data.length?(i(),h(`table`,ue,[g(`thead`,de,[g(`tr`,null,[g(`th`,fe,p(X.strings.list.issue),1),g(`th`,pe,p(X.strings.list.level),1),g(`th`,me,p(X.strings.list.events),1),g(`th`,he,p(X.strings.list.users),1),g(`th`,ge,p(X.strings.list.last_seen),1)])]),g(`tbody`,_e,[(i(!0),h(m,null,a(X.issues.data,e=>(i(),h(`tr`,{key:e.id,class:`hover:bg-hover`,dusk:`errors-row`},[g(`td`,ve,[n(ee(re),{href:e.url,class:`font-semibold text-accent hover:text-accent-hover hover:underline`,dusk:`errors-open`},{default:c(()=>[s(p(e.short_class),1)]),_:2},1032,[`href`]),e.status===`new`?t(``,!0):(i(),h(`span`,ye,p(X.strings.statuses[e.status]),1)),g(`p`,be,p(e.title),1),e.culprit?(i(),h(`p`,xe,p(e.culprit),1)):t(``,!0)]),g(`td`,Se,[s(p(X.strings.levels[e.level]??e.level)+` `,1),g(`span`,Ce,p(X.strings.kinds[e.kind]??e.kind),1)]),g(`td`,we,p(e.times_seen),1),g(`td`,Te,p(e.users_seen),1),g(`td`,J,[s(p(Me(e.last_seen_at))+` `,1),e.last_release?(i(),h(`span`,Ee,p(e.last_release),1)):t(``,!0)])]))),128))])])):(i(),h(`p`,le,p(X.strings.list.empty),1)),X.issues.last_page>1?(i(),o(v,{key:2,paginator:X.issues},null,8,[`paginator`])):t(``,!0)])]),_:1},8,[`title`]))}};export{X as default};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/Index-DsLgvcm0.js b/packages/admin/dist/assets/Index-CRJysQbh.js
similarity index 98%
rename from packages/admin/dist/assets/Index-DsLgvcm0.js
rename to packages/admin/dist/assets/Index-CRJysQbh.js
index 3712e2c2..2429bd51 100644
--- a/packages/admin/dist/assets/Index-DsLgvcm0.js
+++ b/packages/admin/dist/assets/Index-CRJysQbh.js
@@ -1 +1 @@
-import{$ as e,C as t,E as n,G as r,I as i,R as a,S as o,T as s,W as c,X as l,p as u,s as d,tt as f,v as p,w as m,x as h}from"./dist-Bie52OmN.js";import{t as g}from"./AdminLayout-DBeSErmz.js";import{t as _}from"./AdminButton-KiIJ2sLW.js";var v={class:`mb-6`},ee={"data-page-title":`admin.cache`,class:`text-2xl font-bold text-gray-900`},y={class:`mt-1 text-sm text-gray-600`},b={class:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6`},x={class:`bg-white rounded-lg shadow p-4`,"data-cache-stat":`rate`},S={class:`text-sm text-gray-600`},C={class:`mt-1 text-2xl font-semibold text-gray-900`},w={class:`mt-1 text-xs text-gray-500`},T={class:`bg-white rounded-lg shadow p-4`,"data-cache-stat":`size`},E={class:`text-sm text-gray-600`},D={class:`mt-1 text-2xl font-semibold text-gray-900`},O={class:`mt-1 text-xs text-gray-500`},k={class:`bg-white rounded-lg shadow p-4`,"data-cache-stat":`store`},A={class:`text-sm text-gray-600`},j={class:`mt-1 text-2xl font-semibold text-gray-900`},M={class:`mt-1 text-xs text-gray-500`},N={class:`bg-white rounded-lg shadow p-4`,"data-cache-stat":`state`},P={class:`text-sm text-gray-600`},F={class:`mt-1 text-xs text-gray-500`},I={class:`bg-white rounded-lg shadow p-6 space-y-6`},L={class:`text-sm text-gray-600`},R={key:0,class:`flex flex-col sm:flex-row sm:items-end gap-3`},z={class:`flex-1`},B={class:`block text-sm font-medium text-gray-700 mb-1`},V=[`value`],H={key:1,class:`flex flex-col sm:flex-row sm:items-end gap-3`},U={class:`flex-1`},W={class:`block text-sm font-medium text-gray-700 mb-1`},G=[`value`],K={class:`flex flex-wrap gap-3 pt-2 border-t border-gray-100`},q={__name:`Index`,props:{status:Object,modules:Array,sites:Array},setup(q){let J=q,Y=l(J.modules[0]?.key??``),X=l(J.sites[0]?.id??``),Z=l(!1),Q=(e,t={})=>{Z.value=!0,d.post(route(`admin.cache.clear`),{scope:e,...t},{preserveScroll:!0,onFinish:()=>{Z.value=!1}})},$=e=>e==null?`—`:new Intl.NumberFormat().format(e),te=e=>{if(e==null)return`—`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r(i(),o(g,{title:l.$t(`menu.cache`)},{default:c(()=>[h(`div`,v,[h(`h1`,ee,f(l.$t(`menu.cache`)),1),h(`p`,y,f(l.$t(`cache.subtitle`)),1)]),h(`div`,b,[h(`div`,x,[h(`div`,S,f(l.$t(`cache.hit_rate`)),1),h(`div`,C,f(q.status.rate===null?`—`:`${q.status.rate}%`),1),h(`div`,w,f(l.$t(`cache.hits`))+`: `+f($(q.status.hits))+` · `+f(l.$t(`cache.misses`))+`: `+f($(q.status.misses)),1)]),h(`div`,T,[h(`div`,E,f(l.$t(`cache.size`)),1),h(`div`,D,f(te(q.status.bytes)),1),h(`div`,O,f(l.$t(`cache.entries`))+`: `+f($(q.status.entries)),1)]),h(`div`,k,[h(`div`,A,f(l.$t(`cache.store`)),1),h(`div`,j,f(q.status.driver),1),h(`div`,M,f(q.status.tags?l.$t(`cache.with_tags`):l.$t(`cache.without_tags`)),1)]),h(`div`,N,[h(`div`,P,f(l.$t(`cache.records`)),1),h(`div`,{class:e([`mt-1 text-2xl font-semibold`,q.status.enabled?`text-green-700`:`text-gray-500`])},f(q.status.enabled?l.$t(`cache.on`):l.$t(`cache.off`)),3),h(`div`,F,f(l.$t(`cache.pages`))+`: `+f(q.status.pages?l.$t(`cache.on`):l.$t(`cache.off`)),1)])]),h(`div`,I,[h(`p`,L,f(l.$t(`cache.clear_hint`)),1),q.modules.length?(i(),m(`div`,R,[h(`label`,z,[h(`span`,B,f(l.$t(`cache.module`)),1),r(h(`select`,{"onUpdate:modelValue":d[0]||=e=>Y.value=e,"data-cache-module":``,class:`w-full rounded-md border-gray-300 text-sm`},[(i(!0),m(p,null,a(q.modules,e=>(i(),m(`option`,{key:e.key,value:e.key},f(e.label),9,V))),128))],512),[[u,Y.value]])]),n(_,{variant:`outline`,"data-action":`clear-module`,disabled:Z.value,onClick:d[1]||=e=>Q(`module`,{module:Y.value})},{default:c(()=>[s(f(l.$t(`cache.clear_module`)),1)]),_:1},8,[`disabled`])])):t(``,!0),q.sites.length>1?(i(),m(`div`,H,[h(`label`,U,[h(`span`,W,f(l.$t(`cache.site`)),1),r(h(`select`,{"onUpdate:modelValue":d[2]||=e=>X.value=e,"data-cache-site":``,class:`w-full rounded-md border-gray-300 text-sm`},[(i(!0),m(p,null,a(q.sites,e=>(i(),m(`option`,{key:e.id,value:e.id},f(e.name),9,G))),128))],512),[[u,X.value]])]),n(_,{variant:`outline`,"data-action":`clear-site`,disabled:Z.value,onClick:d[3]||=e=>Q(`site`,{site:X.value})},{default:c(()=>[s(f(l.$t(`cache.clear_site`)),1)]),_:1},8,[`disabled`])])):t(``,!0),h(`div`,K,[n(_,{variant:`danger`,"data-action":`clear-all`,disabled:Z.value,onClick:d[4]||=e=>Q(`all`)},{default:c(()=>[s(f(l.$t(`cache.clear_all`)),1)]),_:1},8,[`disabled`]),n(_,{variant:`secondary`,"data-action":`reset-stats`,disabled:Z.value,onClick:d[5]||=e=>Q(`stats`)},{default:c(()=>[s(f(l.$t(`cache.reset_stats`)),1)]),_:1},8,[`disabled`])])])]),_:1},8,[`title`]))}};export{q as default};
\ No newline at end of file
+import{$ as e,C as t,E as n,G as r,I as i,R as a,S as o,T as s,W as c,X as l,p as u,s as d,tt as f,v as p,w as m,x as h}from"./dist-Bie52OmN.js";import{t as g}from"./AdminLayout-D_QE0gy-.js";import{t as _}from"./AdminButton-KiIJ2sLW.js";var v={class:`mb-6`},ee={"data-page-title":`admin.cache`,class:`text-2xl font-bold text-gray-900`},y={class:`mt-1 text-sm text-gray-600`},b={class:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6`},x={class:`bg-white rounded-lg shadow p-4`,"data-cache-stat":`rate`},S={class:`text-sm text-gray-600`},C={class:`mt-1 text-2xl font-semibold text-gray-900`},w={class:`mt-1 text-xs text-gray-500`},T={class:`bg-white rounded-lg shadow p-4`,"data-cache-stat":`size`},E={class:`text-sm text-gray-600`},D={class:`mt-1 text-2xl font-semibold text-gray-900`},O={class:`mt-1 text-xs text-gray-500`},k={class:`bg-white rounded-lg shadow p-4`,"data-cache-stat":`store`},A={class:`text-sm text-gray-600`},j={class:`mt-1 text-2xl font-semibold text-gray-900`},M={class:`mt-1 text-xs text-gray-500`},N={class:`bg-white rounded-lg shadow p-4`,"data-cache-stat":`state`},P={class:`text-sm text-gray-600`},F={class:`mt-1 text-xs text-gray-500`},I={class:`bg-white rounded-lg shadow p-6 space-y-6`},L={class:`text-sm text-gray-600`},R={key:0,class:`flex flex-col sm:flex-row sm:items-end gap-3`},z={class:`flex-1`},B={class:`block text-sm font-medium text-gray-700 mb-1`},V=[`value`],H={key:1,class:`flex flex-col sm:flex-row sm:items-end gap-3`},U={class:`flex-1`},W={class:`block text-sm font-medium text-gray-700 mb-1`},G=[`value`],K={class:`flex flex-wrap gap-3 pt-2 border-t border-gray-100`},q={__name:`Index`,props:{status:Object,modules:Array,sites:Array},setup(q){let J=q,Y=l(J.modules[0]?.key??``),X=l(J.sites[0]?.id??``),Z=l(!1),Q=(e,t={})=>{Z.value=!0,d.post(route(`admin.cache.clear`),{scope:e,...t},{preserveScroll:!0,onFinish:()=>{Z.value=!1}})},$=e=>e==null?`—`:new Intl.NumberFormat().format(e),te=e=>{if(e==null)return`—`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r(i(),o(g,{title:l.$t(`menu.cache`)},{default:c(()=>[h(`div`,v,[h(`h1`,ee,f(l.$t(`menu.cache`)),1),h(`p`,y,f(l.$t(`cache.subtitle`)),1)]),h(`div`,b,[h(`div`,x,[h(`div`,S,f(l.$t(`cache.hit_rate`)),1),h(`div`,C,f(q.status.rate===null?`—`:`${q.status.rate}%`),1),h(`div`,w,f(l.$t(`cache.hits`))+`: `+f($(q.status.hits))+` · `+f(l.$t(`cache.misses`))+`: `+f($(q.status.misses)),1)]),h(`div`,T,[h(`div`,E,f(l.$t(`cache.size`)),1),h(`div`,D,f(te(q.status.bytes)),1),h(`div`,O,f(l.$t(`cache.entries`))+`: `+f($(q.status.entries)),1)]),h(`div`,k,[h(`div`,A,f(l.$t(`cache.store`)),1),h(`div`,j,f(q.status.driver),1),h(`div`,M,f(q.status.tags?l.$t(`cache.with_tags`):l.$t(`cache.without_tags`)),1)]),h(`div`,N,[h(`div`,P,f(l.$t(`cache.records`)),1),h(`div`,{class:e([`mt-1 text-2xl font-semibold`,q.status.enabled?`text-green-700`:`text-gray-500`])},f(q.status.enabled?l.$t(`cache.on`):l.$t(`cache.off`)),3),h(`div`,F,f(l.$t(`cache.pages`))+`: `+f(q.status.pages?l.$t(`cache.on`):l.$t(`cache.off`)),1)])]),h(`div`,I,[h(`p`,L,f(l.$t(`cache.clear_hint`)),1),q.modules.length?(i(),m(`div`,R,[h(`label`,z,[h(`span`,B,f(l.$t(`cache.module`)),1),r(h(`select`,{"onUpdate:modelValue":d[0]||=e=>Y.value=e,"data-cache-module":``,class:`w-full rounded-md border-gray-300 text-sm`},[(i(!0),m(p,null,a(q.modules,e=>(i(),m(`option`,{key:e.key,value:e.key},f(e.label),9,V))),128))],512),[[u,Y.value]])]),n(_,{variant:`outline`,"data-action":`clear-module`,disabled:Z.value,onClick:d[1]||=e=>Q(`module`,{module:Y.value})},{default:c(()=>[s(f(l.$t(`cache.clear_module`)),1)]),_:1},8,[`disabled`])])):t(``,!0),q.sites.length>1?(i(),m(`div`,H,[h(`label`,U,[h(`span`,W,f(l.$t(`cache.site`)),1),r(h(`select`,{"onUpdate:modelValue":d[2]||=e=>X.value=e,"data-cache-site":``,class:`w-full rounded-md border-gray-300 text-sm`},[(i(!0),m(p,null,a(q.sites,e=>(i(),m(`option`,{key:e.id,value:e.id},f(e.name),9,G))),128))],512),[[u,X.value]])]),n(_,{variant:`outline`,"data-action":`clear-site`,disabled:Z.value,onClick:d[3]||=e=>Q(`site`,{site:X.value})},{default:c(()=>[s(f(l.$t(`cache.clear_site`)),1)]),_:1},8,[`disabled`])])):t(``,!0),h(`div`,K,[n(_,{variant:`danger`,"data-action":`clear-all`,disabled:Z.value,onClick:d[4]||=e=>Q(`all`)},{default:c(()=>[s(f(l.$t(`cache.clear_all`)),1)]),_:1},8,[`disabled`]),n(_,{variant:`secondary`,"data-action":`reset-stats`,disabled:Z.value,onClick:d[5]||=e=>Q(`stats`)},{default:c(()=>[s(f(l.$t(`cache.reset_stats`)),1)]),_:1},8,[`disabled`])])])]),_:1},8,[`title`]))}};export{q as default};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/Index-ZYMbBsuF.js b/packages/admin/dist/assets/Index-Cl336b7A.js
similarity index 99%
rename from packages/admin/dist/assets/Index-ZYMbBsuF.js
rename to packages/admin/dist/assets/Index-Cl336b7A.js
index 93e05ab1..9f0230d2 100644
--- a/packages/admin/dist/assets/Index-ZYMbBsuF.js
+++ b/packages/admin/dist/assets/Index-Cl336b7A.js
@@ -1 +1 @@
-import{C as e,E as t,G as n,I as r,Q as i,R as a,S as o,T as s,W as c,X as l,_ as ee,a as u,m as d,s as te,tt as f,v as p,w as m,x as h}from"./dist-Bie52OmN.js";import{t as g}from"./AdminLayout-DBeSErmz.js";import{n as ne}from"./app-BCJOqmKO.js";import{t as _}from"./AdminButton-KiIJ2sLW.js";import{t as v}from"./AdminCard-YbEwPtJz.js";import{t as re}from"./AdminModal-DKazeNNa.js";var ie={class:`space-y-6`},ae={key:0,"data-api-token-plain":``,class:`p-4 bg-warning-soft border-2 border-warning-soft-fg rounded-lg`},oe={class:`font-medium text-fg`},y={class:`mt-3 flex flex-col sm:flex-row gap-2`},b={class:`flex-1 px-3 py-2 bg-surface border border-field rounded font-mono text-sm break-all`},x={class:`space-y-1 text-sm`},S=[`href`],C=[`href`],w={class:`grid gap-4 sm:grid-cols-2`},T={for:`token-name`,class:`block text-sm font-medium text-fg`},E=[`placeholder`],D={key:0,class:`mt-1 text-sm text-danger`},O={for:`token-expires`,class:`block text-sm font-medium text-fg`},k={key:0,class:`mt-1 text-sm text-danger`},A={class:`flex flex-wrap items-center justify-between gap-2`},j={class:`text-sm font-medium text-fg`},M={class:`flex gap-2`},N={key:0,class:`mt-1 text-sm text-danger`},P={class:`mt-2 max-h-96 overflow-y-auto border border-line rounded-md`},F={class:`min-w-full text-sm`},I={class:`bg-surface-alt sticky top-0`},L={class:`px-3 py-2 text-left font-medium text-fg`},R={class:`px-3 py-2 w-24 text-center font-medium text-fg`},z={class:`px-3 py-2 w-24 text-center font-medium text-fg`},B={class:`divide-y divide-line`},V={class:`px-3 py-1.5`},H={class:`ml-1 text-xs text-muted font-mono`},U={class:`px-3 py-1.5 text-center`},W=[`aria-label`,`checked`,`onChange`],G={class:`px-3 py-1.5 text-center`},K=[`aria-label`,`checked`,`onChange`],se={class:`flex justify-end`},ce={key:0,class:`p-6 text-sm text-muted`},le={key:1,class:`overflow-x-auto`},ue={class:`min-w-full text-sm`},de={class:`bg-surface-alt`},fe={class:`px-4 py-2 text-left font-medium text-fg`},pe={class:`px-4 py-2 text-left font-medium text-fg`},me={class:`px-4 py-2 text-left font-medium text-fg`},he={class:`px-4 py-2 text-left font-medium text-fg`},ge={class:`px-4 py-2 text-left font-medium text-fg`},_e={class:`divide-y divide-line`},ve={class:`px-4 py-2 font-medium text-fg`},ye={class:`px-4 py-2 text-fg`},be={class:`cursor-pointer`},xe={class:`mt-1 space-y-0.5`},Se={class:`px-4 py-2 text-fg`},Ce={class:`text-xs text-muted`},we={class:`px-4 py-2 text-fg`},Te={class:`px-4 py-2 text-fg`},Ee={key:0,class:`font-medium`},q={class:`px-4 py-2 text-right`},De={class:`text-muted`},J={__name:`ApiTokensManager`,props:{tokens:{type:Array,required:!0},modules:{type:Array,required:!0},plainToken:{type:String,default:null},docsUrl:{type:String,required:!0},openApiUrl:{type:String,required:!0}},setup(o){let g=o,J=u({name:``,abilities:[],expires_at:``}),Y=l(!1),X=l(null),Z=e=>J.abilities.includes(e),Q=(e,t)=>{let n=`${e}:${t}`,r=new Set(J.abilities);r.has(n)?(r.delete(n),t===`read`&&r.delete(`${e}:write`)):(r.add(n),t===`write`&&r.add(`${e}:read`)),J.abilities=[...r]},$=e=>{let t=new Set(J.abilities);for(let n of g.modules)t.add(`${n.key}:read`),e===`write`&&n.writable&&t.add(`${n.key}:write`);J.abilities=[...t]},Oe=()=>{J.post(route(`admin.api-tokens.store`),{onSuccess:()=>J.reset()})},ke=async()=>{await navigator.clipboard.writeText(g.plainToken),Y.value=!0},Ae=()=>{te.delete(route(`admin.api-tokens.destroy`,X.value.id),{preserveScroll:!0,onFinish:()=>{X.value=null}})},je=e=>{let[t,n]=e.split(`:`),r=g.modules.find(e=>e.key===t);return ne(n===`write`?`account.api_tokens.ability_write`:`account.api_tokens.ability_read`,{module:r?r.label:t})};return(l,u)=>(r(),m(`div`,ie,[o.plainToken?(r(),m(`div`,ae,[h(`p`,oe,f(l.$t(`account.api_tokens.plain_notice`)),1),h(`div`,y,[h(`code`,b,f(o.plainToken),1),t(_,{variant:`outline`,onClick:ke},{default:c(()=>[s(f(Y.value?l.$t(`common.copied`):l.$t(`common.copy`)),1)]),_:1})])])):e(``,!0),t(v,{title:l.$t(`account.api_tokens.docs_title`),subtitle:l.$t(`account.api_tokens.docs_subtitle`)},{default:c(()=>[h(`ul`,x,[h(`li`,null,[s(f(l.$t(`account.api_tokens.docs_page`))+` `,1),h(`a`,{href:o.docsUrl,target:`_blank`,class:`text-accent-hover underline break-all`},f(o.docsUrl),9,S)]),h(`li`,null,[s(f(l.$t(`account.api_tokens.openapi_schema`))+` `,1),h(`a`,{href:o.openApiUrl,target:`_blank`,class:`text-accent-hover underline break-all`},f(o.openApiUrl),9,C)])])]),_:1},8,[`title`,`subtitle`]),t(v,{title:l.$t(`account.api_tokens.create_title`)},{default:c(()=>[h(`form`,{class:`space-y-5`,onSubmit:ee(Oe,[`prevent`])},[h(`div`,w,[h(`div`,null,[h(`label`,T,f(l.$t(`account.api_tokens.name`)),1),n(h(`input`,{id:`token-name`,"onUpdate:modelValue":u[0]||=e=>i(J).name=e,type:`text`,placeholder:l.$t(`account.api_tokens.name_placeholder`),class:`mt-1 block w-full px-3 py-2 border border-field rounded-md shadow-sm focus:outline-none focus:ring-focus focus:border-focus sm:text-sm`},null,8,E),[[d,i(J).name]]),i(J).errors.name?(r(),m(`p`,D,f(i(J).errors.name),1)):e(``,!0)]),h(`div`,null,[h(`label`,O,f(l.$t(`account.api_tokens.expires_at`)),1),n(h(`input`,{id:`token-expires`,"onUpdate:modelValue":u[1]||=e=>i(J).expires_at=e,type:`date`,class:`mt-1 block w-full px-3 py-2 border border-field rounded-md shadow-sm focus:outline-none focus:ring-focus focus:border-focus sm:text-sm`},null,512),[[d,i(J).expires_at]]),i(J).errors.expires_at?(r(),m(`p`,k,f(i(J).errors.expires_at),1)):e(``,!0)])]),h(`div`,null,[h(`div`,A,[h(`span`,j,f(l.$t(`account.api_tokens.abilities`)),1),h(`div`,M,[t(_,{type:`button`,size:`sm`,variant:`outline`,onClick:u[2]||=e=>$(`read`)},{default:c(()=>[s(f(l.$t(`account.api_tokens.select_read_all`)),1)]),_:1}),t(_,{type:`button`,size:`sm`,variant:`outline`,onClick:u[3]||=e=>$(`write`)},{default:c(()=>[s(f(l.$t(`account.api_tokens.select_all`)),1)]),_:1}),t(_,{type:`button`,size:`sm`,variant:`outline`,onClick:u[4]||=e=>i(J).abilities=[]},{default:c(()=>[s(f(l.$t(`account.api_tokens.clear`)),1)]),_:1})])]),i(J).errors.abilities?(r(),m(`p`,N,f(i(J).errors.abilities),1)):e(``,!0),h(`div`,P,[h(`table`,F,[h(`thead`,I,[h(`tr`,null,[h(`th`,L,f(l.$t(`account.api_tokens.module`)),1),h(`th`,R,f(l.$t(`account.api_tokens.read`)),1),h(`th`,z,f(l.$t(`account.api_tokens.write`)),1)])]),h(`tbody`,B,[(r(!0),m(p,null,a(o.modules,t=>(r(),m(`tr`,{key:t.key},[h(`td`,V,[s(f(t.label)+` `,1),h(`span`,H,f(t.key),1)]),h(`td`,U,[h(`input`,{type:`checkbox`,class:`h-4 w-4`,"aria-label":l.$t(`account.api_tokens.ability_read`,{module:t.label}),checked:Z(`${t.key}:read`),onChange:e=>Q(t.key,`read`)},null,40,W)]),h(`td`,G,[t.writable?(r(),m(`input`,{key:0,type:`checkbox`,class:`h-4 w-4`,"aria-label":l.$t(`account.api_tokens.ability_write`,{module:t.label}),checked:Z(`${t.key}:write`),onChange:e=>Q(t.key,`write`)},null,40,K)):e(``,!0)])]))),128))])])])]),h(`div`,se,[t(_,{type:`submit`,loading:i(J).processing,disabled:i(J).processing},{default:c(()=>[s(f(l.$t(`account.api_tokens.submit`)),1)]),_:1},8,[`loading`,`disabled`])])],32)]),_:1},8,[`title`]),t(v,{title:l.$t(`account.api_tokens.list_title`),"no-padding":``},{default:c(()=>[o.tokens.length===0?(r(),m(`p`,ce,f(l.$t(`account.api_tokens.empty`)),1)):(r(),m(`div`,le,[h(`table`,ue,[h(`thead`,de,[h(`tr`,null,[h(`th`,fe,f(l.$t(`account.api_tokens.name`)),1),h(`th`,pe,f(l.$t(`account.api_tokens.abilities`)),1),h(`th`,me,f(l.$t(`account.api_tokens.owner`)),1),h(`th`,he,f(l.$t(`account.api_tokens.last_used`)),1),h(`th`,ge,f(l.$t(`account.api_tokens.expiry`)),1),u[7]||=h(`th`,{class:`px-4 py-2`},null,-1)])]),h(`tbody`,_e,[(r(!0),m(p,null,a(o.tokens,n=>(r(),m(`tr`,{key:n.id,"data-api-token-row":``},[h(`td`,ve,f(n.name),1),h(`td`,ye,[h(`details`,null,[h(`summary`,be,f(l.$tc(`account.api_tokens.abilities_count`,n.abilities.length)),1),h(`ul`,xe,[(r(!0),m(p,null,a(n.abilities,e=>(r(),m(`li`,{key:e},f(je(e)),1))),128))])])]),h(`td`,Se,[s(f(n.owner),1),h(`div`,Ce,f(n.created_at),1)]),h(`td`,we,f(n.last_used_at||l.$t(`account.api_tokens.never_used`)),1),h(`td`,Te,[n.expires_at?(r(),m(p,{key:0},[s(f(l.$t(`account.api_tokens.until`,{date:n.expires_at})),1),n.expired?(r(),m(`span`,Ee,f(l.$t(`account.api_tokens.expired`)),1)):e(``,!0)],64)):(r(),m(p,{key:1},[s(f(l.$t(`account.api_tokens.no_expiry`)),1)],64))]),h(`td`,q,[t(_,{size:`sm`,variant:`danger`,onClick:e=>X.value=n},{default:c(()=>[s(f(l.$t(`account.api_tokens.revoke`)),1)]),_:1},8,[`onClick`])])]))),128))])])]))]),_:1},8,[`title`]),t(re,{show:X.value!==null,title:l.$t(`account.api_tokens.revoke_title`),onClose:u[6]||=e=>X.value=null},{footer:c(()=>[t(_,{variant:`secondary`,onClick:u[5]||=e=>X.value=null},{default:c(()=>[s(f(l.$t(`common.cancel`)),1)]),_:1}),t(_,{variant:`danger`,onClick:Ae},{default:c(()=>[s(f(l.$t(`account.api_tokens.revoke`)),1)]),_:1})]),default:c(()=>[h(`p`,De,[s(f(l.$t(`account.api_tokens.revoke_confirm_before`))+` `,1),h(`strong`,null,f(X.value?.name),1),s(` `+f(l.$t(`account.api_tokens.revoke_confirm_after`)),1)])]),_:1},8,[`show`,`title`])]))}},Y={class:`mb-6`},X={class:`text-2xl font-bold text-fg`},Z={class:`mt-1 text-sm text-muted`},Q={__name:`Index`,props:{tokens:Array,modules:Array,plainToken:String,docsUrl:String,openApiUrl:String},setup(e){return(n,i)=>(r(),o(g,{title:n.$t(`menu.api_tokens`)},{default:c(()=>[h(`div`,Y,[h(`h1`,X,f(n.$t(`menu.api_tokens`)),1),h(`p`,Z,f(n.$t(`account.api_tokens.subtitle`)),1)]),t(J,{tokens:e.tokens,modules:e.modules,"plain-token":e.plainToken,"docs-url":e.docsUrl,"open-api-url":e.openApiUrl},null,8,[`tokens`,`modules`,`plain-token`,`docs-url`,`open-api-url`])]),_:1},8,[`title`]))}};export{Q as default};
\ No newline at end of file
+import{C as e,E as t,G as n,I as r,Q as i,R as a,S as o,T as s,W as c,X as l,_ as ee,a as u,m as d,s as te,tt as f,v as p,w as m,x as h}from"./dist-Bie52OmN.js";import{t as g}from"./AdminLayout-D_QE0gy-.js";import{n as ne}from"./app-Cdw8k5No.js";import{t as _}from"./AdminButton-KiIJ2sLW.js";import{t as v}from"./AdminCard-YbEwPtJz.js";import{t as re}from"./AdminModal-DKazeNNa.js";var ie={class:`space-y-6`},ae={key:0,"data-api-token-plain":``,class:`p-4 bg-warning-soft border-2 border-warning-soft-fg rounded-lg`},oe={class:`font-medium text-fg`},y={class:`mt-3 flex flex-col sm:flex-row gap-2`},b={class:`flex-1 px-3 py-2 bg-surface border border-field rounded font-mono text-sm break-all`},x={class:`space-y-1 text-sm`},S=[`href`],C=[`href`],w={class:`grid gap-4 sm:grid-cols-2`},T={for:`token-name`,class:`block text-sm font-medium text-fg`},E=[`placeholder`],D={key:0,class:`mt-1 text-sm text-danger`},O={for:`token-expires`,class:`block text-sm font-medium text-fg`},k={key:0,class:`mt-1 text-sm text-danger`},A={class:`flex flex-wrap items-center justify-between gap-2`},j={class:`text-sm font-medium text-fg`},M={class:`flex gap-2`},N={key:0,class:`mt-1 text-sm text-danger`},P={class:`mt-2 max-h-96 overflow-y-auto border border-line rounded-md`},F={class:`min-w-full text-sm`},I={class:`bg-surface-alt sticky top-0`},L={class:`px-3 py-2 text-left font-medium text-fg`},R={class:`px-3 py-2 w-24 text-center font-medium text-fg`},z={class:`px-3 py-2 w-24 text-center font-medium text-fg`},B={class:`divide-y divide-line`},V={class:`px-3 py-1.5`},H={class:`ml-1 text-xs text-muted font-mono`},U={class:`px-3 py-1.5 text-center`},W=[`aria-label`,`checked`,`onChange`],G={class:`px-3 py-1.5 text-center`},K=[`aria-label`,`checked`,`onChange`],se={class:`flex justify-end`},ce={key:0,class:`p-6 text-sm text-muted`},le={key:1,class:`overflow-x-auto`},ue={class:`min-w-full text-sm`},de={class:`bg-surface-alt`},fe={class:`px-4 py-2 text-left font-medium text-fg`},pe={class:`px-4 py-2 text-left font-medium text-fg`},me={class:`px-4 py-2 text-left font-medium text-fg`},he={class:`px-4 py-2 text-left font-medium text-fg`},ge={class:`px-4 py-2 text-left font-medium text-fg`},_e={class:`divide-y divide-line`},ve={class:`px-4 py-2 font-medium text-fg`},ye={class:`px-4 py-2 text-fg`},be={class:`cursor-pointer`},xe={class:`mt-1 space-y-0.5`},Se={class:`px-4 py-2 text-fg`},Ce={class:`text-xs text-muted`},we={class:`px-4 py-2 text-fg`},Te={class:`px-4 py-2 text-fg`},Ee={key:0,class:`font-medium`},q={class:`px-4 py-2 text-right`},De={class:`text-muted`},J={__name:`ApiTokensManager`,props:{tokens:{type:Array,required:!0},modules:{type:Array,required:!0},plainToken:{type:String,default:null},docsUrl:{type:String,required:!0},openApiUrl:{type:String,required:!0}},setup(o){let g=o,J=u({name:``,abilities:[],expires_at:``}),Y=l(!1),X=l(null),Z=e=>J.abilities.includes(e),Q=(e,t)=>{let n=`${e}:${t}`,r=new Set(J.abilities);r.has(n)?(r.delete(n),t===`read`&&r.delete(`${e}:write`)):(r.add(n),t===`write`&&r.add(`${e}:read`)),J.abilities=[...r]},$=e=>{let t=new Set(J.abilities);for(let n of g.modules)t.add(`${n.key}:read`),e===`write`&&n.writable&&t.add(`${n.key}:write`);J.abilities=[...t]},Oe=()=>{J.post(route(`admin.api-tokens.store`),{onSuccess:()=>J.reset()})},ke=async()=>{await navigator.clipboard.writeText(g.plainToken),Y.value=!0},Ae=()=>{te.delete(route(`admin.api-tokens.destroy`,X.value.id),{preserveScroll:!0,onFinish:()=>{X.value=null}})},je=e=>{let[t,n]=e.split(`:`),r=g.modules.find(e=>e.key===t);return ne(n===`write`?`account.api_tokens.ability_write`:`account.api_tokens.ability_read`,{module:r?r.label:t})};return(l,u)=>(r(),m(`div`,ie,[o.plainToken?(r(),m(`div`,ae,[h(`p`,oe,f(l.$t(`account.api_tokens.plain_notice`)),1),h(`div`,y,[h(`code`,b,f(o.plainToken),1),t(_,{variant:`outline`,onClick:ke},{default:c(()=>[s(f(Y.value?l.$t(`common.copied`):l.$t(`common.copy`)),1)]),_:1})])])):e(``,!0),t(v,{title:l.$t(`account.api_tokens.docs_title`),subtitle:l.$t(`account.api_tokens.docs_subtitle`)},{default:c(()=>[h(`ul`,x,[h(`li`,null,[s(f(l.$t(`account.api_tokens.docs_page`))+` `,1),h(`a`,{href:o.docsUrl,target:`_blank`,class:`text-accent-hover underline break-all`},f(o.docsUrl),9,S)]),h(`li`,null,[s(f(l.$t(`account.api_tokens.openapi_schema`))+` `,1),h(`a`,{href:o.openApiUrl,target:`_blank`,class:`text-accent-hover underline break-all`},f(o.openApiUrl),9,C)])])]),_:1},8,[`title`,`subtitle`]),t(v,{title:l.$t(`account.api_tokens.create_title`)},{default:c(()=>[h(`form`,{class:`space-y-5`,onSubmit:ee(Oe,[`prevent`])},[h(`div`,w,[h(`div`,null,[h(`label`,T,f(l.$t(`account.api_tokens.name`)),1),n(h(`input`,{id:`token-name`,"onUpdate:modelValue":u[0]||=e=>i(J).name=e,type:`text`,placeholder:l.$t(`account.api_tokens.name_placeholder`),class:`mt-1 block w-full px-3 py-2 border border-field rounded-md shadow-sm focus:outline-none focus:ring-focus focus:border-focus sm:text-sm`},null,8,E),[[d,i(J).name]]),i(J).errors.name?(r(),m(`p`,D,f(i(J).errors.name),1)):e(``,!0)]),h(`div`,null,[h(`label`,O,f(l.$t(`account.api_tokens.expires_at`)),1),n(h(`input`,{id:`token-expires`,"onUpdate:modelValue":u[1]||=e=>i(J).expires_at=e,type:`date`,class:`mt-1 block w-full px-3 py-2 border border-field rounded-md shadow-sm focus:outline-none focus:ring-focus focus:border-focus sm:text-sm`},null,512),[[d,i(J).expires_at]]),i(J).errors.expires_at?(r(),m(`p`,k,f(i(J).errors.expires_at),1)):e(``,!0)])]),h(`div`,null,[h(`div`,A,[h(`span`,j,f(l.$t(`account.api_tokens.abilities`)),1),h(`div`,M,[t(_,{type:`button`,size:`sm`,variant:`outline`,onClick:u[2]||=e=>$(`read`)},{default:c(()=>[s(f(l.$t(`account.api_tokens.select_read_all`)),1)]),_:1}),t(_,{type:`button`,size:`sm`,variant:`outline`,onClick:u[3]||=e=>$(`write`)},{default:c(()=>[s(f(l.$t(`account.api_tokens.select_all`)),1)]),_:1}),t(_,{type:`button`,size:`sm`,variant:`outline`,onClick:u[4]||=e=>i(J).abilities=[]},{default:c(()=>[s(f(l.$t(`account.api_tokens.clear`)),1)]),_:1})])]),i(J).errors.abilities?(r(),m(`p`,N,f(i(J).errors.abilities),1)):e(``,!0),h(`div`,P,[h(`table`,F,[h(`thead`,I,[h(`tr`,null,[h(`th`,L,f(l.$t(`account.api_tokens.module`)),1),h(`th`,R,f(l.$t(`account.api_tokens.read`)),1),h(`th`,z,f(l.$t(`account.api_tokens.write`)),1)])]),h(`tbody`,B,[(r(!0),m(p,null,a(o.modules,t=>(r(),m(`tr`,{key:t.key},[h(`td`,V,[s(f(t.label)+` `,1),h(`span`,H,f(t.key),1)]),h(`td`,U,[h(`input`,{type:`checkbox`,class:`h-4 w-4`,"aria-label":l.$t(`account.api_tokens.ability_read`,{module:t.label}),checked:Z(`${t.key}:read`),onChange:e=>Q(t.key,`read`)},null,40,W)]),h(`td`,G,[t.writable?(r(),m(`input`,{key:0,type:`checkbox`,class:`h-4 w-4`,"aria-label":l.$t(`account.api_tokens.ability_write`,{module:t.label}),checked:Z(`${t.key}:write`),onChange:e=>Q(t.key,`write`)},null,40,K)):e(``,!0)])]))),128))])])])]),h(`div`,se,[t(_,{type:`submit`,loading:i(J).processing,disabled:i(J).processing},{default:c(()=>[s(f(l.$t(`account.api_tokens.submit`)),1)]),_:1},8,[`loading`,`disabled`])])],32)]),_:1},8,[`title`]),t(v,{title:l.$t(`account.api_tokens.list_title`),"no-padding":``},{default:c(()=>[o.tokens.length===0?(r(),m(`p`,ce,f(l.$t(`account.api_tokens.empty`)),1)):(r(),m(`div`,le,[h(`table`,ue,[h(`thead`,de,[h(`tr`,null,[h(`th`,fe,f(l.$t(`account.api_tokens.name`)),1),h(`th`,pe,f(l.$t(`account.api_tokens.abilities`)),1),h(`th`,me,f(l.$t(`account.api_tokens.owner`)),1),h(`th`,he,f(l.$t(`account.api_tokens.last_used`)),1),h(`th`,ge,f(l.$t(`account.api_tokens.expiry`)),1),u[7]||=h(`th`,{class:`px-4 py-2`},null,-1)])]),h(`tbody`,_e,[(r(!0),m(p,null,a(o.tokens,n=>(r(),m(`tr`,{key:n.id,"data-api-token-row":``},[h(`td`,ve,f(n.name),1),h(`td`,ye,[h(`details`,null,[h(`summary`,be,f(l.$tc(`account.api_tokens.abilities_count`,n.abilities.length)),1),h(`ul`,xe,[(r(!0),m(p,null,a(n.abilities,e=>(r(),m(`li`,{key:e},f(je(e)),1))),128))])])]),h(`td`,Se,[s(f(n.owner),1),h(`div`,Ce,f(n.created_at),1)]),h(`td`,we,f(n.last_used_at||l.$t(`account.api_tokens.never_used`)),1),h(`td`,Te,[n.expires_at?(r(),m(p,{key:0},[s(f(l.$t(`account.api_tokens.until`,{date:n.expires_at})),1),n.expired?(r(),m(`span`,Ee,f(l.$t(`account.api_tokens.expired`)),1)):e(``,!0)],64)):(r(),m(p,{key:1},[s(f(l.$t(`account.api_tokens.no_expiry`)),1)],64))]),h(`td`,q,[t(_,{size:`sm`,variant:`danger`,onClick:e=>X.value=n},{default:c(()=>[s(f(l.$t(`account.api_tokens.revoke`)),1)]),_:1},8,[`onClick`])])]))),128))])])]))]),_:1},8,[`title`]),t(re,{show:X.value!==null,title:l.$t(`account.api_tokens.revoke_title`),onClose:u[6]||=e=>X.value=null},{footer:c(()=>[t(_,{variant:`secondary`,onClick:u[5]||=e=>X.value=null},{default:c(()=>[s(f(l.$t(`common.cancel`)),1)]),_:1}),t(_,{variant:`danger`,onClick:Ae},{default:c(()=>[s(f(l.$t(`account.api_tokens.revoke`)),1)]),_:1})]),default:c(()=>[h(`p`,De,[s(f(l.$t(`account.api_tokens.revoke_confirm_before`))+` `,1),h(`strong`,null,f(X.value?.name),1),s(` `+f(l.$t(`account.api_tokens.revoke_confirm_after`)),1)])]),_:1},8,[`show`,`title`])]))}},Y={class:`mb-6`},X={class:`text-2xl font-bold text-fg`},Z={class:`mt-1 text-sm text-muted`},Q={__name:`Index`,props:{tokens:Array,modules:Array,plainToken:String,docsUrl:String,openApiUrl:String},setup(e){return(n,i)=>(r(),o(g,{title:n.$t(`menu.api_tokens`)},{default:c(()=>[h(`div`,Y,[h(`h1`,X,f(n.$t(`menu.api_tokens`)),1),h(`p`,Z,f(n.$t(`account.api_tokens.subtitle`)),1)]),t(J,{tokens:e.tokens,modules:e.modules,"plain-token":e.plainToken,"docs-url":e.docsUrl,"open-api-url":e.openApiUrl},null,8,[`tokens`,`modules`,`plain-token`,`docs-url`,`open-api-url`])]),_:1},8,[`title`]))}};export{Q as default};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/Index-C63EL5RF.js b/packages/admin/dist/assets/Index-ClSNZWUj.js
similarity index 97%
rename from packages/admin/dist/assets/Index-C63EL5RF.js
rename to packages/admin/dist/assets/Index-ClSNZWUj.js
index 41f94c42..3b84b501 100644
--- a/packages/admin/dist/assets/Index-C63EL5RF.js
+++ b/packages/admin/dist/assets/Index-ClSNZWUj.js
@@ -1 +1 @@
-import{C as e,E as t,G as n,I as r,S as i,T as a,W as o,X as s,g as c,m as l,s as u,tt as d,w as f,x as p}from"./dist-Bie52OmN.js";import{t as m}from"./AdminLayout-DBeSErmz.js";import{t as h}from"./AdminButton-KiIJ2sLW.js";import{t as g}from"./AdminDataTable-6eKgKDeA.js";import{t as _}from"./AdminModal-DKazeNNa.js";var v={class:`mb-6 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4`},y={class:`text-2xl font-bold text-fg`},b={class:`mt-1 text-sm text-muted`},x={class:`mb-6`},S={class:`flex gap-4`},C={class:`flex-1 max-w-md`},w=[`placeholder`],T={class:`text-muted`},E={key:0},D={class:`mt-2 text-sm text-danger`},O={__name:`Index`,props:{items:Object,columns:Array,filters:Object,title:String,can:{type:Object,default:()=>({})}},setup(O){let k=O,A=s(k.filters.search||``),j=s(!1),M=s(null),N=()=>{u.get(route(`admin.users.index`),{search:A.value},{preserveState:!0,preserveScroll:!0})},P=({column:e,direction:t})=>{u.get(route(`admin.users.index`),{...k.filters,sort:e,direction:t},{preserveState:!0,preserveScroll:!0})},F=e=>{u.visit(route(`admin.users.edit`,e.id))},I=e=>{M.value=e,j.value=!0},L=()=>{M.value&&u.delete(route(`admin.users.destroy`,M.value.id),{onSuccess:()=>{j.value=!1,M.value=null}})};return(s,u)=>(r(),i(m,{title:O.title},{default:o(()=>[p(`div`,v,[p(`div`,null,[p(`h1`,y,d(O.title),1),p(`p`,b,d(s.$t(`account.users.total`,{count:O.items.total})),1)]),O.can.create===!1?e(``,!0):(r(),i(h,{key:0,"data-action":`create`,href:s.route(`admin.users.create`)},{default:o(()=>[u[3]||=p(`svg`,{class:`w-4 h-4 mr-2`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[p(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 4v16m8-8H4`})],-1),a(` `+d(s.$t(`common.create`)),1)]),_:1},8,[`href`]))]),p(`div`,x,[p(`div`,S,[p(`div`,C,[n(p(`input`,{"onUpdate:modelValue":u[0]||=e=>A.value=e,type:`text`,placeholder:s.$t(`account.users.search_placeholder`),class:`w-full px-4 py-2 border border-field rounded-lg focus:ring-focus focus:border-focus`,onKeyup:c(N,[`enter`])},null,40,w),[[l,A.value]])]),t(h,{onClick:N,variant:`secondary`},{default:o(()=>[a(d(s.$t(`common.search`)),1)]),_:1})])]),t(g,{columns:O.columns,items:O.items,"sort-by":O.filters.sort,"sort-direction":O.filters.direction,"can-delete":O.can.delete!==!1,onSort:P,onEdit:F,onDelete:I},null,8,[`columns`,`items`,`sort-by`,`sort-direction`,`can-delete`]),t(_,{show:j.value,title:s.$t(`account.users.delete_title`),onClose:u[2]||=e=>j.value=!1},{footer:o(()=>[t(h,{variant:`secondary`,onClick:u[1]||=e=>j.value=!1},{default:o(()=>[a(d(s.$t(`common.cancel`)),1)]),_:1}),t(h,{variant:`danger`,onClick:L},{default:o(()=>[a(d(s.$t(`common.delete`)),1)]),_:1})]),default:o(()=>[p(`p`,T,[a(d(s.$t(`account.users.delete_confirm`))+` `,1),M.value?(r(),f(`strong`,E,d(M.value.name),1)):e(``,!0)]),p(`p`,D,d(s.$t(`account.users.delete_irreversible`)),1)]),_:1},8,[`show`,`title`])]),_:1},8,[`title`]))}};export{O as default};
\ No newline at end of file
+import{C as e,E as t,G as n,I as r,S as i,T as a,W as o,X as s,g as c,m as l,s as u,tt as d,w as f,x as p}from"./dist-Bie52OmN.js";import{t as m}from"./AdminLayout-D_QE0gy-.js";import{t as h}from"./AdminButton-KiIJ2sLW.js";import{t as g}from"./AdminDataTable-6eKgKDeA.js";import{t as _}from"./AdminModal-DKazeNNa.js";var v={class:`mb-6 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4`},y={class:`text-2xl font-bold text-fg`},b={class:`mt-1 text-sm text-muted`},x={class:`mb-6`},S={class:`flex gap-4`},C={class:`flex-1 max-w-md`},w=[`placeholder`],T={class:`text-muted`},E={key:0},D={class:`mt-2 text-sm text-danger`},O={__name:`Index`,props:{items:Object,columns:Array,filters:Object,title:String,can:{type:Object,default:()=>({})}},setup(O){let k=O,A=s(k.filters.search||``),j=s(!1),M=s(null),N=()=>{u.get(route(`admin.users.index`),{search:A.value},{preserveState:!0,preserveScroll:!0})},P=({column:e,direction:t})=>{u.get(route(`admin.users.index`),{...k.filters,sort:e,direction:t},{preserveState:!0,preserveScroll:!0})},F=e=>{u.visit(route(`admin.users.edit`,e.id))},I=e=>{M.value=e,j.value=!0},L=()=>{M.value&&u.delete(route(`admin.users.destroy`,M.value.id),{onSuccess:()=>{j.value=!1,M.value=null}})};return(s,u)=>(r(),i(m,{title:O.title},{default:o(()=>[p(`div`,v,[p(`div`,null,[p(`h1`,y,d(O.title),1),p(`p`,b,d(s.$t(`account.users.total`,{count:O.items.total})),1)]),O.can.create===!1?e(``,!0):(r(),i(h,{key:0,"data-action":`create`,href:s.route(`admin.users.create`)},{default:o(()=>[u[3]||=p(`svg`,{class:`w-4 h-4 mr-2`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[p(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 4v16m8-8H4`})],-1),a(` `+d(s.$t(`common.create`)),1)]),_:1},8,[`href`]))]),p(`div`,x,[p(`div`,S,[p(`div`,C,[n(p(`input`,{"onUpdate:modelValue":u[0]||=e=>A.value=e,type:`text`,placeholder:s.$t(`account.users.search_placeholder`),class:`w-full px-4 py-2 border border-field rounded-lg focus:ring-focus focus:border-focus`,onKeyup:c(N,[`enter`])},null,40,w),[[l,A.value]])]),t(h,{onClick:N,variant:`secondary`},{default:o(()=>[a(d(s.$t(`common.search`)),1)]),_:1})])]),t(g,{columns:O.columns,items:O.items,"sort-by":O.filters.sort,"sort-direction":O.filters.direction,"can-delete":O.can.delete!==!1,onSort:P,onEdit:F,onDelete:I},null,8,[`columns`,`items`,`sort-by`,`sort-direction`,`can-delete`]),t(_,{show:j.value,title:s.$t(`account.users.delete_title`),onClose:u[2]||=e=>j.value=!1},{footer:o(()=>[t(h,{variant:`secondary`,onClick:u[1]||=e=>j.value=!1},{default:o(()=>[a(d(s.$t(`common.cancel`)),1)]),_:1}),t(h,{variant:`danger`,onClick:L},{default:o(()=>[a(d(s.$t(`common.delete`)),1)]),_:1})]),default:o(()=>[p(`p`,T,[a(d(s.$t(`account.users.delete_confirm`))+` `,1),M.value?(r(),f(`strong`,E,d(M.value.name),1)):e(``,!0)]),p(`p`,D,d(s.$t(`account.users.delete_irreversible`)),1)]),_:1},8,[`show`,`title`])]),_:1},8,[`title`]))}};export{O as default};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/Index-BNmU5PEL.js b/packages/admin/dist/assets/Index-CrHgEVrS.js
similarity index 97%
rename from packages/admin/dist/assets/Index-BNmU5PEL.js
rename to packages/admin/dist/assets/Index-CrHgEVrS.js
index 2b4c28ab..cd86b36c 100644
--- a/packages/admin/dist/assets/Index-BNmU5PEL.js
+++ b/packages/admin/dist/assets/Index-CrHgEVrS.js
@@ -1 +1 @@
-import{E as e,I as t,R as n,S as r,T as i,W as a,X as o,s,tt as c,v as l,w as u,x as d}from"./dist-Bie52OmN.js";import{t as f}from"./AdminLayout-DBeSErmz.js";import{t as p}from"./AdminButton-KiIJ2sLW.js";import{t as m}from"./AdminModal-DKazeNNa.js";var h={class:`mb-6 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4`},g={"data-page-title":`admin.roles`,class:`text-2xl font-bold text-fg`},_={class:`mt-1 text-sm text-muted`},v={class:`bg-surface rounded-lg shadow overflow-hidden`},y={key:0,class:`p-6 text-sm text-muted`},b={key:1,class:`min-w-full text-sm`},x={class:`bg-surface-alt`},S={class:`px-4 py-2 text-left font-medium text-fg`},C={class:`px-4 py-2 text-left font-medium text-fg`},w={class:`px-4 py-2 text-left font-medium text-fg`},T={class:`divide-y divide-line`},E={class:`px-4 py-2 font-medium text-fg`},D={class:`px-4 py-2 text-fg`},O={class:`px-4 py-2 text-fg`},k={class:`px-4 py-2 text-right whitespace-nowrap`},A={class:`text-muted`},j={__name:`Index`,props:{roles:Array,title:String},setup(j){let M=o(null),N=()=>{s.delete(route(`admin.roles.destroy`,M.value.id),{preserveScroll:!0,onFinish:()=>{M.value=null}})};return(o,s)=>(t(),r(f,{title:j.title},{default:a(()=>[d(`div`,h,[d(`div`,null,[d(`h1`,g,c(j.title),1),d(`p`,_,c(o.$t(`permissions.index_hint`)),1)]),e(p,{"data-action":`create`,href:o.route(`admin.roles.create`)},{default:a(()=>[s[2]||=d(`svg`,{class:`w-4 h-4 mr-2`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 4v16m8-8H4`})],-1),i(` `+c(o.$t(`common.create`)),1)]),_:1},8,[`href`])]),d(`div`,v,[j.roles.length===0?(t(),u(`p`,y,c(o.$t(`permissions.empty`)),1)):(t(),u(`table`,b,[d(`thead`,x,[d(`tr`,null,[d(`th`,S,c(o.$t(`permissions.name`)),1),d(`th`,C,c(o.$t(`permissions.permissions_count`)),1),d(`th`,w,c(o.$t(`permissions.users_count`)),1),s[3]||=d(`th`,{class:`px-4 py-2`},null,-1)])]),d(`tbody`,T,[(t(!0),u(l,null,n(j.roles,n=>(t(),u(`tr`,{key:n.id,"data-role-row":``},[d(`td`,E,c(n.name),1),d(`td`,D,c(n.permissions_count),1),d(`td`,O,c(n.users_count),1),d(`td`,k,[e(p,{size:`sm`,variant:`outline`,"data-action":`edit`,href:o.route(`admin.roles.edit`,n.id)},{default:a(()=>[i(c(o.$t(`common.edit`)),1)]),_:1},8,[`href`]),e(p,{size:`sm`,variant:`danger`,"data-action":`delete`,class:`ml-2`,onClick:e=>M.value=n},{default:a(()=>[i(c(o.$t(`common.delete`)),1)]),_:1},8,[`onClick`])])]))),128))])]))]),e(m,{show:M.value!==null,title:o.$t(`permissions.delete_title`),onClose:s[1]||=e=>M.value=null},{footer:a(()=>[e(p,{variant:`secondary`,onClick:s[0]||=e=>M.value=null},{default:a(()=>[i(c(o.$t(`common.cancel`)),1)]),_:1}),e(p,{variant:`danger`,"data-action":`delete-confirm`,onClick:N},{default:a(()=>[i(c(o.$t(`common.delete`)),1)]),_:1})]),default:a(()=>[d(`p`,A,[d(`strong`,null,c(M.value?.name),1),i(` — `+c(o.$t(`permissions.delete_confirm`)),1)])]),_:1},8,[`show`,`title`])]),_:1},8,[`title`]))}};export{j as default};
\ No newline at end of file
+import{E as e,I as t,R as n,S as r,T as i,W as a,X as o,s,tt as c,v as l,w as u,x as d}from"./dist-Bie52OmN.js";import{t as f}from"./AdminLayout-D_QE0gy-.js";import{t as p}from"./AdminButton-KiIJ2sLW.js";import{t as m}from"./AdminModal-DKazeNNa.js";var h={class:`mb-6 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4`},g={"data-page-title":`admin.roles`,class:`text-2xl font-bold text-fg`},_={class:`mt-1 text-sm text-muted`},v={class:`bg-surface rounded-lg shadow overflow-hidden`},y={key:0,class:`p-6 text-sm text-muted`},b={key:1,class:`min-w-full text-sm`},x={class:`bg-surface-alt`},S={class:`px-4 py-2 text-left font-medium text-fg`},C={class:`px-4 py-2 text-left font-medium text-fg`},w={class:`px-4 py-2 text-left font-medium text-fg`},T={class:`divide-y divide-line`},E={class:`px-4 py-2 font-medium text-fg`},D={class:`px-4 py-2 text-fg`},O={class:`px-4 py-2 text-fg`},k={class:`px-4 py-2 text-right whitespace-nowrap`},A={class:`text-muted`},j={__name:`Index`,props:{roles:Array,title:String},setup(j){let M=o(null),N=()=>{s.delete(route(`admin.roles.destroy`,M.value.id),{preserveScroll:!0,onFinish:()=>{M.value=null}})};return(o,s)=>(t(),r(f,{title:j.title},{default:a(()=>[d(`div`,h,[d(`div`,null,[d(`h1`,g,c(j.title),1),d(`p`,_,c(o.$t(`permissions.index_hint`)),1)]),e(p,{"data-action":`create`,href:o.route(`admin.roles.create`)},{default:a(()=>[s[2]||=d(`svg`,{class:`w-4 h-4 mr-2`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 4v16m8-8H4`})],-1),i(` `+c(o.$t(`common.create`)),1)]),_:1},8,[`href`])]),d(`div`,v,[j.roles.length===0?(t(),u(`p`,y,c(o.$t(`permissions.empty`)),1)):(t(),u(`table`,b,[d(`thead`,x,[d(`tr`,null,[d(`th`,S,c(o.$t(`permissions.name`)),1),d(`th`,C,c(o.$t(`permissions.permissions_count`)),1),d(`th`,w,c(o.$t(`permissions.users_count`)),1),s[3]||=d(`th`,{class:`px-4 py-2`},null,-1)])]),d(`tbody`,T,[(t(!0),u(l,null,n(j.roles,n=>(t(),u(`tr`,{key:n.id,"data-role-row":``},[d(`td`,E,c(n.name),1),d(`td`,D,c(n.permissions_count),1),d(`td`,O,c(n.users_count),1),d(`td`,k,[e(p,{size:`sm`,variant:`outline`,"data-action":`edit`,href:o.route(`admin.roles.edit`,n.id)},{default:a(()=>[i(c(o.$t(`common.edit`)),1)]),_:1},8,[`href`]),e(p,{size:`sm`,variant:`danger`,"data-action":`delete`,class:`ml-2`,onClick:e=>M.value=n},{default:a(()=>[i(c(o.$t(`common.delete`)),1)]),_:1},8,[`onClick`])])]))),128))])]))]),e(m,{show:M.value!==null,title:o.$t(`permissions.delete_title`),onClose:s[1]||=e=>M.value=null},{footer:a(()=>[e(p,{variant:`secondary`,onClick:s[0]||=e=>M.value=null},{default:a(()=>[i(c(o.$t(`common.cancel`)),1)]),_:1}),e(p,{variant:`danger`,"data-action":`delete-confirm`,onClick:N},{default:a(()=>[i(c(o.$t(`common.delete`)),1)]),_:1})]),default:a(()=>[d(`p`,A,[d(`strong`,null,c(M.value?.name),1),i(` — `+c(o.$t(`permissions.delete_confirm`)),1)])]),_:1},8,[`show`,`title`])]),_:1},8,[`title`]))}};export{j as default};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/Index-DaeZ92GY.js b/packages/admin/dist/assets/Index-DywV1SDR.js
similarity index 96%
rename from packages/admin/dist/assets/Index-DaeZ92GY.js
rename to packages/admin/dist/assets/Index-DywV1SDR.js
index 13f5a18b..b71ad727 100644
--- a/packages/admin/dist/assets/Index-DaeZ92GY.js
+++ b/packages/admin/dist/assets/Index-DywV1SDR.js
@@ -1 +1 @@
-import{C as e,E as t,G as n,I as r,Q as i,R as a,S as o,T as s,W as c,X as l,g as u,m as d,s as f,tt as p,v as m,w as h,x as g}from"./dist-Bie52OmN.js";import{t as _}from"./AdminLayout-DBeSErmz.js";import{t as v}from"./AdminButton-KiIJ2sLW.js";import{t as y}from"./AdminDataTable-6eKgKDeA.js";import{t as b}from"./AdminModal-DKazeNNa.js";import{t as x}from"./recordActions-CtRs42tG.js";var S={class:`mb-6 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4`},C=[`data-page-title`],w={class:`mt-1 text-sm text-muted`},T={class:`flex flex-wrap items-center gap-2`},E={class:`mb-6`},D={class:`flex gap-4`},O={class:`flex-1 max-w-md`},k=[`placeholder`],A={class:`text-muted`},j={__name:`Index`,props:{routeName:String,createLabel:String,items:Object,columns:Array,filters:Object,title:String,can:{type:Object,default:()=>({})},actions:{type:Array,default:()=>[]},links:{type:Array,default:()=>[]}},setup(j){let M=j,N=Object.fromEntries(Object.entries(M.filters||{}).filter(([e])=>![`search`,`sort`,`direction`].includes(e))),P=M.actions.map(e=>({...e,href:t=>x(M.routeName,e,t)})),F=l(M.filters.search||``),I=l(!1),L=l(null),R=()=>{f.get(route(`${M.routeName}.index`),{...N,search:F.value},{preserveState:!0,preserveScroll:!0})},z=({column:e,direction:t})=>{f.get(route(`${M.routeName}.index`),{...M.filters,sort:e,direction:t},{preserveState:!0,preserveScroll:!0})},B=e=>{f.visit(route(`${M.routeName}.edit`,e.id))},V=e=>{L.value=e,I.value=!0},H=()=>{L.value&&f.delete(route(`${M.routeName}.destroy`,L.value.id),{onSuccess:()=>{I.value=!1,L.value=null}})};return(l,f)=>(r(),o(_,{title:j.title},{default:c(()=>[g(`div`,S,[g(`div`,null,[g(`h1`,{"data-page-title":j.routeName,class:`text-2xl font-bold text-fg`},p(j.title),9,C),g(`p`,w,p(l.$t(`resource.index.total`,{count:j.items.total})),1)]),g(`div`,T,[(r(!0),h(m,null,a(j.links,e=>(r(),o(v,{key:e.name,"data-link":e.name,href:e.href,variant:`secondary`},{default:c(()=>[s(p(e.label),1)]),_:2},1032,[`data-link`,`href`]))),128)),j.can.create===!1?e(``,!0):(r(),o(v,{key:0,"data-action":`create`,href:l.route(`${M.routeName}.create`,i(N))},{default:c(()=>[f[3]||=g(`svg`,{class:`w-4 h-4 mr-2`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[g(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 4v16m8-8H4`})],-1),s(` `+p(l.$t(`common.create`)),1)]),_:1},8,[`href`]))])]),g(`div`,E,[g(`div`,D,[g(`div`,O,[n(g(`input`,{"onUpdate:modelValue":f[0]||=e=>F.value=e,type:`text`,placeholder:l.$t(`resource.index.search_placeholder`),"data-search-input":`true`,class:`w-full px-4 py-2 border border-field rounded-lg focus:ring-focus focus:border-focus`,onKeyup:u(R,[`enter`])},null,40,k),[[d,F.value]])]),t(v,{"data-action":`search`,onClick:R,variant:`secondary`},{default:c(()=>[s(p(l.$t(`resource.index.search_button`)),1)]),_:1})])]),t(y,{columns:j.columns,items:j.items,"sort-by":j.filters.sort,"sort-direction":j.filters.direction,"can-delete":j.can.delete!==!1,"row-actions":i(P),onSort:z,onEdit:B,onDelete:V},null,8,[`columns`,`items`,`sort-by`,`sort-direction`,`can-delete`,`row-actions`]),t(b,{show:I.value,title:l.$t(`resource.delete.title`),onClose:f[2]||=e=>I.value=!1},{footer:c(()=>[t(v,{"data-action":`delete-cancel`,variant:`secondary`,onClick:f[1]||=e=>I.value=!1},{default:c(()=>[s(p(l.$t(`common.cancel`)),1)]),_:1}),t(v,{"data-action":`delete-confirm`,variant:`danger`,onClick:H},{default:c(()=>[s(p(l.$t(`common.delete`)),1)]),_:1})]),default:c(()=>[g(`p`,A,p(l.$t(`resource.delete.confirm`)),1)]),_:1},8,[`show`,`title`])]),_:1},8,[`title`]))}};export{j as default};
\ No newline at end of file
+import{C as e,E as t,G as n,I as r,Q as i,R as a,S as o,T as s,W as c,X as l,g as u,m as d,s as f,tt as p,v as m,w as h,x as g}from"./dist-Bie52OmN.js";import{t as _}from"./AdminLayout-D_QE0gy-.js";import{t as v}from"./AdminButton-KiIJ2sLW.js";import{t as y}from"./AdminDataTable-6eKgKDeA.js";import{t as b}from"./AdminModal-DKazeNNa.js";import{t as x}from"./recordActions-CtRs42tG.js";var S={class:`mb-6 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4`},C=[`data-page-title`],w={class:`mt-1 text-sm text-muted`},T={class:`flex flex-wrap items-center gap-2`},E={class:`mb-6`},D={class:`flex gap-4`},O={class:`flex-1 max-w-md`},k=[`placeholder`],A={class:`text-muted`},j={__name:`Index`,props:{routeName:String,createLabel:String,items:Object,columns:Array,filters:Object,title:String,can:{type:Object,default:()=>({})},actions:{type:Array,default:()=>[]},links:{type:Array,default:()=>[]}},setup(j){let M=j,N=Object.fromEntries(Object.entries(M.filters||{}).filter(([e])=>![`search`,`sort`,`direction`].includes(e))),P=M.actions.map(e=>({...e,href:t=>x(M.routeName,e,t)})),F=l(M.filters.search||``),I=l(!1),L=l(null),R=()=>{f.get(route(`${M.routeName}.index`),{...N,search:F.value},{preserveState:!0,preserveScroll:!0})},z=({column:e,direction:t})=>{f.get(route(`${M.routeName}.index`),{...M.filters,sort:e,direction:t},{preserveState:!0,preserveScroll:!0})},B=e=>{f.visit(route(`${M.routeName}.edit`,e.id))},V=e=>{L.value=e,I.value=!0},H=()=>{L.value&&f.delete(route(`${M.routeName}.destroy`,L.value.id),{onSuccess:()=>{I.value=!1,L.value=null}})};return(l,f)=>(r(),o(_,{title:j.title},{default:c(()=>[g(`div`,S,[g(`div`,null,[g(`h1`,{"data-page-title":j.routeName,class:`text-2xl font-bold text-fg`},p(j.title),9,C),g(`p`,w,p(l.$t(`resource.index.total`,{count:j.items.total})),1)]),g(`div`,T,[(r(!0),h(m,null,a(j.links,e=>(r(),o(v,{key:e.name,"data-link":e.name,href:e.href,variant:`secondary`},{default:c(()=>[s(p(e.label),1)]),_:2},1032,[`data-link`,`href`]))),128)),j.can.create===!1?e(``,!0):(r(),o(v,{key:0,"data-action":`create`,href:l.route(`${M.routeName}.create`,i(N))},{default:c(()=>[f[3]||=g(`svg`,{class:`w-4 h-4 mr-2`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[g(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 4v16m8-8H4`})],-1),s(` `+p(l.$t(`common.create`)),1)]),_:1},8,[`href`]))])]),g(`div`,E,[g(`div`,D,[g(`div`,O,[n(g(`input`,{"onUpdate:modelValue":f[0]||=e=>F.value=e,type:`text`,placeholder:l.$t(`resource.index.search_placeholder`),"data-search-input":`true`,class:`w-full px-4 py-2 border border-field rounded-lg focus:ring-focus focus:border-focus`,onKeyup:u(R,[`enter`])},null,40,k),[[d,F.value]])]),t(v,{"data-action":`search`,onClick:R,variant:`secondary`},{default:c(()=>[s(p(l.$t(`resource.index.search_button`)),1)]),_:1})])]),t(y,{columns:j.columns,items:j.items,"sort-by":j.filters.sort,"sort-direction":j.filters.direction,"can-delete":j.can.delete!==!1,"row-actions":i(P),onSort:z,onEdit:B,onDelete:V},null,8,[`columns`,`items`,`sort-by`,`sort-direction`,`can-delete`,`row-actions`]),t(b,{show:I.value,title:l.$t(`resource.delete.title`),onClose:f[2]||=e=>I.value=!1},{footer:c(()=>[t(v,{"data-action":`delete-cancel`,variant:`secondary`,onClick:f[1]||=e=>I.value=!1},{default:c(()=>[s(p(l.$t(`common.cancel`)),1)]),_:1}),t(v,{"data-action":`delete-confirm`,variant:`danger`,onClick:H},{default:c(()=>[s(p(l.$t(`common.delete`)),1)]),_:1})]),default:c(()=>[g(`p`,A,p(l.$t(`resource.delete.confirm`)),1)]),_:1},8,[`show`,`title`])]),_:1},8,[`title`]))}};export{j as default};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/MonitoringChart-DLuy45XH.js b/packages/admin/dist/assets/MonitoringChart-DLuy45XH.js
new file mode 100644
index 00000000..5b771dd4
--- /dev/null
+++ b/packages/admin/dist/assets/MonitoringChart-DLuy45XH.js
@@ -0,0 +1 @@
+import{I as e,R as t,tt as n,v as r,w as i,x as a}from"./dist-Bie52OmN.js";import{t as o}from"./labels-DbKc85RH.js";var s={class:`bg-surface rounded-lg shadow px-5 py-4`},c={class:`text-sm font-semibold text-fg`},l={class:`mt-1 text-xs text-muted`},u=[`innerHTML`],d={class:`mt-2 text-sm`},f={class:`cursor-pointer text-accent`},p={class:`mt-2 overflow-x-auto`},m={class:`min-w-full text-xs`},h={class:`px-2 py-1 text-left font-medium text-fg`},g={class:`px-2 py-1 text-right font-medium text-fg`},_={class:`divide-y divide-line`},v={class:`px-2 py-1 text-fg tabular-nums`},y={class:`px-2 py-1 text-right text-fg tabular-nums`},b={class:`px-2 py-1 text-right text-fg tabular-nums`},x={class:`px-2 py-1 text-right text-fg tabular-nums`},S={class:`px-2 py-1 text-right text-fg tabular-nums`},C={__name:`MonitoringChart`,props:{title:{type:String,required:!0},svg:{type:String,required:!0},points:{type:Array,default:()=>[]},t:{type:Object,required:!0}},setup(C){let w=C,T=e=>o(w.t,e);return(o,w)=>(e(),i(`figure`,s,[a(`figcaption`,c,n(C.title),1),a(`p`,l,n(T(`charts.legend`)),1),a(`div`,{class:`mt-3`,innerHTML:C.svg},null,8,u),a(`details`,d,[a(`summary`,f,n(T(`charts.table`)),1),a(`div`,p,[a(`table`,m,[a(`thead`,null,[a(`tr`,null,[a(`th`,h,n(T(`columns.period`)),1),a(`th`,g,n(T(`columns.count`)),1),w[0]||=a(`th`,{class:`px-2 py-1 text-right font-medium text-fg`},`p50`,-1),w[1]||=a(`th`,{class:`px-2 py-1 text-right font-medium text-fg`},`p75`,-1),w[2]||=a(`th`,{class:`px-2 py-1 text-right font-medium text-fg`},`p95`,-1)])]),a(`tbody`,_,[(e(!0),i(r,null,t(C.points,t=>(e(),i(`tr`,{key:t.label},[a(`td`,v,n(t.label),1),a(`td`,y,n(t.count),1),a(`td`,b,n(t.p50),1),a(`td`,x,n(t.p75),1),a(`td`,S,n(t.p95),1)]))),128))])])])])]))}};export{C as t};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/MonitoringChart-QzapWRK7.css b/packages/admin/dist/assets/MonitoringChart-QzapWRK7.css
new file mode 100644
index 00000000..3d12296d
--- /dev/null
+++ b/packages/admin/dist/assets/MonitoringChart-QzapWRK7.css
@@ -0,0 +1 @@
+.atrium-monitoring-chart{--monitoring-p50:#0b5fa5;--monitoring-p75:#b34700;--monitoring-p95:#374151;height:auto;display:block;overflow:visible}[data-theme=night] .atrium-monitoring-chart{--monitoring-p50:#6cb4f0;--monitoring-p75:#f5a05b;--monitoring-p95:#e5e7eb}[data-theme=contrast] .atrium-monitoring-chart{--monitoring-p50:#000;--monitoring-p75:#000;--monitoring-p95:#000}.atrium-monitoring-chart .grid{stroke:var(--color-line);stroke-width:1px}.atrium-monitoring-chart .axis,.atrium-monitoring-chart .empty{fill:var(--color-muted);font-size:12px}.atrium-monitoring-chart .series path{stroke-width:2.5px;stroke-linecap:round;stroke-linejoin:round}.atrium-monitoring-chart .label{font-size:12px;font-weight:600}.atrium-monitoring-chart .series.p50 path{stroke:var(--monitoring-p50)}.atrium-monitoring-chart .series.p50 :is(circle,rect,polygon,.label){fill:var(--monitoring-p50)}.atrium-monitoring-chart .series.p75 path{stroke:var(--monitoring-p75)}.atrium-monitoring-chart .series.p75 :is(circle,rect,polygon,.label){fill:var(--monitoring-p75)}.atrium-monitoring-chart .series.p95 path{stroke:var(--monitoring-p95)}.atrium-monitoring-chart .series.p95 :is(circle,rect,polygon,.label){fill:var(--monitoring-p95)}
diff --git a/packages/admin/dist/assets/Query-CxDUw4Nd.js b/packages/admin/dist/assets/Query-CxDUw4Nd.js
new file mode 100644
index 00000000..9bf5b210
--- /dev/null
+++ b/packages/admin/dist/assets/Query-CxDUw4Nd.js
@@ -0,0 +1 @@
+import{C as e,E as t,I as n,R as r,S as i,T as a,W as o,tt as s,v as c,w as l,x as u}from"./dist-Bie52OmN.js";import{t as d}from"./AdminLayout-D_QE0gy-.js";import{t as f}from"./AdminCard-YbEwPtJz.js";import{t as p}from"./MonitoringChart-DLuy45XH.js";import{t as m}from"./labels-DbKc85RH.js";var h={class:`mb-6`},g=[`href`],_={class:`mt-2 text-2xl font-bold text-fg`},v={class:`space-y-6`},y={dusk:`query-sql`,class:`whitespace-pre-wrap break-all font-mono text-sm text-fg`},b={class:`mt-3 flex flex-wrap gap-x-6 gap-y-1 text-xs text-muted`},x={class:`inline`},S={class:`inline font-mono`},C={class:`inline`},w={class:`inline tabular-nums`},T={key:0,class:`p-4 text-sm text-muted`},E={key:1,class:`overflow-x-auto`},D={dusk:`query-routes`,class:`min-w-full text-sm`},O={class:`bg-surface-alt`},k={class:`px-3 py-2 text-left font-medium text-fg`},A={class:`px-3 py-2 text-right font-medium text-fg`},j={class:`px-3 py-2 text-right font-medium text-fg`},M={class:`px-3 py-2 text-right font-medium text-fg`},N={class:`divide-y divide-line`},P={class:`px-3 py-2`},F=[`href`],I={class:`block text-xs text-muted font-mono break-all`},L=[`href`],R={class:`px-3 py-2 text-right text-fg tabular-nums`},z={class:`px-3 py-2 text-right text-fg tabular-nums whitespace-nowrap`},B={class:`px-3 py-2 text-right text-fg tabular-nums whitespace-nowrap`},V={__name:`Query`,props:{t:{type:Object,required:!0},query:{type:Object,required:!0},chart:{type:String,required:!0},points:{type:Array,required:!0},routes:{type:Array,required:!0}},setup(V){let H=V,U=(e,t={})=>m(H.t,e,t);return(m,H)=>(n(),i(d,{title:U(`columns.query`)},{default:o(()=>[u(`div`,h,[u(`a`,{href:m.route(`admin.monitoring.index`),class:`text-sm text-accent underline`,dusk:`monitoring-back`},`← `+s(U(`back`)),9,g),u(`h1`,_,s(U(`columns.query`)),1)]),u(`div`,v,[t(f,null,{default:o(()=>[u(`pre`,y,s(V.query.sql),1),u(`dl`,b,[u(`div`,null,[u(`dt`,x,s(U(`columns.connection`))+`:`,1),H[0]||=a(),u(`dd`,S,s(V.query.connection),1)]),u(`div`,null,[u(`dt`,C,s(U(`columns.last_seen`))+`:`,1),H[1]||=a(),u(`dd`,w,s(V.query.last_seen),1)])])]),_:1}),t(p,{title:U(`charts.query_time`),svg:V.chart,points:V.points,t:V.t,dusk:`chart-query`},null,8,[`title`,`svg`,`points`,`t`]),t(f,{"no-padding":``,title:U(`sections.routes_of_query`)},{default:o(()=>[V.routes.length?(n(),l(`div`,E,[u(`table`,D,[u(`thead`,O,[u(`tr`,null,[u(`th`,k,s(U(`columns.route`)),1),u(`th`,A,s(U(`columns.times`)),1),u(`th`,j,s(U(`columns.average`)),1),u(`th`,M,s(U(`columns.slowest`)),1)])]),u(`tbody`,N,[(n(!0),l(c,null,r(V.routes,t=>(n(),l(`tr`,{key:t.route},[u(`td`,P,[u(`a`,{href:m.route(`admin.monitoring.index`,{route:t.route}),class:`font-mono text-accent underline`},s(t.route),9,F),u(`span`,I,s(t.path),1),t.errors_url?(n(),l(`a`,{key:0,href:t.errors_url,class:`block text-xs text-accent underline`,dusk:`query-route-errors`},s(U(`links.errors`)),9,L)):e(``,!0)]),u(`td`,R,s(t.times),1),u(`td`,z,s(t.average),1),u(`td`,B,s(t.slowest),1)]))),128))])])])):(n(),l(`p`,T,s(U(`no_data`)),1))]),_:1},8,[`title`])])]),_:1},8,[`title`]))}};export{V as default};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/Settings-BrbOStcv.js b/packages/admin/dist/assets/Settings-7h1Ram2n.js
similarity index 88%
rename from packages/admin/dist/assets/Settings-BrbOStcv.js
rename to packages/admin/dist/assets/Settings-7h1Ram2n.js
index 800737b7..dbf28631 100644
--- a/packages/admin/dist/assets/Settings-BrbOStcv.js
+++ b/packages/admin/dist/assets/Settings-7h1Ram2n.js
@@ -1 +1 @@
-import{C as e,E as t,I as n,L as r,Q as i,R as a,S as o,T as s,W as c,_ as l,a as u,b as d,i as f,tt as p,v as m,w as h,x as g}from"./dist-Bie52OmN.js";import{t as _}from"./AdminLayout-DBeSErmz.js";import{t as v}from"./AdminButton-KiIJ2sLW.js";import{t as y}from"./AdminCard-YbEwPtJz.js";import{t as b}from"./FormField-B-XX4VFv.js";import{n as x}from"./contentLocale-BV_E0iGS.js";var S={class:`mb-6`},C={class:`max-w-4xl`},w={"data-page-title":`admin.modules.settings`,class:`text-2xl font-bold text-fg`},T={key:0,class:`mt-1 text-sm text-muted`},E={key:1,"data-settings-site":``,class:`mt-1 text-sm text-muted`},D=[`data-module`],O={class:`space-y-6`},k={class:`flex items-center justify-end space-x-3 pt-6 mt-6 border-t`},A={__name:`Settings`,props:{module:Object,description:String,fields:Array,values:Object,site:{type:Object,default:null},title:String},setup(A){let j=A,M={};j.fields.forEach(e=>{M[e.name]=x(e,j.values[e.name])});let N=u(M);r(`formData`,d(()=>N.data()));let P=()=>{N.submit(`put`,route(`admin.modules.settings.update`,j.module.key),{preserveScroll:!0})};return(r,u)=>(n(),o(_,{title:A.title},{default:c(()=>[g(`div`,S,[t(i(f),{href:r.route(`admin.modules.index`),class:`text-muted hover:text-accent`},{default:c(()=>[s(p(r.$t(`menu.modules`)),1)]),_:1},8,[`href`])]),g(`div`,C,[g(`h1`,w,p(A.title),1),A.description?(n(),h(`p`,T,p(A.description),1)):e(``,!0),A.site?(n(),h(`p`,E,p(r.$t(`modules.per_site`,{site:A.site.name})),1)):e(``,!0),t(y,{class:`mt-6`},{default:c(()=>[g(`form`,{"data-settings-form":``,"data-module":A.module.key,onSubmit:l(P,[`prevent`])},[g(`div`,O,[(n(!0),h(m,null,a(A.fields,e=>(n(),o(b,{key:e.name,field:e,modelValue:i(N)[e.name],"onUpdate:modelValue":t=>i(N)[e.name]=t,errors:i(N).errors},null,8,[`field`,`modelValue`,`onUpdate:modelValue`,`errors`]))),128))]),g(`div`,k,[t(v,{href:r.route(`admin.modules.index`),variant:`secondary`},{default:c(()=>[s(p(r.$t(`common.cancel`)),1)]),_:1},8,[`href`]),t(v,{"data-action":`save`,type:`submit`,loading:i(N).processing},{default:c(()=>[s(p(r.$t(`common.save`)),1)]),_:1},8,[`loading`])])],40,D)]),_:1})])]),_:1},8,[`title`]))}};export{A as default};
\ No newline at end of file
+import{C as e,E as t,I as n,L as r,Q as i,R as a,S as o,T as s,W as c,_ as l,a as u,b as d,i as f,tt as p,v as m,w as h,x as g}from"./dist-Bie52OmN.js";import{t as _}from"./AdminLayout-D_QE0gy-.js";import{t as v}from"./AdminButton-KiIJ2sLW.js";import{t as y}from"./AdminCard-YbEwPtJz.js";import{t as b}from"./FormField-WE0R-1uV.js";import{n as x}from"./contentLocale-BV_E0iGS.js";var S={class:`mb-6`},C={class:`max-w-4xl`},w={"data-page-title":`admin.modules.settings`,class:`text-2xl font-bold text-fg`},T={key:0,class:`mt-1 text-sm text-muted`},E={key:1,"data-settings-site":``,class:`mt-1 text-sm text-muted`},D=[`data-module`],O={class:`space-y-6`},k={class:`flex items-center justify-end space-x-3 pt-6 mt-6 border-t`},A={__name:`Settings`,props:{module:Object,description:String,fields:Array,values:Object,site:{type:Object,default:null},title:String},setup(A){let j=A,M={};j.fields.forEach(e=>{M[e.name]=x(e,j.values[e.name])});let N=u(M);r(`formData`,d(()=>N.data()));let P=()=>{N.submit(`put`,route(`admin.modules.settings.update`,j.module.key),{preserveScroll:!0})};return(r,u)=>(n(),o(_,{title:A.title},{default:c(()=>[g(`div`,S,[t(i(f),{href:r.route(`admin.modules.index`),class:`text-muted hover:text-accent`},{default:c(()=>[s(p(r.$t(`menu.modules`)),1)]),_:1},8,[`href`])]),g(`div`,C,[g(`h1`,w,p(A.title),1),A.description?(n(),h(`p`,T,p(A.description),1)):e(``,!0),A.site?(n(),h(`p`,E,p(r.$t(`modules.per_site`,{site:A.site.name})),1)):e(``,!0),t(y,{class:`mt-6`},{default:c(()=>[g(`form`,{"data-settings-form":``,"data-module":A.module.key,onSubmit:l(P,[`prevent`])},[g(`div`,O,[(n(!0),h(m,null,a(A.fields,e=>(n(),o(b,{key:e.name,field:e,modelValue:i(N)[e.name],"onUpdate:modelValue":t=>i(N)[e.name]=t,errors:i(N).errors},null,8,[`field`,`modelValue`,`onUpdate:modelValue`,`errors`]))),128))]),g(`div`,k,[t(v,{href:r.route(`admin.modules.index`),variant:`secondary`},{default:c(()=>[s(p(r.$t(`common.cancel`)),1)]),_:1},8,[`href`]),t(v,{"data-action":`save`,type:`submit`,loading:i(N).processing},{default:c(()=>[s(p(r.$t(`common.save`)),1)]),_:1},8,[`loading`])])],40,D)]),_:1})])]),_:1},8,[`title`]))}};export{A as default};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/Show-CS6rq4RP.js b/packages/admin/dist/assets/Show-BBgM4LS_.js
similarity index 99%
rename from packages/admin/dist/assets/Show-CS6rq4RP.js
rename to packages/admin/dist/assets/Show-BBgM4LS_.js
index 31760a7b..7476642e 100644
--- a/packages/admin/dist/assets/Show-CS6rq4RP.js
+++ b/packages/admin/dist/assets/Show-BBgM4LS_.js
@@ -1 +1 @@
-import{$ as e,C as t,E as n,I as r,Q as i,R as a,S as o,T as s,W as c,X as l,b as u,i as d,o as ee,s as te,tt as f,v as p,w as m,x as h}from"./dist-Bie52OmN.js";import{t as ne}from"./AdminLayout-DBeSErmz.js";import{t as g}from"./AdminButton-KiIJ2sLW.js";import{t as _}from"./AdminCard-YbEwPtJz.js";import{t as re}from"./AdminPagination-D7rwNfhd.js";import{t as ie}from"./BarChart-wks0RLo_.js";var ae={class:`mt-3 mb-6 flex flex-col lg:flex-row lg:items-start lg:justify-between gap-4`},oe={class:`min-w-0`},se={class:`text-2xl font-bold text-fg break-all`},ce={class:`mt-1 text-xs text-muted font-mono break-all`},le={class:`mt-2 text-fg break-words whitespace-pre-line`,dusk:`error-message`},ue={key:0,class:`mt-1 text-sm text-muted font-mono break-all`},v={class:`mt-3 flex flex-wrap gap-2 text-xs`},y={class:`px-2 py-0.5 rounded bg-off text-off-fg`,dusk:`error-status`},b={class:`px-2 py-0.5 rounded bg-off text-off-fg`},x={class:`px-2 py-0.5 rounded bg-off text-off-fg`},S={key:0,class:`px-2 py-0.5 rounded bg-success-soft text-success-soft-fg`},C={key:1,class:`px-2 py-0.5 rounded bg-warning-soft text-warning-soft-fg`},w={class:`flex flex-wrap gap-2 shrink-0`},T={key:0,class:`-mt-4 mb-6 text-xs text-muted`},E={class:`mb-6 grid grid-cols-2 md:grid-cols-3 xl:grid-cols-6 gap-3`},D={class:`text-xs text-muted`},O={class:`text-lg font-semibold text-fg tabular-nums break-words`},k={class:`grid gap-6 lg:grid-cols-3 mb-6`},A={class:`flex items-center justify-between gap-3`},j={class:`text-lg font-medium text-fg`},M={class:`flex gap-1`,role:`group`},N=[`aria-pressed`,`dusk`,`onClick`],P={class:`text-sm font-semibold text-fg`},F={class:`mt-2 mb-4 text-sm`,dusk:`error-top-paths`},I={class:`font-mono text-fg break-all`},L={class:`tabular-nums text-fg`},R={key:0,class:`text-muted`},z={class:`text-sm font-semibold text-fg`},B={class:`mt-2 text-sm`},V={class:`font-mono text-fg break-all`},H={class:`tabular-nums text-fg`},U={key:0,class:`text-muted`},de={key:1,class:`mb-6 bg-surface rounded-lg shadow px-6 py-6 text-sm text-muted`,dusk:`error-no-event`},fe={class:`flex flex-wrap items-center justify-between gap-3`},pe={class:`text-lg font-medium text-fg`},me={class:`text-xs text-muted`},he={key:0,class:`mb-1 text-xs font-semibold uppercase tracking-wide text-muted`},ge={class:`font-semibold text-fg break-all`},_e={class:`mb-3 text-sm text-fg break-words whitespace-pre-line`},ve={class:`space-y-2`},ye={class:`px-3 py-1.5 text-sm bg-surface-alt`},be={class:`font-mono text-fg break-all`},xe={class:`ml-2 font-mono text-xs text-muted break-all`},Se={key:0,class:`overflow-x-auto text-xs leading-5 font-mono py-1`,dusk:`error-code`},Ce={class:`inline-block w-12 select-none text-right pr-3`},we={class:`block px-3 bg-accent-soft text-accent-soft-fg font-semibold`},W={class:`inline-block w-12 select-none text-right pr-3`},Te={class:`inline-block w-12 select-none text-right pr-3`},Ee={class:`grid gap-6 lg:grid-cols-2 mb-6`},De={class:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-sm`,dusk:`error-request`},Oe={class:`text-muted`},ke={class:`text-fg font-mono break-all`},Ae={class:`text-muted`},je={class:`text-fg font-mono break-all`},Me={class:`text-muted font-mono`},Ne={class:`text-fg font-mono break-all`},Pe={class:`text-sm space-y-1`,dusk:`error-breadcrumbs`},Fe={class:`font-mono text-muted tabular-nums`},Ie={class:`font-mono text-muted`},Le={class:`text-fg break-words`},Re={key:0,class:`text-muted`},ze={class:`min-w-full divide-y divide-line text-sm`,dusk:`error-occurrences`},Be={class:`bg-surface-alt`},Ve={class:`divide-y divide-line`},He={class:`px-4 py-2 whitespace-nowrap`},Ue={key:0,class:`font-semibold`},We={class:`px-4 py-2`},Ge={class:`px-4 py-2 font-mono`},Ke={class:`px-4 py-2 font-mono break-all`},qe={class:`px-4 py-2 font-mono`},Je={class:`px-4 py-2 tabular-nums`},G={__name:`Show`,props:{issue:{type:Object,required:!0},event:{type:Object,default:null},occurrences:{type:Object,required:!0},top:{type:Object,required:!0},chart:{type:Object,required:!0},currentRelease:{type:String,default:``},strings:{type:Object,required:!0}},setup(G){let K=G,Ye=ee(),Xe=u(()=>String(Ye.props.locale||`en`).replace(`_`,`-`)),q=u(()=>K.strings.issue);function J(e){return e?new Date(e).toLocaleString(Xe.value,{dateStyle:`medium`,timeStyle:`short`}):q.value.none}function Y(e,t){return Object.entries(t).reduce((e,[t,n])=>e.replaceAll(`:${t}`,String(n??``)),e)}let X=l(!1);function Z(e,t=!1){X.value=!0,te.post(route(`admin.errors.status`,K.issue.id),{status:e,next_release:t},{preserveScroll:!0,onFinish:()=>{X.value=!1}})}let Q=l(`hourly`),$=l(!1),Ze=u(()=>(K.event?.exceptions??[]).map(e=>{let t=e.frames??[],n=t.filter(e=>e.in_app);return{...e,shown:$.value||n.length===0?t:n,hidden:t.length-n.length}}));function Qe(e){return[e.file,e.line].filter(Boolean).join(`:`)}let $e=u(()=>{let e=K.event?.request??{};return[[`method`,e.method],[`url`,e.url],[`route`,e.route],[`site`,K.event?.site],[`locale`,e.locale],[`user`,e.user_id]].filter(([,e])=>e!=null&&e!==``)}),et=u(()=>{let e=K.event??{};return[[`release`,e.release],[`php`,e.runtime?.php],[`laravel`,e.runtime?.laravel]].filter(([,e])=>e)}),tt=u(()=>Object.entries(K.event?.context??{}));function nt(e){return typeof e==`string`?e:JSON.stringify(e)}return(l,u)=>(r(),o(ne,{title:G.issue.short_class},{default:c(()=>[n(i(d),{href:l.route(`admin.errors.index`),class:`text-sm text-accent hover:text-accent-hover hover:underline`,dusk:`error-back`},{default:c(()=>[s(`← `+f(q.value.back),1)]),_:1},8,[`href`]),h(`div`,ae,[h(`div`,oe,[h(`h1`,se,f(G.issue.short_class),1),h(`p`,ce,f(G.issue.class),1),h(`p`,le,f(G.issue.message),1),G.issue.culprit?(r(),m(`p`,ue,f(G.issue.culprit),1)):t(``,!0),h(`p`,v,[h(`span`,y,f(G.strings.statuses[G.issue.status]),1),h(`span`,b,f(G.strings.levels[G.issue.level]??G.issue.level),1),h(`span`,x,f(G.strings.kinds[G.issue.kind]??G.issue.kind),1),G.issue.resolved_in?(r(),m(`span`,S,f(Y(q.value.resolved_in,{release:G.issue.resolved_in})),1)):t(``,!0),G.issue.regressed_at?(r(),m(`span`,C,f(q.value.regressed)+`: `+f(J(G.issue.regressed_at)),1)):t(``,!0)])]),h(`div`,w,[G.issue.status===`new`?(r(),m(p,{key:0},[n(g,{disabled:X.value,dusk:`error-resolve`,onClick:u[0]||=e=>Z(`resolved`)},{default:c(()=>[s(f(q.value.resolve),1)]),_:1},8,[`disabled`]),n(g,{variant:`secondary`,disabled:X.value,title:Y(q.value.resolve_next_hint,{release:G.currentRelease}),dusk:`error-resolve-next`,onClick:u[1]||=e=>Z(`resolved`,!0)},{default:c(()=>[s(f(q.value.resolve_next),1)]),_:1},8,[`disabled`,`title`]),n(g,{variant:`secondary`,disabled:X.value,dusk:`error-ignore`,onClick:u[2]||=e=>Z(`ignored`)},{default:c(()=>[s(f(q.value.ignore),1)]),_:1},8,[`disabled`])],64)):(r(),o(g,{key:1,variant:`secondary`,disabled:X.value,dusk:`error-reopen`,onClick:u[3]||=e=>Z(`new`)},{default:c(()=>[s(f(q.value.reopen),1)]),_:1},8,[`disabled`]))])]),G.issue.status===`new`?(r(),m(`p`,T,f(Y(q.value.resolve_next_hint,{release:G.currentRelease})),1)):t(``,!0),h(`dl`,E,[(r(!0),m(p,null,a([[G.strings.list.events,G.issue.times_seen],[G.strings.list.users,G.issue.users_seen],[G.strings.list.first_seen,J(G.issue.first_seen_at)],[G.strings.list.last_seen,J(G.issue.last_seen_at)],[q.value.first_release,G.issue.first_release||q.value.none],[q.value.last_release,G.issue.last_release||q.value.none]],([e,t])=>(r(),m(`div`,{key:e,class:`bg-surface rounded-lg shadow px-4 py-3 flex flex-col-reverse`},[h(`dt`,D,f(e),1),h(`dd`,O,f(t),1)]))),128))]),h(`div`,k,[n(_,{class:`lg:col-span-2`},{header:c(()=>[h(`div`,A,[h(`h2`,j,f(q.value.frequency),1),h(`div`,M,[(r(!0),m(p,null,a([[`hourly`,q.value.last_24h],[`daily`,q.value.last_30d]],([t,n])=>(r(),m(`button`,{key:t,type:`button`,class:e([`px-2.5 py-1 rounded text-sm border`,Q.value===t?`bg-accent text-on-accent border-accent`:`bg-surface text-fg border-field hover:bg-hover`]),"aria-pressed":Q.value===t,dusk:`error-chart-${t}`,onClick:e=>Q.value=t},f(n),11,N))),128))])])]),default:c(()=>[n(ie,{points:G.chart[Q.value],every:Q.value===`hourly`?3:5,label:`${q.value.frequency}, ${Q.value===`hourly`?q.value.last_24h:q.value.last_30d}`},null,8,[`points`,`every`,`label`])]),_:1}),n(_,null,{default:c(()=>[h(`h3`,P,f(q.value.top_paths),1),h(`ul`,F,[(r(!0),m(p,null,a(G.top.paths,e=>(r(),m(`li`,{key:e.value,class:`flex justify-between gap-3 py-0.5`},[h(`span`,I,f(e.value),1),h(`span`,L,f(e.count),1)]))),128)),G.top.paths.length?t(``,!0):(r(),m(`li`,R,f(q.value.none),1))]),h(`h3`,z,f(q.value.top_releases),1),h(`ul`,B,[(r(!0),m(p,null,a(G.top.releases,e=>(r(),m(`li`,{key:e.value,class:`flex justify-between gap-3 py-0.5`},[h(`span`,V,f(e.value),1),h(`span`,H,f(e.count),1)]))),128)),G.top.releases.length?t(``,!0):(r(),m(`li`,U,f(q.value.none),1))])]),_:1})]),G.event?(r(),m(p,{key:2},[n(_,{class:`mb-6`},{header:c(()=>[h(`div`,fe,[h(`h2`,pe,f(q.value.trace),1),h(`span`,me,f(q.value.shown)+`: `+f(J(G.event.created_at)),1),h(`button`,{type:`button`,class:`text-sm text-accent hover:text-accent-hover hover:underline`,dusk:`error-all-frames`,onClick:u[4]||=e=>$.value=!$.value},f($.value?q.value.app_frames:q.value.all_frames),1)])]),default:c(()=>[(r(!0),m(p,null,a(Ze.value,(e,n)=>(r(),m(`section`,{key:n,class:`mb-6 last:mb-0`,dusk:`error-exception`},[n>0?(r(),m(`p`,he,f(q.value.caused_by),1)):t(``,!0),h(`p`,ge,f(e.class),1),h(`p`,_e,f(e.message),1),h(`ol`,ve,[(r(!0),m(p,null,a(e.shown,(e,n)=>(r(),m(`li`,{key:n,class:`rounded border border-line`,dusk:`error-frame`},[h(`p`,ye,[h(`span`,be,f(e.function||q.value.none),1),h(`span`,xe,f(Qe(e)),1)]),e.context?(r(),m(`pre`,Se,[h(`code`,null,[(r(!0),m(p,null,a(e.context.pre,(t,n)=>(r(),m(`span`,{key:`pre${n}`,class:`block px-3 text-muted`},[h(`span`,Ce,f(e.line-e.context.pre.length+n),1),s(f(t),1)]))),128)),h(`span`,we,[h(`span`,W,f(e.line),1),s(f(e.context.line),1)]),(r(!0),m(p,null,a(e.context.post,(t,n)=>(r(),m(`span`,{key:`post${n}`,class:`block px-3 text-muted`},[h(`span`,Te,f(e.line+1+n),1),s(f(t),1)]))),128))])])):t(``,!0)]))),128))])]))),128))]),_:1}),h(`div`,Ee,[n(_,{title:q.value.request},{default:c(()=>[h(`dl`,De,[(r(!0),m(p,null,a($e.value,([e,t])=>(r(),m(p,{key:e},[h(`dt`,Oe,f(q.value[e]),1),h(`dd`,ke,f(t),1)],64))),128)),(r(!0),m(p,null,a(et.value,([e,t])=>(r(),m(p,{key:e},[h(`dt`,Ae,f(q.value[e]),1),h(`dd`,je,f(t),1)],64))),128)),(r(!0),m(p,null,a(tt.value,([e,t])=>(r(),m(p,{key:`context-${e}`},[h(`dt`,Me,f(e),1),h(`dd`,Ne,f(nt(t)),1)],64))),128))])]),_:1},8,[`title`]),n(_,{title:q.value.breadcrumbs},{default:c(()=>[h(`ol`,Pe,[(r(!0),m(p,null,a(G.event.breadcrumbs,(e,t)=>(r(),m(`li`,{key:t,class:`grid grid-cols-[auto_auto_1fr] gap-3`},[h(`span`,Fe,f(e.time),1),h(`span`,Ie,f(e.category),1),h(`span`,Le,f(e.message),1)]))),128)),G.event.breadcrumbs?.length?t(``,!0):(r(),m(`li`,Re,f(q.value.none),1))])]),_:1},8,[`title`])])],64)):(r(),m(`p`,de,f(q.value.no_event),1)),n(_,{title:q.value.occurrences,"no-padding":``},{default:c(()=>[h(`table`,ze,[h(`thead`,Be,[h(`tr`,null,[(r(),m(p,null,a([`time`,`site`,`method`,`url`,`release`,`user`],e=>h(`th`,{key:e,scope:`col`,class:`px-4 py-2 text-left font-medium text-fg`},f(q.value[e]),1)),64))])]),h(`tbody`,Ve,[(r(!0),m(p,null,a(G.occurrences.data,t=>(r(),m(`tr`,{key:t.id,class:e(t.id===G.event?.id?`bg-accent-soft text-accent-soft-fg`:`hover:bg-hover`)},[h(`td`,He,[t.id===G.event?.id?(r(),m(`span`,Ue,f(J(t.created_at))+` · `+f(q.value.shown),1)):(r(),o(i(d),{key:1,href:l.route(`admin.errors.show`,{issue:G.issue.id,event:t.id}),"preserve-scroll":``,class:`text-accent hover:text-accent-hover hover:underline`,dusk:`error-occurrence`},{default:c(()=>[s(f(J(t.created_at)),1)]),_:2},1032,[`href`]))]),h(`td`,We,f(t.site??q.value.none),1),h(`td`,Ge,f(t.method??q.value.none),1),h(`td`,Ke,f(t.path??q.value.none),1),h(`td`,qe,f(t.release),1),h(`td`,Je,f(t.user_id??q.value.none),1)],2))),128))])]),G.occurrences.last_page>1?(r(),o(re,{key:0,paginator:G.occurrences},null,8,[`paginator`])):t(``,!0)]),_:1},8,[`title`])]),_:1},8,[`title`]))}};export{G as default};
\ No newline at end of file
+import{$ as e,C as t,E as n,I as r,Q as i,R as a,S as o,T as s,W as c,X as l,b as u,i as d,o as ee,s as te,tt as f,v as p,w as m,x as h}from"./dist-Bie52OmN.js";import{t as ne}from"./AdminLayout-D_QE0gy-.js";import{t as g}from"./AdminButton-KiIJ2sLW.js";import{t as _}from"./AdminCard-YbEwPtJz.js";import{t as re}from"./AdminPagination-D7rwNfhd.js";import{t as ie}from"./BarChart-wks0RLo_.js";var ae={class:`mt-3 mb-6 flex flex-col lg:flex-row lg:items-start lg:justify-between gap-4`},oe={class:`min-w-0`},se={class:`text-2xl font-bold text-fg break-all`},ce={class:`mt-1 text-xs text-muted font-mono break-all`},le={class:`mt-2 text-fg break-words whitespace-pre-line`,dusk:`error-message`},ue={key:0,class:`mt-1 text-sm text-muted font-mono break-all`},v={class:`mt-3 flex flex-wrap gap-2 text-xs`},y={class:`px-2 py-0.5 rounded bg-off text-off-fg`,dusk:`error-status`},b={class:`px-2 py-0.5 rounded bg-off text-off-fg`},x={class:`px-2 py-0.5 rounded bg-off text-off-fg`},S={key:0,class:`px-2 py-0.5 rounded bg-success-soft text-success-soft-fg`},C={key:1,class:`px-2 py-0.5 rounded bg-warning-soft text-warning-soft-fg`},w={class:`flex flex-wrap gap-2 shrink-0`},T={key:0,class:`-mt-4 mb-6 text-xs text-muted`},E={class:`mb-6 grid grid-cols-2 md:grid-cols-3 xl:grid-cols-6 gap-3`},D={class:`text-xs text-muted`},O={class:`text-lg font-semibold text-fg tabular-nums break-words`},k={class:`grid gap-6 lg:grid-cols-3 mb-6`},A={class:`flex items-center justify-between gap-3`},j={class:`text-lg font-medium text-fg`},M={class:`flex gap-1`,role:`group`},N=[`aria-pressed`,`dusk`,`onClick`],P={class:`text-sm font-semibold text-fg`},F={class:`mt-2 mb-4 text-sm`,dusk:`error-top-paths`},I={class:`font-mono text-fg break-all`},L={class:`tabular-nums text-fg`},R={key:0,class:`text-muted`},z={class:`text-sm font-semibold text-fg`},B={class:`mt-2 text-sm`},V={class:`font-mono text-fg break-all`},H={class:`tabular-nums text-fg`},U={key:0,class:`text-muted`},de={key:1,class:`mb-6 bg-surface rounded-lg shadow px-6 py-6 text-sm text-muted`,dusk:`error-no-event`},fe={class:`flex flex-wrap items-center justify-between gap-3`},pe={class:`text-lg font-medium text-fg`},me={class:`text-xs text-muted`},he={key:0,class:`mb-1 text-xs font-semibold uppercase tracking-wide text-muted`},ge={class:`font-semibold text-fg break-all`},_e={class:`mb-3 text-sm text-fg break-words whitespace-pre-line`},ve={class:`space-y-2`},ye={class:`px-3 py-1.5 text-sm bg-surface-alt`},be={class:`font-mono text-fg break-all`},xe={class:`ml-2 font-mono text-xs text-muted break-all`},Se={key:0,class:`overflow-x-auto text-xs leading-5 font-mono py-1`,dusk:`error-code`},Ce={class:`inline-block w-12 select-none text-right pr-3`},we={class:`block px-3 bg-accent-soft text-accent-soft-fg font-semibold`},W={class:`inline-block w-12 select-none text-right pr-3`},Te={class:`inline-block w-12 select-none text-right pr-3`},Ee={class:`grid gap-6 lg:grid-cols-2 mb-6`},De={class:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-sm`,dusk:`error-request`},Oe={class:`text-muted`},ke={class:`text-fg font-mono break-all`},Ae={class:`text-muted`},je={class:`text-fg font-mono break-all`},Me={class:`text-muted font-mono`},Ne={class:`text-fg font-mono break-all`},Pe={class:`text-sm space-y-1`,dusk:`error-breadcrumbs`},Fe={class:`font-mono text-muted tabular-nums`},Ie={class:`font-mono text-muted`},Le={class:`text-fg break-words`},Re={key:0,class:`text-muted`},ze={class:`min-w-full divide-y divide-line text-sm`,dusk:`error-occurrences`},Be={class:`bg-surface-alt`},Ve={class:`divide-y divide-line`},He={class:`px-4 py-2 whitespace-nowrap`},Ue={key:0,class:`font-semibold`},We={class:`px-4 py-2`},Ge={class:`px-4 py-2 font-mono`},Ke={class:`px-4 py-2 font-mono break-all`},qe={class:`px-4 py-2 font-mono`},Je={class:`px-4 py-2 tabular-nums`},G={__name:`Show`,props:{issue:{type:Object,required:!0},event:{type:Object,default:null},occurrences:{type:Object,required:!0},top:{type:Object,required:!0},chart:{type:Object,required:!0},currentRelease:{type:String,default:``},strings:{type:Object,required:!0}},setup(G){let K=G,Ye=ee(),Xe=u(()=>String(Ye.props.locale||`en`).replace(`_`,`-`)),q=u(()=>K.strings.issue);function J(e){return e?new Date(e).toLocaleString(Xe.value,{dateStyle:`medium`,timeStyle:`short`}):q.value.none}function Y(e,t){return Object.entries(t).reduce((e,[t,n])=>e.replaceAll(`:${t}`,String(n??``)),e)}let X=l(!1);function Z(e,t=!1){X.value=!0,te.post(route(`admin.errors.status`,K.issue.id),{status:e,next_release:t},{preserveScroll:!0,onFinish:()=>{X.value=!1}})}let Q=l(`hourly`),$=l(!1),Ze=u(()=>(K.event?.exceptions??[]).map(e=>{let t=e.frames??[],n=t.filter(e=>e.in_app);return{...e,shown:$.value||n.length===0?t:n,hidden:t.length-n.length}}));function Qe(e){return[e.file,e.line].filter(Boolean).join(`:`)}let $e=u(()=>{let e=K.event?.request??{};return[[`method`,e.method],[`url`,e.url],[`route`,e.route],[`site`,K.event?.site],[`locale`,e.locale],[`user`,e.user_id]].filter(([,e])=>e!=null&&e!==``)}),et=u(()=>{let e=K.event??{};return[[`release`,e.release],[`php`,e.runtime?.php],[`laravel`,e.runtime?.laravel]].filter(([,e])=>e)}),tt=u(()=>Object.entries(K.event?.context??{}));function nt(e){return typeof e==`string`?e:JSON.stringify(e)}return(l,u)=>(r(),o(ne,{title:G.issue.short_class},{default:c(()=>[n(i(d),{href:l.route(`admin.errors.index`),class:`text-sm text-accent hover:text-accent-hover hover:underline`,dusk:`error-back`},{default:c(()=>[s(`← `+f(q.value.back),1)]),_:1},8,[`href`]),h(`div`,ae,[h(`div`,oe,[h(`h1`,se,f(G.issue.short_class),1),h(`p`,ce,f(G.issue.class),1),h(`p`,le,f(G.issue.message),1),G.issue.culprit?(r(),m(`p`,ue,f(G.issue.culprit),1)):t(``,!0),h(`p`,v,[h(`span`,y,f(G.strings.statuses[G.issue.status]),1),h(`span`,b,f(G.strings.levels[G.issue.level]??G.issue.level),1),h(`span`,x,f(G.strings.kinds[G.issue.kind]??G.issue.kind),1),G.issue.resolved_in?(r(),m(`span`,S,f(Y(q.value.resolved_in,{release:G.issue.resolved_in})),1)):t(``,!0),G.issue.regressed_at?(r(),m(`span`,C,f(q.value.regressed)+`: `+f(J(G.issue.regressed_at)),1)):t(``,!0)])]),h(`div`,w,[G.issue.status===`new`?(r(),m(p,{key:0},[n(g,{disabled:X.value,dusk:`error-resolve`,onClick:u[0]||=e=>Z(`resolved`)},{default:c(()=>[s(f(q.value.resolve),1)]),_:1},8,[`disabled`]),n(g,{variant:`secondary`,disabled:X.value,title:Y(q.value.resolve_next_hint,{release:G.currentRelease}),dusk:`error-resolve-next`,onClick:u[1]||=e=>Z(`resolved`,!0)},{default:c(()=>[s(f(q.value.resolve_next),1)]),_:1},8,[`disabled`,`title`]),n(g,{variant:`secondary`,disabled:X.value,dusk:`error-ignore`,onClick:u[2]||=e=>Z(`ignored`)},{default:c(()=>[s(f(q.value.ignore),1)]),_:1},8,[`disabled`])],64)):(r(),o(g,{key:1,variant:`secondary`,disabled:X.value,dusk:`error-reopen`,onClick:u[3]||=e=>Z(`new`)},{default:c(()=>[s(f(q.value.reopen),1)]),_:1},8,[`disabled`]))])]),G.issue.status===`new`?(r(),m(`p`,T,f(Y(q.value.resolve_next_hint,{release:G.currentRelease})),1)):t(``,!0),h(`dl`,E,[(r(!0),m(p,null,a([[G.strings.list.events,G.issue.times_seen],[G.strings.list.users,G.issue.users_seen],[G.strings.list.first_seen,J(G.issue.first_seen_at)],[G.strings.list.last_seen,J(G.issue.last_seen_at)],[q.value.first_release,G.issue.first_release||q.value.none],[q.value.last_release,G.issue.last_release||q.value.none]],([e,t])=>(r(),m(`div`,{key:e,class:`bg-surface rounded-lg shadow px-4 py-3 flex flex-col-reverse`},[h(`dt`,D,f(e),1),h(`dd`,O,f(t),1)]))),128))]),h(`div`,k,[n(_,{class:`lg:col-span-2`},{header:c(()=>[h(`div`,A,[h(`h2`,j,f(q.value.frequency),1),h(`div`,M,[(r(!0),m(p,null,a([[`hourly`,q.value.last_24h],[`daily`,q.value.last_30d]],([t,n])=>(r(),m(`button`,{key:t,type:`button`,class:e([`px-2.5 py-1 rounded text-sm border`,Q.value===t?`bg-accent text-on-accent border-accent`:`bg-surface text-fg border-field hover:bg-hover`]),"aria-pressed":Q.value===t,dusk:`error-chart-${t}`,onClick:e=>Q.value=t},f(n),11,N))),128))])])]),default:c(()=>[n(ie,{points:G.chart[Q.value],every:Q.value===`hourly`?3:5,label:`${q.value.frequency}, ${Q.value===`hourly`?q.value.last_24h:q.value.last_30d}`},null,8,[`points`,`every`,`label`])]),_:1}),n(_,null,{default:c(()=>[h(`h3`,P,f(q.value.top_paths),1),h(`ul`,F,[(r(!0),m(p,null,a(G.top.paths,e=>(r(),m(`li`,{key:e.value,class:`flex justify-between gap-3 py-0.5`},[h(`span`,I,f(e.value),1),h(`span`,L,f(e.count),1)]))),128)),G.top.paths.length?t(``,!0):(r(),m(`li`,R,f(q.value.none),1))]),h(`h3`,z,f(q.value.top_releases),1),h(`ul`,B,[(r(!0),m(p,null,a(G.top.releases,e=>(r(),m(`li`,{key:e.value,class:`flex justify-between gap-3 py-0.5`},[h(`span`,V,f(e.value),1),h(`span`,H,f(e.count),1)]))),128)),G.top.releases.length?t(``,!0):(r(),m(`li`,U,f(q.value.none),1))])]),_:1})]),G.event?(r(),m(p,{key:2},[n(_,{class:`mb-6`},{header:c(()=>[h(`div`,fe,[h(`h2`,pe,f(q.value.trace),1),h(`span`,me,f(q.value.shown)+`: `+f(J(G.event.created_at)),1),h(`button`,{type:`button`,class:`text-sm text-accent hover:text-accent-hover hover:underline`,dusk:`error-all-frames`,onClick:u[4]||=e=>$.value=!$.value},f($.value?q.value.app_frames:q.value.all_frames),1)])]),default:c(()=>[(r(!0),m(p,null,a(Ze.value,(e,n)=>(r(),m(`section`,{key:n,class:`mb-6 last:mb-0`,dusk:`error-exception`},[n>0?(r(),m(`p`,he,f(q.value.caused_by),1)):t(``,!0),h(`p`,ge,f(e.class),1),h(`p`,_e,f(e.message),1),h(`ol`,ve,[(r(!0),m(p,null,a(e.shown,(e,n)=>(r(),m(`li`,{key:n,class:`rounded border border-line`,dusk:`error-frame`},[h(`p`,ye,[h(`span`,be,f(e.function||q.value.none),1),h(`span`,xe,f(Qe(e)),1)]),e.context?(r(),m(`pre`,Se,[h(`code`,null,[(r(!0),m(p,null,a(e.context.pre,(t,n)=>(r(),m(`span`,{key:`pre${n}`,class:`block px-3 text-muted`},[h(`span`,Ce,f(e.line-e.context.pre.length+n),1),s(f(t),1)]))),128)),h(`span`,we,[h(`span`,W,f(e.line),1),s(f(e.context.line),1)]),(r(!0),m(p,null,a(e.context.post,(t,n)=>(r(),m(`span`,{key:`post${n}`,class:`block px-3 text-muted`},[h(`span`,Te,f(e.line+1+n),1),s(f(t),1)]))),128))])])):t(``,!0)]))),128))])]))),128))]),_:1}),h(`div`,Ee,[n(_,{title:q.value.request},{default:c(()=>[h(`dl`,De,[(r(!0),m(p,null,a($e.value,([e,t])=>(r(),m(p,{key:e},[h(`dt`,Oe,f(q.value[e]),1),h(`dd`,ke,f(t),1)],64))),128)),(r(!0),m(p,null,a(et.value,([e,t])=>(r(),m(p,{key:e},[h(`dt`,Ae,f(q.value[e]),1),h(`dd`,je,f(t),1)],64))),128)),(r(!0),m(p,null,a(tt.value,([e,t])=>(r(),m(p,{key:`context-${e}`},[h(`dt`,Me,f(e),1),h(`dd`,Ne,f(nt(t)),1)],64))),128))])]),_:1},8,[`title`]),n(_,{title:q.value.breadcrumbs},{default:c(()=>[h(`ol`,Pe,[(r(!0),m(p,null,a(G.event.breadcrumbs,(e,t)=>(r(),m(`li`,{key:t,class:`grid grid-cols-[auto_auto_1fr] gap-3`},[h(`span`,Fe,f(e.time),1),h(`span`,Ie,f(e.category),1),h(`span`,Le,f(e.message),1)]))),128)),G.event.breadcrumbs?.length?t(``,!0):(r(),m(`li`,Re,f(q.value.none),1))])]),_:1},8,[`title`])])],64)):(r(),m(`p`,de,f(q.value.no_event),1)),n(_,{title:q.value.occurrences,"no-padding":``},{default:c(()=>[h(`table`,ze,[h(`thead`,Be,[h(`tr`,null,[(r(),m(p,null,a([`time`,`site`,`method`,`url`,`release`,`user`],e=>h(`th`,{key:e,scope:`col`,class:`px-4 py-2 text-left font-medium text-fg`},f(q.value[e]),1)),64))])]),h(`tbody`,Ve,[(r(!0),m(p,null,a(G.occurrences.data,t=>(r(),m(`tr`,{key:t.id,class:e(t.id===G.event?.id?`bg-accent-soft text-accent-soft-fg`:`hover:bg-hover`)},[h(`td`,He,[t.id===G.event?.id?(r(),m(`span`,Ue,f(J(t.created_at))+` · `+f(q.value.shown),1)):(r(),o(i(d),{key:1,href:l.route(`admin.errors.show`,{issue:G.issue.id,event:t.id}),"preserve-scroll":``,class:`text-accent hover:text-accent-hover hover:underline`,dusk:`error-occurrence`},{default:c(()=>[s(f(J(t.created_at)),1)]),_:2},1032,[`href`]))]),h(`td`,We,f(t.site??q.value.none),1),h(`td`,Ge,f(t.method??q.value.none),1),h(`td`,Ke,f(t.path??q.value.none),1),h(`td`,qe,f(t.release),1),h(`td`,Je,f(t.user_id??q.value.none),1)],2))),128))])]),G.occurrences.last_page>1?(r(),o(re,{key:0,paginator:G.occurrences},null,8,[`paginator`])):t(``,!0)]),_:1},8,[`title`])]),_:1},8,[`title`]))}};export{G as default};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/app-BCJOqmKO.js b/packages/admin/dist/assets/app-Cdw8k5No.js
similarity index 86%
rename from packages/admin/dist/assets/app-BCJOqmKO.js
rename to packages/admin/dist/assets/app-Cdw8k5No.js
index 0032554c..c4f86928 100644
--- a/packages/admin/dist/assets/app-BCJOqmKO.js
+++ b/packages/admin/dist/assets/app-Cdw8k5No.js
@@ -1,2 +1,2 @@
-const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Index-ZYMbBsuF.js","assets/dist-Bie52OmN.js","assets/AdminLayout-DBeSErmz.js","assets/LocaleSwitcher-DAWnmZni.js","assets/AdminLayout-QfjingjX.css","assets/AdminButton-KiIJ2sLW.js","assets/AdminCard-YbEwPtJz.js","assets/AdminModal-DKazeNNa.js","assets/Login-DTW3u1G9.js","assets/Index-CG3NSbtt.js","assets/Index-DsLgvcm0.js","assets/Dashboard-C9RqcuE0.js","assets/BarChart-wks0RLo_.js","assets/Index-D_2Ij5S1.js","assets/AdminPagination-D7rwNfhd.js","assets/Show-CS6rq4RP.js","assets/Index-B9KqS9R5.js","assets/Settings-BrbOStcv.js","assets/FormField-B-XX4VFv.js","assets/FormField-0qI8GE1v.css","assets/contentLocale-BV_E0iGS.js","assets/Edit-CyzBsvwt.js","assets/Create-DutDQiBS.js","assets/ContentLocaleSwitcher-HJzbB87a.js","assets/Edit-BEWPbBmM.js","assets/recordActions-CtRs42tG.js","assets/Index-DaeZ92GY.js","assets/AdminDataTable-6eKgKDeA.js","assets/Edit-Bm3W6F3v.js","assets/Index-BNmU5PEL.js","assets/Create-CbxIXc0Q.js","assets/Edit-Cp-LIO0D.js","assets/Index-C63EL5RF.js"])))=>i.map(i=>d[i]);
-import{k as e,l as t,o as n,s as r,t as i}from"./dist-Bie52OmN.js";var a=`modulepreload`,o=function(e){return`/vendor/atrium/`+e},s={},c=function(e){return e.pathname.endsWith(`.css`)},l=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},u=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),u=i?.nonce||i?.getAttribute(`nonce`);function d(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function f(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=d(t.map(t=>{t=o(t,n);let r=f(t),i=c(r);return l(s,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:a,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,u&&t.setAttribute(`nonce`,u),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},d=String.prototype.replace,f=/%20/g,p={RFC1738:`RFC1738`,RFC3986:`RFC3986`},m={RFC1738:function(e){return d.call(e,f,`+`)},RFC3986:function(e){return String(e)}},h=p.RFC1738;p.RFC3986;var g=p.RFC3986,_=Object.prototype.hasOwnProperty,v=Array.isArray,y=new WeakMap,b=function(e,t){return y.set(e,t),e};function x(e){return y.has(e)}var S=function(e){return y.get(e)},C=function(e,t){y.set(e,t)},w=(function(){let e=[];for(let t=0;t<256;++t)e.push(`%`+((t<16?`0`:``)+t.toString(16)).toUpperCase());return e})(),T=function(e){for(;e.length>1;){let t=e.pop(),n=t.obj[t.prop];if(v(n)){let e=[];for(let t=0;t=0&&e>S(t)&&C(t,e)}return t},l)},te=function(e){let t=e.replace(/\+/g,` `);try{return decodeURIComponent(t)}catch{return t}},D=1024,ne=function(e,t,n,r){if(e.length===0)return e;let i=e;typeof e==`symbol`?i=Symbol.prototype.toString.call(e):typeof e!=`string`&&(i=String(e));let a=``;for(let e=0;e=D?i.slice(e,e+D):i;if(e+D=55296&&n<=56319&&(t=t.slice(0,-1),--e)}let n=[];for(let e=0;e=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||r===h&&(i===40||i===41)?n[n.length]=t.charAt(e):i<128?n[n.length]=w[i]:i<2048?n[n.length]=w[192|i>>6]+w[128|i&63]:i<55296||i>=57344?n[n.length]=w[224|i>>12]+w[128|i>>6&63]+w[128|i&63]:(e+=1,i=65536+((i&1023)<<10|t.charCodeAt(e)&1023),n[n.length]=w[240|i>>18]+w[128|i>>12&63]+w[128|i>>6&63]+w[128|i&63])}a+=n.join(``)}return a},re=function(e){let t=[{obj:{o:e},prop:`o`}],n=new WeakMap;for(let e=0;en?b(E(a,{plainObjects:r}),a.length-1):a},k=function(e,t){if(v(e)){let n=[];for(let r=0;r0?_.join(`,`)||null:void 0}];else if(j(l))S=l;else{let e=Object.keys(_);S=u?e.sort(u):e}let C=s?t.replace(/\./g,`%2E`):t,w=r&&j(_)&&_.length===1?C+`[]`:C;if(i&&j(_)&&_.length===0)return w+`[]`;for(let t=0;t0?d+u:``}var L=Object.prototype.hasOwnProperty,R=Array.isArray,z={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,comma:!1,decodeDotInKeys:!1,decoder:te,delimiter:`&`,depth:5,duplicates:`combine`,ignoreQueryPrefix:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},B=function(e,t){return e&&typeof e==`string`&&t.comma&&e.indexOf(`,`)>-1?e.split(`,`):e},fe=function(e,t){let n={__proto__:null},r=t.ignoreQueryPrefix?e.replace(/^\?/,``):e,i=t.parameterLimit===1/0?void 0:t.parameterLimit,a=r.split(t.delimiter,i),o=0;for(;o-1&&(c=R(c)?[c]:c),t.comma&&R(c)&&c.length>t.arrayLimit&&(c=O([],c,t.arrayLimit,t.plainObjects));let l=L.call(n,s);l&&t.duplicates===`combine`?n[s]=O(n[s],c,t.arrayLimit,t.plainObjects):l&&t.duplicates!==`last`||(n[s]=c)}return n},pe=function(e,t,n,r){let i=r?t:B(t,n);for(let t=e.length-1;t>=0;--t){let r,a=e[t];if(a===`[]`&&n.parseArrays)r=x(i)?i:n.allowEmptyArrays&&(i===``||n.strictNullHandling&&i===null)?[]:O([],i,n.arrayLimit,n.plainObjects);else{r=n.plainObjects?Object.create(null):{};let e=a.charAt(0)===`[`&&a.charAt(a.length-1)===`]`?a.slice(1,-1):a,t=n.decodeDotInKeys?e.replace(/%2E/g,`.`):e,o=parseInt(t,10),s=!isNaN(o)&&a!==t&&String(o)===t&&o>=0&&n.parseArrays;!n.parseArrays&&t===``?r={0:i}:s&&o<=n.arrayLimit?(r=[],r[o]=i):s?(r[o]=i,b(r,o)):t!==`__proto__`&&(r[t]=i)}i=r}return i},me=function(e,t,n,r){if(!e)return;let i=n.allowDots?e.replace(/\.([^.[]+)/g,`[$1]`):e,a=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,s=n.depth>0&&a.exec(i),c=s?i.slice(0,s.index):i,l=[];if(c){if(!n.plainObjects&&L.call(Object.prototype,c)&&!n.allowPrototypes)return;l.push(c)}let u=0;for(;n.depth>0&&(s=o.exec(i))!==null&&u{try{return decodeURIComponent(e)}catch{return e}})}var H=class{constructor(e,t,n){this.name=e,this.definition=t,this.bindings=t.bindings??{},this.wheres=t.wheres??{},this.config=n}get template(){let e=`${this.origin}/${this.definition.uri}`.replace(/\/+$/,``);return e===``?`/`:e}get origin(){return this.config.absolute?this.definition.domain?`${this.config.url.match(/^\w+:\/\//)[0]}${this.definition.domain}${this.config.port?`:${this.config.port}`:``}`:this.config.url:``}get parameterSegments(){return this.template.match(/{[^}?]+\??}/g)?.map(e=>({name:e.replace(/{|\??}/g,``),required:!/\?}$/.test(e)}))??[]}matchesUrl(e){if(!this.definition.methods.includes(`GET`))return!1;let t=this.template.replace(/[.*+$()[\]]/g,`\\$&`).replace(/(\/?){([^}?]*)(\??)}/g,(e,t,n,r)=>{let i=`(?<${n}>${this.wheres[n]?.replace(/(^\^)|(\$$)/g,``)||`[^/?]+`})`;return r?`(${t}${i})?`:`${t}${i}`}).replace(/^\w+:\/\//,``),[n,r]=e.replace(/^\w+:\/\//,``).split(`?`),i=RegExp(`^${t}/?$`).exec(n);if(!i)try{i=RegExp(`^${t}/?$`).exec(decodeURI(n))}catch{}if(i){for(let e in i.groups)typeof i.groups[e]==`string`&&(i.groups[e]=V(i.groups[e]));return{params:i.groups,query:ge(r)}}return!1}compile(e){return this.parameterSegments.length?this.template.replace(/{([^}?]+)(\??)}/g,(t,n,r)=>{if(!r&&[null,void 0].includes(e[n]))throw Error(`Ziggy error: '${n}' parameter is required for route '${this.name}'.`);if(this.wheres[n]&&!RegExp(`^${r?`(${this.wheres[n]})?`:this.wheres[n]}$`).test(e[n]??``))throw Error(`Ziggy error: '${n}' parameter '${e[n]}' does not match required format '${this.wheres[n]}' for route '${this.name}'.`);return encodeURI(e[n]??``).replace(/%7C/g,`|`).replace(/%25/g,`%`).replace(/\$/g,`%24`)}).replace(this.config.absolute?/(\.[^/]+?)(\/\/)/:/(^)(\/\/)/,`$1/`).replace(/\/+$/,``):this.template}};function U(e){"@babel/helpers - typeof";return U=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},U(e)}function _e(e,t){if(U(e)!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(U(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ve(e){var t=_e(e,`string`);return U(t)==`symbol`?t:t+``}function ye(e,t,n){return(t=ve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function G(e){for(var t=1;t!this._route.parameterSegments.some(({name:t})=>t===e)).filter(e=>e!==`_query`).reduce((e,t)=>G(G({},e),{},{[t]:this._params[t]}),{});return this._route.compile(this._params)+de(G(G({},e),this._params._query),{addQueryPrefix:!0,arrayFormat:`indices`,encodeValuesOnly:!0,skipNulls:!0,encoder:(e,t)=>typeof e==`boolean`?Number(e):t(e)})}_unresolve(e){e?this._config.absolute&&e.startsWith(`/`)&&(e=this._location().host+e):e=this._currentUrl();let t={},[n,r]=Object.entries(this._config.routes).find(([n,r])=>t=new H(n,r,this._config).matchesUrl(e))||[void 0,void 0];return G(G({name:n},t),{},{route:r})}_currentUrl(){let{host:e,pathname:t,search:n}=this._location();return(this._config.absolute?e+t:t.replace(this._config.url.replace(/^\w*:\/\/[^/]+/,``),``).replace(/^\/+/,`/`))+n}current(e,t){let{name:n,params:r,query:i,route:a}=this._unresolve();if(!e)return n;let o=RegExp(`^${e.replace(/\./g,`\\.`).replace(/\*/g,`.*`)}$`).test(n);if([null,void 0].includes(t)||!o)return o;let s=new H(n,a,this._config);t=this._parse(t,s);let c=G(G({},r),i);if(Object.values(t).every(e=>!e)&&!Object.values(c).some(e=>e!==void 0))return!0;let l=(e,t)=>Object.entries(e).every(([e,n])=>Array.isArray(n)&&Array.isArray(t[e])?n.every(n=>t[e].includes(n)||t[e].includes(V(String(n)))):typeof n==`object`&&typeof t[e]==`object`&&n!==null&&t[e]!==null?l(n,t[e]):t[e]==n||t[e]==V(String(n)));return l(t,c)}_location(){let{host:e=``,pathname:t=``,search:n=``}=typeof window<`u`?window.location:{},r=typeof this._config.location==`string`?new URL(this._config.location):this._config.location;return{host:r?.host??e,pathname:r?.pathname??t,search:r?.search??n}}get params(){let{params:e,query:t}=this._unresolve();return G(G({},e),t)}get routeParams(){return this._unresolve().params}get queryParams(){return this._unresolve().query}has(e){return this._config.routes.hasOwnProperty(e)}_parse(e={},t=this._route){e??={},e=[`string`,`number`].includes(typeof e)?[e]:e;let n=t.parameterSegments.filter(({name:e})=>!this._config.defaults[e]);return Array.isArray(e)?e=e.reduce((e,t,r)=>n[r]?G(G({},e),{},{[n[r].name]:t}):typeof t==`object`?G(G({},e),t):G(G({},e),{},{[t]:``}),{}):n.length===1&&!e.hasOwnProperty(n[0].name)&&(e.hasOwnProperty(Object.values(t.bindings)[0])||e.hasOwnProperty(`id`))&&(e={[n[0].name]:e}),G(G({},this._defaults(t)),this._substituteBindings(e,t))}_defaults(e){return e.parameterSegments.filter(({name:e})=>this._config.defaults[e]).reduce((e,{name:t},n)=>G(G({},e),{},{[t]:this._config.defaults[t]}),{})}_substituteBindings(e,{bindings:t,parameterSegments:n}){return Object.entries(e).reduce((e,[r,i])=>{if(!i||typeof i!=`object`||Array.isArray(i)||!n.some(({name:e})=>e===r))return G(G({},e),{},{[r]:i});let a=i.hasOwnProperty(t[r])?t[r]:i.hasOwnProperty(`id`)?`id`:void 0;if(a===void 0)throw Error(`Ziggy error: object passed as '${r}' parameter is missing route model binding key '${t[r]}'.`);return G(G({},e),{},{[r]:i[a]})},{})}valueOf(){return this.toString()}};function xe(e,t,n,r){let i=new be(e,t,n,r);return e?i.toString():i}var Se={install(e,t){let n=(e,n,r,i=t)=>xe(e,n,r,typeof i==`function`?i():i);parseInt(e.version)>2?(e.config.globalProperties.route=n,e.provide(`route`,n)):e.mixin({methods:{route:n}})}};function Ce(e,t){let n=Math.trunc(t)%10,r=Math.trunc(t)%100;switch(e){case`ja`:case`zh_CN`:case`tr`:case`kk`:case`uz`:return 0;case`fr`:return t===0||t===1?0:1;case`ru`:case`uk`:case`be`:return n===1&&r!==11?0:n>=2&&n<=4&&(r<10||r>=20)?1:2;case`pl`:return t===1?0:n>=2&&n<=4&&(r<12||r>14)?1:2;default:return t===1?0:1}}function K(){return n().props.translations||{}}function we(){return n().props.locale||`en`}function q(e,t){return Object.entries(t).reduce((e,[t,n])=>e.replaceAll(`:${t}`,String(n??``)),e)}function J(e,t={}){let n=K()[e];return typeof n==`string`?q(n,t):e}function Te(e,t,n={}){let r=K()[e];if(typeof r!=`string`)return e;let i=r.split(`|`),a=i[Math.min(Ce(we(),t),i.length-1)];return q(a,{count:t,...n})}var Ee={install(e){e.config.globalProperties.$t=J,e.config.globalProperties.$tc=Te}},De=[`graphite`,`day`,`night`,`sand`,`contrast`],Y=typeof window<`u`&&window.matchMedia?window.matchMedia(`(prefers-color-scheme: dark)`):null,X=null,Oe=e=>e===`system`?Y?.matches?`night`:`graphite`:De.includes(e)?e:`graphite`;function Z(e){if(!e)return;X=e;let t=document.documentElement;t.dataset.themeChoice=e,t.dataset.theme=Oe(e)}Y?.addEventListener(`change`,()=>{X===`system`&&Z(X)});var Q=e=>{let t=e.detail.page.props.locale;t&&(document.documentElement.lang=t.replace(`_`,`-`))};r.on(`success`,Q),r.on(`navigate`,Q);var $=e=>Z(e.detail.page.props.theme);r.on(`success`,$),r.on(`navigate`,$);var ke=Object.assign({"./Pages/Admin/ApiTokens/Index.vue":()=>u(()=>import(`./Index-ZYMbBsuF.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])),"./Pages/Admin/Auth/Login.vue":()=>u(()=>import(`./Login-DTW3u1G9.js`),__vite__mapDeps([8,1,3])),"./Pages/Admin/Backups/Index.vue":()=>u(()=>import(`./Index-CG3NSbtt.js`),__vite__mapDeps([9,1,2,3,4,5,6,7])),"./Pages/Admin/Cache/Index.vue":()=>u(()=>import(`./Index-DsLgvcm0.js`),__vite__mapDeps([10,1,2,3,4,5])),"./Pages/Admin/Dashboard.vue":()=>u(()=>import(`./Dashboard-C9RqcuE0.js`),__vite__mapDeps([11,1,2,3,4,12])),"./Pages/Admin/Errors/Index.vue":()=>u(()=>import(`./Index-D_2Ij5S1.js`),__vite__mapDeps([13,1,2,3,4,5,14])),"./Pages/Admin/Errors/Show.vue":()=>u(()=>import(`./Show-CS6rq4RP.js`),__vite__mapDeps([15,1,2,3,4,5,6,14,12])),"./Pages/Admin/Modules/Index.vue":()=>u(()=>import(`./Index-B9KqS9R5.js`),__vite__mapDeps([16,1,2,3,4,5])),"./Pages/Admin/Modules/Settings.vue":()=>u(()=>import(`./Settings-BrbOStcv.js`),__vite__mapDeps([17,1,2,3,4,5,6,18,7,19,20])),"./Pages/Admin/Profile/Edit.vue":()=>u(()=>import(`./Edit-CyzBsvwt.js`),__vite__mapDeps([21,1,2,3,4])),"./Pages/Admin/Resource/Create.vue":()=>u(()=>import(`./Create-DutDQiBS.js`),__vite__mapDeps([22,1,2,3,4,5,6,23,18,7,19,20])),"./Pages/Admin/Resource/Edit.vue":()=>u(()=>import(`./Edit-BEWPbBmM.js`),__vite__mapDeps([24,1,2,3,4,5,6,23,18,7,19,20,25])),"./Pages/Admin/Resource/Index.vue":()=>u(()=>import(`./Index-DaeZ92GY.js`),__vite__mapDeps([26,1,2,3,4,5,27,14,7,25])),"./Pages/Admin/Roles/Edit.vue":()=>u(()=>import(`./Edit-Bm3W6F3v.js`),__vite__mapDeps([28,1,2,3,4,5,6])),"./Pages/Admin/Roles/Index.vue":()=>u(()=>import(`./Index-BNmU5PEL.js`),__vite__mapDeps([29,1,2,3,4,5,7])),"./Pages/Admin/Users/Create.vue":()=>u(()=>import(`./Create-CbxIXc0Q.js`),__vite__mapDeps([30,1,2,3,4,5,6,18,7,19])),"./Pages/Admin/Users/Edit.vue":()=>u(()=>import(`./Edit-Cp-LIO0D.js`),__vite__mapDeps([31,1,2,3,4,5,6,18,7,19])),"./Pages/Admin/Users/Index.vue":()=>u(()=>import(`./Index-C63EL5RF.js`),__vite__mapDeps([32,1,2,3,4,5,27,14,7]))});i({title:e=>{let t=document.querySelector(`title`)?.dataset.brand||`Atrium`;return e?`${e} — ${t}`:t},resolve:e=>{let t=ke[`./Pages/${e}.vue`];if(!t)throw Error(`Atrium: page "${e}" not found`);return t()},setup({el:n,App:r,props:i,plugin:a}){Z(i.initialPage.props.theme),t({render:()=>e(r,i)}).use(a).use(Se).use(Ee).mount(n)},progress:{color:`var(--atrium-accent)`}});export{J as n,Z as t};
\ No newline at end of file
+const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Index-Cl336b7A.js","assets/dist-Bie52OmN.js","assets/AdminLayout-D_QE0gy-.js","assets/LocaleSwitcher-DAWnmZni.js","assets/AdminLayout-QfjingjX.css","assets/AdminButton-KiIJ2sLW.js","assets/AdminCard-YbEwPtJz.js","assets/AdminModal-DKazeNNa.js","assets/Login-DTW3u1G9.js","assets/Index-BjHeDb5k.js","assets/Index-CRJysQbh.js","assets/Dashboard-DkBuI6d2.js","assets/BarChart-wks0RLo_.js","assets/labels-DbKc85RH.js","assets/Index-BzKcFwHs.js","assets/AdminPagination-D7rwNfhd.js","assets/Show-BBgM4LS_.js","assets/Index-0in3vE-5.js","assets/Settings-7h1Ram2n.js","assets/FormField-WE0R-1uV.js","assets/FormField-0qI8GE1v.css","assets/contentLocale-BV_E0iGS.js","assets/Index-BYxAQoR9.js","assets/MonitoringChart-DLuy45XH.js","assets/MonitoringChart-QzapWRK7.css","assets/Query-CxDUw4Nd.js","assets/Edit-BtQ-5Jec.js","assets/Create-kOifSpfZ.js","assets/ContentLocaleSwitcher-HJzbB87a.js","assets/Edit-CG7aI-oj.js","assets/recordActions-CtRs42tG.js","assets/Index-DywV1SDR.js","assets/AdminDataTable-6eKgKDeA.js","assets/Edit-B4rBMOtq.js","assets/Index-CrHgEVrS.js","assets/Create-CJxinjjT.js","assets/Edit-BB6QBa8T.js","assets/Index-ClSNZWUj.js"])))=>i.map(i=>d[i]);
+import{k as e,l as t,o as n,s as r,t as i}from"./dist-Bie52OmN.js";var a=`modulepreload`,o=function(e){return`/vendor/atrium/`+e},s={},c=function(e){return e.pathname.endsWith(`.css`)},l=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},u=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),u=i?.nonce||i?.getAttribute(`nonce`);function d(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function f(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=d(t.map(t=>{t=o(t,n);let r=f(t),i=c(r);return l(s,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:a,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,u&&t.setAttribute(`nonce`,u),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},d=String.prototype.replace,f=/%20/g,p={RFC1738:`RFC1738`,RFC3986:`RFC3986`},m={RFC1738:function(e){return d.call(e,f,`+`)},RFC3986:function(e){return String(e)}},h=p.RFC1738;p.RFC3986;var g=p.RFC3986,_=Object.prototype.hasOwnProperty,v=Array.isArray,y=new WeakMap,b=function(e,t){return y.set(e,t),e};function x(e){return y.has(e)}var S=function(e){return y.get(e)},C=function(e,t){y.set(e,t)},w=(function(){let e=[];for(let t=0;t<256;++t)e.push(`%`+((t<16?`0`:``)+t.toString(16)).toUpperCase());return e})(),T=function(e){for(;e.length>1;){let t=e.pop(),n=t.obj[t.prop];if(v(n)){let e=[];for(let t=0;t=0&&e>S(t)&&C(t,e)}return t},l)},te=function(e){let t=e.replace(/\+/g,` `);try{return decodeURIComponent(t)}catch{return t}},D=1024,ne=function(e,t,n,r){if(e.length===0)return e;let i=e;typeof e==`symbol`?i=Symbol.prototype.toString.call(e):typeof e!=`string`&&(i=String(e));let a=``;for(let e=0;e=D?i.slice(e,e+D):i;if(e+D=55296&&n<=56319&&(t=t.slice(0,-1),--e)}let n=[];for(let e=0;e=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||r===h&&(i===40||i===41)?n[n.length]=t.charAt(e):i<128?n[n.length]=w[i]:i<2048?n[n.length]=w[192|i>>6]+w[128|i&63]:i<55296||i>=57344?n[n.length]=w[224|i>>12]+w[128|i>>6&63]+w[128|i&63]:(e+=1,i=65536+((i&1023)<<10|t.charCodeAt(e)&1023),n[n.length]=w[240|i>>18]+w[128|i>>12&63]+w[128|i>>6&63]+w[128|i&63])}a+=n.join(``)}return a},re=function(e){let t=[{obj:{o:e},prop:`o`}],n=new WeakMap;for(let e=0;en?b(E(a,{plainObjects:r}),a.length-1):a},k=function(e,t){if(v(e)){let n=[];for(let r=0;r0?_.join(`,`)||null:void 0}];else if(j(l))S=l;else{let e=Object.keys(_);S=u?e.sort(u):e}let C=s?t.replace(/\./g,`%2E`):t,w=r&&j(_)&&_.length===1?C+`[]`:C;if(i&&j(_)&&_.length===0)return w+`[]`;for(let t=0;t0?d+u:``}var L=Object.prototype.hasOwnProperty,R=Array.isArray,z={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,comma:!1,decodeDotInKeys:!1,decoder:te,delimiter:`&`,depth:5,duplicates:`combine`,ignoreQueryPrefix:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},B=function(e,t){return e&&typeof e==`string`&&t.comma&&e.indexOf(`,`)>-1?e.split(`,`):e},fe=function(e,t){let n={__proto__:null},r=t.ignoreQueryPrefix?e.replace(/^\?/,``):e,i=t.parameterLimit===1/0?void 0:t.parameterLimit,a=r.split(t.delimiter,i),o=0;for(;o-1&&(c=R(c)?[c]:c),t.comma&&R(c)&&c.length>t.arrayLimit&&(c=O([],c,t.arrayLimit,t.plainObjects));let l=L.call(n,s);l&&t.duplicates===`combine`?n[s]=O(n[s],c,t.arrayLimit,t.plainObjects):l&&t.duplicates!==`last`||(n[s]=c)}return n},pe=function(e,t,n,r){let i=r?t:B(t,n);for(let t=e.length-1;t>=0;--t){let r,a=e[t];if(a===`[]`&&n.parseArrays)r=x(i)?i:n.allowEmptyArrays&&(i===``||n.strictNullHandling&&i===null)?[]:O([],i,n.arrayLimit,n.plainObjects);else{r=n.plainObjects?Object.create(null):{};let e=a.charAt(0)===`[`&&a.charAt(a.length-1)===`]`?a.slice(1,-1):a,t=n.decodeDotInKeys?e.replace(/%2E/g,`.`):e,o=parseInt(t,10),s=!isNaN(o)&&a!==t&&String(o)===t&&o>=0&&n.parseArrays;!n.parseArrays&&t===``?r={0:i}:s&&o<=n.arrayLimit?(r=[],r[o]=i):s?(r[o]=i,b(r,o)):t!==`__proto__`&&(r[t]=i)}i=r}return i},me=function(e,t,n,r){if(!e)return;let i=n.allowDots?e.replace(/\.([^.[]+)/g,`[$1]`):e,a=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,s=n.depth>0&&a.exec(i),c=s?i.slice(0,s.index):i,l=[];if(c){if(!n.plainObjects&&L.call(Object.prototype,c)&&!n.allowPrototypes)return;l.push(c)}let u=0;for(;n.depth>0&&(s=o.exec(i))!==null&&u{try{return decodeURIComponent(e)}catch{return e}})}var H=class{constructor(e,t,n){this.name=e,this.definition=t,this.bindings=t.bindings??{},this.wheres=t.wheres??{},this.config=n}get template(){let e=`${this.origin}/${this.definition.uri}`.replace(/\/+$/,``);return e===``?`/`:e}get origin(){return this.config.absolute?this.definition.domain?`${this.config.url.match(/^\w+:\/\//)[0]}${this.definition.domain}${this.config.port?`:${this.config.port}`:``}`:this.config.url:``}get parameterSegments(){return this.template.match(/{[^}?]+\??}/g)?.map(e=>({name:e.replace(/{|\??}/g,``),required:!/\?}$/.test(e)}))??[]}matchesUrl(e){if(!this.definition.methods.includes(`GET`))return!1;let t=this.template.replace(/[.*+$()[\]]/g,`\\$&`).replace(/(\/?){([^}?]*)(\??)}/g,(e,t,n,r)=>{let i=`(?<${n}>${this.wheres[n]?.replace(/(^\^)|(\$$)/g,``)||`[^/?]+`})`;return r?`(${t}${i})?`:`${t}${i}`}).replace(/^\w+:\/\//,``),[n,r]=e.replace(/^\w+:\/\//,``).split(`?`),i=RegExp(`^${t}/?$`).exec(n);if(!i)try{i=RegExp(`^${t}/?$`).exec(decodeURI(n))}catch{}if(i){for(let e in i.groups)typeof i.groups[e]==`string`&&(i.groups[e]=V(i.groups[e]));return{params:i.groups,query:ge(r)}}return!1}compile(e){return this.parameterSegments.length?this.template.replace(/{([^}?]+)(\??)}/g,(t,n,r)=>{if(!r&&[null,void 0].includes(e[n]))throw Error(`Ziggy error: '${n}' parameter is required for route '${this.name}'.`);if(this.wheres[n]&&!RegExp(`^${r?`(${this.wheres[n]})?`:this.wheres[n]}$`).test(e[n]??``))throw Error(`Ziggy error: '${n}' parameter '${e[n]}' does not match required format '${this.wheres[n]}' for route '${this.name}'.`);return encodeURI(e[n]??``).replace(/%7C/g,`|`).replace(/%25/g,`%`).replace(/\$/g,`%24`)}).replace(this.config.absolute?/(\.[^/]+?)(\/\/)/:/(^)(\/\/)/,`$1/`).replace(/\/+$/,``):this.template}};function U(e){"@babel/helpers - typeof";return U=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},U(e)}function _e(e,t){if(U(e)!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(U(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ve(e){var t=_e(e,`string`);return U(t)==`symbol`?t:t+``}function ye(e,t,n){return(t=ve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function G(e){for(var t=1;t!this._route.parameterSegments.some(({name:t})=>t===e)).filter(e=>e!==`_query`).reduce((e,t)=>G(G({},e),{},{[t]:this._params[t]}),{});return this._route.compile(this._params)+de(G(G({},e),this._params._query),{addQueryPrefix:!0,arrayFormat:`indices`,encodeValuesOnly:!0,skipNulls:!0,encoder:(e,t)=>typeof e==`boolean`?Number(e):t(e)})}_unresolve(e){e?this._config.absolute&&e.startsWith(`/`)&&(e=this._location().host+e):e=this._currentUrl();let t={},[n,r]=Object.entries(this._config.routes).find(([n,r])=>t=new H(n,r,this._config).matchesUrl(e))||[void 0,void 0];return G(G({name:n},t),{},{route:r})}_currentUrl(){let{host:e,pathname:t,search:n}=this._location();return(this._config.absolute?e+t:t.replace(this._config.url.replace(/^\w*:\/\/[^/]+/,``),``).replace(/^\/+/,`/`))+n}current(e,t){let{name:n,params:r,query:i,route:a}=this._unresolve();if(!e)return n;let o=RegExp(`^${e.replace(/\./g,`\\.`).replace(/\*/g,`.*`)}$`).test(n);if([null,void 0].includes(t)||!o)return o;let s=new H(n,a,this._config);t=this._parse(t,s);let c=G(G({},r),i);if(Object.values(t).every(e=>!e)&&!Object.values(c).some(e=>e!==void 0))return!0;let l=(e,t)=>Object.entries(e).every(([e,n])=>Array.isArray(n)&&Array.isArray(t[e])?n.every(n=>t[e].includes(n)||t[e].includes(V(String(n)))):typeof n==`object`&&typeof t[e]==`object`&&n!==null&&t[e]!==null?l(n,t[e]):t[e]==n||t[e]==V(String(n)));return l(t,c)}_location(){let{host:e=``,pathname:t=``,search:n=``}=typeof window<`u`?window.location:{},r=typeof this._config.location==`string`?new URL(this._config.location):this._config.location;return{host:r?.host??e,pathname:r?.pathname??t,search:r?.search??n}}get params(){let{params:e,query:t}=this._unresolve();return G(G({},e),t)}get routeParams(){return this._unresolve().params}get queryParams(){return this._unresolve().query}has(e){return this._config.routes.hasOwnProperty(e)}_parse(e={},t=this._route){e??={},e=[`string`,`number`].includes(typeof e)?[e]:e;let n=t.parameterSegments.filter(({name:e})=>!this._config.defaults[e]);return Array.isArray(e)?e=e.reduce((e,t,r)=>n[r]?G(G({},e),{},{[n[r].name]:t}):typeof t==`object`?G(G({},e),t):G(G({},e),{},{[t]:``}),{}):n.length===1&&!e.hasOwnProperty(n[0].name)&&(e.hasOwnProperty(Object.values(t.bindings)[0])||e.hasOwnProperty(`id`))&&(e={[n[0].name]:e}),G(G({},this._defaults(t)),this._substituteBindings(e,t))}_defaults(e){return e.parameterSegments.filter(({name:e})=>this._config.defaults[e]).reduce((e,{name:t},n)=>G(G({},e),{},{[t]:this._config.defaults[t]}),{})}_substituteBindings(e,{bindings:t,parameterSegments:n}){return Object.entries(e).reduce((e,[r,i])=>{if(!i||typeof i!=`object`||Array.isArray(i)||!n.some(({name:e})=>e===r))return G(G({},e),{},{[r]:i});let a=i.hasOwnProperty(t[r])?t[r]:i.hasOwnProperty(`id`)?`id`:void 0;if(a===void 0)throw Error(`Ziggy error: object passed as '${r}' parameter is missing route model binding key '${t[r]}'.`);return G(G({},e),{},{[r]:i[a]})},{})}valueOf(){return this.toString()}};function xe(e,t,n,r){let i=new be(e,t,n,r);return e?i.toString():i}var Se={install(e,t){let n=(e,n,r,i=t)=>xe(e,n,r,typeof i==`function`?i():i);parseInt(e.version)>2?(e.config.globalProperties.route=n,e.provide(`route`,n)):e.mixin({methods:{route:n}})}};function Ce(e,t){let n=Math.trunc(t)%10,r=Math.trunc(t)%100;switch(e){case`ja`:case`zh_CN`:case`tr`:case`kk`:case`uz`:return 0;case`fr`:return t===0||t===1?0:1;case`ru`:case`uk`:case`be`:return n===1&&r!==11?0:n>=2&&n<=4&&(r<10||r>=20)?1:2;case`pl`:return t===1?0:n>=2&&n<=4&&(r<12||r>14)?1:2;default:return t===1?0:1}}function K(){return n().props.translations||{}}function we(){return n().props.locale||`en`}function q(e,t){return Object.entries(t).reduce((e,[t,n])=>e.replaceAll(`:${t}`,String(n??``)),e)}function J(e,t={}){let n=K()[e];return typeof n==`string`?q(n,t):e}function Te(e,t,n={}){let r=K()[e];if(typeof r!=`string`)return e;let i=r.split(`|`),a=i[Math.min(Ce(we(),t),i.length-1)];return q(a,{count:t,...n})}var Ee={install(e){e.config.globalProperties.$t=J,e.config.globalProperties.$tc=Te}},De=[`graphite`,`day`,`night`,`sand`,`contrast`],Y=typeof window<`u`&&window.matchMedia?window.matchMedia(`(prefers-color-scheme: dark)`):null,X=null,Oe=e=>e===`system`?Y?.matches?`night`:`graphite`:De.includes(e)?e:`graphite`;function Z(e){if(!e)return;X=e;let t=document.documentElement;t.dataset.themeChoice=e,t.dataset.theme=Oe(e)}Y?.addEventListener(`change`,()=>{X===`system`&&Z(X)});var Q=e=>{let t=e.detail.page.props.locale;t&&(document.documentElement.lang=t.replace(`_`,`-`))};r.on(`success`,Q),r.on(`navigate`,Q);var $=e=>Z(e.detail.page.props.theme);r.on(`success`,$),r.on(`navigate`,$);var ke=Object.assign({"./Pages/Admin/ApiTokens/Index.vue":()=>u(()=>import(`./Index-Cl336b7A.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])),"./Pages/Admin/Auth/Login.vue":()=>u(()=>import(`./Login-DTW3u1G9.js`),__vite__mapDeps([8,1,3])),"./Pages/Admin/Backups/Index.vue":()=>u(()=>import(`./Index-BjHeDb5k.js`),__vite__mapDeps([9,1,2,3,4,5,6,7])),"./Pages/Admin/Cache/Index.vue":()=>u(()=>import(`./Index-CRJysQbh.js`),__vite__mapDeps([10,1,2,3,4,5])),"./Pages/Admin/Dashboard.vue":()=>u(()=>import(`./Dashboard-DkBuI6d2.js`),__vite__mapDeps([11,1,2,3,4,12,13])),"./Pages/Admin/Errors/Index.vue":()=>u(()=>import(`./Index-BzKcFwHs.js`),__vite__mapDeps([14,1,2,3,4,5,15])),"./Pages/Admin/Errors/Show.vue":()=>u(()=>import(`./Show-BBgM4LS_.js`),__vite__mapDeps([16,1,2,3,4,5,6,15,12])),"./Pages/Admin/Modules/Index.vue":()=>u(()=>import(`./Index-0in3vE-5.js`),__vite__mapDeps([17,1,2,3,4,5])),"./Pages/Admin/Modules/Settings.vue":()=>u(()=>import(`./Settings-7h1Ram2n.js`),__vite__mapDeps([18,1,2,3,4,5,6,19,7,20,21])),"./Pages/Admin/Monitoring/Index.vue":()=>u(()=>import(`./Index-BYxAQoR9.js`),__vite__mapDeps([22,1,2,3,4,6,23,13,24])),"./Pages/Admin/Monitoring/Query.vue":()=>u(()=>import(`./Query-CxDUw4Nd.js`),__vite__mapDeps([25,1,2,3,4,6,23,13,24])),"./Pages/Admin/Profile/Edit.vue":()=>u(()=>import(`./Edit-BtQ-5Jec.js`),__vite__mapDeps([26,1,2,3,4])),"./Pages/Admin/Resource/Create.vue":()=>u(()=>import(`./Create-kOifSpfZ.js`),__vite__mapDeps([27,1,2,3,4,5,6,28,19,7,20,21])),"./Pages/Admin/Resource/Edit.vue":()=>u(()=>import(`./Edit-CG7aI-oj.js`),__vite__mapDeps([29,1,2,3,4,5,6,28,19,7,20,21,30])),"./Pages/Admin/Resource/Index.vue":()=>u(()=>import(`./Index-DywV1SDR.js`),__vite__mapDeps([31,1,2,3,4,5,32,15,7,30])),"./Pages/Admin/Roles/Edit.vue":()=>u(()=>import(`./Edit-B4rBMOtq.js`),__vite__mapDeps([33,1,2,3,4,5,6])),"./Pages/Admin/Roles/Index.vue":()=>u(()=>import(`./Index-CrHgEVrS.js`),__vite__mapDeps([34,1,2,3,4,5,7])),"./Pages/Admin/Users/Create.vue":()=>u(()=>import(`./Create-CJxinjjT.js`),__vite__mapDeps([35,1,2,3,4,5,6,19,7,20])),"./Pages/Admin/Users/Edit.vue":()=>u(()=>import(`./Edit-BB6QBa8T.js`),__vite__mapDeps([36,1,2,3,4,5,6,19,7,20])),"./Pages/Admin/Users/Index.vue":()=>u(()=>import(`./Index-ClSNZWUj.js`),__vite__mapDeps([37,1,2,3,4,5,32,15,7]))});i({title:e=>{let t=document.querySelector(`title`)?.dataset.brand||`Atrium`;return e?`${e} — ${t}`:t},resolve:e=>{let t=ke[`./Pages/${e}.vue`];if(!t)throw Error(`Atrium: page "${e}" not found`);return t()},setup({el:n,App:r,props:i,plugin:a}){Z(i.initialPage.props.theme),t({render:()=>e(r,i)}).use(a).use(Se).use(Ee).mount(n)},progress:{color:`var(--atrium-accent)`}});export{J as n,Z as t};
\ No newline at end of file
diff --git a/packages/admin/dist/assets/app-DBhrvJI0.css b/packages/admin/dist/assets/app-DBhrvJI0.css
new file mode 100644
index 00000000..3936dcef
--- /dev/null
+++ b/packages/admin/dist/assets/app-DBhrvJI0.css
@@ -0,0 +1,2 @@
+/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
+@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-4xl:56rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--font-brand:"Space Grotesk", var(--font-sans);--color-muted:var(--atrium-muted);--color-line:var(--atrium-line)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}html{accent-color:var(--atrium-accent);background-color:var(--atrium-page);color:var(--atrium-fg)}*{--tw-ring-offset-color:var(--atrium-surface)}::placeholder{color:var(--atrium-muted);opacity:1}select:not([multiple]):not([size]){appearance:none;background-color:var(--atrium-surface);background-image:linear-gradient(45deg,#0000 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,#0000 50%);background-position:calc(100% - 1rem),calc(100% - .6875rem);background-repeat:no-repeat;background-size:.3125rem .3125rem}select option{background-color:var(--atrium-surface);color:var(--atrium-fg)}}@layer components;@layer utilities{.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-y-0{inset-block:0}.top-0{top:0}.top-1{top:var(--spacing)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-4{top:calc(var(--spacing) * 4)}.right-0{right:0}.right-1{right:var(--spacing)}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-0{left:0}.left-2{left:calc(var(--spacing) * 2)}.left-2\.5{left:calc(var(--spacing) * 2.5)}.isolate{isolation:isolate}.z-10{z-index:10}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mx-auto{margin-inline:auto}.-mt-4{margin-top:calc(var(--spacing) * -4)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mr-1{margin-right:var(--spacing)}.mr-1\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mr-3{margin-right:calc(var(--spacing) * 3)}.mr-4{margin-right:calc(var(--spacing) * 4)}.-mb-px{margin-bottom:-1px}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:var(--spacing)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.-ml-0\.5{margin-left:calc(var(--spacing) * -.5)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.ml-1{margin-left:var(--spacing)}.ml-1\.5{margin-left:calc(var(--spacing) * 1.5)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-3{margin-left:calc(var(--spacing) * 3)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-6{margin-left:calc(var(--spacing) * 6)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-square{aspect-ratio:1}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-16{height:calc(var(--spacing) * 16)}.h-24{height:calc(var(--spacing) * 24)}.h-full{height:100%}.h-px{height:1px}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\[90vh\]{max-height:90vh}.max-h-\[min\(36rem\,calc\(100vh-8rem\)\)\]{max-height:min(36rem,100vh - 8rem)}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.w-0\.5{width:calc(var(--spacing) * .5)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-\[4\.75rem\]{width:4.75rem}.w-\[22rem\]{width:22rem}.w-auto{width:auto}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-14{max-width:calc(var(--spacing) * 14)}.max-w-56{max-width:calc(var(--spacing) * 56)}.max-w-\[85\%\]{max-width:85%}.max-w-\[90\%\]{max-width:90%}.max-w-\[calc\(100vw-2rem\)\]{max-width:calc(100vw - 2rem)}.max-w-md{max-width:var(--container-md)}.max-w-none{max-width:none}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-48{min-width:calc(var(--spacing) * 48)}.min-w-full{min-width:100%}.flex-1{flex:1}.flex-none{flex:none}.flex-shrink{flex-shrink:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.border-separate{border-collapse:separate}.border-spacing-0{--tw-border-spacing-x:0px;--tw-border-spacing-y:0px;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-0{--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-4{--tw-translate-y:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-95{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-110{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, )}.transform-gpu{transform:translateZ(0) var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, )}.animate-spin{animation:var(--animate-spin)}.cursor-move{cursor:move}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.list-disc{list-style-type:disc}.appearance-none{appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.grid-cols-\[auto_auto_1fr\]{grid-template-columns:auto auto 1fr}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-px{gap:1px}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}:where(.-space-x-px>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(-1px * var(--tw-space-x-reverse));margin-inline-end:calc(-1px * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-1>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(var(--spacing) * var(--tw-space-x-reverse));margin-inline-end:calc(var(--spacing) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 3) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-4>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 4) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-8>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 8) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-x-reverse)))}.gap-y-1{row-gap:var(--spacing)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-line>:not(:last-child)){border-color:var(--atrium-line)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t-sm{border-top-left-radius:var(--radius-sm);border-top-right-radius:var(--radius-sm)}.rounded-l-md{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.rounded-r-md{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.rounded-b-lg{border-bottom-right-radius:var(--radius-lg);border-bottom-left-radius:var(--radius-lg)}.rounded-b-xl{border-bottom-right-radius:var(--radius-xl);border-bottom-left-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent{border-color:var(--atrium-accent)}.border-accent-hover{border-color:var(--atrium-accent-hover)}.border-accent-soft{border-color:var(--atrium-accent-soft)}.border-badge-line{border-color:var(--atrium-badge-line)}.border-current{border-color:currentColor}.border-danger{border-color:var(--atrium-danger)}.border-danger-soft{border-color:var(--atrium-danger-soft)}.border-field{border-color:var(--atrium-field)}.border-focus{border-color:var(--atrium-focus)}.border-line{border-color:var(--atrium-line)}.border-sidebar-line{border-color:var(--atrium-sidebar-line)}.border-success{border-color:var(--atrium-success)}.border-transparent{border-color:#0000}.border-warning-soft-fg{border-color:var(--atrium-warning-soft-fg)}.bg-accent{background-color:var(--atrium-accent)}.bg-accent-hover{background-color:var(--atrium-accent-hover)}.bg-accent-soft{background-color:var(--atrium-accent-soft)}.bg-black\/50{background-color:oklab(0% none none/.5)}.bg-current{background-color:currentColor}.bg-danger{background-color:var(--atrium-danger)}.bg-danger-hover{background-color:var(--atrium-danger-hover)}.bg-danger-soft{background-color:var(--atrium-danger-soft)}.bg-field{background-color:var(--atrium-field)}.bg-inherit{background-color:inherit}.bg-line{background-color:var(--atrium-line)}.bg-off{background-color:var(--atrium-off)}.bg-page{background-color:var(--atrium-page)}.bg-sidebar{background-color:var(--atrium-sidebar)}.bg-sidebar-active{background-color:var(--atrium-sidebar-active)}.bg-success-soft{background-color:var(--atrium-success-soft)}.bg-surface{background-color:var(--atrium-surface)}.bg-surface-alt{background-color:var(--atrium-surface-alt)}.bg-surface\/75{background-color:var(--atrium-surface)}@supports (color:color-mix(in lab, red, red)){.bg-surface\/75{background-color:color-mix(in oklab, var(--atrium-surface) 75%, transparent)}}.bg-transparent{background-color:#0000}.bg-warning-soft{background-color:var(--atrium-warning-soft)}.bg-white{background-color:#fff}.bg-contain{background-size:contain}.bg-center{background-position:50%}.bg-left{background-position:0}.bg-no-repeat{background-repeat:no-repeat}.fill-accent{fill:var(--atrium-accent)}.fill-fg{fill:var(--atrium-fg)}.fill-mark{fill:var(--atrium-mark)}.fill-mark-accent{fill:var(--atrium-mark-accent)}.fill-surface{fill:var(--atrium-surface)}.object-cover{object-fit:cover}.p-0{padding:0}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pb-1{padding-bottom:var(--spacing)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.pl-6{padding-left:calc(var(--spacing) * 6)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-9{padding-left:calc(var(--spacing) * 9)}.pl-10{padding-left:calc(var(--spacing) * 10)}.pl-12{padding-left:calc(var(--spacing) * 12)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-brand{font-family:var(--font-brand)}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[-0\.01em\]{--tw-tracking:-.01em;letter-spacing:-.01em}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent{color:var(--atrium-accent)}.text-accent-hover{color:var(--atrium-accent-hover)}.text-accent-soft-fg{color:var(--atrium-accent-soft-fg)}.text-danger{color:var(--atrium-danger)}.text-danger-soft-fg{color:var(--atrium-danger-soft-fg)}.text-fg{color:var(--atrium-fg)}.text-muted{color:var(--atrium-muted)}.text-off-fg{color:var(--atrium-off-fg)}.text-on-accent{color:var(--atrium-on-accent)}.text-on-danger{color:var(--atrium-on-danger)}.text-sidebar-active-fg{color:var(--atrium-sidebar-active-fg)}.text-sidebar-fg{color:var(--atrium-sidebar-fg)}.text-sidebar-muted{color:var(--atrium-sidebar-muted)}.text-success{color:var(--atrium-success)}.text-success-soft-fg{color:var(--atrium-success-soft-fg)}.text-transparent{color:#0000}.text-warning-soft-fg{color:var(--atrium-warning-soft-fg)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.underline{text-decoration-line:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.placeholder-muted::placeholder{color:var(--atrium-muted)}.accent-hover{accent-color:var(--atrium-hover)}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-75{opacity:.75}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[inset_3px_0_0_var\(--atrium-sidebar-accent\)\]{--tw-shadow:inset 3px 0 0 var(--tw-shadow-color,var(--atrium-sidebar-accent));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring,.ring-1{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-field{--tw-ring-color:var(--atrium-field)}.ring-focus{--tw-ring-color:var(--atrium-focus)}.ring-line{--tw-ring-color:var(--atrium-line)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-75{--tw-duration:75ms;transition-duration:75ms}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.ring-inset{--tw-ring-inset:inset}@media (hover:hover){:is(:where(.group):hover .group-hover\:text-fg){color:var(--atrium-fg)}:is(:where(.group):hover .group-hover\:opacity-100){opacity:1}}.file\:mr-4::file-selector-button{margin-right:calc(var(--spacing) * 4)}.file\:rounded-md::file-selector-button{border-radius:var(--radius-md)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-accent-soft::file-selector-button{background-color:var(--atrium-accent-soft)}.file\:px-4::file-selector-button{padding-inline:calc(var(--spacing) * 4)}.file\:py-2::file-selector-button{padding-block:calc(var(--spacing) * 2)}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-accent-hover::file-selector-button{color:var(--atrium-accent-hover)}.last\:mb-0:last-child{margin-bottom:0}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media (hover:hover){.hover\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\:border-fg:hover{border-color:var(--atrium-fg)}.hover\:border-field:hover{border-color:var(--atrium-field)}.hover\:border-focus:hover{border-color:var(--atrium-focus)}.hover\:bg-accent-hover:hover{background-color:var(--atrium-accent-hover)}.hover\:bg-accent-soft:hover{background-color:var(--atrium-accent-soft)}.hover\:bg-danger-hover:hover{background-color:var(--atrium-danger-hover)}.hover\:bg-danger-soft:hover{background-color:var(--atrium-danger-soft)}.hover\:bg-hover:hover{background-color:var(--atrium-hover)}.hover\:bg-sidebar-hover:hover{background-color:var(--atrium-sidebar-hover)}.hover\:text-accent:hover{color:var(--atrium-accent)}.hover\:text-accent-hover:hover{color:var(--atrium-accent-hover)}.hover\:text-accent-soft-fg:hover{color:var(--atrium-accent-soft-fg)}.hover\:text-danger:hover{color:var(--atrium-danger)}.hover\:text-danger-soft-fg:hover{color:var(--atrium-danger-soft-fg)}.hover\:text-fg:hover{color:var(--atrium-fg)}.hover\:text-sidebar-fg:hover{color:var(--atrium-sidebar-fg)}.hover\:underline:hover{text-decoration-line:underline}.hover\:file\:bg-accent-soft:hover::file-selector-button{background-color:var(--atrium-accent-soft)}}.focus\:border-focus:focus{border-color:var(--atrium-focus)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-danger:focus{--tw-ring-color:var(--atrium-danger)}.focus\:ring-focus:focus{--tw-ring-color:var(--atrium-focus)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset, ) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-focus:focus-visible{--tw-ring-color:var(--atrium-focus)}.focus-visible\:ring-sidebar-accent:focus-visible{--tw-ring-color:var(--atrium-sidebar-accent)}.focus-visible\:outline:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\:outline-focus:focus-visible{outline-color:var(--atrium-focus)}.focus-visible\:ring-inset:focus-visible{--tw-ring-inset:inset}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-off:disabled{background-color:var(--atrium-off)}.disabled\:text-muted:disabled{color:var(--atrium-muted)}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=40rem){.sm\:col-span-2{grid-column:span 2/span 2}.sm\:my-8{margin-block:calc(var(--spacing) * 8)}.sm\:block{display:block}.sm\:hidden{display:none}.sm\:inline{display:inline}.sm\:w-full{width:100%}.sm\:max-w-2xl{max-width:var(--container-2xl)}.sm\:max-w-32{max-width:calc(var(--spacing) * 32)}.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:max-w-md{max-width:var(--container-md)}.sm\:max-w-sm{max-width:var(--container-sm)}.sm\:max-w-xl{max-width:var(--container-xl)}.sm\:translate-y-0{--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.sm\:scale-95{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.sm\:scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:items-end{align-items:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-2{gap:calc(var(--spacing) * 2)}.sm\:gap-4{gap:calc(var(--spacing) * 4)}.sm\:px-2{padding-inline:calc(var(--spacing) * 2)}.sm\:px-4{padding-inline:calc(var(--spacing) * 4)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}.sm\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.sm\:text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}}@media (width>=48rem){.md\:block{display:block}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}:where(.md\:space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 3) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-x-reverse)))}}@media (width>=64rem){.lg\:col-span-2{grid-column:span 2/span 2}.lg\:col-span-4{grid-column:span 4/span 4}.lg\:block{display:block}.lg\:hidden{display:none}.lg\:w-20{width:calc(var(--spacing) * 20)}.lg\:w-64{width:calc(var(--spacing) * 64)}.lg\:translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:items-start{align-items:flex-start}.lg\:justify-between{justify-content:space-between}.lg\:gap-3{gap:calc(var(--spacing) * 3)}.lg\:p-6{padding:calc(var(--spacing) * 6)}.lg\:px-2{padding-inline:calc(var(--spacing) * 2)}.lg\:px-6{padding-inline:calc(var(--spacing) * 6)}.lg\:px-8{padding-inline:calc(var(--spacing) * 8)}.lg\:pl-20{padding-left:calc(var(--spacing) * 20)}.lg\:pl-64{padding-left:calc(var(--spacing) * 64)}.lg\:text-center{text-align:center}}@media (width>=80rem){.xl\:max-w-48{max-width:calc(var(--spacing) * 48)}.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}}@font-face{font-family:Space Grotesk;font-style:normal;font-display:swap;font-weight:600;src:url(/vendor/atrium/assets/space-grotesk-latin-600-normal-DjKNqYRj.woff2)format("woff2"),url(/vendor/atrium/assets/space-grotesk-latin-600-normal-BflQw4A9.woff)format("woff")}:root,[data-theme=graphite]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--atrium-sidebar:#111827;--atrium-sidebar-fg:#f9fafb;--atrium-sidebar-muted:#9ca3af;--atrium-sidebar-hover:#1f2937;--atrium-sidebar-active:#1f2937;--atrium-sidebar-active-fg:#fff;--atrium-sidebar-accent:#60a5fa;--atrium-sidebar-line:#1f2937;--atrium-page:#f3f4f6;--atrium-surface:#fff;--atrium-surface-alt:#f9fafb;--atrium-hover:#f3f4f6;--atrium-fg:#111827;--atrium-muted:#4b5563;--atrium-line:#e5e7eb;--atrium-field:#7e8691;--atrium-accent:#2563eb;--atrium-accent-hover:#1d4ed8;--atrium-on-accent:#fff;--atrium-accent-soft:#dbeafe;--atrium-accent-soft-fg:#1e40af;--atrium-focus:#2563eb;--atrium-off:#f3f4f6;--atrium-off-fg:#374151;--atrium-badge-line:transparent;--atrium-danger:#c81e1e;--atrium-danger-hover:#991b1b;--atrium-on-danger:#fff;--atrium-danger-soft:#fee2e2;--atrium-danger-soft-fg:#991b1b;--atrium-success:#15803d;--atrium-success-soft:#dcfce7;--atrium-success-soft-fg:#166534;--atrium-warning-soft:#fef3c7;--atrium-warning-soft-fg:#92400e;--atrium-mark:#fff;--atrium-mark-accent:#60a5fa}[data-theme=day]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--atrium-sidebar:#fff;--atrium-sidebar-fg:#1f2937;--atrium-sidebar-muted:#64748b;--atrium-sidebar-hover:#f1f5f9;--atrium-sidebar-active:#eef2ff;--atrium-sidebar-active-fg:#3730a3;--atrium-sidebar-accent:#4f46e5;--atrium-sidebar-line:#e2e8f0;--atrium-page:#f8fafc;--atrium-surface:#fff;--atrium-surface-alt:#f8fafc;--atrium-hover:#f1f5f9;--atrium-fg:#0f172a;--atrium-muted:#475569;--atrium-line:#e2e8f0;--atrium-field:#8391a5;--atrium-accent:#4f46e5;--atrium-accent-hover:#4338ca;--atrium-on-accent:#fff;--atrium-accent-soft:#e0e7ff;--atrium-accent-soft-fg:#3730a3;--atrium-focus:#4f46e5;--atrium-off:#f1f5f9;--atrium-off-fg:#334155;--atrium-badge-line:transparent;--atrium-danger:#c81e1e;--atrium-danger-hover:#991b1b;--atrium-on-danger:#fff;--atrium-danger-soft:#fee2e2;--atrium-danger-soft-fg:#991b1b;--atrium-success:#15803d;--atrium-success-soft:#dcfce7;--atrium-success-soft-fg:#166534;--atrium-warning-soft:#fef3c7;--atrium-warning-soft-fg:#92400e;--atrium-mark:#0f172a;--atrium-mark-accent:#4f46e5}[data-theme=night]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--atrium-sidebar:#0a0e14;--atrium-sidebar-fg:#e6eaf0;--atrium-sidebar-muted:#8b95a5;--atrium-sidebar-hover:#141b26;--atrium-sidebar-active:#1a2230;--atrium-sidebar-active-fg:#fff;--atrium-sidebar-accent:#8ab4ff;--atrium-sidebar-line:#1a2230;--atrium-page:#0f141b;--atrium-surface:#161d27;--atrium-surface-alt:#121821;--atrium-hover:#1f2733;--atrium-fg:#e6eaf0;--atrium-muted:#a0aaba;--atrium-line:#253041;--atrium-field:#5f6d82;--atrium-accent:#8ab4ff;--atrium-accent-hover:#b0ccff;--atrium-on-accent:#0a0e14;--atrium-accent-soft:#1e2f4d;--atrium-accent-soft-fg:#b9d1ff;--atrium-focus:#8ab4ff;--atrium-off:#222b38;--atrium-off-fg:#c3cbd6;--atrium-badge-line:transparent;--atrium-danger:#ff8a8a;--atrium-danger-hover:#ffb0b0;--atrium-on-danger:#0a0e14;--atrium-danger-soft:#3d1c22;--atrium-danger-soft-fg:#ffc2c2;--atrium-success:#5fd38d;--atrium-success-soft:#173524;--atrium-success-soft-fg:#a6ebc0;--atrium-warning-soft:#3a2e12;--atrium-warning-soft-fg:#fcd98a;--atrium-mark:#fff;--atrium-mark-accent:#8ab4ff}[data-theme=sand]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--atrium-sidebar:#1f1a14;--atrium-sidebar-fg:#f5efe6;--atrium-sidebar-muted:#b3a796;--atrium-sidebar-hover:#2b241c;--atrium-sidebar-active:#342b21;--atrium-sidebar-active-fg:#fff;--atrium-sidebar-accent:#f2a65a;--atrium-sidebar-line:#342b21;--atrium-page:#f7f3ec;--atrium-surface:#fff;--atrium-surface-alt:#fbf8f3;--atrium-hover:#f1ece4;--atrium-fg:#1f1a14;--atrium-muted:#5c5246;--atrium-line:#e7dfd2;--atrium-field:#958672;--atrium-accent:#a6490a;--atrium-accent-hover:#853a07;--atrium-on-accent:#fff;--atrium-accent-soft:#fce7d2;--atrium-accent-soft-fg:#7a3506;--atrium-focus:#a6490a;--atrium-off:#f1ece4;--atrium-off-fg:#4a4137;--atrium-badge-line:transparent;--atrium-danger:#b42318;--atrium-danger-hover:#912018;--atrium-on-danger:#fff;--atrium-danger-soft:#fde4e1;--atrium-danger-soft-fg:#8a1c12;--atrium-success:#2e7d32;--atrium-success-soft:#e3f2df;--atrium-success-soft-fg:#1f5a23;--atrium-warning-soft:#fbefc5;--atrium-warning-soft-fg:#7a4a06;--atrium-mark:#f5efe6;--atrium-mark-accent:#f2a65a}[data-theme=contrast]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--atrium-sidebar:#000;--atrium-sidebar-fg:#fff;--atrium-sidebar-muted:#d4d4d4;--atrium-sidebar-hover:#262626;--atrium-sidebar-active:#ffd400;--atrium-sidebar-active-fg:#000;--atrium-sidebar-accent:#ffd400;--atrium-sidebar-line:#fff;--atrium-page:#fff;--atrium-surface:#fff;--atrium-surface-alt:#fff;--atrium-hover:#fff2a8;--atrium-fg:#000;--atrium-muted:#262626;--atrium-line:#000;--atrium-field:#000;--atrium-accent:#0033a0;--atrium-accent-hover:#001f66;--atrium-on-accent:#fff;--atrium-accent-soft:#ffd400;--atrium-accent-soft-fg:#000;--atrium-focus:#0033a0;--atrium-off:#fff;--atrium-off-fg:#000;--atrium-badge-line:#000;--atrium-danger:#b00020;--atrium-danger-hover:#7a0016;--atrium-on-danger:#fff;--atrium-danger-soft:#ffe0e0;--atrium-danger-soft-fg:#7a0016;--atrium-success:#006b2d;--atrium-success-soft:#d9f5e3;--atrium-success-soft-fg:#003d1a;--atrium-warning-soft:#ffd400;--atrium-warning-soft-fg:#000;--atrium-mark:#fff;--atrium-mark-accent:#ffd400}[data-theme=contrast] .border{border-width:2px}[data-theme=contrast] .border-t{border-top-width:2px}[data-theme=contrast] .border-b{border-bottom-width:2px}[data-theme=contrast] .border-l{border-left-width:2px}[data-theme=contrast] .border-r{border-right-width:2px}[data-theme=contrast] .divide-y>:not(:last-child){border-bottom-width:2px}[data-credit]{--atrium-credit-logo:url(/vendor/atrium/assets/logo-DDS3n-zU.svg)}:where([data-theme=graphite],[data-theme=night],[data-theme=sand],[data-theme=contrast]) [data-credit-on=sidebar],:where([data-theme=night]) [data-credit-on=page]{--atrium-credit-logo:url(/vendor/atrium/assets/logo-white-BqJt87jq.svg)}select:not([multiple]):not([size]){padding-right:2rem}@property --tw-border-spacing-x{syntax:"";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"";inherits:false;initial-value:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}
diff --git a/packages/admin/dist/assets/app-XteR4oRF.css b/packages/admin/dist/assets/app-XteR4oRF.css
deleted file mode 100644
index 222780a6..00000000
--- a/packages/admin/dist/assets/app-XteR4oRF.css
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
-@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-4xl:56rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--font-brand:"Space Grotesk", var(--font-sans)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}html{accent-color:var(--atrium-accent);background-color:var(--atrium-page);color:var(--atrium-fg)}*{--tw-ring-offset-color:var(--atrium-surface)}::placeholder{color:var(--atrium-muted);opacity:1}select:not([multiple]):not([size]){appearance:none;background-color:var(--atrium-surface);background-image:linear-gradient(45deg,#0000 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,#0000 50%);background-position:calc(100% - 1rem),calc(100% - .6875rem);background-repeat:no-repeat;background-size:.3125rem .3125rem}select option{background-color:var(--atrium-surface);color:var(--atrium-fg)}}@layer components;@layer utilities{.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-y-0{inset-block:0}.top-0{top:0}.top-1{top:var(--spacing)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-4{top:calc(var(--spacing) * 4)}.right-0{right:0}.right-1{right:var(--spacing)}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-0{left:0}.left-2{left:calc(var(--spacing) * 2)}.left-2\.5{left:calc(var(--spacing) * 2.5)}.isolate{isolation:isolate}.z-10{z-index:10}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mx-auto{margin-inline:auto}.-mt-4{margin-top:calc(var(--spacing) * -4)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mr-1{margin-right:var(--spacing)}.mr-1\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mr-3{margin-right:calc(var(--spacing) * 3)}.mr-4{margin-right:calc(var(--spacing) * 4)}.-mb-px{margin-bottom:-1px}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:var(--spacing)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.-ml-0\.5{margin-left:calc(var(--spacing) * -.5)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.ml-1{margin-left:var(--spacing)}.ml-1\.5{margin-left:calc(var(--spacing) * 1.5)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-3{margin-left:calc(var(--spacing) * 3)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-6{margin-left:calc(var(--spacing) * 6)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-square{aspect-ratio:1}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-16{height:calc(var(--spacing) * 16)}.h-24{height:calc(var(--spacing) * 24)}.h-full{height:100%}.h-px{height:1px}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\[90vh\]{max-height:90vh}.max-h-\[min\(36rem\,calc\(100vh-8rem\)\)\]{max-height:min(36rem,100vh - 8rem)}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.w-0\.5{width:calc(var(--spacing) * .5)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-\[4\.75rem\]{width:4.75rem}.w-\[22rem\]{width:22rem}.w-auto{width:auto}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-14{max-width:calc(var(--spacing) * 14)}.max-w-56{max-width:calc(var(--spacing) * 56)}.max-w-\[85\%\]{max-width:85%}.max-w-\[90\%\]{max-width:90%}.max-w-\[calc\(100vw-2rem\)\]{max-width:calc(100vw - 2rem)}.max-w-md{max-width:var(--container-md)}.max-w-none{max-width:none}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-48{min-width:calc(var(--spacing) * 48)}.min-w-full{min-width:100%}.flex-1{flex:1}.flex-none{flex:none}.flex-shrink{flex-shrink:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.border-separate{border-collapse:separate}.border-spacing-0{--tw-border-spacing-x:0px;--tw-border-spacing-y:0px;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-0{--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-4{--tw-translate-y:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-95{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-110{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, )}.transform-gpu{transform:translateZ(0) var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, )}.animate-spin{animation:var(--animate-spin)}.cursor-move{cursor:move}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.list-disc{list-style-type:disc}.appearance-none{appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.grid-cols-\[auto_auto_1fr\]{grid-template-columns:auto auto 1fr}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-px{gap:1px}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}:where(.-space-x-px>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(-1px * var(--tw-space-x-reverse));margin-inline-end:calc(-1px * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-1>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(var(--spacing) * var(--tw-space-x-reverse));margin-inline-end:calc(var(--spacing) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 3) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-4>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 4) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-8>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 8) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-x-reverse)))}.gap-y-1{row-gap:var(--spacing)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-line>:not(:last-child)){border-color:var(--atrium-line)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t-sm{border-top-left-radius:var(--radius-sm);border-top-right-radius:var(--radius-sm)}.rounded-l-md{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.rounded-r-md{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.rounded-b-lg{border-bottom-right-radius:var(--radius-lg);border-bottom-left-radius:var(--radius-lg)}.rounded-b-xl{border-bottom-right-radius:var(--radius-xl);border-bottom-left-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent{border-color:var(--atrium-accent)}.border-accent-hover{border-color:var(--atrium-accent-hover)}.border-accent-soft{border-color:var(--atrium-accent-soft)}.border-badge-line{border-color:var(--atrium-badge-line)}.border-current{border-color:currentColor}.border-danger{border-color:var(--atrium-danger)}.border-danger-soft{border-color:var(--atrium-danger-soft)}.border-field{border-color:var(--atrium-field)}.border-focus{border-color:var(--atrium-focus)}.border-line{border-color:var(--atrium-line)}.border-sidebar-line{border-color:var(--atrium-sidebar-line)}.border-success{border-color:var(--atrium-success)}.border-transparent{border-color:#0000}.border-warning-soft-fg{border-color:var(--atrium-warning-soft-fg)}.bg-accent{background-color:var(--atrium-accent)}.bg-accent-hover{background-color:var(--atrium-accent-hover)}.bg-accent-soft{background-color:var(--atrium-accent-soft)}.bg-black\/50{background-color:oklab(0% none none/.5)}.bg-current{background-color:currentColor}.bg-danger{background-color:var(--atrium-danger)}.bg-danger-hover{background-color:var(--atrium-danger-hover)}.bg-danger-soft{background-color:var(--atrium-danger-soft)}.bg-field{background-color:var(--atrium-field)}.bg-inherit{background-color:inherit}.bg-line{background-color:var(--atrium-line)}.bg-off{background-color:var(--atrium-off)}.bg-page{background-color:var(--atrium-page)}.bg-sidebar{background-color:var(--atrium-sidebar)}.bg-sidebar-active{background-color:var(--atrium-sidebar-active)}.bg-success-soft{background-color:var(--atrium-success-soft)}.bg-surface{background-color:var(--atrium-surface)}.bg-surface-alt{background-color:var(--atrium-surface-alt)}.bg-surface\/75{background-color:var(--atrium-surface)}@supports (color:color-mix(in lab, red, red)){.bg-surface\/75{background-color:color-mix(in oklab, var(--atrium-surface) 75%, transparent)}}.bg-transparent{background-color:#0000}.bg-warning-soft{background-color:var(--atrium-warning-soft)}.bg-white{background-color:#fff}.bg-contain{background-size:contain}.bg-center{background-position:50%}.bg-left{background-position:0}.bg-no-repeat{background-repeat:no-repeat}.fill-accent{fill:var(--atrium-accent)}.fill-fg{fill:var(--atrium-fg)}.fill-mark{fill:var(--atrium-mark)}.fill-mark-accent{fill:var(--atrium-mark-accent)}.fill-surface{fill:var(--atrium-surface)}.object-cover{object-fit:cover}.p-0{padding:0}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pb-1{padding-bottom:var(--spacing)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.pl-6{padding-left:calc(var(--spacing) * 6)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-9{padding-left:calc(var(--spacing) * 9)}.pl-10{padding-left:calc(var(--spacing) * 10)}.pl-12{padding-left:calc(var(--spacing) * 12)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-brand{font-family:var(--font-brand)}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[-0\.01em\]{--tw-tracking:-.01em;letter-spacing:-.01em}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent{color:var(--atrium-accent)}.text-accent-hover{color:var(--atrium-accent-hover)}.text-accent-soft-fg{color:var(--atrium-accent-soft-fg)}.text-danger{color:var(--atrium-danger)}.text-danger-soft-fg{color:var(--atrium-danger-soft-fg)}.text-fg{color:var(--atrium-fg)}.text-muted{color:var(--atrium-muted)}.text-off-fg{color:var(--atrium-off-fg)}.text-on-accent{color:var(--atrium-on-accent)}.text-on-danger{color:var(--atrium-on-danger)}.text-sidebar-active-fg{color:var(--atrium-sidebar-active-fg)}.text-sidebar-fg{color:var(--atrium-sidebar-fg)}.text-sidebar-muted{color:var(--atrium-sidebar-muted)}.text-success{color:var(--atrium-success)}.text-success-soft-fg{color:var(--atrium-success-soft-fg)}.text-transparent{color:#0000}.text-warning-soft-fg{color:var(--atrium-warning-soft-fg)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.underline{text-decoration-line:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.placeholder-muted::placeholder{color:var(--atrium-muted)}.accent-hover{accent-color:var(--atrium-hover)}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-75{opacity:.75}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[inset_3px_0_0_var\(--atrium-sidebar-accent\)\]{--tw-shadow:inset 3px 0 0 var(--tw-shadow-color,var(--atrium-sidebar-accent));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring,.ring-1{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-field{--tw-ring-color:var(--atrium-field)}.ring-focus{--tw-ring-color:var(--atrium-focus)}.ring-line{--tw-ring-color:var(--atrium-line)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-75{--tw-duration:75ms;transition-duration:75ms}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.ring-inset{--tw-ring-inset:inset}@media (hover:hover){:is(:where(.group):hover .group-hover\:text-fg){color:var(--atrium-fg)}:is(:where(.group):hover .group-hover\:opacity-100){opacity:1}}.file\:mr-4::file-selector-button{margin-right:calc(var(--spacing) * 4)}.file\:rounded-md::file-selector-button{border-radius:var(--radius-md)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-accent-soft::file-selector-button{background-color:var(--atrium-accent-soft)}.file\:px-4::file-selector-button{padding-inline:calc(var(--spacing) * 4)}.file\:py-2::file-selector-button{padding-block:calc(var(--spacing) * 2)}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-accent-hover::file-selector-button{color:var(--atrium-accent-hover)}.last\:mb-0:last-child{margin-bottom:0}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media (hover:hover){.hover\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\:border-fg:hover{border-color:var(--atrium-fg)}.hover\:border-field:hover{border-color:var(--atrium-field)}.hover\:border-focus:hover{border-color:var(--atrium-focus)}.hover\:bg-accent-hover:hover{background-color:var(--atrium-accent-hover)}.hover\:bg-accent-soft:hover{background-color:var(--atrium-accent-soft)}.hover\:bg-danger-hover:hover{background-color:var(--atrium-danger-hover)}.hover\:bg-danger-soft:hover{background-color:var(--atrium-danger-soft)}.hover\:bg-hover:hover{background-color:var(--atrium-hover)}.hover\:bg-sidebar-hover:hover{background-color:var(--atrium-sidebar-hover)}.hover\:text-accent:hover{color:var(--atrium-accent)}.hover\:text-accent-hover:hover{color:var(--atrium-accent-hover)}.hover\:text-accent-soft-fg:hover{color:var(--atrium-accent-soft-fg)}.hover\:text-danger:hover{color:var(--atrium-danger)}.hover\:text-danger-soft-fg:hover{color:var(--atrium-danger-soft-fg)}.hover\:text-fg:hover{color:var(--atrium-fg)}.hover\:text-sidebar-fg:hover{color:var(--atrium-sidebar-fg)}.hover\:underline:hover{text-decoration-line:underline}.hover\:file\:bg-accent-soft:hover::file-selector-button{background-color:var(--atrium-accent-soft)}}.focus\:border-focus:focus{border-color:var(--atrium-focus)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-danger:focus{--tw-ring-color:var(--atrium-danger)}.focus\:ring-focus:focus{--tw-ring-color:var(--atrium-focus)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset, ) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-focus:focus-visible{--tw-ring-color:var(--atrium-focus)}.focus-visible\:ring-sidebar-accent:focus-visible{--tw-ring-color:var(--atrium-sidebar-accent)}.focus-visible\:outline:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\:outline-focus:focus-visible{outline-color:var(--atrium-focus)}.focus-visible\:ring-inset:focus-visible{--tw-ring-inset:inset}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-off:disabled{background-color:var(--atrium-off)}.disabled\:text-muted:disabled{color:var(--atrium-muted)}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=40rem){.sm\:col-span-2{grid-column:span 2/span 2}.sm\:my-8{margin-block:calc(var(--spacing) * 8)}.sm\:block{display:block}.sm\:hidden{display:none}.sm\:inline{display:inline}.sm\:w-full{width:100%}.sm\:max-w-2xl{max-width:var(--container-2xl)}.sm\:max-w-32{max-width:calc(var(--spacing) * 32)}.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:max-w-md{max-width:var(--container-md)}.sm\:max-w-sm{max-width:var(--container-sm)}.sm\:max-w-xl{max-width:var(--container-xl)}.sm\:translate-y-0{--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.sm\:scale-95{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.sm\:scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:items-end{align-items:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-2{gap:calc(var(--spacing) * 2)}.sm\:gap-4{gap:calc(var(--spacing) * 4)}.sm\:px-2{padding-inline:calc(var(--spacing) * 2)}.sm\:px-4{padding-inline:calc(var(--spacing) * 4)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}.sm\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.sm\:text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}}@media (width>=48rem){.md\:block{display:block}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}:where(.md\:space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 3) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-x-reverse)))}}@media (width>=64rem){.lg\:col-span-2{grid-column:span 2/span 2}.lg\:col-span-4{grid-column:span 4/span 4}.lg\:block{display:block}.lg\:hidden{display:none}.lg\:w-20{width:calc(var(--spacing) * 20)}.lg\:w-64{width:calc(var(--spacing) * 64)}.lg\:translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:items-start{align-items:flex-start}.lg\:justify-between{justify-content:space-between}.lg\:gap-3{gap:calc(var(--spacing) * 3)}.lg\:p-6{padding:calc(var(--spacing) * 6)}.lg\:px-2{padding-inline:calc(var(--spacing) * 2)}.lg\:px-6{padding-inline:calc(var(--spacing) * 6)}.lg\:px-8{padding-inline:calc(var(--spacing) * 8)}.lg\:pl-20{padding-left:calc(var(--spacing) * 20)}.lg\:pl-64{padding-left:calc(var(--spacing) * 64)}.lg\:text-center{text-align:center}}@media (width>=80rem){.xl\:max-w-48{max-width:calc(var(--spacing) * 48)}.xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}}@font-face{font-family:Space Grotesk;font-style:normal;font-display:swap;font-weight:600;src:url(/vendor/atrium/assets/space-grotesk-latin-600-normal-DjKNqYRj.woff2)format("woff2"),url(/vendor/atrium/assets/space-grotesk-latin-600-normal-BflQw4A9.woff)format("woff")}:root,[data-theme=graphite]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--atrium-sidebar:#111827;--atrium-sidebar-fg:#f9fafb;--atrium-sidebar-muted:#9ca3af;--atrium-sidebar-hover:#1f2937;--atrium-sidebar-active:#1f2937;--atrium-sidebar-active-fg:#fff;--atrium-sidebar-accent:#60a5fa;--atrium-sidebar-line:#1f2937;--atrium-page:#f3f4f6;--atrium-surface:#fff;--atrium-surface-alt:#f9fafb;--atrium-hover:#f3f4f6;--atrium-fg:#111827;--atrium-muted:#4b5563;--atrium-line:#e5e7eb;--atrium-field:#7e8691;--atrium-accent:#2563eb;--atrium-accent-hover:#1d4ed8;--atrium-on-accent:#fff;--atrium-accent-soft:#dbeafe;--atrium-accent-soft-fg:#1e40af;--atrium-focus:#2563eb;--atrium-off:#f3f4f6;--atrium-off-fg:#374151;--atrium-badge-line:transparent;--atrium-danger:#c81e1e;--atrium-danger-hover:#991b1b;--atrium-on-danger:#fff;--atrium-danger-soft:#fee2e2;--atrium-danger-soft-fg:#991b1b;--atrium-success:#15803d;--atrium-success-soft:#dcfce7;--atrium-success-soft-fg:#166534;--atrium-warning-soft:#fef3c7;--atrium-warning-soft-fg:#92400e;--atrium-mark:#fff;--atrium-mark-accent:#60a5fa}[data-theme=day]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--atrium-sidebar:#fff;--atrium-sidebar-fg:#1f2937;--atrium-sidebar-muted:#64748b;--atrium-sidebar-hover:#f1f5f9;--atrium-sidebar-active:#eef2ff;--atrium-sidebar-active-fg:#3730a3;--atrium-sidebar-accent:#4f46e5;--atrium-sidebar-line:#e2e8f0;--atrium-page:#f8fafc;--atrium-surface:#fff;--atrium-surface-alt:#f8fafc;--atrium-hover:#f1f5f9;--atrium-fg:#0f172a;--atrium-muted:#475569;--atrium-line:#e2e8f0;--atrium-field:#8391a5;--atrium-accent:#4f46e5;--atrium-accent-hover:#4338ca;--atrium-on-accent:#fff;--atrium-accent-soft:#e0e7ff;--atrium-accent-soft-fg:#3730a3;--atrium-focus:#4f46e5;--atrium-off:#f1f5f9;--atrium-off-fg:#334155;--atrium-badge-line:transparent;--atrium-danger:#c81e1e;--atrium-danger-hover:#991b1b;--atrium-on-danger:#fff;--atrium-danger-soft:#fee2e2;--atrium-danger-soft-fg:#991b1b;--atrium-success:#15803d;--atrium-success-soft:#dcfce7;--atrium-success-soft-fg:#166534;--atrium-warning-soft:#fef3c7;--atrium-warning-soft-fg:#92400e;--atrium-mark:#0f172a;--atrium-mark-accent:#4f46e5}[data-theme=night]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--atrium-sidebar:#0a0e14;--atrium-sidebar-fg:#e6eaf0;--atrium-sidebar-muted:#8b95a5;--atrium-sidebar-hover:#141b26;--atrium-sidebar-active:#1a2230;--atrium-sidebar-active-fg:#fff;--atrium-sidebar-accent:#8ab4ff;--atrium-sidebar-line:#1a2230;--atrium-page:#0f141b;--atrium-surface:#161d27;--atrium-surface-alt:#121821;--atrium-hover:#1f2733;--atrium-fg:#e6eaf0;--atrium-muted:#a0aaba;--atrium-line:#253041;--atrium-field:#5f6d82;--atrium-accent:#8ab4ff;--atrium-accent-hover:#b0ccff;--atrium-on-accent:#0a0e14;--atrium-accent-soft:#1e2f4d;--atrium-accent-soft-fg:#b9d1ff;--atrium-focus:#8ab4ff;--atrium-off:#222b38;--atrium-off-fg:#c3cbd6;--atrium-badge-line:transparent;--atrium-danger:#ff8a8a;--atrium-danger-hover:#ffb0b0;--atrium-on-danger:#0a0e14;--atrium-danger-soft:#3d1c22;--atrium-danger-soft-fg:#ffc2c2;--atrium-success:#5fd38d;--atrium-success-soft:#173524;--atrium-success-soft-fg:#a6ebc0;--atrium-warning-soft:#3a2e12;--atrium-warning-soft-fg:#fcd98a;--atrium-mark:#fff;--atrium-mark-accent:#8ab4ff}[data-theme=sand]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--atrium-sidebar:#1f1a14;--atrium-sidebar-fg:#f5efe6;--atrium-sidebar-muted:#b3a796;--atrium-sidebar-hover:#2b241c;--atrium-sidebar-active:#342b21;--atrium-sidebar-active-fg:#fff;--atrium-sidebar-accent:#f2a65a;--atrium-sidebar-line:#342b21;--atrium-page:#f7f3ec;--atrium-surface:#fff;--atrium-surface-alt:#fbf8f3;--atrium-hover:#f1ece4;--atrium-fg:#1f1a14;--atrium-muted:#5c5246;--atrium-line:#e7dfd2;--atrium-field:#958672;--atrium-accent:#a6490a;--atrium-accent-hover:#853a07;--atrium-on-accent:#fff;--atrium-accent-soft:#fce7d2;--atrium-accent-soft-fg:#7a3506;--atrium-focus:#a6490a;--atrium-off:#f1ece4;--atrium-off-fg:#4a4137;--atrium-badge-line:transparent;--atrium-danger:#b42318;--atrium-danger-hover:#912018;--atrium-on-danger:#fff;--atrium-danger-soft:#fde4e1;--atrium-danger-soft-fg:#8a1c12;--atrium-success:#2e7d32;--atrium-success-soft:#e3f2df;--atrium-success-soft-fg:#1f5a23;--atrium-warning-soft:#fbefc5;--atrium-warning-soft-fg:#7a4a06;--atrium-mark:#f5efe6;--atrium-mark-accent:#f2a65a}[data-theme=contrast]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--atrium-sidebar:#000;--atrium-sidebar-fg:#fff;--atrium-sidebar-muted:#d4d4d4;--atrium-sidebar-hover:#262626;--atrium-sidebar-active:#ffd400;--atrium-sidebar-active-fg:#000;--atrium-sidebar-accent:#ffd400;--atrium-sidebar-line:#fff;--atrium-page:#fff;--atrium-surface:#fff;--atrium-surface-alt:#fff;--atrium-hover:#fff2a8;--atrium-fg:#000;--atrium-muted:#262626;--atrium-line:#000;--atrium-field:#000;--atrium-accent:#0033a0;--atrium-accent-hover:#001f66;--atrium-on-accent:#fff;--atrium-accent-soft:#ffd400;--atrium-accent-soft-fg:#000;--atrium-focus:#0033a0;--atrium-off:#fff;--atrium-off-fg:#000;--atrium-badge-line:#000;--atrium-danger:#b00020;--atrium-danger-hover:#7a0016;--atrium-on-danger:#fff;--atrium-danger-soft:#ffe0e0;--atrium-danger-soft-fg:#7a0016;--atrium-success:#006b2d;--atrium-success-soft:#d9f5e3;--atrium-success-soft-fg:#003d1a;--atrium-warning-soft:#ffd400;--atrium-warning-soft-fg:#000;--atrium-mark:#fff;--atrium-mark-accent:#ffd400}[data-theme=contrast] .border{border-width:2px}[data-theme=contrast] .border-t{border-top-width:2px}[data-theme=contrast] .border-b{border-bottom-width:2px}[data-theme=contrast] .border-l{border-left-width:2px}[data-theme=contrast] .border-r{border-right-width:2px}[data-theme=contrast] .divide-y>:not(:last-child){border-bottom-width:2px}[data-credit]{--atrium-credit-logo:url(/vendor/atrium/assets/logo-DDS3n-zU.svg)}:where([data-theme=graphite],[data-theme=night],[data-theme=sand],[data-theme=contrast]) [data-credit-on=sidebar],:where([data-theme=night]) [data-credit-on=page]{--atrium-credit-logo:url(/vendor/atrium/assets/logo-white-BqJt87jq.svg)}select:not([multiple]):not([size]){padding-right:2rem}@property --tw-border-spacing-x{syntax:"";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"";inherits:false;initial-value:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}
diff --git a/packages/admin/dist/assets/labels-DbKc85RH.js b/packages/admin/dist/assets/labels-DbKc85RH.js
new file mode 100644
index 00000000..64846e30
--- /dev/null
+++ b/packages/admin/dist/assets/labels-DbKc85RH.js
@@ -0,0 +1 @@
+function e(e,t,n={}){let r=t.split(`.`).reduce((e,t)=>e&&typeof e==`object`?e[t]:void 0,e);if(typeof r!=`string`)return t;for(let[e,t]of Object.entries(n))r=r.replaceAll(`:${e}`,String(t??``));return r}function t(e,t){return Number(e).toLocaleString(String(t||`en`).replace(`_`,`-`),{maximumFractionDigits:2})}export{t as n,e as t};
\ No newline at end of file
diff --git a/packages/admin/dist/manifest.json b/packages/admin/dist/manifest.json
index 34a11760..bec6a9c5 100644
--- a/packages/admin/dist/manifest.json
+++ b/packages/admin/dist/manifest.json
@@ -21,8 +21,8 @@
"_AdminPagination-D7rwNfhd.js"
]
},
- "_AdminLayout-DBeSErmz.js": {
- "file": "assets/AdminLayout-DBeSErmz.js",
+ "_AdminLayout-D_QE0gy-.js": {
+ "file": "assets/AdminLayout-D_QE0gy-.js",
"name": "AdminLayout",
"imports": [
"_dist-Bie52OmN.js",
@@ -69,13 +69,13 @@
"file": "assets/FormField-0qI8GE1v.css",
"src": "_FormField-0qI8GE1v.css"
},
- "_FormField-B-XX4VFv.js": {
- "file": "assets/FormField-B-XX4VFv.js",
+ "_FormField-WE0R-1uV.js": {
+ "file": "assets/FormField-WE0R-1uV.js",
"name": "FormField",
"imports": [
"_dist-Bie52OmN.js",
"resources/js/app.js",
- "_AdminLayout-DBeSErmz.js",
+ "_AdminLayout-D_QE0gy-.js",
"_AdminModal-DKazeNNa.js",
"_AdminButton-KiIJ2sLW.js"
],
@@ -90,6 +90,21 @@
"_dist-Bie52OmN.js"
]
},
+ "_MonitoringChart-DLuy45XH.js": {
+ "file": "assets/MonitoringChart-DLuy45XH.js",
+ "name": "MonitoringChart",
+ "imports": [
+ "_dist-Bie52OmN.js",
+ "_labels-DbKc85RH.js"
+ ],
+ "css": [
+ "assets/MonitoringChart-QzapWRK7.css"
+ ]
+ },
+ "_MonitoringChart-QzapWRK7.css": {
+ "file": "assets/MonitoringChart-QzapWRK7.css",
+ "src": "_MonitoringChart-QzapWRK7.css"
+ },
"_contentLocale-BV_E0iGS.js": {
"file": "assets/contentLocale-BV_E0iGS.js",
"name": "contentLocale",
@@ -101,6 +116,10 @@
"file": "assets/dist-Bie52OmN.js",
"name": "dist"
},
+ "_labels-DbKc85RH.js": {
+ "file": "assets/labels-DbKc85RH.js",
+ "name": "labels"
+ },
"_recordActions-CtRs42tG.js": {
"file": "assets/recordActions-CtRs42tG.js",
"name": "recordActions"
@@ -122,13 +141,13 @@
"src": "resources/images/alvesoft/logo.svg"
},
"resources/js/Pages/Admin/ApiTokens/Index.vue": {
- "file": "assets/Index-ZYMbBsuF.js",
+ "file": "assets/Index-Cl336b7A.js",
"name": "Index",
"src": "resources/js/Pages/Admin/ApiTokens/Index.vue",
"isDynamicEntry": true,
"imports": [
"_dist-Bie52OmN.js",
- "_AdminLayout-DBeSErmz.js",
+ "_AdminLayout-D_QE0gy-.js",
"resources/js/app.js",
"_AdminButton-KiIJ2sLW.js",
"_AdminCard-YbEwPtJz.js",
@@ -146,60 +165,61 @@
]
},
"resources/js/Pages/Admin/Backups/Index.vue": {
- "file": "assets/Index-CG3NSbtt.js",
+ "file": "assets/Index-BjHeDb5k.js",
"name": "Index",
"src": "resources/js/Pages/Admin/Backups/Index.vue",
"isDynamicEntry": true,
"imports": [
"_dist-Bie52OmN.js",
- "_AdminLayout-DBeSErmz.js",
+ "_AdminLayout-D_QE0gy-.js",
"_AdminButton-KiIJ2sLW.js",
"_AdminCard-YbEwPtJz.js",
"_AdminModal-DKazeNNa.js"
]
},
"resources/js/Pages/Admin/Cache/Index.vue": {
- "file": "assets/Index-DsLgvcm0.js",
+ "file": "assets/Index-CRJysQbh.js",
"name": "Index",
"src": "resources/js/Pages/Admin/Cache/Index.vue",
"isDynamicEntry": true,
"imports": [
"_dist-Bie52OmN.js",
- "_AdminLayout-DBeSErmz.js",
+ "_AdminLayout-D_QE0gy-.js",
"_AdminButton-KiIJ2sLW.js"
]
},
"resources/js/Pages/Admin/Dashboard.vue": {
- "file": "assets/Dashboard-C9RqcuE0.js",
+ "file": "assets/Dashboard-DkBuI6d2.js",
"name": "Dashboard",
"src": "resources/js/Pages/Admin/Dashboard.vue",
"isDynamicEntry": true,
"imports": [
"_dist-Bie52OmN.js",
- "_AdminLayout-DBeSErmz.js",
- "_BarChart-wks0RLo_.js"
+ "_AdminLayout-D_QE0gy-.js",
+ "_BarChart-wks0RLo_.js",
+ "_labels-DbKc85RH.js"
]
},
"resources/js/Pages/Admin/Errors/Index.vue": {
- "file": "assets/Index-D_2Ij5S1.js",
+ "file": "assets/Index-BzKcFwHs.js",
"name": "Index",
"src": "resources/js/Pages/Admin/Errors/Index.vue",
"isDynamicEntry": true,
"imports": [
"_dist-Bie52OmN.js",
- "_AdminLayout-DBeSErmz.js",
+ "_AdminLayout-D_QE0gy-.js",
"_AdminButton-KiIJ2sLW.js",
"_AdminPagination-D7rwNfhd.js"
]
},
"resources/js/Pages/Admin/Errors/Show.vue": {
- "file": "assets/Show-CS6rq4RP.js",
+ "file": "assets/Show-BBgM4LS_.js",
"name": "Show",
"src": "resources/js/Pages/Admin/Errors/Show.vue",
"isDynamicEntry": true,
"imports": [
"_dist-Bie52OmN.js",
- "_AdminLayout-DBeSErmz.js",
+ "_AdminLayout-D_QE0gy-.js",
"_AdminButton-KiIJ2sLW.js",
"_AdminCard-YbEwPtJz.js",
"_AdminPagination-D7rwNfhd.js",
@@ -207,79 +227,105 @@
]
},
"resources/js/Pages/Admin/Modules/Index.vue": {
- "file": "assets/Index-B9KqS9R5.js",
+ "file": "assets/Index-0in3vE-5.js",
"name": "Index",
"src": "resources/js/Pages/Admin/Modules/Index.vue",
"isDynamicEntry": true,
"imports": [
"_dist-Bie52OmN.js",
- "_AdminLayout-DBeSErmz.js",
+ "_AdminLayout-D_QE0gy-.js",
"_AdminButton-KiIJ2sLW.js"
]
},
"resources/js/Pages/Admin/Modules/Settings.vue": {
- "file": "assets/Settings-BrbOStcv.js",
+ "file": "assets/Settings-7h1Ram2n.js",
"name": "Settings",
"src": "resources/js/Pages/Admin/Modules/Settings.vue",
"isDynamicEntry": true,
"imports": [
"_dist-Bie52OmN.js",
- "_AdminLayout-DBeSErmz.js",
+ "_AdminLayout-D_QE0gy-.js",
"_AdminButton-KiIJ2sLW.js",
"_AdminCard-YbEwPtJz.js",
- "_FormField-B-XX4VFv.js",
+ "_FormField-WE0R-1uV.js",
"_contentLocale-BV_E0iGS.js"
]
},
+ "resources/js/Pages/Admin/Monitoring/Index.vue": {
+ "file": "assets/Index-BYxAQoR9.js",
+ "name": "Index",
+ "src": "resources/js/Pages/Admin/Monitoring/Index.vue",
+ "isDynamicEntry": true,
+ "imports": [
+ "_dist-Bie52OmN.js",
+ "_AdminLayout-D_QE0gy-.js",
+ "_AdminCard-YbEwPtJz.js",
+ "_MonitoringChart-DLuy45XH.js",
+ "_labels-DbKc85RH.js"
+ ]
+ },
+ "resources/js/Pages/Admin/Monitoring/Query.vue": {
+ "file": "assets/Query-CxDUw4Nd.js",
+ "name": "Query",
+ "src": "resources/js/Pages/Admin/Monitoring/Query.vue",
+ "isDynamicEntry": true,
+ "imports": [
+ "_dist-Bie52OmN.js",
+ "_AdminLayout-D_QE0gy-.js",
+ "_AdminCard-YbEwPtJz.js",
+ "_MonitoringChart-DLuy45XH.js",
+ "_labels-DbKc85RH.js"
+ ]
+ },
"resources/js/Pages/Admin/Profile/Edit.vue": {
- "file": "assets/Edit-CyzBsvwt.js",
+ "file": "assets/Edit-BtQ-5Jec.js",
"name": "Edit",
"src": "resources/js/Pages/Admin/Profile/Edit.vue",
"isDynamicEntry": true,
"imports": [
"_dist-Bie52OmN.js",
- "_AdminLayout-DBeSErmz.js"
+ "_AdminLayout-D_QE0gy-.js"
]
},
"resources/js/Pages/Admin/Resource/Create.vue": {
- "file": "assets/Create-DutDQiBS.js",
+ "file": "assets/Create-kOifSpfZ.js",
"name": "Create",
"src": "resources/js/Pages/Admin/Resource/Create.vue",
"isDynamicEntry": true,
"imports": [
"_dist-Bie52OmN.js",
- "_AdminLayout-DBeSErmz.js",
+ "_AdminLayout-D_QE0gy-.js",
"_AdminButton-KiIJ2sLW.js",
"_AdminCard-YbEwPtJz.js",
"_ContentLocaleSwitcher-HJzbB87a.js",
- "_FormField-B-XX4VFv.js",
+ "_FormField-WE0R-1uV.js",
"_contentLocale-BV_E0iGS.js"
]
},
"resources/js/Pages/Admin/Resource/Edit.vue": {
- "file": "assets/Edit-BEWPbBmM.js",
+ "file": "assets/Edit-CG7aI-oj.js",
"name": "Edit",
"src": "resources/js/Pages/Admin/Resource/Edit.vue",
"isDynamicEntry": true,
"imports": [
"_dist-Bie52OmN.js",
- "_AdminLayout-DBeSErmz.js",
+ "_AdminLayout-D_QE0gy-.js",
"_AdminButton-KiIJ2sLW.js",
"_AdminCard-YbEwPtJz.js",
"_ContentLocaleSwitcher-HJzbB87a.js",
- "_FormField-B-XX4VFv.js",
+ "_FormField-WE0R-1uV.js",
"_contentLocale-BV_E0iGS.js",
"_recordActions-CtRs42tG.js"
]
},
"resources/js/Pages/Admin/Resource/Index.vue": {
- "file": "assets/Index-DaeZ92GY.js",
+ "file": "assets/Index-DywV1SDR.js",
"name": "Index",
"src": "resources/js/Pages/Admin/Resource/Index.vue",
"isDynamicEntry": true,
"imports": [
"_dist-Bie52OmN.js",
- "_AdminLayout-DBeSErmz.js",
+ "_AdminLayout-D_QE0gy-.js",
"_AdminButton-KiIJ2sLW.js",
"_AdminDataTable-6eKgKDeA.js",
"_AdminModal-DKazeNNa.js",
@@ -287,71 +333,71 @@
]
},
"resources/js/Pages/Admin/Roles/Edit.vue": {
- "file": "assets/Edit-Bm3W6F3v.js",
+ "file": "assets/Edit-B4rBMOtq.js",
"name": "Edit",
"src": "resources/js/Pages/Admin/Roles/Edit.vue",
"isDynamicEntry": true,
"imports": [
"_dist-Bie52OmN.js",
- "_AdminLayout-DBeSErmz.js",
+ "_AdminLayout-D_QE0gy-.js",
"_AdminButton-KiIJ2sLW.js",
"_AdminCard-YbEwPtJz.js",
"resources/js/app.js"
]
},
"resources/js/Pages/Admin/Roles/Index.vue": {
- "file": "assets/Index-BNmU5PEL.js",
+ "file": "assets/Index-CrHgEVrS.js",
"name": "Index",
"src": "resources/js/Pages/Admin/Roles/Index.vue",
"isDynamicEntry": true,
"imports": [
"_dist-Bie52OmN.js",
- "_AdminLayout-DBeSErmz.js",
+ "_AdminLayout-D_QE0gy-.js",
"_AdminButton-KiIJ2sLW.js",
"_AdminModal-DKazeNNa.js"
]
},
"resources/js/Pages/Admin/Users/Create.vue": {
- "file": "assets/Create-CbxIXc0Q.js",
+ "file": "assets/Create-CJxinjjT.js",
"name": "Create",
"src": "resources/js/Pages/Admin/Users/Create.vue",
"isDynamicEntry": true,
"imports": [
"_dist-Bie52OmN.js",
- "_AdminLayout-DBeSErmz.js",
+ "_AdminLayout-D_QE0gy-.js",
"_AdminButton-KiIJ2sLW.js",
"_AdminCard-YbEwPtJz.js",
- "_FormField-B-XX4VFv.js"
+ "_FormField-WE0R-1uV.js"
]
},
"resources/js/Pages/Admin/Users/Edit.vue": {
- "file": "assets/Edit-Cp-LIO0D.js",
+ "file": "assets/Edit-BB6QBa8T.js",
"name": "Edit",
"src": "resources/js/Pages/Admin/Users/Edit.vue",
"isDynamicEntry": true,
"imports": [
"_dist-Bie52OmN.js",
- "_AdminLayout-DBeSErmz.js",
+ "_AdminLayout-D_QE0gy-.js",
"_AdminButton-KiIJ2sLW.js",
"_AdminCard-YbEwPtJz.js",
- "_FormField-B-XX4VFv.js"
+ "_FormField-WE0R-1uV.js"
]
},
"resources/js/Pages/Admin/Users/Index.vue": {
- "file": "assets/Index-C63EL5RF.js",
+ "file": "assets/Index-ClSNZWUj.js",
"name": "Index",
"src": "resources/js/Pages/Admin/Users/Index.vue",
"isDynamicEntry": true,
"imports": [
"_dist-Bie52OmN.js",
- "_AdminLayout-DBeSErmz.js",
+ "_AdminLayout-D_QE0gy-.js",
"_AdminButton-KiIJ2sLW.js",
"_AdminDataTable-6eKgKDeA.js",
"_AdminModal-DKazeNNa.js"
]
},
"resources/js/app.js": {
- "file": "assets/app-BCJOqmKO.js",
+ "file": "assets/app-Cdw8k5No.js",
"name": "app",
"src": "resources/js/app.js",
"isEntry": true,
@@ -368,6 +414,8 @@
"resources/js/Pages/Admin/Errors/Show.vue",
"resources/js/Pages/Admin/Modules/Index.vue",
"resources/js/Pages/Admin/Modules/Settings.vue",
+ "resources/js/Pages/Admin/Monitoring/Index.vue",
+ "resources/js/Pages/Admin/Monitoring/Query.vue",
"resources/js/Pages/Admin/Profile/Edit.vue",
"resources/js/Pages/Admin/Resource/Create.vue",
"resources/js/Pages/Admin/Resource/Edit.vue",
@@ -379,7 +427,7 @@
"resources/js/Pages/Admin/Users/Index.vue"
],
"css": [
- "assets/app-XteR4oRF.css"
+ "assets/app-DBhrvJI0.css"
],
"assets": [
"assets/space-grotesk-latin-600-normal-DjKNqYRj.woff2",