diff --git a/api/README.md b/api/README.md index fcb8a37..f5e4034 100644 --- a/api/README.md +++ b/api/README.md @@ -95,17 +95,26 @@ which the site shows as it is. | Request | Body | Answer | |---|---|---| | `POST /auth/code` | `{ "email": "ada@example.com" }` | `200 { "sent": true }`; `400` not an address; `429` too soon or too many, with `Retry-After`; `502` the email couldn't be sent | -| `POST /auth/verify` | `{ "email": "...", "code": "123456" }` | `200 { "user": }` and the session cookie; `400` or `401` wrong or expired code; `429` too many checks | +| `POST /auth/verify` | `{ "email": "...", "code": "123456", "name"?: "..." }` | `200 { "user": }` and the session cookie; `400` or `401` wrong or expired code, or `400` a name that can't be kept; `429` too many checks | | `GET /auth/session` | | `200 { "user": }`, or `{ "user": null }` when signed out | +| `POST /auth/profile` | `{ "name": "..." }` | `200 { "user": }`; an empty name clears it; `400` a name that can't be kept; `401` signed out | | `POST /auth/signout` | `{}` | `200 { "signedOut": true }`, and the cookie is cleared | | `GET /admin/users` | | `200 { "signup": "waitlist" \| "open", "users": [...] }`, the waiting ones first; `401` signed out; `403` not an admin | | `POST /admin/approve` | `{ "email": "..." }` | `200 { "approved": true, "emailed": true \| false }`; `404` no such account; `401`, `403` as above | | `POST /admin/remove` | `{ "email": "..." }` | `200 { "removed": true }`; `400` an admin; `404` no such account; `401`, `403` as above | -`` is `{ "email": "...", "waiting": false, "admin": false }`. `waiting` is -true while the account is on the waitlist; the site then shows `/waitlist` -instead of the console. Anything added to the service later that only -approved accounts may use should check `waiting` the same way. +`` is `{ "email": "...", "name": "..." | null, "waiting": false, "admin": false }`. +`waiting` is true while the account is on the waitlist; the site then shows +`/waitlist` instead of the console. Anything added to the service later that +only approved accounts may use should check `waiting` the same way. + +`name` is what the account goes by, or `null` until one is given. Sign-up can +send it with the code (`/auth/verify`): it names a new account, or one with no +name yet, and never replaces a name the account has. `/auth/profile` changes +it. A name is trimmed and its runs of spaces made one; it can be up to 80 +characters, and can't hold control characters or the bidirectional overrides +that would make it display as something else. The admin listing carries each +account's `name` too. Without `RESEND_API_KEY`, or an `AUTH_SECRET` of at least 32 characters, `/auth/code` and `/auth/verify` answer `503`. diff --git a/api/migrations/0003_profile_name.sql b/api/migrations/0003_profile_name.sql new file mode 100644 index 0000000..cf38370 --- /dev/null +++ b/api/migrations/0003_profile_name.sql @@ -0,0 +1,4 @@ +-- The name an account goes by, given at sign-up or on the account page. NULL +-- until it is given: the site shows the address instead. + +ALTER TABLE users ADD COLUMN name TEXT; diff --git a/api/src/admin.ts b/api/src/admin.ts index bec63cc..27affd6 100644 --- a/api/src/admin.ts +++ b/api/src/admin.ts @@ -29,6 +29,7 @@ async function emailFrom(request: Request) { type AccountRow = { email: string; + name: string | null; status: string; created_at: number; last_sign_in_at: number; @@ -40,7 +41,7 @@ export async function listUsers(request: Request, env: Env, now: number) { await requireAdmin(request, env, now); const admins = adminEmails(env); const { results } = await env.DB.prepare( - `SELECT email, status, created_at, last_sign_in_at, approved_at, approved_by FROM users + `SELECT email, name, status, created_at, last_sign_in_at, approved_at, approved_by FROM users ORDER BY status = 'waiting' DESC, created_at DESC LIMIT ?`, ) .bind(LIST_LIMIT) @@ -48,6 +49,7 @@ export async function listUsers(request: Request, env: Env, now: number) { const open = isOpen(env); const users = results.map((row) => ({ email: row.email, + name: row.name, // The status the account has now: an admin never waits, even one added to // ADMIN_EMAILS after joining the waitlist, and nobody waits while sign-up // is open. A row stored as waiting waits again if the waitlist comes back. diff --git a/api/src/auth.ts b/api/src/auth.ts index 63e28ce..e1d9cb7 100644 --- a/api/src/auth.ts +++ b/api/src/auth.ts @@ -6,6 +6,7 @@ // POST /auth/code { email } emails a code // POST /auth/verify { email, code } checks it and starts a session // GET /auth/session who the session cookie belongs to +// POST /auth/profile { name } changes the signed-in account's name // POST /auth/signout ends the session import type { Env } from "./env"; @@ -19,15 +20,16 @@ import { DAY, LIMITS, MESSAGES, + NAME_MAX_LENGTH, RESEND_COOLDOWN_MS, SESSION_TTL_MS, } from "./rules"; import { codeHash, isToken, newCode, newToken, sameHash, tokenHash } from "./tokens"; -/** What the site is told about the signed-in account. */ -export type PublicUser = { email: string; waiting: boolean; admin: boolean }; +/** What the site is told about the signed-in account. `name` is null until one is given. */ +export type PublicUser = { email: string; name: string | null; waiting: boolean; admin: boolean }; -type UserRow = { id: string; email: string; status: string }; +type UserRow = { id: string; email: string; status: string; name: string | null }; /** Whether anyone who signs in may use the console; anything but "open" keeps the waitlist. */ export function isOpen(env: Env) { @@ -42,7 +44,23 @@ export function adminEmails(env: Env) { /** An account waits only while sign-up is on the waitlist, until approved; admins never wait. */ function publicUser(row: UserRow, env: Env): PublicUser { const admin = adminEmails(env).has(row.email); - return { email: row.email, waiting: !admin && !isOpen(env) && row.status !== "approved", admin }; + return { email: row.email, name: row.name, waiting: !admin && !isOpen(env) && row.status !== "approved", admin }; +} + +// Characters a name can't hold: control characters, and the bidirectional +// overrides and isolates that would let a name display as something else. +const NOT_IN_A_NAME = /[\p{Cc}\u202a-\u202e\u2066-\u2069]/u; + +/** + * A name as it is kept: trimmed, with runs of spaces made one, or null for none (absent or empty). + * Anything else, or a name longer than NAME_MAX_LENGTH characters, is refused. + */ +export function readName(value: unknown) { + if (value === undefined || value === null) return null; + if (typeof value !== "string") throw new HttpError(400, MESSAGES.badName); + const name = value.normalize("NFC").replace(/\s+/gu, " ").trim(); + if ([...name].length > NAME_MAX_LENGTH || NOT_IN_A_NAME.test(name)) throw new HttpError(400, MESSAGES.badName); + return name || null; } /** An address in the form accounts are kept under, or null if it isn't one. */ @@ -148,6 +166,9 @@ export async function verifyCode(request: Request, env: Env, now: number) { const email = normalizeEmail(body.email); const code = typeof body.code === "string" ? body.code.trim() : ""; if (!email || code.length !== CODE_LENGTH || !/^\d+$/.test(code)) throw new HttpError(400, MESSAGES.wrongCode); + // Sign-up may send the name to start the account with; it is checked before + // the code, so a name that can't be kept doesn't use up a try. + const name = readName(body.name); // Every check uses up one of the code's tries, right or wrong. const live = await db @@ -176,14 +197,16 @@ export async function verifyCode(request: Request, env: Env, now: number) { // A new account joins the waitlist unless sign-up is open or it is an // admin's; an existing one keeps its status. Either way the address is // proven, so the session starts: a waiting account sees the waitlist and - // nothing else. + // nothing else. A name sent along names a new account, or one without a + // name yet; it never replaces a name the account already has. const user = await db .prepare( - `INSERT INTO users (id, email, created_at, last_sign_in_at, status) VALUES (?1, ?2, ?3, ?3, ?4) - ON CONFLICT (email) DO UPDATE SET last_sign_in_at = excluded.last_sign_in_at - RETURNING id, email, status`, + `INSERT INTO users (id, email, created_at, last_sign_in_at, status, name) VALUES (?1, ?2, ?3, ?3, ?4, ?5) + ON CONFLICT (email) DO UPDATE SET + last_sign_in_at = excluded.last_sign_in_at, name = COALESCE(users.name, excluded.name) + RETURNING id, email, status, name`, ) - .bind(crypto.randomUUID(), email, now, isOpen(env) || adminEmails(env).has(email) ? "approved" : "waiting") + .bind(crypto.randomUUID(), email, now, isOpen(env) || adminEmails(env).has(email) ? "approved" : "waiting", name) .first(); const token = newToken(); await db @@ -200,7 +223,7 @@ export async function sessionUser(request: Request, env: Env, now: number) { const token = readSessionCookie(request); if (!token || !isToken(token)) return null; const row = await env.DB.prepare( - `SELECT users.id, users.email, users.status FROM sessions JOIN users ON users.id = sessions.user_id + `SELECT users.id, users.email, users.status, users.name FROM sessions JOIN users ON users.id = sessions.user_id WHERE sessions.id = ? AND sessions.expires_at > ?`, ) .bind(await tokenHash(token), now) @@ -212,6 +235,19 @@ export async function currentSession(request: Request, env: Env, now: number) { return json({ user: await sessionUser(request, env, now) }); } +/** Sets or clears (an empty name) the signed-in account's name, and answers with the account. */ +export async function updateProfile(request: Request, env: Env, now: number) { + const name = readName((await readJson(request)).name); + const signedIn = await sessionUser(request, env, now); + if (!signedIn) throw new HttpError(401, MESSAGES.signedOut); + const row = await env.DB.prepare("UPDATE users SET name = ? WHERE email = ? RETURNING id, email, status, name") + .bind(name, signedIn.email) + .first(); + // Removed by an admin between the two steps: signed out as far as anyone knows. + if (!row) throw new HttpError(401, MESSAGES.signedOut); + return json({ user: publicUser(row, env) }); +} + export async function signOut(request: Request, env: Env) { const token = readSessionCookie(request); if (token && isToken(token)) { diff --git a/api/src/index.ts b/api/src/index.ts index 43f9276..f0d34c8 100644 --- a/api/src/index.ts +++ b/api/src/index.ts @@ -2,7 +2,7 @@ // and sweeps expired rows on its daily schedule. import { approveUser, listUsers, removeUser } from "./admin"; -import { currentSession, sendCode, signOut, sweep, verifyCode } from "./auth"; +import { currentSession, sendCode, signOut, sweep, updateProfile, verifyCode } from "./auth"; import type { Env } from "./env"; import { allowedOrigin, HttpError, json, preflight, withCors } from "./http"; import { MESSAGES } from "./rules"; @@ -21,6 +21,8 @@ async function route(request: Request, env: Env, origin: string | null) { return verifyCode(request, env, now); case "GET /auth/session": return currentSession(request, env, now); + case "POST /auth/profile": + return updateProfile(request, env, now); case "POST /auth/signout": return signOut(request, env); case "GET /admin/users": diff --git a/api/src/rules.ts b/api/src/rules.ts index 568d300..0b459b0 100644 --- a/api/src/rules.ts +++ b/api/src/rules.ts @@ -6,6 +6,8 @@ export const CODE_TTL_MS = 10 * 60_000; export const CODE_MAX_ATTEMPTS = 5; export const RESEND_COOLDOWN_MS = 60_000; export const SESSION_TTL_MS = 30 * 24 * 60 * 60_000; +/** The longest name an account can go by, in characters. */ +export const NAME_MAX_LENGTH = 80; const HOUR = 60 * 60_000; export const DAY = 24 * HOUR; @@ -34,6 +36,7 @@ export function waitText(ms: number) { export const MESSAGES = { badRequest: "That request could not be read.", badEmail: "Enter a valid email address.", + badName: `Enter a name of up to ${NAME_MAX_LENGTH} characters, or leave it empty.`, wrongCode: "That code is wrong or has expired. Check the newest code, or ask for a new one.", wait: (seconds: number) => `You can ask for a new code in ${seconds} s.`, tooManyFromNetwork: (wait: string) => `Too many sign-in attempts from this network. Try again in ${wait}.`, diff --git a/api/test/auth.test.mjs b/api/test/auth.test.mjs index f4677fd..ee84e9c 100644 --- a/api/test/auth.test.mjs +++ b/api/test/auth.test.mjs @@ -7,7 +7,7 @@ const MINUTE = 60_000; const HOUR = 60 * MINUTE; const DAY = 24 * HOUR; // A new account, as the service describes it while sign-up is on the waitlist. -const ADA = { user: { email: "ada@example.com", waiting: true, admin: false } }; +const ADA = { user: { email: "ada@example.com", name: null, waiting: true, admin: false } }; let w; before(async () => { diff --git a/api/test/profile.test.mjs b/api/test/profile.test.mjs new file mode 100644 index 0000000..67b401c --- /dev/null +++ b/api/test/profile.test.mjs @@ -0,0 +1,134 @@ +import assert from "node:assert/strict"; +import { after, before, beforeEach, describe, test } from "node:test"; +import { start } from "./harness.mjs"; + +const BAD_NAME = "Enter a name of up to 80 characters, or leave it empty."; + +let w; +before(async () => { + // The waitlist on, whatever is deployed, so a waiting account can be tried too. + w = await start({ bindings: { ADMIN_EMAILS: "grace@example.com", SIGNUP_MODE: "waitlist" } }); +}); +after(() => w.stop()); +beforeEach(() => w.reset()); + +/** Signs in with `name` sent along, as /signup does; returns the answer and the cookie. */ +async function signUp(email, name) { + const code = await w.codeFor(email); + const verified = await w.call("/auth/verify", { body: { email, code, name } }); + return { ...verified, cookie: verified.headers.get("Set-Cookie")?.split(";")[0] }; +} +const session = async (cookie) => (await w.call("/auth/session", { method: "GET", cookie })).body.user; +const stored = async (email) => (await w.db.prepare("SELECT name FROM users WHERE email = ?").bind(email).first())?.name; + +describe("the name an account goes by", () => { + test("is null until one is given", async () => { + const cookie = await w.signIn("ada@example.com"); + assert.equal((await session(cookie)).name, null); + assert.equal(await stored("ada@example.com"), null); + }); + + test("sign-up can give it, tidied", async () => { + const { status, body, cookie } = await signUp("ada@example.com", " Ada \t Lovelace "); + assert.equal(status, 200); + assert.equal(body.user.name, "Ada Lovelace"); + assert.equal((await session(cookie)).name, "Ada Lovelace"); + }); + + test("an empty name at sign-up is none", async () => { + const { body } = await signUp("ada@example.com", " "); + assert.equal(body.user.name, null); + }); + + test("signing in again never replaces it, but fills it in if there is none", async () => { + await signUp("ada@example.com", "Ada Lovelace"); + assert.equal((await signUp("ada@example.com", "Someone Else")).body.user.name, "Ada Lovelace"); + await w.signIn("bob@example.com"); + assert.equal((await signUp("bob@example.com", "Bob")).body.user.name, "Bob"); + }); + + test("a name that can't be kept is refused before the code is tried", async () => { + const code = await w.codeFor("ada@example.com"); + for (const name of ["x".repeat(81), "Ada\u0000", "Ada\nLovelace\u0007", "‮ecalevoL adA", 42, ["Ada"]]) { + const refused = await w.call("/auth/verify", { body: { email: "ada@example.com", code, name } }); + assert.equal(refused.status, 400, JSON.stringify(name)); + assert.equal(refused.body.error, BAD_NAME); + } + // The code still has all its tries: refusing the name didn't use one. + const { attempts } = await w.db.prepare("SELECT attempts FROM sign_in_codes WHERE email = ?").bind("ada@example.com").first(); + assert.equal(attempts, 0); + assert.equal((await w.call("/auth/verify", { body: { email: "ada@example.com", code, name: "Ada" } })).status, 200); + }); + + test("80 characters fit, counted as characters, not bytes", async () => { + const name = "é".repeat(40) + "李".repeat(39) + "😀"; + assert.equal([...name].length, 80); + assert.equal((await signUp("ada@example.com", name)).body.user.name, name); + }); + + test("scripts that join with zero-width joiners keep them", async () => { + // Malayalam, Hindi and emoji sequences use U+200C and U+200D inside a name. + const name = "ന്‍ क्‌ष 👩‍💻"; + assert.ok(name.includes("‍") && name.includes("‌")); + assert.equal((await signUp("ada@example.com", name)).body.user.name, name); + }); +}); + +describe("POST /auth/profile", () => { + test("changes the signed-in account's name, and answers with the account", async () => { + const cookie = await w.signIn("ada@example.com"); + const changed = await w.call("/auth/profile", { body: { name: " Ada King " }, cookie }); + assert.equal(changed.status, 200); + assert.deepEqual(changed.body, { user: { email: "ada@example.com", name: "Ada King", waiting: true, admin: false } }); + assert.equal((await session(cookie)).name, "Ada King"); + }); + + test("an empty name clears it", async () => { + const { cookie } = await signUp("ada@example.com", "Ada"); + assert.equal((await w.call("/auth/profile", { body: { name: "" }, cookie })).body.user.name, null); + assert.equal(await stored("ada@example.com"), null); + }); + + test("a waiting account can name itself too", async () => { + const cookie = await w.signIn("ada@example.com"); + assert.equal((await session(cookie)).waiting, true); + assert.equal((await w.call("/auth/profile", { body: { name: "Ada" }, cookie })).status, 200); + }); + + test("refuses a name that can't be kept, and changes nothing", async () => { + const { cookie } = await signUp("ada@example.com", "Ada"); + const refused = await w.call("/auth/profile", { body: { name: "x".repeat(81) }, cookie }); + assert.equal(refused.status, 400); + assert.equal(refused.body.error, BAD_NAME); + assert.equal(await stored("ada@example.com"), "Ada"); + }); + + test("needs a session", async () => { + const answer = await w.call("/auth/profile", { body: { name: "Ada" } }); + assert.equal(answer.status, 401); + assert.equal(answer.body.error, "Sign in first."); + }); + + test("changes only its own account", async () => { + const ada = await w.signIn("ada@example.com"); + await signUp("bob@example.com", "Bob"); + await w.call("/auth/profile", { body: { name: "Ada" }, cookie: ada }); + assert.equal(await stored("bob@example.com"), "Bob"); + }); + + test("is refused from another site, before anything is read", async () => { + const cookie = await w.signIn("ada@example.com"); + const foreign = await w.call("/auth/profile", { body: { name: "Mallory" }, cookie, origin: "https://evil.example" }); + assert.equal(foreign.status, 403); + assert.equal(await stored("ada@example.com"), null); + }); + + test("the admin listing carries each account's name", async () => { + await signUp("ada@example.com", "Ada Lovelace"); + await w.signIn("bob@example.com"); + const admin = await w.signIn("grace@example.com"); + const { users } = (await w.call("/admin/users", { method: "GET", cookie: admin })).body; + assert.equal(users.find((u) => u.email === "ada@example.com").name, "Ada Lovelace"); + assert.equal(users.find((u) => u.email === "bob@example.com").name, null); + }); +}); diff --git a/api/test/waitlist.test.mjs b/api/test/waitlist.test.mjs index c2be4db..c473b73 100644 --- a/api/test/waitlist.test.mjs +++ b/api/test/waitlist.test.mjs @@ -20,13 +20,13 @@ describe("while sign-up is on the waitlist", () => { test("a new account signs in, but waits", async () => { const cookie = await w.signIn("ada@example.com"); - assert.deepEqual(await session(w, cookie), { email: "ada@example.com", waiting: true, admin: false }); + assert.deepEqual(await session(w, cookie), { email: "ada@example.com", name: null, waiting: true, admin: false }); assert.equal(await status(w, "ada@example.com"), "waiting"); }); test("an admin never waits", async () => { const cookie = await w.signIn(GRACE); - assert.deepEqual(await session(w, cookie), { email: GRACE, waiting: false, admin: true }); + assert.deepEqual(await session(w, cookie), { email: GRACE, name: null, waiting: false, admin: true }); assert.equal(await status(w, GRACE), "approved"); }); @@ -35,7 +35,7 @@ describe("while sign-up is on the waitlist", () => { .prepare("INSERT INTO users (id, email, created_at, last_sign_in_at, status) VALUES ('u1', 'ops@example.com', 1, 1, 'waiting')") .run(); const ops = await w.signIn("ops@example.com"); - assert.deepEqual(await session(w, ops), { email: "ops@example.com", waiting: false, admin: true }); + assert.deepEqual(await session(w, ops), { email: "ops@example.com", name: null, waiting: false, admin: true }); await w.signIn("ada@example.com"); const listed = await w.call("/admin/users", { method: "GET", cookie: ops }); assert.deepEqual( @@ -101,7 +101,7 @@ describe("while sign-up is on the waitlist", () => { assert.equal(approved.status, 200); assert.deepEqual(approved.body, { approved: true, emailed: true }); - assert.deepEqual(await session(w, ada), { email: "ada@example.com", waiting: false, admin: false }); + assert.deepEqual(await session(w, ada), { email: "ada@example.com", name: null, waiting: false, admin: false }); const row = await w.db.prepare("SELECT status, approved_at, approved_by FROM users WHERE email = 'ada@example.com'").first(); assert.equal(row.status, "approved"); assert.equal(row.approved_by, GRACE); @@ -212,7 +212,7 @@ describe("the SIGNUP_MODE flag", () => { assert.equal((await session(w, old)).waiting, false); const ada = await w.signIn("ada@example.com"); - assert.deepEqual(await session(w, ada), { email: "ada@example.com", waiting: false, admin: false }); + assert.deepEqual(await session(w, ada), { email: "ada@example.com", name: null, waiting: false, admin: false }); assert.equal(await status(w, "ada@example.com"), "approved"); const admin = await w.signIn(GRACE); diff --git a/docs/404.html b/docs/404.html index 94f1b2e..9885542 100644 --- a/docs/404.html +++ b/docs/404.html @@ -33,8 +33,8 @@ - - + + diff --git a/docs/assets/index-CI9Lh2bL.js b/docs/assets/index-CI9Lh2bL.js new file mode 100644 index 0000000..f84dcf0 --- /dev/null +++ b/docs/assets/index-CI9Lh2bL.js @@ -0,0 +1,67 @@ +function RM(e,t){for(var r=0;ra[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function r(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(o){if(o.ep)return;o.ep=!0;const c=r(o);fetch(o.href,c)}})();function CM(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zp={exports:{}},uc={};var Jb;function TM(){if(Jb)return uc;Jb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,o,c){var u=null;if(c!==void 0&&(u=""+c),o.key!==void 0&&(u=""+o.key),"key"in o){c={};for(var f in o)f!=="key"&&(c[f]=o[f])}else c=o;return o=c.ref,{$$typeof:e,type:a,key:u,ref:o!==void 0?o:null,props:c}}return uc.Fragment=t,uc.jsx=r,uc.jsxs=r,uc}var ex;function AM(){return ex||(ex=1,zp.exports=TM()),zp.exports}var y=AM(),Pp={exports:{}},rt={};var tx;function MM(){if(tx)return rt;tx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),x=Symbol.iterator;function S(M){return M===null||typeof M!="object"?null:(M=x&&M[x]||M["@@iterator"],typeof M=="function"?M:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,R={};function T(M,z,I){this.props=M,this.context=z,this.refs=R,this.updater=I||E}T.prototype.isReactComponent={},T.prototype.setState=function(M,z){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,z,"setState")},T.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function O(){}O.prototype=T.prototype;function k(M,z,I){this.props=M,this.context=z,this.refs=R,this.updater=I||E}var j=k.prototype=new O;j.constructor=k,w(j,T.prototype),j.isPureReactComponent=!0;var L=Array.isArray;function P(){}var N={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function H(M,z,I){var B=I.ref;return{$$typeof:e,type:M,key:z,ref:B!==void 0?B:null,props:I}}function Y(M,z){return H(M.type,z,M.props)}function W(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function K(M){var z={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(I){return z[I]})}var $=/\/+/g;function ee(M,z){return typeof M=="object"&&M!==null&&M.key!=null?K(""+M.key):z.toString(36)}function ie(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(P,P):(M.status="pending",M.then(function(z){M.status==="pending"&&(M.status="fulfilled",M.value=z)},function(z){M.status==="pending"&&(M.status="rejected",M.reason=z)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function V(M,z,I,B,Z){var re=typeof M;(re==="undefined"||re==="boolean")&&(M=null);var fe=!1;if(M===null)fe=!0;else switch(re){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(M.$$typeof){case e:case t:fe=!0;break;case g:return fe=M._init,V(fe(M._payload),z,I,B,Z)}}if(fe)return Z=Z(M),fe=B===""?"."+ee(M,0):B,L(Z)?(I="",fe!=null&&(I=fe.replace($,"$&/")+"/"),V(Z,z,I,"",function(Ae){return Ae})):Z!=null&&(W(Z)&&(Z=Y(Z,I+(Z.key==null||M&&M.key===Z.key?"":(""+Z.key).replace($,"$&/")+"/")+fe)),z.push(Z)),1;fe=0;var pe=B===""?".":B+":";if(L(M))for(var ce=0;ce>>1,_=V[F];if(0>>1;Fo(I,Q))B<_&&0>o(Z,I)?(V[F]=Z,V[B]=Q,F=B):(V[F]=I,V[z]=Q,F=z);else if(B<_&&0>o(Z,Q))V[F]=Z,V[B]=Q,F=B;else break e}}return X}function o(V,X){var Q=V.sortIndex-X.sortIndex;return Q!==0?Q:V.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var d=[],m=[],g=1,v=null,x=3,S=!1,E=!1,w=!1,R=!1,T=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function j(V){for(var X=r(m);X!==null;){if(X.callback===null)a(m);else if(X.startTime<=V)a(m),X.sortIndex=X.expirationTime,t(d,X);else break;X=r(m)}}function L(V){if(w=!1,j(V),!E)if(r(d)!==null)E=!0,P||(P=!0,K());else{var X=r(m);X!==null&&ie(L,X.startTime-V)}}var P=!1,N=-1,A=5,H=-1;function Y(){return R?!0:!(e.unstable_now()-HV&&Y());){var F=v.callback;if(typeof F=="function"){v.callback=null,x=v.priorityLevel;var _=F(v.expirationTime<=V);if(V=e.unstable_now(),typeof _=="function"){v.callback=_,j(V),X=!0;break t}v===r(d)&&a(d),j(V)}else a(d);v=r(d)}if(v!==null)X=!0;else{var M=r(m);M!==null&&ie(L,M.startTime-V),X=!1}}break e}finally{v=null,x=Q,S=!1}X=void 0}}finally{X?K():P=!1}}}var K;if(typeof k=="function")K=function(){k(W)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,ee=$.port2;$.port1.onmessage=W,K=function(){ee.postMessage(null)}}else K=function(){T(W,0)};function ie(V,X){N=T(function(){V(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125F?(V.sortIndex=Q,t(m,V),r(d)===null&&V===r(m)&&(w?(O(N),N=-1):w=!0,ie(L,Q-F))):(V.sortIndex=_,t(d,V),E||S||(E=!0,P||(P=!0,K()))),V},e.unstable_shouldYield=Y,e.unstable_wrapCallback=function(V){var X=x;return function(){var Q=x;x=X;try{return V.apply(this,arguments)}finally{x=Q}}}})(Up)),Up}var rx;function NM(){return rx||(rx=1,Vp.exports=OM()),Vp.exports}var Ip={exports:{}},li={};var ax;function DM(){if(ax)return li;ax=1;var e=du();function t(d){var m="https://react.dev/errors/"+d;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ip.exports=DM(),Ip.exports}var ox;function LM(){if(ox)return fc;ox=1;var e=NM(),t=du(),r=ZE();function a(n){var i="https://react.dev/errors/"+n;if(1_||(n.current=F[_],F[_]=null,_--)}function I(n,i){_++,F[_]=n.current,n.current=i}var B=M(null),Z=M(null),re=M(null),fe=M(null);function pe(n,i){switch(I(re,i),I(Z,n),I(B,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?wb(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=wb(i),n=Eb(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}z(B),I(B,n)}function ce(){z(B),z(Z),z(re)}function Ae(n){n.memoizedState!==null&&I(fe,n);var i=B.current,s=Eb(i,n.type);i!==s&&(I(Z,n),I(B,s))}function ke(n){Z.current===n&&(z(B),z(Z)),fe.current===n&&(z(fe),sc._currentValue=Q)}var we,Re;function ye(n){if(we===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);we=i&&i[1]||"",Re=-1)":-1h||q[l]!==se[h]){var me=` +`+q[l].replace(" at new "," at ");return n.displayName&&me.includes("")&&(me=me.replace("",n.displayName)),me}while(1<=l&&0<=h);break}}}finally{ze=!1,Error.prepareStackTrace=s}return(s=n?n.displayName||n.name:"")?ye(s):""}function Qe(n,i){switch(n.tag){case 26:case 27:case 5:return ye(n.type);case 16:return ye("Lazy");case 13:return n.child!==i&&i!==null?ye("Suspense Fallback"):ye("Suspense");case 19:return ye("SuspenseList");case 0:case 15:return Ye(n.type,!1);case 11:return Ye(n.type.render,!1);case 1:return Ye(n.type,!0);case 31:return ye("Activity");default:return""}}function nt(n){try{var i="",s=null;do i+=Qe(n,s),s=n,n=n.return;while(n);return i}catch(l){return` +Error generating stack: `+l.message+` +`+l.stack}}var De=Object.prototype.hasOwnProperty,Xe=e.unstable_scheduleCallback,Me=e.unstable_cancelCallback,et=e.unstable_shouldYield,Et=e.unstable_requestPaint,at=e.unstable_now,ue=e.unstable_getCurrentPriorityLevel,be=e.unstable_ImmediatePriority,$e=e.unstable_UserBlockingPriority,Te=e.unstable_NormalPriority,Oe=e.unstable_LowPriority,bt=e.unstable_IdlePriority,Dt=e.log,xt=e.unstable_setDisableYieldValue,Ot=null,Lt=null;function Ft(n){if(typeof Dt=="function"&&xt(n),Lt&&typeof Lt.setStrictMode=="function")try{Lt.setStrictMode(Ot,n)}catch{}}var Yt=Math.clz32?Math.clz32:Gn,mn=Math.log,qn=Math.LN2;function Gn(n){return n>>>=0,n===0?32:31-(mn(n)/qn|0)|0}var bn=256,Rt=262144,un=4194304;function kt(n){var i=n&42;if(i!==0)return i;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function jn(n,i,s){var l=n.pendingLanes;if(l===0)return 0;var h=0,p=n.suspendedLanes,C=n.pingedLanes;n=n.warmLanes;var D=l&134217727;return D!==0?(l=D&~p,l!==0?h=kt(l):(C&=D,C!==0?h=kt(C):s||(s=D&~n,s!==0&&(h=kt(s))))):(D=l&~p,D!==0?h=kt(D):C!==0?h=kt(C):s||(s=l&~n,s!==0&&(h=kt(s)))),h===0?0:i!==0&&i!==h&&(i&p)===0&&(p=h&-h,s=i&-i,p>=s||p===32&&(s&4194048)!==0)?i:h}function Pn(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function ct(n,i){switch(n){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 sn(){var n=un;return un<<=1,(un&62914560)===0&&(un=4194304),n}function Jt(n){for(var i=[],s=0;31>s;s++)i.push(n);return i}function _t(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function en(n,i,s,l,h,p){var C=n.pendingLanes;n.pendingLanes=s,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=s,n.entangledLanes&=s,n.errorRecoveryDisabledLanes&=s,n.shellSuspendCounter=0;var D=n.entanglements,q=n.expirationTimes,se=n.hiddenUpdates;for(s=C&~s;0"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var Ue=/[\n"\\]/g;function qe(n){return n.replace(Ue,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Je(n,i,s,l,h,p,C,D){n.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?n.type=C:n.removeAttribute("type"),i!=null?C==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+qt(i)):n.value!==""+qt(i)&&(n.value=""+qt(i)):C!=="submit"&&C!=="reset"||n.removeAttribute("value"),i!=null?on(n,C,qt(i)):s!=null?on(n,C,qt(s)):l!=null&&n.removeAttribute("value"),h==null&&p!=null&&(n.defaultChecked=!!p),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?n.name=""+qt(D):n.removeAttribute("name")}function At(n,i,s,l,h,p,C,D){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(n.type=p),i!=null||s!=null){if(!(p!=="submit"&&p!=="reset"||i!=null)){oe(n);return}s=s!=null?""+qt(s):"",i=i!=null?""+qt(i):s,D||i===n.value||(n.value=i),n.defaultValue=i}l=l??h,l=typeof l!="function"&&typeof l!="symbol"&&!!l,n.checked=D?n.checked:!!l,n.defaultChecked=!!l,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(n.name=C),oe(n)}function on(n,i,s){i==="number"&&xe(n.ownerDocument)===n||n.defaultValue===""+s||(n.defaultValue=""+s)}function Mt(n,i,s,l){if(n=n.options,i){i={};for(var h=0;h"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wi=!1;if(Li)try{var Ei={};Object.defineProperty(Ei,"passive",{get:function(){wi=!0}}),window.addEventListener("test",Ei,Ei),window.removeEventListener("test",Ei,Ei)}catch{wi=!1}var mi=null,lo=null,pi=null;function co(){if(pi)return pi;var n,i=lo,s=i.length,l,h="value"in mi?mi.value:mi.textContent,p=h.length;for(n=0;n=Al),jv=" ",Ov=!1;function Nv(n,i){switch(n){case"keyup":return G5.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dv(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var uo=!1;function X5(n,i){switch(n){case"compositionend":return Dv(i);case"keypress":return i.which!==32?null:(Ov=!0,jv);case"textInput":return n=i.data,n===jv&&Ov?null:n;default:return null}}function $5(n,i){if(uo)return n==="compositionend"||!Bh&&Nv(n,i)?(n=co(),pi=lo=mi=null,uo=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1=i)return{node:s,offset:i-n};n=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Iv(s)}}function Hv(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Hv(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function Fv(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=xe(n.document);i instanceof n.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)n=i.contentWindow;else break;i=xe(n.document)}return i}function Yh(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var i3=Li&&"documentMode"in document&&11>=document.documentMode,fo=null,qh=null,Nl=null,Gh=!1;function Yv(n,i,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Gh||fo==null||fo!==xe(l)||(l=fo,"selectionStart"in l&&Yh(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Nl&&Ol(Nl,l)||(Nl=l,l=yf(qh,"onSelect"),0>=C,h-=C,Ur=1<<32-Yt(i)+h|s<ht?(Tt=Ie,Ie=null):Tt=Ie.sibling;var Pt=le(ne,Ie,ae[ht],ve);if(Pt===null){Ie===null&&(Ie=Tt);break}n&&Ie&&Pt.alternate===null&&i(ne,Ie),J=p(Pt,J,ht),zt===null?Ge=Pt:zt.sibling=Pt,zt=Pt,Ie=Tt}if(ht===ae.length)return s(ne,Ie),jt&&sa(ne,ht),Ge;if(Ie===null){for(;htht?(Tt=Ie,Ie=null):Tt=Ie.sibling;var is=le(ne,Ie,Pt.value,ve);if(is===null){Ie===null&&(Ie=Tt);break}n&&Ie&&is.alternate===null&&i(ne,Ie),J=p(is,J,ht),zt===null?Ge=is:zt.sibling=is,zt=is,Ie=Tt}if(Pt.done)return s(ne,Ie),jt&&sa(ne,ht),Ge;if(Ie===null){for(;!Pt.done;ht++,Pt=ae.next())Pt=Se(ne,Pt.value,ve),Pt!==null&&(J=p(Pt,J,ht),zt===null?Ge=Pt:zt.sibling=Pt,zt=Pt);return jt&&sa(ne,ht),Ge}for(Ie=l(Ie);!Pt.done;ht++,Pt=ae.next())Pt=de(Ie,ne,ht,Pt.value,ve),Pt!==null&&(n&&Pt.alternate!==null&&Ie.delete(Pt.key===null?ht:Pt.key),J=p(Pt,J,ht),zt===null?Ge=Pt:zt.sibling=Pt,zt=Pt);return n&&Ie.forEach(function(EM){return i(ne,EM)}),jt&&sa(ne,ht),Ge}function Zt(ne,J,ae,ve){if(typeof ae=="object"&&ae!==null&&ae.type===w&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case S:e:{for(var Ge=ae.key;J!==null;){if(J.key===Ge){if(Ge=ae.type,Ge===w){if(J.tag===7){s(ne,J.sibling),ve=h(J,ae.props.children),ve.return=ne,ne=ve;break e}}else if(J.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===A&&Ls(Ge)===J.type){s(ne,J.sibling),ve=h(J,ae.props),_l(ve,ae),ve.return=ne,ne=ve;break e}s(ne,J);break}else i(ne,J);J=J.sibling}ae.type===w?(ve=Ms(ae.props.children,ne.mode,ve,ae.key),ve.return=ne,ne=ve):(ve=Lu(ae.type,ae.key,ae.props,null,ne.mode,ve),_l(ve,ae),ve.return=ne,ne=ve)}return C(ne);case E:e:{for(Ge=ae.key;J!==null;){if(J.key===Ge)if(J.tag===4&&J.stateNode.containerInfo===ae.containerInfo&&J.stateNode.implementation===ae.implementation){s(ne,J.sibling),ve=h(J,ae.children||[]),ve.return=ne,ne=ve;break e}else{s(ne,J);break}else i(ne,J);J=J.sibling}ve=Jh(ae,ne.mode,ve),ve.return=ne,ne=ve}return C(ne);case A:return ae=Ls(ae),Zt(ne,J,ae,ve)}if(ie(ae))return _e(ne,J,ae,ve);if(K(ae)){if(Ge=K(ae),typeof Ge!="function")throw Error(a(150));return ae=Ge.call(ae),Ze(ne,J,ae,ve)}if(typeof ae.then=="function")return Zt(ne,J,Iu(ae),ve);if(ae.$$typeof===k)return Zt(ne,J,Pu(ne,ae),ve);Bu(ne,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,J!==null&&J.tag===6?(s(ne,J.sibling),ve=h(J,ae),ve.return=ne,ne=ve):(s(ne,J),ve=Qh(ae,ne.mode,ve),ve.return=ne,ne=ve),C(ne)):s(ne,J)}return function(ne,J,ae,ve){try{Pl=0;var Ge=Zt(ne,J,ae,ve);return Eo=null,Ge}catch(Ie){if(Ie===wo||Ie===Vu)throw Ie;var zt=Vi(29,Ie,null,ne.mode);return zt.lanes=ve,zt.return=ne,zt}}}var zs=h1(!0),m1=h1(!1),Ia=!1;function fm(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function dm(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Ba(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Ha(n,i,s){var l=n.updateQueue;if(l===null)return null;if(l=l.shared,(Vt&2)!==0){var h=l.pending;return h===null?i.next=i:(i.next=h.next,h.next=i),l.pending=i,i=Du(n),Zv(n,null,s),i}return Nu(n,l,i,s),Du(n)}function Vl(n,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var l=i.lanes;l&=n.pendingLanes,s|=l,i.lanes=s,Kn(n,s)}}function hm(n,i){var s=n.updateQueue,l=n.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var h=null,p=null;if(s=s.firstBaseUpdate,s!==null){do{var C={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};p===null?h=p=C:p=p.next=C,s=s.next}while(s!==null);p===null?h=p=i:p=p.next=i}else h=p=i;s={baseState:l.baseState,firstBaseUpdate:h,lastBaseUpdate:p,shared:l.shared,callbacks:l.callbacks},n.updateQueue=s;return}n=s.lastBaseUpdate,n===null?s.firstBaseUpdate=i:n.next=i,s.lastBaseUpdate=i}var mm=!1;function Ul(){if(mm){var n=So;if(n!==null)throw n}}function Il(n,i,s,l){mm=!1;var h=n.updateQueue;Ia=!1;var p=h.firstBaseUpdate,C=h.lastBaseUpdate,D=h.shared.pending;if(D!==null){h.shared.pending=null;var q=D,se=q.next;q.next=null,C===null?p=se:C.next=se,C=q;var me=n.alternate;me!==null&&(me=me.updateQueue,D=me.lastBaseUpdate,D!==C&&(D===null?me.firstBaseUpdate=se:D.next=se,me.lastBaseUpdate=q))}if(p!==null){var Se=h.baseState;C=0,me=se=q=null,D=p;do{var le=D.lane&-536870913,de=le!==D.lane;if(de?(Ct&le)===le:(l&le)===le){le!==0&&le===xo&&(mm=!0),me!==null&&(me=me.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var _e=n,Ze=D;le=i;var Zt=s;switch(Ze.tag){case 1:if(_e=Ze.payload,typeof _e=="function"){Se=_e.call(Zt,Se,le);break e}Se=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=Ze.payload,le=typeof _e=="function"?_e.call(Zt,Se,le):_e,le==null)break e;Se=v({},Se,le);break e;case 2:Ia=!0}}le=D.callback,le!==null&&(n.flags|=64,de&&(n.flags|=8192),de=h.callbacks,de===null?h.callbacks=[le]:de.push(le))}else de={lane:le,tag:D.tag,payload:D.payload,callback:D.callback,next:null},me===null?(se=me=de,q=Se):me=me.next=de,C|=le;if(D=D.next,D===null){if(D=h.shared.pending,D===null)break;de=D,D=de.next,de.next=null,h.lastBaseUpdate=de,h.shared.pending=null}}while(!0);me===null&&(q=Se),h.baseState=q,h.firstBaseUpdate=se,h.lastBaseUpdate=me,p===null&&(h.shared.lanes=0),Ka|=C,n.lanes=C,n.memoizedState=Se}}function p1(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function g1(n,i){var s=n.callbacks;if(s!==null)for(n.callbacks=null,n=0;np?p:8;var C=V.T,D={};V.T=D,Lm(n,!1,i,s);try{var q=h(),se=V.S;if(se!==null&&se(D,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var me=d3(q,l);Fl(n,i,me,Fi(n))}else Fl(n,i,l,Fi(n))}catch(Se){Fl(n,i,{then:function(){},status:"rejected",reason:Se},Fi())}finally{X.p=p,C!==null&&D.types!==null&&(C.types=D.types),V.T=C}}function v3(){}function Nm(n,i,s,l){if(n.tag!==5)throw Error(a(476));var h=X1(n).queue;K1(n,h,i,Q,s===null?v3:function(){return $1(n),s(l)})}function X1(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:Q},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:s},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function $1(n){var i=X1(n);i.next===null&&(i=n.alternate.memoizedState),Fl(n,i.next.queue,{},Fi())}function Dm(){return Qn(sc)}function W1(){return An().memoizedState}function Z1(){return An().memoizedState}function b3(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var s=Fi();n=Ba(s);var l=Ha(i,n,s);l!==null&&(Mi(l,i,s),Vl(l,i,s)),i={cache:om()},n.payload=i;return}i=i.return}}function x3(n,i,s){var l=Fi();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Zu(n)?J1(i,s):(s=Wh(n,i,s,l),s!==null&&(Mi(s,n,l),e2(s,i,l)))}function Q1(n,i,s){var l=Fi();Fl(n,i,s,l)}function Fl(n,i,s,l){var h={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Zu(n))J1(i,h);else{var p=n.alternate;if(n.lanes===0&&(p===null||p.lanes===0)&&(p=i.lastRenderedReducer,p!==null))try{var C=i.lastRenderedState,D=p(C,s);if(h.hasEagerState=!0,h.eagerState=D,_i(D,C))return Nu(n,i,h,0),tn===null&&Ou(),!1}catch{}if(s=Wh(n,i,h,l),s!==null)return Mi(s,n,l),e2(s,i,l),!0}return!1}function Lm(n,i,s,l){if(l={lane:2,revertLane:fp(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Zu(n)){if(i)throw Error(a(479))}else i=Wh(n,s,l,2),i!==null&&Mi(i,n,2)}function Zu(n){var i=n.alternate;return n===lt||i!==null&&i===lt}function J1(n,i){Co=Yu=!0;var s=n.pending;s===null?i.next=i:(i.next=s.next,s.next=i),n.pending=i}function e2(n,i,s){if((s&4194048)!==0){var l=i.lanes;l&=n.pendingLanes,s|=l,i.lanes=s,Kn(n,s)}}var Yl={readContext:Qn,use:Ku,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useLayoutEffect:xn,useInsertionEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useSyncExternalStore:xn,useId:xn,useHostTransitionStatus:xn,useFormState:xn,useActionState:xn,useOptimistic:xn,useMemoCache:xn,useCacheRefresh:xn};Yl.useEffectEvent=xn;var t2={readContext:Qn,use:Ku,useCallback:function(n,i){return yi().memoizedState=[n,i===void 0?null:i],n},useContext:Qn,useEffect:V1,useImperativeHandle:function(n,i,s){s=s!=null?s.concat([n]):null,$u(4194308,4,H1.bind(null,i,n),s)},useLayoutEffect:function(n,i){return $u(4194308,4,n,i)},useInsertionEffect:function(n,i){$u(4,2,n,i)},useMemo:function(n,i){var s=yi();i=i===void 0?null:i;var l=n();if(Ps){Ft(!0);try{n()}finally{Ft(!1)}}return s.memoizedState=[l,i],l},useReducer:function(n,i,s){var l=yi();if(s!==void 0){var h=s(i);if(Ps){Ft(!0);try{s(i)}finally{Ft(!1)}}}else h=i;return l.memoizedState=l.baseState=h,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:h},l.queue=n,n=n.dispatch=x3.bind(null,lt,n),[l.memoizedState,n]},useRef:function(n){var i=yi();return n={current:n},i.memoizedState=n},useState:function(n){n=Tm(n);var i=n.queue,s=Q1.bind(null,lt,i);return i.dispatch=s,[n.memoizedState,s]},useDebugValue:jm,useDeferredValue:function(n,i){var s=yi();return Om(s,n,i)},useTransition:function(){var n=Tm(!1);return n=K1.bind(null,lt,n.queue,!0,!1),yi().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,s){var l=lt,h=yi();if(jt){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),tn===null)throw Error(a(349));(Ct&127)!==0||w1(l,i,s)}h.memoizedState=s;var p={value:s,getSnapshot:i};return h.queue=p,V1(R1.bind(null,l,p,n),[n]),l.flags|=2048,Ao(9,{destroy:void 0},E1.bind(null,l,p,s,i),null),s},useId:function(){var n=yi(),i=tn.identifierPrefix;if(jt){var s=Ir,l=Ur;s=(l&~(1<<32-Yt(l)-1)).toString(32)+s,i="_"+i+"R_"+s,s=qu++,0<\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof l.is=="string"?C.createElement("select",{is:l.is}):C.createElement("select"),l.multiple?p.multiple=!0:l.size&&(p.size=l.size);break;default:p=typeof l.is=="string"?C.createElement(h,{is:l.is}):C.createElement(h)}}p[Ce]=i,p[je]=l;e:for(C=i.child;C!==null;){if(C.tag===5||C.tag===6)p.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===i)break e;for(;C.sibling===null;){if(C.return===null||C.return===i)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}i.stateNode=p;e:switch(ei(p,h,l),h){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&da(i)}}return cn(i),Km(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,s),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==l&&da(i);else{if(typeof l!="string"&&i.stateNode===null)throw Error(a(166));if(n=re.current,vo(i)){if(n=i.stateNode,s=i.memoizedProps,l=null,h=Zn,h!==null)switch(h.tag){case 27:case 5:l=h.memoizedProps}n[Ce]=i,n=!!(n.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||xb(n.nodeValue,s)),n||Va(i,!0)}else n=vf(n).createTextNode(l),n[Ce]=i,i.stateNode=n}return cn(i),null;case 31:if(s=i.memoizedState,n===null||n.memoizedState!==null){if(l=vo(i),s!==null){if(n===null){if(!l)throw Error(a(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[Ce]=i}else js(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;cn(i),n=!1}else s=im(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=s),n=!0;if(!n)return i.flags&256?(Ii(i),i):(Ii(i),null);if((i.flags&128)!==0)throw Error(a(558))}return cn(i),null;case 13:if(l=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(h=vo(i),l!==null&&l.dehydrated!==null){if(n===null){if(!h)throw Error(a(318));if(h=i.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[Ce]=i}else js(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;cn(i),h=!1}else h=im(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=h),h=!0;if(!h)return i.flags&256?(Ii(i),i):(Ii(i),null)}return Ii(i),(i.flags&128)!==0?(i.lanes=s,i):(s=l!==null,n=n!==null&&n.memoizedState!==null,s&&(l=i.child,h=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(h=l.alternate.memoizedState.cachePool.pool),p=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),p!==h&&(l.flags|=2048)),s!==n&&s&&(i.child.flags|=8192),nf(i,i.updateQueue),cn(i),null);case 4:return ce(),n===null&&pp(i.stateNode.containerInfo),cn(i),null;case 10:return la(i.type),cn(i),null;case 19:if(z(Tn),l=i.memoizedState,l===null)return cn(i),null;if(h=(i.flags&128)!==0,p=l.rendering,p===null)if(h)Gl(l,!1);else{if(Sn!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(p=Fu(n),p!==null){for(i.flags|=128,Gl(l,!1),n=p.updateQueue,i.updateQueue=n,nf(i,n),i.subtreeFlags=0,n=s,s=i.child;s!==null;)Qv(s,n),s=s.sibling;return I(Tn,Tn.current&1|2),jt&&sa(i,l.treeForkCount),i.child}n=n.sibling}l.tail!==null&&at()>lf&&(i.flags|=128,h=!0,Gl(l,!1),i.lanes=4194304)}else{if(!h)if(n=Fu(p),n!==null){if(i.flags|=128,h=!0,n=n.updateQueue,i.updateQueue=n,nf(i,n),Gl(l,!0),l.tail===null&&l.tailMode==="hidden"&&!p.alternate&&!jt)return cn(i),null}else 2*at()-l.renderingStartTime>lf&&s!==536870912&&(i.flags|=128,h=!0,Gl(l,!1),i.lanes=4194304);l.isBackwards?(p.sibling=i.child,i.child=p):(n=l.last,n!==null?n.sibling=p:i.child=p,l.last=p)}return l.tail!==null?(n=l.tail,l.rendering=n,l.tail=n.sibling,l.renderingStartTime=at(),n.sibling=null,s=Tn.current,I(Tn,h?s&1|2:s&1),jt&&sa(i,l.treeForkCount),n):(cn(i),null);case 22:case 23:return Ii(i),gm(),l=i.memoizedState!==null,n!==null?n.memoizedState!==null!==l&&(i.flags|=8192):l&&(i.flags|=8192),l?(s&536870912)!==0&&(i.flags&128)===0&&(cn(i),i.subtreeFlags&6&&(i.flags|=8192)):cn(i),s=i.updateQueue,s!==null&&nf(i,s.retryQueue),s=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),l=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),l!==s&&(i.flags|=2048),n!==null&&z(Ds),null;case 24:return s=null,n!==null&&(s=n.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),la(Nn),cn(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function C3(n,i){switch(tm(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return la(Nn),ce(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return ke(i),null;case 31:if(i.memoizedState!==null){if(Ii(i),i.alternate===null)throw Error(a(340));js()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(Ii(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(a(340));js()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return z(Tn),null;case 4:return ce(),null;case 10:return la(i.type),null;case 22:case 23:return Ii(i),gm(),n!==null&&z(Ds),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return la(Nn),null;case 25:return null;default:return null}}function C2(n,i){switch(tm(i),i.tag){case 3:la(Nn),ce();break;case 26:case 27:case 5:ke(i);break;case 4:ce();break;case 31:i.memoizedState!==null&&Ii(i);break;case 13:Ii(i);break;case 19:z(Tn);break;case 10:la(i.type);break;case 22:case 23:Ii(i),gm(),n!==null&&z(Ds);break;case 24:la(Nn)}}function Kl(n,i){try{var s=i.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var h=l.next;s=h;do{if((s.tag&n)===n){l=void 0;var p=s.create,C=s.inst;l=p(),C.destroy=l}s=s.next}while(s!==h)}}catch(D){Kt(i,i.return,D)}}function qa(n,i,s){try{var l=i.updateQueue,h=l!==null?l.lastEffect:null;if(h!==null){var p=h.next;l=p;do{if((l.tag&n)===n){var C=l.inst,D=C.destroy;if(D!==void 0){C.destroy=void 0,h=i;var q=s,se=D;try{se()}catch(me){Kt(h,q,me)}}}l=l.next}while(l!==p)}}catch(me){Kt(i,i.return,me)}}function T2(n){var i=n.updateQueue;if(i!==null){var s=n.stateNode;try{g1(i,s)}catch(l){Kt(n,n.return,l)}}}function A2(n,i,s){s.props=_s(n.type,n.memoizedProps),s.state=n.memoizedState;try{s.componentWillUnmount()}catch(l){Kt(n,i,l)}}function Xl(n,i){try{var s=n.ref;if(s!==null){switch(n.tag){case 26:case 27:case 5:var l=n.stateNode;break;case 30:l=n.stateNode;break;default:l=n.stateNode}typeof s=="function"?n.refCleanup=s(l):s.current=l}}catch(h){Kt(n,i,h)}}function Br(n,i){var s=n.ref,l=n.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(h){Kt(n,i,h)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(h){Kt(n,i,h)}else s.current=null}function M2(n){var i=n.type,s=n.memoizedProps,l=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(h){Kt(n,n.return,h)}}function Xm(n,i,s){try{var l=n.stateNode;K3(l,n.type,s,i),l[je]=i}catch(h){Kt(n,n.return,h)}}function j2(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Qa(n.type)||n.tag===4}function $m(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||j2(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Qa(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Wm(n,i,s){var l=n.tag;if(l===5||l===6)n=n.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(n,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(n),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=Ni));else if(l!==4&&(l===27&&Qa(n.type)&&(s=n.stateNode,i=null),n=n.child,n!==null))for(Wm(n,i,s),n=n.sibling;n!==null;)Wm(n,i,s),n=n.sibling}function rf(n,i,s){var l=n.tag;if(l===5||l===6)n=n.stateNode,i?s.insertBefore(n,i):s.appendChild(n);else if(l!==4&&(l===27&&Qa(n.type)&&(s=n.stateNode),n=n.child,n!==null))for(rf(n,i,s),n=n.sibling;n!==null;)rf(n,i,s),n=n.sibling}function O2(n){var i=n.stateNode,s=n.memoizedProps;try{for(var l=n.type,h=i.attributes;h.length;)i.removeAttributeNode(h[0]);ei(i,l,s),i[Ce]=n,i[je]=s}catch(p){Kt(n,n.return,p)}}var ha=!1,kn=!1,Zm=!1,N2=typeof WeakSet=="function"?WeakSet:Set,$n=null;function T3(n,i){if(n=n.containerInfo,vp=Cf,n=Fv(n),Yh(n)){if("selectionStart"in n)var s={start:n.selectionStart,end:n.selectionEnd};else e:{s=(s=n.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var h=l.anchorOffset,p=l.focusNode;l=l.focusOffset;try{s.nodeType,p.nodeType}catch{s=null;break e}var C=0,D=-1,q=-1,se=0,me=0,Se=n,le=null;t:for(;;){for(var de;Se!==s||h!==0&&Se.nodeType!==3||(D=C+h),Se!==p||l!==0&&Se.nodeType!==3||(q=C+l),Se.nodeType===3&&(C+=Se.nodeValue.length),(de=Se.firstChild)!==null;)le=Se,Se=de;for(;;){if(Se===n)break t;if(le===s&&++se===h&&(D=C),le===p&&++me===l&&(q=C),(de=Se.nextSibling)!==null)break;Se=le,le=Se.parentNode}Se=de}s=D===-1||q===-1?null:{start:D,end:q}}else s=null}s=s||{start:0,end:0}}else s=null;for(bp={focusedElem:n,selectionRange:s},Cf=!1,$n=i;$n!==null;)if(i=$n,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,$n=n;else for(;$n!==null;){switch(i=$n,p=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(s=0;s title"))),ei(p,l,s),p[Ce]=n,st(p),l=p;break e;case"link":var C=_b("link","href",h).get(l+(s.href||""));if(C){for(var D=0;DZt&&(C=Zt,Zt=Ze,Ze=C);var ne=Bv(D,Ze),J=Bv(D,Zt);if(ne&&J&&(de.rangeCount!==1||de.anchorNode!==ne.node||de.anchorOffset!==ne.offset||de.focusNode!==J.node||de.focusOffset!==J.offset)){var ae=Se.createRange();ae.setStart(ne.node,ne.offset),de.removeAllRanges(),Ze>Zt?(de.addRange(ae),de.extend(J.node,J.offset)):(ae.setEnd(J.node,J.offset),de.addRange(ae))}}}}for(Se=[],de=D;de=de.parentNode;)de.nodeType===1&&Se.push({element:de,left:de.scrollLeft,top:de.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;Ds?32:s,V.T=null,s=rp,rp=null;var p=$a,C=va;if(Bn=0,Do=$a=null,va=0,(Vt&6)!==0)throw Error(a(331));var D=Vt;if(Vt|=4,H2(p.current),U2(p,p.current,C,s),Vt=D,ec(0,!1),Lt&&typeof Lt.onPostCommitFiberRoot=="function")try{Lt.onPostCommitFiberRoot(Ot,p)}catch{}return!0}finally{X.p=h,V.T=l,sb(n,i)}}function lb(n,i,s){i=rr(s,i),i=_m(n.stateNode,i,2),n=Ha(n,i,2),n!==null&&(_t(n,2),Hr(n))}function Kt(n,i,s){if(n.tag===3)lb(n,n,s);else for(;i!==null;){if(i.tag===3){lb(i,n,s);break}else if(i.tag===1){var l=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Xa===null||!Xa.has(l))){n=rr(s,n),s=c2(2),l=Ha(i,s,2),l!==null&&(u2(s,l,i,n),_t(l,2),Hr(l));break}}i=i.return}}function lp(n,i,s){var l=n.pingCache;if(l===null){l=n.pingCache=new j3;var h=new Set;l.set(i,h)}else h=l.get(i),h===void 0&&(h=new Set,l.set(i,h));h.has(s)||(ep=!0,h.add(s),n=k3.bind(null,n,i,s),i.then(n,n))}function k3(n,i,s){var l=n.pingCache;l!==null&&l.delete(i),n.pingedLanes|=n.suspendedLanes&s,n.warmLanes&=~s,tn===n&&(Ct&s)===s&&(Sn===4||Sn===3&&(Ct&62914560)===Ct&&300>at()-of?(Vt&2)===0&&Lo(n,0):tp|=s,No===Ct&&(No=0)),Hr(n)}function cb(n,i){i===0&&(i=sn()),n=As(n,i),n!==null&&(_t(n,i),Hr(n))}function z3(n){var i=n.memoizedState,s=0;i!==null&&(s=i.retryLane),cb(n,s)}function P3(n,i){var s=0;switch(n.tag){case 31:case 13:var l=n.stateNode,h=n.memoizedState;h!==null&&(s=h.retryLane);break;case 19:l=n.stateNode;break;case 22:l=n.stateNode._retryCache;break;default:throw Error(a(314))}l!==null&&l.delete(i),cb(n,s)}function _3(n,i){return Xe(n,i)}var mf=null,zo=null,cp=!1,pf=!1,up=!1,Za=0;function Hr(n){n!==zo&&n.next===null&&(zo===null?mf=zo=n:zo=zo.next=n),pf=!0,cp||(cp=!0,U3())}function ec(n,i){if(!up&&pf){up=!0;do for(var s=!1,l=mf;l!==null;){if(n!==0){var h=l.pendingLanes;if(h===0)var p=0;else{var C=l.suspendedLanes,D=l.pingedLanes;p=(1<<31-Yt(42|n)+1)-1,p&=h&~(C&~D),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(s=!0,hb(l,p))}else p=Ct,p=jn(l,l===tn?p:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(p&3)===0||Pn(l,p)||(s=!0,hb(l,p));l=l.next}while(s);up=!1}}function V3(){ub()}function ub(){pf=cp=!1;var n=0;Za!==0&&$3()&&(n=Za);for(var i=at(),s=null,l=mf;l!==null;){var h=l.next,p=fb(l,i);p===0?(l.next=null,s===null?mf=h:s.next=h,h===null&&(zo=s)):(s=l,(n!==0||(p&3)!==0)&&(pf=!0)),l=h}Bn!==0&&Bn!==5||ec(n),Za!==0&&(Za=0)}function fb(n,i){for(var s=n.suspendedLanes,l=n.pingedLanes,h=n.expirationTimes,p=n.pendingLanes&-62914561;0D)break;var me=q.transferSize,Se=q.initiatorType;me&&Sb(Se)&&(q=q.responseEnd,C+=me*(q"u"?null:document;function Lb(n,i,s){var l=Po;if(l&&typeof i=="string"&&i){var h=qe(i);h='link[rel="'+n+'"][href="'+h+'"]',typeof s=="string"&&(h+='[crossorigin="'+s+'"]'),Db.has(h)||(Db.add(h),n={rel:n,crossOrigin:s,href:i},l.querySelector(h)===null&&(i=l.createElement("link"),ei(i,"link",n),st(i),l.head.appendChild(i)))}}function rM(n){ba.D(n),Lb("dns-prefetch",n,null)}function aM(n,i){ba.C(n,i),Lb("preconnect",n,i)}function sM(n,i,s){ba.L(n,i,s);var l=Po;if(l&&n&&i){var h='link[rel="preload"][as="'+qe(i)+'"]';i==="image"&&s&&s.imageSrcSet?(h+='[imagesrcset="'+qe(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(h+='[imagesizes="'+qe(s.imageSizes)+'"]')):h+='[href="'+qe(n)+'"]';var p=h;switch(i){case"style":p=_o(n);break;case"script":p=Vo(n)}ur.has(p)||(n=v({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:n,as:i},s),ur.set(p,n),l.querySelector(h)!==null||i==="style"&&l.querySelector(rc(p))||i==="script"&&l.querySelector(ac(p))||(i=l.createElement("link"),ei(i,"link",n),st(i),l.head.appendChild(i)))}}function oM(n,i){ba.m(n,i);var s=Po;if(s&&n){var l=i&&typeof i.as=="string"?i.as:"script",h='link[rel="modulepreload"][as="'+qe(l)+'"][href="'+qe(n)+'"]',p=h;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Vo(n)}if(!ur.has(p)&&(n=v({rel:"modulepreload",href:n},i),ur.set(p,n),s.querySelector(h)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(ac(p)))return}l=s.createElement("link"),ei(l,"link",n),st(l),s.head.appendChild(l)}}}function lM(n,i,s){ba.S(n,i,s);var l=Po;if(l&&n){var h=Bt(l).hoistableStyles,p=_o(n);i=i||"default";var C=h.get(p);if(!C){var D={loading:0,preload:null};if(C=l.querySelector(rc(p)))D.loading=5;else{n=v({rel:"stylesheet",href:n,"data-precedence":i},s),(s=ur.get(p))&&Tp(n,s);var q=C=l.createElement("link");st(q),ei(q,"link",n),q._p=new Promise(function(se,me){q.onload=se,q.onerror=me}),q.addEventListener("load",function(){D.loading|=1}),q.addEventListener("error",function(){D.loading|=2}),D.loading|=4,xf(C,i,l)}C={type:"stylesheet",instance:C,count:1,state:D},h.set(p,C)}}}function cM(n,i){ba.X(n,i);var s=Po;if(s&&n){var l=Bt(s).hoistableScripts,h=Vo(n),p=l.get(h);p||(p=s.querySelector(ac(h)),p||(n=v({src:n,async:!0},i),(i=ur.get(h))&&Ap(n,i),p=s.createElement("script"),st(p),ei(p,"link",n),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},l.set(h,p))}}function uM(n,i){ba.M(n,i);var s=Po;if(s&&n){var l=Bt(s).hoistableScripts,h=Vo(n),p=l.get(h);p||(p=s.querySelector(ac(h)),p||(n=v({src:n,async:!0,type:"module"},i),(i=ur.get(h))&&Ap(n,i),p=s.createElement("script"),st(p),ei(p,"link",n),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},l.set(h,p))}}function kb(n,i,s,l){var h=(h=re.current)?bf(h):null;if(!h)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=_o(s.href),s=Bt(h).hoistableStyles,l=s.get(i),l||(l={type:"style",instance:null,count:0,state:null},s.set(i,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){n=_o(s.href);var p=Bt(h).hoistableStyles,C=p.get(n);if(C||(h=h.ownerDocument||h,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(n,C),(p=h.querySelector(rc(n)))&&!p._p&&(C.instance=p,C.state.loading=5),ur.has(n)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},ur.set(n,s),p||fM(h,n,s,C.state))),i&&l===null)throw Error(a(528,""));return C}if(i&&l!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Vo(s),s=Bt(h).hoistableScripts,l=s.get(i),l||(l={type:"script",instance:null,count:0,state:null},s.set(i,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function _o(n){return'href="'+qe(n)+'"'}function rc(n){return'link[rel="stylesheet"]['+n+"]"}function zb(n){return v({},n,{"data-precedence":n.precedence,precedence:null})}function fM(n,i,s,l){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?l.loading=1:(i=n.createElement("link"),l.preload=i,i.addEventListener("load",function(){return l.loading|=1}),i.addEventListener("error",function(){return l.loading|=2}),ei(i,"link",s),st(i),n.head.appendChild(i))}function Vo(n){return'[src="'+qe(n)+'"]'}function ac(n){return"script[async]"+n}function Pb(n,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var l=n.querySelector('style[data-href~="'+qe(s.href)+'"]');if(l)return i.instance=l,st(l),l;var h=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(n.ownerDocument||n).createElement("style"),st(l),ei(l,"style",h),xf(l,s.precedence,n),i.instance=l;case"stylesheet":h=_o(s.href);var p=n.querySelector(rc(h));if(p)return i.state.loading|=4,i.instance=p,st(p),p;l=zb(s),(h=ur.get(h))&&Tp(l,h),p=(n.ownerDocument||n).createElement("link"),st(p);var C=p;return C._p=new Promise(function(D,q){C.onload=D,C.onerror=q}),ei(p,"link",l),i.state.loading|=4,xf(p,s.precedence,n),i.instance=p;case"script":return p=Vo(s.src),(h=n.querySelector(ac(p)))?(i.instance=h,st(h),h):(l=s,(h=ur.get(p))&&(l=v({},s),Ap(l,h)),n=n.ownerDocument||n,h=n.createElement("script"),st(h),ei(h,"link",l),n.head.appendChild(h),i.instance=h);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(l=i.instance,i.state.loading|=4,xf(l,s.precedence,n));return i.instance}function xf(n,i,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=l.length?l[l.length-1]:null,p=h,C=0;C title"):null)}function dM(n,i,s){if(s===1||i.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(n=i.disabled,typeof i.precedence=="string"&&n==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Ub(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function hM(n,i,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var h=_o(l.href),p=i.querySelector(rc(h));if(p){i=p._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=wf.bind(n),i.then(n,n)),s.state.loading|=4,s.instance=p,st(p);return}p=i.ownerDocument||i,l=zb(l),(h=ur.get(h))&&Tp(l,h),p=p.createElement("link"),st(p);var C=p;C._p=new Promise(function(D,q){C.onload=D,C.onerror=q}),ei(p,"link",l),s.instance=p}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(n.count++,s=wf.bind(n),i.addEventListener("load",s),i.addEventListener("error",s))}}var Mp=0;function mM(n,i){return n.stylesheets&&n.count===0&&Rf(n,n.stylesheets),0Mp?50:800)+i);return n.unsuspend=s,function(){n.unsuspend=null,clearTimeout(l),clearTimeout(h)}}:null}function wf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Rf(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Ef=null;function Rf(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Ef=new Map,i.forEach(pM,n),Ef=null,wf.call(n))}function pM(n,i){if(!(i.state.loading&4)){var s=Ef.get(n);if(s)var l=s.get(null);else{s=new Map,Ef.set(n,s);for(var h=n.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),_p.exports=LM(),_p.exports}var cx=kM();const G0=b.createContext({});function hu(e){const t=b.useRef(null);return t.current===null&&(t.current=e()),t.current}const zM=typeof window<"u",Bc=zM?b.useLayoutEffect:b.useEffect,th=b.createContext(null);function K0(e,t){e.indexOf(t)===-1&&e.push(t)}function Rd(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}const Ma=(e,t,r)=>r>t?t:r/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),QE=e=>typeof e=="object"&&e!==null,$0=e=>/^0[^.\s]+$/u.test(e);function PM(e){let t;return()=>(t===void 0&&(t=e()),t)}const Dr=e=>e,ol=(...e)=>e.reduce((t,r)=>a=>r(t(a))),eo=(e,t,r)=>{const a=t-e;return a?(r-e)/a:1};class Cd{constructor(){this.subscriptions=[]}add(t){return K0(this.subscriptions,t),()=>this.remove(t)}remove(t){Rd(this.subscriptions,t)}notify(t,r,a){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,r,a);else for(let c=0;ce*1e3,Xi=e=>e/1e3,JE=(e,t)=>t?e*(1e3/t):0,Bp=(e,t,r)=>e*(3*(1-e)*((1-e)*t+e*r)+e*e);function mu(e,t,r,a){return e===t&&r===a?Dr:o=>{let c=0,u=1,f=o;for(let d=0;;d++){f>=c&&f<=u||(f=(c+u)/2);const m=Bp(f,e,r)-o;if(m*m<1e-28||d===40)break;m>0?u=f:c=f,f-=m*1e-7/(Bp(f+1e-7,e,r)-o-m)}return Bp(f,t,a)}}const eR=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,tR=e=>t=>1-e(1-t),nR=mu(.33,1.53,.69,.99),W0=tR(nR),iR=eR(W0),rR=e=>e>=1?1:(e*=2)<1?.5*W0(e):.5*(2-Math.pow(2,-10*(e-1))),Z0=e=>1-Math.sin(Math.acos(e)),aR=tR(Z0),sR=eR(Z0),_M=mu(.42,0,1,1),VM=mu(0,0,.58,1),Q0=mu(.42,0,.58,1),oR=e=>Array.isArray(e)&&typeof e[0]!="number",J0=e=>Array.isArray(e)&&typeof e[0]=="number",UM={linear:Dr,easeIn:_M,easeInOut:Q0,easeOut:VM,circIn:Z0,circInOut:sR,circOut:aR,backIn:W0,backInOut:iR,backOut:nR,anticipate:rR},IM=e=>typeof e=="string",Hg=e=>{if(J0(e)){const[t,r,a,o]=e;return mu(t,r,a,o)}else if(IM(e))return UM[e];return e},Mn={delta:0,timestamp:0,isProcessing:!1};let rd;function BM(){rd=void 0}const Ut={now:()=>(rd===void 0&&Ut.set(Mn.isProcessing||zr.useManualTiming?Mn.timestamp:performance.now()),rd),set:e=>{rd=e,queueMicrotask(BM)}},Jo=e=>Math.round(e*1e5)/1e5,lR=e=>t=>typeof t=="string"&&t.startsWith(e),cR=lR("--"),HM=lR("var(--"),nh=e=>HM(e)?FM.test(e.split("/*")[0].trim()):!1,FM=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Hp(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Sl={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Hc={...Sl,transform:e=>Ma(0,1,e)},Df={...Sl,default:1},ey=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function YM(e){return e==null}const qM=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ty=(e,t)=>r=>!!(typeof r=="string"&&qM.test(r)&&r.startsWith(e)||t&&!YM(r)&&Object.prototype.hasOwnProperty.call(r,t)),uR=(e,t,r)=>a=>{if(typeof a!="string")return a;const[o,c,u,f]=a.match(ey);return{[e]:parseFloat(o),[t]:parseFloat(c),[r]:parseFloat(u),alpha:f!==void 0?parseFloat(f):1}},GM=e=>Ma(0,255,e),Fp={...Sl,transform:e=>Math.round(GM(e))},Gs={test:ty("rgb","red"),parse:uR("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:a=1})=>"rgba("+Fp.transform(e)+", "+Fp.transform(t)+", "+Fp.transform(r)+", "+Jo(Hc.transform(a))+")"},Lf=(e,t,r)=>{const a=e.substring(1+t*r,1+(t+1)*r);return r>1?a:a+a};function KM(e){const t=e.length>5?2:1,r=Lf(e,3,t);return{red:parseInt(Lf(e,0,t),16),green:parseInt(Lf(e,1,t),16),blue:parseInt(Lf(e,2,t),16),alpha:r?parseInt(r,16)/255:1}}const Fg={test:ty("#"),parse:KM,transform:Gs.transform},pu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),xa=pu("deg"),$r=pu("%"),Ve=pu("px"),XM=pu("vh"),$M=pu("vw"),ux={...$r,parse:e=>$r.parse(e)/100,transform:e=>$r.transform(e*100)},Go={test:ty("hsl","hue"),parse:uR("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:a=1})=>"hsla("+Math.round(e)+", "+$r.transform(Jo(t))+", "+$r.transform(Jo(r))+", "+Jo(Hc.transform(a))+")"},Fn={test:e=>Gs.test(e)||Fg.test(e)||Go.test(e),parse:e=>Gs.test(e)?Gs.parse(e):Go.test(e)?Go.parse(e):Fg.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Gs.transform(e):Go.transform(e),getAnimatableNone:e=>{const t=Fn.parse(e);return t.alpha=0,Fn.transform(t)}},WM=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,fR=new RegExp(ey.source),dR=new RegExp(WM.source,"i");function ZM(e){return isNaN(e)&&typeof e=="string"&&(fR.test(e)||dR.test(e))}const hR="number",mR="color",QM="var",JM="var(",fx="${}",e4=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)(?![a-z]*\()/giu;function t4(e){const t=e.toString();return fR.test(t)||dR.test(t)}function Fc(e){const t=e.toString(),r=[],a={color:[],number:[],var:[]},o=[];let c=0;const f=t.replace(e4,d=>(Fn.test(d)?(a.color.push(c),o.push(mR),r.push(Fn.parse(d))):d.startsWith(JM)?(a.var.push(c),o.push(QM),r.push(d)):(a.number.push(c),o.push(hR),r.push(parseFloat(d))),++c,fx)).split(fx);return{values:r,split:f,indexes:a,types:o}}function n4(e){return Fc(e).values}function ny({split:e,types:t}){const r=e.length;return a=>{let o="";for(let c=0;ctypeof e=="number"?0:Fn.test(e)?Fn.getAnimatableNone(e):e,a4=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:r4(e);function s4(e){const t=Fc(e);return ny(t)(t.values.map((a,o)=>a4(a,t.split[o])))}const mr={test:ZM,parse:n4,createTransformer:i4,getAnimatableNone:s4};function Yp(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function o4({hue:e,saturation:t,lightness:r,alpha:a}){e/=360,t/=100,r/=100;let o=0,c=0,u=0;if(!t)o=c=u=r;else{const f=r<.5?r*(1+t):r+t-r*t,d=2*r-f;o=Yp(d,f,e+1/3),c=Yp(d,f,e),u=Yp(d,f,e-1/3)}return{red:Math.round(o*255),green:Math.round(c*255),blue:Math.round(u*255),alpha:a}}function Td(e,t){return r=>r>0?t:e}const rn=(e,t,r)=>e+(t-e)*r,qp=(e,t,r)=>{const a=e*e,o=r*(t*t-a)+a;return o<0?0:Math.sqrt(o)},l4=[Fg,Gs,Go],c4=e=>l4.find(t=>t.test(e));function dx(e){const t=c4(e);if(!t)return!1;let r=t.parse(e);return t===Go&&(r=o4(r)),r}const hx=(e,t)=>{const r=dx(e),a=dx(t);if(!r||!a)return Td(e,t);const o={...r};return c=>(o.red=qp(r.red,a.red,c),o.green=qp(r.green,a.green,c),o.blue=qp(r.blue,a.blue,c),o.alpha=rn(r.alpha,a.alpha,c),Gs.transform(o))},Yg=new Set(["none","hidden"]);function u4(e,t){return Yg.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function f4(e,t){return r=>rn(e,t,r)}function iy(e){return typeof e=="number"?f4:typeof e=="string"?nh(e)?Td:Fn.test(e)?hx:m4:Array.isArray(e)?pR:typeof e=="object"?Fn.test(e)?hx:d4:Td}function pR(e,t){const r=[...e],a=r.length,o=e.map((c,u)=>iy(c)(c,t[u]));return c=>{for(let u=0;u{for(const c in a)r[c]=a[c](o);return r}}function h4(e,t){const r=[],a={color:0,var:0,number:0};for(let o=0;o{const r=Fc(e),a=Fc(t);return r.indexes.var.length===a.indexes.var.length&&r.indexes.color.length===a.indexes.color.length&&r.indexes.number.length>=a.indexes.number.length?Yg.has(e)&&!a.values.length||Yg.has(t)&&!r.values.length?u4(e,t):ol(pR(h4(r,a),a.values),ny(a)):Td(e,t)},mx=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function p4(e,t){const r=mx.exec(e);if(!r)return;const a=mx.exec(t);if(!a||r[2]!==a[2])return;const o=r[2],c=parseFloat(r[1]),u=parseFloat(a[1]);return f=>Jo(rn(c,u,f))+o}function ry(e,t,r){if(typeof e=="number"&&typeof t=="number"&&typeof r=="number")return rn(e,t,r);if(typeof e=="string"&&typeof t=="string"){const o=p4(e,t);if(o)return o}return iy(e)(e,t)}const kf=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function g4(e){let t=new Set,r=new Set,a=!1,o=!1,c;const u=new Set;let f={delta:0,timestamp:0,isProcessing:!1};function d(g){u.has(g)&&(r.add(g),e()),(c=g)(f)}const m={schedule:(g,v=!1,x=!1)=>{const S=x&&a,E=S?t:r;return v&&u.add(g),S&&g!==c&&E.delete(g),E.add(g),g},cancel:g=>{r.delete(g),u.delete(g)},process:g=>{if(f=g,a){o=!0;return}a=!0;const v=t;t=r,r=v,t.forEach(d),t.clear(),c=void 0,a=!1,o&&(o=!1,m.process(g))}};return m}const y4=40;function gR(e,t,r={delta:0,timestamp:0,isProcessing:!1}){let a=!1,o=!0;const c=()=>a=!0,u=kf.reduce((k,j)=>(k[j]=g4(c),k),{}),{setup:f,read:d,resolveKeyframes:m,preUpdate:g,update:v,preRender:x,render:S,postRender:E}=u,w=()=>{const k=zr.useManualTiming,j=k?r.timestamp:performance.now();a=!1,k||(r.delta=o?1e3/60:Math.max(Math.min(j-r.timestamp,y4),1)),r.timestamp=j,r.isProcessing=!0,f.process(r),d.process(r),m.process(r),g.process(r),v.process(r),x.process(r),S.process(r),E.process(r),r.isProcessing=!1,a&&t&&(o=!1,e(w))},R=()=>{a=!0,o=!0,r.isProcessing||e(w)};return{schedule:kf.reduce((k,j)=>{const L=u[j];return k[j]=(P,N=!1,A=!1)=>(a||R(),L.schedule(P,N,A)),k},{}),cancel:k=>{for(let j=0;j{const t=({timestamp:r})=>e(r);return{start:(r=!0)=>Xt.update(t,r),stop:()=>Ki(t),now:()=>Mn.isProcessing?Mn.timestamp:Ut.now()}},yR=(e,t,r=10)=>{let a="";const o=Math.max(Math.round(t/r),2);for(let c=0;c=r?1/0:o}function v4(e,t=100,r){const{keyframes:a,velocity:o}=e,c=a&&a[a.length-1]-a[0],u=r({...e,velocity:o&&c?o*t/c:o,keyframes:[0,t]}),f=Math.min(oy(u),sy);return{type:"keyframes",ease:d=>u.next(f*d).value/t,duration:Xi(f)}}const px=100,gx=10,b4=1,x4=800,vR=.3,S4=.3,w4=.01,E4=2,R4=.005,C4=.5,T4=.01,A4=10,yx=.05,bR=e=>e<0?1/Math.max(1+e,yx):Math.max(1-e,yx);function xR(e,t){if(!(e>1))return 1;const r=Math.sqrt(e*e-1),a=e-r,o=e+r,c=2*r*Math.exp(-t)*(1+t);return SR(u=>o*Math.exp(-a*u)-a*Math.exp(-o*u)-c,u=>Math.exp(-o*u)-Math.exp(-a*u),t)/t}function qg(e,t){return e*Math.sqrt(1-t*t)}const M4=12;function SR(e,t,r){let a=r;for(let o=1;o{const g=m*o,v=g*e,x=qg(m,o),S=Math.exp(-v);return Kp-g/x*S},a=m=>{const v=m*o*e,x=o*o*m*m*e,S=Math.exp(-v),E=qg(m*m,o);return(-r(m)+Kp>0?-1:1)*-x*S/E}):(r=m=>{const g=Math.exp(-m*e),v=m*e+1;return-Kp+g*v},a=m=>{const g=Math.exp(-m*e),v=-m*(e*e);return g*v});const c=5/e,u=SR(r,a,c),f=u*xR(o,u*e),d=f*f;return{stiffness:d,damping:o*2*Math.sqrt(d),duration:bi(e)}}const Gg=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Xp(e,t){if(Gg(e,t))return e}function O4(e){const t=Xp(e.stiffness),r=Xp(e.damping,!0),a=Xp(e.mass),o={...e,stiffness:t??px,damping:r??gx,mass:a??b4,isResolvedFromDuration:!1,isTimeDefined:(t??r??a)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(o.isTimeDefined){if(e.visualDuration){const c=bR(e.bounce||0),u=2*Math.PI/(e.visualDuration*1.2)*xR(c,2*Math.PI/1.2);o.stiffness=u*u,o.damping=2*c*Math.sqrt(o.stiffness)}else Object.assign(o,j4(o)),o.isResolvedFromDuration=!0;(!Gg(o.stiffness)||!Gg(o.damping,!0))&&(o.stiffness=px,o.damping=gx)}return o}function vx(e=S4,t=vR){const r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,a=r.keyframes[0],o=r.keyframes[r.keyframes.length-1],c={done:!1,value:a},{stiffness:u,damping:f,mass:d,duration:m,isResolvedFromDuration:g,isTimeDefined:v}=O4({...r}),x=N=>v?0:-Xi(N),S=f/(2*Math.sqrt(u*d)),E=Xi(Math.sqrt(u/d)),w=S*E,R={target:o,delta:o-a,velocity:x(r.velocity||0)||0,restSpeed:0,restDelta:0},T=()=>{const N=Math.abs(R.delta)<5;R.restSpeed=r.restSpeed||(N?w4:E4),R.restDelta=r.restDelta||(N?R4:C4)};T();let O,k,j;if(S<1){const N=qg(E,S),A={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};j=()=>{A.A=(R.velocity+w*R.delta)/N,A.sinC=w*A.A+R.delta*N,A.cosC=w*R.delta-A.A*N};const H=Y=>{Y!==A.t&&(A.t=Y,A.env=Math.exp(-w*Y),A.sin=Math.sin(N*Y),A.cos=Math.cos(N*Y))};O=Y=>(H(Y),R.target-A.env*(A.A*A.sin+R.delta*A.cos)),k=Y=>(H(Y),A.env*(A.sinC*A.sin+A.cosC*A.cos))}else if(S===1){O=A=>R.target-Math.exp(-E*A)*(R.delta+(R.velocity+E*R.delta)*A);const N={C:0};j=()=>{N.C=R.velocity+E*R.delta},k=A=>Math.exp(-E*A)*(E*N.C*A-R.velocity)}else{const N=E*Math.sqrt(S*S-1),A=w-N,H=w+N,Y=N<1||v?1/0:300/N,W=($,ee)=>Math.exp(ee>Y?(w-$)*Y-w*ee:-$*ee),K={S:0,F:0};j=()=>{const $=(R.velocity+w*R.delta)/N;K.S=(R.delta+$)/2,K.F=(R.delta-$)/2},O=$=>R.target-K.S*W(A,$)-K.F*W(H,$),k=$=>A*K.S*W(A,$)+H*K.F*W(H,$)}j();const L=g&&m||null,P={calculatedDuration:L,retarget:(N,A)=>{R.target=N[N.length-1],R.delta=R.target-N[0],R.velocity=x(A),r.restSpeed&&r.restDelta||T(),P.calculatedDuration=L,c.done=!1,j()},velocity:N=>bi(k(N)),next:N=>{const A=O(N);if(g)c.done=N>=m;else{const H=bi(k(N));c.done=Math.abs(H)<=R.restSpeed&&Math.abs(R.target-A)<=R.restDelta}return c.value=c.done?R.target:A,c},toString:()=>{const N=Math.min(oy(P),sy),A=yR(H=>P.next(N*H).value,N,30);return N+"ms "+A},toTransition:()=>{}};return P}const wR=Object.assign(vx,{applyToOptions:e=>{const t=v4(e,100,vx);return e.ease=t.ease,e.duration=bi(t.duration),e.type="keyframes",e}});function Ad({keyframes:e,velocity:t=0,power:r=.8,timeConstant:a=325,bounceDamping:o=10,bounceStiffness:c=500,modifyTarget:u,min:f,max:d,restDelta:m=.5,restSpeed:g}){const v=e[0],x={done:!1,value:v},S=N=>Nd,E=N=>f===void 0?d:d===void 0||Math.abs(f-N)-w*Math.exp(-N/a),k=N=>{const A=O(N);x.done=Math.abs(A)<=m,x.value=x.done?T:N?T+A:v};let j,L;const P=N=>{S(x.value)&&(j=N,L=wR({keyframes:[x.value,E(x.value)],velocity:-O(N)/a*1e3,damping:o,stiffness:c,restDelta:m,restSpeed:g}))};return P(0),{calculatedDuration:null,next:N=>{let A=!1;return!L&&j===void 0&&(A=!0,k(N),P(N)),j!==void 0&&N>=j?L.next(N-j):(!A&&k(N),x)}}}function N4(e,t,r){const a=[],o=zr.mix||ry,c=e.length-1;for(let u=0;ut[0];if(c===2&&t[0]===t[1])return()=>t[1];const u=e[0]===e[1];e[0]>e[c-1]&&(e=[...e].reverse(),t=[...t].reverse());const f=N4(t,a,o),d=f.length,m=g=>{if(u&&g1)for(;vm(Ma(e[0],e[c-1],g)):m}function L4(e,t){const r=e[e.length-1];for(let a=1;a<=t;a++){const o=eo(0,t,a);e.push(rn(r,1,o))}}function Yc(e){const t=[0];return L4(t,e.length-1),t}function k4(e,t){return e.map(r=>r*t)}function z4(e,t){return e.map(()=>t||Q0).splice(0,e.length-1)}function fs({duration:e=300,keyframes:t,times:r,ease:a="easeInOut",mixer:o}){const c=typeof t[0]=="number"?void 0:o,u=oR(a)?a.map(Hg):Hg(a)||Q0,f={done:!1,value:t[0]};let d=-1;if(!c){for(let v=1;v=0){d=-2;break}d=v-1}}if(d>=0){const v=r&&r.length===t.length?r:Yc(t),x=v[d]*e,S=v[d+1]*e,E=t[d],w=t[d+1],R=Array.isArray(u)?u[d]:u,T=(zr.mix||ry)(E,w),O=t.length-2;return{calculatedDuration:e,next:k=>(f.value=d&&k=S||!e)?typeof w=="number"?w:T(1):T(R(k>=S||!e?1:k<=x?0:(k-x)/(S-x))),f.done=k>=e,f)}}const m=k4(r&&r.length===t.length?r:Yc(t),e),g=D4(m,t,{ease:Array.isArray(u)?u:z4(t,u),mixer:c});return{calculatedDuration:e,next:v=>(f.value=g(v),f.done=v>=e,f)}}const P4=5;function _4(e,t,r){const a=Math.max(t-P4,0);return JE(r-e(a),t-a)}function V4(e,t,r=0){return t<=0?r:e.velocity?e.velocity(t):_4(a=>e.next(a).value,t,e.next(t).value)}function qc(e,{repeat:t,repeatType:r="loop"},a,o=1){let c,u,f=0;for(let g=0;gt-e>I4&&!zr.useManualTiming?t:e;function CR(e,t){return{kind:e,animation:t,timestamp:Ut.now(),frameTimestamp:Mn.timestamp,frameIsProcessing:Mn.isProcessing}}function TR(e,t,r){const a=globalThis.__MOTION_INSPECT__;if(a)try{a({...CR("animation-start",e),options:r?{...t,...r}:t})}catch{}}function B4(e,t){const r=globalThis.__MOTION_INSPECT__;if(r)try{r({...CR("layout-animation-start",e),node:t})}catch{}}class ly{constructor(){this.isResolved=!1}get finished(){return this._finished||(this._finished=this.isResolved?Promise.resolve():new Promise(t=>{this._resolve=t})),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(t,r){return this.finished.then(t,r)}}const H4=e=>e/100,Gc=e=>Math.round(e*1e4)/1e4;class ll extends ly{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:r}=this.options;r&&r.updatedAt!==Ut.now()&&this.tick(Ut.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause(),TR(this,this.options)}initAnimation(){const{options:t}=this;ER(t);const{type:r=fs,repeat:a=0,repeatDelay:o=0,repeatType:c,velocity:u=0}=t;let{keyframes:f}=t;const d=r||fs;this.mixKeyframes=void 0,d!==fs&&typeof f[0]!="number"&&(this.mixKeyframes=ol(H4,t.mixer?.(f[0],f[1])||ry(f[0],f[1])),f=[0,100]);const m=d(f===t.keyframes?t:{...t,keyframes:f});c==="mirror"&&(this.mirroredGenerator=d({...t,keyframes:[...f].reverse(),velocity:-u})),m.calculatedDuration===null&&(m.calculatedDuration=oy(m));const{calculatedDuration:g}=m;this.calculatedDuration=g,this.resolvedDuration=g+o,this.totalDuration=this.resolvedDuration*(a+1)-o,this.generator=m}updateTime(t){this.currentTime=this.holdTime??Math.round(t-this.startTime)*this.playbackSpeed}tick(t,r=!1){const{generator:a,totalDuration:o,calculatedDuration:c}=this;if(this.startTime===null)return a.next(0);const{delay:u=0,keyframes:f,type:d,onUpdate:m,finalKeyframe:g}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=RR(this.startTime,t)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);const v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?v<0:v>o;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);const S=this.generate(this.currentTime,x);let{done:E}=S;x||(E=this.playbackSpeed>=0?c<1/0?this.currentTime>=o:E:this.currentTime<=0);const w=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return w&&d!==Ad&&(S.value=qc(f,this.options,g,this.speed)),m&&m(S.value),w&&this.finish(),S}at(t){return this.holdTime??Gc((t-this.startTime)*this.playbackSpeed)}sampleAt(t,r){const{options:a,totalDuration:o}=this,c=this.at(t)-(a.delay||0);return c>=o&&a.type!==Ad?qc(a.keyframes,a,r?void 0:a.finalKeyframe):this.generate(Math.max(c,0),c<0).value}generate(t,r){const{generator:a,totalDuration:o,mixKeyframes:c,mirroredGenerator:u,resolvedDuration:f}=this,{keyframes:d,repeat:m,repeatType:g,repeatDelay:v}=this.options;let x=t,S=a;if(m){const w=Math.min(t,o)/f;let R=Math.floor(w),T=w%1;!T&&w>=1&&(T=1),T===1&&R--,R=Math.min(R,m+1),R%2&&(g==="reverse"?(T=1-T,v&&(T-=v/f)):g==="mirror"&&(S=u)),x=Ma(0,1,T)*f}let E;return r?(this.delayState.value=d[0],E=this.delayState):E=S.next(x),c&&!r&&(E.value=c(E.value)),E}get duration(){return Xi(this.calculatedDuration)}get iterationDuration(){return this.duration+Xi(this.options.delay??0)}get time(){return Xi(this.currentTime)}set time(t){this.state==="finished"&&this.updateFinished(),t=bi(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){return V4(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(t){const r=this.playbackSpeed!==t;r&&this.driver&&this.updateTime(Ut.now()),this.playbackSpeed=t,r&&this.driver&&(this.time=Xi(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ay,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();const a=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=a):this.holdTime!==null?this.startTime=a-this.holdTime/(this.playbackSpeed||1):this.startTime||(this.startTime=r??(this.pendingStartTime=a)),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ut.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.driver?.stop(),this.driver=void 0,this.startTime=this.holdTime=null}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const F4=new Set(["brightness","contrast","saturate","opacity"]);function Y4(e){const[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[a]=r.match(ey)||[];if(!a)return e;const o=r.replace(a,"");let c=F4.has(t)?1:0;return a!==r&&(c*=100),t+"("+c+o+")"}const q4=/\b([a-z-]*)\(.*?\)/gu,Kg={...mr,getAnimatableNone:e=>{const t=e.match(q4);return t?t.map(Y4).join(" "):e}},Xg={...mr,getAnimatableNone:e=>{const t=mr.parse(e);return mr.createTransformer(e)(t.map(a=>typeof a=="number"?0:typeof a=="object"?{...a,alpha:1}:a))}},bx={...Sl,transform:Math.round},AR={rotate:xa,pathRotation:xa,rotateX:xa,rotateY:xa,rotateZ:xa,scale:Df,scaleX:Df,scaleY:Df,scaleZ:Df,skew:xa,skewX:xa,skewY:xa,distance:Ve,translateX:Ve,translateY:Ve,translateZ:Ve,x:Ve,y:Ve,z:Ve,perspective:Ve,transformPerspective:Ve,opacity:Hc,originX:ux,originY:ux,originZ:Ve},cy={borderWidth:Ve,borderTopWidth:Ve,borderRightWidth:Ve,borderBottomWidth:Ve,borderLeftWidth:Ve,borderRadius:Ve,borderTopLeftRadius:Ve,borderTopRightRadius:Ve,borderBottomRightRadius:Ve,borderBottomLeftRadius:Ve,width:Ve,maxWidth:Ve,height:Ve,maxHeight:Ve,top:Ve,right:Ve,bottom:Ve,left:Ve,inset:Ve,insetBlock:Ve,insetBlockStart:Ve,insetBlockEnd:Ve,insetInline:Ve,insetInlineStart:Ve,insetInlineEnd:Ve,padding:Ve,paddingTop:Ve,paddingRight:Ve,paddingBottom:Ve,paddingLeft:Ve,paddingBlock:Ve,paddingBlockStart:Ve,paddingBlockEnd:Ve,paddingInline:Ve,paddingInlineStart:Ve,paddingInlineEnd:Ve,margin:Ve,marginTop:Ve,marginRight:Ve,marginBottom:Ve,marginLeft:Ve,marginBlock:Ve,marginBlockStart:Ve,marginBlockEnd:Ve,marginInline:Ve,marginInlineStart:Ve,marginInlineEnd:Ve,fontSize:Ve,backgroundPositionX:Ve,backgroundPositionY:Ve,...AR,zIndex:bx,fillOpacity:Hc,strokeOpacity:Hc,numOctaves:bx},G4={...cy,color:Fn,backgroundColor:Fn,outlineColor:Fn,fill:Fn,stroke:Fn,borderColor:Fn,borderTopColor:Fn,borderRightColor:Fn,borderBottomColor:Fn,borderLeftColor:Fn,filter:Kg,WebkitFilter:Kg,mask:Xg,WebkitMask:Xg},MR=e=>G4[e],K4=new Set([Kg,Xg]);let xx,Sx,$p;function uy(e,t){if(e===xx&&t===Sx)return $p;let r=MR(e);return K4.has(r)||(r=mr),$p=r.getAnimatableNone?r.getAnimatableNone(t):void 0,xx=e,Sx=t,$p}function X4(e){for(let t=1;te*180/Math.PI,$g=e=>{const t=Ks(Math.atan2(e[1],e[0]));return Wg(t)},$4={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:$g,rotateZ:$g,skewX:e=>Ks(Math.atan(e[1])),skewY:e=>Ks(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Wg=e=>(e=e%360,e<0&&(e+=360),e),wx=$g,Ex=e=>Math.hypot(e[0],e[1]),Rx=e=>Math.hypot(e[4],e[5]),W4={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ex,scaleY:Rx,scaleZ:e=>Math.hypot(e[8],e[9],e[10]),scale:e=>(Ex(e)+Rx(e))/2,rotateX:e=>Wg(Ks(Math.atan2(e[6],e[5]))),rotateY:e=>Wg(Ks(Math.atan2(-e[2],e[0]))),rotateZ:wx,rotate:wx,skewX:e=>Ks(Math.atan(e[4])),skewY:e=>Ks(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Kc(e){return e.includes("scale")?1:0}function fy(e,t){if(!e||e==="none")return Kc(t);const r=e.match(/^matrix(3d)?\(([-\d.e\s,]+)\)$/u);if(!r)return Kc(t);const a=(r[1]?W4:$4)[t],o=r[2].split(",").map(c=>parseFloat(c));return typeof a=="function"?a(o):o[a]}const Z4=(e,t)=>{const{transform:r="none"}=getComputedStyle(e);return fy(r,t)},Ca=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ds=new Set([...Ca,"pathRotation"]),Cx=e=>e===Sl||e===Ve,Q4=new Set(["x","y","z"]),J4=Ca.filter(e=>!Q4.has(e));function e6(e){const t=[];return J4.forEach(r=>{const a=e.getValue(r);if(a!==void 0){const o=a.get(),c=r.startsWith("scale")?1:0;if(o===c)return;t.push([r,o]),a.set(c)}}),t}const t6=new Set(["bottom","right"]);function Tx(e,t,r,a,o,c){const u=parseFloat(e);if(!isNaN(u))return u;const{min:f,max:d}=t()[r],m=d-f;return c==="border-box"?m:m-parseFloat(a)-parseFloat(o)}const Ax=({transform:e})=>fy(e,"x"),Mx=({transform:e})=>fy(e,"y"),Wp={width:({width:e,paddingLeft:t="0",paddingRight:r="0",boxSizing:a},o)=>Tx(e,o,"x",t,r,a),height:({height:e,paddingTop:t="0",paddingBottom:r="0",boxSizing:a},o)=>Tx(e,o,"y",t,r,a),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{const{y:r}=t();return parseFloat(e)+(r.max-r.min)},right:({left:e},t)=>{const{x:r}=t();return parseFloat(e)+(r.max-r.min)},x:Ax,y:Mx,translateX:Ax,translateY:Mx},$s=new Set;let Zg=!1,Qg=!1,Jg=!1;function jR(){if(Qg){const e=[],t=new Set,r=new Set;$s.forEach(o=>{o.needsMeasurement&&(e.push(o),t.add(o.element),t6.has(o.name)&&r.add(o.element))});const a=new Map;r.forEach(o=>{const c=e6(o);c.length&&(a.set(o,c),o.render())}),e.forEach(o=>o.measureInitialState()),t.forEach(o=>{o.render();const c=a.get(o);c&&c.forEach(([u,f])=>{o.getValue(u)?.set(f)})}),e.forEach(o=>o.measureEndState()),e.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}Qg=!1,Zg=!1,$s.forEach(e=>e.complete(Jg)),$s.clear()}function OR(){$s.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Qg=!0)})}function n6(){Jg=!0,OR(),jR(),Jg=!1}function i6(e,t,r){if(typeof e=="string"){if(X0(e)||$0(e))return parseFloat(e);if(!mr.test(e)&&mr.test(r))return uy(t,r)}return e??void 0}class dy{constructor(t,r,a,o,c,u=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=a,this.motionValue=o,this.element=c,this.isAsync=u}scheduleResolve(){this.state="scheduled",this.isAsync?($s.add(this),Zg||(Zg=!0,Xt.read(OR),Xt.resolveKeyframes(jR))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:r,element:a,motionValue:o}=this;if(t[0]===null){const c=o?.get(),u=t[t.length-1];if(c!==void 0)t[0]=c;else if(a&&r){const f=i6(a.readValue(r,u),r,u);f!==void 0&&(t[0]=f)}t[0]===void 0&&(t[0]=u),o&&c===void 0&&o.set(t[0])}X4(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),$s.delete(this)}cancel(){this.state==="scheduled"&&($s.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const r6=e=>e.startsWith("--");function NR(e,t,r){r6(t)?e.style.setProperty(t,r):e.style[t]=r}const a6={};function DR(e,t){const r=PM(e);return()=>a6[t]??r()}const s6=DR(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),hy=DR(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ko=([e,t,r,a])=>`cubic-bezier(${e}, ${t}, ${r}, ${a})`,e0={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ko([0,.65,.55,1]),circOut:Ko([.55,0,1,.45]),backIn:Ko([.31,.01,.66,-.59]),backOut:Ko([.33,1.53,.69,.99])};function LR(e,t){if(e)return typeof e=="function"?hy()?yR(e,t):"ease-out":J0(e)?Ko(e):Array.isArray(e)?e.map(r=>LR(r,t)||e0.easeOut):e0[e]}function o6(e,t,r,{delay:a=0,duration:o=300,repeat:c=0,repeatType:u="loop",ease:f="easeOut",times:d}={},m=void 0){const g={[t]:r};d&&(g.offset=d);const v=LR(f,o);Array.isArray(v)&&(g.easing=v);const x={delay:a,duration:o,easing:Array.isArray(v)?"linear":v,fill:"both",iterations:c+1,direction:u==="reverse"?"alternate":"normal"};return m&&(x.pseudoElement=m),e.animate(g,x)}function kR(e){return typeof e=="function"&&"applyToOptions"in e}function l6({type:e,...t}){return kR(e)&&hy()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class zR extends ly{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:r,name:a,keyframes:o,pseudoElement:c,allowFlatten:u=!1,finalKeyframe:f,onComplete:d}=t;this.isPseudoElement=!!c,this.allowFlatten=u,this.options=t;const m=l6(t);this.animation=o6(r,a,o,m,c),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=this.onFinish=()=>{if(this.animation.onfinish=null,this.finishedTime=this.time,!c){const g=qc(o,this.options,f,this.speed);this.updateMotionValue?.(g),NR(r,a,g),this.animation.cancel()}d?.(),this.notifyFinished()},TR(this,t,m)}play(){this.isStopped||(this.manualStartTime=null,this.animation.onfinish=this.onFinish,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.isStopped||(this.animation.onfinish=this.onFinish),this.animation.finish?.()}cancel(){this.animation.onfinish=null;try{this.animation.cancel()}catch{}}stop(){this.isStopped||(this.isStopped=!0,!(this.state==="idle"||this.finishedTime!==null)&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel()))}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Xi(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Xi(t)}get time(){return Xi(Number(this.animation.currentTime)||0)}set time(t){const r=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=bi(t),r&&(this.animation.pause(),this.updateFinished())}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,onAttach:r,observe:a}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=this.onFinish=null,t&&s6()?(this.animation.timeline=t,r?.(this.animation),Dr):a(this)}}const PR={anticipate:rR,backInOut:iR,circInOut:sR};function c6(e){return e in PR}function u6(e){typeof e.ease=="string"&&c6(e.ease)&&(e.ease=PR[e.ease])}const Md=10;class f6 extends zR{constructor(t){u6(t),ER(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}elapsed(){return this.state==="running"?(Ut.now()-this.startTime)*this.speed:this.time*1e3}sample(t){if(!this.sampler){const{motionValue:r,onUpdate:a,onComplete:o,onPlay:c,onStop:u,element:f,...d}=this.options;this.sampler=new ll({...d,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,t)).value}liveValue(){const{state:t}=this;if(t==="running"||t==="paused")return this.sample(this.elapsed())}updateMotionValue(t){const{motionValue:r,element:a,name:o}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}const{speed:c}=this,u=this.elapsed(),f=this.state==="running"&&c?Ma(0,Md,u):0,d=this.sample(u);a&&o&&NR(a,o,d),r.setWithVelocity(this.sample(u-f*Math.sign(c)),d,f/Math.abs(c||1))}}const jx=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(mr.test(e)||e==="0")&&!e.startsWith("url("));function d6(e){const t=e[0];if(e.length===1)return!0;for(let r=0;re&&typeof t[0]!="number"&&t.some((r,a)=>a&&e(t[a-1],r)),Ox=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),VR=()=>!zr.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,"animate");function g6(e){const{motionValue:t,name:r,repeatDelay:a,repeatType:o,damping:c,type:u,keyframes:f}=e;if(!r||!(n0.has(r)||Ox.has(r)))return!1;const d=t?.owner?.current;if(!(d instanceof HTMLElement)&&!(d instanceof SVGElement))return!1;const{onUpdate:m,transformTemplate:g}=t.owner.getProps();return VR()&&(n0.has(r)||Ox.has(r)&&p6(f))&&(r!=="transform"||!g)&&!m&&!a&&o!=="mirror"&&c!==0&&u!=="inertia"&&!_R(e)}const my=(e,t)=>t&&typeof e=="number"?t.transform(e):e,y6={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},v6=Ca.length,Nx={},i0=(e,t,r=my(t,AR[e]))=>(Nx[e]||(Nx[e]=(y6[e]||e)+"("))+r+")",r0=(e,t)=>(typeof t=="number"?t:parseFloat(t))===(e.startsWith("scale")?1:0);function b6(e,t,r){let a="";for(let c=0;cR6.has(e),Lx=new WeakMap,T6=(e,t)=>{let r=Lx.get(e);return r?.[0]!==t&&(r=[t,"linear("+Yc(Array(t+1)).map(a=>Gc(e(a))+" "+Gc(a*100)+"%")+")"],Lx.set(e,r)),r[1]},kx=(e,t)=>Math.min(x6,Math.max(2,Math.ceil((t-e)/Md))),zc=(e,t)=>Math.abs(e-t)<=UR,Zp=(e,t)=>e-t,zx=(e,t,r)=>Yc(Array(r+1)).map(a=>rn(e,t,a)),ad=e=>e.motionValue.owner,jd=e=>cl.get(e),Px=({state:e})=>e==="idle"||e==="finished",Xo=(e,t)=>e.latestValues?e.latestValues[t]:e.getValue(t)?.get(),A6=({name:e,motionValue:t})=>e&&Ca.includes(e)&&t?.owner?.current instanceof HTMLElement&&VR()&&hy();function M6(e){const t=ad(e),{onUpdate:r,transformTemplate:a}=t.getProps();return!e.isHandoff&&!r&&!e.hasOnUpdate&&!a&&e.type!=="inertia"&&(Xo(t,"transform")||"none")==="none"&&!Xo(t,"pathRotation")&&!t.projection?.isProjecting()&&!_R(e)}class j6{constructor(t,r,a,o){this.element=t,this.update=r,this.makeDriver=a,this.animation=o}get js(){return this.driver||(this.driver=this.makeDriver(this.update))}now(){return this.driver||this.makeDriver!==ay?this.js.now():Mn.isProcessing?Mn.timestamp:Ut.now()}start(t=!0){const r=jd(this.element);!r||r.isJS?this.js.start(t):r.schedule(!1,!t)}stopJS(){this.driver?.stop()}stop(){this.stopJS();const t=jd(this.element);t&&!t.isFinishing&&t.release(this.animation)}}let _x;class O6 extends ll{constructor(t){const r=ad(t).current,{driver:a=ay}=t;let o;const c=M6(t);t.driver=d=>new j6(r,d,a,o),super(t),o=this;const u=this.driver;u&&(u.animation=this),this.canAccelerate=c;const{stop:f}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),f()}}offsets(){const{keyframes:t,times:r}=this.options;return r||(this.offsetsOf!==t&&(this.offsetsOf=t,this.cachedOffsets=Yc(t)),this.cachedOffsets)}get group(){return jd(ad(this.options).current)}get js(){return this.driver?.js}stopJS(){this.driver?.stopJS()}get name(){return this.options.name}timing(){const{startTime:t,speed:r,totalDuration:a}=this,{delay:o=0,repeatType:c}=this.options;return this.holdTime!==null?[1/0,0]:a===1/0?[t+o/r,this.resolvedDuration*(c==="loop"?1:2)/r||1]:[t+(o+a)/r,0]}isAccelerated(){const{group:t,state:r}=this;return t?.tracks.has(this)&&!t.isJS&&this.canAccelerate&&(r==="running"||r==="paused")}liveValue(){return this.isAccelerated()?this.sampleAt(Ut.now()):void 0}tween(){const{keyframes:t,type:r,repeat:a,delay:o=0}=this.options;let c=-1;if(a||r!==fs||this.holdTime!==null)return;for(let m=1;m=0)return;c=m-1}let{ease:u}=this.options;oR(u)&&(u=u[c]);const f=this.offsets(),d=m=>this.startTime+(o+f[m]*this.totalDuration)/this.speed;if(c>=0){const m=J0(u)?Ko(u):C6(u)?e0[u]:Hg(u);return[d(c),d(c+1),typeof m=="string"||zc(m(0),0)&&zc(m(1),1)?m:void 0]}}boundaries(t,r){const{startTime:a,speed:o,resolvedDuration:c,options:u}=this,{delay:f=0,repeat:d=0,repeatDelay:m=0,repeatType:g,type:v}=u,x=(v||fs)===fs?this.offsets():[0,1],S=a+f/o,E=[];if(this.holdTime!==null||!(c>0))return E;for(let w=Math.max(0,Math.floor((t-S)*o/c));w<=d;w++){const R=S+w*c/o;if(R>r)break;for(const T of x){const O=R+(w%2&&g&&g!=="loop"?1-T:T)*(c-m)/o;O>t&&O{dc||queueMicrotask(()=>{const t=dc;dc=void 0,t.forEach(r=>r())}),(dc||(dc=[])).push(e)};function D6(e){const t=e.current,r=new Set,a=new Map;let o={},c=[],u=new Map,f=[],d=!1,m=!1,g=!1,v=!1,x=-1/0,S,E=1/0,w;const R=_=>{for(const M of r)if(M.name===_)return!0},T=(_,M)=>{const z={};for(const I of _===void 0?Ca:c){const B=a.get(I),Z=_===void 0?Xo(e,I):B?B.sampleAt(M>_&&!B.timing()[1]?M:_):o[I];Z!==void 0&&(z[I]=Z)}return z},O=(_,M)=>{let z="";for(const I in _){const B=_[I];(!M||!r0(I,B))&&(z+=i0(I,B)+" ")}return(M?z.trim():z)||"none"},k=(_,M)=>O(T(_,M)),j=(_=T())=>{t.style.transform=O(_,!0)},L=_=>{_.onfinish=_.oncancel=null,_.cancel()},P=(_=!0)=>{clearTimeout(S),E=1/0,w=void 0,_&&j(),f.forEach(({animation:M})=>L(M)),f=[]},N=(_,M)=>new Animation(new KeyframeEffect(t,_,M)),A=(_,M,z=1/0)=>{const I={animation:_,offset:M,end:z};_.startTime=Ut.now()+M,z<1/0&&(_.onfinish=()=>{I.isDone=!0,f.some(B=>B.end===1/0)&&(L(_),f=f.filter(B=>B!==I)),F.schedule(!1)}),_.oncancel=()=>f.includes(I)&&F.demote(),f.push(I)},H=(_,M,z)=>{const I=(Z,re)=>Math.abs(_(re)-_(Z)),B=I(M,z);for(;z-M>.01;){const Z=(M+z)/2;I(M,Z)>I(Z,z)?z=Z:M=Z}return I(M,z)>B/2?[M,z]:[]},Y=(_,M,z,I)=>{const B=kx(M,z);if(I.length*4>B)return;let Z;for(const we of _){const Re=we.numberAt(M),ye=(we.numberAt((M+z)/2)-Re)/(we.numberAt(z)-Re);if(ye===ye){if(Z===void 0)Z=ye;else if(!zc(ye,Z))return}}const re=zx(M,z,B).concat(I).sort(Zp),fe=we=>eo(M,z,we);let pe,ce;for(const we of _){const Re=we.numberAt(M),ye=re.map(nt=>we.numberAt(nt)-Re),ze=ye[ye.length-1],Ye=ye.some(nt=>Math.abs(nt)*UR>Math.abs(ze))?0:ze,Qe=ye.map(nt=>Ye?nt/Ye:nt);if(Ye&&!pe)pe=Qe,ce=nt=>(we.numberAt(nt)-Re)/Ye;else if(Qe.some((nt,De)=>!zc(nt,Ye&&pe[De])))return}if(!pe||pe.every((we,Re)=>zc(we,fe(re[Re]))))return"linear";const Ae=[],ke=(we,Re=ce(we))=>Ae.push(Gc(Re)+" "+Gc(fe(we)*100)+"%");return pe.forEach((we,Re)=>{Re&&Math.abs(we-pe[Re-1])>.2&&H(ce,re[Re-1],re[Re]).forEach(ye=>ke(ye)),ke(re[Re],we)}),"linear("+Ae+")"},W=(_,M,z,I)=>{const B=[M],Z=[];let re=z,fe=M;for(const we of _){const Re=we.tween();if(Re?.[2]!=="linear"){const[ye,ze]=we.timing(),[Ye,Qe]=Re||[M,ze?z:ye];re=Math.min(re,Ye),fe=Math.max(fe,Qe),Z.push(we)}}re=Math.max(M,re),fe=Math.min(z,fe);const pe=(we,Re)=>Z.every(ye=>!(Math.abs(ye.numberAt((we+Re)/2)-(ye.numberAt(we)+ye.numberAt(Re))/2)>(ye.name.startsWith("scale")?w6:S6))),ce=(we,Re,ye)=>{if(Re-we<1||pe(we,Re))B.push(Re);else if(ye<4)ce(we,(we+Re)/2,ye+1),ce((we+Re)/2,Re,ye+1);else{for(const ze of _)B.push(...H(Ye=>ze.numberAt(Ye),we,Re));B.push(Re)}},Ae=fe>re?zx(re,fe,Math.ceil((fe-re)/100)):[];Ae.push(z);for(const we of I)Ae.push(we,Math.min(we+.01,z));let ke=M;for(const we of Ae.sort(Zp))we>ke&&ce(ke,we,0),ke=we;return B.sort(Zp)},K=_=>{let M;for(const z of _){const I=z.tween();if(!I||M&&(Math.abs(I[0]-M[0])>1||Math.abs(I[1]-M[1])>1))return;M=[I[0],I[1],!M||I[2]===M[2]?I[2]:void 0]}return M},$=(_,M,z,I,B={fill:"both"},Z)=>{const re=I?[]:_.flatMap(ke=>ke.boundaries(M,z)),fe=I||Y(_,M,z,re),pe=fe?[M,z]:W(_,M,z,re),ce=pe.map(ke=>k(ke,Z));let Ae={transform:ce};return fe||(Ae.offset=pe.map(ke=>eo(M,z,ke))),ce.every(ke=>ke===ce[0])&&(j(T(M,Z)),Ae=null),N(Ae,{...B,duration:z-M,easing:fe||"linear"})},ee=_=>{const M=Ut.now()+_;M{E=1/0,F.schedule(!1)},_))},ie=_=>{let M=_,z=0,I=0;const B=[],Z=[],re=new Set;a.clear(),u=new Map;for(const pe of r){a.set(pe.name,pe);const[ce,Ae]=pe.timing(),ke=ce===1/0;if(u.set(pe,[pe.at(_),pe.speed,ke]),!ke){if(pe.speed<0)return;if(Ae){if(z){const we=(ce-I)/Ae;if(Math.abs(Ae-z)>1||Math.abs(we-Math.round(we))*z>1)return}else z=Ae,I=ce;Z.push(pe)}else re.add(ce);B.push(pe),M=Math.max(M,ce)}}o={},c=Ca.filter(pe=>{if(a.has(pe))return!0;const ce=o[pe]=Xo(e,pe);return ce!==void 0&&!r0(pe,ce)}),P(!1);const fe=!z&&K(B);try{if(M>_){let pe;if(fe&&fe[1]>_){const[ce,Ae,ke]=fe;if(ce-_>Dx)return B.forEach(we=>we.sync()),ee(w=ce-_-Dx),!0;pe=typeof ke=="string"?ke:ke?T6(ke,kx(ce,Ae)):Y(B,ce,Ae,[]),pe&&A($(B,ce,Ae,pe,{fill:"both",endDelay:M-Ae}),ce-_,M-ce)}pe||A($(B,_,M),0,M-_),re.forEach(ce=>ce{let z,I=0;for(const B of r){const Z=u.get(B);if(!Z)return!1;const[re,fe,pe]=Z,ce=B.at(_),Ae=B.timing()[0]===1/0;if(pe){if(Ae&&(ce===re||!f.length))continue;return!1}const ke=(ce-re)/fe,we=Ae?0:B.speed/fe;if(z===void 0)z=ke,I=we;else if(Math.abs(ke-z)>1||we!==I)return!1}if(z===void 0)return!0;if(!f.length){if(w===void 0||M&&I)return!1;if(I){const B=(w-z)/I;if(B<1)return!1;ee(B)}return!0}for(const{offset:B,end:Z,isDone:re}of f){const fe=z-B;if(Z<1/0&&(re?fe=Z))return!1}for(const{animation:B,offset:Z,isDone:re}of f){if(re)continue;const fe=z-Z;I&&B.updatePlaybackRate&&B.playState==="running"&&Math.abs(Number(B.currentTime)-fe)<20?B.playbackRate!==I&&B.updatePlaybackRate(I):I?(B.playbackRate!==I&&(B.playbackRate=I),B.startTime=_-fe/I):(B.startTime=null,B.currentTime=fe)}return!0},X=()=>r.size?!1:(g=!0,jd(t)===F&&cl.delete(t),F.isJS||P(),!0),Q=()=>{const _=Ut.now();if(F.isJS||(F.isFinishing=!0,r.forEach(I=>{const[B,Z]=I.timing();I.state==="running"&&I.speed>0&&!Z&&B<=_+1&&(I.complete(),o[I.name]=Xo(e,I.name),u.has(I)||(d=!0))}),F.isFinishing=!1),m=!1,g||(r.forEach(I=>Px(I)&&r.delete(I)),X()))return;for(const I of r)if(!I.canAccelerate)return F.demote(!0);F.isJS&&(F.isJS=!1,d=!0,r.forEach(I=>I.stopJS()));const M=d,z=v;if(d=v=!1,M||!V(_,z)){if(z){if(_-xI.timing()[0]===1/0&&I.sync())},F={tracks:r,isJS:!1,isFinishing:!1,schedule(_,M){g||(d||(d=_),v||(v=!!M),m||(m=!0,Mn.isProcessing?Xt.render(Q,!1,!0):N6(Q)))},release(_){Px(_)&&r.delete(_),X()||F.schedule(!0)},check(){if(!F.isJS){for(const _ in o)if(Xo(e,_)!==o[_]&&!R(_))return F.schedule(!0,!0)}},demote(_){if(!(F.isJS||g))return r.forEach(M=>{M.isAccelerated()&&M.sync(),_||(M.canAccelerate=!1)}),F.isJS=!0,u=new Map,P(),r.forEach(M=>M.state==="running"&&M.js?.start()),!0}};return cl.set(t,F),F}class L6 extends ly{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ut.now();const{keyframes:r,name:a,motionValue:o,element:c}=t,u=t;u.autoplay??(u.autoplay=!0),u.delay??(u.delay=0),u.type??(u.type="keyframes"),u.repeat??(u.repeat=0),u.repeatDelay??(u.repeatDelay=0),u.repeatType??(u.repeatType="loop");const f=c?.KeyframeResolver||dy;this.keyframeResolver=new f(r,(d,m,g)=>this.onKeyframesResolved(d,m,u,!g),a,o,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,r,a,o){this.keyframeResolver=void 0;const{name:c,type:u,velocity:f,delay:d,isHandoff:m,onUpdate:g}=a;this.resolvedAt=Ut.now();const v=h6(t,c,u,f);v||((zr.instantAnimations||!d)&&g?.(qc(t,a,r)),t[0]=t[t.length-1],t0(a),a.repeat=0);const{onComplete:x}=a;a.finalKeyframe=r,a.keyframes=t,a.onComplete=()=>{x?.(),this.notifyFinished()};const S=v&&!m&&g6(a),E=!S&&A6(a);o&&(S||E||this.resolvedAt!==this.createdAt)&&(a.startTime??(a.startTime=RR(this.createdAt,this.resolvedAt)));let w;if(S){a.element=a.motionValue?.owner?.current;try{w=new f6(a)}catch{w=new ll(a)}}else E?w=new O6(a):w=new ll(a);this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this._animation.finished:super.finished}then(t,r){return this.finished.finally(t).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),n6()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation?.cancel(),this.keyframeResolver?.cancel()}}function IR(e,t,r,a=0,o=1){const c=Array.from(e).sort((m,g)=>m.sortNodePosition(g)).indexOf(t),u=e.size,f=(u-1)*a;return typeof r=="function"?r(c,u):o===1?c*a:f-c*a}const Vx=30,k6=e=>!isNaN(parseFloat(e));class z6{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const o=Ut.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&(this.dirty(),this.dependents))for(const c of this.dependents)c.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=Ut.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=k6(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){var a;return t==="change"?this.onChangeSubscribe(r):((a=this.events)[t]||(a[t]=new Cd)).add(r)}onChangeSubscribe(t){const{events:r}=this;return!r.change&&!this.changeSubscriber?this.changeSubscriber=t:(r.change||(r.change=new Cd,r.change.add(this.changeSubscriber),this.changeSubscriber=void 0),r.change.add(t)),()=>{this.changeSubscriber===t?this.changeSubscriber=void 0:r.change?.remove(t),this.stopIfUnobserved()}}stopIfUnobserved(){Xt.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(const t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,a){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-a}jump(t,r=!0){r&&(this.updatedAt=Ut.now(),this.stop()),this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,this.stopPassiveEffect?.()}dirty(){const{current:t,changeSubscriber:r}=this;r?r(t):this.events.change?.notify(t)}addDependent(t){(this.dependents||(this.dependents=new Set)).add(t)}removeDependent(t){this.dependents?.delete(t)}get(){const t=this.animation?.liveValue?.();return t===void 0?this.current:t}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ut.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Vx)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,Vx);return JE(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return new Promise(r=>this.run(t,r))}run(t,r){this.stop(),this.hasAnimated=!0;let a=!1,o;o=t(()=>{a=!0,this.events.animationComplete?.notify(),this.animation===o&&(this.animation=void 0),r?.()}),a||(this.animation=o),this.events.animationStart?.notify()}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel?.notify()),this.animation=void 0}isAnimating(){return!!this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect?.()}}function ul(e,t){return new z6(e,t)}function py(e,t){if(e?.inherit&&t){const{inherit:r,...a}=e;return{...t,...a}}return e}function gy(e,t){const r=e?.[t]??e?.default??e;return r!==e?py(r,e):r}const P6={type:"spring",stiffness:500,damping:25,restSpeed:10},_6=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),V6={type:"keyframes",duration:.8},U6={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},I6=(e,{keyframes:t})=>t.length>2?V6:ds.has(e)?e.startsWith("scale")?_6(t[1]):P6:U6,B6=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed","out","mixer"]);function H6(e){for(const t in e)if(!B6.has(t))return!0;return!1}const yy=(e,t,r,a={},o,c)=>u=>{const f=gy(a,e)||{},d=f.delay||a.delay||0;let{elapsed:m=0}=a;m=m-bi(d);const g={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...f,delay:-m,onUpdate:x=>{t.set(x),f.onUpdate&&f.onUpdate(x)},onComplete:()=>{u(),f.onComplete&&f.onComplete()},name:e,motionValue:t,element:c?void 0:o,hasOnUpdate:!!f.onUpdate};H6(f)||Object.assign(g,I6(e,g)),g.duration&&(g.duration=bi(g.duration)),g.repeatDelay&&(g.repeatDelay=bi(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let v=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(t0(g),g.delay===0&&(v=!0)),(zr.instantAnimations||zr.skipAnimations||o?.shouldSkipAnimations||f.skipAnimations)&&(v=!0,t0(g),g.delay=0),g.allowFlatten=!f.type&&!f.ease,v&&!c&&t.get()!==void 0){const x=qc(g.keyframes,f);if(x!==void 0){Xt.update(()=>{g.onUpdate(x),g.onComplete()});return}}return f.isSync?new ll(g):new L6(g)},F6=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Y6(e){const t=F6.exec(e);if(!t)return[,];const[,r,a,o]=t;return[`--${r??a}`,o]}function vy(e,t,r=1){const[a,o]=Y6(e);if(!a)return;const c=window.getComputedStyle(t).getPropertyValue(a);if(c){const u=c.trim();return X0(u)?parseFloat(u):u}return nh(o)?vy(o,t,r+1):o}function q6(e){const t=[{},{}];return e?.values.forEach((r,a)=>{t[0][a]=r.get(),t[1][a]=r.getVelocity()}),t}function BR(e,t,r,a){const o=c=>typeof c=="function"?c(r!==void 0?r:e.custom,...q6(a)):c;return t=o(t),typeof t=="string"&&(t=e.variants&&e.variants[t]),o(t)}function Ws(e,t,r){return BR(e.getProps(),t,r,e)}const HR=(e,t)=>t==="exit"?e.presenceContext?.custom:void 0,FR=new Set(["width","height","top","left","right","bottom",...Ca]),G6=e=>Array.isArray(e);function K6(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,ul(r))}function X6(e){return G6(e)?e[e.length-1]||0:e}function $6(e,t){const r=Ws(e,t);let{transitionEnd:a={},transition:o={},...c}=r||{};c={...c,...a};for(const u in c){const f=X6(c[u]);K6(e,u,f)}}const ai=e=>!!(e&&e.getVelocity);function W6(e){return!!(ai(e)&&e.add)}function a0(e,t){const r=e.getValue("willChange");if(W6(r))return r.add(t);if(!r&&zr.WillChange){const a=new zr.WillChange("auto");e.addValue("willChange",a),a.add(t)}}const YR="data-framer-appear-id";function qR(e){return e.props[YR]}const Z6=typeof window<"u";function Q6({protectedKeys:e,needsAnimating:t},r){const a=r in e&&!t[r];return t[r]=!1,a}function GR(e,t,{delay:r=0,transitionOverride:a,type:o}={}){let{transition:c,transitionEnd:u,...f}=t;const d=e.getDefaultTransition();c=c?py(c,d):d;const m=c?.reduceMotion,g=c?.skipAnimations;a&&(c=a);const v=[],x=o&&e.animationState?.getState()[o],S=c?.path;S&&(S.animateValues?S.animateValues(E=>e.getValue(E,e.latestValues[E]??0),f,c,r,v):S.animateVisualElement?.(e,f,c,r,v));for(const E in f){const w=e.getValue(E,e.latestValues[E]??null),R=f[E];if(R===void 0||x&&Q6(x,E))continue;const T={delay:r,...gy(x?.out[E]||c||{},E)};g&&(T.skipAnimations=!0);const O=w.get();if(O!==void 0&&!w.isAnimating()&&!Array.isArray(R)&&R===O&&!T.velocity){Xt.update(()=>w.set(R));continue}let k=!1;if(Z6&&window.MotionHandoffAnimation){const P=qR(e);if(P){const N=window.MotionHandoffAnimation(P,E,Xt);N!==null&&(T.startTime=N,k=!0)}}a0(e,E);const j=m??e.shouldReduceMotion;w.run(yy(E,w,R,j&&FR.has(E)?{type:!1}:T,e,k));const L=w.animation;L&&v.push(L)}if(u){const E=()=>Xt.update(()=>{u&&$6(e,u)});v.length?Promise.all(v).then(E):E()}return v}function s0(e,t,r={}){const a=Ws(e,t,HR(e,r.type)),o=r.transitionOverride||(a?.transition??(e.getDefaultTransition()||{})),c=()=>Promise.all(a?GR(e,a,r):[]),u=(d=0)=>{const{variantChildren:m}=e,{delayChildren:g=0,staggerChildren:v,staggerDirection:x}=o,S=[];return m?.forEach(E=>{E.notify("AnimationStart",t),S.push(s0(E,t,{...r,delay:d+(typeof g=="function"?0:g)+IR(m,E,g,v,x)}).then(()=>E.notify("AnimationComplete",t)))}),Promise.all(S)},{when:f}=o;return f?f==="beforeChildren"?c().then(()=>u()):u().then(c):Promise.all([c(),u(r.delay)])}function J6(e,t,r={}){return e.notify("AnimationStart",t),(Array.isArray(t)?Promise.all(t.map(o=>s0(e,o,r))):typeof t=="string"?s0(e,t,r):Promise.all(GR(e,Ws(e,t,r.custom),r))).then(()=>{e.notify("AnimationComplete",t)})}const ej={test:e=>e==="auto",parse:e=>e},tj=e=>t=>t.test(e),nj=[Sl,Ve,$r,xa,$M,XM,ej],Ux=e=>nj.find(tj(e));function ij(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||$0(e):!0}const rj=new Set(["auto","none","0"]);function aj(e,t,r){let a=0,o;for(;at.measureViewportBox())}measureInitialState(){const{element:t,unresolvedKeyframes:r,name:a}=this;if(!t?.current)return;a==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),r[0]=this.measuredOrigin;const o=r[r.length-1];o!==void 0&&this.motionValue?.jump(o,!1)}measureEndState(){const{element:t,unresolvedKeyframes:r}=this;if(!t?.current)return;this.motionValue?.jump(this.measuredOrigin,!1);const a=r.length-1,o=r[a];r[a]=this.measure(),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.resolveNoneKeyframes()}}const by=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function sd(e){return QE(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}function xy(e){return QE(e)&&"ownerSVGElement"in e}const Od={};function Sy(e){return Od.current?.add(e),e}const wy=e=>Od.current?Od.current.bind(e):e;function KR(e,t,r){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){const a=t?t.current:Od.current?.root||document,o=r?.[e]??a.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(a=>a!=null)}function XR(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}function Ey(e,t,r){const{style:a,vars:o,transformOrigin:c}=e;let u=!1,f=!1;for(const d in t){const m=t[d];if(ds.has(d)){u=!0;continue}else if(cR(d)){o[d]=m;continue}else{const g=my(m,cy[d]);d.startsWith("origin")?(f=!0,c[d]=g):a[d]=g}}if(t.transform||(u||r?a.transform=b6(t,e.transform,r):a.transform&&(a.transform="none")),f){const{originX:d="50%",originY:m="50%",originZ:g=0}=c;a.transformOrigin=`${d} ${m} ${g}`}}const oj={offset:"stroke-dashoffset",array:"stroke-dasharray"},lj={offset:"strokeDashoffset",array:"strokeDasharray"};function cj(e,t,r=1,a=0,o=!0){e.pathLength=1;const c=o?oj:lj;e[c.offset]=`${-a}`,e[c.array]=`${t} ${r}`}const $R=["transform","opacity","clipPath","filter","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function WR(e,{attrX:t,attrY:r,attrScale:a,pathLength:o,pathSpacing:c=1,pathOffset:u=0,...f},d,m,g){if(Ey(e,f,m),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:v,style:x}=e;for(const S of $R)v[S]!==void 0&&(x[S]=v[S],delete v[S]);(x.transform||v.transformOrigin)&&(x.transformOrigin=v.transformOrigin??"50% 50%",delete v.transformOrigin),x.transform&&(x.transformBox=g?.transformBox??"fill-box",delete v.transformBox),t!==void 0&&(v.x=t),r!==void 0&&(v.y=r),a!==void 0&&(v.scale=a),o!==void 0&&cj(v,o,c,u,!1)}function ZR({top:e,left:t,right:r,bottom:a}){return{x:{min:t,max:r},y:{min:e,max:a}}}function uj({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function fj(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),a=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:a.y,right:a.x}}function Qp(e){return e===void 0||e===1}function o0({scale:e,scaleX:t,scaleY:r}){return!Qp(e)||!Qp(t)||!Qp(r)}const fl=["rotate","rotateX","rotateY","rotateZ","skewX","skewY"];function Fs(e){return o0(e)||JR(e)||QR(e)}function QR(e){return e.z||e.rotate||e.rotateX||e.rotateY||e.rotateZ||e.skewX||e.skewY}function JR(e){return Ix(e.x)||Ix(e.y)}function Ix(e){return e&&e!=="0%"}function Nd(e,t,r){const a=e-r,o=t*a;return r+o}function Bx(e,t,r,a,o){return o!==void 0&&(e=Nd(e,o,a)),Nd(e,r,a)+t}function l0(e,t=0,r=1,a,o){e.min=Bx(e.min,t,r,a,o),e.max=Bx(e.max,t,r,a,o)}function eC(e,{x:t,y:r}){l0(e.x,t.translate,t.scale,t.originPoint),l0(e.y,r.translate,r.scale,r.originPoint)}const Hx=.999999999999,Fx=1.0000000000001;function dj(e,t,r,a=!1){const o=r.length;if(!o)return;t.x=t.y=1;let c,u;for(let f=0;fHx&&(t.x=1),t.yHx&&(t.y=1)}function Nr(e,t){e.min+=t,e.max+=t}function Yx(e,t,r,a,o=.5){const c=rn(e.min,e.max,o);l0(e,t,r,c,a)}function qx(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function od(e,t,r){const a=r??e;Yx(e.x,qx(t.x,a.x),t.scaleX,t.scale,t.originX),Yx(e.y,qx(t.y,a.y),t.scaleY,t.scale,t.originY)}function tC(e,t){return ZR(fj(e.getBoundingClientRect(),t))}function hj(e,t,r){const a=tC(e,r),{scroll:o}=t;return o&&(Nr(a.x,o.offset.x),Nr(a.y,o.offset.y)),a}const mj=()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),{schedule:Xc}=gR(queueMicrotask,!1);function pj(e,t,r){const a=ai(e)?e:ul(e);return a.run(yy("",a,t,r)),a.animation}const jc={};function gj(e,t){const r=Ut.now();e=wy(e);const a=({timestamp:o})=>{const c=o-r;c>=t&&(Ki(a),e(c-t))};return Xt.setup(a,!0),Sy(()=>Ki(a))}function yj(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function vj(e){return xy(e)&&e.tagName==="svg"}function ld(e){return ai(e)?e.get():e}const Gx=e=>typeof e=="number"?e:parseFloat(e),bj=by.length,Kx=e=>typeof e=="number"||Ve.test(e);function xj(e,t,r,a,o,c){o?(e.opacity=rn(0,r.opacity??1,Sj(a)),e.opacityExit=rn(t.opacity??1,0,wj(a))):c&&(e.opacity=rn(t.opacity??1,r.opacity??1,a));for(let u=0;uat?1:r(eo(e,t,a))}function c0(e,t){e.min=t.min,e.max=t.max}function Tr(e,t){c0(e.x,t.x),c0(e.y,t.y)}function $x(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const iC=1e-4,Ej=1-iC,Rj=1+iC,rC=.01,Cj=0-rC,Tj=0+rC;function ji(e){return e.max-e.min}function Aj(e,t,r){return Math.abs(e-t)<=r}function Wx(e,t,r,a=.5){e.origin=a,e.originPoint=rn(t.min,t.max,e.origin),e.scale=ji(r)/ji(t),e.translate=rn(r.min,r.max,e.origin)-e.originPoint,(e.scale>=Ej&&e.scale<=Rj||isNaN(e.scale))&&(e.scale=1),(e.translate>=Cj&&e.translate<=Tj||isNaN(e.translate))&&(e.translate=0)}function Dd(e,t,r,a){Wx(e.x,t.x,r.x,a?.originX),Wx(e.y,t.y,r.y,a?.originY)}function Zx(e,t,r,a=0){const o=a?rn(r.min,r.max,a):r.min;e.min=o+t.min,e.max=e.min+ji(t)}function Mj(e,t,r,a){Zx(e.x,t.x,r.x,a?.x),Zx(e.y,t.y,r.y,a?.y)}function Qx(e,t,r,a=0){const o=a?rn(r.min,r.max,a):r.min;e.min=t.min-o,e.max=e.min+ji(t)}function Ld(e,t,r,a){Qx(e.x,t.x,r.x,a?.x),Qx(e.y,t.y,r.y,a?.y)}function Jx(e,t,r,a,o){return e-=t,e=Nd(e,1/r,a),o!==void 0&&(e=Nd(e,1/o,a)),e}function jj(e,t=0,r=1,a=.5,o,c=e,u=e){if($r.test(t)&&(t=parseFloat(t),t=rn(u.min,u.max,t/100)-u.min),typeof t!="number")return;let f=rn(c.min,c.max,a);e===c&&(f-=t),e.min=Jx(e.min,t,r,f,o),e.max=Jx(e.max,t,r,f,o)}function eS(e,t,[r,a,o],c,u){jj(e,t[r],t[a],t[o],t.scale,c,u)}const Oj=["x","scaleX","originX"],Nj=["y","scaleY","originY"];function tS(e,t,r,a){eS(e.x,t,Oj,r?.x,a?.x),eS(e.y,t,Nj,r?.y,a?.y)}const nS=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),iS=nS("applewebkit/")&&!nS("chrome/")?Math.round:Dr;function rS(e){e.min=iS(e.min),e.max=iS(e.max)}function Dj(e){rS(e.x),rS(e.y)}const aS=()=>({translate:0,scale:1,origin:0,originPoint:0}),$o=()=>({x:aS(),y:aS()}),sS=()=>({min:0,max:0}),Hn=()=>({x:sS(),y:sS()});function oS(e){return e.translate===0&&e.scale===1}function aC(e){return oS(e.x)&&oS(e.y)}function lS(e,t){return e.min===t.min&&e.max===t.max}function Lj(e,t){return lS(e.x,t.x)&&lS(e.y,t.y)}function cS(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function sC(e,t){return cS(e.x,t.x)&&cS(e.y,t.y)}function uS(e){return ji(e.x)/ji(e.y)}function fS(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class kj{constructor(){this.members=[]}add(t){K0(this.members,t);for(let r=this.members.length-1;r>=0;r--){const a=this.members[r];if(a===t||a===this.lead||a===this.prevLead)continue;const o=a.instance;(!o||o.isConnected===!1)&&!a.snapshot&&(Rd(this.members,a),a.unmount())}t.scheduleRender()}remove(t){if(Rd(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){for(let r=this.members.indexOf(t)-1;r>=0;r--){const a=this.members[r];if(a.isPresent!==!1&&a.instance?.isConnected!==!1)return this.promote(a),!0}return!1}promote(t,r){const a=this.lead;if(t!==a&&(this.prevLead=a,this.lead=t,t.show(),a)){a.updateSnapshot(),t.scheduleRender();const{layoutDependency:o}=a.options,{layoutDependency:c}=t.options;(o===void 0||o!==c)&&(t.resumeFrom=a,r&&(a.preserveOpacity=!0),a.snapshot&&(t.snapshot=a.snapshot,t.snapshot.latestValues=a.animationValues||a.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&a.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}function dS(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const hc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ve.test(e))e=parseFloat(e);else return e;const r=dS(e,t.target.x),a=dS(e,t.target.y);return`${r}% ${a}%`}},zj={correct:(e,{treeScale:t,projectionDelta:r})=>{const a=e,o=mr.parse(e);if(o.length>5)return a;const c=mr.createTransformer(e),u=typeof o[0]!="number"?1:0,f=r.x.scale*t.x,d=r.y.scale*t.y;o[0+u]/=f,o[1+u]/=d;const m=rn(f,d,.5);return typeof o[2+u]=="number"&&(o[2+u]/=m),typeof o[3+u]=="number"&&(o[3+u]/=m),c(o)}},Pj={borderRadius:Object.assign({},hc,{applyTo:by.slice()}),borderTopLeftRadius:hc,borderTopRightRadius:hc,borderBottomLeftRadius:hc,borderBottomRightRadius:hc,boxShadow:zj};function _j(e,t,r){let a="";const o=e.x.translate/t.x,c=e.y.translate/t.y,u=r?.z||0;(o||c||u)&&(a=`translate3d(${o}px, ${c}px, ${u}px) `);let f="";if(r){const{transformPerspective:d}=r;d&&(a=`perspective(${d}px) ${a}`);for(let m=0;me.depth-t.depth;class Uj{constructor(){this.children=[],this.isDirty=!1}add(t){K0(this.children,t),this.isDirty=!0}remove(t){Rd(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Vj),this.isDirty=!1,this.children.forEach(t)}}const cd={hasAnimatedSinceResize:!0,hasEverUpdated:!1},hS=["z","skew","skewZ"],Ij=1e3;let Bj=0;function mS(e,t,r,a){const{latestValues:o}=t;o[e]&&(r[e]=o[e],t.setStaticValue(e,0),a&&(a[e]=0))}const Jp=e=>e.instance&&cl.get(e.instance)?.demote()&&e.resetSkewAndRotation();function oC(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=qR(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:o,layoutId:c}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",Xt,!(o||c))}const{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&oC(a)}function lC(e){if(e)return e.options.allowProjection!==!1?e.projection:lC(e.parent)}function cC({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:a,resetTransform:o}){return Object.assign(jc,{...Pj,...jc}),class{static create(u,f,d){const{layoutId:m,layout:g,drag:v,dragConstraints:x,layoutScroll:S,layoutRoot:E,layoutAnchor:w,layoutCrossfade:R}=f,T=u.projection=new this(u.latestValues,f["data-framer-portal-id"]?void 0:lC(u.parent));T.setOptions({layoutId:m,layout:g,alwaysMeasureLayout:!!v||x&&yj(x),visualElement:u,animationType:typeof g=="string"?g:"both",initialPromotionConfig:d,crossfade:R,layoutScroll:S,layoutRoot:E,layoutAnchor:w});const O=T.getStack()?.lead;O&&!T.root.isUpdateBlocked()&&(O.willUpdate(),O.scheduleCheckAfterUnmount())}constructor(u={},f=t?.()){this.id=Bj++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Yj),this.nodes.forEach(Qj),this.nodes.forEach(Jj),this.nodes.forEach(qj)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=u,this.root=f?f.root||f:this,this.path=f?[...f.path,f]:[],this.parent=f,this.depth=f?f.depth+1:0;for(let d=0;dthis.root.updateBlockedByResize=!1;Xt.read(()=>{v=window.innerWidth}),e(u,()=>{const S=window.innerWidth;S!==v&&(v=S,this.root.updateBlockedByResize=!0,g?.(),g=gj(x,250),cd.hasAnimatedSinceResize&&(cd.hasAnimatedSinceResize=!1,this.nodes.forEach(yS)))})}f&&this.root.registerSharedNode(f,this),this.addLayoutListener()}addLayoutListener(){const{layoutId:u,layout:f,visualElement:d,animate:m}=this.options;!this.instance||this.hasLayoutListener||m===!1||!d||!(u||f)||(this.hasLayoutListener=!0,this.addEventListener("didUpdate",({delta:g,hasLayoutChanged:v,hasRelativeLayoutChanged:x,layout:S})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}const E=this.options.transition||d.getDefaultTransition()||i8,{onLayoutAnimationStart:w,onLayoutAnimationComplete:R}=d.getProps(),T=!this.targetLayout||!sC(this.targetLayout,S),O=!v&&x;if(this.options.layoutRoot||this.resumeFrom||O||v&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const k={...gy(E,"layout"),onPlay:w,onComplete:R};(d.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k),this.setAnimationOrigin(g,O,k.path)}else v||yS(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=S}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,Ki(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach(e8),this.animationId++)}getTransformTemplate(){const{visualElement:u}=this.options;return u&&u.getProps().transformTemplate}willUpdate(u=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete?.();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&oC(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;Jp(this),this.isLayoutDirty=!0;for(let g=0;gu.members.length?u.removeLeadSnapshot():this.sharedNodes.delete(f))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Xt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Xt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ji(this.snapshot.measuredBox.x)&&!ji(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d{const L=j/1e3,P=k?.(L);vS(x.x,u.x,L),vS(x.y,u.y,L),P&&(x.x.translate=P.x,x.y.translate=P.y),this.setTargetDelta(x),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ld(S,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),t8(this.relativeTarget,this.relativeTargetOrigin,S,L),O&&Lj(this.relativeTarget,O)&&(this.isProjectionDirty=!1),O||(O=Hn()),Tr(O,this.relativeTarget)),E&&(this.animationValues=v,xj(v,g,this.latestValues,L,T,R)),P?.rotate!==void 0&&(this.animationValues||(this.animationValues=v),this.animationValues.pathRotation=P.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(u){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Ki(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Xt.update(()=>{cd.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ul(0)),this.motionValue.jump(0,!1),this.currentAnimation=pj(this.motionValue,[0,1e3],{...u,velocity:0,isSync:!0,onUpdate:f=>{this.mixTargetDelta(f),u.onUpdate&&u.onUpdate(f)},onComplete:()=>{u.onComplete&&u.onComplete(),this.completeAnimation()}}),B4(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const u=this.getStack();u&&u.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta?.(Ij),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const u=this.getLead(),{targetWithTransforms:f,layout:d,latestValues:m}=u;let{target:g}=u;if(!(!f||!g||!d)){if(this!==u&&this.layout&&d&&uC(this.options.animationType,this.layout.layoutBox,d.layoutBox)){const{layoutBox:v}=this.layout,x=g;g=this.target||Hn(),xS(g.x,x.x,v.x),xS(g.y,x.y,v.y)}Tr(f,g),od(f,m),Dd(this.projectionDeltaWithTransform,this.layoutCorrected,f,m)}}registerSharedNode(u,f){this.sharedNodes.has(u)||this.sharedNodes.set(u,new kj),this.sharedNodes.get(u).add(f);const m=f.options.initialPromotionConfig;f.promote({transition:m?.transition,preserveFollowOpacity:m?.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(f):void 0})}isLead(){const u=this.getStack();return u?u.lead===this:!0}getLead(){const{layoutId:u}=this.options;return u?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:u}=this.options;return u?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:u}=this.options;if(u)return this.root.sharedNodes.get(u)}promote({needsReset:u,transition:f,preserveFollowOpacity:d}={}){this.getStack()?.promote(this,d),u&&(this.projectionDelta=void 0,this.needsReset=!0),f&&this.setOptions({transition:f})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){const{visualElement:u}=this.options;if(!u)return;const{latestValues:f}=u;if(!QR(f))return;const d={};for(let m=0;mu.currentAnimation?.stop()),this.root.nodes.forEach(pS),this.root.sharedNodes.clear()}}}function Hj(e){e.updateLayout(),Xj(e)}function Fj(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:a}=e.layout,{animationType:o}=e.options,c=t.source!==e.layout.source,u=(S,E)=>{if(o==="size")jr(w=>{const R=ji(S[w]);S[w].min=E[w].min,S[w].max=S[w].min+R});else if(o==="x"||o==="y"){const w=o==="x"?"y":"x";c0(S[w],E[w])}else uC(o,t.layoutBox,r)&&jr(w=>{const R=ji(E[w]);S[w].max=S[w].min+R,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[w].max=e.relativeTarget[w].min+R)})},f=c?t.measuredBox:t.layoutBox;u(f,r);const d=$o();Dd(d,r,t.layoutBox);const m=$o();Dd(m,c?e.applyTransform(a,!0):r,f);const g=!aC(d);let v=!1;const x=e.getClosestProjectingParent();if((!c||x?.options.layoutRoot&&e.resumeFrom?.path.includes(x))&&x&&!x.resumeFrom){const{snapshot:S,layout:E}=x;if(S&&E){const w=e.options.layoutAnchor||void 0,R=Hn();Ld(R,c?e.resumeFrom.applyTransform(t.layoutBox,!0,void 0,!0,x.depth+1):t.layoutBox,S.layoutBox,w);const T=Hn();Ld(T,r,E.layoutBox,w),c&&u(R,T),sC(R,T)||(v=!0),x.options.layoutRoot&&(e.relativeTarget=T,e.relativeTargetOrigin=R,e.relativeParent=x)}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:m,layoutDelta:d,hasLayoutChanged:g,hasRelativeLayoutChanged:v})}else e.isLead()&&e.options.onExitComplete?.();e.options.transition=void 0}function Yj(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function qj(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Gj(e){e.clearSnapshot()}function pS(e){e.clearMeasurements()}function Kj(e){e.isLayoutDirty=!0,e.updateLayout()}function gS(e){e.isLayoutDirty=!1}function Xj(e){const{snapshot:t,dragAncestor:r}=e,a=r?.isAnimationBlocked&&r.layout;if(!t||!a||e.resumeFrom||e.isAnimationBlocked)return;const o=r.dragSnapshot;jr(c=>Nr(t.layoutBox[c],a.layoutBox[c].min-o.layoutBox[c].min))}function $j(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function Wj(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function Zj(e){const{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function yS(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Qj(e){e.resolveTargetDelta()}function Jj(e){e.calcProjection()}function e8(e){e.resetSkewAndRotation()}function vS(e,t,r){e.translate=rn(t.translate,0,r),e.scale=rn(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function bS(e,t,r,a){e.min=rn(t.min,r.min,a),e.max=rn(t.max,r.max,a)}function t8(e,t,r,a){bS(e.x,t.x,r.x,a),bS(e.y,t.y,r.y,a)}function n8(e){return e.animationValues?.opacityExit!==void 0}const i8={duration:.45,ease:[.4,0,.1,1]};function xS(e,t,r){e.max=ji(r)+(e.min=t.min)}function uC(e,t,r){return e==="position"||e==="preserve-aspect"&&!Aj(uS(t),uS(r),.2)}function r8(e){return e!==e.root&&e.scroll?.wasRoot}function to(e,t,r,a={passive:!0}){return e.addEventListener(t,r,a),()=>e.removeEventListener(t,r,a)}const a8=cC({attachResizeListener:(e,t)=>to(e,"resize",t),measureScroll:mj,checkIsScrollRoot:()=>!0}),ud={current:void 0},fC=cC({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ud.current){const e=new a8({});e.mount(window),e.setOptions({layoutScroll:!0}),ud.current=e}return ud.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),s8=new WeakMap;function ih(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function $c(e){return typeof e=="string"||Array.isArray(e)}const rh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],SS=["initial"].concat(rh);function ah(e){if(ih(e.animate))return!0;for(let t=0;tkd.current=e.matches;e.addEventListener("change",t),t()}else kd.current=!1}const wS=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let zd={};function mC(e){zd=e}function c8(){return zd}class u8{scrapeMotionValuesFromProps(t,r,a){return{}}constructor({parent:t,props:r,presenceContext:a,reducedMotionConfig:o,skipAnimations:c,blockInitialAnimation:u,visualState:f},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=dy,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const S=Ut.now();this.renderScheduledAto.delete(this)}}this.values.forEach((a,o)=>this.bindToMotionValue(o,a)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Ry.current||hC(),this.shouldReduceMotion=kd.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection?.unmount(),Ki(this.notifyUpdate),Ki(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree?.(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const r=this.features[t];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),(this.enteringChildren||(this.enteringChildren=new Set)).add(t)}removeChild(t){this.children.delete(t),this.enteringChildren?.delete(t)}bindToMotionValue(t,r){if(this.valueSubscriptions.get(t)?.(),r.accelerate&&n0.has(t)&&this.current instanceof HTMLElement){const{factory:u,keyframes:f,times:d,ease:m,duration:g}=r.accelerate,v=new zR({element:this.current,name:t,keyframes:f,times:d,ease:m,duration:bi(g)}),x=u(v);this.valueSubscriptions.set(t,()=>{x(),v.cancel()});return}const a=ds.has(t);a&&this.onBindTransform&&this.onBindTransform();const o=r.on("change",u=>{this.latestValues[t]=u,this.props.onUpdate&&Xt.preRender(this.notifyUpdate),a&&(this.projection&&(this.projection.isTransformDirty=!0),cl.get(this.current)?.check()),this.scheduleRender()});let c;typeof window<"u"&&window.MotionCheckAppearSync&&(c=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{o(),c?.()})}sortNodePosition(t){return!this.current||!t.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in zd){const r=zd[t];if(!r)continue;const{isEnabled:a,Feature:o}=r;if(!this.features[t]&&o&&a(this.props)&&(this.features[t]=new o(this)),this.features[t]){const c=this.features[t];c.isMounted?c.update():(c.mount(),c.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Hn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){const{transformTemplate:a,onUpdate:o}=this.props;(t.transformTemplate||a)&&this.scheduleRender(),(t.transformTemplate&&!a||t.onUpdate&&!o)&&cl.get(this.current)?.demote(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let c=0;c{this.current&&(this.current.textContent=`${r}`)}))}}function gC(e,{style:t,vars:r},a,o){const c=e.style;let u;for(u in t)c[u]=t[u];o?.applyProjectionStyles(c,a);for(u in r)c.setProperty(u,r[u])}function yC(e,{layout:t,layoutId:r}){return ds.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!jc[e]||e==="opacity")}function Cy(e,t,r){const a=e.style,o=t?.style,c={};if(!a)return c;for(const u in a)(ai(a[u])||o&&ai(o[u])||yC(u,e)||r?.getValue(u)?.liveStyle!==void 0)&&(c[u]=a[u]);return c}function f8(e){return window.getComputedStyle(e)}class d8 extends pC{constructor(){super(...arguments),this.type="html",this.renderInstance=gC}mount(t){super.mount(t)}readValueFromInstance(t,r){if(ds.has(r))return this.projection?.isProjecting?Kc(r):Z4(t,r);{const a=f8(t),o=(cR(r)?a.getPropertyValue(r):a[r])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:r}){return tC(t,r)}build(t,r,a){Ey(t,r,a.transformTemplate)}scrapeMotionValuesFromProps(t,r,a){return Cy(t,r,a)}}const Wc=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Ty(e){return{point:{x:e.pageX,y:e.pageY}}}const h8=e=>t=>Wc(t)&&e(t,Ty(t));function Pc(e,t,r,a){return to(e,t,h8(r),a)}const fd=new WeakMap;let dd;const vC=(e,t,r)=>(a,o)=>o&&o[0]?o[0][e+"Size"]:xy(a)&&"getBBox"in a?a.getBBox()[t]:a[r],m8=vC("inline","width","offsetWidth"),p8=vC("block","height","offsetHeight");function g8({target:e,borderBoxSize:t}){fd.get(e)?.forEach(r=>{r(e,{get width(){return m8(e,t)},get height(){return p8(e,t)}})})}function y8(e){e.forEach(g8)}function v8(){typeof ResizeObserver>"u"||(dd=new ResizeObserver(y8))}function b8(e,t){dd||v8();const r=KR(e);return r.forEach(a=>{let o=fd.get(a);o||(o=new Set,fd.set(a,o)),o.add(t),dd?.observe(a)}),()=>{r.forEach(a=>{const o=fd.get(a);o?.delete(t),o?.size||dd?.unobserve(a)})}}const hd=new Set;let Wo;function x8(){Wo=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};hd.forEach(t=>t(e))},window.addEventListener("resize",Wo)}function S8(e){return hd.add(e),Wo||x8(),()=>{hd.delete(e),!hd.size&&typeof Wo=="function"&&(window.removeEventListener("resize",Wo),Wo=void 0)}}function ES(e,t){return Sy(typeof e=="function"?S8(e):b8(e,t))}const RS=(e,t)=>Math.abs(e-t);function w8(e,t){const r=RS(e.x,t.x),a=RS(e.y,t.y);return Math.sqrt(r**2+a**2)}const CS=new Set(["auto","scroll"]);class bC{constructor(t,r,{transformPagePoint:a,contextWindow:o=window,dragSnapToOrigin:c=!1,distanceThreshold:u=3,element:f,immediate:d}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=E=>{this.handleScroll(E.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=zf(this.lastRawMoveEventInfo,this.transformPagePoint));const E=tg(this.lastMoveEventInfo,this.history),w=this.startEvent!==null,R=w8(E.offset,{x:0,y:0})>=this.distanceThreshold;if(!w&&!R)return;const{point:T}=E;this.history.push({...T,timestamp:Ut.now()});const{onStart:O,onMove:k}=this.handlers;w||(O?.(this.lastMoveEvent,E),this.startEvent=this.lastMoveEvent),k?.(this.lastMoveEvent,E)},this.handlePointerMove=(E,w)=>{this.handleScroll(window),this.lastMoveEvent=E,this.lastRawMoveEventInfo=w,this.lastMoveEventInfo=zf(w,this.transformPagePoint),this.hasPendingMove=!0,Xt.update(this.updatePoint,!0)},this.handlePointerUp=(E,w)=>{this.hasPendingMove&&this.updatePoint(),this.end();const{onEnd:R,onSessionEnd:T,resumeAnimation:O}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&O?.(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const k=tg(E.type==="pointercancel"?this.lastMoveEventInfo:zf(w,this.transformPagePoint),this.history);this.startEvent&&R?.(E,k),T?.(E,k)},!Wc(t))return;this.dragSnapToOrigin=c,this.handlers=r,this.transformPagePoint=a,this.distanceThreshold=d?0:u,this.contextWindow=o||window;const m=Ty(t),g=zf(m,this.transformPagePoint),{point:v}=g;this.history=[{...v,timestamp:Ut.now()}];const{onSessionStart:x}=r;x&&x(t,tg(g,this.history));const S={passive:!0,capture:!0};this.removeListeners=ol(Pc(this.contextWindow,"pointermove",this.handlePointerMove,S),Pc(this.contextWindow,"pointerup",this.handlePointerUp,S),Pc(this.contextWindow,"pointercancel",this.handlePointerUp,S)),f&&this.startScrollTracking(f),d&&(this.handlePointerMove(t,m),this.updatePoint())}startScrollTracking(t){let r=t.parentElement;for(;r;){const a=getComputedStyle(r);(CS.has(a.overflowX)||CS.has(a.overflowY))&&this.scrollPositions.set(r,eg(r)),r=r.parentElement}this.scrollPositions.set(window,eg(window)),this.removeScrollListeners=ol(to(window,"scroll",this.onElementScroll,{capture:!0}),to(window,"scroll",this.onWindowScroll,{}))}handleScroll(t){const r=this.scrollPositions.get(t);if(!r)return;const a=t===window,o=eg(t),c={x:o.x-r.x,y:o.y-r.y};c.x===0&&c.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=c.x,this.lastMoveEventInfo.point.y+=c.y):this.history.length>0&&(this.history[0].x-=c.x,this.history[0].y-=c.y),this.scrollPositions.set(t,o),Xt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),Ki(this.updatePoint)}}const eg=e=>e===window?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop};function zf(e,t){return t?{point:t(e.point)}:e}function TS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function tg({point:e},t){return{point:e,delta:TS(e,xC(t)),offset:TS(e,E8(t)),velocity:R8(t,.1)}}function E8(e){return e[0]}function xC(e){return e[e.length-1]}function R8(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,a=null;const o=xC(e);for(;r>=0&&(a=e[r],!(o.timestamp-a.timestamp>bi(t)));)r--;if(!a)return{x:0,y:0};a===e[0]&&e.length>2&&o.timestamp-a.timestamp>bi(t)*2&&(a=e[1]);const c=Xi(o.timestamp-a.timestamp);if(c===0)return{x:0,y:0};const u={x:(o.x-a.x)/c,y:(o.y-a.y)/c};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}const C8=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function T8(e){return C8.has(e.tagName)||e.isContentEditable===!0}const A8=new Set(["INPUT","SELECT","TEXTAREA"]);function M8(e){return A8.has(e.tagName)||e.isContentEditable===!0}const Ar={x:!1,y:!1};function Pd(){return Ar.x||Ar.y}function j8(e){return e==="x"||e==="y"?Ar[e]?null:(Ar[e]=!0,()=>{Ar[e]=!1}):Ar.x||Ar.y?null:(Ar.x=Ar.y=!0,()=>{Ar.x=Ar.y=!1})}function O8(e,{min:t,max:r},a){return t!==void 0&&er&&(e=a?rn(r,e,a.max):Math.min(e,r)),e}function AS(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function N8(e,{top:t,left:r,bottom:a,right:o}){return{x:AS(e.x,r,o),y:AS(e.y,t,a)}}function MS(e,t){let r=t.min-e.min,a=t.max-e.max;return t.max-t.mina?r=eo(t.min,t.max-a,e.min):a>o&&(r=eo(e.min,e.max-o,t.min)),Ma(0,1,r)}function k8(e,t){const r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}const u0=.35;function z8(e=u0){return e===!1?e=0:e===!0&&(e=u0),{x:jS(e,"left","right"),y:jS(e,"top","bottom")}}function jS(e,t,r){return{min:OS(e,t),max:OS(e,r)}}function OS(e,t){return typeof e=="number"?e:e[t]||0}function NS(e){let t="";for(const r of e.path){r.scroll=void 0,r.updateScroll();const{scroll:a}=r;r!==e.root&&a&&(t+=a.offset.x+","+a.offset.y+",")}return t}const P8=new WeakMap;class _8{constructor(t,r=()=>t.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Hn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t,this.readProps=r}start(t,r={}){if(this.visualElement.presenceContext?.isPresent===!1)return;const a=m=>{r.snapToCursor&&this.snapToCursor(m),this.stopAnimation()},o=(m,g)=>{const{drag:v,dragConstraints:x,dragPropagation:S,onDragStart:E}=this.getProps();if(v&&!S&&(this.openDragLock?.(),this.openDragLock=j8(v),!this.openDragLock))return;this.latestPointerEvent=m,this.latestPanInfo=g,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();const{projection:w}=this.visualElement;w&&(w.isAnimationBlocked=!0,w.target=void 0),jr(R=>{let T=this.getAxisMotionValue(R).get()||0;if(nh(T)&&(T=vy(T,this.visualElement.current)||0),Ve.test(T))T=parseFloat(T);else if($r.test(T)){const O=w?.layout?.layoutBox[R];O&&(T=ji(O)*(parseFloat(T)/100))}this.originPoint[R]=T}),this.point=typeof x=="function"&&x(this),E&&Xt.update(()=>E(m,g),!1,!0),a0(this.visualElement,"transform"),this.visualElement.animationState?.setActive("whileDrag",!0)},c=(m,g)=>{this.latestPointerEvent=m,this.latestPanInfo=g;const{dragPropagation:v,dragDirectionLock:x,onDirectionLock:S,onDrag:E}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:w}=g;if(x&&this.currentDirection===null){if(this.currentDirection=U8(w),this.currentDirection===null)return;S&&S(this.currentDirection)}this.updateAxis("x",w),this.updateAxis("y",w),this.point&&this.point.move(),this.visualElement.render(),E&&Xt.update(()=>E(m,g),!1,!0)},u=(m,g)=>{this.latestPointerEvent=m,this.latestPanInfo=g,this.stop(m,g),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:m}=this.getProps();(m||this.constraints||this.point)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new bC(t,{onSessionStart:a,onStart:o,onMove:c,onSessionEnd:u,resumeAnimation:f},{...r,transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(t,r,a){const o=t||this.latestPointerEvent,c=r||this.latestPanInfo,u=this.isDragging;if(this.cancel(),!u||!c||!o)return;const{velocity:f}=c;this.startAnimation(f,a);const{onDragEnd:d}=this.getProps();d&&Xt.postRender(()=>d(o,c))}cancel(){this.isDragging=!1;const{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r?.setActive("whileDrag",!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(t,r){const{drag:a}=this.readProps();if(!r||!Io(t,a,this.currentDirection))return;const o=this.getAxisMotionValue(t);let c=this.originPoint[t]+r[t];const u=this.constraints&&this.constraints[t];u&&(c=O8(c,u,this.elastic[t])),this.point?this.point[t]=c:o.set(c)}resolveConstraints(){const{dragConstraints:t,dragElastic:r}=this.getProps(),{projection:a}=this.visualElement,o=a&&(a.layout||a.measure(!1)),c=this.constraints;mc(t)?(!this.constraints||this.scroll!==NS(a))&&(this.constraints=this.resolveRefConstraints()):t&&o&&typeof t=="object"?this.constraints=N8(o.layoutBox,t):this.constraints=!1,this.elastic=z8(r),c!==this.constraints&&!mc(t)&&o&&this.constraints&&!this.hasMutatedConstraints&&jr(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=k8(o.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!mc(t))return!1;const a=DS(t),{projection:o}=this.visualElement;if(!o||!o.layout)return!1;this.scroll=NS(o);const c=hj(a,o.root,this.visualElement.getTransformPagePoint());let u=D8(o.layout.layoutBox,o.removeElementScroll(c));if(r){const f=r(uj(u));this.hasMutatedConstraints=!!f,f&&(u=ZR(f))}return u}startAnimation(t,r){const{drag:a,dragMomentum:o,dragElastic:c,dragTransition:u,dragSnapToOrigin:f,onDragTransitionEnd:d}=this.getProps(),m={bounceStiffness:c?200:1e6,bounceDamping:c?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...u},g=S=>o&&!(this.point&&f)&&Io(S,r||a,this.currentDirection)?t[S]:0;if(this.point&&!f)return this.point.release({x:g("x"),y:g("y")},m).then(d);const v=this.constraints||{},x=jr(S=>{if(!Io(S,r||a,this.currentDirection))return;let E=v[S]||{};(f===!0||f===S)&&(E={min:0,max:0});const w={type:"inertia",velocity:g(S),...m,...E};return this.startAxisValueAnimation(S,w)});return Promise.all(x).then(d)}startAxisValueAnimation(t,r){const a=this.getAxisMotionValue(t);return a0(this.visualElement,t),a.start(yy(t,a,0,r,this.visualElement,!1))}stopAnimation(){jr(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const r=`_drag${t.toUpperCase()}`,o=this.readProps()[r];return o||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor({clientX:t,clientY:r}){const{drag:a}=this.getProps(),o={x:t,y:r},c=this.visualElement.getTransformPagePoint()?.(o)||o,u=this.visualElement.measureViewportBox();jr(f=>{if(!Io(f,a,this.currentDirection))return;const d=this.getAxisMotionValue(f),{min:m,max:g}=u[f];d.set((d.get()||0)+c[f]-rn(m,g,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:r}=this.getProps(),{projection:a}=this.visualElement;if(!mc(r)||!a||!this.constraints)return;this.stopAnimation();const o=this.constraints,c={x:0,y:0};jr(f=>{const d=this.getAxisMotionValue(f).get();c[f]=L8({min:d,max:d},o[f])});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",a.root?.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),jr(f=>{const d=this.getAxisMotionValue(f);if(!Io(f,t,null)||!d.get())return;const{min:m,max:g}=this.constraints[f];d.set(rn(m,g,c[f]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;P8.set(this.visualElement,this);const t=this.visualElement.current,r=Pc(t,"pointerdown",m=>{const{drag:g,dragListener:v=!0}=this.getProps(),x=m.target,S=x!==t&&M8(x);g&&v&&!S&&this.start(m)});let a;const o=()=>{const{dragConstraints:m}=this.getProps(),g=mc(m)&&DS(m);g&&(this.constraints=this.resolveRefConstraints(),a||(a=V8(t,g,()=>this.scalePositionWithinConstraints())))},{projection:c}=this.visualElement,u=c.addEventListener("measure",o);c.layout||(c.root?.updateScroll(),c.updateLayout()),Xt.read(o);const f=to(window,"resize",()=>this.scalePositionWithinConstraints()),d=c.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(jr(v=>{if(!Io(v,this.getProps().drag,this.currentDirection))return;const x=this.getAxisMotionValue(v);this.originPoint[v]+=m[v].translate,x.set(x.get()+m[v].translate)}),this.visualElement.render())}));return()=>{f(),r(),u(),d(),a?.()}}getProps(){const t=this.readProps(),{dragElastic:r=u0,dragMomentum:a=!0}=t;return{...t,dragElastic:r,dragMomentum:a}}}function mc(e){return!!e&&typeof e=="object"&&("current"in e||"nodeType"in e)}const DS=e=>"current"in e?e.current:e;function LS(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function V8(e,t,r){const a=ES(e,LS(r)),o=ES(t,LS(r));return()=>{a(),o()}}function Io(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function U8(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}function SC(e,t){const r=KR(e),a=new AbortController,o={passive:!0,...t,signal:a.signal},c=Sy(()=>a.abort());return[r,o,c]}function I8(e){return!(e.pointerType==="touch"||Pd())}function B8(e,t,r={}){t=wy(t);const[a,o,c]=SC(e,r);return a.forEach(u=>{let f=!1,d=!1,m;const g=()=>{u.removeEventListener("pointerleave",E)},v=R=>{m&&(m(R),m=void 0),g()},x=R=>{f=!1,window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x),d&&(d=!1,v(R))},S=()=>{f=!0,window.addEventListener("pointerup",x,o),window.addEventListener("pointercancel",x,o)},E=R=>{if(R.pointerType!=="touch"){if(f){d=!0;return}v(R)}},w=R=>{if(!I8(R))return;d=!1;const T=t(u,R);typeof T=="function"&&(m=T,u.addEventListener("pointerleave",E,o))};u.addEventListener("pointerenter",w,o),u.addEventListener("pointerdown",S,o)}),c}const wC=(e,t)=>t?e===t?!0:wC(e,t.parentElement):!1,f0=new WeakSet;function kS(e){return t=>{t.key==="Enter"&&e(t)}}function ng(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const H8=(e,t)=>{let r=!1;const a=kS(()=>{r||f0.has(e)||(r=!0,ng(e,"down"))}),o=kS(()=>{r&&(r=!1,ng(e,"up"))});e.addEventListener("keydown",a,t),e.addEventListener("keyup",o,t),e.addEventListener("blur",()=>{e.removeEventListener("keydown",a),e.removeEventListener("keyup",o),r&&ng(e,"cancel")},{...t,once:!0})};function F8(e){return Wc(e)&&!Pd()}const zS=new WeakSet,Y8=100,q8=8,PS=(e,t,r)=>Math.hypot(e.clientX-t.clientX,e.clientY-t.clientY)>r,_S=e=>e.preventDefault();function G8(e,t,r={}){t=wy(t);const[a,o,c]=SC(e,r),u=new WeakMap,f=d=>{const m=d.currentTarget;if(!F8(d)||zS.has(d))return;r.stopPropagation&&zS.add(d);const{count:g=1,countTimeout:v=.3,hold:x=0,repeat:S}=r,E=Ut.now(),w=bi(x),R=bi(v);let T=u.get(m);T?.expire(PS(T.event,d,Y8))?T=void 0:T&&(Ki(T.expire),u.delete(m));const O=T?T.count+1:1,k=O>=g,j=k&&(x||S);let L=!x,P=0,N;if(f0.add(m),T)N=T.handlers;else{const Q=t(m,d);N=typeof Q=="function"?{onComplete:Q}:Q||{}}k&&L&&N.onActive?.();const A=bi(S);let H=w||A,Y=E+H,W=!0;const K=()=>{if(o.signal.aborted)return Ki(K);let Q=Math.min(1-(Y-Ut.now())/H,1);W&&Q<1&&(Q=0),W=!1,N.onHold?.(Q),!(Q<1)&&(L?N.onRepeat?.(++P):(L=!0,N.onActive?.()),S?(W=!0,Y+=H=A):Ki(K))},$={...o,capture:!0},ee=(Q,F)=>{if(window.removeEventListener("pointerup",ie,$),window.removeEventListener("pointercancel",V,$),window.removeEventListener("pointermove",X,$),m.removeEventListener("contextmenu",_S),Ki(K),f0.delete(m),!!Wc(Q))if(Pd()&&(F=!1),F&&!k){const _=Ut.now(),M=z=>{const I=o.signal.aborted;if(I||z===!0||Ut.now()-_>R)return Ki(M),u.delete(m),I||N.onComplete?.(Q,{success:!1}),!0};u.set(m,{count:O,event:d,handlers:N,expire:M}),Xt.update(M,!0)}else N.onComplete?.(Q,{success:F&&L})},ie=Q=>{ee(Q,m===window||m===document||r.useGlobalTarget||wC(m,Q.target))},V=Q=>{ee(Q,!1)},X=Q=>{Wc(Q)&&((S||!L)&&PS(d,Q,q8)||g>1&&Pd())&&V(Q)};window.addEventListener("pointerup",ie,$),window.addEventListener("pointercancel",V,$),(j||g>1)&&window.addEventListener("pointermove",X,$),j&&(Xt.update(K,!0),m.addEventListener("contextmenu",_S,{...o,passive:!1}))};return a.forEach(d=>{(r.useGlobalTarget?window:d).addEventListener("pointerdown",f,o),sd(d)&&(d.addEventListener("focus",()=>H8(d,o),o),!T8(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),c}class xs{constructor(t){this.isMounted=!1,this.node=t}update(){}}const EC=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),RC=e=>typeof e=="string"&&e.toLowerCase()==="svg";function K8(e,t,r,a){gC(e,t,void 0,a);for(const o in t.attrs)e.setAttribute(EC.has(o)?o:XR(o),t.attrs[o])}function CC(e,t,r){const a=Cy(e,t,r);for(const o in e)if(o!=="children"&&(ai(e[o])||ai(t[o]))){const c=Ca.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;a[c]=e[o]}return a}class X8 extends pC{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Hn}getBaseTargetFromProps(t,r){return ds.has(r)?super.getBaseTargetFromProps(t,r)??Kc(r):t[r]}getDefaultValue(t){return ds.has(t)?this.latestValues[t]??Kc(t):void 0}readValueFromInstance(t,r){if(ds.has(r)){const a=MR(r);return a&&a.default||0}if($R.includes(r)){const o=getComputedStyle(t)[r];if(typeof o=="string"&&o)return o.trim()}return r=EC.has(r)?r:XR(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,a){return CC(t,r,a)}build(t,r,a){WR(t,r,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(t,r,a,o){K8(t,r,a,o)}mount(t){this.isSVGTag=RC(t.tagName),super.mount(t)}}function TC(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let a=0;ae?.out===!0?e:e?.out;function W8(e){let t=f=>Promise.all(f.map(({animation:d,options:m})=>J6(e,d,m))),r=US(),a=!0,o=!1;function c(f){const{props:d,parent:m,manuallyAnimateOnMount:g}=e,{initial:v}=d,x=a||o,S=[],E=(L=v)=>typeof L!="boolean"&&Ws(e,Array.isArray(L)?L[0]:L,e.presenceContext?.custom)||void 0,w=new Map;let R={},T=1/0,O=e;do O=O.props.inherit!==!1&&O.parent;while(O&&!O.isControllingVariants);const k=x&&VS(E(v??(O&&O.props.initial))?.transition);if($8.forEach((L,P)=>{const N=r[L],A=d[L],H=O&&O.props[L],Y=A!==void 0?A:$c(H)||H===!1?H:void 0,W=$c(Y),K=L===f?N.isActive:null,$=W&&A===void 0&&!(x&&g);if(N.protectedKeys={...R},!N.isActive&&K===null||!Y&&!N.prevProp||ih(Y)||typeof Y=="boolean")return;if(K===!1&&(T=P),L==="exit"&&N.isActive&&K!==!0){R={...R,...N.prevResolvedValues};return}const ee=Z8(N.prevProp,Y);let ie=ee||W&&(K&&!$||P>T),V=!1;const X=Array.isArray(Y)?Y:[Y];let Q={},F;if(K!==!1)for(const M of X){const{transition:z,transitionEnd:I,...B}=Ws(e,M,HR(e,L))||{};Q={...Q,...B,...I},F=VS(z)||F}const{prevResolvedValues:_}=N;for(const M in{..._,...Q}){if(M in R)continue;const z=Q[M],I=_[M],B=Array.isArray(z)&&Array.isArray(I)?!TC(z,I)||ee:z!==I;let Z;if(B&&z==null)w.has(M)||w.set(M,N.prevOut);else if(B||z!==void 0&&w.has(M)){ie=!0,Z=w.get(M)||k,w.delete(M)&&(V=!0),N.needsAnimating[M]=!0;const re=e.getValue(M);re&&(re.liveStyle=!1)}else N.protectedKeys[M]=!0;N.out[M]=Z}if(N.prevProp=Y,N.prevResolvedValues=Q,N.prevOut=F,N.isActive&&(R={...R,...Q}),ie&&(!($&&ee)||V))for(const M of X){const z={type:L};if(typeof M=="string"&&x&&g&&m?.enteringChildren){const I=Ws(m,M)?.transition?.delayChildren;z.delay=IR(m.enteringChildren,e,I)}S.push({animation:M,options:z})}}),w.size){const L={},P=E();let N=P?.transition;w.forEach((A,H)=>{A&&(N={...N||e.getDefaultTransition(),[H]:A});const Y=e.getValue(H);Y&&(Y.liveStyle=!0);const W=P&&!Array.isArray(v)?P[H]:void 0,K=e.getBaseTargetFromProps(d,H);L[H]=(W!==void 0?W:K!==void 0&&!ai(K)?K:e.initialValues[H]===void 0?e.baseTarget[H]:void 0)??null}),N&&(L.transition=N),S.push({animation:L})}const j=x&&e.blockInitialAnimation||a&&!g&&(d.initial===!1||d.initial===d.animate);return a=o=!1,!j&&S.length?t(S):Promise.resolve()}function u(f,d){if(r[f].isActive===d)return Promise.resolve();e.variantChildren?.forEach(g=>g.animationState?.setActive(f,d)),r[f].isActive=d;const m=c(f);for(const g in r)r[g].protectedKeys={};return m}return{animateChanges:c,setActive:u,setAnimateFunction:f=>{t=f(e)},getState:()=>r,reset:()=>{r=US(),o=!0}}}function Z8(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!TC(t,e):!1}function US(){const e={};for(const t of rh)e[t]={isActive:t==="animate",protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return e}const Zc=b.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function IS(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Q8(...e){return t=>{let r=!1;const a=e.map(o=>{const c=IS(o,t);return!r&&typeof c=="function"&&(r=!0),c});if(r)return()=>{for(let o=0;o{const{width:t,height:r}=e?.getBoundingClientRect()||{};return[t/e?.offsetWidth||1,r/e?.offsetHeight||1]},AC=e=>{let{left:t,top:r}=e.getBoundingClientRect(),a=e;for(;a=a.parentElement||a.parentNode?.host;){const{scrollLeft:u,scrollTop:f}=a;if(u||f){const[d,m]=BS(a);t+=u*d,r+=f*m}if(getComputedStyle(a).position==="fixed")break}const[o,c]=BS(e.offsetParent);return[t/o,r/c]};class eO extends b.Component{getSnapshotBeforeUpdate(t){const r=this.props.getElement();if(sd(r)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const a=r.offsetParent,o=sd(a)&&a.offsetWidth||0,c=sd(a)&&a.offsetHeight||0,u=getComputedStyle(r),f=this.props.sizeRef.current;f.height=parseFloat(u.height),f.width=parseFloat(u.width),f.top=r.offsetTop,f.left=r.offsetLeft,f.right=o-f.width-f.left,f.bottom=c-f.height-f.top,f.direction=u.direction,f.point=AC(r)}return null}componentDidUpdate(){}render(){return this.props.children}}function tO({children:e,isPresent:t,anchorX:r,anchorY:a,root:o,pop:c,popNode:u}){const f=b.useId(),d=b.useRef(null),m=b.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:g}=b.useContext(Zc),v=c!==!1?e.props?.ref??e?.ref:void 0,x=J8(d,v),S=()=>d.current||u?.current?.current,E=w=>{const{width:R,height:T,top:O,left:k,right:j,bottom:L,direction:P}=m.current,N=P==="rtl",A=r==="left"?N?`right:${j}`:`left:${k}`:N?`left:${k}`:`right:${j}`,H=a==="bottom"?`bottom:${L}`:`top:${O}`;w?.insertRule(`[data-motion-pop-id="${f}"]{position:absolute!important;width:${R}px!important;height:${T}px!important;${A}px!important;${H}px!important}`)};return b.useInsertionEffect(()=>{const{width:w,height:R}=m.current,T=S();if(t||c===!1||!T||!w||!R)return;T.dataset.motionPopId=f;const O=T.ownerDocument,k=O.createElement("style");g&&(k.nonce=g);const j=o??O.head;j.appendChild(k),E(k.sheet);let L=0,P=0;return Xc.setup(()=>{const[N,A]=AC(T);L=m.current.point[0]-N,P=m.current.point[1]-A}),Xc.read(()=>{const{sheet:N}=k;if(!N||!L&&!P)return;const A=m.current;A.left+=L,A.right-=L,A.top+=P,A.bottom-=P,N.deleteRule(0),E(N)}),()=>{T.removeAttribute("data-motion-pop-id"),j.contains(k)&&j.removeChild(k)}},[t]),y.jsx(eO,{isPresent:t,getElement:S,sizeRef:m,pop:c,children:c===!1?e:b.cloneElement(e,{ref:x})})}const nO=({children:e,initial:t,isPresent:r,onExitComplete:a,custom:o,presenceAffectsLayout:c,mode:u,anchorX:f,anchorY:d,root:m})=>{const g=hu(iO),v=b.useId(),x=b.useRef(),S=b.useRef(r),E=b.useRef(a);Bc(()=>{S.current=r,E.current=a});let w=!0,R=b.useMemo(()=>(w=!1,{id:v,initial:t,isPresent:r,custom:o,onExitComplete:T=>{g.set(T,!0);for(const O of g.values())if(!O)return;a&&a()},register:(T,O)=>(g.set(T,!1),O&&O.parent?.presenceContext?.id!==v&&(x.current=O),()=>{g.delete(T),!S.current&&!g.size&&E.current?.()})}),[r,g,a]);return c&&w&&(R={...R}),b.useMemo(()=>{g.forEach((T,O)=>g.set(O,!1))},[r]),b.useEffect(()=>{!r&&!g.size&&a&&a()},[r]),e=y.jsx(tO,{pop:u==="popLayout",isPresent:r,anchorX:f,anchorY:d,root:m,popNode:x,children:e}),y.jsx(th.Provider,{value:R,children:e})};function iO(){return new Map}function MC(e=!0){const t=b.useContext(th);if(t===null)return[!0,null];const{isPresent:r,onExitComplete:a,register:o}=t,c=b.useId();b.useEffect(()=>{if(e)return o(c)},[e]);const u=b.useCallback(()=>e&&a&&a(c),[c,a,e]);return!r&&a?[!1,u]:[!0]}const pc=e=>e.key||"";function HS(e){const t=[];return b.Children.forEach(e,r=>{b.isValidElement(r)&&t.push(r)}),t}const Ay=({children:e,custom:t,initial:r=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:c="sync",propagate:u=!1,anchorX:f="left",anchorY:d="top",root:m})=>{const[g,v]=MC(u),x=b.useMemo(()=>HS(e),[e]),S=u&&!g?[]:x.map(pc),E=b.useRef(!0),w=hu(()=>new Map),R=b.useRef(new Set),[T,O]=b.useState(x),[k,j]=b.useState(x);Bc(()=>{u&&!g&&!k.length&&v?.()},[g,u,k.length,v]);const L=b.useRef();b.useEffect(()=>()=>{const A=L.current;L.current=void 0,A?.()},[k]),Bc(()=>{E.current=!1;for(let A=0;Aw.get(pc(Y)))?A=x:c==="wait"&&(A=P),j(HS(A)),O(x),null}const{forceRender:N}=b.useContext(G0);return y.jsx(y.Fragment,{children:k.map(A=>{const H=pc(A),Y=u&&!g?!1:x===k||S.includes(H),W=()=>{if(R.current.has(H))return;if(w.has(H))R.current.add(H),w.set(H,!0);else return;let K=!0;w.forEach($=>{$||(K=!1)}),K&&(N?.(),O([]),u&&v?.(),L.current=a)};return y.jsx(nO,{isPresent:Y,initial:!E.current||r?void 0:!1,custom:t,presenceAffectsLayout:o,mode:c,root:m,onExitComplete:Y?void 0:W,anchorX:f,anchorY:d,children:A},H)})})},jC=b.createContext({strict:!1}),FS={animation:["variants",...rh],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let YS=!1;function rO(){if(YS)return;const e={};for(const t in FS)e[t]={isEnabled:r=>FS[t].some(a=>!!r[a])};mC(e),YS=!0}function OC(){return rO(),c8()}function aO(e){const t=OC();for(const r in e)t[r]={...t[r],...e[r]};mC(t)}function sO({children:e,...t}){const r=b.useContext(Zc);t={...r,...t},t.transition=py(t.transition,r.transition),t.isStatic=hu(()=>t.isStatic);const a=b.useMemo(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion,t.skipAnimations,t.isValidProp]);return y.jsx(Zc.Provider,{value:a,children:e})}const sh=b.createContext({});function oO(e,t){if(ah(e)){const{initial:r,animate:a}=e;return{initial:r===!1||$c(r)?r:void 0,animate:$c(a)?a:void 0}}return e.inherit!==!1?t:{}}function lO(e){const{initial:t,animate:r}=oO(e,b.useContext(sh));return b.useMemo(()=>({initial:t,animate:r}),[qS(t),qS(r)])}function qS(e){return Array.isArray(e)?e.join(" "):e}const My=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function NC(e,t,r){for(const a in t)!ai(t[a])&&!yC(a,r)&&(e[a]=t[a])}function cO({transformTemplate:e},t){return b.useMemo(()=>{const r=My();return Ey(r,t,e),Object.assign({},r.vars,r.style)},[t])}function uO(e,t){const r=e.style||{},a={};return NC(a,r,e),Object.assign(a,cO(e,t)),a}function fO(e,t){const r={},a=uO(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=a,r}const DC=()=>({...My(),attrs:{}});function dO(e,t,r,a){const o=b.useMemo(()=>{const c=DC();return WR(c,t,RC(a),e.transformTemplate,e.style),{...c.attrs,style:{...c.style}}},[t]);if(e.style){const c={};return NC(c,e.style,e),{...o,style:{...c,...o.style}}}return o}const hO=new Set(["animate","exit","variants","initial","style","values","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","tap","propagate","ignoreStrict","viewport"]);function _d(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||hO.has(e)}function mO(e,t){return e.startsWith("on")?!_d(e):t?.(e)??!_d(e)}function pO(e,t,r,a){const o={};for(const c in e)c==="values"&&typeof e.values=="object"||ai(e[c])||(mO(c,a)||r===!0&&_d(c)||!t&&!_d(c)||e.draggable&&c.startsWith("onDrag"))&&(o[c]=e[c]);return o}const gO=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function jy(e){return typeof e!="string"||e.includes("-")?!1:!!(gO.indexOf(e)>-1||/[A-Z]/u.test(e))}function yO(e,t,r,{latestValues:a},o,c=!1,u,f){const m=(u??jy(e)?dO:fO)(t,a,o,e),g=pO(t,typeof e=="string",c,f),v=e!==b.Fragment?{...g,...m,ref:r}:{},{children:x}=t,S=b.useMemo(()=>ai(x)?x.get():x,[x]);return b.createElement(e,{...v,children:S})}function vO({scrapeMotionValuesFromProps:e,createRenderState:t},r,a,o){return{latestValues:bO(r,a,o,e),renderState:t()}}function bO(e,t,r,a){const o={},c=a(e,{});for(const x in c)o[x]=ld(c[x]);let{initial:u,animate:f}=e;const d=ah(e),m=dC(e);t&&m&&!d&&e.inherit!==!1&&(u===void 0&&(u=t.initial),f===void 0&&(f=t.animate));let g=r?r.initial===!1:!1;g=g||u===!1;const v=g?f:u;if(v&&typeof v!="boolean"&&!ih(v)){const x=Array.isArray(v)?v:[v];for(let S=0;S(t,r)=>{const a=b.useContext(sh),o=b.useContext(th),c=()=>vO(e,t,a,o);return r?c():hu(c)},xO=LC({scrapeMotionValuesFromProps:Cy,createRenderState:My}),SO=LC({scrapeMotionValuesFromProps:CC,createRenderState:DC}),wO=Symbol.for("motionComponentSymbol");function EO(e,t,r){const a=b.useRef(r);b.useInsertionEffect(()=>{a.current=r});const o=b.useRef(null);return b.useCallback(c=>{c&&e.onMount?.(c),t&&(c?t.mount(c):t.unmount());const u=a.current;if(typeof u=="function")if(c){const f=u(c);typeof f=="function"&&(o.current=f)}else o.current?(o.current(),o.current=null):u(c);else u&&(u.current=c)},[t])}const kC=b.createContext({});function RO(e,t,r,a,o,c){const{visualElement:u}=b.useContext(sh),f=b.useContext(jC),d=b.useContext(th),m=b.useContext(Zc),g=m.reducedMotion,v=m.skipAnimations,x=b.useRef(null),S=b.useRef(!1);a=a||f.renderer,!x.current&&a&&(x.current=a(e,{visualState:t,parent:u,props:r,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:g,skipAnimations:v,isSVG:c}),S.current&&x.current&&(x.current.manuallyAnimateOnMount=!0));const E=x.current,w=b.useContext(kC);E&&!E.projection&&o&&(E.type==="html"||E.type==="svg")&&o.create(E,r,w),b.useInsertionEffect(()=>{E&&E.props!==r&&E.update(r,d)});const R=r[YR],T=b.useRef(!!R&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(R)&&window.MotionHasOptimisedAnimation?.(R));return Bc(()=>{!S.current||!E||(E.animationState?.animateChanges(),E.enteringChildren=void 0)},[]),Bc(()=>{S.current=!0,E&&(window.MotionIsMounted=!0,E.updateFeatures(),E.scheduleRenderMicrotask(),T.current&&E.animationState&&E.animationState.animateChanges())}),b.useEffect(()=>{E&&(!T.current&&E.animationState&&E.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(R)}),T.current=!1),E.enteringChildren=void 0)}),E}function ig(e,{forwardMotionProps:t=!1,type:r}={},a,o){a&&aO(a);const c=r?r==="svg":jy(e),u=c?SO:xO;function f(m,g){let v;const x=CO(m);hu(()=>!!ud.current?.sharedNodes.get(x)?.lead&&m.initial)&&(m={...m,initial:!1});const S={...b.useContext(Zc),...m,layoutId:x},{isStatic:E,isValidProp:w}=S,R=lO(m),T=u(m,E);if(!E&&typeof window<"u"){TO();const O=AO(S);R.visualElement=RO(e,T,S,o,O.ProjectionNode,c),(O.isEnabled||R.visualElement?.projection?.options.layoutId)&&(v=O.MeasureLayout)}return y.jsxs(sh.Provider,{value:R,children:[v&&R.visualElement?y.jsx(v,{visualElement:R.visualElement,...S}):null,yO(e,m,EO(T,R.visualElement,g),T,E,t,c,w)]})}f.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const d=b.forwardRef(f);return d[wO]=e,d}function CO({layoutId:e}){const t=b.useContext(G0).id;return t&&e!==void 0?t+"-"+e:e}function TO(e,t){b.useContext(jC).strict}function AO(e){const t=OC(),{drag:r,layout:a}=t;if(!r&&!a)return{};const o={...r,...a};return{MeasureLayout:o.MeasureLayout,isEnabled:r?.isEnabled(e)||a?.isEnabled(e),ProjectionNode:o.ProjectionNode}}function MO(e,t){if(typeof Proxy>"u")return ig;const r=new Map,a=(c,u)=>ig(c,u,e,t),o=(c,u)=>a(c,u);return new Proxy(o,{get:(c,u)=>u==="create"?a:(r.has(u)||r.set(u,ig(u,void 0,e,t)),r.get(u))})}const jO=(e,t)=>t.isSVG??jy(e)?new X8(t):new d8(t,{allowProjection:e!==b.Fragment});class OO extends xs{constructor(t){super(t),t.animationState||(t.animationState=W8(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ih(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){this.node.getProps().animate!==this.node.prevProps?.animate&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let NO=0;class DO extends xs{constructor(){super(...arguments),this.id=NO++}update(){const{presenceContext:t,animationState:r}=this.node;if(!t||!r)return;const{isPresent:a,onExitComplete:o}=t;if(a===!this.exit)return;if(a){if(this.exit===!0){const{initial:u}=this.node.getProps();if(u&&!Array.isArray(u)){const{transition:f,transitionEnd:d,...m}=Ws(this.node,u)||{};for(const g in m)this.node.getValue(g)?.jump(m[g])}this.node.blockInitialAnimation=!1,r.reset(),r.animateChanges()}else r.setActive("exit",!1);this.exit=void 0;return}const c=this.exit=r.setActive("exit",!0);o&&c.then(()=>{this.exit===c&&(this.exit=!0,o(this.id))})}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id,this.node)),this.update()}unmount(){}}const LO={animation:{Feature:OO},exit:{Feature:DO}};class kO extends xs{constructor(t){super(t),this.removeGroupControls=Dr,this.removeListeners=Dr,this.controls=new _8(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Dr}update(){const{dragControls:t,drag:r}=this.node.getProps(),{dragControls:a,drag:o}=this.node.prevProps||{};t!==a&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls))),o&&!r&&this.controls.stop(void 0,void 0,o)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const rg=e=>(t,r)=>{e&&Xt.update(()=>e(t,r),!1,!0)};class zO extends xs{constructor(){super(...arguments),this.removePointerDownListener=Dr}onPointerDown(t){this.session=new bC(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:this.node.current?.ownerDocument.defaultView})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:r,onPan:a,onPanEnd:o}=this.node.getProps();return{onSessionStart:rg(t),onStart:rg(r),onMove:rg(a),onEnd:(c,u)=>{delete this.session,o&&Xt.postRender(()=>o(c,u))}}}mount(){this.removePointerDownListener=Pc(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}}let ag=!1;const GS=({layout:e,layoutDependency:t,layoutAnchor:r})=>({layout:e,layoutDependency:t,layoutAnchor:r,animationType:typeof e=="string"?e:"both"}),KS=(e,t)=>{const{snapshot:r}=e,a=e.getStack();a?.remove(e);const o=a?.lead;if(a?.prevLead===e&&o.resumeFrom===e&&(o.resumeFrom=o.currentAnimation=e.resumingFrom=void 0),e.options.layoutId=t,!t){e.needsShow=!0;return}return e.root.registerSharedNode(t,e),()=>{const{resumeFrom:c}=e;c?.isPresent!==!1&&e.getStack().members.includes(c)&&(c.hide(),e.resumeFrom=void 0,e.snapshot=r)}};class PO extends b.Component{componentDidMount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:a,layoutId:o}=this.props,{projection:c}=t;c&&(r.group?.add(c),o&&a?.register?.(c),ag&&c.root.didUpdate(),c.options.layoutId!==o&&KS(c,o)?.(),c.addEventListener("animationComplete",()=>this.safeToRemove()),c.setOptions({...c.options,...GS(this.props),onExitComplete:()=>this.safeToRemove()})),cd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:r,layoutId:a,visualElement:o,drag:c,isPresent:u}=this.props,{projection:f}=o;return f&&(f.isPresent=u,this.takeOver=t.layoutId!==a?(f.willUpdate(),KS(f,a)):void 0,f.setOptions({...f.options,...GS(this.props)}),ag=!0,c||t.layoutDependency!==r||r===void 0||t.isPresent!==u?f.willUpdate():this.safeToRemove(),t.isPresent!==u&&(u?f.promote():f.relegate()||Xt.postRender(()=>{f.getStack()?.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(this.takeOver?.(),t.root.didUpdate(),Xc.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:a}=this.props,{projection:o}=t;ag=!0,o&&(o.scheduleCheckAfterUnmount(),r.group?.remove(o),a?.deregister?.(o))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}}function zC(e){const[t,r]=MC(),a=b.useContext(G0);return y.jsx(PO,{...e,layoutGroup:a,switchLayoutGroup:b.useContext(kC),isPresent:t,safeToRemove:r})}const _O={pan:{Feature:zO},drag:{Feature:kO,ProjectionNode:fC,MeasureLayout:zC}};function d0(e,t,r,a,o){const{props:c}=e,u="while"+r;!o&&e.animationState&&c[u]&&e.animationState.setActive(u,a==="Start");const f=c["on"+r+a];f&&Xt.postRender(()=>f(t,Ty(t)))}class VO extends xs{mount(){const{current:t}=this.node;t&&(this.unmount=B8(t,(r,a)=>(d0(this.node,a,"Hover","Start"),o=>d0(this.node,o,"Hover","End"))))}unmount(){}}class UO extends xs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ol(to(this.node.current,"focus",()=>this.onFocus()),to(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function sg(e,t,r,a){e.current instanceof HTMLButtonElement&&e.current.disabled||d0(e,t,"Tap",r,a)}class IO extends xs{constructor(){super(...arguments),this.options={}}mount(){const{current:t}=this.node;t&&(this.update(),this.unmount=G8(t,(r,a)=>(sg(this.node,a,"Start"),{onComplete:(o,{success:c})=>sg(this.node,o,c?"":"Cancel"),onRepeat:()=>sg(this.node,a,"",!0)}),this.options))}update(){const{options:t,node:r}=this,{globalTapTarget:a,propagate:o,tap:c}=r.props;for(const u in t)delete t[u];Object.assign(t,c,{useGlobalTarget:a,stopPropagation:o?.tap===!1})}unmount(){}}const h0=new WeakMap,og=new WeakMap,BO=e=>{const t=h0.get(e.target);t&&t(e)},HO=e=>{e.forEach(BO)};function FO({root:e,...t}){const r=e||document;og.has(r)||og.set(r,{});const a=og.get(r),o=JSON.stringify(t);return a[o]||(a[o]=new IntersectionObserver(HO,{root:e,...t})),a[o]}function YO(e,t,r){const a=FO(t);return h0.set(e,r),a.observe(e),()=>{h0.delete(e),a.unobserve(e)}}const qO={some:0,all:1};class GO extends xs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:r,margin:a,amount:o="some",once:c}=t,u={root:r?r.current:void 0,rootMargin:a,threshold:typeof o=="number"?o:qO[o]},f=d=>{const{isIntersecting:m}=d;if(this.isInView===m||(this.isInView=m,c&&!m&&this.hasEnteredView))return;m&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",m);const{onViewportEnter:g,onViewportLeave:v}=this.node.getProps(),x=m?g:v;x&&x(d)};this.stopObserver=YO(this.node.current,u,f)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:r}=this.node;["amount","margin","root"].some(KO(t,r))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function KO({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}const XO={inView:{Feature:GO},tap:{Feature:IO},focus:{Feature:UO},hover:{Feature:VO}},$O={layout:{ProjectionNode:fC,MeasureLayout:zC}},WO=Object.assign({},LO,XO,_O,$O),ZO=MO(WO,jO);function QO(){!Ry.current&&hC();const[e]=b.useState(kd.current);return e}const Qc=ZO;var PC=e=>{throw TypeError(e)},_C=(e,t,r)=>t.has(e)||PC("Cannot "+r),fr=(e,t,r)=>(_C(e,t,"read from private field"),r?r.call(e):t.get(e)),Oc=(e,t,r)=>t.has(e)?PC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Fr=(e,t,r,a)=>(_C(e,t,"write to private field"),t.set(e,r),r),oh=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,lh=/^[\\/]{2}/;function VC(e,t){return t+e.replace(/\\/g,"/")}var XS="popstate";function $S(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function JO(e={}){function t(a,o){let c=o.state?.masked,{pathname:u,search:f,hash:d}=c||a.location;return Jc("",{pathname:u,search:f,hash:d},o.state&&o.state.usr||null,o.state&&o.state.key||"default",c?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,o){return typeof o=="string"?o:xi(o)}return tN(t,r,null,e)}function gt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function wn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function eN(){return Math.random().toString(36).substring(2,10)}function WS(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Jc(e,t,r=null,a,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Qr(t):t,state:r,key:t&&t.key||a||eN(),mask:o}}function xi({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Qr(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function tN(e,t,r,a={}){let{window:o=document.defaultView,v5Compat:c=!1}=a,u=o.history,f="POP",d=null,m=g();m==null&&(m=0,u.replaceState({...u.state,idx:m},""));function g(){return(u.state||{idx:null}).idx}function v(){f="POP";let R=g(),T=R==null?null:R-m;m=R,d&&d({action:f,location:w.location,delta:T})}function x(R,T){f="PUSH";let O=$S(R)?R:Jc(w.location,R,T);m=g()+1;let k=WS(O,m),j=w.createHref(O.mask||O);try{u.pushState(k,"",j)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;o.location.assign(j)}c&&d&&d({action:f,location:w.location,delta:1})}function S(R,T){f="REPLACE";let O=$S(R)?R:Jc(w.location,R,T);m=g();let k=WS(O,m),j=w.createHref(O.mask||O);u.replaceState(k,"",j),c&&d&&d({action:f,location:w.location,delta:0})}function E(R){return UC(o,R)}let w={get action(){return f},get location(){return e(o,u)},listen(R){if(d)throw new Error("A history only accepts one active listener");return o.addEventListener(XS,v),d=R,()=>{o.removeEventListener(XS,v),d=null}},createHref(R){return t(o,R)},createURL:E,encodeLocation(R){let T=E(R);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:x,replace:S,go(R){return u.go(R)}};return w}function UC(e,t,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),gt(a,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:xi(t);return o=o.replace(/ $/,"%20"),!r&&lh.test(o)&&(o=a+o),new URL(o,a)}var Nc,ZS=class{constructor(e){if(Oc(this,Nc,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(fr(this,Nc).has(e))return fr(this,Nc).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){fr(this,Nc).set(e,t)}};Nc=new WeakMap;var nN=new Set(["lazy","caseSensitive","path","id","index","children"]);function iN(e){return nN.has(e)}var rN=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function aN(e){return rN.has(e)}function sN(e){return e.index===!0}function eu(e,t,r=[],a={},o=!1){return e.map((c,u)=>{let f=[...r,String(u)],d=typeof c.id=="string"?c.id:f.join("-");if(gt(c.index!==!0||!c.children,"Cannot specify children on an index route"),gt(o||!a[d],`Found a route id collision on id "${d}". Route id's must be globally unique within Data Router usages`),sN(c)){let m={...c,id:d};return a[d]=QS(m,t(m)),m}else{let m={...c,id:d,children:void 0};return a[d]=QS(m,t(m)),c.children&&(m.children=eu(c.children,t,f,a,o)),m}})}function QS(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function IC(e,t,r="/"){return Mr(e,t,r,!1)}function Mr(e,t,r,a,o){let c=typeof t=="string"?Qr(t):t,u=yr(c.pathname||"/",r);if(u==null)return null;let f=o??md(e),d=null,m=vN(u);for(let g=0;d==null&&g{let g={relativePath:m===void 0?u.path||"":m,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(a)&&d)return;gt(g.relativePath.startsWith(a),`Absolute route path "${g.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(a.length)}let v=pr([a,g.relativePath]),x=r.concat(g);u.children&&u.children.length>0&&(gt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),BC(u.children,t,x,v,d)),!(u.path==null&&!u.index)&&t.push({path:v,score:pN(v,u.index),routesMeta:x.map((S,E)=>{let[w,R]=YC(S.relativePath,S.caseSensitive,E===x.length-1);return{...S,matcher:w,compiledParams:R}})})};return e.forEach((u,f)=>{if(u.path===""||!u.path?.includes("?"))c(u,f);else for(let d of HC(u.path))c(u,f,!0,d)}),t}function HC(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,o=r.endsWith("?"),c=r.replace(/\?$/,"");if(a.length===0)return o?[c,""]:[c];let u=HC(a.join("/")),f=[];return f.push(...u.map(d=>d===""?c:[c,d].join("/"))),o&&f.push(...u),f.map(d=>e.startsWith("/")&&d===""?"/":d)}function lN(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:gN(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var cN=/^:[\w-]+$/,uN=3,fN=2,dN=1,hN=10,mN=-2,JS=e=>e==="*";function pN(e,t){let r=e.split("/"),a=r.length;return r.some(JS)&&(a+=mN),t&&(a+=fN),r.filter(o=>!JS(o)).reduce((o,c)=>o+(cN.test(c)?uN:c===""?dN:hN),a)}function gN(e,t){return e.length===t.length&&e.slice(0,-1).every((a,o)=>a===t[o])?e[e.length-1]-t[t.length-1]:0}function yN(e,t,r=!1){let{routesMeta:a}=e,o={},c="/",u=[];for(let f=0;f{if(g==="*"){let E=f[x]||"";u=dl(c.slice(0,c.length-E.length),1)}const S=f[x];return v&&!S?m[g]=void 0:m[g]=(S||"").replace(/%2F/g,"/"),m},{}),pathname:c,pathnameBase:u,pattern:e}}function YC(e,t=!1,r=!0){wn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,d,m,g)=>{if(a.push({paramName:f,isOptional:d!=null}),d){let v=g.charAt(m+u.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),a]}function vN(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return wn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function yr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function bN({basename:e,pathname:t}){return t==="/"?e:pr([e,t])}var Oy=e=>oh.test(e);function xN(e,t="/"){let{pathname:r,search:a="",hash:o=""}=typeof e=="string"?Qr(e):e,c;return r?(r=Ny(r),r.startsWith("/")||r.startsWith("\\")?c=ew(r.substring(1),"/"):c=ew(r,t)):c=t,{pathname:c,search:wN(a),hash:EN(o)}}function ew(e,t){let r=dl(t).split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function lg(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function qC(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function ch(e){let t=qC(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function gu(e,t,r,a=!1){let o;typeof e=="string"?o=Qr(e):(o={...e},gt(!o.pathname||!o.pathname.includes("?"),lg("?","pathname","search",o)),gt(!o.pathname||!o.pathname.includes("#"),lg("#","pathname","hash",o)),gt(!o.search||!o.search.includes("#"),lg("#","search","hash",o)));let c=e===""||o.pathname==="",u=c?"/":o.pathname,f;if(u==null)f=r;else{let v=t.length-1;if(!a&&u.startsWith("..")){let x=u.split("/");for(;x[0]==="..";)x.shift(),v-=1;o.pathname=x.join("/")}f=v>=0?t[v]:"/"}let d=xN(o,f),m=u&&u!=="/"&&u.endsWith("/"),g=(c||u===".")&&r.endsWith("/");return!d.pathname.endsWith("/")&&(m||g)&&(d.pathname+="/"),d}var Ny=e=>e.replace(/[\\/]{2,}/g,"/"),pr=e=>Ny(e.join("/"));function dl(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}var SN=e=>dl(e).replace(/^\/*/,"/"),wN=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,EN=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,RN=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],yu=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function tu(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function vu(e){let t=e.map(r=>r.route.path).filter(Boolean);return pr(t)||"/"}var GC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function KC(e,t){let r=e;if(typeof r!="string"||!oh.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,o=!1;if(GC)try{let c=new URL(window.location.href),u=lh.test(r)?new URL(VC(r,c.protocol)):new URL(r),f=yr(u.pathname,t);u.origin===c.origin&&f!=null?r=f+u.search+u.hash:o=!0}catch{wn(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:o,to:r}}var cs=Symbol("Uninstrumented");function CN(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:t.id,index:t.index,path:t.path,instrument(c){let u=Object.keys(r);for(let f of u)c[f]&&r[f].push(c[f])}}));let a={};if(typeof t.lazy=="function"&&r.lazy.length>0){let o=Zo(r.lazy,t.lazy,()=>{});o&&(a.lazy=o)}if(typeof t.lazy=="object"){let o=t.lazy;["middleware","loader","action"].forEach(c=>{let u=o[c],f=r[`lazy.${c}`];if(typeof u=="function"&&f.length>0){let d=Zo(f,u,()=>{});d&&(a.lazy=Object.assign(a.lazy||{},{[c]:d}))}})}return["loader","action"].forEach(o=>{let c=t[o];if(typeof c=="function"&&r[o].length>0){let u=c[cs]??c,f=Zo(r[o],u,(...d)=>tw(d[0]));f&&(o==="loader"&&u.hydrate===!0&&(f.hydrate=!0),f[cs]=u,a[o]=f)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(a.middleware=t.middleware.map(o=>{let c=o[cs]??o,u=Zo(r.middleware,c,(...f)=>tw(f[0]));return u?(u[cs]=c,u):o})),a}function TN(e,t){let r={navigate:[],fetch:[]};if(t.forEach(a=>a({instrument(o){let c=Object.keys(o);for(let u of c)o[u]&&r[u].push(o[u])}})),r.navigate.length>0){let a=e.navigate[cs]??e.navigate,o=Zo(r.navigate,a,(...c)=>{let[u,f]=c;return{to:typeof u=="number"||typeof u=="string"?u:u?xi(u):".",...nw(e,f??{})}});o&&(o[cs]=a,e.navigate=o)}if(r.fetch.length>0){let a=e.fetch[cs]??e.fetch,o=Zo(r.fetch,a,(...c)=>{let[u,,f,d]=c;return{href:f??".",fetcherKey:u,...nw(e,d??{})}});o&&(o[cs]=a,e.fetch=o)}return e}function Zo(e,t,r){return e.length===0?null:async(...a)=>{let o=await XC(e,r(...a),()=>t(...a),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function XC(e,t,r,a){let o=e[a],c;if(o){let u,f=async()=>(u?console.error("You cannot call instrumented handlers more than once"):u=XC(e,t,r,a-1),c=await u,gt(c,"Expected a result"),c.type==="error"&&c.value instanceof Error?{status:"error",error:c.value}:{status:"success",error:void 0});try{await o(f,t)}catch(d){console.error("An instrumentation function threw an error:",d)}u||await f(),await u}else try{c={type:"success",value:await r()}}catch(u){c={type:"error",value:u}}return c||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function tw(e){let{request:t,context:r,params:a,pattern:o}=e;return{request:AN(t),params:{...a},pattern:o,context:MN(r)}}function nw(e,t){return{currentUrl:xi(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function AN(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function MN(e){if(ON(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var jN=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ON(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===jN}var iw=new URL("http://localhost");function Dy(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),iw)}catch{return iw}}function cg(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function NN(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}function el(e,t,r,a){let o=null;try{o=e==null?null:new URL(e,r)}catch{}let c=new URL(t,r),u=o!=null&&!cg(o,r),f=!cg(c,r);if(a==="reject"){if(u||f)throw new Error("External navigation is not allowed")}else if(f&&(o==null||!NN(e,o)||!cg(o,c)))throw new Error("External navigation is not allowed")}var $C=["POST","PUT","PATCH","DELETE"],DN=new Set($C),LN=["GET",...$C],kN=new Set(LN),WC=new Set([301,302,303,307,308]),zN=new Set([307,308]),ug={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},PN={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},gc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},_N=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),ZC="remix-router-transitions",QC=Symbol("ResetLoaderData"),Ys,Ho,ss,Fo,VN=class{constructor(e){Oc(this,Ys),Oc(this,Ho),Oc(this,ss),Oc(this,Fo),Fr(this,Ys,e),Fr(this,Ho,md(e))}get stableRoutes(){return fr(this,Ys)}get activeRoutes(){return fr(this,ss)??fr(this,Ys)}get branches(){return fr(this,Fo)??fr(this,Ho)}get hasHMRRoutes(){return fr(this,ss)!=null}setRoutes(e){Fr(this,Ys,e),Fr(this,Ho,md(e))}setHmrRoutes(e){Fr(this,ss,e),Fr(this,Fo,md(e))}commitHmrRoutes(){fr(this,ss)&&(Fr(this,Ys,fr(this,ss)),Fr(this,Ho,fr(this,Fo)),Fr(this,ss,void 0),Fr(this,Fo,void 0))}};Ys=new WeakMap;Ho=new WeakMap;ss=new WeakMap;Fo=new WeakMap;function UN(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";gt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],o=e.mapRouteProperties||_N,c=o;if(e.instrumentations){let U=e.instrumentations;c=G=>({...o(G),...CN(U.map(te=>te.route).filter(Boolean),G)})}let u={},f=new VN(eu(e.routes,c,void 0,u)),d=e.basename||"/";d.startsWith("/")||(d=`/${d}`);let m=e.dataStrategy||YN,g={...e.future},v=null,x=new Set,S=null,E=null,w=null,R=null,T=e.hydrationData!=null,O=Mr(f.activeRoutes,e.history.location,d,!1,f.branches),k=!1,j=null,L,P;if(O==null&&!e.patchRoutesOnNavigation){let U=dr(404,{pathname:e.history.location.pathname}),{matches:G,route:te}=Pf(f.activeRoutes);L=!0,P=!L,O=G,j={[te.id]:U}}else if(O&&!e.hydrationData&&Jt(O,f.activeRoutes,e.history.location.pathname).active&&(O=null),O)if(O.some(U=>U.route.lazy))L=!1,P=!L;else if(!O.some(U=>Ly(U.route)))L=!0,P=!L;else{let U=e.hydrationData?e.hydrationData.loaderData:null,G=e.hydrationData?e.hydrationData.errors:null,te=O;if(G){let he=O.findIndex(ge=>G[ge.route.id]!==void 0);te=te.slice(0,he+1)}P=!1,L=!0,te.forEach(he=>{let ge=JC(he.route,U,G);P=P||ge.renderFallback,L=L&&!ge.shouldLoad})}else{L=!1,P=!L,O=[];let U=Jt(null,f.activeRoutes,e.history.location.pathname);U.active&&U.matches&&(k=!0,O=U.matches)}let N,A={historyAction:e.history.action,location:e.history.location,matches:O,initialized:L,renderFallback:P,navigation:ug,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||j,fetchers:new Map,blockers:new Map},H="POP",Y=null,W=!1,K,$=!1,ee=new Map,ie=null,V=!1,X=!1,Q=new Set,F=new Map,_=0,M=-1,z=new Map,I=new Set,B=new Map,Z=new Map,re=new Set,fe=new Map,pe,ce=null;function Ae(){if(v=e.history.listen(({action:U,location:G,delta:te})=>{if(pe){pe(),pe=void 0;return}wn(fe.size===0||te!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let he=un({currentLocation:A.location,nextLocation:G,historyAction:U});if(he&&te!=null){let ge=new Promise(Le=>{pe=Le});e.history.go(te*-1),Rt(he,{state:"blocked",location:G,proceed(){Rt(he,{state:"proceeding",proceed:void 0,reset:void 0,location:G}),ge.then(()=>e.history.go(te))},reset(){let Le=new Map(A.blockers);Le.set(he,gc),Re({blockers:Le})}}),Y?.resolve(),Y=null;return}return Qe(U,G)}),r){cD(t,ee);let U=()=>uD(t,ee);t.addEventListener("pagehide",U),ie=()=>t.removeEventListener("pagehide",U)}return A.initialized||Qe("POP",A.location,{initialHydration:!0}),N}function ke(){v&&v(),ie&&ie(),x.clear(),K&&K.abort(),A.fetchers.forEach((U,G)=>Ot(A.fetchers,G)),A.blockers.forEach((U,G)=>bn(G))}function we(U){if(x.add(U),S){let{newErrors:G}=S;S=null,U(A,{deletedFetchers:[],newErrors:G,viewTransitionOpts:void 0,flushSync:!1})}return()=>x.delete(U)}function Re(U,G={}){U.matches&&(U.matches=U.matches.map(ge=>{let Le=u[ge.route.id],Ce=ge.route;return Ce.element!==Le.element||Ce.errorElement!==Le.errorElement||Ce.hydrateFallbackElement!==Le.hydrateFallbackElement?{...ge,route:Le}:ge})),A={...A,...U};let te=[],he=[];A.fetchers.forEach((ge,Le)=>{ge.state==="idle"&&(re.has(Le)?te.push(Le):he.push(Le))}),re.forEach(ge=>{!A.fetchers.has(ge)&&!F.has(ge)&&te.push(ge)}),x.size===0&&(S={newErrors:U.errors??null}),[...x].forEach(ge=>ge(A,{deletedFetchers:te,newErrors:U.errors??null,viewTransitionOpts:G.viewTransitionOpts,flushSync:G.flushSync===!0})),te.forEach(ge=>Ot(A.fetchers,ge)),he.forEach(ge=>A.fetchers.delete(ge))}function ye(U,G,{flushSync:te}={}){let he=A.actionData!=null&&A.navigation.formMethod!=null&&ci(A.navigation.formMethod)&&A.navigation.state==="loading"&&U.state?._isRedirect!==!0,ge;G.actionData?Object.keys(G.actionData).length>0?ge=G.actionData:ge=null:he?ge=A.actionData:ge=null;let Le=G.loaderData?hw(A.loaderData,G.loaderData,G.matches||[],G.errors):A.loaderData,Ce=A.blockers;Ce.size>0&&(Ce=new Map(Ce),Ce.forEach((Pe,tt)=>Ce.set(tt,gc)));let je=V?!1:sn(U,G.matches||A.matches),Ne=W===!0||A.navigation.formMethod!=null&&ci(A.navigation.formMethod)&&U.state?._isRedirect!==!0;f.commitHmrRoutes(),V||H==="POP"||(H==="PUSH"?e.history.push(U,U.state):H==="REPLACE"&&e.history.replace(U,U.state));let Be;if(H==="POP"&&!V&&U!==A.location){let Pe=ee.get(A.location.pathname);Pe&&Pe.has(U.pathname)?Be={currentLocation:A.location,nextLocation:U}:ee.has(U.pathname)&&(Be={currentLocation:U,nextLocation:A.location})}else if($){let Pe=ee.get(A.location.pathname);Pe?Pe.add(U.pathname):(Pe=new Set([U.pathname]),ee.set(A.location.pathname,Pe)),Be={currentLocation:A.location,nextLocation:U}}Re({...G,actionData:ge,loaderData:Le,historyAction:H,location:U,initialized:!0,renderFallback:!1,navigation:ug,revalidation:"idle",restoreScrollPosition:je,preventScrollReset:Ne,blockers:Ce},{viewTransitionOpts:Be,flushSync:te===!0}),H="POP",W=!1,$=!1,V=!1,X=!1,Y?.resolve(),Y=null,ce?.resolve(),ce=null}async function ze(U,G){if(Y?.resolve(),Y=null,typeof U=="number"){Y||(Y=yw());let pt=Y.promise;return e.history.go(U),pt}let te=m0(A.location,A.matches,d,U,G?.fromRouteId,G?.relative),{path:he,submission:ge,error:Le}=rw(!1,te,G),Ce;if(G?.mask){let pt=typeof G.mask=="string"?Qr(G.mask):{...A.location.mask,...G.mask};if(Ce={pathname:pt.pathname??"",search:pt.search??"",hash:pt.hash??""},lh.test(Ce.pathname))throw new Error("External navigation is not allowed");Ce.pathname.startsWith("\\")&&(Ce.pathname=Ce.pathname.replace(/^\\+/,"/")),el(typeof G.mask=="string"?G.mask:xi(G.mask),xi(Ce),e.history.createURL("/"),"reject")}let je=A.location,Ne=Jc(je,he,G&&G.state,void 0,Ce);Ne={...Ne,...e.history.encodeLocation(Ne)},el(U==null?e.history.createHref(A.location):typeof U=="string"?U:xi(U),e.history.createHref(Ne.mask||Ne),e.history.createURL("/"),"reject");let Be=G&&G.replace!=null?G.replace:void 0,Pe="PUSH";Be===!0?Pe="REPLACE":Be===!1||ge!=null&&ci(ge.formMethod)&&ge.formAction===A.location.pathname+A.location.search&&(Pe="REPLACE");let tt=G&&"preventScrollReset"in G?G.preventScrollReset===!0:void 0,Ke=(G&&G.flushSync)===!0,ut=un({currentLocation:je,nextLocation:Ne,historyAction:Pe});if(ut){Rt(ut,{state:"blocked",location:Ne,proceed(){Rt(ut,{state:"proceeding",proceed:void 0,reset:void 0,location:Ne}),ze(U,G)},reset(){let pt=new Map(A.blockers);pt.set(ut,gc),Re({blockers:pt})}});return}await Qe(Pe,Ne,{submission:ge,pendingError:Le,preventScrollReset:tt,replace:G&&G.replace,enableViewTransition:G&&G.viewTransition,flushSync:Ke,callSiteDefaultShouldRevalidate:G&&G.defaultShouldRevalidate})}function Ye(){ce||(ce=yw()),Te(),Re({revalidation:"loading"});let U=ce.promise;return A.navigation.state==="submitting"?U:A.navigation.state==="idle"?(Qe(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),U):(Qe(H||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:$===!0}),U)}async function Qe(U,G,te){K&&K.abort(),K=null,H=U,V=(te&&te.startUninterruptedRevalidation)===!0,ct(A.location,A.matches),W=(te&&te.preventScrollReset)===!0,$=(te&&te.enableViewTransition)===!0;let he=f.activeRoutes,ge=te?.initialHydration&&A.matches&&A.matches.length>0&&!k?A.matches:Mr(he,G,d,!1,f.branches),Le=(te&&te.flushSync)===!0;if(ge&&A.initialized&&!X&&JN(A.location,G)&&!(te&&te.submission&&ci(te.submission.formMethod))){ye(G,{matches:ge},{flushSync:Le});return}let Ce=Jt(ge,he,G.pathname);if(Ce.active&&Ce.matches&&(ge=Ce.matches),!ge){let{error:ft,notFoundMatches:dt,route:Bt}=kt(G.pathname);ye(G,{matches:dt,loaderData:{},errors:{[Bt.id]:ft}},{flushSync:Le});return}let je=te&&te.overrideNavigation?{...te.overrideNavigation,matches:ge,historyAction:U}:void 0;K=new AbortController;let Ne=Yo(e.history,G,K.signal,te&&te.submission),Be=e.getContext?await e.getContext():new ZS,Pe;if(te&&te.pendingError)Pe=[os(ge).route.id,{type:"error",error:te.pendingError}];else if(te&&te.submission&&ci(te.submission.formMethod)){let ft=await nt(Ne,G,te.submission,ge,U,Be,Ce.active,te&&te.initialHydration===!0,{replace:te.replace,flushSync:Le});if(ft.shortCircuited)return;if(ft.pendingActionResult){let[dt,Bt]=ft.pendingActionResult;if(qi(Bt)&&tu(Bt.error)&&Bt.error.status===404){K=null,ye(G,{matches:ft.matches,loaderData:{},errors:{[dt]:Bt.error}});return}}ge=ft.matches||ge,Pe=ft.pendingActionResult,je=fg(G,ge,U,te.submission),Le=!1,Ce.active=!1,Ne=Yo(e.history,Ne.url,Ne.signal)}let{shortCircuited:tt,matches:Ke,loaderData:ut,errors:pt,workingFetchers:It}=await De(Ne,G,ge,U,Be,Ce.active,je,te&&te.submission,te&&te.fetcherSubmission,te&&te.replace,te&&te.initialHydration===!0,Le,Pe,te&&te.callSiteDefaultShouldRevalidate);tt||(K=null,ye(G,{matches:Ke||ge,...mw(Pe),loaderData:ut,errors:pt,...It?{fetchers:It}:{}}))}async function nt(U,G,te,he,ge,Le,Ce,je,Ne={}){Te();let Be=oD(G,he,ge,te);if(Re({navigation:Be},{flushSync:Ne.flushSync===!0}),Ce){let Ke=await _t(he,G.pathname,U.signal);if(Ke.type==="aborted")return{shortCircuited:!0};if(Ke.type==="error"){if(Ke.partialMatches.length===0){let{matches:pt,route:It}=Pf(f.activeRoutes);return{matches:pt,pendingActionResult:[It.id,{type:"error",error:Ke.error}]}}let ut=os(Ke.partialMatches).route.id;return{matches:Ke.partialMatches,pendingActionResult:[ut,{type:"error",error:Ke.error}]}}else if(Ke.matches)he=Ke.matches;else{let{notFoundMatches:ut,error:pt,route:It}=kt(G.pathname);return{matches:ut,pendingActionResult:[It.id,{type:"error",error:pt}]}}}let Pe,tt=pd(he,G);if(!tt.route.action&&!tt.route.lazy)Pe={type:"error",error:dr(405,{method:U.method,pathname:G.pathname,routeId:tt.route.id})};else{let Ke=tl(c,u,U,G,he,tt,je?[]:a,Le),ut=await be(U,G,Ke,Le,null);if(Pe=ut[tt.route.id],!Pe){for(let pt of he)if(ut[pt.route.id]){Pe=ut[pt.route.id];break}}if(U.signal.aborted)return{shortCircuited:!0}}if(Xs(Pe)){let Ke;return Ne&&Ne.replace!=null?Ke=Ne.replace:Ke=uw(Pe.response.headers.get("Location"),new URL(U.url),d,e.history)===A.location.pathname+A.location.search,await ue(U,Pe,!0,{submission:te,replace:Ke}),{shortCircuited:!0}}if(qi(Pe)){let Ke=os(he,tt.route.id);return(Ne&&Ne.replace)!==!0&&(H="PUSH"),{matches:he,pendingActionResult:[Ke.route.id,Pe,tt.route.id]}}return{matches:he,pendingActionResult:[tt.route.id,Pe]}}async function De(U,G,te,he,ge,Le,Ce,je,Ne,Be,Pe,tt,Ke,ut){let pt=Ce||fg(G,te,he,je),It=je||Ne||gw(pt),ft=!V&&!Pe;if(Le){if(ft){let qt=Xe(Ke);Re({navigation:pt,...qt!==void 0?{actionData:qt}:{}},{flushSync:tt})}let it=await _t(te,G.pathname,U.signal);if(it.type==="aborted")return{shortCircuited:!0};if(it.type==="error"){if(it.partialMatches.length===0){let{matches:Wn,route:er}=Pf(f.activeRoutes);return{matches:Wn,loaderData:{},errors:{[er.id]:it.error}}}let qt=os(it.partialMatches).route.id;return{matches:it.partialMatches,loaderData:{},errors:{[qt]:it.error}}}else if(it.matches)te=it.matches;else{let{error:qt,notFoundMatches:Wn,route:er}=kt(G.pathname);return{matches:Wn,loaderData:{},errors:{[er.id]:qt}}}}let dt=f.activeRoutes,{dsMatches:Bt,revalidatingFetchers:st}=aw(U,ge,c,u,e.history,A,te,It,G,Pe?[]:a,Pe===!0,X,Q,re,B,I,dt,d,e.patchRoutesOnNavigation!=null,f.branches,Ke,ut);if(M=++_,!e.dataStrategy&&!Bt.some(it=>it.shouldLoad)&&!Bt.some(it=>it.route.middleware&&it.route.middleware.length>0)&&st.length===0){let it=new Map(A.fetchers),qt=mn(it);return ye(G,{matches:te,loaderData:{},errors:Ke&&qi(Ke[1])?{[Ke[0]]:Ke[1].error}:null,...mw(Ke),...qt?{fetchers:it}:{}},{flushSync:tt}),{shortCircuited:!0}}if(ft){let it={};if(!Le){it.navigation=pt;let qt=Xe(Ke);qt!==void 0&&(it.actionData=qt)}st.length>0&&(it.fetchers=Me(st)),Re(it,{flushSync:tt})}st.forEach(it=>{Ft(it.key),it.controller&&F.set(it.key,it.controller)});let Oi=()=>st.forEach(it=>Ft(it.key));K&&K.signal.addEventListener("abort",Oi);let{loaderResults:pn,fetcherResults:On}=await $e(Bt,st,U,G,ge);if(U.signal.aborted)return{shortCircuited:!0};K&&K.signal.removeEventListener("abort",Oi),st.forEach(it=>F.delete(it.key));let Xn=_f(pn);if(Xn)return await ue(U,Xn.result,!0,{replace:Be}),{shortCircuited:!0};if(Xn=_f(On),Xn)return I.add(Xn.key),await ue(U,Xn.result,!0,{replace:Be}),{shortCircuited:!0};let _n=new Map(A.fetchers),{loaderData:ta,errors:oi}=dw(A,te,pn,Ke,st,On,_n);Pe&&A.errors&&(oi={...A.errors,...oi});let xr=mn(_n),di=qn(M,_n),Sr=xr||di||st.length>0;return{matches:te,loaderData:ta,errors:oi,...Sr?{workingFetchers:_n}:{}}}function Xe(U){if(U&&!qi(U[1]))return{[U[0]]:U[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function Me(U){let G=new Map(A.fetchers);return U.forEach(te=>{let he=G.get(te.key),ge=yc(void 0,he?he.data:void 0);G.set(te.key,ge)}),G}async function et(U,G,te,he){Ft(U);let ge=(he&&he.flushSync)===!0,Le=f.activeRoutes,Ce=m0(A.location,A.matches,d,te,G,he?.relative),je=Mr(Le,Ce,d,!1,f.branches),Ne=Jt(je,Le,Ce);if(Ne.active&&Ne.matches&&(je=Ne.matches),!je){bt(U,G,dr(404,{pathname:Ce}),{flushSync:ge});return}let{path:Be,submission:Pe,error:tt}=rw(!0,Ce,he);if(tt){bt(U,G,tt,{flushSync:ge});return}let Ke=e.getContext?await e.getContext():new ZS,ut=(he&&he.preventScrollReset)===!0;if(Pe&&ci(Pe.formMethod)){await Et(U,G,Be,je,Ke,Ne.active,ge,ut,Pe,he&&he.defaultShouldRevalidate);return}B.set(U,{routeId:G,path:Be}),await at(U,G,Be,je,Ke,Ne.active,ge,ut,Pe)}async function Et(U,G,te,he,ge,Le,Ce,je,Ne,Be){Te(),B.delete(U);let Pe=A.fetchers.get(U);Oe(U,lD(Ne,Pe),{flushSync:Ce});let tt=new AbortController,Ke=Yo(e.history,te,tt.signal,Ne);if(Le){let xe=await _t(he,new URL(Ke.url).pathname,Ke.signal,U);if(xe.type==="aborted")return;if(xe.type==="error"){bt(U,G,xe.error,{flushSync:Ce});return}else if(xe.matches)he=xe.matches;else{bt(U,G,dr(404,{pathname:te}),{flushSync:Ce});return}}let ut=pd(he,te);if(!ut.route.action&&!ut.route.lazy){let xe=dr(405,{method:Ne.formMethod,pathname:te,routeId:G});bt(U,G,xe,{flushSync:Ce});return}F.set(U,tt);let pt=_,It=tl(c,u,Ke,te,he,ut,a,ge),ft=await be(Ke,te,It,ge,U),dt=ft[ut.route.id];if(!dt){for(let xe of It)if(ft[xe.route.id]){dt=ft[xe.route.id];break}}if(Ke.signal.aborted){F.get(U)===tt&&F.delete(U);return}if(re.has(U)){if(Xs(dt)||qi(dt)){Oe(U,qr(void 0));return}}else{if(Xs(dt))if(F.delete(U),M>pt){Oe(U,qr(void 0));return}else return I.add(U),Oe(U,yc(Ne)),ue(Ke,dt,!1,{fetcherSubmission:Ne,preventScrollReset:je});if(qi(dt)){bt(U,G,dt.error);return}}let Bt=A.navigation.location||A.location,st=Yo(e.history,Bt,tt.signal),Oi=f.activeRoutes,pn=A.navigation.state!=="idle"?Mr(Oi,A.navigation.location,d,!1,f.branches):A.matches;gt(pn,"Didn't find any matches after fetcher action");let On=++_;z.set(U,On);let{dsMatches:Xn,revalidatingFetchers:_n}=aw(st,ge,c,u,e.history,A,pn,Ne,Bt,a,!1,X,Q,re,B,I,Oi,d,e.patchRoutesOnNavigation!=null,f.branches,[ut.route.id,dt],Be),ta=yc(Ne,dt.data),oi=new Map(A.fetchers);oi.set(U,ta),_n.filter(xe=>xe.key!==U).forEach(xe=>{let Ue=xe.key,qe=oi.get(Ue),Je=yc(void 0,qe?qe.data:void 0);oi.set(Ue,Je),Ft(Ue),xe.controller&&F.set(Ue,xe.controller)}),Re({fetchers:oi});let xr=()=>_n.forEach(xe=>Ft(xe.key));tt.signal.addEventListener("abort",xr);let{loaderResults:di,fetcherResults:Sr}=await $e(Xn,_n,st,Bt,ge);if(tt.signal.aborted)return;tt.signal.removeEventListener("abort",xr),z.delete(U),F.delete(U),_n.forEach(xe=>F.delete(xe.key));let it=A.fetchers.has(U),qt=xe=>{if(!it)return xe;let Ue=new Map(xe.fetchers);return Ue.set(U,qr(dt.data)),{...xe,fetchers:Ue}},Wn=_f(di);if(Wn)return A=qt(A),ue(st,Wn.result,!1,{preventScrollReset:je});if(Wn=_f(Sr),Wn)return I.add(Wn.key),A=qt(A),ue(st,Wn.result,!1,{preventScrollReset:je});let er=new Map(A.fetchers);it&&er.set(U,qr(dt.data));let{loaderData:oe,errors:Ee}=dw(A,pn,di,void 0,_n,Sr,er);qn(On,er),A.navigation.state==="loading"&&On>M?(gt(H,"Expected pending action"),K&&K.abort(),ye(A.navigation.location,{matches:pn,loaderData:oe,errors:Ee,fetchers:er})):(Re({errors:Ee,loaderData:hw(A.loaderData,oe,pn,Ee),fetchers:er}),X=!1)}async function at(U,G,te,he,ge,Le,Ce,je,Ne){let Be=A.fetchers.get(U);Oe(U,yc(Ne,Be?Be.data:void 0),{flushSync:Ce});let Pe=new AbortController,tt=Yo(e.history,te,Pe.signal);if(Le){let dt=await _t(he,new URL(tt.url).pathname,tt.signal,U);if(dt.type==="aborted")return;if(dt.type==="error"){bt(U,G,dt.error,{flushSync:Ce});return}else if(dt.matches)he=dt.matches;else{bt(U,G,dr(404,{pathname:te}),{flushSync:Ce});return}}let Ke=pd(he,te);F.set(U,Pe);let ut=_,pt=tl(c,u,tt,te,he,Ke,a,ge),It=await be(tt,te,pt,ge,U),ft=It[Ke.route.id];if(!ft){for(let dt of he)if(It[dt.route.id]){ft=It[dt.route.id];break}}if(F.get(U)===Pe&&F.delete(U),!tt.signal.aborted){if(re.has(U)){Oe(U,qr(void 0));return}if(Xs(ft))if(M>ut){Oe(U,qr(void 0));return}else{I.add(U),await ue(tt,ft,!1,{preventScrollReset:je});return}if(qi(ft)){bt(U,G,ft.error);return}Oe(U,qr(ft.data))}}async function ue(U,G,te,{submission:he,fetcherSubmission:ge,preventScrollReset:Le,replace:Ce}={}){te||(Y?.resolve(),Y=null),G.response.headers.has("X-Remix-Revalidate")&&(X=!0);let je=G.response.headers.get("Location");gt(je,"Expected a Location header on the redirect Response");let Ne=je,Be=new URL(U.url);je=uw(je,Be,d,e.history),el(Ne,je,Be,"allow-explicit");let Pe=Jc(A.location,je,{_isRedirect:!0});if(r){let ft=!1;if(G.response.headers.has("X-Remix-Reload-Document"))ft=!0;else if(Oy(je)){const dt=UC(t,je,!0);ft=dt.origin!==t.location.origin||yr(dt.pathname,d)==null}if(ft){Ce?t.location.replace(je):t.location.assign(je);return}}K=null;let tt=Ce===!0||G.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ke,formAction:ut,formEncType:pt}=A.navigation;!he&&!ge&&Ke&&ut&&pt&&(he=gw(A.navigation));let It=he||ge;if(zN.has(G.response.status)&&It&&ci(It.formMethod))await Qe(tt,Pe,{submission:{...It,formAction:je},preventScrollReset:Le||W,enableViewTransition:te?$:void 0});else{let ft=fg(Pe,[],tt,he);await Qe(tt,Pe,{overrideNavigation:ft,fetcherSubmission:ge,preventScrollReset:Le||W,enableViewTransition:te?$:void 0})}}async function be(U,G,te,he,ge){let Le,Ce={};try{Le=await GN(m,U,G,te,ge,he,!1)}catch(je){return te.filter(Ne=>Ne.shouldLoad).forEach(Ne=>{Ce[Ne.route.id]={type:"error",error:je}}),Ce}if(U.signal.aborted)return Ce;if(!ci(U.method))for(let je of te){if(Le[je.route.id]?.type==="error")break;!Le.hasOwnProperty(je.route.id)&&!A.loaderData.hasOwnProperty(je.route.id)&&(!A.errors||!A.errors.hasOwnProperty(je.route.id))&&je.shouldCallHandler()&&(Le[je.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${je.route.id}`)})}for(let[je,Ne]of Object.entries(Le))if(iD(Ne)){let Be=Ne.result;Ce[je]={type:"redirect",response:WN(Be,U,je,te,d)}}else Ce[je]=await $N(Ne);return Ce}async function $e(U,G,te,he,ge){let Le=be(te,he,U,ge,null),Ce=Promise.all(G.map(async Be=>{if(Be.matches&&Be.match&&Be.request&&Be.controller){let tt=(await be(Be.request,Be.path,Be.matches,ge,Be.key))[Be.match.route.id];return{[Be.key]:tt}}else return Promise.resolve({[Be.key]:{type:"error",error:dr(404,{pathname:Be.path})}})})),je=await Le,Ne=(await Ce).reduce((Be,Pe)=>Object.assign(Be,Pe),{});return{loaderResults:je,fetcherResults:Ne}}function Te(){X=!0,B.forEach((U,G)=>{F.has(G)&&Q.add(G),Ft(G)})}function Oe(U,G,te={}){let he=new Map(A.fetchers);he.set(U,G),Re({fetchers:he},{flushSync:(te&&te.flushSync)===!0})}function bt(U,G,te,he={}){let ge=os(A.matches,G),Le=new Map(A.fetchers);Ot(Le,U),Re({errors:{[ge.route.id]:te},fetchers:Le},{flushSync:(he&&he.flushSync)===!0})}function Dt(U){return Z.set(U,(Z.get(U)||0)+1),re.has(U)&&re.delete(U),A.fetchers.get(U)||PN}function xt(U,G){Ft(U,G?.reason),Oe(U,qr(null))}function Ot(U,G){let te=A.fetchers.get(G);F.has(G)&&!(te&&te.state==="loading"&&z.has(G))&&Ft(G),B.delete(G),z.delete(G),I.delete(G),re.delete(G),Q.delete(G),U.delete(G)}function Lt(U){let G=(Z.get(U)||0)-1;G<=0?(Z.delete(U),re.add(U)):Z.set(U,G),Re({fetchers:new Map(A.fetchers)})}function Ft(U,G){let te=F.get(U);te&&(te.abort(G),F.delete(U))}function Yt(U,G){for(let te of U){let he=G.get(te);gt(he,`Expected fetcher: ${te}`);let ge=qr(he.data);G.set(te,ge)}}function mn(U){let G=[],te=!1;for(let he of I){let ge=U.get(he);gt(ge,`Expected fetcher: ${he}`),ge.state==="loading"&&(I.delete(he),G.push(he),te=!0)}return Yt(G,U),te}function qn(U,G){let te=[];for(let[he,ge]of z)if(ge0}function Gn(U,G){let te=A.blockers.get(U)||gc;return fe.get(U)!==G&&fe.set(U,G),te}function bn(U){A.blockers.delete(U),fe.delete(U)}function Rt(U,G){let te=A.blockers.get(U)||gc;gt(te.state==="unblocked"&&G.state==="blocked"||te.state==="blocked"&&G.state==="blocked"||te.state==="blocked"&&G.state==="proceeding"||te.state==="blocked"&&G.state==="unblocked"||te.state==="proceeding"&&G.state==="unblocked",`Invalid blocker state transition: ${te.state} -> ${G.state}`);let he=new Map(A.blockers);he.set(U,G),Re({blockers:he})}function un({currentLocation:U,nextLocation:G,historyAction:te}){if(fe.size===0)return;fe.size>1&&wn(!1,"A router only supports one blocker at a time");let he=Array.from(fe.entries()),[ge,Le]=he[he.length-1],Ce=A.blockers.get(ge);if(!(Ce&&Ce.state==="proceeding")&&Le({currentLocation:U,nextLocation:G,historyAction:te}))return ge}function kt(U){let G=dr(404,{pathname:U}),te=f.activeRoutes,{matches:he,route:ge}=Pf(te);return{notFoundMatches:he,route:ge,error:G}}function jn(U,G,te){if(E=U,R=G,w=te||null,!T&&A.navigation===ug){T=!0;let he=sn(A.location,A.matches);he!=null&&Re({restoreScrollPosition:he})}return()=>{E=null,R=null,w=null}}function Pn(U,G){return w&&w(U,G.map(he=>oN(he,A.loaderData)))||U.key}function ct(U,G){if(E&&R){let te=Pn(U,G);E[te]=R()}}function sn(U,G){if(E){let te=Pn(U,G),he=E[te];if(typeof he=="number")return he}return null}function Jt(U,G,te){if(e.patchRoutesOnNavigation){let he=f.branches;if(U){if(Object.keys(U[0].params).length>0)return{active:!0,matches:Mr(G,te,d,!0,he)}}else return{active:!0,matches:Mr(G,te,d,!0,he)||[]}}return{active:!1,matches:null}}async function _t(U,G,te,he){if(!e.patchRoutesOnNavigation)return{type:"success",matches:U};let ge=U;for(;;){let Le=u;try{await e.patchRoutesOnNavigation({signal:te,path:G,matches:ge,fetcherKey:he,patch:(Be,Pe)=>{te.aborted||sw(Be,Pe,f,Le,c,!1)}})}catch(Be){return{type:"error",error:Be,partialMatches:ge}}if(te.aborted)return{type:"aborted"};let Ce=f.branches,je=Mr(f.activeRoutes,G,d,!1,Ce),Ne=null;if(je){if(Object.keys(je[0].params).length===0)return{type:"success",matches:je};if(Ne=Mr(f.activeRoutes,G,d,!0,Ce),!(Ne&&ge.lengthte.route.id===G[he].route.id)}function fn(U){u={},f.setHmrRoutes(eu(U,c,void 0,u))}function Kn(U,G,te=!1){sw(U,G,f,u,c,te),f.hasHMRRoutes||Re({})}return N={get basename(){return d},get future(){return g},get state(){return A},get routes(){return f.stableRoutes},get branches(){return f.branches},get manifest(){return u},get window(){return t},initialize:Ae,subscribe:we,enableScrollRestoration:jn,navigate:ze,fetch:et,revalidate:Ye,createHref:U=>e.history.createHref(U),createURL:U=>e.history.createURL(U),encodeLocation:U=>e.history.encodeLocation(U),getFetcher:Dt,resetFetcher:xt,deleteFetcher:Lt,dispose:ke,getBlocker:Gn,deleteBlocker:bn,patchRoutes:Kn,_internalFetchControllers:F,_internalSetRoutes:fn,_internalSetStateDoNotUseOrYouWillBreakYourApp(U){Re(U)}},e.instrumentations&&(N=TN(N,e.instrumentations.map(U=>U.router).filter(Boolean))),N}function IN(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function m0(e,t,r,a,o,c){let u,f;if(o){u=[];for(let m of t)if(u.push(m),m.route.id===o){f=m;break}}else u=t,f=t[t.length-1];let d=gu(a||".",ch(u),yr(e.pathname,r)||e.pathname,c==="path");if(a==null&&(d.search=e.search,d.hash=e.hash),(a==null||a===""||a===".")&&f){let m=zy(d.search);if(f.route.index&&!m)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!f.route.index&&m){let g=new URLSearchParams(d.search),v=g.getAll("index");g.delete("index"),v.filter(S=>S).forEach(S=>g.append("index",S));let x=g.toString();d.search=x?`?${x}`:""}}return r!=="/"&&(d.pathname=bN({basename:r,pathname:d.pathname})),xi(d)}function rw(e,t,r){if(!r||!IN(r))return{path:t};if(r.formMethod&&!sD(r.formMethod))return{path:t,error:dr(405,{method:r.formMethod})};let a=()=>({path:t,error:dr(400,{type:"invalid-body"})}),c=(r.formMethod||"get").toUpperCase(),u=sT(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ci(c))return a();let v=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((x,[S,E])=>`${x}${S}=${E} +`,""):String(r.body);return{path:t,submission:{formMethod:c,formAction:u,formEncType:r.formEncType,formData:void 0,json:void 0,text:v}}}else if(r.formEncType==="application/json"){if(!ci(c))return a();try{let v=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:c,formAction:u,formEncType:r.formEncType,formData:void 0,json:v,text:void 0}}}catch{return a()}}}gt(typeof FormData=="function","FormData is not available in this environment");let f,d;if(r.formData)f=y0(r.formData),d=r.formData;else if(r.body instanceof FormData)f=y0(r.body),d=r.body;else if(r.body instanceof URLSearchParams)f=r.body,d=fw(f);else if(r.body==null)f=new URLSearchParams,d=new FormData;else try{f=new URLSearchParams(r.body),d=fw(f)}catch{return a()}let m={formMethod:c,formAction:u,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:d,json:void 0,text:void 0};if(ci(m.formMethod))return{path:t,submission:m};let g=Qr(t);return e&&g.search&&zy(g.search)&&f.append("index",""),g.search=`?${f}`,{path:xi(g),submission:m}}function aw(e,t,r,a,o,c,u,f,d,m,g,v,x,S,E,w,R,T,O,k,j,L){let P=j?qi(j[1])?j[1].error:j[1].data:void 0,N=o.createURL(c.location),A=o.createURL(d),H;if(g&&c.errors){let V=Object.keys(c.errors)[0];H=u.findIndex(X=>X.route.id===V)}else if(j&&qi(j[1])){let V=j[0];H=u.findIndex(X=>X.route.id===V)-1}let Y=j?j[1].statusCode:void 0,W=Y&&Y>=400,K={currentUrl:N,currentParams:c.matches[0]?.params||{},nextUrl:A,nextParams:u[0].params,...f,actionResult:P,actionStatus:Y},$=vu(u),ee=u.map((V,X)=>{let{route:Q}=V,F=null;if(H!=null&&X>H)F=!1;else if(Q.lazy)F=!0;else if(!Ly(Q))F=!1;else if(g){let{shouldLoad:I}=JC(Q,c.loaderData,c.errors);F=I}else BN(c.loaderData,c.matches[X],V)&&(F=!0);if(F!==null)return p0(r,a,e,d,$,V,m,t,F);let _=!1;typeof L=="boolean"?_=L:W?_=!1:(v||N.pathname+N.search===A.pathname+A.search||N.search!==A.search||HN(c.matches[X],V))&&(_=!0);let M={...K,defaultShouldRevalidate:_},z=_c(V,M);return p0(r,a,e,d,$,V,m,t,z,M,L)}),ie=[];return E.forEach((V,X)=>{if(g||!u.some(Z=>Z.route.id===V.routeId)||S.has(X))return;let Q=c.fetchers.get(X),F=Q&&Q.state!=="idle"&&Q.data===void 0,_=Mr(R,V.path,T??"/",!1,k);if(!_){if(O&&F)return;ie.push({key:X,routeId:V.routeId,path:V.path,matches:null,match:null,request:null,controller:null});return}if(w.has(X))return;let M=pd(_,V.path),z=new AbortController,I=Yo(o,V.path,z.signal),B=null;if(x.has(X))x.delete(X),B=tl(r,a,I,V.path,_,M,m,t);else if(F)v&&(B=tl(r,a,I,V.path,_,M,m,t));else{let Z;typeof L=="boolean"?Z=L:W?Z=!1:Z=v;let re={...K,defaultShouldRevalidate:Z};_c(M,re)&&(B=tl(r,a,I,V.path,_,M,m,t,re))}B&&ie.push({key:X,routeId:V.routeId,path:V.path,matches:B,match:M,request:I,controller:z})}),{dsMatches:ee,revalidatingFetchers:ie}}function Ly(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function JC(e,t,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Ly(e))return{shouldLoad:!1,renderFallback:!1};let a=t!=null&&e.id in t,o=r!=null&&r[e.id]!==void 0;if(!a&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!a};let c=!a&&!o;return{shouldLoad:c,renderFallback:c}}function BN(e,t,r){let a=!t||r.route.id!==t.route.id,o=!e.hasOwnProperty(r.route.id);return a||o}function HN(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function _c(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function sw(e,t,r,a,o,c){let u;if(e){let m=a[e];gt(m,`No route found to patch children into: routeId = ${e}`),m.children||(m.children=[]),u=m.children}else u=r.activeRoutes;let f=[],d=[];if(t.forEach(m=>{let g=u.find(v=>eT(m,v));g?d.push({existingRoute:g,newRoute:m}):f.push(m)}),f.length>0){let m=eu(f,o,[e||"_","patch",String(u?.length||"0")],a);u.push(...m)}if(c&&d.length>0)for(let m=0;mt.children?.some(o=>eT(r,o)))??!1:!1}var ow=new WeakMap,tT=({key:e,route:t,manifest:r,mapRouteProperties:a})=>{let o=r[t.id];if(gt(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let c=o.lazy[e];if(!c)return;let u=ow.get(o);u||(u={},ow.set(o,u));let f=u[e];if(f)return f;let d=(async()=>{let m=iN(e),v=o[e]!==void 0&&e!=="hasErrorBoundary";if(m)wn(!m,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),u[e]=Promise.resolve();else if(v)wn(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await c();x!=null&&(Object.assign(o,{[e]:x}),Object.assign(o,a(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(x=>x===void 0)&&(o.lazy=void 0))})();return u[e]=d,d},lw=new WeakMap;function FN(e,t,r,a,o){let c=r[e.id];if(gt(c,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let g=lw.get(c);if(g)return{lazyRoutePromise:g,lazyHandlerPromise:g};let v=(async()=>{gt(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),S={};for(let E in x){let w=x[E];if(w===void 0)continue;let R=aN(E),O=c[E]!==void 0&&E!=="hasErrorBoundary";R?wn(!R,"Route property "+E+" is not a supported property to be returned from a lazy route function. This property will be ignored."):O?wn(!O,`Route "${c.id}" has a static property "${E}" defined but its lazy function is also returning a value for this property. The lazy route property "${E}" will be ignored.`):S[E]=w}Object.assign(c,S),Object.assign(c,{...a(c),lazy:void 0})})();return lw.set(c,v),v.catch(()=>{}),{lazyRoutePromise:v,lazyHandlerPromise:v}}let u=Object.keys(e.lazy),f=[],d;for(let g of u){if(o&&o.includes(g))continue;let v=tT({key:g,route:e,manifest:r,mapRouteProperties:a});v&&(f.push(v),g===t&&(d=v))}let m=f.length>0?Promise.all(f).then(()=>{}):void 0;return m?.catch(()=>{}),d?.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:d}}async function cw(e){let t=e.matches.filter(o=>o.shouldLoad),r={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,c)=>{r[t[c].route.id]=o}),r}async function YN(e){return e.matches.some(t=>t.route.middleware)?nT(e,()=>cw(e)):cw(e)}function nT(e,t){return qN(e,t,a=>{if(aD(a))throw a;return a},tD,r);function r(a,o,c){if(c)return Promise.resolve(Object.assign(c.value,{[o]:{type:"error",result:a}}));{let{matches:u}=e,f=Math.min(Math.max(u.findIndex(m=>m.route.id===o),0),Math.max(u.findIndex(m=>m.shouldCallHandler()),0)),d=os(u,u[f].route.id).route.id;return Promise.resolve({[d]:{type:"error",result:a}})}}}async function qN(e,t,r,a,o){let{matches:c,...u}=e,f=c.flatMap(m=>m.route.middleware?m.route.middleware.map(g=>[m.route.id,g]):[]);return await iT(u,f,t,r,a,o)}async function iT(e,t,r,a,o,c,u=0){let{request:f}=e;if(f.signal.aborted)throw f.signal.reason??new Error(`Request aborted: ${f.method} ${f.url}`);let d=t[u];if(!d)return await r();let[m,g]=d,v,x=async()=>{if(v)throw new Error("You may only call `next()` once per middleware");try{return v={value:await iT(e,t,r,a,o,c,u+1)},v.value}catch(S){return v={value:await c(S,m,v)},v.value}};try{let S=await g(e,x),E=S!=null?a(S):void 0;return o(E)?E:v?E??v.value:(v={value:await x()},v.value)}catch(S){return await c(S,m,v)}}function rT(e,t,r,a,o){let c=tT({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),u=FN(a.route,ci(r.method)?"action":"loader",t,e,o);return{middleware:c,route:u.lazyRoutePromise,handler:u.lazyHandlerPromise}}function p0(e,t,r,a,o,c,u,f,d,m=null,g){let v=!1,x=rT(e,t,r,c,u);return{...c,_lazyPromises:x,shouldLoad:d,shouldRevalidateArgs:m,shouldCallHandler(S){return v=!0,m?typeof g=="boolean"?_c(c,{...m,defaultShouldRevalidate:g}):typeof S=="boolean"?_c(c,{...m,defaultShouldRevalidate:S}):_c(c,m):d},resolve(S){let{lazy:E,loader:w,middleware:R}=c.route,T=v||d||S&&!ci(r.method)&&(E||w),O=R&&R.length>0&&!w&&!E;return T&&(ci(r.method)||!O)?KN({request:r,path:a,pattern:o,match:c,lazyHandlerPromise:x?.handler,lazyRoutePromise:x?.route,handlerOverride:S,scopedContext:f}):Promise.resolve({type:"data",result:void 0})}}}function tl(e,t,r,a,o,c,u,f,d=null){return o.map(m=>m.route.id!==c.route.id?{...m,shouldLoad:!1,shouldRevalidateArgs:d,shouldCallHandler:()=>!1,_lazyPromises:rT(e,t,r,m,u),resolve:()=>Promise.resolve({type:"data",result:void 0})}:p0(e,t,r,a,vu(o),m,u,f,!0,d))}async function GN(e,t,r,a,o,c,u){a.some(g=>g._lazyPromises?.middleware)&&await Promise.all(a.map(g=>g._lazyPromises?.middleware));let f={request:t,url:aT(t,r),pattern:vu(a),params:a[0].params,context:c,matches:a},m=await e({...f,fetcherKey:o,runClientMiddleware:g=>{let v=f;return nT(v,()=>g({...v,fetcherKey:o,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(a.flatMap(g=>[g._lazyPromises?.handler,g._lazyPromises?.route]))}catch{}return m}async function KN({request:e,path:t,pattern:r,match:a,lazyHandlerPromise:o,lazyRoutePromise:c,handlerOverride:u,scopedContext:f}){let d,m,g=ci(e.method),v=g?"action":"loader",x=S=>{let E,w=new Promise((O,k)=>E=k);m=()=>E(),e.signal.addEventListener("abort",m);let R=O=>typeof S!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${v}" [routeId: ${a.route.id}]`)):S({request:e,url:aT(e,t),pattern:r,params:a.params,context:f},...O!==void 0?[O]:[]),T=(async()=>{try{return{type:"data",result:await(u?u(k=>R(k)):R())}}catch(O){return{type:"error",result:O}}})();return Promise.race([T,w])};try{let S=g?a.route.action:a.route.loader;if(o||c)if(S){let E,[w]=await Promise.all([x(S).catch(R=>{E=R}),o,c]);if(E!==void 0)throw E;d=w}else{await o;let E=g?a.route.action:a.route.loader;if(E)[d]=await Promise.all([x(E),c]);else if(v==="action"){let w=new URL(e.url),R=w.pathname+w.search;throw dr(405,{method:e.method,pathname:R,routeId:a.route.id})}else return{type:"data",result:void 0}}else if(S)d=await x(S);else{let E=new URL(e.url),w=E.pathname+E.search;throw dr(404,{pathname:w})}}catch(S){return{type:"error",result:S}}finally{m&&e.signal.removeEventListener("abort",m)}return d}async function XN(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function $N(e){let{result:t,type:r}=e;if(ky(t)){let a;try{a=await XN(t)}catch(o){return{type:"error",error:o}}return r==="error"?{type:"error",error:new yu(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:"data",data:a,statusCode:t.status,headers:t.headers}}return r==="error"?pw(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:eD(t),statusCode:tu(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:tu(t)?t.status:void 0}:pw(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function WN(e,t,r,a,o){let c=e.headers.get("Location");if(gt(c,"Redirects returned/thrown from loaders/actions must have a Location header"),!Oy(c)){let u=a.slice(0,a.findIndex(f=>f.route.id===r)+1);c=m0(new URL(t.url),u,o,c),e.headers.set("Location",c)}return e}var ZN=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function g0(e){try{return ZN.includes(new URL(e).protocol)}catch{return!1}}function uw(e,t,r,a){if(Oy(e)){let o=e,c=lh.test(o)?new URL(VC(o,t.protocol)):new URL(o);if(g0(c.toString()))throw new Error("Invalid redirect location");let u=yr(c.pathname,r)!=null;if(c.origin===t.origin&&u)return Ny(c.pathname)+c.search+c.hash}try{let o=a.createURL(e);if(g0(o.toString()))throw new Error("Invalid redirect location")}catch{}return e}function Yo(e,t,r,a){let o=e.createURL(sT(t)).toString(),c={signal:r};if(a&&ci(a.formMethod)){let{formMethod:u,formEncType:f}=a;c.method=u.toUpperCase(),f==="application/json"?(c.headers=new Headers({"Content-Type":f}),c.body=JSON.stringify(a.json)):f==="text/plain"?c.body=a.text:f==="application/x-www-form-urlencoded"&&a.formData?c.body=y0(a.formData):c.body=a.formData}return new Request(o,c)}function aT(e,t){let r=new URL(e.url),a=typeof t=="string"?Qr(t):t;if(r.pathname=a.pathname||"/",a.search){let o=new URLSearchParams(a.search),c=o.getAll("index");o.delete("index");for(let u of c.filter(Boolean))o.append("index",u);r.search=o.size?`?${o.toString()}`:""}else r.search="";return r.hash=a.hash||"",r}function y0(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,typeof a=="string"?a:a.name);return t}function fw(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function QN(e,t,r,a=!1,o=!1){let c={},u=null,f,d=!1,m={},g=r&&qi(r[1])?r[1].error:void 0;return e.forEach(v=>{if(!(v.route.id in t))return;let x=v.route.id,S=t[x];if(gt(!Xs(S),"Cannot handle redirect results in processLoaderData"),qi(S)){let E=S.error;if(g!==void 0&&(E=g,g=void 0),u=u||{},o)u[x]=E;else{let w=os(e,x);u[w.route.id]==null&&(u[w.route.id]=E)}a||(c[x]=QC),d||(d=!0,f=tu(S.error)?S.error.status:500),S.headers&&(m[x]=S.headers)}else c[x]=S.data,S.statusCode&&S.statusCode!==200&&!d&&(f=S.statusCode),S.headers&&(m[x]=S.headers)}),g!==void 0&&r&&(u={[r[0]]:g},r[2]&&(c[r[2]]=void 0)),{loaderData:c,errors:u,statusCode:f||200,loaderHeaders:m}}function dw(e,t,r,a,o,c,u){let{loaderData:f,errors:d}=QN(t,r,a);return o.filter(m=>!m.matches||m.matches.some(g=>g.shouldLoad)).forEach(m=>{let{key:g,match:v,controller:x}=m;if(x&&x.signal.aborted)return;let S=c[g];if(gt(S,"Did not find corresponding fetcher result"),qi(S)){let E=os(e.matches,v?.route.id);d&&d[E.route.id]||(d={...d,[E.route.id]:S.error}),u.delete(g)}else if(Xs(S))gt(!1,"Unhandled fetcher revalidation redirect");else{let E=qr(S.data);u.set(g,E)}}),{loaderData:f,errors:d}}function hw(e,t,r,a){let o=Object.entries(t).filter(([,c])=>c!==QC).reduce((c,[u,f])=>(c[u]=f,c),{});for(let c of r){let u=c.route.id;if(!t.hasOwnProperty(u)&&e.hasOwnProperty(u)&&c.route.loader&&(o[u]=e[u]),a&&a.hasOwnProperty(u))break}return o}function mw(e){return e?qi(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function os(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function Pf(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function dr(e,{pathname:t,routeId:r,method:a,type:o,message:c}={}){let u="Unknown Server Error",f="Unknown @remix-run/router error";return e===400?(u="Bad Request",a&&t&&r?f=`You made a ${a} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:o==="invalid-body"&&(f="Unable to encode submission body")):e===403?(u="Forbidden",f=`Route "${r}" does not match URL "${t}"`):e===404?(u="Not Found",f=`No route matches URL "${t}"`):e===405&&(u="Method Not Allowed",a&&t&&r?f=`You made a ${a.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:a&&(f=`Invalid request method "${a.toUpperCase()}"`)),new yu(e||500,u,new Error(f),!0)}function _f(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[a,o]=t[r];if(Xs(o))return{key:a,result:o}}}function sT(e){let t=typeof e=="string"?Qr(e):e;return xi({...t,hash:""})}function JN(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function eD(e){return new yu(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function tD(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&nD(r))}function nD(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function iD(e){return ky(e.result)&&WC.has(e.result.status)}function qi(e){return e.type==="error"}function Xs(e){return(e&&e.type)==="redirect"}function pw(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function ky(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function rD(e){return WC.has(e)}function aD(e){return ky(e)&&rD(e.status)&&e.headers.has("Location")}function sD(e){return kN.has(e.toUpperCase())}function ci(e){return DN.has(e.toUpperCase())}function zy(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function pd(e,t){let r=typeof t=="string"?Qr(t).search:t.search;if(e[e.length-1].route.index&&zy(r||""))return e[e.length-1];let a=qC(e);return a[a.length-1]}function gw(e){let{formMethod:t,formAction:r,formEncType:a,text:o,formData:c,json:u}=e;if(!(!t||!r||!a)){if(o!=null)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:void 0,text:o};if(c!=null)return{formMethod:t,formAction:r,formEncType:a,formData:c,json:void 0,text:void 0};if(u!==void 0)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:u,text:void 0}}}function fg(e,t,r,a){return a?{state:"loading",location:e,matches:t,historyAction:r,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}:{state:"loading",location:e,matches:t,historyAction:r,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function oD(e,t,r,a){return{state:"submitting",location:e,matches:t,historyAction:r,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}}function yc(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function lD(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function qr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function cD(e,t){try{let r=e.sessionStorage.getItem(ZC);if(r){let a=JSON.parse(r);for(let[o,c]of Object.entries(a||{}))c&&Array.isArray(c)&&t.set(o,new Set(c||[]))}}catch{}}function uD(e,t){if(t.size>0){let r={};for(let[a,o]of t)r[a]=[...o];try{e.sessionStorage.setItem(ZC,JSON.stringify(r))}catch(a){wn(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function yw(){let e,t,r=new Promise((a,o)=>{e=async c=>{a(c);try{await r}catch{}},t=async c=>{o(c);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var so=b.createContext(null);so.displayName="DataRouter";var bu=b.createContext(null);bu.displayName="DataRouterState";var oT=b.createContext(!1);function lT(){return b.useContext(oT)}var Py=b.createContext({isTransitioning:!1});Py.displayName="ViewTransition";var cT=b.createContext(new Map);cT.displayName="Fetchers";var fD=b.createContext(null);fD.displayName="Await";var Qi=b.createContext(null);Qi.displayName="Navigation";var uh=b.createContext(null);uh.displayName="Location";var br=b.createContext({outlet:null,matches:[],isDataRoute:!1});br.displayName="Route";var _y=b.createContext(null);_y.displayName="RouteError";var uT="REACT_ROUTER_ERROR",dD="REDIRECT",hD="ROUTE_ERROR_RESPONSE";function mD(e){if(e.startsWith(`${uT}:${dD}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function pD(e){if(e.startsWith(`${uT}:${hD}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new yu(t.status,t.statusText,t.data)}catch{}}function gD(e,{relative:t}={}){gt(wl(),"useHref() may be used only in the context of a component.");let{basename:r,navigator:a}=b.useContext(Qi),{hash:o,pathname:c,search:u}=xu(e,{relative:t}),f=c;return r!=="/"&&(f=c==="/"?r:pr([r,c])),a.createHref({pathname:f,search:u,hash:o})}function wl(){return b.useContext(uh)!=null}function Ji(){return gt(wl(),"useLocation() may be used only in the context of a component."),b.useContext(uh).location}var fT="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function dT(e){b.useContext(Qi).static||b.useLayoutEffect(e)}function oo(){let{isDataRoute:e}=b.useContext(br);return e?DD():yD()}function yD(){gt(wl(),"useNavigate() may be used only in the context of a component.");let e=b.useContext(so),{basename:t,navigator:r}=b.useContext(Qi),{matches:a}=b.useContext(br),{pathname:o}=Ji(),c=JSON.stringify(ch(a)),u=b.useRef(!1);return dT(()=>{u.current=!0}),b.useCallback((d,m={})=>{if(wn(u.current,fT),!u.current)return;if(typeof d=="number"){r.go(d);return}let g=gu(d,JSON.parse(c),o,m.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:pr([t,g.pathname])),el(typeof d=="string"?d:xi(d),r.createHref(g),Dy(r),"reject"),(m.replace?r.replace:r.push)(g,m.state,m)},[t,r,c,o,e])}var vD=b.createContext(null);function bD(e){let t=b.useContext(br).outlet;return b.useMemo(()=>t&&b.createElement(vD.Provider,{value:e},t),[t,e])}function xD(){let{matches:e}=b.useContext(br);return e[e.length-1]?.params??{}}function xu(e,{relative:t}={}){let{matches:r}=b.useContext(br),{pathname:a}=Ji(),o=JSON.stringify(ch(r));return b.useMemo(()=>gu(e,JSON.parse(o),a,t==="path"),[e,o,a,t])}function SD(e,t,r){gt(wl(),"useRoutes() may be used only in the context of a component.");let{navigator:a}=b.useContext(Qi),{matches:o}=b.useContext(br),c=o[o.length-1],u=c?c.params:{},f=c?c.pathname:"/",d=c?c.pathnameBase:"/",m=c&&c.route;{let R=m&&m.path||"";mT(f,!m||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${f}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. + +Please change the parent to .`)}let g=Ji(),v;v=g;let x=v.pathname||"/",S=x;if(d!=="/"){let R=d.replace(/^\//,"").split("/");S="/"+x.replace(/^\//,"").split("/").slice(R.length).join("/")}let E=r&&r.state.matches.length?r.state.matches.map(R=>Object.assign(R,{route:r.manifest[R.route.id]||R.route})):IC(e,{pathname:S});return wn(m||E!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),wn(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`),TD(E&&E.map(R=>Object.assign({},R,{params:Object.assign({},u,R.params),pathname:pr([d,a.encodeLocation?a.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?d:pr([d,a.encodeLocation?a.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),o,r)}function wD(){let e=ND(),t=tu(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:a},c={padding:"2px 4px",backgroundColor:a},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:c},"ErrorBoundary")," or"," ",b.createElement("code",{style:c},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),r?b.createElement("pre",{style:o},r):null,u)}var ED=b.createElement(wD,null),hT=class extends b.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=pD(e.digest);r&&(e=r)}let t=e!==void 0?b.createElement(br.Provider,{value:this.props.routeContext},b.createElement(_y.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(RD,{error:e},t):t}};hT.contextType=oT;var dg=new WeakMap;function RD({children:e,error:t}){let{basename:r,navigator:a}=b.useContext(Qi);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let o=mD(t.digest);if(o){let c=dg.get(t);if(c)throw c;let u=KC(o.location,r),f=u.absoluteURL||u.to;if(el(o.location,f,Dy(a),"allow-explicit"),g0(f))throw new Error("Invalid redirect location");if(GC&&!dg.get(t))if(u.isExternal||o.reloadDocument)window.location.href=f;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:o.replace}));throw dg.set(t,d),d}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f}`})}}return e}function CD({routeContext:e,match:t,children:r}){let a=b.useContext(so);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(br.Provider,{value:e},r)}function TD(e,t=[],r){let a=r?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let o=e,c=a?.errors;if(c!=null){let g=o.findIndex(v=>v.route.id&&c?.[v.route.id]!==void 0);gt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),o=o.slice(0,Math.min(o.length,g+1))}let u=!1,f=-1;if(r&&a){u=a.renderFallback;for(let g=0;g=0?o=o.slice(0,f+1):o=[o[0]];break}}}}let d=r?.onError,m=a&&d?(g,v)=>{d(g,{location:a.location,params:a.matches?.[0]?.params??{},pattern:vu(a.matches),errorInfo:v})}:void 0;return o.reduceRight((g,v,x)=>{let S,E=!1,w=null,R=null;a&&(S=c&&v.route.id?c[v.route.id]:void 0,w=v.route.errorElement||ED,u&&(f<0&&x===0?(mT("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,R=null):f===x&&(E=!0,R=v.route.hydrateFallbackElement||null)));let T=t.concat(o.slice(0,x+1)),O=()=>{let k;return S?k=w:E?k=R:v.route.Component?k=b.createElement(v.route.Component,null):v.route.element?k=v.route.element:k=g,b.createElement(CD,{match:v,routeContext:{outlet:g,matches:T,isDataRoute:a!=null},children:k})};return a&&(v.route.ErrorBoundary||v.route.errorElement||x===0)?b.createElement(hT,{location:a.location,revalidation:a.revalidation,component:w,error:S,children:O(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:m}):O()},null)}function Vy(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function AD(e){let t=b.useContext(so);return gt(t,Vy(e)),t}function MD(e){let t=b.useContext(bu);return gt(t,Vy(e)),t}function jD(e){let t=b.useContext(br);return gt(t,Vy(e)),t}function Uy(e){let t=jD(e),r=t.matches[t.matches.length-1];return gt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function OD(){return Uy("useRouteId")}function ND(){let e=b.useContext(_y),t=MD("useRouteError"),r=Uy("useRouteError");return e!==void 0?e:t.errors?.[r]}function DD(){let{router:e}=AD("useNavigate"),t=Uy("useNavigate"),r=b.useRef(!1);return dT(()=>{r.current=!0}),b.useCallback(async(o,c={})=>{wn(r.current,fT),r.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...c}))},[e,t])}var vw={};function mT(e,t,r){!t&&!vw[e]&&(vw[e]=!0,wn(!1,r))}var bw={};function xw(e,t){!e&&!bw[t]&&(bw[t]=!0,console.warn(t))}var LD="useOptimistic",Sw=WE[LD],kD=()=>{};function zD(e){return Sw?Sw(e):[e,kD]}function PD(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&wn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:b.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&wn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:b.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&wn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:b.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var _D=["HydrateFallback","hydrateFallbackElement"],VD=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function UD({router:e,flushSync:t,onError:r,useTransitions:a}){a=lT()||a;let[c,u]=b.useState(e.state),[f,d]=zD(c),[m,g]=b.useState(),[v,x]=b.useState({isTransitioning:!1}),[S,E]=b.useState(),[w,R]=b.useState(),[T,O]=b.useState(),k=b.useRef(new Map),j=b.useCallback((A,{deletedFetchers:H,newErrors:Y,flushSync:W,viewTransitionOpts:K})=>{Y&&r&&Object.values(Y).forEach(ee=>r(ee,{location:A.location,params:A.matches[0]?.params??{},pattern:vu(A.matches)})),A.fetchers.forEach((ee,ie)=>{ee.data!==void 0&&k.current.set(ie,ee.data)}),H.forEach(ee=>k.current.delete(ee)),xw(W===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let $=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(xw(K==null||$,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!K||!$){t&&W?t(()=>u(A)):a===!1?u(A):b.startTransition(()=>{a===!0&&d(ee=>ww(ee,A)),u(A)});return}if(t&&W){t(()=>{w&&(S?.resolve(),w.skipTransition()),x({isTransitioning:!0,flushSync:!0,currentLocation:K.currentLocation,nextLocation:K.nextLocation})});let ee=e.window.document.startViewTransition(()=>{t(()=>u(A))});ee.finished.finally(()=>{t(()=>{E(void 0),R(void 0),g(void 0),x({isTransitioning:!1})})}),t(()=>R(ee));return}w?(S?.resolve(),w.skipTransition(),O({state:A,currentLocation:K.currentLocation,nextLocation:K.nextLocation})):(g(A),x({isTransitioning:!0,flushSync:!1,currentLocation:K.currentLocation,nextLocation:K.nextLocation}))},[e.window,t,w,S,a,d,r]);b.useLayoutEffect(()=>e.subscribe(j),[e,j]),b.useEffect(()=>{v.isTransitioning&&!v.flushSync&&E(new VD)},[v]),b.useEffect(()=>{if(S&&m&&e.window){let A=m,H=S.promise,Y=e.window.document.startViewTransition(async()=>{a===!1?u(A):b.startTransition(()=>{a===!0&&d(W=>ww(W,A)),u(A)}),await H});Y.finished.finally(()=>{E(void 0),R(void 0),g(void 0),x({isTransitioning:!1})}),R(Y)}},[m,S,e.window,a,d]),b.useEffect(()=>{S&&m&&f.location.key===m.location.key&&S.resolve()},[S,w,f.location,m]),b.useEffect(()=>{!v.isTransitioning&&T&&(g(T.state),x({isTransitioning:!0,flushSync:!1,currentLocation:T.currentLocation,nextLocation:T.nextLocation}),O(void 0))},[v.isTransitioning,T]);let L=b.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:A=>e.navigate(A),push:(A,H,Y)=>e.navigate(A,{state:H,preventScrollReset:Y?.preventScrollReset}),replace:(A,H,Y)=>e.navigate(A,{replace:!0,state:H,preventScrollReset:Y?.preventScrollReset})}),[e]),P=e.basename||"/",N=b.useMemo(()=>({router:e,navigator:L,static:!1,basename:P,onError:r}),[e,L,P,r]);return b.createElement(b.Fragment,null,b.createElement(so.Provider,{value:N},b.createElement(bu.Provider,{value:f},b.createElement(cT.Provider,{value:k.current},b.createElement(Py.Provider,{value:v},b.createElement(HD,{basename:P,location:f.location,navigationType:f.historyAction,navigator:L,useTransitions:a},b.createElement(ID,{routes:e.routes,manifest:e.manifest,future:e.future,state:f,isStatic:!1,onError:r})))))),null)}function ww(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var ID=b.memo(BD);function BD({routes:e,manifest:t,future:r,state:a,isStatic:o,onError:c}){return SD(e,void 0,{manifest:t,state:a,isStatic:o,onError:c})}function Ta({to:e,replace:t,state:r,relative:a}){gt(wl()," may be used only in the context of a component.");let{static:o,navigator:c}=b.useContext(Qi);wn(!o," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:u}=b.useContext(br),{pathname:f}=Ji(),d=oo(),m=gu(e,ch(u),f,a==="path");el(typeof e=="string"?e:xi(e),c.createHref(m),Dy(c),"reject");let g=JSON.stringify(m);return b.useEffect(()=>{d(JSON.parse(g),{replace:t,state:r,relative:a})},[d,g,a,t,r]),null}function pT(e){return bD(e.context)}function HD({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:o,static:c=!1,useTransitions:u}){gt(!wl(),"You cannot render a inside another . You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),d=b.useMemo(()=>({basename:f,navigator:o,static:c,useTransitions:u,future:{}}),[f,o,c,u]);typeof r=="string"&&(r=Qr(r));let{pathname:m="/",search:g="",hash:v="",state:x=null,key:S="default",mask:E}=r,w=b.useMemo(()=>{let R=yr(m,f);return R==null?null:{location:{pathname:R,search:g,hash:v,state:x,key:S,mask:E},navigationType:a}},[f,m,g,v,x,S,a,E]);return wn(w!=null,` is not able to match the URL "${m}${g}${v}" because it does not start with the basename, so the won't render anything.`),w==null?null:b.createElement(Qi.Provider,{value:d},b.createElement(uh.Provider,{children:t,value:w}))}var gd="get",yd="application/x-www-form-urlencoded";function fh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function FD(e){return fh(e)&&e.tagName.toLowerCase()==="button"}function YD(e){return fh(e)&&e.tagName.toLowerCase()==="form"}function qD(e){return fh(e)&&e.tagName.toLowerCase()==="input"}function GD(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function KD(e,t){return e.button===0&&(!t||t==="_self")&&!GD(e)}function v0(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map(o=>[r,o]):[[r,a]])},[]))}function XD(e,t){let r=v0(e);return t&&t.forEach((a,o)=>{r.has(o)||t.getAll(o).forEach(c=>{r.append(o,c)})}),r}var Vf=null;function $D(){if(Vf===null)try{new FormData(document.createElement("form"),0),Vf=!1}catch{Vf=!0}return Vf}var WD=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function hg(e){return e!=null&&!WD.has(e)?(wn(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${yd}"`),null):e}function ZD(e,t){let r,a,o,c,u;if(YD(e)){let f=e.getAttribute("action");a=f?yr(f,t):null,r=e.getAttribute("method")||gd,o=hg(e.getAttribute("enctype"))||yd,c=new FormData(e)}else if(FD(e)||qD(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a RoadmapPricingWaitlistView the Crate

