diff --git a/.env.example b/.env.example index ff06edd4d..ba602fa2a 100644 --- a/.env.example +++ b/.env.example @@ -36,3 +36,22 @@ LOG_TO_FILE=true # also store the value separately (otherwise an encrypted backup cannot be # restored after key loss). # MFA_ENCRYPTION_KEY= + +# External library folders (GHSA-r2qv follow-up) — colon-separated list of +# host paths that users are permitted to register as external library +# folders via Settings → Library → "Add external folder". +# +# Empty (the default) means the external-folder feature is DISABLED: +# attempts to register one return HTTP 400. Set this to one or more +# absolute paths to opt in. Paths that fall inside Bambuddy's own +# DATA_DIR / LOG_DIR / static dir are always rejected regardless of +# this value. +# +# Example for a single NAS mount: +# BAMBUDDY_EXTERNAL_ROOTS=/mnt/nas/3d-prints +# Example for two roots: +# BAMBUDDY_EXTERNAL_ROOTS=/mnt/nas/3d-prints:/srv/library +# +# In Docker, also bind-mount the host path into the container at the same +# location (see docker-compose.yml for the matching volume snippet). +# BAMBUDDY_EXTERNAL_ROOTS= diff --git a/CHANGELOG.md b/CHANGELOG.md index 034193b42..c30a5d942 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,8 @@ All notable changes to Bambuddy will be documented in this file. ### Security -- **GHSA-r2qv-8222-hqg3 (CVSS 9.9) — API-key permission enforcement is allowlist-based** (reported by @vfxdev) — The three documented API-key scopes ("Read Status", "Manage Queue", "Control Printer") were enforced only inside the legacy `/api/v1/webhook/*` router; every other route used `require_permission_if_auth_enabled` which fell through to a 17-entry admin denylist for API keys and ignored the per-key scope flags entirely. The structural failure modes: (a) any valid key, including one with every scope checkbox unticked, could call print start/stop/pause/resume, queue create/delete/reorder, archive reprint, and every `*_READ` endpoint outside the denylist; (b) `require_any_permission_if_auth_enabled` (`inventory.py`) and `require_ownership_permission` (`print_queue.py`, `archives.py`, `library.py`, `library_trash.py`) returned `None` for any valid key with zero scope check, granting full ownership-modify access to ~10 ownership-gated routes; (c) every new `Permission` enum value added to `core/permissions.py` since the denylist was written silently joined the "API-key-allowed" bucket — fail-open-by-construction, which is exactly how the surface grew over time. **Fix**: `core/auth.py::_check_apikey_permissions` now consumes a new `_APIKEY_SCOPE_BY_PERMISSION` allowlist that maps every non-admin `Permission` to exactly one scope flag on the `APIKey` row; unmapped permissions return 403 ("administrative operations") regardless of which flags are set; the helper is now invoked in all three previously-skipping dependencies. The denylist is retained as a redundant explicit "these are admin" marker plus drift-detection in tests, but the allowlist is the load-bearing check. **Two new scope flags** (per same-PR design discussion): `can_manage_library` (gates `LIBRARY_UPLOAD` / `LIBRARY_UPDATE_OWN` / `LIBRARY_DELETE_OWN` / `MAKERWORLD_IMPORT` — distinct trust level from queue management; rejected the "fold library upload into can_queue" shortcut) and `can_manage_inventory` (gates `INVENTORY_CREATE` / `INVENTORY_UPDATE` / `INVENTORY_DELETE` / `INVENTORY_FORECAST_WRITE` — required because SpoolBuddy kiosks write NFC scans, scale readings, and `/spoolbuddy/devices/{id}/system/command` + `/update` via INVENTORY_UPDATE under the prior denylist gap; 15+ kiosk routes depend on this scope). `CLOUD_AUTH` is now routed through the existing `can_access_cloud` flag (was unmapped → would have admin-denied; the router-level `_cloud_api_key_gate` already does this check, but the route-level dep now fails closed too for defence in depth). **Migration** (`core/database.py::run_migrations`, dialect-branched per [[feedback_sqlite_and_postgres_upfront]]): two new boolean columns added to `api_keys` with `DEFAULT TRUE`, one-shot backfilled to mirror `can_queue` (gated on a new `_api_keys_column_exists` check so the backfill runs only on the migration that adds the column — user-edited values on subsequent restarts are never clobbered). Backfill rationale: a key the operator created as "queue-only" was implicitly relying on the upload+queue and inventory-write workflows the queue scope already let through, so mirroring `can_queue` preserves the operator's intent; a hardened "read-only" key (`can_queue=False`) does NOT silently gain new writes on upgrade. The bundled SpoolBuddy CLI key is explicitly granted `can_manage_inventory=True` because the kiosk itself is the legitimate writer (NFC scan, scale reading, /system/command). **Structural drift backstop**: new `test_every_permission_has_a_classification` fails CI on any future `Permission` added to `core/permissions.py` without an entry in `_APIKEY_SCOPE_BY_PERMISSION` or `_APIKEY_DENIED_PERMISSIONS` — the previous denylist shape allowed silent surface growth, this catches it. **Tests** (`test_auth_apikey_rbac.py`): 78 new — pure-logic `_check_apikey_permissions` matrix covers every (Permission × scope-flag combo) outcome with cross-scope leakage assertions, the structural drift-detection guard, allowlist/denylist disjointness, scope-flag-has-permissions sanity, unknown-perm-string + empty-perm-list fail-closed cases, and the `require_any=True` semantics; the existing denylist-integrity test is updated to reflect that INVENTORY_CREATE/UPDATE are now allowlisted (not admin-only-by-omission) and that operations admin only via omission (PRINTERS_CREATE, LIBRARY_DELETE_ALL, LIBRARY_PURGE, DISCOVERY_SCAN) still 403 with a fully-flagged key. Full 5469-test backend suite green; backend ruff clean. **Frontend**: API-key create dialog gains "Manage Library" + "Manage Inventory" checkboxes with descriptions, the existing list view gains Library and Inventory badges, the cosmetic `apiKeyName`/save-toast flow is unchanged; `api/client.ts` `APIKey` / `APIKeyCreate` / `APIKeyUpdate` types extended. **i18n parity**: real translations for the 6 new keys (`manageLibrary` / `manageLibraryDescription` / `manageInventory` / `manageInventoryDescription` / `libraryBadge` / `inventoryBadge`) across all 9 locales per the [[feedback_translate_dont_fallback]] HARD RULE; parity script green at 5005 leaves × 9 locales. **Wiki** (`features/api-keys.md`): permissions table grows from 5 to 7 toggles with the new scopes and an updated "Principle of Least Privilege" examples list; upgrade notes call out the can_queue-mirroring backfill so operators understand why an existing "queue-only" key keeps uploading after upgrade (and why a "read-only" key still won't); a new explicit "Allowlist model since 0.2.4.5 (GHSA-r2qv-8222-hqg3)" callout documents the shift from denylist to allowlist with the exact previous failure mode (so the audit-trail isn't only in this CHANGELOG). **Out of scope / explicit choice**: did not refactor the SpoolBuddy kiosk routes to use a more semantically-accurate permission than `INVENTORY_UPDATE` for `/system/command` and `/update` (large blast radius across 15+ route decorators, and `can_manage_inventory` matches the trust dimension correctly); did not consolidate the bespoke `require_energy_cost_update` into the new allowlist (its narrow-scope semantics — bypass the SETTINGS_UPDATE denylist via `can_update_energy_cost` — predates this work and is still the right shape for that one electricity-price endpoint). +- **WebSocket auth gate + audit-driven hardening sweep — A proactive auth-surface audit run surfaced one critical (`/api/v1/ws` broadcast every printer-status / archive / inventory event to anyone reachable on the HTTP port. All fixed in the same PR. +- **API-key permission enforcement is allowlist-based** (reported by @vfxdev) — The three documented API-key scopes ("Read Status", "Manage Queue", "Control Printer") were enforced only inside the legacy `/api/v1/webhook/*` router; every other route used `require_permission_if_auth_enabled` which fell through to a 17-entry admin denylist for API keys and ignored the per-key scope flags. The structural failure modes: (a) any valid key, including one with every scope checkbox unticked, could call print start/stop/pause/resume, queue create/delete/reorder, archive reprint, and every `*_READ` endpoint outside the denylist; (b) `require_any_permission_if_auth_enabled` (`inventory.py`) and `require_ownership_permission` (`print_queue.py`, `archives.py`, `library.py`, `library_trash.py`) returned `None` for any valid key with zero scope check, granting full ownership-modify access to ~10 ownership-gated routes; (c) every new `Permission` enum value added to `core/permissions.py` since the denylist was written silently joined the "API-key-allowed" bucket — fail-open-by-construction, which is exactly how the surface grew over time. **Fix**: `core/auth.py::_check_apikey_permissions` now consumes a new `_APIKEY_SCOPE_BY_PERMISSION` allowlist that maps every non-admin `Permission` to exactly one scope flag on the `APIKey` row; unmapped permissions return 403 ("administrative operations") regardless of which flags are set; the helper is now invoked in all three previously-skipping dependencies. The denylist is retained as a redundant explicit "these are admin" marker plus drift-detection in tests, but the allowlist is the load-bearing check. **Two new scope flags** (per same-PR design discussion): `can_manage_library` (gates `LIBRARY_UPLOAD` / `LIBRARY_UPDATE_OWN` / `LIBRARY_DELETE_OWN` / `MAKERWORLD_IMPORT` — distinct trust level from queue management; rejected the "fold library upload into can_queue" shortcut) and `can_manage_inventory` (gates `INVENTORY_CREATE` / `INVENTORY_UPDATE` / `INVENTORY_DELETE` / `INVENTORY_FORECAST_WRITE` — required because SpoolBuddy kiosks write NFC scans, scale readings, and `/spoolbuddy/devices/{id}/system/command` + `/update` via INVENTORY_UPDATE under the prior denylist gap; 15+ kiosk routes depend on this scope). `CLOUD_AUTH` is now routed through the existing `can_access_cloud` flag (was unmapped → would have admin-denied; the router-level `_cloud_api_key_gate` already does this check, but the route-level dep now fails closed too for defence in depth). **Migration** (`core/database.py::run_migrations`, dialect-branched per [[feedback_sqlite_and_postgres_upfront]]): two new boolean columns added to `api_keys` with `DEFAULT TRUE`, one-shot backfilled to mirror `can_queue` (gated on a new `_api_keys_column_exists` check so the backfill runs only on the migration that adds the column — user-edited values on subsequent restarts are never clobbered). Backfill rationale: a key the operator created as "queue-only" was implicitly relying on the upload+queue and inventory-write workflows the queue scope already let through, so mirroring `can_queue` preserves the operator's intent; a hardened "read-only" key (`can_queue=False`) does NOT silently gain new writes on upgrade. The bundled SpoolBuddy CLI key is explicitly granted `can_manage_inventory=True` because the kiosk itself is the legitimate writer (NFC scan, scale reading, /system/command). **Structural drift backstop**: new `test_every_permission_has_a_classification` fails CI on any future `Permission` added to `core/permissions.py` without an entry in `_APIKEY_SCOPE_BY_PERMISSION` or `_APIKEY_DENIED_PERMISSIONS` — the previous denylist shape allowed silent surface growth, this catches it. **Tests** (`test_auth_apikey_rbac.py`): 78 new — pure-logic `_check_apikey_permissions` matrix covers every (Permission × scope-flag combo) outcome with cross-scope leakage assertions, the structural drift-detection guard, allowlist/denylist disjointness, scope-flag-has-permissions sanity, unknown-perm-string + empty-perm-list fail-closed cases, and the `require_any=True` semantics; the existing denylist-integrity test is updated to reflect that INVENTORY_CREATE/UPDATE are now allowlisted (not admin-only-by-omission) and that operations admin only via omission (PRINTERS_CREATE, LIBRARY_DELETE_ALL, LIBRARY_PURGE, DISCOVERY_SCAN) still 403 with a fully-flagged key. Full 5469-test backend suite green; backend ruff clean. **Frontend**: API-key create dialog gains "Manage Library" + "Manage Inventory" checkboxes with descriptions, the existing list view gains Library and Inventory badges, the cosmetic `apiKeyName`/save-toast flow is unchanged; `api/client.ts` `APIKey` / `APIKeyCreate` / `APIKeyUpdate` types extended. **i18n parity**: real translations for the 6 new keys (`manageLibrary` / `manageLibraryDescription` / `manageInventory` / `manageInventoryDescription` / `libraryBadge` / `inventoryBadge`) across all 9 locales per the [[feedback_translate_dont_fallback]] HARD RULE; parity script green at 5005 leaves × 9 locales. **Wiki** (`features/api-keys.md`): permissions table grows from 5 to 7 toggles with the new scopes and an updated "Principle of Least Privilege" examples list; upgrade notes call out the can_queue-mirroring backfill so operators understand why an existing "queue-only" key keeps uploading after upgrade (and why a "read-only" key still won't); a new explicit "Allowlist model since 0.2.4.5 (GHSA-r2qv-8222-hqg3)" callout documents the shift from denylist to allowlist with the exact previous failure mode (so the audit-trail isn't only in this CHANGELOG). **Out of scope / explicit choice**: did not refactor the SpoolBuddy kiosk routes to use a more semantically-accurate permission than `INVENTORY_UPDATE` for `/system/command` and `/update` (large blast radius across 15+ route decorators, and `can_manage_inventory` matches the trust dimension correctly); did not consolidate the bespoke `require_energy_cost_update` into the new allowlist (its narrow-scope semantics — bypass the SETTINGS_UPDATE denylist via `can_update_energy_cost` — predates this work and is still the right shape for that one electricity-price endpoint). - **Trivy DS-0026 (`Dockerfile.test` missing HEALTHCHECK): silenced via `HEALTHCHECK NONE`** — The test image runs `pytest` and exits; there is no long-running service to probe, so any HEALTHCHECK we added would be cargo-cult noise. `HEALTHCHECK NONE` is the documented Docker directive to explicitly opt out of any inherited healthcheck and is the way Trivy expects projects to signal "this image is not a service." Closes code-scanning alert #813. - **VP access codes now compared with `hmac.compare_digest` (constant-time)** — Pre-fix: both `FTPSession.cmd_PASS` and `SimpleMQTTServer._handle_connect` used Python's `==` operator on the 8-char access code. Constant-time comparison closes the timing-side-channel without changing the protocol surface. Same auth, no UX change. - **VP MQTT brute-force rate-limit per source IP** — 5 failed CONNECT attempts within a 60 s sliding window block further auth attempts from that IP for the rest of the window. Auto-recovers — no manual unblock. Constants `_AUTH_RATE_LIMIT_MAX_ATTEMPTS = 5` / `_AUTH_RATE_LIMIT_WINDOW_SECONDS = 60.0` are module-level for ops tunability. See Added section for full description. diff --git a/README.md b/README.md index 1794ea169..ec9ab9650 100644 --- a/README.md +++ b/README.md @@ -192,7 +192,7 @@ Optional but recommended — drop the [`slicer-api/` Compose stack](slicer-api/R ### 📁 File Manager (Library) - Upload and organize sliced files (3MF, gcode, STL) -- **External folder mounting** - Mount host directories (NAS, USB, network shares) without copying files +- **External folder mounting** - Mount host directories (NAS, USB, network shares) without copying files. Operator-controlled via the `BAMBUDDY_EXTERNAL_ROOTS` env var (colon-separated allowlist of host paths users are permitted to register; empty by default to disable the feature). See [Docker → External library folders](https://wiki.bambuddy.cool/getting-started/docker/#external-library-folders-bambuddy_external_roots). - **STL thumbnail generation** - Auto-generate previews for STL files on upload or batch generate for existing files - ZIP file extraction with folder structure preservation - Option to create folder from ZIP filename diff --git a/SECURITY.md b/SECURITY.md index e1658ceca..de646b640 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -81,11 +81,85 @@ The following are **out of scope**: - Denial of service (DoS) attacks - Issues requiring physical access to the server -## Acknowledgments +## Bambuddy Security Stance -We thank the following individuals for responsibly disclosing security issues: +The following rules apply to every PR that touches authentication, +authorization, permission gating, secret handling, or any code that +decides whether to allow or deny an action. They are not aspirational — +each one is enforced by a CI test that fails the build on violation. -*No security issues have been reported yet.* +### 1. Default-deny, allowlist over denylist + +At any security boundary, the safe default is to deny and the +exceptions are listed explicitly. Denylists fail open on growth — every +new resource added to the codebase is implicitly granted access until +someone remembers to deny it. Allowlists fail closed: an unmapped new +resource gets a 403, which is loud and recoverable. + +Concretely: + +- `_APIKEY_SCOPE_BY_PERMISSION` in `backend/app/core/auth.py` is the + load-bearing API-key authorization map. Every `Permission` enum value + must be either present here with a scope flag, or present in + `_APIKEY_DENIED_PERMISSIONS`. Unmapped permissions return 403. +- Route auth dependencies are explicit, not implicit. A route without a + `Depends(require_*)` decorator must be listed in the route-audit + `PUBLIC_ROUTES` allowlist with a justification comment, or CI fails. + +### 2. Fail-closed in auth code + +No `except Exception:` (or bare `except:`) in authentication, +authorization, or permission code may return a permissive value +(`None`, `True`, an admin user, an empty filter that lets everything +through, etc.). The catch-all either re-raises or returns a denial. +This is CWE-636 "Not Failing Securely" — see +. + +The lint scope is `backend/app/core/auth.py`, +`backend/app/core/permissions.py`, +`backend/app/api/routes/auth*.py`. Any `except Exception:` block in +those files must be tagged `# SEC-AUTH-EXC: ` on the same +line; CI fails otherwise. (We use a standalone marker rather than +`# noqa: ...` because ruff reserves the latter syntax for its own +error codes.) + +### 3. No hardcoded fallback secrets + +Production secrets (JWT signing keys, encryption keys, OAuth client +secrets, API tokens) have no string-literal fallback in source. The +codebase reads them from env vars or generates them on first run; if a +secret is missing AND cannot be generated, the app refuses to start +rather than booting with a known value. CI greps the source for +`-change-in-production`-shaped strings and fails on any hit. + +### 4. Negative-path tests required for any auth change + +Any PR that adds or modifies an auth dependency, permission check, or +scope flag includes tests for the negative paths: + +- "No credentials → 401" +- "Wrong credentials → 401" +- "Right credentials, wrong scope → 403" +- "Expired / revoked credentials → 401" + +A test asserting the happy path passes is necessary but not sufficient. +The failure modes are where the vulnerabilities live. The structural +backstops above catch *categories* of regression; the negative-path +tests catch *specific* regressions in the new code. + +### Where these rules live in the codebase + +| Rule | Enforcement | Location | +|------|-------------|----------| +| 1. Allowlist over denylist (Permission) | `test_every_permission_has_a_classification` | `backend/tests/integration/test_auth_apikey_rbac.py` | +| 1. Allowlist over denylist (routes) | `test_routes_have_explicit_auth_deps` | `backend/tests/unit/test_route_auth_coverage.py` | +| 2. Fail-closed in auth code | `test_no_fail_open_in_auth_modules` | `backend/tests/unit/test_no_fail_open_in_auth.py` | +| 3. No hardcoded fallback secrets | `test_no_hardcoded_secrets` | `backend/tests/unit/test_no_hardcoded_secrets.py` | +| 4. Negative-path tests required | Reviewer responsibility (no automated CI gate yet) | PR review | + +If you are adding a CI rule, update this table. If you are removing a +CI rule, you are removing a security backstop and the PR description +must explain why. --- diff --git a/backend/app/api/routes/auth.py b/backend/app/api/routes/auth.py index be31ee870..e473a7873 100644 --- a/backend/app/api/routes/auth.py +++ b/backend/app/api/routes/auth.py @@ -25,6 +25,7 @@ from backend.app.core.auth import ( authenticate_user, authenticate_user_by_email, create_access_token, + create_websocket_token, get_current_active_user, get_password_hash, get_user_by_email, @@ -273,7 +274,7 @@ async def setup_auth(request: SetupRequest, db: AsyncSession = Depends(get_db)): db.add(admin_user) logger.info("Admin user added to session: %s", request.admin_username) admin_created = True - except Exception as e: + except Exception as e: # SEC-AUTH-EXC: rollback + raise 500 (fail-closed); no user is created on error await db.rollback() logger.error("Failed to create admin user: %s", e, exc_info=True) raise HTTPException( @@ -294,7 +295,7 @@ async def setup_auth(request: SetupRequest, db: AsyncSession = Depends(get_db)): return SetupResponse(auth_enabled=request.auth_enabled, admin_created=admin_created) except HTTPException: raise - except Exception as e: + except Exception as e: # SEC-AUTH-EXC: rollback + raise 500 (fail-closed); setup state stays unchanged logger.error("Setup error: %s", e, exc_info=True) await db.rollback() raise HTTPException( @@ -339,7 +340,7 @@ async def disable_auth( await db.commit() logger.info("Authentication disabled by admin user: %s", user.username) return {"message": "Authentication disabled successfully", "auth_enabled": False} - except Exception as e: + except Exception as e: # SEC-AUTH-EXC: rollback + raise 500 (fail-closed); auth_enabled stays at its prior value await db.rollback() logger.error("Failed to disable authentication: %s", e, exc_info=True) raise HTTPException( @@ -408,7 +409,7 @@ async def login(raw_request: Request, request: LoginRequest, response: Response, if user and ldap_user: # Update email and group mappings on each login await _sync_ldap_user(db, user, ldap_user, ldap_config) - except Exception as e: + except Exception as e: # SEC-AUTH-EXC: LDAP failure sets ldap_user=None, downstream local-auth path runs with its own credential check (no implicit grant) import logging logging.getLogger(__name__).warning("LDAP authentication error, falling back to local: %s", e) @@ -505,6 +506,29 @@ async def login(raw_request: Request, request: LoginRequest, response: Response, ) +@router.post("/ws-token") +async def mint_websocket_token( + current_user: User | None = RequirePermissionIfAuthEnabled(Permission.WEBSOCKET_CONNECT), +): + """Mint a short-lived token for ``/api/v1/ws`` connections (GHSA-r2qv follow-up). + + The WebSocket endpoint cannot read ``Authorization`` headers from + browsers (the WebSocket handshake does not let JS attach custom + headers), so we use the same opaque-token-in-query-param pattern + as ``/camera/stream`` — the token is minted here behind the standard + permission gate, then appended as ``?token=`` on the + ``ws://...`` URL. The WebSocket endpoint validates it *before* + calling ``websocket.accept()``. + + Returns ``{"token": }``. The token is valid for 60 + minutes; the SPA refreshes it on reconnect if expired. API keys can + mint tokens too — their scope flags decide whether ``WEBSOCKET_CONNECT`` + passes via the standard allowlist (``can_read_status`` covers it). + """ + username = current_user.username if current_user is not None else None + return {"token": await create_websocket_token(username)} + + @router.get("/me", response_model=UserResponse) async def get_current_user_info( credentials: Annotated[HTTPAuthorizationCredentials | None, Depends(security)] = None, @@ -619,7 +643,7 @@ async def logout( expires_at = datetime.fromtimestamp(exp, tz=timezone.utc) try: await revoke_jti(jti, expires_at, username) - except Exception as exc: + except Exception as exc: # SEC-AUTH-EXC: JTI-revoke failure on logout is logged only; logout removes access, never grants it (token stays valid until natural expiry — degraded but never escalation) _logger.error("Failed to revoke JTI on logout for user %s: %s", username, exc) except PyJWTError: client_ip = _get_client_ip(raw_request) @@ -664,7 +688,7 @@ async def test_smtp_connection( logger.info(f"Test email sent successfully to {test_request.test_recipient}") return TestSMTPResponse(success=True, message="Test email sent successfully") - except Exception as e: + except Exception as e: # SEC-AUTH-EXC: SMTP test diagnostic returns success=False; no auth-relevant outcome (route is admin-gated by SETTINGS_UPDATE upstream) logger.error("Failed to send test email: %s", e) return TestSMTPResponse(success=False, message="Failed to send test email") @@ -698,7 +722,7 @@ async def save_smtp_config( await db.commit() logger.info(f"SMTP settings updated by admin user: {current_user.username if current_user else 'anonymous'}") return {"message": "SMTP settings saved successfully"} - except Exception as e: + except Exception as e: # SEC-AUTH-EXC: rollback + raise 500 (fail-closed); SMTP settings unchanged on error await db.rollback() logger.error("Failed to save SMTP settings: %s", e) raise HTTPException( @@ -743,7 +767,7 @@ async def enable_advanced_auth( await db.commit() logger.info(f"Advanced authentication enabled by admin user: {user.username}") return {"message": "Advanced authentication enabled successfully", "advanced_auth_enabled": True} - except Exception as e: + except Exception as e: # SEC-AUTH-EXC: rollback + raise 500 (fail-closed); advanced-auth setting unchanged on error await db.rollback() logger.error("Failed to enable advanced authentication: %s", e) raise HTTPException( @@ -777,7 +801,7 @@ async def disable_advanced_auth( await db.commit() logger.info(f"Advanced authentication disabled by admin user: {user.username}") return {"message": "Advanced authentication disabled successfully", "advanced_auth_enabled": False} - except Exception as e: + except Exception as e: # SEC-AUTH-EXC: rollback + raise 500 (fail-closed); advanced-auth setting unchanged on error await db.rollback() logger.error("Failed to disable advanced authentication: %s", e) raise HTTPException( @@ -826,7 +850,7 @@ async def _send_reset_email_or_delete_token( try: send_email(smtp_settings, to_email, subject, text_body, html_body) _logger.info("Password reset email sent (%s) to %s", log_label, to_email) - except Exception as exc: + except Exception as exc: # SEC-AUTH-EXC: email-send failure → defensive token cleanup so a stuck token doesn't block re-request; no access granted, just frees future workflow _logger.error( "Password reset email failed (%s) to %s — deleting token to unblock re-request: %s", log_label, @@ -842,7 +866,7 @@ async def _send_reset_email_or_delete_token( ) ) await db.commit() - except Exception as db_exc: + except Exception as db_exc: # SEC-AUTH-EXC: nested cleanup failure logged only; no access decision made in this branch (already handling a prior failure) _logger.error("Failed to delete reset token after send failure: %s", db_exc) @@ -967,7 +991,7 @@ async def forgot_password( "forgot_password", ) _logger.info("Password reset email queued for %s", user.email) - except Exception as e: + except Exception as e: # SEC-AUTH-EXC: forgot-password response is intentionally generic regardless of outcome (user-enumeration defence); email failure does not grant access _logger.error("Failed to send password reset email: %s", e) # Don't reveal error to caller for security @@ -1114,7 +1138,7 @@ async def reset_user_password( _logger.info("Admin password reset link queued for user '%s' by admin '%s'", user.username, admin_user.username) return ResetPasswordResponse(message=f"Password reset link sent to {user.email}") - except Exception as e: + except Exception as e: # SEC-AUTH-EXC: rollback + raise 500 (fail-closed); reset token state unchanged on error await db.rollback() _logger.error("Failed to send admin password reset for user '%s': %s", user.username, e) raise HTTPException( @@ -1354,7 +1378,7 @@ async def search_ldap_directory( try: results = search_ldap_users(config, query, limit=25) - except Exception as e: + except Exception as e: # SEC-AUTH-EXC: raise 503 (fail-closed); route gated upstream by USERS_CREATE permission so detail leak is admin-only _logger.exception("LDAP directory search failed") # Admin-only endpoint — surface the underlying reason so the operator # can fix it (auth_middleware already restricted access to USERS_CREATE). @@ -1430,7 +1454,7 @@ async def provision_ldap_user( # "username doesn't exist in the directory" in the UI. try: ldap_user = lookup_ldap_user(config, username) - except Exception as e: + except Exception as e: # SEC-AUTH-EXC: raise 503 (fail-closed); LDAP provision never succeeds on lookup failure _logger.exception("LDAP lookup failed during provision") raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, diff --git a/backend/app/api/routes/library.py b/backend/app/api/routes/library.py index db56aefa2..dde0368bd 100644 --- a/backend/app/api/routes/library.py +++ b/backend/app/api/routes/library.py @@ -1074,20 +1074,73 @@ async def delete_folder( # ============ External Folder Endpoints ============ -# Blocked system directories that cannot be mounted -_BLOCKED_PREFIXES = ( - "/proc", - "/sys", - "/dev", - "/run", - "/boot", - "/sbin", - "/bin", - "/usr/sbin", - "/usr/bin", - "/lib", - "/etc", -) +# GHSA-r2qv follow-up (audit finding I1): external-folder mount path uses an +# allowlist of operator-opted-in roots rather than the original denylist of +# system directories. The denylist shape was fail-open-on-growth — anything +# not enumerated (``/data`` containing other users' archives, ``/root``, +# arbitrary NFS/SMB mounts, the Bambuddy ``LOG_DIR``) could be mounted by any +# user with ``LIBRARY_UPLOAD``. The allowlist defaults to empty and is +# extended via the ``BAMBUDDY_EXTERNAL_ROOTS`` env var (colon-separated +# absolute paths). The route is additionally gated on ``SETTINGS_UPDATE`` +# (admin scope) rather than ``LIBRARY_UPLOAD`` because mounting host paths +# is an operator-level capability that crosses user boundaries. + + +# Bambuddy-owned data directories. Hardcode-rejected even if the operator +# tries to add them to ``BAMBUDDY_EXTERNAL_ROOTS`` — mounting these would +# allow reading other users' archives, log files, or the static assets path. +def _bambuddy_reserved_roots() -> tuple[Path, ...]: + """Resolved Bambuddy-owned directories that may NEVER be mounted as an + external folder regardless of the operator's allowlist. + + Resolved at call time because tests patch ``settings.base_dir`` / + ``settings.log_dir`` to a temp dir; resolving lazily picks up the + patched values rather than module-import-time values. + """ + from backend.app.core.config import settings as app_settings + + reserved = [app_settings.base_dir, app_settings.log_dir, app_settings.static_dir, app_settings.archive_dir] + return tuple(Path(p).resolve() for p in reserved if p is not None) + + +def _allowed_external_roots() -> tuple[Path, ...]: + """Parse ``BAMBUDDY_EXTERNAL_ROOTS`` into resolved allowed roots. + + Empty env var (the default) means external folders are disabled. + Operators opt in explicitly: ``BAMBUDDY_EXTERNAL_ROOTS=/mnt/library:/srv/3d`` + Returns a tuple of resolved ``Path`` objects; entries that don't + resolve to absolute paths are silently dropped (operator error, not + a security boundary). Resolved lazily so tests can monkeypatch. + """ + raw = os.environ.get("BAMBUDDY_EXTERNAL_ROOTS", "") + roots: list[Path] = [] + for entry in raw.split(":"): + entry = entry.strip() + if not entry: + continue + try: + resolved = Path(entry).resolve() + except (OSError, RuntimeError): # noqa: BLE001 — operator config error, not a security boundary + continue + if resolved.is_absolute(): + roots.append(resolved) + return tuple(roots) + + +def _path_within(child: Path, parent: Path) -> bool: + """Return True if ``child`` is ``parent`` or any descendant. + + Uses ``Path.relative_to`` semantics (raises ``ValueError`` on miss) + instead of string ``startswith``, which would falsely match + ``/data-other`` against ``/data``. ``Path.is_relative_to`` is the + sanctioned form on Python 3.9+; both are available here. + """ + try: + child.relative_to(parent) + except ValueError: + return False + return True + # Supported file extensions for external folder scanning _SCANNABLE_EXTENSIONS = { @@ -1108,15 +1161,53 @@ _SCANNABLE_EXTENSIONS = { def _validate_external_path(path_str: str) -> Path: - """Validate an external path is safe to mount.""" + """Validate an external path is safe to mount. + + Allowlist semantics: + 1. Path must be absolute and resolve cleanly (symlink-escape rejected + implicitly by the resolved-startswith check below). + 2. Path must fall under one of the roots enumerated in + ``BAMBUDDY_EXTERNAL_ROOTS``; empty allowlist (the default) + means external folders are not available on this deployment. + 3. Path must NOT fall under any Bambuddy-owned directory (``base_dir``, + ``log_dir``, ``static_dir``, ``archive_dir``) — the reserved set + takes precedence over the allowlist, so an operator who accidentally + sets ``BAMBUDDY_EXTERNAL_ROOTS=/`` does not expose ``/data``. + 4. Existence + directory-type + readability gates remain. + """ path = Path(path_str).resolve() if not path.is_absolute(): raise HTTPException(status_code=400, detail="Path must be absolute") - for prefix in _BLOCKED_PREFIXES: - if str(path).startswith(prefix): - raise HTTPException(status_code=400, detail=f"Cannot mount system directory: {prefix}") + allowed_roots = _allowed_external_roots() + if not allowed_roots: + raise HTTPException( + status_code=400, + detail=( + "External folders are not enabled on this deployment. Ask the " + "operator to set BAMBUDDY_EXTERNAL_ROOTS=." + ), + ) + + # Reserved (Bambuddy-owned) paths are rejected before the allowlist check + # so an over-broad allowlist (e.g. operator set "/" for testing) cannot + # expose Bambuddy's own data dir or log dir. + for reserved in _bambuddy_reserved_roots(): + if _path_within(path, reserved): + raise HTTPException( + status_code=400, + detail=f"Cannot mount Bambuddy-managed directory: {reserved}", + ) + + if not any(_path_within(path, root) for root in allowed_roots): + raise HTTPException( + status_code=400, + detail=( + f"Path '{path}' is not within an allowed external root. " + f"Allowed roots: {', '.join(str(r) for r in allowed_roots)}" + ), + ) if not path.exists(): raise HTTPException(status_code=400, detail=f"Path does not exist: {path}") @@ -1135,7 +1226,14 @@ def _validate_external_path(path_str: str) -> Path: async def create_external_folder( data: ExternalFolderCreate, db: AsyncSession = Depends(get_db), - _: User | None = Depends(require_permission_if_auth_enabled(Permission.LIBRARY_UPLOAD)), + # GHSA-r2qv follow-up (I1): elevated from LIBRARY_UPLOAD to SETTINGS_UPDATE. + # Registering a host filesystem path as a Bambuddy library folder is an + # operator-level capability that crosses user boundaries (one user's + # registered external folder is visible to every other user via + # /api/v1/library/folders). LIBRARY_UPLOAD was always the wrong scope — + # SETTINGS_UPDATE is the admin-class gate that already protects every + # other host-affecting setting (SMTP, LDAP, cloud, smart plugs). + _: User | None = Depends(require_permission_if_auth_enabled(Permission.SETTINGS_UPDATE)), ): """Create an external folder that points to a host directory.""" resolved = _validate_external_path(data.external_path) diff --git a/backend/app/api/routes/metrics.py b/backend/app/api/routes/metrics.py index 3ab8b734a..6da5b81a9 100644 --- a/backend/app/api/routes/metrics.py +++ b/backend/app/api/routes/metrics.py @@ -1,6 +1,7 @@ """Prometheus metrics endpoint for external monitoring.""" import platform +import secrets from fastapi import APIRouter, Depends, Header, HTTPException, Response from sqlalchemy import func, select @@ -75,7 +76,9 @@ async def get_metrics( if not authorization.startswith("Bearer "): raise HTTPException(status_code=401, detail="Bearer token required") provided_token = authorization[7:] # Remove "Bearer " prefix - if provided_token != token: + # Constant-time comparison closes the byte-by-byte timing oracle that + # plain ``!=`` opens on a LAN-attached attacker (audit finding I2). + if not secrets.compare_digest(provided_token.encode("utf-8"), token.encode("utf-8")): raise HTTPException(status_code=401, detail="Invalid token") lines: list[str] = [] diff --git a/backend/app/api/routes/settings.py b/backend/app/api/routes/settings.py index 9bff7dc38..3613f625c 100644 --- a/backend/app/api/routes/settings.py +++ b/backend/app/api/routes/settings.py @@ -361,12 +361,20 @@ async def get_ui_preferences(db: AsyncSession = Depends(get_db)): @router.get("/check-ffmpeg") -async def check_ffmpeg(): - """Check if ffmpeg is installed and available.""" +async def check_ffmpeg( + _: User | None = RequirePermissionIfAuthEnabled(Permission.SETTINGS_READ), +): + """Check if ffmpeg is installed and available. + + Gated on ``SETTINGS_READ`` (audit finding I4 — the binary path was + leaking the host filesystem layout to unauthenticated callers). + ``require_permission_if_auth_enabled`` returns ``None`` only when + auth is disabled (in which case there's no privacy boundary to + enforce); otherwise it raises 401/403 before we get here. + """ from backend.app.services.camera import get_ffmpeg_path ffmpeg_path = get_ffmpeg_path() - return { "installed": ffmpeg_path is not None, "path": ffmpeg_path, diff --git a/backend/app/api/routes/websocket.py b/backend/app/api/routes/websocket.py index f79e2e2b6..ada438074 100644 --- a/backend/app/api/routes/websocket.py +++ b/backend/app/api/routes/websocket.py @@ -1,7 +1,27 @@ +"""GHSA-r2qv follow-up — WebSocket auth gate. + +Previously ``/api/v1/ws`` accepted *any* network client and immediately +streamed every ``printer_status`` / ``print_start`` / ``print_complete`` +/ ``archive_*`` / ``inventory_changed`` broadcast back to it. That is +the GHSA-gc24 shape on a different protocol — anyone who could reach +the HTTP port could subscribe to every printer event in the system. + +This endpoint now validates a short-lived token (minted by +``POST /api/v1/auth/ws-token`` behind ``Permission.WEBSOCKET_CONNECT``) +*before* ``websocket.accept()``. When auth is disabled, no token is +required (the legacy SPA-friendly path). The token is reused across +reconnects within its 60-minute window so a brief network blip does +not require a round-trip to the auth router. +""" + +from __future__ import annotations + import logging -from fastapi import APIRouter, WebSocket, WebSocketDisconnect +from fastapi import APIRouter, Query, WebSocket, WebSocketDisconnect +from backend.app.core.auth import is_auth_enabled, verify_websocket_token +from backend.app.core.database import async_session from backend.app.core.websocket import ws_manager from backend.app.services.background_dispatch import background_dispatch from backend.app.services.printer_manager import printer_manager, printer_state_to_dict @@ -9,16 +29,68 @@ from backend.app.services.printer_manager import printer_manager, printer_state_ logger = logging.getLogger(__name__) router = APIRouter() +# 4401 mirrors the WebSocket "unauthorised" application close code +# convention used by Sec-WebSocket-Protocol authors (private-use range +# is 4000-4999 per RFC 6455). The SPA distinguishes 4401 from network +# drops and refetches a token instead of retrying with the old one. +_WS_CLOSE_UNAUTHORIZED = 4401 + @router.websocket("/ws") -async def websocket_endpoint(websocket: WebSocket): - """WebSocket endpoint for real-time updates.""" - logger.info("WebSocket client connecting...") +async def websocket_endpoint(websocket: WebSocket, token: str | None = Query(default=None)) -> None: + """WebSocket endpoint for real-time updates. + + Connection auth (GHSA-r2qv follow-up): + + - Auth disabled → connect without a token, identical to the prior + behaviour (single-user / local-network deployments). + - Auth enabled → ``?token=`` query param must hold an + unexpired token minted via ``POST /api/v1/auth/ws-token``. + Missing / invalid / expired token → ``close(code=4401)`` *before* + ``accept()`` so no ``ws_manager.broadcast`` ever reaches the + caller (broadcasts walk ``active_connections`` blindly — letting + an unauthenticated socket into that list is a fan-out leak). + + The auth check is fail-closed at every error path: a DB exception + while reading the ``auth_enabled`` setting closes the connection + rather than admitting the caller. + """ + # Authenticate before accept() so an unauth caller never lands in + # ws_manager.active_connections (where broadcasts blindly fan out). + try: + async with async_session() as db: + auth_required = await is_auth_enabled(db) + except Exception: # SEC-AUTH-EXC: DB failure on auth probe → fail-closed (refuse connect), matches is_auth_enabled itself which returns True on error + logger.error("WebSocket auth probe failed; refusing connection", exc_info=True) + await websocket.close(code=_WS_CLOSE_UNAUTHORIZED) + return + + principal: str | None = None + if auth_required: + if not token: + logger.info("WebSocket connect refused: no token (auth enabled)") + await websocket.close(code=_WS_CLOSE_UNAUTHORIZED) + return + principal = await verify_websocket_token(token) + if principal is None: + logger.info("WebSocket connect refused: invalid or expired token") + await websocket.close(code=_WS_CLOSE_UNAUTHORIZED) + return + + # Token verified (or auth disabled); now safe to admit the connection. + logger.info("WebSocket client connecting (principal=%s)", principal if principal else "") await ws_manager.connect(websocket) + # Stash on connection state for any future per-message permission + # logic; today the message handlers are read-only and only respond + # to the requesting socket, so the stash is informational. The + # explicit attribute (rather than a side dict) means a future + # ``broadcast_to_principal()`` helper can filter on it without + # touching every call site. + websocket.state.bambuddy_principal = principal logger.info("WebSocket client connected") try: - # Send initial status of all printers + # Send initial status of all printers. statuses = printer_manager.get_all_statuses() for printer_id, state in statuses.items(): await websocket.send_json( @@ -39,7 +111,7 @@ async def websocket_endpoint(websocket: WebSocket): ) logger.info("Sent initial status for %s printers", len(statuses)) - # Keep connection alive and handle incoming messages + # Keep connection alive and handle incoming messages. while True: data = await websocket.receive_json() diff --git a/backend/app/core/auth.py b/backend/app/core/auth.py index 6dd700f7b..75badbfc5 100644 --- a/backend/app/core/auth.py +++ b/backend/app/core/auth.py @@ -504,6 +504,72 @@ async def create_camera_stream_token() -> str: return token +WEBSOCKET_TOKEN_EXPIRE_MINUTES = 60 + + +async def create_websocket_token(username: str | None) -> str: + """Create a short-lived token for ``/api/v1/ws`` connections. + + Mirrors the camera-stream-token pattern: opaque random string stored + in ``auth_ephemeral_tokens`` with type ``"websocket"`` so the WS + endpoint can verify it *before* calling ``websocket.accept()``. + + Records the issuing principal in the ``username`` field — for JWT + callers this is the actual username, for API-keyed callers this is + the empty string (handled in the route layer; we accept None at this + interface so the auth-disabled path doesn't have to fabricate one). + + The 60-minute expiry matches camera tokens: long enough to survive + page reloads / brief disconnects, short enough that a leaked token + is not a credential. + """ + now = datetime.now(timezone.utc) + expires_at = now + timedelta(minutes=WEBSOCKET_TOKEN_EXPIRE_MINUTES) + token = secrets.token_urlsafe(24) + async with async_session() as db: + # Prune expired tokens opportunistically (same shape as camera). + await db.execute( + delete(AuthEphemeralToken).where( + AuthEphemeralToken.token_type == "websocket", + AuthEphemeralToken.expires_at < now, + ) + ) + db.add( + AuthEphemeralToken( + token=token, + token_type="websocket", + username=username or "", + expires_at=expires_at, + ) + ) + await db.commit() + return token + + +async def verify_websocket_token(token: str) -> str | None: + """Verify a WebSocket connect token. + + Returns the recorded ``username`` (possibly ``""`` for API-key + callers, never ``None`` on success) when the token is valid, or + ``None`` when it is missing / expired / unknown. The token is + NOT consumed — a single page reload should not need a new round + trip to mint a replacement. + """ + now = datetime.now(timezone.utc) + async with async_session() as db: + result = await db.execute( + select(AuthEphemeralToken).where( + AuthEphemeralToken.token == token, + AuthEphemeralToken.token_type == "websocket", + AuthEphemeralToken.expires_at > now, + ) + ) + row = result.scalar_one_or_none() + if row is None: + return None + return row.username or "" + + async def verify_camera_stream_token(token: str) -> bool: """Verify a camera stream token is valid (reusable — does not consume it). @@ -748,7 +814,7 @@ async def _validate_api_key(db: AsyncSession, api_key_value: str) -> APIKey | No api_key.last_used = datetime.now(timezone.utc) await db.commit() return api_key - except Exception as e: + except Exception as e: # SEC-AUTH-EXC: validation failure returns None; every caller treats None as "invalid key" → 401 (fail-closed) logger.warning("API key validation error: %s", e) return None @@ -939,19 +1005,92 @@ def require_role(required_role: str): def require_admin_if_auth_enabled(): - """Dependency factory that requires admin role if auth is enabled.""" + """Dependency factory that requires admin role if auth is enabled. + + GHSA-r2qv follow-up (audit pattern P3): explicitly fail-closed for API + keys. The previous implementation chained on ``require_auth_if_enabled`` + which returns ``None`` for *both* "auth disabled" *and* "valid API + key" — the inner ``admin_checker`` then treated ``None`` as auth- + disabled and admitted the caller. If any route had ever adopted this + dep, any API key with no scope flags set would have satisfied an + admin requirement. + + Today no route uses this dep, but rather than leave the footgun + armed, the dep is rewritten to distinguish the two cases by + consulting ``is_auth_enabled`` directly and rejecting API-keyed + requests with 403. "Admin" requires a user-identity role, which API + keys do not carry. + """ async def admin_checker( - current_user: Annotated[User | None, Depends(require_auth_if_enabled)] = None, + credentials: Annotated[HTTPAuthorizationCredentials | None, Depends(security)] = None, + x_api_key: Annotated[str | None, Header(alias="X-API-Key")] = None, ) -> User | None: - if current_user is None: - return None # Auth not enabled, allow access - if current_user.role != "admin": - raise HTTPException( - status_code=status.HTTP_403_FORBIDDEN, - detail="Requires admin role", - ) - return current_user + async with async_session() as db: + if not await is_auth_enabled(db): + return None # Auth disabled — no role to check. + + # Reject API-keyed requests up front: admin is a user-role + # concept, not a key-scope concept. The right path for + # admin-equivalent API-key access is a specific Permission + # (e.g. SETTINGS_UPDATE) gated by the allowlist, not the + # admin role. + if x_api_key or (credentials and credentials.credentials.startswith("bb_")): + raise HTTPException( + status_code=status.HTTP_403_FORBIDDEN, + detail="Admin operations require a user role; API keys cannot be admins", + ) + + # Standard JWT path: validate and require admin role. + if credentials is None: + raise HTTPException( + status_code=status.HTTP_401_UNAUTHORIZED, + detail="Authentication required", + headers={"WWW-Authenticate": "Bearer"}, + ) + try: + payload = jwt.decode(credentials.credentials, SECRET_KEY, algorithms=[ALGORITHM]) + username: str = payload.get("sub") + if username is None: + raise HTTPException( + status_code=status.HTTP_401_UNAUTHORIZED, + detail="Could not validate credentials", + headers={"WWW-Authenticate": "Bearer"}, + ) + jti: str | None = payload.get("jti") + if not jti or await is_jti_revoked(jti): + raise HTTPException( + status_code=status.HTTP_401_UNAUTHORIZED, + detail="Could not validate credentials", + headers={"WWW-Authenticate": "Bearer"}, + ) + iat: int | float | None = payload.get("iat") + except JWTError: + raise HTTPException( + status_code=status.HTTP_401_UNAUTHORIZED, + detail="Could not validate credentials", + headers={"WWW-Authenticate": "Bearer"}, + ) + + user = await get_user_by_username(db, username) + if user is None or not user.is_active: + raise HTTPException( + status_code=status.HTTP_401_UNAUTHORIZED, + detail="Could not validate credentials", + headers={"WWW-Authenticate": "Bearer"}, + ) + if not _is_token_fresh(iat, user): + raise HTTPException( + status_code=status.HTTP_401_UNAUTHORIZED, + detail="Could not validate credentials", + headers={"WWW-Authenticate": "Bearer"}, + ) + if user.role != "admin": + raise HTTPException( + status_code=status.HTTP_403_FORBIDDEN, + detail="Requires admin role", + ) + return user return admin_checker diff --git a/backend/tests/integration/test_external_folders_api.py b/backend/tests/integration/test_external_folders_api.py index a7d5f9403..f592d04d1 100644 --- a/backend/tests/integration/test_external_folders_api.py +++ b/backend/tests/integration/test_external_folders_api.py @@ -8,6 +8,21 @@ import pytest from httpx import AsyncClient +@pytest.fixture(autouse=True) +def _enable_external_roots(monkeypatch, tmp_path): + """Permit pytest's ``tmp_path`` tree as a valid external root. + + After the GHSA-r2qv I1 fix, external folders are opt-in via the + ``BAMBUDDY_EXTERNAL_ROOTS`` env var (empty by default → feature + disabled). The test suite's external dirs live under pytest's + per-session ``tmp_path`` root, which is a subtree of the OS tmp + dir, so allowlisting the parent of ``tmp_path`` lets every test + folder fixture pass the new validator. Autouse so individual tests + don't have to know the env var exists. + """ + monkeypatch.setenv("BAMBUDDY_EXTERNAL_ROOTS", str(tmp_path.parent)) + + class TestExternalFolderCreation: """Tests for POST /library/folders/external.""" @@ -53,11 +68,18 @@ class TestExternalFolderCreation: @pytest.mark.asyncio @pytest.mark.integration - async def test_create_external_folder_nonexistent_path(self, async_client: AsyncClient, db_session): - """Verify 400 for non-existent path.""" + async def test_create_external_folder_nonexistent_path(self, async_client: AsyncClient, db_session, tmp_path): + """Verify 400 for non-existent path within an allowed root. + + After GHSA-r2qv I1 the allowlist check runs before the existence + check, so the test path must be inside ``BAMBUDDY_EXTERNAL_ROOTS`` + (= ``tmp_path.parent`` per ``_enable_external_roots``) to actually + exercise the existence branch rather than the allowlist branch. + """ + bad_path = tmp_path / "nonexistent" / "subdir" data = { "name": "Bad Path", - "external_path": "/nonexistent/path/that/does/not/exist", + "external_path": str(bad_path), } response = await async_client.post("/api/v1/library/folders/external", json=data) assert response.status_code == 400 @@ -65,15 +87,24 @@ class TestExternalFolderCreation: @pytest.mark.asyncio @pytest.mark.integration - async def test_create_external_folder_system_dir_blocked(self, async_client: AsyncClient, db_session): - """Verify system directories are blocked.""" + async def test_create_external_folder_outside_allowlist_blocked(self, async_client: AsyncClient, db_session): + """Paths outside ``BAMBUDDY_EXTERNAL_ROOTS`` are rejected (GHSA-r2qv I1). + + Prior behaviour was a denylist (``/proc``, ``/sys``, ``/dev``, etc); + anything not enumerated passed, including ``/data`` containing + other users' archives. The allowlist replacement defaults to the + empty set; this test confirms that a path outside the (tmp-path) + allowlist set up by ``_enable_external_roots`` is rejected. + ``/proc`` is the canonical example of a system directory that + any operator allowlist would never legitimately include. + """ data = { "name": "System", "external_path": "/proc", } response = await async_client.post("/api/v1/library/folders/external", json=data) assert response.status_code == 400 - assert "system directory" in response.json()["detail"].lower() + assert "not within an allowed external root" in response.json()["detail"].lower() @pytest.mark.asyncio @pytest.mark.integration diff --git a/backend/tests/unit/test_no_fail_open_in_auth.py b/backend/tests/unit/test_no_fail_open_in_auth.py new file mode 100644 index 000000000..0953d7907 --- /dev/null +++ b/backend/tests/unit/test_no_fail_open_in_auth.py @@ -0,0 +1,115 @@ +"""GHSA-6mf4-q26m-47pv backstop: no fail-open ``except Exception`` in auth code. + +The advisory's root cause was a single ``except Exception:`` block in the +auth probe path that returned ``False`` (treated as "auth disabled, allow +everything") when the DB raised an error during the check. CVSS 9.8. +Other Python ecosystems would call this CWE-636 ("Not Failing +Securely"). + +The fundamental problem is that ``except Exception:`` is too broad to +audit at review time — the reviewer cannot tell, just from the except +clause, whether the handler re-raises, denies, or silently returns a +permissive value. So every such block in auth-sensitive code must be +explicitly tagged with the reviewer's audit conclusion using the +``# SEC-AUTH-EXC: `` marker. Untagged blocks fail this +test. + +The tag forces three things every time an ``except Exception:`` lands +in scope: +1. A reviewer has read the handler body and confirmed fail-closed semantics. +2. The reasoning is captured at the exact line so future readers can verify. +3. ``grep SEC-AUTH-EXC`` enumerates every audited exception path for spot-checks. + +Scope (where this rule applies, mirrors SECURITY.md rule 2): +- backend/app/core/auth.py +- backend/app/core/permissions.py +- backend/app/api/routes/auth.py + +To add a new ``except Exception:`` block in scope, append a comment +``# SEC-AUTH-EXC: `` on the same line as the +``except`` keyword. The reason should describe what makes the handler +safe (e.g. "rollback + raise 500", "returns None which caller treats +as invalid → 401", "logged only, no access decision made here"). +""" + +from __future__ import annotations + +import ast +from pathlib import Path + +import pytest + +REPO_ROOT = Path(__file__).resolve().parents[3] + +# Files in scope for the lint. Adding a file here widens the safety net; +# removing one weakens it. Either decision belongs in a PR description. +IN_SCOPE: tuple[Path, ...] = ( + REPO_ROOT / "backend" / "app" / "core" / "auth.py", + REPO_ROOT / "backend" / "app" / "core" / "permissions.py", + REPO_ROOT / "backend" / "app" / "api" / "routes" / "auth.py", +) + +TAG_MARKER = "# SEC-AUTH-EXC:" + + +def _is_broad_except(handler: ast.ExceptHandler) -> bool: + """Return True if ``handler`` catches Exception or bare ``except:``. + + Excludes narrower catches like ``except (OperationalError, ProgrammingError):`` + or ``except JWTError:`` which are explicit about what they handle and + not the GHSA-6mf4 shape. + """ + if handler.type is None: + return True # bare `except:` + # Single Name catching Exception + if isinstance(handler.type, ast.Name) and handler.type.id == "Exception": + return True + # Tuple catching Exception alongside other types — e.g. `except (Exception, OSError):` + if isinstance(handler.type, ast.Tuple): + return any(isinstance(elt, ast.Name) and elt.id == "Exception" for elt in handler.type.elts) + return False + + +@pytest.mark.unit +def test_no_fail_open_in_auth_modules() -> None: + """SEC-AUTH-2 (SECURITY.md): every broad except in auth modules must carry SEC-AUTH-EXC tag. + + Walks the AST of each in-scope module, finds every ``except Exception:`` + (or bare ``except:``) block, and asserts the source line containing + the ``except`` keyword has a ``# SEC-AUTH-EXC: `` tag. + + The tag is the reviewer's signed-off audit conclusion. Without it, + the broad except is indistinguishable from the GHSA-6mf4 shape. + """ + findings: list[str] = [] + for source_path in IN_SCOPE: + assert source_path.is_file(), f"Expected in-scope file at {source_path}" + source = source_path.read_text(encoding="utf-8") + source_lines = source.splitlines() + tree = ast.parse(source) + relative = source_path.relative_to(REPO_ROOT) + + for node in ast.walk(tree): + if not isinstance(node, ast.ExceptHandler): + continue + if not _is_broad_except(node): + continue + + # The ``except`` keyword is on node.lineno. Comment must appear + # on that line (1-indexed in ast, 0-indexed in our list). + line_text = source_lines[node.lineno - 1] + if TAG_MARKER not in line_text: + # Show enough context for the operator to find the block. + handler_preview = line_text.strip() + findings.append( + f" {relative}:{node.lineno} {handler_preview}\n" + f" → add `{TAG_MARKER} ` describing why this is fail-closed" + ) + + assert not findings, ( + "Untagged ``except Exception:`` (or bare ``except:``) blocks found in auth modules. " + "Each one is indistinguishable at review time from the GHSA-6mf4-q26m-47pv shape (CVSS 9.8). " + "Either narrow the catch to the specific exception type you handle, or tag the line with " + "`# SEC-AUTH-EXC: ` documenting what makes the handler fail-closed. " + "See SECURITY.md rule 2 'Fail-closed in auth code'.\n\n" + "\n".join(findings) + ) diff --git a/backend/tests/unit/test_no_hardcoded_secrets.py b/backend/tests/unit/test_no_hardcoded_secrets.py new file mode 100644 index 000000000..c161aa861 --- /dev/null +++ b/backend/tests/unit/test_no_hardcoded_secrets.py @@ -0,0 +1,158 @@ +"""GHSA-gc24-px2r-5qmf backstop: no hardcoded fallback secrets in source. + +The first half of GHSA-gc24-px2r-5qmf (CVSS 9.8) was a literal +``bambuddy-secret-key-change-in-production`` string used as the JWT +signing key when ``JWT_SECRET_KEY`` was unset. Production Docker images +shipped with that exact string — meaning anyone who pulled the image +could forge admin tokens for any Bambuddy instance running unmodified. + +This test walks every source file in ``backend/app/`` at parse time and +flags string literals that look like credential fallbacks. It is +deliberately stricter than the actual exploit: any +``*-change-in-production`` / ``change-me`` / ``your-secret-here`` +shaped string is a code smell at a security boundary, regardless of +whether the call site happens to enforce env-var presence today. The +goal is to keep that string class out of the codebase entirely so +future code paths cannot re-introduce the same vulnerability shape. + +If you need one of these strings as a test input (e.g. asserting that +a forged token signed with the old leaked secret is *rejected*), use +the ``ALLOWED_TEST_INPUT_PATTERNS`` allowlist below — never the +production source. +""" + +from __future__ import annotations + +import ast +from pathlib import Path + +import pytest + +# Substring patterns that should never appear in production source as +# string literals. Case-insensitive substring match. +FORBIDDEN_PATTERNS: tuple[str, ...] = ( + "change-in-production", + "change-me-in-production", + "your-secret-here", + "your-secret-key", + "default-secret-key", + "insecure-default", + "placeholder-secret", + "replace-this-secret", + # The exact leaked value from GHSA-gc24 — keep as a regression marker + # so any reintroduction is caught loudly with the CVE number attached. + "bambuddy-secret-key-change-in-production", +) + +# Production-source files where these patterns are TOLERATED because they +# document the historical leak (CHANGELOG / migration notes / security +# advisory references) rather than being used as a credential fallback. +# Add an entry with a `# reason: ...` comment, never silently. +ALLOWED_PRODUCTION_FILES: frozenset[Path] = frozenset() + + +def _python_files_under(root: Path) -> list[Path]: + """Yield every .py file under ``root`` excluding caches and virtualenvs.""" + return [ + p + for p in root.rglob("*.py") + if "__pycache__" not in p.parts and ".venv" not in p.parts and "venv" not in p.parts + ] + + +def _string_literals_in(file_path: Path) -> list[tuple[int, str]]: + """Return (lineno, value) for every string literal in ``file_path``. + + Uses ``ast`` to avoid false positives from comments / docstrings; + docstrings are ``ast.Constant`` too but we explicitly include them + because a docstring is not a safe place to put a credential either. + Returns an empty list on syntax-error files rather than crashing — + a parse failure means the file has a separate bug and we don't want + this test to mask it. + """ + try: + tree = ast.parse(file_path.read_text(encoding="utf-8")) + except (SyntaxError, UnicodeDecodeError): + return [] + return [ + (node.lineno, node.value) + for node in ast.walk(tree) + if isinstance(node, ast.Constant) and isinstance(node.value, str) + ] + + +@pytest.mark.unit +def test_no_hardcoded_secrets_in_production_source() -> None: + """SEC-AUTH-3 (SECURITY.md): no credential-shaped fallback strings in backend/app/. + + Walks every Python source file under ``backend/app/``. Flags string + literals matching any pattern in ``FORBIDDEN_PATTERNS``. Allowlisted + files (e.g. tests asserting we reject the leaked GHSA-gc24 token) + are exempt via ``ALLOWED_PRODUCTION_FILES``. + + Failure here means a code change has reintroduced the GHSA-gc24 + failure mode: a string literal that production code could fall + back to as a credential, defeating the env-var-or-fail design of + ``_get_jwt_secret()``. + """ + repo_root = Path(__file__).resolve().parents[3] + production_root = repo_root / "backend" / "app" + assert production_root.is_dir(), f"Expected backend/app/ at {production_root}" + + findings: list[str] = [] + for src in _python_files_under(production_root): + relative = src.relative_to(repo_root) + if relative in ALLOWED_PRODUCTION_FILES: + continue + for lineno, literal in _string_literals_in(src): + literal_lower = literal.lower() + for pattern in FORBIDDEN_PATTERNS: + if pattern in literal_lower: + findings.append(f" {relative}:{lineno} contains forbidden pattern '{pattern}': {literal!r}") + break + + assert not findings, ( + "Hardcoded credential-shaped strings found in production source — " + "this is the GHSA-gc24-px2r-5qmf shape (CVSS 9.8 hardcoded JWT secret). " + "See SECURITY.md rule 3 'No hardcoded fallback secrets'.\n\n" + "\n".join(findings) + ) + + +@pytest.mark.unit +def test_jwt_secret_loader_has_no_hardcoded_fallback() -> None: + """SEC-AUTH-3 (SECURITY.md): _get_jwt_secret never returns a literal string. + + The post-GHSA-gc24 design of ``_get_jwt_secret`` reads from env, then + file, then generates a random value via ``secrets.token_urlsafe``. + No code path returns a string literal. This test asserts that + structural property by walking the function's AST and confirming + every ``return`` statement returns either a Name (variable) or a + Call (function result), never an ast.Constant string literal. + + If this test fails, ``_get_jwt_secret`` has been modified to return + a hardcoded value somewhere — likely as a "convenience default" that + will end up in a shipped Docker image, which is exactly how the + original GHSA-gc24 advisory happened. + """ + repo_root = Path(__file__).resolve().parents[3] + auth_module = repo_root / "backend" / "app" / "core" / "auth.py" + tree = ast.parse(auth_module.read_text(encoding="utf-8")) + + loader: ast.FunctionDef | None = None + for node in ast.walk(tree): + if isinstance(node, ast.FunctionDef) and node.name == "_get_jwt_secret": + loader = node + break + + assert loader is not None, "_get_jwt_secret() not found in backend/app/core/auth.py — has it been renamed?" + + literal_returns: list[tuple[int, str]] = [] + for node in ast.walk(loader): + if isinstance(node, ast.Return) and isinstance(node.value, ast.Constant) and isinstance(node.value.value, str): + literal_returns.append((node.lineno, node.value.value)) + + assert not literal_returns, ( + "_get_jwt_secret() has a string-literal return — this is the GHSA-gc24 vulnerability shape. " + "Use os.environ + file storage + secrets.token_urlsafe; never return a hardcoded string.\n" + + "\n".join(f" auth.py:{ln}: returns {val!r}" for ln, val in literal_returns) + ) diff --git a/backend/tests/unit/test_route_auth_coverage.py b/backend/tests/unit/test_route_auth_coverage.py new file mode 100644 index 000000000..b6106446d --- /dev/null +++ b/backend/tests/unit/test_route_auth_coverage.py @@ -0,0 +1,226 @@ +"""GHSA-gc24 + GHSA-r2qv backstop: every route has an explicit auth dep. + +The "second half" of GHSA-gc24-px2r-5qmf was that 77 endpoints out of 117 +responded to anonymous requests with full payloads. The fix at the time +was retroactive — auth deps were added route by route. This test makes +the requirement structural: every FastAPI route at the app-level (HTTP +and WebSocket) is walked, and each one either has an auth dependency or +is in the ``PUBLIC_ROUTES`` allowlist with a justification comment. + +Adding an unauthenticated route now requires touching the allowlist. +The diff makes the intent visible in code review and the entry-with- +reason format documents *why* this is safe (login itself, status +heartbeat, etc.). Drift catches the same failure mode that surfaced +the original advisory. + +The audit also covers WebSocket routes — the proactive sweep that +surfaced finding C1 (`/api/v1/ws` was fully unauthenticated) showed +that an APIRoute-only walk has a blind spot for the very route shape +that produced the most severe disclosure. +""" + +from __future__ import annotations + +import re + +import pytest +from fastapi.routing import APIRoute, APIWebSocketRoute + +from backend.app.main import app + +# Substring patterns identifying auth-bearing callable qualnames in the +# resolved Depends() tree. Inner functions returned by factories carry +# the outer factory's name in their qualname (e.g. +# ``require_permission..permission_checker``), so a substring +# check is enough; we don't have to enumerate the inner names. +_AUTH_QUALNAME_PATTERNS: tuple[str, ...] = ( + "require_", # require_permission, require_permission_if_auth_enabled, require_role, require_admin_*, require_auth_*, require_any_*, require_ownership_*, require_camera_stream_token_*, require_energy_cost_update + "cloud_caller", # cloud.py route-level dep + "_cloud_api_key_gate", # cloud.py router-level dep + "resolve_api_key_cloud_owner", # used by slicer routes that need the API key's owner + "get_current_user", # JWT identity resolution + "get_current_active_user", # JWT identity resolution + "get_api_key", # webhook routes use this directly + "verify_websocket_token", # WebSocket route inline check (GHSA-r2qv I-WS) +) + +# Routes that are intentionally accessible without an auth dependency. +# Each entry MUST be (method, path) tuple — the path is matched against +# ``route.path`` literally. To add an entry: include a justification on +# the line above explaining why anonymous access is safe. +_PUBLIC_ROUTES: frozenset[tuple[str, str]] = frozenset( + { + # ---- HTTP API: auth bootstrap (pre-credential or token-self-validated) ---- + # First-run setup — runs before any user exists. Idempotent once setup_completed is true. + ("POST", "/api/v1/auth/setup"), + # Login itself — credentials in the request body ARE the auth. + ("POST", "/api/v1/auth/login"), + # Logout — clears server-side JTI revocation; degraded behaviour on bad token is acceptable. + ("POST", "/api/v1/auth/logout"), + # Status heartbeat — used by the login UI to decide whether to show login form. + ("GET", "/api/v1/auth/status"), + # Advanced-auth status (whether 2FA / OIDC / LDAP are configured) — read by login form. + ("GET", "/api/v1/auth/advanced-auth/status"), + # LDAP status (whether LDAP login is configured) — read by login form. + ("GET", "/api/v1/auth/ldap/status"), + # OIDC discovery — login form needs the list of providers + their icons before user picks one. + ("GET", "/api/v1/auth/oidc/providers"), + ("GET", "/api/v1/auth/oidc/providers/{provider_id}/icon"), + # OIDC authorize / callback / exchange — protocol-level handshakes that validate state nonces inline. + ("GET", "/api/v1/auth/oidc/authorize/{provider_id}"), + ("GET", "/api/v1/auth/oidc/callback"), + ("POST", "/api/v1/auth/oidc/exchange"), + # 2FA send + verify — issued after password check; pre-auth token in cookie is the auth. + ("POST", "/api/v1/auth/2fa/email/send"), + ("POST", "/api/v1/auth/2fa/verify"), + # Forgot-password (anonymous request) + confirm (signed token in the URL). + ("POST", "/api/v1/auth/forgot-password"), + ("POST", "/api/v1/auth/forgot-password/confirm"), + # ---- HTTP API: signed-URL routes (token in path is the auth) ---- + # Signed download URLs — token in path validated by the handler. + ("GET", "/api/v1/archives/{archive_id}/dl/{token}/{filename}"), + ("GET", "/api/v1/archives/{archive_id}/source-dl/{token}/{filename}"), + ("GET", "/api/v1/library/files/{file_id}/dl/{token}/{filename}"), + # Obico cached frame — one-time nonce embedded in tags. + ("GET", "/api/v1/obico/cached-frame/{nonce}"), + # MakerWorld thumbnail proxy — fetches external URL; no Bambuddy data exposed. + ("GET", "/api/v1/makerworld/thumbnail"), + # ---- HTTP API: operational + UI-bootstrap (no sensitive data) ---- + # Operational liveness probe — minimal payload, used by container orchestrators. + ("GET", "/health"), + # Prometheus metrics — gated by its own bearer token check (constant-time post-I2). + ("GET", "/api/v1/metrics"), + # UI bootstrap — defaults for sidebar order and ui-preferences are public defaults that ship with the app. + ("GET", "/api/v1/settings/default-sidebar-order"), + ("GET", "/api/v1/settings/ui-preferences"), + # Slicer printer-models — static catalog, no user data. + ("GET", "/api/v1/slicer/printer-models"), + # Current Bambuddy version — public info (already visible in HTTP response headers + Docker tags). + ("GET", "/api/v1/updates/version"), + # Webhook routes — auth lives inside the handler via get_api_key() + check_permission(), not as a Depends. + # Once they all migrate to standard auth deps these entries come out; for now exempting the file. + ("GET", "/api/v1/webhook/printer/{printer_id}/status"), + ("GET", "/api/v1/webhook/queue"), + ("POST", "/api/v1/webhook/printer/{printer_id}/cancel"), + ("POST", "/api/v1/webhook/printer/{printer_id}/start"), + ("POST", "/api/v1/webhook/printer/{printer_id}/stop"), + ("POST", "/api/v1/webhook/queue/add"), + # ---- Static / SPA routes (not user data) ---- + ("GET", "/"), + ("GET", "/manifest.json"), + ("GET", "/sw-register.js"), + ("GET", "/sw.js"), + ("GET", "/gcode-viewer/"), + ("GET", "/gcode-viewer/{file_path:path}"), + # SPA catch-all — serves index.html for client-side routing. No backend data path. + ("GET", "/{full_path:path}"), + # ---- WebSocket routes ---- + # /ws performs an inline ``verify_websocket_token`` check before + # ``accept()`` (GHSA-r2qv WS fix). The qualname matches one of the + # auth-bearing patterns above, so this entry is informational — the + # walker recognises the inline check as auth. + } +) + + +def _walk_dependant_qualnames(dependant) -> list[str]: + """Flatten the dependant tree to a list of callable qualnames.""" + names: list[str] = [] + if dependant is None: + return names + if dependant.call: + names.append(getattr(dependant.call, "__qualname__", "?")) + for sub in dependant.dependencies: + names.extend(_walk_dependant_qualnames(sub)) + return names + + +def _has_auth_dep(dependant) -> bool: + """True if any callable in the dependant tree matches an auth pattern.""" + return any(any(p in qn for p in _AUTH_QUALNAME_PATTERNS) for qn in _walk_dependant_qualnames(dependant)) + + +def _ws_endpoint_does_inline_token_check(route: APIWebSocketRoute) -> bool: + """True if the websocket endpoint reads its source uses ``verify_websocket_token``. + + WebSocket routes don't pass auth via the standard Depends machinery + (the WebSocket handshake doesn't carry headers), so the auth check + lives inline in the endpoint body. We confirm by inspecting the + endpoint function's source text — looking for an actual call to + ``verify_websocket_token``. A docstring-only mention would NOT + satisfy this check (we look for a call-shaped pattern, not a + substring). + """ + import inspect + + try: + source = inspect.getsource(route.endpoint) + except (OSError, TypeError): + return False + return bool(re.search(r"\bverify_websocket_token\s*\(", source)) + + +@pytest.mark.unit +def test_routes_have_explicit_auth_deps() -> None: + """SEC-AUTH-1 (SECURITY.md): every API route has an auth dep or is in the public allowlist. + + Walks both ``APIRoute`` (HTTP) and ``APIWebSocketRoute`` (WS) + objects on the live FastAPI app. For each, asserts that at least + one of the resolved Depends in the dependant tree matches an auth- + bearing qualname, OR that the (method, path) pair is in the + explicit public-route allowlist, OR (for WebSocket routes) that + the endpoint performs an inline ``verify_websocket_token`` check. + + Failure means a new route is reachable anonymously without being + documented as such — the GHSA-gc24 / GHSA-r2qv shape. + """ + failures: list[str] = [] + + for route in app.routes: + if isinstance(route, APIRoute): + method = sorted(route.methods)[0] if route.methods else "GET" + if _has_auth_dep(route.dependant): + continue + if (method, route.path) in _PUBLIC_ROUTES: + continue + failures.append(f" {method:7} {route.path} → no auth dep, not in _PUBLIC_ROUTES allowlist") + elif isinstance(route, APIWebSocketRoute): + if _has_auth_dep(route.dependant): + continue + if _ws_endpoint_does_inline_token_check(route): + continue + if ("WS", route.path) in _PUBLIC_ROUTES: + continue + failures.append(f" WS {route.path} → no auth dep, no inline token check, not in _PUBLIC_ROUTES") + + assert not failures, ( + "Routes without an auth dependency that aren't in the public allowlist. " + "Either add a ``Depends(require_*)`` to the route OR add the (method, path) " + "to ``_PUBLIC_ROUTES`` with a comment justifying why anonymous access is safe. " + "See SECURITY.md rule 1 'Allowlist over denylist' (route allowlist sub-section).\n\n" + "\n".join(failures) + ) + + +@pytest.mark.unit +def test_public_routes_allowlist_matches_real_routes() -> None: + """Drift-detection: every (method, path) in ``_PUBLIC_ROUTES`` must exist on the app. + + If a route is renamed or removed, the entry for it in the allowlist + becomes dead — a residual rubber-stamp that does nothing but leaves + the impression that the route still has anonymous access. This test + flags those. + """ + real_routes: set[tuple[str, str]] = set() + for route in app.routes: + if isinstance(route, APIRoute): + method = sorted(route.methods)[0] if route.methods else "GET" + real_routes.add((method, route.path)) + elif isinstance(route, APIWebSocketRoute): + real_routes.add(("WS", route.path)) + + stale = sorted(_PUBLIC_ROUTES - real_routes) + assert not stale, ( + "_PUBLIC_ROUTES contains entries that no longer match any real route. " + "Remove these stale entries (the route was renamed, removed, or its method changed).\n\n" + + "\n".join(f" {m:7} {p}" for m, p in stale) + ) diff --git a/docker-compose.yml b/docker-compose.yml index 16abc25db..5b32164ef 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -69,6 +69,14 @@ services: # Enable the system trust store with the USE_SYSTEM_TRUST_STORE env var to # have Bambuddy trust the certificate. # - /path/to/certs:/usr/local/share/ca-certificates + # + # External library folders. Mount the host paths the operator wants + # users to be able to register as external folders. The in-container + # paths chosen here MUST appear in BAMBUDDY_EXTERNAL_ROOTS below. + # Read-only (:ro) is recommended unless you want users uploading + # files back to the host share. + #- /mnt/nas/3d-prints:/external/nas:ro + #- /srv/library:/external/projects:ro environment: - TZ=${TZ:-Europe/Berlin} # User/group the container drops to after the entrypoint normalises @@ -101,6 +109,16 @@ services: # to manage the key out-of-band (e.g. via a secret manager). #- MFA_ENCRYPTION_KEY= # + # External library folders (GHSA-r2qv follow-up). Empty default + # disables the "Add external folder" feature; set to one or more + # colon-separated absolute paths INSIDE THE CONTAINER to opt in. + # The paths must also be bind-mounted from the host — uncomment + # the matching volume snippet below. + # Example for a single NAS mount: + #- BAMBUDDY_EXTERNAL_ROOTS=/external/nas + # Example for two roots: + #- BAMBUDDY_EXTERNAL_ROOTS=/external/nas:/external/projects + # # Enable System Trust Store for certificate validation (e.g. for local Home Assistant) # You also need to mount your certificates to the container (see volumes section above). # - USE_SYSTEM_TRUST_STORE=true diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index a8d2baa13..bc1477d04 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -153,10 +153,16 @@ function SetupRoute({ children }: { children: React.ReactNode }) { function App() { return ( - + {/* ThemeProvider sits inside AuthProvider so its initial + ``api.getSettings()`` fetch can wait for AuthContext to + resolve — otherwise it fires unconditionally on every + login page load and returns 401. ErrorBoundary uses + inline styles, so a missing theme on a crash screen is + not a regression. */} + @@ -213,10 +219,10 @@ function App() { + - ); } diff --git a/frontend/src/__tests__/contexts/AuthContext.test.tsx b/frontend/src/__tests__/contexts/AuthContext.test.tsx index a6e839549..7bc57ff6e 100644 --- a/frontend/src/__tests__/contexts/AuthContext.test.tsx +++ b/frontend/src/__tests__/contexts/AuthContext.test.tsx @@ -24,11 +24,14 @@ function createWrapper() { return ( - - - {children} - - + {/* ThemeProvider sits inside AuthProvider (matches App.tsx + after the GHSA-r2qv login-page-quiet fix) so its + useAuth() call resolves. */} + + + {children} + + ); diff --git a/frontend/src/__tests__/contexts/ColorCatalogContext.test.tsx b/frontend/src/__tests__/contexts/ColorCatalogContext.test.tsx index ae7ed3ff8..9604ff793 100644 --- a/frontend/src/__tests__/contexts/ColorCatalogContext.test.tsx +++ b/frontend/src/__tests__/contexts/ColorCatalogContext.test.tsx @@ -27,13 +27,13 @@ function createWrapper() { return ( - - - + + + {children} - - - + + + ); diff --git a/frontend/src/__tests__/contexts/ThemeContext.test.tsx b/frontend/src/__tests__/contexts/ThemeContext.test.tsx index 9a8b562b3..a87e5d888 100644 --- a/frontend/src/__tests__/contexts/ThemeContext.test.tsx +++ b/frontend/src/__tests__/contexts/ThemeContext.test.tsx @@ -5,6 +5,8 @@ import { describe, it, expect, beforeEach } from 'vitest'; import { renderHook, act } from '@testing-library/react'; import { ThemeProvider, useTheme } from '../../contexts/ThemeContext'; +import { AuthProvider } from '../../contexts/AuthContext'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import type { ReactNode } from 'react'; // Helper to create a controllable matchMedia mock for individual tests @@ -41,7 +43,21 @@ function mockMatchMedia(prefersDark: boolean) { } function wrapper({ children }: { children: ReactNode }) { - return {children}; + // ThemeProvider now calls useAuth() internally to gate its initial + // api.getSettings() fetch (GHSA-r2qv login-page-quiet fix), so we + // need AuthProvider in the tree. QueryClientProvider is required by + // any AuthProvider descendant that calls useQuery (none here, but + // AuthProvider itself uses ``api.request`` via getAuthStatus). + const queryClient = new QueryClient({ + defaultOptions: { queries: { retry: false, gcTime: 0 } }, + }); + return ( + + + {children} + + + ); } describe('ThemeContext', () => { diff --git a/frontend/src/__tests__/hooks/useWebSocket.test.ts b/frontend/src/__tests__/hooks/useWebSocket.test.ts index 479ea8a5e..61b4676dd 100644 --- a/frontend/src/__tests__/hooks/useWebSocket.test.ts +++ b/frontend/src/__tests__/hooks/useWebSocket.test.ts @@ -107,8 +107,27 @@ function createWrapper(queryClient: QueryClient) { }; } -function getLatestWs(): MockWebSocket | undefined { - return wsInstances[wsInstances.length - 1]; +/** + * After GHSA-r2qv, useWebSocket awaits a ws-token fetch before constructing + * the WebSocket. The MockWebSocket isn't pushed into ``wsInstances`` until + * that promise resolves. ``waitFor`` from testing-library uses real-time + * polling and so wedges under ``vi.useFakeTimers()``; flushing microtasks + * manually works under both real and fake timers because Promise resolution + * runs on the microtask queue, not on the mocked clock. + * + * Two iterations suffice for ``await fetch(...)`` → ``await resp.json()``; + * a small headroom lets future awaits land here without changing every + * call site. + */ +async function waitForWs(): Promise { + for (let i = 0; i < 10 && wsInstances.length === 0; i++) { + await Promise.resolve(); + } + const ws = wsInstances[wsInstances.length - 1]; + if (!ws) { + throw new Error('WebSocket was not constructed after microtask flush'); + } + return ws; } describe('useWebSocket hook', () => { @@ -122,10 +141,28 @@ describe('useWebSocket hook', () => { // Save original and install mock originalWebSocket = globalThis.WebSocket; globalThis.WebSocket = MockWebSocket as unknown as typeof WebSocket; + + // After GHSA-r2qv, useWebSocket fetches a ws-token via api.getWebSocketToken + // before opening the socket. ``api.request`` reads ``response.headers`` + // and ``response.status``; the stub must expose those (a missing + // ``headers`` field throws inside request() and the silent catch in + // useWebSocket then proceeds with an undefined token, so the assertion + // "URL contains ?token=" fails without making the cause obvious). + vi.stubGlobal( + 'fetch', + vi.fn(async () => ({ + ok: true, + status: 200, + statusText: 'OK', + headers: { get: () => null }, + json: async () => ({ token: 'test-ws-token' }), + })), + ); }); afterEach(() => { vi.restoreAllMocks(); + vi.unstubAllGlobals(); // Restore original WebSocket globalThis.WebSocket = originalWebSocket; }); @@ -190,9 +227,11 @@ describe('useWebSocket hook', () => { wrapper: createWrapper(queryClient), }); - const ws = getLatestWs(); + const ws = await waitForWs(); expect(ws).toBeDefined(); - expect(ws?.url).toContain('/api/v1/ws'); + expect(ws.url).toContain('/api/v1/ws'); + // GHSA-r2qv: the ws-token mint result is appended as ?token=... + expect(ws.url).toContain('token=test-ws-token'); }); it('reports connected state when WebSocket opens', async () => { @@ -206,9 +245,9 @@ describe('useWebSocket hook', () => { expect(result.current.isConnected).toBe(false); // Simulate connection opening - const ws = getLatestWs(); + const ws = await waitForWs(); act(() => { - ws?.open(); + ws.open(); }); await waitFor(() => { @@ -285,7 +324,7 @@ describe('useWebSocket hook', () => { wrapper: createWrapper(queryClient), }); - const ws = getLatestWs()!; + const ws = await waitForWs(); // Open connection act(() => { @@ -327,7 +366,7 @@ describe('useWebSocket hook', () => { wrapper: createWrapper(queryClient), }); - const ws = getLatestWs()!; + const ws = await waitForWs(); // Open connection act(() => { @@ -368,7 +407,7 @@ describe('useWebSocket hook', () => { wrapper: createWrapper(queryClient), }); - const ws = getLatestWs()!; + const ws = await waitForWs(); // Open connection act(() => { @@ -405,7 +444,7 @@ describe('useWebSocket hook', () => { wrapper: createWrapper(queryClient), }); - const ws = getLatestWs()!; + const ws = await waitForWs(); act(() => { ws.open(); }); @@ -435,7 +474,7 @@ describe('useWebSocket hook', () => { wrapper: createWrapper(queryClient), }); - const ws = getLatestWs()!; + const ws = await waitForWs(); // Open connection act(() => { @@ -460,7 +499,7 @@ describe('useWebSocket hook', () => { wrapper: createWrapper(queryClient), }); - const ws = getLatestWs()!; + const ws = await waitForWs(); // Open connection act(() => { @@ -490,7 +529,7 @@ describe('useWebSocket hook', () => { wrapper: createWrapper(queryClient), }); - const ws = getLatestWs()!; + const ws = await waitForWs(); // Open connection act(() => { @@ -519,7 +558,7 @@ describe('useWebSocket hook', () => { wrapper: createWrapper(queryClient), }); - const ws = getLatestWs()!; + const ws = await waitForWs(); // Open connection act(() => { @@ -542,7 +581,7 @@ describe('useWebSocket hook', () => { wrapper: createWrapper(queryClient), }); - const ws = getLatestWs()!; + const ws = await waitForWs(); // Don't open connection - still in CONNECTING state @@ -564,7 +603,11 @@ describe('useWebSocket hook', () => { wrapper: createWrapper(queryClient), }); - const firstWs = getLatestWs()!; + // GHSA-r2qv: connect() awaits a ws-token fetch before constructing + // the WebSocket. Flush microtasks under fake timers so the await + // resolves and MockWebSocket is pushed into wsInstances. + await vi.advanceTimersByTimeAsync(0); + const firstWs = wsInstances[wsInstances.length - 1]!; // Open connection act(() => { @@ -578,14 +621,13 @@ describe('useWebSocket hook', () => { firstWs.close(); }); - // Wait for reconnect timeout (3 seconds) - act(() => { - vi.advanceTimersByTime(3000); - }); + // Wait for reconnect timeout (3 seconds) + microtask flush for the + // async connect() that the reconnect schedules. + await vi.advanceTimersByTimeAsync(3000); // Should have created new WebSocket expect(wsInstances.length).toBe(instanceCountBefore + 1); - expect(getLatestWs()).not.toBe(firstWs); + expect(wsInstances[wsInstances.length - 1]).not.toBe(firstWs); vi.useRealTimers(); }); @@ -597,7 +639,7 @@ describe('useWebSocket hook', () => { wrapper: createWrapper(queryClient), }); - const ws = getLatestWs()!; + const ws = await waitForWs(); // Open connection act(() => { diff --git a/frontend/src/__tests__/pages/CameraPage.test.tsx b/frontend/src/__tests__/pages/CameraPage.test.tsx index 9994e8d10..74034ec43 100644 --- a/frontend/src/__tests__/pages/CameraPage.test.tsx +++ b/frontend/src/__tests__/pages/CameraPage.test.tsx @@ -44,15 +44,15 @@ function renderCameraPage(printerId: number, search = '') { - - + + } /> - - + + diff --git a/frontend/src/__tests__/pages/GroupEditPage.test.tsx b/frontend/src/__tests__/pages/GroupEditPage.test.tsx index 50b6c7898..ffe6c359e 100644 --- a/frontend/src/__tests__/pages/GroupEditPage.test.tsx +++ b/frontend/src/__tests__/pages/GroupEditPage.test.tsx @@ -237,18 +237,18 @@ describe('GroupEditPage', () => { const wrapper = ( - - - + + + } /> Settings} /> - - - + + + ); rtlRender(wrapper); diff --git a/frontend/src/__tests__/pages/StreamOverlayPage.test.tsx b/frontend/src/__tests__/pages/StreamOverlayPage.test.tsx index c35bd843c..2cc27e959 100644 --- a/frontend/src/__tests__/pages/StreamOverlayPage.test.tsx +++ b/frontend/src/__tests__/pages/StreamOverlayPage.test.tsx @@ -11,6 +11,7 @@ import { MemoryRouter, Route, Routes } from 'react-router-dom'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { ThemeProvider } from '../../contexts/ThemeContext'; import { ToastProvider } from '../../contexts/ToastContext'; +import { AuthProvider } from '../../contexts/AuthContext'; const mockPrinter = { id: 1, @@ -60,13 +61,15 @@ function renderOverlayPage(printerId: number, queryParams = '') { return rtlRender( - - - - } /> - - - + + + + + } /> + + + + ); diff --git a/frontend/src/__tests__/setup.ts b/frontend/src/__tests__/setup.ts index 31fd6670d..e1cd9059a 100644 --- a/frontend/src/__tests__/setup.ts +++ b/frontend/src/__tests__/setup.ts @@ -87,6 +87,52 @@ vi.stubGlobal('WebSocket', MockWebSocket); // Mock scrollTo window.scrollTo = vi.fn(); +// Silence jsdom's "Not implemented: navigation (except hash changes)" +// warning when production code does ``window.location.href = '/setup'`` +// (AuthContext setup-redirect) or other full-page nav assignments. +// +// jsdom defines ``href`` as a non-configurable accessor on +// ``Location.prototype``, so it cannot be redefined on the instance via +// ``Object.defineProperty``. We wrap the real jsdom Location in a Proxy +// that turns ``href = "..."`` writes into silent no-ops; everything +// else (reads of ``pathname`` / ``search`` / ``hash``, writes to +// ``hash``, ``assign()`` / ``replace()`` calls, ``history.replaceState`` +// updating ``search``) passes through unchanged. The ``get`` trap is +// deliberately permissive: returning a substitute value for a non- +// configurable target property violates Proxy invariants and the spread +// operator (``{ ...window.location }``) walks every key — tests that +// use the spread to copy the location object must keep working. +{ + const realLocation = window.location; + const locationProxy = new Proxy(realLocation, { + set(target, prop, value) { + if (prop === 'href') { + // Silently swallow "navigation not implemented". Tests asserting + // on the redirect should replace ``window.location`` themselves + // (several existing tests do exactly this). + return true; + } + Reflect.set(target, prop, value); + return true; + }, + get(target, prop, receiver) { + // Return the exact value present on the target. Returning a + // bound/wrapped version of a non-configurable function (``assign`` + // is one) violates Proxy invariants (the spread operator at one + // call site triggers this). Production code that does + // ``window.location.assign(url)`` calls the function with the + // proxy as ``this``, which jsdom still accepts because its + // Location methods unwrap their receiver internally. + return Reflect.get(target, prop, receiver); + }, + }); + Object.defineProperty(window, 'location', { + configurable: true, + writable: true, + value: locationProxy, + }); +} + // Mock localStorage const localStorageMock = { getItem: vi.fn(), diff --git a/frontend/src/__tests__/utils.tsx b/frontend/src/__tests__/utils.tsx index 29bde1250..ea1748b37 100644 --- a/frontend/src/__tests__/utils.tsx +++ b/frontend/src/__tests__/utils.tsx @@ -36,11 +36,16 @@ function AllProviders({ children }: AllProvidersProps) { return ( - - + {/* ThemeProvider is now mounted inside AuthProvider in App.tsx so + its initial ``api.getSettings()`` sync can gate on auth state. + Tests follow the same nesting; otherwise ThemeProvider's + ``useAuth()`` throws "AuthContext must be used inside + AuthProvider". */} + + {children} - - + + ); diff --git a/frontend/src/api/client.ts b/frontend/src/api/client.ts index fa6956bde..a968b62c0 100644 --- a/frontend/src/api/client.ts +++ b/frontend/src/api/client.ts @@ -5088,6 +5088,12 @@ export const api = { getCameraStreamToken: () => request<{ token: string }>('/printers/camera/stream-token', { method: 'POST' }), + // WebSocket auth (GHSA-r2qv follow-up) — mint a short-lived token for + // the /ws connection. Browsers can't attach Authorization headers to a + // WebSocket handshake, so the token rides in the ?token= query param. + getWebSocketToken: () => + request<{ token: string }>('/auth/ws-token', { method: 'POST' }), + // Long-lived camera-stream tokens (#1108) createLongLivedCameraToken: (payload: { name: string; expires_in_days: number }) => request('/auth/tokens', { diff --git a/frontend/src/contexts/ThemeContext.tsx b/frontend/src/contexts/ThemeContext.tsx index f8032e193..bc2884464 100644 --- a/frontend/src/contexts/ThemeContext.tsx +++ b/frontend/src/contexts/ThemeContext.tsx @@ -1,5 +1,6 @@ import { createContext, useContext, useEffect, useState, type ReactNode } from 'react'; import { api } from '../api/client'; +import { useAuth } from './AuthContext'; type ThemeMode = 'light' | 'dark' | 'system'; type ThemeStyle = 'classic' | 'glow' | 'vibrant'; @@ -32,6 +33,14 @@ interface ThemeContextType { const ThemeContext = createContext(undefined); export function ThemeProvider({ children }: { children: ReactNode }) { + // Auth-aware: read state from AuthContext so the initial getSettings() + // sync waits until we know whether (a) auth is enabled and (b) there + // is a logged-in user. Without this the fetch fires on the login page + // and returns 401 — harmless (the catch swallows it) but noisy in the + // network panel and wasteful. ThemeProvider is mounted inside + // AuthProvider in App.tsx specifically so this hook is callable. + const { authEnabled, user, loading: authLoading } = useAuth(); + // Mode const [mode, setModeState] = useState(() => { const stored = localStorage.getItem('theme-mode') as ThemeMode | null; @@ -78,8 +87,13 @@ export function ThemeProvider({ children }: { children: ReactNode }) { return (localStorage.getItem('light-accent') as ThemeAccent) || 'green'; }); - // Sync from API on mount + // Sync from API once auth state is known. Same gate shape as + // useStreamTokenSync / ColorCatalogProvider: wait for AuthContext to + // settle, then only fetch when we can actually expect a 200 (auth + // disabled, or auth enabled with a logged-in user). useEffect(() => { + if (authLoading) return; + if (authEnabled && user === null) return; api.getSettings().then((settings) => { // Dark settings if (settings.dark_style) { @@ -108,7 +122,10 @@ export function ThemeProvider({ children }: { children: ReactNode }) { localStorage.setItem('light-accent', settings.light_accent); } }).catch(() => {}); - }, []); + // Re-fetch when auth state transitions (e.g. login completes); the + // gate above short-circuits subsequent calls once we already have a + // valid sync. + }, [authLoading, authEnabled, user]); // Apply theme classes based on current mode useEffect(() => { diff --git a/frontend/src/hooks/useCameraStreamToken.ts b/frontend/src/hooks/useCameraStreamToken.ts index 20d966500..e61bf7ab1 100644 --- a/frontend/src/hooks/useCameraStreamToken.ts +++ b/frontend/src/hooks/useCameraStreamToken.ts @@ -41,17 +41,24 @@ export function rewriteMediaSrcWithToken(root: ParentNode, token: string): numbe * Components that need token-protected URLs can import withStreamToken directly. */ export function useStreamTokenSync() { - const { authEnabled, user } = useAuth(); + const { authEnabled, user, loading: authLoading } = useAuth(); const queryClient = useQueryClient(); const refreshingRef = useRef(false); // Key the token by user id so a login/logout invalidates the cache // automatically — otherwise a failed anonymous fetch on the login page // would be cached and never retried after sign-in. + // + // Race-aware gate (same shape as ColorCatalogProvider): wait for + // ``checkAuthStatus`` to finish before deciding whether to fetch. + // The previous form ``authEnabled ? !!user : true`` evaluated to + // ``true`` on first render because ``authEnabled`` defaults to false, + // firing a 401 POST on the login page before AuthContext had a chance + // to settle on ``authEnabled=true, user=null``. const { data } = useQuery({ queryKey: ['camera-stream-token', user?.id ?? null], queryFn: () => api.getCameraStreamToken(), - enabled: authEnabled ? !!user : true, + enabled: !authLoading && (!authEnabled || user !== null), staleTime: 50 * 60 * 1000, // refresh at 50 min (tokens expire at 60) refetchInterval: 50 * 60 * 1000, }); diff --git a/frontend/src/hooks/useWebSocket.ts b/frontend/src/hooks/useWebSocket.ts index 8280d462a..e99b4ab99 100644 --- a/frontend/src/hooks/useWebSocket.ts +++ b/frontend/src/hooks/useWebSocket.ts @@ -2,6 +2,7 @@ import { useQueryClient } from '@tanstack/react-query'; import { useCallback, useEffect, useRef, useState } from 'react'; import { useToast } from '../contexts/ToastContext'; import { useTranslation } from 'react-i18next'; +import { api } from '../api/client'; interface WebSocketMessage { type: string; @@ -64,13 +65,34 @@ export function useWebSocket() { processNext(); }, []); - const connect = useCallback(() => { + const connect = useCallback(async () => { if (wsRef.current?.readyState === WebSocket.OPEN) { return; } + // GHSA-r2qv follow-up: when auth is enabled, /ws now requires a token + // minted by POST /api/v1/auth/ws-token. We use the shared ``api.request`` + // helper (via ``api.getWebSocketToken``) so the JWT Authorization header + // is attached — a raw ``fetch()`` with ``credentials: 'include'`` would + // miss it (Bambuddy uses Bearer tokens, not cookies, for JWT auth). + // Auth-disabled deployments accept connections without a token, so we + // treat a missing/failed token mint as non-fatal here and let the + // WebSocket close with code 4401 if the server actually rejects us. + let token: string | undefined; + try { + const resp = await api.getWebSocketToken(); + token = resp.token; + } catch { + // Token mint failed — most likely auth is disabled (no JWT to attach, + // 401 response) or the user isn't authenticated yet. Fall through and + // try the WebSocket anyway. Auth-disabled deployments succeed; + // auth-enabled deployments close with 4401 and the reconnect loop + // kicks in once the user logs in. + } + const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; - const wsUrl = `${protocol}//${window.location.host}/api/v1/ws`; + const tokenParam = token ? `?token=${encodeURIComponent(token)}` : ''; + const wsUrl = `${protocol}//${window.location.host}/api/v1/ws${tokenParam}`; const ws = new WebSocket(wsUrl); @@ -356,7 +378,10 @@ export function useWebSocket() { }, [handleMessage]); useEffect(() => { - connect(); + // connect() is async after the GHSA-r2qv fix (mints a ws-token first). + // Fire-and-forget at mount; the inner reconnect loop also calls + // connect() in the ws.onclose handler. + void connect(); return () => { if (reconnectTimeoutRef.current) { diff --git a/frontend/src/pages/StreamOverlayPage.tsx b/frontend/src/pages/StreamOverlayPage.tsx index 3c8c32d0e..d4f85a476 100644 --- a/frontend/src/pages/StreamOverlayPage.tsx +++ b/frontend/src/pages/StreamOverlayPage.tsx @@ -144,11 +144,33 @@ export function StreamOverlayPage() { useEffect(() => { if (!id) return; - const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; - const wsUrl = `${protocol}//${window.location.host}/api/v1/ws`; - const ws = new WebSocket(wsUrl); + let ws: WebSocket | null = null; + let cancelled = false; - ws.onmessage = (event) => { + // GHSA-r2qv follow-up: mint a ws-token before connecting. Uses + // api.getWebSocketToken so the JWT Authorization header rides along + // (raw fetch+credentials:'include' would miss it — Bambuddy uses + // Bearer tokens, not cookies, for JWT auth). Auth-disabled deployments + // succeed even without a token. + (async () => { + let token: string | undefined; + try { + const resp = await api.getWebSocketToken(); + token = resp.token; + } catch { + // Token mint failed — auth disabled, no JWT yet, or transient + // network error. Fall through; auth-disabled deployments still + // succeed, auth-enabled ones close with 4401 and the page's + // polling fallback continues to refresh the status. + } + if (cancelled) return; + + const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; + const tokenParam = token ? `?token=${encodeURIComponent(token)}` : ''; + const wsUrl = `${protocol}//${window.location.host}/api/v1/ws${tokenParam}`; + ws = new WebSocket(wsUrl); + + ws.onmessage = (event) => { try { const data = JSON.parse(event.data); if (data.type === 'printer_status' && data.printer_id === id) { @@ -159,12 +181,14 @@ export function StreamOverlayPage() { } }; - ws.onerror = () => { - // WebSocket error - polling will continue as fallback - }; + ws.onerror = () => { + // WebSocket error - polling will continue as fallback + }; + })(); return () => { - ws.close(); + cancelled = true; + if (ws) ws.close(); }; }, [id, queryClient]); diff --git a/static/assets/index-Crwf3Atk.js b/static/assets/index-BeiuHSbR.js similarity index 86% rename from static/assets/index-Crwf3Atk.js rename to static/assets/index-BeiuHSbR.js index 6bf22295f..d874c5796 100644 --- a/static/assets/index-Crwf3Atk.js +++ b/static/assets/index-BeiuHSbR.js @@ -1,12 +1,12 @@ -function rme(t,e){for(var a=0;ar[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function a(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=a(i);fetch(i.href,s)}})();var T_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var rE={exports:{}},a0={};var TH;function ime(){if(TH)return a0;TH=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function a(r,i,s){var o=null;if(s!==void 0&&(o=""+s),i.key!==void 0&&(o=""+i.key),"key"in i){s={};for(var l in i)l!=="key"&&(s[l]=i[l])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:o,ref:i!==void 0?i:null,props:s}}return a0.Fragment=e,a0.jsx=a,a0.jsxs=a,a0}var AH;function sme(){return AH||(AH=1,rE.exports=ime()),rE.exports}var n=sme(),iE={exports:{}},Ka={};var jH;function ome(){if(jH)return Ka;jH=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),p=Symbol.iterator;function f(Q){return Q===null||typeof Q!="object"?null:(Q=p&&Q[p]||Q["@@iterator"],typeof Q=="function"?Q:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,b={};function x(Q,se,pe){this.props=Q,this.context=se,this.refs=b,this.updater=pe||g}x.prototype.isReactComponent={},x.prototype.setState=function(Q,se){if(typeof Q!="object"&&typeof Q!="function"&&Q!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Q,se,"setState")},x.prototype.forceUpdate=function(Q){this.updater.enqueueForceUpdate(this,Q,"forceUpdate")};function S(){}S.prototype=x.prototype;function _(Q,se,pe){this.props=Q,this.context=se,this.refs=b,this.updater=pe||g}var C=_.prototype=new S;C.constructor=_,v(C,x.prototype),C.isPureReactComponent=!0;var P=Array.isArray;function T(){}var M={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function N(Q,se,pe){var me=pe.ref;return{$$typeof:t,type:Q,key:se,ref:me!==void 0?me:null,props:pe}}function j(Q,se){return N(Q.type,se,Q.props)}function R(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===t}function O(Q){var se={"=":"=0",":":"=2"};return"$"+Q.replace(/[=:]/g,function(pe){return se[pe]})}var B=/\/+/g;function L(Q,se){return typeof Q=="object"&&Q!==null&&Q.key!=null?O(""+Q.key):se.toString(36)}function Y(Q){switch(Q.status){case"fulfilled":return Q.value;case"rejected":throw Q.reason;default:switch(typeof Q.status=="string"?Q.then(T,T):(Q.status="pending",Q.then(function(se){Q.status==="pending"&&(Q.status="fulfilled",Q.value=se)},function(se){Q.status==="pending"&&(Q.status="rejected",Q.reason=se)})),Q.status){case"fulfilled":return Q.value;case"rejected":throw Q.reason}}throw Q}function ee(Q,se,pe,me,be){var H=typeof Q;(H==="undefined"||H==="boolean")&&(Q=null);var X=!1;if(Q===null)X=!0;else switch(H){case"bigint":case"string":case"number":X=!0;break;case"object":switch(Q.$$typeof){case t:case e:X=!0;break;case u:return X=Q._init,ee(X(Q._payload),se,pe,me,be)}}if(X)return be=be(Q),X=me===""?"."+L(Q,0):me,P(be)?(pe="",X!=null&&(pe=X.replace(B,"$&/")+"/"),ee(be,se,pe,"",function(U){return U})):be!=null&&(R(be)&&(be=j(be,pe+(be.key==null||Q&&Q.key===be.key?"":(""+be.key).replace(B,"$&/")+"/")+X)),se.push(be)),1;X=0;var A=me===""?".":me+":";if(P(Q))for(var E=0;E>>1,ue=ee[de];if(0>>1;dei(pe,le))mei(be,pe)?(ee[de]=be,ee[me]=le,de=me):(ee[de]=pe,ee[se]=le,de=se);else if(mei(be,le))ee[de]=be,ee[me]=le,de=me;else break e}}return J}function i(ee,J){var le=ee.sortIndex-J.sortIndex;return le!==0?le:ee.id-J.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],d=[],u=1,m=null,p=3,f=!1,g=!1,v=!1,b=!1,x=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function C(ee){for(var J=a(d);J!==null;){if(J.callback===null)r(d);else if(J.startTime<=ee)r(d),J.sortIndex=J.expirationTime,e(c,J);else break;J=a(d)}}function P(ee){if(v=!1,C(ee),!g)if(a(c)!==null)g=!0,T||(T=!0,O());else{var J=a(d);J!==null&&Y(P,J.startTime-ee)}}var T=!1,M=-1,F=5,N=-1;function j(){return b?!0:!(t.unstable_now()-Nee&&j());){var de=m.callback;if(typeof de=="function"){m.callback=null,p=m.priorityLevel;var ue=de(m.expirationTime<=ee);if(ee=t.unstable_now(),typeof ue=="function"){m.callback=ue,C(ee),J=!0;break t}m===a(c)&&r(c),C(ee)}else r(c);m=a(c)}if(m!==null)J=!0;else{var Q=a(d);Q!==null&&Y(P,Q.startTime-ee),J=!1}}break e}finally{m=null,p=le,f=!1}J=void 0}}finally{J?O():T=!1}}}var O;if(typeof _=="function")O=function(){_(R)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,L=B.port2;B.port1.onmessage=R,O=function(){L.postMessage(null)}}else O=function(){x(R,0)};function Y(ee,J){M=x(function(){ee(t.unstable_now())},J)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(ee){ee.callback=null},t.unstable_forceFrameRate=function(ee){0>ee||125de?(ee.sortIndex=le,e(d,ee),a(c)===null&&ee===a(d)&&(v?(S(M),M=-1):v=!0,Y(P,le-de))):(ee.sortIndex=ue,e(c,ee),g||f||(g=!0,T||(T=!0,O()))),ee},t.unstable_shouldYield=j,t.unstable_wrapCallback=function(ee){var J=p;return function(){var le=p;p=J;try{return ee.apply(this,arguments)}finally{p=le}}}})(lE)),lE}var DH;function dme(){return DH||(DH=1,oE.exports=cme()),oE.exports}var cE={exports:{}},Hs={};var FH;function ume(){if(FH)return Hs;FH=1;var t=ob();function e(c){var d="https://react.dev/errors/"+c;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),cE.exports=ume(),cE.exports}var RH;function mme(){if(RH)return n0;RH=1;var t=dme(),e=ob(),a=JX();function r(h){var w="https://react.dev/errors/"+h;if(1ue||(h.current=de[ue],de[ue]=null,ue--)}function pe(h,w){ue++,de[ue]=h.current,h.current=w}var me=Q(null),be=Q(null),H=Q(null),X=Q(null);function A(h,w){switch(pe(H,w),pe(be,h),pe(me,null),w.nodeType){case 9:case 11:h=(h=w.documentElement)&&(h=h.namespaceURI)?Xq(h):0;break;default:if(h=w.tagName,w=w.namespaceURI)w=Xq(w),h=Zq(w,h);else switch(h){case"svg":h=1;break;case"math":h=2;break;default:h=0}}se(me),pe(me,h)}function E(){se(me),se(be),se(H)}function U(h){h.memoizedState!==null&&pe(X,h);var w=me.current,k=Zq(w,h.type);w!==k&&(pe(be,h),pe(me,k))}function W(h){be.current===h&&(se(me),se(be)),X.current===h&&(se(X),Zv._currentValue=le)}var q,re;function z(h){if(q===void 0)try{throw Error()}catch(k){var w=k.stack.trim().match(/\n( *(at )?)/);q=w&&w[1]||"",re=-1)":-1r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function a(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=a(i);fetch(i.href,s)}})();var T_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var rE={exports:{}},a0={};var TH;function ime(){if(TH)return a0;TH=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function a(r,i,s){var o=null;if(s!==void 0&&(o=""+s),i.key!==void 0&&(o=""+i.key),"key"in i){s={};for(var l in i)l!=="key"&&(s[l]=i[l])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:o,ref:i!==void 0?i:null,props:s}}return a0.Fragment=e,a0.jsx=a,a0.jsxs=a,a0}var AH;function sme(){return AH||(AH=1,rE.exports=ime()),rE.exports}var n=sme(),iE={exports:{}},Ka={};var jH;function ome(){if(jH)return Ka;jH=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),p=Symbol.iterator;function f(Y){return Y===null||typeof Y!="object"?null:(Y=p&&Y[p]||Y["@@iterator"],typeof Y=="function"?Y:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,b={};function x(Y,se,pe){this.props=Y,this.context=se,this.refs=b,this.updater=pe||g}x.prototype.isReactComponent={},x.prototype.setState=function(Y,se){if(typeof Y!="object"&&typeof Y!="function"&&Y!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Y,se,"setState")},x.prototype.forceUpdate=function(Y){this.updater.enqueueForceUpdate(this,Y,"forceUpdate")};function S(){}S.prototype=x.prototype;function k(Y,se,pe){this.props=Y,this.context=se,this.refs=b,this.updater=pe||g}var C=k.prototype=new S;C.constructor=k,v(C,x.prototype),C.isPureReactComponent=!0;var P=Array.isArray;function T(){}var j={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function N(Y,se,pe){var me=pe.ref;return{$$typeof:t,type:Y,key:se,ref:me!==void 0?me:null,props:pe}}function D(Y,se){return N(Y.type,se,Y.props)}function R(Y){return typeof Y=="object"&&Y!==null&&Y.$$typeof===t}function z(Y){var se={"=":"=0",":":"=2"};return"$"+Y.replace(/[=:]/g,function(pe){return se[pe]})}var O=/\/+/g;function L(Y,se){return typeof Y=="object"&&Y!==null&&Y.key!=null?z(""+Y.key):se.toString(36)}function Q(Y){switch(Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason;default:switch(typeof Y.status=="string"?Y.then(T,T):(Y.status="pending",Y.then(function(se){Y.status==="pending"&&(Y.status="fulfilled",Y.value=se)},function(se){Y.status==="pending"&&(Y.status="rejected",Y.reason=se)})),Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason}}throw Y}function ee(Y,se,pe,me,be){var H=typeof Y;(H==="undefined"||H==="boolean")&&(Y=null);var X=!1;if(Y===null)X=!0;else switch(H){case"bigint":case"string":case"number":X=!0;break;case"object":switch(Y.$$typeof){case t:case e:X=!0;break;case u:return X=Y._init,ee(X(Y._payload),se,pe,me,be)}}if(X)return be=be(Y),X=me===""?"."+L(Y,0):me,P(be)?(pe="",X!=null&&(pe=X.replace(O,"$&/")+"/"),ee(be,se,pe,"",function(B){return B})):be!=null&&(R(be)&&(be=D(be,pe+(be.key==null||Y&&Y.key===be.key?"":(""+be.key).replace(O,"$&/")+"/")+X)),se.push(be)),1;X=0;var A=me===""?".":me+":";if(P(Y))for(var M=0;M>>1,ue=ee[de];if(0>>1;dei(pe,le))mei(be,pe)?(ee[de]=be,ee[me]=le,de=me):(ee[de]=pe,ee[se]=le,de=se);else if(mei(be,le))ee[de]=be,ee[me]=le,de=me;else break e}}return J}function i(ee,J){var le=ee.sortIndex-J.sortIndex;return le!==0?le:ee.id-J.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],d=[],u=1,m=null,p=3,f=!1,g=!1,v=!1,b=!1,x=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function C(ee){for(var J=a(d);J!==null;){if(J.callback===null)r(d);else if(J.startTime<=ee)r(d),J.sortIndex=J.expirationTime,e(c,J);else break;J=a(d)}}function P(ee){if(v=!1,C(ee),!g)if(a(c)!==null)g=!0,T||(T=!0,z());else{var J=a(d);J!==null&&Q(P,J.startTime-ee)}}var T=!1,j=-1,F=5,N=-1;function D(){return b?!0:!(t.unstable_now()-Nee&&D());){var de=m.callback;if(typeof de=="function"){m.callback=null,p=m.priorityLevel;var ue=de(m.expirationTime<=ee);if(ee=t.unstable_now(),typeof ue=="function"){m.callback=ue,C(ee),J=!0;break t}m===a(c)&&r(c),C(ee)}else r(c);m=a(c)}if(m!==null)J=!0;else{var Y=a(d);Y!==null&&Q(P,Y.startTime-ee),J=!1}}break e}finally{m=null,p=le,f=!1}J=void 0}}finally{J?z():T=!1}}}var z;if(typeof k=="function")z=function(){k(R)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,L=O.port2;O.port1.onmessage=R,z=function(){L.postMessage(null)}}else z=function(){x(R,0)};function Q(ee,J){j=x(function(){ee(t.unstable_now())},J)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(ee){ee.callback=null},t.unstable_forceFrameRate=function(ee){0>ee||125de?(ee.sortIndex=le,e(d,ee),a(c)===null&&ee===a(d)&&(v?(S(j),j=-1):v=!0,Q(P,le-de))):(ee.sortIndex=ue,e(c,ee),g||f||(g=!0,T||(T=!0,z()))),ee},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(ee){var J=p;return function(){var le=p;p=J;try{return ee.apply(this,arguments)}finally{p=le}}}})(lE)),lE}var DH;function dme(){return DH||(DH=1,oE.exports=cme()),oE.exports}var cE={exports:{}},Hs={};var FH;function ume(){if(FH)return Hs;FH=1;var t=ob();function e(c){var d="https://react.dev/errors/"+c;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),cE.exports=ume(),cE.exports}var RH;function mme(){if(RH)return n0;RH=1;var t=dme(),e=ob(),a=JX();function r(h){var w="https://react.dev/errors/"+h;if(1ue||(h.current=de[ue],de[ue]=null,ue--)}function pe(h,w){ue++,de[ue]=h.current,h.current=w}var me=Y(null),be=Y(null),H=Y(null),X=Y(null);function A(h,w){switch(pe(H,w),pe(be,h),pe(me,null),w.nodeType){case 9:case 11:h=(h=w.documentElement)&&(h=h.namespaceURI)?Xq(h):0;break;default:if(h=w.tagName,w=w.namespaceURI)w=Xq(w),h=Zq(w,h);else switch(h){case"svg":h=1;break;case"math":h=2;break;default:h=0}}se(me),pe(me,h)}function M(){se(me),se(be),se(H)}function B(h){h.memoizedState!==null&&pe(X,h);var w=me.current,_=Zq(w,h.type);w!==_&&(pe(be,h),pe(me,_))}function W(h){be.current===h&&(se(me),se(be)),X.current===h&&(se(X),Zv._currentValue=le)}var q,re;function U(h){if(q===void 0)try{throw Error()}catch(_){var w=_.stack.trim().match(/\n( *(at )?)/);q=w&&w[1]||"",re=-1<_.stack.indexOf(` + at`)?" ()":-1<_.stack.indexOf("@")?"@unknown:0:0":""}return` +`+q+h+re}var G=!1;function K(h,w){if(!h||G)return"";G=!0;var _=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var E={DetermineComponentFrameRoot:function(){try{if(w){var Gt=function(){throw Error()};if(Object.defineProperty(Gt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Gt,[])}catch(Ut){var Lt=Ut}Reflect.construct(h,[],Gt)}else{try{Gt.call()}catch(Ut){Lt=Ut}h.call(Gt.prototype)}}else{try{throw Error()}catch(Ut){Lt=Ut}(Gt=h())&&typeof Gt.catch=="function"&&Gt.catch(function(){})}}catch(Ut){if(Ut&&Lt&&typeof Ut.stack=="string")return[Ut.stack,Lt.stack]}return[null,null]}};E.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var V=Object.getOwnPropertyDescriptor(E.DetermineComponentFrameRoot,"name");V&&V.configurable&&Object.defineProperty(E.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var te=E.DetermineComponentFrameRoot(),we=te[0],qe=te[1];if(we&&qe){var mt=we.split(` `),Et=qe.split(` -`);for(V=D=0;DV||mt[D]!==Et[V]){var Ht=` -`+mt[D].replace(" at new "," at ");return h.displayName&&Ht.includes("")&&(Ht=Ht.replace("",h.displayName)),Ht}while(1<=D&&0<=V);break}}}finally{G=!1,Error.prepareStackTrace=k}return(k=h?h.displayName||h.name:"")?z(k):""}function Z(h,w){switch(h.tag){case 26:case 27:case 5:return z(h.type);case 16:return z("Lazy");case 13:return h.child!==w&&w!==null?z("Suspense Fallback"):z("Suspense");case 19:return z("SuspenseList");case 0:case 15:return K(h.type,!1);case 11:return K(h.type.render,!1);case 1:return K(h.type,!0);case 31:return z("Activity");default:return""}}function ie(h){try{var w="",k=null;do w+=Z(h,k),k=h,h=h.return;while(h);return w}catch(D){return` -Error generating stack: `+D.message+` -`+D.stack}}var oe=Object.prototype.hasOwnProperty,he=t.unstable_scheduleCallback,ce=t.unstable_cancelCallback,fe=t.unstable_shouldYield,$=t.unstable_requestPaint,I=t.unstable_now,ae=t.unstable_getCurrentPriorityLevel,ge=t.unstable_ImmediatePriority,xe=t.unstable_UserBlockingPriority,ve=t.unstable_NormalPriority,je=t.unstable_LowPriority,Me=t.unstable_IdlePriority,Se=t.log,Be=t.unstable_setDisableYieldValue,_e=null,Ie=null;function Fe(h){if(typeof Se=="function"&&Be(h),Ie&&typeof Ie.setStrictMode=="function")try{Ie.setStrictMode(_e,h)}catch{}}var He=Math.clz32?Math.clz32:Le,ze=Math.log,it=Math.LN2;function Le(h){return h>>>=0,h===0?32:31-(ze(h)/it|0)|0}var st=256,Te=262144,Xe=4194304;function Ve(h){var w=h&42;if(w!==0)return w;switch(h&-h){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return h&261888;case 262144:case 524288:case 1048576:case 2097152:return h&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return h&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return h}}function Ce(h,w,k){var D=h.pendingLanes;if(D===0)return 0;var V=0,te=h.suspendedLanes,we=h.pingedLanes;h=h.warmLanes;var qe=D&134217727;return qe!==0?(D=qe&~te,D!==0?V=Ve(D):(we&=qe,we!==0?V=Ve(we):k||(k=qe&~h,k!==0&&(V=Ve(k))))):(qe=D&~te,qe!==0?V=Ve(qe):we!==0?V=Ve(we):k||(k=D&~h,k!==0&&(V=Ve(k)))),V===0?0:w!==0&&w!==V&&(w&te)===0&&(te=V&-V,k=w&-w,te>=k||te===32&&(k&4194048)!==0)?w:V}function Oe(h,w){return(h.pendingLanes&~(h.suspendedLanes&~h.pingedLanes)&w)===0}function et(h,w){switch(h){case 1:case 2:case 4:case 8:case 64:return w+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return w+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function We(){var h=Xe;return Xe<<=1,(Xe&62914560)===0&&(Xe=4194304),h}function Ae(h){for(var w=[],k=0;31>k;k++)w.push(h);return w}function at(h,w){h.pendingLanes|=w,w!==268435456&&(h.suspendedLanes=0,h.pingedLanes=0,h.warmLanes=0)}function nt(h,w,k,D,V,te){var we=h.pendingLanes;h.pendingLanes=k,h.suspendedLanes=0,h.pingedLanes=0,h.warmLanes=0,h.expiredLanes&=k,h.entangledLanes&=k,h.errorRecoveryDisabledLanes&=k,h.shellSuspendCounter=0;var qe=h.entanglements,mt=h.expirationTimes,Et=h.hiddenUpdates;for(k=we&~k;0"u")return null;try{return h.activeElement||h.body}catch{return h.body}}var zn=/[\n"\\]/g;function Oa(h){return h.replace(zn,function(w){return"\\"+w.charCodeAt(0).toString(16)+" "})}function Br(h,w,k,D,V,te,we,qe){h.name="",we!=null&&typeof we!="function"&&typeof we!="symbol"&&typeof we!="boolean"?h.type=we:h.removeAttribute("type"),w!=null?we==="number"?(w===0&&h.value===""||h.value!=w)&&(h.value=""+da(w)):h.value!==""+da(w)&&(h.value=""+da(w)):we!=="submit"&&we!=="reset"||h.removeAttribute("value"),w!=null?ur(h,we,da(w)):k!=null?ur(h,we,da(k)):D!=null&&h.removeAttribute("value"),V==null&&te!=null&&(h.defaultChecked=!!te),V!=null&&(h.checked=V&&typeof V!="function"&&typeof V!="symbol"),qe!=null&&typeof qe!="function"&&typeof qe!="symbol"&&typeof qe!="boolean"?h.name=""+da(qe):h.removeAttribute("name")}function Ua(h,w,k,D,V,te,we,qe){if(te!=null&&typeof te!="function"&&typeof te!="symbol"&&typeof te!="boolean"&&(h.type=te),w!=null||k!=null){if(!(te!=="submit"&&te!=="reset"||w!=null)){ma(h);return}k=k!=null?""+da(k):"",w=w!=null?""+da(w):k,qe||w===h.value||(h.value=w),h.defaultValue=w}D=D??V,D=typeof D!="function"&&typeof D!="symbol"&&!!D,h.checked=qe?h.checked:!!D,h.defaultChecked=!!D,we!=null&&typeof we!="function"&&typeof we!="symbol"&&typeof we!="boolean"&&(h.name=we),ma(h)}function ur(h,w,k){w==="number"&&Ya(h.ownerDocument)===h||h.defaultValue===""+k||(h.defaultValue=""+k)}function Mn(h,w,k,D){if(h=h.options,w){w={};for(var V=0;V"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hp=!1;if(Xa)try{var _d={};Object.defineProperty(_d,"passive",{get:function(){hp=!0}}),window.addEventListener("test",_d,_d),window.removeEventListener("test",_d,_d)}catch{hp=!1}var li=null,Au=null,vi=null;function yf(){if(vi)return vi;var h,w=Au,k=w.length,D,V="value"in li?li.value:li.textContent,te=V.length;for(h=0;h=di),yp=" ",_b=!1;function ye(h,w){switch(h){case"keyup":return kv.indexOf(w.keyCode)!==-1;case"keydown":return w.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zt(h){return h=h.detail,typeof h=="object"&&"data"in h?h.data:null}var la=!1;function Ta(h,w){switch(h){case"compositionend":return zt(w);case"keypress":return w.which!==32?null:(_b=!0,yp);case"textInput":return h=w.data,h===yp&&_b?null:h;default:return null}}function Ba(h,w){if(la)return h==="compositionend"||!il&&ye(h,w)?(h=yf(),vi=Au=li=null,la=!1,h):null;switch(h){case"paste":return null;case"keypress":if(!(w.ctrlKey||w.altKey||w.metaKey)||w.ctrlKey&&w.altKey){if(w.char&&1=w)return{node:k,offset:w-h};h=D}e:{for(;k;){if(k.nextSibling){k=k.nextSibling;break e}k=k.parentNode}k=void 0}k=Eo(k)}}function Do(h,w){return h&&w?h===w?!0:h&&h.nodeType===3?!1:w&&w.nodeType===3?Do(h,w.parentNode):"contains"in h?h.contains(w):h.compareDocumentPosition?!!(h.compareDocumentPosition(w)&16):!1:!1}function uo(h){h=h!=null&&h.ownerDocument!=null&&h.ownerDocument.defaultView!=null?h.ownerDocument.defaultView:window;for(var w=Ya(h.document);w instanceof h.HTMLIFrameElement;){try{var k=typeof w.contentWindow.location.href=="string"}catch{k=!1}if(k)h=w.contentWindow;else break;w=Ya(h.document)}return w}function wi(h){var w=h&&h.nodeName&&h.nodeName.toLowerCase();return w&&(w==="input"&&(h.type==="text"||h.type==="search"||h.type==="tel"||h.type==="url"||h.type==="password")||w==="textarea"||h.contentEditable==="true")}var Ad=Xa&&"documentMode"in document&&11>=document.documentMode,mi=null,hn=null,En=null,Yr=!1;function vp(h,w,k){var D=k.window===k?k.document:k.nodeType===9?k:k.ownerDocument;Yr||mi==null||mi!==Ya(D)||(D=mi,"selectionStart"in D&&wi(D)?D={start:D.selectionStart,end:D.selectionEnd}:(D=(D.ownerDocument&&D.ownerDocument.defaultView||window).getSelection(),D={anchorNode:D.anchorNode,anchorOffset:D.anchorOffset,focusNode:D.focusNode,focusOffset:D.focusOffset}),En&&vs(En,D)||(En=D,D=p_(hn,"onSelect"),0>=we,V-=we,Md=1<<32-He(w)+V|k<tn?(_n=Ca,Ca=null):_n=Ca.sibling;var Rn=Lt(kt,Ca,jt[tn],Vt);if(Rn===null){Ca===null&&(Ca=_n);break}h&&Ca&&Rn.alternate===null&&w(kt,Ca),xt=te(Rn,xt,tn),Ln===null?Da=Rn:Ln.sibling=Rn,Ln=Rn,Ca=_n}if(tn===jt.length)return k(kt,Ca),Cn&&Iu(kt,tn),Da;if(Ca===null){for(;tntn?(_n=Ca,Ca=null):_n=Ca.sibling;var qp=Lt(kt,Ca,Rn.value,Vt);if(qp===null){Ca===null&&(Ca=_n);break}h&&Ca&&qp.alternate===null&&w(kt,Ca),xt=te(qp,xt,tn),Ln===null?Da=qp:Ln.sibling=qp,Ln=qp,Ca=_n}if(Rn.done)return k(kt,Ca),Cn&&Iu(kt,tn),Da;if(Ca===null){for(;!Rn.done;tn++,Rn=jt.next())Rn=Gt(kt,Rn.value,Vt),Rn!==null&&(xt=te(Rn,xt,tn),Ln===null?Da=Rn:Ln.sibling=Rn,Ln=Rn);return Cn&&Iu(kt,tn),Da}for(Ca=D(Ca);!Rn.done;tn++,Rn=jt.next())Rn=Ut(Ca,kt,tn,Rn.value,Vt),Rn!==null&&(h&&Rn.alternate!==null&&Ca.delete(Rn.key===null?tn:Rn.key),xt=te(Rn,xt,tn),Ln===null?Da=Rn:Ln.sibling=Rn,Ln=Rn);return h&&Ca.forEach(function(nme){return w(kt,nme)}),Cn&&Iu(kt,tn),Da}function ar(kt,xt,jt,Vt){if(typeof jt=="object"&&jt!==null&&jt.type===v&&jt.key===null&&(jt=jt.props.children),typeof jt=="object"&&jt!==null){switch(jt.$$typeof){case f:e:{for(var Da=jt.key;xt!==null;){if(xt.key===Da){if(Da=jt.type,Da===v){if(xt.tag===7){k(kt,xt.sibling),Vt=V(xt,jt.props.children),Vt.return=kt,kt=Vt;break e}}else if(xt.elementType===Da||typeof Da=="object"&&Da!==null&&Da.$$typeof===F&&Af(Da)===xt.type){k(kt,xt.sibling),Vt=V(xt,jt.props),Av(Vt,jt),Vt.return=kt,kt=Vt;break e}k(kt,xt);break}else w(kt,xt);xt=xt.sibling}jt.type===v?(Vt=_f(jt.props.children,kt.mode,Vt,jt.key),Vt.return=kt,kt=Vt):(Vt=jk(jt.type,jt.key,jt.props,null,kt.mode,Vt),Av(Vt,jt),Vt.return=kt,kt=Vt)}return we(kt);case g:e:{for(Da=jt.key;xt!==null;){if(xt.key===Da)if(xt.tag===4&&xt.stateNode.containerInfo===jt.containerInfo&&xt.stateNode.implementation===jt.implementation){k(kt,xt.sibling),Vt=V(xt,jt.children||[]),Vt.return=kt,kt=Vt;break e}else{k(kt,xt);break}else w(kt,xt);xt=xt.sibling}Vt=Sj(jt,kt.mode,Vt),Vt.return=kt,kt=Vt}return we(kt);case F:return jt=Af(jt),ar(kt,xt,jt,Vt)}if(Y(jt))return wa(kt,xt,jt,Vt);if(O(jt)){if(Da=O(jt),typeof Da!="function")throw Error(r(150));return jt=Da.call(jt),Ia(kt,xt,jt,Vt)}if(typeof jt.then=="function")return ar(kt,xt,Ik(jt),Vt);if(jt.$$typeof===_)return ar(kt,xt,Dk(kt,jt),Vt);Ok(kt,jt)}return typeof jt=="string"&&jt!==""||typeof jt=="number"||typeof jt=="bigint"?(jt=""+jt,xt!==null&&xt.tag===6?(k(kt,xt.sibling),Vt=V(xt,jt),Vt.return=kt,kt=Vt):(k(kt,xt),Vt=wj(jt,kt.mode,Vt),Vt.return=kt,kt=Vt),we(kt)):k(kt,xt)}return function(kt,xt,jt,Vt){try{Tv=0;var Da=ar(kt,xt,jt,Vt);return Fb=null,Da}catch(Ca){if(Ca===Db||Ca===Lk)throw Ca;var Ln=sl(29,Ca,null,kt.mode);return Ln.lanes=Vt,Ln.return=kt,Ln}}}var Mf=qU(!0),HU=qU(!1),Np=!1;function Fj(h){h.updateQueue={baseState:h.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lj(h,w){h=h.updateQueue,w.updateQueue===h&&(w.updateQueue={baseState:h.baseState,firstBaseUpdate:h.firstBaseUpdate,lastBaseUpdate:h.lastBaseUpdate,shared:h.shared,callbacks:null})}function Cp(h){return{lane:h,tag:0,payload:null,callback:null,next:null}}function Pp(h,w,k){var D=h.updateQueue;if(D===null)return null;if(D=D.shared,(Bn&2)!==0){var V=D.pending;return V===null?w.next=w:(w.next=V.next,V.next=w),D.pending=w,w=Ak(h),CU(h,null,k),w}return Tk(h,D,w,k),Ak(h)}function jv(h,w,k){if(w=w.updateQueue,w!==null&&(w=w.shared,(k&4194048)!==0)){var D=w.lanes;D&=h.pendingLanes,k|=D,w.lanes=k,Bt(h,k)}}function Rj(h,w){var k=h.updateQueue,D=h.alternate;if(D!==null&&(D=D.updateQueue,k===D)){var V=null,te=null;if(k=k.firstBaseUpdate,k!==null){do{var we={lane:k.lane,tag:k.tag,payload:k.payload,callback:null,next:null};te===null?V=te=we:te=te.next=we,k=k.next}while(k!==null);te===null?V=te=w:te=te.next=w}else V=te=w;k={baseState:D.baseState,firstBaseUpdate:V,lastBaseUpdate:te,shared:D.shared,callbacks:D.callbacks},h.updateQueue=k;return}h=k.lastBaseUpdate,h===null?k.firstBaseUpdate=w:h.next=w,k.lastBaseUpdate=w}var Ij=!1;function Mv(){if(Ij){var h=Eb;if(h!==null)throw h}}function Ev(h,w,k,D){Ij=!1;var V=h.updateQueue;Np=!1;var te=V.firstBaseUpdate,we=V.lastBaseUpdate,qe=V.shared.pending;if(qe!==null){V.shared.pending=null;var mt=qe,Et=mt.next;mt.next=null,we===null?te=Et:we.next=Et,we=mt;var Ht=h.alternate;Ht!==null&&(Ht=Ht.updateQueue,qe=Ht.lastBaseUpdate,qe!==we&&(qe===null?Ht.firstBaseUpdate=Et:qe.next=Et,Ht.lastBaseUpdate=mt))}if(te!==null){var Gt=V.baseState;we=0,Ht=Et=mt=null,qe=te;do{var Lt=qe.lane&-536870913,Ut=Lt!==qe.lane;if(Ut?(kn&Lt)===Lt:(D&Lt)===Lt){Lt!==0&&Lt===Mb&&(Ij=!0),Ht!==null&&(Ht=Ht.next={lane:0,tag:qe.tag,payload:qe.payload,callback:null,next:null});e:{var wa=h,Ia=qe;Lt=w;var ar=k;switch(Ia.tag){case 1:if(wa=Ia.payload,typeof wa=="function"){Gt=wa.call(ar,Gt,Lt);break e}Gt=wa;break e;case 3:wa.flags=wa.flags&-65537|128;case 0:if(wa=Ia.payload,Lt=typeof wa=="function"?wa.call(ar,Gt,Lt):wa,Lt==null)break e;Gt=m({},Gt,Lt);break e;case 2:Np=!0}}Lt=qe.callback,Lt!==null&&(h.flags|=64,Ut&&(h.flags|=8192),Ut=V.callbacks,Ut===null?V.callbacks=[Lt]:Ut.push(Lt))}else Ut={lane:Lt,tag:qe.tag,payload:qe.payload,callback:qe.callback,next:null},Ht===null?(Et=Ht=Ut,mt=Gt):Ht=Ht.next=Ut,we|=Lt;if(qe=qe.next,qe===null){if(qe=V.shared.pending,qe===null)break;Ut=qe,qe=Ut.next,Ut.next=null,V.lastBaseUpdate=Ut,V.shared.pending=null}}while(!0);Ht===null&&(mt=Gt),V.baseState=mt,V.firstBaseUpdate=Et,V.lastBaseUpdate=Ht,te===null&&(V.shared.lanes=0),Ep|=we,h.lanes=we,h.memoizedState=Gt}}function $U(h,w){if(typeof h!="function")throw Error(r(191,h));h.call(w)}function VU(h,w){var k=h.callbacks;if(k!==null)for(h.callbacks=null,h=0;hte?te:8;var we=ee.T,qe={};ee.T=qe,aM(h,!1,w,k);try{var mt=V(),Et=ee.S;if(Et!==null&&Et(qe,mt),mt!==null&&typeof mt=="object"&&typeof mt.then=="function"){var Ht=Gde(mt,D);Lv(h,w,Ht,ul(h))}else Lv(h,w,D,ul(h))}catch(Gt){Lv(h,w,{then:function(){},status:"rejected",reason:Gt},ul())}finally{J.p=te,we!==null&&qe.types!==null&&(we.types=qe.types),ee.T=we}}function Zde(){}function eM(h,w,k,D){if(h.tag!==5)throw Error(r(476));var V=kB(h).queue;SB(h,V,w,le,k===null?Zde:function(){return _B(h),k(D)})}function kB(h){var w=h.memoizedState;if(w!==null)return w;w={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bu,lastRenderedState:le},next:null};var k={};return w.next={memoizedState:k,baseState:k,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bu,lastRenderedState:k},next:null},h.memoizedState=w,h=h.alternate,h!==null&&(h.memoizedState=w),w}function _B(h){var w=kB(h);w.next===null&&(w=h.alternate.memoizedState),Lv(h,w.next.queue,{},ul())}function tM(){return Ss(Zv)}function NB(){return hi().memoizedState}function CB(){return hi().memoizedState}function Jde(h){for(var w=h.return;w!==null;){switch(w.tag){case 24:case 3:var k=ul();h=Cp(k);var D=Pp(w,h,k);D!==null&&(Oo(D,w,k),jv(D,w,k)),w={cache:jj()},h.payload=w;return}w=w.return}}function eue(h,w,k){var D=ul();k={lane:D,revertLane:0,gesture:null,action:k,hasEagerState:!1,eagerState:null,next:null},Kk(h)?TB(w,k):(k=yj(h,w,k,D),k!==null&&(Oo(k,h,D),AB(k,w,D)))}function PB(h,w,k){var D=ul();Lv(h,w,k,D)}function Lv(h,w,k,D){var V={lane:D,revertLane:0,gesture:null,action:k,hasEagerState:!1,eagerState:null,next:null};if(Kk(h))TB(w,V);else{var te=h.alternate;if(h.lanes===0&&(te===null||te.lanes===0)&&(te=w.lastRenderedReducer,te!==null))try{var we=w.lastRenderedState,qe=te(we,k);if(V.hasEagerState=!0,V.eagerState=qe,Mr(qe,we))return Tk(h,w,V,0),hr===null&&Pk(),!1}catch{}if(k=yj(h,w,V,D),k!==null)return Oo(k,h,D),AB(k,w,D),!0}return!1}function aM(h,w,k,D){if(D={lane:2,revertLane:FM(),gesture:null,action:D,hasEagerState:!1,eagerState:null,next:null},Kk(h)){if(w)throw Error(r(479))}else w=yj(h,k,D,2),w!==null&&Oo(w,h,2)}function Kk(h){var w=h.alternate;return h===Za||w!==null&&w===Za}function TB(h,w){Rb=Bk=!0;var k=h.pending;k===null?w.next=w:(w.next=k.next,k.next=w),h.pending=w}function AB(h,w,k){if((k&4194048)!==0){var D=w.lanes;D&=h.pendingLanes,k|=D,w.lanes=k,Bt(h,k)}}var Rv={readContext:Ss,use:$k,useCallback:Xr,useContext:Xr,useEffect:Xr,useImperativeHandle:Xr,useLayoutEffect:Xr,useInsertionEffect:Xr,useMemo:Xr,useReducer:Xr,useRef:Xr,useState:Xr,useDebugValue:Xr,useDeferredValue:Xr,useTransition:Xr,useSyncExternalStore:Xr,useId:Xr,useHostTransitionStatus:Xr,useFormState:Xr,useActionState:Xr,useOptimistic:Xr,useMemoCache:Xr,useCacheRefresh:Xr};Rv.useEffectEvent=Xr;var jB={readContext:Ss,use:$k,useCallback:function(h,w){return mo().memoizedState=[h,w===void 0?null:w],h},useContext:Ss,useEffect:pB,useImperativeHandle:function(h,w,k){k=k!=null?k.concat([h]):null,Gk(4194308,4,bB.bind(null,w,h),k)},useLayoutEffect:function(h,w){return Gk(4194308,4,h,w)},useInsertionEffect:function(h,w){Gk(4,2,h,w)},useMemo:function(h,w){var k=mo();w=w===void 0?null:w;var D=h();if(Ef){Fe(!0);try{h()}finally{Fe(!1)}}return k.memoizedState=[D,w],D},useReducer:function(h,w,k){var D=mo();if(k!==void 0){var V=k(w);if(Ef){Fe(!0);try{k(w)}finally{Fe(!1)}}}else V=w;return D.memoizedState=D.baseState=V,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:h,lastRenderedState:V},D.queue=h,h=h.dispatch=eue.bind(null,Za,h),[D.memoizedState,h]},useRef:function(h){var w=mo();return h={current:h},w.memoizedState=h},useState:function(h){h=Qj(h);var w=h.queue,k=PB.bind(null,Za,w);return w.dispatch=k,[h.memoizedState,k]},useDebugValue:Zj,useDeferredValue:function(h,w){var k=mo();return Jj(k,h,w)},useTransition:function(){var h=Qj(!1);return h=SB.bind(null,Za,h.queue,!0,!1),mo().memoizedState=h,[!1,h]},useSyncExternalStore:function(h,w,k){var D=Za,V=mo();if(Cn){if(k===void 0)throw Error(r(407));k=k()}else{if(k=w(),hr===null)throw Error(r(349));(kn&127)!==0||XU(D,w,k)}V.memoizedState=k;var te={value:k,getSnapshot:w};return V.queue=te,pB(JU.bind(null,D,te,h),[h]),D.flags|=2048,Ob(9,{destroy:void 0},ZU.bind(null,D,te,k,w),null),k},useId:function(){var h=mo(),w=hr.identifierPrefix;if(Cn){var k=Ed,D=Md;k=(D&~(1<<32-He(D)-1)).toString(32)+k,w="_"+w+"R_"+k,k=qk++,0<\/script>",te=te.removeChild(te.firstChild);break;case"select":te=typeof D.is=="string"?we.createElement("select",{is:D.is}):we.createElement("select"),D.multiple?te.multiple=!0:D.size&&(te.size=D.size);break;default:te=typeof D.is=="string"?we.createElement(V,{is:D.is}):we.createElement(V)}}te[vt]=w,te[Nt]=D;e:for(we=w.child;we!==null;){if(we.tag===5||we.tag===6)te.appendChild(we.stateNode);else if(we.tag!==4&&we.tag!==27&&we.child!==null){we.child.return=we,we=we.child;continue}if(we===w)break e;for(;we.sibling===null;){if(we.return===null||we.return===w)break e;we=we.return}we.sibling.return=we.return,we=we.sibling}w.stateNode=te;e:switch(_s(te,V,D),V){case"button":case"input":case"select":case"textarea":D=!!D.autoFocus;break e;case"img":D=!0;break e;default:D=!1}D&&Hu(w)}}return Nr(w),gM(w,w.type,h===null?null:h.memoizedProps,w.pendingProps,k),null;case 6:if(h&&w.stateNode!=null)h.memoizedProps!==D&&Hu(w);else{if(typeof D!="string"&&w.stateNode===null)throw Error(r(166));if(h=H.current,Ab(w)){if(h=w.stateNode,k=w.memoizedProps,D=null,V=ws,V!==null)switch(V.tag){case 27:case 5:D=V.memoizedProps}h[vt]=w,h=!!(h.nodeValue===k||D!==null&&D.suppressHydrationWarning===!0||Qq(h.nodeValue,k)),h||kp(w,!0)}else h=h_(h).createTextNode(D),h[vt]=w,w.stateNode=h}return Nr(w),null;case 31:if(k=w.memoizedState,h===null||h.memoizedState!==null){if(D=Ab(w),k!==null){if(h===null){if(!D)throw Error(r(318));if(h=w.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(r(557));h[vt]=w}else Nf(),(w.flags&128)===0&&(w.memoizedState=null),w.flags|=4;Nr(w),h=!1}else k=Cj(),h!==null&&h.memoizedState!==null&&(h.memoizedState.hydrationErrors=k),h=!0;if(!h)return w.flags&256?(ll(w),w):(ll(w),null);if((w.flags&128)!==0)throw Error(r(558))}return Nr(w),null;case 13:if(D=w.memoizedState,h===null||h.memoizedState!==null&&h.memoizedState.dehydrated!==null){if(V=Ab(w),D!==null&&D.dehydrated!==null){if(h===null){if(!V)throw Error(r(318));if(V=w.memoizedState,V=V!==null?V.dehydrated:null,!V)throw Error(r(317));V[vt]=w}else Nf(),(w.flags&128)===0&&(w.memoizedState=null),w.flags|=4;Nr(w),V=!1}else V=Cj(),h!==null&&h.memoizedState!==null&&(h.memoizedState.hydrationErrors=V),V=!0;if(!V)return w.flags&256?(ll(w),w):(ll(w),null)}return ll(w),(w.flags&128)!==0?(w.lanes=k,w):(k=D!==null,h=h!==null&&h.memoizedState!==null,k&&(D=w.child,V=null,D.alternate!==null&&D.alternate.memoizedState!==null&&D.alternate.memoizedState.cachePool!==null&&(V=D.alternate.memoizedState.cachePool.pool),te=null,D.memoizedState!==null&&D.memoizedState.cachePool!==null&&(te=D.memoizedState.cachePool.pool),te!==V&&(D.flags|=2048)),k!==h&&k&&(w.child.flags|=8192),Jk(w,w.updateQueue),Nr(w),null);case 4:return E(),h===null&&OM(w.stateNode.containerInfo),Nr(w),null;case 10:return zu(w.type),Nr(w),null;case 19:if(se(pi),D=w.memoizedState,D===null)return Nr(w),null;if(V=(w.flags&128)!==0,te=D.rendering,te===null)if(V)Ov(D,!1);else{if(Zr!==0||h!==null&&(h.flags&128)!==0)for(h=w.child;h!==null;){if(te=Uk(h),te!==null){for(w.flags|=128,Ov(D,!1),h=te.updateQueue,w.updateQueue=h,Jk(w,h),w.subtreeFlags=0,h=k,k=w.child;k!==null;)PU(k,h),k=k.sibling;return pe(pi,pi.current&1|2),Cn&&Iu(w,D.treeForkCount),w.child}h=h.sibling}D.tail!==null&&I()>r_&&(w.flags|=128,V=!0,Ov(D,!1),w.lanes=4194304)}else{if(!V)if(h=Uk(te),h!==null){if(w.flags|=128,V=!0,h=h.updateQueue,w.updateQueue=h,Jk(w,h),Ov(D,!0),D.tail===null&&D.tailMode==="hidden"&&!te.alternate&&!Cn)return Nr(w),null}else 2*I()-D.renderingStartTime>r_&&k!==536870912&&(w.flags|=128,V=!0,Ov(D,!1),w.lanes=4194304);D.isBackwards?(te.sibling=w.child,w.child=te):(h=D.last,h!==null?h.sibling=te:w.child=te,D.last=te)}return D.tail!==null?(h=D.tail,D.rendering=h,D.tail=h.sibling,D.renderingStartTime=I(),h.sibling=null,k=pi.current,pe(pi,V?k&1|2:k&1),Cn&&Iu(w,D.treeForkCount),h):(Nr(w),null);case 22:case 23:return ll(w),zj(),D=w.memoizedState!==null,h!==null?h.memoizedState!==null!==D&&(w.flags|=8192):D&&(w.flags|=8192),D?(k&536870912)!==0&&(w.flags&128)===0&&(Nr(w),w.subtreeFlags&6&&(w.flags|=8192)):Nr(w),k=w.updateQueue,k!==null&&Jk(w,k.retryQueue),k=null,h!==null&&h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(k=h.memoizedState.cachePool.pool),D=null,w.memoizedState!==null&&w.memoizedState.cachePool!==null&&(D=w.memoizedState.cachePool.pool),D!==k&&(w.flags|=2048),h!==null&&se(Tf),null;case 24:return k=null,h!==null&&(k=h.memoizedState.cache),w.memoizedState.cache!==k&&(w.flags|=2048),zu(Si),Nr(w),null;case 25:return null;case 30:return null}throw Error(r(156,w.tag))}function iue(h,w){switch(_j(w),w.tag){case 1:return h=w.flags,h&65536?(w.flags=h&-65537|128,w):null;case 3:return zu(Si),E(),h=w.flags,(h&65536)!==0&&(h&128)===0?(w.flags=h&-65537|128,w):null;case 26:case 27:case 5:return W(w),null;case 31:if(w.memoizedState!==null){if(ll(w),w.alternate===null)throw Error(r(340));Nf()}return h=w.flags,h&65536?(w.flags=h&-65537|128,w):null;case 13:if(ll(w),h=w.memoizedState,h!==null&&h.dehydrated!==null){if(w.alternate===null)throw Error(r(340));Nf()}return h=w.flags,h&65536?(w.flags=h&-65537|128,w):null;case 19:return se(pi),null;case 4:return E(),null;case 10:return zu(w.type),null;case 22:case 23:return ll(w),zj(),h!==null&&se(Tf),h=w.flags,h&65536?(w.flags=h&-65537|128,w):null;case 24:return zu(Si),null;case 25:return null;default:return null}}function eq(h,w){switch(_j(w),w.tag){case 3:zu(Si),E();break;case 26:case 27:case 5:W(w);break;case 4:E();break;case 31:w.memoizedState!==null&&ll(w);break;case 13:ll(w);break;case 19:se(pi);break;case 10:zu(w.type);break;case 22:case 23:ll(w),zj(),h!==null&&se(Tf);break;case 24:zu(Si)}}function zv(h,w){try{var k=w.updateQueue,D=k!==null?k.lastEffect:null;if(D!==null){var V=D.next;k=V;do{if((k.tag&h)===h){D=void 0;var te=k.create,we=k.inst;D=te(),we.destroy=D}k=k.next}while(k!==V)}}catch(qe){Kn(w,w.return,qe)}}function jp(h,w,k){try{var D=w.updateQueue,V=D!==null?D.lastEffect:null;if(V!==null){var te=V.next;D=te;do{if((D.tag&h)===h){var we=D.inst,qe=we.destroy;if(qe!==void 0){we.destroy=void 0,V=w;var mt=k,Et=qe;try{Et()}catch(Ht){Kn(V,mt,Ht)}}}D=D.next}while(D!==te)}}catch(Ht){Kn(w,w.return,Ht)}}function tq(h){var w=h.updateQueue;if(w!==null){var k=h.stateNode;try{VU(w,k)}catch(D){Kn(h,h.return,D)}}}function aq(h,w,k){k.props=Df(h.type,h.memoizedProps),k.state=h.memoizedState;try{k.componentWillUnmount()}catch(D){Kn(h,w,D)}}function Uv(h,w){try{var k=h.ref;if(k!==null){switch(h.tag){case 26:case 27:case 5:var D=h.stateNode;break;case 30:D=h.stateNode;break;default:D=h.stateNode}typeof k=="function"?h.refCleanup=k(D):k.current=D}}catch(V){Kn(h,w,V)}}function Dd(h,w){var k=h.ref,D=h.refCleanup;if(k!==null)if(typeof D=="function")try{D()}catch(V){Kn(h,w,V)}finally{h.refCleanup=null,h=h.alternate,h!=null&&(h.refCleanup=null)}else if(typeof k=="function")try{k(null)}catch(V){Kn(h,w,V)}else k.current=null}function nq(h){var w=h.type,k=h.memoizedProps,D=h.stateNode;try{e:switch(w){case"button":case"input":case"select":case"textarea":k.autoFocus&&D.focus();break e;case"img":k.src?D.src=k.src:k.srcSet&&(D.srcset=k.srcSet)}}catch(V){Kn(h,h.return,V)}}function bM(h,w,k){try{var D=h.stateNode;Pue(D,h.type,k,w),D[Nt]=w}catch(V){Kn(h,h.return,V)}}function rq(h){return h.tag===5||h.tag===3||h.tag===26||h.tag===27&&Ip(h.type)||h.tag===4}function xM(h){e:for(;;){for(;h.sibling===null;){if(h.return===null||rq(h.return))return null;h=h.return}for(h.sibling.return=h.return,h=h.sibling;h.tag!==5&&h.tag!==6&&h.tag!==18;){if(h.tag===27&&Ip(h.type)||h.flags&2||h.child===null||h.tag===4)continue e;h.child.return=h,h=h.child}if(!(h.flags&2))return h.stateNode}}function yM(h,w,k){var D=h.tag;if(D===5||D===6)h=h.stateNode,w?(k.nodeType===9?k.body:k.nodeName==="HTML"?k.ownerDocument.body:k).insertBefore(h,w):(w=k.nodeType===9?k.body:k.nodeName==="HTML"?k.ownerDocument.body:k,w.appendChild(h),k=k._reactRootContainer,k!=null||w.onclick!==null||(w.onclick=Wt));else if(D!==4&&(D===27&&Ip(h.type)&&(k=h.stateNode,w=null),h=h.child,h!==null))for(yM(h,w,k),h=h.sibling;h!==null;)yM(h,w,k),h=h.sibling}function e_(h,w,k){var D=h.tag;if(D===5||D===6)h=h.stateNode,w?k.insertBefore(h,w):k.appendChild(h);else if(D!==4&&(D===27&&Ip(h.type)&&(k=h.stateNode),h=h.child,h!==null))for(e_(h,w,k),h=h.sibling;h!==null;)e_(h,w,k),h=h.sibling}function iq(h){var w=h.stateNode,k=h.memoizedProps;try{for(var D=h.type,V=w.attributes;V.length;)w.removeAttributeNode(V[0]);_s(w,D,k),w[vt]=h,w[Nt]=k}catch(te){Kn(h,h.return,te)}}var $u=!1,Ni=!1,vM=!1,sq=typeof WeakSet=="function"?WeakSet:Set,Zi=null;function sue(h,w){if(h=h.containerInfo,BM=w_,h=uo(h),wi(h)){if("selectionStart"in h)var k={start:h.selectionStart,end:h.selectionEnd};else e:{k=(k=h.ownerDocument)&&k.defaultView||window;var D=k.getSelection&&k.getSelection();if(D&&D.rangeCount!==0){k=D.anchorNode;var V=D.anchorOffset,te=D.focusNode;D=D.focusOffset;try{k.nodeType,te.nodeType}catch{k=null;break e}var we=0,qe=-1,mt=-1,Et=0,Ht=0,Gt=h,Lt=null;t:for(;;){for(var Ut;Gt!==k||V!==0&&Gt.nodeType!==3||(qe=we+V),Gt!==te||D!==0&&Gt.nodeType!==3||(mt=we+D),Gt.nodeType===3&&(we+=Gt.nodeValue.length),(Ut=Gt.firstChild)!==null;)Lt=Gt,Gt=Ut;for(;;){if(Gt===h)break t;if(Lt===k&&++Et===V&&(qe=we),Lt===te&&++Ht===D&&(mt=we),(Ut=Gt.nextSibling)!==null)break;Gt=Lt,Lt=Gt.parentNode}Gt=Ut}k=qe===-1||mt===-1?null:{start:qe,end:mt}}else k=null}k=k||{start:0,end:0}}else k=null;for(qM={focusedElem:h,selectionRange:k},w_=!1,Zi=w;Zi!==null;)if(w=Zi,h=w.child,(w.subtreeFlags&1028)!==0&&h!==null)h.return=w,Zi=h;else for(;Zi!==null;){switch(w=Zi,te=w.alternate,h=w.flags,w.tag){case 0:if((h&4)!==0&&(h=w.updateQueue,h=h!==null?h.events:null,h!==null))for(k=0;k title"))),_s(te,D,k),te[vt]=h,ot(te),D=te;break e;case"link":var we=mH("link","href",V).get(D+(k.href||""));if(we){for(var qe=0;qear&&(we=ar,ar=Ia,Ia=we);var kt=Zn(qe,Ia),xt=Zn(qe,ar);if(kt&&xt&&(Ut.rangeCount!==1||Ut.anchorNode!==kt.node||Ut.anchorOffset!==kt.offset||Ut.focusNode!==xt.node||Ut.focusOffset!==xt.offset)){var jt=Gt.createRange();jt.setStart(kt.node,kt.offset),Ut.removeAllRanges(),Ia>ar?(Ut.addRange(jt),Ut.extend(xt.node,xt.offset)):(jt.setEnd(xt.node,xt.offset),Ut.addRange(jt))}}}}for(Gt=[],Ut=qe;Ut=Ut.parentNode;)Ut.nodeType===1&&Gt.push({element:Ut,left:Ut.scrollLeft,top:Ut.scrollTop});for(typeof qe.focus=="function"&&qe.focus(),qe=0;qek?32:k,ee.T=null,k=PM,PM=null;var te=Fp,we=Qu;if(Oi=0,Hb=Fp=null,Qu=0,(Bn&6)!==0)throw Error(r(331));var qe=Bn;if(Bn|=4,bq(te.current),hq(te,te.current,we,k),Bn=qe,Gv(0,!1),Ie&&typeof Ie.onPostCommitFiberRoot=="function")try{Ie.onPostCommitFiberRoot(_e,te)}catch{}return!0}finally{J.p=V,ee.T=D,Lq(h,w)}}function Iq(h,w,k){w=Vl(k,w),w=sM(h.stateNode,w,2),h=Pp(h,w,2),h!==null&&(at(h,2),Fd(h))}function Kn(h,w,k){if(h.tag===3)Iq(h,h,k);else for(;w!==null;){if(w.tag===3){Iq(w,h,k);break}else if(w.tag===1){var D=w.stateNode;if(typeof w.type.getDerivedStateFromError=="function"||typeof D.componentDidCatch=="function"&&(Dp===null||!Dp.has(D))){h=Vl(k,h),k=OB(2),D=Pp(w,k,2),D!==null&&(zB(k,D,w,h),at(D,2),Fd(D));break}}w=w.return}}function MM(h,w,k){var D=h.pingCache;if(D===null){D=h.pingCache=new cue;var V=new Set;D.set(w,V)}else V=D.get(w),V===void 0&&(V=new Set,D.set(w,V));V.has(k)||(kM=!0,V.add(k),h=hue.bind(null,h,w,k),w.then(h,h))}function hue(h,w,k){var D=h.pingCache;D!==null&&D.delete(w),h.pingedLanes|=h.suspendedLanes&k,h.warmLanes&=~k,hr===h&&(kn&k)===k&&(Zr===4||Zr===3&&(kn&62914560)===kn&&300>I()-n_?(Bn&2)===0&&$b(h,0):_M|=k,qb===kn&&(qb=0)),Fd(h)}function Oq(h,w){w===0&&(w=We()),h=kf(h,w),h!==null&&(at(h,w),Fd(h))}function fue(h){var w=h.memoizedState,k=0;w!==null&&(k=w.retryLane),Oq(h,k)}function gue(h,w){var k=0;switch(h.tag){case 31:case 13:var D=h.stateNode,V=h.memoizedState;V!==null&&(k=V.retryLane);break;case 19:D=h.stateNode;break;case 22:D=h.stateNode._retryCache;break;default:throw Error(r(314))}D!==null&&D.delete(w),Oq(h,k)}function bue(h,w){return he(h,w)}var d_=null,Gb=null,EM=!1,u_=!1,DM=!1,Rp=0;function Fd(h){h!==Gb&&h.next===null&&(Gb===null?d_=Gb=h:Gb=Gb.next=h),u_=!0,EM||(EM=!0,yue())}function Gv(h,w){if(!DM&&u_){DM=!0;do for(var k=!1,D=d_;D!==null;){if(h!==0){var V=D.pendingLanes;if(V===0)var te=0;else{var we=D.suspendedLanes,qe=D.pingedLanes;te=(1<<31-He(42|h)+1)-1,te&=V&~(we&~qe),te=te&201326741?te&201326741|1:te?te|2:0}te!==0&&(k=!0,qq(D,te))}else te=kn,te=Ce(D,D===hr?te:0,D.cancelPendingCommit!==null||D.timeoutHandle!==-1),(te&3)===0||Oe(D,te)||(k=!0,qq(D,te));D=D.next}while(k);DM=!1}}function xue(){zq()}function zq(){u_=EM=!1;var h=0;Rp!==0&&Aue()&&(h=Rp);for(var w=I(),k=null,D=d_;D!==null;){var V=D.next,te=Uq(D,w);te===0?(D.next=null,k===null?d_=V:k.next=V,V===null&&(Gb=k)):(k=D,(h!==0||(te&3)!==0)&&(u_=!0)),D=V}Oi!==0&&Oi!==5||Gv(h),Rp!==0&&(Rp=0)}function Uq(h,w){for(var k=h.suspendedLanes,D=h.pingedLanes,V=h.expirationTimes,te=h.pendingLanes&-62914561;0qe)break;var Ht=mt.transferSize,Gt=mt.initiatorType;Ht&&Yq(Gt)&&(mt=mt.responseEnd,we+=Ht*(mt"u"?null:document;function lH(h,w,k){var D=Wb;if(D&&typeof w=="string"&&w){var V=Oa(w);V='link[rel="'+h+'"][href="'+V+'"]',typeof k=="string"&&(V+='[crossorigin="'+k+'"]'),oH.has(V)||(oH.add(V),h={rel:h,crossOrigin:k,href:w},D.querySelector(V)===null&&(w=D.createElement("link"),_s(w,"link",h),ot(w),D.head.appendChild(w)))}}function Oue(h){Yu.D(h),lH("dns-prefetch",h,null)}function zue(h,w){Yu.C(h,w),lH("preconnect",h,w)}function Uue(h,w,k){Yu.L(h,w,k);var D=Wb;if(D&&h&&w){var V='link[rel="preload"][as="'+Oa(w)+'"]';w==="image"&&k&&k.imageSrcSet?(V+='[imagesrcset="'+Oa(k.imageSrcSet)+'"]',typeof k.imageSizes=="string"&&(V+='[imagesizes="'+Oa(k.imageSizes)+'"]')):V+='[href="'+Oa(h)+'"]';var te=V;switch(w){case"style":te=Kb(h);break;case"script":te=Qb(h)}Xl.has(te)||(h=m({rel:"preload",href:w==="image"&&k&&k.imageSrcSet?void 0:h,as:w},k),Xl.set(te,h),D.querySelector(V)!==null||w==="style"&&D.querySelector(Yv(te))||w==="script"&&D.querySelector(Xv(te))||(w=D.createElement("link"),_s(w,"link",h),ot(w),D.head.appendChild(w)))}}function Bue(h,w){Yu.m(h,w);var k=Wb;if(k&&h){var D=w&&typeof w.as=="string"?w.as:"script",V='link[rel="modulepreload"][as="'+Oa(D)+'"][href="'+Oa(h)+'"]',te=V;switch(D){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":te=Qb(h)}if(!Xl.has(te)&&(h=m({rel:"modulepreload",href:h},w),Xl.set(te,h),k.querySelector(V)===null)){switch(D){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(k.querySelector(Xv(te)))return}D=k.createElement("link"),_s(D,"link",h),ot(D),k.head.appendChild(D)}}}function que(h,w,k){Yu.S(h,w,k);var D=Wb;if(D&&h){var V=rt(D).hoistableStyles,te=Kb(h);w=w||"default";var we=V.get(te);if(!we){var qe={loading:0,preload:null};if(we=D.querySelector(Yv(te)))qe.loading=5;else{h=m({rel:"stylesheet",href:h,"data-precedence":w},k),(k=Xl.get(te))&&QM(h,k);var mt=we=D.createElement("link");ot(mt),_s(mt,"link",h),mt._p=new Promise(function(Et,Ht){mt.onload=Et,mt.onerror=Ht}),mt.addEventListener("load",function(){qe.loading|=1}),mt.addEventListener("error",function(){qe.loading|=2}),qe.loading|=4,g_(we,w,D)}we={type:"stylesheet",instance:we,count:1,state:qe},V.set(te,we)}}}function Hue(h,w){Yu.X(h,w);var k=Wb;if(k&&h){var D=rt(k).hoistableScripts,V=Qb(h),te=D.get(V);te||(te=k.querySelector(Xv(V)),te||(h=m({src:h,async:!0},w),(w=Xl.get(V))&&YM(h,w),te=k.createElement("script"),ot(te),_s(te,"link",h),k.head.appendChild(te)),te={type:"script",instance:te,count:1,state:null},D.set(V,te))}}function $ue(h,w){Yu.M(h,w);var k=Wb;if(k&&h){var D=rt(k).hoistableScripts,V=Qb(h),te=D.get(V);te||(te=k.querySelector(Xv(V)),te||(h=m({src:h,async:!0,type:"module"},w),(w=Xl.get(V))&&YM(h,w),te=k.createElement("script"),ot(te),_s(te,"link",h),k.head.appendChild(te)),te={type:"script",instance:te,count:1,state:null},D.set(V,te))}}function cH(h,w,k,D){var V=(V=H.current)?f_(V):null;if(!V)throw Error(r(446));switch(h){case"meta":case"title":return null;case"style":return typeof k.precedence=="string"&&typeof k.href=="string"?(w=Kb(k.href),k=rt(V).hoistableStyles,D=k.get(w),D||(D={type:"style",instance:null,count:0,state:null},k.set(w,D)),D):{type:"void",instance:null,count:0,state:null};case"link":if(k.rel==="stylesheet"&&typeof k.href=="string"&&typeof k.precedence=="string"){h=Kb(k.href);var te=rt(V).hoistableStyles,we=te.get(h);if(we||(V=V.ownerDocument||V,we={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},te.set(h,we),(te=V.querySelector(Yv(h)))&&!te._p&&(we.instance=te,we.state.loading=5),Xl.has(h)||(k={rel:"preload",as:"style",href:k.href,crossOrigin:k.crossOrigin,integrity:k.integrity,media:k.media,hrefLang:k.hrefLang,referrerPolicy:k.referrerPolicy},Xl.set(h,k),te||Vue(V,h,k,we.state))),w&&D===null)throw Error(r(528,""));return we}if(w&&D!==null)throw Error(r(529,""));return null;case"script":return w=k.async,k=k.src,typeof k=="string"&&w&&typeof w!="function"&&typeof w!="symbol"?(w=Qb(k),k=rt(V).hoistableScripts,D=k.get(w),D||(D={type:"script",instance:null,count:0,state:null},k.set(w,D)),D):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,h))}}function Kb(h){return'href="'+Oa(h)+'"'}function Yv(h){return'link[rel="stylesheet"]['+h+"]"}function dH(h){return m({},h,{"data-precedence":h.precedence,precedence:null})}function Vue(h,w,k,D){h.querySelector('link[rel="preload"][as="style"]['+w+"]")?D.loading=1:(w=h.createElement("link"),D.preload=w,w.addEventListener("load",function(){return D.loading|=1}),w.addEventListener("error",function(){return D.loading|=2}),_s(w,"link",k),ot(w),h.head.appendChild(w))}function Qb(h){return'[src="'+Oa(h)+'"]'}function Xv(h){return"script[async]"+h}function uH(h,w,k){if(w.count++,w.instance===null)switch(w.type){case"style":var D=h.querySelector('style[data-href~="'+Oa(k.href)+'"]');if(D)return w.instance=D,ot(D),D;var V=m({},k,{"data-href":k.href,"data-precedence":k.precedence,href:null,precedence:null});return D=(h.ownerDocument||h).createElement("style"),ot(D),_s(D,"style",V),g_(D,k.precedence,h),w.instance=D;case"stylesheet":V=Kb(k.href);var te=h.querySelector(Yv(V));if(te)return w.state.loading|=4,w.instance=te,ot(te),te;D=dH(k),(V=Xl.get(V))&&QM(D,V),te=(h.ownerDocument||h).createElement("link"),ot(te);var we=te;return we._p=new Promise(function(qe,mt){we.onload=qe,we.onerror=mt}),_s(te,"link",D),w.state.loading|=4,g_(te,k.precedence,h),w.instance=te;case"script":return te=Qb(k.src),(V=h.querySelector(Xv(te)))?(w.instance=V,ot(V),V):(D=k,(V=Xl.get(te))&&(D=m({},k),YM(D,V)),h=h.ownerDocument||h,V=h.createElement("script"),ot(V),_s(V,"link",D),h.head.appendChild(V),w.instance=V);case"void":return null;default:throw Error(r(443,w.type))}else w.type==="stylesheet"&&(w.state.loading&4)===0&&(D=w.instance,w.state.loading|=4,g_(D,k.precedence,h));return w.instance}function g_(h,w,k){for(var D=k.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),V=D.length?D[D.length-1]:null,te=V,we=0;we title"):null)}function Gue(h,w,k){if(k===1||w.itemProp!=null)return!1;switch(h){case"meta":case"title":return!0;case"style":if(typeof w.precedence!="string"||typeof w.href!="string"||w.href==="")break;return!0;case"link":if(typeof w.rel!="string"||typeof w.href!="string"||w.href===""||w.onLoad||w.onError)break;return w.rel==="stylesheet"?(h=w.disabled,typeof w.precedence=="string"&&h==null):!0;case"script":if(w.async&&typeof w.async!="function"&&typeof w.async!="symbol"&&!w.onLoad&&!w.onError&&w.src&&typeof w.src=="string")return!0}return!1}function hH(h){return!(h.type==="stylesheet"&&(h.state.loading&3)===0)}function Wue(h,w,k,D){if(k.type==="stylesheet"&&(typeof D.media!="string"||matchMedia(D.media).matches!==!1)&&(k.state.loading&4)===0){if(k.instance===null){var V=Kb(D.href),te=w.querySelector(Yv(V));if(te){w=te._p,w!==null&&typeof w=="object"&&typeof w.then=="function"&&(h.count++,h=x_.bind(h),w.then(h,h)),k.state.loading|=4,k.instance=te,ot(te);return}te=w.ownerDocument||w,D=dH(D),(V=Xl.get(V))&&QM(D,V),te=te.createElement("link"),ot(te);var we=te;we._p=new Promise(function(qe,mt){we.onload=qe,we.onerror=mt}),_s(te,"link",D),k.instance=te}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(k,w),(w=k.state.preload)&&(k.state.loading&3)===0&&(h.count++,k=x_.bind(h),w.addEventListener("load",k),w.addEventListener("error",k))}}var XM=0;function Kue(h,w){return h.stylesheets&&h.count===0&&v_(h,h.stylesheets),0XM?50:800)+w);return h.unsuspend=k,function(){h.unsuspend=null,clearTimeout(D),clearTimeout(V)}}:null}function x_(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)v_(this,this.stylesheets);else if(this.unsuspend){var h=this.unsuspend;this.unsuspend=null,h()}}}var y_=null;function v_(h,w){h.stylesheets=null,h.unsuspend!==null&&(h.count++,y_=new Map,w.forEach(Que,h),y_=null,x_.call(h))}function Que(h,w){if(!(w.state.loading&4)){var k=y_.get(h);if(k)var D=k.get(null);else{k=new Map,y_.set(h,k);for(var V=h.querySelectorAll("link[data-precedence],style[data-precedence]"),te=0;te"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),sE.exports=mme(),sE.exports}var hme=pme();const qa=t=>typeof t=="string",r0=()=>{let t,e;const a=new Promise((r,i)=>{t=r,e=i});return a.resolve=t,a.reject=e,a},OH=t=>t==null?"":""+t,fme=(t,e,a)=>{t.forEach(r=>{e[r]&&(a[r]=e[r])})},gme=/###/g,zH=t=>t&&t.indexOf("###")>-1?t.replace(gme,"."):t,UH=t=>!t||qa(t),tw=(t,e,a)=>{const r=qa(e)?e.split("."):e;let i=0;for(;i{const{obj:r,k:i}=tw(t,e,Object);if(r!==void 0||e.length===1){r[i]=a;return}let s=e[e.length-1],o=e.slice(0,e.length-1),l=tw(t,o,Object);for(;l.obj===void 0&&o.length;)s=`${o[o.length-1]}.${s}`,o=o.slice(0,o.length-1),l=tw(t,o,Object),l?.obj&&typeof l.obj[`${l.k}.${s}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${s}`]=a},bme=(t,e,a,r)=>{const{obj:i,k:s}=tw(t,e,Object);i[s]=i[s]||[],i[s].push(a)},ZN=(t,e)=>{const{obj:a,k:r}=tw(t,e);if(a&&Object.prototype.hasOwnProperty.call(a,r))return a[r]},xme=(t,e,a)=>{const r=ZN(t,a);return r!==void 0?r:ZN(e,a)},eZ=(t,e,a)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?qa(t[r])||t[r]instanceof String||qa(e[r])||e[r]instanceof String?a&&(t[r]=e[r]):eZ(t[r],e[r],a):t[r]=e[r]);return t},Xb=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var yme={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const vme=t=>qa(t)?t.replace(/[&<>"'\/]/g,e=>yme[e]):t;class wme{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const a=this.regExpMap.get(e);if(a!==void 0)return a;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const Sme=[" ",",","?","!",";"],kme=new wme(20),_me=(t,e,a)=>{e=e||"",a=a||"";const r=Sme.filter(o=>e.indexOf(o)<0&&a.indexOf(o)<0);if(r.length===0)return!0;const i=kme.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let s=!i.test(t);if(!s){const o=t.indexOf(a);o>0&&!i.test(t.substring(0,o))&&(s=!0)}return s},z3=(t,e,a=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const r=e.split(a);let i=t;for(let s=0;s-1&&ct?.replace("_","-"),Nme={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console?.[t]?.apply?.(console,e)}};class JN{constructor(e,a={}){this.init(e,a)}init(e,a={}){this.prefix=a.prefix||"i18next:",this.logger=e||Nme,this.options=a,this.debug=a.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,a,r,i){return i&&!this.debug?null:(qa(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[a](e))}create(e){return new JN(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new JN(this.logger,e)}}var Jd=new JN;let _T=class{constructor(){this.observers={}}on(e,a){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(a)||0;this.observers[r].set(a,i+1)}),this}off(e,a){if(this.observers[e]){if(!a){delete this.observers[e];return}this.observers[e].delete(a)}}emit(e,...a){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,s])=>{for(let o=0;o{for(let o=0;o-1&&this.options.ns.splice(a,1)}getResource(e,a,r,i={}){const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;e.indexOf(".")>-1?l=e.split("."):(l=[e,a],r&&(Array.isArray(r)?l.push(...r):qa(r)&&s?l.push(...r.split(s)):l.push(r)));const c=ZN(this.data,l);return!c&&!a&&!r&&e.indexOf(".")>-1&&(e=l[0],a=l[1],r=l.slice(2).join(".")),c||!o||!qa(r)?c:z3(this.data?.[e]?.[a],r,s)}addResource(e,a,r,i,s={silent:!1}){const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let l=[e,a];r&&(l=l.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(l=e.split("."),i=a,a=l[1]),this.addNamespaces(a),BH(this.data,l,i),s.silent||this.emit("added",e,a,r,i)}addResources(e,a,r,i={silent:!1}){for(const s in r)(qa(r[s])||Array.isArray(r[s]))&&this.addResource(e,a,s,r[s],{silent:!0});i.silent||this.emit("added",e,a,r)}addResourceBundle(e,a,r,i,s,o={silent:!1,skipCopy:!1}){let l=[e,a];e.indexOf(".")>-1&&(l=e.split("."),i=r,r=a,a=l[1]),this.addNamespaces(a);let c=ZN(this.data,l)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?eZ(c,r,s):c={...c,...r},BH(this.data,l,c),o.silent||this.emit("added",e,a,r)}removeResourceBundle(e,a){this.hasResourceBundle(e,a)&&delete this.data[e][a],this.removeNamespaces(a),this.emit("removed",e,a)}hasResourceBundle(e,a){return this.getResource(e,a)!==void 0}getResourceBundle(e,a){return a||(a=this.options.defaultNS),this.getResource(e,a)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const a=this.getDataByLanguage(e);return!!(a&&Object.keys(a)||[]).find(i=>a[i]&&Object.keys(a[i]).length>0)}toJSON(){return this.data}}var tZ={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,a,r,i){return t.forEach(s=>{e=this.processors[s]?.process(e,a,r,i)??e}),e}};const aZ=Symbol("i18next/PATH_KEY");function Cme(){const t=[],e=Object.create(null);let a;return e.get=(r,i)=>(a?.revoke?.(),i===aZ?t:(t.push(i),a=Proxy.revocable(r,e),a.proxy)),Proxy.revocable(Object.create(null),e).proxy}function U3(t,e){const{[aZ]:a}=t(Cme());return a.join(e?.keySeparator??".")}const HH={},dE=t=>!qa(t)&&typeof t!="boolean"&&typeof t!="number";class eC extends _T{constructor(e,a={}){super(),fme(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Jd.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,a={interpolation:{}}){const r={...a};if(e==null)return!1;const i=this.resolve(e,r);if(i?.res===void 0)return!1;const s=dE(i.res);return!(r.returnObjects===!1&&s)}extractFromKey(e,a){let r=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let s=a.ns||this.options.defaultNS||[];const o=r&&e.indexOf(r)>-1,l=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!_me(e,r,i);if(o&&!l){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:qa(s)?[s]:s};const d=e.split(r);(r!==i||r===i&&this.options.ns.indexOf(d[0])>-1)&&(s=d.shift()),e=d.join(i)}return{key:e,namespaces:qa(s)?[s]:s}}translate(e,a,r){let i=typeof a=="object"?{...a}:a;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),e==null)return"";typeof e=="function"&&(e=U3(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]);const s=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(e[e.length-1],i),d=c[c.length-1];let u=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;u===void 0&&(u=":");const m=i.lng||this.language,p=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(m?.toLowerCase()==="cimode")return p?s?{res:`${d}${u}${l}`,usedKey:l,exactUsedKey:l,usedLng:m,usedNS:d,usedParams:this.getUsedParamsDetails(i)}:`${d}${u}${l}`:s?{res:l,usedKey:l,exactUsedKey:l,usedLng:m,usedNS:d,usedParams:this.getUsedParamsDetails(i)}:l;const f=this.resolve(e,i);let g=f?.res;const v=f?.usedKey||l,b=f?.exactUsedKey||l,x=["[object Number]","[object Function]","[object RegExp]"],S=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,_=!this.i18nFormat||this.i18nFormat.handleAsObject,C=i.count!==void 0&&!qa(i.count),P=eC.hasDefaultValue(i),T=C?this.pluralResolver.getSuffix(m,i.count,i):"",M=i.ordinal&&C?this.pluralResolver.getSuffix(m,i.count,{ordinal:!1}):"",F=C&&!i.ordinal&&i.count===0,N=F&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${T}`]||i[`defaultValue${M}`]||i.defaultValue;let j=g;_&&!g&&P&&(j=N);const R=dE(j),O=Object.prototype.toString.apply(j);if(_&&j&&R&&x.indexOf(O)<0&&!(qa(S)&&Array.isArray(j))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const B=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,j,{...i,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return s?(f.res=B,f.usedParams=this.getUsedParamsDetails(i),f):B}if(o){const B=Array.isArray(j),L=B?[]:{},Y=B?b:v;for(const ee in j)if(Object.prototype.hasOwnProperty.call(j,ee)){const J=`${Y}${o}${ee}`;P&&!g?L[ee]=this.translate(J,{...i,defaultValue:dE(N)?N[ee]:void 0,joinArrays:!1,ns:c}):L[ee]=this.translate(J,{...i,joinArrays:!1,ns:c}),L[ee]===J&&(L[ee]=j[ee])}g=L}}else if(_&&qa(S)&&Array.isArray(g))g=g.join(S),g&&(g=this.extendTranslation(g,e,i,r));else{let B=!1,L=!1;!this.isValidLookup(g)&&P&&(B=!0,g=N),this.isValidLookup(g)||(L=!0,g=l);const ee=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:g,J=P&&N!==g&&this.options.updateMissing;if(L||B||J){if(this.logger.log(J?"updateKey":"missingKey",m,d,l,J?N:g),o){const Q=this.resolve(l,{...i,keySeparator:!1});Q&&Q.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let le=[];const de=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&de&&de[0])for(let Q=0;Q{const me=P&&pe!==g?pe:ee;this.options.missingKeyHandler?this.options.missingKeyHandler(Q,d,se,me,J,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(Q,d,se,me,J,i),this.emit("missingKey",Q,d,se,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&C?le.forEach(Q=>{const se=this.pluralResolver.getSuffixes(Q,i);F&&i[`defaultValue${this.options.pluralSeparator}zero`]&&se.indexOf(`${this.options.pluralSeparator}zero`)<0&&se.push(`${this.options.pluralSeparator}zero`),se.forEach(pe=>{ue([Q],l+pe,i[`defaultValue${pe}`]||N)})}):ue(le,l,N))}g=this.extendTranslation(g,e,i,f,r),L&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${d}${u}${l}`),(L||B)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${d}${u}${l}`:l,B?g:void 0,i))}return s?(f.res=g,f.usedParams=this.getUsedParamsDetails(i),f):g}extendTranslation(e,a,r,i,s){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const c=qa(e)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(c){const m=e.match(this.interpolator.nestingRegexp);d=m&&m.length}let u=r.replace&&!qa(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),e=this.interpolator.interpolate(e,u,r.lng||this.language||i.usedLng,r),c){const m=e.match(this.interpolator.nestingRegexp),p=m&&m.length;ds?.[0]===m[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${a[0]}`),null):this.translate(...m,a),r)),r.interpolation&&this.interpolator.reset()}const o=r.postProcess||this.options.postProcess,l=qa(o)?[o]:o;return e!=null&&l?.length&&r.applyPostProcessor!==!1&&(e=tZ.handle(l,e,a,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,a={}){let r,i,s,o,l;return qa(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(r))return;const d=this.extractFromKey(c,a),u=d.key;i=u;let m=d.namespaces;this.options.fallbackNS&&(m=m.concat(this.options.fallbackNS));const p=a.count!==void 0&&!qa(a.count),f=p&&!a.ordinal&&a.count===0,g=a.context!==void 0&&(qa(a.context)||typeof a.context=="number")&&a.context!=="",v=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);m.forEach(b=>{this.isValidLookup(r)||(l=b,!HH[`${v[0]}-${b}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(l)&&(HH[`${v[0]}-${b}`]=!0,this.logger.warn(`key "${i}" for languages "${v.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),v.forEach(x=>{if(this.isValidLookup(r))return;o=x;const S=[u];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(S,u,x,b,a);else{let C;p&&(C=this.pluralResolver.getSuffix(x,a.count,a));const P=`${this.options.pluralSeparator}zero`,T=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(a.ordinal&&C.indexOf(T)===0&&S.push(u+C.replace(T,this.options.pluralSeparator)),S.push(u+C),f&&S.push(u+P)),g){const M=`${u}${this.options.contextSeparator||"_"}${a.context}`;S.push(M),p&&(a.ordinal&&C.indexOf(T)===0&&S.push(M+C.replace(T,this.options.pluralSeparator)),S.push(M+C),f&&S.push(M+P))}}let _;for(;_=S.pop();)this.isValidLookup(r)||(s=_,r=this.getResource(x,b,_,a))}))})}),{res:r,usedKey:i,exactUsedKey:s,usedLng:o,usedNS:l}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,a,r,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,a,r,i):this.resourceStore.getResource(e,a,r,i)}getUsedParamsDetails(e={}){const a=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!qa(e.replace);let i=r?e.replace:e;if(r&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const s of a)delete i[s]}return i}static hasDefaultValue(e){const a="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&a===r.substring(0,a.length)&&e[r]!==void 0)return!0;return!1}}class $H{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Jd.create("languageUtils")}getScriptPartFromCode(e){if(e=Ew(e),!e||e.indexOf("-")<0)return null;const a=e.split("-");return a.length===2||(a.pop(),a[a.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(a.join("-"))}getLanguagePartFromCode(e){if(e=Ew(e),!e||e.indexOf("-")<0)return e;const a=e.split("-");return this.formatLanguageCode(a[0])}formatLanguageCode(e){if(qa(e)&&e.indexOf("-")>-1){let a;try{a=Intl.getCanonicalLocales(e)[0]}catch{}return a&&this.options.lowerCaseLng&&(a=a.toLowerCase()),a||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let a;return e.forEach(r=>{if(a)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(a=i)}),!a&&this.options.supportedLngs&&e.forEach(r=>{if(a)return;const i=this.getScriptPartFromCode(r);if(this.isSupportedCode(i))return a=i;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return a=s;a=this.options.supportedLngs.find(o=>{if(o===s)return o;if(!(o.indexOf("-")<0&&s.indexOf("-")<0)&&(o.indexOf("-")>0&&s.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===s||o.indexOf(s)===0&&s.length>1))return o})}),a||(a=this.getFallbackCodes(this.options.fallbackLng)[0]),a}getFallbackCodes(e,a){if(!e)return[];if(typeof e=="function"&&(e=e(a)),qa(e)&&(e=[e]),Array.isArray(e))return e;if(!a)return e.default||[];let r=e[a];return r||(r=e[this.getScriptPartFromCode(a)]),r||(r=e[this.formatLanguageCode(a)]),r||(r=e[this.getLanguagePartFromCode(a)]),r||(r=e.default),r||[]}toResolveHierarchy(e,a){const r=this.getFallbackCodes((a===!1?[]:a)||this.options.fallbackLng||[],e),i=[],s=o=>{o&&(this.isSupportedCode(o)?i.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return qa(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(e))):qa(e)&&s(this.formatLanguageCode(e)),r.forEach(o=>{i.indexOf(o)<0&&s(this.formatLanguageCode(o))}),i}}const VH={zero:0,one:1,two:2,few:3,many:4,other:5},GH={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Pme{constructor(e,a={}){this.languageUtils=e,this.options=a,this.logger=Jd.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,a){this.rules[e]=a}clearCache(){this.pluralRulesCache={}}getRule(e,a={}){const r=Ew(e==="dev"?"en":e),i=a.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:r,type:i});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let o;try{o=new Intl.PluralRules(r,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),GH;if(!e.match(/-|_/))return GH;const c=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(c,a)}return this.pluralRulesCache[s]=o,o}needsPlural(e,a={}){let r=this.getRule(e,a);return r||(r=this.getRule("dev",a)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,a,r={}){return this.getSuffixes(e,r).map(i=>`${a}${i}`)}getSuffixes(e,a={}){let r=this.getRule(e,a);return r||(r=this.getRule("dev",a)),r?r.resolvedOptions().pluralCategories.sort((i,s)=>VH[i]-VH[s]).map(i=>`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,a,r={}){const i=this.getRule(e,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(a)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",a,r))}}const WH=(t,e,a,r=".",i=!0)=>{let s=xme(t,e,a);return!s&&i&&qa(a)&&(s=z3(t,a,r),s===void 0&&(s=z3(e,a,r))),s},uE=t=>t.replace(/\$/g,"$$$$");class Tme{constructor(e={}){this.logger=Jd.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(a=>a),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:a,escapeValue:r,useRawValueToEscape:i,prefix:s,prefixEscaped:o,suffix:l,suffixEscaped:c,formatSeparator:d,unescapeSuffix:u,unescapePrefix:m,nestingPrefix:p,nestingPrefixEscaped:f,nestingSuffix:g,nestingSuffixEscaped:v,nestingOptionsSeparator:b,maxReplaces:x,alwaysFormat:S}=e.interpolation;this.escape=a!==void 0?a:vme,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=s?Xb(s):o||"{{",this.suffix=l?Xb(l):c||"}}",this.formatSeparator=d||",",this.unescapePrefix=u?"":m||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=p?Xb(p):f||Xb("$t("),this.nestingSuffix=g?Xb(g):v||Xb(")"),this.nestingOptionsSeparator=b||",",this.maxReplaces=x||1e3,this.alwaysFormat=S!==void 0?S:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(a,r)=>a?.source===r?(a.lastIndex=0,a):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,a,r,i){let s,o,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=f=>{if(f.indexOf(this.formatSeparator)<0){const x=WH(a,c,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(x,void 0,r,{...i,...a,interpolationkey:f}):x}const g=f.split(this.formatSeparator),v=g.shift().trim(),b=g.join(this.formatSeparator).trim();return this.format(WH(a,c,v,this.options.keySeparator,this.options.ignoreJSONStructure),b,r,{...i,...a,interpolationkey:v})};this.resetRegExp();const u=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,m=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>uE(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?uE(this.escape(f)):uE(f)}].forEach(f=>{for(l=0;s=f.regex.exec(e);){const g=s[1].trim();if(o=d(g),o===void 0)if(typeof u=="function"){const b=u(e,s,i);o=qa(b)?b:""}else if(i&&Object.prototype.hasOwnProperty.call(i,g))o="";else if(m){o=s[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${e}`),o="";else!qa(o)&&!this.useRawValueToEscape&&(o=OH(o));const v=f.safeValue(o);if(e=e.replace(s[0],v),m?(f.regex.lastIndex+=o.length,f.regex.lastIndex-=s[0].length):f.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),e}nest(e,a,r={}){let i,s,o;const l=(c,d)=>{const u=this.nestingOptionsSeparator;if(c.indexOf(u)<0)return c;const m=c.split(new RegExp(`${u}[ ]*{`));let p=`{${m[1]}`;c=m[0],p=this.interpolate(p,o);const f=p.match(/'/g),g=p.match(/"/g);((f?.length??0)%2===0&&!g||g.length%2!==0)&&(p=p.replace(/'/g,'"'));try{o=JSON.parse(p),d&&(o={...d,...o})}catch(v){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,v),`${c}${u}${p}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,c};for(;i=this.nestingRegexp.exec(e);){let c=[];o={...r},o=o.replace&&!qa(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const d=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(d!==-1&&(c=i[1].slice(d).split(this.formatSeparator).map(u=>u.trim()).filter(Boolean),i[1]=i[1].slice(0,d)),s=a(l.call(this,i[1].trim(),o),o),s&&i[0]===e&&!qa(s))return s;qa(s)||(s=OH(s)),s||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),s=""),c.length&&(s=c.reduce((u,m)=>this.format(u,m,r.lng,{...r,interpolationkey:i[1].trim()}),s.trim())),e=e.replace(i[0],s),this.regexp.lastIndex=0}return e}}const Ame=t=>{let e=t.toLowerCase().trim();const a={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);e==="currency"&&i.indexOf(":")<0?a.currency||(a.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?a.range||(a.range=i.trim()):i.split(";").forEach(o=>{if(o){const[l,...c]=o.split(":"),d=c.join(":").trim().replace(/^'+|'+$/g,""),u=l.trim();a[u]||(a[u]=d),d==="false"&&(a[u]=!1),d==="true"&&(a[u]=!0),isNaN(d)||(a[u]=parseInt(d,10))}})}return{formatName:e,formatOptions:a}},KH=t=>{const e={};return(a,r,i)=>{let s=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(s={...s,[i.interpolationkey]:void 0});const o=r+JSON.stringify(s);let l=e[o];return l||(l=t(Ew(r),i),e[o]=l),l(a)}},jme=t=>(e,a,r)=>t(Ew(a),r)(e);class Mme{constructor(e={}){this.logger=Jd.create("formatter"),this.options=e,this.init(e)}init(e,a={interpolation:{}}){this.formatSeparator=a.interpolation.formatSeparator||",";const r=a.cacheInBuiltFormats?KH:jme;this.formats={number:r((i,s)=>{const o=new Intl.NumberFormat(i,{...s});return l=>o.format(l)}),currency:r((i,s)=>{const o=new Intl.NumberFormat(i,{...s,style:"currency"});return l=>o.format(l)}),datetime:r((i,s)=>{const o=new Intl.DateTimeFormat(i,{...s});return l=>o.format(l)}),relativetime:r((i,s)=>{const o=new Intl.RelativeTimeFormat(i,{...s});return l=>o.format(l,s.range||"day")}),list:r((i,s)=>{const o=new Intl.ListFormat(i,{...s});return l=>o.format(l)})}}add(e,a){this.formats[e.toLowerCase().trim()]=a}addCached(e,a){this.formats[e.toLowerCase().trim()]=KH(a)}format(e,a,r,i={}){const s=a.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(l=>l.indexOf(")")>-1)){const l=s.findIndex(c=>c.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,l)].join(this.formatSeparator)}return s.reduce((l,c)=>{const{formatName:d,formatOptions:u}=Ame(c);if(this.formats[d]){let m=l;try{const p=i?.formatParams?.[i.interpolationkey]||{},f=p.locale||p.lng||i.locale||i.lng||r;m=this.formats[d](l,f,{...u,...i,...p})}catch(p){this.logger.warn(p)}return m}else this.logger.warn(`there was no format function for ${d}`);return l},e)}}const Eme=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class Dme extends _T{constructor(e,a,r,i={}){super(),this.backend=e,this.store=a,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=Jd.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,i.backend,i)}queueLoad(e,a,r,i){const s={},o={},l={},c={};return e.forEach(d=>{let u=!0;a.forEach(m=>{const p=`${d}|${m}`;!r.reload&&this.store.hasResourceBundle(d,m)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?o[p]===void 0&&(o[p]=!0):(this.state[p]=1,u=!1,o[p]===void 0&&(o[p]=!0),s[p]===void 0&&(s[p]=!0),c[m]===void 0&&(c[m]=!0)))}),u||(l[d]=!0)}),(Object.keys(s).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(e,a,r){const i=e.split("|"),s=i[0],o=i[1];a&&this.emit("failedLoading",s,o,a),!a&&r&&this.store.addResourceBundle(s,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=a?-1:2,a&&r&&(this.state[e]=0);const l={};this.queue.forEach(c=>{bme(c.loaded,[s],o),Eme(c,e),a&&c.errors.push(a),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(d=>{l[d]||(l[d]={});const u=c.loaded[d];u.length&&u.forEach(m=>{l[d][m]===void 0&&(l[d][m]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(c=>!c.done)}read(e,a,r,i=0,s=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:a,fcName:r,tried:i,wait:s,callback:o});return}this.readingCalls++;const l=(d,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const m=this.waitingReads.shift();this.read(m.lng,m.ns,m.fcName,m.tried,m.wait,m.callback)}if(d&&u&&i{this.read.call(this,e,a,r,i+1,s*2,o)},s);return}o(d,u)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const d=c(e,a);d&&typeof d.then=="function"?d.then(u=>l(null,u)).catch(l):l(null,d)}catch(d){l(d)}return}return c(e,a,l)}prepareLoading(e,a,r={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();qa(e)&&(e=this.languageUtils.toResolveHierarchy(e)),qa(a)&&(a=[a]);const s=this.queueLoad(e,a,r,i);if(!s.toLoad.length)return s.pending.length||i(),null;s.toLoad.forEach(o=>{this.loadOne(o)})}load(e,a,r){this.prepareLoading(e,a,{},r)}reload(e,a,r){this.prepareLoading(e,a,{reload:!0},r)}loadOne(e,a=""){const r=e.split("|"),i=r[0],s=r[1];this.read(i,s,"read",void 0,void 0,(o,l)=>{o&&this.logger.warn(`${a}loading namespace ${s} for language ${i} failed`,o),!o&&l&&this.logger.log(`${a}loaded namespace ${s} for language ${i}`,l),this.loaded(e,o,l)})}saveMissing(e,a,r,i,s,o={},l=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(a)){this.logger.warn(`did not save key "${r}" as the namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const c={...o,isUpdate:s},d=this.backend.create.bind(this.backend);if(d.length<6)try{let u;d.length===5?u=d(e,a,r,i,c):u=d(e,a,r,i),u&&typeof u.then=="function"?u.then(m=>l(null,m)).catch(l):l(null,u)}catch(u){l(u)}else d(e,a,r,i,l,c)}!e||!e[0]||this.store.addResource(e[0],a,r,i)}}}const QH=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),qa(t[1])&&(e.defaultValue=t[1]),qa(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const a=t[3]||t[2];Object.keys(a).forEach(r=>{e[r]=a[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),YH=t=>(qa(t.ns)&&(t.ns=[t.ns]),qa(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),qa(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t),A_=()=>{},Fme=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(a=>{typeof t[a]=="function"&&(t[a]=t[a].bind(t))})};class aw extends _T{constructor(e={},a){if(super(),this.options=YH(e),this.services={},this.logger=Jd,this.modules={external:[]},Fme(this),a&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,a),this;setTimeout(()=>{this.init(e,a)},0)}}init(e={},a){this.isInitializing=!0,typeof e=="function"&&(a=e,e={}),e.defaultNS==null&&e.ns&&(qa(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const r=QH();this.options={...r,...this.options,...YH(e)},this.options.interpolation={...r.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const i=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?Jd.init(i(this.modules.logger),this.options):Jd.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:d=Mme;const u=new $H(this.options);this.store=new qH(this.options.resources,this.options);const m=this.services;m.logger=Jd,m.resourceStore=this.store,m.languageUtils=u,m.pluralResolver=new Pme(u,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),d&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(m.formatter=i(d),m.formatter.init&&m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new Tme(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new Dme(i(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",(f,...g)=>{this.emit(f,...g)}),this.modules.languageDetector&&(m.languageDetector=i(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=i(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new eC(this.services,this.options),this.translator.on("*",(f,...g)=>{this.emit(f,...g)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,a||(a=A_),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=(...u)=>this.store[d](...u)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=(...u)=>(this.store[d](...u),this)});const l=r0(),c=()=>{const d=(u,m)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(m),a(u,m)};if(this.languages&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(e,a=A_){let r=a;const i=qa(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const s=[],o=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(d=>{d!=="cimode"&&s.indexOf(d)<0&&s.push(d)})};i?o(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>o(c)),this.options.preload?.forEach?.(l=>o(l)),this.services.backendConnector.load(s,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(l)})}else r(null)}reloadResources(e,a,r){const i=r0();return typeof e=="function"&&(r=e,e=void 0),typeof a=="function"&&(r=a,a=void 0),e||(e=this.languages),a||(a=this.options.ns),r||(r=A_),this.services.backendConnector.reload(e,a,s=>{i.resolve(),r(s)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&tZ.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let a=0;a-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,a){this.isLanguageChangingTo=e;const r=r0();this.emit("languageChanging",e);const i=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},s=(l,c)=>{c?this.isLanguageChangingTo===e&&(i(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,r.resolve((...d)=>this.t(...d)),a&&a(l,(...d)=>this.t(...d))},o=l=>{!e&&!l&&this.services.languageDetector&&(l=[]);const c=qa(l)?l:l&&l[0],d=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(qa(l)?[l]:l);d&&(this.language||i(d),this.translator.language||this.translator.changeLanguage(d),this.services.languageDetector?.cacheUserLanguage?.(d)),this.loadResources(d,u=>{s(u,d)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),r}getFixedT(e,a,r){const i=(s,o,...l)=>{let c;typeof o!="object"?c=this.options.overloadTranslationOptionHandler([s,o].concat(l)):c={...o},c.lng=c.lng||i.lng,c.lngs=c.lngs||i.lngs,c.ns=c.ns||i.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||i.keyPrefix);const d=this.options.keySeparator||".";let u;return c.keyPrefix&&Array.isArray(s)?u=s.map(m=>(typeof m=="function"&&(m=U3(m,{...this.options,...o})),`${c.keyPrefix}${d}${m}`)):(typeof s=="function"&&(s=U3(s,{...this.options,...o})),u=c.keyPrefix?`${c.keyPrefix}${d}${s}`:s),this.t(u,c)};return qa(e)?i.lng=e:i.lngs=e,i.ns=a,i.keyPrefix=r,i}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,a={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=a.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(l,c)=>{const d=this.services.backendConnector.state[`${l}|${c}`];return d===-1||d===0||d===2};if(a.precheck){const l=a.precheck(this,o);if(l!==void 0)return l}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!i||o(s,e)))}loadNamespaces(e,a){const r=r0();return this.options.ns?(qa(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),a&&a(i)}),r):(a&&a(),Promise.resolve())}loadLanguages(e,a){const r=r0();qa(e)&&(e=[e]);const i=this.options.preload||[],s=e.filter(o=>i.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return s.length?(this.options.preload=i.concat(s),this.loadResources(o=>{r.resolve(),a&&a(o)}),r):(a&&a(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const i=new Intl.Locale(e);if(i&&i.getTextInfo){const s=i.getTextInfo();if(s&&s.direction)return s.direction}}catch{}const a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new $H(QH());return e.toLowerCase().indexOf("-latn")>1?"ltr":a.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},a){const r=new aw(e,a);return r.createInstance=aw.createInstance,r}cloneInstance(e={},a=A_){const r=e.forkResourceStore;r&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},s=new aw(i);if((e.debug!==void 0||e.prefix!==void 0)&&(s.logger=s.logger.clone(e)),["store","services","language"].forEach(l=>{s[l]=this[l]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},r){const l=Object.keys(this.store.data).reduce((c,d)=>(c[d]={...this.store.data[d]},c[d]=Object.keys(c[d]).reduce((u,m)=>(u[m]={...c[d][m]},u),c[d]),c),{});s.store=new qH(l,i),s.services.resourceStore=s.store}return s.translator=new eC(s.services,i),s.translator.on("*",(l,...c)=>{s.emit(l,...c)}),s.init(i,a),s.translator.options=i,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ao=aw.createInstance();Ao.createInstance;Ao.dir;Ao.init;Ao.loadResources;Ao.reloadResources;Ao.use;Ao.changeLanguage;Ao.getFixedT;Ao.t;Ao.exists;Ao.setDefaultNamespace;Ao.hasLoadedNamespace;Ao.loadNamespaces;Ao.loadLanguages;const Lme=(t,e,a,r)=>{const i=[a,{code:e,...r||{}}];if(t?.services?.logger?.forward)return t.services.logger.forward(i,"warn","react-i18next::",!0);Eg(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),t?.services?.logger?.warn?t.services.logger.warn(...i):console?.warn&&console.warn(...i)},XH={},nZ=(t,e,a,r)=>{Eg(a)&&XH[a]||(Eg(a)&&(XH[a]=new Date),Lme(t,e,a,r))},rZ=(t,e)=>()=>{if(t.isInitialized)e();else{const a=()=>{setTimeout(()=>{t.off("initialized",a)},0),e()};t.on("initialized",a)}},B3=(t,e,a)=>{t.loadNamespaces(e,rZ(t,a))},ZH=(t,e,a,r)=>{if(Eg(a)&&(a=[a]),t.options.preload&&t.options.preload.indexOf(e)>-1)return B3(t,a,r);a.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,rZ(t,r))},Rme=(t,e,a={})=>!e.languages||!e.languages.length?(nZ(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:a.lng,precheck:(r,i)=>{if(a.bindI18n&&a.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,t))return!1}}),Eg=t=>typeof t=="string",Ime=t=>typeof t=="object"&&t!==null,Ome=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,zme={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Ume=t=>zme[t],Bme=t=>t.replace(Ome,Ume);let q3={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Bme,transDefaultProps:void 0};const qme=(t={})=>{q3={...q3,...t}},Hme=()=>q3;let iZ;const $me=t=>{iZ=t},Vme=()=>iZ,Gme={type:"3rdParty",init(t){qme(t.options.react),$me(t)}},Wme=y.createContext();class Kme{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(a=>{this.usedNamespaces[a]||(this.usedNamespaces[a]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var mE={exports:{}},pE={};var JH;function Qme(){if(JH)return pE;JH=1;var t=ob();function e(m,p){return m===p&&(m!==0||1/m===1/p)||m!==m&&p!==p}var a=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,o=t.useDebugValue;function l(m,p){var f=p(),g=r({inst:{value:f,getSnapshot:p}}),v=g[0].inst,b=g[1];return s(function(){v.value=f,v.getSnapshot=p,c(v)&&b({inst:v})},[m,f,p]),i(function(){return c(v)&&b({inst:v}),m(function(){c(v)&&b({inst:v})})},[m]),o(f),f}function c(m){var p=m.getSnapshot;m=m.value;try{var f=p();return!a(m,f)}catch{return!0}}function d(m,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return pE.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,pE}var e8;function sZ(){return e8||(e8=1,mE.exports=Qme()),mE.exports}var hO=sZ();const Yme=(t,e)=>Eg(e)?e:Ime(e)&&Eg(e.defaultValue)?e.defaultValue:Array.isArray(t)?t[t.length-1]:t,Xme={t:Yme,ready:!1},Zme=()=>()=>{},wt=(t,e={})=>{const{i18n:a}=e,{i18n:r,defaultNS:i}=y.useContext(Wme)||{},s=a||r||Vme();s&&!s.reportNamespaces&&(s.reportNamespaces=new Kme),s||nZ(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const o=y.useMemo(()=>({...Hme(),...s?.options?.react,...e}),[s,e]),{useSuspense:l,keyPrefix:c}=o,d=i||s?.options?.defaultNS,u=Eg(d)?[d]:d||["translation"],m=y.useMemo(()=>u,u);s?.reportNamespaces?.addUsedNamespaces?.(m);const p=y.useRef(0),f=y.useCallback(N=>{if(!s)return Zme;const{bindI18n:j,bindI18nStore:R}=o,O=()=>{p.current+=1,N()};return j&&s.on(j,O),R&&s.store.on(R,O),()=>{j&&j.split(" ").forEach(B=>s.off(B,O)),R&&R.split(" ").forEach(B=>s.store.off(B,O))}},[s,o]),g=y.useRef(),v=y.useCallback(()=>{if(!s)return Xme;const N=!!(s.isInitialized||s.initializedStoreOnce)&&m.every(Y=>Rme(Y,s,o)),j=e.lng||s.language,R=p.current,O=g.current;if(O&&O.ready===N&&O.lng===j&&O.keyPrefix===c&&O.revision===R)return O;const L={t:s.getFixedT(j,o.nsMode==="fallback"?m:m[0],c),ready:N,lng:j,keyPrefix:c,revision:R};return g.current=L,L},[s,m,c,o,e.lng]),[b,x]=y.useState(0),{t:S,ready:_}=hO.useSyncExternalStore(f,v,v);y.useEffect(()=>{if(s&&!_&&!l){const N=()=>x(j=>j+1);e.lng?ZH(s,e.lng,m,N):B3(s,m,N)}},[s,e.lng,m,_,l,b]);const C=s||{},P=y.useRef(null),T=y.useRef(),M=N=>{const j=Object.getOwnPropertyDescriptors(N);j.__original&&delete j.__original;const R=Object.create(Object.getPrototypeOf(N),j);if(!Object.prototype.hasOwnProperty.call(R,"__original"))try{Object.defineProperty(R,"__original",{value:N,writable:!1,enumerable:!1,configurable:!1})}catch{}return R},F=y.useMemo(()=>{const N=C,j=N?.language;let R=N;N&&(P.current&&P.current.__original===N?T.current!==j?(R=M(N),P.current=R,T.current=j):R=P.current:(R=M(N),P.current=R,T.current=j));const O=[S,R,_];return O.t=S,O.i18n=R,O.ready=_,O},[S,C,_,C.resolvedLanguage,C.language,C.languages]);if(s&&l&&!_)throw new Promise(N=>{const j=()=>N();e.lng?ZH(s,e.lng,m,j):B3(s,m,j)});return F},{slice:Jme,forEach:epe}=[];function tpe(t){return epe.call(Jme.call(arguments,1),e=>{if(e)for(const a in e)t[a]===void 0&&(t[a]=e[a])}),t}function ape(t){return typeof t!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(a=>a.test(t))}const t8=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,npe=function(t,e){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(e);let s=`${t}=${i}`;if(r.maxAge>0){const o=r.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(o)}`}if(r.domain){if(!t8.test(r.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${r.domain}`}if(r.path){if(!t8.test(r.path))throw new TypeError("option path is invalid");s+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(s+="; HttpOnly"),r.secure&&(s+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(s+="; Partitioned"),s},a8={create(t,e,a,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};a&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+a*60*1e3)),r&&(i.domain=r),document.cookie=npe(t,e,i)},read(t){const e=`${t}=`,a=document.cookie.split(";");for(let r=0;r-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const s=r.substring(1).split("&");for(let o=0;o0&&s[o].substring(0,l)===e&&(a=s[o].substring(l+1))}}return a}},spe={name:"hash",lookup(t){let{lookupHash:e,lookupFromHashIndex:a}=t,r;if(typeof window<"u"){const{hash:i}=window.location;if(i&&i.length>2){const s=i.substring(1);if(e){const o=s.split("&");for(let l=0;l0&&o[l].substring(0,c)===e&&(r=o[l].substring(c+1))}}if(r)return r;if(!r&&a>-1){const o=i.match(/\/([a-zA-Z-]*)/g);return Array.isArray(o)?o[typeof a=="number"?a:0]?.replace("/",""):void 0}}}return r}};let Zb=null;const n8=()=>{if(Zb!==null)return Zb;try{if(Zb=typeof window<"u"&&window.localStorage!==null,!Zb)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Zb=!1}return Zb};var ope={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&n8())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:a}=e;a&&n8()&&window.localStorage.setItem(a,t)}};let Jb=null;const r8=()=>{if(Jb!==null)return Jb;try{if(Jb=typeof window<"u"&&window.sessionStorage!==null,!Jb)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Jb=!1}return Jb};var lpe={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&r8())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:a}=e;a&&r8()&&window.sessionStorage.setItem(a,t)}},cpe={name:"navigator",lookup(t){const e=[];if(typeof navigator<"u"){const{languages:a,userLanguage:r,language:i}=navigator;if(a)for(let s=0;s0?e:void 0}},dpe={name:"htmlTag",lookup(t){let{htmlTag:e}=t,a;const r=e||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(a=r.getAttribute("lang")),a}},upe={name:"path",lookup(t){let{lookupFromPathIndex:e}=t;if(typeof window>"u")return;const a=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?a[typeof e=="number"?e:0]?.replace("/",""):void 0}},mpe={name:"subdomain",lookup(t){let{lookupFromSubdomainIndex:e}=t;const a=typeof e=="number"?e+1:1,r=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[a]}};let oZ=!1;try{document.cookie,oZ=!0}catch{}const lZ=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];oZ||lZ.splice(1,1);const ppe=()=>({order:lZ,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class cZ{constructor(e){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,a)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=tpe(a,this.options||{},ppe()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(rpe),this.addDetector(ipe),this.addDetector(ope),this.addDetector(lpe),this.addDetector(cpe),this.addDetector(dpe),this.addDetector(upe),this.addDetector(mpe),this.addDetector(spe)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,a=[];return e.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(a=a.concat(i))}}),a=a.filter(r=>r!=null&&!ape(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?a:a.length>0?a[0]:null}cacheUserLanguage(e){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;a&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||a.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}cZ.type="languageDetector";const hpe={nav:{printers:"Printers",archives:"Archives",queue:"Print Queue",stats:"Statistics",profiles:"Profiles",maintenance:"Maintenance",projects:"Projects",inventory:"Filament",files:"File Manager",makerworld:"MakerWorld",notifications:"Notifications",settings:"Settings",system:"System",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",update:"Update",updateAvailable:"Update available: v{{version}}",updateAvailableBanner:"Version {{version}} is available!",viewUpdate:"View update",viewOnGithub:"View on GitHub",keyboardShortcuts:"Keyboard shortcuts (?)",switchToLight:"Switch to light mode",switchToDark:"Switch to dark mode",switchToSystem:"Switch to system mode",smartSwitches:"Smart Switches",logout:"Logout",installApp:"Install app",installAppSuccess:"Bambuddy was installed"},common:{save:"Save",saving:"Saving...",cancel:"Cancel",delete:"Delete",edit:"Edit",add:"Add",close:"Close",confirm:"Confirm",loading:"Loading...",error:"Error",errorLoading:"Error loading data",retry:"Retry",success:"Success",warning:"Warning",enabled:"Enabled",disabled:"Disabled",yes:"Yes",no:"No",on:"On",off:"Off",all:"All",none:"None",search:"Search",filter:"Filter",sort:"Sort",refresh:"Refresh",download:"Download",upload:"Upload",uploading:"Uploading...",uploadFailed:"Upload failed",actions:"Actions",status:"Status",name:"Name",description:"Description",date:"Date",time:"Time",hours:"hours",minutes:"minutes",seconds:"seconds",days:"days",enable:"Enable",disable:"Disable",permissions:"Permissions",noPrinters:"No printers configured",noData:"No data available",linkNotFound:"Link not found",required:"Required",optional:"Optional",dismiss:"Dismiss",apply:"Apply",reset:"Reset",export:"Export",import:"Import",clear:"Clear",selectAll:"Select All",deselectAll:"Deselect All",noChange:"— No change —",unchanged:"Unchanged",unassigned:"Unassigned",unknown:"Unknown",unknownError:"Unknown error",today:"Today",tomorrow:"Tomorrow",asap:"ASAP",overdue:"Overdue",now:"Now",collapse:"Collapse",expand:"Expand",viewArchive:"View archive",viewInFileManager:"View in File Manager",addedBy:"Added by {{username}}",prints:"prints",more:"+{{count}} more",ascending:"Ascending",descending:"Descending",back:"Back",copy:"Copy",copied:"Copied!",printer:"Printer",remove:"Remove",type:"Type",print:"Print",rename:"Rename",move:"Move",create:"Create",duplicate:"Duplicate",left:"Left",right:"Right"},printers:{title:"Printers",addPrinter:"Add Printer",addPreflight:{checking:"Checking connection...",warning:"Some connection checks failed. This printer may show as offline. Review the checks below, fix what you can, or save anyway.",back:"Back",saveAnyway:"Save anyway"},editPrinter:"Edit Printer",deletePrinter:"Delete Printer",printerName:"Printer Name",serialNumber:"Serial Number",ipAddress:"IP Address / Hostname",accessCode:"Access Code",model:"Model",nozzleCount:"Nozzle Count",autoArchive:"Auto Archive",status:{available:"Available",idle:"Idle",printing:"Printing",paused:"Paused",offline:"Offline",problem:"Problem",error:"Error",finished:"Finished",unknown:"Unknown"},temperatures:{nozzle:"Nozzle",bed:"Bed",chamber:"Chamber"},progress:"{{percent}}% complete",timeRemaining:"{{time}} remaining",deleteConfirm:'Are you sure you want to delete "{{name}}"?',maintenanceOk:"Maintenance OK",maintenanceWarning:"{{count}} warning",maintenanceWarning_plural:"{{count}} warnings",maintenanceDue:"{{count}} due",maintenanceDue_plural:"{{count}} due",sort:{name:"Name",status:"Status",model:"Model",location:"Location",ascending:"Sort ascending",descending:"Sort descending"},cardSize:{small:"Small cards",medium:"Medium cards",large:"Large cards",extraLarge:"Extra large cards"},hideOffline:"Hide offline",nextAvailable:"Next available",powerOn:"Power On",offlinePrintersWithPlugs:"Offline printers with smart plugs",noPrintersConfigured:"No printers configured yet",search:"Search printers...",noSearchResults:"No printers match your search or filters",filter:{allStatuses:"All statuses",allLocations:"All locations"},toolbar:{filters:"Filters",view:"View",actions:"Actions"},readyToPrint:"Ready to print",external:"External",extL:"Ext-L",extR:"Ext-R",deleteArchives:"Delete print archives",noLabel:"No label",printPreview:"Print preview",width:"Width",height:"Height",noObjectsFound:"No objects found",objectsLoadedOnPrintStart:"Objects are loaded when a print starts",willBeSkipped:"Will be skipped",name:"Name",serialCannotBeChanged:"Serial number cannot be changed",locationHelp:"Used to group printers and filter queue jobs",wifiSignal:{veryWeak:"Very weak",weak:"Weak",fair:"Fair",good:"Good",excellent:"Excellent"},maintenanceUpToDate:"All maintenance up to date - Click to view",chamberLightOn:"Turn on chamber light",chamberLightOff:"Turn off chamber light",files:"Files",browseFiles:"Browse printer files",autoOffAfterPrint:"Auto power-off after print",autoOffExecuted:"Auto-off was executed - turn printer on to reset",hmsErrors:"HMS Errors",viewHmsErrors:"View {{count}} HMS error(s)",resume:"Resume",pause:"Pause",stop:"Stop",camera:"Camera",skipObject:"Skip Object",reconnect:"Reconnect",forceRefresh:"Force Refresh",forceRefreshSuccess:"Refresh requested",mqttDebug:"MQTT Debug",printerInformation:"Printer Information",copyToClipboard:"Copy",copied:"Copied!",state:"State",wifiSignalLabel:"WiFi Signal",developerMode:"Developer Mode",enabled:"Enabled",disabled:"Disabled",addedOn:"Added",sdCard:"SD Card",inserted:"Inserted",notInserted:"Not inserted",totalPrintHours:"Print Hours",activeNozzle:"Active: {{nozzle}} nozzle",nozzleRack:"Nozzle Rack",nozzleDocked:"Docked",nozzleMounted:"Mounted",nozzleActive:"Active",nozzleIdle:"Idle",nozzleDiameter:"Diameter",nozzleType:"Type",nozzleStatus:"Status",nozzleFilament:"Filament",nozzleWear:"Wear",nozzleMaxTemp:"Max Temp",nozzleSerial:"Serial",nozzleHardenedSteel:"Hardened Steel",nozzleStainlessSteel:"Stainless Steel",nozzleTungstenCarbide:"Tungsten Carbide",nozzleFlow:"Flow",nozzleHighFlow:"High Flow",nozzleStandardFlow:"Standard",firmwareUpdate:"Firmware Update",firmwareInstructions:"On the printer's touchscreen, go to",firmwareNav:"Navigate to",settings:"Settings",firmware:"Firmware",discoverPrinters:"Discover Printers",searching:"Searching...",manualEntry:"Manual Entry",addFromCloud:"Add from Cloud",toast:{printerDeleted:"Printer deleted",missingSpoolAssignment:"Print started on {{printer}}. Missing spool assignment for: {{slots}}",printerAdded:"Printer added",printerUpdated:"Printer updated",failedToDelete:"Failed to delete printer",failedToAdd:"Failed to add printer",connectionFailedNotAdded:"Could not connect to the printer. Verify the IP, serial number, and access code, and confirm LAN-only mode is on. The printer was not added.",failedToUpdate:"Failed to update printer",commandSent:"Command sent",failedToSendCommand:"Failed to send command",turnedOn:"{{name}} turned on",failedToPowerOn:"Failed to power on {{name}}",scriptTriggered:"Script triggered",printStopped:"Print stopped",printPaused:"Print paused",printResumed:"Print resumed",referenceDeleted:"Reference deleted",detectionAreaSaved:"Detection area saved",failedToRunScript:"Failed to run script",failedToStopPrint:"Failed to stop print",failedToPausePrint:"Failed to pause print",failedToResumePrint:"Failed to resume print",failedToControlChamberLight:"Failed to control chamber light",failedToSetSpeed:"Failed to set print speed",failedToUpdateSetting:"Failed to update setting",failedToSkipObjects:"Failed to skip objects",failedToRereadRfid:"Failed to re-read RFID",failedToCheckPlate:"Failed to check plate",failedToUpdateLabel:"Failed to update label",failedToDeleteReference:"Failed to delete reference",failedToSaveDetectionArea:"Failed to save detection area",plateCheckEnabled:"Plate check enabled",plateCheckDisabled:"Plate check disabled",calibrationSaved:"Calibration saved!",calibrationFailed:"Calibration failed",rfidRereadInitiated:"RFID re-read initiated",loadInitiated:"Loading filament…",unloadInitiated:"Unloading filament…",failedToLoad:"Failed to load filament",failedToUnload:"Failed to unload filament"},connection:{connected:"Connected",offline:"Offline"},plateStatus:{markCleared:"Mark plate as cleared",cleared:"Plate Clear",notCleared:"Plate not Clear",inUse:"Plate in Use"},queue:{inQueue:"{{count}} print in queue",inQueue_plural:"{{count}} prints in queue"},controls:"Controls",rfid:{reread:"Re-read RFID"},ams:{load:"Load",unload:"Unload"},bedJog:{title:"Move build plate",bed:"Bed",step:"Step (mm)",up:"Move plate up",down:"Move plate down",disabledWhilePrinting:"Disabled while printing",notHomedTitle:"Printer is not homed",notHomedMessage:"The printer has not been homed since the last print. Run auto-home first for safe positioning (parks the toolhead, then homes X, Y, and Z), or move anyway — soft endstops will be bypassed.",homeZ:"Auto Home",moveAnyway:"Move anyway",homingStarted:"Auto-homing printer…"},permission:{noAdd:"You do not have permission to add printers",noEdit:"You do not have permission to edit printers",noDelete:"You do not have permission to delete printers",noControl:"You do not have permission to control printers",noFiles:"You do not have permission to access printer files",noAmsRfid:"You do not have permission to re-read AMS RFID",noSmartPlugControl:"You do not have permission to control smart plugs",noCamera:"You do not have permission to view cameras"},modal:{addTitle:"Add Printer",editTitle:"Edit Printer",myPrinter:"My Printer",selectModel:"Select model...",locationGroup:"Location / Group (optional)",locationPlaceholder:"e.g., Workshop, Office, Basement",autoArchiveLabel:"Auto-archive completed prints",fromPrinterSettings:"From printer settings",modelOptional:"Model (optional)",saveChanges:"Save Changes"},skipObjects:{tooltip:"Skip objects",onlyWhilePrinting:"Skip objects (only while printing)",requiresMultiple:"Skip objects (requires 2+ objects)",title:"Skip Objects",matchIdsInfo:"Match IDs with your printer display",printerShowsIds:"The printer screen shows object IDs on the build plate",skipSelected:"Skip Selected",skipping:"Skipping...",noObjectsSelected:"No objects selected",selectObjectsToSkip:"Select objects you want to skip from the current print",skipped:"skipped",objectsSkipped:"Objects skipped",activeCount:"{{count}} active",waitForLayer:"Wait for layer 2+ to skip objects (currently layer {{layer}})",skip:"Skip",confirmTitle:"Skip Object?",confirmMessage:'Are you sure you want to skip "{{name}}"? This cannot be undone.'},confirm:{deleteTitle:"Delete Printer",deleteMessage:'Are you sure you want to delete "{{name}}"? This will remove all connection settings.',deleteArchivesNote:"All print history for this printer will be permanently deleted.",keepArchivesNote:"Print history will be kept but no longer associated with this printer.",stopTitle:"Stop Print",stopMessage:'Are you sure you want to stop the current print on "{{name}}"? This will cancel the print job.',stopButton:"Stop Print",pauseTitle:"Pause Print",pauseMessage:'Are you sure you want to pause the current print on "{{name}}"?',pauseButton:"Pause Print",resumeTitle:"Resume Print",resumeMessage:'Are you sure you want to resume the print on "{{name}}"?',resumeButton:"Resume Print",powerOnTitle:"Power On Printer",powerOnMessage:'Are you sure you want to turn ON the power for "{{name}}"?',powerOnButton:"Power On",powerOffTitle:"Power Off Printer",powerOffMessage:'Are you sure you want to turn OFF the power for "{{name}}"?',powerOffWarning:'WARNING: "{{name}}" is currently printing! Are you sure you want to turn OFF the power? This will interrupt the print and may damage the printer.',powerOffButton:"Power Off",haToggleTitle:'Toggle "{{name}}"',haToggleMessage:"Toggle the Home Assistant entity {{entity}}? This may turn power off if it is currently on.",haToggleWarning:'WARNING: "{{name}}" is currently printing! Toggling {{entity}} may cut power and interrupt the print. Continue?',haToggleButton:"Toggle"},bulk:{select:"Select",selectAll:"Select All",selectByLocation:"Select by Location",selected:"{{count}} selected",actions:{stop:"Stop",pause:"Pause",resume:"Resume",clearPlate:"Clear Bed",clearHMS:"Clear Notifications"},confirm:{stopTitle:"Stop {{count}} Prints",stopMessage:"This will cancel active prints on {{count}} printer(s). This action cannot be undone.",stopButton:"Stop All",pauseTitle:"Pause {{count}} Prints",pauseMessage:"This will pause active prints on {{count}} printer(s).",pauseButton:"Pause All",clearPlateTitle:"Clear {{count}} Print Beds",clearPlateMessage:"This will clear the print bed on {{count}} printer(s) and may trigger queued jobs.",clearPlateButton:"Clear All"},success:"{{action}} completed on {{count}} printer(s)",partial:"{{succeeded}} succeeded, {{failed}} failed",noneApplicable:"No selected printers are in the right state for this action",selectByState:"Select by State"},discovery:{title:"Discover Printers",searching:"Searching...",scanning:"Scanning...",scanProgress:"Scanning... {{scanned}}/{{total}}",foundPrinters:"Found {{count}} printer(s)",noPrintersFound:"No printers found",noPrintersFoundSubnet:"No printers found in the specified subnet.",noPrintersFoundNetwork:"No printers found on the network.",allConfigured:"All discovered printers are already configured.",alreadyAdded:"Already added",select:"Select",manualEntry:"Manual Entry",addFromCloud:"Add from Cloud",subnetToScan:"Subnet to scan",dockerNote:"Docker detected. Enter your printer's subnet in CIDR notation. Requires network_mode: host in docker-compose.yml.",scanSubnet:"Scan Subnet for Printers",discoverNetwork:"Discover Printers on Network",scanningSubnet:"Scanning subnet for Bambu printers...",scanningNetwork:"Scanning network...",serialRequired:"Serial required",unknown:"Unknown",failedToStart:"Failed to start discovery"},drying:{start:"Start Drying",stop:"Stop Drying",temperature:"Temperature",duration:"Duration",hours:"hours",timeRemaining:"{{time}} left",active:"Drying",notSupported:"Drying not supported",powerRequired:"Connect AMS power adapter to enable drying",startingDrying:"Starting drying...",stoppingDrying:"Stopping drying...",rotateTray:"Rotate spool during drying"},filaments:"Filaments",openCameraOverlay:"Open camera overlay",openCameraWindow:"Open camera in new window",firmwareUpdateAvailable:"Firmware update available: {{current}} → {{latest}}",firmwareUpToDate:"Firmware {{version}} — Up to date",firmwareUpdateButton:"Update",plateDetection:{noPermission:"You do not have permission to update printers",enabledClick:"Plate check enabled - Click to disable",disabledClick:"Plate check disabled - Click to enable",manageCalibration:"Manage plate detection calibration",calibrationRequired:"Calibration Required",calibrationInstructions:"Please ensure the build plate is completely empty, then click Calibrate.",calibrationDescription:"Calibration captures a reference image of the empty plate. Future checks will compare against this reference to detect objects.",calibrationTip:"Tip: You can store up to 5 calibrations for different plates. The system automatically uses the best match when checking.",plateEmpty:"Plate appears empty",objectsDetected:"Objects detected on plate",confidence:"Confidence",difference:"Difference",analysisPreview:"Analysis preview:",analysisLegend:"Green box = detection area, Red overlay = differences from calibration",savedReferences:"Saved References ({{count}}/{{max}})",deleteReference:"Delete reference",labelPlaceholder:"Label...",clickToEdit:"{{label}} - Click to edit",clickToAddLabel:"Click to add label"},speed:{title:"Print Speed",silent:"Silent (50%)",standard:"Standard (100%)",sport:"Sport (124%)",ludicrous:"Ludicrous (166%)"},airduct:{title:"Airduct Mode",cooling:"Cooling",heating:"Heating"},noSdCard:"No SD",door:{open:"Open",closed:"Closed"},fans:{partCooling:"Part Cooling Fan",auxiliary:"Auxiliary Fan",chamber:"Chamber Fan"},clickToViewHmsErrors:"Click to view HMS errors",estimatedCompletion:"Estimated completion time",plateNumber:"Plate {{number}}",slotOptions:"Slot options",amsPopup:{friendlyName:"AMS Name",friendlyNamePlaceholder:"e.g. AMS Friendly Name",serialNumber:"Serial Number",firmwareVersion:"Firmware",save:"Save",clear:"Clear",noEditPermission:"You do not have permission to rename AMS units"},firmwareModal:{title:"Firmware Update",titleUpToDate:"Firmware Info",currentVersion:"Current:",latestVersion:"Latest:",releaseNotes:"Release Notes",checkingPrereqs:"Checking prerequisites...",sdCardReady:"SD card ready. Click below to upload firmware.",uploadedSuccess:"Firmware uploaded to SD card!",applyInstructions:"To apply the update on your printer:",step1:"On the printer's touchscreen, go to Settings",step2:"Navigate to Firmware",step3:"Select Update from SD card",step4:"The update will take 10-20 minutes",done:"Done",starting:"Starting...",uploadFirmware:"Upload Firmware",uploadFailed:"Failed to start upload: {{error}}",uploadedToast:"Firmware uploaded! Trigger update from printer screen.",availableVersions:"Available versions",usable:"Usable",unavailable:"Unavailable",installed:"Installed",newerBadge:"newer",olderBadge:"older",currentBadge:"current"},accessCodePlaceholder:"Leave empty to keep current",roi:{title:"Detection Area (ROI)",xStart:"X Start",yStart:"Y Start",width:"Width",height:"Height",instruction:"Adjust the detection area to focus on the build plate. The green box in the preview shows the current area."},developerModeWarning:"Developer LAN mode is not enabled on: {{names}}. Some features may not work.",howToEnable:"How to enable",incompatibleFile:"This file was sliced for {{slicedFor}}, but this printer is a {{printerModel}}",dropNotPrintable:"Only .gcode and .gcode.3mf files can be printed",dropToPrint:"Drop to print",cannotPrint:"Printer busy"},archives:{title:"Print Archives",searchPlaceholder:"Search archives...",filterByPrinter:"Filter by printer",filterByStatus:"Filter by status",sortBy:"Sort by",sortNewest:"Newest first",sortOldest:"Oldest first",sortName:"Name",sortDuration:"Duration",sortLargest:"Largest first",sortSmallest:"Smallest first",sortSize:"Size",noArchives:"No archives found",noArchivesSearch:"No archives match your search",originalPrintNotVisible:"Original print not visible - try clearing filters",noArchivesYet:"No archives yet",prints:"prints",pagination:{showing:"Showing",to:"to",of:"of",show:"Show",page:"Page",all:"All"},loadingArchives:"Loading archives...",releaseToUpload:"Release to upload",showAll:"Show all",showFavoritesOnly:"Show favorites only",gridView:"Grid view",listView:"List view",calendarView:"Calendar view",logView:"Print Log",manageTags:"Manage Tags",showFailedPrints:"Show failed prints",hideFailedPrints:"Hide failed prints",hideDuplicates:"Hide Duplicates",viewOriginalPrint:"Click to view original print (#{{id}})",printTime:"Print Time",filamentUsed:"Filament Used",cost:"Cost",reprint:"Reprint",preview:"Preview",deleteArchive:"Delete Archive",deleteConfirm:"Are you sure you want to delete this archive?",favorite:"Favorite",unfavorite:"Remove from favorites",viewDetails:"View Details",status:{completed:"Completed",failed:"Failed",stopped:"Stopped"},toast:{source3mfAttached:"Source 3MF attached: {{filename}}",failedUploadSource3mf:"Failed to upload source 3MF",source3mfRemoved:"Source 3MF removed",failedRemoveSource3mf:"Failed to remove source 3MF",f3dAttached:"F3D attached: {{filename}}",failedUploadF3d:"Failed to upload F3D",f3dRemoved:"F3D removed",failedRemoveF3d:"Failed to remove F3D",timelapseAttached:"Timelapse attached: {{filename}}",timelapseAlreadyAttached:"Timelapse already attached",noMatchingTimelapse:"No matching timelapse found",failedScanTimelapse:"Failed to scan for timelapse",failedAttachTimelapse:"Failed to attach timelapse",timelapseRemoved:"Timelapse removed",failedRemoveTimelapse:"Failed to remove timelapse",timelapseUploaded:"Timelapse uploaded: {{filename}}",failedUploadTimelapse:"Failed to upload timelapse",archiveDeleted:"Archive deleted",failedDeleteArchive:"Failed to delete archive",addedToFavorites:"Added to favorites",removedFromFavorites:"Removed from favorites",projectUpdated:"Project updated",failedUpdateProject:"Failed to update project",linkCopied:"Link copied to clipboard",failedCopyLink:"Failed to copy link",photoDeleted:"Photo deleted",failedDeletePhoto:"Failed to delete photo",failedDeleteArchives:"Failed to delete archives",failedUpdateFavorites:"Failed to update favorites",exportDownloaded:"Export downloaded",exportFailed:"Export failed"},menu:{print:"Print",schedule:"Schedule",openInBambuStudio:"Open in Slicer",slice:"Slice",externalLink:"External Link",viewOnMakerWorld:"View on MakerWorld",preview3d:"3D Preview",viewTimelapse:"View Timelapse",scanForTimelapse:"Scan for Timelapse",uploadTimelapse:"Upload Timelapse",removeTimelapse:"Remove Timelapse",downloadSource3mf:"Download Source 3MF",uploadSource3mf:"Upload Source 3MF",replaceSource3mf:"Replace Source 3MF",removeSource3mf:"Remove Source 3MF",uploadF3d:"Upload F3D",replaceF3d:"Replace F3D",downloadF3d:"Download F3D",removeF3d:"Remove F3D",download:"Download",copyDownloadLink:"Copy Download Link",qrCode:"QR Code",viewPhotos:"View Photos",viewPhotosCount:"View Photos ({{count}})",projectPage:"Project Page",addToFavorites:"Add to Favorites",removeFromFavorites:"Remove from Favorites",edit:"Edit",printLog:"Print Log",goToProject:"Go to Project: {{name}}",addToProject:"Add to Project",removeFromProject:"Remove from Project",loading:"Loading...",noProjectsAvailable:"No projects available",searchProjects:"Search projects…",select:"Select",deselect:"Deselect",delete:"Delete"},permission:{noReprint:"You do not have permission to reprint this archive",noAddToQueue:"You do not have permission to add to queue",noUpdateArchives:"You do not have permission to update archives",noUploadFiles:"You do not have permission to upload files",noDownload:"You do not have permission to download archives",noCopyLink:"You do not have permission to copy download links",noDelete:"You do not have permission to delete this archive",noCreate:"You do not have permission to create archives"},platePicker:{title:"Select plate to preview",hint:"This archive has multiple plates. Pick one to open in the GCode viewer.",plateLabel:"Plate {{index}}",objectCount:"{{count}} object",objectCount_plural:"{{count}} objects",noGcode:"This archive has no sliced G-code to preview. Open it in Bambu Studio to slice first."},card:{previousPlate:"Previous plate",nextPlate:"Next plate",plateNumber:"Plate {{index}}",moreOptions:"Right-click for more options",addToFavorites:"Add to favorites",removeFromFavorites:"Remove from favorites",cancelled:"cancelled",failed:"failed",duplicate:"duplicate",duplicateTitle:"This model has been printed before",openSource3mf:"Open source 3MF in Bambu Studio (right-click for more options)",downloadF3d:"Download Fusion 360 design file",viewTimelapse:"View timelapse",viewPhoto:"View 1 photo",viewPhotos:"View {{count}} photos",openFolder:"Open folder: {{name}}",slicedFile:"Sliced file - ready to print",sourceFile:"Source file only - no AMS mapping available",gcode:"GCODE",source:"SOURCE",project:"Project: {{name}}",runsBadge:"{{count}} prints",runsBadgeTitle:"{{count}} prints total — {{successful}} successful, {{failed}} failed. Click to see the full print log.",estimated:"Estimated: {{time}}",actual:"Actual: {{time}}",accuracy:"Accuracy: {{percent}}%",filament:"{{weight}}g",layer:"{{count}} layer",layers:"{{count}} layers",object:"{{count}} object",objects:"{{count}} objects",slicedFor:"Sliced for {{model}}",uploadedBy:"Uploaded By",noPermissionReprint:"You do not have permission to reprint",noFileForReprint:"No 3MF file available — the file could not be downloaded from the printer when the print was recorded",noPermissionEdit:"You do not have permission to edit archives",noPermissionDelete:"You do not have permission to delete archives",reprint:"Reprint",schedulePrint:"Schedule Print",schedule:"Schedule",openInBambuStudio:"Open in Slicer",openInBambuStudioToSlice:"Open in Slicer to slice",slice:"Slice",externalLink:"External Link",makerWorld:"MakerWorld: {{designer}}",viewProject:"View project",noExternalLink:"No external link",preview3d:"3D Preview",download:"Download",edit:"Edit",delete:"Delete"},runLog:{title:"Print Log",modalTitle:"Print Log — {{name}}",modalTitleFallback:"this archive",empty:"No print events recorded for this archive yet.",col:{date:"Date",status:"Status",duration:"Duration",filament:"Filament",cost:"Cost"},status:{completed:"Completed",failed:"Failed",cancelled:"Cancelled",stopped:"Stopped",skipped:"Skipped",printing:"Printing"}},modal:{deleteArchive:"Delete Archive",deleteConfirm:'Are you sure you want to delete "{{name}}"? This action cannot be undone.',deleteButton:"Delete",deletePurgeStats:"Also remove this print from Quick Stats (filament, time, cost, energy)",removeSource3mf:"Remove Source 3MF",removeSource3mfConfirm:'Are you sure you want to remove the source 3MF file from "{{name}}"? This will delete the original slicer project file.',removeButton:"Remove",removeF3d:"Remove F3D",removeF3dConfirm:'Are you sure you want to remove the Fusion 360 design file from "{{name}}"?',removeTimelapse:"Remove Timelapse",removeTimelapseConfirm:'Are you sure you want to remove the timelapse video from "{{name}}"?',timelapse:"{{name}} - Timelapse",selectTimelapse:"Select Timelapse",selectTimelapseDesc:"No auto-match found. Select the timelapse for this print:",deleteArchives:"Delete Archives",deleteArchivesConfirm:"Are you sure you want to delete {{count}} archive(s)? This action cannot be undone.",deleteCount:"Delete {{count}}"},page:{title:"Archives",printsCount:"{{filtered}} of {{total}} prints",dropFilesHere:"Drop .3mf files here",releaseToUpload:"Release to upload",only3mfSupported:"Only .3mf files are supported",close:"Close",selected:"{{count}} selected",selectAll:"Select All",tags:"Tags",project:"Project",favorite:"Favorite",delete:"Delete",toggledFavorites:"Toggled favorites for {{count}} archive(s)",failedUpdateFavorites:"Failed to update favorites",archivesDeleted:"{{count}} archive(s) deleted",failedDeleteArchives:"Failed to delete archives",photoDeleted:"Photo deleted",failedDeletePhoto:"Failed to delete photo"},list:{name:"Name",printer:"Printer",date:"Date",size:"Size",actions:"Actions",hasTimelapse:"Has timelapse"},log:{date:"Date",printName:"Print Name",printer:"Printer",user:"User",status:"Status",duration:"Duration",filament:"Filament",allPrinters:"All Printers",allUsers:"All Users",allStatuses:"All Statuses",cancelled:"Cancelled",skipped:"Skipped",dateFrom:"From",dateTo:"To",noEntries:"No print log entries found",showing:"Showing {{count}} of {{total}} entries",rowsPerPage:"Rows",page:"Page",prev:"Prev",next:"Next",clearLog:"Clear Log",clearLogTitle:"Clear Print Log",clearLogConfirm:"All print log entries will be permanently deleted. Archives and queue items are not affected. This action cannot be undone. Are you sure?",clearLogButton:"Clear All",cleared:"{{count}} log entries cleared",clearFailed:"Failed to clear print log"}},queue:{title:"Print Queue",subtitle:"Schedule and manage your print jobs",addToQueue:"Add to Queue",filamentShort:{rowBadge:"Insufficient filament for the assigned spool",rowTooltip:"The dispatch scheduler flagged this item. Click Play to see the per-slot deficit and decide whether to print anyway.",confirmTitle:"Insufficient filament",confirmIntro:"The assigned spool cannot satisfy at least one slot. Print anyway?",lineItem:"Slot {{slot}}: needs {{required}} g, {{remaining}} g remaining",unknown:"unknown",printAnyway:"Print Anyway"},print:"Print",reprint:"Re-print",schedulePrint:"Schedule Print",editQueueItem:"Edit Queue Item",printToPrinters:"Print to {{count}} Printers",queueToPrinters:"Queue to {{count}} Printers",queueSelectedPlates:"Queue {{count}} Plates",selectAllPlates:"Select All {{count}} Plates",deselectAll:"Deselect All",printQueued:"Print queued",itemsQueued:"{{count}} items queued",sending:"Sending...",sendingProgress:"Sending {{current}}/{{total}}...",adding:"Adding...",addingProgress:"Adding {{current}}/{{total}}...",savingProgress:"Saving {{current}}/{{total}}...",clearQueue:"Clear Queue",clearHistory:"Clear History",emptyQueue:"Queue is empty",position:"Position",scheduledTime:"Scheduled Time",moveUp:"Move Up",moveDown:"Move Down",startNow:"Start Now",printingInProgress:"Printing in progress...",viewArchive:"View archive",viewInFileManager:"View in File Manager",itemCount:"{{count}} item",itemCount_plural:"{{count}} items",dragToReorder:"Drag to reorder (ASAP only)",reorderHint:"Position only affects ASAP items. Scheduled items run at their set time.",sjf:{label:"SJF",tooltip:"Shortest Job First — scheduler prioritizes shorter prints"},addedBy:"Added by {{name}}",nextInQueue:"Next in queue",clearPlateSuccess:"Plate cleared — ready for next print",plateNumber:"Plate {{index}}",quantity:"Quantity",quantityHint:"Creates {{count}} queue items",activeBatches:"Active Batches",batchProgress:"{{completed}} of {{total}} completed",cancelBatch:"Cancel Remaining",batchCancelled:"Remaining batch items cancelled",cancelBatchConfirmTitle:"Cancel Batch",cancelBatchConfirmMessage:"Cancel all remaining pending items in this batch?",batch:"Batch",sections:{currentlyPrinting:"Currently Printing",queued:"Queued",history:"History"},status:{pending:"Pending",waiting:"Waiting",printing:"Printing",paused:"Paused",completed:"Completed",failed:"Failed",skipped:"Skipped",cancelled:"Cancelled"},summary:{printing:"Printing",queued:"Queued",totalTime:"Total Queue Time",totalWeight:"Total Queue Weight",history:"History"},filter:{allPrinters:"All Printers",unassigned:"Unassigned",allStatus:"All Status",allLocations:"All Locations",any:"Any"},sort:{byPosition:"Sort by Position",byName:"Sort by Name",byPrinter:"Sort by Printer",bySchedule:"Sort by Schedule",byDate:"Sort by Date",ascendingOldest:"Ascending (oldest first)",descendingNewest:"Descending (newest first)"},badges:{staged:"Staged",requiresPrevious:"Requires previous success",autoPowerOff:"Auto power off",gcodeInjection:"G-code"},empty:{title:"No prints scheduled",description:'Schedule a print from the Archives page using the "Schedule" option in the context menu, or drag and drop files to get started.'},time:{asap:"ASAP",overdue:"Overdue",now:"Now",lessThanMinute:"In less than a minute",inMinutes:"In {{count}} min",inHours:"In {{count}} hours"},actions:{stopPrint:"Stop Print",startPrint:"Start Print",requeue:"Re-queue"},bulkEdit:{title:"Edit {{count}} Item",title_plural:"Edit {{count}} Items",description:"Only changed settings will be applied to selected items.",printer:"Printer",noChange:"— No change —",queueOptions:"Queue Options",staged:"Staged (manual start)",autoPowerOff:"Auto power off after print",requirePrevious:"Require previous success",printOptions:"Print Options",bedLevelling:"Bed levelling",flowCalibration:"Flow calibration",vibrationCalibration:"Vibration calibration",layerInspection:"First layer inspection",timelapse:"Timelapse",useAms:"Use AMS",applyChanges:"Apply Changes",selectAll:"Select All",deselectAll:"Deselect All",selected:"{{count}} selected",editSelected:"Edit Selected",cancelSelected:"Cancel Selected"},confirm:{cancelTitle:"Cancel Scheduled Print",cancelMessage:'Are you sure you want to cancel "{{name}}"?',stopTitle:"Stop Print",stopMessage:'Are you sure you want to stop the current print "{{name}}"? This will cancel the print job on the printer.',removeTitle:"Remove from History",removeMessage:'Are you sure you want to remove "{{name}}" from the queue history?',clearHistoryTitle:"Clear History",clearHistoryMessage:"Are you sure you want to remove all {{count}} item(s) from the history?",cancelButton:"Cancel Print",stopButton:"Stop Print",thisPrint:"this print",thisItem:"this item"},toast:{cancelled:"Queue item cancelled",cancelFailed:"Failed to cancel item",removed:"Queue item removed",removeFailed:"Failed to remove item",stopped:"Print stopped",stopFailed:"Failed to stop print",released:"Print released to queue",startFailed:"Failed to start print",reorderFailed:"Failed to reorder queue",historyCleared:"Cleared {{count}} history item(s)",clearHistoryFailed:"Failed to clear history",updateFailed:"Failed to update items",bulkCancelled:"Cancelled {{count}} item(s)",bulkCancelFailed:"Failed to cancel items"},timeline:{listView:"List",timelineView:"Timeline",unassigned:"Unassigned",noData:"No scheduled prints for this day",allDoneBy:"All prints estimated done by {{time}}",staged:"Staged",filterAll:"Show All",filterPrinting:"Printing",filterQueued:"Queued",time:{anyMoment:"any moment",minutesLeft:"{{minutes}}m left",hoursLeft:"{{hours}}h left",hoursMinutesLeft:"{{hours}}h {{minutes}}m left"},day:{previous:"Previous day",next:"Next day",today:"Today"}},permissions:{noStopPrint:"You do not have permission to stop prints",noStartPrint:"You do not have permission to start prints",noEdit:"You do not have permission to edit this queue item",noCancel:"You do not have permission to cancel this queue item",noRequeue:"You do not have permission to re-queue items",noRemove:"You do not have permission to remove this queue item",noClearHistory:"You do not have permission to clear all history",noEditItems:"You do not have permission to edit queue items",noCancelItems:"You do not have permission to cancel queue items"}},backgroundDispatch:{unknownFile:"Unknown file",unknownPrinter:"Unknown printer",startingPrints:"Starting prints",progressSummary:"{{complete}}/{{total}} complete • Dispatched: {{dispatched}} • Processing: {{processing}}",expandDetails:"Expand dispatch details",collapseDetails:"Collapse dispatch details",dismissToast:"Dismiss dispatch toast",cancelDispatchJob:"Cancel dispatch job",cancel:"Cancel",cancelling:"Cancelling…",awaitingPrinter:"Awaiting printer…",status:{dispatched:"Dispatched",processing:"Processing",completed:"Completed",failed:"Failed",cancelled:"Cancelled"},toast:{cancellingUpload:"Cancelling upload...",cancelled:"Dispatch cancelled",cancelFailed:"Failed to cancel dispatch",completeWithFailures:"Background dispatch complete: {{completed}} succeeded, {{failed}} failed",completeSuccess:"Background dispatch complete: {{completed}} succeeded",printStartedRemaining:"{{completed}} print(s) started, {{remaining}} more sending..."}},stats:{title:"Statistics",subtitle:"Drag widgets to rearrange. Click the eye icon to hide.",overview:"Overview",totalPrints:"Total Prints",successRate:"Success Rate",totalPrintTime:"Total Print Time",printTime:"Print Time",totalFilament:"Total Filament Used",filamentUsed:"Filament Used",filamentCost:"Filament Cost",totalCost:"Total Cost",energyUsed:"Energy Used",energyCost:"Energy Cost",energyWarmingUpTooltip:"Energy tracking is still collecting hourly snapshots. Date-range totals will become accurate once at least one snapshot exists before the selected range. Early values may undercount.",averagePrintTime:"Average Print Time",printsPerDay:"Prints per Day",byPrinter:"By Printer",printsByPrinter:"Prints by Printer",byMaterial:"By Material",byMonth:"By Month",last7Days:"Last 7 Days",last30Days:"Last 30 Days",last90Days:"Last 90 Days",allTime:"All Time",quickStats:"Quick Stats",printActivity:"Print Activity",filamentTypes:"Filament Types",filamentTrends:"Filament Trends",failureAnalysis:"Failure Analysis",timeAccuracy:"Time Accuracy",successful:"Successful:",failed:"Failed:",cancelled:"Cancelled:",perfectEstimate:"100% = perfect estimate",noTimeAccuracyData:"No time accuracy data yet",noFilamentData:"No filament data available",noPrinterData:"No printer data available",noPrintData:"No print data available",noPrintDataLast30Days:"No print data in the last 30 days",failureReasons:"Failure Reasons",topFailureReasons:"Top Failure Reasons",failedPrintsCount:"{{failed}} / {{total}} prints failed",lastWeekRate:"Last week: {{rate}}%",resetLayout:"Reset Layout",recalculateCosts:"Recalculate Costs",recalculateCostsHint:"Recalculate all archive costs using current filament prices",exportStats:"Export Stats",exportAsCsv:"Export as CSV",exportAsExcel:"Export as Excel",hiddenCount:"{{count}} Hidden",exportDownloaded:"Export downloaded",exportFailed:"Export failed",layoutReset:"Layout reset",recalculatedCosts:"Recalculated costs for {{count}} archives",recalculateFailed:"Failed to recalculate costs",loadingStats:"Loading statistics...",noPermissionResetLayout:"You do not have permission to reset layout",noPermissionRecalculate:"You do not have permission to recalculate costs",noPrintDataInRange:"No print data in selected range",periodFilament:"Period Filament",periodCost:"Period Cost",avgPerPrint:"Avg per Print",usageOverTime:"Usage Over Time",filamentByWeight:"Weight",printDuration:"Print Duration",printerUtilization:"Printer Utilization",filamentSuccess:"Success by Material",printHabits:"Print Habits",printTimeOfDay:"Print Time of Day",colorDistribution:"Color Distribution",noColorData:"No color data available",records:"Records",longestPrint:"Longest Print",heaviestPrint:"Heaviest Print",mostExpensivePrint:"Most Expensive",busiestDay:"Busiest Day",successStreak:"Success Streak",streakPrint:"consecutive print",streakPrints:"{{count}} consecutive prints",printerStats:"Printer Stats",hours:"hours",avgPrints:"Avg. prints",noArchiveData:"No print data available",filamentByTime:"Time",avgWeight:"Avg. weight",avgTime:"Avg. time",filamentByPrints:"Prints",timeframe:{today:"Today","this-week":"This Week","this-month":"This Month","last-7":"Last 7 Days","last-30":"Last 30 Days","last-90":"Last 90 Days","this-year":"This Year","all-time":"All Time",custom:"Custom Range",from:"From",to:"To"},allUsers:"All Users",noUser:"No User (System)",filterByUser:"Filter by User"},maintenance:{title:"Maintenance",overview:"Overview",allOk:"All maintenance up to date",dueCount:"{{count}} item due",dueCount_plural:"{{count}} items due",warningCount:"{{count}} warning",warningCount_plural:"{{count}} warnings",totalPrintTime:"Total Print Time",nextMaintenance:"Next Maintenance",nothingDue:"Nothing due",tasks:"Tasks",lastPerformed:"Last performed",interval:"Interval",hoursRemaining:"{{hours}}h remaining",hoursOverdue:"{{hours}}h overdue",markDone:"Mark as Done",performMaintenance:"Perform Maintenance",history:"History",noHistory:"No maintenance history",editPrintHours:"Edit Print Hours",currentHours:"Current Hours",statusTab:"Status",settingsTab:"Settings",overdueCount:"{{count}} overdue",dueSoonCount:"{{count}} due soon",dueSoon:"Due soon",allGood:"All good",overdueBy:"Overdue by {{duration}}",dueIn:"Due in {{duration}}",timeLeft:"{{duration}} left",day:"1 day",days:"{{count}} days",week:"1 week",weeks:"{{count}} weeks",month:"1 month",months:"{{count}} months",year:"1 year",maintenanceTypes:"Maintenance Types",maintenanceTypesDescription:"System types and your custom maintenance tasks",addCustomType:"Add Custom Type",restoreDefaults:"Restore Default Tasks",intervalType:"Interval Type",intervalValue:"Interval ({{type}})",icon:"Icon",documentationLink:"Documentation Link (optional)",assignToPrinters:"Assign to Printers",selectAtLeastOnePrinter:"Select at least one printer",addType:"Add Type",custom:"Custom",printHours:"Print Hours",calendarDays:"Calendar Days",exampleName:"e.g., Replace HEPA Filter",viewDocumentation:"View documentation",timeBasedInterval:"Time-based interval",intervalOverrides:"Interval Overrides",intervalOverridesDescription:"Customize intervals for specific printers",assignedToPrinters:"Assigned to printers:",noPrintersAssigned:"No printers assigned",addPrinterShort:"Add:",printersAssignedClick:"{{count}} printer(s) assigned - click to manage",removeFromPrinter:"Remove from this printer",types:{lubricateCarbonRods:"Lubricate Carbon Rods",lubricateRails:"Lubricate Linear Rails",cleanNozzle:"Clean Nozzle/Hotend",checkBelts:"Check Belt Tension",cleanBuildPlate:"Clean Build Plate",checkExtruder:"Check Extruder Gears",checkCooling:"Check Cooling Fans",generalInspection:"General Inspection",cleanCarbonRods:"Clean Carbon Rods",lubricateSteelRods:"Lubricate Steel Rods",cleanSteelRods:"Clean Steel Rods",cleanLinearRails:"Clean Linear Rails",checkPtfeTube:"Check PTFE Tube",replaceHepaFilter:"Replace HEPA Filter",replaceCarbonFilter:"Replace Carbon Filter",lubricateLeftNozzleRail:"Lubricate Left Nozzle Rail"},maintenanceComplete:"Maintenance marked as complete",typeUpdated:"Maintenance type updated",typeDeleted:"Maintenance type deleted",defaultsRestored:"Restored {{count}} default task(s)",printHoursUpdated:"Print hours updated",printerAssigned:"Printer assigned",printerRemoved:"Printer removed",deleteTypeConfirm:'Delete "{{name}}"?',deleteSystemTypeTitle:"Delete default maintenance task?",deleteSystemTypeMessage:'Are you sure you want to delete the default maintenance task "{{name}}"?',noPermissionUpdate:"You do not have permission to update maintenance items",noPermissionPerform:"You do not have permission to perform maintenance",noPermissionEditTypes:"You do not have permission to edit maintenance types",noPermissionDeleteTypes:"You do not have permission to delete maintenance types",noPermissionEditHours:"You do not have permission to edit print hours",noPermissionRemovePrinter:"You do not have permission to remove printer assignments",noPermissionAssignPrinter:"You do not have permission to assign printers",noPermissionEditIntervals:"You do not have permission to edit intervals",configureSettings:"Configure maintenance types and intervals"},settings:{title:"Settings",general:"General",tabs:{general:"General",smartPlugs:"Smart Plugs",notifications:"Notifications",queue:"Workflow",filament:"Filament",network:"Network",apiKeys:"API Keys",virtualPrinter:"Virtual Printer",spoolbuddy:"SpoolBuddy",failureDetection:"Failure Detection",users:"Authentication",backup:"Backup",emailAuth:"Email Authentication",ldap:"LDAP",twoFa:"Two-Factor Auth",oidc:"SSO / OIDC",security:"Security"},spoolbuddy:{infoTitle:"SpoolBuddy devices",infoBody:"SpoolBuddy kiosks register themselves automatically via heartbeat. Unregister a device here if it is no longer in use or if a stale duplicate was left behind by a daemon crash.",duplicatesTitle:"{{count}} devices registered",duplicatesBody:"Only the first registered device is used by the kiosk UI. If one of these is a stale duplicate from a crash, unregister it — an online device will re-register itself on its next heartbeat.",empty:"No SpoolBuddy devices registered yet.",online:"Online",offline:"Offline",unregister:"Unregister",unregisterSuccess:"Device unregistered",unregisterError:"Failed to unregister device",confirmTitle:"Unregister SpoolBuddy device?",confirmBody:'This will remove "{{hostname}}" ({{deviceId}}) from the database. If the device is online, it will re-register itself on its next heartbeat.',ipAddress:"IP address",firmware:"Firmware",lastSeen:"Last seen",daemonUptime:"Daemon uptime",systemUptime:"System uptime",never:"never",nfc:"NFC",scale:"Scale",cpuTemp:"CPU temp",cpuLoad:"CPU load",memory:"Memory",disk:"Disk",update:"Update",updateConfirmTitle:"Update Spoolbuddy daemon?",updateConfirmBody:'Trigger a software update on "{{hostname}}"? The daemon will restart once the update is applied.',restartBrowser:"Restart Browser",restartBrowserConfirmTitle:"Restart kiosk browser?",restartBrowserConfirmBody:'Restart the kiosk browser on "{{hostname}}"? The display will blank briefly.',restartDaemon:"Restart Daemon",restartDaemonConfirmTitle:"Restart Spoolbuddy daemon?",restartDaemonConfirmBody:'Restart the Spoolbuddy daemon on "{{hostname}}"? The device will go offline for a few seconds.',reboot:"Reboot",rebootConfirmTitle:"Reboot device?",rebootConfirmBody:'Reboot "{{hostname}}"? The device will be offline for around a minute.',shutdown:"Shutdown",shutdownConfirmTitle:"Shutdown device?",shutdownConfirmBody:'Shutdown "{{hostname}}"? You will need physical access to power it back on.',commandConfirm:"Confirm",commandQueued:"Command queued",commandError:"Failed to send command"},ldap:{title:"LDAP Authentication",enabledDesc:"LDAP authentication is enabled",disabledDesc:"LDAP authentication is disabled",disabledHint:"Configure and save LDAP settings below, then enable.",enabled:"LDAP authentication enabled",disabled:"LDAP authentication disabled",feature1:"Users can login with LDAP credentials",feature2:"Local admin account remains as fallback",feature3:"LDAP groups are mapped to BamBuddy groups on login",serverConfig:"LDAP Server Configuration",serverUrl:"Server URL",serverUrlHint:"Use ldaps:// for SSL or ldap:// with StartTLS",security:"Security",securityHint:"StartTLS upgrades a plain connection to TLS. LDAPS uses TLS from the start.",bindDn:"Bind DN (Service Account)",bindPassword:"Bind Password",searchBase:"Search Base DN",userFilter:"User Search Filter",userFilterHint:"{username} is replaced with the login username. Use (uid={username}) for OpenLDAP.",advanced:"Advanced",autoProvision:"Auto-provision users",autoProvisionHint:"Automatically create a BamBuddy account on first LDAP login",defaultGroup:"Default group",defaultGroupNone:"— None (no fallback) —",defaultGroupHint:"Fallback group assigned when an LDAP user authenticates but is not listed in any mapped LDAP group. Leave empty to leave unmapped users without permissions.",groupMapping:"Group Mapping (JSON)",groupMappingHint:"Map LDAP group DNs to BamBuddy groups. Available groups: ",testConnection:"Test Connection",settingsSaved:"LDAP settings saved",errors:{serverRequired:"LDAP server URL is required",searchBaseRequired:"Search base DN is required",enableAuthFirst:"Enable authentication first",configureLdapFirst:"Save LDAP settings first"}},email:{smtpSettings:"SMTP Configuration",smtpHost:"SMTP Server",smtpPort:"SMTP Port",security:"Security",authentication:"Authentication",username:"Username",password:"Password",fromEmail:"From Email",fromName:"From Name",testConnection:"Test SMTP Connection",testRecipient:"Test Recipient Email",sendTest:"Send Test Email",sending:"Sending...",save:"Save Settings",saving:"Saving...",advancedAuth:"Advanced Authentication",advancedAuthEnabled:"Advanced Authentication is enabled",advancedAuthEnabledDesc:"Email-based user management features are active. New users will receive auto-generated passwords via email, and users can reset their passwords through the forgot password feature.",advancedAuthDisabled:"Advanced Authentication is disabled",advancedAuthDisabledDesc:"Enable advanced authentication to activate email-based features for user management.",enable:"Enable",disable:"Disable",feature1:"Passwords are auto-generated and emailed to new users",feature2:"Users can login with username or email",feature3:"Forgot password feature is available",feature4:"Admins can reset user passwords via email",errors:{requiredFields:"Please fill in all required fields",usernameRequired:"Username is required when authentication is enabled",enterTestEmail:"Please enter a test email address",smtpServerAndEmail:"Please fill in SMTP Server and From Email before testing",usernamePasswordRequired:"Username and Password are required when authentication is enabled",configureSmtpFirst:"Please configure and test SMTP settings first",enableAuthFirst:"Please enable authentication first to use email-based features."},success:{settingsSaved:"SMTP settings saved successfully"},securityOptions:{starttls:"STARTTLS (Port 587)",ssl:"SSL/TLS (Port 465)",none:"None (Port 25)"},authOptions:{enabled:"Enabled",disabled:"Disabled"}},appearance:"Appearance",notifications:"Notifications",smartPlugs:"Smart Plugs",spoolman:"Spoolman",updates:"Updates",language:"Language",languageDescription:"Select your preferred language",theme:"Theme",themeLight:"Light",themeDark:"Dark",themeSystem:"System",defaultView:"Default View",defaultViewDescription:"Page to show when opening the app",checkForUpdates:"Check for Updates",autoUpdate:"Auto Update",currentVersion:"Current Version",latestVersion:"Latest Version",upToDate:"You are up to date",updateAvailable:"Update available",notificationLanguage:"Notification Language",notificationLanguageDescription:"Language for push notifications",bedCooledThreshold:"Bed Cooled Threshold",bedCooledThresholdDescription:"Temperature below which the bed is considered cooled after a print",userNotificationsEnabled:"User Notifications",userNotificationsEnabledDescription:"Enable the user notifications menu and email notifications for print job events. Requires Advanced Authentication.",userNotificationsDisabledHint:"Enable Advanced Authentication to use user notifications.",notificationProviders:"Notification Providers",addProvider:"Add Provider",editProvider:"Edit Provider",providerType:"Provider Type",testNotification:"Test Notification",testSuccess:"Test notification sent successfully",testFailed:"Failed to send test notification",quietHours:"Quiet Hours",quietHoursDescription:"Do not disturb during these hours",quietHoursStart:"Start",quietHoursEnd:"End",events:{title:"Notification Events",printStart:"Print Started",printComplete:"Print Completed",printFailed:"Print Failed",printStopped:"Print Stopped",printProgress:"Progress Milestones",printProgressDescription:"Notify at 25%, 50%, 75%",printerOffline:"Printer Offline",printerError:"Printer Error",filamentLow:"Low Filament",maintenanceDue:"Maintenance Due",maintenanceDueDescription:"Notify when maintenance is needed"},smartPlug:{title:"Smart Plugs",add:"Add Smart Plug",edit:"Edit Smart Plug",name:"Name",ipAddress:"IP Address",linkedPrinter:"Linked Printer",autoOn:"Auto Power On",autoOnDescription:"Turn on when print starts",autoOff:"Auto Power Off",autoOffDescription:"Turn off after print completes",offDelay:"Off Delay",offDelayMinutes:"Minutes after print",offDelayTemp:"When nozzle below temperature",currentState:"Current State",turnOn:"Turn On",turnOff:"Turn Off"},filamentTracking:"Filament Tracking",filamentTrackingDesc:"Choose how to track your filament spools. You can use the built-in inventory or connect an external Spoolman server.",filamentChecks:"Filament checks",disableFilamentWarnings:"Disable filament warnings",disableFilamentWarningsDesc:"Don't show warnings about insufficient filament when printing or queueing",preferLowestFilament:"Prefer lowest remaining filament",preferLowestFilamentDesc:"When multiple spools match, use the one with the least filament remaining",trackingModeBuiltIn:"Built-in Inventory",trackingModeBuiltInDesc:"RFID auto-matching and usage tracking included",trackingModeSpoolmanDesc:"External filament management server",builtInFeatureRfid:"Automatically detects Bambu Lab RFID spools in AMS",builtInFeatureUsage:"Tracks filament consumption per print",builtInFeatureCatalog:"Manage spools, colors, and K-factor profiles",builtInFeatureThirdParty:"Third-party spools can be assigned to inventory spools",amsSyncButton:"Sync Weights from AMS",amsSyncTitle:"Sync Spool Weights from AMS",amsSyncMessage:"This will overwrite all inventory spool weights with the current AMS remain% values from connected printers. Use this to recover from corrupted weight data. Printers must be online.",amsSyncing:"Syncing...",amsSyncSuccess:"{{synced}} spool(s) synced, {{skipped}} skipped",amsSyncError:"Failed to sync weights from AMS",spoolmanAmsSyncButton:"Sync Spoolman Weights from AMS",spoolmanAmsSyncTitle:"Sync Spoolman Spool Weights from AMS",spoolmanAmsSyncMessage:"This will update all Spoolman spool weights based on the current AMS remain% values from connected printers. Printers must be online.",spoolmanAmsSyncing:"Syncing...",spoolmanAmsSyncSuccess:"{{synced}} spool(s) synced, {{skipped}} skipped",spoolmanAmsSyncError:"Failed to sync Spoolman weights from AMS",spoolmanAmsSyncErrorUnreachable:"Failed to sync Spoolman weights (Spoolman unreachable)",spoolmanAmsSyncErrorNotConfigured:"Failed to sync Spoolman weights (Spoolman not configured)",spoolmanNotConfigured:"Spoolman not configured",spoolmanFilamentCatalogTitle:"Spoolman Filament Catalog",spoolmanFilamentCatalogDesc:"Filament names and tare weights from your Spoolman instance. Name and spool weight are editable here; all other properties are managed directly in Spoolman.",spoolmanUrl:"Spoolman URL",spoolmanUrlHint:"URL of your Spoolman server (e.g., http://localhost:7912)",spoolmanConnected:"Connected",spoolmanDisconnected:"Disconnected",status:"Status",connect:"Connect",disconnect:"Disconnect",howSyncWorks:"How Sync Works",syncInfoRfidOnly:"Only official Bambu Lab spools with RFID are synced",syncInfoAutoCreate:"New spools are auto-created in Spoolman on first sync",syncInfoThirdPartySkipped:"Non-Bambu Lab spools (third-party, refilled) are skipped",linkingExistingSpools:"Linking Existing Spools",linkingExistingSpoolsDesc:'To link existing Spoolman spools to your AMS, hover over an AMS slot and click "Link to Spoolman".',syncMode:"Sync Mode",syncModeAuto:"Automatic",syncModeManual:"Manual Only",syncModeAutoDesc:"AMS data syncs automatically when changes are detected",syncModeManualDesc:"Only sync when manually triggered",syncAmsData:"Sync AMS Data",syncAmsDataDesc:"Manually sync printer AMS data to Spoolman",allPrinters:"All Printers",noDefaultPrinter:"No default (ask each time)",sidebarOrder:"Sidebar order",saveThumbnails:"Save thumbnails",captureFinishPhoto:"Capture finish photo",noPrintersConfigured:"No printers configured",archiveMode:{always:"Always create archive entry",never:"Never create archive entry",ask:"Ask each time"},checkForUpdatesLabel:"Check for updates",checkPrinterFirmware:"Check printer firmware",includeBetaUpdates:"Include beta versions",includeBetaUpdatesDesc:"Notify about beta and prerelease versions when checking for updates",enableRetry:"Enable retry",homeAssistantDescription:"Control smart plugs via Home Assistant",environmentManagedLabel:"(Environment Managed)",autoEnabledViaEnv:"Automatically enabled via environment variables",urlFromEnvReadOnly:"Value set by HA_URL environment variable (read-only)",tokenFromEnvReadOnly:"Value set by HA_TOKEN environment variable (read-only)",mqttConnectedTo:"Connected to",prometheusDescription:"Expose printer data in Prometheus format",noSmartPlugsTitle:"No smart plugs configured",noSmartPlugsDescription:"Add a Tasmota-based smart plug to track energy usage and automate power control.",noProvidersTitle:"No providers configured",noProvidersDescription:"Add a provider to receive alerts.",noTemplatesAvailable:"No templates available. Restart the backend to seed default templates.",apiPermissionView:"View printer status and queue",apiPermissionEdit:"Add and remove items from print queue",apiKeysEmptyTitle:"No API keys",apiKeysEmptyDescription:"Create an API key to integrate with external services.",noUsersFound:"No users found",noGroupsFound:"No groups found",noGroupsAvailable:"No groups available",passwordsDoNotMatch:"Passwords do not match",systemGroupWarning:"System group names cannot be changed",authDisabledTitle:"Authentication is Disabled",authDisabledFeature1:"Require login to access the system",authDisabledFeature2:"Create multiple users with group-based permissions",authDisabledFeature3:"Control access with 50+ granular permissions",userHasCreated:"This user has created:",userItemsQuestion:"What would you like to do with these items?",deleteUserConfirm:"Are you sure you want to delete this user?",actionCannotBeUndone:"This action cannot be undone.",addFirstSmartPlug:"Add Your First Smart Plug",providers:"Providers",log:"Log",testAll:"Test All",testResults:"Test Results",testPassedCount:"{{count}} passed",testFailedCount:"{{count}} failed",messageTemplates:"Message Templates",messageTemplatesDescription:"Customize notification messages for each event.",apiKeys:"API Keys",apiKeysDescription:"Create API keys for external integrations and webhooks.",createKey:"Create Key",apiKeyCreated:"API Key Created Successfully",apiKeyCopyWarning:"Copy this key now - it won't be shown again!",useInApiBrowser:"Use in API Browser",createNewApiKey:"Create New API Key",keyName:"Key Name",keyNamePlaceholder:"e.g., Home Assistant, OctoPrint",readStatus:"Read Status",readStatusDescription:"View printer status and queue",manageQueue:"Manage Queue",manageQueueDescription:"Add and remove items from print queue",controlPrinter:"Control Printer",controlPrinterDescription:"Pause, resume, and stop prints",manageLibrary:"Manage Library",manageLibraryDescription:"Upload, rename, and delete library files; import models from MakerWorld",manageInventory:"Manage Inventory",manageInventoryDescription:"Create, update, and delete spools and inventory records. Required for SpoolBuddy kiosks (NFC scan, scale readings, kiosk system commands).",libraryBadge:"Library",inventoryBadge:"Inventory",cloudAccess:"Allow cloud access",cloudAccessDescription:"Read Bambu Cloud presets and filaments on your behalf. Requires you to be signed into Bambu Cloud.",cloudBadge:"Cloud",updateEnergyCost:"Update electricity price",updateEnergyCostDescription:"Allow this key to POST a new per-kWh electricity price to /settings/electricity-price. Useful for Home Assistant dynamic-tariff automations (Tibber, Octopus, etc.). This is the only settings field writable via API key.",energyCostBadge:"Energy",legacyKey:"Legacy",legacyKeyTooltip:"Created before per-user ownership; recreate to use cloud access",unnamedKey:"Unnamed Key",lastUsed:"Last used",read:"Read",control:"Control",createFirstKey:"Create Your First Key",webhookEndpoints:"Webhook Endpoints",webhookApiKeyHint:"Use your API key in the X-API-Key header.",webhook:{getAllStatus:"Get all printer status",getSpecificStatus:"Get specific printer status",addToQueue:"Add to print queue",pausePrint:"Pause print",resumePrint:"Resume print",stopPrint:"Stop print"},apiBrowser:"API Browser",apiBrowserDescription:"Explore and test all available API endpoints.",apiKeyForTesting:"API Key for Testing",apiKeyPlaceholder:"Paste your API key here to test authenticated endpoints...",apiKeyHint:"This key will be sent as X-API-Key header with requests.",deleteApiKeyTitle:"Delete API Key",deleteApiKeyMessage:"Are you sure you want to delete this API key? Any integrations using this key will stop working.",deleteKey:"Delete Key",amsDisplayThresholds:"AMS Display Thresholds",amsThresholdsDescription:"Configure color thresholds for AMS humidity and temperature indicators.",humidity:"Humidity",goodGreen:"Good (green)",fairOrange:"Fair (orange)",aboveFairBad:"Above fair threshold shows as red (bad)",fairAlsoDryingThreshold:"This threshold is also used to trigger auto-drying when enabled",temperature:"Temperature",goodBlue:"Good (blue)",aboveFairHot:"Above fair threshold shows as red (hot)",historyRetention:"History Retention",keepSensorHistory:"Keep sensor history for",historyRetentionDescription:"Older humidity and temperature data will be automatically deleted",defaultPrintOptions:"Default Print Options",defaultPrintOptionsDescription:"Set default values for print options when starting new prints. These can be overridden per print in the print dialog.",defaultBedLevelling:"Bed Levelling",defaultBedLevellingDesc:"Auto-level bed before print",defaultFlowCali:"Flow Calibration",defaultFlowCaliDesc:"Calibrate extrusion flow",defaultVibrationCali:"Vibration Calibration",defaultVibrationCaliDesc:"Reduce ringing artifacts",defaultLayerInspect:"First Layer Inspection",defaultLayerInspectDesc:"AI inspection of first layer",defaultTimelapse:"Timelapse",defaultTimelapseDesc:"Record timelapse video",staggeredStart:"Staggered Start",staggeredStartDescription:"Default group size and interval when staggering multi-printer batch starts. Can be overridden per batch in the print modal.",plateClear:"Plate-Clear Confirmation",requirePlateClear:"Require plate-clear confirmation",requirePlateClearDescription:'When enabled, the scheduler waits for per-printer plate-clear confirmation before starting queued prints on printers with finished jobs. Disabling this also hides the plate status badge and the "Mark plate as cleared" button on printer cards.',gcodeInjection:"G-code Injection",gcodeInjectionDescription:'Configure custom G-code to inject at the start and/or end of prints for auto-print systems like Farmloop, SwapMod, AutoClear, and Printflow 3D. Snippets are configured per printer model and applied when "Inject G-code" is enabled on a queue item.',gcodeInjectionNoPrinters:"No printers found. Add printers to configure G-code snippets.",gcodeStartLabel:"Start G-code",gcodeEndLabel:"End G-code",gcodeStartPlaceholder:"G-code prepended before the print starts...",gcodeEndPlaceholder:"G-code appended after the print ends...",staggerGroupSize:"Group size",staggerGroupSizeHelp:"Printers to start simultaneously per group",staggerInterval:"Interval (minutes)",staggerIntervalHelp:"Delay between each group starting",queueDrying:"Queue Auto-Drying",queueDryingDescription:"Automatically dry AMS filament when printer is idle between queued prints. Uses humidity threshold above to trigger drying.",queueDryingEnabled:"Enable auto-drying",queueDryingEnabledDescription:"Start AMS drying automatically when printer is idle and humidity is above threshold",queueDryingBlock:"Wait for drying to complete",queueDryingBlockDescription:"Block the print queue until drying finishes. When off, prints take priority over drying.",ambientDryingEnabled:"Ambient drying",ambientDryingEnabledDescription:"Automatically dry filament on idle printers when humidity exceeds threshold, even without queued prints.",dryingPresets:"Drying Presets",dryingPresetsDescription:"Temperature and duration per filament type. AMS 2 Pro uses lower temps, AMS-HT supports higher temps.",dryingFilament:"Filament",printModal:"Print Modal",expandCustomMapping:"Expand custom mapping by default",expandCustomMappingDescription:"When printing to multiple printers, show per-printer AMS mapping expanded",authentication:"Authentication",authEnabledDescription:"Your instance is secured with user authentication",authDisabledDescription:"Enable to require login and manage user access",authDisabledMessage:"Enable authentication to create user accounts, manage permissions, and secure your Bambuddy instance.",enableAuthentication:"Enable Authentication",currentUser:"Current User",changePassword:"Change Password",admin:"Admin",users:"Users",addUser:"Add User",groups:"Groups",addGroup:"Add Group",system:"System",noDescription:"No description",userCount:"{{count}} users",permissionCount:"{{count}} permissions",createUser:"Create User",username:"Username",enterUsername:"Enter username",password:"Password",enterPassword:"Enter password",passwordRequirements:"At least 8 characters, with one uppercase, one lowercase, one digit, and one special character.",confirmPassword:"Confirm Password",confirmPasswordPlaceholder:"Confirm password",viewReleaseOnGitHub:"View release on GitHub",turnAllPlugsOn:"Turn all plugs on",turnAllPlugsOff:"Turn all plugs off",clearNotificationLogs:"Clear Notification Logs",clearLogsMessage:"This will permanently delete all notification logs older than 30 days. This action cannot be undone.",clearLogs:"Clear Logs",resetUiPreferences:"Reset UI Preferences",resetUiPreferencesMessage:"This will reset all UI preferences to defaults: sidebar order, theme, dashboard layout, view modes, and sorting preferences. Your printers, archives, and server settings will NOT be affected. The page will reload after clearing.",resetPreferences:"Reset Preferences",deleteGroupTitle:"Delete Group",deleteGroupMessage:"Are you sure you want to delete this group? Users in this group will lose these permissions.",deleteGroup:"Delete Group",disableAuthenticationTitle:"Disable Authentication",disableAuthenticationMessage:"Are you sure you want to disable authentication? This will make your Bambuddy instance accessible without login. All users will remain in the database but authentication will be disabled.",disableAuthentication:"Disable Authentication",configureBambuddy:"Configure Bambuddy",systemDefault:"System Default",archiveSettings:"Archive Settings",newWindow:"New Window",embeddedOverlay:"Embedded Overlay",preferredSlicer:"Preferred Slicer",preferredSlicerDescription:"Choose which slicer application to open files with",orcaslicerKnownIssuesWarning:"OrcaSlicer 2.3.2 / 2.4.0-dev have known CLI bugs that block slicing many Bambu-authored 3MFs — see upstream issues #12426 (segfault on painted multi-extruder files) and #13386 (parameter-range strict-validation reject). Bambu Studio is recommended until the upstream fixes land.",useSlicerApi:"Use Slicer API",useSlicerApiDescription:'When on, "Slice" actions open the in-app slicer modal and call the slicer-API sidecar. When off (default), they hand off to the desktop slicer via URI scheme.',slicerCard:"Slicer",orcaslicerApiUrl:"OrcaSlicer sidecar URL",bambuStudioApiUrl:"Bambu Studio sidecar URL",slicerApiUrlDescription:"URL of the slicer-API sidecar container. Leave blank to use the SLICER_API_URL / BAMBU_STUDIO_API_URL env var defaults.",slicerBundles:{title:"Slicer Bundles",description:'Import a Printer Preset Bundle (.bbscfg) exported from BambuStudio (File → Export → Export Preset Bundle → "Printer preset bundle"). Once imported, slice requests can pick presets from the bundle by name without re-uploading the JSON profile triplet.',uploadButton:"Upload bundle",uploading:"Uploading…",loading:"Loading bundles…",empty:"No bundles imported yet.",summary:"{{processCount}} process · {{filamentCount}} filament presets",delete:"Delete",uploadSuccess:"Imported {{name}}",uploadError:"Bundle upload failed: {{message}}",deleteSuccess:"Bundle removed",deleteError:"Bundle delete failed: {{message}}",confirmDeleteTitle:"Remove this bundle?",confirmDeleteMessage:'Slice requests that reference "{{name}}" will fail until the bundle is re-imported.'},externalCameras:"External Cameras",costTracking:"Cost Tracking",printsOnly:"Prints Only",totalConsumption:"Total Consumption",dataManagement:"Data Management",storageUsage:"Storage Usage",storageUsageDescription:"Breakdown of data usage by category",storageUsageTotal:"Total",storageUsageErrors:"Errors",storageUsageOtherBreakdown:"Other (includes static assets, scripts, and configuration files)",storageUsageSystem:"System",storageUsageData:"Data",storageUsageUnavailable:"Storage usage information unavailable",clearNotificationLogsDescription:"Delete notification logs older than 30 days",resetUiPreferencesDescription:"Reset sidebar order, theme, view modes, and layout preferences. Printers, archives, and settings are not affected.",enableHomeAssistant:"Enable Home Assistant",enableMqtt:"Enable MQTT",useTls:"Use TLS",enableMetricsEndpoint:"Enable Metrics Endpoint",availableMetrics:"Available Metrics",editUser:"Edit User",deleteUserTitle:"Delete User",groupName:"Group Name",leaveEmptyForAnonymous:"Leave empty for anonymous",leaveEmptyForNoAuth:"Leave empty for no authentication",enterNewPassword:"Enter new password",confirmNewPassword:"Confirm new password",enterGroupName:"Enter group name",enterDescriptionOptional:"Enter description (optional)",enterCurrentPassword:"Enter current password",enterNewPasswordMin6:"Enter new password (min 6 characters)",toast:{keyCopied:"Key copied to clipboard",copyFailed:"Failed to copy key",keyAddedToBrowser:"Key added to API Browser",clearLogsFailed:"Failed to clear logs",uiPreferencesReset:"UI preferences reset. Refreshing...",authDisabled:"Authentication disabled successfully",authDisableFailed:"Failed to disable authentication",apiKeyCreated:"API key created",apiKeyDeleted:"API key deleted",userCreated:"User created successfully",userUpdated:"User updated successfully",userDeleted:"User deleted successfully",groupCreated:"Group created successfully",groupUpdated:"Group updated successfully",groupDeleted:"Group deleted successfully",fillRequiredFields:"Please fill in all required fields",passwordsDoNotMatch:"Passwords do not match",passwordTooShort:"Password must be at least 8 characters",passwordNeedsUppercase:"Password must contain at least one uppercase letter",passwordNeedsLowercase:"Password must contain at least one lowercase letter",passwordNeedsDigit:"Password must contain at least one digit",passwordNeedsSpecial:"Password must contain at least one special character",enterGroupName:"Please enter a group name",settingsSaved:"Settings saved",noPermissionUpdate:"You do not have permission to change settings",cameraSettingsSaved:"Camera settings saved",enterCameraUrl:"Please enter a camera URL",passwordChanged:"Password changed successfully",connectionFailed:"Connection failed",testFailed:"Test failed",cameraConnected:"Camera connected{{resolution}}"},testConnection:"Test Connection",catalog:{spoolCatalog:"Spool Catalog",spoolCatalogDescription:"Empty spool weights by brand/type. Used for automatic weight lookup when adding spools.",searchCatalog:"Search catalog...",addNewEntry:"Add New Entry",namePlaceholder:"Name (e.g., Bambu Lab - Plastic)",weight:"Weight",type:"Type",default:"Default",custom:"Custom",noMatch:"No entries match your search",empty:"No entries in catalog",deleteEntry:"Delete Entry",deleteConfirm:'Are you sure you want to delete "{{name}}"?',resetCatalog:"Reset Catalog",resetConfirm:"Reset catalog to defaults? This will remove all custom entries.",loadFailed:"Failed to load spool catalog",nameWeightRequired:"Name and weight are required",entryAdded:"Entry added",addFailed:"Failed to add entry",entryUpdated:"Entry updated",updateFailed:"Failed to update entry",entryDeleted:"Entry deleted",deleteFailed:"Failed to delete entry",resetSuccess:"Catalog reset to defaults",resetFailed:"Failed to reset catalog",exported:"Exported {{count}} entries",imported:"Imported {{added}} entries ({{skipped}} skipped)",importFailed:"Failed to import: invalid JSON format",exportTooltip:"Export catalog to JSON",importTooltip:"Import catalog from JSON",resetTooltip:"Reset to defaults",selectedCount:"{{count}} selected",deleteSelected:"Delete Selected",bulkDeleteConfirm:"Are you sure you want to delete {{count}} entries?",bulkDeleted:"Deleted {{count}} entries",bulkDeleteFailed:"Failed to delete entries",material:"Material",spoolWeight:"Spool Weight",color:"Color",updateSpoolWeight:"Update Spool Weight",filamentUpdated:"Filament updated",filamentUpdateFailed:"Failed to update filament",filamentUpdateInvalid:"Invalid filament data",keepExistingSpoolWeight:"Keep old weight for existing spools",keepExistingSpoolWeightDesc:"Spools already created with this filament type retain the old tare weight. New spools use the updated value.",applyToAllSpools:"Apply to all spools",applyToAllSpoolsDesc:"All weight calculations for this filament type immediately use the new tare weight."},colorCatalog:{title:"Color Catalog",description:"Filament colors by manufacturer/material. Used for automatic color lookup when adding spools.",searchColors:"Search colors...",allManufacturers:"All manufacturers",addNewColor:"Add New Color",manufacturer:"Manufacturer",colorName:"Color Name",hex:"Hex",materialOptional:"Material (optional)",showing:"Showing {{filtered}} of {{total}} colors",noMatch:"No colors match your search",empty:"No colors in catalog",deleteColor:"Delete Color",deleteConfirm:'Are you sure you want to delete "{{name}}"?',resetCatalog:"Reset Color Catalog",resetConfirm:"Reset catalog to defaults? This will remove all custom colors.",sync:"Sync",starting:"Starting...",syncTooltip:"Sync from FilamentColors.xyz (2000+ colors, may take a minute)",loadFailed:"Failed to load color catalog",fieldsRequired:"Manufacturer, color name, and hex color are required",colorAdded:"Color added",addFailed:"Failed to add color",colorUpdated:"Color updated",updateFailed:"Failed to update color",colorDeleted:"Color deleted",deleteFailed:"Failed to delete color",resetSuccess:"Color catalog reset to defaults",resetFailed:"Failed to reset catalog",syncUpToDate:"Already up to date ({{count}} colors checked)",syncComplete:"Added {{added}} new colors ({{skipped}} already existed)",syncError:"Sync error",syncFailed:"Failed to sync from FilamentColors.xyz",exported:"Exported {{count}} colors",imported:"Imported {{added}} colors ({{skipped}} skipped)",importFailed:"Failed to import: invalid JSON format",selectedCount:"{{count}} selected",deleteSelected:"Delete Selected",bulkDeleteConfirm:"Are you sure you want to delete {{count}} colors?",bulkDeleted:"Deleted {{count}} colors",bulkDeleteFailed:"Failed to delete colors"},dateFormat:"Date Format",dateFormatUs:"US (MM/DD/YYYY)",dateFormatEu:"EU (DD/MM/YYYY)",dateFormatIso:"ISO (YYYY-MM-DD)",timeFormat:"Time Format",timeFormat12:"12-hour (3:30 PM)",timeFormat24:"24-hour (15:30)",defaultPrinter:"Default Printer",defaultPrinterDescription:"Pre-select this printer for uploads, reprints, and other operations.",slicerBambuStudio:"Bambu Studio",slicerOrcaSlicer:"OrcaSlicer",sidebarOrderDescription:"Drag items in the sidebar to reorder. Reset to default order here.",setDefault:"Set Default",sidebarOrderSetDefaultHint:"Set default applies the current menu order to users who haven't customized theirs.",sidebarDefaultSet:"Default menu order has been set.",sidebarDefaultCleared:"Default menu order cleared.",sidebarDefaultFailed:"Failed to set default menu order.",reset:"Reset",darkMode:"Dark Mode",lightMode:"Light Mode",active:"(active)",background:"Background",accent:"Accent",style:"Style",bgNeutral:"Neutral",bgWarm:"Warm",bgCool:"Cool",bgOled:"OLED Black",bgSlate:"Slate Blue",bgForest:"Forest Green",accentGreen:"Green",accentTeal:"Teal",accentBlue:"Blue",accentOrange:"Orange",accentPurple:"Purple",accentRed:"Red",styleClassic:"Classic",styleGlow:"Glow",styleVibrant:"Vibrant",themeToggleHint:"Toggle between dark, light, and system mode using the icon in the sidebar.",autoArchivePrints:"Auto-archive prints",autoArchiveDescription:"Automatically save 3MF files when prints complete",saveThumbnailsDescription:"Extract and save preview images from 3MF files",captureFinishPhotoDescription:"Take a photo from printer camera when print completes",ffmpegNotInstalled:"ffmpeg not installed",ffmpegRequired:"Camera capture requires ffmpeg. Install it via brew install ffmpeg (macOS) or apt install ffmpeg (Linux).",camera:"Camera",cameraViewMode:"Camera View Mode",cameraOverlayDescription:"Camera opens in a resizable overlay on the main screen",cameraWindowDescription:"Camera opens in a separate browser window",externalCamerasDescription:"Configure external cameras to replace the built-in printer camera. Supports MJPEG streams, RTSP, HTTP snapshots, and USB cameras (V4L2). When enabled, the external camera is used for live view and finish photos.",cameraPlaceholderUsb:"Device path (/dev/video0)",cameraPlaceholderUrl:"Camera URL (rtsp://... or http://...)",cameraTypeMjpeg:"MJPEG Stream",cameraTypeRtsp:"RTSP Stream",cameraTypeSnapshot:"HTTP Snapshot",cameraTypeUsb:"USB Camera (V4L2)",cameraSnapshotUrl:"Snapshot URL (optional)",cameraSnapshotUrlPlaceholder:"http://192.168.1.61:1984/api/frame.jpeg?src=printer",cameraSnapshotUrlHelp:"Single-frame URL used for notification thumbnails, finish photos, layer-timelapse frames, and plate detection. Timelapse and plate detection each require their own per-printer toggle — this URL is just the image source they pull from when active. Leave blank to capture from the live stream above. Useful for go2rtc (/api/frame.jpeg) and IP cameras with a dedicated snapshot endpoint.",cameraRotation:"Rotation",test:"Test",connected:"Connected",disconnected:"Disconnected",currency:"Currency",defaultFilamentCost:"Default filament cost (per kg)",electricityCost:"Electricity cost per kWh",energyDisplayMode:"Energy display mode",energyModePrintDescription:"Dashboard shows sum of energy used during prints",energyModeTotalDescription:"Dashboard shows lifetime energy from smart plugs",fileManager:"File Manager",createArchiveEntry:"Create Archive Entry When Printing",createArchiveEntryDescription:"When printing from File Manager, optionally create an archive entry",lowDiskSpaceWarning:"Low Disk Space Warning",lowDiskSpaceDescription:"Show warning when free disk space falls below this threshold",printerFirmware:"Printer Firmware",checkFirmwareDescription:"Check for printer firmware updates from Bambu Lab",bambuddySoftware:"Bambuddy Software",autoCheckDescription:"Automatically check for new versions on startup",checkNow:"Check now",updateAvailableVersion:"Update available: v{{version}}",releaseNotes:"Release Notes",updateViaDocker:"Update via Docker Compose:",updateViaHomeAssistant:"Updates are managed by the Home Assistant Supervisor. Open Settings → Add-ons → Bambuddy in Home Assistant to install the new version.",installUpdate:"Install Update",latestVersionRunning:"You're running the latest version",failedToCheckUpdates:"Failed to check for updates: {{error}}",backupRestore:"Backup & Restore",backupRestoreDescription:"Export/import settings and configure GitHub backup",goToBackup:"Go to Backup",externalUrl:"External URL",externalUrlDescription:"The external URL where Bambuddy is accessible. Used for notification images and external integrations.",bambuddyUrl:"Bambuddy URL",externalUrlHint:"Include protocol and port (e.g., http://192.168.1.100:8000)",ftpRetry:"FTP Retry",ftpRetryDescription:"Retry FTP operations when printer WiFi is unreliable. Applies to 3MF downloads, print uploads, timelapse downloads, and firmware updates.",autoRetryDescription:"Automatically retry failed FTP operations",retryAttempts:"Retry attempts",retryDelay:"Retry delay",connectionTimeout:"Connection timeout",time_one:"{{count}} time",time_other:"{{count}} times",second_one:"{{count}} second",second_other:"{{count}} seconds",nSeconds:"{{count}} seconds",increaseForWeakWifi:"Increase for printers with weak WiFi",homeAssistant:"Home Assistant",homeAssistantFullDescription:"Connect to Home Assistant to control smart plugs via HA's REST API. Supports switch, light, input_boolean, and script entities.",homeAssistantUrl:"Home Assistant URL",longLivedAccessToken:"Long-Lived Access Token",haTokenHint:"Create a token in HA: Profile → Long-Lived Access Tokens → Create Token",connectionSuccessful:"Connection Successful",connectionFailed:"Connection Failed",haConnectionSuccess:"Successfully connected to Home Assistant.",haConnectionFailed:"Failed to connect to Home Assistant.",mqttPublishing:"MQTT Publishing",mqttDescription:"Publish BamBuddy events to an external MQTT broker for integration with Node-RED, Home Assistant, and other automation systems.",mqttEnableDescription:"Publish events to external MQTT broker",brokerHostname:"Broker hostname",port:"Port",usernameOptional:"Username (optional)",passwordOptional:"Password (optional)",topicPrefix:"Topic prefix",topicPrefixHint:"Topics will be: {{prefix}}/printers//status, etc.",prometheusMetrics:"Prometheus Metrics",prometheusEndpointDescription:"Expose printer metrics at /api/v1/metrics for Prometheus/Grafana monitoring.",bearerTokenOptional:"Bearer Token (optional)",bearerTokenHint:"If set, requests must include Authorization: Bearer ",metricsConnectionStatus:"Connection status",metricsPrinterState:"Printer state (idle/printing/etc)",metricsPrintProgress:"Print progress 0-100%",metricsBedTemp:"Bed temperature",metricsNozzleTemp:"Nozzle temperature",metricsPrintsTotal:"Total prints by result",metricsMore:"...and more (layers, fans, queue, filament usage)",smartPlugsDescription:"Connect smart plugs (Tasmota or Home Assistant) to automate power control and track energy usage for your printers.",allOn:"All On",allOff:"All Off",addSmartPlug:"Add Smart Plug",energySummary:"Energy Summary",currentPower:"Current Power",plugsOnline:"{{reachable}}/{{total}} plugs online",today:"Today",yesterday:"Yesterday",total:"Total",enablePlugsForSummary:"Enable plugs to see energy summary",addNotificationProvider:"Add",systemBadge:"(System)",creating:"Creating...",changing:"Changing...",deleteUserAndItems:"Delete user AND their items",deleteUserKeepItems:"Delete user, keep items (become ownerless)",ok:"OK",twoFa:{totpTitle:"Authenticator App (TOTP)",totpDesc:"Use an authenticator app like Google Authenticator, Aegis or Authy.",emailOtpTitle:"Email OTP",emailOtpDesc:"Send a one-time code to {{email}} when you log in.",emailOtpNoEmail:"Add an email address to your account to enable this method.",addEmailFirst:"Your account has no email address. Ask an admin to add one before enabling Email OTP.",setupTotp:"Set up Authenticator App",setupAuthApp:"Set up Authenticator App",setupInstructions:"Scan the QR code below with your authenticator app, then confirm with a code.",manualEntry:"Can't scan? Enter this secret manually:",scannedContinue:"I've scanned the code — continue",enterCodeToConfirm:"Enter the 6-digit code from your authenticator app to confirm setup.",activate:"Activate",disableTotp:"Disable Authenticator",disableConfirmHint:"Enter a valid TOTP code or a backup code to disable the authenticator.",totpDisabled:"Authenticator app disabled.",emailOtpEnabled:"Email OTP enabled.",emailOtpDisabled:"Email OTP disabled.",smtpRequired:"Please configure and test SMTP settings first.",invalidCode:"Invalid code. Please try again.",enableEmailOtp:"Enable Email OTP",disableEmailOtp:"Disable Email OTP",emailSetupEnterCode:"A verification code has been sent to your email address. Enter it below to confirm you own this inbox.",verifyAndEnable:"Verify & Enable",emailDisablePasswordHint:"Enter your account password to confirm disabling email OTP.",passwordPlaceholder:"Enter your password",backupCodesTitle:"Save your backup codes",backupCodesWarning:"Save these codes somewhere safe. Each code can only be used once and they will not be shown again.",backupCodesRemaining:"{{count}} backup codes remaining",savedCodes:"I've saved my codes",regenBackup:"Regenerate Backup Codes",regenBackupHint:"Enter your current TOTP code to generate 10 new backup codes. All existing backup codes will be invalidated.",newBackupCodes:"New backup codes",linkedAccounts:"Linked SSO Accounts",linkedAccountsDesc:"These external identity providers are linked to your account.",oidcUnlinked:"Account unlinked."},oidc:{title:"SSO / OIDC Providers",desc:"Configure OpenID Connect providers to allow single sign-on via external identity providers.",addProvider:"Add Provider",newProvider:"New Provider",empty:"No OIDC providers configured yet.",created:"Provider created.",updated:"Provider updated.",deleted:"Provider deleted.",refreshIcon:"Refresh icon",removeIcon:"Remove icon",iconRefreshed:"Icon refreshed.",iconRemoved:"Icon removed.",iconFetchFailed:"Icon could not be fetched from the provider URL.",deleteTitle:"Delete Provider",deleteMessage:'Delete "{{name}}"? All linked user accounts will be disconnected.',form:{name:"Display Name",issuerUrl:"Issuer URL",clientId:"Client ID",clientSecret:"Client Secret",scopes:"Scopes",iconUrl:"Icon URL (optional)",enabled:"Enabled",autoCreate:"Auto-create users",autoCreateDesc:"Automatically create a local account on first login.",autoLink:"Auto-link existing accounts",autoLinkDesc:"Link existing local accounts by matching email on first login.",secretHint:"leave blank to keep current",secretPlaceholder:"new secret",emailClaim:"Email Claim",emailClaimDesc:"JWT claim used as email identity. Use 'preferred_username' or 'upn' for Azure Entra ID (which does not send email_verified). Only use trusted claim names.",emailClaimPlaceholder:"email",emailClaimCustomClaimAutoLinkWarning:"Custom claims are safe for auto-link only when the value is tenant-administered (e.g. Azure Entra ID upn / preferred_username). Do not enable auto-link if your IdP allows users to self-assert this claim.",requireEmailVerified:"Require email verified",requireEmailVerifiedDesc:"Only accept the email claim when the provider marks it as verified.",requireEmailVerifiedWarning:"Warning: email will be accepted even without verification. Use only with trusted providers.",requireEmailVerifiedAutoLink:"Disable auto-link first to change this setting.",defaultGroup:"Default Group",defaultGroupDesc:"Group assigned to auto-created users. Falls back to Viewers if not set.",defaultGroupViewersFallback:"Viewers (default)"}},encryption:{title:"MFA Encryption Status",enabledFromEnv:"At-rest encryption enabled (key from MFA_ENCRYPTION_KEY environment variable)",enabledFromFile:"At-rest encryption enabled (key loaded from data directory)",enabledGenerated:"At-rest encryption enabled with auto-generated key",notConfigured:"At-rest encryption not configured",notConfiguredDesc:"TOTP secrets and OIDC client_secrets are stored in plaintext. Set MFA_ENCRYPTION_KEY or restart Bambuddy with a writable data directory to auto-generate one.",allEncrypted:"All MFA secrets are encrypted at rest.",legacyRowsLabel:"Legacy plaintext rows",encryptedRowsLabel:"Encrypted rows",legacyRowsWarning:"{{count}} legacy plaintext row(s) detected. Re-save the OIDC provider or re-enroll the user’s authenticator app to migrate to encrypted storage.",backupHint:"The auto-generated key is stored at DATA_DIR/.mfa_encryption_key and is included in local backup ZIPs. Keep your backups secure or set MFA_ENCRYPTION_KEY explicitly.",decryptionBrokenTitle:"Encryption key missing",decryptionBrokenError:"{{count}} encrypted record(s) cannot be decrypted because the encryption key is no longer available. Restore the previous MFA_ENCRYPTION_KEY or DATA_DIR/.mfa_encryption_key to recover.",migrationErrorWarning:"{{count}} legacy row(s) failed to re-encrypt at startup. Check server logs and restart Bambuddy to retry."}},notification:{printStarted:{title:"Print Started",body:"{{printer}}: {{filename}} has started printing"},printCompleted:{title:"Print Completed",body:"{{printer}}: {{filename}} completed successfully"},printFailed:{title:"Print Failed",body:"{{printer}}: {{filename}} has failed"},printStopped:{title:"Print Stopped",body:"{{printer}}: {{filename}} was stopped"},printProgress:{title:"Print Progress",body:"{{printer}}: {{filename}} is {{percent}}% complete"},printerOffline:{title:"Printer Offline",body:"{{printer}} is offline"},printerError:{title:"Printer Error",body:"{{printer}}: {{error}}"},filamentLow:{title:"Low Filament",body:"{{printer}}: Filament is running low"},maintenanceDue:{title:"Maintenance Due",body:"{{printer}}: {{items}} need attention"}},errors:{generic:"Something went wrong",networkError:"Network error. Please check your connection.",notFound:"Not found",unauthorized:"Unauthorized",serverError:"Server error",validationError:"Please check your input",printerConnectionFailed:"Failed to connect to printer",saveFailed:"Failed to save changes",deleteFailed:"Failed to delete",loadFailed:"Failed to load data"},hmsErrors:{title:"Errors - {{name}}",noErrors:"No errors",viewOnWiki:"View on Bambu Lab Wiki",clearInstructions:"Clear errors on the printer to dismiss them here.",clearErrors:"Clear Errors",clearSuccess:"HMS errors cleared",clearFailed:"Failed to clear HMS errors"},mqttDebug:{title:"MQTT Debug Log",searchPlaceholder:"Search topic or payload...",noMessages:"No messages logged yet",startLoggingHint:'Click "Start Logging" to begin capturing MQTT messages',noMessagesMatch:"No messages match your filter",adjustFilterHint:"Try adjusting your search or filter criteria",incoming:"Incoming",outgoing:"Outgoing",loggingStopped:"Logging stopped",loggingActive:"Logging active - messages will auto-refresh",startLogging:"Start Logging",stopLogging:"Stop Logging",clearLog:"Clear Log",topic:"Topic",timestamp:"Timestamp",direction:"Direction",all:"All"},printerFiles:{title:"File Manager",storageUsed:"Used:",storageFree:"Free:",filterPlaceholder:"Filter files...",deleteButton:"Delete",deleteFiles:"Delete {{count}} Files",deleteFileConfirm:'Delete "{{name}}"? This cannot be undone.',deleteFilesConfirm:"Delete {{count}} selected files? This cannot be undone.",noFiles:"No files on printer",loadingFiles:"Loading files...",failedToLoad:"Failed to load files",toast:{filesDeleted:"Deleted {{count}} file(s)",deleteFailed:"Delete failed: {{error}}"}},confirm:{delete:"Are you sure you want to delete this?",unsavedChanges:"You have unsaved changes. Are you sure you want to leave?",clearQueue:"Are you sure you want to clear the queue?"},login:{title:"Bambuddy Login",subtitle:"Sign in to your account",username:"Username",usernamePlaceholder:"Enter your username",usernameOrEmail:"Username or Email",usernameOrEmailPlaceholder:"Username or @ Email",password:"Password",passwordPlaceholder:"Enter your password",signIn:"Sign in",signingIn:"Logging in...",rememberMe:"Remember Me",forgotPassword:"Forgot your password?",loginSuccess:"Logged in successfully",loginFailed:"Login failed",enterCredentials:"Please enter username and password",enterEmail:"Please enter your email address",oidcLoginFailed:"OIDC login failed",oidcErrors:{providerError:"The identity provider returned an error",missingParameters:"OIDC callback is missing required parameters",invalidState:"OIDC state is invalid or has already been used",stateExpired:"OIDC login session expired — please try again",providerNotFound:"OIDC provider not found",discoveryFailed:"Failed to fetch OIDC discovery document",invalidDiscovery:"OIDC discovery document is invalid",networkError:"Network error during OIDC token exchange",badResponse:"Unexpected response during OIDC token exchange",noIdToken:"OIDC provider did not return an ID token",validationFailed:"OIDC token validation failed",nonceMismatch:"OIDC nonce mismatch — possible replay attack",missingSubClaim:"OIDC token is missing the sub claim",noLinkedAccount:"No local account is linked to this OIDC identity",accountInactive:"Your account is inactive",userResolutionFailed:"Failed to resolve your account",internalError:"An internal error occurred during OIDC login",tokenExchangeFailed:"OIDC token exchange failed"},forgotPasswordTitle:"Forgot Password",forgotPasswordMessage:"If you've forgotten your password, please contact your system administrator to reset it.",forgotPasswordEmailMessage:"Enter your email address and we'll send you a new password.",emailAddress:"Email Address",emailPlaceholder:"your.email@example.com",cancel:"Cancel",sending:"Sending...",sendResetEmail:"Send Reset Email",howToReset:"How to reset your password:",resetStep1:"Contact your Bambuddy administrator",resetStep2:"Ask them to reset your password in User Management",resetStep3:"They can set a new temporary password for you",resetStep4:"Log in with the new password and change it in Settings",gotIt:"Got it",resetPassword:{title:"Set New Password",subtitle:"Enter and confirm your new password below.",newPassword:"New Password",newPasswordPlaceholder:"At least 8 characters",confirmPassword:"Confirm Password",confirmPasswordPlaceholder:"Repeat new password",saving:"Saving…",submit:"Set New Password",backToLogin:"Back to login",passwordsDoNotMatch:"Passwords do not match",passwordTooShort:"Password must be at least 8 characters",resetFailed:"Password reset failed. The link may have expired."},twoFA:{title:"Two-Factor Authentication",subtitle:"Your account is protected with 2FA. Enter the verification code below.",methodAuthenticator:"Authenticator App",methodEmail:"Email Code",methodBackup:"Backup Code",instructionsTotp:"Open your authenticator app and enter the 6-digit code for Bambuddy.",instructionsEmail:"A 6-digit code has been sent to your email address. It expires in 10 minutes.",instructionsEmailNotSent:"Click the button below to receive a verification code via email.",instructionsBackup:"Enter one of your 8-character backup recovery codes. Each code can only be used once.",sendCodeButton:"Send Code via Email",sendingCode:"Sending...",resendCode:"Resend code",codeLabel:"Verification Code",backupCodeLabel:"Backup Code",codePlaceholder:"000000",backupCodePlaceholder:"XXXXXXXX",verifyButton:"Verify",verifyingButton:"Verifying...",backToLogin:"← Back to login",orContinueWith:"or continue with",signInWith:"Sign in with {{provider}}",enterCode:"Please enter the verification code",sendCodeFailed:"Failed to send verification code",invalidCode:"Invalid code. Please try again."}},setup:{title:"Bambuddy Setup",subtitle:"Configure authentication for your Bambuddy instance",enableAuth:"Enable Authentication",adminAccount:"Admin Account",adminAccountDesc:"If admin users already exist, authentication will be enabled using the existing admin accounts. Leave the fields below empty to use existing admins, or enter new credentials to create a new admin user.",adminUsername:"Admin Username",adminPassword:"Admin Password",optionalIfAdminExists:"(optional if admin users exist)",adminUsernamePlaceholder:"Enter admin username (optional)",adminPasswordPlaceholder:"Enter admin password (optional)",confirmPassword:"Confirm Password",confirmPasswordPlaceholder:"Confirm admin password",settingUp:"Setting up...",completeSetup:"Complete Setup",toast:{authEnabledAdminCreated:"Authentication enabled and admin user created",authEnabledExistingAdmins:"Authentication enabled using existing admin users",setupCompleted:"Setup completed",enterBothCredentials:"Please enter both admin username and password, or leave both empty to use existing admin users",passwordsDoNotMatch:"Passwords do not match",passwordTooShort:"Password must be at least 6 characters"}},changePassword:{title:"Change Password",currentPassword:"Current Password",currentPasswordPlaceholder:"Enter current password",newPassword:"New Password",newPasswordPlaceholder:"Enter new password (min 6 characters)",confirmPassword:"Confirm New Password",confirmPasswordPlaceholder:"Confirm new password",passwordsDoNotMatch:"Passwords do not match",passwordTooShort:"Password must be at least 6 characters",changing:"Changing...",success:"Password changed successfully",failed:"Failed to change password"},plateAlert:{title:"Print Paused!",message:"Objects detected on build plate. The print has been automatically paused. Please clear the plate and resume the print.",understand:"I Understand"},camera:{title:"Camera View",invalidPrinterId:"Invalid printer ID",live:"Live",snapshot:"Snapshot",restartStream:"Restart stream",refreshSnapshot:"Refresh snapshot",fullscreen:"Fullscreen",exitFullscreen:"Exit fullscreen",connectingToCamera:"Connecting to camera...",capturingSnapshot:"Capturing snapshot...",connectionLost:"Connection lost",connectionFailed:"Camera connection failed",reconnecting:"Reconnecting in {{countdown}}s... (attempt {{attempt}}/{{max}})",reconnectNow:"Reconnect now",cameraUnavailable:"Camera unavailable",cameraUnavailableDesc:"Make sure the printer is powered on and connected.",noCamera:"No camera available",retry:"Retry",cameraStream:"Camera stream",zoomOut:"Zoom out",zoomIn:"Zoom in",resetZoom:"Reset zoom",recording:"Recording",startRecording:"Start Recording",stopRecording:"Stop Recording",chamberLight:"Toggle chamber light",unavailable:"Camera unavailable",diagnose:{button:"Diagnose",modalTitle:"Camera diagnostic",running:"Running diagnostic...",runFailed:"Diagnostic could not run: {{error}}",retry:"Run again",stage:{tcp_reachable:"Network reachability",first_frame:"Frame capture",live_stream_active:"Live stream active"},summary:{all_ok:"Camera is working. The diagnostic completed all stages successfully.",live_stream_active_healthy:"Camera is currently streaming with recent frames — no test needed.",printer_unreachable:"Printer is not reachable. Check the IP address, network connection, and that the printer is powered on.",camera_port_closed:"Printer is reachable but the camera port is closed. Make sure LAN-only mode and Developer Mode are enabled in the printer settings.",no_frame:"Connected to the camera but no frames were received. Try again, or check that the camera is enabled in the printer settings.",unknown_failure:"Camera diagnostic failed for an unknown reason. Check the support log for details."},meta:{protocol:"Protocol",port:"Port",profile:"Profile"}}},groups:{title:"Group Management",subtitle:"Manage permission groups for access control",backToSettings:"Back to Settings",createGroup:"Create Group",noPermission:"You do not have permission to access this page.",system:"System",noDescription:"No description",usersCount:"{{count}} users",permissionsCount:"{{count}} permissions",edit:"Edit",delete:"Delete",toast:{created:"Group created successfully",updated:"Group updated successfully",deleted:"Group deleted successfully",enterGroupName:"Please enter a group name"},modal:{editGroup:"Edit Group",createGroup:"Create Group",cancel:"Cancel",saving:"Saving...",creating:"Creating...",saveChanges:"Save Changes"},form:{groupName:"Group Name",groupNamePlaceholder:"Enter group name",systemGroupWarning:"System group names cannot be changed",description:"Description",descriptionPlaceholder:"Enter description (optional)",permissions:"Permissions ({{count}} selected)"},deleteModal:{title:"Delete Group",message:"Are you sure you want to delete this group? Users in this group will lose these permissions.",confirm:"Delete Group"},editor:{title:"Edit Group",createTitle:"Create Group",search:"Search permissions...",selectAll:"Select All",clearAll:"Clear All",permissionsSelected:"{{count}} selected",noResults:"No permissions match your search"}},users:{title:"User Management",subtitle:"Manage users and their access to your Bambuddy instance",backToSettings:"Back to Settings",createUser:"Create User",noPermission:"You do not have permission to access this page.",admin:"Admin",noGroups:"No groups",active:"Active",inactive:"Inactive",edit:"Edit",delete:"Delete",system:"System",noGroupsAvailable:"No groups available",table:{username:"Username",groups:"Groups",status:"Status",actions:"Actions"},toast:{created:"User created successfully",updated:"User updated successfully",deleted:"User deleted successfully",fillRequired:"Please fill in all required fields",passwordsDoNotMatch:"Passwords do not match",passwordTooShort:"Password must be at least 6 characters",ldapProvisioned:'Provisioned LDAP user "{{username}}"'},modal:{createUser:"Create User",editUser:"Edit User",cancel:"Cancel",creating:"Creating...",saving:"Saving...",saveChanges:"Save Changes",advancedAuthSubtitle:"with Advanced Authentication",tabsAriaLabel:"User source",localTab:"Local",ldapTab:"LDAP",ldapSearchLabel:"Search directory",ldapSearchPlaceholder:"Type a username, name, or email...",ldapMinChars:"Type at least 2 characters to search",ldapTypeToSearch:"Start typing to search the LDAP directory",ldapSearching:"Searching directory...",ldapNoResults:"No matching users in the directory",ldapSearchError:"Directory search failed. Check the LDAP server status.",ldapAlreadyProvisioned:"Already provisioned",ldapSelectedLabel:"Selected",ldapProvision:"Provision user",ldapProvisioning:"Provisioning...",ldapErrorProvision:"Provisioning failed. Check the LDAP server status and try again."},form:{username:"Username",usernamePlaceholder:"Enter username",email:"Email",emailPlaceholder:"user@example.com",password:"Password",passwordPlaceholder:"Enter password",confirmPassword:"Confirm Password",confirmPasswordPlaceholder:"Confirm password",newPasswordPlaceholder:"Enter new password",confirmNewPasswordPlaceholder:"Confirm new password",leaveBlankToKeep:"leave blank to keep current",groups:"Groups",optional:"optional",autoGeneratedPassword:"A secure password will be automatically generated and emailed to the user.",passwordManagedByAdvancedAuth:'Password is managed by Advanced Authentication. Use "Reset Password" to send a new password to the user via email.',resetPassword:"Reset Password",resettingPassword:"Resetting Password..."},deleteModal:{title:"Delete User",message:"Are you sure you want to delete this user? This action cannot be undone.",confirm:"Delete User"}},streamOverlay:{title:"Stream Overlay",invalidPrinterId:"Invalid printer ID",cameraStream:"Camera stream",progress:"Progress",eta:"ETA",printerIdle:"Printer is idle",printerOffline:"Printer offline",status:{printing:"Printing",paused:"Paused",finished:"Finished",failed:"Failed",idle:"Idle",unknown:"Unknown"}},profiles:{title:"Profiles",subtitle:"Manage your slicer presets and pressure advance calibrations",tabs:{cloud:"Cloud Profiles",local:"Local Profiles",kprofiles:"K-Profiles"},localProfiles:{title:"Local Profiles",subtitle:"Import and manage slicer presets from OrcaSlicer",import:"Import Profiles",importDesc:"Drop .bbscfg, .bbsflmt, .orca_filament, .zip, or .json files here",importing:"Importing...",search:"Search local presets...",noPresets:"No local presets yet",noSearchResults:"No presets match your search",badge:"Local",edit:"Edit",delete:"Delete",cancel:"Cancel",deleteConfirmTitle:"Delete Preset",deleteConfirm:"Are you sure you want to delete this preset? This cannot be undone.",source:"Source",inheritsFrom:"Inherits",filamentType:"Type",vendor:"Vendor",compatiblePrinters:"Printers",nozzleTemp:"Nozzle Temp",cost:"Cost",density:"Density",pressureAdvance:"Pressure Advance",filament:"Filament",process:"Process",printer:"Printer",toast:{importSuccess:"{{count}} preset(s) imported",importSkipped:"{{count}} preset(s) skipped (duplicates)",importError:"{{count}} error(s) during import",deleted:"Preset deleted",updated:"Preset updated"}},connectedAs:"Connected as",logout:"Logout",noLogoutPermission:"You do not have permission to logout",failedToLoad:"Failed to load profiles",retry:"Retry",time:{justNow:"Just now",minsAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",daysAgo:"{{count}}d ago"},toast:{loggedOut:"Logged out"},login:{title:"Connect to Bambu Cloud",subtitle:"Sync your slicer presets across devices",email:"Email",password:"Password",region:"Region",regionGlobal:"Global",regionChina:"China",verificationCode:"Verification Code",totpCode:"Authenticator Code",checkEmail:"Check your email ({{email}}) for a 6-digit code",enterTotpHint:"Enter the 6-digit code from your authenticator app",accessToken:"Access Token",accessTokenHint:"Paste your Bambu Cloud access token. China-region accounts must use this path (phone-bound — email login unavailable). See the wiki for how to retrieve the token from MakerWorld cookies.",back:"Back",loginButton:"Login",verifyButton:"Verify",setTokenButton:"Set Token",useToken:"Use access token instead",useEmail:"Login with email instead",toast:{loggedIn:"Logged in successfully",codeSent:"Verification code sent to your email",enterTotp:"Enter code from your authenticator app",tokenSet:"Token set successfully"}},presets:{myPreset:"My preset (editable)",duplicate:"Duplicate",editable:"Editable",failedToLoadDetails:"Failed to load preset details",deleteConfirm:"Delete this preset?",deleteWarning:'This will permanently delete "{{name}}" from Bambu Cloud. This cannot be undone.',noDuplicatePermission:"You do not have permission to duplicate presets",noEditPermission:"You do not have permission to edit presets",noDeletePermission:"You do not have permission to delete presets",types:{filament:"Filament preset",printer:"Printer preset",process:"Process preset"},toast:{deleted:"Preset deleted",created:"Preset created",updated:"Preset updated",duplicated:"Preset duplicated",fieldAdded:'Field "{{key}}" added',exported:"Preset exported"},baseLabel:"Base: {{name}}",currentLabel:"Current: {{name}}",newPreset:"New Preset",editPreset:"Edit Preset",duplicatePreset:"Duplicate Preset",createNewPreset:"Create New Preset",customizeSettings:"Customize settings for your new preset",compareWithBase:"Compare with base preset",compare:"Compare",basePreset:"Base Preset",selectBasePreset:"Select base preset...",presetName:"Preset Name",myCustomPreset:"My custom preset",inheritsFrom:"Inherits from",dropJsonToImport:"Drop JSON to import",tabs:{common:"Common",allFields:"All Fields"},availableFields:"Available Fields",searchFieldsPlaceholder:"Search fields...",noMatchingFields:"No matching fields",allFieldsAdded:"All fields added",addCustomField:"Add custom field",yourOverrides:"Your Overrides",noOverridesYet:"No overrides yet",clickFieldsToAdd:"Click fields on the left to add them",saveAsTemplate:"Save as template",jsonTip:"Tip: Drag & drop a .json file anywhere on this modal to import settings"},cloudView:{searchPlaceholder:"Search presets...",templates:"Templates",refresh:"Refresh",newPreset:"New Preset",clearFilters:"Clear filters",compareMode:"Compare Mode",selectAnotherPreset:"Select another {{type}} preset",clickTwoPresets:"Click two presets of the same type to compare",selectFirst:"1. Select first",selectSecond:"2. Select second",compareNow:"Compare Now",lastSynced:"Last synced:",showingCount:"Showing {{showing}} of {{total}} presets",noPresetsFound:"No presets found",columns:{filament:"Filament",process:"Process",printer:"Printer"},noFilamentPresets:"No filament presets",noProcessPresets:"No process presets",noPrinterPresets:"No printer presets",filters:{type:"Type",owner:"Owner",printer:"Printer",nozzle:"Nozzle",filament:"Filament",layer:"Layer",all:"All",myPresets:"My Presets",builtIn:"Built-in",process:"Process"},noTemplatesPermission:"You do not have permission to manage templates",noRefreshPermission:"You do not have permission to refresh profiles",noCreatePermission:"You do not have permission to create presets"},templates:{title:"Quick Templates",noTemplates:"No templates yet",createFirst:"Create templates from the preset editor",typeFilter:"Type:",deleteTitle:"Delete Template",deleteWarning:"This action cannot be undone",deleteConfirm:'Are you sure you want to delete "{{name}}"?',namePlaceholder:"Template name",descriptionPlaceholder:"Description",settingsJson:"Settings (JSON)",fieldsCount:"{{count}} fields",shownInModals:"Shown in modals",hiddenInModals:"Hidden in modals",apply:"Apply",toast:{deleted:"Template deleted",updated:"Template updated",created:"Template created",applied:"Template applied"}}},support:{debugLoggingActive:"Debug logging is active",manageLogs:"Manage",collectItem7:"Printer connectivity and firmware versions",collectItem8:"Integration status (Spoolman, MQTT, HA)",collectItem9:"Network interfaces (subnets only)",collectItem10:"Python package versions",collectItem11:"Database health checks",collectItem12:"Docker environment details",bundleGenerating:"Generating bundle...",bundleStepConnection:"Running printer connectivity checks",bundleStepVirtualPrinters:"Running virtual-printer setup checks",bundleStepLogScan:"Scanning recent logs for known issues",bundleStepBuild:"Building the support bundle ZIP"},fileManager:{title:"File Manager",subtitle:"Organize and manage your print files",uploadFiles:"Upload Files",newFolder:"New Folder",folderName:"Folder Name",folderNamePlaceholder:"e.g., Functional Parts",renameFile:"Rename File",renameFolder:"Rename Folder",invalidFilenameChar:'The character "{{char}}" is not allowed in print filenames. The printer SD card rejects: < > : " / \\ | ? *',moveFiles:"Move {{count}} File(s)",rootNoFolder:"Root (No Folder)",current:"current",linkFolder:"Link Folder",linkFolderDescription:'Link "{{name}}" to a project or archive for quick access.',project:"Project",archive:"Archive",noProjectsFound:"No projects found",noArchivesFound:"No archives found",unlink:"Unlink",link:"Link",dragDropFiles:"Drag & drop files here",dropFilesHere:"Drop files here",orClickToBrowse:"or click to browse",allFileTypesSupported:"All file types supported. ZIP files will be extracted.",zipFilesDetected:"ZIP files detected",zipExtractOptions:"ZIP files will be extracted. Choose how to handle folder structure:",preserveZipStructure:"Preserve folder structure from ZIP",createFolderFromZip:"Create folder from ZIP filename",stlThumbnailGeneration:"STL thumbnail generation",zipMayContainStl:"ZIP files may contain STL files. Thumbnails can be generated during extraction.",thumbnailsCanBeGenerated:"Thumbnails can be generated for STL files. Large models may take longer to process.",generateThumbnailsForStl:"Generate thumbnails for STL files",threemfDetected:"3MF files detected",threemfExtractionInfo:"Printer model, material, color, and print settings will be automatically extracted from 3MF files.",willBeExtracted:"Will be extracted",filesExtracted:"{{count}} files extracted",uploadComplete:"Upload complete: {{succeeded}} succeeded",uploadFailed:"Upload failed",zipFilesFailed:"{{count}} files failed",uploading:"Uploading...",changeLink:"Change Link...",linkTo:"Link to...",linkToProjectOrArchive:"Link to project or archive",addToQueue:"Add to Queue",schedulePrint:"Schedule",generateThumbnail:"Generate Thumbnail",generateThumbnails:"Generate Thumbnails",generateThumbnailsForMissing:"Generate thumbnails for STL files missing them",gridView:"Grid view",listView:"List view",lowDiskSpaceWarning:"Low disk space warning",lowDiskSpaceDetails:"Only {{free}} free of {{total}} total. Threshold is set to {{threshold}} GB in settings.",files:"Files",folders:"Folders",size:"Size",free:"Free",allFiles:"All Files",wrap:"Wrap",enableTextWrapping:"Enable text wrapping",disableTextWrapping:"Disable text wrapping",collapse:"Collapse",collapseFoldersByDefault:"Collapse folders by default",expandFoldersByDefault:"Expand folders by default",dragToResizeTooltip:"Drag to resize, double-click to reset",searchFiles:"Search files...",allTypes:"All types",prints:"Prints",ascending:"Ascending",descending:"Descending",resultsCount:"{{showing}} of {{total}} files",selectAll:"Select All",deselectAll:"Deselect All",selected:"{{count}} selected",adding:"Adding...",loadingFiles:"Loading files...",folderIsEmpty:"Folder is empty",noFilesYet:"No files yet",folderEmptyDescription:"Upload files or move files into this folder to get started.",noFilesDescription:"Upload files to start organizing your print-related files.",noMatchingFiles:"No matching files",noMatchingFilesDescription:"No files match your current search or filter criteria.",clearFilters:"Clear filters",printedCount:"Printed {{count}}x",uploadedBy:"Uploaded By",deleteFolder:"Delete Folder",deleteFile:"Delete File",deleteFilesCount:"Delete {{count}} Files",deleteFolderConfirm:"Are you sure you want to delete this folder? All files inside will also be deleted.",deleteFileConfirm:"Are you sure you want to delete this file?",deleteFilesConfirm:"Are you sure you want to delete {{count}} selected files? This action cannot be undone.",deleting:"Deleting...",noPermissionRenameFolder:"You do not have permission to rename folders",noPermissionLinkFolder:"You do not have permission to link folders",noPermissionDeleteFolder:"You do not have permission to delete folders",noPermissionPrint:"You do not have permission to print",noPermissionAddToQueue:"You do not have permission to add to queue",noPermissionSlice:"You do not have permission to slice files",noPermissionDownload:"You do not have permission to download files",noPermissionRenameFile:"You do not have permission to rename this file",noPermissionGenerateThumbnail:"You do not have permission to generate thumbnails",noPermissionDeleteFile:"You do not have permission to delete this file",noPermissionCreateFolder:"You do not have permission to create folders",noPermissionUpload:"You do not have permission to upload files",noPermissionMoveFiles:"You do not have permission to move files",noPermissionDeleteFiles:"You do not have permission to delete files",linkExternal:"Link External",linkExternalFolder:"Link External Folder",linkExternalFolderDescription:"Mount a host directory (NAS, USB, network share) into the File Manager. Files are not copied — they are accessed directly from the original path.",externalFolderNamePlaceholder:"e.g., NAS Prints",externalPath:"Host Path",externalPathHelp:"Absolute path to the directory on the Docker host. Must be bind-mounted into the container.",readOnly:"Read Only",readOnlyHelp:"prevents uploads and deletions",showHiddenFiles:"Show hidden files (dotfiles)",externalFolder:"External Folder",scanFolder:"Scan",toast:{folderCreated:"Folder created",folderDeleted:"Folder deleted",fileDeleted:"File deleted",filesDeleted:"Deleted {{count}} files",filesMoved:"Files moved",folderLinked:"Folder linked",folderUnlinked:"Folder unlinked",externalFolderLinked:"External folder linked and scanned",folderScanned:"Scan complete: {{added}} added, {{removed}} removed",addedToQueue:"Added {{count}} file(s) to queue",addedToQueuePartial:"Added {{added}} file(s), {{failed}} failed",failedToAddToQueue:"Failed to add files: {{error}}",fileRenamed:"File renamed",folderRenamed:"Folder renamed",thumbnailsGenerated:"Generated {{count}} thumbnail(s)",thumbnailsGeneratedPartial:"Generated {{succeeded}} thumbnail(s), {{failed}} failed",noStlMissingThumbnails:"No STL files missing thumbnails",failedToGenerateThumbnails:"Failed to generate thumbnails: {{error}}",thumbnailGenerated:"Thumbnail generated",failedToGenerateThumbnail:"Failed to generate thumbnail: {{error}}"}},projects:{title:"Projects",subtitle:"Organize and track your 3D printing projects",newProject:"New Project",editProject:"Edit Project",deleteProject:"Delete Project",projectName:"Project Name",description:"Description",noProjects:"No projects yet",noProjectsFiltered:"No {{status}} projects",noProjectsFilteredHelp:"You don't have any {{status}} projects. Projects will appear here when their status changes.",createFirst:"Create your first project to start organizing related prints, tracking progress, and managing your builds.",createFirstButton:"Create Your First Project",create:"Create",files:"Files",prints:"Prints",plates:"plates",parts:"parts",lastModified:"Last Modified",deleteConfirm:"Are you sure you want to delete this project? Archives and queue items will be unlinked but not deleted.",addFiles:"Add Files",removeFile:"Remove File",viewDetails:"View Details",namePlaceholder:"e.g., Voron 2.4 Build",descriptionPlaceholder:"Optional description...",urlLabel:"URL",urlPlaceholder:"https://makerworld.com/...",urlInvalid:"URL must start with http:// or https://",openExternalUrl:"Open project URL",coverImageLabel:"Cover photo",coverImageAlt:"Project cover photo",coverImageUpload:"Upload",coverImageReplace:"Replace",coverImageRemove:"Remove",color:"Color",targetPlates:"Target Plates",targetPlatesPlaceholder:"e.g., 25",targetPlatesHelp:"Number of print jobs",targetParts:"Target Parts",targetPartsPlaceholder:"e.g., 150",targetPartsHelp:"Total objects needed",tagsLabel:"Tags (comma-separated)",tagsPlaceholder:"e.g., voron, functional, gift",dueDate:"Due Date",priority:"Priority",priorityLow:"Low",priorityNormal:"Normal",priorityHigh:"High",priorityUrgent:"Urgent",statusActive:"Active",statusCompleted:"Completed",statusArchived:"Archived",done:"Done",completed:"completed",failed:"failed",inQueue:"in queue",noPrintsYet:"No prints yet",printJobs:"Print jobs (plates)",partsPrinted:"Parts printed",failedParts:"Failed parts",import:"Import",export:"Export",importProject:"Import project",exportAll:"Export all projects",loading:"Loading projects...",noEditPermission:"You do not have permission to edit projects",noDeletePermission:"You do not have permission to delete projects",noCreatePermission:"You do not have permission to create projects",noImportPermission:"You do not have permission to import projects",noExportPermission:"You do not have permission to export projects",toast:{created:"Project created",updated:"Project updated",deleted:"Project deleted",imported:"Project imported",multipleImported:"{{count}} projects imported",importFailed:"Import failed",exported:"Projects exported (metadata only)"}},projectDetail:{notFound:"Project not found",backToProjects:"Back to Projects",export:"Export",exportProject:"Export project",noExportPermission:"You do not have permission to export projects",noEditPermission:"You do not have permission to edit projects",partOf:"Part of:",priorityLabel:"Priority:",noPrints:"No prints in this project yet",status:{active:"Active",completed:"Completed",archived:"Archived"},priority:{low:"Low",normal:"Normal",high:"High",urgent:"Urgent"},dueDate:{overdue:"Overdue",today:"Due today",daysLeft:"{{count}} days left"},progress:{platesProgress:"Plates Progress",partsProgress:"Parts Progress",printJobs:"print jobs",parts:"parts",percentComplete:"{{percent}}% complete",remaining:"{{count}} remaining"},stats:{printJobs:"Print Jobs",total:"total",failed:"{{count}} failed",partsPrinted:"{{count}} parts printed",printTime:"Print Time",filamentUsed:"Filament Used"},cost:{title:"Cost Tracking",filamentCost:"Filament Cost",energy:"Energy",totalCost:"Total Cost",total:"Total",includesBom:"incl. BOM",budget:"Budget",remaining:"Remaining"},subProjects:{title:"Sub-projects ({{count}})"},notes:{title:"Notes",noEditPermission:"You do not have permission to edit notes",placeholder:"Add notes about this project...",empty:"No notes yet. Click Edit to add notes."},files:{title:"Files",linkFolders:"Link folders from the File Manager",forQuickAccess:"to this project for quick access.",fileCount:"{{count}} file(s)",empty:"No folders linked. Go to File Manager and link a folder to this project.",noFiles:"No files in this folder.",print:"Print Now",addToQueue:"Add to Queue"},bom:{title:"Bill of Materials",acquired:"{{completed}}/{{total}} acquired",showAll:"Show all",hideDone:"Hide done",addPart:"Add Part",noAddPermission:"You do not have permission to add parts",partNamePlaceholder:"Part name (e.g., M3x8 screws)",partName:"Part name",qty:"Qty",price:"Price ({{currency}})",sourcingUrlPlaceholder:"Sourcing URL (optional)",remarksPlaceholder:"Remarks (optional)",deletePart:"Delete Part",deleteConfirm:'Are you sure you want to delete "{{name}}"?',noUpdatePermission:"You do not have permission to update parts",noEditPermission:"You do not have permission to edit parts",noDeletePermission:"You do not have permission to delete parts",totalCost:"Total cost:",empty:"No parts in the bill of materials. Add hardware, electronics, or other components to track what needs to be sourced."},timeline:{title:"Activity Timeline",empty:"No activity yet."},template:{saveAsTemplate:"Save as Template",noCreatePermission:"You do not have permission to create templates"},queue:{title:"Queue",viewAll:"View all",printing:"{{count}} printing",queued:"{{count}} queued"},prints:{title:"Prints ({{count}})"},toast:{projectUpdated:"Project updated",partAdded:"Part added",partRemoved:"Part removed",exportFailed:"Export failed",projectExported:"Project exported",templateCreated:"Template created"}},system:{title:"System Information",version:"Version",uptime:"Uptime",cpuUsage:"CPU Usage",memoryUsage:"Memory Usage",diskUsage:"Disk Usage",networkInfo:"Network Info",logs:"Logs",debugMode:"Debug Mode",enableDebug:"Enable Debug Logging",disableDebug:"Disable Debug Logging",downloadLogs:"Download Logs",clearLogs:"Clear Logs",dockerInfo:"Docker Info",containerName:"Container Name",imageName:"Image Name",platform:"Platform",architecture:"Architecture"},library:{title:"Filament Library",addFilament:"Add Filament",editFilament:"Edit Filament",deleteFilament:"Delete Filament",vendor:"Vendor",material:"Material",color:"Color",kFactor:"K Factor",temperature:"Temperature",noFilaments:"No filaments in library",deleteConfirm:"Are you sure you want to delete this filament?",importFromPrinter:"Import from Printer",exportToFile:"Export to File"},slice:{title:"Slice model",action:"Slice",actionAll:"Slice all {{count}} plates",actionAllTitle:"Slice every plate into one multi-plate output (single archive). Filament selection covers every slot the project defines.",allPlatesToggle:"Slice all {{count}} plates",slicing:"Slicing…",printer:"Printer profile",process:"Process profile",filament:"Filament profile",filamentSlot:"Filament {{index}} ({{type}})",selectPreset:"— Select a preset —",loadingPresets:"Loading presets…",analyzingPlateFilaments:"Analyzing plate filaments…",analyzingPlateFilamentsHint:"Running a preview slice to discover which AMS slots this plate uses. Cached after — re-opening is instant.",previewToast:"Analyzing {{name}} — {{elapsed}}",previewWithProgress:"Analyzing {{name}} — {{stage}} ({{percent}}%) — {{elapsed}}",notUsedByPlate:"— not used by this plate",noPresetsForSlot:"No presets available",otherPrinters:"Other printers",presetsLoadFailed:"Failed to load presets. Open Settings → Profiles to import them first.",allPresetsRequired:"All presets must be selected",bundle:"Slicer bundle",bundleNone:"— None (pick presets individually) —",bundleAllRequired:"Bundle process and every filament slot must be picked",enqueuing:"Submitting slice job…",queued:"Queued…",failed:"Slicing failed. Check the slicer sidecar logs.",startedToast:"Slicing {{name}} in the background…",queuedToast:"Queued: {{name}} — {{elapsed}}",runningToast:"Slicing {{name}} — {{elapsed}}",runningWithProgress:"{{name}} — {{stage}} ({{percent}}%) — {{elapsed}}",runningWithProgressMultiPlate:"Plate {{plateIndex}} of {{plateCount}} • {{name}} — {{stage}} ({{percent}}%) — {{elapsed}}",completedToast:"Sliced {{name}}",failedTitle:"Slicing failed",failedToast:"Slicing {{name}} failed: {{detail}}",tier:{local:"Imported",cloud:"Cloud",standard:"Standard"},cloud:{notAuthenticated:"Sign in to Bambu Cloud (Settings → Profiles → Cloud) to see your cloud presets.",expired:"Bambu Cloud session expired — sign in again to refresh your cloud presets.",unreachable:"Bambu Cloud is unreachable right now. Local and standard presets still work."},bedType:{label:"Build plate",auto:"Auto (use process preset)",coolPlate:"Cool Plate",coolPlateSuperTack:"Cool Plate SuperTack",engineering:"Engineering Plate",highTemp:"High Temp Plate",texturedPEI:"Textured PEI Plate",smoothPEI:"Smooth PEI Plate"}},spoolman:{title:"Spoolman Integration",enabled:"Spoolman Enabled",url:"Spoolman URL",connected:"Connected",disconnected:"Not Connected",testConnection:"Test Connection",sync:"Sync",syncing:"Syncing...",lastSync:"Last Sync",linkToSpoolman:"Link to Spoolman",openInSpoolman:"Open in Spoolman",unlinkSpool:"Unlink Spool",unlinkConfirmTitle:"Unassign Spool?",unlinkConfirmMessage:"This will remove the spool from this slot. The spool data itself will remain unchanged.",selectSpool:"Select Spool",noUnlinkedSpools:"No unassigned spools available",linkSuccess:"Spool assigned successfully",linkFailed:"Failed to assign spool",unlinkSuccess:"Spool unassigned successfully",unlinkFailed:"Failed to unassign spool",linkedSpool:"Assigned spool",spoolId:"Spool ID",fillSourceLabel:"(Spoolman)",weight:"Weight",remaining:"Remaining",disableWeightSync:"Disable AMS Estimated Weight Sync",disableWeightSyncDesc:"Don't update remaining capacity from AMS estimates. Use this if you prefer Spoolman's usage tracking over AMS percentage-based estimates. New spools will still use the AMS estimate as their initial weight.",reportPartialUsage:"Report Partial Usage for Failed Prints",reportPartialUsageDesc:"When a print fails or is cancelled, report the estimated filament used up to that point based on layer progress."},inventory:{title:"Spool Inventory",subtitle:"Manage your spools",spoolmanMixedContentTitle:"Spoolman can't load over HTTPS — mixed-content blocked by your browser",spoolmanMixedContentBody:"Bambuddy is served over HTTPS (via your reverse proxy), but your Spoolman URL is still plain HTTP. Browsers block mixed content for security, so the embedded Spoolman UI can't render. Spoolman needs to be reachable over HTTPS for this to work.",spoolmanMixedContentFixReverseProxy:"Put Spoolman behind the same reverse proxy as Bambuddy (Traefik / Nginx / Caddy) with HTTPS, then update the Spoolman URL in Settings to the new HTTPS address.",spoolmanMixedContentFixOpenNewTab:"As a workaround, open Spoolman in a new browser tab over HTTP — mixed-content rules only apply to embedded frames, so a standalone tab still works.",spoolmanOpenInNewTab:"Open Spoolman in a new tab",labels:{title:"Print spool labels",selectedCount:"{{count}} selected",pickSpools:"Pick which spools to print labels for:",searchPlaceholder:"Search name, brand, or #ID",filterByMaterial:"Material:",allMaterials:"All",selectVisible:"Select all visible ({{count}})",deselectVisible:"Deselect visible",clearAll:"Clear all",noSpoolsToShow:"No spools to show. Adjust your filter and try again.",noMatches:"No spools match the current search or filter.",printOne:"Print label for this spool",printLabels:"Print labels…",bulkTitle:"Pick spools to print labels for from the {{count}} currently shown",noSpoolsTitle:"No spools to label",error:"Could not generate labels: {{msg}}",sortBy:{label:"Sort:",id:"By ID",color:"By colour"},templates:{amsHolderSmall:{label:"AMS holder — small (74 × 33 mm)",hint:"Single label per page; matches the printable label from MakerWorld model 752566 (AMS Filament Label Holder)."},amsHolderLarge:{label:"AMS holder — large (75 × 55 mm)",hint:"Single label per page; fits the cardstock-insert variant of the AMS Filament Label Holder. Roomy enough for swatch, brand, material, ID, and QR code."},box40x30:{label:"Box label (40 × 30 mm)",hint:"Single label per page; common DK/Brother roll size, good for filament-bag and storage-bin labels."},box:{label:"Box label (62 × 29 mm)",hint:"Single label per page; sized for Brother PT/QL and Dymo small labels."},averyL7160:{label:"Avery L7160 — A4 sheet (38.1 × 63.5 mm × 21)",hint:"EU sheet stock; 21 labels per A4 page."},avery5160:{label:"Avery 5160 — US Letter sheet (25.4 × 66.7 mm × 30)",hint:"US sheet stock; 30 labels per Letter page."}}},addSpool:"Add Spool",editSpool:"Edit Spool",copySpool:"Copy Spool",material:"Material",selectMaterial:"Select material...",subtype:"Subtype",brand:"Brand",searchBrand:"Search brand...",useCustomBrand:'Use "{{brand}}"',useCustomMaterial:"Use custom material: {{material}}",colorName:"Color Name",colorNamePlaceholder:"Jade White, Fire Red...",color:"Color",hexColor:"Hex Color",pickColor:"Pick custom color",labelWeight:"Label Weight",coreWeight:"Empty Spool Weight",searchSpoolWeight:"Search spool weight...",weightUsed:"Used",currentWeight:"Remaining Weight",measuredWeight:"Measured Weight",spoolName:"Spool",costPerKg:"Cost per kg",storageLocation:"Storage Location",storageLocationPlaceholder:"e.g. Shelf A, Drawer 1",openInInventory:"Open in Inventory",measuredWeightError:"Measured weight must be between {{min}}g and {{max}}g.",slicerFilament:"Slicer Filament",slicerFilamentName:"Slicer Preset Name",slicerPreset:"Slicer Preset",searchPresets:"Search filament presets...",selectedPreset:"Selected",noPresetsFound:"No presets found",tempOverrides:"Temperature Overrides",note:"Note",notePlaceholder:"Any additional notes about this spool...",category:"Category",categoryPlaceholder:"e.g. Production, Prototype, Client A",categoryNone:"Uncategorized",storageLocationNone:"No location set",lowStockThresholdOverride:"Low-stock threshold (this spool)",lowStockThresholdOverrideHelp:"Leave blank to use the global threshold ({{global}}%).",clearRfid:"Clear RFID Tag",rfidCleared:"RFID tag cleared",archive:"Archive",restore:"Restore",noSpools:"No spools yet. Add your first spool to get started.",noAvailableSpools:"No spools available. Add a spool to your inventory or unassign one from another slot first.",kProfiles:"K-Profiles",addKProfile:"Add K-Profile",assignSpool:"Assign Spool",unassignSpool:"Unassign",assignSuccess:"Spool assigned and AMS slot configured",assignFailed:"Failed to assign spool",selectSpool:"Select a spool to assign to this slot",assigned:"Assigned",assigning:"Assigning...",searchSpools:"Search spools...",showAllSpools:"Show all spools",spoolmanSpools:"Spoolman Spools",allMaterials:"All Materials",filterByBrand:"Filter by brand...",showArchived:"Show archived",quickAdd:"Quick Add (Stock)",quantity:"Quantity",stock:"Stock",configured:"Configured",spoolsCreated:"{{count}} spools created",spoolsPartiallyCreated:"{{created}} of {{total}} spools created (some failed)",spoolCreated:"Spool created",spoolUpdated:"Spool updated",spoolDeleted:"Spool deleted",deepLinkSpoolNotFound:"Spool not found",deepLinkFetchFailed:"Could not load spool — try again",spoolArchived:"Spool archived",spoolRestored:"Spool restored",kProfileSaveFailed:"K-profile settings could not be saved",syncWeightSpoolNotFound:"Spool not found — it may have been deleted",syncWeightSpoolmanUnreachable:"Spoolman is unreachable — try again later",syncWeightFailed:"Failed to sync weight",spoolmanUnreachable:"Spoolman is not reachable — please try again later",deleteSpoolNotFound:"Spool not found — it may have already been deleted",deleteFailed:"Failed to delete spool",archiveSpoolNotFound:"Spool not found — it may have already been deleted",archiveFailed:"Failed to archive spool",restoreSpoolNotFound:"Spool not found — it may have already been deleted",restoreFailed:"Failed to restore spool",saveFailed:"Failed to save changes",tagClearFailed:"Failed to clear tag",deleteConfirm:"Are you sure you want to delete this spool? This cannot be undone.",archiveConfirm:"Are you sure you want to archive this spool?",advancedSettings:"Advanced Settings",filamentInfoTab:"Filament Info",paProfileTab:"PA Profile",filamentInfo:"Filament",additional:"Additional",loadingPresets:"Loading cloud presets...",cloudConnected:"Cloud connected",cloudNotConnected:"Cloud not connected (using defaults)",recentColors:"Recent",searchColors:"Search colors...",searchResults:"Search results",allColors:"All colors",commonColors:"Common colors",showLess:"Show less",showAll:"Show all",noColorsFound:"No colors match your search",noResults:"No matches found",extraColorsLabel:"Extra colors",extraColorsPlaceholder:"EC984C,#6CD4BC,A66EB9,D87694",extraColorsHint:"Paste 2 to 8 hex stops, separated by commas. Renders as a gradient.",extraColorsInvalid:"Ignored invalid hex: {{tokens}}",colorEffectLabel:"Effect",colorEffect:{none:"None",sparkle:"Sparkle",wood:"Wood",marble:"Marble",glow:"Glow",matte:"Matte",silk:"Silk",galaxy:"Galaxy",rainbow:"Rainbow",metal:"Metal",translucent:"Translucent",gradient:"Gradient",dualColor:"Dual Color",triColor:"Tri Color",multicolor:"Multicolor"},selectMaterialFirst:"Please select a material first in the Filament Info tab.",noPrintersConfigured:"No printers configured. Add printers to use PA profiles.",matchingFilter:"Matching",anyBrand:"Any brand",anyVariant:"Any variant",autoSelect:"Auto-select",matches:"matches",match:"match",noMatches:"No matches",connected:"Connected",offline:"Offline",printerOffline:"Printer is offline. Connect to view calibration profiles.",noKProfilesMatch:"No K-profiles match the selected filament.",leftNozzle:"Left Nozzle",rightNozzle:"Right Nozzle",profilesSelected:"calibration profile(s) selected",totalInventory:"Total Inventory",totalConsumed:"Total Consumed",byMaterial:"By Material",inPrinter:"In Printer",lowStock:"Low Stock",sinceTracking:"Since tracking started",resetUsage:"Reset usage to 0",resetUsageTooltip:"Zero the consumed-grams counter for this spool",resetUsageConfirm:"Reset this spool's consumed-grams counter to 0? Future prints will track from zero again. The spool itself, its remaining weight calculation, and your settings are not changed.",resetAllUsage:"Reset all spool usage",resetAllUsageTooltip:"Zero the consumed-grams counter on every spool",resetAllUsageConfirm:'Reset the consumed-grams counter to 0 on all {{count}} spools (archived ones included)? This clears the "Total Consumed" stat so future prints track from zero. Spools and remaining weights are not changed.',usageReset:"Spool usage reset to 0",allUsageReset:"Reset {{count}} spool(s)",resetUsageFailed:"Failed to reset spool usage",loadedInAms:"Loaded in AMS/Ext",remaining:"Remaining",weightCheck:"Weight Check",lastWeighed:"Last weighed",neverWeighed:"Never weighed",search:"Search spools...",showing:"Showing",to:"to",of:"of",show:"Show",spools:"spools",spool:"spool",page:"Page",noSpoolsMatch:"No results found",noSpoolsMatchDesc:"Try adjusting your search or filters to find what you're looking for.",active:"Active",archived:"Archived",all:"All",used:"Used",new:"New",clearFilters:"Clear filters",table:"Table",cards:"Cards",net:"Net",groupSimilar:"Group",groupedSpools:"{{count}} identical spools",groupedRows:"rows",columns:"Columns",configureColumns:"Configure Columns",configureColumnsDesc:"Drag to reorder columns or use arrows. Toggle visibility with the eye icon.",visible:"visible",reset:"Reset",cancel:"Cancel",applyChanges:"Apply Changes",moveUp:"Move up",moveDown:"Move down",hideColumn:"Hide column",showColumn:"Show column",linkToSpool:"Link to Spool",tagLinked:"Tag linked to spool",tagLinkFailed:"Failed to link tag",tagAlreadyLinked:"Tag already linked to another spool",unknownTag:"Unknown RFID tag detected",usageHistory:"Usage History",noUsageHistory:"No usage recorded yet",printName:"Print Name",weightConsumed:"Weight Consumed",clearHistory:"Clear",historyCleared:"Usage history cleared",fillSourceLabel:"(Inv)",lowStockThresholdError:"Threshold must be between 0.1 and 99.9",assignMismatchTitle:"Material mismatch",assignMismatchMessage:'The selected spool material "{{spoolMaterial}}" does not match the tray material "{{trayMaterial}}" for {{location}}. Assign anyway?',assignMismatchConfirm:"Assign Anyway",assignPartialMismatchMessage:'The spool material "{{spoolMaterial}}" is similar to but not exactly matching "{{trayMaterial}}" in {{location}}. Do you want to proceed?',assignProfileMismatchMessage:'The spool profile "{{spoolProfile}}" does not match the tray profile "{{trayProfile}}" in {{location}}. Do you want to proceed?',assignReconfigureNote:"The AMS slot will be reconfigured to use the spool's profile.",spoolmanFilamentCatalog:"Spoolman Filament Catalog",pickFromSpoolmanCatalog:"Pick from Spoolman catalog…",spoolmanFilamentSelected:"Filament selected from Spoolman catalog",spoolmanFilamentUnlinked:"Filament catalog link cleared",noSpoolmanFilaments:"No filaments found in Spoolman catalog",spoolmanFilamentColorSwatch:"Filament color",spoolWeightManagedBySpoolman:"Empty spool weight is managed per filament type in Spoolman",spoolmanCatalogLoadFailed:"Failed to load Spoolman filament catalog"},timelapse:{title:"Timelapse",create:"Create Timelapse",download:"Download",delete:"Delete",preview:"Preview",frameRate:"Frame Rate",quality:"Quality",processing:"Processing...",noTimelapses:"No timelapses available"},ams:{title:"AMS",slot:"Slot",empty:"Empty",emptySlot:"Empty slot",slotEmpty:"Empty",emptySlotReset:"No filament assigned",unknown:"Unknown",humidity:"Humidity",temperature:"Temperature",filamentType:"Filament Type",filamentColor:"Color",remaining:"Remaining",history:"AMS History",noHistory:"No history available",configureSlot:"Configure Slot",externalSpool:"External Spool",profile:"Profile",kFactor:"K Factor",fill:"Fill",configure:"Configure",used:"used",remainingUnit:"remaining"},printModal:{title:"Start Print",selectPrinter:"Select Printer",selectPlate:"Select Plate",filamentMapping:"Filament Mapping",totalCost:"Total cost:",slotRemainingShort:" - {{grams}}g left",printSettings:"Print Settings",bedLeveling:"Bed Leveling",flowCalibration:"Flow Calibration",vibrationCalibration:"Vibration Calibration",layerInspection:"First Layer Inspection",timelapse:"Timelapse",startPrint:"Start Print",addToQueue:"Add to Queue",cancel:"Cancel",noPrintersAvailable:"No printers available",printerBusy:"Printer is busy",printerOffline:"Printer is offline",sameTypeDifferentColor:"Same type, different color",filamentTypeNotLoaded:"Filament type not loaded",openCalendar:"Open calendar",leftNozzle:"L",rightNozzle:"R",leftNozzleTooltip:"Left nozzle",rightNozzleTooltip:"Right nozzle",filamentOverride:"Filament Override",filamentOverrideHint:"Optionally override filaments for model-based assignment. The scheduler will match against your selected filaments instead of the original 3MF values.",originalFilament:"Original",overrideWith:"Override with",resetToOriginal:"Reset to original",insufficientFilamentTitle:"Not enough filament",insufficientFilamentMessage:"Some assigned spools have less filament remaining than this print needs:",insufficientFilamentLine:"{{printer}} - {{slot}}: needs {{required}}g, remaining {{remaining}}g",printAnyway:"Print anyway",forceColorMatch:"Force color match",staggerPrinterStarts:"Stagger printer starts",staggerGroupSize:"Group size",staggerInterval:"Interval (min)",staggerPreview:"{{printers}} printers → {{groups}} groups of {{size}}, starting every {{interval}} min",staggerLastGroup:"last group: {{count}}",staggerTotal:"total: {{minutes}} min",staggerToPrinters:"Stagger to {{count}} printers",gcodeInjection:"Inject auto-print G-code"},backup:{includesEncryptionKey:"Local backups include the MFA encryption key file (DATA_DIR/.mfa_encryption_key) so a backup ZIP is self-contained. Treat the ZIP as sensitive — anyone with the file can decrypt the OIDC client secrets and TOTP secrets stored inside.",title:"Backup & Restore",createBackup:"Create Backup",restoreBackup:"Restore Backup",restoreDescription:"Replace all data from a backup file",downloadBackup:"Download Backup",uploadBackup:"Upload Backup",lastBackup:"Last Backup",autoBackup:"Auto Backup",backupNow:"Backup Now",restoreWarning:"Warning: Restoring a backup will overwrite all current data.",includeArchives:"Include Archives",includeSettings:"Include Settings",includeProfiles:"Include Profiles",backupSuccess:"Backup created successfully",restoreSuccess:"Backup restored successfully",backupFailed:"Backup failed",restoreFailed:"Restore failed",restoreNote:"Virtual Printer will be stopped during restore",githubBackup:"Git Backup",enabled:"Enabled",cloudLoginRequired:"Bambu Cloud login required. Sign in under Profiles → Cloud Profiles to enable GitHub backup.",cloudLoginRequiredShort:"Cloud login required",githubDescription:"Automatically sync your profiles to a private GitHub repository for backup and version history.",repoIsPrivate:"Repository is private — safe to back up to.",repoIsPublicWarning:"Repository is PUBLIC. Bambuddy backups include MQTT credentials, Home Assistant tokens, Prometheus tokens, your Bambu Cloud email, and printer access codes via K-profiles. Saving is blocked until you make the repository private in your provider's settings.",repoVisibilityUnknown:"Could not determine repository visibility. Bambuddy refuses to back up to anything not confirmed private; saving will be blocked.",repositoryUrl:"Repository URL",repoUrlPlaceholderGitHub:"https://github.com/username/repo-name",repoUrlPlaceholderGitea:"https://gitea.example.com/username/repo-name",repoUrlPlaceholderForgejo:"https://forgejo.example.com/username/repo-name",repoUrlPlaceholderGitLab:"https://gitlab.com/username/repo-name",allowInsecureHttp:"Allow insecure HTTP",allowInsecureHttpHint:"Enable for self-hosted instances on private networks without TLS",personalAccessToken:"Personal Access Token",tokenSaved:"(saved)",enterNewToken:"Enter new token to update",tokenHint:"Fine-grained token with Contents read/write permission",branch:"Branch",provider:"Git Provider",providerGitHub:"GitHub",providerGitLab:"GitLab",providerGitea:"Gitea",providerForgejo:"Forgejo",manualOnly:"Manual only",hourly:"Hourly",daily:"Daily",weekly:"Weekly",includeInBackup:"Include in backup",kProfiles:"K-Profiles",kProfilesDescription:"Pressure advance calibration from connected printers",noPrintersConnected:"No printers connected",printersConnected:"{{connected}}/{{total}} connected",cloudProfiles:"Cloud Profiles",cloudProfilesDescription:"Filament, printer, and process presets from Bambu Cloud",appSettings:"App Settings",appSettingsDescription:"Bambuddy configuration (complete database)",spoolInventory:"Spool Inventory",spoolInventoryDescription:"Filament spools, usage history, and cost tracking",printArchives:"Print Archives",printArchivesDescription:"Print history metadata (no gcode/3MF files)",lastBackupAt:"Last backup:",noBackupsYet:"No backups yet",next:"Next:",startingBackup:"Starting backup...",test:"Test",enableBackup:"Enable Backup",testConnection:"Test Connection",enterRepoUrl:"Enter repository URL",enterRepoAndToken:"Enter repository URL and access token",repoRequired:"Repository URL is required",tokenRequired:"Access token is required",githubBackupEnabled:"GitHub backup enabled",tokenUpdated:"Token updated",settingsSaved:"Settings saved",failedToSave:"Failed to save: {{message}}",backupCompleteFiles:"Backup complete - {{count}} files updated",backupSkippedNoChanges:"Backup skipped - no changes",backupFailed2:"Backup failed: {{message}}",clearedLogs:"Cleared {{count}} logs",failedToClearLogs:"Failed to clear logs: {{message}}",history:"History",clear:"Clear",date:"Date",status:"Status",commit:"Commit",localBackup:"Local Backup",localBackupDescription:"Create a complete backup of your Bambuddy data including the database, archives, uploads, and all files.",downloadBackupLabel:"Download Backup",completeBackupZip:"Complete backup: database + all files (ZIP)",download:"Download",preparingBackup:"Preparing backup...",creatingArchive:"Creating backup archive... This may take a while for large archives.",downloadingFile:"Downloading backup file...",backupDownloaded:"Backup downloaded successfully",failedToCreateBackup:"Failed to create backup: {{message}}",restore:"Restore",restoreReplacesAll:"Restore replaces all data.",restoreReplacesAllDetail:"Your current database and files will be completely replaced. A restart is required after restore.",restoreConfirmTitle:"Restore Backup",restoreConfirmMessage:'Are you sure you want to restore from "{{filename}}"? This will completely replace your current database and all files. The application will need to be restarted after restore.',restoreConfirmButton:"Restore Backup",uploadingFile:"Uploading backup file...",backupRestoredRestart:"Backup restored. Please restart Bambuddy.",failedToRestore:"Failed to restore backup. Please check the file format.",reloadNow:"Reload Now",creatingBackup:"Creating Backup",restoringBackup:"Restoring Backup",preparing:"Preparing...",processing:"Processing...",doNotClosePage:"Please do not close this page or navigate away. This operation may take several minutes for large backups.",restoring:"Restoring...",restoreComplete:"Restore Complete",restoreFailed2:"Restore Failed",importSettings:"Import settings from a backup file",pleaseWaitRestoring:"Please wait while your data is being restored",selectBackupFile:"Click to select backup file (.json or .zip)",duplicateHandling:"How duplicate handling works:",matchPrinters:"Printers",matchPrintersBy:"matched by serial number",matchSmartPlugs:"Smart Plugs",matchSmartPlugsBy:"matched by IP address",matchNotificationProviders:"Notification Providers",matchNotificationProvidersBy:"matched by name",matchFilaments:"Filaments",matchFilamentsBy:"matched by name + type + brand",matchArchives:"Archives",matchArchivesBy:"matched by content hash (always skipped)",matchPendingUploads:"Pending Uploads",matchPendingUploadsBy:"matched by filename",matchSettingsTemplates:"Settings & Templates",matchSettingsTemplatesBy:"always overwritten",replaceExisting:"Replace existing data",keepExisting:"Keep existing data",overwriteDescription:"Overwrite items that already exist with backup data",keepDescription:"Only restore items that don't already exist",overwriteCaution:"Caution:",overwriteWarning:"Overwriting will replace your current configurations with data from the backup. Printer access codes are never overwritten for security.",cancel:"Cancel",processingBackup:"Processing backup file...",itemsRestored:"Items Restored",itemsSkipped:"Items Skipped",restored:"Restored",skippedAlreadyExist:"Skipped (already exist)",filesCategory:"Files (3MF, thumbnails, etc.)",andMore:"...and {{count}} more",newApiKeysGenerated:"New API Keys Generated",keysShownOnce:"These keys are only shown once. Copy them now!",copy:"Copy",noDataFound:"No data was found to restore in the backup file.",close:"Close",scheduledBackup:"Scheduled Backups",scheduledBackupDescription:"Automatically create backup snapshots on a schedule. Output directory can be mounted to a NAS or external storage.",frequency:"Frequency",backupTime:"Time",retention:"Retention",retentionDescription:"Number of backups to keep",outputPath:"Output Path",outputPathPlaceholder:"Default: {{path}}",outputPathDescription:"Leave empty for default location",runNow:"Run Now",backupFiles:"Backup Files",noScheduledBackups:"No backups yet",deleteBackup:"Delete",deleteBackupConfirm:"Delete this backup file?",backupRunning:"Backup in progress...",scheduledBackupComplete:"Backup completed successfully",scheduledBackupFailed:"Backup failed",nextBackup:"Next backup",backupSize:"Size",utc:"UTC",defaultPathLabel:"Default:",categories:{settings:"Settings",notification_providers:"Notification Providers",notification_templates:"Notification Templates",smart_plugs:"Smart Plugs",printers:"Printers",filaments:"Filaments",maintenance_types:"Maintenance Types",archives:"Archives",projects:"Projects",pending_uploads:"Pending Uploads",external_links:"External Links",api_keys:"API Keys"}},tags:{title:"Tags",addTag:"Add Tag",editTag:"Edit Tag",deleteTag:"Delete Tag",tagName:"Tag Name",tagColor:"Tag Color",noTags:"No tags",deleteConfirm:"Are you sure you want to delete this tag?",manageTags:"Manage Tags"},uploadModal:{title:"Upload 3MF Files",dragDrop:"Drag & drop .3mf files here",or:"or",browseFiles:"Browse Files",extractionInfo:"The printer model will be automatically extracted from the 3MF file metadata.",uploaded:"uploaded",failed:"failed",uploading:"Uploading...",upload:"Upload",uploadFailed:"Upload failed"},editArchive:{title:"Edit Archive",name:"Name",namePlaceholder:"Print name",printer:"Printer",noPrinter:"No printer",project:"Project",noProject:"No project",itemsPrinted:"Items Printed",itemsPrintedHelp:"Number of items produced in this print job",notes:"Notes",notesPlaceholder:"Add notes about this print...",externalLink:"External Link",externalLinkPlaceholder:"https://printables.com/model/...",externalLinkHelp:"Link to Printables, Thingiverse, or other source",tags:"Tags",tagsPlaceholder:"Add tags...",addMoreTags:"Add more tags...",matchingTags:'Matching "{{query}}"',existingTags:"Existing tags",clickToAdd:"(click to add)",status:"Status",failureReason:"Failure Reason",selectReason:"Select reason...",photos:"Photos of Printed Result",photosHelp:"Click + to add photos of your printed result",printResult:"Print result",saving:"Saving...",failureReasons:{adhesionFailure:"Adhesion failure",spaghettiDetached:"Spaghetti / Detached",layerShift:"Layer shift",cloggedNozzle:"Clogged nozzle",filamentRunout:"Filament runout",warping:"Warping",stringing:"Stringing",underExtrusion:"Under-extrusion",powerFailure:"Power failure",userCancelled:"User cancelled",other:"Other"},statuses:{completed:"Completed",failed:"Failed",aborted:"Cancelled",printing:"Printing"}},kProfiles:{title:"K-Profiles",noPrintersConfigured:"No Printers Configured",addPrinterInSettings:"Add a printer in Settings to manage K-profiles",noActivePrinters:"No Active Printers",enablePrinterConnection:"Enable a printer connection to view its K-profiles",loadingProfiles:"Loading K-Profiles...",printerOffline:"Printer Offline",printerOfflineDesc:"The selected printer is not connected. Power it on to view K-profiles.",noMatchingProfiles:"No Matching Profiles",noMatchingProfilesDesc:"No profiles match your search criteria",noKProfiles:"No K-Profiles",noKProfilesDesc:"No pressure advance profiles found for {{diameter}}mm nozzle",createFirstProfile:"Create First Profile",printer:"Printer",nozzle:"Nozzle",refresh:"Refresh",addProfile:"Add Profile",export:"Export",import:"Import",select:"Select",selectAll:"Select All",delete:"Delete",searchPlaceholder:"Search by name or filament...",allExtruders:"All Extruders",leftOnly:"Left Only",rightOnly:"Right Only",allFlow:"All Flow",hfOnly:"HF Only",sOnly:"S Only",sortName:"Sort: Name",sortKValue:"Sort: K-Value",sortFilament:"Sort: Filament",leftExtruder:"Left Extruder",rightExtruder:"Right Extruder",modal:{addTitle:"Add K-Profile",editTitle:"Edit K-Profile",profileName:"Profile Name",profileNamePlaceholder:"My PLA Profile",kValue:"K-Value",kValuePlaceholder:"0.020",kValueHelp:"Typical range: 0.01 - 0.06 for PLA, 0.02 - 0.10 for PETG",filament:"Filament",selectFilament:"Select filament...",noFilamentsHelp:"No filaments found. Create a K-profile in Bambu Studio first.",flowType:"Flow Type",highFlow:"High Flow",standard:"Standard",nozzleSize:"Nozzle Size",extruder:"Extruder",extruders:"Extruders",left:"Left",right:"Right",notes:"Notes (stored locally)",notesPlaceholder:"Add notes about this profile...",notesHelp:"Notes are saved in Bambuddy, not on the printer",syncing:"Syncing with printer...",savingExtruder:"Saving to extruder {{current}}/{{total}}...",pleaseWait:"Please wait"},deleteConfirm:{title:"Delete Profile",cannotUndo:"This cannot be undone",message:'Are you sure you want to delete "{{name}}" from the printer?'},bulkDelete:{title:"Delete Profiles",cannotUndo:"This cannot be undone",message:"Are you sure you want to delete {{count}} selected profiles from the printer?"},toast:{profileSaved:"K-profile saved",profilesSaved:"K-profile saved to {{count}} extruders",selectAtLeastOneExtruder:"Please select at least one extruder",profileDeleted:"K-profile deleted",profilesDeleted:"Deleted {{count}} profiles",exportedProfiles:"Exported {{count}} profiles",importedProfiles:"Imported {{count}} of {{total}} profiles",noProfilesToExport:"No profiles to export",invalidFileFormat:"Invalid file format",failedToParseImport:"Failed to parse import file",failedToSaveBatch:"Failed to save K-profiles",noteSaved:"Note saved",failedToSaveNote:"Failed to save note"},permission:{noRead:"You do not have permission to refresh profiles",noCreate:"You do not have permission to add profiles",noUpdate:"You do not have permission to update K-profiles",noDelete:"You do not have permission to delete K-profiles",noExport:"You do not have permission to export profiles",noImport:"You do not have permission to import profiles"}},virtualPrinter:{title:"Virtual Printer",running:"Running",stopped:"Stopped",description:{default:"Enable a virtual printer that appears in Bambu Studio and OrcaSlicer. Files sent to this printer will be archived directly without printing.",proxy:"Enable a proxy that relays slicer traffic to a real printer, allowing remote printing over any network."},enable:{title:"Enable Virtual Printer",visibleInSlicer:'Visible as "Bambuddy" in slicer discovery',proxyingTo:"Proxying to {{name}}",notActive:"Not active"},model:{title:"Printer Model",description:"Select which printer model to emulate.",restartWarning:"Changing the model will restart the virtual printer"},accessCode:{title:"Access Code",isSet:"Access code is set",notSet:"No access code set - required to enable",placeholder:"Enter 8-char code",placeholderChange:"Enter new code to change",hint:"Must be exactly 8 characters. Used by slicers to authenticate.",charCount:"({{count}}/8)"},targetPrinter:{title:"Target Printer",configured:"Proxy target configured",notConfigured:"No target printer selected - required for proxy mode",placeholder:"Select a printer...",hint:"Select the printer to proxy slicer traffic to. The printer must be in LAN mode.",noPrinters:"No printers configured. Add a printer first to use proxy mode."},remoteInterface:{title:"Network Interface Override",configured:"Interface override active",optional:"Optional - use if auto-detected IP is wrong (e.g. multiple NICs, Docker, VPN)",placeholder:"Auto-detect (default)...",hint:"Override the IP address advertised via SSDP and used in the TLS certificate. Useful when Bambuddy has multiple network interfaces."},mode:{title:"Mode",archive:"Archive",archiveDesc:"Archive files immediately",review:"Review",reviewDesc:"Review before archiving",queue:"Queue",queueDesc:"Archive and add to queue",proxy:"Proxy",proxyDesc:"Relay to real printer"},autoDispatch:{title:"Auto-dispatch",description:"Automatically start prints when added to queue. When off, prints wait for manual dispatch."},queueForceColorMatch:{title:"Force color match",description:"Refuse to dispatch onto a printer that does not have the exact filament type and color loaded. Off by default — without this, the queue uses model-only matching and may pick a printer with the wrong color loaded."},tailscaleDisabled:{title:"Tailscale integration",description:"Enable to mark this VP as exposed over Tailscale. Shows the host's Tailscale address so you know which IP to paste into the slicer. The CA-import step is unchanged — this toggle has no effect on certificates."},setupRequired:{title:"Setup Required",description:"The virtual printer feature requires additional system configuration before it will work. This includes port forwarding, firewall rules, and platform-specific settings.",readGuide:"Read the setup guide before enabling"},archiveNameSource:{title:"Archive name source",description:'Choose how new archives are named when files arrive via the virtual printer. "Metadata" uses the slicer-embedded title from the 3MF (default). "Filename" uses the filename Bambu Studio sent over FTP — handy if you renamed the job in the "send to printer" dialog.',metadata:"Metadata",filename:"Filename"},caCert:{title:"Slicer certificate",description:"Virtual printers use a TLS certificate signed by the Bambuddy CA. Import this CA certificate into your slicer's trust store once so it accepts the connection — no need to copy it from the command line.",copy:"Copy",copied:"Copied",download:"Download",fingerprint:"SHA-256"},howItWorks:{title:"How it works",step1:"On the same LAN, virtual printers appear in your slicer (Bambu Studio / OrcaSlicer) automatically via discovery. From other networks, add them manually by IP address and access code.",step2:'In Archive, Review, and Queue modes, use the "Send" button in your slicer to upload 3MF files to Bambuddy. The slicer will show "Print success" — the file is stored, not printed.',step3:"In Proxy mode, the virtual printer relays all traffic to a real printer — prints start immediately as if connected directly."},status:{title:"Status Details",printerName:"Printer Name",model:"Model",serialNumber:"Serial Number",mode:"Mode",pendingFiles:"Pending Files",targetPrinter:"Target Printer",ftpPort:"FTP Port",mqttPort:"MQTT Port",ftpConnections:"FTP Connections",mqttConnections:"MQTT Connections"},toast:{updated:"Virtual printer settings updated",failedToUpdate:"Failed to update settings",copyFailed:"Failed to copy — try selecting the text manually",accessCodeRequired:"Please set an access code first",targetPrinterRequired:"Please select a target printer first",bindIpRequired:"Please set a bind IP first",accessCodeEmpty:"Access code cannot be empty",accessCodeLength:"Access code must be exactly 8 characters",created:"Virtual printer created",failedToCreate:"Failed to create virtual printer",deleted:"Virtual printer deleted",failedToDelete:"Failed to delete virtual printer"},list:{title:"Virtual Printers",add:"Add",addFirst:"Add Virtual Printer",empty:"No virtual printers configured. Add one to get started."},bindIp:{title:"Bind Interface",placeholder:"Select interface...",hint:"Network interface for this virtual printer to bind to. Must be unique per printer."},proxy:{accessCodeHint:"In proxy mode, use your target printer's access code in the slicer. The connection is forwarded transparently to the real printer."},addDialog:{title:"Add Virtual Printer",name:"Name",hint:"You can configure access code, target printer, and other settings after creating.",create:"Create"},deleteConfirm:{title:"Delete Virtual Printer",message:'Are you sure you want to delete "{{name}}"? This will stop all services for this printer.'}},modelViewer:{openInSlicer:"Open in Slicer",tabs:{model:"3D Model",gcode:"G-code Preview"},notAvailable:"not available",notSliced:"not sliced",plates:"Plates",allPlates:"All Plates",plateNumber:"Plate {{number}}",plateCount:"{{count}} plate",plateCount_other:"{{count}} plates",objectCount:"{{count}} object",objectCount_other:"{{count}} objects",filamentCount:"{{count}} filament",filamentCount_other:"{{count}} filaments",eta:"ETA {{minutes}} min",noPreview:"No preview available for this file",pagination:{pageOf:"Page {{current}} of {{total}}",prev:"Prev",next:"Next"},errors:{failedToLoad:"Failed to load file",noMeshes:"No meshes found in 3MF file",unsupportedFormat:"Unsupported file format"}},maintenanceDescriptions:{lubricateCarbonRods:"Apply lubricant to carbon rods for smooth motion",lubricateRails:"Apply lubricant to linear rails for smooth motion",cleanNozzle:"Clean hotend and nozzle to prevent clogs",checkBelts:"Verify belt tension for accurate prints",cleanBuildPlate:"Clean build plate for better adhesion",checkExtruder:"Inspect extruder gears for wear",checkCooling:"Ensure cooling fans are working properly",generalInspection:"General printer inspection",cleanCarbonRods:"Clean carbon rods to reduce friction",lubricateSteelRods:"Apply lubricant to steel rods for smooth motion",cleanSteelRods:"Clean steel rods to reduce friction",cleanLinearRails:"Wipe linear rails to remove dust and debris",checkPtfeTube:"Inspect PTFE tube for wear or damage",replaceHepaFilter:"Replace HEPA filter for air quality",replaceCarbonFilter:"Replace activated carbon filter",lubricateLeftNozzleRail:"Lubricate left nozzle rail (H2 series)"},smartPlugs:{offline:"Offline",admin:"Admin",openPlugAdminPage:"Open plug admin page",deleteSmartPlug:"Delete Smart Plug",turnOnSmartPlug:"Turn On Smart Plug",turnOffSmartPlug:"Turn Off Smart Plug",turnOn:"Turn On",turnOff:"Turn Off",addSmartPlug:{scanningNetwork:"Scanning network...",chooseEntity:"Choose an entity...",connectionFailed:"Connection failed",searchEntities:"Search entities...",searchPowerSensors:"Search power sensors...",searchEnergySensors:"Search energy sensors...",placeholders:{plugName:"Living Room Plug",mqttStateOnValue:"ON, true, 1",mqttSameAsPower:"Same as power topic, or different"}},linkedTo:"Linked to:",monitorOnly:"Monitor Only",alerts:"Alerts",scheduleOn:"On {{time}}",scheduleOff:"Off {{time}}",on:"On",off:"Off",power:"Power",kwhToday:"kWh Today",settings:"Settings",automationSettings:"Automation Settings",showInSwitchbar:"Show in Switchbar",quickAccessSidebar:"Quick access from sidebar",enabled:"Enabled",enableAutomation:"Enable automation for this plug",autoOn:"Auto On",autoOnDescription:"Turn on when print starts",autoOff:"Auto Off",autoOffDescription:"Turn off when print completes (one-shot)",autoOffPersistent:"Keep Enabled",autoOffPersistentDescription:"Stay enabled between prints instead of one-shot",autoOffAfterDrying:"Auto Off After Drying",autoOffAfterDryingDescription:"Turn off when AMS drying completes",delayAfterDryingMinutes:"Drying delay (minutes)",turnOffDelayMode:"Turn Off Delay Mode",time:"Time",temp:"Temp",delayMinutes:"Delay (minutes)",tempThreshold:"Temperature threshold (°C)",tempThresholdDescription:"Turns off when nozzle cools below this temperature",edit:"Edit",deleteConfirm:'Are you sure you want to delete "{{name}}"? This cannot be undone.',turnOnConfirm:'Are you sure you want to turn on "{{name}}"?',turnOffConfirm:'Are you sure you want to turn off "{{name}}"? This will cut power to the connected device.',failedToTurn:'Failed to turn {{action}} "{{name}}"',unknown:"Unknown",addTitle:"Add Smart Plug",editTitle:"Edit Smart Plug",stopScanning:"Stop Scanning",discoverTasmota:"Discover Tasmota Devices",foundDevices:"Found {{count}} device(s) - click to select:",noDevicesFound:"No Tasmota devices found on your network",haNotConfigured:"Home Assistant is not configured. Set it up in",haSettingsPath:"Settings → Network → Home Assistant",selectEntity:"Select Entity *",ipAddress:"IP Address *",nameLabel:"Name *",username:"Username",password:"Password",authHint:"Leave empty if your Tasmota device doesn't require authentication",linkToPrinter:"Link to Printer",noPrinter:"No printer (manual control only)",linkingDescription:"Linking enables automatic on/off when prints start/complete",powerAlerts:"Power Alerts",alertAbove:"Alert if above (W)",alertBelow:"Alert if below (W)",alertDescription:"Get notified when power consumption crosses these thresholds. Leave empty to disable that direction.",dailySchedule:"Daily Schedule",turnOnAt:"Turn On at",turnOffAt:"Turn Off at",scheduleDescription:"Automatically turn the plug on/off at these times daily. Leave empty to skip that action.",showOnPrinterCard:"Show on Printer Card",displayOnPrinterCard:"Display button on printer card",connectedResult:"Connected!",deviceLabel:"Device: {{name}} - ",stateLabel:"State: {{state}}",test:"Test",delete:"Delete",save:"Save",add:"Add",cancel:"Cancel",failedToStartScan:"Failed to start scan",nameRequired:"Name is required",entityRequired:"Entity is required for Home Assistant plugs",mqttTopicRequired:"At least one MQTT topic must be configured for power, energy, or state monitoring",loadingEntities:"Loading entities...",loading:"Loading...",failedToLoadEntities:"Failed to load entities: {{error}}",noEntitiesMatching:'No entities found matching "{{search}}"',noEntitiesAvailable:"No entities available",searchingEntities:"Searching all entities ({{count}} found)",showingEntities:"Showing switch, light, input_boolean ({{count}} available)",energyMonitoringOptional:"Energy Monitoring (Optional)",energyMonitoringHint:"Search and select sensors that provide power/energy data.",powerSensorW:"Power Sensor (W)",energyTodayKwh:"Energy Today (kWh)",totalEnergyKwh:"Total Energy (kWh)",noMatchingSensors:"No matching sensors",none:"None",mqttNotConfigured:"MQTT broker not configured. Set broker address in",mqttSettingsPath:"Settings → Network → MQTT Publishing",mqttNotConfiguredSuffix:"(you don't need to enable publishing, just fill in the broker details).",mqttMonitorOnlyDescription:"MQTT plugs receive power/energy data via MQTT subscription. On/off control is not available - use your MQTT broker or home automation system.",powerMonitoring:"Power Monitoring",energyMonitoring:"Energy Monitoring",stateMonitoring:"State Monitoring",optional:"optional",topic:"Topic",jsonPath:"JSON Path",multiplier:"Multiplier",onValue:"ON Value",mqttPowerHint:`JSON path extracts value from JSON payload (e.g., "power_l1"). Leave empty if topic publishes raw numeric values. +`);for(V=E=0;EV||mt[E]!==Et[V]){var Ht=` +`+mt[E].replace(" at new "," at ");return h.displayName&&Ht.includes("")&&(Ht=Ht.replace("",h.displayName)),Ht}while(1<=E&&0<=V);break}}}finally{G=!1,Error.prepareStackTrace=_}return(_=h?h.displayName||h.name:"")?U(_):""}function Z(h,w){switch(h.tag){case 26:case 27:case 5:return U(h.type);case 16:return U("Lazy");case 13:return h.child!==w&&w!==null?U("Suspense Fallback"):U("Suspense");case 19:return U("SuspenseList");case 0:case 15:return K(h.type,!1);case 11:return K(h.type.render,!1);case 1:return K(h.type,!0);case 31:return U("Activity");default:return""}}function ie(h){try{var w="",_=null;do w+=Z(h,_),_=h,h=h.return;while(h);return w}catch(E){return` +Error generating stack: `+E.message+` +`+E.stack}}var oe=Object.prototype.hasOwnProperty,he=t.unstable_scheduleCallback,ce=t.unstable_cancelCallback,fe=t.unstable_shouldYield,$=t.unstable_requestPaint,I=t.unstable_now,ae=t.unstable_getCurrentPriorityLevel,ge=t.unstable_ImmediatePriority,xe=t.unstable_UserBlockingPriority,ve=t.unstable_NormalPriority,je=t.unstable_LowPriority,Me=t.unstable_IdlePriority,Se=t.log,Be=t.unstable_setDisableYieldValue,_e=null,Ie=null;function Fe(h){if(typeof Se=="function"&&Be(h),Ie&&typeof Ie.setStrictMode=="function")try{Ie.setStrictMode(_e,h)}catch{}}var He=Math.clz32?Math.clz32:Le,ze=Math.log,it=Math.LN2;function Le(h){return h>>>=0,h===0?32:31-(ze(h)/it|0)|0}var st=256,Te=262144,Xe=4194304;function Ve(h){var w=h&42;if(w!==0)return w;switch(h&-h){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return h&261888;case 262144:case 524288:case 1048576:case 2097152:return h&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return h&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return h}}function Ce(h,w,_){var E=h.pendingLanes;if(E===0)return 0;var V=0,te=h.suspendedLanes,we=h.pingedLanes;h=h.warmLanes;var qe=E&134217727;return qe!==0?(E=qe&~te,E!==0?V=Ve(E):(we&=qe,we!==0?V=Ve(we):_||(_=qe&~h,_!==0&&(V=Ve(_))))):(qe=E&~te,qe!==0?V=Ve(qe):we!==0?V=Ve(we):_||(_=E&~h,_!==0&&(V=Ve(_)))),V===0?0:w!==0&&w!==V&&(w&te)===0&&(te=V&-V,_=w&-w,te>=_||te===32&&(_&4194048)!==0)?w:V}function Oe(h,w){return(h.pendingLanes&~(h.suspendedLanes&~h.pingedLanes)&w)===0}function et(h,w){switch(h){case 1:case 2:case 4:case 8:case 64:return w+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return w+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function We(){var h=Xe;return Xe<<=1,(Xe&62914560)===0&&(Xe=4194304),h}function Ae(h){for(var w=[],_=0;31>_;_++)w.push(h);return w}function at(h,w){h.pendingLanes|=w,w!==268435456&&(h.suspendedLanes=0,h.pingedLanes=0,h.warmLanes=0)}function nt(h,w,_,E,V,te){var we=h.pendingLanes;h.pendingLanes=_,h.suspendedLanes=0,h.pingedLanes=0,h.warmLanes=0,h.expiredLanes&=_,h.entangledLanes&=_,h.errorRecoveryDisabledLanes&=_,h.shellSuspendCounter=0;var qe=h.entanglements,mt=h.expirationTimes,Et=h.hiddenUpdates;for(_=we&~_;0<_;){var Ht=31-He(_),Gt=1<"u")return null;try{return h.activeElement||h.body}catch{return h.body}}var zn=/[\n"\\]/g;function Oa(h){return h.replace(zn,function(w){return"\\"+w.charCodeAt(0).toString(16)+" "})}function Br(h,w,_,E,V,te,we,qe){h.name="",we!=null&&typeof we!="function"&&typeof we!="symbol"&&typeof we!="boolean"?h.type=we:h.removeAttribute("type"),w!=null?we==="number"?(w===0&&h.value===""||h.value!=w)&&(h.value=""+da(w)):h.value!==""+da(w)&&(h.value=""+da(w)):we!=="submit"&&we!=="reset"||h.removeAttribute("value"),w!=null?ur(h,we,da(w)):_!=null?ur(h,we,da(_)):E!=null&&h.removeAttribute("value"),V==null&&te!=null&&(h.defaultChecked=!!te),V!=null&&(h.checked=V&&typeof V!="function"&&typeof V!="symbol"),qe!=null&&typeof qe!="function"&&typeof qe!="symbol"&&typeof qe!="boolean"?h.name=""+da(qe):h.removeAttribute("name")}function Ua(h,w,_,E,V,te,we,qe){if(te!=null&&typeof te!="function"&&typeof te!="symbol"&&typeof te!="boolean"&&(h.type=te),w!=null||_!=null){if(!(te!=="submit"&&te!=="reset"||w!=null)){ma(h);return}_=_!=null?""+da(_):"",w=w!=null?""+da(w):_,qe||w===h.value||(h.value=w),h.defaultValue=w}E=E??V,E=typeof E!="function"&&typeof E!="symbol"&&!!E,h.checked=qe?h.checked:!!E,h.defaultChecked=!!E,we!=null&&typeof we!="function"&&typeof we!="symbol"&&typeof we!="boolean"&&(h.name=we),ma(h)}function ur(h,w,_){w==="number"&&Ya(h.ownerDocument)===h||h.defaultValue===""+_||(h.defaultValue=""+_)}function Mn(h,w,_,E){if(h=h.options,w){w={};for(var V=0;V<_.length;V++)w["$"+_[V]]=!0;for(_=0;_"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hp=!1;if(Xa)try{var _d={};Object.defineProperty(_d,"passive",{get:function(){hp=!0}}),window.addEventListener("test",_d,_d),window.removeEventListener("test",_d,_d)}catch{hp=!1}var li=null,Au=null,vi=null;function yf(){if(vi)return vi;var h,w=Au,_=w.length,E,V="value"in li?li.value:li.textContent,te=V.length;for(h=0;h<_&&w[h]===V[h];h++);var we=_-h;for(E=1;E<=we&&w[_-E]===V[te-E];E++);return vi=V.slice(h,1=di),yp=" ",_b=!1;function ye(h,w){switch(h){case"keyup":return kv.indexOf(w.keyCode)!==-1;case"keydown":return w.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zt(h){return h=h.detail,typeof h=="object"&&"data"in h?h.data:null}var la=!1;function Ta(h,w){switch(h){case"compositionend":return zt(w);case"keypress":return w.which!==32?null:(_b=!0,yp);case"textInput":return h=w.data,h===yp&&_b?null:h;default:return null}}function Ba(h,w){if(la)return h==="compositionend"||!il&&ye(h,w)?(h=yf(),vi=Au=li=null,la=!1,h):null;switch(h){case"paste":return null;case"keypress":if(!(w.ctrlKey||w.altKey||w.metaKey)||w.ctrlKey&&w.altKey){if(w.char&&1=w)return{node:_,offset:w-h};h=E}e:{for(;_;){if(_.nextSibling){_=_.nextSibling;break e}_=_.parentNode}_=void 0}_=Eo(_)}}function Do(h,w){return h&&w?h===w?!0:h&&h.nodeType===3?!1:w&&w.nodeType===3?Do(h,w.parentNode):"contains"in h?h.contains(w):h.compareDocumentPosition?!!(h.compareDocumentPosition(w)&16):!1:!1}function uo(h){h=h!=null&&h.ownerDocument!=null&&h.ownerDocument.defaultView!=null?h.ownerDocument.defaultView:window;for(var w=Ya(h.document);w instanceof h.HTMLIFrameElement;){try{var _=typeof w.contentWindow.location.href=="string"}catch{_=!1}if(_)h=w.contentWindow;else break;w=Ya(h.document)}return w}function wi(h){var w=h&&h.nodeName&&h.nodeName.toLowerCase();return w&&(w==="input"&&(h.type==="text"||h.type==="search"||h.type==="tel"||h.type==="url"||h.type==="password")||w==="textarea"||h.contentEditable==="true")}var Ad=Xa&&"documentMode"in document&&11>=document.documentMode,mi=null,hn=null,En=null,Yr=!1;function vp(h,w,_){var E=_.window===_?_.document:_.nodeType===9?_:_.ownerDocument;Yr||mi==null||mi!==Ya(E)||(E=mi,"selectionStart"in E&&wi(E)?E={start:E.selectionStart,end:E.selectionEnd}:(E=(E.ownerDocument&&E.ownerDocument.defaultView||window).getSelection(),E={anchorNode:E.anchorNode,anchorOffset:E.anchorOffset,focusNode:E.focusNode,focusOffset:E.focusOffset}),En&&vs(En,E)||(En=E,E=p_(hn,"onSelect"),0>=we,V-=we,Md=1<<32-He(w)+V|_<tn?(_n=Ca,Ca=null):_n=Ca.sibling;var Rn=Lt(kt,Ca,jt[tn],Vt);if(Rn===null){Ca===null&&(Ca=_n);break}h&&Ca&&Rn.alternate===null&&w(kt,Ca),xt=te(Rn,xt,tn),Ln===null?Da=Rn:Ln.sibling=Rn,Ln=Rn,Ca=_n}if(tn===jt.length)return _(kt,Ca),Cn&&Iu(kt,tn),Da;if(Ca===null){for(;tntn?(_n=Ca,Ca=null):_n=Ca.sibling;var qp=Lt(kt,Ca,Rn.value,Vt);if(qp===null){Ca===null&&(Ca=_n);break}h&&Ca&&qp.alternate===null&&w(kt,Ca),xt=te(qp,xt,tn),Ln===null?Da=qp:Ln.sibling=qp,Ln=qp,Ca=_n}if(Rn.done)return _(kt,Ca),Cn&&Iu(kt,tn),Da;if(Ca===null){for(;!Rn.done;tn++,Rn=jt.next())Rn=Gt(kt,Rn.value,Vt),Rn!==null&&(xt=te(Rn,xt,tn),Ln===null?Da=Rn:Ln.sibling=Rn,Ln=Rn);return Cn&&Iu(kt,tn),Da}for(Ca=E(Ca);!Rn.done;tn++,Rn=jt.next())Rn=Ut(Ca,kt,tn,Rn.value,Vt),Rn!==null&&(h&&Rn.alternate!==null&&Ca.delete(Rn.key===null?tn:Rn.key),xt=te(Rn,xt,tn),Ln===null?Da=Rn:Ln.sibling=Rn,Ln=Rn);return h&&Ca.forEach(function(nme){return w(kt,nme)}),Cn&&Iu(kt,tn),Da}function ar(kt,xt,jt,Vt){if(typeof jt=="object"&&jt!==null&&jt.type===v&&jt.key===null&&(jt=jt.props.children),typeof jt=="object"&&jt!==null){switch(jt.$$typeof){case f:e:{for(var Da=jt.key;xt!==null;){if(xt.key===Da){if(Da=jt.type,Da===v){if(xt.tag===7){_(kt,xt.sibling),Vt=V(xt,jt.props.children),Vt.return=kt,kt=Vt;break e}}else if(xt.elementType===Da||typeof Da=="object"&&Da!==null&&Da.$$typeof===F&&Af(Da)===xt.type){_(kt,xt.sibling),Vt=V(xt,jt.props),Av(Vt,jt),Vt.return=kt,kt=Vt;break e}_(kt,xt);break}else w(kt,xt);xt=xt.sibling}jt.type===v?(Vt=_f(jt.props.children,kt.mode,Vt,jt.key),Vt.return=kt,kt=Vt):(Vt=jk(jt.type,jt.key,jt.props,null,kt.mode,Vt),Av(Vt,jt),Vt.return=kt,kt=Vt)}return we(kt);case g:e:{for(Da=jt.key;xt!==null;){if(xt.key===Da)if(xt.tag===4&&xt.stateNode.containerInfo===jt.containerInfo&&xt.stateNode.implementation===jt.implementation){_(kt,xt.sibling),Vt=V(xt,jt.children||[]),Vt.return=kt,kt=Vt;break e}else{_(kt,xt);break}else w(kt,xt);xt=xt.sibling}Vt=Sj(jt,kt.mode,Vt),Vt.return=kt,kt=Vt}return we(kt);case F:return jt=Af(jt),ar(kt,xt,jt,Vt)}if(Q(jt))return wa(kt,xt,jt,Vt);if(z(jt)){if(Da=z(jt),typeof Da!="function")throw Error(r(150));return jt=Da.call(jt),Ia(kt,xt,jt,Vt)}if(typeof jt.then=="function")return ar(kt,xt,Ik(jt),Vt);if(jt.$$typeof===k)return ar(kt,xt,Dk(kt,jt),Vt);Ok(kt,jt)}return typeof jt=="string"&&jt!==""||typeof jt=="number"||typeof jt=="bigint"?(jt=""+jt,xt!==null&&xt.tag===6?(_(kt,xt.sibling),Vt=V(xt,jt),Vt.return=kt,kt=Vt):(_(kt,xt),Vt=wj(jt,kt.mode,Vt),Vt.return=kt,kt=Vt),we(kt)):_(kt,xt)}return function(kt,xt,jt,Vt){try{Tv=0;var Da=ar(kt,xt,jt,Vt);return Fb=null,Da}catch(Ca){if(Ca===Db||Ca===Lk)throw Ca;var Ln=sl(29,Ca,null,kt.mode);return Ln.lanes=Vt,Ln.return=kt,Ln}}}var Mf=qU(!0),HU=qU(!1),Np=!1;function Fj(h){h.updateQueue={baseState:h.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lj(h,w){h=h.updateQueue,w.updateQueue===h&&(w.updateQueue={baseState:h.baseState,firstBaseUpdate:h.firstBaseUpdate,lastBaseUpdate:h.lastBaseUpdate,shared:h.shared,callbacks:null})}function Cp(h){return{lane:h,tag:0,payload:null,callback:null,next:null}}function Pp(h,w,_){var E=h.updateQueue;if(E===null)return null;if(E=E.shared,(Bn&2)!==0){var V=E.pending;return V===null?w.next=w:(w.next=V.next,V.next=w),E.pending=w,w=Ak(h),CU(h,null,_),w}return Tk(h,E,w,_),Ak(h)}function jv(h,w,_){if(w=w.updateQueue,w!==null&&(w=w.shared,(_&4194048)!==0)){var E=w.lanes;E&=h.pendingLanes,_|=E,w.lanes=_,Bt(h,_)}}function Rj(h,w){var _=h.updateQueue,E=h.alternate;if(E!==null&&(E=E.updateQueue,_===E)){var V=null,te=null;if(_=_.firstBaseUpdate,_!==null){do{var we={lane:_.lane,tag:_.tag,payload:_.payload,callback:null,next:null};te===null?V=te=we:te=te.next=we,_=_.next}while(_!==null);te===null?V=te=w:te=te.next=w}else V=te=w;_={baseState:E.baseState,firstBaseUpdate:V,lastBaseUpdate:te,shared:E.shared,callbacks:E.callbacks},h.updateQueue=_;return}h=_.lastBaseUpdate,h===null?_.firstBaseUpdate=w:h.next=w,_.lastBaseUpdate=w}var Ij=!1;function Mv(){if(Ij){var h=Eb;if(h!==null)throw h}}function Ev(h,w,_,E){Ij=!1;var V=h.updateQueue;Np=!1;var te=V.firstBaseUpdate,we=V.lastBaseUpdate,qe=V.shared.pending;if(qe!==null){V.shared.pending=null;var mt=qe,Et=mt.next;mt.next=null,we===null?te=Et:we.next=Et,we=mt;var Ht=h.alternate;Ht!==null&&(Ht=Ht.updateQueue,qe=Ht.lastBaseUpdate,qe!==we&&(qe===null?Ht.firstBaseUpdate=Et:qe.next=Et,Ht.lastBaseUpdate=mt))}if(te!==null){var Gt=V.baseState;we=0,Ht=Et=mt=null,qe=te;do{var Lt=qe.lane&-536870913,Ut=Lt!==qe.lane;if(Ut?(kn&Lt)===Lt:(E&Lt)===Lt){Lt!==0&&Lt===Mb&&(Ij=!0),Ht!==null&&(Ht=Ht.next={lane:0,tag:qe.tag,payload:qe.payload,callback:null,next:null});e:{var wa=h,Ia=qe;Lt=w;var ar=_;switch(Ia.tag){case 1:if(wa=Ia.payload,typeof wa=="function"){Gt=wa.call(ar,Gt,Lt);break e}Gt=wa;break e;case 3:wa.flags=wa.flags&-65537|128;case 0:if(wa=Ia.payload,Lt=typeof wa=="function"?wa.call(ar,Gt,Lt):wa,Lt==null)break e;Gt=m({},Gt,Lt);break e;case 2:Np=!0}}Lt=qe.callback,Lt!==null&&(h.flags|=64,Ut&&(h.flags|=8192),Ut=V.callbacks,Ut===null?V.callbacks=[Lt]:Ut.push(Lt))}else Ut={lane:Lt,tag:qe.tag,payload:qe.payload,callback:qe.callback,next:null},Ht===null?(Et=Ht=Ut,mt=Gt):Ht=Ht.next=Ut,we|=Lt;if(qe=qe.next,qe===null){if(qe=V.shared.pending,qe===null)break;Ut=qe,qe=Ut.next,Ut.next=null,V.lastBaseUpdate=Ut,V.shared.pending=null}}while(!0);Ht===null&&(mt=Gt),V.baseState=mt,V.firstBaseUpdate=Et,V.lastBaseUpdate=Ht,te===null&&(V.shared.lanes=0),Ep|=we,h.lanes=we,h.memoizedState=Gt}}function $U(h,w){if(typeof h!="function")throw Error(r(191,h));h.call(w)}function VU(h,w){var _=h.callbacks;if(_!==null)for(h.callbacks=null,h=0;h<_.length;h++)$U(_[h],w)}var Lb=Y(null),zk=Y(0);function GU(h,w){h=Ku,pe(zk,h),pe(Lb,w),Ku=h|w.baseLanes}function Oj(){pe(zk,Ku),pe(Lb,Lb.current)}function zj(){Ku=zk.current,se(Lb),se(zk)}var ol=Y(null),Ql=null;function Tp(h){var w=h.alternate;pe(pi,pi.current&1),pe(ol,h),Ql===null&&(w===null||Lb.current!==null||w.memoizedState!==null)&&(Ql=h)}function Uj(h){pe(pi,pi.current),pe(ol,h),Ql===null&&(Ql=h)}function WU(h){h.tag===22?(pe(pi,pi.current),pe(ol,h),Ql===null&&(Ql=h)):Ap()}function Ap(){pe(pi,pi.current),pe(ol,ol.current)}function ll(h){se(ol),Ql===h&&(Ql=null),se(pi)}var pi=Y(0);function Uk(h){for(var w=h;w!==null;){if(w.tag===13){var _=w.memoizedState;if(_!==null&&(_=_.dehydrated,_===null||GM(_)||WM(_)))return w}else if(w.tag===19&&(w.memoizedProps.revealOrder==="forwards"||w.memoizedProps.revealOrder==="backwards"||w.memoizedProps.revealOrder==="unstable_legacy-backwards"||w.memoizedProps.revealOrder==="together")){if((w.flags&128)!==0)return w}else if(w.child!==null){w.child.return=w,w=w.child;continue}if(w===h)break;for(;w.sibling===null;){if(w.return===null||w.return===h)return null;w=w.return}w.sibling.return=w.return,w=w.sibling}return null}var Uu=0,Za=null,er=null,ki=null,Bk=!1,Rb=!1,Ef=!1,qk=0,Dv=0,Ib=null,Wde=0;function Xr(){throw Error(r(321))}function Bj(h,w){if(w===null)return!1;for(var _=0;_te?te:8;var we=ee.T,qe={};ee.T=qe,aM(h,!1,w,_);try{var mt=V(),Et=ee.S;if(Et!==null&&Et(qe,mt),mt!==null&&typeof mt=="object"&&typeof mt.then=="function"){var Ht=Gde(mt,E);Lv(h,w,Ht,ul(h))}else Lv(h,w,E,ul(h))}catch(Gt){Lv(h,w,{then:function(){},status:"rejected",reason:Gt},ul())}finally{J.p=te,we!==null&&qe.types!==null&&(we.types=qe.types),ee.T=we}}function Zde(){}function eM(h,w,_,E){if(h.tag!==5)throw Error(r(476));var V=kB(h).queue;SB(h,V,w,le,_===null?Zde:function(){return _B(h),_(E)})}function kB(h){var w=h.memoizedState;if(w!==null)return w;w={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bu,lastRenderedState:le},next:null};var _={};return w.next={memoizedState:_,baseState:_,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bu,lastRenderedState:_},next:null},h.memoizedState=w,h=h.alternate,h!==null&&(h.memoizedState=w),w}function _B(h){var w=kB(h);w.next===null&&(w=h.alternate.memoizedState),Lv(h,w.next.queue,{},ul())}function tM(){return Ss(Zv)}function NB(){return hi().memoizedState}function CB(){return hi().memoizedState}function Jde(h){for(var w=h.return;w!==null;){switch(w.tag){case 24:case 3:var _=ul();h=Cp(_);var E=Pp(w,h,_);E!==null&&(Oo(E,w,_),jv(E,w,_)),w={cache:jj()},h.payload=w;return}w=w.return}}function eue(h,w,_){var E=ul();_={lane:E,revertLane:0,gesture:null,action:_,hasEagerState:!1,eagerState:null,next:null},Kk(h)?TB(w,_):(_=yj(h,w,_,E),_!==null&&(Oo(_,h,E),AB(_,w,E)))}function PB(h,w,_){var E=ul();Lv(h,w,_,E)}function Lv(h,w,_,E){var V={lane:E,revertLane:0,gesture:null,action:_,hasEagerState:!1,eagerState:null,next:null};if(Kk(h))TB(w,V);else{var te=h.alternate;if(h.lanes===0&&(te===null||te.lanes===0)&&(te=w.lastRenderedReducer,te!==null))try{var we=w.lastRenderedState,qe=te(we,_);if(V.hasEagerState=!0,V.eagerState=qe,Mr(qe,we))return Tk(h,w,V,0),hr===null&&Pk(),!1}catch{}if(_=yj(h,w,V,E),_!==null)return Oo(_,h,E),AB(_,w,E),!0}return!1}function aM(h,w,_,E){if(E={lane:2,revertLane:FM(),gesture:null,action:E,hasEagerState:!1,eagerState:null,next:null},Kk(h)){if(w)throw Error(r(479))}else w=yj(h,_,E,2),w!==null&&Oo(w,h,2)}function Kk(h){var w=h.alternate;return h===Za||w!==null&&w===Za}function TB(h,w){Rb=Bk=!0;var _=h.pending;_===null?w.next=w:(w.next=_.next,_.next=w),h.pending=w}function AB(h,w,_){if((_&4194048)!==0){var E=w.lanes;E&=h.pendingLanes,_|=E,w.lanes=_,Bt(h,_)}}var Rv={readContext:Ss,use:$k,useCallback:Xr,useContext:Xr,useEffect:Xr,useImperativeHandle:Xr,useLayoutEffect:Xr,useInsertionEffect:Xr,useMemo:Xr,useReducer:Xr,useRef:Xr,useState:Xr,useDebugValue:Xr,useDeferredValue:Xr,useTransition:Xr,useSyncExternalStore:Xr,useId:Xr,useHostTransitionStatus:Xr,useFormState:Xr,useActionState:Xr,useOptimistic:Xr,useMemoCache:Xr,useCacheRefresh:Xr};Rv.useEffectEvent=Xr;var jB={readContext:Ss,use:$k,useCallback:function(h,w){return mo().memoizedState=[h,w===void 0?null:w],h},useContext:Ss,useEffect:pB,useImperativeHandle:function(h,w,_){_=_!=null?_.concat([h]):null,Gk(4194308,4,bB.bind(null,w,h),_)},useLayoutEffect:function(h,w){return Gk(4194308,4,h,w)},useInsertionEffect:function(h,w){Gk(4,2,h,w)},useMemo:function(h,w){var _=mo();w=w===void 0?null:w;var E=h();if(Ef){Fe(!0);try{h()}finally{Fe(!1)}}return _.memoizedState=[E,w],E},useReducer:function(h,w,_){var E=mo();if(_!==void 0){var V=_(w);if(Ef){Fe(!0);try{_(w)}finally{Fe(!1)}}}else V=w;return E.memoizedState=E.baseState=V,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:h,lastRenderedState:V},E.queue=h,h=h.dispatch=eue.bind(null,Za,h),[E.memoizedState,h]},useRef:function(h){var w=mo();return h={current:h},w.memoizedState=h},useState:function(h){h=Qj(h);var w=h.queue,_=PB.bind(null,Za,w);return w.dispatch=_,[h.memoizedState,_]},useDebugValue:Zj,useDeferredValue:function(h,w){var _=mo();return Jj(_,h,w)},useTransition:function(){var h=Qj(!1);return h=SB.bind(null,Za,h.queue,!0,!1),mo().memoizedState=h,[!1,h]},useSyncExternalStore:function(h,w,_){var E=Za,V=mo();if(Cn){if(_===void 0)throw Error(r(407));_=_()}else{if(_=w(),hr===null)throw Error(r(349));(kn&127)!==0||XU(E,w,_)}V.memoizedState=_;var te={value:_,getSnapshot:w};return V.queue=te,pB(JU.bind(null,E,te,h),[h]),E.flags|=2048,Ob(9,{destroy:void 0},ZU.bind(null,E,te,_,w),null),_},useId:function(){var h=mo(),w=hr.identifierPrefix;if(Cn){var _=Ed,E=Md;_=(E&~(1<<32-He(E)-1)).toString(32)+_,w="_"+w+"R_"+_,_=qk++,0<_&&(w+="H"+_.toString(32)),w+="_"}else _=Wde++,w="_"+w+"r_"+_.toString(32)+"_";return h.memoizedState=w},useHostTransitionStatus:tM,useFormState:lB,useActionState:lB,useOptimistic:function(h){var w=mo();w.memoizedState=w.baseState=h;var _={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return w.queue=_,w=aM.bind(null,Za,!0,_),_.dispatch=w,[h,w]},useMemoCache:Gj,useCacheRefresh:function(){return mo().memoizedState=Jde.bind(null,Za)},useEffectEvent:function(h){var w=mo(),_={impl:h};return w.memoizedState=_,function(){if((Bn&2)!==0)throw Error(r(440));return _.impl.apply(void 0,arguments)}}},nM={readContext:Ss,use:$k,useCallback:yB,useContext:Ss,useEffect:Xj,useImperativeHandle:xB,useInsertionEffect:fB,useLayoutEffect:gB,useMemo:vB,useReducer:Vk,useRef:mB,useState:function(){return Vk(Bu)},useDebugValue:Zj,useDeferredValue:function(h,w){var _=hi();return wB(_,er.memoizedState,h,w)},useTransition:function(){var h=Vk(Bu)[0],w=hi().memoizedState;return[typeof h=="boolean"?h:Fv(h),w]},useSyncExternalStore:YU,useId:NB,useHostTransitionStatus:tM,useFormState:cB,useActionState:cB,useOptimistic:function(h,w){var _=hi();return aB(_,er,h,w)},useMemoCache:Gj,useCacheRefresh:CB};nM.useEffectEvent=hB;var MB={readContext:Ss,use:$k,useCallback:yB,useContext:Ss,useEffect:Xj,useImperativeHandle:xB,useInsertionEffect:fB,useLayoutEffect:gB,useMemo:vB,useReducer:Kj,useRef:mB,useState:function(){return Kj(Bu)},useDebugValue:Zj,useDeferredValue:function(h,w){var _=hi();return er===null?Jj(_,h,w):wB(_,er.memoizedState,h,w)},useTransition:function(){var h=Kj(Bu)[0],w=hi().memoizedState;return[typeof h=="boolean"?h:Fv(h),w]},useSyncExternalStore:YU,useId:NB,useHostTransitionStatus:tM,useFormState:uB,useActionState:uB,useOptimistic:function(h,w){var _=hi();return er!==null?aB(_,er,h,w):(_.baseState=h,[h,_.queue.dispatch])},useMemoCache:Gj,useCacheRefresh:CB};MB.useEffectEvent=hB;function rM(h,w,_,E){w=h.memoizedState,_=_(E,w),_=_==null?w:m({},w,_),h.memoizedState=_,h.lanes===0&&(h.updateQueue.baseState=_)}var iM={enqueueSetState:function(h,w,_){h=h._reactInternals;var E=ul(),V=Cp(E);V.payload=w,_!=null&&(V.callback=_),w=Pp(h,V,E),w!==null&&(Oo(w,h,E),jv(w,h,E))},enqueueReplaceState:function(h,w,_){h=h._reactInternals;var E=ul(),V=Cp(E);V.tag=1,V.payload=w,_!=null&&(V.callback=_),w=Pp(h,V,E),w!==null&&(Oo(w,h,E),jv(w,h,E))},enqueueForceUpdate:function(h,w){h=h._reactInternals;var _=ul(),E=Cp(_);E.tag=2,w!=null&&(E.callback=w),w=Pp(h,E,_),w!==null&&(Oo(w,h,_),jv(w,h,_))}};function EB(h,w,_,E,V,te,we){return h=h.stateNode,typeof h.shouldComponentUpdate=="function"?h.shouldComponentUpdate(E,te,we):w.prototype&&w.prototype.isPureReactComponent?!vs(_,E)||!vs(V,te):!0}function DB(h,w,_,E){h=w.state,typeof w.componentWillReceiveProps=="function"&&w.componentWillReceiveProps(_,E),typeof w.UNSAFE_componentWillReceiveProps=="function"&&w.UNSAFE_componentWillReceiveProps(_,E),w.state!==h&&iM.enqueueReplaceState(w,w.state,null)}function Df(h,w){var _=w;if("ref"in w){_={};for(var E in w)E!=="ref"&&(_[E]=w[E])}if(h=h.defaultProps){_===w&&(_=m({},_));for(var V in h)_[V]===void 0&&(_[V]=h[V])}return _}function FB(h){Ck(h)}function LB(h){console.error(h)}function RB(h){Ck(h)}function Qk(h,w){try{var _=h.onUncaughtError;_(w.value,{componentStack:w.stack})}catch(E){setTimeout(function(){throw E})}}function IB(h,w,_){try{var E=h.onCaughtError;E(_.value,{componentStack:_.stack,errorBoundary:w.tag===1?w.stateNode:null})}catch(V){setTimeout(function(){throw V})}}function sM(h,w,_){return _=Cp(_),_.tag=3,_.payload={element:null},_.callback=function(){Qk(h,w)},_}function OB(h){return h=Cp(h),h.tag=3,h}function zB(h,w,_,E){var V=_.type.getDerivedStateFromError;if(typeof V=="function"){var te=E.value;h.payload=function(){return V(te)},h.callback=function(){IB(w,_,E)}}var we=_.stateNode;we!==null&&typeof we.componentDidCatch=="function"&&(h.callback=function(){IB(w,_,E),typeof V!="function"&&(Dp===null?Dp=new Set([this]):Dp.add(this));var qe=E.stack;this.componentDidCatch(E.value,{componentStack:qe!==null?qe:""})})}function tue(h,w,_,E,V){if(_.flags|=32768,E!==null&&typeof E=="object"&&typeof E.then=="function"){if(w=_.alternate,w!==null&&jb(w,_,V,!0),_=ol.current,_!==null){switch(_.tag){case 31:case 13:return Ql===null?o_():_.alternate===null&&Zr===0&&(Zr=3),_.flags&=-257,_.flags|=65536,_.lanes=V,E===Rk?_.flags|=16384:(w=_.updateQueue,w===null?_.updateQueue=new Set([E]):w.add(E),MM(h,E,V)),!1;case 22:return _.flags|=65536,E===Rk?_.flags|=16384:(w=_.updateQueue,w===null?(w={transitions:null,markerInstances:null,retryQueue:new Set([E])},_.updateQueue=w):(_=w.retryQueue,_===null?w.retryQueue=new Set([E]):_.add(E)),MM(h,E,V)),!1}throw Error(r(435,_.tag))}return MM(h,E,V),o_(),!1}if(Cn)return w=ol.current,w!==null?((w.flags&65536)===0&&(w.flags|=256),w.flags|=65536,w.lanes=V,E!==Nj&&(h=Error(r(422),{cause:E}),Nv(Vl(h,_)))):(E!==Nj&&(w=Error(r(423),{cause:E}),Nv(Vl(w,_))),h=h.current.alternate,h.flags|=65536,V&=-V,h.lanes|=V,E=Vl(E,_),V=sM(h.stateNode,E,V),Rj(h,V),Zr!==4&&(Zr=2)),!1;var te=Error(r(520),{cause:E});if(te=Vl(te,_),$v===null?$v=[te]:$v.push(te),Zr!==4&&(Zr=2),w===null)return!0;E=Vl(E,_),_=w;do{switch(_.tag){case 3:return _.flags|=65536,h=V&-V,_.lanes|=h,h=sM(_.stateNode,E,h),Rj(_,h),!1;case 1:if(w=_.type,te=_.stateNode,(_.flags&128)===0&&(typeof w.getDerivedStateFromError=="function"||te!==null&&typeof te.componentDidCatch=="function"&&(Dp===null||!Dp.has(te))))return _.flags|=65536,V&=-V,_.lanes|=V,V=OB(V),zB(V,h,_,E),Rj(_,V),!1}_=_.return}while(_!==null);return!1}var oM=Error(r(461)),_i=!1;function ks(h,w,_,E){w.child=h===null?HU(w,null,_,E):Mf(w,h.child,_,E)}function UB(h,w,_,E,V){_=_.render;var te=w.ref;if("ref"in E){var we={};for(var qe in E)qe!=="ref"&&(we[qe]=E[qe])}else we=E;return Pf(w),E=qj(h,w,_,we,te,V),qe=Hj(),h!==null&&!_i?($j(h,w,V),qu(h,w,V)):(Cn&&qe&&kj(w),w.flags|=1,ks(h,w,E,V),w.child)}function BB(h,w,_,E,V){if(h===null){var te=_.type;return typeof te=="function"&&!vj(te)&&te.defaultProps===void 0&&_.compare===null?(w.tag=15,w.type=te,qB(h,w,te,E,V)):(h=jk(_.type,null,E,w,w.mode,V),h.ref=w.ref,h.return=w,w.child=h)}if(te=h.child,!fM(h,V)){var we=te.memoizedProps;if(_=_.compare,_=_!==null?_:vs,_(we,E)&&h.ref===w.ref)return qu(h,w,V)}return w.flags|=1,h=Ru(te,E),h.ref=w.ref,h.return=w,w.child=h}function qB(h,w,_,E,V){if(h!==null){var te=h.memoizedProps;if(vs(te,E)&&h.ref===w.ref)if(_i=!1,w.pendingProps=E=te,fM(h,V))(h.flags&131072)!==0&&(_i=!0);else return w.lanes=h.lanes,qu(h,w,V)}return lM(h,w,_,E,V)}function HB(h,w,_,E){var V=E.children,te=h!==null?h.memoizedState:null;if(h===null&&w.stateNode===null&&(w.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),E.mode==="hidden"){if((w.flags&128)!==0){if(te=te!==null?te.baseLanes|_:_,h!==null){for(E=w.child=h.child,V=0;E!==null;)V=V|E.lanes|E.childLanes,E=E.sibling;E=V&~te}else E=0,w.child=null;return $B(h,w,te,_,E)}if((_&536870912)!==0)w.memoizedState={baseLanes:0,cachePool:null},h!==null&&Fk(w,te!==null?te.cachePool:null),te!==null?GU(w,te):Oj(),WU(w);else return E=w.lanes=536870912,$B(h,w,te!==null?te.baseLanes|_:_,_,E)}else te!==null?(Fk(w,te.cachePool),GU(w,te),Ap(),w.memoizedState=null):(h!==null&&Fk(w,null),Oj(),Ap());return ks(h,w,V,_),w.child}function Iv(h,w){return h!==null&&h.tag===22||w.stateNode!==null||(w.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),w.sibling}function $B(h,w,_,E,V){var te=Ej();return te=te===null?null:{parent:Si._currentValue,pool:te},w.memoizedState={baseLanes:_,cachePool:te},h!==null&&Fk(w,null),Oj(),WU(w),h!==null&&jb(h,w,E,!0),w.childLanes=V,null}function Yk(h,w){return w=Zk({mode:w.mode,children:w.children},h.mode),w.ref=h.ref,h.child=w,w.return=h,w}function VB(h,w,_){return Mf(w,h.child,null,_),h=Yk(w,w.pendingProps),h.flags|=2,ll(w),w.memoizedState=null,h}function aue(h,w,_){var E=w.pendingProps,V=(w.flags&128)!==0;if(w.flags&=-129,h===null){if(Cn){if(E.mode==="hidden")return h=Yk(w,E),w.lanes=536870912,Iv(null,h);if(Uj(w),(h=_r)?(h=nH(h,Kl),h=h!==null&&h.data==="&"?h:null,h!==null&&(w.memoizedState={dehydrated:h,treeContext:wp!==null?{id:Md,overflow:Ed}:null,retryLane:536870912,hydrationErrors:null},_=TU(h),_.return=w,w.child=_,ws=w,_r=null)):h=null,h===null)throw kp(w);return w.lanes=536870912,null}return Yk(w,E)}var te=h.memoizedState;if(te!==null){var we=te.dehydrated;if(Uj(w),V)if(w.flags&256)w.flags&=-257,w=VB(h,w,_);else if(w.memoizedState!==null)w.child=h.child,w.flags|=128,w=null;else throw Error(r(558));else if(_i||jb(h,w,_,!1),V=(_&h.childLanes)!==0,_i||V){if(E=hr,E!==null&&(we=ft(E,_),we!==0&&we!==te.retryLane))throw te.retryLane=we,kf(h,we),Oo(E,h,we),oM;o_(),w=VB(h,w,_)}else h=te.treeContext,_r=Yl(we.nextSibling),ws=w,Cn=!0,Sp=null,Kl=!1,h!==null&&MU(w,h),w=Yk(w,E),w.flags|=4096;return w}return h=Ru(h.child,{mode:E.mode,children:E.children}),h.ref=w.ref,w.child=h,h.return=w,h}function Xk(h,w){var _=w.ref;if(_===null)h!==null&&h.ref!==null&&(w.flags|=4194816);else{if(typeof _!="function"&&typeof _!="object")throw Error(r(284));(h===null||h.ref!==_)&&(w.flags|=4194816)}}function lM(h,w,_,E,V){return Pf(w),_=qj(h,w,_,E,void 0,V),E=Hj(),h!==null&&!_i?($j(h,w,V),qu(h,w,V)):(Cn&&E&&kj(w),w.flags|=1,ks(h,w,_,V),w.child)}function GB(h,w,_,E,V,te){return Pf(w),w.updateQueue=null,_=QU(w,E,_,V),KU(h),E=Hj(),h!==null&&!_i?($j(h,w,te),qu(h,w,te)):(Cn&&E&&kj(w),w.flags|=1,ks(h,w,_,te),w.child)}function WB(h,w,_,E,V){if(Pf(w),w.stateNode===null){var te=Cb,we=_.contextType;typeof we=="object"&&we!==null&&(te=Ss(we)),te=new _(E,te),w.memoizedState=te.state!==null&&te.state!==void 0?te.state:null,te.updater=iM,w.stateNode=te,te._reactInternals=w,te=w.stateNode,te.props=E,te.state=w.memoizedState,te.refs={},Fj(w),we=_.contextType,te.context=typeof we=="object"&&we!==null?Ss(we):Cb,te.state=w.memoizedState,we=_.getDerivedStateFromProps,typeof we=="function"&&(rM(w,_,we,E),te.state=w.memoizedState),typeof _.getDerivedStateFromProps=="function"||typeof te.getSnapshotBeforeUpdate=="function"||typeof te.UNSAFE_componentWillMount!="function"&&typeof te.componentWillMount!="function"||(we=te.state,typeof te.componentWillMount=="function"&&te.componentWillMount(),typeof te.UNSAFE_componentWillMount=="function"&&te.UNSAFE_componentWillMount(),we!==te.state&&iM.enqueueReplaceState(te,te.state,null),Ev(w,E,te,V),Mv(),te.state=w.memoizedState),typeof te.componentDidMount=="function"&&(w.flags|=4194308),E=!0}else if(h===null){te=w.stateNode;var qe=w.memoizedProps,mt=Df(_,qe);te.props=mt;var Et=te.context,Ht=_.contextType;we=Cb,typeof Ht=="object"&&Ht!==null&&(we=Ss(Ht));var Gt=_.getDerivedStateFromProps;Ht=typeof Gt=="function"||typeof te.getSnapshotBeforeUpdate=="function",qe=w.pendingProps!==qe,Ht||typeof te.UNSAFE_componentWillReceiveProps!="function"&&typeof te.componentWillReceiveProps!="function"||(qe||Et!==we)&&DB(w,te,E,we),Np=!1;var Lt=w.memoizedState;te.state=Lt,Ev(w,E,te,V),Mv(),Et=w.memoizedState,qe||Lt!==Et||Np?(typeof Gt=="function"&&(rM(w,_,Gt,E),Et=w.memoizedState),(mt=Np||EB(w,_,mt,E,Lt,Et,we))?(Ht||typeof te.UNSAFE_componentWillMount!="function"&&typeof te.componentWillMount!="function"||(typeof te.componentWillMount=="function"&&te.componentWillMount(),typeof te.UNSAFE_componentWillMount=="function"&&te.UNSAFE_componentWillMount()),typeof te.componentDidMount=="function"&&(w.flags|=4194308)):(typeof te.componentDidMount=="function"&&(w.flags|=4194308),w.memoizedProps=E,w.memoizedState=Et),te.props=E,te.state=Et,te.context=we,E=mt):(typeof te.componentDidMount=="function"&&(w.flags|=4194308),E=!1)}else{te=w.stateNode,Lj(h,w),we=w.memoizedProps,Ht=Df(_,we),te.props=Ht,Gt=w.pendingProps,Lt=te.context,Et=_.contextType,mt=Cb,typeof Et=="object"&&Et!==null&&(mt=Ss(Et)),qe=_.getDerivedStateFromProps,(Et=typeof qe=="function"||typeof te.getSnapshotBeforeUpdate=="function")||typeof te.UNSAFE_componentWillReceiveProps!="function"&&typeof te.componentWillReceiveProps!="function"||(we!==Gt||Lt!==mt)&&DB(w,te,E,mt),Np=!1,Lt=w.memoizedState,te.state=Lt,Ev(w,E,te,V),Mv();var Ut=w.memoizedState;we!==Gt||Lt!==Ut||Np||h!==null&&h.dependencies!==null&&Ek(h.dependencies)?(typeof qe=="function"&&(rM(w,_,qe,E),Ut=w.memoizedState),(Ht=Np||EB(w,_,Ht,E,Lt,Ut,mt)||h!==null&&h.dependencies!==null&&Ek(h.dependencies))?(Et||typeof te.UNSAFE_componentWillUpdate!="function"&&typeof te.componentWillUpdate!="function"||(typeof te.componentWillUpdate=="function"&&te.componentWillUpdate(E,Ut,mt),typeof te.UNSAFE_componentWillUpdate=="function"&&te.UNSAFE_componentWillUpdate(E,Ut,mt)),typeof te.componentDidUpdate=="function"&&(w.flags|=4),typeof te.getSnapshotBeforeUpdate=="function"&&(w.flags|=1024)):(typeof te.componentDidUpdate!="function"||we===h.memoizedProps&&Lt===h.memoizedState||(w.flags|=4),typeof te.getSnapshotBeforeUpdate!="function"||we===h.memoizedProps&&Lt===h.memoizedState||(w.flags|=1024),w.memoizedProps=E,w.memoizedState=Ut),te.props=E,te.state=Ut,te.context=mt,E=Ht):(typeof te.componentDidUpdate!="function"||we===h.memoizedProps&&Lt===h.memoizedState||(w.flags|=4),typeof te.getSnapshotBeforeUpdate!="function"||we===h.memoizedProps&&Lt===h.memoizedState||(w.flags|=1024),E=!1)}return te=E,Xk(h,w),E=(w.flags&128)!==0,te||E?(te=w.stateNode,_=E&&typeof _.getDerivedStateFromError!="function"?null:te.render(),w.flags|=1,h!==null&&E?(w.child=Mf(w,h.child,null,V),w.child=Mf(w,null,_,V)):ks(h,w,_,V),w.memoizedState=te.state,h=w.child):h=qu(h,w,V),h}function KB(h,w,_,E){return Nf(),w.flags|=256,ks(h,w,_,E),w.child}var cM={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function dM(h){return{baseLanes:h,cachePool:IU()}}function uM(h,w,_){return h=h!==null?h.childLanes&~_:0,w&&(h|=dl),h}function QB(h,w,_){var E=w.pendingProps,V=!1,te=(w.flags&128)!==0,we;if((we=te)||(we=h!==null&&h.memoizedState===null?!1:(pi.current&2)!==0),we&&(V=!0,w.flags&=-129),we=(w.flags&32)!==0,w.flags&=-33,h===null){if(Cn){if(V?Tp(w):Ap(),(h=_r)?(h=nH(h,Kl),h=h!==null&&h.data!=="&"?h:null,h!==null&&(w.memoizedState={dehydrated:h,treeContext:wp!==null?{id:Md,overflow:Ed}:null,retryLane:536870912,hydrationErrors:null},_=TU(h),_.return=w,w.child=_,ws=w,_r=null)):h=null,h===null)throw kp(w);return WM(h)?w.lanes=32:w.lanes=536870912,null}var qe=E.children;return E=E.fallback,V?(Ap(),V=w.mode,qe=Zk({mode:"hidden",children:qe},V),E=_f(E,V,_,null),qe.return=w,E.return=w,qe.sibling=E,w.child=qe,E=w.child,E.memoizedState=dM(_),E.childLanes=uM(h,we,_),w.memoizedState=cM,Iv(null,E)):(Tp(w),mM(w,qe))}var mt=h.memoizedState;if(mt!==null&&(qe=mt.dehydrated,qe!==null)){if(te)w.flags&256?(Tp(w),w.flags&=-257,w=pM(h,w,_)):w.memoizedState!==null?(Ap(),w.child=h.child,w.flags|=128,w=null):(Ap(),qe=E.fallback,V=w.mode,E=Zk({mode:"visible",children:E.children},V),qe=_f(qe,V,_,null),qe.flags|=2,E.return=w,qe.return=w,E.sibling=qe,w.child=E,Mf(w,h.child,null,_),E=w.child,E.memoizedState=dM(_),E.childLanes=uM(h,we,_),w.memoizedState=cM,w=Iv(null,E));else if(Tp(w),WM(qe)){if(we=qe.nextSibling&&qe.nextSibling.dataset,we)var Et=we.dgst;we=Et,E=Error(r(419)),E.stack="",E.digest=we,Nv({value:E,source:null,stack:null}),w=pM(h,w,_)}else if(_i||jb(h,w,_,!1),we=(_&h.childLanes)!==0,_i||we){if(we=hr,we!==null&&(E=ft(we,_),E!==0&&E!==mt.retryLane))throw mt.retryLane=E,kf(h,E),Oo(we,h,E),oM;GM(qe)||o_(),w=pM(h,w,_)}else GM(qe)?(w.flags|=192,w.child=h.child,w=null):(h=mt.treeContext,_r=Yl(qe.nextSibling),ws=w,Cn=!0,Sp=null,Kl=!1,h!==null&&MU(w,h),w=mM(w,E.children),w.flags|=4096);return w}return V?(Ap(),qe=E.fallback,V=w.mode,mt=h.child,Et=mt.sibling,E=Ru(mt,{mode:"hidden",children:E.children}),E.subtreeFlags=mt.subtreeFlags&65011712,Et!==null?qe=Ru(Et,qe):(qe=_f(qe,V,_,null),qe.flags|=2),qe.return=w,E.return=w,E.sibling=qe,w.child=E,Iv(null,E),E=w.child,qe=h.child.memoizedState,qe===null?qe=dM(_):(V=qe.cachePool,V!==null?(mt=Si._currentValue,V=V.parent!==mt?{parent:mt,pool:mt}:V):V=IU(),qe={baseLanes:qe.baseLanes|_,cachePool:V}),E.memoizedState=qe,E.childLanes=uM(h,we,_),w.memoizedState=cM,Iv(h.child,E)):(Tp(w),_=h.child,h=_.sibling,_=Ru(_,{mode:"visible",children:E.children}),_.return=w,_.sibling=null,h!==null&&(we=w.deletions,we===null?(w.deletions=[h],w.flags|=16):we.push(h)),w.child=_,w.memoizedState=null,_)}function mM(h,w){return w=Zk({mode:"visible",children:w},h.mode),w.return=h,h.child=w}function Zk(h,w){return h=sl(22,h,null,w),h.lanes=0,h}function pM(h,w,_){return Mf(w,h.child,null,_),h=mM(w,w.pendingProps.children),h.flags|=2,w.memoizedState=null,h}function YB(h,w,_){h.lanes|=w;var E=h.alternate;E!==null&&(E.lanes|=w),Tj(h.return,w,_)}function hM(h,w,_,E,V,te){var we=h.memoizedState;we===null?h.memoizedState={isBackwards:w,rendering:null,renderingStartTime:0,last:E,tail:_,tailMode:V,treeForkCount:te}:(we.isBackwards=w,we.rendering=null,we.renderingStartTime=0,we.last=E,we.tail=_,we.tailMode=V,we.treeForkCount=te)}function XB(h,w,_){var E=w.pendingProps,V=E.revealOrder,te=E.tail;E=E.children;var we=pi.current,qe=(we&2)!==0;if(qe?(we=we&1|2,w.flags|=128):we&=1,pe(pi,we),ks(h,w,E,_),E=Cn?_v:0,!qe&&h!==null&&(h.flags&128)!==0)e:for(h=w.child;h!==null;){if(h.tag===13)h.memoizedState!==null&&YB(h,_,w);else if(h.tag===19)YB(h,_,w);else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===w)break e;for(;h.sibling===null;){if(h.return===null||h.return===w)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}switch(V){case"forwards":for(_=w.child,V=null;_!==null;)h=_.alternate,h!==null&&Uk(h)===null&&(V=_),_=_.sibling;_=V,_===null?(V=w.child,w.child=null):(V=_.sibling,_.sibling=null),hM(w,!1,V,_,te,E);break;case"backwards":case"unstable_legacy-backwards":for(_=null,V=w.child,w.child=null;V!==null;){if(h=V.alternate,h!==null&&Uk(h)===null){w.child=V;break}h=V.sibling,V.sibling=_,_=V,V=h}hM(w,!0,_,null,te,E);break;case"together":hM(w,!1,null,null,void 0,E);break;default:w.memoizedState=null}return w.child}function qu(h,w,_){if(h!==null&&(w.dependencies=h.dependencies),Ep|=w.lanes,(_&w.childLanes)===0)if(h!==null){if(jb(h,w,_,!1),(_&w.childLanes)===0)return null}else return null;if(h!==null&&w.child!==h.child)throw Error(r(153));if(w.child!==null){for(h=w.child,_=Ru(h,h.pendingProps),w.child=_,_.return=w;h.sibling!==null;)h=h.sibling,_=_.sibling=Ru(h,h.pendingProps),_.return=w;_.sibling=null}return w.child}function fM(h,w){return(h.lanes&w)!==0?!0:(h=h.dependencies,!!(h!==null&&Ek(h)))}function nue(h,w,_){switch(w.tag){case 3:A(w,w.stateNode.containerInfo),_p(w,Si,h.memoizedState.cache),Nf();break;case 27:case 5:B(w);break;case 4:A(w,w.stateNode.containerInfo);break;case 10:_p(w,w.type,w.memoizedProps.value);break;case 31:if(w.memoizedState!==null)return w.flags|=128,Uj(w),null;break;case 13:var E=w.memoizedState;if(E!==null)return E.dehydrated!==null?(Tp(w),w.flags|=128,null):(_&w.child.childLanes)!==0?QB(h,w,_):(Tp(w),h=qu(h,w,_),h!==null?h.sibling:null);Tp(w);break;case 19:var V=(h.flags&128)!==0;if(E=(_&w.childLanes)!==0,E||(jb(h,w,_,!1),E=(_&w.childLanes)!==0),V){if(E)return XB(h,w,_);w.flags|=128}if(V=w.memoizedState,V!==null&&(V.rendering=null,V.tail=null,V.lastEffect=null),pe(pi,pi.current),E)break;return null;case 22:return w.lanes=0,HB(h,w,_,w.pendingProps);case 24:_p(w,Si,h.memoizedState.cache)}return qu(h,w,_)}function ZB(h,w,_){if(h!==null)if(h.memoizedProps!==w.pendingProps)_i=!0;else{if(!fM(h,_)&&(w.flags&128)===0)return _i=!1,nue(h,w,_);_i=(h.flags&131072)!==0}else _i=!1,Cn&&(w.flags&1048576)!==0&&jU(w,_v,w.index);switch(w.lanes=0,w.tag){case 16:e:{var E=w.pendingProps;if(h=Af(w.elementType),w.type=h,typeof h=="function")vj(h)?(E=Df(h,E),w.tag=1,w=WB(null,w,h,E,_)):(w.tag=0,w=lM(null,w,h,E,_));else{if(h!=null){var V=h.$$typeof;if(V===C){w.tag=11,w=UB(null,w,h,E,_);break e}else if(V===j){w.tag=14,w=BB(null,w,h,E,_);break e}}throw w=L(h)||h,Error(r(306,w,""))}}return w;case 0:return lM(h,w,w.type,w.pendingProps,_);case 1:return E=w.type,V=Df(E,w.pendingProps),WB(h,w,E,V,_);case 3:e:{if(A(w,w.stateNode.containerInfo),h===null)throw Error(r(387));E=w.pendingProps;var te=w.memoizedState;V=te.element,Lj(h,w),Ev(w,E,null,_);var we=w.memoizedState;if(E=we.cache,_p(w,Si,E),E!==te.cache&&Aj(w,[Si],_,!0),Mv(),E=we.element,te.isDehydrated)if(te={element:E,isDehydrated:!1,cache:we.cache},w.updateQueue.baseState=te,w.memoizedState=te,w.flags&256){w=KB(h,w,E,_);break e}else if(E!==V){V=Vl(Error(r(424)),w),Nv(V),w=KB(h,w,E,_);break e}else for(h=w.stateNode.containerInfo,h.nodeType===9?h=h.body:h=h.nodeName==="HTML"?h.ownerDocument.body:h,_r=Yl(h.firstChild),ws=w,Cn=!0,Sp=null,Kl=!0,_=HU(w,null,E,_),w.child=_;_;)_.flags=_.flags&-3|4096,_=_.sibling;else{if(Nf(),E===V){w=qu(h,w,_);break e}ks(h,w,E,_)}w=w.child}return w;case 26:return Xk(h,w),h===null?(_=cH(w.type,null,w.pendingProps,null))?w.memoizedState=_:Cn||(_=w.type,h=w.pendingProps,E=h_(H.current).createElement(_),E[vt]=w,E[Nt]=h,_s(E,_,h),ot(E),w.stateNode=E):w.memoizedState=cH(w.type,h.memoizedProps,w.pendingProps,h.memoizedState),null;case 27:return B(w),h===null&&Cn&&(E=w.stateNode=sH(w.type,w.pendingProps,H.current),ws=w,Kl=!0,V=_r,Ip(w.type)?(KM=V,_r=Yl(E.firstChild)):_r=V),ks(h,w,w.pendingProps.children,_),Xk(h,w),h===null&&(w.flags|=4194304),w.child;case 5:return h===null&&Cn&&((V=E=_r)&&(E=Due(E,w.type,w.pendingProps,Kl),E!==null?(w.stateNode=E,ws=w,_r=Yl(E.firstChild),Kl=!1,V=!0):V=!1),V||kp(w)),B(w),V=w.type,te=w.pendingProps,we=h!==null?h.memoizedProps:null,E=te.children,HM(V,te)?E=null:we!==null&&HM(V,we)&&(w.flags|=32),w.memoizedState!==null&&(V=qj(h,w,Kde,null,null,_),Zv._currentValue=V),Xk(h,w),ks(h,w,E,_),w.child;case 6:return h===null&&Cn&&((h=_=_r)&&(_=Fue(_,w.pendingProps,Kl),_!==null?(w.stateNode=_,ws=w,_r=null,h=!0):h=!1),h||kp(w)),null;case 13:return QB(h,w,_);case 4:return A(w,w.stateNode.containerInfo),E=w.pendingProps,h===null?w.child=Mf(w,null,E,_):ks(h,w,E,_),w.child;case 11:return UB(h,w,w.type,w.pendingProps,_);case 7:return ks(h,w,w.pendingProps,_),w.child;case 8:return ks(h,w,w.pendingProps.children,_),w.child;case 12:return ks(h,w,w.pendingProps.children,_),w.child;case 10:return E=w.pendingProps,_p(w,w.type,E.value),ks(h,w,E.children,_),w.child;case 9:return V=w.type._context,E=w.pendingProps.children,Pf(w),V=Ss(V),E=E(V),w.flags|=1,ks(h,w,E,_),w.child;case 14:return BB(h,w,w.type,w.pendingProps,_);case 15:return qB(h,w,w.type,w.pendingProps,_);case 19:return XB(h,w,_);case 31:return aue(h,w,_);case 22:return HB(h,w,_,w.pendingProps);case 24:return Pf(w),E=Ss(Si),h===null?(V=Ej(),V===null&&(V=hr,te=jj(),V.pooledCache=te,te.refCount++,te!==null&&(V.pooledCacheLanes|=_),V=te),w.memoizedState={parent:E,cache:V},Fj(w),_p(w,Si,V)):((h.lanes&_)!==0&&(Lj(h,w),Ev(w,null,null,_),Mv()),V=h.memoizedState,te=w.memoizedState,V.parent!==E?(V={parent:E,cache:E},w.memoizedState=V,w.lanes===0&&(w.memoizedState=w.updateQueue.baseState=V),_p(w,Si,E)):(E=te.cache,_p(w,Si,E),E!==V.cache&&Aj(w,[Si],_,!0))),ks(h,w,w.pendingProps.children,_),w.child;case 29:throw w.pendingProps}throw Error(r(156,w.tag))}function Hu(h){h.flags|=4}function gM(h,w,_,E,V){if((w=(h.mode&32)!==0)&&(w=!1),w){if(h.flags|=16777216,(V&335544128)===V)if(h.stateNode.complete)h.flags|=8192;else if(Nq())h.flags|=8192;else throw jf=Rk,Dj}else h.flags&=-16777217}function JB(h,w){if(w.type!=="stylesheet"||(w.state.loading&4)!==0)h.flags&=-16777217;else if(h.flags|=16777216,!hH(w))if(Nq())h.flags|=8192;else throw jf=Rk,Dj}function Jk(h,w){w!==null&&(h.flags|=4),h.flags&16384&&(w=h.tag!==22?We():536870912,h.lanes|=w,qb|=w)}function Ov(h,w){if(!Cn)switch(h.tailMode){case"hidden":w=h.tail;for(var _=null;w!==null;)w.alternate!==null&&(_=w),w=w.sibling;_===null?h.tail=null:_.sibling=null;break;case"collapsed":_=h.tail;for(var E=null;_!==null;)_.alternate!==null&&(E=_),_=_.sibling;E===null?w||h.tail===null?h.tail=null:h.tail.sibling=null:E.sibling=null}}function Nr(h){var w=h.alternate!==null&&h.alternate.child===h.child,_=0,E=0;if(w)for(var V=h.child;V!==null;)_|=V.lanes|V.childLanes,E|=V.subtreeFlags&65011712,E|=V.flags&65011712,V.return=h,V=V.sibling;else for(V=h.child;V!==null;)_|=V.lanes|V.childLanes,E|=V.subtreeFlags,E|=V.flags,V.return=h,V=V.sibling;return h.subtreeFlags|=E,h.childLanes=_,w}function rue(h,w,_){var E=w.pendingProps;switch(_j(w),w.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nr(w),null;case 1:return Nr(w),null;case 3:return _=w.stateNode,E=null,h!==null&&(E=h.memoizedState.cache),w.memoizedState.cache!==E&&(w.flags|=2048),zu(Si),M(),_.pendingContext&&(_.context=_.pendingContext,_.pendingContext=null),(h===null||h.child===null)&&(Ab(w)?Hu(w):h===null||h.memoizedState.isDehydrated&&(w.flags&256)===0||(w.flags|=1024,Cj())),Nr(w),null;case 26:var V=w.type,te=w.memoizedState;return h===null?(Hu(w),te!==null?(Nr(w),JB(w,te)):(Nr(w),gM(w,V,null,E,_))):te?te!==h.memoizedState?(Hu(w),Nr(w),JB(w,te)):(Nr(w),w.flags&=-16777217):(h=h.memoizedProps,h!==E&&Hu(w),Nr(w),gM(w,V,h,E,_)),null;case 27:if(W(w),_=H.current,V=w.type,h!==null&&w.stateNode!=null)h.memoizedProps!==E&&Hu(w);else{if(!E){if(w.stateNode===null)throw Error(r(166));return Nr(w),null}h=me.current,Ab(w)?EU(w):(h=sH(V,E,_),w.stateNode=h,Hu(w))}return Nr(w),null;case 5:if(W(w),V=w.type,h!==null&&w.stateNode!=null)h.memoizedProps!==E&&Hu(w);else{if(!E){if(w.stateNode===null)throw Error(r(166));return Nr(w),null}if(te=me.current,Ab(w))EU(w);else{var we=h_(H.current);switch(te){case 1:te=we.createElementNS("http://www.w3.org/2000/svg",V);break;case 2:te=we.createElementNS("http://www.w3.org/1998/Math/MathML",V);break;default:switch(V){case"svg":te=we.createElementNS("http://www.w3.org/2000/svg",V);break;case"math":te=we.createElementNS("http://www.w3.org/1998/Math/MathML",V);break;case"script":te=we.createElement("div"),te.innerHTML=" +