okengine 0.18.5 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +18 -10
- package/README.md +2 -2
- package/package.json +51 -50
- package/site/content/docs/ai/llms-txt.mdx +1 -1
- package/site/content/docs/ai/meta.json +1 -1
- package/site/content/docs/ai/skills.mdx +4 -1
- package/site/content/docs/ai/try-it.mdx +58 -0
- package/site/content/docs/client/auth.mdx +208 -0
- package/site/content/docs/client/calling.mdx +451 -0
- package/site/content/docs/client/index.mdx +209 -0
- package/site/content/docs/client/live.mdx +234 -0
- package/site/content/docs/client/meta.json +5 -0
- package/site/content/docs/client/react.mdx +249 -0
- package/site/content/docs/elements/ai/agents.mdx +232 -0
- package/site/content/docs/elements/ai/index.mdx +341 -0
- package/site/content/docs/elements/ai/mcp.mdx +275 -0
- package/site/content/docs/elements/ai/meta.json +5 -0
- package/site/content/docs/elements/ai/models.mdx +283 -0
- package/site/content/docs/elements/ai/prompts.mdx +256 -0
- package/site/content/docs/elements/channel/email.mdx +266 -0
- package/site/content/docs/elements/channel/index.mdx +344 -0
- package/site/content/docs/elements/channel/meta.json +5 -0
- package/site/content/docs/elements/channel/push.mdx +218 -0
- package/site/content/docs/elements/channel/receipts.mdx +206 -0
- package/site/content/docs/elements/channel/sms.mdx +264 -0
- package/site/content/docs/elements/channel/whatsapp.mdx +220 -0
- package/site/content/docs/elements/clock/index.mdx +300 -0
- package/site/content/docs/elements/clock/meta.json +5 -0
- package/site/content/docs/elements/clock/schedules.mdx +508 -0
- package/site/content/docs/elements/clock/sleep.mdx +445 -0
- package/site/content/docs/elements/flow/consumers.mdx +707 -0
- package/site/content/docs/elements/flow/http.mdx +1080 -0
- package/site/content/docs/elements/flow/index.mdx +618 -0
- package/site/content/docs/elements/flow/meta.json +5 -0
- package/site/content/docs/elements/flow/routing.mdx +559 -0
- package/site/content/docs/elements/flow/workflows.mdx +640 -0
- package/site/content/docs/elements/gate/auth.mdx +371 -0
- package/site/content/docs/elements/gate/authorization.mdx +298 -0
- package/site/content/docs/elements/gate/index.mdx +418 -0
- package/site/content/docs/elements/gate/meta.json +5 -0
- package/site/content/docs/elements/gate/rate-limits.mdx +365 -0
- package/site/content/docs/elements/gate/rls.mdx +303 -0
- package/site/content/docs/elements/gate/tenancy.mdx +372 -0
- package/site/content/docs/elements/index.mdx +20 -10
- package/site/content/docs/elements/signal/broadcast.mdx +517 -0
- package/site/content/docs/elements/signal/index.mdx +352 -0
- package/site/content/docs/elements/signal/live.mdx +590 -0
- package/site/content/docs/elements/signal/meta.json +5 -0
- package/site/content/docs/elements/signal/once.mdx +596 -0
- package/site/content/docs/elements/store/files.mdx +659 -0
- package/site/content/docs/elements/store/index.mdx +310 -0
- package/site/content/docs/elements/store/kv.mdx +629 -0
- package/site/content/docs/elements/store/meta.json +5 -0
- package/site/content/docs/elements/store/search.mdx +946 -0
- package/site/content/docs/elements/store/sql.mdx +937 -0
- package/site/content/docs/elements/vault/config.mdx +256 -0
- package/site/content/docs/elements/vault/index.mdx +356 -0
- package/site/content/docs/elements/vault/meta.json +5 -0
- package/site/content/docs/elements/vault/rotation.mdx +273 -0
- package/site/content/docs/elements/vault/secrets.mdx +285 -0
- package/site/content/docs/index.mdx +63 -36
- package/site/content/docs/meta.json +8 -7
- package/site/content/docs/plugins/cors.mdx +2 -1
- package/site/content/docs/plugins/csrf.mdx +4 -1
- package/site/content/docs/plugins/headers.mdx +2 -1
- package/site/content/docs/plugins/ip-allowlist.mdx +2 -1
- package/site/content/docs/plugins/magic-link.mdx +6 -0
- package/site/content/docs/plugins/maintenance-mode.mdx +2 -1
- package/site/content/docs/plugins/oauth.mdx +1 -1
- package/site/content/docs/plugins/otp.mdx +12 -1
- package/site/content/docs/plugins/passkey.mdx +39 -15
- package/site/content/docs/plugins/two-factor.mdx +91 -34
- package/site/content/docs/plugins/username.mdx +1 -1
- package/site/content/docs/recipes/caddy.mdx +3 -3
- package/site/content/docs/recipes/index.mdx +18 -28
- package/site/content/docs/recipes/mailpit.mdx +1 -1
- package/site/content/docs/recipes/meilisearch.mdx +3 -3
- package/site/content/docs/recipes/meta.json +1 -4
- package/site/content/docs/recipes/nginx.mdx +2 -2
- package/site/content/docs/recipes/openrouter.mdx +283 -0
- package/site/content/docs/recipes/pgdog.mdx +3 -3
- package/site/content/docs/recipes/postgres.mdx +1 -2
- package/site/content/docs/recipes/rustfs.mdx +2 -2
- package/site/content/docs/recipes/traefik.mdx +3 -3
- package/site/content/docs/reference/cli.mdx +231 -0
- package/site/content/docs/reference/configuration.mdx +30 -10
- package/site/content/docs/reference/environment-variables.mdx +93 -20
- package/site/content/docs/reference/errors.mdx +132 -29
- package/site/content/docs/reference/fx.mdx +137 -73
- package/site/content/docs/reference/index.mdx +13 -21
- package/site/content/docs/reference/meta.json +4 -5
- package/site/content/docs/reference/okid.mdx +42 -17
- package/site/content/docs/reference/plugins.mdx +4 -3
- package/site/content/docs/reference/security.mdx +197 -0
- package/site/content/docs/understand/meta.json +5 -0
- package/site/content/docs/understand/the-anatomy.mdx +132 -0
- package/site/content/docs/understand/the-model.mdx +32 -0
- package/site/content/docs/understand/the-problem.mdx +74 -0
- package/site/content/docs/understand/the-vocabulary.mdx +26 -0
- package/src/auth/api-keys.ts +2 -1
- package/src/auth/bindings.ts +64 -16
- package/src/auth/gate-auth.test.ts +6 -1
- package/src/auth/identity.ts +152 -5
- package/src/auth/index.ts +29 -0
- package/src/auth/invites.ts +2 -1
- package/src/auth/method-context.ts +41 -0
- package/src/auth/oauth-as/crypto.ts +2 -1
- package/src/auth/oauth-as/stores.ts +2 -1
- package/src/auth/operator.ts +2 -1
- package/src/auth/sessions-jwt.test.ts +77 -0
- package/src/auth/sessions.ts +20 -4
- package/src/auth/tenants.ts +3 -2
- package/src/auth/two-factor-challenge.test.ts +61 -0
- package/src/auth/two-factor-challenge.ts +284 -0
- package/src/auth/verification.ts +5 -0
- package/src/bench/REPORT.md +49 -0
- package/src/bench/g03-signal-once.bench.ts +1 -1
- package/src/bench/g10-observability-contention.bench.ts +1 -1
- package/src/bench/g17-hybrid-search.bench.ts +572 -0
- package/src/bench/load-app.ts +2 -10
- package/src/cli/ai-setup/ai-setup.test.ts +331 -42
- package/src/cli/ai-setup/apply.ts +294 -52
- package/src/cli/ai-setup/catalog.ts +238 -1342
- package/src/cli/ai-setup/index.ts +14 -99
- package/src/cli/ai-setup/prompts.ts +60 -443
- package/src/cli/ask-seed.test.ts +96 -0
- package/src/cli/ask-seed.ts +82 -0
- package/src/cli/ask-vault-gaps.test.ts +84 -0
- package/src/cli/ask-vault-gaps.ts +146 -0
- package/src/cli/build.ts +2 -2
- package/src/cli/client-add.test.ts +26 -1
- package/src/cli/client-add.ts +106 -27
- package/src/cli/db-seed.ts +2 -0
- package/src/cli/db.ts +150 -11
- package/src/cli/dev.ts +119 -211
- package/src/cli/docker-clean.ts +2 -2
- package/src/cli/docker-cli.test.ts +1 -1
- package/src/cli/doctor-diff.ts +4 -2
- package/src/cli/doctor-pii.test.ts +1 -1
- package/src/cli/doctor.ts +14 -1
- package/src/cli/hero-meta.test.ts +4 -2
- package/src/cli/load-config.images.test.ts +8 -10
- package/src/cli/load-config.ts +1 -1
- package/src/cli/registry.ts +22 -10
- package/src/cli/replay.ts +3 -1
- package/src/cli/start.ts +1 -1
- package/src/cli/tui/keys.ts +2 -3
- package/src/client/auth/cookies.ts +74 -0
- package/src/client/auth/create-auth-client.ts +636 -0
- package/src/client/auth/denials.ts +99 -0
- package/src/client/auth/session.ts +283 -0
- package/src/client/auth.test.ts +251 -0
- package/src/client/auth.ts +39 -114
- package/src/client/create-with-session.ts +245 -0
- package/src/client/create.ts +51 -5
- package/src/client/index.ts +11 -1
- package/src/client/live.ts +11 -79
- package/src/client/notes-contract.test.ts +5 -10
- package/src/client/sse.ts +137 -0
- package/src/client/stream.ts +147 -0
- package/src/client/transport.test.ts +32 -0
- package/src/client/transport.ts +123 -26
- package/src/client/types.ts +118 -14
- package/src/client-react/index.ts +185 -24
- package/src/client-react/use-live-query.ts +13 -3
- package/src/compiler/aot.test.ts +7 -4
- package/src/compiler/effects-embed.test.ts +56 -0
- package/src/compiler/effects-fetch.test.ts +43 -0
- package/src/compiler/effects-infer.ts +58 -2
- package/src/compiler/extract.test.ts +257 -43
- package/src/compiler/extract.ts +566 -48
- package/src/compiler/fixtures/skyport/src/flows/bookings/index.ts +7 -4
- package/src/compiler/fixtures/skyport/src/flows/bookings/signals.ts +2 -8
- package/src/compiler/fixtures/skyport.expected.json +4 -4
- package/src/compiler/fixtures/triggers/five-triggers.ts +14 -10
- package/src/compiler/response.ts +2 -2
- package/src/compiler/search-writer-isolation.test.ts +40 -0
- package/src/config/index.ts +11 -0
- package/src/console/server/app.ts +17 -23
- package/src/console/server/bind.ts +4 -0
- package/src/console/server/console.test.ts +2 -2
- package/src/console/server/flows-invoke.test.ts +50 -34
- package/src/console/server/flows.ts +436 -255
- package/src/console/server/runs-ingest.test.ts +6 -3
- package/src/console/server/serve.ts +1 -1
- package/src/console/server/signals.test.ts +1 -5
- package/src/console/server/signals.ts +8 -6
- package/src/console/server/state.ts +6 -1
- package/src/console/server/store.ts +1 -1
- package/src/console/ui-next/dist/assets/FileExportIcon-Ck-5od4R.js +1 -0
- package/src/console/ui-next/dist/assets/MoreHorizontalCircle01Icon-gMNGsE37.js +1 -0
- package/src/console/ui-next/dist/assets/PlusSignIcon-CwG3nxfu.js +1 -0
- package/src/console/ui-next/dist/assets/UnavailableIcon-D9cvHVPr.js +1 -0
- package/src/console/ui-next/dist/assets/UserIcon-DaE2PB5_.js +1 -0
- package/src/console/ui-next/dist/assets/access-page-DFeymU07.js +4 -0
- package/src/console/ui-next/dist/assets/agent-disclosure-U1rdfblp.js +1 -0
- package/src/console/ui-next/dist/assets/cache-glyph-BeFJeqBG.js +1 -0
- package/src/console/ui-next/dist/assets/call-pii-button-CVAONPii.js +1 -0
- package/src/console/ui-next/dist/assets/collapsible-D2A6NJ-3.js +1 -0
- package/src/console/ui-next/dist/assets/copy-inline-button-CAYD18cr.js +1 -0
- package/src/console/ui-next/dist/assets/dagre.esm-B1_XeuLP.js +1 -0
- package/src/console/ui-next/dist/assets/detail-header-DVWNjWjg.js +1 -0
- package/src/console/ui-next/dist/assets/dropdown-menu-4h2LOVXM.js +1 -0
- package/src/console/ui-next/dist/assets/duration-tone-Cgk_h5ja.js +9 -0
- package/src/console/ui-next/dist/assets/element-icons-BI8cJgdh.js +1 -0
- package/src/console/ui-next/dist/assets/explorer-empty-CJs5A-wm.js +1 -0
- package/src/console/ui-next/dist/assets/flows-page-Dss7941e.js +1 -0
- package/src/console/ui-next/dist/assets/highlighted-json-MYZQtRnw.js +154 -0
- package/src/console/ui-next/dist/assets/http-method-Jrh39p7A.js +1 -0
- package/src/console/ui-next/dist/assets/index-D0zS5rKO.css +2 -0
- package/src/console/ui-next/dist/assets/index-DXP2dBIF.js +63 -0
- package/src/console/ui-next/dist/assets/observability-page-HvolXxTI.js +4 -0
- package/src/console/ui-next/dist/assets/react-dom-Ddte4I-Q.js +9 -0
- package/src/console/ui-next/dist/assets/replica-lag-CSh2dzrb.js +18 -0
- package/src/console/ui-next/dist/assets/request-meta-BatF8KrK.js +1 -0
- package/src/console/ui-next/dist/assets/shortcut-keys-3ILd8oGn.js +1 -0
- package/src/console/ui-next/dist/assets/{sql-BskegiFM.js → sql-BsFa4tDR.js} +1 -1
- package/src/console/ui-next/dist/assets/store-page-eiKiHnNe.js +41 -0
- package/src/console/ui-next/dist/assets/trace-detail-sheet-CZkMeKS-.js +2 -0
- package/src/console/ui-next/dist/assets/tree-expand-toggle-CW8y5A2h.js +55 -0
- package/src/console/ui-next/dist/assets/units-page-B_RWJrEO.js +1 -0
- package/src/console/ui-next/dist/assets/{use-vault-list-uk4WVboC.js → use-vault-list-CT4-gajj.js} +1 -1
- package/src/console/ui-next/dist/assets/vault-page-CWrg-A68.js +2 -0
- package/src/console/ui-next/dist/assets/xyflow-CSyC6ryz.css +1 -0
- package/src/console/ui-next/dist/assets/xyflow-yApv7D4e.js +7 -0
- package/src/console/ui-next/dist/index.html +6 -13
- package/src/console/ui-next/seed-invoke-host.ts +21 -18
- package/src/console/ui-next/src/client.ts +7 -2
- package/src/console/ui-next/src/features/flows/graph/element-map.ts +2 -0
- package/src/console/ui-next/src/features/flows/traces/effect-kind.ts +12 -2
- package/src/console/ui-next/src/features/flows/traces/effect-summary.ts +4 -0
- package/src/console/ui-next/src/features/flows/traces/trace-detail-sheet.tsx +8 -0
- package/src/console/ui-next/src/features/flows/traces/waterfall-bars.ts +4 -0
- package/src/console/ui-next/src/features/flows/traces/waterfall-tooltip.ts +9 -3
- package/src/console/ui-next/src/features/store/detail/reveal-cell.tsx +7 -11
- package/src/console/ui-next/src/features/store/detail/store-row-detail-sheet.tsx +2 -2
- package/src/console/ui-next/src/features/store/lib/fields-from-table.ts +2 -0
- package/src/console/ui-next/src/features/store/lib/grid-model.test.ts +25 -1
- package/src/console/ui-next/src/features/store/lib/grid-model.ts +36 -1
- package/src/console/ui-next/src/features/store/query/query-results.tsx +3 -3
- package/src/console/ui-next/src/features/units/detail/effects-summary.tsx +2 -0
- package/src/console/ui-next/src/features/units/lib/call-read-safe.ts +3 -1
- package/src/console/ui-next/src/features/units/lib/fields-from-schema.ts +6 -0
- package/src/docker/ai-model-status.test.ts +1 -12
- package/src/docker/ai-model-status.ts +10 -38
- package/src/docker/compose-up.test.ts +100 -0
- package/src/docker/compose-up.ts +292 -0
- package/src/docker/compose.ts +4 -14
- package/src/docker/derive.ts +9 -34
- package/src/docker/docker.test.ts +16 -261
- package/src/docker/images-config.test.ts +13 -25
- package/src/docker/index.ts +1 -24
- package/src/docker/recipes/index.ts +0 -23
- package/src/docker/recipes/pgdog.ts +6 -4
- package/src/docker/stack-id.test.ts +2 -2
- package/src/docker/stack-id.ts +0 -1
- package/src/docker/types.ts +2 -2
- package/src/drivers/ai-anthropic.ts +10 -0
- package/src/drivers/ai-openai-compatible.ts +34 -7
- package/src/drivers/ai-providers.test.ts +0 -107
- package/src/drivers/ai-stream.test.ts +0 -34
- package/src/drivers/ai-types.ts +17 -8
- package/src/drivers/channel-fcm.ts +6 -1
- package/src/drivers/channel-msegat.ts +6 -1
- package/src/drivers/channel-resend.ts +5 -1
- package/src/drivers/channel-smtp.ts +5 -1
- package/src/drivers/channel-sndr.ts +10 -1
- package/src/drivers/channel-taqnyat-mail.ts +5 -1
- package/src/drivers/channel-taqnyat-whatsapp.ts +6 -1
- package/src/drivers/channel-taqnyat.ts +6 -1
- package/src/drivers/channel-types.ts +10 -0
- package/src/drivers/channel-unifonic.ts +6 -1
- package/src/drivers/channel-wa-cloud.ts +6 -1
- package/src/drivers/channel-webpush.ts +6 -1
- package/src/drivers/external.ts +33 -0
- package/src/drivers/index.ts +0 -10
- package/src/drivers/meilisearch.ts +6 -0
- package/src/drivers/oauth-types.ts +4 -0
- package/src/drivers/postgres.test.ts +74 -3
- package/src/drivers/postgres.ts +175 -6
- package/src/drivers/signal-types.ts +5 -5
- package/src/drivers/types.ts +7 -0
- package/src/drivers/vault-types.ts +5 -0
- package/src/elements/ai/declare.ts +17 -4
- package/src/elements/ai/eval.ts +1 -1
- package/src/elements/ai/mcp-http.ts +1 -1
- package/src/elements/ai/pii.ts +1 -1
- package/src/elements/ai/providers.test.ts +289 -0
- package/src/elements/ai/providers.ts +169 -0
- package/src/elements/ai/runtime.ts +68 -5
- package/src/elements/ai/schema.ts +2 -2
- package/src/elements/ai.test.ts +7 -7
- package/src/elements/ai.ts +17 -1
- package/src/elements/channel/runtime.ts +105 -12
- package/src/elements/clock/cron-fields.test.ts +144 -0
- package/src/elements/clock/cron-fields.ts +185 -0
- package/src/elements/clock/declare.ts +247 -3
- package/src/elements/clock.ts +21 -1
- package/src/elements/index.ts +15 -0
- package/src/elements/signal/chaos-child.ts +1 -2
- package/src/elements/signal/declare.ts +65 -37
- package/src/elements/signal/delivery-modes.test.ts +11 -31
- package/src/elements/signal/dry-run-replay.test.ts +1 -7
- package/src/elements/signal/dry-run-write-isolation.test.ts +1 -7
- package/src/elements/signal/key-ordering.test.ts +6 -26
- package/src/elements/signal/lease-reclaim.test.ts +2 -6
- package/src/elements/signal/optional-emit.test.ts +6 -9
- package/src/elements/signal/order-lifecycle.test.ts +4 -17
- package/src/elements/signal/orphan-messages.test.ts +4 -15
- package/src/elements/signal/reconcile.test.ts +2 -2
- package/src/elements/signal/runtime.ts +1 -1
- package/src/elements/signal/schema-emit.test.ts +4 -8
- package/src/elements/signal.test.ts +24 -49
- package/src/elements/signal.ts +9 -2
- package/src/elements/store/domain-ddl.test.ts +1 -1
- package/src/elements/store/live-http.test.ts +9 -4
- package/src/elements/store/prepare-row.test.ts +123 -0
- package/src/elements/store/resource.ts +43 -12
- package/src/elements/store/schema-decl.ts +117 -0
- package/src/elements/store/search-backfill.ts +205 -0
- package/src/elements/store/search-bind.ts +66 -0
- package/src/elements/store/search-bm25.ts +78 -0
- package/src/elements/store/search-ddl.ts +156 -0
- package/src/elements/store/search-embed-flow.ts +141 -0
- package/src/elements/store/search-errors.ts +34 -0
- package/src/elements/store/search-fusion.ts +112 -0
- package/src/elements/store/search-lsh.ts +179 -0
- package/src/elements/store/search-runtime.ts +300 -0
- package/src/elements/store/search.test.ts +144 -0
- package/src/elements/store/sql-session.test.ts +1 -0
- package/src/elements/store/sql-session.ts +83 -3
- package/src/elements/store/table.ts +23 -2
- package/src/elements/store/upsert-app.test.ts +1 -3
- package/src/elements/store.ts +50 -0
- package/src/full.ts +4 -2
- package/src/http.ts +4 -1
- package/src/i18n/catalogs/ar.ts +14 -6
- package/src/i18n/catalogs/en.ts +14 -6
- package/src/index.ts +6 -1
- package/src/kernel/adopt-barrel-fresh.test.ts +7 -7
- package/src/kernel/adopt-routes.ts +9 -1
- package/src/kernel/app-auth.ts +5 -0
- package/src/kernel/app.ts +102 -9
- package/src/kernel/auto-cache.test.ts +6 -12
- package/src/kernel/auto-registry.test.ts +3 -3
- package/src/kernel/boot-bind/ai.test.ts +22 -19
- package/src/kernel/boot-bind/ai.ts +5 -43
- package/src/kernel/boot-bind/clock.ts +23 -5
- package/src/kernel/boot-bind/honor-config.test.ts +4 -4
- package/src/kernel/boot.test.ts +11 -6
- package/src/kernel/boot.ts +66 -16
- package/src/kernel/boundary-contract.ts +93 -0
- package/src/kernel/budget.test.ts +1 -1
- package/src/kernel/call.ts +89 -0
- package/src/kernel/capability.ts +6 -0
- package/src/kernel/client-descriptor.ts +123 -0
- package/src/kernel/clock-timezone.test.ts +80 -0
- package/src/kernel/correlation.test.ts +1 -1
- package/src/kernel/dry-run.ts +11 -8
- package/src/kernel/effects-stamping.test.ts +42 -9
- package/src/kernel/effects.test.ts +4 -2
- package/src/kernel/effects.ts +51 -9
- package/src/kernel/errors-channel.ts +17 -0
- package/src/kernel/errors-live-resume.ts +3 -2
- package/src/kernel/errors-tenant.ts +7 -4
- package/src/kernel/errors.registry-helpers.ts +96 -0
- package/src/kernel/errors.registry.test.ts +139 -25
- package/src/kernel/errors.ts +102 -23
- package/src/kernel/external-effects.test.ts +196 -0
- package/src/kernel/flow.test.ts +13 -4
- package/src/kernel/flow.ts +69 -71
- package/src/kernel/fx-ask-telemetry.test.ts +2 -2
- package/src/kernel/fx-dead-letters.test.ts +3 -3
- package/src/kernel/fx-fetch.ts +55 -0
- package/src/kernel/fx-live-stream.ts +2 -2
- package/src/kernel/fx-live.test.ts +8 -8
- package/src/kernel/fx.test.ts +17 -11
- package/src/kernel/fx.ts +180 -57
- package/src/kernel/horizontal-child.ts +1 -1
- package/src/kernel/http-query.test.ts +3 -6
- package/src/kernel/index.ts +13 -3
- package/src/kernel/instance-id.ts +1 -1
- package/src/kernel/instances.test.ts +40 -0
- package/src/kernel/instances.ts +47 -9
- package/src/kernel/live-http.test.ts +6 -7
- package/src/kernel/live-http.ts +6 -2
- package/src/kernel/live-resume.test.ts +1 -1
- package/src/kernel/mcp-tool.test.ts +3 -3
- package/src/kernel/on.ts +98 -4
- package/src/kernel/pipeline.test.ts +12 -15
- package/src/kernel/plugin-elements.test.ts +1 -1
- package/src/kernel/stamp-http.test.ts +3 -3
- package/src/kernel/triggers.ts +210 -95
- package/src/kernel-entry.ts +0 -1
- package/src/manifest/diff.ts +11 -1
- package/src/manifest/fixtures/skyport.excerpt.json +1 -1
- package/src/manifest/types.ts +46 -2
- package/src/mcp/docs-index.ts +3 -3
- package/src/mcp/docs-mcp.test.ts +2 -2
- package/src/mcp/docs-tools.ts +1 -1
- package/src/okid.test.ts +56 -0
- package/src/okid.ts +55 -11
- package/src/plugins/anonymous.ts +8 -4
- package/src/plugins/auth/shared.ts +27 -3
- package/src/plugins/auth-delivery.mailpit.integration.test.ts +1 -1
- package/src/plugins/auth-methods.security.test.ts +561 -23
- package/src/plugins/config-source.ts +1 -1
- package/src/plugins/csrf.test.ts +65 -0
- package/src/plugins/index.ts +2 -0
- package/src/plugins/magic-link.ts +36 -16
- package/src/plugins/oauth/shared.ts +3 -1
- package/src/plugins/oauth.ts +22 -14
- package/src/plugins/otp.ts +37 -21
- package/src/plugins/passkey-webauthn.ts +9 -6
- package/src/plugins/passkey.ts +98 -26
- package/src/plugins/pre-account-hijack.test.ts +223 -0
- package/src/plugins/two-factor.ts +466 -37
- package/src/plugins/username.ts +19 -7
- package/src/release/build-lib.ts +1 -0
- package/src/release/limits.ts +2 -2
- package/src/release/measure.ts +1 -1
- package/src/runs/collect.test.ts +0 -2
- package/src/runtime/json-code-block.test.ts +250 -20
- package/src/runtime/json-code-block.ts +1261 -41
- package/src/term.test.ts +1 -1
- package/src/test/create-test-app.test.ts +12 -12
- package/src/test/live-signals.test.ts +6 -6
- package/src/test/provisions.integration.test.ts +10 -14
- package/src/test/reset-element-registries.ts +1 -1
- package/src/test/tenant-isolation.test.ts +12 -6
- package/site/content/docs/deployment/docker-swarm.mdx +0 -164
- package/site/content/docs/deployment/docker.mdx +0 -227
- package/site/content/docs/deployment/index.mdx +0 -83
- package/site/content/docs/deployment/kubernetes.mdx +0 -176
- package/site/content/docs/deployment/meta.json +0 -5
- package/site/content/docs/deployment/reverse-proxy.mdx +0 -234
- package/site/content/docs/elements/ai.mdx +0 -385
- package/site/content/docs/elements/channel.mdx +0 -346
- package/site/content/docs/elements/clock.mdx +0 -244
- package/site/content/docs/elements/flow.mdx +0 -420
- package/site/content/docs/elements/gate.mdx +0 -436
- package/site/content/docs/elements/signal.mdx +0 -380
- package/site/content/docs/elements/store.mdx +0 -1099
- package/site/content/docs/elements/vault.mdx +0 -405
- package/site/content/docs/get-started/basic-usage.mdx +0 -173
- package/site/content/docs/get-started/index.mdx +0 -43
- package/site/content/docs/get-started/installation.mdx +0 -220
- package/site/content/docs/get-started/introduction.mdx +0 -144
- package/site/content/docs/get-started/meta.json +0 -13
- package/site/content/docs/get-started/project-structure.mdx +0 -925
- package/site/content/docs/get-started/testing.mdx +0 -328
- package/site/content/docs/get-started/why.mdx +0 -114
- package/site/content/docs/recipes/llama-cpp.mdx +0 -151
- package/site/content/docs/recipes/ollama.mdx +0 -142
- package/site/content/docs/recipes/sglang.mdx +0 -105
- package/site/content/docs/recipes/vllm.mdx +0 -106
- package/site/content/docs/reference/cli.md +0 -232
- package/site/content/docs/reference/client.mdx +0 -469
- package/site/content/docs/reference/security.md +0 -74
- package/src/cli/ai-setup/detect-ollama.ts +0 -213
- package/src/cli/ai-setup/recommend.test.ts +0 -225
- package/src/cli/ai-setup/recommend.ts +0 -225
- package/src/cli/dev-controls.test.ts +0 -122
- package/src/cli/dev-controls.ts +0 -164
- package/src/cli/tui/DevLive.tsx +0 -126
- package/src/console/ui-next/dist/assets/access-page-3-EFj-2G.js +0 -4
- package/src/console/ui-next/dist/assets/agent-disclosure-BP0Y0Sux.js +0 -1
- package/src/console/ui-next/dist/assets/cache-glyph-B5X-NM0-.js +0 -1
- package/src/console/ui-next/dist/assets/call-pii-button-ChAUiLo9.js +0 -1
- package/src/console/ui-next/dist/assets/collapsible-DGnOM2ph.js +0 -1
- package/src/console/ui-next/dist/assets/copy-inline-button-DBHhgHKP.js +0 -1
- package/src/console/ui-next/dist/assets/dagre.esm-ZwcdTuZZ.js +0 -1
- package/src/console/ui-next/dist/assets/detail-header-DhHM1iaZ.js +0 -1
- package/src/console/ui-next/dist/assets/dropdown-menu-_NjTEo5_.js +0 -1
- package/src/console/ui-next/dist/assets/duration-tone-sC3lGABz.js +0 -9
- package/src/console/ui-next/dist/assets/element-icons-BVXtRyd3.js +0 -1
- package/src/console/ui-next/dist/assets/explorer-empty-2uIhBu0_.js +0 -1
- package/src/console/ui-next/dist/assets/flows-page-cVFnA4HH.js +0 -1
- package/src/console/ui-next/dist/assets/highlighted-json-Awq7gYdu.js +0 -154
- package/src/console/ui-next/dist/assets/http-method-_UHM2ODJ.js +0 -1
- package/src/console/ui-next/dist/assets/index-CMIgUbD0.js +0 -66
- package/src/console/ui-next/dist/assets/index-Ck88Jmv8.css +0 -2
- package/src/console/ui-next/dist/assets/link-BX6Vqztd.js +0 -1
- package/src/console/ui-next/dist/assets/observability-page-CQ3p34ip.js +0 -4
- package/src/console/ui-next/dist/assets/preload-helper-oH4irX4C.js +0 -1
- package/src/console/ui-next/dist/assets/react-D8E3mtu1.js +0 -1
- package/src/console/ui-next/dist/assets/react-dom-Bph1y7z7.js +0 -9
- package/src/console/ui-next/dist/assets/replica-lag-DKRrbvdo.js +0 -18
- package/src/console/ui-next/dist/assets/request-meta-DV0ywz7t.js +0 -1
- package/src/console/ui-next/dist/assets/shortcut-JQIZlWfm.js +0 -1
- package/src/console/ui-next/dist/assets/shortcut-keys-DKxNTe_m.js +0 -1
- package/src/console/ui-next/dist/assets/skeleton-D-czQJT6.js +0 -1
- package/src/console/ui-next/dist/assets/store-page-02xOiqIK.js +0 -41
- package/src/console/ui-next/dist/assets/trace-detail-sheet-B09O8rA6.js +0 -2
- package/src/console/ui-next/dist/assets/tree-expand-toggle-BtyhmWb4.js +0 -55
- package/src/console/ui-next/dist/assets/units-page-l8FeKfnP.js +0 -1
- package/src/console/ui-next/dist/assets/useMutation-B8EO02Ej.js +0 -1
- package/src/console/ui-next/dist/assets/useRender-BE2A9BWC.js +0 -1
- package/src/console/ui-next/dist/assets/vault-page-CL-d_mLE.js +0 -2
- package/src/console/ui-next/dist/assets/xyflow-D7n4g6go.js +0 -7
- package/src/console/ui-next/dist/assets/xyflow-DZ0Ws1xk.css +0 -1
- package/src/docker/ollama-pull.ts +0 -232
- package/src/docker/recipes/llama-cpp.ts +0 -298
- package/src/docker/recipes/ollama.ts +0 -44
- package/src/docker/recipes/sglang.ts +0 -55
- package/src/docker/recipes/vllm.ts +0 -44
- package/src/drivers/ai-ollama-tools.integration.test.ts +0 -109
- package/src/drivers/ai-ollama.integration.test.ts +0 -184
- package/src/drivers/ai-ollama.ts +0 -389
- package/src/drivers/ollama.ts +0 -14
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/flows-page-Dss7941e.js","assets/rolldown-runtime-hePW80VL.js","assets/react-dom-Ddte4I-Q.js","assets/xyflow-yApv7D4e.js","assets/xyflow-CSyC6ryz.css","assets/shortcut-keys-3ILd8oGn.js","assets/element-icons-BI8cJgdh.js","assets/collapsible-D2A6NJ-3.js","assets/duration-tone-Cgk_h5ja.js","assets/highlighted-json-MYZQtRnw.js","assets/request-meta-BatF8KrK.js","assets/http-method-Jrh39p7A.js","assets/UserIcon-DaE2PB5_.js","assets/UnavailableIcon-D9cvHVPr.js","assets/dagre.esm-B1_XeuLP.js","assets/trace-detail-sheet-CZkMeKS-.js","assets/PlusSignIcon-CwG3nxfu.js","assets/cache-glyph-BeFJeqBG.js","assets/agent-disclosure-U1rdfblp.js","assets/units-page-B_RWJrEO.js","assets/call-pii-button-CVAONPii.js","assets/tree-expand-toggle-CW8y5A2h.js","assets/dropdown-menu-4h2LOVXM.js","assets/explorer-empty-CJs5A-wm.js","assets/detail-header-DVWNjWjg.js","assets/store-page-eiKiHnNe.js","assets/replica-lag-CSh2dzrb.js","assets/FileExportIcon-Ck-5od4R.js","assets/MoreHorizontalCircle01Icon-gMNGsE37.js","assets/copy-inline-button-CAYD18cr.js","assets/vault-page-CWrg-A68.js","assets/use-vault-list-CT4-gajj.js","assets/access-page-DFeymU07.js","assets/observability-page-HvolXxTI.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,r as n,t as r}from"./react-dom-Ddte4I-Q.js";import{A as i,O as a}from"./xyflow-yApv7D4e.js";import{$i as o,$r as s,Ai as c,Bi as l,Br as u,Cr as d,Di as f,Dr as p,E as m,Ei as h,Er as g,Et as _,F as v,Fi as y,Gi as b,Hi as x,I as S,Ii as C,Ji as w,Ki as T,L as ee,Li as te,Mi as ne,Ni as re,Oi as ie,Or as ae,Pi as oe,Qi as se,R as ce,Ri as le,T as ue,Tt as de,Ui as fe,Vi as pe,Vr as me,Wi as he,Xi as ge,Xr as _e,Yi as ve,Zi as ye,_ as be,aa as xe,ai as Se,ar as Ce,b as we,br as Te,ca as Ee,cr as De,d as Oe,da as ke,ea as E,ei as Ae,f as je,fa as Me,fr as Ne,gr as Pe,h as Fe,ha as Ie,i as Le,ia as Re,ii as ze,ji as Be,ki as Ve,kr as He,l as Ue,la as We,lr as Ge,ma as Ke,mr as qe,n as Je,na as Ye,ni as Xe,o as Ze,oa as Qe,oi as $e,pa as et,pr as tt,qi as nt,qr as rt,r as it,ra as at,ri as ot,s as st,sa as ct,sr as lt,t as ut,ta as dt,ti as ft,u as pt,ua as mt,ur as ht,wr as gt,x as _t,xr as vt,y as yt,yr as bt,zi as xt}from"./shortcut-keys-3ILd8oGn.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var St=class extends ye{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ct(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=se({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),E.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ct(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var wt=class extends Ye{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new St({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Tt(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Tt(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Tt(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Tt(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){E.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Qe(t,e))}findAll(e={}){return this.getAll().filter(t=>Qe(e,t))}notify(e){E.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return E.batch(()=>Promise.all(e.map(e=>e.continue().catch(Ee))))}};function Tt(e){return e.options.scope?.id}var Et=class extends Ye{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),ke(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Re(t.mutationKey)!==Re(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Ct();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){E.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Dt=class extends Ye{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??xe(r,t),a=this.get(i);return a||(a=new ge({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){E.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ct(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ct(e,t)):t}notify(e){E.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){E.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){E.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ot=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Dt,this.#t=e.mutationCache||new wt,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=dt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=o.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(mt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=at(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return E.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;E.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return E.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=E.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Ee).catch(Ee)}invalidateQueries(e,t={}){return E.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=E.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Ee)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Ee)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(mt(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(mt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ee).catch(Ee)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ee).catch(Ee)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return o.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Re(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{We(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Re(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{We(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=xe(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===et&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},D=e(n(),1);function kt(e,t){let n=Ie(t),[r]=D.useState(()=>new Et(n,e));D.useEffect(()=>{r.setOptions(e)},[r,e]);let i=D.useSyncExternalStore(D.useCallback(e=>r.subscribe(E.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=D.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Ee)},[r]);if(i.error&&Me(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var At=D.use,jt=D.useLayoutEffect;function Mt(e,t,n){D.useEffect(()=>{if(!e.current||n||typeof IntersectionObserver!=`function`)return()=>t();let r=new IntersectionObserver(e=>{t(e.pop())},{rootMargin:`100px`});return r.observe(e.current),()=>{r.disconnect(),t()}},[t,n,e])}function Nt(e){let t=D.useRef(null);return D.useImperativeHandle(e,()=>t.current,[]),t}function Pt(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var Ft=4,It=5;function Lt(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=a.indexOf(`{`),s;if(o!==-1&&o+1<a.length&&(s=a.indexOf(`}`,o))!==-1){let r=a.charCodeAt(o+1);if(r===45){if(o+2<a.length&&a.charCodeAt(o+2)===36){let e=o+3,r=s;if(e<r)return n[0]=3,n[1]=t+o,n[2]=t+e,n[3]=t+r,n[4]=t+s+1,n[5]=i,n}}else if(r===36){let r=o+1,a=o+2;return a===s?(n[0]=2,n[1]=t+o,n[2]=t+r,n[3]=t+a,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+o,n[2]=t+a,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Rt(e,t,n,r,i,a,o,s){s?.(n);let c=r;{let r=n.fullPath??n.from,s=n.options,l=r.length,u=s?.caseSensitive??e,d=s?.params?.parse??s?.parseParams;for(;c<l;){let e=Lt(r,c,t),n,s=c,l=e[5];c=l+1,a++;let f=e[0];switch(f){case 0:{let t=r.substring(e[2],e[3]),o=t,s;u?s=i.static??=new Map:(o=t.toLowerCase(),s=i.staticInsensitive??=new Map);let c=s.get(o);if(c)n=c;else{let e=Bt(r);e.parent=i,e.depth=a,n=e,s.set(o,e)}break}case 1:case 3:case 2:{let t=r.substring(s,e[1]),c=r.substring(e[4],l),p=u&&!!(t||c);u||(t=t.toLowerCase(),c=c.toLowerCase());let m=f===1?i.dynamic:f===3?i.optional:i.wildcard,h=f!==2&&!d&&m?.find(e=>!e.parse&&e.caseSensitive===p&&e.prefix===t&&e.suffix===c);if(h)n=h;else{let e=Vt(f,r,p,t,c);n=e,e.parent=i,e.depth=a;let s;s=f===1?i.dynamic??=[]:f===3?i.optional??=[]:i.wildcard??=[],s.push(e),s.length===2&&o?.push(s)}break}}i=n}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=Bt(r);e.kind=It,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let f=(n.path||!n.children)&&!n.isRoot;if(f&&r.endsWith(`/`)){let e=Bt(r);e.kind=Ft,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=d??null,i.priority=s?.params?.priority??0,f&&!i.route&&(i.route=n,i.fullPath=r)}if(n.children)for(let r of n.children)Rt(e,t,r,c,i,a,o,s)}function zt(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Bt(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function Vt(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function Ht(e,t){let n=Bt(`/`),r=new Uint16Array(6),i=[];for(let t of e)Rt(!1,r,t,1,n,0,i);for(let e of i)e.sort(zt);t.masksTree=n,t.flatCache=Pt(1e3)}function Ut(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=Jt(e,t.masksTree);return t.flatCache.set(e,r),r}function Wt(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Bt(`/`),Rt(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Jt(r,o,n)}function Gt(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Jt(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Xt(a.route)),t.matchCache.set(r,a),a}function Kt(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function qt(e,t=!1,n){let r=Bt(e.fullPath),i=new Uint16Array(6),a=[],o={},s={},c=0;Rt(t,i,e,1,r,0,a,e=>{if(n?.(e,c),e.id in o&&oe(),o[e.id]=e,c!==0&&e.path){let t=Kt(e.fullPath);(!s[t]||e.fullPath.endsWith(`/`))&&(s[t]=e)}c++});for(let e of a)e.sort(zt);return{processedTree:{segmentTree:r,singleCache:Pt(1e3),matchCache:Pt(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:s}}function Jt(e,t,n=!1){let r=e.split(`/`),i=Qt(e,r,t,n);if(!i)return null;let[a]=Yt(e,r,i);return{route:i.node.route,rawParams:a}}function Yt(e,t,n){let r=Zt(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===Ft)break;if(u.kind===It){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix.length;if(e.charCodeAt(t)===123){let n=u.suffix.length,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix.length,r=u.suffix.length,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function Xt(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Zt(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Qt(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!b(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!nn(l,n))continue;if(i.parse){if(!tn(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==Ft&&nn(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===Ft||i.kind===2)&&nn(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(tn(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&en(f,o))return n;nn(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!r||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+$t(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+$t(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+$t(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+$t(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function $t(e,t){return 2**(e-t-1)}function en(e,t){return e===2**(t-1)-1}function tn(e,t,n){let r,i;try{[r,i]=Yt(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function nn(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Ft)>(e.node.kind===Ft)||t.node.kind===Ft==(e.node.kind===Ft)&&t.node.depth>e.node.depth)))}function rn(e){return an(e.filter(e=>e!==void 0).join(`/`))}function an(e){return e.replace(/\/{2,}/g,`/`)}function on(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function sn(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function cn(e){return sn(on(e))}function ln(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function un({base:e,to:t,trailingSlash:n=`never`,cache:r}){if(t.includes(`//`)&&(t=an(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=an(e)),o=e.split(`/`);o.length>1&&b(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(b(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?an(s):s)||`/`;return a&&r&&r.set(a,c),c}function dn(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function fn(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>mn(e,n)).join(`/`):mn(r,n):r}function pn({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=Lt(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=fn(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=fn(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=fn(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function mn(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function hn(e){return e?.isNotFound===!0}function gn(){try{return sessionStorage}catch{return}}var _n=`tsr-scroll-restoration-v1_3`,vn=gn();function yn(){try{return JSON.parse(vn?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function bn(){try{vn?.setItem(_n,JSON.stringify(xn))}catch{}}var xn=yn(),Sn=`data-scroll-restoration-id`,Cn=e=>e.state.__TSR_key||e.href;function wn(e){let t=e.getAttribute(Sn);if(t)return`[${Sn}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var Tn=!1,En=`window`;function Dn(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function On(e){let t=new Set;for(let n of e){if(n===En)continue;let e=Dn(n);e&&t.add(e)}return t}function kn(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||Cn,a=new Set,o=e=>{let t=xn[e]||={};for(let e of a)e===document?t[En]={scrollX,scrollY}:e.isConnected&&(t[wn(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,Tn=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{Tn||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),bn()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=xn[d];if(e){let t=xn[u];for(let n in e){if(n===En){if(s)continue}else{let e=Dn(n);if(!e||s&&o&&(l??=On(o),l.has(e)))continue}t||=xn[u]={},t[n]??=e[n]}}}Tn=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=On(o));let t=e&&i&&c,s=r.restoring?xn[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===En){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Dn(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{Tn=!1}}))}function An(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function jn(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Mn(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=jn(r):Array.isArray(t)?t.push(jn(r)):n[e]=[t,jn(r)]}return n}var Nn=/^(?:\s|["[{\d-]|fa|nu|tr)/,Pn=In(JSON.parse),Fn=Ln(JSON.stringify,JSON.parse);function In(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.substring(1));let r=Mn(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!Nn.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function Ln(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!Nn.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=An(e,r);return t?`?${t}`:``}}var Rn=`__root__`;function zn(e){e.statusCode=e.statusCode||e.code||307;let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Bn(e){return e instanceof Response&&!!e.options}function Vn(e){return{input:({url:t})=>{for(let n of e)t=Un(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Wn(e[n],t);return t}}}function Hn(e){let t=cn(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=rn([`/`,t,e.pathname]),e)}}function Un(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Wn(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Gn(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{C(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var Kn=`__TSR_index`,qn=`popstate`,Jn=`beforeunload`,Yn=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function Xn(e){let t=Yn.exec(e);return t?`/`+e.slice(t[0].length):e}function Zn(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>`
|
|
3
|
+
\r`.includes(e)?``:encodeURIComponent(e))),Xn(e)}function Qn(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=tr(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[Kn];i=$n(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[Kn];i=$n(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t,n?.ignoreBlocker??!1),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[Kn]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r,_getBlockers:()=>e.getBlockers?.()??[]}}function $n(e,t){t||={};let n=nr();return{...t,key:n,__TSR_key:n,[Kn]:e}}function er(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=t=>Zn(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>tr(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=nr();t.history.replaceState({[Kn]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=tr(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[Kn]-l.state[Kn],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=Qn({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0,m=!0),t.history.back()),forward:e=>{e&&(p=!0,m=!0),t.history.forward()},go:(e,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Jn,x,{capture:!0}),t.removeEventListener(qn,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return S._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(Jn,x,{capture:!0}),t.addEventListener(qn,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function tr(e,t){let n=Zn(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=nr();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[Kn]:0,key:a,__TSR_key:a}}}function nr(){return(Math.random()+1).toString(36).substring(7)}function rr(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function ir(e){return e.pathname+e.search+e.hash}function ar(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function or(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function sr({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function cr(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function lr(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var ur=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=dn(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:er()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=Pt(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Gn(this.latestLocation,e),kn(this)}let a=this.options.basepath??`/`,o=this.options.rewrite;if(r||n!==a||i!==o){this.basepath=a;let e=[],t=cn(a);t&&t!==`/`&&e.push(Hn({basepath:a})),o&&e.push(o),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Vn(e),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=qt(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&Ht(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:te(e),external:!1,searchStr:o,search:T(t?.search,i),hash:te(r.slice(1)),state:w(t?.state,a)}}let o=new URL(i,this.origin),s=Un(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:te(Xn(s.pathname)),external:!!this.rewrite&&rr(s,this.origin),searchStr:l,search:T(t?.search,c),hash:te(s.hash.slice(1)),state:w(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>un({base:e,to:t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=Gt(sn(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{let t=(t={})=>{if(t.href){let e=tr(t.href,{});t={...t,to:Un(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let n=t._fromLocation||this._pendingLocation||this.latestLocation,r=this.matchRoutesLightweight(n),i=t.unsafeRelative===`path`?n.pathname:t.from??r[1],a=r[2],o=r[3],s=this.resolvePathWithBase(i,t.to?`${t.to}`:`.`),c=_r(t.params,o),u=this.routesByPath[sn(s)],d;if(u)d=this.getRouteBranch(u);else if(s.includes(`$`))d=[];else{let[e,t,n]=this.getMatchedRoutes(s);d=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(d=[...d,this.options.notFoundRoute])}if(d.length&&x(c))for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){c===o&&(c=Object.assign(Object.create(null),c));try{Object.assign(c,t(c))}catch{}}}let f=e.leaveParams?s:te(Xn(pn({path:s,params:c,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath)),p=a;if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,mr(t.options.validateSearch,{...e,...p}))}catch{}}),p=e}p=hr(p,t,d,e._includeValidateSearch),p=T(a,p);let m=this.options.stringifySearch(p),h=t.hash===!0?n.hash:t.hash?l(t.hash,n.hash):void 0,g=h?`#${h}`:``,_=t.state===!0?n.state:t.state?l(t.state,n.state):{};t.state&&(_=w(n.state,_));let v=`${f}${m}${g}`,y,b,S=!1;if(this.rewrite){let e=new URL(v,this.origin),t=e.origin,n=Wn(this.rewrite,e);y=ir(e),rr(n,t)?(b=n.href,S=!0):b=Xn(ir(n))}else y=xt(v),b=y;return{publicHref:b,href:y,pathname:f,search:p,searchStr:m,state:_,hash:h??``,external:S,unmaskOnReload:t.unmaskOnReload}},n=t(e);if(e.mask)n.maskedLocation=t({from:e.from,...e.mask});else if(this.options.routeMasks){let r=Ut(n.pathname,this.processedTree);if(r){let i=Object.assign(Object.create(null),r.rawParams),{from:a,params:o,...s}=r.route,c=_r(o,i);n.maskedLocation=t({from:e.from,...s,params:c})}}return n},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return dr(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=sn(this.latestLocation.href)===sn(n.href)&&le(sr(n.state),sr(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.next=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=n?pe(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return dr(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await si(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(or(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set([...t,...this._cache.values(),...[...r?.values()??[]].flat(),...this._tx?.[3]??[]].filter(e=>!n||n(e)).map(e=>e.id)),a=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),a.push(e));let o=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&ar(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(o);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i)this._flights?.delete(e);for(let e of a)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(nt.test(n)||(r=pe(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:rr(e,this.origin)||(n=ir(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=xr,this.preloadRoute=e=>ci(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=Wt(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!le(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?le(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Fn,parseSearch:e.parseSearch??Pn,protocolAllowlist:e.protocolAllowlist??y}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=Xt(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:sn(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?gr(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,f,p;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=mr(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof fr||(r=new fr(e.message,{cause:e})),t?.throwOnError)throw r;l=n,f={},p=r}}let m=``,h=``;try{m=i.options.loaderDeps?.({search:l})??``,h=m&&JSON.stringify(m)||``}catch(e){if(t?.throwOnError)throw e;p??=e}let{interpolatedPath:g,usedParams:_}=pn({path:i.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),v=i.id+g+h,y=u(i,n),b=this._cache.get(v)??(y?.id===v?y:void 0);d=b?._strictParams??Object.assign(_,d);let x;if(!b)try{vr(i,d)}catch(e){if(x=hn(e)||Bn(e)?e:new pr(e.message,{cause:e}),t?.throwOnError)throw x}let S=y?`stay`:`enter`,C;if(b)C={...b,cause:S,search:T(y?y.search:b.search,l),_strictSearch:f,searchError:p};else{let e=ar(i)?`pending`:`success`;C={id:v,ssr:i.options.ssr,index:n,routeId:i.id,params:y?.params??d,_strictParams:d,pathname:g,updatedAt:Date.now(),search:y?T(y.search,l):l,_strictSearch:f,searchError:p,status:e,isFetching:!1,error:void 0,paramsError:x,context:{},abortController:t?._controller??new AbortController,cause:S,loaderDeps:y?w(y.loaderDeps,m):m,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let ee=s===i.id;C._notFound&&!ee&&(C.error=void 0),C._notFound=ee,c[n]=C}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?T(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=b(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=b(a),c={...e.search};for(let e of a)try{Object.assign(c,mr(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=Object.assign(Object.create(null),o);for(let t of a)try{vr(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}};async function dr(e,t,{replace:n,ignoreBlocker:r}){if(!fe(t,e.protocolAllowlist)){if(!r){let t=e.history._getBlockers();for(let r of t)if(r?.blockerFn&&await r.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:n?`REPLACE`:`PUSH`}))return}e.history._ignoreNextBeforeUnload?.(t),n?window.location.replace(t):window.location.href=t}}var fr=class extends Error{},pr=class extends Error{};function mr(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new fr(`Async validation not supported`);if(n.issues)throw new fr(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function hr(e,t,n,r){let i=[];for(let e of n){let t=e.options;`search`in t?t.search?.middlewares&&i.push(...t.search.middlewares):(t.preSearchFilters||t.postSearchFilters)&&i.push(({search:e,next:n})=>{let r=n(t.preSearchFilters?t.preSearchFilters.reduce((e,t)=>t(e),e):e);return t.postSearchFilters?t.postSearchFilters.reduce((e,t)=>t(e),r):r});let n=t.validateSearch;r&&n&&i.push(({search:e,next:t,meta:r})=>{let i=t(e);try{let e=mr(n,i);if(r&&e)for(let t in e)t in i||(r.defaulted||=new Map).set(t,e[t]);return{...i,...e}}catch{}return i})}let a=(e,n,r)=>{if(e>=i.length){if(!t.search)return{};if(t.search===!0)return n;let e=l(t.search,n);return r&&(r.explicit=e),e}return i[e]({search:n,next:(t,n)=>{if(n){let n=r||{};return{search:a(e+1,t,n),meta:n}}return a(e+1,t,r)},meta:r})};return a(0,e)}function gr(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return Rn}function _r(e,t){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return t;let n=Object.assign(Object.create(null),t);return Object.assign(n,l(e,n))}function vr(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function yr(e,t){return e.options[t]?.preload?.()}function br(e,t){let n=yr(e,`component`),r=yr(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function xr(e,t,n){let r=()=>t===!1?void 0:t?yr(e,t):br(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Sr(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var Cr=0,wr=1,Tr=2,O=3,Er=[4];function Dr(e){return typeof e[0]==`number`}function Or(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener(`abort`,i))})}function kr(e,t){return e.routesById[t.routeId]}function Ar(e,t,n){return Bn(e)?[O,e]:hn(e)?(e.routeId||=n,[Tr,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[wr,e]):[Cr,e]}function jr(e,t){let n=Ar(t,!0,e.id);if(n[0]!==wr)return n;try{e.options.onError?.(n[1])}catch(t){n=Ar(t,!0,e.id)}return n}function Mr(e,t,n,r,i){return i[0].signal.aborted?Er:Jr(e,t,n,jr(n,r),i)}async function Nr(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=kr(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return Fr(e,r),[i,Mr(e,t,u,a,n)]}if(c.aborted)return[i,Er];let p=r.paramsError??r.searchError;if(p!==void 0)return Fr(e,r),[i,Mr(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{Rr(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?Or(a,c):a);if(c.aborted)return[i,Er];let s=Jr(e,t,u,Ar(o,!1,u.id),n);if(s[0]!==Cr)return Fr(e,r),[i,s];r.context={...r.context,...o}}catch(a){return Fr(e,r),[i,Mr(e,t,u,a,n)]}finally{r.status=h,Rr(e,r,!1,n[0])}}i()}function Pr(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function Fr(e,t){let n=t._flight;t._flight=void 0,Pr(e,t,n)?.abort()}function Ir(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=Pr(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Lr(e){for(let t of e){let e=t._flight;e&&e[2]++}}function Rr(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function zr(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function Br(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return Er;if(!i)return[Cr,void 0];let l=n._flight;Rr(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(zr(e,t,n,r,s,a,!!o[3]))).then(e=>Ar(e,!1,r.id),e=>Ar(e,!0,r.id)).then(t=>(t[0]!==Cr&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===wr&&l[2]?jr(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],Jr(e,t,r,await Or(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return Fr(e,n),Er}finally{Rr(e,n,!1,s)}}function Vr(e,t,n){t[0]!==O&&(e.status=`success`,e.error=void 0,t[0]===Cr?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function Hr(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&Fr(e,r)}function Ur(e,t){return t[0]===wr||t[0]===Tr?{...e,status:t[0]===wr?`error`:`notFound`,error:t[1],_flight:void 0}:e}function Wr(e,t,n,r,i,a,o){let s=t[1][n],c=kr(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(zr(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=Er)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,Fr(e,s),p=Mr(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,Pr(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?Br(e,t,s,c,g,i,a).then(t=>(Vr(s,t,l),t[0]===Cr&&(m&&!a[0].signal.aborted&&Hr(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[Cr,s.loaderData]),T=(async()=>{try{let e=xr(c,void 0,C);e&&await Or(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,Mr(e,t,c,r,a)]}let r=await w;x&&r[0]===Cr&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,T]),!y)return w.then(e=>Ur(s,e));let ee={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let te=Br(e,t,ee,c,g,i,a).then(e=>(s.isFetching=!1,Vr(ee,e,!1),e));return(t[2]??=[]).push([n,te,T,ee]),te.then(e=>Ur(ee,e))}async function Gr(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=kr(e,t[n]);try{let e=xr(i,!1);e&&await Or(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function Kr(e,t){t[2]&&=(Ir(e,t[2].map(e=>e[3])),void 0)}async function qr(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=O)throw[a,t];!i&&t[0]!==Cr&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===O)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function Jr(e,t,n,r,i,a){for(;r[0]===O;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[O,t]:[O,t,a]}return[O,o,n]}catch(e){r=a?[wr,e]:jr(n,e),a=!0}}return r}async function Yr(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Tr?Gr(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=O)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==Cr&&t[0]<O&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=O){let n=s[1];if(n[0]!==O||n[1].options.reloadDocument||n[2])return Kr(e,t),n;c=!0,s=[0,[wr,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===wr?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=kr(e,u);try{await Or(i?Promise.resolve().then(()=>xr(m,l===wr?`errorComponent`:`notFoundComponent`)):Promise.all([xr(m),xr(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return Kr(e,t),Er}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),Kr(e,t),Ir(e,o),p()):u.status=`success`}return t}async function Xr(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=kr(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await Or(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Zr(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await Gr(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||e.preload||a?.id!==e.id||a.status!==`success`||(l++,i._notFound||a._notFound))break}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=Wr(e,i,t,u,f,r,l)},m=await Nr(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Tr){let t=await Gr(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=O&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=Yr(e,i,u,r[0],qr(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=qr(i[2],void 0,void 0,h.then(e=>Dr(e)?0:Sr(n).length,()=>0))),o=await h}catch(t){if(Kr(e,i),t===a&&a.aborted)return Er;throw t}return Dr(o)?o:Xr(e,o,a,r[6]===n.length?r[6]:0)}function Qr(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=kr(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>Qr(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function $r(e,t){let n=e._pending;(e._tx===t||!e._tx?.[3].some(e=>e.id===n?.[1]))&&(clearTimeout(n?.[3]),e._pending=void 0)}async function ei(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Sr(t[3]).some(e=>e.id===n[1]))return;let i;try{await Or(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function ti(e,t){e._committed=t,e.stores.setMatches(t)}function ni(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=Sr(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e<n.length;e++){let t=n[e];(e<s||t.status===`success`)&&r.add(t.id)}for(let n of[...i,...o.values()]){if(n.status!==`success`||r.has(n.id))continue;let i=kr(e,n);!i.options.loader||t-n.updatedAt>=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=cr(n);ti(e,n),Ir(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),lr(e,i,n,a,l,t)}async function ri(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function ii(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(i.maskedLocation??i).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function ai(e,t,n,r,i){let a=n.map(e=>({...e}));Lr(a);for(let t of r)Fr(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Yr(e,o,r,t[0],i)}catch(t){throw Ir(e,a),t}if(Dr(s)){Ir(e,a),s[0]===O&&e._tx===t&&e._committed===n&&await ii(e,t,s);return}if(await Xr(e,s,t[0].signal),e._tx!==t||e._committed!==n){Ir(e,a);return}for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),Fr(e,n))}ti(e,a),Ir(e,n,a)}async function oi(e,t,n,r,i,a){let o=await Zr(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(Dr(o)){let n=o[0]===O&&e._tx===t;if((!n||o[1].options.reloadDocument)&&$r(e,t),Ir(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){$r(e,t);return}await ii(e,t,o);return}let s=o[1];if(e._tx===t&&await ei(e,t),e._tx!==t){$r(e,t),Ir(e,s),Kr(e,o);return}let c=t[2],l=or(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await ei(e,t),e._tx!==t){$r(e,t),Ir(e,s),Kr(e,o);return}let n=await e.startTransition(()=>{$r(e,t),ni(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);if(e._tx!==t){Kr(e,o);return}u?.length&&ai(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)})}async function si(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=or(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await ri(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});Lr(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){Ir(e,m),await ri(e,n);return}e._preflight=void 0;let g,_=()=>oi(e,y,f,()=>Qr(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>ri(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&Rr(e,t,!1)}n[0].abort(),Ir(e,n[3],y[3],!0)}if(e._tx!==y){Ir(e,y[3]),y[3]=[],g?.(),await ri(e,y);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&Qr(e,y),g?.(_()),await y[5]}async function ci(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),Lr(a),o=(e._preloads??=new Map).set(i,a),s=await Zr(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),Ir(e,a)),i.abort()}if(!Dr(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){hn(e)||console.error(e);return}}}var li=`Error preloading route! ☝️`,ui=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Rn:this.parentRoute||oe();let r=n?Rn:t?.path;r&&r!==`/`&&(r=on(r));let i=t?.id||r,a=n?Rn:rn([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=rn([`/`,a]));let o=a===`__root__`?`/`:rn([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=sn(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>zn({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},di=class extends ui{constructor(e){super(e)}},k=i(),fi=class extends D.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?D.createElement(this.props.errorComponent??pi,{error:e[0],reset:this.reset}):this.props.children}};function pi({error:e}){let[t,n]=D.useState(!1);return(0,k.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,k.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,k.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,k.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,k.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,k.jsx)(`div`,{children:(0,k.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,k.jsx)(`code`,{children:e.message}):null})}):null]})}function mi({children:e,fallback:t=null}){return(0,k.jsx)(D.Fragment,{children:hi()?e:t})}function hi(){return D.useSyncExternalStore(gi,()=>!0,()=>!1)}function gi(){return()=>{}}var A=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(A||{});function _i({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function vi(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var yi=[],bi=0,{link:xi,unlink:Si,propagate:Ci,checkDirty:wi,shallowPropagate:Ti}=_i({update(e){return e._update()},notify(e){yi[Di++]=e,e.flags&=~A.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=A.Mutable|A.Dirty,ji(e))}}),Ei=0,Di=0,Oi,ki=0;function Ai(e){try{++ki,e()}finally{--ki||Mi()}}function ji(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Si(n,e)}function Mi(){if(!(ki>0)){for(;Ei<Di;){let e=yi[Ei];yi[Ei++]=void 0,e.notify()}Ei=0,Di=0}}function Ni(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?A.None:A.Mutable,get(){return Oi!==void 0&&xi(i,Oi,bi),i._snapshot},subscribe(e){let t=vi(e),n={current:!1},r=Pi(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Oi,o=t?.compare??Object.is;if(n)Oi=i,++bi,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=A.Mutable|A.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Oi=a,n&&(i.flags&=~A.RecursedCheck),ji(i)}}};return n?(i.flags=A.Mutable|A.Dirty,i.get=function(){let e=i.flags;if(e&A.Dirty||e&A.Pending&&wi(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Ti(e)}}else e&A.Pending&&(i.flags=e&~A.Pending);return Oi!==void 0&&xi(i,Oi,bi),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Ci(e),Ti(e),Mi())}},i}function Pi(e){let t=()=>{let t=Oi;Oi=n,++bi,n.depsTail=void 0,n.flags=A.Watching|A.RecursedCheck;try{return e()}finally{Oi=t,n.flags&=~A.RecursedCheck,ji(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:A.Watching|A.RecursedCheck,notify(){let e=this.flags;e&A.Dirty||e&A.Pending&&wi(this.deps,this)?t():this.flags=A.Watching},stop(){this.flags=A.None,this.depsTail=void 0,ji(this)}};return t(),n}function Fi(e){return ie({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Ii(e){let{select:t,...n}=e;return ie({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Li(e){return ie({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Ri(e){return ie({...e,select:t=>e.select?e.select(t.context):t.context})}function zi(e){let t=D.useRef(e);return le(t.current,e,{ignoreUndefined:!1})||(t.current=e),t.current}function Bi(e,t){return e[0]===t[0]&&e[1]===t[1]}function Vi(e,t){let n=typeof e==`string`&&pe(e);if(n)return t.has(n)?e:null}function Hi(e,t,n,r,i){let a=ln(e.pathname,r),o=ln(t.pathname,r);return(n?.exact?a!==o:!a.startsWith(o)||a.length!==o.length&&a[o.length]!==`/`)||(n?.includeSearch??!0)&&!le(e.search,t.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:!n?.includeHash||i&&e.hash===t.hash}function Ui(e,t){let n=ne(),r=Nt(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:u,preloadDelay:d,preloadIntentProximity:f,hashScrollIntoView:p,replace:m,startTransition:h,resetScroll:g,viewTransition:_,children:v,target:y,disabled:b,style:x,className:S,onClick:C,onBlur:w,onFocus:T,onMouseEnter:ee,onMouseLeave:te,onTouchStart:re,ignoreBlocker:ie,params:ae,search:oe,hash:se,state:ce,mask:le,reloadDocument:ue,unsafeRelative:de,from:fe,_fromLocation:me,...he}=e,ge=s,_e=hi(),ve=zi(e.search),ye=zi(e.params),be=zi(o),xe=D.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,ve,ye,e.state,e.mask,e.unsafeRelative]),Se=D.useCallback(e=>{let t=Vi(ge,n.protocolAllowlist);if(t!==void 0)return[t??void 0];let r=n.buildLocation({_fromLocation:e,...xe}),i=Zi(r,n,b);return[i,!b&&(!i||pe(i))?void 0:Hi(e,r,be,n.basepath,_e)]},[be,b,_e,xe,n,ge]),[Ce,we]=c(n.stores.location,Se,Bi),Te=we===void 0?Ce:void 0,Ee=b||Ce===void 0,De=D.useRef(!1),Oe=e.reloadDocument||Te||Ee?!1:u??n.options.defaultPreload,ke=d??n.options.defaultPreloadDelay??0,E=D.useCallback(()=>{n.preloadRoute(xe).catch(e=>{console.warn(e),console.warn(li)})},[n,xe]),Ae=D.useCallback(e=>{if(!e){Yi(r);return}if(!(e.isIntersecting??Oe===`intent`)){e.isIntersecting===!1&&Yi(r);return}if(!ke){E();return}Ji.has(r)||Ji.set(r,setTimeout(()=>{Ji.delete(r),E()},ke))},[E,r,Oe,ke]);if(Mt(r,Ae,Oe!==`viewport`),D.useEffect(()=>{De.current||Oe===`render`&&(E(),De.current=!0)},[E,Oe]),Te)return{...he,ref:r,href:Te,...v&&{children:v},...y&&{target:y},...b&&{disabled:b},...x&&{style:x},...S&&{className:S},...C&&{onClick:C},...w&&{onBlur:w},...T&&{onFocus:T},...ee&&{onMouseEnter:ee},...te&&{onMouseLeave:te},...re&&{onTouchStart:re}};let je=l(we?i:a,{})??(we?Gi:Wi),Me=je.className,Ne=S?Me?`${S} ${Me}`:S:Me,Pe=je.style,Fe=x&&Pe?{...x,...Pe}:x||Pe,Ie=e=>{let t=e.currentTarget.getAttribute(`target`),r=y===void 0?t:y;!Ee&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0&&(e.preventDefault(),n.navigate({...xe,replace:m,resetScroll:g,hashScrollIntoView:p,startTransition:h,viewTransition:_,ignoreBlocker:ie}))},Le=()=>{Oe===`intent`&&E()},Re=()=>{Oe===`intent`&&Yi(r)};return{...he,...je,href:Ce,ref:r,onClick:Xi(C,Ie),onBlur:Xi(w,Re),onFocus:Xi(T,Ae),onMouseEnter:Xi(ee,Ae),onMouseLeave:Xi(te,Re),onTouchStart:Xi(re,Le),disabled:!!Ee,target:y,...Fe&&{style:Fe},...Ne&&{className:Ne},...Ee&&Ki,...we&&qi}}var Wi={},Gi={className:`active`},Ki={role:`link`,"aria-disabled":!0},qi={"data-status":`active`,"aria-current":`page`},Ji=new WeakMap,Yi=e=>{clearTimeout(Ji.get(e)),Ji.delete(e)},Xi=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function Zi(e,t,n){if(n)return;let r=e.maskedLocation??e,i=r.external?r.publicHref:t.history.createHref(r.publicHref)||`/`;if(!r.external&&i===r.publicHref||!fe(i,t.protocolAllowlist))return i}var Qi=D.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Ui(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;a=t}return D.createElement(n||`a`,a,o)}),$i=class extends ui{constructor(e){super(e),this.useMatch=e=>ie({...e,from:this.id}),this.useRouteContext=e=>Ri({...e,from:this.id}),this.useSearch=e=>f({...e,from:this.id}),this.useParams=e=>Li({...e,from:this.id}),this.useLoaderDeps=e=>Ii({...e,from:this.id}),this.useLoaderData=e=>Fi({...e,from:this.id}),this.useNavigate=()=>h({from:this.fullPath}),this.Link=D.forwardRef((e,t)=>(0,k.jsx)(Qi,{ref:t,from:this.fullPath,...e}))}};function ea(e){return new $i(e)}var ta=class extends di{constructor(e){super(e),this.useMatch=e=>ie({...e,from:this.id}),this.useRouteContext=e=>Ri({...e,from:this.id}),this.useSearch=e=>f({...e,from:this.id}),this.useParams=e=>Li({...e,from:this.id}),this.useLoaderDeps=e=>Ii({...e,from:this.id}),this.useLoaderData=e=>Fi({...e,from:this.id}),this.useNavigate=()=>h({from:this.fullPath}),this.Link=D.forwardRef((e,t)=>(0,k.jsx)(Qi,{ref:t,from:this.fullPath,...e}))}};function na(e){return new ta(e)}function ra(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,o.preload=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if(he(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r){if(At)At(a());else throw a()}return D.createElement(r,e)};return o.preload=a,o}function ia(e){let t=ne(),n=`not-found-${c(t.stores.location,e=>e.pathname)}-${c(t.stores.status,e=>e)}`;return(0,k.jsx)(fi,{getResetKey:()=>n,onCatch:(t,n)=>{if(hn(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(hn(t))return e.fallback?.(t);throw t},children:e.children})}function aa(){return(0,k.jsx)(`p`,{children:`Not Found`})}function oa(e){return(0,k.jsx)(k.Fragment,{children:e.children})}function sa(e,t,n){return t.options.notFoundComponent?(0,k.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,k.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,k.jsx)(aa,{})}function ca(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,k.jsx)(n,{}):null}var la=(e,t)=>e[0]===t[0]&&e[1]===t[1],ua=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,da=D.memo(function({routeId:e}){let t=ne();return(0,k.jsx)(fa,{router:t,match:c(t.stores.getMatchStore(e),e=>e)})});function fa({router:e,match:t}){let n=e.routesById[t.routeId],r=ca(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=ua(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s))?D.Suspense:oa,l=i?fi:oa,u=o?ia:oa;return(0,k.jsxs)(n.isRoot?n.options.shellComponent??oa:oa,{children:[(0,k.jsx)(Be.Provider,{value:t.routeId,children:(0,k.jsx)(c,{fallback:r,children:(0,k.jsx)(l,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(hn(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:(0,k.jsx)(u,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return D.createElement(o,e)},children:s?(0,k.jsx)(mi,{fallback:r,children:(0,k.jsx)(pa,{match:t})}):(0,k.jsx)(pa,{match:t})})})})}),null]})}var pa=D.memo(function({match:e}){let t=ne(),n=e.routeId,r=t.routesById[n],i=D.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=D.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,k.jsx)(e,{},i):(0,k.jsx)(ma,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!ua(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return ca(t,r)}if(e.status===`notFound`)return sa(t,r,e.error);if(e.status===`error`)throw e.error;return a}),ma=D.memo(function(){let e=ne(),t=D.useContext(Be),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=c(a,e=>[!!e._notFound,e.error],la),i=c(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return sa(e,e.routesById[t],r);if(!i)return null;let a=(0,k.jsx)(da,{routeId:i});return t===`__root__`?(0,k.jsx)(D.Suspense,{fallback:ca(e),children:a}):a});function ha(e,t){let n=e[1];e.length=0,n?.(t)}function ga({t:e}){let t=ne(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{ha(n,!1),n.push(i,a),e(t),D.startTransition(r)}),jt(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(sn(r.publicHref)!==sn(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...or(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function _a(){let e=ne(),t=e.routesById[Rn],n=ca(e,t),r=e.ssr?oa:D.Suspense,i=(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ga,{t:D.useState()[1]}),(0,k.jsx)(r,{fallback:n,children:(0,k.jsx)(va,{})})]});return e.options.InnerWrap?(0,k.jsx)(e.options.InnerWrap,{children:i}):i}function va(){let e=ne(),t=e._rendered,n=c(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;jt(()=>{t[0]===n&&ha(t,!0)},[t,n]);let a=i?(0,k.jsx)(da,{routeId:i}):null;return(0,k.jsx)(Be.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:(0,k.jsx)(fi,{getResetKey:()=>r,onCatch:void 0,children:a})})}var ya=e=>({createMutableStore:Ni,createReadonlyStore:Ni,batch:Ai}),ba=e=>new xa(e),xa=class extends ur{constructor(e){super(e,ya)}};function Sa({router:e,children:t,...n}){x(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,k.jsx)(re.Provider,{value:e,children:t});return e.options.Wrap?(0,k.jsx)(e.options.Wrap,{children:r}):r}function Ca({router:e,...t}){return(0,k.jsx)(Sa,{router:e,...t,children:(0,k.jsx)(_a,{})})}function wa(e){let t=ne({warn:e?.router===void 0}),n=e?.router||t;return c(n.stores.__store,Ve(e,n))}var Ta=null;function j(e,...t){Ta?.(e,t)}var Ea={303:`Multiple adapter contexts detected. This might happen in monorepos.`,404:`nuqs requires an adapter to work with your framework.`,409:"Multiple versions of the library are loaded. This may lead to unexpected behavior. Currently using `%s`, but `%s` (via the %s adapter) was about to load on top.",414:`Max safe URL length exceeded. Some browsers may not be able to accept this URL. Consider limiting the amount of state stored in the URL.`,429:"URL update rate-limited by the browser. Consider increasing `throttleMs` for key(s) `%s`. %O",500:`Empty search params cache. Search params can't be accessed in Layouts.`,501:"Search params cache already populated. Have you called `parse` twice?",502:"`processUrlSearchParams` threw while processing key(s) `%s`. %O"};function Da(e){return`[nuqs] ${Ea[e]}
|
|
4
|
+
See https://nuqs.dev/NUQS-${e}`}function Oa(e){if(e.size===0)return``;let t=[];for(let[n,r]of e.entries()){let e=n.replace(/#/g,`%23`).replace(/&/g,`%26`).replace(/\+/g,`%2B`).replace(/=/g,`%3D`).replace(/\?/g,`%3F`);t.push(`${e}=${ka(r)}`)}return`?`+t.join(`&`)}function ka(e){return e.replace(/%/g,`%25`).replace(/\+/g,`%2B`).replace(/ /g,`+`).replace(/#/g,`%23`).replace(/&/g,`%26`).replace(/"/g,`%22`).replace(/'/g,`%27`).replace(/`/g,`%60`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/[\x00-\x1F]/g,e=>encodeURIComponent(e))}var Aa=`2.10.1`,ja={};function Ma(e,t){let n=Symbol.for(`nuqs.${Aa}.${e}`),r=globalThis;if(r[n]!=null)return r[n];let i=Object.isExtensible(r)?r:ja;return i[n]??=t()}function Na(e,t,n){let r=Ma(e,()=>new WeakMap);return r.has(t)||r.set(t,n()),r.get(t)}var Pa=Na(`adapter-context`,D.createContext,()=>{let e=(0,D.createContext)({useAdapter(){throw Error(Da(404))}});return e.displayName=`NuqsAdapterContext`,e});typeof window<`u`&&(window.__NuqsAdapterContext&&window.__NuqsAdapterContext!==Pa&&console.error(Da(303)),window.__NuqsAdapterContext=Pa);function Fa(e){return({children:t,defaultOptions:n,processUrlSearchParams:r,...i})=>(0,D.createElement)(Pa.Provider,{...i,value:{useAdapter:e,defaultOptions:n,processUrlSearchParams:r}},t)}function Ia(){if(typeof window>`u`||!window.GestureEvent)return 50;try{let e=navigator.userAgent?.match(/version\/([\d\.]+) safari/i);return parseFloat(e[1])>=17?120:320}catch{return 320}}function La(e){return{method:`throttle`,timeMs:e}}var Ra=La(Ia());function za(e,t,n){if(typeof n==`string`)e.set(t,n);else{e.delete(t);for(let r of n)e.append(t,r);e.has(t)||e.set(t,``)}return e}function Ba(){let e=new Map;return{on(t,n){let r=e.get(t)||[];return r.push(n),e.set(t,r),()=>this.off(t,n)},off(t,n){let r=e.get(t);r&&e.set(t,r.filter(e=>e!==n))},emit(t,n){e.get(t)?.forEach(e=>e(n))}}}function Va(e,t,n){function r(){e(),n.removeEventListener(`abort`,a)}let i=setTimeout(r,t);function a(){clearTimeout(i),n.removeEventListener(`abort`,a)}n.addEventListener(`abort`,a)}function Ha(){let e=Promise;if(Promise.hasOwnProperty(`withResolvers`))return Promise.withResolvers();let t=()=>{},n=()=>{};return{promise:new e((e,r)=>{t=e,n=r}),resolve:t,reject:n}}function Ua(e,t){let n=t;for(let t=e.length-1;t>=0;t--){let r=e[t];if(!r)continue;let i=n;n=()=>r(i)}n()}function Wa(){return new URLSearchParams(location.search)}var Ga=class{updateMap=new Map;options={history:`replace`,scroll:!1,shallow:!0};timeMs=Ra.timeMs;transitions=new Set;resolvers=null;controller=null;lastFlushedAt=0;resetQueueOnNextPush=!1;push({key:e,query:t,options:n},r=Ra.timeMs){this.resetQueueOnNextPush&&=(this.reset(),!1),j(7,e,t,n),this.updateMap.set(e,t),n.history===`push`&&(this.options.history=`push`),n.scroll&&(this.options.scroll=!0),n.shallow===!1&&(this.options.shallow=!1),n.startTransition&&this.transitions.add(n.startTransition),(!Number.isFinite(this.timeMs)||r>this.timeMs)&&(this.timeMs=r)}getQueuedQuery(e){return this.updateMap.get(e)}getPendingPromise({getSearchParamsSnapshot:e=Wa}){return this.resolvers?.promise??Promise.resolve(e())}flush({getSearchParamsSnapshot:e=Wa,rateLimitFactor:t=1,...n},r){if(this.controller??=new AbortController,!Number.isFinite(this.timeMs))return j(8),Promise.resolve(e());if(this.resolvers)return this.resolvers.promise;this.resolvers=Ha();let i=()=>{this.lastFlushedAt=performance.now();let[t,i]=this.applyPendingUpdates({...n,autoResetQueueOnUpdate:n.autoResetQueueOnUpdate??!0,getSearchParamsSnapshot:e},r);i===null?(this.resolvers.resolve(t),this.resetQueueOnNextPush=!0):this.resolvers.reject(t),this.resolvers=null};return Va(()=>{let e=performance.now()-this.lastFlushedAt,n=this.timeMs,r=t*Math.max(0,n-e);j(9,r,n,t),r===0?i():Va(i,r,this.controller.signal)},0,this.controller.signal),this.resolvers.promise}abort(){return this.controller?.abort(),this.controller=new AbortController,this.resolvers?.resolve(new URLSearchParams),this.resolvers=null,this.reset()}reset(){let e=Array.from(this.updateMap.keys());return j(10,JSON.stringify(Object.fromEntries(this.updateMap))),this.updateMap.clear(),this.transitions.clear(),this.options={history:`replace`,scroll:!1,shallow:!0},this.timeMs=Ra.timeMs,e}applyPendingUpdates(e,t){let{updateUrl:n,getSearchParamsSnapshot:r}=e,i=r();if(j(11,this.updateMap.size,i.toString()),this.updateMap.size===0)return[i,null];let a=Array.from(this.updateMap.entries()),o={...this.options},s=Array.from(this.transitions);e.autoResetQueueOnUpdate&&this.reset(),j(12,a,o);for(let[e,t]of a)t===null?i.delete(e):i=za(i,e,t);if(t)try{i=t(i)}catch(e){return console.error(Da(502),a.map(([e])=>e).join(),e),this.resetQueueOnNextPush=!0,[i,e]}try{return Ua(s,()=>n(i,o)),[i,null]}catch(e){return console.error(Da(429),a.map(([e])=>e).join(),e),[i,e]}}},Ka=Ma(`throttle-queue`,()=>new Ga),qa=class{resolvers=Ha();controller=new AbortController;queuedValue=void 0;abort(){this.controller.abort(),this.queuedValue=void 0}push(e,t,n){return this.queuedValue=e,this.controller.abort(),this.controller=new AbortController,Va(()=>{let t=this.resolvers;try{j(13,e);let r=n(e);j(14,this.queuedValue),this.queuedValue=void 0,this.resolvers=Ha(),r.then(e=>t.resolve(e)).catch(e=>t.reject(e))}catch(e){this.queuedValue=void 0,t.reject(e)}},t,this.controller.signal),this.resolvers.promise}},Ja=class{throttleQueue;queues=new Map;queuedQuerySync=Ba();constructor(e=new Ga){this.throttleQueue=e}push(e,t,n,r){if(!Number.isFinite(t)){let e=n.getSearchParamsSnapshot??Wa;return Promise.resolve(e())}let i=e.key,a=this.queues.get(i);a||(j(15,i),a=new qa,this.queues.set(i,a)),j(17,e);let o=a.push(e,t,()=>(this.throttleQueue.push(e),this.throttleQueue.flush(n,r).finally(()=>{this.queues.get(i)?.queuedValue===void 0&&(j(16,i),this.queues.delete(i)),this.queuedQuerySync.emit(i)})));return this.queuedQuerySync.emit(i),o}abort(e){let t=this.queues.get(e);return t?(j(18,e,t.queuedValue?.query),this.queues.delete(e),t.abort(),this.queuedQuerySync.emit(e),e=>(e.then(t.resolvers.resolve,t.resolvers.reject),e)):e=>e}abortAll(){for(let[e,t]of this.queues.entries())j(18,e,t.queuedValue?.query),t.abort(),t.resolvers.resolve(new URLSearchParams),this.queuedQuerySync.emit(e);this.queues.clear()}getQueuedQuery(e){let t=this.queues.get(e)?.queuedValue?.query;return t===void 0?this.throttleQueue.getQueuedQuery(e):t}},Ya=Ma(`debounce-controller`,()=>new Ja(Ka));Ma(`queue-reset`,()=>({mutex:0}));function Xa(){j(19),Ya.abortAll(),Ka.abort().forEach(e=>Ya.queuedQuerySync.emit(e))}function Za(e,t,n){if(t.length===0)return e;let r=n?new URLSearchParams(e):e;for(let n of Array.from(e.keys()))t.includes(n)||r.delete(n);return r}function Qa(e){return Ma(`history-emitter.${e}`,()=>Ba())}var $a=`__nuqs__`,eo=Qa(`react`);function to(e){return function(t,n){let r=new URL(location.href);r.search=Oa(t),j(20,`react`,r),e&&n.shallow===!1?(n.history===`push`?location.assign:location.replace).call(location,r):(n.history===`push`?history.pushState:history.replaceState).call(history,history.state,$a,r),eo.emit(`update`,t),n.scroll===!0&&window.scrollTo({top:0})}}var no=(0,D.createContext)({fullPageNavigationOnShallowFalseUpdates:!1});function ro(e){return eo.on(`update`,e),window.addEventListener(`popstate`,e),()=>{eo.off(`update`,e),window.removeEventListener(`popstate`,e)}}function io(){return(0,D.useEffect)(()=>(window.addEventListener(`popstate`,Xa),()=>window.removeEventListener(`popstate`,Xa)),[]),null}function ao(e){let{fullPageNavigationOnShallowFalseUpdates:t,serverSearch:n}=(0,D.useContext)(no),r=(0,D.useRef)(null);function i(t){let n=Za(new URLSearchParams(t),e,!1),i=n.toString();return r.current?.key===i?r.current.search:(r.current={key:i,search:n},n)}return{searchParams:(0,D.useSyncExternalStore)(ro,()=>i(location.search),()=>i(n??``)),updateUrl:(0,D.useMemo)(()=>to(t),[t])}}var oo=Fa(ao);function so({children:e,fullPageNavigationOnShallowFalseUpdates:t=!1,serverSearch:n,...r}){return(0,D.createElement)(no.Provider,{value:{fullPageNavigationOnShallowFalseUpdates:t,serverSearch:n}},(0,D.createElement)(oo,{...r,children:[(0,D.createElement)(io,{key:`nuqs-adapter-queue-reset`}),e]}))}var co=r();function lo(e){let t=typeof e.run==`string`&&e.run.length>0?e.run:void 0,n=typeof e.flow==`string`&&e.flow.length>0?e.flow:void 0,r=e.follow===!1||e.follow===`false`?!1:void 0;return{...t===void 0?{}:{run:t},...n===void 0?{}:{flow:n},...r===void 0?{}:{follow:r}}}function uo(){let e=f({strict:!1}),t=h();return{selectedRunId:typeof e.run==`string`?e.run:null,selectedFlowId:typeof e.flow==`string`?e.flow:null,follow:e.follow!==!1,setSelectedRun:(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,run:e??void 0}),replace:!0})},[t]),setSelectedFlow:(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,flow:e??void 0}),replace:!0})},[t]),setFollow:(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,follow:e?void 0:!1}),replace:!0})},[t])}}function fo(e){let t=typeof e.resource==`string`&&e.resource.length>0?e.resource:void 0,n=typeof e.tenant==`string`&&e.tenant.length>0?e.tenant:void 0,r=e.view===`query`||e.view===`schema`||e.view===`performance`?e.view:void 0,i=e.facet===`sql`||e.facet===`kv`?e.facet:void 0;return{...t===void 0?{}:{resource:t},...n===void 0?{}:{tenant:n},...r===void 0?{}:{view:r},...i===void 0?{}:{facet:i}}}function po(){let e=f({strict:!1}),t=h(),n=typeof e.resource==`string`?e.resource:null,r=typeof e.tenant==`string`?e.tenant:null,i=e.view===`query`&&(e.facet===`sql`||e.facet===`kv`)?e.facet:null,a=e.view===`schema`,o=e.view===`performance`,s=o?e.facet===`kv`?`kv`:`sql`:null,c=(0,D.useCallback)((e,n)=>{t({to:`.`,search:t=>({...t,resource:e??void 0,...n?.keepView?{}:{view:void 0,facet:void 0}}),replace:!0})},[t]),l=(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,view:e?`query`:void 0,facet:e??void 0}),replace:!0})},[t]),u=(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,view:e?`schema`:void 0,facet:void 0}),replace:!0})},[t]),d=(0,D.useCallback)((e,n)=>{t({to:`.`,search:t=>({...t,view:e?`performance`:void 0,facet:e&&n===`kv`?`kv`:void 0}),replace:!0})},[t]);return{selectedResource:n,selectedTenant:r,queryFacet:i,schemaView:a,performanceView:o,performanceFacet:s,setSelectedResource:c,setSelectedTenant:(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,tenant:e??void 0}),replace:!0})},[t]),setQueryFacet:l,setSchemaView:u,setPerformanceView:d}}function mo(e){let t=typeof e.flow==`string`&&e.flow.length>0?e.flow:void 0;return{...t===void 0?{}:{flow:t}}}function ho(){let e=f({strict:!1}),t=h();return{selectedFlowId:typeof e.flow==`string`?e.flow:null,setSelectedFlow:(0,D.useCallback)(e=>{t({to:`.`,search:t=>({...t,flow:e??void 0}),replace:!0})},[t])}}var go={"15m":9e5,"1h":36e5,"24h":864e5,"7d":6048e5};function _o(e){return e===`15m`||e===`1h`||e===`24h`||e===`7d`?e:`1h`}function vo(e){return e.error!=null&&e.error.length>0}function yo(e,t){return e.length===0?0:e.length===1?e[0]:e[Math.min(e.length-1,Math.max(0,Math.ceil(t*e.length)-1))]}function bo(e,t,n){let r=t-Math.max(0,n);return e.filter(e=>e.startedAt>=r&&e.startedAt<=t)}function xo(e,t,n){let r=bo(e,t,n);if(r.length===0)return{kind:`empty`};let i=r.map(e=>e.durationMs).sort((e,t)=>e-t),a=r.filter(vo).length,o=r.length;return{kind:`summary`,total:o,errors:a,errorRate:a/o,p50Ms:yo(i,.5),p95Ms:yo(i,.95),p99Ms:yo(i,.99),from:t-Math.max(0,n),to:t,windowMs:n}}function So(e){let t=typeof e.run==`string`&&e.run.length>0?e.run:void 0,n=_o(e.window),r=typeof e.error==`string`&&e.error.length>0?e.error:void 0,i=typeof e.q==`string`&&e.q.length>0?e.q:void 0,a=e.view===`query`?`query`:void 0;return{...t===void 0?{}:{run:t},...n===`1h`?{}:{window:n},...r===void 0?{}:{error:r},...i===void 0?{}:{q:i},...a===void 0?{}:{view:a}}}function Co(){let e=f({strict:!1}),t=h(),n=typeof e.run==`string`?e.run:null,r=_o(e.window),i=typeof e.error==`string`?e.error:null,a=typeof e.q==`string`?e.q:``,o=e.view===`query`?`query`:`metrics`,s=(0,D.useCallback)(e=>{t({to:`.`,search:t=>So({...t,...e}),replace:!0})},[t]);return{selectedRunId:n,window:r,selectedErrorKey:i,query:a,view:o,setSelectedRun:(0,D.useCallback)(e=>{s({run:e??void 0})},[s]),setWindow:(0,D.useCallback)(e=>{s({window:e})},[s]),setSelectedError:(0,D.useCallback)((e,t)=>{s({error:e??void 0,...t===void 0?{}:{run:t??void 0}})},[s]),setQuery:(0,D.useCallback)(e=>{s({q:e.length>0?e:void 0})},[s]),setView:(0,D.useCallback)(e=>{s({view:e===`metrics`?void 0:e})},[s])}}function wo(e){let t=typeof e.q==`string`&&e.q.length>0?e.q:void 0,n=typeof e.name==`string`&&e.name.length>0?e.name:void 0,r=e.action===`set`||e.action===`rotate`||e.action===`rotate-master`||e.action===`create`?e.action:void 0;return{...t===void 0?{}:{q:t},...n===void 0?{}:{name:n},...r===void 0?{}:{action:r}}}function To(){let e=f({strict:!1}),t=h(),n=typeof e.q==`string`?e.q:``,r=typeof e.name==`string`?e.name:null,i=e.action??null,a=(0,D.useCallback)(e=>{t({to:`.`,search:t=>wo({...t,...e}),replace:!0})},[t]);return{query:n,selectedName:r,action:i,setQuery:(0,D.useCallback)(e=>{a({q:e.length>0?e:void 0})},[a]),setSelectedName:(0,D.useCallback)(e=>{a({name:e??void 0,action:void 0})},[a]),setAction:(0,D.useCallback)(e=>{a({action:e??void 0})},[a])}}function Eo(e){let t=typeof e.q==`string`&&e.q.length>0?e.q:void 0,n=typeof e.key==`string`&&e.key.length>0?e.key:void 0,r=e.action===`create`||e.action===`edit`||e.action===`refresh`||e.action===`revoke`||e.action===`rotate`?e.action:void 0;return{...t===void 0?{}:{q:t},...n===void 0?{}:{key:n},...r===void 0?{}:{action:r}}}function Do(){let e=f({strict:!1}),t=h(),n=typeof e.q==`string`?e.q:``,r=typeof e.key==`string`?e.key:null,i=e.action??null,a=(0,D.useCallback)(e=>{t({to:`.`,search:t=>Eo({...t,...e}),replace:!0})},[t]);return{query:n,selectedKey:r,action:i,setQuery:e=>{a({q:e.length>0?e:void 0})},setSelectedKey:e=>{a({key:e??void 0,action:void 0})},setAction:e=>{a({action:e??void 0})}}}var Oo=`/overview`,ko=new Set([`/overview`,`/flows`,`/store`,`/vault`,`/access`,`/observability`]),Ao=`/monitoring`,jo=`/observability`,Mo=1024;function No(e){if(typeof e!=`string`)return;let t=e.trim();if(t.length===0||t.length>Mo||!t.startsWith(`/`)||t.startsWith(`//`)||t.includes(`://`))return;let n,r;try{let e=new URL(t,`http://console.local`);if(e.origin!==`http://console.local`)return;n=e.pathname,r=e.search}catch{return}if(n===Ao&&(n=jo),ko.has(n))return r.length>0?`${n}${r}`:n}function Po(e){let t=No(e.next);return t===void 0||t===`/overview`?{}:{next:t}}function Fo(e){return Po({next:e})}function Io(e){let t=No(e);if(t===void 0)return{to:Oo,search:{}};let n=new URL(t,`http://console.local`),r=Object.fromEntries(n.searchParams.entries());return n.pathname===`/flows`?{to:`/flows`,search:mo(r)}:n.pathname===`/store`?{to:`/store`,search:fo(r)}:n.pathname===`/vault`?{to:`/vault`,search:wo(r)}:n.pathname===`/access`?{to:`/access`,search:Eo(r)}:n.pathname===jo?{to:`/observability`,search:So(r)}:{to:`/overview`,search:lo(r)}}function Lo(e,t){let n=Io(t);switch(n.to){case`/flows`:e({to:`/flows`,search:n.search});return;case`/store`:e({to:`/store`,search:n.search});return;case`/vault`:e({to:`/vault`,search:n.search});return;case`/access`:e({to:`/access`,search:n.search});return;case`/observability`:e({to:`/observability`,search:n.search});return;default:e({to:`/overview`,search:n.search})}}var Ro=[[`path`,{d:`M15 5H19.5C20.4346 5 20.9019 5 21.25 5.20096C21.478 5.33261 21.6674 5.52197 21.799 5.75C22 6.09808 22 6.56538 22 7.5C22 8.43462 22 8.90192 21.799 9.25C21.6674 9.47803 21.478 9.66739 21.25 9.79904C20.9019 10 20.4346 10 19.5 10H15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M13 14H19.5C20.4346 14 20.9019 14 21.25 14.201C21.478 14.3326 21.6674 14.522 21.799 14.75C22 15.0981 22 15.5654 22 16.5C22 17.4346 22 17.9019 21.799 18.25C21.6674 18.478 21.478 18.6674 21.25 18.799C20.9019 19 20.4346 19 19.5 19H13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M9.29969 14.3638L9.92373 13.9477L9.92373 13.9477L9.29969 14.3638ZM9.32684 14.4045L8.7028 14.8205L8.7028 14.8205L9.32684 14.4045ZM8.41421 21L7.88388 20.4697L8.41421 21ZM9.05201 20.3622L9.58234 20.8925H9.58234L9.05201 20.3622ZM9.19561 16.4867L8.59561 16.0367L8.59561 16.0367L9.19561 16.4867ZM9.27186 16.3851L9.87186 16.8351L9.87186 16.8351L9.27186 16.3851ZM9.19561 18.3417L8.59561 18.7917L8.59561 18.7917L9.19561 18.3417ZM8.79241 17.7024L9.5106 17.4862V17.4862L8.79241 17.7024ZM8.79241 17.1261L9.5106 17.3422V17.3422L8.79241 17.1261ZM5.58579 21L5.05546 21.5303L5.05546 21.5303L5.58579 21ZM9.76462 15.2332L10.5065 15.1229L10.5065 15.1229L9.76462 15.2332ZM9.75494 15.5819L10.4895 15.7332V15.7332L9.75494 15.5819ZM9.60244 19.7056L8.91033 19.4167V19.4167L9.60244 19.7056ZM9.64765 19.0695L10.3737 18.8814V18.8814L9.64765 19.0695ZM9.02647 13.84L9.75662 13.6686L9.75662 13.6686L9.02647 13.84ZM9.06318 13.9613L8.36057 14.2236L8.36057 14.2236L9.06318 13.9613ZM9 11.584L8.69972 10.8967C8.42655 11.016 8.25 11.2859 8.25 11.584H9ZM5 11.584H5.75C5.75 11.2859 5.57345 11.016 5.30028 10.8967L5 11.584ZM2 7H2.75C2.75 4.65279 4.65279 2.75 7 2.75V2V1.25C3.82436 1.25 1.25 3.82436 1.25 7H2ZM7 2V2.75C9.34721 2.75 11.25 4.65279 11.25 7H12H12.75C12.75 3.82436 10.1756 1.25 7 1.25V2ZM9.29969 14.3638L8.67565 14.7798L8.7028 14.8205L9.32684 14.4045L9.95088 13.9884L9.92373 13.9477L9.29969 14.3638ZM8.41421 21L8.94454 21.5303L9.58234 20.8925L9.05201 20.3622L8.52168 19.8319L7.88388 20.4697L8.41421 21ZM9.19561 16.4867L9.79561 16.9367L9.87186 16.8351L9.27186 16.3851L8.67186 15.9351L8.59561 16.0367L9.19561 16.4867ZM9.19561 18.3417L9.79561 17.8917C9.67257 17.7276 9.60164 17.6325 9.55282 17.5578C9.50856 17.4902 9.50756 17.4761 9.5106 17.4862L8.79241 17.7024L8.07422 17.9185C8.17302 18.2468 8.39708 18.527 8.59561 18.7917L9.19561 18.3417ZM9.19561 16.4867L8.59561 16.0367C8.39708 16.3014 8.17302 16.5816 8.07422 16.91L8.79241 17.1261L9.5106 17.3422C9.50756 17.3523 9.50856 17.3382 9.55282 17.2706C9.60164 17.196 9.67257 17.1008 9.79561 16.9367L9.19561 16.4867ZM8.79241 17.7024L9.5106 17.4862C9.49647 17.4393 9.49647 17.3892 9.5106 17.3422L8.79241 17.1261L8.07422 16.91C7.97526 17.2388 7.97526 17.5896 8.07422 17.9185L8.79241 17.7024ZM5.58579 21L5.05546 21.5303C5.37379 21.8487 5.66477 22.1419 5.93262 22.3463C6.21778 22.5638 6.56297 22.75 7 22.75V22V21.25C6.99936 21.25 6.99936 21.25 6.9998 21.25C7.00025 21.2501 7.00053 21.2501 7.00045 21.2501C7.00036 21.2501 6.99936 21.2499 6.99731 21.2492C6.99523 21.2486 6.99174 21.2474 6.98671 21.2453C6.96497 21.2362 6.91996 21.2128 6.8425 21.1537C6.67346 21.0248 6.46444 20.818 6.11612 20.4697L5.58579 21ZM8.41421 21L7.88388 20.4697C7.53556 20.818 7.32654 21.0248 7.1575 21.1537C7.08004 21.2128 7.03503 21.2362 7.0133 21.2453C7.00826 21.2474 7.00477 21.2486 7.00269 21.2492C7.00064 21.2499 6.99965 21.2501 6.99955 21.2501C6.99947 21.2501 6.99975 21.2501 7.0002 21.25C7.00064 21.25 7.00064 21.25 7 21.25V22V22.75C7.43703 22.75 7.78222 22.5638 8.06737 22.3463C8.33523 22.1419 8.62621 21.8487 8.94454 21.5303L8.41421 21ZM5 19.5858H4.25C4.25 19.9333 4.23672 20.316 4.38321 20.6697L5.07612 20.3827L5.76903 20.0957C5.76901 20.0956 5.76889 20.0954 5.7686 20.0944C5.76828 20.0933 5.76746 20.0905 5.76635 20.0852C5.76401 20.0739 5.76041 20.052 5.75736 20.0117C5.7505 19.9215 5.75 19.8011 5.75 19.5858H5ZM5.58579 21L6.11612 20.4697C5.96383 20.3174 5.87909 20.2319 5.82012 20.1633C5.79385 20.1327 5.78085 20.1146 5.77456 20.105C5.77157 20.1004 5.77014 20.0978 5.76963 20.0969C5.76915 20.096 5.76905 20.0957 5.76903 20.0957L5.07612 20.3827L4.38321 20.6697C4.5297 21.0233 4.8097 21.2846 5.05546 21.5303L5.58579 21ZM9.32684 14.4045L8.7028 14.8205C8.84441 15.0329 8.92554 15.1556 8.97895 15.2518C9.0267 15.3378 9.02449 15.355 9.02277 15.3435L9.76462 15.2332L10.5065 15.1229C10.4718 14.8899 10.3857 14.6953 10.2903 14.5234C10.2005 14.3618 10.0792 14.1809 9.95087 13.9884L9.32684 14.4045ZM9.27186 16.3851L9.87186 16.8351C10.0106 16.65 10.1418 16.4761 10.2404 16.3197C10.3452 16.1534 10.442 15.9638 10.4895 15.7332L9.75494 15.5819L9.02035 15.4306C9.02271 15.4192 9.02396 15.4366 8.97152 15.5197C8.91285 15.6128 8.82504 15.7308 8.67186 15.9351L9.27186 16.3851ZM9.76462 15.2332L9.02277 15.3435C9.02708 15.3724 9.02626 15.402 9.02035 15.4306L9.75494 15.5819L10.4895 15.7332C10.5309 15.5323 10.5366 15.3257 10.5065 15.1229L9.76462 15.2332ZM9.05201 20.3622L9.58234 20.8925C9.73312 20.7418 9.87353 20.6019 9.98321 20.4758C10.0983 20.3435 10.2133 20.1892 10.2946 19.9945L9.60244 19.7056L8.91033 19.4167C8.91552 19.4043 8.9134 19.4202 8.85137 19.4915C8.78391 19.569 8.68714 19.6664 8.52168 19.8319L9.05201 20.3622ZM9.19561 18.3417L8.59561 18.7917C8.736 18.9789 8.81803 19.089 8.87384 19.1753C8.92516 19.2547 8.92501 19.2707 8.92163 19.2577L9.64765 19.0695L10.3737 18.8814C10.3207 18.6772 10.2287 18.5082 10.1335 18.3609C10.0428 18.2205 9.92355 18.0623 9.79561 17.8917L9.19561 18.3417ZM9.60244 19.7056L10.2946 19.9945C10.4417 19.6421 10.4695 19.2511 10.3737 18.8814L9.64765 19.0695L8.92163 19.2577C8.93532 19.3105 8.93135 19.3663 8.91033 19.4167L9.60244 19.7056ZM9 13.3739H8.25C8.25 13.5755 8.24543 13.7947 8.29633 14.0115L9.02647 13.84L9.75662 13.6686C9.75749 13.6723 9.75458 13.6641 9.75254 13.6191C9.75018 13.5669 9.75 13.4981 9.75 13.3739H9ZM9.29969 14.3638L9.92373 13.9477C9.85483 13.8444 9.81683 13.7871 9.78988 13.7424C9.76658 13.7037 9.76447 13.6953 9.7658 13.6989L9.06318 13.9613L8.36057 14.2236C8.43847 14.4322 8.56384 14.6121 8.67565 14.7798L9.29969 14.3638ZM9.02647 13.84L8.29633 14.0114C8.31324 14.0835 8.3347 14.1543 8.36057 14.2236L9.06318 13.9613L9.7658 13.6989C9.7621 13.689 9.75903 13.6789 9.75662 13.6686L9.02647 13.84ZM9 11.584H8.25V13.3739H9H9.75V11.584H9ZM12 7H11.25C11.25 8.74161 10.2023 10.2402 8.69972 10.8967L9 11.584L9.30028 12.2712C11.3295 11.3846 12.75 9.35903 12.75 7H12ZM5 11.584H4.25V19.5858H5H5.75V11.584H5ZM5 11.584L5.30028 10.8967C3.79769 10.2402 2.75 8.74161 2.75 7H2H1.25C1.25 9.35903 2.6705 11.3846 4.69972 12.2712L5 11.584Z`,fill:`currentColor`,key:`2`}],[`path`,{d:`M7.25 7H7M7.5 7C7.5 7.27614 7.27614 7.5 7 7.5C6.72386 7.5 6.5 7.27614 6.5 7C6.5 6.72386 6.72386 6.5 7 6.5C7.27614 6.5 7.5 6.72386 7.5 7Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],zo=[[`path`,{d:`M7 21H16.9999C19.3569 21 20.5354 21 21.2677 20.2678C21.9999 19.5355 21.9999 18.357 21.9999 16C21.9999 13.643 21.9999 12.4645 21.2677 11.7322C20.5354 11 19.3569 11 16.9999 11H7C4.64302 11 3.46453 11 2.7323 11.7322C2.00007 12.4644 2.00005 13.6429 2 15.9999C1.99995 18.357 1.99993 19.5355 2.73217 20.2677C3.4644 21 4.64294 21 7 21Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M4 11C4.00005 9.59977 4.00008 8.89966 4.27263 8.36485C4.5123 7.89455 4.89469 7.51218 5.365 7.27253C5.89981 7 6.59993 7 8.00015 7H16C17.4001 7 18.1002 7 18.635 7.27248C19.1054 7.51217 19.4878 7.89462 19.7275 8.36502C20 8.8998 20 9.59987 20 11`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M6 7C6.00004 5.5998 6.00006 4.89969 6.27259 4.3649C6.51227 3.89457 6.89467 3.51218 7.36501 3.27252C7.89981 3 8.59991 3 10.0001 3H14C15.4001 3 16.1002 3 16.635 3.27248C17.1054 3.51217 17.4878 3.89462 17.7275 4.36502C18 4.8998 18 5.59987 18 7`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M16 15L15.7 15.4C15.1111 16.1851 14.8167 16.5777 14.3944 16.7889C13.9721 17 13.4814 17 12.5 17H11.5C10.5186 17 10.0279 17 9.60557 16.7889C9.18328 16.5777 8.88885 16.1851 8.3 15.4L8 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],Bo=[[`path`,{d:`M4.26781 18.8447C4.49269 20.515 5.87613 21.8235 7.55966 21.9009C8.97627 21.966 10.4153 22 12 22C13.5847 22 15.0237 21.966 16.4403 21.9009C18.1239 21.8235 19.5073 20.515 19.7322 18.8447C19.879 17.7547 20 16.6376 20 15.5C20 14.3624 19.879 13.2453 19.7322 12.1553C19.5073 10.485 18.1239 9.17649 16.4403 9.09909C15.0237 9.03397 13.5847 9 12 9C10.4153 9 8.97627 9.03397 7.55966 9.09909C5.87613 9.17649 4.49269 10.485 4.26781 12.1553C4.12105 13.2453 4 14.3624 4 15.5C4 16.6376 4.12105 17.7547 4.26781 18.8447Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7.5 9V6.5C7.5 4.01472 9.51472 2 12 2C14.4853 2 16.5 4.01472 16.5 6.5V9`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M8 17.5V16C8 13.7909 9.79086 12 12 12C14.2091 12 16 13.7909 16 16V17.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M10.5 19V16C10.5 15.1716 11.1716 14.5 12 14.5C12.8284 14.5 13.5 15.1716 13.5 16M13.5 19V18`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}]],Vo=[[`path`,{d:`M3 11L5.5 8.5C6.51706 7.48294 7.02558 6.97442 7.63723 6.8616C7.87705 6.81737 8.12295 6.81737 8.36277 6.8616C8.97442 6.97442 9.48295 7.48295 10.5 8.5C11.5171 9.51705 12.0256 10.0256 12.6372 10.1384C12.8771 10.1826 13.1229 10.1826 13.3628 10.1384C13.9744 10.0256 14.4829 9.51705 15.5 8.5L21 3`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M3 15V21M9 13V21M15 16V21M21 9V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Ho=[[`path`,{d:`M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8 12.5L10.5 15L16 9`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Uo=[[`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Wo=[[`path`,{d:`M15 9V15H9V9H15Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M15 15H18C19.6569 15 21 16.3431 21 18C21 19.6569 19.6569 21 18 21C16.3431 21 15 19.6569 15 18V15Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M9 15.002H6C4.34315 15.002 3 16.3451 3 18.002C3 19.6588 4.34315 21.002 6 21.002C7.65685 21.002 9 19.6588 9 18.002V15.002Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M15 9L15 6C15 4.34315 16.3431 3 18 3C19.6569 3 21 4.34315 21 6C21 7.65685 19.6569 9 18 9H15Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M9 9V6C9 4.34315 7.65685 3 6 3C4.34315 3 3 4.34315 3 6C3 7.65685 4.34315 9 6 9H9Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}]],Go=[[`path`,{d:`M14 21H16M14 21C13.1716 21 12.5 20.3284 12.5 19.5V17L12 17M14 21H10M10 21H8M10 21C10.8284 21 11.5 20.3284 11.5 19.5V17L12 17M12 17V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M16 3H8C5.17157 3 3.75736 3 2.87868 3.87868C2 4.75736 2 6.17157 2 9V11C2 13.8284 2 15.2426 2.87868 16.1213C3.75736 17 5.17157 17 8 17H16C18.8284 17 20.2426 17 21.1213 16.1213C22 15.2426 22 13.8284 22 11V9C22 6.17157 22 4.75736 21.1213 3.87868C20.2426 3 18.8284 3 16 3Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Ko=[[`path`,{d:`M2.79289 21.2071C3.08579 21.5 3.55719 21.5 4.5 21.5H14.5C15.4428 21.5 15.9142 21.5 16.2071 21.2071M2.79289 21.2071C2.5 20.9142 2.5 20.4428 2.5 19.5V9.5C2.5 8.55719 2.5 8.08579 2.79289 7.79289M2.79289 21.2071L8.79289 15.2071M16.2071 21.2071C16.5 20.9142 16.5 20.4428 16.5 19.5V9.5C16.5 8.55719 16.5 8.08579 16.2071 7.79289M16.2071 21.2071L21.2071 16.2071C21.5 15.9142 21.5 15.4428 21.5 14.5V4.5C21.5 3.55719 21.5 3.08579 21.2071 2.79289M16.2071 7.79289C15.9142 7.5 15.4428 7.5 14.5 7.5H4.5C3.55719 7.5 3.08579 7.5 2.79289 7.79289M16.2071 7.79289L21.2071 2.79289M2.79289 7.79289L7.79289 2.79289C8.08579 2.5 8.55719 2.5 9.5 2.5H19.5C20.4428 2.5 20.9142 2.5 21.2071 2.79289M8.79289 15.2071C9.08579 15.5 9.55719 15.5 10.5 15.5H14M8.79289 15.2071C8.5 14.9142 8.5 14.4428 8.5 13.5V10.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],qo=[[`path`,{d:`M12 3V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 18V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M21 12L18 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M6 12L3 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M18.3635 5.63672L16.2422 7.75804`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M7.75804 16.2422L5.63672 18.3635`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`5`}],[`path`,{d:`M18.3635 18.3635L16.2422 16.2422`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`6`}],[`path`,{d:`M7.75804 7.75804L5.63672 5.63672`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`7`}]],Jo=[[`path`,{d:`M18 18C18 18.4644 18 18.6965 17.978 18.8918C17.7952 20.5145 16.5145 21.7952 14.8919 21.978C14.6965 22 14.4644 22 14 22H11C7.70017 22 6.05025 22 5.02513 20.9749C4 19.9498 4 18.2998 4 15L4.00001 8.99998C4.00001 5.70016 4.00003 4.05024 5.02514 3.02512C6.05027 2 7.70018 2 11 2H14C14.4644 2 14.6965 2 14.8919 2.02201C16.5145 2.20483 17.7952 3.48547 17.978 5.10816C18 5.30347 18 5.53565 18 6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8.07612 11.1183C8 11.3021 8 11.535 8 12.001C8 12.4669 8 12.6999 8.07612 12.8837C8.17761 13.1287 8.37229 13.3234 8.61732 13.4249C8.80109 13.501 9.03406 13.501 9.5 13.501H14.5C14.5002 15.2503 14.511 16.1299 15.0623 16.3858C15.0829 16.3954 15.1037 16.4042 15.1249 16.4124C15.7045 16.6353 16.3999 16.0139 17.7907 14.7711C19.2576 13.4602 19.9912 12.7851 20 11.957C19.9912 11.1289 19.2576 10.4538 17.7907 9.14301C16.3999 7.90018 15.7045 7.27876 15.1249 7.50171C15.1037 7.50985 15.0829 7.51869 15.0623 7.52822C14.5018 7.78844 14.5 8.69318 14.5 10.501H9.5C9.03406 10.501 8.80109 10.501 8.61732 10.5771C8.37229 10.6786 8.17761 10.8733 8.07612 11.1183Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Yo=[[`path`,{d:`M21.5 14.0784C20.3003 14.7189 18.9301 15.0821 17.4751 15.0821C12.7491 15.0821 8.91792 11.2509 8.91792 6.52485C8.91792 5.06986 9.28105 3.69968 9.92163 2.5C5.66765 3.49698 2.5 7.31513 2.5 11.8731C2.5 17.1899 6.8101 21.5 12.1269 21.5C16.6849 21.5 20.503 18.3324 21.5 14.0784Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Xo=[[`path`,{d:`M17 17L21 21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19C15.4183 19 19 15.4183 19 11Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Zo=[[`path`,{d:`M21.3175 7.14139L20.8239 6.28479C20.4506 5.63696 20.264 5.31305 19.9464 5.18388C19.6288 5.05472 19.2696 5.15664 18.5513 5.36048L17.3311 5.70418C16.8725 5.80994 16.3913 5.74994 15.9726 5.53479L15.6357 5.34042C15.2766 5.11043 15.0004 4.77133 14.8475 4.37274L14.5136 3.37536C14.294 2.71534 14.1842 2.38533 13.9228 2.19657C13.6615 2.00781 13.3143 2.00781 12.6199 2.00781H11.5051C10.8108 2.00781 10.4636 2.00781 10.2022 2.19657C9.94085 2.38533 9.83106 2.71534 9.61149 3.37536L9.27753 4.37274C9.12465 4.77133 8.84845 5.11043 8.48937 5.34042L8.15249 5.53479C7.73374 5.74994 7.25259 5.80994 6.79398 5.70418L5.57375 5.36048C4.85541 5.15664 4.49625 5.05472 4.17867 5.18388C3.86109 5.31305 3.67445 5.63696 3.30115 6.28479L2.80757 7.14139C2.45766 7.74864 2.2827 8.05227 2.31666 8.37549C2.35061 8.69871 2.58483 8.95918 3.05326 9.48012L4.0843 10.6328C4.3363 10.9518 4.51521 11.5078 4.51521 12.0077C4.51521 12.5078 4.33636 13.0636 4.08433 13.3827L3.05326 14.5354C2.58483 15.0564 2.35062 15.3168 2.31666 15.6401C2.2827 15.9633 2.45766 16.2669 2.80757 16.8741L3.30114 17.7307C3.67443 18.3785 3.86109 18.7025 4.17867 18.8316C4.49625 18.9608 4.85542 18.8589 5.57377 18.655L6.79394 18.3113C7.25263 18.2055 7.73387 18.2656 8.15267 18.4808L8.4895 18.6752C8.84851 18.9052 9.12464 19.2442 9.2775 19.6428L9.61149 20.6403C9.83106 21.3003 9.94085 21.6303 10.2022 21.8191C10.4636 22.0078 10.8108 22.0078 11.5051 22.0078H12.6199C13.3143 22.0078 13.6615 22.0078 13.9228 21.8191C14.1842 21.6303 14.294 21.3003 14.5136 20.6403L14.8476 19.6428C15.0004 19.2442 15.2765 18.9052 15.6356 18.6752L15.9724 18.4808C16.3912 18.2656 16.8724 18.2055 17.3311 18.3113L18.5513 18.655C19.2696 18.8589 19.6288 18.9608 19.9464 18.8316C20.264 18.7025 20.4506 18.3785 20.8239 17.7307L21.3175 16.8741C21.6674 16.2669 21.8423 15.9633 21.8084 15.6401C21.7744 15.3168 21.5402 15.0564 21.0718 14.5354L20.0407 13.3827C19.7887 13.0636 19.6098 12.5078 19.6098 12.0077C19.6098 11.5078 19.7888 10.9518 20.0407 10.6328L21.0718 9.48012C21.5402 8.95918 21.7744 8.69871 21.8084 8.37549C21.8423 8.05227 21.6674 7.74864 21.3175 7.14139Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M15.5195 12C15.5195 13.933 13.9525 15.5 12.0195 15.5C10.0865 15.5 8.51953 13.933 8.51953 12C8.51953 10.067 10.0865 8.5 12.0195 8.5C13.9525 8.5 15.5195 10.067 15.5195 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}]],Qo=[[`path`,{d:`M13.3382 10H10.6618C9.1273 10 8.36006 10 8.08543 9.49297C7.8108 8.98594 8.21743 8.32019 9.0307 6.9887L10.3689 4.79773C11.101 3.59924 11.467 3 12 3C12.533 3 12.899 3.59924 13.6311 4.79773L14.9693 6.9887C15.7826 8.32019 16.1892 8.98594 15.9146 9.49297C15.6399 10 14.8727 10 13.3382 10Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M9.66294 20.1111C10 19.6067 10 18.9045 10 17.5C10 16.0955 10 15.3933 9.66294 14.8889C9.51702 14.6705 9.32952 14.483 9.11114 14.3371C8.60669 14 7.90446 14 6.5 14C5.09554 14 4.39331 14 3.88886 14.3371C3.67048 14.483 3.48298 14.6705 3.33706 14.8889C3 15.3933 3 16.0955 3 17.5C3 18.9045 3 19.6067 3.33706 20.1111C3.48298 20.3295 3.67048 20.517 3.88886 20.6629C4.39331 21 5.09554 21 6.5 21C7.90446 21 8.60669 21 9.11114 20.6629C9.32952 20.517 9.51702 20.3295 9.66294 20.1111Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],$o=[[`path`,{d:`M19.5576 4L20.4551 4.97574C20.8561 5.41165 21.0566 5.62961 20.9861 5.81481C20.9155 6 20.632 6 20.0649 6C18.7956 6 17.2771 5.79493 16.1111 6.4733C15.3903 6.89272 14.8883 7.62517 14.0392 9M3 18H4.58082C6.50873 18 7.47269 18 8.2862 17.5267C9.00708 17.1073 9.50904 16.3748 10.3582 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M19.5576 20L20.4551 19.0243C20.8561 18.5883 21.0566 18.3704 20.9861 18.1852C20.9155 18 20.632 18 20.0649 18C18.7956 18 17.2771 18.2051 16.1111 17.5267C15.2976 17.0534 14.7629 16.1815 13.6935 14.4376L10.7038 9.5624C9.63441 7.81853 9.0997 6.9466 8.2862 6.4733C7.47269 6 6.50873 6 4.58082 6H3`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],es=[[`path`,{d:`M2 12C2 8.31087 2 6.4663 2.81382 5.15877C3.1149 4.67502 3.48891 4.25427 3.91891 3.91554C5.08116 3 6.72077 3 10 3H14C17.2792 3 18.9188 3 20.0811 3.91554C20.5111 4.25427 20.8851 4.67502 21.1862 5.15877C22 6.4663 22 8.31087 22 12C22 15.6891 22 17.5337 21.1862 18.8412C20.8851 19.325 20.5111 19.7457 20.0811 20.0845C18.9188 21 17.2792 21 14 21H10C6.72077 21 5.08116 21 3.91891 20.0845C3.48891 19.7457 3.1149 19.325 2.81382 18.8412C2 17.5337 2 15.6891 2 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.5 3L9.5 21`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M5 7H6M5 10H6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],ts=[[`path`,{d:`M17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 2V3.5M12 20.5V22M19.0708 19.0713L18.0101 18.0106M5.98926 5.98926L4.9286 4.9286M22 12H20.5M3.5 12H2M19.0713 4.92871L18.0106 5.98937M5.98975 18.0107L4.92909 19.0714`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}]],ns=[[`path`,{d:`M19.439 15.439C20.3636 14.5212 21.0775 13.6091 21.544 12.955C21.848 12.5287 22 12.3155 22 12C22 11.6845 21.848 11.4713 21.544 11.045C20.1779 9.12944 16.6892 5 12 5C11.0922 5 10.2294 5.15476 9.41827 5.41827M6.74742 6.74742C4.73118 8.1072 3.24215 9.94266 2.45604 11.045C2.15201 11.4713 2 11.6845 2 12C2 12.3155 2.15201 12.5287 2.45604 12.955C3.8221 14.8706 7.31078 19 12 19C13.9908 19 15.7651 18.2557 17.2526 17.2526`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.85786 10C9.32783 10.53 9 11.2623 9 12.0711C9 13.6887 10.3113 15 11.9289 15C12.7377 15 13.47 14.6722 14 14.1421`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M3 3L21 21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],rs=[[`path`,{d:`M21.544 11.045C21.848 11.4713 22 11.6845 22 12C22 12.3155 21.848 12.5287 21.544 12.955C20.1779 14.8706 16.6892 19 12 19C7.31078 19 3.8221 14.8706 2.45604 12.955C2.15201 12.5287 2 12.3155 2 12C2 11.6845 2.15201 11.4713 2.45604 11.045C3.8221 9.12944 7.31078 5 12 5C16.6892 5 20.1779 9.12944 21.544 11.045Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15C13.6569 15 15 13.6569 15 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}]],is=[[`path`,{d:`M3 19C3 20.4142 3 21.1213 3.43934 21.5607C3.87868 22 4.58579 22 6 22C7.41421 22 8.12132 22 8.56066 21.5607C9 21.1213 9 20.4142 9 19C9 17.5858 9 16.8787 8.56066 16.4393C8.12132 16 7.41421 16 6 16C4.58579 16 3.87868 16 3.43934 16.4393C3 16.8787 3 17.5858 3 19Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M3 5C3 6.41421 3 7.12132 3.43934 7.56066C3.87868 8 4.58579 8 6 8C7.41421 8 8.12132 8 8.56066 7.56066C9 7.12132 9 6.41421 9 5C9 3.58579 9 2.87868 8.56066 2.43934C8.12132 2 7.41421 2 6 2C4.58579 2 3.87868 2 3.43934 2.43934C3 2.87868 3 3.58579 3 5Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M15 14C15 15.4142 15 16.1213 15.4393 16.5607C15.8787 17 16.5858 17 18 17C19.4142 17 20.1213 17 20.5607 16.5607C21 16.1213 21 15.4142 21 14C21 12.5858 21 11.8787 20.5607 11.4393C20.1213 11 19.4142 11 18 11C16.5858 11 15.8787 11 15.4393 11.4393C15 11.8787 15 12.5858 15 14Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M6 8V16`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M15 14H12C8.68629 14 6 11.3137 6 8`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}]],as=[.16,1,.3,1],os={type:`spring`,stiffness:500,damping:30,mass:.6},ss={type:`spring`,stiffness:460,damping:30,mass:.55},cs={type:`spring`,stiffness:420,damping:40,mass:.5},ls={type:`spring`,stiffness:360,damping:32,mass:.6};function us(){let[e,t]=(0,D.useState)(!1);return(0,D.useEffect)(()=>{if(typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(hover: hover) and (pointer: fine)`),n=()=>{t(e.matches)};return n(),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var ds=(0,D.createContext)({});function fs(e){let t=(0,D.useRef)(null);return t.current===null&&(t.current=e()),t.current}var ps=typeof window<`u`?D.useLayoutEffect:D.useEffect,ms=(0,D.createContext)(null);function hs(e,t){e.indexOf(t)===-1&&e.push(t)}function gs(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var _s=(e,t,n)=>n>t?t:n<e?e:n,vs=()=>{},ys=()=>{},bs={},xs=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Ss=e=>typeof e==`object`&&!!e,Cs=e=>/^0[^.\s]+$/u.test(e);function ws(e){let t;return()=>(t===void 0&&(t=e()),t)}var Ts=e=>e,Es=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Ds=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},Os=class{constructor(){this.subscriptions=[]}add(e){return hs(this.subscriptions,e),()=>gs(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},ks=e=>e*1e3,As=e=>e/1e3,js=(e,t)=>t?1e3/t*e:0,Ms=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Ns=1e-7,Ps=12;function Fs(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Ms(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Ns&&++s<Ps);return o}function Is(e,t,n,r){if(e===t&&n===r)return Ts;let i=t=>Fs(t,0,1,e,n);return e=>e===0||e===1?e:Ms(i(e),t,r)}var Ls=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Rs=e=>t=>1-e(1-t),zs=Is(.33,1.53,.69,.99),Bs=Rs(zs),Vs=Ls(Bs),Hs=e=>e>=1?1:(e*=2)<1?.5*Bs(e):.5*(2-2**(-10*(e-1))),Us=e=>1-Math.sin(Math.acos(e)),Ws=Rs(Us),Gs=Ls(Us),Ks=Is(.42,0,1,1),qs=Is(0,0,.58,1),Js=Is(.42,0,.58,1),Ys=e=>Array.isArray(e)&&typeof e[0]!=`number`,Xs=e=>Array.isArray(e)&&typeof e[0]==`number`,Zs={linear:Ts,easeIn:Ks,easeInOut:Js,easeOut:qs,circIn:Us,circInOut:Gs,circOut:Ws,backIn:Bs,backInOut:Vs,backOut:zs,anticipate:Hs},Qs=e=>typeof e==`string`,$s=e=>{if(Xs(e)){e.length;let[t,n,r,i]=e;return Is(t,n,r,i)}return Qs(e)?(Zs[e],`${e}`,Zs[e]):e},ec=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function tc(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var nc=40;function rc(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=ec.reduce((e,t)=>(e[t]=tc(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=bs.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,nc),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:ec.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<ec.length;t++)o[ec[t]].cancel(e)},state:i,steps:o}}var{schedule:M,cancel:ic,state:N,steps:ac}=rc(typeof requestAnimationFrame<`u`?requestAnimationFrame:Ts,!0),oc;function sc(){oc=void 0}var P={now:()=>(oc===void 0&&P.set(N.isProcessing||bs.useManualTiming?N.timestamp:performance.now()),oc),set:e=>{oc=e,queueMicrotask(sc)}},cc=e=>t=>typeof t==`string`&&t.startsWith(e),lc=cc(`--`),uc=cc(`var(--`),dc=e=>uc(e)?fc.test(e.split(`/*`)[0].trim()):!1,fc=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function pc(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var mc={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},hc={...mc,transform:e=>_s(0,1,e)},gc={...mc,default:1},_c=e=>Math.round(e*1e5)/1e5,vc=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function yc(e){return e==null}var bc=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,xc=(e,t)=>n=>!!(typeof n==`string`&&bc.test(n)&&n.startsWith(e)||t&&!yc(n)&&Object.prototype.hasOwnProperty.call(n,t)),Sc=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(vc);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Cc=e=>_s(0,255,e),wc={...mc,transform:e=>Math.round(Cc(e))},Tc={test:xc(`rgb`,`red`),parse:Sc(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+wc.transform(e)+`, `+wc.transform(t)+`, `+wc.transform(n)+`, `+_c(hc.transform(r))+`)`};function Ec(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Dc={test:xc(`#`),parse:Ec,transform:Tc.transform},Oc=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),kc=Oc(`deg`),Ac=Oc(`%`),F=Oc(`px`),jc=Oc(`vh`),Mc=Oc(`vw`),Nc={...Ac,parse:e=>Ac.parse(e)/100,transform:e=>Ac.transform(e*100)},Pc={test:xc(`hsl`,`hue`),parse:Sc(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Ac.transform(_c(t))+`, `+Ac.transform(_c(n))+`, `+_c(hc.transform(r))+`)`},I={test:e=>Tc.test(e)||Dc.test(e)||Pc.test(e),parse:e=>Tc.test(e)?Tc.parse(e):Pc.test(e)?Pc.parse(e):Dc.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Tc.transform(e):Pc.transform(e),getAnimatableNone:e=>{let t=I.parse(e);return t.alpha=0,I.transform(t)}},Fc=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Ic(e){return isNaN(e)&&typeof e==`string`&&(e.match(vc)?.length||0)+(e.match(Fc)?.length||0)>0}var Lc=`number`,Rc=`color`,zc=`var`,Bc=`var(`,Vc="${}",Hc=/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+)/giu;function Uc(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Hc,e=>(I.test(e)?(r.color.push(a),i.push(Rc),n.push(I.parse(e))):e.startsWith(Bc)?(r.var.push(a),i.push(zc),n.push(e)):(r.number.push(a),i.push(Lc),n.push(parseFloat(e))),++a,Vc)).split(Vc),indexes:r,types:i}}function Wc(e){return Uc(e).values}function Gc({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Lc?_c(r[a]):e===Rc?I.transform(r[a]):r[a]}return i}}function Kc(e){return Gc(Uc(e))}var qc=e=>typeof e==`number`?0:I.test(e)?I.getAnimatableNone(e):e,Jc=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:qc(e);function Yc(e){let t=Uc(e);return Gc(t)(t.values.map((e,n)=>Jc(e,t.split[n])))}var Xc={test:Ic,parse:Wc,createTransformer:Kc,getAnimatableNone:Yc};function Zc(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Qc({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Zc(s,r,e+1/3),a=Zc(s,r,e),o=Zc(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function $c(e,t){return n=>n>0?t:e}var L=(e,t,n)=>e+(t-e)*n,el=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},tl=[Dc,Tc,Pc],nl=e=>tl.find(t=>t.test(e));function rl(e){let t=nl(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===Pc&&(n=Qc(n)),n}var il=(e,t)=>{let n=rl(e),r=rl(t);if(!n||!r)return $c(e,t);let i={...n};return e=>(i.red=el(n.red,r.red,e),i.green=el(n.green,r.green,e),i.blue=el(n.blue,r.blue,e),i.alpha=L(n.alpha,r.alpha,e),Tc.transform(i))},al=new Set([`none`,`hidden`]);function ol(e,t){return al.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function sl(e,t){return n=>L(e,t,n)}function cl(e){return typeof e==`number`?sl:typeof e==`string`?dc(e)?$c:I.test(e)?il:fl:Array.isArray(e)?ll:typeof e==`object`?I.test(e)?il:ul:$c}function ll(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>cl(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function ul(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=cl(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function dl(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var fl=(e,t)=>{let n=Xc.createTransformer(t),r=Uc(e),i=Uc(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?al.has(e)&&!i.values.length||al.has(t)&&!r.values.length?ol(e,t):Es(ll(dl(r,i),i.values),n):(`${e}${t}`,$c(e,t))};function pl(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?L(e,t,n):cl(e)(e,t)}var ml=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>M.update(t,e),stop:()=>ic(t),now:()=>N.isProcessing?N.timestamp:P.now()}},hl=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},gl=2e4;function _l(e,t=50,n=gl,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function vl(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(_l(r),gl);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:As(i)}}var R={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function yl(e,t){return e*Math.sqrt(1-t*t)}var bl=12;function xl(e,t,n){let r=n;for(let n=1;n<bl;n++)r-=e(r)/t(r);return r}var Sl=.001;function Cl({duration:e=R.duration,bounce:t=R.bounce,velocity:n=R.velocity,mass:r=R.mass}){let i,a;R.maxDuration;let o=1-t;o=_s(R.minDamping,R.maxDamping,o),e=_s(R.minDuration,R.maxDuration,As(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=yl(t,o),c=Math.exp(-i);return Sl-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o*o*t*t*e,c=Math.exp(-r),l=yl(t*t,o);return(-i(t)+Sl>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=xl(i,a,s);if(e=ks(e),isNaN(c))return{stiffness:R.stiffness,damping:R.damping,duration:e};{let t=c*c*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var wl=[`duration`,`bounce`],Tl=[`stiffness`,`damping`,`mass`];function El(e,t){return t.some(t=>e[t]!==void 0)}function Dl(e){let t={velocity:R.velocity,stiffness:R.stiffness,damping:R.damping,mass:R.mass,isResolvedFromDuration:!1,...e};if(!El(e,Tl)&&El(e,wl)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*_s(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:R.mass,stiffness:i,damping:a}}else{let n=Cl({...e,velocity:0});t={...t,...n,mass:R.mass},t.isResolvedFromDuration=!0}}return t}function Ol(e=R.visualDuration,t=R.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Dl({...n,velocity:-As(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=As(Math.sqrt(c/u)),v=h*_,y=Math.abs(g)<5;r||=y?R.restSpeed.granular:R.restSpeed.default,i||=y?R.restDelta.granular:R.restDelta.default;let b,x;if(h<1){let e=yl(_,h),t=(m+v*g)/e,n=v*t+g*e,r=v*g-t*e,i=-1,a=0,s=0,c=c=>{if(c!==i){i=c;let l=Math.exp(-v*c),u=Math.sin(e*c),d=Math.cos(e*c);a=o-l*(t*u+g*d),s=l*(n*u+r*d)}};b=e=>(c(e),a),x=e=>(c(e),s)}else if(h===1){b=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;x=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);b=t=>{let n=Math.exp(-v*t),r=Math.min(e*t,300);return o-n*((m+v*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+v*g)/e,n=v*t-g*e,r=v*g-t*e;x=t=>{let i=Math.exp(-v*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let S={calculatedDuration:p&&d||null,velocity:e=>ks(x(e)),next:e=>{let t=b(e);if(p)s.done=e>=d;else{let n=ks(x(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(_l(S),gl),t=hl(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}Ol.applyToOptions=e=>{let t=vl(e,100,Ol);return e.ease=t.ease,e.duration=ks(t.duration),e.type=`keyframes`,e};function kl({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=Ol({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Al(e,t,n){let r=[],i=n||bs.mix||pl,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=Es(Array.isArray(t)?t[n]||Ts:t,a)),r.push(a)}return r}function jl(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Al(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=Ds(e[r],e[r+1],n);return s[r](i)};return n?t=>l(_s(e[0],e[a-1],t)):l}function Ml(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Ds(0,t,r);e.push(L(n,1,i))}}function Nl(e){let t=[0];return Ml(t,e.length-1),t}function Pl(e,t){return e.map(e=>e*t)}function Fl(e,t){return e.map(()=>t||Js).splice(0,e.length-1)}function Il({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Ys(r)?r.map($s):$s(r),a={done:!1,value:t[0]},o=jl(Pl(n&&n.length===t.length?n:Nl(t),e),t,{ease:Array.isArray(i)?i:Fl(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Ll=5;function Rl(e,t,n){let r=Math.max(t-Ll,0);return js(n-e(r),t-r)}var zl=e=>e!==null;function Bl(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(zl),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Vl={decay:kl,inertia:kl,tween:Il,keyframes:Il,spring:Ol};function Hl(e){typeof e.type==`string`&&(e.type=Vl[e.type])}var Ul=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},Wl=e=>e/100,Gl=class extends Ul{constructor(e){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=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==P.now()&&this.tick(P.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Hl(e);let{type:t=Il,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Il;s!==Il&&typeof o[0]!=`number`&&(this.mixKeyframes=Es(Wl,pl(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=_l(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=_s(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==kl&&(b.value=Bl(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return As(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+As(e)}get time(){return As(this.currentTime)}set time(e){e=ks(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return Rl(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(P.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=As(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=ml,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,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(P.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.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function Kl(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var ql=e=>e*180/Math.PI,Jl=e=>Xl(ql(Math.atan2(e[1],e[0]))),Yl={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Jl,rotateZ:Jl,skewX:e=>ql(Math.atan(e[1])),skewY:e=>ql(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Xl=e=>(e%=360,e<0&&(e+=360),e),Zl=Jl,Ql=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),$l=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),eu={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ql,scaleY:$l,scale:e=>(Ql(e)+$l(e))/2,rotateX:e=>Xl(ql(Math.atan2(e[6],e[5]))),rotateY:e=>Xl(ql(Math.atan2(-e[2],e[0]))),rotateZ:Zl,rotate:Zl,skewX:e=>ql(Math.atan(e[4])),skewY:e=>ql(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function tu(e){return+!!e.includes(`scale`)}function nu(e,t){if(!e||e===`none`)return tu(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=eu,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Yl,i=t}if(!i)return tu(t);let a=r[t],o=i[1].split(`,`).map(iu);return typeof a==`function`?a(o):o[a]}var ru=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return nu(n,t)};function iu(e){return parseFloat(e.trim())}var au=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],ou=new Set([...au,`pathRotation`]),su=e=>e===mc||e===F,cu=new Set([`x`,`y`,`z`]),lu=au.filter(e=>!cu.has(e));function uu(e){let t=[];return lu.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var du={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>nu(t,`x`),y:(e,{transform:t})=>nu(t,`y`)};du.translateX=du.x,du.translateY=du.y;var fu=new Set,pu=!1,mu=!1,hu=!1;function gu(){if(mu){let e=Array.from(fu).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=uu(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}mu=!1,pu=!1,fu.forEach(e=>e.complete(hu)),fu.clear()}function _u(){fu.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(mu=!0)})}function vu(){hu=!0,_u(),gu(),hu=!1}var yu=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(fu.add(this),pu||(pu=!0,M.read(_u),M.resolveKeyframes(gu))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Kl(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),fu.delete(this)}cancel(){this.state===`scheduled`&&(fu.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},bu=e=>e.startsWith(`--`);function xu(e,t,n){bu(t)?e.style.setProperty(t,n):e.style[t]=n}var Su={};function Cu(e,t){let n=ws(e);return()=>Su[t]??n()}var wu=Cu(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Tu=Cu(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Eu=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Du={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Eu([0,.65,.55,1]),circOut:Eu([.55,0,1,.45]),backIn:Eu([.31,.01,.66,-.59]),backOut:Eu([.33,1.53,.69,.99])};function Ou(e,t){if(e)return typeof e==`function`?Tu()?hl(e,t):`ease-out`:Xs(e)?Eu(e):Array.isArray(e)?e.map(e=>Ou(e,t)||Du.easeOut):Du[e]}function ku(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Ou(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function Au(e){return typeof e==`function`&&`applyToOptions`in e}function ju({type:e,...t}){return Au(e)&&Tu()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Mu=class extends Ul{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=ju(e);this.animation=ku(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Bl(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),xu(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return As(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+As(e)}get time(){return As(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ks(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&wu()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),Ts):r(this)}},Nu={anticipate:Hs,backInOut:Vs,circInOut:Gs};function Pu(e){return e in Nu}function Fu(e){typeof e.ease==`string`&&Pu(e.ease)&&(e.ease=Nu[e.ease])}var Iu=10,Lu=class extends Mu{constructor(e){Fu(e),Hl(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Gl({...a,autoplay:!1}),s=Math.max(Iu,P.now()-this.startTime),c=_s(0,Iu,s-Iu),l=o.sample(s).value,{name:u}=this.options;i&&u&&xu(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},Ru=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Xc.test(e)||e===`0`)&&!e.startsWith(`url(`));function zu(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Bu(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Ru(i,t),s=Ru(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:zu(e)||(n===`spring`||Au(n))&&r}function Vu(e){e.duration=0,e.type=`keyframes`}var Hu=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),Uu=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Wu(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&Uu.test(e[t]))return!0;return!1}var Gu=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Ku=ws(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function qu(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return Ku()&&n&&(Hu.has(n)||Gu.has(n)&&Wu(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Ju=40,Yu=class extends Ul{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=P.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||yu;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=P.now();let u=!0;Bu(e,i,a,o)||(u=!1,(bs.instantAnimations||!s)&&l?.(Bl(e,n,t)),e[0]=e[e.length-1],Vu(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>Ju?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&qu(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new Lu({...d,element:p})}catch{m=new Gl(d)}else m=new Gl(d);m.finished.then(()=>{this.notifyFinished()}).catch(Ts),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),vu()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function Xu(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var Zu=30,Qu=e=>!isNaN(parseFloat(e)),$u={current:void 0},ed=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=P.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=P.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Qu(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new Os);let n=this.events[e].add(t);return e===`change`?()=>{n(),M.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return $u.current&&$u.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=P.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Zu)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Zu);return js(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function td(e,t){return new ed(e,t)}function nd(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function rd(e,t){let n=e?.[t]??e?.default??e;return n===e?n:nd(n,e)}var id={type:`spring`,stiffness:500,damping:25,restSpeed:10},ad=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),od={type:`keyframes`,duration:.8},sd={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},cd=(e,{keyframes:t})=>t.length>2?od:ou.has(e)?e.startsWith(`scale`)?ad(t[1]):id:sd,ld=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function ud(e){for(let t in e)if(!ld.has(t))return!0;return!1}var dd=(e,t,n,r={},i,a)=>o=>{let s=rd(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=ks(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};ud(s)||Object.assign(u,cd(e,u)),u.duration&&=ks(u.duration),u.repeatDelay&&=ks(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Vu(u),u.delay===0&&(d=!0)),(bs.instantAnimations||bs.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,Vu(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Bl(u.keyframes,s);if(e!==void 0){M.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Gl(u):new Yu(u)},fd=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function pd(e){let t=fd.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function md(e,t,n=1){`${e}`;let[r,i]=pd(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return xs(e)?parseFloat(e):e}return dc(i)?md(i,t,n+1):i}function hd(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function gd(e,t,n,r){if(typeof t==`function`){let[i,a]=hd(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=hd(r);t=t(n===void 0?e.custom:n,i,a)}return t}function _d(e,t,n){let r=e.getProps();return gd(r,t,n===void 0?r.custom:n,e)}var vd=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...au]),yd=e=>Array.isArray(e);function bd(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,td(n))}function xd(e){return yd(e)?e[e.length-1]||0:e}function Sd(e,t){let{transitionEnd:n={},transition:r={},...i}=_d(e,t)||{};i={...i,...n};for(let t in i)bd(e,t,xd(i[t]))}var z=e=>!!(e&&e.getVelocity);function Cd(e){return!!(z(e)&&e.add)}function wd(e,t){let n=e.getValue(`willChange`);if(Cd(n))return n.add(t);if(!n&&bs.WillChange){let n=new bs.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Td(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Ed=`data-`+Td(`framerAppearId`);function Dd(e){return e.props[Ed]}var Od=typeof window<`u`;function kd({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ad(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?nd(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&kd(f,t))continue;let o={delay:n,...rd(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){M.update(()=>r.set(i));continue}let p=!1;if(Od&&window.MotionHandoffAnimation){let n=Dd(e);if(n){let e=window.MotionHandoffAnimation(n,t,M);e!==null&&(o.startTime=e,p=!0)}}wd(e,t);let m=l??e.shouldReduceMotion;r.start(dd(t,r,i,m&&vd.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>M.update(()=>{o&&Sd(e,o)});d.length?Promise.all(d).then(t):t()}return d}function jd(e,t,n={}){let r=_d(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(Ad(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Md(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function Md(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(jd(c,t,{...o,delay:n+(typeof r==`function`?0:r)+Xu(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function Nd(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>jd(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=jd(e,t,n);else{let i=typeof t==`function`?_d(e,t,n.custom):t;r=Promise.all(Ad(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var Pd={test:e=>e===`auto`,parse:e=>e},Fd=e=>t=>t.test(e),Id=[mc,F,Ac,kc,Mc,jc,Pd],Ld=e=>Id.find(Fd(e));function Rd(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Cs(e)}var zd=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Bd(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(vc)||[];if(!r)return e;let i=n.replace(r,``),a=+!!zd.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Vd=/\b([a-z-]*)\(.*?\)/gu,Hd={...Xc,getAnimatableNone:e=>{let t=e.match(Vd);return t?t.map(Bd).join(` `):e}},Ud={...Xc,getAnimatableNone:e=>{let t=Xc.parse(e);return Xc.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Wd={...mc,transform:Math.round},Gd={borderWidth:F,borderTopWidth:F,borderRightWidth:F,borderBottomWidth:F,borderLeftWidth:F,borderRadius:F,borderTopLeftRadius:F,borderTopRightRadius:F,borderBottomRightRadius:F,borderBottomLeftRadius:F,width:F,maxWidth:F,height:F,maxHeight:F,top:F,right:F,bottom:F,left:F,inset:F,insetBlock:F,insetBlockStart:F,insetBlockEnd:F,insetInline:F,insetInlineStart:F,insetInlineEnd:F,padding:F,paddingTop:F,paddingRight:F,paddingBottom:F,paddingLeft:F,paddingBlock:F,paddingBlockStart:F,paddingBlockEnd:F,paddingInline:F,paddingInlineStart:F,paddingInlineEnd:F,margin:F,marginTop:F,marginRight:F,marginBottom:F,marginLeft:F,marginBlock:F,marginBlockStart:F,marginBlockEnd:F,marginInline:F,marginInlineStart:F,marginInlineEnd:F,fontSize:F,backgroundPositionX:F,backgroundPositionY:F,rotate:kc,pathRotation:kc,rotateX:kc,rotateY:kc,rotateZ:kc,scale:gc,scaleX:gc,scaleY:gc,scaleZ:gc,skew:kc,skewX:kc,skewY:kc,distance:F,translateX:F,translateY:F,translateZ:F,x:F,y:F,z:F,perspective:F,transformPerspective:F,opacity:hc,originX:Nc,originY:Nc,originZ:F,zIndex:Wd,fillOpacity:hc,strokeOpacity:hc,numOctaves:Wd},Kd={...Gd,color:I,backgroundColor:I,outlineColor:I,fill:I,stroke:I,borderColor:I,borderTopColor:I,borderRightColor:I,borderBottomColor:I,borderLeftColor:I,filter:Hd,WebkitFilter:Hd,mask:Ud,WebkitMask:Ud},qd=e=>Kd[e],Jd=new Set([Hd,Ud]);function Yd(e,t){let n=qd(e);return Jd.has(n)||(n=Xc),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var Xd=new Set([`auto`,`none`,`0`]);function Zd(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Xd.has(t)&&Uc(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=Yd(n,i)}var Qd=class extends yu{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),dc(r))){let i=md(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!vd.has(n)||e.length!==2)return;let[r,i]=e,a=Ld(r),o=Ld(i);if(pc(r)!==pc(i)&&du[n]){this.needsMeasurement=!0;return}if(a!==o){if(su(a)&&su(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else du[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Rd(e[t]))&&n.push(t);n.length&&Zd(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=du[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=du[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},$d=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function ef(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var tf=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function nf(e){return Ss(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:rf,cancel:af}=rc(queueMicrotask,!1),of={x:!1,y:!1};function sf(){return of.x||of.y}function cf(e){return e===`x`||e===`y`?of[e]?null:(of[e]=!0,()=>{of[e]=!1}):of.x||of.y?null:(of.x=of.y=!0,()=>{of.x=of.y=!1})}function lf(e,t){let n=ef(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function uf(e){return!(e.pointerType===`touch`||sf())}function df(e,t,n={}){let[r,i,a]=lf(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!uf(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var ff=(e,t)=>t?e===t||ff(e,t.parentElement):!1,pf=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,mf=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function hf(e){return mf.has(e.tagName)||e.isContentEditable===!0}var gf=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function _f(e){return gf.has(e.tagName)||e.isContentEditable===!0}var vf=new WeakSet;function yf(e){return t=>{t.key===`Enter`&&e(t)}}function bf(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var xf=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=yf(()=>{if(vf.has(n))return;bf(n,`down`);let e=yf(()=>{bf(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>bf(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function Sf(e){return pf(e)&&!sf()}var Cf=new WeakSet;function wf(e,t,n={}){let[r,i,a]=lf(e,n),o=e=>{let r=e.currentTarget;if(!Sf(e)||Cf.has(e))return;vf.add(r),n.stopPropagation&&Cf.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),vf.has(r)&&vf.delete(r),Sf(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||ff(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),nf(e)&&(e.addEventListener(`focus`,e=>xf(e,i)),!hf(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function Tf(e){return Ss(e)&&`ownerSVGElement`in e}var Ef=new WeakMap,Df,Of=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Tf(r)&&`getBBox`in r?r.getBBox()[t]:r[n],kf=Of(`inline`,`width`,`offsetWidth`),Af=Of(`block`,`height`,`offsetHeight`);function jf({target:e,borderBoxSize:t}){Ef.get(e)?.forEach(n=>{n(e,{get width(){return kf(e,t)},get height(){return Af(e,t)}})})}function Mf(e){e.forEach(jf)}function Nf(){typeof ResizeObserver>`u`||(Df=new ResizeObserver(Mf))}function Pf(e,t){Df||Nf();let n=ef(e);return n.forEach(e=>{let n=Ef.get(e);n||(n=new Set,Ef.set(e,n)),n.add(t),Df?.observe(e)}),()=>{n.forEach(e=>{let n=Ef.get(e);n?.delete(t),n?.size||Df?.unobserve(e)})}}var Ff=new Set,If;function Lf(){If=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ff.forEach(t=>t(e))},window.addEventListener(`resize`,If)}function Rf(e){return Ff.add(e),If||Lf(),()=>{Ff.delete(e),!Ff.size&&typeof If==`function`&&(window.removeEventListener(`resize`,If),If=void 0)}}function zf(e,t){return typeof e==`function`?Rf(e):Pf(e,t)}var Bf={value:null,addProjectionMetrics:null};function Vf(e){return Tf(e)&&e.tagName===`svg`}var Hf=[...Id,I,Xc],Uf=e=>Hf.find(Fd(e)),Wf=()=>({translate:0,scale:1,origin:0,originPoint:0}),Gf=()=>({x:Wf(),y:Wf()}),Kf=()=>({min:0,max:0}),B=()=>({x:Kf(),y:Kf()}),qf=new WeakMap;function Jf(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Yf(e){return typeof e==`string`||Array.isArray(e)}var Xf=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Zf=[`initial`,...Xf];function Qf(e){return Jf(e.animate)||Zf.some(t=>Yf(e[t]))}function $f(e){return!!(Qf(e)||e.variants)}function ep(e,t,n){for(let r in t){let i=t[r],a=n[r];if(z(i))e.addValue(r,i);else if(z(a))e.addValue(r,td(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,td(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var tp={current:null},np={current:!1},rp=typeof window<`u`;function ip(){if(np.current=!0,rp){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>tp.current=e.matches;e.addEventListener(`change`,t),t()}else tp.current=!1}}var ap=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],op={};function sp(e){op=e}function cp(){return op}var lp=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){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=yu,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=()=>{let e=P.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,M.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Qf(t),this.isVariantNode=$f(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&z(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,qf.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(np.current||ip(),this.shouldReduceMotion=tp.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),ic(this.notifyUpdate),ic(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Hu.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Mu({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:ks(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=ou.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&M.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in op){let t=op[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):B()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<ap.length;t++){let n=ap[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=ep(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=td(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(xs(n)||Cs(n))?n=parseFloat(n):!Uf(n)&&Xc.test(t)&&(n=Yd(e,t)),this.setBaseTarget(e,z(n)?n.get():n)),z(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=gd(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!z(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Os),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){rf.render(this.render)}},up=class extends lp{constructor(){super(...arguments),this.KeyframeResolver=Qd}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;z(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},dp=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function fp({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function pp({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function mp(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function hp(e){return e===void 0||e===1}function gp({scale:e,scaleX:t,scaleY:n}){return!hp(e)||!hp(t)||!hp(n)}function _p(e){return gp(e)||vp(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function vp(e){return yp(e.x)||yp(e.y)}function yp(e){return e&&e!==`0%`}function bp(e,t,n){return n+t*(e-n)}function xp(e,t,n,r,i){return i!==void 0&&(e=bp(e,i,r)),bp(e,n,r)+t}function Sp(e,t=0,n=1,r,i){e.min=xp(e.min,t,n,r,i),e.max=xp(e.max,t,n,r,i)}function Cp(e,{x:t,y:n}){Sp(e.x,t.translate,t.scale,t.originPoint),Sp(e.y,n.translate,n.scale,n.originPoint)}var wp=.999999999999,Tp=1.0000000000001;function Ep(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(Dp(e.x,-a.scroll.offset.x),Dp(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Cp(e,o)),r&&_p(a.latestValues)&&Ap(e,a.latestValues,a.layout?.layoutBox))}t.x<Tp&&t.x>wp&&(t.x=1),t.y<Tp&&t.y>wp&&(t.y=1)}function Dp(e,t){e.min+=t,e.max+=t}function Op(e,t,n,r,i=.5){Sp(e,t,n,L(e.min,e.max,i),r)}function kp(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Ap(e,t,n){let r=n??e;Op(e.x,kp(t.x,r.x),t.scaleX,t.scale,t.originX),Op(e.y,kp(t.y,r.y),t.scaleY,t.scale,t.originY)}function jp(e,t){return fp(mp(e.getBoundingClientRect(),t))}function Mp(e,t,n){let r=jp(e,n),{scroll:i}=t;return i&&(Dp(r.x,i.offset.x),Dp(r.y,i.offset.y)),r}var Np={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Pp=au.length;function Fp(e,t,n){let r=``,i=!0;for(let a=0;a<Pp;a++){let o=au[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=tf(s,Gd[o]);if(!c){i=!1;let t=Np[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${tf(a,Gd.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Ip(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(ou.has(e)){o=!0;continue}if(lc(e)){i[e]=n;continue}{let t=tf(n,Gd[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Fp(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function Lp(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Rp(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var zp={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(F.test(e))e=parseFloat(e);else return e}return`${Rp(e,t.target.x)}% ${Rp(e,t.target.y)}%`}},Bp={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Xc.parse(e);if(i.length>5)return r;let a=Xc.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=L(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Vp={borderRadius:{...zp,applyTo:[...$d]},borderTopLeftRadius:zp,borderTopRightRadius:zp,borderBottomLeftRadius:zp,borderBottomRightRadius:zp,boxShadow:Bp};function Hp(e,{layout:t,layoutId:n}){return ou.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Vp[e]||e===`opacity`)}function Up(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(z(r[t])||i&&z(i[t])||Hp(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Wp(e){return window.getComputedStyle(e)}var Gp=class extends up{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Lp}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(ou.has(t))return this.projection?.isProjecting?tu(t):ru(e,t);{let n=Wp(e),r=(lc(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return jp(e,t)}build(e,t,n){Ip(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Up(e,t,n)}},Kp={offset:`stroke-dashoffset`,array:`stroke-dasharray`},qp={offset:`strokeDashoffset`,array:`strokeDasharray`};function Jp(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Kp:qp;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Yp=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Xp(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Ip(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of Yp)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Jp(d,i,a,o,!1)}var Zp=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`]),Qp=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function $p(e,t,n,r){Lp(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Zp.has(n)?n:Td(n),t.attrs[n])}function em(e,t,n){let r=Up(e,t,n);for(let n in e)if(z(e[n])||z(t[n])){let t=au.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var tm=class extends up{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=B}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(ou.has(t)){let e=qd(t);return e&&e.default||0}if(Yp.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=Zp.has(t)?t:Td(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return em(e,t,n)}build(e,t,n){Xp(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){$p(e,t,n,r)}mount(e){this.isSVGTag=Qp(e.tagName),super.mount(e)}},nm=Zf.length;function rm(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&rm(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<nm;n++){let r=Zf[n],i=e.props[r];(Yf(i)||i===!1)&&(t[r]=i)}return t}function im(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var am=[...Xf].reverse(),om=Xf.length;function sm(e){return t=>Promise.all(t.map(({animation:t,options:n})=>Nd(e,t,n)))}function cm(e){let t=sm(e),n=dm(),r=!0,i=!1,a=t=>(n,r)=>{let i=_d(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=rm(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<om;t++){let p=am[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Yf(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||Jf(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=lm(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},ee=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=yd(t)&&yd(n)?!im(t,n)||y:t!==n,r?t==null?u.add(e):ee(e):t!==void 0&&u.has(e)?ee(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let te=v&&y;b&&(!te||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!te&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=_d(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=Xu(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=_d(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=dm(),i=!0}}}function lm(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!im(t,e):!1}function um(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function dm(){return{animate:um(!0),whileInView:um(),whileHover:um(),whileTap:um(),whileDrag:um(),whileFocus:um(),exit:um()}}function fm(e,t){e.min=t.min,e.max=t.max}function pm(e,t){fm(e.x,t.x),fm(e.y,t.y)}function mm(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var hm=.9999,gm=1.0001,_m=-.01,vm=.01;function V(e){return e.max-e.min}function ym(e,t,n){return Math.abs(e-t)<=n}function bm(e,t,n,r=.5){e.origin=r,e.originPoint=L(t.min,t.max,e.origin),e.scale=V(n)/V(t),e.translate=L(n.min,n.max,e.origin)-e.originPoint,(e.scale>=hm&&e.scale<=gm||isNaN(e.scale))&&(e.scale=1),(e.translate>=_m&&e.translate<=vm||isNaN(e.translate))&&(e.translate=0)}function xm(e,t,n,r){bm(e.x,t.x,n.x,r?r.originX:void 0),bm(e.y,t.y,n.y,r?r.originY:void 0)}function Sm(e,t,n,r=0){e.min=(r?L(n.min,n.max,r):n.min)+t.min,e.max=e.min+V(t)}function Cm(e,t,n,r){Sm(e.x,t.x,n.x,r?.x),Sm(e.y,t.y,n.y,r?.y)}function wm(e,t,n,r=0){let i=r?L(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+V(t)}function Tm(e,t,n,r){wm(e.x,t.x,n.x,r?.x),wm(e.y,t.y,n.y,r?.y)}function Em(e,t,n,r,i){return e-=t,e=bp(e,1/n,r),i!==void 0&&(e=bp(e,1/i,r)),e}function Dm(e,t=0,n=1,r=.5,i,a=e,o=e){if(Ac.test(t)&&(t=parseFloat(t),t=L(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=L(a.min,a.max,r);e===a&&(s-=t),e.min=Em(e.min,t,n,s,i),e.max=Em(e.max,t,n,s,i)}function Om(e,t,[n,r,i],a,o){Dm(e,t[n],t[r],t[i],t.scale,a,o)}var km=[`x`,`scaleX`,`originX`],Am=[`y`,`scaleY`,`originY`];function jm(e,t,n,r){Om(e.x,t,km,n?n.x:void 0,r?r.x:void 0),Om(e.y,t,Am,n?n.y:void 0,r?r.y:void 0)}function Mm(e){return e.translate===0&&e.scale===1}function Nm(e){return Mm(e.x)&&Mm(e.y)}function Pm(e,t){return e.min===t.min&&e.max===t.max}function Fm(e,t){return Pm(e.x,t.x)&&Pm(e.y,t.y)}function Im(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Lm(e,t){return Im(e.x,t.x)&&Im(e.y,t.y)}function Rm(e){return V(e.x)/V(e.y)}function zm(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Bm(e){return[e(`x`),e(`y`)]}function Vm(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var Hm=$d.length,Um=e=>typeof e==`string`?parseFloat(e):e,Wm=e=>typeof e==`number`||F.test(e);function Gm(e,t,n,r,i,a){i?(e.opacity=L(0,n.opacity??1,qm(r)),e.opacityExit=L(t.opacity??1,0,Jm(r))):a&&(e.opacity=L(t.opacity??1,n.opacity??1,r));for(let i=0;i<Hm;i++){let a=$d[i],o=Km(t,a),s=Km(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Wm(o)===Wm(s)?(e[a]=Math.max(L(Um(o),Um(s),r),0),(Ac.test(s)||Ac.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=L(t.rotate||0,n.rotate||0,r))}function Km(e,t){return e[t]===void 0?e.borderRadius:e[t]}var qm=Ym(0,.5,Ws),Jm=Ym(.5,.95,Ts);function Ym(e,t,n){return r=>r<e?0:r>t?1:n(Ds(e,t,r))}function Xm(e,t,n){let r=z(e)?e:td(e);return r.start(dd(``,r,t,n)),r.animation}function Zm(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var Qm=(e,t)=>e.depth-t.depth,$m=class{constructor(){this.children=[],this.isDirty=!1}add(e){hs(this.children,e),this.isDirty=!0}remove(e){gs(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Qm),this.isDirty=!1,this.children.forEach(e)}};function eh(e,t){let n=P.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(ic(r),e(a-t))};return M.setup(r,!0),()=>ic(r)}function th(e){return z(e)?e.get():e}var nh=class{constructor(){this.members=[]}add(e){hs(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(gs(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(gs(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},rh={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ih={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},ah=[``,`X`,`Y`,`Z`],oh=1e3,sh=0;function ch(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function lh(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Dd(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,M,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&lh(r)}function uh({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=sh++,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.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Bf.value&&(ih.nodes=ih.calculatedTargetDeltas=ih.calculatedProjections=0),this.nodes.forEach(ph),this.nodes.forEach(Sh),this.nodes.forEach(Ch),this.nodes.forEach(mh),Bf.addProjectionMetrics&&Bf.addProjectionMetrics(ih)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new $m)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Os),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=Tf(t)&&!Vf(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;M.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=eh(i,250),rh.hasAnimatedSinceResize&&(rh.hasAnimatedSinceResize=!1,this.nodes.forEach(xh)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Ah,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Lm(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...rd(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||xh(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ic(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(wh),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&lh(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(_h),this.nodes.forEach(gh);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(vh);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(yh),this.nodes.forEach(bh),this.nodes.forEach(dh),this.nodes.forEach(fh)):this.nodes.forEach(vh),this.clearAllSnapshots();let e=P.now();N.delta=_s(0,1e3/60,e-N.timestamp),N.timestamp=e,N.isProcessing=!0,ac.update.process(N),ac.preRender.process(N),ac.render.process(N),N.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,rf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(hh),this.sharedNodes.forEach(Th)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,M.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){M.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!V(this.snapshot.measuredBox.x)&&!V(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 e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=B(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Nm(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||_p(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Ph(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return B();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Ih))){let{scroll:e}=this.root;e&&(Dp(t.x,e.offset.x),Dp(t.y,e.offset.y))}return t}removeElementScroll(e){let t=B();if(pm(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&pm(t,e),Dp(t.x,i.offset.x),Dp(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||B();pm(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(Dp(r.x,-n.scroll.offset.x),Dp(r.y,-n.scroll.offset.y)),_p(n.latestValues)&&Ap(r,n.latestValues,n.layout?.layoutBox)}return _p(this.latestValues)&&Ap(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=B();pm(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!_p(n.latestValues))continue;let r;n.instance&&(gp(n.latestValues)&&n.updateSnapshot(),r=B(),pm(r,n.measurePageBox())),jm(t,n.latestValues,n.snapshot?.layoutBox,r)}return _p(this.latestValues)&&jm(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==N.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=N.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=B(),this.targetWithTransforms=B()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Cm(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):pm(this.target,this.layout.layoutBox),Cp(this.target,this.targetDelta)):pm(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Bf.value&&ih.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||gp(this.parent.latestValues)||vp(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=B(),this.relativeTargetOrigin=B(),Tm(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),pm(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===N.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;pm(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Ep(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=B());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(mm(this.prevProjectionDelta.x,this.projectionDelta.x),mm(this.prevProjectionDelta.y,this.projectionDelta.y)),xm(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!zm(this.projectionDelta.x,this.prevProjectionDelta.x)||!zm(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Bf.value&&ih.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Gf(),this.projectionDelta=Gf(),this.projectionDeltaWithTransform=Gf()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Gf();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=B(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(kh));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=L(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=L(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(Eh(o.x,e.x,n),Eh(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Tm(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Oh(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Fm(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=B(),pm(f,this.relativeTarget)),c&&(this.animationValues=a,Gm(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(ic(this.pendingAnimation),void 0),this.pendingAnimation=M.update(()=>{rh.hasAnimatedSinceResize=!0,this.motionValue||=td(0),this.motionValue.jump(0,!1),this.currentAnimation=Xm(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(oh),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&Fh(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||B();let t=V(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=V(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}pm(t,n),Ap(t,i),xm(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new nh),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&ch(`z`,e,r,this.animationValues);for(let t=0;t<ah.length;t++)ch(`rotate${ah[t]}`,e,r,this.animationValues),ch(`skew${ah[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=th(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=th(t?.pointerEvents)||``),this.hasProjected&&!_p(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Vm(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Vp){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Vp[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?th(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(gh),this.root.sharedNodes.clear()}}}function dh(e){e.updateLayout()}function fh(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)Bm(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=V(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;fm(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Fh(i,t.layoutBox,n)&&Bm(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=V(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Gf();xm(o,n,t.layoutBox);let s=Gf();a?xm(s,e.applyTransform(r,!0),t.measuredBox):xm(s,n,t.layoutBox);let c=!Nm(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=B();Tm(s,t.layoutBox,i.layoutBox,o);let c=B();Tm(c,n,a.layoutBox,o),Lm(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function ph(e){Bf.value&&ih.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function mh(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function hh(e){e.clearSnapshot()}function gh(e){e.clearMeasurements()}function _h(e){e.isLayoutDirty=!0,e.updateLayout()}function vh(e){e.isLayoutDirty=!1}function yh(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function bh(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function xh(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Sh(e){e.resolveTargetDelta()}function Ch(e){e.calcProjection()}function wh(e){e.resetSkewAndRotation()}function Th(e){e.removeLeadSnapshot()}function Eh(e,t,n){e.translate=L(t.translate,0,n),e.scale=L(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Dh(e,t,n,r){e.min=L(t.min,n.min,r),e.max=L(t.max,n.max,r)}function Oh(e,t,n,r){Dh(e.x,t.x,n.x,r),Dh(e.y,t.y,n.y,r)}function kh(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Ah={duration:.45,ease:[.4,0,.1,1]},jh=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Mh=jh(`applewebkit/`)&&!jh(`chrome/`)?Math.round:Ts;function Nh(e){e.min=Mh(e.min),e.max=Mh(e.max)}function Ph(e){Nh(e.x),Nh(e.y)}function Fh(e,t,n){return e===`position`||e===`preserve-aspect`&&!ym(Rm(t),Rm(n),.2)}function Ih(e){return e!==e.root&&e.scroll?.wasRoot}var Lh=uh({attachResizeListener:(e,t)=>Zm(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Rh={current:void 0},zh=uh({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Rh.current){let e=new Lh({});e.mount(window),e.setOptions({layoutScroll:!0}),Rh.current=e}return Rh.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Bh=(0,D.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Vh(e=!0){let t=(0,D.useContext)(ms);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,D.useId)();(0,D.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,D.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Hh=(0,D.createContext)({strict:!1}),Uh={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],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`]},Wh=!1;function Gh(){if(Wh)return;let e={};for(let t in Uh)e[t]={isEnabled:e=>Uh[t].some(t=>!!e[t])};sp(e),Wh=!0}function Kh(){return Gh(),cp()}function qh(e){let t=Kh();for(let n in e)t[n]={...t[n],...e[n]};sp(t)}var Jh=(0,D.createContext)({});function Yh(e,t){if(Qf(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Yf(t)?t:void 0,animate:Yf(n)?n:void 0}}return e.inherit===!1?{}:t}function Xh(e){let{initial:t,animate:n}=Yh(e,(0,D.useContext)(Jh));return(0,D.useMemo)(()=>({initial:t,animate:n}),[Zh(t),Zh(n)])}function Zh(e){return Array.isArray(e)?e.join(` `):e}var Qh=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function $h(e,t,n){for(let r in t)!z(t[r])&&!Hp(r,n)&&(e[r]=t[r])}function eg({transformTemplate:e},t){return(0,D.useMemo)(()=>{let n=Qh();return Ip(n,t,e),Object.assign({},n.vars,n.style)},[t])}function tg(e,t){let n=e.style||{},r={};return $h(r,n,e),Object.assign(r,eg(e,t)),r}function ng(e,t){let n={},r=tg(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var rg=()=>({...Qh(),attrs:{}});function ig(e,t,n,r){let i=(0,D.useMemo)(()=>{let n=rg();return Xp(n,t,Qp(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};$h(t,e.style,e),i.style={...t,...i.style}}return i}var ag=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function og(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||ag.has(e)}function sg(e,t){return e.startsWith(`on`)?!og(e):t?.(e)??!og(e)}function cg(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(z(e[a])||(sg(a,r)||n===!0&&og(a)||!t&&!og(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var lg=[`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 ug(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(lg.indexOf(e)>-1||/[A-Z]/u.test(e))}function dg(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??ug(e)?ig:ng)(t,r,i,e),l=cg(t,typeof e==`string`,a,s),u=e===D.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,D.useMemo)(()=>z(d)?d.get():d,[d]);return(0,D.createElement)(e,{...u,children:f})}function fg({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:pg(n,r,i,e),renderState:t()}}function pg(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=th(a[e]);let{initial:o,animate:s}=e,c=Qf(e),l=$f(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Jf(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=gd(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var mg=e=>(t,n)=>{let r=(0,D.useContext)(Jh),i=(0,D.useContext)(ms),a=()=>fg(e,t,r,i);return n?a():fs(a)},hg=mg({scrapeMotionValuesFromProps:Up,createRenderState:Qh}),gg=mg({scrapeMotionValuesFromProps:em,createRenderState:rg}),_g=Symbol.for(`motionComponentSymbol`);function vg(e,t,n){let r=(0,D.useRef)(n);(0,D.useInsertionEffect)(()=>{r.current=n});let i=(0,D.useRef)(null);return(0,D.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var yg=(0,D.createContext)({});function bg(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function xg(e,t,n,r,i,a){let{visualElement:o}=(0,D.useContext)(Jh),s=(0,D.useContext)(Hh),c=(0,D.useContext)(ms),l=(0,D.useContext)(Bh),u=l.reducedMotion,d=l.skipAnimations,f=(0,D.useRef)(null),p=(0,D.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,D.useContext)(yg);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&Sg(f.current,n,i,h);let g=(0,D.useRef)(!1);(0,D.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[Ed],v=(0,D.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return ps(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,D.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function Sg(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Cg(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&bg(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Cg(e){if(e)return e.options.allowProjection===!1?Cg(e.parent):e.projection}function wg(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&qh(r);let a=n?n===`svg`:ug(e),o=a?gg:hg;function s(n,s){let c,l={...(0,D.useContext)(Bh),...n,layoutId:Tg(n)},{isStatic:u,isValidProp:d}=l,f=Xh(n),p=o(n,u);if(!u&&typeof window<`u`){Eg(l,r);let t=Dg(l);c=t.MeasureLayout,f.visualElement=xg(e,p,l,i,t.ProjectionNode,a)}return(0,k.jsxs)(Jh.Provider,{value:f,children:[c&&f.visualElement?(0,k.jsx)(c,{visualElement:f.visualElement,...l}):null,dg(e,n,vg(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,D.forwardRef)(s);return c[_g]=e,c}function Tg({layoutId:e}){let t=(0,D.useContext)(ds).id;return t&&e!==void 0?t+`-`+e:e}function Eg(e,t){(0,D.useContext)(Hh).strict}function Dg(e){let{drag:t,layout:n}=Kh();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Og(e,t){if(typeof Proxy>`u`)return wg;let n=new Map,r=(n,r)=>wg(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,wg(a,void 0,e,t)),n.get(a))})}var kg=(e,t)=>t.isSVG??ug(e)?new tm(t):new Gp(t,{allowProjection:e!==D.Fragment}),Ag=class extends dp{constructor(e){super(e),e.animationState||=cm(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Jf(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},jg=0,Mg={animation:{Feature:Ag},exit:{Feature:class extends dp{constructor(){super(...arguments),this.id=jg++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=_d(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Ng(e){return{point:{x:e.pageX,y:e.pageY}}}var Pg=e=>t=>pf(t)&&e(t,Ng(t));function Fg(e,t,n,r){return Zm(e,t,Pg(n),r)}var Ig=({current:e})=>e?e.ownerDocument.defaultView:null,Lg=(e,t)=>Math.abs(e-t);function Rg(e,t){let n=Lg(e.x,t.x),r=Lg(e.y,t.y);return Math.sqrt(n**2+r**2)}var zg=new Set([`auto`,`scroll`]),Bg=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Vg(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Ug(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Rg(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=N;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Vg(t,this.transformPagePoint),M.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Ug(e.type===`pointercancel`?this.lastMoveEventInfo:Vg(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!pf(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Vg(Ng(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=N;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Ug(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=Es(Fg(this.contextWindow,`pointermove`,this.handlePointerMove,d),Fg(this.contextWindow,`pointerup`,this.handlePointerUp,d),Fg(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(zg.has(e.overflowX)||zg.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),M.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ic(this.updatePoint)}};function Vg(e,t){return t?{point:t(e.point)}:e}function Hg(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ug({point:e},t){return{point:e,delta:Hg(e,Gg(t)),offset:Hg(e,Wg(t)),velocity:Kg(t,.1)}}function Wg(e){return e[0]}function Gg(e){return e[e.length-1]}function Kg(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Gg(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>ks(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>ks(t)*2&&(r=e[1]);let a=As(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function qg(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?L(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?L(n,e,r.max):Math.min(e,n)),e}function Jg(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Yg(e,{top:t,left:n,bottom:r,right:i}){return{x:Jg(e.x,n,i),y:Jg(e.y,t,r)}}function Xg(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Zg(e,t){return{x:Xg(e.x,t.x),y:Xg(e.y,t.y)}}function Qg(e,t){let n=.5,r=V(e),i=V(t);return i>r?n=Ds(t.min,t.max-r,e.min):r>i&&(n=Ds(e.min,e.max-i,t.min)),_s(0,1,n)}function $g(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var e_=.35;function t_(e=e_){return e===!1?e=0:e===!0&&(e=e_),{x:n_(e,`left`,`right`),y:n_(e,`top`,`bottom`)}}function n_(e,t,n){return{min:r_(e,t),max:r_(e,n)}}function r_(e,t){return typeof e==`number`?e:e[t]||0}var i_=new WeakMap,a_=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=B(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(Ng(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=cf(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Bm(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Ac.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=V(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&M.update(()=>i(e,t),!1,!0),wd(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=l_(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&M.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Bg(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Ig(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&M.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!c_(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=qg(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&bg(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?Yg(n.layoutBox,e):!1,this.elastic=t_(t),r!==this.constraints&&!bg(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Bm(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=$g(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!bg(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Mp(n,r.root,this.visualElement.getTransformPagePoint()),a=Zg(r.layout.layoutBox,i);if(t){let e=t(pp(a));this.hasMutatedConstraints=!!e,e&&(a=fp(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Bm(o=>{if(!c_(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return wd(this.visualElement,e),n.start(dd(e,n,0,t,this.visualElement,!1))}stopAnimation(){Bm(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){Bm(t=>{let{drag:n}=this.getProps();if(!c_(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-L(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!bg(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};Bm(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=Qg({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Bm(t=>{if(!c_(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(L(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;i_.set(this.visualElement,this);let e=this.visualElement.current,t=Fg(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&_f(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();bg(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=s_(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),M.read(r);let o=Zm(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Bm(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=e_,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function o_(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function s_(e,t,n){let r=zf(e,o_(n)),i=zf(t,o_(n));return()=>{r(),i()}}function c_(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function l_(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var u_=class extends dp{constructor(e){super(e),this.removeGroupControls=Ts,this.removeListeners=Ts,this.controls=new a_(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ts}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},d_=e=>(t,n)=>{e&&M.update(()=>e(t,n),!1,!0)},f_=class extends dp{constructor(){super(...arguments),this.removePointerDownListener=Ts}onPointerDown(e){this.session=new Bg(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ig(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:d_(e),onStart:d_(t),onMove:d_(n),onEnd:(e,t)=>{delete this.session,r&&M.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Fg(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},p_=!1,m_=class extends D.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),p_&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),rh.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),p_=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||M.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),rf.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;p_=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function h_(e){let[t,n]=Vh(),r=(0,D.useContext)(ds);return(0,k.jsx)(m_,{...e,layoutGroup:r,switchLayoutGroup:(0,D.useContext)(yg),isPresent:t,safeToRemove:n})}var g_={pan:{Feature:f_},drag:{Feature:u_,ProjectionNode:zh,MeasureLayout:h_}};function __(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&M.postRender(()=>i(t,Ng(t)))}var v_=class extends dp{mount(){let{current:e}=this.node;e&&(this.unmount=df(e,(e,t)=>(__(this.node,t,`Start`),e=>__(this.node,e,`End`))))}unmount(){}},y_=class extends dp{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&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=Es(Zm(this.node.current,`focus`,()=>this.onFocus()),Zm(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function b_(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&M.postRender(()=>i(t,Ng(t)))}var x_=class extends dp{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=wf(e,(e,t)=>(b_(this.node,t,`Start`),(e,{success:t})=>b_(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},S_=new WeakMap,C_=new WeakMap,w_=e=>{let t=S_.get(e.target);t&&t(e)},T_=e=>{e.forEach(w_)};function E_({root:e,...t}){let n=e||document;C_.has(n)||C_.set(n,{});let r=C_.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(T_,{root:e,...t})),r[i]}function D_(e,t,n){let r=E_(t);return S_.set(e,n),r.observe(e),()=>{S_.delete(e),r.unobserve(e)}}var O_={some:0,all:1},k_=class extends dp{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:O_[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=D_(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(A_(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function A_({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var j_={inView:{Feature:k_},tap:{Feature:x_},focus:{Feature:y_},hover:{Feature:v_}},M_={layout:{ProjectionNode:zh,MeasureLayout:h_}},N_=Og({...Mg,...j_,...g_,...M_},kg);function P_(){!np.current&&ip();let[e]=(0,D.useState)(tp.current);return e}var F_=N_,I_=[1,.78,.54,.32,.16],L_=36;function R_({className:e}){return(0,k.jsxs)(`svg`,{viewBox:`0 0 20 28`,fill:`none`,"aria-hidden":!0,className:e,children:[(0,k.jsx)(`circle`,{cx:`4`,cy:`4`,r:`2`,fill:`currentColor`}),(0,k.jsx)(`circle`,{cx:`10`,cy:`9`,r:`2`,fill:`currentColor`}),(0,k.jsx)(`circle`,{cx:`16`,cy:`14`,r:`2`,fill:`currentColor`}),(0,k.jsx)(`circle`,{cx:`10`,cy:`19`,r:`2`,fill:`currentColor`}),(0,k.jsx)(`circle`,{cx:`4`,cy:`24`,r:`2`,fill:`currentColor`})]})}var z_=(0,D.forwardRef)(function({children:e,className:t,accentClassName:n,labelClassName:r,expand:i=!0,disabled:a,onMouseEnter:o,onMouseLeave:s,onFocus:c,onBlur:l,...u},d){let f=P_(),p=us(),[m,h]=(0,D.useState)(!1),[_,v]=(0,D.useState)(!1),y=!!(i&&!a&&(p&&m||_)),b=f?{duration:0}:ls;return(0,k.jsxs)(F_.button,{ref:d,type:`button`,disabled:a,onMouseEnter:e=>{h(!0),o?.(e)},onMouseLeave:e=>{h(!1),s?.(e)},onFocus:e=>{v(!0),c?.(e)},onBlur:e=>{v(!1),l?.(e)},whileTap:f||a?void 0:{scale:.98},transition:os,className:g(`relative inline-flex h-11 w-full items-center overflow-hidden rounded-none bg-primary p-1 text-primary-foreground select-none`,`outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,`disabled:pointer-events-none disabled:opacity-50`,t),...u,children:[i?(0,k.jsxs)(F_.span,{layout:`size`,"aria-hidden":!0,transition:b,style:{width:y?`calc(100% - 8px)`:L_,borderRadius:0},className:g(`absolute inset-y-1 left-1 z-10 overflow-hidden bg-background text-foreground`,n),children:[(0,k.jsx)(F_.span,{animate:{opacity:+!y},transition:{duration:f?0:.1,ease:as},className:`absolute inset-0 grid place-items-center`,children:(0,k.jsx)(R_,{className:`h-5 w-3.5`})}),(0,k.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-around px-3`,children:I_.map((e,t)=>(0,k.jsx)(F_.span,{animate:{opacity:y?e:0,transform:y&&!f?`translateX(0px)`:`translateX(-6px)`},transition:{duration:f?0:.18,delay:y&&!f?.04+t*.025:0,ease:as},className:`inline-grid place-items-center`,children:(0,k.jsx)(R_,{className:`h-5 w-3.5`})},e))})]}):null,(0,k.jsx)(F_.span,{animate:{opacity:+!y,transform:y&&!f?`translateX(6px)`:`translateX(0px)`},transition:{duration:f?0:.12,ease:as},className:g(`relative z-0 flex w-full items-center justify-center text-sm font-medium text-primary-foreground`,i&&`pr-3 pl-11`,r),children:e})]})});function B_({className:e,...t}){return(0,k.jsx)(`div`,{"data-slot":`skeleton`,className:g(`animate-pulse rounded-md bg-muted`,e),...t})}var V_=`flex w-full flex-col rounded-none border border-border bg-card text-card-foreground`,H_=`gap-0 border-t border-border/60`,U_=`grid grid-cols-[6rem_minmax(0,1fr)] items-center gap-x-3 gap-y-1 border-b border-border/60 px-5 py-3.5 last:border-b-0 data-[invalid=true]:border-destructive`,W_=`h-8 rounded-none border-0 bg-transparent px-0 text-sm shadow-none focus-visible:border-0 focus-visible:ring-0 dark:bg-transparent autofill:bg-transparent autofill:shadow-none`,G_=`col-start-2 min-w-0`,K_=`text-[10px] font-semibold tracking-[0.08em] text-muted-foreground uppercase group-focus-within/field:text-foreground`;function q_(e){return e.pending?`loading`:e.success?`success`:e.error?`error`:`idle`}function J_({state:e=`idle`,children:t,loadingText:n=`Loading`,successText:r=`Done`,errorText:i=`Try again`,disabled:a,...o}){let s=e===`loading`,c=e===`loading`?n:e===`success`?r:e===`error`?i:t,l=e===`loading`?qo:e===`success`?ae:e===`error`?He:null;return(0,k.jsx)(z_,{disabled:a||s,expand:e===`idle`,"aria-busy":s||void 0,"data-slot":`auth-submit`,...o,children:(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[l?(0,k.jsx)(p,{icon:l,size:16,color:`currentColor`,strokeWidth:1.5,className:e===`loading`?`animate-spin`:void 0,"aria-hidden":!0}):null,c]})})}var Y_={neutral:`bg-foreground/35`,open:`bg-foreground`,alert:`bg-destructive`};function X_({label:e,tone:t=`neutral`}){return(0,k.jsxs)(`p`,{className:g(K_,`flex h-10 shrink-0 items-center gap-1.5 border-b border-border/60 px-5 group-focus-within/field:text-muted-foreground`),children:[(0,k.jsx)(`span`,{"aria-hidden":!0,className:g(`size-1.5 rounded-[1px]`,Y_[t])}),e]})}var Z_=`pointer-events-none absolute size-3 border-foreground/50`;function Q_(){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`span`,{"aria-hidden":!0,className:g(Z_,`-top-1.5 -left-1.5 border-t border-l`)}),(0,k.jsx)(`span`,{"aria-hidden":!0,className:g(Z_,`-top-1.5 -right-1.5 border-t border-r`)}),(0,k.jsx)(`span`,{"aria-hidden":!0,className:g(Z_,`-bottom-1.5 -left-1.5 border-b border-l`)}),(0,k.jsx)(`span`,{"aria-hidden":!0,className:g(Z_,`-right-1.5 -bottom-1.5 border-r border-b`)})]})}function $_({title:e,description:t,status:n,children:r,footer:i,className:a}){let o=(0,D.useId)(),s=`auth-title-${o}`,c=t?`auth-desc-${o}`:void 0,l=P_()??!1;return(0,k.jsxs)(F_.div,{"data-slot":`auth-card`,initial:!l&&{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:l?0:.42,ease:as},className:g(`relative flex w-full flex-col gap-4`,a),children:[(0,k.jsx)(Q_,{}),(0,k.jsxs)(`div`,{"data-auth-layer":`0`,className:V_,children:[n?(0,k.jsx)(X_,{...n}):null,(0,k.jsxs)(`header`,{"data-auth-layer":`1`,className:g(`flex flex-col gap-3 px-5`,n?`pt-7`:`pt-6`),children:[(0,k.jsx)(`h1`,{id:s,className:`text-[1.75rem] leading-none font-semibold tracking-[-0.03em] text-foreground`,children:e}),t?(0,k.jsx)(`p`,{id:c,className:`text-[13px] leading-snug text-muted-foreground`,children:t}):null]}),(0,k.jsx)(`div`,{className:`mt-7 flex flex-col pb-1`,children:typeof r==`function`?r({titleId:s,descriptionId:c}):r})]}),i?(0,k.jsx)(`div`,{"data-auth-layer":`footer`,className:`w-full`,children:i}):null]})}function ev(){return(0,k.jsxs)(`div`,{"data-slot":`auth-card`,className:`relative flex w-full flex-col gap-4`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,k.jsx)(`span`,{className:`sr-only`,children:`Checking setup…`}),(0,k.jsx)(Q_,{}),(0,k.jsxs)(`div`,{"data-auth-layer":`0`,className:V_,children:[(0,k.jsx)(`div`,{className:`flex h-10 shrink-0 items-center border-b border-border/60 px-5`,children:(0,k.jsx)(B_,{className:`h-3 w-24 rounded-none`})}),(0,k.jsxs)(`header`,{"data-auth-layer":`1`,className:`flex flex-col gap-3 px-5 pt-7`,children:[(0,k.jsx)(B_,{className:`h-7 w-36 rounded-none`}),(0,k.jsx)(B_,{className:`h-4 w-full rounded-none`})]}),(0,k.jsx)(`div`,{className:`mt-7 flex flex-col border-t border-border/60 pb-1`,children:Array.from({length:2},(e,t)=>(0,k.jsxs)(`div`,{className:`grid grid-cols-[6rem_minmax(0,1fr)] items-center gap-x-3 border-b border-border/60 px-5 py-3.5 last:border-b-0`,children:[(0,k.jsx)(B_,{className:`h-3 w-14 rounded-none`}),(0,k.jsx)(B_,{className:`h-8 w-full rounded-none`})]},t))})]}),(0,k.jsx)(`div`,{"data-auth-layer":`footer`,className:`w-full`,children:(0,k.jsx)(B_,{className:`h-11 w-full rounded-none`})})]})}var tv=(0,D.createContext)({theme:`system`,setTheme:()=>null});function nv({children:e,defaultTheme:t=`system`,storageKey:n=`oke-console-theme`,...r}){let[i,a]=(0,D.useState)(()=>localStorage.getItem(n)||t);(0,D.useEffect)(()=>{let e=window.document.documentElement,t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>{let n=i===`system`?t.matches?`dark`:`light`:i;e.classList.remove(`light`,`dark`),e.classList.add(n)};if(n(),i===`system`)return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[i]);let o={theme:i,setTheme:e=>{localStorage.setItem(n,e),a(e)}};return(0,k.jsx)(tv.Provider,{...r,value:o,children:e})}function rv(){let e=(0,D.useContext)(tv);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e}var iv=[{value:`light`,label:`Light`,icon:ts},{value:`dark`,label:`Dark`,icon:Yo},{value:`system`,label:`System`,icon:Go}];function av(){let{theme:e,setTheme:t}=rv();return(0,k.jsx)(`div`,{role:`group`,"aria-label":`Theme`,"data-slot":`mode-toggle`,className:`flex h-10 items-stretch`,children:iv.map(n=>{let r=e===n.value;return(0,k.jsxs)(v,{disabled:r,children:[(0,k.jsx)(ce,{render:e=>(0,k.jsxs)(`button`,{...e,type:`button`,"aria-label":n.label,"aria-pressed":r,onClick:r=>{e.onClick?.(r),t(n.value)},className:g(Te,`font-semibold tracking-[0.08em] uppercase`,r?bt:vt,e.className),children:[(0,k.jsx)(p,{icon:n.icon,className:`size-3`,color:`currentColor`,strokeWidth:1.5,"aria-hidden":!0}),r?n.label:null]})}),(0,k.jsx)(S,{side:`top`,sideOffset:6,children:n.label})]},n.value)})})}function ov({className:e,...t}){return(0,k.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 327 87`,fill:`none`,role:`img`,"aria-label":`OKE`,className:g(`text-foreground`,e),...t,children:[(0,k.jsx)(`path`,{d:`M231.08 84.672V0H320.648V13.824H250.088V33.696H303.944V47.952H250.088V70.848H321.224L326.984 83.088C326.984 83.472 325.688 83.856 323.096 84.24C320.504 84.528 316.04 84.672 309.704 84.672H231.08Z`,fill:`currentColor`}),(0,k.jsx)(`path`,{d:`M136.638 13.672V36.864H144.702C146.622 36.864 148.206 36.624 149.454 36.144C150.702 35.664 151.854 34.896 152.91 33.84C155.598 31.152 158.67 27.792 162.126 23.76C165.582 19.728 168.942 15.6 172.206 11.376C175.566 7.05599 178.446 3.264 180.846 0H204.174L198.27 8.64C195.582 11.424 192.702 14.448 189.63 17.712C186.558 20.976 183.534 24.192 180.558 27.36C177.582 30.432 174.894 33.168 172.494 35.568C170.094 37.872 168.318 39.552 167.166 40.608C169.758 41.472 172.11 42.576 174.222 43.92C176.43 45.264 179.118 47.232 182.286 49.824C184.686 51.744 186.99 53.712 189.198 55.728C191.502 57.744 194.142 60.144 197.118 62.928C200.478 66 203.646 68.256 206.622 69.696C209.598 71.136 212.094 72.048 214.11 72.432C216.222 72.816 217.566 73.008 218.142 73.008L215.262 84.672C214.974 84.96 214.11 85.248 212.67 85.536C211.23 85.92 209.166 86.112 206.478 86.112C201.774 86.112 197.694 85.152 194.238 83.232C190.782 81.312 187.374 78.72 184.014 75.456C180.366 71.616 175.95 67.2 170.766 62.208C168.366 59.712 165.918 57.648 163.422 56.016C160.926 54.384 158.094 53.136 154.926 52.272C151.854 51.408 148.014 50.976 143.406 50.976H136.638V70.672H117.63V13.672H136.638Z`,fill:`currentColor`}),(0,k.jsx)(`path`,{d:`M75.865 84.191C73.608 84.512 71.12 84.672 68.4 84.672H26.352C19.632 84.672 14.352 83.712 10.512 81.792C6.672 79.872 3.936 76.992 2.304 73.152C0.768001 69.312 0 64.56 0 58.896V25.632C0 20.064 0.768001 15.408 2.304 11.664C3.84 7.824 6.528 4.944 10.368 3.024C14.208 1.008 19.536 0 26.352 0H68.4C71.135 0 73.623 0.166992 75.865 0.500992V13.672H92.928C94.048 17.033 94.608 21.019 94.608 25.632V58.896C94.608 63.392 94.078 67.318 93.017 70.672H75.865V84.191ZM30.528 70.848H64.368C67.92 70.848 70.656 69.936 72.576 68.112C74.592 66.288 75.6 63.792 75.6 60.624V23.904C75.6 21.12 74.592 18.768 72.576 16.848C70.56 14.832 67.824 13.824 64.368 13.824H30.528C27.072 13.824 24.288 14.736 22.176 16.56C20.064 18.384 19.008 20.832 19.008 23.904V60.624C19.008 63.888 20.016 66.432 22.032 68.256C24.144 69.984 26.976 70.848 30.528 70.848Z`,fill:`currentColor`})]})}function sv({className:e,...t}){return(0,k.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 95 85`,fill:`none`,role:`img`,"aria-label":`OKE`,className:g(`text-foreground`,e),...t,children:(0,k.jsx)(`path`,{d:`M75.865 84.191C73.608 84.512 71.12 84.672 68.4 84.672H26.352C19.632 84.672 14.352 83.712 10.512 81.792C6.672 79.872 3.936 76.992 2.304 73.152C0.768001 69.312 0 64.56 0 58.896V25.632C0 20.064 0.768001 15.408 2.304 11.664C3.84 7.824 6.528 4.944 10.368 3.024C14.208 1.008 19.536 0 26.352 0H68.4C71.135 0 73.623 0.166992 75.865 0.500992V13.672H92.928C94.048 17.033 94.608 21.019 94.608 25.632V58.896C94.608 63.392 94.078 67.318 93.017 70.672H75.865V84.191ZM30.528 70.848H64.368C67.92 70.848 70.656 69.936 72.576 68.112C74.592 66.288 75.6 63.792 75.6 60.624V23.904C75.6 21.12 74.592 18.768 72.576 16.848C70.56 14.832 67.824 13.824 64.368 13.824H30.528C27.072 13.824 24.288 14.736 22.176 16.56C20.064 18.384 19.008 20.832 19.008 23.904V60.624C19.008 63.888 20.016 66.432 22.032 68.256C24.144 69.984 26.976 70.848 30.528 70.848Z`,fill:`currentColor`})})}function cv({children:e}){return(0,k.jsxs)(`div`,{className:`flex min-h-dvh w-full flex-col bg-background`,"data-slot":`console-chrome`,children:[(0,k.jsx)(`main`,{className:`mx-auto flex w-full max-w-md flex-1 flex-col justify-center px-4 py-10`,children:(0,k.jsxs)(`div`,{className:`flex flex-col items-stretch gap-10`,children:[(0,k.jsx)(ov,{className:`h-7 w-auto self-center`}),e]})}),(0,k.jsxs)(`footer`,{className:`grid h-10 shrink-0 grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-stretch border-t border-border/60`,children:[(0,k.jsx)(`p`,{className:`flex min-w-0 items-center truncate px-2 text-[10px] font-medium text-muted-foreground`,children:`OKE | Console`}),(0,k.jsx)(av,{}),(0,k.jsxs)(`p`,{className:`${Ce} flex min-w-0 items-center justify-end gap-1.5 px-2`,children:[(0,k.jsx)(p,{icon:Ko,size:12,color:`currentColor`,strokeWidth:1.5,"aria-hidden":!0}),(0,k.jsxs)(`span`,{children:[`v`,`0.19.0`]})]})]})]})}function lv(){return(0,k.jsx)(cv,{children:(0,k.jsxs)(`div`,{"data-slot":`not-found`,children:[(0,k.jsx)(`p`,{className:K_,children:`404`}),(0,k.jsx)(`h1`,{className:`mt-3 text-2xl font-semibold tracking-tight`,children:`Page not found`}),(0,k.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground`,children:`This URL is not a Console page.`})]})})}function uv({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function dv(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var fv=[],pv=0,{link:mv,unlink:hv,propagate:gv,checkDirty:_v,shallowPropagate:vv}=uv({update(e){return e._update()},notify(e){fv[bv++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Cv(e))}}),yv=0,bv=0,xv,Sv=0;function H(e){try{++Sv,e()}finally{--Sv||wv()}}function Cv(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=hv(n,e)}function wv(){if(!(Sv>0)){for(;yv<bv;){let e=fv[yv];fv[yv++]=void 0,e.notify()}yv=0,bv=0}}function Tv(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return xv!==void 0&&mv(i,xv,pv),i._snapshot},subscribe(e){let t=dv(e),n={current:!1},r=Ev(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=xv,o=t?.compare??Object.is;if(n)xv=i,++pv,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{xv=a,n&&(i.flags&=-5),Cv(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&_v(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&vv(e)}}else e&32&&(i.flags=e&-33);return xv!==void 0&&mv(i,xv,pv),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(gv(e),vv(e),wv())}},i}function Ev(e){let t=()=>{let t=xv;xv=n,++pv,n.depsTail=void 0,n.flags=6;try{return e()}finally{xv=t,n.flags&=-5,Cv(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&_v(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,Cv(this)}};return t(),n}var Dv=class{constructor(e,t){this.atom=Tv(e),this.get=this.get.bind(this),this.setState=this.setState.bind(this),this.subscribe=this.subscribe.bind(this),t&&(this.actions=t(this))}setState(e){this.atom.set(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(dv(e))}},Ov=class{constructor(e){this.atom=Tv(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(dv(e))}};function kv(e,t){return typeof e==`function`?new Ov(e):t?new Dv(e,t):new Dv(e)}var Av=class{constructor(e,t){this.fn=e,this.options=t,this.lastExecutionTime=0,this.isPending=!1,this.maybeExecute=(...e)=>{let t=Date.now()-this.lastExecutionTime;if(this.options.leading&&t>=this.options.wait)this.execute(...e);else if(this.lastArgs=e,!this.timeoutId&&this.options.trailing){let e=this.options.wait-t;this.isPending=!0,this.timeoutId=setTimeout(()=>{this.lastArgs!==void 0&&this.execute(...this.lastArgs)},e)}},this.execute=(...e)=>{this.fn(...e),this.options.onExecute?.(e,this),this.lastExecutionTime=Date.now(),this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.flush=()=>{this.isPending&&this.lastArgs&&this.execute(...this.lastArgs)},this.cancel=()=>{this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.clearTimeout=()=>{this.timeoutId&&=(clearTimeout(this.timeoutId),void 0)},this.options.leading===void 0&&this.options.trailing===void 0&&(this.options.leading=!0,this.options.trailing=!0)}};function jv(e,t){return new Av(e,t).maybeExecute}var Mv=class{#e=!0;#t;#n;#r;#i;#a;#o;#s;#c=0;#l=5;#u=!1;#d=!1;#f=null;#p=()=>{this.debugLog(`Connected to event bus`),this.#a=!0,this.#u=!1,this.debugLog(`Emitting queued events`,this.#i),this.#i.forEach(e=>this.emitEventToBus(e)),this.#i=[],this.stopConnectLoop(),this.#n().removeEventListener(`tanstack-connect-success`,this.#p)};#m=()=>{if(this.#c<this.#l){this.#c++,this.dispatchCustomEvent(`tanstack-connect`,{});return}this.#n().removeEventListener(`tanstack-connect`,this.#m),this.#d=!0,this.debugLog(`Max retries reached, giving up on connection`),this.stopConnectLoop()};#h=()=>{this.#u||(this.#u=!0,this.#n().addEventListener(`tanstack-connect-success`,this.#p),this.#m())};constructor({pluginId:e,debug:t=!1,enabled:n=!0,reconnectEveryMs:r=300}){this.#t=e,this.#e=n,this.#n=this.getGlobalTarget,this.#r=t,this.debugLog(` Initializing event subscription for plugin`,this.#t),this.#i=[],this.#a=!1,this.#d=!1,this.#o=null,this.#s=r}startConnectLoop(){this.#o!==null||this.#a||(this.debugLog(`Starting connect loop (every ${this.#s}ms)`),this.#o=setInterval(this.#m,this.#s))}stopConnectLoop(){this.#u=!1,this.#o!==null&&(clearInterval(this.#o),this.#o=null,this.#i=[],this.debugLog(`Stopped connect loop`))}debugLog(...e){this.#r&&console.log(`🌴 [tanstack-devtools:${this.#t}-plugin]`,...e)}getGlobalTarget(){if(typeof globalThis<`u`&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog(`Using global event target`),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<`u`&&window.addEventListener!==void 0)return this.debugLog(`Using window as event target`),window;let e=typeof EventTarget<`u`?new EventTarget:void 0;return e===void 0||e.addEventListener===void 0?(this.debugLog(`No event mechanism available, running in non-web environment`),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog(`Using new EventTarget as fallback`),e)}getPluginId(){return this.#t}dispatchCustomEventShim(e,t){try{let n=new Event(e,{detail:t});this.#n().dispatchEvent(n)}catch{this.debugLog(`Failed to dispatch shim event`)}}dispatchCustomEvent(e,t){try{this.#n().dispatchEvent(new CustomEvent(e,{detail:t}))}catch{this.dispatchCustomEventShim(e,t)}}emitEventToBus(e){this.debugLog(`Emitting event to client bus`,e),this.dispatchCustomEvent(`tanstack-dispatch-event`,e)}createEventPayload(e,t){return{type:`${this.#t}:${e}`,payload:t,pluginId:this.#t}}emit(e,t){if(!this.#e){this.debugLog(`Event bus client is disabled, not emitting event`,e,t);return}if(this.#f&&(this.debugLog(`Emitting event to internal event target`,e,t),this.#f.dispatchEvent(new CustomEvent(`${this.#t}:${e}`,{detail:this.createEventPayload(e,t)}))),this.#d){this.debugLog(`Previously failed to connect, not emitting to bus`);return}if(!this.#a){this.debugLog(`Bus not available, will be pushed as soon as connected`),this.#i.push(this.createEventPayload(e,t)),typeof CustomEvent<`u`&&!this.#u&&(this.#h(),this.startConnectLoop());return}return this.emitEventToBus(this.createEventPayload(e,t))}on(e,t,n){let r=n?.withEventTarget??!1,i=`${this.#t}:${e}`;if(r&&(this.#f||=new EventTarget,this.#f.addEventListener(i,e=>{t(e.detail)})),!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`,i),()=>{};let a=e=>{this.debugLog(`Received event from bus`,e.detail),t(e.detail)};return this.#n().addEventListener(i,a),this.debugLog(`Registered event to bus`,i),()=>{r&&this.#f?.removeEventListener(i,a),this.#n().removeEventListener(i,a)}}onAll(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}onAllPluginEvents(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;this.#t&&n.pluginId!==this.#t||e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}},Nv=new class extends Mv{constructor(){super({pluginId:`form-devtools`,reconnectEveryMs:1e3})}};function Pv(e,t){return typeof e==`function`?e(t):e}function Fv(e,t){return Uv(t).reduce((e,t)=>{if(e===null)return null;if(e!==void 0)return e[t]},e)}function Iv(e,t,n){let r=Uv(t);function i(e){if(!r.length)return Pv(n,e);let t=r.shift();if(typeof t==`string`||typeof t==`number`&&!Array.isArray(e))return typeof e==`object`?(e===null&&(e={}),{...e,[t]:i(e[t])}):{[t]:i()};if(Array.isArray(e)&&typeof t==`number`){let n=e.slice(0,t);return[...n.length?n:Array(t),i(e[t]),...e.slice(t+1)]}return[...Array(t),i()]}return i(e)}function Lv(e,t){let n=Uv(t);function r(e){if(!e)return;if(n.length===1){let t=n[0];if(Array.isArray(e)&&typeof t==`number`)return e.filter((e,n)=>n!==t);let{[t]:r,...i}=e;return i}let t=n.shift();if((typeof t==`string`||typeof t==`number`&&!Array.isArray(e))&&typeof e==`object`)return{...e,[t]:r(e[t])};if(typeof t==`number`&&Array.isArray(e)){if(t>=e.length)return e;let n=e.slice(0,t);return[...n.length?n:Array(t),r(e[t]),...e.slice(t+1)]}throw Error(`It seems we have created an infinite loop in deleteBy. `)}return r(e)}var Rv=46,zv=91,Bv=93,Vv=48,Hv=57;function Uv(e){if(Array.isArray(e))return[...e];if(typeof e!=`string`)throw Error(`Path must be a string.`);let t=e.length,n=[],r=+(t>0&&e.charCodeAt(0)===zv),i=!0,a=-1;for(let o=r;o<=t;o++){let s=o<t?e.charCodeAt(o):-1;if(o===t||s===Rv||s===zv||s===Bv){let t=o-r;if(t>0){let a=i&&(t===1||e.charCodeAt(r)!==Vv),s=e.slice(r,o);if(a){let e=parseInt(s,10);t<=15||String(e)===s?n.push(e):n.push(s)}else n.push(s)}else a!==Bv&&(a!==-1||s!==Bv)&&(a!==s||s!==Rv&&s!==zv)&&n.push(``);r=o+1,i=!0}else(s<Vv||s>Hv)&&(i=!1);a=s}return n.length||n.push(``),n}function Wv(e){return!(Array.isArray(e)&&e.length===0)}function Gv(e,t){return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!1},runValidation:e=>e.validators.filter(Boolean).map(e=>({cause:e.cause,validate:e.fn}))})}function Kv(e,t){let{asyncDebounceMs:n}=t,{onBlurAsyncDebounceMs:r,onChangeAsyncDebounceMs:i,onDynamicAsyncDebounceMs:a}=t.validators||{},o=n??0;return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!0},runValidation:t=>t.validators.filter(Boolean).map(t=>{let n=t?.cause||e,s=o;switch(n){case`change`:s=i??o;break;case`blur`:s=r??o;break;case`dynamic`:s=a??o;break;case`submit`:s=0}return e===`submit`&&(s=0),{cause:n,validate:t.fn,debounceMs:s}})})}var qv=e=>!!e&&typeof e==`object`&&`fields`in e;function Jv(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||n.length===0&&!Array.isArray(e)&&!Array.isArray(t)&&(Object.getPrototypeOf(e)!==Object.prototype||Object.getPrototypeOf(t)!==Object.prototype))return!1;for(let i of n)if(!r.includes(i)||!Jv(e[i],t[i]))return!1;return!0}var Yv=({newFormValidatorError:e,isPreviousErrorFromFormValidator:t,previousErrorValue:n})=>e?{newErrorValue:e,newSource:`form`}:t?{newErrorValue:void 0,newSource:void 0}:n?{newErrorValue:n,newSource:`field`}:{newErrorValue:void 0,newSource:void 0},Xv=({formLevelError:e,fieldLevelError:t})=>t?{newErrorValue:t,newSource:`field`}:e?{newErrorValue:e,newSource:`form`}:{newErrorValue:void 0,newSource:void 0};function U(e,t){return e==null?t:{...e,...t}}for(var Zv=256,Qv=[],$v;Zv--;)Qv[Zv]=(Zv+256).toString(16).substring(1);function ey(){let e=0,t,n=``;if(!$v||Zv+16>256){for($v=Array(256),e=256;e--;)$v[e]=256*Math.random()|0;e=0,Zv=0}for(;e<16;e++)t=$v[Zv+e],n+=e===6?Qv[t&15|64]:e===8?Qv[t&63|128]:Qv[t],e&1&&e>1&&e<11&&(n+=`-`);return Zv++,n}var ty=jv(e=>Nv.emit(`form-state`,{id:e.formId,state:e.store.state}),{wait:300});function ny(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++)t[n]=ny(e[n]);return t}if(e instanceof Map){let t=new Map;return e.forEach((e,n)=>{t.set(n,ny(e))}),t}if(e instanceof Set){let t=new Set;return e.forEach(e=>{t.add(ny(e))}),t}let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=ny(e[n]));return t}function ry(e,t){return t===e||t.startsWith(`${e}.`)||t.startsWith(`${e}[`)}var iy=e=>{if(!e.validators)return e.runValidation({validators:[],form:e.form});let t=e.event.async,n=t?void 0:{fn:e.validators.onMount,cause:`mount`},r={fn:t?e.validators.onChangeAsync:e.validators.onChange,cause:`change`},i={fn:t?e.validators.onBlurAsync:e.validators.onBlur,cause:`blur`},a={fn:t?e.validators.onSubmitAsync:e.validators.onSubmit,cause:`submit`},o=t?void 0:{fn:()=>void 0,cause:`server`};switch(e.event.type){case`mount`:return e.runValidation({validators:[n],form:e.form});case`submit`:return e.runValidation({validators:[r,i,a,o],form:e.form});case`server`:return e.runValidation({validators:[],form:e.form});case`blur`:return e.runValidation({validators:[i,o],form:e.form});case`change`:return e.runValidation({validators:[r,o],form:e.form});default:throw Error(`Unknown validation event type: ${e.event.type}`)}};function ay(e,t){let n=new Map;for(let r of e){let e=r.path??[],i=t,a=``;for(let t=0;t<e.length;t++){let n=e[t];if(n===void 0)continue;let r=typeof n==`object`?n.key:n,o=Number(r);a+=Array.isArray(i)&&!Number.isNaN(o)?`[${o}]`:(t>0?`.`:``)+String(r),i=typeof i==`object`&&i?i[r]:void 0}n.set(a,(n.get(a)??[]).concat(r))}return Object.fromEntries(n)}var oy=(e,t)=>{let n=ay(e,t);return{form:n,fields:n}},sy={validate({value:e,validationSource:t},n){let r=n[`~standard`].validate(e);if(r instanceof Promise)throw Error(`async function passed to sync validator`);if(r.issues)return t===`field`?r.issues:oy(r.issues,e)},async validateAsync({value:e,validationSource:t},n){let r=await n[`~standard`].validate(e);if(r.issues)return t===`field`?r.issues:oy(r.issues,e)}},cy=e=>!!e&&`~standard`in e,W={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{},_arrayVersion:0,_pendingValidationsCount:0};function ly(e){function t(t){let n=e.getFieldMeta(t)??W;e.setFieldMeta(t,{...n,_arrayVersion:(n._arrayVersion||0)+1})}function n(n,r,i){t(n);let a=s(n,r,`move`,i),c=Math.min(r,i),u=Math.max(r,i);for(let e=c;e<=u;e++)a.push(o(n,e));let d=Object.keys(e.fieldInfo).reduce((t,i)=>(i.startsWith(o(n,r))&&t.set(i,e.getFieldMeta(i)),t),new Map);l(a,r<i?`up`:`down`),Object.keys(e.fieldInfo).filter(e=>e.startsWith(o(n,i))).forEach(t=>{let a=t.replace(o(n,i),o(n,r)),s=d.get(a);s&&e.setFieldMeta(t,s)})}function r(e,n){t(e),l(s(e,n,`remove`),`up`)}function i(n,r,i){t(n),s(n,r,`swap`,i).forEach(t=>{if(!t.toString().startsWith(o(n,r)))return;let a=t.toString().replace(o(n,r),o(n,i)),[s,c]=[e.getFieldMeta(t),e.getFieldMeta(a)];s&&e.setFieldMeta(a,s),c&&e.setFieldMeta(t,c)})}function a(n,r){t(n);let i=s(n,r,`insert`);l(i,`down`),i.forEach(t=>{t.toString().startsWith(o(n,r))&&e.setFieldMeta(t,u())})}function o(e,t){return`${e}[${t}]`}function s(t,n,r,i){let a=[o(t,n)];switch(r){case`swap`:a.push(o(t,i));break;case`move`:{let[e,r]=[Math.min(n,i),Math.max(n,i)];for(let n=e;n<=r;n++)a.push(o(t,n));break}default:{let r=e.getFieldValue(t),i=Array.isArray(r)?r.length:0;for(let e=n+1;e<i;e++)a.push(o(t,e));break}}return Object.keys(e.fieldInfo).filter(e=>a.some(t=>e.startsWith(t)))}function c(e,t){return e.replace(/\[(\d+)\]/,(e,n)=>{let r=parseInt(n,10);return`[${t===`up`?r+1:Math.max(0,r-1)}]`})}function l(t,n){(n===`up`?t:[...t].reverse()).forEach(t=>{let r=c(t.toString(),n),i=e.getFieldMeta(r);i?e.setFieldMeta(t,i):e.setFieldMeta(t,u())})}let u=()=>W;return{bumpArrayVersion:t,handleArrayMove:n,handleArrayRemove:r,handleArraySwap:i,handleArrayInsert:a}}function uy(e){return{values:e.values??{},errorMap:e.errorMap??{},fieldMetaBase:e.fieldMetaBase??{},formGroupStateBase:e.formGroupStateBase??{},isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}}}var dy=class{constructor(e){this.options={},this.fieldInfo={},this.formGroupApis=new Set,this.mount=()=>{let e=this.store.subscribe(()=>{ty(this)}),t=Nv.on(`request-form-state`,e=>{e.payload.id===this._formId&&Nv.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}),n=Nv.on(`request-form-reset`,e=>{e.payload.id===this._formId&&this.reset()}),r=Nv.on(`request-form-force-submit`,e=>{e.payload.id===this._formId&&(this._devtoolsSubmissionOverride=!0,this.handleSubmit(),this._devtoolsSubmissionOverride=!1)}),i=()=>{r(),n(),t(),e.unsubscribe(),Nv.emit(`form-unmounted`,{id:this._formId})};this.options.listeners?.onMount?.({formApi:this});let{onMount:a}=this.options.validators||{};return Nv.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options}),a&&this.validateSync(`mount`),i},this.update=e=>{if(!e)return;let t=this.options;this.options=e;let n=e.defaultValues&&!Jv(e.defaultValues,t.defaultValues)&&!this.state.isTouched,r=!Jv(e.defaultState,t.defaultState)&&!this.state.isTouched;if(n||r){if(H(()=>{this.baseStore.setState(()=>uy(Object.assign({},this.state,r?e.defaultState:{},n?{values:e.defaultValues}:{})))}),n){let e=ly(this);for(let t of Object.keys(this.fieldInfo))Array.isArray(this.getFieldValue(t))&&e.bumpArrayVersion(t)}Nv.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}},this.reset=(e,t)=>{let{fieldMeta:n}=this.state,r=this.resetFieldMeta(n);e&&!t?.keepDefaultValues&&(this.options={...this.options,defaultValues:e}),this.baseStore.setState(()=>{let t=e??this.options.defaultValues??this.options.defaultState?.values;return e||Object.values(this.fieldInfo).forEach(e=>{e.instance&&e.instance.options.defaultValue!==void 0&&(t=Iv(t,e.instance.name,e.instance.options.defaultValue))}),uy({...this.options.defaultState,values:t,fieldMetaBase:r})})},this.validateAllFields=async e=>{let t=[];return H(()=>{Object.values(this.fieldInfo).forEach(n=>{if(!n.instance)return;let r=n.instance;t.push(Promise.resolve().then(()=>r.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.instance.store.state.meta.isTouched||n.instance.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null,a=[`${e}[${t}]`];for(let n=t+1;n<=(i??0);n++)a.push(`${e}[${n}]`);let o=Object.keys(this.fieldInfo).filter(e=>a.some(t=>e.startsWith(t))),s=[];return H(()=>{o.forEach(e=>{s.push(Promise.resolve().then(()=>this.validateField(e,n)))})}),(await Promise.all(s)).flat()},this.validateField=(e,t)=>{let n=this.fieldInfo[e]?.instance;if(!n){let{hasErrored:n}=this.validateSync(t);return n&&!this.options.asyncAlways?this.getFieldMeta(e)?.errors??[]:this.validateAsync(t).then(()=>this.getFieldMeta(e)?.errors??[])}return n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0})),n.validate(t)},this.validateSync=(e,t)=>{let n=Gv(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||iy}),r=!1,i={};return H(()=>{for(let e of n){if(!e.validate)continue;let{formError:n,fieldErrors:a}=fy(this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`},type:`validate`})),o=py(e.cause),s=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(a||{})]);t?.filterFieldNames&&(s=new Set([...s].filter(t.filterFieldNames)));for(let e of s){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!a?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??W,r=a?.[e],{newErrorValue:s,newSource:c}=Yv({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[o]===`form`,previousErrorValue:t?.[o]});c===`form`&&(i[e]={...i[e],[o]:r}),t?.[o]!==s&&this.setFieldMeta(e,(e=W)=>({...e,errorMap:{...e.errorMap,[o]:s},errorSourceMap:{...e.errorSourceMap,[o]:c}}))}t?.dontUpdateFormErrorMap||this.state.errorMap?.[o]!==n&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:n}})),(n||a)&&(r=!0)}if(t?.dontUpdateFormErrorMap)return;let a=py(`submit`);this.state.errorMap?.[a]&&e!==`submit`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[a]:void 0}}));let o=py(`server`);this.state.errorMap?.[o]&&e!==`server`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:void 0}}))}),{hasErrored:r,fieldsErrorMap:i}},this.validateAsync=async(e,t)=>{let n=Kv(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||iy});this.state.isFormValidating||this.baseStore.setState(e=>({...e,isFormValidating:!0}));let r=[],i;for(let e of n){if(!e.validate)continue;let n=py(e.cause);this.state.validationMetaMap[n]?.lastAbortController.abort();let a=new AbortController;this.state.validationMetaMap[n]={lastAbortController:a},r.push(new Promise(async n=>{let r;try{r=await new Promise((t,n)=>{setTimeout(async()=>{if(a.signal.aborted)return t(void 0);try{t(await this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`,signal:a.signal},type:`validateAsync`}))}catch(e){n(e)}},e.debounceMs)})}catch(e){r=e}let{formError:o,fieldErrors:s}=fy(r);s&&(i=i?{...i,...s}:s);let c=py(e.cause),l=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(i||{})]),u=Array.from(l);t?.filterFieldNames&&(u=u.filter(t.filterFieldNames));for(let e of u){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!i?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??W,r=i?.[e],{newErrorValue:a,newSource:o}=Yv({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[c]===`form`,previousErrorValue:t?.[c]});t?.[c]!==a&&this.setFieldMeta(e,(e=W)=>({...e,errorMap:{...e.errorMap,[c]:a},errorSourceMap:{...e.errorSourceMap,[c]:o}}))}t?.dontUpdateFormErrorMap||this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[c]:o}})),n(i?{fieldErrors:i,errorMapKey:c}:void 0)}))}let a=[],o={};if(r.length){a=await Promise.all(r);for(let e of a)if(e?.fieldErrors){let{errorMapKey:t}=e;for(let[n,r]of Object.entries(e.fieldErrors))o[n]={...o[n]||{},[t]:r}}}return this.baseStore.setState(e=>({...e,isFormValidating:!1})),o},this.validate=(e,t)=>{let{hasErrored:n,fieldsErrorMap:r}=this.validateSync(e,t);return n&&!this.options.asyncAlways?r:this.validateAsync(e,t)},this._handleSubmit=async e=>{this.baseStore.setState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),H(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance&&(e.instance.store.state.meta.isTouched||e.instance.setMeta(e=>({...e,isTouched:!0})))})});let t=e??this.options.onSubmitMeta;if(!this.state.canSubmit&&!this._devtoolsSubmissionOverride&&this.baseStore.state.submissionAttempts<=1){this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t});return}this.baseStore.setState(e=>({...e,isSubmitting:!0}));let n=()=>{this.baseStore.setState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.state.isFieldsValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),Nv.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validateAllFields`,errors:Object.values(this.state.fieldMeta).map(e=>e.errors).flat()});return}if(await this.validate(`submit`),!this.state.isValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),Nv.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validate`,errors:this.state.errors});return}H(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance?.triggerOnSubmitListener()})}),this.options.listeners?.onSubmit?.({formApi:this,meta:t});try{await this.options.onSubmit?.({value:this.state.values,formApi:this,meta:t}),H(()=>{this.baseStore.setState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),Nv.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),n()})}catch(e){throw this.baseStore.setState(e=>({...e,isSubmitSuccessful:!1})),Nv.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`inflight`,onError:e}),n(),e}},this.getFieldValue=e=>Fv(this.state.values,e),this.getFieldMeta=e=>this.state.fieldMeta[e],this.getFormGroupMeta=e=>this.formGroupMetaDerived.state[e],this.getFieldInfo=e=>this.fieldInfo[e]||={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.setFieldMeta=(e,t)=>{this.baseStore.setState(n=>({...n,fieldMetaBase:{...n.fieldMetaBase,[e]:Pv(t,n.fieldMetaBase[e])}}))},this.resetFieldMeta=e=>Object.keys(e).reduce((e,t)=>{let n=t;return e[n]=W,e},{}),this.setFieldValue=(e,t,n)=>{let r=n?.dontUpdateMeta??!1,i=n?.dontRunListeners??!1,a=n?.dontValidate??!1;H(()=>{r||this.setFieldMeta(e,e=>({...e,isTouched:!0,isDirty:!0,errorMap:{...e?.errorMap,onMount:void 0}})),this.baseStore.setState(n=>({...n,values:Iv(n.values,e,t)}))}),i||this.getFieldInfo(e).instance?.triggerOnChangeListener(),a||this.validateField(e,`change`)},this.deleteField=e=>{let t=[...Object.keys(this.fieldInfo).filter(t=>{let n=e.toString();return t.startsWith(`${n}.`)||t.startsWith(`${n}[`)}),e];this.baseStore.setState(e=>{let n={...e};return t.forEach(e=>{n.values=Lv(n.values,e),delete this.fieldInfo[e],delete n.fieldMetaBase[e]}),n})},this.pushFieldValue=(e,t,n)=>{this.setFieldValue(e,e=>[...Array.isArray(e)?e:[],t],n),ly(this).bumpArrayVersion(e)},this.insertFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>[...e.slice(0,t),n,...e.slice(t)],U(r,{dontValidate:!0}));let i=r?.dontValidate??!1;i||await this.validateField(e,`change`),ly(this).handleArrayInsert(e,t),i||await this.validateArrayFieldsStartingFrom(e,t,`change`)},this.replaceFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>e.map((e,r)=>r===t?n:e),U(r,{dontValidate:!0})),ly(this).bumpArrayVersion(e),(r?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.removeFieldValue=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null;if(this.setFieldValue(e,e=>e.filter((e,n)=>n!==t),U(n,{dontValidate:!0})),ly(this).handleArrayRemove(e,t),i!==null){let t=`${e}[${i}]`;this.deleteField(t)}(n?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.swapFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=e[t],i=e[n];return Iv(Iv(e,`${t}`,i),`${n}`,r)},U(r,{dontValidate:!0})),ly(this).handleArraySwap(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.moveFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=[...e];return r.splice(n,0,r.splice(t,1)[0]),r},U(r,{dontValidate:!0})),ly(this).handleArrayMove(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.clearFieldValues=(e,t)=>{let n=this.getFieldValue(e),r=Array.isArray(n)?Math.max(n.length-1,0):null;if(this.setFieldValue(e,[],U(t,{dontValidate:!0})),ly(this).bumpArrayVersion(e),r!==null)for(let t=0;t<=r;t++){let n=`${e}[${t}]`;this.deleteField(n)}(t?.dontValidate??!1)||this.validateField(e,`change`)},this.resetField=e=>{this.baseStore.setState(t=>{let n=this.getFieldInfo(e).instance?.options.defaultValue,r=Fv(this.options.defaultValues,e),i=n??r;return{...t,fieldMetaBase:{...t.fieldMetaBase,[e]:W},values:i===void 0?t.values:Iv(t.values,e,i)}})},this.setErrorMap=e=>{H(()=>{Object.entries(e).forEach(([e,t])=>{let n=e;if(qv(t)){let{formError:e,fieldErrors:r}=fy(t);for(let e of Object.keys(this.fieldInfo))this.getFieldMeta(e)&&this.setFieldMeta(e,t=>({...t,errorMap:{...t.errorMap,[n]:r?.[e]},errorSourceMap:{...t.errorSourceMap,[n]:`form`}}));this.baseStore.setState(t=>({...t,errorMap:{...t.errorMap,[n]:e}}))}else this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[n]:t}}))})})},this.getAllErrors=()=>({form:{errors:this.state.errors,errorMap:this.state.errorMap},fields:Object.entries(this.state.fieldMeta).reduce((e,[t,n])=>(Object.keys(n).length&&n.errors.length&&(e[t]={errors:n.errors,errorMap:n.errorMap}),e),{})}),this.parseValuesWithSchema=e=>sy.validate({value:this.state.values,validationSource:`form`},e),this.parseValuesWithSchemaAsync=e=>sy.validateAsync({value:this.state.values,validationSource:`form`},e),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=e?.formId??ey(),this._devtoolsSubmissionOverride=!1;let t=uy({...e?.defaultState,values:e?.defaultValues??e?.defaultState?.values});if(e?.transform){t=e.transform({state:t}).state;for(let e of Object.keys(t.errorMap)){let n=t.errorMap[e];if(n!==void 0&&qv(n))for(let r of Object.keys(n.fields)){let i=n.fields[r];if(i===void 0)continue;let a=t.fieldMetaBase[r];t.fieldMetaBase[r]={isTouched:!1,isValidating:!1,isBlurred:!1,isDirty:!1,_arrayVersion:0,_pendingValidationsCount:0,...a??{},errorSourceMap:{...a?.errorSourceMap??{},onChange:`form`},errorMap:{...a?.errorMap??{},[e]:i}}}}}this.baseStore=kv(t);let n;this.fieldMetaDerived=kv(e=>{let t=this.baseStore.get(),r=0,i={};for(let a of Object.keys(t.fieldMetaBase)){let o=t.fieldMetaBase[a],s=n?.fieldMetaBase[a],c=e?.[a],l=Fv(t.values,a),u=c?.errors;if(!s||o.errorMap!==s.errorMap){u=Object.values(o.errorMap??{}).filter(e=>e!==void 0);let e=this.getFieldInfo(a)?.instance;(!e||!e.options.disableErrorFlat)&&(u=u.flat(1))}let d=!Wv(u),f=!o.isDirty,p=Jv(l,this.getFieldInfo(a)?.instance?.options.defaultValue??Fv(this.options.defaultValues,a));if(c&&c.isPristine===f&&c.isValid===d&&c.isDefaultValue===p&&c.errors===u&&o===s){i[a]=c,r++;continue}i[a]={...o,errors:u??[],isPristine:f,isValid:d,isDefaultValue:p}}return Object.keys(t.fieldMetaBase).length?e&&r===Object.keys(t.fieldMetaBase).length?e:(n=this.baseStore.get(),i):i}),this.formGroupMetaDerived=kv(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),r={};for(let i of this.formGroupApis){let a=i.name,o=t.formGroupStateBase[a]??{isSubmitted:!1,isSubmitting:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1},s=n[a],c=!1,l=!0,u=!1,d=!1,f=!0,p=!1;for(let e in n){if(e===a||!ry(a,e))continue;let t=n[e];t&&(t.isValidating&&(c=!0),t.isValid||(l=!1),t.isTouched&&(u=!0),t.isBlurred&&(d=!0),t.isDefaultValue||(f=!1),t.isDirty&&(p=!0))}let m=!p,h=!!c||o.isValidating,g=s?.errorMap??{},_=s?.errorSourceMap??{},v=!!(g.onMount||Object.entries(n).some(([e,t])=>t&&e!==a&&ry(a,e)&&t.errorMap.onMount)),y=e?.[a],b=y?.errors??[];(!y||y.__srcErrorMap!==g)&&(b=Object.values(g).reduce((e,t)=>{if(t===void 0)return e;if(t&&typeof t==`object`&&`fields`in t){let n=t.group;return n!==void 0&&e.push(n),e}return e.push(t),e},[]));let x=b.length===0,S=l&&x,C=i.options.canSubmitWhenInvalid??!1,w=o.submissionAttempts===0&&!u&&!v||!h&&!o.isSubmitting&&S||C;if(y&&y.errorMap===g&&y.errorSourceMap===_&&y.errors===b&&y.isFieldsValidating===c&&y.isFieldsValid===l&&y.isGroupValid===x&&y.isValid===S&&y.canSubmit===w&&y.isTouched===u&&y.isBlurred===d&&y.isPristine===m&&y.isDefaultValue===f&&y.isDirty===p&&y.isValidating===h&&y.isSubmitting===o.isSubmitting&&y.isSubmitted===o.isSubmitted&&y.submissionAttempts===o.submissionAttempts&&y.isSubmitSuccessful===o.isSubmitSuccessful){r[a]=y;continue}let T={...o,errorMap:g,errorSourceMap:_,_arrayVersion:s?._arrayVersion??0,isTouched:u,isBlurred:d,isDirty:p,isPristine:m,isDefaultValue:f,isValid:S,errors:b,isValidating:h,isFieldsValidating:c,isFieldsValid:l,isGroupValid:x,canSubmit:w};Object.defineProperty(T,"__srcErrorMap",{value:g,enumerable:!1,configurable:!0}),r[a]=T}return r});let r;this.store=kv(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),i=Object.values(n).filter(Boolean),a=i.some(e=>e.isValidating),o=i.every(e=>e.isValid),s=i.some(e=>e.isTouched),c=i.some(e=>e.isBlurred),l=i.every(e=>e.isDefaultValue),u=s&&t.errorMap?.onMount,d=i.some(e=>e.isDirty),f=!d,p=!!(t.errorMap?.onMount||i.some(e=>e?.errorMap?.onMount)),m=!!a,h=e?.errors??[];(!r||t.errorMap!==r.errorMap)&&(h=Object.values(t.errorMap).reduce((e,t)=>t===void 0?e:t&&qv(t)?(e.push(t.form),e):(e.push(t),e),[]));let g=h.length===0,_=o&&g,v=this.options.canSubmitWhenInvalid??!1,y=t.submissionAttempts===0&&!s&&!p||!m&&!t.isSubmitting&&_||v,b=t.errorMap;if(u&&(h=h.filter(e=>e!==t.errorMap.onMount),b=Object.assign(b,{onMount:void 0})),e&&r&&e.errorMap===b&&e.fieldMeta===this.fieldMetaDerived.state&&e.errors===h&&e.isFieldsValidating===a&&e.isFieldsValid===o&&e.isFormValid===g&&e.isValid===_&&e.canSubmit===y&&e.isTouched===s&&e.isBlurred===c&&e.isPristine===f&&e.isDefaultValue===l&&e.isDirty===d&&Jv(r,t))return e;let x={...t,errorMap:b,fieldMeta:this.fieldMetaDerived.state,errors:h,isFieldsValidating:a,isFieldsValid:o,isFormValid:g,isValid:_,canSubmit:y,isTouched:s,isBlurred:c,isPristine:f,isDefaultValue:l,isDirty:d};return r=this.baseStore.get(),x}),this.handleSubmit=this.handleSubmit.bind(this),this.update(e||{})}get state(){return this.store.state}get formId(){return this._formId}runValidator(e){return cy(e.validate)?sy[e.type](e.value,e.validate):e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function fy(e){return e?qv(e)?{formError:fy(e.form).formError,fieldErrors:e.fields}:{formError:e}:{formError:void 0}}function py(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}var my=class e{constructor(t){this.options={},this.mount=()=>{this.options.defaultValue!==void 0&&!this.getMeta().isTouched&&this.form.setFieldValue(this.name,this.options.defaultValue,{dontUpdateMeta:!0});let e=this.getInfo();e.instance=this,this.update(this.options);let{onMount:t}=this.options.validators||{};if(t){let e=this.runValidator({validate:t,value:{value:this.state.value,fieldApi:this,validationSource:`field`},type:`validate`});e&&this.setMeta(t=>({...t,errorMap:{...t?.errorMap,onMount:e},errorSourceMap:{...t?.errorSourceMap,onMount:`field`}}))}return this.options.listeners?.onMount?.({value:this.state.value,fieldApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);let e=this.form.fieldInfo[this.name];if(e&&e.instance===this){for(let[t,n]of Object.entries(e.validationMetaMap))n?.lastAbortController.abort(),e.validationMetaMap[t]=void 0;this.form.baseStore.setState(e=>({...e,fieldMetaBase:{...e.fieldMetaBase,[this.name]:{...W,isTouched:e.fieldMetaBase[this.name]?.isTouched??W.isTouched,isBlurred:e.fieldMetaBase[this.name]?.isBlurred??W.isBlurred,isDirty:e.fieldMetaBase[this.name]?.isDirty??W.isDirty}}})),e.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,fieldApi:this}),this.form.options.listeners?.onFieldUnmount?.({formApi:this.form,fieldApi:this})}}},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(Jv(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,this.state.meta)},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,U(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(e,t)=>{this.form.pushFieldValue(this.name,e,U(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(e,t,n)=>{this.form.insertFieldValue(this.name,e,t,U(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(e,t,n)=>{this.form.replaceFieldValue(this.name,e,t,U(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(e,t)=>{this.form.removeFieldValue(this.name,e,U(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(e,t,n)=>{this.form.swapFieldValues(this.name,e,t,U(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(e,t,n)=>{this.form.moveFieldValues(this.name,e,t,U(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=e=>{this.form.clearFieldValues(this.name,U(e,{dontRunListeners:!0})),e?.dontRunListeners||this.triggerOnChangeListener()},this.getLinkedFields=t=>{let n=Object.values(this.form.fieldInfo),r=[];for(let i of n){if(!i.instance||!(i.instance instanceof e))continue;let{onChangeListenTo:n,onBlurListenTo:a}=i.instance.options.validators||{};t===`change`&&n?.includes(this.name)&&r.push(i.instance),t===`blur`&&a?.includes(this.name)&&r.push(i.instance)}return r},this.validateSync=(e,t)=>{let n=Gv(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||iy}),r=this.getLinkedFields(e).reduce((t,n)=>{let r=Gv(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||iy});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),i=!1;H(()=>{let e=(e,n)=>{let r=gy(n.cause),a=n.validate?hy(e.runValidator({validate:n.validate,value:{value:e.store.state.value,validationSource:`field`,fieldApi:e},type:`validate`})):void 0,o=t[r],{newErrorValue:s,newSource:c}=Xv({formLevelError:o,fieldLevelError:a});e.state.meta.errorMap?.[r]!==s&&e.setMeta(e=>({...e,errorMap:{...e.errorMap,[r]:s},errorSourceMap:{...e.errorSourceMap,[r]:c}})),s&&(i=!0)};for(let t of n)e(this,t);for(let t of r)t.validate&&e(t.field,t)});let a=gy(`submit`);return this.state.meta.errorMap?.[a]&&e!==`submit`&&!i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[a]:void 0},errorSourceMap:{...e.errorSourceMap,[a]:void 0}})),{hasErrored:i}},this.validateAsync=async(e,t)=>{let n=Kv(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||iy}),r=await t,i=this.getLinkedFields(e).reduce((t,n)=>{let r=Kv(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||iy});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),a=[],o=[],s=n.some(e=>e.validate),c=Array.from(new Set(i.filter(e=>e.validate).map(e=>e.field)));H(()=>{s&&this.startValidation();for(let e of c)e.startValidation()});let l=(e,t,n)=>{let i=gy(t.cause),a=e.getInfo();a.validationMetaMap[i]?.lastAbortController.abort();let o=new AbortController;a.validationMetaMap[i]={lastAbortController:o},n.push(new Promise(async n=>{let a;try{a=await new Promise((n,r)=>{e.timeoutIds.validations[t.cause]&&(clearTimeout(e.timeoutIds.validations[t.cause]),e.endValidation()),e.timeoutIds.validations[t.cause]=setTimeout(async()=>{if(o.signal.aborted)return n(void 0);try{n(await this.runValidator({validate:t.validate,value:{value:e.store.state.value,fieldApi:e,signal:o.signal,validationSource:`field`},type:`validateAsync`}))}catch(e){r(e)}},t.debounceMs)})}catch(e){a=e}if(o.signal.aborted)return n(void 0);let s=hy(a),c=r[e.name]?.[i],{newErrorValue:l,newSource:u}=Xv({formLevelError:c,fieldLevelError:s});if(e.getInfo().instance!==e)return n(void 0);e.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:l},errorSourceMap:{...e.errorSourceMap,[i]:u}})),n(l)}))};for(let e of n)e.validate&&l(this,e,a);for(let e of i)e.validate&&l(e.field,e,o);let u=[];return(a.length||o.length)&&(u=await Promise.all(a),await Promise.all(o)),H(()=>{s&&this.endValidation();for(let e of c)e.endValidation()}),u.filter(Boolean)},this.validate=(e,t)=>{if(!this.state.meta.isTouched)return[];let n=t?.skipGroupValidation?[]:Array.from(this.form.formGroupApis).filter(e=>this.name.startsWith(e.name)),r=(t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e)).fieldsErrorMap[this.name]??{};if(!t?.skipFormValidation)for(let t of n){if(t.state.meta.submissionAttempts===0)continue;let{fieldsErrorMap:n}=this.form.validateSync(e,{group:t,dontUpdateFormErrorMap:!0,filterFieldNames:e=>ry(t.name,e)});r={...r,...n[this.name]??{}}}let{hasErrored:i}=this.validateSync(e,r),a=new WeakMap;for(let t of n){let{hasErrored:n}=t.validateSync(e,{},{skipRelatedFieldValidation:!0});a.set(t,n)}if(i&&!this.options.asyncAlways){this.getInfo().validationMetaMap[gy(e)]?.lastAbortController.abort();let t=[];for(let r of n)r.getInfo().validationMetaMap[gy(e)]?.lastAbortController.abort(),t.push(r.state.meta.errors);return[...this.state.meta.errors,...t.flat()]}let o=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e),s=this.validateAsync(e,o),c=[];for(let t of n)(!a.get(t)||t.options.asyncAlways)&&c.push(t.validateAsync(e,o,{skipRelatedFieldValidation:!0}));return c.length===0?s:Promise.all([s,...c]).then(e=>e.flat())},this.handleChange=e=>{this.setValue(e)},this.handleBlur=()=>{this.state.meta.isTouched||this.setMeta(e=>({...e,isTouched:!0})),this.state.meta.isBlurred||this.setMeta(e=>({...e,isBlurred:!0})),this.validate(`blur`),this.triggerOnBlurListener()},this.setErrorMap=e=>{this.setMeta(t=>({...t,errorMap:{...t.errorMap,...e}}))},this.parseValueWithSchema=e=>sy.validate({value:this.state.value,validationSource:`field`},e),this.parseValueWithSchemaAsync=e=>sy.validateAsync({value:this.state.value,validationSource:`field`},e),this.triggerOnBlurListener=()=>{let e=this.form.options.listeners?.onBlurDebounceMs;e&&e>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onBlurDebounceMs;t&&t>0?(this.timeoutIds.listeners.blur&&clearTimeout(this.timeoutIds.listeners.blur),this.timeoutIds.listeners.blur=setTimeout(()=>{this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this});for(let e of this.form.formGroupApis)ry(e.name,this.name)&&e.triggerOnChangeListener()},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,fieldApi:this})},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.store=kv(e=>{this.form.store.get();let n=this.form.getFieldMeta(this.name)??{...W,...t.defaultMeta},r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!Jv(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}})}get state(){return this.store.state}runValidator(e){return cy(e.validate)?sy[e.type](e.value,e.validate):e.validate(e.value)}startValidation(){this.setMeta(e=>{let t=e._pendingValidationsCount+1;return{...e,_pendingValidationsCount:t,isValidating:t>0&&!e.isValidating||e.isValidating}})}endValidation(){this.setMeta(e=>{let t=Math.max(0,e._pendingValidationsCount-1);return{...e,_pendingValidationsCount:t,isValidating:t===0&&e.isValidating?!1:e.isValidating}})}};function hy(e){if(e)return e}function gy(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function _y(e){return{isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1}}function vy(e){return{...W,...e,errors:[],isPristine:!0,isValid:!0,isDefaultValue:!0,isFieldsValidating:!1,isFieldsValid:!0,isGroupValid:!0,canSubmit:!0,isSubmitting:!1,isSubmitted:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1}}var yy=class e{constructor(t){this.options={},this.setFormGroupState=e=>{this.form.baseStore.setState(t=>{let n=t.formGroupStateBase[this.name]??_y({});return{...t,formGroupStateBase:{...t.formGroupStateBase,[this.name]:e(n)}}})},this._lastDistributedFieldNames={},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(Jv(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,{...W,...this.options.defaultMeta})},this.mount=()=>{this.update(this.options),this.form.formGroupApis.add(this),this.fieldInfo.instance=this,this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:e.formGroupStateBase[this.name]??_y({...this.options.defaultState})}}));let{onMount:e}=this.options.validators||{};if(e){let t=this.runValidator({validate:e,value:{value:this.state.value,groupApi:this,validationSource:`form`},type:`validate`}),n=t,r;xy(t)&&(n=t.group,r=t.fields);let i=by(n);i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,onMount:i},errorSourceMap:{...e.errorSourceMap,onMount:`field`}})),this.distributeFieldErrors(`onMount`,r)}return this.options.listeners?.onMount?.({value:this.state.value,groupApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);if(this.fieldInfo.instance===this){for(let[e,t]of Object.entries(this.fieldInfo.validationMetaMap))t?.lastAbortController.abort(),this.fieldInfo.validationMetaMap[e]=void 0;this.form.formGroupApis.delete(this),this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:_y({})}})),this.fieldInfo.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,groupApi:this})}}},this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,U(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.fieldInfo,this.getRelatedFields=()=>{let e=Object.values(this.form.fieldInfo),t=[];for(let n of e)n.instance&&n.instance instanceof my&&n.instance.name.startsWith(this.name)&&t.push(n.instance);return t},this.getRelatedFieldMetasDerived=()=>{let e=Object.entries(this.form.fieldMetaDerived.state),t=[];for(let[n,r]of e)n!==this.name&&ry(this.name,n)&&t.push({...r,name:n});return t},this.buildChildFieldName=e=>e===``?this.name:e.startsWith(`[`)?`${this.name}${e}`:`${this.name}.${e}`,this.distributeFieldErrors=(e,t)=>{let n=this._lastDistributedFieldNames[e]??new Set,r=new Set;if(t)for(let[e,n]of Object.entries(t))n!=null&&n!==!1&&r.add(this.buildChildFieldName(e));let i=new Set([...n,...r]),a=!1;for(let n of i){let r=n.startsWith(this.name+`[`)?n.slice(this.name.length):n.slice(this.name.length+1),i=t?.[r],o=this.form.getFieldMeta(n);if(!o&&!i)continue;let s=o?.errorMap[e],{newErrorValue:c,newSource:l}=Yv({newFormValidatorError:i,isPreviousErrorFromFormValidator:o?.errorSourceMap[e]===`form`,previousErrorValue:s});c&&(a=!0),(s!==c||o?.errorSourceMap[e]!==l)&&this.form.setFieldMeta(n,(t=W)=>({...t,errorMap:{...t.errorMap,[e]:c},errorSourceMap:{...t.errorSourceMap,[e]:l}}))}return this._lastDistributedFieldNames[e]=r,a},this.validateSync=(t,n,r={})=>{let i=Gv(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||iy}),a=(r.skipRelatedFieldValidation?[]:this.getRelatedFields()).reduce((e,n)=>{let r=Gv(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||iy});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),o=!1;H(()=>{let t=(t,r)=>{let i=Cy(r.cause),a=t===this,s;r.validate&&(s=t.runValidator({validate:r.validate,value:{value:t.store.state.value,validationSource:a?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validate`}));let c=s,l;a&&xy(s)&&(c=s.group,l=s.fields);let u=by(c),d=n[i],{newErrorValue:f,newSource:p}=Xv({formLevelError:d,fieldLevelError:u});t.state.meta.errorMap?.[i]!==f&&t.setMeta(e=>({...e,errorMap:{...e.errorMap,[i]:f},errorSourceMap:{...e.errorSourceMap,[i]:p}})),f&&(o=!0),a&&this.distributeFieldErrors(i,l)&&(o=!0)};for(let e of i)t(this,e);for(let e of a)e.validate&&t(e.field,e)});let s=Cy(`submit`);return this.state.meta.errorMap?.[s]&&t!==`submit`&&!o&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[s]:void 0},errorSourceMap:{...e.errorSourceMap,[s]:void 0}})),{hasErrored:o}},this.validateAsync=async(t,n,r={})=>{let i=Kv(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||iy}),a=await n,o=r.skipRelatedFieldValidation?[]:this.getRelatedFields(),s=o.reduce((e,n)=>{let r=Kv(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||iy});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),c=[],l=[],u=i.some(e=>e.validate)||s.some(e=>e.validate);if(u){this.state.meta.isValidating||this.setMeta(e=>({...e,isValidating:!0}));for(let e of o)e.setMeta(e=>({...e,isValidating:!0}))}let d=(t,n,r)=>{let i=Cy(n.cause),o=t.getInfo();o.validationMetaMap[i]?.lastAbortController.abort();let s=new AbortController;o.validationMetaMap[i]={lastAbortController:s};let c=t===this;r.push(new Promise(async r=>{let o;try{o=await new Promise((r,i)=>{t.timeoutIds.validations[n.cause]&&clearTimeout(t.timeoutIds.validations[n.cause]),t.timeoutIds.validations[n.cause]=setTimeout(async()=>{if(s.signal.aborted)return r(void 0);try{r(await this.runValidator({validate:n.validate,value:{value:t.store.state.value,signal:s.signal,validationSource:c?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validateAsync`}))}catch(e){i(e)}},n.debounceMs)})}catch(e){o=e}if(s.signal.aborted)return r(void 0);let l=o,u;c&&xy(o)&&(l=o.group,u=o.fields);let d=by(l),f=a[t.name]?.[i],{newErrorValue:p,newSource:m}=Xv({formLevelError:f,fieldLevelError:d});if(t.getInfo().instance!==t)return r(void 0);t.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:p},errorSourceMap:{...e.errorSourceMap,[i]:m}})),c&&this.distributeFieldErrors(i,u),r(p)}))};for(let e of i)e.validate&&d(this,e,c);for(let e of s)e.validate&&d(e.field,e,l);let f=[];if((c.length||l.length)&&(f=await Promise.all(c),await Promise.all(l)),u){this.setMeta(e=>({...e,isValidating:!1}));for(let e of o)e.setMeta(e=>({...e,isValidating:!1}))}return f.filter(Boolean)},this.validateAllFields=async e=>{let t=[];return H(()=>{Object.values(this.getRelatedFields()).forEach(n=>{t.push(Promise.resolve().then(()=>n.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=(e,t,n)=>this.form.validateArrayFieldsStartingFrom(e,t,n),this.validateField=(e,t)=>this.form.validateField(e,t),this.getFieldValue=e=>this.form.getFieldValue(e),this.getFieldMeta=e=>this.form.getFieldMeta(e),this.setFieldMeta=(e,t)=>this.form.setFieldMeta(e,t),this.setFieldValue=(e,t)=>this.form.setFieldValue(e,t),this.deleteField=e=>this.form.deleteField(e),this.pushFieldValue=(e,t)=>this.form.pushFieldValue(e,t),this.insertFieldValue=(e,t,n)=>this.form.insertFieldValue(e,t,n),this.replaceFieldValue=(e,t,n)=>this.form.replaceFieldValue(e,t,n),this.swapFieldValues=(e,t,n)=>this.form.swapFieldValues(e,t,n),this.moveFieldValues=(e,t,n)=>this.form.moveFieldValues(e,t,n),this.clearFieldValues=e=>this.form.clearFieldValues(e),this.resetField=e=>this.form.resetField(e),this.removeFieldValue=(e,t)=>this.form.removeFieldValue(e,t),this.areRelatedFieldsValid=()=>Object.values(this.getRelatedFields()).every(e=>e.state.meta.isValid),this.validate=(e,t)=>{let{fieldsErrorMap:n}=t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>ry(this.name,e)}),{hasErrored:r}=this.validateSync(e,n[this.name]??{},{skipRelatedFieldValidation:t?.skipRelatedFieldValidation});if(r&&!this.options.asyncAlways)return this.getInfo().validationMetaMap[Cy(e)]?.lastAbortController.abort(),this.state.meta.errors;let i=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>ry(this.name,e)});return this.validateAsync(e,i,{skipRelatedFieldValidation:t?.skipRelatedFieldValidation})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeGroupDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this})},e)):this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,groupApi:this})},this._handleSubmit=async e=>{this.setFormGroupState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),H(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.state.meta.isTouched||e.setMeta(e=>({...e,isTouched:!0}))})});let t=e??this.options.onSubmitMeta;this.setFormGroupState(e=>({...e,isSubmitting:!0}));let n=()=>{this.setFormGroupState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.areRelatedFieldsValid()){n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});return}if(await this.validate(`submit`,{skipRelatedFieldValidation:!0}),!this.areRelatedFieldsValid()||!this.state.meta.isValid){n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});return}H(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.options.listeners?.onGroupSubmit?.({value:e.state.value,fieldApi:e})})}),this.options.listeners?.onSubmit?.({groupApi:this,value:this.state.value});try{await this.options.onGroupSubmit?.({value:this.state.value,groupApi:this,meta:t}),H(()=>{this.setFormGroupState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),n()})}catch(e){throw this.setFormGroupState(e=>({...e,isSubmitSuccessful:!1})),n(),e}},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.fieldInfo={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.store=kv(e=>{this.form.formGroupMetaDerived.get(),this.form.baseStore.get();let n=this.form.getFormGroupMeta(this.name)??vy(t.defaultMeta),r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!Jv(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}}),this.handleSubmit=this.handleSubmit.bind(this)}get state(){return this.store.state}runValidator(e){if(cy(e.validate)){let t=sy[e.type](e.value,e.validate);return e.type===`validate`?Sy(t):t.then(Sy)}return e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function by(e){if(e)return e}function xy(e){return!!e&&typeof e==`object`&&`fields`in e}function Sy(e){if(!e||typeof e!=`object`||!(`form`in e)&&!(`fields`in e))return e;let{form:t,fields:n,...r}=e;return{...r,group:t,fields:n}}function Cy(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function wy(e,t){if(!t)return;let n=Object.assign({},e,{state:ny(e.state)});t(n),n.fieldInfo!==e.fieldInfo&&(e.fieldInfo=n.fieldInfo),n.options!==e.options&&(e.options=n.options);let r=Object.keys({values:null,validationMetaMap:null,fieldMetaBase:null,formGroupStateBase:null,isSubmitting:null,isSubmitted:null,isValidating:null,submissionAttempts:null,isSubmitSuccessful:null,_force_re_eval:null}).reduce((t,r)=>(e.state[r]!==n.state[r]&&(t[r]=n.state[r]),t),{});return H(()=>{Object.keys(r).length&&e.baseStore.setState(e=>({...e,...r})),n.state.errorMap!==e.state.errorMap&&e.setErrorMap(n.state.errorMap)}),n}var Ty=e(a(),1);function Ey(e,t){return e===t}function G(e,t=e=>e,n){let r=n?.compare??Ey,i=(0,D.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,D.useCallback)(()=>e.get(),[e]);return(0,Ty.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var Dy=typeof window<`u`?D.useLayoutEffect:D.useEffect;function Oy(e){let[t,n]=(0,D.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,D.useState)(()=>new my({...e})),a=r;(t.form!==e.form||t.name!==e.name)&&(a=new my({...e}),i(a),n({form:e.form,name:e.name}));let o=G(a.store,e.mode===`array`?e=>e.meta._arrayVersion||0:e=>e.value),s=G(a.store,e=>e.meta.isTouched),c=G(a.store,e=>e.meta.isBlurred),l=G(a.store,e=>e.meta.isDirty),u=G(a.store,e=>e.meta.errorMap),d=G(a.store,e=>e.meta.errorSourceMap),f=G(a.store,e=>e.meta.isValidating),p=(0,D.useMemo)(()=>({...a,get state(){return{value:e.mode===`array`?a.state.value:o,get meta(){return{...a.state.meta,isTouched:s,isBlurred:c,isDirty:l,errorMap:u,errorSourceMap:d,isValidating:f}}}}}),[a,e.mode,o,s,c,l,u,d,f]);return Dy(a.mount,[a]),Dy(()=>{a.update(e)}),p}var ky=(({children:e,...t})=>{let n=Oy(t),r=(0,D.useMemo)(()=>Pv(e,n),[e,n]);return(0,k.jsx)(k.Fragment,{children:r})});function Ay(){return(0,D.useState)(()=>ey())[0]}var jy=D,My=`19.3.0`.split(`.`)[0]===`17`?Ay:jy.useId;function Ny(e){let[t,n]=(0,D.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,D.useState)(()=>new yy({...e}));(t.form!==e.form||t.name!==e.name)&&(i(new yy({...e})),n({form:e.form,name:e.name}));let a=G(r.store,e=>e.value),o=G(r.store,e=>e.meta.isTouched),s=G(r.store,e=>e.meta.isBlurred),c=G(r.store,e=>e.meta.isDirty),l=G(r.store,e=>e.meta.errorMap),u=G(r.store,e=>e.meta.errorSourceMap),d=G(r.store,e=>e.meta.isValidating),f=G(r.store,e=>e.meta.isSubmitting),p=G(r.store,e=>e.meta.isSubmitted),m=G(r.store,e=>e.meta.submissionAttempts),h=G(r.store,e=>e.meta.isSubmitSuccessful),g=G(r.store,e=>e.meta.canSubmit),_=G(r.store,e=>e.meta.isValid),v=G(r.store,e=>e.meta.isFieldsValid),y=G(r.store,e=>e.meta.isFieldsValidating),b=G(r.store,e=>e.meta.isGroupValid),x=(0,D.useMemo)(()=>({...r,handleSubmit:((...e)=>r._handleSubmit(...e)),get state(){return{...r.state,value:a,get meta(){return{...r.state.meta,isTouched:o,isBlurred:s,isDirty:c,errorMap:l,errorSourceMap:u,isValidating:d,isSubmitting:f,isSubmitted:p,submissionAttempts:m,isSubmitSuccessful:h,canSubmit:g,isValid:_,isFieldsValid:v,isFieldsValidating:y,isGroupValid:b}}}}}),[r,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b]);return Dy(r.mount,[r]),Dy(()=>{r.update(e)}),x}var Py=(({children:e,...t})=>{let n=Ny(t),r=(0,D.useMemo)(()=>Pv(e,n),[e,n]);return(0,k.jsx)(k.Fragment,{children:r})});function Fy({form:e,selector:t=e=>e,children:n}){let r=G(e.store,t);return(0,k.jsx)(k.Fragment,{children:Pv(n,r)})}function Iy(e){let t=My(),[n,r]=(0,D.useState)(e?.formId),[i,a]=(0,D.useState)(()=>new dy({...e,formId:e?.formId??t}));if(n!==e?.formId){let n=e?.formId??t;a(new dy({...e,formId:n})),r(n)}let o=(0,D.useMemo)(()=>{let e={...i,handleSubmit:((...e)=>i._handleSubmit(...e)),get formId(){return i._formId},get state(){return i.store.state}};return e.Field=function(e){return(0,k.jsx)(ky,{...e,form:i})},e.FormGroup=function(e){return(0,k.jsx)(Py,{...e,form:i})},e.Subscribe=function(e){return(0,k.jsx)(Fy,{form:i,selector:e.selector,children:e.children})},e},[i]);Dy(i.mount,[]),Dy(()=>{i.update(e)});let s=(0,D.useRef)(!1);return Dy(()=>{s.current&&e?.transform&&wy(i,e.transform)},[i,e?.transform]),Dy(()=>{s.current=!0}),o}function Ly(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Ry(e,t=`|`){return e.map(e=>cb(e)).join(t)}function zy(e,t){return typeof t==`bigint`?t.toString():t}var By=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Vy(e){return new By(e)}function Hy(e){return e==null}function Uy(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Wy(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Gy(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function Ky(e){return Gy(e._zod.def)??e._zod.def.shape}function qy(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return Wy(this,t,e),e},enumerable:!0,configurable:!0})}function Jy(e,t,n){t in e?Wy(e,t,n):e[t]=n}function Yy(e,t,n,r){let i=Ky(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?qy(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):Jy(e,a,r?r(n.value,a):n.value))}}function Xy(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?qy(e,n,()=>t[n]):Jy(e,n,r.value))}}function Zy(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Qy(e){return JSON.stringify(e)}function $y(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var eb=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function tb(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var nb=Vy(()=>{if(Xb.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function rb(e){if(tb(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return tb(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ib(e){return rb(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ab=new Set([`string`,`number`,`symbol`]);function ob(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function sb(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function K(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function cb(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function lb(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var ub={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},db={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function fb(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return Yy(i,e,pb(e,t)),sb(e,Zy(n,{shape:i,checks:[]}))}function pb(e,t){let n=Ky(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function mb(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(pb(e,t)),a={};return Yy(a,e,Reflect.ownKeys(Ky(e)).filter(e=>!i.has(e))),sb(e,Zy(n,{shape:a,checks:[]}))}function hb(e,t){if(!rb(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=Ky(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return sb(e,Zy(e._zod.def,{shape:gb(e,t)}))}function gb(e,t){let n={};return Yy(n,e,Reflect.ownKeys(Ky(e))),Xy(n,t),n}function _b(e,t){if(!rb(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return sb(e,Zy(e._zod.def,{shape:gb(e,t)}))}function vb(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return Yy(n,e,Reflect.ownKeys(Ky(e))),Yy(n,t,Reflect.ownKeys(Ky(t))),sb(e,Zy(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function yb(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(pb(t,n)):void 0,o={};return Yy(o,t,Reflect.ownKeys(Ky(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),sb(t,Zy(t._zod.def,{shape:o,checks:[]}))}function bb(e,t,n){let r=n?new Set(pb(t,n)):void 0,i={};return Yy(i,t,Reflect.ownKeys(Ky(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),sb(t,Zy(t._zod.def,{shape:i}))}function xb(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Sb(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Cb(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function wb(e){return typeof e==`string`?e:e?.message}function Tb(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Eb(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:wb(e.inst?._zod.def?.error?.(e))??wb(a?.(e))??wb(t?.error?.(e))??wb(n.customError?.(e))??wb(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var Db=/[\uD800-\uDBFF]/;function Ob(e){let t=e.length;if(!Db.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function kb(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ab(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function jb(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Mb(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Ib(e,n,r.value)}for(let n of Object.getOwnPropertySymbols(t))Ib(e,n,t[n])}function Nb(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Pb(e,t,n){return Nb(e,t,n,!1)}function Fb(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Nb(this,n,r(this))},set(e){Nb(this,n,e)}})}return t}function Ib(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Nb(this,t,n.bind(this))},set(e){Nb(this,t,e)}})}function Lb(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Rb,zb=!1,Bb={configurable:!0,get(){zb=!0}};function q(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&Rb!==e._zod){Rb=void 0;return}Rb=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Bb);let e=zb;zb=!1;try{let r=n(this);return zb?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),zb||=e,r}catch(n){throw delete this[t],zb||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function Vb(e,t,n,r){let i=Lb(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var Hb=`~constantCatch`;function Ub(e){let t=()=>e;return t[Hb]=!0,t}var Wb,Gb={value:void 0,enumerable:!1},Kb=`captureStackTrace`in Error?Error:null;function qb(e){let t=Kb;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Kb=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function J(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Gb.value=new a(r);try{Object.defineProperty(n,"_zod",Gb)}finally{Gb.value=void 0}}if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Mb(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?qb(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Jb=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Yb=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Wb=globalThis).__zod_globalConfig??(Wb.__zod_globalConfig={});var Xb=globalThis.__zod_globalConfig;function Zb(e){return e&&Object.assign(Xb,e),Xb}function Qb(){let e=this._zod;return e.message??=JSON.stringify(e.def,zy,2),e.message}function $b(e){this._zod.message=e}var ex={get:Qb,set:$b,enumerable:!0,configurable:!0},tx={value:void 0,enumerable:!1},nx=new WeakSet([Object.prototype,Error.prototype]),rx=(e,t)=>{e.name=`$ZodError`,tx.value=t,Object.defineProperty(e,"issues",tx),tx.value=void 0,Object.defineProperty(e,"message",ex);let n=Object.getPrototypeOf(e);nx.has(n)||(nx.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},ix=J(`$ZodError`,rx);J(`$ZodError`,rx,void 0,{Parent:Error});function ax(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function ox(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?ax(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function sx(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function cx(e,t){return{callee:t?.callee??e,Err:t?.Err}}var lx=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Jb;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Eb(e,o,Zb())));throw eb(n,a?.callee??t),n}return s.value};return t},ux=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Eb(e,o,Zb())));throw eb(n,a?.callee??t),n}return s.value};return t},dx=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Jb;return a.issues.length?fx(e,a.issues,i):{success:!0,data:a.value}};function fx(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>Eb(e,n,Zb()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var px=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?fx(e,a.issues,i):{success:!0,data:a.value}},mx=Symbol.for(`zod.compile.invalid`),hx=Symbol.for(`zod.compile.fallback`),gx=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==mx)return!0;if(r.definite===!0&&n===void 0)return!1}return _x(e,t,n)});function _x(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[hx]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Jb;return a.issues.length===0}var vx=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},yx=e=>{let t=lx(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,cx(n,a))};return n},bx=e=>{let t=lx(e),n=(e,r,i,a)=>t(e,r,i,cx(n,a));return n},xx=e=>{let t=ux(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,cx(n,a))};return n},Sx=e=>{let t=ux(e),n=async(e,r,i,a)=>await t(e,r,i,cx(n,a));return n},Cx=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return dx(e)(t,n,i)},wx=e=>(t,n,r)=>dx(e)(t,n,r),Tx=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return px(e)(t,n,i)},Ex=e=>async(t,n,r)=>px(e)(t,n,r),Dx=/^[cC][0-9a-z]{6,}$/,Ox=/^[0-9a-z]+$/,kx=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Ax=/^[0-9a-vA-V]{20}$/,jx=/^[A-Za-z0-9]{27}$/,Mx=/^[a-zA-Z0-9_-]{21}$/;function Nx(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Px=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Fx=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ix=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Lx=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Rx=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function zx(){return new RegExp(Rx,`u`)}var Bx=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Vx=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Hx=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ux=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Wx=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Gx=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Kx=/^https?$/,qx=/^\+[1-9]\d{6,14}$/,Jx=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function Yx(e){return RegExp(`^${e}$`)}var Xx=Yx(Jx);function Zx(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Qx(e){return RegExp(`^${Zx(e)}$`)}function $x(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Zx({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Zx({precision:e.precision})}`:n;return RegExp(`^${Jx}T(?:${r})$`)}var eS=/^[\s\S]{0,}$/,tS=/^[^A-Z]*$/,nS=/^[^a-z]*$/,rS=J(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),iS=e=>{let t=e.value;return!Hy(t)&&t.length!==void 0},aS=J(`$ZodCheckMaxLength`,(e,t)=>{var n;rS.init(e,t),(n=e._zod.def).when??(n.when=iS),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Ob(r):i)<=t.maximum)return;let a=kb(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),oS=J(`$ZodCheckMinLength`,(e,t)=>{var n;rS.init(e,t),(n=e._zod.def).when??(n.when=iS),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Ob(r):i)>=t.minimum)return;let a=kb(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),sS=J(`$ZodCheckLengthEquals`,(e,t)=>{var n;rS.init(e,t),(n=e._zod.def).when??(n.when=iS),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Ob(r):i;if(a===t.length)return;let o=kb(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),cS=J(`$ZodCheckStringFormat`,(e,t)=>{var n,r;rS.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),lS=J(`$ZodCheckRegex`,(e,t)=>{cS.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),uS=J(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=tS,cS.init(e,t)}),dS=J(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=nS,cS.init(e,t)}),fS=J(`$ZodCheckIncludes`,(e,t)=>{rS.init(e,t);let n=ob(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),pS=J(`$ZodCheckStartsWith`,(e,t)=>{rS.init(e,t);let n=RegExp(`^${ob(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),mS=J(`$ZodCheckEndsWith`,(e,t)=>{rS.init(e,t);let n=RegExp(`.*${ob(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),hS=J(`$ZodCheckOverwrite`,(e,t)=>{rS.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),gS=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
5
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
6
|
+
`)}\n};`)(...Object.values(this.closed))}},_S={major:4,minor:6,patch:1},Y=J(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_S;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=xb(t),a;for(let o of n){if(o._zod.def.when){if(Sb(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new Jb;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Tb(t.issues,n,e),i||=xb(t,n))});else{if(t.issues.length===n)continue;Tb(t.issues,n,e),i||=xb(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(xb(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Jb;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new Jb;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Pb(this,`~standard`,bS(this))},set"~standard"(e){Nb(this,`~standard`,e)}}),vS=(e,t)=>e.issues.length?{issues:e.issues.map(e=>Eb(e,t,Zb()))}:{value:e.value};async function yS(e,t){let n={async:!0};return vS(await e._zod.run({value:t,issues:[]},n),n)}function bS(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return vS(r,n)}catch{}return yS(e,t)},vendor:`zod`,version:1}}var xS=J(`$ZodString`,(e,t)=>{Y.init(e,t),e._zod.pattern=t.pattern??eS,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),X=J(`$ZodStringFormat`,(e,t)=>{cS.init(e,t),xS.init(e,t)}),SS=J(`$ZodGUID`,(e,t)=>{t.pattern??=Fx,X.init(e,t)}),CS=J(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Ix(e)}else t.pattern??=Ix();X.init(e,t)}),wS=J(`$ZodEmail`,(e,t)=>{t.pattern??=Lx,X.init(e,t)});function TS(e,t){if(!t.normalize&&t.protocol?.source===Kx.source&&!/^https?:\/\//i.test(e))return 1;try{return new URL(e)}catch{return 2}}var ES=/[\t\n\r]/g;function DS(e){return e.replace(ES,``)}function OS(e,t){return t.lastIndex=0,t.test(e.hostname)}function kS(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var AS=J(`$ZodURL`,(e,t)=>{X.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=TS(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}t.hostname&&!OS(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!kS(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:DS(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),jS=J(`$ZodEmoji`,(e,t)=>{t.pattern??=zx(),X.init(e,t)}),MS=J(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Mx:Nx(t.length),X.init(e,t)}),NS=J(`$ZodCUID`,(e,t)=>{t.pattern??=Dx,X.init(e,t)}),PS=J(`$ZodCUID2`,(e,t)=>{t.pattern??=Ox,X.init(e,t)}),FS=J(`$ZodULID`,(e,t)=>{t.pattern??=kx,X.init(e,t)}),IS=J(`$ZodXID`,(e,t)=>{t.pattern??=Ax,X.init(e,t)}),LS=J(`$ZodKSUID`,(e,t)=>{t.pattern??=jx,X.init(e,t)}),RS=J(`$ZodISODateTime`,(e,t)=>{t.pattern??=$x(t),X.init(e,t)}),zS=J(`$ZodISODate`,(e,t)=>{t.pattern??=Xx,X.init(e,t)}),BS=J(`$ZodISOTime`,(e,t)=>{t.pattern??=Qx(t),X.init(e,t)}),VS=J(`$ZodISODuration`,(e,t)=>{t.pattern??=Px,X.init(e,t)}),HS=J(`$ZodIPv4`,(e,t)=>{t.pattern??=Bx,X.init(e,t)}),US=/^[0-9a-fA-F:.]+$/;function WS(e){if(!US.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var GS=J(`$ZodIPv6`,(e,t)=>{t.pattern??=Vx,X.init(e,t),e._zod.check=n=>{WS(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),KS=J(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Hx,X.init(e,t)});function qS(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:WS(n)}var JS=J(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Ux,X.init(e,t),e._zod.check=n=>{qS(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function YS(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var XS=/^[0-9a-zA-Z+/]*={0,2}$/,ZS=J(`$ZodBase64`,(e,t)=>{t.pattern??=XS,X.init(e,t),e._zod.check=n=>{YS(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),QS=/^[A-Za-z0-9_-]*$/;function $S(e){if(!QS.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return YS(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var eC=J(`$ZodBase64URL`,(e,t)=>{t.pattern??=QS,X.init(e,t),e._zod.check=n=>{$S(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),tC=J(`$ZodE164`,(e,t)=>{t.pattern??=qx,X.init(e,t)});function nC(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var rC=J(`$ZodJWT`,(e,t)=>{X.init(e,t),e._zod.check=n=>{nC(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),iC=J(`$ZodUnknown`,(e,t)=>{Y.init(e,t),e._zod.parse=e=>e}),aC=J(`$ZodNever`,(e,t)=>{Y.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function oC(e,t,n){e.issues.length&&t.issues.push(...Cb(n,e.issues)),t.value[n]=e.value}var sC=J(`$ZodArray`,(e,t)=>{Y.init(e,t);let n=Xb.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>oC(t,r,e)));else if(oC(c,r,e),s&&c.issues.length!==0&&xb(c))break}return o.length?Promise.all(o).then(()=>r):r}});function cC(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Cb(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}}var lC=[];function uC(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:lC,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=lb(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function dC(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(xb(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>cC(e,n,i,t,d,f))):cC(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var fC=J(`$ZodObject`,(e,t)=>{Y.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=Vy(()=>uC(t));q(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||Wy(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=tb,o=t.catchall,s,c=Xb.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(xb(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>cC(n,t,e,r,a,o))):cC(s,t,e,r,a,o)}return o?dC(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),pC=J(`$ZodObjectJIT`,(e,t)=>{fC.init(e,t);let n=e._zod.parse,r=Vy(()=>uC(t)),i=Xb.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new gS([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
7
|
+
let ${e}_ab = false;
|
|
8
|
+
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
9
|
+
const iss = ${e}.issues[i];
|
|
10
|
+
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
11
|
+
payload.issues.push(iss);
|
|
12
|
+
if (iss.continue !== true) ${e}_ab = true;
|
|
13
|
+
}
|
|
14
|
+
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
15
|
+
payload.value = newResult;
|
|
16
|
+
return payload;
|
|
17
|
+
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:Qy(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
18
|
+
const ${n}_present = ${i};
|
|
19
|
+
if (!${n}.issues.length || ${n}_present) {
|
|
20
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (${e}) {
|
|
24
|
+
newResult[${r}] = ${n}.value;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
`)}else f?o.write(`
|
|
29
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (${n}.value === undefined) {
|
|
33
|
+
if (${i}) {
|
|
34
|
+
newResult[${r}] = undefined;
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
newResult[${r}] = ${n}.value;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
`):o.write(`
|
|
41
|
+
const ${n}_present = ${i};
|
|
42
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
43
|
+
}
|
|
44
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
45
|
+
payload.issues.push({
|
|
46
|
+
code: "invalid_type",
|
|
47
|
+
expected: "nonoptional",
|
|
48
|
+
input: undefined,
|
|
49
|
+
path: [${r}]
|
|
50
|
+
});
|
|
51
|
+
if (ctx && ctx.abortEarly) {
|
|
52
|
+
payload.value = newResult;
|
|
53
|
+
return payload;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (${n}_present) {
|
|
58
|
+
newResult[${r}] = ${n}.value;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=tb,c=!Xb.jitless,l=c&&nb.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?dC([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function mC(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!xb(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Eb(e,r,Zb())))}),t)}var hC=J(`$ZodUnion`,(e,t)=>{Y.init(e,t),q(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),q(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),q(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),q(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Uy(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>mC(t,r,e,i)):mC(o,r,e,i)}}),gC=J(`$ZodIntersection`,(e,t)=>{Y.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>vC(e,t,n)):vC(e,i,a)}});function _C(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(rb(e)&&rb(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=_C(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=_C(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function vC(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=_C(t.value,n.value);if(!c.valid){if(xb(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var yC=J(`$ZodEnum`,(e,t)=>{Y.init(e,t);let n=Ly(t.entries),r=new Set(n);e._zod.values=r,q(e,`pattern`,e=>{let t=Ly(e.def.entries).filter(e=>ab.has(typeof e));return RegExp(t.length?`^(${t.map(e=>ob(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),bC=J(`$ZodTransform`,(e,t)=>{Y.init(e,t),e._zod.optin=`optional`,Xb.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Yb(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Jb;return n.value=i,n}});function xC(e,t){return e.value=t.issues.length?void 0:t.value,e}var SC=J(`$ZodOptional`,(e,t)=>{Y.init(e,t),q(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,q(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),q(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Uy(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>xC(e,t)):xC(e,r)}return t.innerType._zod.run(e,n)}}),CC=J(`$ZodExactOptional`,(e,t)=>{SC.init(e,t),q(e,`values`,e=>e.def.innerType._zod.values),q(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),wC=J(`$ZodNullable`,(e,t)=>{Y.init(e,t),q(e,`optin`,e=>e.def.innerType._zod.optin),q(e,`optout`,e=>e.def.innerType._zod.optout),q(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Uy(t.source)}|null)$`):void 0}),q(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),TC=J(`$ZodDefault`,(e,t)=>{Y.init(e,t),e._zod.optin=`defaulted`,q(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>EC(e,t)):EC(r,t)}});function EC(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var DC=J(`$ZodPrefault`,(e,t)=>{Y.init(e,t),e._zod.optin=`defaulted`,q(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),OC=J(`$ZodNonOptional`,(e,t)=>{Y.init(e,t),q(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>kC(t,e)):kC(i,e)}});function kC(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function AC(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Eb(e,r,Zb()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var jC=J(`$ZodCatch`,(e,t)=>{Y.init(e,t),q(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),q(e,`optout`,e=>e.def.innerType._zod.optout),q(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>AC(e,r,t,n)):AC(e,r,t,n)}}),MC=J(`$ZodPipe`,(e,t)=>{Y.init(e,t),q(e,`values`,e=>e.def.in._zod.values),q(e,`optin`,e=>e.def.in._zod.optin),q(e,`optout`,e=>e.def.out._zod.optout),q(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>NC(e,t.in,n)):NC(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>NC(e,t.out,n)):NC(r,t.out,n)}});function NC(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var PC=J(`$ZodReadonly`,(e,t)=>{Y.init(e,t),q(e,`propValues`,e=>e.def.innerType._zod.propValues),q(e,`values`,e=>e.def.innerType._zod.values),q(e,`optin`,e=>e.def.innerType?._zod?.optin),q(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(FC):FC(r)}});function FC(e){return e.memo||(e.value=Object.freeze(e.value)),e}var IC=J(`$ZodCustom`,(e,t)=>{rS.init(e,t),Y.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>LC(t,n,r,e));LC(i,n,r,e)}});function LC(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(jb(e))}}var RC=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},zC=`~memo`,BC=[];function VC(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function HC(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var UC=new WeakMap,WC=0,GC=1,KC=2;function qC(e,t,n){let r=UC.get(e);if(r!==void 0)return r?KC:WC;if(t.has(e))return KC;t.add(e);let i=WC,a=e=>{if(i!==KC&&e?._zod){let r=qC(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=WC;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?GC:o.value?._zod?qC(o.value,t,n):WC;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Gy(c);s(e?o(e,!0):GC),a(c.catchall);break}case`properties`:s(o(c.shape,!1));break;case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?qC(r,t,!1):GC);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),JC(e,i)}function JC(e,t){return t!==GC&&UC.set(e,t===KC),t}function YC(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var XC,ZC=[],QC={alloc(e,t,n){let r=XC;if(!r)return n;XC=void 0;let i={value:n,issues:null};return r.set(t.value,i),ZC.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&ew(n,e.value))throw new RC;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=qC(e,new Set,!1);if(i===WC)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===KC||r?n=!0:r=!0}let l=s.value;if(!VC(l))return t(s,c);let u=c[zC];u||(u={buckets:new WeakMap,backEdges:void 0},c[zC]=u);let d;i===c?d=a:(d=YC(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...HC(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;XC=d;let p=ZC.length,m=t(s,c);XC=void 0;let h=ZC.length>p?ZC.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?HC(e.issues):BC),e)):(h&&(h.issues=m.issues.length?HC(m.issues):BC),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function $C(){return QC}function ew(e,t){let n=e[zC]?.backEdges;return n!==void 0&&VC(t)&&n.has(t)}var tw=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Ab(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${cb(e.values[0])}`:`Invalid option: expected one of ${Ry(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Ry(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function nw(){return{localeError:tw()}}var rw,iw=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function aw(){return new iw}(rw=globalThis).__zod_globalRegistry??(rw.__zod_globalRegistry=aw());var ow=globalThis.__zod_globalRegistry;function sw(e,t){return new e({type:`string`,...K(t)})}function cw(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...K(t)})}function lw(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...K(t)})}function uw(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...K(t)})}function dw(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...K(t)})}function fw(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...K(t)})}function pw(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...K(t)})}function mw(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...K(t)})}function hw(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...K(t)})}function gw(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...K(t)})}function _w(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...K(t)})}function vw(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...K(t)})}function yw(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...K(t)})}function bw(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...K(t)})}function xw(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...K(t)})}function Sw(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...K(t)})}function Cw(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...K(t)})}function ww(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...K(t)})}function Tw(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...K(t)})}function Ew(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...K(t)})}function Dw(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...K(t)})}function Ow(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...K(t)})}function kw(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...K(t)})}function Aw(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...K(t)})}function jw(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...K(t)})}function Mw(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...K(t)})}function Nw(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...K(t)})}function Pw(e){return new e({type:`unknown`})}function Fw(e,t){return new e({type:`never`,...K(t)})}function Iw(e,t){return new aS({check:`max_length`,...K(t),maximum:e})}function Lw(e,t){return new oS({check:`min_length`,...K(t),minimum:e})}function Rw(e,t){return new sS({check:`length_equals`,...K(t),length:e})}function zw(e,t){return new lS({check:`string_format`,format:`regex`,...K(t),pattern:e})}function Bw(e){return new uS({check:`string_format`,format:`lowercase`,...K(e)})}function Vw(e){return new dS({check:`string_format`,format:`uppercase`,...K(e)})}function Hw(e,t){return new fS({check:`string_format`,format:`includes`,...K(t),includes:e})}function Uw(e,t){return new pS({check:`string_format`,format:`starts_with`,...K(t),prefix:e})}function Ww(e,t){return new mS({check:`string_format`,format:`ends_with`,...K(t),suffix:e})}function Gw(e){return new hS({check:`overwrite`,tx:e})}function Kw(e){return Gw(t=>t.normalize(e))}function qw(){return Gw(e=>e.trim())}function Jw(){return Gw(e=>e.toLowerCase())}function Yw(){return Gw(e=>e.toUpperCase())}function Xw(){return Gw(e=>$y(e))}function Zw(e,t,n){return new e({type:`array`,element:t,...K(n)})}function Qw(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...K(n)})}function $w(e,t){let n=eT(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(jb(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(jb(r))}},e(t.value,t)),t);return n}function eT(e,t){let n=new rS({check:`custom`,...K(t)});return n._zod.check=e,n}function tT(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Wy(e,t,n[t]);return e}function nT(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??ow,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function rT(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function Z(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,Z(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&tT(o.schema,c),t.io===`input`&&pT(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function iT(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function aT(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${iT(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+iT(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
62
|
+
|
|
63
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function oT(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;oT(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var sT=new Set([`type`,`properties`,`required`,`additionalProperties`]),cT=[`oneOf`,`anyOf`];function lT(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function uT(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!sT.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??lT(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Wy(n,r,e.length===1?e[0]:uT(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=lT(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function dT(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of sT)if(t in e)return;let n=t.filter(e=>cT.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=uT(t);else{let e=n[0],i=cT.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>uT([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,tT(e,r))}function fT(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):tT(i,s),tT(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())oT(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])dT(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}tT(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Wy(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:hT(t,`input`,e.processors),output:hT(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function pT(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return pT(r.element,n);if(r.type===`set`)return pT(r.valueType,n);if(r.type===`lazy`)return pT(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return pT(r.innerType,n);if(r.type===`intersection`)return pT(r.left,n)||pT(r.right,n);if(r.type===`record`||r.type===`map`)return pT(r.keyType,n)||pT(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:pT(r.in,n)||pT(r.out,n);if(r.type===`object`){for(let e in r.shape)if(pT(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(pT(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(pT(e,n))return!0;return!!(r.rest&&pT(r.rest,n))}return!1}var mT=(e,t={})=>n=>{let r=nT({...n,processors:t});return Z(e,r),aT(r,e),fT(r,e)},hT=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=nT({...i??{},target:a,io:t,processors:n});return Z(e,o),aT(o,e),fT(o,e)},gT=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},_T=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},vT=(e,t)=>{gT(e,`minimum`,t),_T(e,`maximum`,t)},yT=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},bT=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},xT=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},ST=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},CT=(e,t)=>gT(e,`minimum`,t.minimum),wT=(e,t)=>_T(e,`maximum`,t.maximum),TT=e=>(t,n)=>{ST(t,n.format);let[r,i]=e[n.format];gT(t,`minimum`,r),_T(t,`maximum`,i)},ET={greater_than:(e,t)=>gT(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>_T(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>yT(e,t.value),number_format:TT(ub),bigint_format:TT(db),min_length:CT,max_length:wT,length_equals:(e,t)=>vT(e,t.length),min_size:CT,max_size:wT,size_equals:(e,t)=>vT(e,t.size),string_format:(e,t)=>{ST(e,t.format),t.pattern&&bT(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>xT(e,t.mime)};function DT(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)ET[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&gT(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&gT(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&_T(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&_T(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&yT(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&xT(t,i.mime);for(let e of i.patterns??[])bT(t,e);return t}var OT={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},kT=new Map([[XS,Wx],[QS,Gx]]),AT=e=>kT.get(e)??e,jT=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=DT(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=OT[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(AT);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},MT=(e,t,n,r)=>{n.not={}},NT=(e,t,n,r)=>{let i=e._zod.def,a=Ly(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},PT=(e,t,n,r)=>{rT(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},FT=(e,t,n,r)=>{rT(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},IT=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=DT(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Z(a.element,t,{...r,path:[...r.path,`items`]})};function LT(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?LT(t.out):t.type===`catch`?LT(t.innerType):e._zod.optin}var RT=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&rT(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Wy(i.properties,e,Z(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e];return t.io===`input`?LT(n)===void 0:n._zod.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Z(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},zT=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Z(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},BT=(e,t,n,r)=>{let i=e._zod.def,a=Z(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Z(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},VT=(e,t,n,r)=>{let i=e._zod.def,a=Z(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},HT=(e,t,n,r)=>{let i=e._zod.def;Z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},UT=Symbol();function WT(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(rT(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),UT):JSON.parse(o)}var GT=(e,t,n,r)=>{let i=e._zod.def;Z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=WT(i.defaultValue,e,t,n,r);o!==UT&&(n.default=o)},KT=(e,t,n,r)=>{let i=e._zod.def;Z(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=WT(i.defaultValue,e,t,n,r);o!==UT&&(n._prefault=o)},qT=(e,t,n,r)=>{let i=e._zod.def;Z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{rT(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},JT=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Z(o,t,r);let s=t.seen.get(e);s.ref=o},YT=(e,t,n,r)=>{let i=e._zod.def;Z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},XT=(e,t,n,r)=>{let i=e._zod.def;Z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ZT=new WeakSet([Object.prototype,Error.prototype]);function QT(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var $T=J(`ZodError`,(e,t)=>{ix.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);ZT.has(n)||(ZT.add(n),QT(n,`format`,e=>t=>sx(e,t)),QT(n,`flatten`,e=>t=>ox(e,t)),QT(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,zy,2)}),QT(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,zy,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),eE=lx($T),tE=ux($T),nE=dx($T),rE=px($T),iE=yx($T),aE=bx($T),oE=xx($T),sE=Sx($T),cE=Cx($T),lE=wx($T),uE=Tx($T),dE=Ex($T);function fE(){Xb.localeError||Zb(nw())}function pE(){Xb.memoizer||Zb({memoizer:$C()})}var Q=J(`ZodType`,(e,t)=>(fE(),Y.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Zy(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return sb(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(xD(e,t))},superRefine(e,t){return this.check(SD(e,t))},overwrite(e){return this.check(Gw(e))},optional(){return rD(this)},exactOptional(){return aD(this)},nullable(){return sD(this)},nullish(){return rD(sD(this))},nonoptional(e){return pD(this,e)},array(){return GE(this)},or(e){return YE([this,e])},and(e){return ZE(this,e)},transform(e){return _D(this,tD(e))},default(e){return lD(this,e)},prefault(e){return dD(this,e)},catch(e){return hD(this,e)},pipe(e){return _D(this,e)},readonly(){return yD(this)},describe(e){let t=this.clone();return ow.add(t,{description:e}),t},meta(...e){if(e.length===0)return ow.get(this);let t=this.clone();return ow.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Pb(this,`~standard`,{...bS(this),jsonSchema:{input:hT(this,`input`),output:hT(this,`output`)}})},set"~standard"(e){Nb(this,`~standard`,e)},parse:function e(t,n){return eE(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await tE(this,t,n,{callee:e})},safeParse(e,t){return nE(this,e,t)},async safeParseAsync(e,t){return rE(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Nb(this,`spa`,e)},validate(e,t){return gx(this,e,t)},validateAsync(e,t){return vx(this,e,t)},encode:function e(t,n){return iE(this,t,n,{callee:e})},decode:function e(t,n){return aE(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await oE(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await sE(this,t,n,{callee:e})},safeEncode(e,t){return cE(this,e,t)},safeDecode(e,t){return lE(this,e,t)},async safeEncodeAsync(e,t){return uE(this,e,t)},async safeDecodeAsync(e,t){return dE(this,e,t)},toJSONSchema(e){return mT(this,{})(e)},get description(){return ow.get(this)?.description},get _def(){return this._zod.def}}),mE=J(`_ZodString`,(e,t)=>{xS.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jT(e,t,n,r)},Fb({format:e=>DT(e).format??null,minLength:e=>DT(e).minimum??null,maxLength:e=>DT(e).maximum??null},{regex(...e){return this.check(zw(...e))},includes(...e){return this.check(Hw(...e))},startsWith(...e){return this.check(Uw(...e))},endsWith(...e){return this.check(Ww(...e))},min(...e){return this.check(Lw(...e))},max(...e){return this.check(Iw(...e))},length(...e){return this.check(Rw(...e))},nonempty(...e){return this.check(Lw(1,...e))},lowercase(e){return this.check(Bw(e))},uppercase(e){return this.check(Vw(e))},trim(){return this.check(qw())},normalize(...e){return this.check(Kw(...e))},toLowerCase(){return this.check(Jw())},toUpperCase(){return this.check(Yw())},slugify(){return this.check(Xw())}})),hE=J(`ZodString`,(e,t)=>{xS.init(e,t),mE.init(e,t)},{email(e){return this.check(cw(xE,e))},url(e){return this.check(mw(wE,e))},jwt(e){return this.check(kw(zE,e))},emoji(e){return this.check(hw(TE,e))},guid(e){return this.check(lw(SE,e))},uuid(e){return this.check(uw(CE,e))},uuidv4(e){return this.check(dw(CE,e))},uuidv6(e){return this.check(fw(CE,e))},uuidv7(e){return this.check(pw(CE,e))},nanoid(e){return this.check(gw(EE,e))},cuid(e){return this.check(_w(DE,e))},cuid2(e){return this.check(vw(OE,e))},ulid(e){return this.check(yw(kE,e))},base64(e){return this.check(Ew(IE,e))},base64url(e){return this.check(Dw(LE,e))},xid(e){return this.check(bw(AE,e))},ksuid(e){return this.check(xw(jE,e))},ipv4(e){return this.check(Sw(ME,e))},ipv6(e){return this.check(Cw(NE,e))},cidrv4(e){return this.check(ww(PE,e))},cidrv6(e){return this.check(Tw(FE,e))},e164(e){return this.check(Ow(RE,e))},datetime(e){return this.check(Aw(_E,e))},date(e){return this.check(jw(vE,e))},time(e){return this.check(Mw(yE,e))},duration(e){return this.check(Nw(bE,e))}});function gE(e){return sw(hE,e)}var $=J(`ZodStringFormat`,(e,t)=>{X.init(e,t),mE.init(e,t)}),_E=J(`ZodISODateTime`,(e,t)=>{RS.init(e,t),$.init(e,t)}),vE=J(`ZodISODate`,(e,t)=>{zS.init(e,t),$.init(e,t)}),yE=J(`ZodISOTime`,(e,t)=>{BS.init(e,t),$.init(e,t)}),bE=J(`ZodISODuration`,(e,t)=>{VS.init(e,t),$.init(e,t)}),xE=J(`ZodEmail`,(e,t)=>{wS.init(e,t),$.init(e,t)}),SE=J(`ZodGUID`,(e,t)=>{SS.init(e,t),$.init(e,t)}),CE=J(`ZodUUID`,(e,t)=>{CS.init(e,t),$.init(e,t)}),wE=J(`ZodURL`,(e,t)=>{AS.init(e,t),$.init(e,t)}),TE=J(`ZodEmoji`,(e,t)=>{jS.init(e,t),$.init(e,t)}),EE=J(`ZodNanoID`,(e,t)=>{MS.init(e,t),$.init(e,t)}),DE=J(`ZodCUID`,(e,t)=>{NS.init(e,t),$.init(e,t)}),OE=J(`ZodCUID2`,(e,t)=>{PS.init(e,t),$.init(e,t)}),kE=J(`ZodULID`,(e,t)=>{FS.init(e,t),$.init(e,t)}),AE=J(`ZodXID`,(e,t)=>{IS.init(e,t),$.init(e,t)}),jE=J(`ZodKSUID`,(e,t)=>{LS.init(e,t),$.init(e,t)}),ME=J(`ZodIPv4`,(e,t)=>{HS.init(e,t),$.init(e,t)}),NE=J(`ZodIPv6`,(e,t)=>{GS.init(e,t),$.init(e,t)}),PE=J(`ZodCIDRv4`,(e,t)=>{KS.init(e,t),$.init(e,t)}),FE=J(`ZodCIDRv6`,(e,t)=>{JS.init(e,t),$.init(e,t)}),IE=J(`ZodBase64`,(e,t)=>{ZS.init(e,t),$.init(e,t)}),LE=J(`ZodBase64URL`,(e,t)=>{eC.init(e,t),$.init(e,t)}),RE=J(`ZodE164`,(e,t)=>{tC.init(e,t),$.init(e,t)}),zE=J(`ZodJWT`,(e,t)=>{rC.init(e,t),$.init(e,t)}),BE=J(`ZodUnknown`,(e,t)=>{iC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function VE(){return Pw(BE)}var HE=J(`ZodNever`,(e,t)=>{aC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>MT(e,t,n,r)});function UE(e){return Fw(HE,e)}var WE=J(`ZodArray`,(e,t)=>{pE(),sC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>IT(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Lw(e,t))},nonempty(e){return this.check(Lw(1,e))},max(e,t){return this.check(Iw(e,t))},length(e,t){return this.check(Rw(e,t))},unwrap(){return this.element}});function GE(e,t){return Zw(WE,e,t)}var KE=J(`ZodObject`,(e,t)=>{pE(),pC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>RT(e,t,n,r),Vb(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return $E(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Zy(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Zy(this._zod.def,{catchall:VE()}))},loose(){return this.clone(Zy(this._zod.def,{catchall:VE()}))},strict(){return this.clone(Zy(this._zod.def,{catchall:UE()}))},strip(){return this.clone(Zy(this._zod.def,{catchall:void 0}))},extend(e){return hb(this,e)},safeExtend(e){return _b(this,e)},merge(e){return vb(this,e)},pick(e){return fb(this,e)},omit(e){return mb(this,e)},partial(...e){return yb(nD,this,e[0])},exactPartial(...e){return yb(iD,this,e[0],`exactPartial`)},required(...e){return bb(fD,this,e[0])}});function qE(e,t){return new KE({type:`object`,shape:e??{},...K(t)})}var JE=J(`ZodUnion`,(e,t)=>{hC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zT(e,t,n,r),e.options=t.options});function YE(e,t){return new JE({type:`union`,options:e,...K(t)})}var XE=J(`ZodIntersection`,(e,t)=>{gC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>BT(e,t,n,r)});function ZE(e,t){return new XE({type:`intersection`,left:e,right:t})}var QE=J(`ZodEnum`,(e,t)=>{yC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>NT(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new QE({...t,checks:[],...K(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new QE({...t,checks:[],...K(r),entries:i})}});function $E(e,t){return new QE({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...K(t)})}var eD=J(`ZodTransform`,(e,t)=>{pE(),bC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>FT(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Yb(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(jb(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(jb(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function tD(e){return new eD({type:`transform`,transform:e})}var nD=J(`ZodOptional`,(e,t)=>{SC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>XT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function rD(e){return new nD({type:`optional`,innerType:e})}var iD=J(`ZodExactOptional`,(e,t)=>{CC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>XT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function aD(e){return new iD({type:`optional`,innerType:e})}var oD=J(`ZodNullable`,(e,t)=>{wC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>VT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sD(e){return new oD({type:`nullable`,innerType:e})}var cD=J(`ZodDefault`,(e,t)=>{TC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>GT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function lD(e,t){return new cD({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ib(t)}})}var uD=J(`ZodPrefault`,(e,t)=>{DC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>KT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function dD(e,t){return new uD({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ib(t)}})}var fD=J(`ZodNonOptional`,(e,t)=>{OC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>HT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function pD(e,t){return new fD({type:`nonoptional`,innerType:e,...K(t)})}var mD=J(`ZodCatch`,(e,t)=>{jC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function hD(e,t){return new mD({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Ub(t)})}var gD=J(`ZodPipe`,(e,t)=>{MC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>JT(e,t,n,r),e.in=t.in,e.out=t.out});function _D(e,t){return new gD({type:`pipe`,in:e,out:t})}var vD=J(`ZodReadonly`,(e,t)=>{PC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>YT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function yD(e){return new vD({type:`readonly`,innerType:e})}var bD=J(`ZodCustom`,(e,t)=>{IC.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>PT(e,t,n,r)});function xD(e,t={}){return Qw(bD,e,t)}function SD(e,t){return $w(e,t)}function CD({className:e,id:t,revealNonce:n,...r}){let[i,a]=(0,D.useState)(!1);(0,D.useEffect)(()=>{n!==void 0&&n>0&&a(!0)},[n]);let o=(0,D.useId)(),s=t??`password-${o}`,c=`${s}-visibility`,l=i?`text`:`password`;return(0,k.jsxs)(`div`,{className:`relative w-full min-w-0`,children:[(0,k.jsx)(m,{...r,id:s,type:l,inputMode:`text`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,className:g(`pr-10`,e)},l),(0,k.jsx)(`button`,{type:`button`,onClick:()=>a(e=>!e),"aria-label":i?`Hide password`:`Show password`,"aria-pressed":i,"aria-controls":s,"aria-describedby":c,className:g(lt,`absolute top-1/2 right-0 -translate-y-1/2`),children:(0,k.jsx)(p,{icon:i?ns:rs,size:16,color:`currentColor`,strokeWidth:1.5,"aria-hidden":!0})}),(0,k.jsx)(`span`,{id:c,className:`sr-only`,"aria-live":`polite`,children:i?`Password is visible`:`Password is hidden`})]})}function wD({className:e,...t}){return(0,k.jsx)(`label`,{"data-slot":`label`,className:g(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function TD({className:e,...t}){return(0,k.jsx)(`div`,{"data-slot":`field-group`,className:g(`group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t})}var ED=ue(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function DD({className:e,orientation:t=`vertical`,...n}){return(0,k.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:g(ED({orientation:t}),e),...n})}function OD({className:e,...t}){return(0,k.jsx)(wD,{"data-slot":`field-label`,className:g(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}function kD({className:e,children:t,errors:n,...r}){let i=(0,D.useMemo)(()=>{if(t)return t;if(!n?.length)return null;let e=[...new Map(n.map(e=>[e?.message,e])).values()];return e?.length==1?e[0]?.message:(0,k.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:e.map((e,t)=>e?.message&&(0,k.jsx)(`li`,{children:e.message},t))})},[t,n]);return i?(0,k.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:g(`text-sm font-normal text-destructive`,e),...r,children:i}):null}var AD=qE({email:gE().email(`Enter a valid email.`),password:gE().min(1,`Password is required.`)});function jD(...e){let t=e.filter(e=>typeof e==`string`&&e.length>0).join(` `);return t.length>0?t:void 0}function MD(){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`span`,{className:`text-destructive`,"aria-hidden":!0,children:[` `,`*`]}),(0,k.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})}function ND(){let e=Ie(),t=h(),n=f({from:`/`}),[r,i]=(0,D.useState)(null),a=kt({mutationFn:async e=>{let t=await s(e);if(t.error)throw Error(me(t.error));if(!t.data)throw Error(`Empty login response`);return t.data},onSuccess:r=>{u(r),i(null),e.invalidateQueries({queryKey:[`console.setup.status`]}),window.setTimeout(()=>{Lo(t,n.next)},650)},onError:e=>{i(e.message)}}),o=Iy({defaultValues:{email:``,password:``},validators:{onSubmit:AD},onSubmit:async({value:e})=>{i(null),await a.mutateAsync(e)}});return(0,k.jsx)($_,{title:`Sign in`,status:{label:`Setup closed`},description:`Sign in with an existing operator account.`,footer:(0,k.jsx)(J_,{type:`submit`,form:`login-form`,state:q_({pending:a.isPending,success:a.isSuccess,error:a.isError||r!==null}),loadingText:`Signing in`,successText:`Signed in`,errorText:`Try again`,children:`Sign in`}),children:({titleId:e,descriptionId:t})=>(0,k.jsxs)(`form`,{id:`login-form`,className:`flex flex-col`,autoComplete:`on`,noValidate:!0,"aria-labelledby":e,"aria-describedby":t,"aria-busy":a.isPending||void 0,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),o.handleSubmit()},children:[(0,k.jsxs)(TD,{className:H_,role:`group`,"aria-label":`Operator credentials`,children:[(0,k.jsx)(o.Field,{name:`email`,children:e=>{let t=e.state.meta.isTouched&&!e.state.meta.isValid,n=`${e.name}-error`;return(0,k.jsxs)(DD,{"data-invalid":t||void 0,className:U_,children:[(0,k.jsxs)(OD,{htmlFor:e.name,className:K_,children:[`Email`,(0,k.jsx)(MD,{})]}),(0,k.jsx)(m,{id:e.name,name:e.name,type:`email`,inputMode:`email`,autoComplete:`username`,value:e.state.value,onBlur:e.handleBlur,onChange:t=>e.handleChange(t.target.value),placeholder:`Email`,"aria-invalid":t,"aria-required":!0,"aria-describedby":jD(t&&n),required:!0,className:W_}),t?(0,k.jsx)(kD,{id:n,className:G_,errors:e.state.meta.errors}):null]})}}),(0,k.jsx)(o.Field,{name:`password`,children:e=>{let t=e.state.meta.isTouched&&!e.state.meta.isValid,n=`${e.name}-error`;return(0,k.jsxs)(DD,{"data-invalid":t||void 0,className:U_,children:[(0,k.jsxs)(OD,{htmlFor:e.name,className:K_,children:[`Password`,(0,k.jsx)(MD,{})]}),(0,k.jsx)(CD,{id:e.name,name:e.name,value:e.state.value,onBlur:e.handleBlur,onChange:t=>e.handleChange(t.target.value),autoComplete:`current-password`,placeholder:`Password`,"aria-invalid":t,"aria-required":!0,"aria-describedby":jD(t&&n),required:!0,className:W_}),t?(0,k.jsx)(kD,{id:n,className:G_,errors:e.state.meta.errors}):null]})}})]}),r?(0,k.jsx)(`p`,{id:`login-form-error`,className:`px-5 py-3.5 text-sm text-destructive`,role:`alert`,"aria-live":`assertive`,children:r}):null]})})}function PD(e){return e.claimSucceeded?`claim`:e.setupClosed?`login`:`claim`}var FD=/[^A-Za-z0-9]/,ID={minLength:8,requireLetter:!0,requireNumber:!0,requireUppercase:!0,requireLowercase:!0,requireSpecial:!0};function LD(e={}){return{minLength:e.minLength??ID.minLength,requireLetter:e.requireLetter??ID.requireLetter,requireNumber:e.requireNumber??ID.requireNumber,requireUppercase:e.requireUppercase??ID.requireUppercase,requireLowercase:e.requireLowercase??ID.requireLowercase,requireSpecial:e.requireSpecial??ID.requireSpecial}}function RD(e){return FD.test(e)}function zD(e,t={}){let n=LD(t),r=[];if(e.length<n.minLength&&r.push(`minLength ${n.minLength} (got ${e.length})`),n.requireLetter&&!/[A-Za-z]/.test(e)&&r.push(`requireLetter`),n.requireUppercase&&!/[A-Z]/.test(e)&&r.push(`requireUppercase`),n.requireLowercase&&!/[a-z]/.test(e)&&r.push(`requireLowercase`),n.requireNumber&&!/\d/.test(e)&&r.push(`requireNumber`),n.requireSpecial&&!RD(e)&&r.push(`requireSpecial`),r.length>0)throw new JD(r)}var BD=`ABCDEFGHJKLMNPQRSTUVWXYZ`,VD=`abcdefghijkmnpqrstuvwxyz`,HD=`23456789`,UD=`!@#$%^&*-_=+?`;function WD(e={}){let t=LD(e),n=e.length??Math.max(t.minLength,16);if(n<t.minLength)throw Error(`generatePassword: length ${n} is below minLength ${t.minLength}`);let r=[];t.requireUppercase&&r.push(BD),t.requireLowercase&&r.push(VD),t.requireLetter&&!t.requireUppercase&&!t.requireLowercase&&r.push(BD+VD),t.requireNumber&&r.push(HD),t.requireSpecial&&r.push(UD);let i=r.length>0?r.join(``):BD+VD+HD;if(n<r.length)throw Error(`generatePassword: length ${n} cannot cover ${r.length} classes`);let a=r.map(e=>GD(e));for(;a.length<n;)a.push(GD(i));KD(a);let o=a.join(``);return zD(o,t),o}function GD(e){return e[qD(e.length)]??e[0]}function KD(e){for(let t=e.length-1;t>0;t--){let n=qD(t+1),r=e[t];e[t]=e[n],e[n]=r}}function qD(e){if(!Number.isInteger(e)||e<=0)throw Error(`randomInt: maxExclusive must be a positive integer`);let t=e<=256?1:2,n=t===1?256:65536;if(e>n)throw Error(`randomInt: maxExclusive ${e} exceeds ${n}`);let r=n-n%e,i=new Uint8Array(t);for(;;){crypto.getRandomValues(i);let n=t===1?i[0]??0:(i[0]??0)<<8|(i[1]??0);if(n<r)return n%e}}var JD=class extends Error{reasons;constructor(e){super(`password policy failed: ${e.join(`, `)}`),this.name=`PasswordPolicyError`,this.reasons=e}},YD={minLength:12,requireLetter:!0,requireNumber:!0,requireUppercase:!0,requireLowercase:!0,requireSpecial:!0};function XD(e){let t=LD(YD);return[{id:`length`,label:`At least ${t.minLength} characters`,met:e.length>=t.minLength},{id:`uppercase`,label:`Contains an uppercase letter`,met:/[A-Z]/.test(e)},{id:`lowercase`,label:`Contains a lowercase letter`,met:/[a-z]/.test(e)},{id:`number`,label:`Contains a number`,met:/\d/.test(e)},{id:`special`,label:`Contains a special character`,met:RD(e)}]}function ZD(){return WD(YD)}function QD({onGenerate:e,disabled:t,copyText:n=async e=>{await navigator.clipboard.writeText(e)}}){let[r,i]=(0,D.useState)(!1),a=(0,D.useRef)(null);return(0,D.useEffect)(()=>()=>{a.current&&clearTimeout(a.current)},[]),(0,k.jsxs)(_t,{type:`button`,variant:`ghost`,size:`xs`,disabled:t,"data-slot":`generate-password`,"aria-label":r?`Password generated and copied`:`Generate a password and copy it`,className:`text-muted-foreground`,onClick:()=>{let t=ZD();e(t),n(t).then(()=>{i(!0),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>i(!1),1600)}).catch(()=>{i(!1)})},children:[(0,k.jsx)(p,{icon:r?ae:$o,"data-icon":`inline-start`,color:`currentColor`,strokeWidth:1.5,"aria-hidden":!0}),r?`Copied`:`Generate`]})}function $D(e){return XD(e)}function eO(e,t){if(e<=0)return{label:`Empty`,bar:`bg-muted-foreground/35`,text:`text-muted-foreground`};if(e===t)return{label:`Strong`,bar:`bg-emerald-500`,text:`text-emerald-600 dark:text-emerald-400`};let n=e/t;return n<=.4?{label:`Weak`,bar:`bg-destructive`,text:`text-destructive`}:n<=.6?{label:`Fair`,bar:`bg-amber-500`,text:`text-amber-600 dark:text-amber-400`}:{label:`Good`,bar:`bg-lime-500`,text:`text-lime-700 dark:text-lime-400`}}function tO({password:e,id:t=`password-strength`}){let n=$D(e),r=n.filter(e=>e.met).length,i=Math.round(r/n.length*100),a=eO(r,n.length),o=e.length===0;return(0,k.jsxs)(`div`,{id:t,className:`flex flex-col gap-3`,"aria-live":`polite`,children:[(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,k.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,id:`${t}-label`,children:`Password strength`}),(0,k.jsx)(`p`,{className:g(`text-xs tabular-nums font-medium`,o?`text-muted-foreground`:a.text),"aria-hidden":!0,children:o?`0/${n.length}`:`${a.label} · ${r}/${n.length}`})]}),(0,k.jsx)(`div`,{role:`progressbar`,"aria-labelledby":`${t}-label`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":i,"aria-valuetext":o?`No password entered`:`${a.label}: ${r} of ${n.length} requirements met`,className:`h-2 w-full overflow-hidden rounded-full bg-muted`,children:(0,k.jsx)(`div`,{className:g(`h-full rounded-full transition-[width,background-color] duration-200 ease-out`,o?`bg-muted-foreground/35`:a.bar),style:{width:`${o?0:Math.max(i,r>0?12:0)}%`}})})]}),(0,k.jsx)(`ul`,{className:`flex flex-col gap-1.5`,"aria-label":`Password requirements`,children:n.map(e=>(0,k.jsxs)(`li`,{className:g(`flex items-center gap-2 text-xs transition-colors`,e.met?`text-foreground`:`text-muted-foreground`),children:[(0,k.jsx)(p,{icon:e.met?Ho:Uo,size:14,color:`currentColor`,strokeWidth:1.5,className:g(e.met?`text-emerald-600 dark:text-emerald-400`:`text-muted-foreground/60`),"aria-hidden":!0}),(0,k.jsxs)(`span`,{children:[(0,k.jsx)(`span`,{className:`sr-only`,children:e.met?`Met: `:`Not met: `}),e.label]})]},e.id))})]})}var nO=qE({claimCode:gE().min(1,`Claim code is required.`),name:gE().min(1,`Name is required.`),email:gE().email(`Enter a valid email.`),password:gE().min(12,`Password must be at least 12 characters.`).refine(e=>XD(e).every(e=>e.met),{message:`Password needs uppercase, lowercase, a number, and a special character.`})});function rO(...e){let t=e.filter(e=>typeof e==`string`&&e.length>0).join(` `);return t.length>0?t:void 0}function iO(){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`span`,{className:`text-destructive`,"aria-hidden":!0,children:[` `,`*`]}),(0,k.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})}function aO({children:e}){return(0,k.jsx)(cv,{children:e})}function oO(){let e=Ie(),t=h(),n=f({from:`/`}),[r,i]=(0,D.useState)(null),[a,o]=(0,D.useState)(0),s=ve({queryKey:[`console.setup.status`],queryFn:async()=>{let e=await $e();if(e.error)throw Error(me(e.error));if(!e.data)throw Error(`Empty setup status`);return e.data},retry:2});(0,D.useEffect)(()=>{s.data?.claimRequired&&Xe(null)},[s.data?.claimRequired]);let c=kt({mutationFn:async e=>{let t=await Se(e);if(t.error)throw Error(me(t.error));if(!t.data)throw Error(`Empty claim response`);return t.data},onSuccess:r=>{u(r),i(null),e.setQueryData([`console.setup.status`],{setupClosed:!0,claimRequired:!1}),window.setTimeout(()=>{Lo(t,n.next)},650)},onError:e=>{i(e.message)}}),l=Iy({defaultValues:{claimCode:``,name:``,email:``,password:``},validators:{onSubmit:nO},onSubmit:async({value:e})=>{i(null),await c.mutateAsync(e)}});return s.isLoading?(0,k.jsx)(aO,{children:(0,k.jsx)(ev,{})}):s.isError?(0,k.jsx)(aO,{children:(0,k.jsx)($_,{title:`Console unreachable`,status:{label:`Offline`,tone:`alert`},description:`Could not reach the setup API.`,children:(0,k.jsx)(`p`,{className:`px-5 pb-6 text-sm text-muted-foreground`,role:`alert`,children:s.error instanceof Error?s.error.message:`Is the Console kernel running on :6533?`})})}):PD({setupClosed:s.data?.setupClosed===!0,claimSucceeded:c.isSuccess})===`login`?(0,k.jsx)(aO,{children:(0,k.jsx)(ND,{})}):(0,k.jsx)(aO,{children:(0,k.jsx)($_,{title:`First admin`,status:{label:`Setup open`,tone:`open`},description:"Enter the claim code from the `oke dev` board, or run `oke console claim-code`. This wizard closes permanently after the first operator.",footer:(0,k.jsx)(J_,{type:`submit`,form:`claim-form`,state:q_({pending:c.isPending,success:c.isSuccess,error:c.isError||r!==null}),loadingText:`Creating`,successText:`Created`,errorText:`Try again`,children:`Create admin account`}),children:({titleId:e,descriptionId:t})=>(0,k.jsxs)(`form`,{id:`claim-form`,className:`flex flex-col`,autoComplete:`off`,noValidate:!0,"aria-labelledby":e,"aria-describedby":t,"aria-busy":c.isPending||void 0,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),l.handleSubmit()},children:[(0,k.jsxs)(TD,{className:H_,role:`group`,"aria-label":`First admin details`,children:[(0,k.jsx)(l.Field,{name:`claimCode`,children:e=>{let t=e.state.meta.isTouched&&!e.state.meta.isValid,n=`${e.name}-error`;return(0,k.jsxs)(DD,{"data-invalid":t||void 0,className:U_,children:[(0,k.jsxs)(OD,{htmlFor:e.name,className:K_,children:[`Claim code`,(0,k.jsx)(iO,{})]}),(0,k.jsx)(m,{id:e.name,name:e.name,type:`text`,inputMode:`text`,value:e.state.value,onBlur:e.handleBlur,onChange:t=>e.handleChange(t.target.value),autoComplete:`off`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,placeholder:`Claim code`,"aria-invalid":t,"aria-required":!0,"aria-describedby":rO(t&&n),required:!0,className:W_}),t?(0,k.jsx)(kD,{id:n,className:G_,errors:e.state.meta.errors}):null]})}}),(0,k.jsx)(l.Field,{name:`name`,children:e=>{let t=e.state.meta.isTouched&&!e.state.meta.isValid,n=`${e.name}-error`;return(0,k.jsxs)(DD,{"data-invalid":t||void 0,className:U_,children:[(0,k.jsxs)(OD,{htmlFor:e.name,className:K_,children:[`Name`,(0,k.jsx)(iO,{})]}),(0,k.jsx)(m,{id:e.name,name:e.name,type:`text`,autoComplete:`name`,value:e.state.value,onBlur:e.handleBlur,onChange:t=>e.handleChange(t.target.value),placeholder:`Name`,"aria-invalid":t,"aria-required":!0,"aria-describedby":rO(t&&n),required:!0,className:W_}),t?(0,k.jsx)(kD,{id:n,className:G_,errors:e.state.meta.errors}):null]})}}),(0,k.jsx)(l.Field,{name:`email`,children:e=>{let t=e.state.meta.isTouched&&!e.state.meta.isValid,n=`${e.name}-error`;return(0,k.jsxs)(DD,{"data-invalid":t||void 0,className:U_,children:[(0,k.jsxs)(OD,{htmlFor:e.name,className:K_,children:[`Email`,(0,k.jsx)(iO,{})]}),(0,k.jsx)(m,{id:e.name,name:e.name,type:`email`,inputMode:`email`,autoComplete:`email`,value:e.state.value,onBlur:e.handleBlur,onChange:t=>e.handleChange(t.target.value),placeholder:`Email`,"aria-invalid":t,"aria-required":!0,"aria-describedby":rO(t&&n),required:!0,className:W_}),t?(0,k.jsx)(kD,{id:n,className:G_,errors:e.state.meta.errors}):null]})}}),(0,k.jsx)(l.Field,{name:`password`,children:e=>{let t=e.state.meta.isTouched&&!e.state.meta.isValid,n=`${e.name}-strength`,r=`${e.name}-error`;return(0,k.jsxs)(DD,{"data-invalid":t||void 0,className:g(U_,`items-start`),children:[(0,k.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5 pt-1.5`,children:[(0,k.jsxs)(OD,{htmlFor:e.name,className:K_,children:[`Password`,(0,k.jsx)(iO,{})]}),(0,k.jsx)(QD,{disabled:c.isPending,onGenerate:t=>{e.handleChange(t),o(e=>e+1)}})]}),(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,k.jsx)(CD,{id:e.name,name:e.name,value:e.state.value,onBlur:e.handleBlur,onChange:t=>e.handleChange(t.target.value),revealNonce:a,minLength:12,autoComplete:`new-password`,placeholder:`Password`,"aria-invalid":t,"aria-required":!0,"aria-describedby":rO(n,t&&r),required:!0,className:W_}),(0,k.jsx)(tO,{id:n,password:e.state.value}),t?(0,k.jsx)(kD,{id:r,errors:e.state.meta.errors}):null]})]})}})]}),r?(0,k.jsx)(`p`,{id:`claim-form-error`,className:`px-5 py-3.5 text-sm text-destructive`,role:`alert`,"aria-live":`assertive`,children:r}):null]})})})}var sO=`okengine Console`,cO={"/overview":`Overview`,"/flows":`Flows`,"/store":`Store`,"/observability":`Observability`,"/vault":`Vault`,"/access":`Access`,"/monitoring":`Observability`};function lO(e){if(e===`/`||e===``)return sO;let t=cO[e];return t?`${t} · ${sO}`:`Not found · ${sO}`}function uO(){let e=wa({select:e=>e.location.pathname});return(0,D.useEffect)(()=>{document.title=lO(e)},[e]),null}function dO(e){return de(e.defaultTagName??`div`,e,e)}var fO=768;function pO(){let[e,t]=D.useState(void 0);return D.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<fO)};return e.addEventListener(`change`,n),t(window.innerWidth<fO),()=>e.removeEventListener(`change`,n)},[]),!!e}var mO=`sidebar_state`,hO=604800,gO=`16rem`,_O=`18rem`,vO=`3rem`,yO=`b`,bO=D.createContext(null);function xO(){let e=D.useContext(bO);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function SO({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o}){let s=pO(),[c,l]=D.useState(!1),[u,d]=D.useState(e),f=t??u,p=D.useCallback(e=>{let t=typeof e==`function`?e(f):e;n?n(t):d(t),document.cookie=`${mO}=${t}; path=/; max-age=${hO}`},[n,f]),m=D.useCallback(()=>s?l(e=>!e):p(e=>!e),[s,p,l]);D.useEffect(()=>{let e=e=>{e.key===yO&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m]);let h=f?`expanded`:`collapsed`,_=D.useMemo(()=>({state:h,open:f,setOpen:p,isMobile:s,openMobile:c,setOpenMobile:l,toggleSidebar:m}),[h,f,p,s,c,l,m]);return(0,k.jsx)(bO.Provider,{value:_,children:(0,k.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":gO,"--sidebar-width-icon":vO,...i},className:g(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...o,children:a})})}function CO({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,dir:a,...o}){let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=xO();return n===`none`?(0,k.jsx)(`div`,{"data-slot":`sidebar`,className:g(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...o,children:i}):s?(0,k.jsx)(Le,{open:l,onOpenChange:u,...o,children:(0,k.jsxs)(Ze,{dir:a,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":_O},side:e,children:[(0,k.jsxs)(Ue,{className:`sr-only`,children:[(0,k.jsx)(pt,{children:`Sidebar`}),(0,k.jsx)(st,{children:`Displays the mobile sidebar.`})]}),(0,k.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,k.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,k.jsx)(`div`,{"data-slot":`sidebar-gap`,className:g(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,k.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:g(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...o,children:(0,k.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:i})})]})}function wO({className:e,onClick:t,...n}){let{toggleSidebar:r}=xO();return(0,k.jsxs)(_t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,className:g(e),onClick:e=>{t?.(e),r()},...n,children:[(0,k.jsx)(p,{icon:es,className:`cn-rtl-flip`}),(0,k.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function TO({className:e,...t}){return(0,k.jsx)(`main`,{"data-slot":`sidebar-inset`,className:g(`relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,e),...t})}function EO({className:e,...t}){return(0,k.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:g(`flex flex-col gap-2 p-2`,e),...t})}function DO({className:e,...t}){return(0,k.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:g(`flex flex-col gap-2 p-2`,e),...t})}function OO({className:e,...t}){return(0,k.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:g(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function kO({className:e,...t}){return(0,k.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:g(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function AO({className:e,render:t,...n}){return dO({defaultTagName:`div`,props:_({className:g(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,e)},n),render:t,state:{slot:`sidebar-group-label`,sidebar:`group-label`}})}function jO({className:e,...t}){return(0,k.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:g(`flex w-full min-w-0 flex-col gap-0`,e),...t})}function MO({className:e,...t}){return(0,k.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:g(`group/menu-item relative`,e),...t})}var NO=ue(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm text-muted-foreground ring-sidebar-ring outline-hidden transition-[width,height,padding,color] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function PO({render:e,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o}){let{isMobile:s,state:c}=xO(),l=dO({defaultTagName:`button`,props:_({className:g(NO({variant:n,size:r}),a)},o),render:i?(0,k.jsx)(ce,{render:e}):e,state:{slot:`sidebar-menu-button`,sidebar:`menu-button`,size:r,active:t}});return i?(typeof i==`string`&&(i={children:i}),(0,k.jsxs)(v,{children:[l,(0,k.jsx)(S,{side:`right`,align:`center`,hidden:c!==`collapsed`||s,...i})]})):l}function FO(e=globalThis.navigator){if(e===void 0)return!1;let t=e.userAgentData?.platform;return typeof t==`string`&&t.length>0?/mac/i.test(t):/Mac|iPhone|iPad|iPod/.test(`${e.platform??``} ${e.userAgent??``}`)}function IO(e){return FO(e)?`⌘`:`Ctrl`}function LO(e,t){return[IO(t),e]}function RO(e,t){return FO(t)?[IO(t),`⇧`,e]:[IO(t),`Shift`,e]}var zO={overview:`1`,flows:`2`,store:`3`,observability:`4`,vault:`5`,access:`6`};function BO(e){return LO(e===`fast`?`K`:e===`settings`?`,`:e===`logout`?`E`:zO[e])}var VO={1:`/overview`,2:`/flows`,3:`/store`,4:`/observability`,5:`/vault`,6:`/access`};function HO(e){if(e===null||typeof HTMLElement>`u`||!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.closest(`[role="dialog"], [data-slot="command-palette"]`)!==null}var UO=`rounded-none! justify-center data-active:bg-muted/70! data-active:text-foreground group-data-[collapsible=icon]:h-10! group-data-[collapsible=icon]:w-full! group-data-[collapsible=icon]:p-0!`;function WO({onFast:e,onSettings:t,onLogout:n}){let{isMobile:r,setOpenMobile:i}=xO(),a=()=>{r&&i(!1)};return(0,k.jsxs)(jO,{className:`items-stretch gap-0`,children:[(0,k.jsx)(GO,{label:`Fast`,keys:BO(`fast`),icon:Wo,slot:`sidebar-fast`,onClick:()=>{a(),e()}}),(0,k.jsx)(GO,{label:`Settings`,keys:BO(`settings`),icon:Zo,slot:`sidebar-settings`,onClick:()=>{a(),t()}}),(0,k.jsx)(GO,{label:`Logout`,keys:BO(`logout`),icon:Jo,slot:`sidebar-logout`,danger:!0,onClick:()=>{a(),n()}})]})}function GO({label:e,keys:t,icon:n,slot:r,danger:i,onClick:a}){return(0,k.jsx)(MO,{className:`w-full`,children:(0,k.jsxs)(PO,{tooltip:t?{children:(0,k.jsx)(Je,{label:e,keys:t})}:e,onClick:a,"data-slot":r,className:g(UO,i?`hover:bg-destructive/10! hover:text-destructive`:`hover:bg-muted/50! hover:text-foreground`),children:[(0,k.jsx)(p,{icon:n}),(0,k.jsx)(`span`,{className:`sr-only`,children:e})]})})}var KO=[`/overview`,`/flows`,`/store`,`/observability`,`/vault`,`/access`],qO=`oke.console.last-module-search`;function JO(e){return KO.includes(e)}function YO(e){return typeof e!=`object`||!e||Array.isArray(e)?{}:{...e}}function XO(e,t){if(e===void 0)return Object.keys(t).length===0;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>e[n]===t[n])}function ZO(e,t,n){let r=t===`/monitoring`?`/observability`:t;return!JO(r)||XO(e[r],n)?e:{...e,[r]:{...n}}}function QO(e,t){return e[t]??{}}function $O(e){if(e===null||e.length===0)return{};try{let t=JSON.parse(e);if(typeof t!=`object`||!t||Array.isArray(t))return{};let n={},r=t;for(let e of KO){let t=r[e];t&&typeof t==`object`&&!Array.isArray(t)&&(n[e]={...t})}let i=r[`/monitoring`];return n[`/observability`]===void 0&&i&&typeof i==`object`&&!Array.isArray(i)&&(n[`/observability`]={...i}),n}catch{return{}}}function ek(e=nk()){if(!e)return{};try{return $O(e.getItem(qO))}catch{return{}}}function tk(e,t=nk()){if(t)try{t.setItem(qO,JSON.stringify(e))}catch{}}function nk(){try{return typeof sessionStorage>`u`?null:sessionStorage}catch{return null}}function rk(){let e=wa({select:e=>({pathname:e.location.pathname,search:e.location.search})}),[t,n]=(0,D.useState)(ek);return(0,D.useEffect)(()=>{if(!JO(e.pathname))return;let t=YO(e.search);n(n=>{let r=ZO(n,e.pathname,t);return r===n?n:(tk(r),r)})},[e.pathname,e.search]),t}var ik=`rounded-none! justify-center hover:bg-muted/50! hover:text-foreground data-active:bg-muted/70! data-active:text-foreground group-data-[collapsible=icon]:h-10! group-data-[collapsible=icon]:w-full! group-data-[collapsible=icon]:p-0!`,ak=[{title:`Overview`,to:`/overview`,icon:is,shortcut:`overview`},{title:`Flows`,to:`/flows`,icon:Qo,shortcut:`flows`},{title:`Store`,to:`/store`,icon:zo,shortcut:`store`},{title:`Observability`,to:`/observability`,icon:Vo,shortcut:`observability`},{title:`Vault`,to:`/vault`,icon:Ro,shortcut:`vault`},{title:`Access`,to:`/access`,icon:Bo,shortcut:`access`}];function ok(){return(0,k.jsx)(`div`,{className:`flex w-full items-center justify-center px-0`,children:(0,k.jsx)(sv,{className:`size-5`})})}function sk({onFast:e,onSettings:t,onLogout:n,...r}){let i=wa({select:e=>e.location.pathname}),a=rk();return(0,k.jsxs)(CO,{collapsible:`icon`,...r,children:[(0,k.jsx)(EO,{className:`h-10 justify-center border-b border-border/60 p-0`,children:(0,k.jsx)(ok,{})}),(0,k.jsx)(OO,{children:(0,k.jsxs)(kO,{className:`items-stretch p-0`,children:[(0,k.jsx)(AO,{children:`Console`}),(0,k.jsx)(jO,{className:`items-stretch gap-0`,children:ak.map(e=>(0,k.jsx)(MO,{className:`w-full`,children:(0,k.jsxs)(PO,{render:(0,k.jsx)(Qi,{to:e.to,search:QO(a,e.to)}),isActive:i===e.to,tooltip:{children:(0,k.jsx)(Je,{label:e.title,keys:BO(e.shortcut)})},className:ik,children:[(0,k.jsx)(p,{icon:e.icon}),(0,k.jsx)(`span`,{className:`sr-only`,children:e.title})]})},e.to))})]})}),(0,k.jsx)(DO,{className:`border-t border-border/60 p-0`,children:(0,k.jsx)(WO,{onFast:e,onSettings:t,onLogout:n})})]})}var ck=[{title:`Overview`,to:`/overview`,icon:is,keywords:[`home`,`traces`],shortcut:`overview`},{title:`Flows`,to:`/flows`,icon:Qo,keywords:[`units`,`call`],shortcut:`flows`},{title:`Store`,to:`/store`,icon:zo,keywords:[`sql`,`kv`,`files`],shortcut:`store`},{title:`Observability`,to:`/observability`,icon:Vo,keywords:[`runs`,`metrics`,`monitoring`],shortcut:`observability`},{title:`Vault`,to:`/vault`,icon:Ro,keywords:[`secrets`,`contracts`],shortcut:`vault`},{title:`Access`,to:`/access`,icon:Bo,keywords:[`keys`,`api`,`scopes`],shortcut:`access`}];function lk(e){let t=ck.map(t=>({id:`go:${t.to}`,label:t.title,group:`Navigate`,keys:BO(t.shortcut),keywords:t.keywords,icon:t.icon,onSelect:()=>e.go(t.to,QO(e.memory,t.to))})),n=[{id:`theme:light`,label:`Light`,group:`Appearance`,keywords:[`theme`,`day`],icon:ts,onSelect:()=>e.setTheme(`light`)},{id:`theme:dark`,label:`Dark`,group:`Appearance`,keywords:[`theme`,`night`],icon:Yo,onSelect:()=>e.setTheme(`dark`)},{id:`theme:system`,label:`System`,group:`Appearance`,keywords:[`theme`,`auto`],icon:Go,onSelect:()=>e.setTheme(`system`)}],r=[{id:`settings`,label:`Settings`,group:`Account`,keys:BO(`settings`),keywords:[`preferences`,`operator`],icon:Zo,onSelect:e.openSettings},{id:`logout`,label:`Logout`,group:`Account`,keys:BO(`logout`),keywords:[`sign out`,`exit`],icon:Jo,onSelect:e.logout}];return[...t,...n,...r]}var uk=e(t(),1);function dk(e,t){if(e.length===0)return!0;let n=e.toLowerCase(),r=t.toLowerCase(),i=0;for(let e of r)if(e===n[i]&&(i+=1),i===n.length)return!0;return!1}function fk(e,t){return t.length===0?e:e.filter(e=>[e.label,e.group??``,...e.keywords??[]].some(e=>dk(t,e)))}var pk=`h-auto min-w-0 bg-transparent px-0 font-mono text-[10px] tracking-[0.08em] text-muted-foreground`,mk={type:`spring`,stiffness:560,damping:40,mass:.5};function hk({items:e,shortcut:t=`k`,placeholder:n=`Type a command or search…`,emptyMessage:r=`No results found.`,open:i,onOpenChange:a}){let[o,s]=(0,D.useState)(!1),c=i!==void 0,l=c?i:o,u=(0,D.useCallback)(e=>{c||s(e),a?.(e)},[c,a]),[f,m]=(0,D.useState)(``),[h,_]=(0,D.useState)(0),[v,y]=(0,D.useState)(!1);(0,D.useEffect)(()=>y(!0),[]);let b=(0,D.useId)(),x=P_(),S=(0,D.useCallback)(e=>{m(e),_(0)},[]),C=(0,D.useRef)(null),w=(0,D.useRef)(null);(0,D.useEffect)(()=>{let e=e=>{if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===t.toLowerCase()){e.preventDefault(),u(!l);return}e.key===`Escape`&&l&&(e.preventDefault(),u(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[l,t,u]),(0,D.useEffect)(()=>{l&&(S(``),_(0),requestAnimationFrame(()=>C.current?.focus()))},[l,S]),(0,D.useEffect)(()=>{if(!l)return;let e=document.documentElement,t=e.style.overflow,n=document.body.style.overflow;return e.style.overflow=`hidden`,document.body.style.overflow=`hidden`,()=>{e.style.overflow=t,document.body.style.overflow=n}},[l]);let T=(0,D.useMemo)(()=>fk(e,f),[e,f]),ee=(0,D.useMemo)(()=>e.some(e=>e.icon!==void 0),[e]),te=(0,D.useMemo)(()=>{let e=new Map;for(let t of T){let n=t.group??`Results`,r=e.get(n)??[];r.push(t),e.set(n,r)}return Array.from(e.entries())},[T]),ne=e=>{if(T.length!==0){if(e.key===`ArrowDown`)e.preventDefault(),_(e=>Math.min(T.length-1,e+1));else if(e.key===`ArrowUp`)e.preventDefault(),_(e=>Math.max(0,e-1));else if(e.key===`Enter`){e.preventDefault();let t=T[h];t&&(t.onSelect(),u(!1))}}};if((0,D.useEffect)(()=>{l&&(w.current?.querySelector(`[data-index="${h}"]`))?.scrollIntoView({block:`nearest`})},[h,l]),!v)return null;let re=0,ie=LO(t.toUpperCase());return(0,uk.createPortal)((0,k.jsxs)(`div`,{"aria-hidden":!l,inert:!l,"data-slot":`command-palette`,className:g(`fixed inset-0 z-100 flex items-start justify-center px-4 pt-[12vh]`,l?`pointer-events-auto`:`pointer-events-none`),children:[(0,k.jsx)(F_.button,{type:`button`,"aria-label":`Close command palette`,initial:!1,animate:{opacity:+!!l},transition:{duration:l?.18:.12},onClick:()=>u(!1),className:g(`absolute inset-0 bg-black/20`,l?`pointer-events-auto`:`pointer-events-none`)}),(0,k.jsxs)(F_.div,{role:`dialog`,"aria-modal":`true`,"aria-label":`Command palette`,initial:!1,animate:{opacity:+!!l,y:l||x?0:-8,scale:l||x?1:.97},transition:x?{duration:.1}:l?mk:{duration:.12},onKeyDown:ne,className:g(`relative w-full max-w-xl overflow-hidden rounded-none border border-border bg-popover text-popover-foreground shadow-lg will-change-transform`,l?`pointer-events-auto`:`pointer-events-none`),children:[(0,k.jsxs)(`div`,{className:d,children:[(0,k.jsx)(`span`,{className:g(De,`pointer-events-none`),children:(0,k.jsx)(p,{icon:Xo,className:Ge})}),(0,k.jsx)(`input`,{ref:C,value:f,onChange:e=>S(e.target.value),placeholder:n,tabIndex:l?0:-1,role:`combobox`,"aria-expanded":l,"aria-controls":`${b}-list`,"aria-activedescendant":T.length>0?`${b}-opt-${h}`:void 0,"aria-autocomplete":`list`,className:Pe}),(0,k.jsxs)(`span`,{className:`flex h-full shrink-0 items-center gap-2 pr-2`,children:[(0,k.jsx)(`span`,{className:`inline-flex items-center gap-0.5`,children:ie.map(e=>(0,k.jsx)(it,{className:pk,children:e},e))}),(0,k.jsx)(it,{className:pk,children:`Esc`})]})]}),(0,k.jsx)(`div`,{ref:w,id:`${b}-list`,role:`listbox`,"aria-label":`Commands`,className:`max-h-[60vh] overflow-y-auto overscroll-contain`,children:T.length===0?(0,k.jsx)(`p`,{className:ht,children:r}):te.map(([e,t])=>(0,k.jsxs)(`div`,{className:`border-b border-border/60 last:border-b-0`,children:[(0,k.jsx)(`div`,{"aria-hidden":!0,className:g(gt,`px-2 py-1.5`),children:e}),t.map(e=>{let t=re;re+=1;let n=t===h,r=e.icon;return(0,k.jsxs)(`button`,{type:`button`,id:`${b}-opt-${t}`,role:`option`,"aria-selected":n,"data-index":t,onMouseEnter:()=>_(t),onClick:()=>{e.onSelect(),u(!1)},tabIndex:l?0:-1,className:g(qe,`border-b-0`,n&&`bg-muted/70 text-foreground`),children:[n?(0,k.jsx)(`span`,{className:g(tt,Ne)}):null,r?(0,k.jsx)(p,{icon:r,className:`relative z-10 size-3.5 shrink-0 text-muted-foreground`}):ee?(0,k.jsx)(`span`,{className:`size-3.5 shrink-0`}):null,(0,k.jsx)(`span`,{className:`relative z-10 min-w-0 flex-1 truncate`,children:e.label}),e.badge?(0,k.jsx)(`span`,{className:`relative z-10 shrink-0 text-[10px] text-muted-foreground`,children:e.badge}):null,e.keys&&e.keys.length>0?(0,k.jsx)(ut,{keys:e.keys,className:`relative z-10`}):e.hint?(0,k.jsx)(`span`,{className:`relative z-10 shrink-0 text-[10px] text-muted-foreground`,children:e.hint}):null]},e.id)})]},e))})]})]}),document.body)}function gk({...e}){return(0,k.jsx)(je,{"data-slot":`dialog`,...e})}function _k({...e}){return(0,k.jsx)(Fe,{"data-slot":`dialog-portal`,...e})}function vk({className:e,...t}){return(0,k.jsx)(we,{"data-slot":`dialog-overlay`,className:g(`fixed inset-0 z-50 bg-black/20 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs`,e),...t})}function yk({className:e,children:t,...n}){return(0,k.jsxs)(_k,{children:[(0,k.jsx)(vk,{}),(0,k.jsx)(be,{"data-slot":`dialog-content`,className:g(`fixed top-1/2 left-1/2 z-50 w-[min(100%-2rem,24rem)] -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-none border border-border bg-popover text-sm text-popover-foreground shadow-lg outline-none transition duration-150 data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0`,e),...n,children:t})]})}function bk({className:e,...t}){return(0,k.jsx)(`div`,{"data-slot":`dialog-header`,className:g(`flex flex-col gap-1 border-b border-border/60 px-4 py-3`,e),...t})}function xk({className:e,...t}){return(0,k.jsx)(Oe,{"data-slot":`dialog-title`,className:g(`text-sm font-medium text-foreground`,e),...t})}function Sk({className:e,...t}){return(0,k.jsx)(yt,{"data-slot":`dialog-description`,className:g(`text-[11px] text-muted-foreground`,e),...t})}function Ck({open:e,onOpenChange:t,operator:n}){return(0,k.jsx)(gk,{open:e,onOpenChange:t,children:(0,k.jsxs)(yk,{"data-slot":`settings-dialog`,children:[(0,k.jsxs)(bk,{children:[(0,k.jsx)(xk,{children:`Settings`}),(0,k.jsx)(Sk,{children:`Operator account and appearance.`})]}),(0,k.jsxs)(`dl`,{className:`flex flex-col`,children:[(0,k.jsx)(wk,{label:`Name`,value:n.name}),(0,k.jsx)(wk,{label:`Email`,value:n.email}),(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-4 py-2`,children:[(0,k.jsx)(`dt`,{className:gt,children:`Theme`}),(0,k.jsx)(`dd`,{children:(0,k.jsx)(av,{})})]})]})]})})}function wk({label:e,value:t}){return(0,k.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 border-b border-border/60 px-4 py-2`,children:[(0,k.jsx)(`dt`,{className:gt,children:e}),(0,k.jsx)(`dd`,{className:`min-w-0 truncate text-xs text-foreground`,children:t})]})}async function Tk(){try{await Ae()}finally{Xe(null)}}function Ek(e){let t=(0,D.useRef)(e);t.current=e,(0,D.useEffect)(()=>{let e=e=>{let{enabled:n,go:r,openSettings:i,logout:a}=t.current;if(!n||e.repeat||HO(e.target)||!(e.metaKey||e.ctrlKey)||e.altKey)return;if(e.key===`,`){e.preventDefault(),i();return}if(e.key.toLowerCase()===`e`){e.preventDefault(),a();return}let o=VO[e.key];o&&(e.preventDefault(),r(o))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[])}function Dk({operator:e}){let t=wa({select:e=>e.location.pathname}),n=h(),r=rk(),{setTheme:i}=rv(),[a,o]=(0,D.useState)(!1),[s,c]=(0,D.useState)(!1),l=t===`/overview`||t===`/flows`||t===`/store`||t===`/vault`||t===`/access`||t===`/observability`,u=(0,D.useCallback)(()=>{Tk().then(()=>{n({to:`/`})})},[n]),d=(0,D.useCallback)((e,t)=>{n({to:e,search:t})},[n]),f=(0,D.useMemo)(()=>lk({memory:r,go:d,openSettings:()=>o(!0),logout:u,setTheme:i}),[d,u,r,i]);return Ek({enabled:!s&&!a,go:e=>d(e,QO(r,e)),openSettings:()=>o(!0),logout:u}),(0,k.jsxs)(SO,{open:!1,className:l?`h-svh max-h-svh overflow-hidden`:void 0,children:[(0,k.jsx)(sk,{onFast:()=>c(!0),onSettings:()=>o(!0),onLogout:u}),(0,k.jsx)(TO,{className:l?`min-h-0 max-h-svh overflow-hidden`:void 0,children:(0,k.jsxs)(`div`,{className:g(`flex flex-col`,l?`h-svh max-h-svh min-h-0 overflow-hidden`:`flex-1 gap-4 p-4`),children:[(0,k.jsx)(wO,{className:`-ml-1 md:hidden`}),(0,k.jsx)(ma,{})]})}),(0,k.jsx)(Ck,{open:a,onOpenChange:o,operator:e}),(0,k.jsx)(hk,{open:s,onOpenChange:c,items:f})]})}var Ok=`modulepreload`,kk=function(e){return`/`+e},Ak={},jk=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},i=function(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href},a=document.getElementsByTagName(`link`),o=document.querySelector(`meta[property=csp-nonce]`),s=o?.nonce||o?.getAttribute(`nonce`);r=e(t.map(e=>{if(e=kk(e,n),e=i(e),e in Ak)return;Ak[e]=!0;let t=e.endsWith(`.css`);for(let n=a.length-1;n>=0;n--){let r=a[n];if(r.href===e&&(!t||r.rel===`stylesheet`))return}let r=document.createElement(`link`);if(r.rel=t?`stylesheet`:Ok,t||(r.as=`script`),r.crossOrigin=``,r.href=e,s&&r.setAttribute(`nonce`,s),document.head.appendChild(r),t)return new Promise((t,n)=>{r.addEventListener(`load`,t),r.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${e}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};async function Mk({location:e}){let t=Fo(`${e.pathname}${e.searchStr}`);if(!rt())throw zn({to:`/`,search:t});let n=await ft();if(n.error||!n.data)throw Xe(null),zn({to:`/`,search:t});let r={operatorId:n.data.operatorId,email:n.data.email,name:n.data.name};return ze(r),{operator:r}}var Nk=na({component:function(){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(uO,{}),(0,k.jsx)(ma,{})]})}}),Pk=ea({getParentRoute:()=>Nk,path:`/`,validateSearch:Po,component:oO}),Fk=ea({getParentRoute:()=>Nk,id:`authenticated`,beforeLoad:Mk,component:function(){let{operator:e}=Fk.useRouteContext();return(0,k.jsx)(Dk,{operator:e})}}),Ik=ea({getParentRoute:()=>Fk,path:`/overview`,validateSearch:lo,component:ra(()=>jk(()=>import(`./flows-page-Dss7941e.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])),`FlowsPage`)}),Lk=ea({getParentRoute:()=>Fk,path:`/flows`,validateSearch:mo,component:ra(()=>jk(()=>import(`./units-page-B_RWJrEO.js`),__vite__mapDeps([19,1,2,3,4,5,20,6,11,12,7,9,10,13,14,21,22,23,24,17])),`UnitsPage`)}),Rk=ea({getParentRoute:()=>Fk,path:`/store`,validateSearch:fo,component:ra(()=>jk(()=>import(`./store-page-eiKiHnNe.js`),__vite__mapDeps([25,1,2,3,4,5,20,6,7,8,9,26,27,12,14,21,22,28,16,23,24,29,18])),`StorePage`)}),zk=ea({getParentRoute:()=>Fk,path:`/vault`,validateSearch:wo,component:ra(()=>jk(()=>import(`./vault-page-CWrg-A68.js`),__vite__mapDeps([30,1,2,3,4,5,6,7,27,28,16,13,22,23,24,29,31])),`VaultPage`)}),Bk=ea({getParentRoute:()=>Fk,path:`/access`,validateSearch:Eo,component:ra(()=>jk(()=>import(`./access-page-DFeymU07.js`),__vite__mapDeps([32,1,2,3,4,5,11,6,12,16,23,24,29])),`AccessPage`)}),Vk=ea({getParentRoute:()=>Fk,path:`/observability`,validateSearch:So,component:ra(()=>jk(()=>import(`./observability-page-HvolXxTI.js`),__vite__mapDeps([33,1,2,3,4,5,20,6,7,8,9,26,27,10,11,12,13,15,16,23,31])),`ObservabilityPage`)}),Hk=ea({getParentRoute:()=>Fk,path:`/monitoring`,validateSearch:So,beforeLoad:({search:e})=>{throw zn({to:`/observability`,search:e})}}),Uk=ba({routeTree:Nk.addChildren([Pk,Fk.addChildren([Ik,Lk,Rk,zk,Bk,Vk,Hk])]),defaultNotFoundComponent:lv,defaultPendingComponent:()=>(0,k.jsx)(`div`,{className:`grid min-h-dvh place-items-center text-sm text-muted-foreground`,children:`Loading…`})});ot(e=>{let t=e.split(`?`)[0]??``;t!==`/`&&t!==``&&Uk.navigate({to:`/`,search:Fo(e)})}),_e();var Wk=new Ot({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1}}}),Gk=document.getElementById(`root`);if(!Gk)throw Error(`Missing #root`);(0,co.createRoot)(Gk).render((0,k.jsx)(D.StrictMode,{children:(0,k.jsx)(nv,{defaultTheme:`system`,storageKey:`oke-console-theme`,children:(0,k.jsx)(ee,{delay:0,children:(0,k.jsx)(Ke,{client:Wk,children:(0,k.jsx)(so,{children:(0,k.jsx)(Ca,{router:Uk})})})})})}));export{os as $,Gl as A,Rs as B,z as C,$u as D,nd as E,vl as F,gs as G,Ds as H,L as I,fs as J,ms as K,ic as L,Ml as M,jl as N,td as O,Ol as P,cs as Q,M as R,Ad as S,rd as T,ys as U,ks as V,vs as W,as as X,ds as Y,ls as Z,B as _,po as _t,ov as a,qo as at,nf as b,kt as bt,F_ as c,Do as ct,Bh as d,go as dt,ss as et,Xm as f,yo as ft,qf as g,ho as gt,lp as h,xo as ht,dO as i,Xo as it,Nl as j,Au as k,P_ as l,To as lt,Gp as m,bo as mt,LO as n,ns as nt,rv as o,Uo as ot,tm as p,vo as pt,ps as q,RO as r,Zo as rt,B_ as s,Ho as st,jk as t,rs as tt,Vh as u,Co as ut,Vf as v,uo as vt,dd as w,ef as x,Tf as y,Qi as yt,Ys as z};
|