When agents flood production, hold the line.

Floodwall meters agent-generated infrastructure changes, verifies each intent at a policy gate, and records every admit, defer, and reject in a tamper-evident ledger.

The processing line

Every intent gets a verdict. Production only sees the admitted ones.

On hold
0Deferred intents wait here
shipped
0.1
dependencies
0
tests
267

  1. Intents
  2. Admission
  3. Scheduler
  4. Gate
  5. Ledger
  6. Production

Hold: deferred intents wait for human release or expiry. The ledger records every verdict and outcome. Green boxes show checked, recorded changes in production.

The model

Agents submit intents. Floodwall governs.

Admission

Per-agent token buckets and a bounded priority queue keep one loop from taking the whole lane.

Scheduler

Wide changes run alone, narrow ones run in parallel per resource, and a waiting change is never overtaken by lower-priority work.

Gate

A deny-overrides policy stack and a conflict check rule on every intent. Deferred changes wait on hold for a human.

Ledger

Every verdict is appended to a hash chain so retroactive edits break verification.

Policy gate

Many policies. One verdict.

Reference policies cover global destructive actions, blast-radius urgency, and resource allowlists. The policy trait stays small so teams can add rules that match their own release discipline. A deferred change is held, not dropped, until a human releases or expires it.

Reference policiesHarshest verdict wins
  • no-global-destroy

    Destructive global changes need human sign-off.

    reject
  • blast-needs-priority

    The wider the blast radius, the more urgent a change must be.

    reject
  • resource-allowlist

    Resources off the list wait on hold for a human.

    defer
Add your ownimpl Policy for YourRule

Tamper-evident ledger

Chained records. Independent proof.

Every decision, release, expiry, and outcome is appended with its evidence: the action, the reason, and each policy’s verdict. A retroactive edit anywhere in history breaks the chain.

  • SHA-256 hash chain: each record folds in the previous digest.
  • With a keyring, Ed25519 signatures prove which agent asked for what.
  • verify() replays the chain; verify_signatures() checks every signer.
Recent recordsValid chain
  1. admitreconciler-7scale web
  2. deferdeployerbilling off allowlist
  3. rejectchaos-loopglobal destroy
  4. admitautoscalercache replicas
  5. rejectcost-botbulk region drain
  6. admitmigratorapi schema v12
Head digest189f5d55…0f84c3ca

Roadmap

Ledger on disk. Replay comes next.

  1. 0.1

    The wall

    Intent model, admission control, policy gate, ledger, and demo.

  2. 0.2

    Scheduler

    Wide changes serialize, narrow work runs in parallel per resource, and contradictions wait for a human.

  3. 0.3

    Trustworthy ledger

    SHA-256 chain, signed records, and Merkle checkpoints.

  4. 0.4

    Replay

    Durable append-only state that rebuilds the plane after restart.

Early access

Gate your agents. Join the waitlist.

Sign up with your email, and we will let you in as early access opens.

Join the waitlist

Already have an account? Sign in.

+

When agents flood production, hold the line.

Floodwall meters agent-generated infrastructure changes, verifies each intent at a policy gate, and records every admit, defer, and reject in a tamper-evident ledger.

The processing line

Every intent gets a verdict. Production only sees the admitted ones.

On hold
0Deferred intents wait here
shipped
0.1
dependencies
0
tests
267

  1. Intents
  2. Admission
  3. Scheduler
  4. Gate
  5. Ledger
  6. Production

Hold: deferred intents wait for human release or expiry. The ledger records every verdict and outcome. Green boxes show checked, recorded changes in production.

The model

Agents submit intents. Floodwall governs.

Admission

Per-agent token buckets and a bounded priority queue keep one loop from taking the whole lane.

Scheduler

Wide changes run alone, narrow ones run in parallel per resource, and a waiting change is never overtaken by lower-priority work.

Gate

A deny-overrides policy stack and a conflict check rule on every intent. Deferred changes wait on hold for a human.

Ledger

Every verdict is appended to a hash chain so retroactive edits break verification.

Policy gate

Many policies. One verdict.

Reference policies cover global destructive actions, blast-radius urgency, and resource allowlists. The policy trait stays small so teams can add rules that match their own release discipline. A deferred change is held, not dropped, until a human releases or expires it.

Reference policiesHarshest verdict wins
  • no-global-destroy

    Destructive global changes need human sign-off.

    reject
  • blast-needs-priority

    The wider the blast radius, the more urgent a change must be.

    reject
  • resource-allowlist

    Resources off the list wait on hold for a human.

    defer
Add your ownimpl Policy for YourRule

Tamper-evident ledger

Chained records. Independent proof.

Every decision, release, expiry, and outcome is appended with its evidence: the action, the reason, and each policy’s verdict. A retroactive edit anywhere in history breaks the chain.

  • SHA-256 hash chain: each record folds in the previous digest.
  • With a keyring, Ed25519 signatures prove which agent asked for what.
  • verify() replays the chain; verify_signatures() checks every signer.
Recent recordsValid chain
  1. admitreconciler-7scale web
  2. deferdeployerbilling off allowlist
  3. rejectchaos-loopglobal destroy
  4. admitautoscalercache replicas
  5. rejectcost-botbulk region drain
  6. admitmigratorapi schema v12
Head digest189f5d55…0f84c3ca

Roadmap

Ledger on disk. Replay comes next.

  1. 0.1

    The wall

    Intent model, admission control, policy gate, ledger, and demo.

  2. 0.2

    Scheduler

    Wide changes serialize, narrow work runs in parallel per resource, and contradictions wait for a human.

  3. 0.3

    Trustworthy ledger

    SHA-256 chain, signed records, and Merkle checkpoints.

  4. 0.4

    Replay

    Durable append-only state that rebuilds the plane after restart.

Early access

Gate your agents. Join the waitlist.

Sign up with your email, and we will let you in as early access opens.

Join the waitlist

Already have an account? Sign in.

diff --git a/site/src/components/auth/AuthCodeForm.tsx b/site/src/components/auth/AuthCodeForm.tsx index ebd0493..da27d49 100644 --- a/site/src/components/auth/AuthCodeForm.tsx +++ b/site/src/components/auth/AuthCodeForm.tsx @@ -1,6 +1,6 @@ import { useEffect, useRef, useState, type FormEvent } from "react"; import { useNavigate, useSearchParams } from "react-router"; -import { AUTH_COPY, CODE_LENGTH, NEXT_PARAM, RESEND_COOLDOWN_MS } from "../../constants/auth"; +import { AUTH_COPY, CODE_LENGTH, NAME_MAX_LENGTH, NEXT_PARAM, RESEND_COOLDOWN_MS } from "../../constants/auth"; import { authClient, safeNext } from "../../helpers/auth"; import { authCard, authNote, pillOutline, pillSolid } from "../../styles/classes"; import { Button } from "../ui/button"; @@ -18,12 +18,13 @@ type Busy = "send" | "resend" | "verify" | null; /** * Sign-in in two steps on one card: an email address, then the six-digit code - * sent to it. Shared by /login and /signup, which differ only in where a new - * session goes next. + * sent to it. Shared by /login and /signup, which differ in where a new + * session goes next, and in the name sign-up can start the account with. */ export function AuthCodeForm({ page }: { page: "login" | "signup" }) { const navigate = useNavigate(); const [params] = useSearchParams(); + const [name, setName] = useState(""); const [email, setEmail] = useState(""); const [code, setCode] = useState(""); const [sentTo, setSentTo] = useState(""); @@ -31,13 +32,13 @@ export function AuthCodeForm({ page }: { page: "login" | "signup" }) { const [demoCode, setDemoCode] = useState(""); const [busy, setBusy] = useState(null); const [status, setStatus] = useState(""); - const emailInput = useRef(null); + const firstInput = useRef(null); const codeInput = useRef(null); const codeShown = sentTo !== ""; // Each step puts the cursor where the next thing is typed. useEffect(() => { - (codeShown ? codeInput : emailInput).current?.focus(); + (codeShown ? codeInput : firstInput).current?.focus(); }, [codeShown]); async function run(kind: Exclude, work: () => Promise) { @@ -79,7 +80,7 @@ export function AuthCodeForm({ page }: { page: "login" | "signup" }) { function onVerify(event: FormEvent) { event.preventDefault(); void run("verify", async () => { - await authClient.verifyCode(sentTo, code); + await authClient.verifyCode(sentTo, code, page === "signup" ? name.trim() || undefined : undefined); navigate(safeNext(page, params.get(NEXT_PARAM)), { replace: true }); }); } @@ -133,12 +134,29 @@ export function AuthCodeForm({ page }: { page: "login" | "signup" }) { ) : (
+ {page === "signup" && ( +
+ + setName(e.target.value)} + /> +
+ )}
- {session.user.email} + {accountLabel(session.user)} + + {open && ( + +

+ {COPY.signedInAs} {accountLabel(user)} + {user.name && {user.email}} +

+
    +
  • + {COPY.account} +
  • +
  • + {/* A waiting account's console is the waitlist page, so the menu says so. */} + {user.waiting ? ( + {COPY.waitlist} + ) : ( + {COPY.console} + )} +
  • +
  • + {/* aria-disabled, not disabled: disabling the focused button would drop focus, and with + it the menu, before a failure could be shown in it. */} + +
  • +
+

+ {status} +

+
+ )} +
+
+ ); +} diff --git a/site/src/components/shared/SiteHeader.tsx b/site/src/components/shared/SiteHeader.tsx index 99a8e43..8b3de3f 100644 --- a/site/src/components/shared/SiteHeader.tsx +++ b/site/src/components/shared/SiteHeader.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState, type FocusEvent, type RefObject } from "react"; +import { useCallback, useId, useLayoutEffect, useRef, useState, type RefObject } from "react"; import { AnimatePresence, motion } from "motion/react"; import { ArrowDown01Icon, @@ -11,9 +11,11 @@ import { } from "@hugeicons/core-free-icons"; import { NAV_EXPLAINERS, NAV_LINKS, NAV_SECTION_IDS, REPO_URL } from "../../constants/links"; import { useActiveSection } from "../../hooks/useActiveSection"; +import { useDismiss } from "../../hooks/useDismiss"; import { useFluidHover, useRegisterFluidHoverItem } from "../../hooks/use-fluid-hover"; -import { spring } from "../../lib/springs"; +import { panelMotion } from "../../lib/panel"; import { FluidHoverHighlight } from "../fluid-hover-highlight"; +import { HeaderAccount } from "./HeaderAccount"; import { Icon } from "./Icon"; import { SiteBrandMark } from "./SiteBrandMark"; @@ -27,13 +29,6 @@ const EXPLAINER_ICONS = { ledger: Link04Icon, } as const; -/** - * The panel's entrance: it drops 4px into place and grows from 98% at its top edge. A spring, so a - * close that interrupts an open reverses from where it is; the close is the tier's quicker tween. - */ -const PANEL_SHOWN = { opacity: 1, y: 0, scale: 1 }; -const PANEL_HIDDEN = { opacity: 0, y: -4, scale: 0.98 }; - type RegisterItem = (index: number, element: HTMLElement | null) => void; /** A top-level item's hover box: the element the rubber-band highlight springs to. */ @@ -49,7 +44,8 @@ function NavItemBox({ index, registerItem, label }: { index: number; registerIte /** * The sticky header on the landing page and /pricing: the logo (which goes home), a "How it works" - * menu over the sections that explain the wall, then Roadmap, Pricing and Waitlist. One hover + * menu over the sections that explain the wall, then Roadmap, Pricing and Waitlist, and at the + * right the account (Sign in, or who is signed in: HeaderAccount) and the GitHub button. One hover * highlight glides between the top-level items, and another between the panel's sections. On the * landing page the current item follows the section in view; /pricing (`onLanding` false) is the * only other page with this header, so there Pricing is current and section links lead to "/#…". @@ -64,28 +60,9 @@ export function SiteHeader({ onLanding = true }: { onLanding?: boolean }) { const menuButtonRef = useRef(null); const menuId = useId(); - // An outside press or Escape closes the menu; Escape hands focus back to its button. - useEffect(() => { - if (!menuOpen) return; - const onPointerDown = (event: PointerEvent) => { - if (!menuRef.current?.contains(event.target as Node)) setMenuOpen(false); - }; - const onKeyDown = (event: KeyboardEvent) => { - if (event.key !== "Escape") return; - setMenuOpen(false); - menuButtonRef.current?.focus(); - }; - document.addEventListener("pointerdown", onPointerDown); - document.addEventListener("keydown", onKeyDown); - return () => { - document.removeEventListener("pointerdown", onPointerDown); - document.removeEventListener("keydown", onKeyDown); - }; - }, [menuOpen]); - // Tabbing out of the menu closes it too. - const onMenuBlur = (event: FocusEvent) => { - if (!event.currentTarget.contains(event.relatedTarget as Node | null)) setMenuOpen(false); - }; + // An outside press, Escape or tabbing out closes the menu; Escape hands focus back to its button. + const closeMenu = useCallback(() => setMenuOpen(false), []); + const onMenuBlur = useDismiss(menuOpen, closeMenu, menuRef, menuButtonRef); // The top-level strip: its items' hover boxes touch, so the highlight glides from one to the next. const linksRef = useRef(null); @@ -186,14 +163,7 @@ export function SiteHeader({ onLanding = true }: { onLanding?: boolean }) { {menuOpen && ( - + setMenuOpen(false)} /> )} @@ -215,11 +185,14 @@ export function SiteHeader({ onLanding = true }: { onLanding?: boolean }) { })} + {user.name && {user.name}} {user.approvedBy && {ADMIN_COPY.approvedBy(user.approvedBy)}} {adminDate(user.createdAt)} diff --git a/site/src/styles/classes.ts b/site/src/styles/classes.ts index 290f5db..7d641df 100644 --- a/site/src/styles/classes.ts +++ b/site/src/styles/classes.ts @@ -18,7 +18,7 @@ const buttonBase = export const pillSolid = `${buttonBase} border border-transparent bg-action text-action-text hover:bg-action-hover`; /** The outlined button beside it, for the quieter actions. */ -export const pillOutline = `${buttonBase} border border-line-strong bg-surface text-ink hover:border-ink`; +export const pillOutline = `${buttonBase} border border-line-strong bg-surface text-ink hover:border-ink hover:bg-surface`; /** The sign-in form or account details: one row of the sign-in sheet, so it adds no frame of its own. */ export const authCard = "gap-5 rounded-none border-0 bg-transparent py-0 text-base text-ink ring-0"; diff --git a/site/src/styles/landing/header.css b/site/src/styles/landing/header.css index 69725de..8736c36 100644 --- a/site/src/styles/landing/header.css +++ b/site/src/styles/landing/header.css @@ -149,8 +149,137 @@ } .site-header .button { gap: 12px; } .site-header .button svg { width: 16px; height: 16px; } + +/* The right of the bar: the account slot, then the GitHub button. */ +.nav-actions { + display: flex; + align-items: stretch; + align-self: stretch; + gap: 8px; +} +.nav-actions > .button { align-self: center; } +/* The slot keeps one width whatever it holds (nothing while the session loads, Sign in, or the + account), so the links don't move when the service answers. */ +.nav-account { + --account-slot: 200px; + position: relative; + display: flex; + align-items: center; + justify-content: flex-end; + width: var(--account-slot); +} +.nav-sign-in, +.nav-account-button { + display: inline-flex; + align-items: center; + min-height: 44px; + padding: 0 12px; + color: var(--ink); + font-size: 15px; + font-weight: 500; +} +@media (hover: hover) and (pointer: fine) { + .nav-sign-in:hover { text-decoration: underline; text-underline-offset: 4px; } + .nav-account-button:hover .nav-account-name { color: var(--ink); } +} +.nav-account-button { + gap: 8px; + max-width: 100%; + border: 0; + background: none; + font-family: inherit; + cursor: pointer; +} +/* The initials on the ink square, the system's one emphasis. */ +.nav-avatar { + display: grid; + flex: none; + place-items: center; + width: 30px; + height: 30px; + background: var(--ink); + color: var(--paper); + font-size: 13px; + font-weight: 600; + line-height: 1; +} +.nav-account-name { + min-width: 0; + overflow: hidden; + color: var(--muted); + text-overflow: ellipsis; + white-space: nowrap; + transition: color var(--motion-fast) var(--ease-out); +} +.nav-account-button[aria-expanded="true"] .nav-account-name { color: var(--ink); } +.nav-account-button[aria-expanded="true"] .nav-menu-chevron { transform: rotate(180deg); } +/* The account menu: one ruled white sheet under the header, against the right edge of the slot. */ +.nav-account-panel { + position: absolute; + top: 100%; + right: 0; + z-index: 10; + width: min(300px, calc(100vw - 32px)); + border: 1px solid var(--line); + background: var(--paper); + transform-origin: top right; +} +.nav-account-who { + margin: 0; + padding: 16px 20px; + border-bottom: 1px solid var(--line); + color: var(--muted); + font-size: var(--text-sm); + overflow-wrap: anywhere; +} +.nav-account-who strong { display: block; margin-top: 2px; color: var(--ink); font-weight: 600; } +.nav-account-email { display: block; } +.nav-account-links { margin: 0; padding: 0; list-style: none; } +.nav-account-links li:last-child { border-top: 1px solid var(--line); } +.nav-account-links a, +.nav-account-links button { + display: flex; + align-items: center; + width: 100%; + min-height: 44px; + padding: 0 20px; + border: 0; + background: none; + color: var(--ink); + font: inherit; + font-size: 15px; + text-align: start; + cursor: pointer; + transition: background var(--motion-fast) var(--ease-out); +} +.nav-account-links button[aria-disabled="true"] { color: var(--muted); cursor: default; } +@media (hover: hover) and (pointer: fine) { + .nav-account-links a:hover, + .nav-account-links button:not([aria-disabled="true"]):hover { background: var(--surface); } +} +.nav-account-links a:focus-visible, +.nav-account-links button:focus-visible, +.nav-sign-in:focus-visible, +.nav-account-button:focus-visible { outline-offset: -4px; } +.nav-account-status { margin: 0; padding: 0 20px 14px; color: var(--muted); font-size: var(--text-sm); } +.nav-account-status:empty { display: none; } + @media (max-width: 1100px) { .nav-bar { gap: 16px; } + /* The slot narrows to the initials, and the GitHub button to its mark (the label stays its name). */ + .nav-account { --account-slot: 84px; } + .nav-account-name { display: none; } + .site-header .nav-crate { padding-inline: 13px; } + .nav-crate .button-arrow { display: none; } + .nav-crate .button-brand { margin: 0; } + .nav-crate-label { + position: absolute; + width: 1px; + height: 1px; + overflow: hidden; + clip-path: inset(50%); + white-space: nowrap; + } } @media (max-width: 850px) { :root { --header-height: 128px; } @@ -162,7 +291,10 @@ /* The panel spans the links row, under the whole header. */ .nav-menu { position: static; } .nav-menu-panel { right: 0; left: 0; width: auto; transform-origin: top center; } + /* The account menu hangs from the header's right edge, under both rows, not from the narrow slot. */ + .nav-account { position: static; } .site-header .button { padding-inline: 14px; font-size: var(--text-xs); } + .nav-sign-in { font-size: var(--text-sm); } } @media (max-width: 600px) { .nav-menu-grid { grid-template-columns: minmax(0, 1fr); } diff --git a/site/src/types/auth.ts b/site/src/types/auth.ts index 699cec8..9ddbdee 100644 --- a/site/src/types/auth.ts +++ b/site/src/types/auth.ts @@ -2,15 +2,17 @@ // codes come from: the sign-in service, or the in-browser demo without one. /** - * `waiting`: the account is on the waitlist, so it sees the waitlist page - * instead of the console. `admin`: it can approve the waitlist. Both are - * always false in the demo. + * `name`: what the account goes by, or null until one is given; the site + * shows the address instead. `waiting`: the account is on the waitlist, so it + * sees the waitlist page instead of the console. `admin`: it can approve the + * waitlist. Both are always false in the demo. */ -export type AuthUser = { email: string; waiting: boolean; admin: boolean }; +export type AuthUser = { email: string; name: string | null; waiting: boolean; admin: boolean }; /** An account as the admin page lists it. */ export type AdminAccount = { email: string; + name: string | null; status: "waiting" | "approved"; admin: boolean; createdAt: number; @@ -35,10 +37,15 @@ export type AuthClient = { * code; the demo returns it so the page can show it. */ sendCode: (email: string) => Promise<{ code?: string }>; - /** Checks the code and starts a session. Signing in with a new address creates the account. */ - verifyCode: (email: string, code: string) => Promise; + /** + * Checks the code and starts a session. Signing in with a new address creates the account; + * `name`, from sign-up, names it (or an account with no name yet). + */ + verifyCode: (email: string, code: string, name?: string) => Promise; /** Who is signed in, or null when no one is. Throws when the service can't be asked. */ getUser: () => Promise; + /** Sets the signed-in account's name, or clears it with an empty one, and returns the account. */ + updateProfile: (name: string) => Promise; /** Ends the session, or throws if it couldn't. */ signOut: () => Promise; };