titan-agent 6.5.2 → 7.0.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/README.md +180 -53
- package/assets/agent-skills/NOTICE-ECC.md +39 -0
- package/assets/agent-skills/agent-introspection-debugging/SKILL.md +153 -0
- package/assets/agent-skills/continuous-agent-loop/SKILL.md +45 -0
- package/assets/agent-skills/continuous-learning/SKILL.md +131 -0
- package/assets/agent-skills/continuous-learning/config.json +18 -0
- package/assets/agent-skills/continuous-learning/evaluate-session.sh +69 -0
- package/assets/agent-skills/production-audit/SKILL.md +206 -0
- package/assets/agent-skills/recursive-decision-ledger/SKILL.md +79 -0
- package/assets/agent-skills/scientific-thinking-literature-review/SKILL.md +192 -0
- package/assets/agent-skills/scientific-thinking-scholar-evaluation/SKILL.md +160 -0
- package/assets/agent-skills/verification-loop/SKILL.md +126 -0
- package/dist/agent/agent.js +67 -26
- package/dist/agent/agent.js.map +1 -1
- package/dist/agent/agentLoop.js +6 -2
- package/dist/agent/agentLoop.js.map +1 -1
- package/dist/agent/autoModeClassifier.js +26 -2
- package/dist/agent/autoModeClassifier.js.map +1 -1
- package/dist/agent/goalDriver.js +2 -0
- package/dist/agent/goalDriver.js.map +1 -1
- package/dist/agent/goalSpec.js +229 -0
- package/dist/agent/goalSpec.js.map +1 -0
- package/dist/agent/heartbeat.js +130 -0
- package/dist/agent/heartbeat.js.map +1 -0
- package/dist/agent/missionDecompose.js +38 -0
- package/dist/agent/missionDecompose.js.map +1 -0
- package/dist/agent/muscleMemory.js +291 -0
- package/dist/agent/muscleMemory.js.map +1 -0
- package/dist/agent/observationWriter.js +56 -0
- package/dist/agent/observationWriter.js.map +1 -0
- package/dist/agent/promptSectionCaps.js +6 -0
- package/dist/agent/promptSectionCaps.js.map +1 -1
- package/dist/agent/reminders.js +101 -0
- package/dist/agent/reminders.js.map +1 -0
- package/dist/agent/systemWidgets.js +41 -0
- package/dist/agent/systemWidgets.js.map +1 -0
- package/dist/agent/toolRunner.js +24 -0
- package/dist/agent/toolRunner.js.map +1 -1
- package/dist/agent/toolSearch.js +3 -0
- package/dist/agent/toolSearch.js.map +1 -1
- package/dist/channels/messenger.js +39 -0
- package/dist/channels/messenger.js.map +1 -1
- package/dist/config/config.js +7 -0
- package/dist/config/config.js.map +1 -1
- package/dist/config/schema.js +18 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/eval/harness.js +13 -3
- package/dist/eval/harness.js.map +1 -1
- package/dist/gateway/onboarding.js +91 -0
- package/dist/gateway/onboarding.js.map +1 -0
- package/dist/gateway/routes/skills.js +2 -1
- package/dist/gateway/routes/skills.js.map +1 -1
- package/dist/gateway/routes/studioRouter.js +88 -0
- package/dist/gateway/routes/studioRouter.js.map +1 -0
- package/dist/gateway/routes/watchRouter.js +4 -4
- package/dist/gateway/routes/watchRouter.js.map +1 -1
- package/dist/gateway/server.js +251 -43
- package/dist/gateway/server.js.map +1 -1
- package/dist/memory/taxonomy.js +117 -0
- package/dist/memory/taxonomy.js.map +1 -0
- package/dist/providers/modelCapabilities.js +13 -0
- package/dist/providers/modelCapabilities.js.map +1 -1
- package/dist/providers/ollama.js +8 -2
- package/dist/providers/ollama.js.map +1 -1
- package/dist/providers/openai.js +1 -1
- package/dist/providers/openai.js.map +1 -1
- package/dist/providers/openai_compat.js +38 -2
- package/dist/providers/openai_compat.js.map +1 -1
- package/dist/providers/router.js +14 -0
- package/dist/providers/router.js.map +1 -1
- package/dist/recipes/runner.js +8 -1
- package/dist/recipes/runner.js.map +1 -1
- package/dist/recipes/store.js +2 -1
- package/dist/recipes/store.js.map +1 -1
- package/dist/skills/builtin/codebase_explore.js +214 -0
- package/dist/skills/builtin/codebase_explore.js.map +1 -0
- package/dist/skills/builtin/config_audit.js +160 -0
- package/dist/skills/builtin/config_audit.js.map +1 -0
- package/dist/skills/builtin/delegate_agent.js +107 -0
- package/dist/skills/builtin/delegate_agent.js.map +1 -0
- package/dist/skills/builtin/memory_map.js +38 -0
- package/dist/skills/builtin/memory_map.js.map +1 -0
- package/dist/skills/builtin/reminders.js +67 -0
- package/dist/skills/builtin/reminders.js.map +1 -0
- package/dist/skills/builtin/spec.js +139 -0
- package/dist/skills/builtin/spec.js.map +1 -0
- package/dist/skills/builtin/widget_gallery.js +12 -5
- package/dist/skills/builtin/widget_gallery.js.map +1 -1
- package/dist/skills/frontmatterLoader.js +7 -1
- package/dist/skills/frontmatterLoader.js.map +1 -1
- package/dist/skills/registry.js +12 -0
- package/dist/skills/registry.js.map +1 -1
- package/dist/substrate/traceBus.js.map +1 -1
- package/dist/telemetry/traceStore.js +127 -0
- package/dist/telemetry/traceStore.js.map +1 -0
- package/dist/utils/constants.js +1 -1
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/contrast.js +69 -0
- package/dist/utils/contrast.js.map +1 -0
- package/dist/watch/sessionContext.js +14 -0
- package/dist/watch/sessionContext.js.map +1 -0
- package/dist/watch/sessionTrace.js +51 -0
- package/dist/watch/sessionTrace.js.map +1 -0
- package/dist/watch/studioBuffer.js +53 -0
- package/dist/watch/studioBuffer.js.map +1 -0
- package/package.json +4 -3
- package/ui/dist/assets/AboutYouMemory-CZKEOd_O.js +11 -0
- package/ui/dist/assets/AuditPanel-Bu71N5Er.js +1 -0
- package/ui/dist/assets/{AutonomyPanel-CmaXJV8d.js → AutonomyPanel-DB-39dX4.js} +2 -2
- package/ui/dist/assets/{AutopilotPanel-CbohPtXW.js → AutopilotPanel-Cj8oKxWv.js} +1 -1
- package/ui/dist/assets/{AutoresearchPanel-DCwiQ2v2.js → AutoresearchPanel-3s8pjm6Z.js} +2 -2
- package/ui/dist/assets/BackupPanel-EUQJMJE7.js +1 -0
- package/ui/dist/assets/{BrowserPanel-D6UaSxap.js → BrowserPanel-Beo4F5Ar.js} +2 -2
- package/ui/dist/assets/Button-MdXmb4_n.js +1 -0
- package/ui/dist/assets/CPActivity-B1Se9VVc.js +1 -0
- package/ui/dist/assets/CPAgentDetail-BYji6tT8.js +1 -0
- package/ui/dist/assets/CPAgents-BSUKucTe.js +1 -0
- package/ui/dist/assets/CPApprovals-B4v0em6e.js +1 -0
- package/ui/dist/assets/CPCosts-9ikh61Kv.js +1 -0
- package/ui/dist/assets/CPDashboard-sOok2T5v.js +1 -0
- package/ui/dist/assets/{CPFiles-BO73EZwJ.js → CPFiles-DB2nY5JE.js} +1 -1
- package/ui/dist/assets/CPGoals-8Z1yOY8e.js +1 -0
- package/ui/dist/assets/CPInbox-Cq6-UY8F.js +11 -0
- package/ui/dist/assets/CPIssueDetail-NAGfmJg8.js +1 -0
- package/ui/dist/assets/CPIssues-BzX6Rckx.js +1 -0
- package/ui/dist/assets/CPLayout-BcRM6QSg.js +2 -0
- package/ui/dist/assets/CPOrg-B7DQ4UQP.js +1 -0
- package/ui/dist/assets/CPRuns-D-cpPw_M.js +1 -0
- package/ui/dist/assets/{CPSocial-Qw5rKy_4.js → CPSocial-DshtmcK0.js} +3 -3
- package/ui/dist/assets/CPVoice-DfXRnQVU.js +1 -0
- package/ui/dist/assets/{ChannelsPanel-DS21E-Iz.js → ChannelsPanel-BnaTOeyf.js} +1 -1
- package/ui/dist/assets/CheckpointsPanel-C62naE4U.js +1 -0
- package/ui/dist/assets/CommandPostHub-B_L1CAss.js +24 -0
- package/ui/dist/assets/ConfirmDialog-VErHWAbo.js +1 -0
- package/ui/dist/assets/CronPanel-BwMrrZ5d.js +1 -0
- package/ui/dist/assets/{DataTable-PnhPeDBG.js → DataTable-BCqSUuN7.js} +1 -1
- package/ui/dist/assets/{DreamPanel-DIrtlk2K.js → DreamPanel-BNAcCLBB.js} +2 -2
- package/ui/dist/assets/EmptyState-D9kQf1PX.js +1 -0
- package/ui/dist/assets/{EvalHarnessPanel-uYb_ZEQG.js → EvalHarnessPanel-BaMLdBNm.js} +2 -2
- package/ui/dist/assets/EvalPanel-CW-SSjtg.js +1 -0
- package/ui/dist/assets/{FileViewer-CVO3TRs3.js → FileViewer-BL00nsd7.js} +1 -1
- package/ui/dist/assets/FilesPanel-CeC6YUSd.js +16 -0
- package/ui/dist/assets/FleetPanel-EyWF7l3W.js +1 -0
- package/ui/dist/assets/{HomelabPanel-BZvN4LPM.js → HomelabPanel-BRfKRYe7.js} +2 -2
- package/ui/dist/assets/InfraView-Jmqhg_Yc.js +2 -0
- package/ui/dist/assets/{InlineEditableField-mBzpbcLB.js → InlineEditableField-DgMrLDj1.js} +1 -1
- package/ui/dist/assets/Input-CBTwa_Iw.js +1 -0
- package/ui/dist/assets/IntegrationsPanel-DQL-7Ec6.js +1 -0
- package/ui/dist/assets/IntelligenceView-DxD78qfP.js +2 -0
- package/ui/dist/assets/LearningPanel-C_JzSbJU.js +1 -0
- package/ui/dist/assets/LiveStudio-Db5yeaWo.js +7 -0
- package/ui/dist/assets/{LogsPanel-DbP3Mwnr.js → LogsPanel-CpinKwaZ.js} +1 -1
- package/ui/dist/assets/McpPanel-D-MqN_f-.js +1 -0
- package/ui/dist/assets/MemoryGraphPanel-BnD5jRqf.js +1 -0
- package/ui/dist/assets/MemoryTaxonomyPanel-BBI202dd.js +6 -0
- package/ui/dist/assets/MemoryWikiPanel-Dn3XZHL0.js +6 -0
- package/ui/dist/assets/{MeshPanel-Bf-4brXL.js → MeshPanel-C-mRJpr0.js} +1 -1
- package/ui/dist/assets/{MissionCanvas-CJyhnauG.js → MissionCanvas-CbZW83Ch.js} +1 -1
- package/ui/dist/assets/{MissionChat-C2Nto3zM.js → MissionChat-Bs75jPAD.js} +1 -1
- package/ui/dist/assets/{MissionLibrary-RXyBHsLL.js → MissionLibrary-BxQ6SxPe.js} +1 -1
- package/ui/dist/assets/MissionStart-CBuBPasl.js +1 -0
- package/ui/dist/assets/Modal-ybPGvlQs.js +9 -0
- package/ui/dist/assets/{NvidiaPanel-4DlcQlyl.js → NvidiaPanel-DdG13OX4.js} +1 -1
- package/ui/dist/assets/OrganismPanel-xZWUJKyr.js +1 -0
- package/ui/dist/assets/OverviewPanel-B45ZYhJV.js +1 -0
- package/ui/dist/assets/{PageHeader-bnc85wQN.js → PageHeader-DdrbS1aq.js} +1 -1
- package/ui/dist/assets/PersonaProfilesPanel-CKER-EU5.js +8 -0
- package/ui/dist/assets/{PersonasPanel-dR8VppcD.js → PersonasPanel-CMMQ3nh3.js} +1 -1
- package/ui/dist/assets/{PhoneDeskPanel-CdVOY7H9.js → PhoneDeskPanel-Bw_Y-cVE.js} +2 -2
- package/ui/dist/assets/RecipesPanel-DzMcxpJJ.js +1 -0
- package/ui/dist/assets/SecurityPanel-BCq3Fzbr.js +1 -0
- package/ui/dist/assets/SelfImprovePanel-YE3hT8jK.js +1 -0
- package/ui/dist/assets/SelfProposalsPanel-DXuqBM6p.js +1 -0
- package/ui/dist/assets/SessionsPanel-DORz5goR.js +1 -0
- package/ui/dist/assets/SessionsTab-qYHDOuC8.js +1 -0
- package/ui/dist/assets/SettingsPanel-BbwPu1i7.js +1 -0
- package/ui/dist/assets/SettingsView-zgqkDDBJ.js +2 -0
- package/ui/dist/assets/{SkeletonLoader-Cax7YTqW.js → SkeletonLoader-r6OGXaU9.js} +1 -1
- package/ui/dist/assets/SkillsPanel-BjEOBMRo.js +11 -0
- package/ui/dist/assets/{SomaView-eG3wI4S1.js → SomaView-DLzApZVW.js} +2 -2
- package/ui/dist/assets/{StatCard-Djr487DV.js → StatCard-DLq8aBps.js} +1 -1
- package/ui/dist/assets/{StatusBadge-JpCoA33_.js → StatusBadge-BqlvIbdj.js} +1 -1
- package/ui/dist/assets/{Tabs-DJHu-roP.js → Tabs-DdUThlp1.js} +1 -1
- package/ui/dist/assets/TeamsPanel-uIIKoU7I.js +1 -0
- package/ui/dist/assets/{TelemetryPanel-D4PXsd-X.js → TelemetryPanel-dVr3yQQr.js} +1 -1
- package/ui/dist/assets/TitanCanvas-xHAJqwG2.js +945 -0
- package/ui/dist/assets/ToolsView-CG1mZdiy.js +2 -0
- package/ui/dist/assets/{Tooltip-B1LhTXJ8.js → Tooltip-C2tXJcrN.js} +1 -1
- package/ui/dist/assets/TraceViewer-BIMD_Osr.js +1 -0
- package/ui/dist/assets/TracesPanel-nMUiyMj5.js +1 -0
- package/ui/dist/assets/TrainingPanel-CT5R4HWm.js +1 -0
- package/ui/dist/assets/{VoiceOverlay-B_ss7Zg_.js → VoiceOverlay-Br4QnCtw.js} +3 -3
- package/ui/dist/assets/VramPanel-CdnJYytg.js +1 -0
- package/ui/dist/assets/WatchView-TNU6Ns1Q.js +13 -0
- package/ui/dist/assets/WorkTab-wTlX_UKP.js +1 -0
- package/ui/dist/assets/WorkflowBuilderPanel-CDpVt5ux.js +6 -0
- package/ui/dist/assets/WorkflowsPanel-zsFqsLdn.js +11 -0
- package/ui/dist/assets/{archive-gZFnGd5A.js → archive-Bh689DNg.js} +1 -1
- package/ui/dist/assets/{arrow-left-qA0Qer2h.js → arrow-left-WkVYLm80.js} +1 -1
- package/ui/dist/assets/{book-open-DIxdPqmD.js → book-open-ohEXgUsS.js} +1 -1
- package/ui/dist/assets/{bot-CvIF1uHi.js → bot-DvEcyQcD.js} +1 -1
- package/ui/dist/assets/{chart-column-BQiM-Td4.js → chart-column-w3goFd5f.js} +1 -1
- package/ui/dist/assets/{check-DgyDEFtq.js → check-CuRYh4Zh.js} +1 -1
- package/ui/dist/assets/{chevron-right-CQ1NTOtd.js → chevron-right-DbLSHmff.js} +1 -1
- package/ui/dist/assets/{circle-check-big-CAFcaPPH.js → circle-check-big-Bkba568b.js} +1 -1
- package/ui/dist/assets/{circle-stop-C-8xGv0n.js → circle-stop-Bx2ohEg8.js} +1 -1
- package/ui/dist/assets/{clipboard-list-9DdqBj1F.js → clipboard-list-Dj9tORnu.js} +1 -1
- package/ui/dist/assets/{clock-CF9BCIpL.js → clock-JyQAYy6X.js} +1 -1
- package/ui/dist/assets/{dollar-sign-LDRZBae6.js → dollar-sign-XxwPAA2a.js} +1 -1
- package/ui/dist/assets/{download-BBNXvBO0.js → download-D1izVEOL.js} +1 -1
- package/ui/dist/assets/{external-link-D_ji4Bec.js → external-link-DZ_rZsIt.js} +1 -1
- package/ui/dist/assets/{file-text-DrdTDEYp.js → file-text-Cfawu8Bs.js} +1 -1
- package/ui/dist/assets/{flask-conical-BGn5PgFX.js → flask-conical-Ql8QxhgY.js} +1 -1
- package/ui/dist/assets/{folder-BeZZUGnK.js → folder-DAdIw-Pb.js} +1 -1
- package/ui/dist/assets/{funnel-CAJgGO5M.js → funnel-FycfZcXo.js} +1 -1
- package/ui/dist/assets/{git-branch-BcXabeOs.js → git-branch-C2qrhGGu.js} +1 -1
- package/ui/dist/assets/index-Cml2x9pA.js +507 -0
- package/ui/dist/assets/index-yWybhcfI.css +1 -0
- package/ui/dist/assets/{layers-DxYDmPA_.js → layers-yzjtGlHB.js} +1 -1
- package/ui/dist/assets/{legacy-dHWI7k8P.js → legacy-D21WSMF1.js} +1 -1
- package/ui/dist/assets/{lightbulb-B0Du4SM4.js → lightbulb-BZJNK69S.js} +1 -1
- package/ui/dist/assets/{link-CUpaumqr.js → link-CnFkBkaY.js} +1 -1
- package/ui/dist/assets/{list-todo-CDDhmPQB.js → list-todo-BlgfQHup.js} +1 -1
- package/ui/dist/assets/{message-square-D5VWlv-Q.js → message-square-CRsG9u6_.js} +1 -1
- package/ui/dist/assets/{mic-Ddcc6Ann.js → mic-B32RHc7Y.js} +1 -1
- package/ui/dist/assets/{missions-2zox16Tc.js → missions-1iw8Z2_0.js} +1 -1
- package/ui/dist/assets/{network-DaJ7ugwX.js → network-C9RXQGrV.js} +1 -1
- package/ui/dist/assets/{pause-BukaK6rs.js → pause-BT1Bc2q3.js} +1 -1
- package/ui/dist/assets/{pencil-D_YwQBeg.js → pencil-BK5IU6o0.js} +1 -1
- package/ui/dist/assets/{play-BjdwtYMk.js → play-Cl1nC_gc.js} +1 -1
- package/ui/dist/assets/{plug-yISDdeW2.js → plug-DvcpOalj.js} +1 -1
- package/ui/dist/assets/{plus-BSjTdepW.js → plus-Dpo1qfrl.js} +1 -1
- package/ui/dist/assets/{radio-B7kX_yWE.js → radio-C5c9IyqX.js} +1 -1
- package/ui/dist/assets/{refresh-cw-CwDpzXUn.js → refresh-cw-C-iZkzuS.js} +1 -1
- package/ui/dist/assets/{rotate-ccw-7SQDTI0_.js → rotate-ccw-qzrB3SNw.js} +1 -1
- package/ui/dist/assets/{save-CjTPAQM0.js → save-DwR9wQVu.js} +1 -1
- package/ui/dist/assets/{search-BP7VlNxX.js → search-D10l0m3-.js} +1 -1
- package/ui/dist/assets/{send-C2XDuRPf.js → send-DtXGsaFW.js} +1 -1
- package/ui/dist/assets/{server-BE8W-AT4.js → server-BzisF3LL.js} +1 -1
- package/ui/dist/assets/settings-Dbwd1_-c.js +6 -0
- package/ui/dist/assets/{shield-check-s7la2J2K.js → shield-check-CXlDJyAW.js} +1 -1
- package/ui/dist/assets/square-BBC-JKzY.js +11 -0
- package/ui/dist/assets/{terminal-B8IK4WsO.js → terminal-DaBIlWEM.js} +1 -1
- package/ui/dist/assets/{test-tube-Xfn9DJeg.js → test-tube-CDATRD5t.js} +1 -1
- package/ui/dist/assets/{toggle-right-CHpzOIlj.js → toggle-right-DTmrC5RD.js} +1 -1
- package/ui/dist/assets/{trash-2-B1C85ePK.js → trash-2-CTeyjxD_.js} +1 -1
- package/ui/dist/assets/{trending-up-DDGHQZY1.js → trending-up-CXPRjRV4.js} +1 -1
- package/ui/dist/assets/{trophy-D0LhJSPA.js → trophy-DbVdXRtU.js} +1 -1
- package/ui/dist/assets/{volume-2-DMaE91b5.js → volume-2-DYDBmm3M.js} +1 -1
- package/ui/dist/assets/{wifi-off-DR9h8HGA.js → wifi-off-BBuIGbiP.js} +1 -1
- package/ui/dist/assets/zoom-out-D47_pRAO.js +16 -0
- package/ui/dist/index.html +2 -2
- package/ui/dist/sw.js +1 -1
- package/ui/dist/assets/AuditPanel-BaftX5MP.js +0 -1
- package/ui/dist/assets/BackupPanel-DAy9G7Wt.js +0 -1
- package/ui/dist/assets/CPActivity-BYDsUoMn.js +0 -1
- package/ui/dist/assets/CPAgentDetail-Bb9-GAJY.js +0 -1
- package/ui/dist/assets/CPAgents-BTZuGnki.js +0 -1
- package/ui/dist/assets/CPApprovals-BME2ARkO.js +0 -1
- package/ui/dist/assets/CPCosts-mOXwWq0i.js +0 -1
- package/ui/dist/assets/CPDashboard-CTlKGXXQ.js +0 -1
- package/ui/dist/assets/CPGoals-BNWhNP14.js +0 -1
- package/ui/dist/assets/CPInbox-ybe4r8LW.js +0 -16
- package/ui/dist/assets/CPIssueDetail-DaMMGbjw.js +0 -1
- package/ui/dist/assets/CPIssues-BgpQOISw.js +0 -1
- package/ui/dist/assets/CPLayout-bgErauTx.js +0 -2
- package/ui/dist/assets/CPOrg-C8l5SIWJ.js +0 -8
- package/ui/dist/assets/CPRuns-DB8S7loF.js +0 -1
- package/ui/dist/assets/CPVoice-DfwHPewA.js +0 -1
- package/ui/dist/assets/CheckpointsPanel-9-l_8GdG.js +0 -1
- package/ui/dist/assets/CommandPostHub-z55Yrhj1.js +0 -24
- package/ui/dist/assets/CronPanel-kEZK3gpx.js +0 -1
- package/ui/dist/assets/EmptyState-CfvU7SdB.js +0 -1
- package/ui/dist/assets/EvalPanel-CDG-njyj.js +0 -1
- package/ui/dist/assets/FilesPanel-CaLPog2e.js +0 -16
- package/ui/dist/assets/FleetPanel-BtlaV6pH.js +0 -1
- package/ui/dist/assets/InfraView-C0zEuFrR.js +0 -2
- package/ui/dist/assets/Input-CbrMbLgn.js +0 -1
- package/ui/dist/assets/IntegrationsPanel-B4TyR6jC.js +0 -1
- package/ui/dist/assets/IntelligenceView-DZ4HxYZ3.js +0 -2
- package/ui/dist/assets/LearningPanel-B4RIm_iQ.js +0 -1
- package/ui/dist/assets/McpPanel-BmNUFozc.js +0 -1
- package/ui/dist/assets/MemoryGraphPanel-JPurHV0L.js +0 -16
- package/ui/dist/assets/MemoryWikiPanel-DdvCAZHa.js +0 -6
- package/ui/dist/assets/MissionStart-wUkcEP0T.js +0 -1
- package/ui/dist/assets/Modal-BmS7C6FN.js +0 -1
- package/ui/dist/assets/OrganismPanel-C2LYDPrn.js +0 -1
- package/ui/dist/assets/OverviewPanel-DK8uuq4D.js +0 -1
- package/ui/dist/assets/PersonaProfilesPanel-DGtokXUu.js +0 -8
- package/ui/dist/assets/RecipesPanel-D3Zs2wxr.js +0 -1
- package/ui/dist/assets/SecurityPanel-BMERf796.js +0 -1
- package/ui/dist/assets/SelfImprovePanel-BxqWHXCU.js +0 -1
- package/ui/dist/assets/SelfProposalsPanel-CuC94vdx.js +0 -2
- package/ui/dist/assets/SessionsPanel-CQ8qvzp7.js +0 -1
- package/ui/dist/assets/SessionsTab-B3eHV3jf.js +0 -1
- package/ui/dist/assets/SettingsPanel-Cumls7N2.js +0 -1
- package/ui/dist/assets/SettingsView-BtA67pol.js +0 -2
- package/ui/dist/assets/SkillsPanel-CA415CT8.js +0 -11
- package/ui/dist/assets/TeamsPanel-C_Vu6vnY.js +0 -1
- package/ui/dist/assets/TitanCanvas-TuYZSZO7.js +0 -1117
- package/ui/dist/assets/ToolsView-BvTN6vFn.js +0 -2
- package/ui/dist/assets/TraceViewer-Bh8Jo3Dr.js +0 -1
- package/ui/dist/assets/TrainingPanel-Dmbd1rJ-.js +0 -1
- package/ui/dist/assets/VramPanel-CPICbZ2s.js +0 -1
- package/ui/dist/assets/WatchView-BCgLVfiV.js +0 -13
- package/ui/dist/assets/WorkTab-iptofXO9.js +0 -1
- package/ui/dist/assets/WorkflowsPanel-3RYkFHyf.js +0 -11
- package/ui/dist/assets/chevron-up-UyfdjRp6.js +0 -6
- package/ui/dist/assets/index-CUgepw5Q.js +0 -337
- package/ui/dist/assets/index-Dm6zcSTS.css +0 -1
- package/ui/dist/assets/proxy-CWET5FFX.js +0 -9
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{r as x,j as I,X as Fo}from"./index-Cml2x9pA.js";import{c as Io}from"./clsx-B-dksMZM.js";const qe=x.createContext({});function Ze(t){const e=x.useRef(null);return e.current===null&&(e.current=t()),e.current}const Bo=typeof window<"u",_s=Bo?x.useLayoutEffect:x.useEffect,ae=x.createContext(null);function Je(t,e){t.indexOf(e)===-1&&t.push(e)}function Qt(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Q=(t,e,n)=>n>e?e:n<t?t:n;let Qe=()=>{};const nt={},Xs=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Ys(t){return typeof t=="object"&&t!==null}const qs=t=>/^0[^.\s]+$/u.test(t);function Zs(t){let e;return()=>(e===void 0&&(e=t()),e)}const G=t=>t,jo=(t,e)=>n=>e(t(n)),jt=(...t)=>t.reduce(jo),kt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class tn{constructor(){this.subscriptions=[]}add(e){return Je(this.subscriptions,e),()=>Qt(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const K=t=>t*1e3,z=t=>t/1e3;function Js(t,e){return e?t*(1e3/e):0}const Qs=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Oo=1e-7,No=12;function Uo(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=Qs(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>Oo&&++a<No);return o}function Ot(t,e,n,s){if(t===e&&n===s)return G;const i=r=>Uo(r,0,1,t,n);return r=>r===0||r===1?r:Qs(i(r),e,s)}const ti=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ei=t=>e=>1-t(1-e),ni=Ot(.33,1.53,.69,.99),en=ei(ni),si=ti(en),ii=t=>(t*=2)<1?.5*en(t):.5*(2-Math.pow(2,-10*(t-1))),nn=t=>1-Math.sin(Math.acos(t)),oi=ei(nn),ri=ti(nn),Wo=Ot(.42,0,1,1),Ko=Ot(0,0,.58,1),ai=Ot(.42,0,.58,1),$o=t=>Array.isArray(t)&&typeof t[0]!="number",li=t=>Array.isArray(t)&&typeof t[0]=="number",zo={linear:G,easeIn:Wo,easeInOut:ai,easeOut:Ko,circIn:nn,circInOut:ri,circOut:oi,backIn:en,backInOut:si,backOut:ni,anticipate:ii},Go=t=>typeof t=="string",Mn=t=>{if(li(t)){Qe(t.length===4);const[e,n,s,i]=t;return Ot(e,n,s,i)}else if(Go(t))return zo[t];return t},Wt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Ho(t,e){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(c){o.has(c)&&(u.schedule(c),t()),c(a)}const u={schedule:(c,f=!1,h=!1)=>{const m=h&&i?n:s;return f&&o.add(c),m.has(c)||m.add(c),c},cancel:c=>{s.delete(c),o.delete(c)},process:c=>{if(a=c,i){r=!0;return}i=!0,[n,s]=[s,n],n.forEach(l),n.clear(),i=!1,r&&(r=!1,u.process(c))}};return u}const _o=40;function ci(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Wt.reduce((v,S)=>(v[S]=Ho(r),v),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:f,preRender:h,render:d,postRender:m}=o,p=()=>{const v=nt.useManualTiming?i.timestamp:performance.now();n=!1,nt.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(v-i.timestamp,_o),1)),i.timestamp=v,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),f.process(i),h.process(i),d.process(i),m.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(p))},g=()=>{n=!0,s=!0,i.isProcessing||t(p)};return{schedule:Wt.reduce((v,S)=>{const P=o[S];return v[S]=(C,L=!1,A=!1)=>(n||g(),P.schedule(C,L,A)),v},{}),cancel:v=>{for(let S=0;S<Wt.length;S++)o[Wt[S]].cancel(v)},state:i,steps:o}}const{schedule:M,cancel:rt,state:O,steps:he}=ci(typeof requestAnimationFrame<"u"?requestAnimationFrame:G,!0);let Ht;function Xo(){Ht=void 0}const U={now:()=>(Ht===void 0&&U.set(O.isProcessing||nt.useManualTiming?O.timestamp:performance.now()),Ht),set:t=>{Ht=t,queueMicrotask(Xo)}},ui=t=>e=>typeof e=="string"&&e.startsWith(t),hi=ui("--"),Yo=ui("var(--"),sn=t=>Yo(t)?qo.test(t.split("/*")[0].trim()):!1,qo=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Dn(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const bt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ft={...bt,transform:t=>Q(0,1,t)},Kt={...bt,default:1},Dt=t=>Math.round(t*1e5)/1e5,on=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Zo(t){return t==null}const Jo=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,rn=(t,e)=>n=>!!(typeof n=="string"&&Jo.test(n)&&n.startsWith(t)||e&&!Zo(n)&&Object.prototype.hasOwnProperty.call(n,e)),fi=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(on);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Qo=t=>Q(0,255,t),fe={...bt,transform:t=>Math.round(Qo(t))},ht={test:rn("rgb","red"),parse:fi("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+fe.transform(t)+", "+fe.transform(e)+", "+fe.transform(n)+", "+Dt(Ft.transform(s))+")"};function tr(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Ce={test:rn("#"),parse:tr,transform:ht.transform},Nt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),st=Nt("deg"),J=Nt("%"),w=Nt("px"),er=Nt("vh"),nr=Nt("vw"),En={...J,parse:t=>J.parse(t)/100,transform:t=>J.transform(t*100)},gt={test:rn("hsl","hue"),parse:fi("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+J.transform(Dt(e))+", "+J.transform(Dt(n))+", "+Dt(Ft.transform(s))+")"},k={test:t=>ht.test(t)||Ce.test(t)||gt.test(t),parse:t=>ht.test(t)?ht.parse(t):gt.test(t)?gt.parse(t):Ce.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ht.transform(t):gt.transform(t),getAnimatableNone:t=>{const e=k.parse(t);return e.alpha=0,k.transform(e)}},sr=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ir(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(on))==null?void 0:e.length)||0)+(((n=t.match(sr))==null?void 0:n.length)||0)>0}const di="number",mi="color",or="var",rr="var(",Rn="${}",ar=/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 St(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(ar,l=>(k.test(l)?(s.color.push(r),i.push(mi),n.push(k.parse(l))):l.startsWith(rr)?(s.var.push(r),i.push(or),n.push(l)):(s.number.push(r),i.push(di),n.push(parseFloat(l))),++r,Rn)).split(Rn);return{values:n,split:a,indexes:s,types:i}}function lr(t){return St(t).values}function pi({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;r<n;r++)if(i+=t[r],s[r]!==void 0){const o=e[r];o===di?i+=Dt(s[r]):o===mi?i+=k.transform(s[r]):i+=s[r]}return i}}function cr(t){return pi(St(t))}const ur=t=>typeof t=="number"?0:k.test(t)?k.getAnimatableNone(t):t,hr=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:ur(t);function fr(t){const e=St(t);return pi(e)(e.values.map((s,i)=>hr(s,e.split[i])))}const X={test:ir,parse:lr,createTransformer:cr,getAnimatableNone:fr};function de(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function dr({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=de(l,a,t+1/3),r=de(l,a,t),o=de(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function te(t,e){return n=>n>0?e:t}const E=(t,e,n)=>t+(e-t)*n,me=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},mr=[Ce,ht,gt],pr=t=>mr.find(e=>e.test(t));function Ln(t){const e=pr(t);if(!e)return!1;let n=e.parse(t);return e===gt&&(n=dr(n)),n}const kn=(t,e)=>{const n=Ln(t),s=Ln(e);if(!n||!s)return te(t,e);const i={...n};return r=>(i.red=me(n.red,s.red,r),i.green=me(n.green,s.green,r),i.blue=me(n.blue,s.blue,r),i.alpha=E(n.alpha,s.alpha,r),ht.transform(i))},Me=new Set(["none","hidden"]);function gr(t,e){return Me.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function yr(t,e){return n=>E(t,e,n)}function an(t){return typeof t=="number"?yr:typeof t=="string"?sn(t)?te:k.test(t)?kn:Tr:Array.isArray(t)?gi:typeof t=="object"?k.test(t)?kn:vr:te}function gi(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>an(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function vr(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=an(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function xr(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}const Tr=(t,e)=>{const n=X.createTransformer(e),s=St(t),i=St(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Me.has(t)&&!i.values.length||Me.has(e)&&!s.values.length?gr(t,e):jt(gi(xr(s,i),i.values),n):te(t,e)};function yi(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?E(t,e,n):an(t)(t,e)}const wr=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>M.update(e,n),stop:()=>rt(e),now:()=>O.isProcessing?O.timestamp:U.now()}},vi=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let r=0;r<i;r++)s+=Math.round(t(r/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},ee=2e4;function ln(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<ee;)e+=n,s=t.next(e);return e>=ee?1/0:e}function Sr(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(ln(s),ee);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:z(i)}}const 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 De(t,e){return t*Math.sqrt(1-e*e)}const Pr=12;function br(t,e,n){let s=n;for(let i=1;i<Pr;i++)s=s-t(s)/e(s);return s}const pe=.001;function Ar({duration:t=R.duration,bounce:e=R.bounce,velocity:n=R.velocity,mass:s=R.mass}){let i,r,o=1-e;o=Q(R.minDamping,R.maxDamping,o),t=Q(R.minDuration,R.maxDuration,z(t)),o<1?(i=u=>{const c=u*o,f=c*t,h=c-n,d=De(u,o),m=Math.exp(-f);return pe-h/d*m},r=u=>{const f=u*o*t,h=f*n+n,d=Math.pow(o,2)*Math.pow(u,2)*t,m=Math.exp(-f),p=De(Math.pow(u,2),o);return(-i(u)+pe>0?-1:1)*((h-d)*m)/p}):(i=u=>{const c=Math.exp(-u*t),f=(u-n)*t+1;return-pe+c*f},r=u=>{const c=Math.exp(-u*t),f=(n-u)*(t*t);return c*f});const a=5/t,l=br(i,r,a);if(t=K(t),isNaN(l))return{stiffness:R.stiffness,damping:R.damping,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:t}}}const Vr=["duration","bounce"],Cr=["stiffness","damping","mass"];function Fn(t,e){return e.some(n=>t[n]!==void 0)}function Mr(t){let e={velocity:R.velocity,stiffness:R.stiffness,damping:R.damping,mass:R.mass,isResolvedFromDuration:!1,...t};if(!Fn(t,Cr)&&Fn(t,Vr))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*Q(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:R.mass,stiffness:i,damping:r}}else{const n=Ar({...t,velocity:0});e={...e,...n,mass:R.mass},e.isResolvedFromDuration=!0}return e}function ne(t=R.visualDuration,e=R.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:u,mass:c,duration:f,velocity:h,isResolvedFromDuration:d}=Mr({...n,velocity:-z(n.velocity||0)}),m=h||0,p=u/(2*Math.sqrt(l*c)),g=o-r,y=z(Math.sqrt(l/c)),T=Math.abs(g)<5;s||(s=T?R.restSpeed.granular:R.restSpeed.default),i||(i=T?R.restDelta.granular:R.restDelta.default);let v,S,P,C,L,A;if(p<1)P=De(y,p),C=(m+p*y*g)/P,v=b=>{const D=Math.exp(-p*y*b);return o-D*(C*Math.sin(P*b)+g*Math.cos(P*b))},L=p*y*C+g*P,A=p*y*g-C*P,S=b=>Math.exp(-p*y*b)*(L*Math.sin(P*b)+A*Math.cos(P*b));else if(p===1){v=D=>o-Math.exp(-y*D)*(g+(m+y*g)*D);const b=m+y*g;S=D=>Math.exp(-y*D)*(y*b*D-m)}else{const b=y*Math.sqrt(p*p-1);v=Y=>{const et=Math.exp(-p*y*Y),q=Math.min(b*Y,300);return o-et*((m+p*y*g)*Math.sinh(q)+b*g*Math.cosh(q))/b};const D=(m+p*y*g)/b,B=p*y*D-g*b,tt=p*y*g-D*b;S=Y=>{const et=Math.exp(-p*y*Y),q=Math.min(b*Y,300);return et*(B*Math.sinh(q)+tt*Math.cosh(q))}}const V={calculatedDuration:d&&f||null,velocity:b=>K(S(b)),next:b=>{if(!d&&p<1){const B=Math.exp(-p*y*b),tt=Math.sin(P*b),Y=Math.cos(P*b),et=o-B*(C*tt+g*Y),q=K(B*(L*tt+A*Y));return a.done=Math.abs(q)<=s&&Math.abs(o-et)<=i,a.value=a.done?o:et,a}const D=v(b);if(d)a.done=b>=f;else{const B=K(S(b));a.done=Math.abs(B)<=s&&Math.abs(o-D)<=i}return a.value=a.done?o:D,a},toString:()=>{const b=Math.min(ln(V),ee),D=vi(B=>V.next(b*B).value,b,30);return b+"ms "+D},toTransition:()=>{}};return V}ne.applyToOptions=t=>{const e=Sr(t,100,ne);return t.ease=e.ease,t.duration=K(e.duration),t.type="keyframes",t};const Dr=5;function xi(t,e,n){const s=Math.max(e-Dr,0);return Js(n-t(s),e-s)}function Ee({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const f=t[0],h={done:!1,value:f},d=A=>a!==void 0&&A<a||l!==void 0&&A>l,m=A=>a===void 0?l:l===void 0||Math.abs(a-A)<Math.abs(l-A)?a:l;let p=n*e;const g=f+p,y=o===void 0?g:o(g);y!==g&&(p=y-f);const T=A=>-p*Math.exp(-A/s),v=A=>y+T(A),S=A=>{const V=T(A),b=v(A);h.done=Math.abs(V)<=u,h.value=h.done?y:b};let P,C;const L=A=>{d(h.value)&&(P=A,C=ne({keyframes:[h.value,m(h.value)],velocity:xi(v,A,h.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return L(0),{calculatedDuration:null,next:A=>{let V=!1;return!C&&P===void 0&&(V=!0,S(A),L(A)),P!==void 0&&A>=P?C.next(A-P):(!V&&S(A),h)}}}function Er(t,e,n){const s=[],i=n||nt.mix||yi,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||G:e;a=jt(l,a)}s.push(a)}return s}function Rr(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(Qe(r===e.length),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Er(e,s,i),l=a.length,u=c=>{if(o&&c<t[0])return e[0];let f=0;if(l>1)for(;f<t.length-2&&!(c<t[f+1]);f++);const h=kt(t[f],t[f+1],c);return a[f](h)};return n?c=>u(Q(t[0],t[r-1],c)):u}function Lr(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=kt(0,e,s);t.push(E(n,1,i))}}function kr(t){const e=[0];return Lr(e,t.length-1),e}function Fr(t,e){return t.map(n=>n*e)}function Ir(t,e){return t.map(()=>e||ai).splice(0,t.length-1)}function Et({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=$o(s)?s.map(Mn):Mn(s),r={done:!1,value:e[0]},o=Fr(n&&n.length===e.length?n:kr(e),t),a=Rr(o,e,{ease:Array.isArray(i)?i:Ir(e,i)});return{calculatedDuration:t,next:l=>(r.value=a(l),r.done=l>=t,r)}}const Br=t=>t!==null;function cn(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Br),a=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const jr={decay:Ee,inertia:Ee,tween:Et,keyframes:Et,spring:ne};function Ti(t){typeof t.type=="string"&&(t.type=jr[t.type])}class un{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Or=t=>t/100;class hn extends un{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,i;const{motionValue:n}=this.options;n&&n.updatedAt!==U.now()&&this.tick(U.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(s=this.options).onStop)==null||i.call(s))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Ti(e);const{type:n=Et,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const l=n||Et;l!==Et&&typeof a[0]!="number"&&(this.mixKeyframes=jt(Or,yi(a[0],a[1])),a=[0,100]);const u=l({...e,keyframes:a});r==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=ln(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:c,repeat:f,repeatType:h,repeatDelay:d,type:m,onUpdate:p,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let v=this.currentTime,S=s;if(f){const A=Math.min(this.currentTime,i)/a;let V=Math.floor(A),b=A%1;!b&&A>=1&&(b=1),b===1&&V--,V=Math.min(V,f+1),!!(V%2)&&(h==="reverse"?(b=1-b,d&&(b-=d/a)):h==="mirror"&&(S=o)),v=Q(0,1,b)*a}const P=T?{done:!1,value:c[0]}:S.next(v);r&&!T&&(P.value=r(P.value));let{done:C}=P;!T&&l!==null&&(C=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return L&&m!==Ee&&(P.value=cn(c,this.options,g,this.speed)),p&&p(P.value),L&&this.finish(),P}then(e,n){return this.finished.then(e,n)}get duration(){return z(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+z(e)}get time(){return z(this.currentTime)}set time(e){e=K(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(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return xi(s=>this.generator.next(s).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(U.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=z(this.currentTime))}play(){var i,r;if(this.isStopped)return;const{driver:e=wr,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(r=(i=this.options).onPlay)==null||r.call(i);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),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(U.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function Nr(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ft=t=>t*180/Math.PI,Re=t=>{const e=ft(Math.atan2(t[1],t[0]));return Le(e)},Ur={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Re,rotateZ:Re,skewX:t=>ft(Math.atan(t[1])),skewY:t=>ft(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Le=t=>(t=t%360,t<0&&(t+=360),t),In=Re,Bn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),jn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Wr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Bn,scaleY:jn,scale:t=>(Bn(t)+jn(t))/2,rotateX:t=>Le(ft(Math.atan2(t[6],t[5]))),rotateY:t=>Le(ft(Math.atan2(-t[2],t[0]))),rotateZ:In,rotate:In,skewX:t=>ft(Math.atan(t[4])),skewY:t=>ft(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ke(t){return t.includes("scale")?1:0}function Fe(t,e){if(!t||t==="none")return ke(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Wr,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Ur,i=a}if(!i)return ke(e);const r=s[e],o=i[1].split(",").map($r);return typeof r=="function"?r(o):o[r]}const Kr=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Fe(n,e)};function $r(t){return parseFloat(t.trim())}const At=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vt=new Set(At),On=t=>t===bt||t===w,zr=new Set(["x","y","z"]),Gr=At.filter(t=>!zr.has(t));function Hr(t){const e=[];return Gr.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const ot={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Fe(e,"x"),y:(t,{transform:e})=>Fe(e,"y")};ot.translateX=ot.x;ot.translateY=ot.y;const dt=new Set;let Ie=!1,Be=!1,je=!1;function wi(){if(Be){const t=Array.from(dt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Hr(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{var a;(a=s.getValue(r))==null||a.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Be=!1,Ie=!1,dt.forEach(t=>t.complete(je)),dt.clear()}function Si(){dt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Be=!0)})}function _r(){je=!0,Si(),wi(),je=!1}class fn{constructor(e,n,s,i,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(dt.add(this),Ie||(Ie=!0,M.read(Si),M.resolveKeyframes(wi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const r=i==null?void 0:i.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const a=s.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&r===void 0&&i.set(e[0])}Nr(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),dt.delete(this)}cancel(){this.state==="scheduled"&&(dt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Xr=t=>t.startsWith("--");function Pi(t,e,n){Xr(e)?t.style.setProperty(e,n):t.style[e]=n}const Yr={};function bi(t,e){const n=Zs(t);return()=>Yr[e]??n()}const qr=bi(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Ai=bi(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Mt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Nn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Mt([0,.65,.55,1]),circOut:Mt([.55,0,1,.45]),backIn:Mt([.31,.01,.66,-.59]),backOut:Mt([.33,1.53,.69,.99])};function Vi(t,e){if(t)return typeof t=="function"?Ai()?vi(t,e):"ease-out":li(t)?Mt(t):Array.isArray(t)?t.map(n=>Vi(n,e)||Nn.easeOut):Nn[t]}function Zr(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const f=Vi(a,i);Array.isArray(f)&&(c.easing=f);const h={delay:s,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),t.animate(c,h)}function Ci(t){return typeof t=="function"&&"applyToOptions"in t}function Jr({type:t,...e}){return Ci(t)&&Ai()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Mi extends un{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,Qe(typeof e.type!="string");const u=Jr(e);this.animation=Zr(n,s,i,u,r),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const c=cn(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(c),Pi(n,s,c),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,s,i;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((i=(s=this.animation).commitStyles)==null||i.call(s))}get duration(){var n,s;const e=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return z(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+z(e)}get time(){return z(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=K(e),n&&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?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:s,observe:i}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&qr()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),G):i(this)}}const Di={anticipate:ii,backInOut:si,circInOut:ri};function Qr(t){return t in Di}function ta(t){typeof t.ease=="string"&&Qr(t.ease)&&(t.ease=Di[t.ease])}const ge=10;class ea extends Mi{constructor(e){ta(e),Ti(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new hn({...o,autoplay:!1}),l=Math.max(ge,U.now()-this.startTime),u=Q(0,ge,l-ge),c=a.sample(l).value,{name:f}=this.options;r&&f&&Pi(r,f,c),n.setWithVelocity(a.sample(Math.max(0,l-u)).value,c,u),a.stop()}}const Un=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(X.test(t)||t==="0")&&!t.startsWith("url("));function na(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function sa(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=Un(i,e),a=Un(r,e);return!o||!a?!1:na(t)||(n==="spring"||Ci(n))&&s}function Oe(t){t.duration=0,t.type="keyframes"}const ia=new Set(["opacity","clipPath","filter","transform"]),oa=Zs(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ra(t){var c;const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;if(!(((c=e==null?void 0:e.owner)==null?void 0:c.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return oa()&&n&&ia.has(n)&&(n!=="transform"||!u)&&!l&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const aa=40;class la extends un{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:l,motionValue:u,element:c,...f}){var m;super(),this.stop=()=>{var p,g;this._animation&&(this._animation.stop(),(p=this.stopTimeline)==null||p.call(this)),(g=this.keyframeResolver)==null||g.cancel()},this.createdAt=U.now();const h={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:l,motionValue:u,element:c,...f},d=(c==null?void 0:c.KeyframeResolver)||fn;this.keyframeResolver=new d(a,(p,g,y)=>this.onKeyframesResolved(p,g,h,!y),l,u,c),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(e,n,s,i){var g,y;this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:l,isHandoff:u,onUpdate:c}=s;this.resolvedAt=U.now(),sa(e,r,o,a)||((nt.instantAnimations||!l)&&(c==null||c(cn(e,s,n))),e[0]=e[e.length-1],Oe(s),s.repeat=0);const h={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>aa?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=!u&&ra(h),m=(y=(g=h.motionValue)==null?void 0:g.owner)==null?void 0:y.current,p=d?new ea({...h,element:m}):new hn(h);p.finished.then(()=>{this.notifyFinished()}).catch(G),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),_r()),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(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function Ei(t,e,n,s=0,i=1){const r=Array.from(t).sort((u,c)=>u.sortNodePosition(c)).indexOf(e),o=t.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}const ca=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ua(t){const e=ca.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Ri(t,e,n=1){const[s,i]=ua(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return Xs(o)?parseFloat(o):o}return sn(i)?Ri(i,e,n+1):i}const ha={type:"spring",stiffness:500,damping:25,restSpeed:10},fa=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),da={type:"keyframes",duration:.8},ma={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},pa=(t,{keyframes:e})=>e.length>2?da:Vt.has(t)?t.startsWith("scale")?fa(e[1]):ha:ma,ga=t=>t!==null;function ya(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(ga),r=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[r]}function Li(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function dn(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?Li(n,t):n}function va({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const mn=(t,e,n,s={},i,r)=>o=>{const a=dn(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-K(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:h=>{e.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};va(a)||Object.assign(c,pa(t,c)),c.duration&&(c.duration=K(c.duration)),c.repeatDelay&&(c.repeatDelay=K(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let f=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(Oe(c),c.delay===0&&(f=!0)),(nt.instantAnimations||nt.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(f=!0,Oe(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,f&&!r&&e.get()!==void 0){const h=ya(c.keyframes,a);if(h!==void 0){M.update(()=>{c.onUpdate(h),c.onComplete()});return}}return a.isSync?new hn(c):new la(c)};function Wn(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function pn(t,e,n,s){if(typeof e=="function"){const[i,r]=Wn(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=Wn(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function wt(t,e,n){const s=t.getProps();return pn(s,e,n!==void 0?n:s.custom,t)}const ki=new Set(["width","height","top","left","right","bottom",...At]),Kn=30,xa=t=>!isNaN(parseFloat(t));class Ta{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var r;const i=U.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((r=this.events.change)==null||r.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=U.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=xa(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new tn);const s=this.events[e].add(n);return e==="change"?()=>{s(),M.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=U.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Kn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Kn);return Js(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),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(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Pt(t,e){return new Ta(t,e)}const Ne=t=>Array.isArray(t);function wa(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Pt(n))}function Sa(t){return Ne(t)?t[t.length-1]||0:t}function Pa(t,e){const n=wt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=Sa(r[o]);wa(t,o,a)}}const N=t=>!!(t&&t.getVelocity);function ba(t){return!!(N(t)&&t.add)}function Ue(t,e){const n=t.getValue("willChange");if(ba(n))return n.add(e);if(!n&&nt.WillChange){const s=new nt.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function gn(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Aa="framerAppearId",Fi="data-"+gn(Aa);function Ii(t){return t.props[Fi]}function Va({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Bi(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:o,...a}=e;const l=t.getDefaultTransition();r=r?Li(r,l):l;const u=r==null?void 0:r.reduceMotion;s&&(r=s);const c=[],f=i&&t.animationState&&t.animationState.getState()[i];for(const h in a){const d=t.getValue(h,t.latestValues[h]??null),m=a[h];if(m===void 0||f&&Va(f,h))continue;const p={delay:n,...dn(r||{},h)},g=d.get();if(g!==void 0&&!d.isAnimating&&!Array.isArray(m)&&m===g&&!p.velocity)continue;let y=!1;if(window.MotionHandoffAnimation){const S=Ii(t);if(S){const P=window.MotionHandoffAnimation(S,h,M);P!==null&&(p.startTime=P,y=!0)}}Ue(t,h);const T=u??t.shouldReduceMotion;d.start(mn(h,d,m,T&&ki.has(h)?{type:!1}:p,t,y));const v=d.animation;v&&c.push(v)}if(o){const h=()=>M.update(()=>{o&&Pa(t,o)});c.length?Promise.all(c).then(h):h()}return c}function We(t,e,n={}){var l;const s=wt(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(Bi(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:f,staggerDirection:h}=i;return Ca(t,e,u,c,f,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,c]=a==="beforeChildren"?[r,o]:[o,r];return u().then(()=>c())}else return Promise.all([r(),o(n.delay)])}function Ca(t,e,n=0,s=0,i=0,r=1,o){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(We(l,e,{...o,delay:n+(typeof s=="function"?0:s)+Ei(t.variantChildren,l,s,i,r)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function Ma(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>We(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=We(t,e,n);else{const i=typeof e=="function"?wt(t,e,n.custom):e;s=Promise.all(Bi(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Da={test:t=>t==="auto",parse:t=>t},ji=t=>e=>e.test(t),Oi=[bt,w,J,st,nr,er,Da],$n=t=>Oi.find(ji(t));function Ea(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||qs(t):!0}const Ra=new Set(["brightness","contrast","saturate","opacity"]);function La(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(on)||[];if(!s)return t;const i=n.replace(s,"");let r=Ra.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const ka=/\b([a-z-]*)\(.*?\)/gu,Ke={...X,getAnimatableNone:t=>{const e=t.match(ka);return e?e.map(La).join(" "):t}},$e={...X,getAnimatableNone:t=>{const e=X.parse(t);return X.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},zn={...bt,transform:Math.round},Fa={rotate:st,rotateX:st,rotateY:st,rotateZ:st,scale:Kt,scaleX:Kt,scaleY:Kt,scaleZ:Kt,skew:st,skewX:st,skewY:st,distance:w,translateX:w,translateY:w,translateZ:w,x:w,y:w,z:w,perspective:w,transformPerspective:w,opacity:Ft,originX:En,originY:En,originZ:w},yn={borderWidth:w,borderTopWidth:w,borderRightWidth:w,borderBottomWidth:w,borderLeftWidth:w,borderRadius:w,borderTopLeftRadius:w,borderTopRightRadius:w,borderBottomRightRadius:w,borderBottomLeftRadius:w,width:w,maxWidth:w,height:w,maxHeight:w,top:w,right:w,bottom:w,left:w,inset:w,insetBlock:w,insetBlockStart:w,insetBlockEnd:w,insetInline:w,insetInlineStart:w,insetInlineEnd:w,padding:w,paddingTop:w,paddingRight:w,paddingBottom:w,paddingLeft:w,paddingBlock:w,paddingBlockStart:w,paddingBlockEnd:w,paddingInline:w,paddingInlineStart:w,paddingInlineEnd:w,margin:w,marginTop:w,marginRight:w,marginBottom:w,marginLeft:w,marginBlock:w,marginBlockStart:w,marginBlockEnd:w,marginInline:w,marginInlineStart:w,marginInlineEnd:w,fontSize:w,backgroundPositionX:w,backgroundPositionY:w,...Fa,zIndex:zn,fillOpacity:Ft,strokeOpacity:Ft,numOctaves:zn},Ia={...yn,color:k,backgroundColor:k,outlineColor:k,fill:k,stroke:k,borderColor:k,borderTopColor:k,borderRightColor:k,borderBottomColor:k,borderLeftColor:k,filter:Ke,WebkitFilter:Ke,mask:$e,WebkitMask:$e},Ni=t=>Ia[t],Ba=new Set([Ke,$e]);function Ui(t,e){let n=Ni(t);return Ba.has(n)||(n=X),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ja=new Set(["auto","none","0"]);function Oa(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!ja.has(r)&&St(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=Ui(n,i)}class Na extends fn{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let f=e[c];if(typeof f=="string"&&(f=f.trim(),sn(f))){const h=Ri(f,n.current);h!==void 0&&(e[c]=h),c===e.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!ki.has(s)||e.length!==2)return;const[i,r]=e,o=$n(i),a=$n(r),l=Dn(i),u=Dn(r);if(l!==u&&ot[s]){this.needsMeasurement=!0;return}if(o!==a)if(On(o)&&On(a))for(let c=0;c<e.length;c++){const f=e[c];typeof f=="string"&&(e[c]=parseFloat(f))}else ot[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||Ea(e[i]))&&s.push(i);s.length&&Oa(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ot[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var a;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=ot[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,u])=>{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const Ua=new Set(["opacity","clipPath","filter","transform"]);function Wi(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=(n==null?void 0:n[t])??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const Ki=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function _t(t){return Ys(t)&&"offsetHeight"in t}const{schedule:vn}=ci(queueMicrotask,!1),_={x:!1,y:!1};function $i(){return _.x||_.y}function Wa(t){return t==="x"||t==="y"?_[t]?null:(_[t]=!0,()=>{_[t]=!1}):_.x||_.y?null:(_.x=_.y=!0,()=>{_.x=_.y=!1})}function zi(t,e){const n=Wi(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Ka(t){return!(t.pointerType==="touch"||$i())}function $a(t,e,n={}){const[s,i,r]=zi(t,n);return s.forEach(o=>{let a=!1,l=!1,u;const c=()=>{o.removeEventListener("pointerleave",m)},f=g=>{u&&(u(g),u=void 0),c()},h=g=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),l&&(l=!1,f(g))},d=()=>{a=!0,window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",h,i)},m=g=>{if(g.pointerType!=="touch"){if(a){l=!0;return}f(g)}},p=g=>{if(!Ka(g))return;l=!1;const y=e(o,g);typeof y=="function"&&(u=y,o.addEventListener("pointerleave",m,i))};o.addEventListener("pointerenter",p,i),o.addEventListener("pointerdown",d,i)}),r}const Gi=(t,e)=>e?t===e?!0:Gi(t,e.parentElement):!1,xn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,za=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ga(t){return za.has(t.tagName)||t.isContentEditable===!0}const Ha=new Set(["INPUT","SELECT","TEXTAREA"]);function _a(t){return Ha.has(t.tagName)||t.isContentEditable===!0}const Xt=new WeakSet;function Gn(t){return e=>{e.key==="Enter"&&t(e)}}function ye(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Xa=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Gn(()=>{if(Xt.has(n))return;ye(n,"down");const i=Gn(()=>{ye(n,"up")}),r=()=>ye(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function Hn(t){return xn(t)&&!$i()}const _n=new WeakSet;function Ya(t,e,n={}){const[s,i,r]=zi(t,n),o=a=>{const l=a.currentTarget;if(!Hn(a)||_n.has(a))return;Xt.add(l),n.stopPropagation&&_n.add(a);const u=e(l,a),c=(d,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),Xt.has(l)&&Xt.delete(l),Hn(d)&&typeof u=="function"&&u(d,{success:m})},f=d=>{c(d,l===window||l===document||n.useGlobalTarget||Gi(l,d.target))},h=d=>{c(d,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",h,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),_t(a)&&(a.addEventListener("focus",u=>Xa(u,i)),!Ga(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function Tn(t){return Ys(t)&&"ownerSVGElement"in t}const Yt=new WeakMap;let it;const Hi=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:Tn(s)&&"getBBox"in s?s.getBBox()[e]:s[n],qa=Hi("inline","width","offsetWidth"),Za=Hi("block","height","offsetHeight");function Ja({target:t,borderBoxSize:e}){var n;(n=Yt.get(t))==null||n.forEach(s=>{s(t,{get width(){return qa(t,e)},get height(){return Za(t,e)}})})}function Qa(t){t.forEach(Ja)}function tl(){typeof ResizeObserver>"u"||(it=new ResizeObserver(Qa))}function el(t,e){it||tl();const n=Wi(t);return n.forEach(s=>{let i=Yt.get(s);i||(i=new Set,Yt.set(s,i)),i.add(e),it==null||it.observe(s)}),()=>{n.forEach(s=>{const i=Yt.get(s);i==null||i.delete(e),i!=null&&i.size||it==null||it.unobserve(s)})}}const qt=new Set;let yt;function nl(){yt=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};qt.forEach(e=>e(t))},window.addEventListener("resize",yt)}function sl(t){return qt.add(t),yt||nl(),()=>{qt.delete(t),!qt.size&&typeof yt=="function"&&(window.removeEventListener("resize",yt),yt=void 0)}}function Xn(t,e){return typeof t=="function"?sl(t):el(t,e)}function il(t){return Tn(t)&&t.tagName==="svg"}const ol=[...Oi,k,X],rl=t=>ol.find(ji(t)),Yn=()=>({translate:0,scale:1,origin:0,originPoint:0}),vt=()=>({x:Yn(),y:Yn()}),qn=()=>({min:0,max:0}),F=()=>({x:qn(),y:qn()}),al=new WeakMap;function le(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function It(t){return typeof t=="string"||Array.isArray(t)}const wn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Sn=["initial",...wn];function ce(t){return le(t.animate)||Sn.some(e=>It(t[e]))}function _i(t){return!!(ce(t)||t.variants)}function ll(t,e,n){for(const s in e){const i=e[s],r=n[s];if(N(i))t.addValue(s,i);else if(N(r))t.addValue(s,Pt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,Pt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const ze={current:null},Xi={current:!1},cl=typeof window<"u";function ul(){if(Xi.current=!0,!!cl)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ze.current=t.matches;t.addEventListener("change",e),e()}else ze.current=!1}const Zn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let se={};function Yi(t){se=t}function hl(){return se}class fl{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:o,visualState:a},l={}){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=fn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=U.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,M.render(this.render,!1,!0))};const{latestValues:u,renderState:c}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=ce(n),this.isVariantNode=_i(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in h){const m=h[d];u[d]!==void 0&&N(m)&&m.set(u[d])}}mount(e){var n,s;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=e,al.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((i,r)=>this.bindToMotionValue(r,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Xi.current||ul(),this.shouldReduceMotion=ze.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),rt(this.notifyUpdate),rt(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const s=this.features[n];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Ua.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:u,duration:c}=n.accelerate,f=new Mi({element:this.current,name:e,keyframes:a,times:l,ease:u,duration:K(c)}),h=o(f);this.valueSubscriptions.set(e,()=>{h(),f.cancel()});return}const s=Vt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&M.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r&&r(),n.owner&&n.stop()})}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 se){const n=se[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):F()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<Zn.length;s++){const i=Zn[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=ll(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){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=Pt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(Xs(s)||qs(s))?s=parseFloat(s):!rl(s)&&X.test(n)&&(s=Ui(e,n)),this.setBaseTarget(e,N(s)?s.get():s)),N(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var r;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=pn(this.props,n,(r=this.presenceContext)==null?void 0:r.custom);o&&(s=o[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!N(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new tn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){vn.render(this.render)}}class qi extends fl{constructor(){super(...arguments),this.KeyframeResolver=Na}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;N(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class at{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Zi({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function dl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function ml(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function ve(t){return t===void 0||t===1}function Ge({scale:t,scaleX:e,scaleY:n}){return!ve(t)||!ve(e)||!ve(n)}function ut(t){return Ge(t)||Ji(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ji(t){return Jn(t.x)||Jn(t.y)}function Jn(t){return t&&t!=="0%"}function ie(t,e,n){const s=t-n,i=e*s;return n+i}function Qn(t,e,n,s,i){return i!==void 0&&(t=ie(t,i,s)),ie(t,n,s)+e}function He(t,e=0,n=1,s,i){t.min=Qn(t.min,e,n,s,i),t.max=Qn(t.max,e,n,s,i)}function Qi(t,{x:e,y:n}){He(t.x,e.translate,e.scale,e.originPoint),He(t.y,n.translate,n.scale,n.originPoint)}const ts=.999999999999,es=1.0000000000001;function pl(t,e,n,s=!1){var a;const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let l=0;l<i;l++){r=n[l],o=r.projectionDelta;const{visualElement:u}=r.options;u&&u.props.style&&u.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Tt(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Qi(t,o)),s&&ut(r.latestValues)&&Tt(t,r.latestValues,(a=r.layout)==null?void 0:a.layoutBox))}e.x<es&&e.x>ts&&(e.x=1),e.y<es&&e.y>ts&&(e.y=1)}function xt(t,e){t.min=t.min+e,t.max=t.max+e}function ns(t,e,n,s,i=.5){const r=E(t.min,t.max,i);He(t,e,n,r,s)}function ss(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Tt(t,e,n){const s=n??t;ns(t.x,ss(e.x,s.x),e.scaleX,e.scale,e.originX),ns(t.y,ss(e.y,s.y),e.scaleY,e.scale,e.originY)}function to(t,e){return Zi(ml(t.getBoundingClientRect(),e))}function gl(t,e,n){const s=to(t,n),{scroll:i}=e;return i&&(xt(s.x,i.offset.x),xt(s.y,i.offset.y)),s}const yl={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},vl=At.length;function xl(t,e,n){let s="",i=!0;for(let r=0;r<vl;r++){const o=At[r],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number")l=a===(o.startsWith("scale")?1:0);else{const u=parseFloat(a);l=o.startsWith("scale")?u===1:u===0}if(!l||n){const u=Ki(a,yn[o]);if(!l){i=!1;const c=yl[o]||o;s+=`${c}(${u}) `}n&&(e[o]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function Pn(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const l in e){const u=e[l];if(Vt.has(l)){o=!0;continue}else if(hi(l)){i[l]=u;continue}else{const c=Ki(u,yn[l]);l.startsWith("origin")?(a=!0,r[l]=c):s[l]=c}}if(e.transform||(o||n?s.transform=xl(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=r;s.transformOrigin=`${l} ${u} ${c}`}}function eo(t,{style:e,vars:n},s,i){const r=t.style;let o;for(o in e)r[o]=e[o];i==null||i.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function is(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ct={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(w.test(t))t=parseFloat(t);else return t;const n=is(t,e.target.x),s=is(t,e.target.y);return`${n}% ${s}%`}},Tl={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=X.parse(t);if(i.length>5)return s;const r=X.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const u=E(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),r(i)}},_e={borderRadius:{...Ct,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ct,borderTopRightRadius:Ct,borderBottomLeftRadius:Ct,borderBottomRightRadius:Ct,boxShadow:Tl};function no(t,{layout:e,layoutId:n}){return Vt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!_e[t]||t==="opacity")}function bn(t,e,n){var o;const s=t.style,i=e==null?void 0:e.style,r={};if(!s)return r;for(const a in s)(N(s[a])||i&&N(i[a])||no(a,t)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(r[a]=s[a]);return r}function wl(t){return window.getComputedStyle(t)}class Sl extends qi{constructor(){super(...arguments),this.type="html",this.renderInstance=eo}readValueFromInstance(e,n){var s;if(Vt.has(n))return(s=this.projection)!=null&&s.isProjecting?ke(n):Kr(e,n);{const i=wl(e),r=(hi(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:n}){return to(e,n)}build(e,n,s){Pn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return bn(e,n,s)}}const Pl={offset:"stroke-dashoffset",array:"stroke-dasharray"},bl={offset:"strokeDashoffset",array:"strokeDasharray"};function Al(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Pl:bl;t[r.offset]=`${-s}`,t[r.array]=`${e} ${n}`}const Vl=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function so(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},l,u,c){if(Pn(t,a,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:h}=t;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete f.transformBox);for(const d of Vl)f[d]!==void 0&&(h[d]=f[d],delete f[d]);e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),s!==void 0&&(f.scale=s),i!==void 0&&Al(f,i,r,o,!1)}const io=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"]),oo=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Cl(t,e,n,s){eo(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(io.has(i)?i:gn(i),e.attrs[i])}function ro(t,e,n){const s=bn(t,e,n);for(const i in t)if(N(t[i])||N(e[i])){const r=At.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}class Ml extends qi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=F}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Vt.has(n)){const s=Ni(n);return s&&s.default||0}return n=io.has(n)?n:gn(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return ro(e,n,s)}build(e,n,s){so(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){Cl(e,n,s,i)}mount(e){this.isSVGTag=oo(e.tagName),super.mount(e)}}const Dl=Sn.length;function ao(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?ao(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Dl;n++){const s=Sn[n],i=t.props[s];(It(i)||i===!1)&&(e[s]=i)}return e}function lo(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const El=[...wn].reverse(),Rl=wn.length;function Ll(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Ma(t,n,s)))}function kl(t){let e=Ll(t),n=os(),s=!0,i=!1;const r=u=>(c,f)=>{var d;const h=wt(t,f,u==="exit"?(d=t.presenceContext)==null?void 0:d.custom:void 0);if(h){const{transition:m,transitionEnd:p,...g}=h;c={...c,...g,...p}}return c};function o(u){e=u(t)}function a(u){const{props:c}=t,f=ao(t.parent)||{},h=[],d=new Set;let m={},p=1/0;for(let y=0;y<Rl;y++){const T=El[y],v=n[T],S=c[T]!==void 0?c[T]:f[T],P=It(S),C=T===u?v.isActive:null;C===!1&&(p=y);let L=S===f[T]&&S!==c[T]&&P;if(L&&(s||i)&&t.manuallyAnimateOnMount&&(L=!1),v.protectedKeys={...m},!v.isActive&&C===null||!S&&!v.prevProp||le(S)||typeof S=="boolean")continue;if(T==="exit"&&v.isActive&&C!==!0){v.prevResolvedValues&&(m={...m,...v.prevResolvedValues});continue}const A=Fl(v.prevProp,S);let V=A||T===u&&v.isActive&&!L&&P||y>p&&P,b=!1;const D=Array.isArray(S)?S:[S];let B=D.reduce(r(T),{});C===!1&&(B={});const{prevResolvedValues:tt={}}=v,Y={...tt,...B},et=j=>{V=!0,d.has(j)&&(b=!0,d.delete(j)),v.needsAnimating[j]=!0;const $=t.getValue(j);$&&($.liveStyle=!1)};for(const j in Y){const $=B[j],lt=tt[j];if(m.hasOwnProperty(j))continue;let mt=!1;Ne($)&&Ne(lt)?mt=!lo($,lt):mt=$!==lt,mt?$!=null?et(j):d.add(j):$!==void 0&&d.has(j)?et(j):v.protectedKeys[j]=!0}v.prevProp=S,v.prevResolvedValues=B,v.isActive&&(m={...m,...B}),(s||i)&&t.blockInitialAnimation&&(V=!1);const q=L&&A;V&&(!q||b)&&h.push(...D.map(j=>{const $={type:T};if(typeof j=="string"&&(s||i)&&!q&&t.manuallyAnimateOnMount&&t.parent){const{parent:lt}=t,mt=wt(lt,j);if(lt.enteringChildren&&mt){const{delayChildren:ko}=mt.transition||{};$.delay=Ei(lt.enteringChildren,t,ko)}}return{animation:j,options:$}}))}if(d.size){const y={};if(typeof c.initial!="boolean"){const T=wt(t,Array.isArray(c.initial)?c.initial[0]:c.initial);T&&T.transition&&(y.transition=T.transition)}d.forEach(T=>{const v=t.getBaseTarget(T),S=t.getValue(T);S&&(S.liveStyle=!0),y[T]=v??null}),h.push({animation:y})}let g=!!h.length;return s&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(g=!1),s=!1,i=!1,g?e(h):Promise.resolve()}function l(u,c){var h;if(n[u].isActive===c)return Promise.resolve();(h=t.variantChildren)==null||h.forEach(d=>{var m;return(m=d.animationState)==null?void 0:m.setActive(u,c)}),n[u].isActive=c;const f=a(u);for(const d in n)n[d].protectedKeys={};return f}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=os(),i=!0}}}function Fl(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!lo(e,t):!1}function ct(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function os(){return{animate:ct(!0),whileInView:ct(),whileHover:ct(),whileTap:ct(),whileDrag:ct(),whileFocus:ct(),exit:ct()}}function rs(t,e){t.min=e.min,t.max=e.max}function H(t,e){rs(t.x,e.x),rs(t.y,e.y)}function as(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const co=1e-4,Il=1-co,Bl=1+co,uo=.01,jl=0-uo,Ol=0+uo;function W(t){return t.max-t.min}function Nl(t,e,n){return Math.abs(t-e)<=n}function ls(t,e,n,s=.5){t.origin=s,t.originPoint=E(e.min,e.max,t.origin),t.scale=W(n)/W(e),t.translate=E(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Il&&t.scale<=Bl||isNaN(t.scale))&&(t.scale=1),(t.translate>=jl&&t.translate<=Ol||isNaN(t.translate))&&(t.translate=0)}function Rt(t,e,n,s){ls(t.x,e.x,n.x,s?s.originX:void 0),ls(t.y,e.y,n.y,s?s.originY:void 0)}function cs(t,e,n){t.min=n.min+e.min,t.max=t.min+W(e)}function Ul(t,e,n){cs(t.x,e.x,n.x),cs(t.y,e.y,n.y)}function us(t,e,n){t.min=e.min-n.min,t.max=t.min+W(e)}function oe(t,e,n){us(t.x,e.x,n.x),us(t.y,e.y,n.y)}function hs(t,e,n,s,i){return t-=e,t=ie(t,1/n,s),i!==void 0&&(t=ie(t,1/i,s)),t}function Wl(t,e=0,n=1,s=.5,i,r=t,o=t){if(J.test(e)&&(e=parseFloat(e),e=E(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=E(r.min,r.max,s);t===r&&(a-=e),t.min=hs(t.min,e,n,a,i),t.max=hs(t.max,e,n,a,i)}function fs(t,e,[n,s,i],r,o){Wl(t,e[n],e[s],e[i],e.scale,r,o)}const Kl=["x","scaleX","originX"],$l=["y","scaleY","originY"];function ds(t,e,n,s){fs(t.x,e,Kl,n?n.x:void 0,s?s.x:void 0),fs(t.y,e,$l,n?n.y:void 0,s?s.y:void 0)}function ms(t){return t.translate===0&&t.scale===1}function ho(t){return ms(t.x)&&ms(t.y)}function ps(t,e){return t.min===e.min&&t.max===e.max}function zl(t,e){return ps(t.x,e.x)&&ps(t.y,e.y)}function gs(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function fo(t,e){return gs(t.x,e.x)&&gs(t.y,e.y)}function ys(t){return W(t.x)/W(t.y)}function vs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Z(t){return[t("x"),t("y")]}function Gl(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:f,rotateY:h,skewX:d,skewY:m}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),f&&(s+=`rotateX(${f}deg) `),h&&(s+=`rotateY(${h}deg) `),d&&(s+=`skewX(${d}deg) `),m&&(s+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const mo=["TopLeft","TopRight","BottomLeft","BottomRight"],Hl=mo.length,xs=t=>typeof t=="string"?parseFloat(t):t,Ts=t=>typeof t=="number"||w.test(t);function _l(t,e,n,s,i,r){i?(t.opacity=E(0,n.opacity??1,Xl(s)),t.opacityExit=E(e.opacity??1,0,Yl(s))):r&&(t.opacity=E(e.opacity??1,n.opacity??1,s));for(let o=0;o<Hl;o++){const a=`border${mo[o]}Radius`;let l=ws(e,a),u=ws(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Ts(l)===Ts(u)?(t[a]=Math.max(E(xs(l),xs(u),s),0),(J.test(u)||J.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=E(e.rotate||0,n.rotate||0,s))}function ws(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Xl=po(0,.5,oi),Yl=po(.5,.95,G);function po(t,e,n){return s=>s<t?0:s>e?1:n(kt(t,e,s))}function ql(t,e,n){const s=N(t)?t:Pt(t);return s.start(mn("",s,e,n)),s.animation}function Bt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const Zl=(t,e)=>t.depth-e.depth;class Jl{constructor(){this.children=[],this.isDirty=!1}add(e){Je(this.children,e),this.isDirty=!0}remove(e){Qt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Zl),this.isDirty=!1,this.children.forEach(e)}}function Ql(t,e){const n=U.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(rt(s),t(r-e))};return M.setup(s,!0),()=>rt(s)}function Zt(t){return N(t)?t.get():t}class tc{constructor(){this.members=[]}add(e){Je(this.members,e);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&(Qt(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(Qt(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let s=this.members.indexOf(e)-1;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1&&((n=i.instance)==null?void 0:n.isConnected)!==!1)return this.promote(i),!0}return!1}promote(e,n){var i;const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:r}=s.options,{layoutDependency:o}=e.options;(r===void 0||r!==o)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),(i=e.root)!=null&&i.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,s,i,r,o;(s=(n=e.options).onExitComplete)==null||s.call(n),(o=(i=e.resumingFrom)==null?void 0:(r=i.options).onExitComplete)==null||o.call(r)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const Jt={hasAnimatedSinceResize:!0,hasEverUpdated:!1},xe=["","X","Y","Z"],ec=1e3;let nc=0;function Te(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function go(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Ii(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",M,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&go(s)}function yo({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=nc++,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,this.nodes.forEach(oc),this.nodes.forEach(cc),this.nodes.forEach(uc),this.nodes.forEach(rc)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Jl)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new tn),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Tn(o)&&!il(o),this.instance=o;const{layoutId:a,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let c,f=0;const h=()=>this.root.updateBlockedByResize=!1;M.read(()=>{f=window.innerWidth}),t(o,()=>{const d=window.innerWidth;d!==f&&(f=d,this.root.updateBlockedByResize=!0,c&&c(),c=Ql(h,250),Jt.hasAnimatedSinceResize&&(Jt.hasAnimatedSinceResize=!1,this.nodes.forEach(bs)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||pc,{onLayoutAnimationStart:p,onLayoutAnimationComplete:g}=u.getProps(),y=!this.targetLayout||!fo(this.targetLayout,d),T=!f&&h;if(this.options.layoutRoot||this.resumeFrom||T||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...dn(m,"layout"),onPlay:p,onComplete:g};(u.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(c,T)}else f||bs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),rt(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(hc),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&go(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const f=this.path[c];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Ss);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ps);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(lc),this.nodes.forEach(sc),this.nodes.forEach(ic)):this.nodes.forEach(Ps),this.clearAllSnapshots();const a=U.now();O.delta=Q(0,1e3/60,a-O.timestamp),O.timestamp=a,O.isProcessing=!0,he.update.process(O),he.preRender.process(O),he.render.process(O),O.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,vn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ac),this.sharedNodes.forEach(fc)}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&&!W(this.snapshot.measuredBox.x)&&!W(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=F(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!ho(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||ut(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),gc(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return F();const a=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(yc))){const{scroll:c}=this.root;c&&(xt(a.x,c.offset.x),xt(a.y,c.offset.y))}return a}removeElementScroll(o){var l;const a=F();if(H(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:f,options:h}=c;c!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&H(a,o),xt(a.x,f.offset.x),xt(a.y,f.offset.y))}return a}applyTransform(o,a=!1){var u,c;const l=F();H(l,o);for(let f=0;f<this.path.length;f++){const h=this.path[f];!a&&h.options.layoutScroll&&h.scroll&&h!==h.root&&Tt(l,{x:-h.scroll.offset.x,y:-h.scroll.offset.y}),ut(h.latestValues)&&Tt(l,h.latestValues,(u=h.layout)==null?void 0:u.layoutBox)}return ut(this.latestValues)&&Tt(l,this.latestValues,(c=this.layout)==null?void 0:c.layoutBox),l}removeTransform(o){var l;const a=F();H(a,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];if(!ut(c.latestValues))continue;let f;c.instance&&(Ge(c.latestValues)&&c.updateSnapshot(),f=F(),H(f,c.measurePageBox())),ds(a,c.latestValues,(l=c.snapshot)==null?void 0:l.layoutBox,f)}return ut(this.latestValues)&&ds(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}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!==O.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var d;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:f}=this.options;if(!this.layout||!(c||f))return;this.resolvedRelativeTargetAt=O.timestamp;const h=this.getClosestProjectingParent();h&&this.linkedParentVersion!==h.layoutVersion&&!h.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=F(),this.targetWithTransforms=F()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Ul(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):H(this.target,this.layout.layoutBox),Qi(this.target,this.targetDelta)):H(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Ge(this.parent.latestValues)||Ji(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=F(),this.relativeTargetOrigin=F(),oe(this.relativeTargetOrigin,a,l),H(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===O.timestamp&&(l=!1),l)return;const{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;H(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;pl(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=F());const{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(as(this.prevProjectionDelta.x,this.projectionDelta.x),as(this.prevProjectionDelta.y,this.projectionDelta.y)),Rt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!vs(this.projectionDelta.x,this.prevProjectionDelta.x)||!vs(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=vt(),this.projectionDelta=vt(),this.projectionDeltaWithTransform=vt()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},f=vt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=F(),d=l?l.source:void 0,m=this.layout?this.layout.source:void 0,p=d!==m,g=this.getStack(),y=!g||g.members.length<=1,T=!!(p&&!y&&this.options.crossfade===!0&&!this.path.some(mc));this.animationProgress=0;let v;this.mixTargetDelta=S=>{const P=S/1e3;As(f.x,o.x,P),As(f.y,o.y,P),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(oe(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),dc(this.relativeTarget,this.relativeTargetOrigin,h,P),v&&zl(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=F()),H(v,this.relativeTarget)),p&&(this.animationValues=c,_l(c,u,this.latestValues,P,T,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(rt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=M.update(()=>{Jt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Pt(0)),this.motionValue.jump(0,!1),this.currentAnimation=ql(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),o.onUpdate&&o.onUpdate(c)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.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);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ec),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&vo(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||F();const f=W(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const h=W(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}H(a,l),Tt(a,c),Rt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new tc),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&Te("z",o,u,this.animationValues);for(let c=0;c<xe.length;c++)Te(`rotate${xe[c]}`,o,u,this.animationValues),Te(`skew${xe[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Zt(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Zt(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!ut(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=Gl(this.projectionDeltaWithTransform,this.treeScale,c);l&&(f=l(c,f)),o.transform=f;const{x:h,y:d}=this.projectionDelta;o.transformOrigin=`${h.origin*100}% ${d.origin*100}% 0`,u.animationValues?o.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:o.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const m in _e){if(c[m]===void 0)continue;const{correct:p,applyTo:g,isCSSVariable:y}=_e[m],T=f==="none"?c[m]:p(c[m],u);if(g){const v=g.length;for(let S=0;S<v;S++)o[g[S]]=T}else y?this.options.visualElement.renderState.vars[m]=T:o[m]=T}this.options.layoutId&&(o.pointerEvents=u===this?Zt(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Ss),this.root.sharedNodes.clear()}}}function sc(t){t.updateLayout()}function ic(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:r}=t.options,o=e.source!==t.layout.source;r==="size"?Z(f=>{const h=o?e.measuredBox[f]:e.layoutBox[f],d=W(h);h.min=s[f].min,h.max=h.min+d}):vo(r,e.layoutBox,s)&&Z(f=>{const h=o?e.measuredBox[f]:e.layoutBox[f],d=W(s[f]);h.max=h.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[f].max=t.relativeTarget[f].min+d)});const a=vt();Rt(a,s,e.layoutBox);const l=vt();o?Rt(l,t.applyTransform(i,!0),e.measuredBox):Rt(l,s,e.layoutBox);const u=!ho(a);let c=!1;if(!t.resumeFrom){const f=t.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:d}=f;if(h&&d){const m=F();oe(m,e.layoutBox,h.layoutBox);const p=F();oe(p,s,d.layoutBox),fo(m,p)||(c=!0),f.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=m,t.relativeParent=f)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:e,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function oc(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function rc(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ac(t){t.clearSnapshot()}function Ss(t){t.clearMeasurements()}function Ps(t){t.isLayoutDirty=!1}function lc(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function bs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function cc(t){t.resolveTargetDelta()}function uc(t){t.calcProjection()}function hc(t){t.resetSkewAndRotation()}function fc(t){t.removeLeadSnapshot()}function As(t,e,n){t.translate=E(e.translate,0,n),t.scale=E(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Vs(t,e,n,s){t.min=E(e.min,n.min,s),t.max=E(e.max,n.max,s)}function dc(t,e,n,s){Vs(t.x,e.x,n.x,s),Vs(t.y,e.y,n.y,s)}function mc(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const pc={duration:.45,ease:[.4,0,.1,1]},Cs=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ms=Cs("applewebkit/")&&!Cs("chrome/")?Math.round:G;function Ds(t){t.min=Ms(t.min),t.max=Ms(t.max)}function gc(t){Ds(t.x),Ds(t.y)}function vo(t,e,n){return t==="position"||t==="preserve-aspect"&&!Nl(ys(e),ys(n),.2)}function yc(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const vc=yo({attachResizeListener:(t,e)=>Bt(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),we={current:void 0},xo=yo({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!we.current){const t=new vc({});t.mount(window),t.setOptions({layoutScroll:!0}),we.current=t}return we.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),An=x.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Es(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function xc(...t){return e=>{let n=!1;const s=t.map(i=>{const r=Es(i,e);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<s.length;i++){const r=s[i];typeof r=="function"?r():Es(t[i],null)}}}}function Tc(...t){return x.useCallback(xc(...t),t)}class wc extends x.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(_t(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,i=_t(s)&&s.offsetWidth||0,r=_t(s)&&s.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=i-a.width-a.left,a.bottom=r-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Sc({children:t,isPresent:e,anchorX:n,anchorY:s,root:i,pop:r}){var h;const o=x.useId(),a=x.useRef(null),l=x.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=x.useContext(An),c=((h=t.props)==null?void 0:h.ref)??(t==null?void 0:t.ref),f=Tc(a,c);return x.useInsertionEffect(()=>{const{width:d,height:m,top:p,left:g,right:y,bottom:T}=l.current;if(e||r===!1||!a.current||!d||!m)return;const v=n==="left"?`left: ${g}`:`right: ${y}`,S=s==="bottom"?`bottom: ${T}`:`top: ${p}`;a.current.dataset.motionPopId=o;const P=document.createElement("style");u&&(P.nonce=u);const C=i??document.head;return C.appendChild(P),P.sheet&&P.sheet.insertRule(`
|
|
2
|
+
[data-motion-pop-id="${o}"] {
|
|
3
|
+
position: absolute !important;
|
|
4
|
+
width: ${d}px !important;
|
|
5
|
+
height: ${m}px !important;
|
|
6
|
+
${v}px !important;
|
|
7
|
+
${S}px !important;
|
|
8
|
+
}
|
|
9
|
+
`),()=>{C.contains(P)&&C.removeChild(P)}},[e]),I.jsx(wc,{isPresent:e,childRef:a,sizeRef:l,pop:r,children:r===!1?t:x.cloneElement(t,{ref:f})})}const Pc=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a,anchorY:l,root:u})=>{const c=Ze(bc),f=x.useId();let h=!0,d=x.useMemo(()=>(h=!1,{id:f,initial:e,isPresent:n,custom:i,onExitComplete:m=>{c.set(m,!0);for(const p of c.values())if(!p)return;s&&s()},register:m=>(c.set(m,!1),()=>c.delete(m))}),[n,c,s]);return r&&h&&(d={...d}),x.useMemo(()=>{c.forEach((m,p)=>c.set(p,!1))},[n]),x.useEffect(()=>{!n&&!c.size&&s&&s()},[n]),t=I.jsx(Sc,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:u,children:t}),I.jsx(ae.Provider,{value:d,children:t})};function bc(){return new Map}function To(t=!0){const e=x.useContext(ae);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,r=x.useId();x.useEffect(()=>{if(t)return i(r)},[t]);const o=x.useCallback(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,o]:[!0]}const $t=t=>t.key||"";function Rs(t){const e=[];return x.Children.forEach(t,n=>{x.isValidElement(n)&&e.push(n)}),e}const Ac=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:a="left",anchorY:l="top",root:u})=>{const[c,f]=To(o),h=x.useMemo(()=>Rs(t),[t]),d=o&&!c?[]:h.map($t),m=x.useRef(!0),p=x.useRef(h),g=Ze(()=>new Map),y=x.useRef(new Set),[T,v]=x.useState(h),[S,P]=x.useState(h);_s(()=>{m.current=!1,p.current=h;for(let A=0;A<S.length;A++){const V=$t(S[A]);d.includes(V)?(g.delete(V),y.current.delete(V)):g.get(V)!==!0&&g.set(V,!1)}},[S,d.length,d.join("-")]);const C=[];if(h!==T){let A=[...h];for(let V=0;V<S.length;V++){const b=S[V],D=$t(b);d.includes(D)||(A.splice(V,0,b),C.push(b))}return r==="wait"&&C.length&&(A=C),P(Rs(A)),v(h),null}const{forceRender:L}=x.useContext(qe);return I.jsx(I.Fragment,{children:S.map(A=>{const V=$t(A),b=o&&!c?!1:h===S||d.includes(V),D=()=>{if(y.current.has(V))return;if(y.current.add(V),g.has(V))g.set(V,!0);else return;let B=!0;g.forEach(tt=>{tt||(B=!1)}),B&&(L==null||L(),P(p.current),o&&(f==null||f()),s&&s())};return I.jsx(Pc,{isPresent:b,initial:!m.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,root:u,onExitComplete:b?void 0:D,anchorX:a,anchorY:l,children:A},V)})})},wo=x.createContext({strict:!1}),Ls={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"]};let ks=!1;function Vc(){if(ks)return;const t={};for(const e in Ls)t[e]={isEnabled:n=>Ls[e].some(s=>!!n[s])};Yi(t),ks=!0}function So(){return Vc(),hl()}function Cc(t){const e=So();for(const n in t)e[n]={...e[n],...t[n]};Yi(e)}const Mc=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"]);function re(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Mc.has(t)}let Po=t=>!re(t);function Dc(t){typeof t=="function"&&(Po=e=>e.startsWith("on")?!re(e):t(e))}try{Dc(require("@emotion/is-prop-valid").default)}catch{}function Ec(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(Po(i)||n===!0&&re(i)||!e&&!re(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const ue=x.createContext({});function Rc(t,e){if(ce(t)){const{initial:n,animate:s}=t;return{initial:n===!1||It(n)?n:void 0,animate:It(s)?s:void 0}}return t.inherit!==!1?e:{}}function Lc(t){const{initial:e,animate:n}=Rc(t,x.useContext(ue));return x.useMemo(()=>({initial:e,animate:n}),[Fs(e),Fs(n)])}function Fs(t){return Array.isArray(t)?t.join(" "):t}const Vn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function bo(t,e,n){for(const s in e)!N(e[s])&&!no(s,n)&&(t[s]=e[s])}function kc({transformTemplate:t},e){return x.useMemo(()=>{const n=Vn();return Pn(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Fc(t,e){const n=t.style||{},s={};return bo(s,n,t),Object.assign(s,kc(t,e)),s}function Ic(t,e){const n={},s=Fc(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const Ao=()=>({...Vn(),attrs:{}});function Bc(t,e,n,s){const i=x.useMemo(()=>{const r=Ao();return so(r,e,oo(s),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};bo(r,t.style,t),i.style={...r,...i.style}}return i}const jc=["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 Cn(t){return typeof t!="string"||t.includes("-")?!1:!!(jc.indexOf(t)>-1||/[A-Z]/u.test(t))}function Oc(t,e,n,{latestValues:s},i,r=!1,o){const l=(o??Cn(t)?Bc:Ic)(e,s,i,t),u=Ec(e,typeof t=="string",r),c=t!==x.Fragment?{...u,...l,ref:n}:{},{children:f}=e,h=x.useMemo(()=>N(f)?f.get():f,[f]);return x.createElement(t,{...c,children:h})}function Nc({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:Uc(n,s,i,t),renderState:e()}}function Uc(t,e,n,s){const i={},r=s(t,{});for(const h in r)i[h]=Zt(r[h]);let{initial:o,animate:a}=t;const l=ce(t),u=_i(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const f=c?a:o;if(f&&typeof f!="boolean"&&!le(f)){const h=Array.isArray(f)?f:[f];for(let d=0;d<h.length;d++){const m=pn(t,h[d]);if(m){const{transitionEnd:p,transition:g,...y}=m;for(const T in y){let v=y[T];if(Array.isArray(v)){const S=c?v.length-1:0;v=v[S]}v!==null&&(i[T]=v)}for(const T in p)i[T]=p[T]}}}return i}const Vo=t=>(e,n)=>{const s=x.useContext(ue),i=x.useContext(ae),r=()=>Nc(t,e,s,i);return n?r():Ze(r)},Wc=Vo({scrapeMotionValuesFromProps:bn,createRenderState:Vn}),Kc=Vo({scrapeMotionValuesFromProps:ro,createRenderState:Ao}),$c=Symbol.for("motionComponentSymbol");function zc(t,e,n){const s=x.useRef(n);x.useInsertionEffect(()=>{s.current=n});const i=x.useRef(null);return x.useCallback(r=>{var a;r&&((a=t.onMount)==null||a.call(t,r));const o=s.current;if(typeof o=="function")if(r){const l=o(r);typeof l=="function"&&(i.current=l)}else i.current?(i.current(),i.current=null):o(r);else o&&(o.current=r);e&&(r?e.mount(r):e.unmount())},[e])}const Co=x.createContext({});function pt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Gc(t,e,n,s,i,r){var v,S;const{visualElement:o}=x.useContext(ue),a=x.useContext(wo),l=x.useContext(ae),u=x.useContext(An),c=u.reducedMotion,f=u.skipAnimations,h=x.useRef(null),d=x.useRef(!1);s=s||a.renderer,!h.current&&s&&(h.current=s(t,{visualState:e,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,skipAnimations:f,isSVG:r}),d.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const m=h.current,p=x.useContext(Co);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&Hc(h.current,n,i,p);const g=x.useRef(!1);x.useInsertionEffect(()=>{m&&g.current&&m.update(n,l)});const y=n[Fi],T=x.useRef(!!y&&typeof window<"u"&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,y))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,y)));return _s(()=>{d.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),T.current&&m.animationState&&m.animationState.animateChanges())}),x.useEffect(()=>{m&&(!T.current&&m.animationState&&m.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{var P;(P=window.MotionHandoffMarkAsComplete)==null||P.call(window,y)}),T.current=!1),m.enteringChildren=void 0)}),m}function Hc(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Mo(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&pt(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:c,layoutScroll:l,layoutRoot:u})}function Mo(t){if(t)return t.options.allowProjection!==!1?t.projection:Mo(t.parent)}function Se(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&Cc(s);const r=n?n==="svg":Cn(t),o=r?Kc:Wc;function a(u,c){let f;const h={...x.useContext(An),...u,layoutId:_c(u)},{isStatic:d}=h,m=Lc(u),p=o(u,d);if(!d&&typeof window<"u"){Xc();const g=Yc(h);f=g.MeasureLayout,m.visualElement=Gc(t,p,h,i,g.ProjectionNode,r)}return I.jsxs(ue.Provider,{value:m,children:[f&&m.visualElement?I.jsx(f,{visualElement:m.visualElement,...h}):null,Oc(t,u,zc(p,m.visualElement,c),p,d,e,r)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=x.forwardRef(a);return l[$c]=t,l}function _c({layoutId:t}){const e=x.useContext(qe).id;return e&&t!==void 0?e+"-"+t:t}function Xc(t,e){x.useContext(wo).strict}function Yc(t){const e=So(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n!=null&&n.isEnabled(t)||s!=null&&s.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function qc(t,e){if(typeof Proxy>"u")return Se;const n=new Map,s=(r,o)=>Se(r,o,t,e),i=(r,o)=>s(r,o);return new Proxy(i,{get:(r,o)=>o==="create"?s:(n.has(o)||n.set(o,Se(o,void 0,t,e)),n.get(o))})}const Zc=(t,e)=>e.isSVG??Cn(t)?new Ml(e):new Sl(e,{allowProjection:t!==x.Fragment});class Jc extends at{constructor(e){super(e),e.animationState||(e.animationState=kl(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();le(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let Qc=0;class tu extends at{constructor(){super(...arguments),this.id=Qc++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const eu={animation:{Feature:Jc},exit:{Feature:tu}};function Ut(t){return{point:{x:t.pageX,y:t.pageY}}}const nu=t=>e=>xn(e)&&t(e,Ut(e));function Lt(t,e,n,s){return Bt(t,e,nu(n),s)}const Do=({current:t})=>t?t.ownerDocument.defaultView:null,Is=(t,e)=>Math.abs(t-e);function su(t,e){const n=Is(t.x,e.x),s=Is(t.y,e.y);return Math.sqrt(n**2+s**2)}const Bs=new Set(["auto","scroll"]);class Eo{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3,element:a}={}){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=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=zt(this.lastRawMoveEventInfo,this.transformPagePoint));const d=Pe(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,p=su(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!p)return;const{point:g}=d,{timestamp:y}=O;this.history.push({...g,timestamp:y});const{onStart:T,onMove:v}=this.handlers;m||(T&&T(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,d)},this.handlePointerMove=(d,m)=>{this.lastMoveEvent=d,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=zt(m,this.transformPagePoint),M.update(this.updatePoint,!0)},this.handlePointerUp=(d,m)=>{this.end();const{onEnd:p,onSessionEnd:g,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=Pe(d.type==="pointercancel"?this.lastMoveEventInfo:zt(m,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,T),g&&g(d,T)},!xn(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const l=Ut(e),u=zt(l,this.transformPagePoint),{point:c}=u,{timestamp:f}=O;this.history=[{...c,timestamp:f}];const{onSessionStart:h}=n;h&&h(e,Pe(u,this.history)),this.removeListeners=jt(Lt(this.contextWindow,"pointermove",this.handlePointerMove),Lt(this.contextWindow,"pointerup",this.handlePointerUp),Lt(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Bs.has(s.overflowX)||Bs.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.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){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:i.x-n.x,y:i.y-n.y};r.x===0&&r.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,i),M.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),rt(this.updatePoint)}}function zt(t,e){return e?{point:e(t.point)}:t}function js(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Pe({point:t},e){return{point:t,delta:js(t,Ro(e)),offset:js(t,iu(e)),velocity:ou(e,.1)}}function iu(t){return t[0]}function Ro(t){return t[t.length-1]}function ou(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Ro(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>K(e)));)n--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&i.timestamp-s.timestamp>K(e)*2&&(s=t[1]);const r=z(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function ru(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?E(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?E(n,t,s.max):Math.min(t,n)),t}function Os(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function au(t,{top:e,left:n,bottom:s,right:i}){return{x:Os(t.x,n,i),y:Os(t.y,e,s)}}function Ns(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function lu(t,e){return{x:Ns(t.x,e.x),y:Ns(t.y,e.y)}}function cu(t,e){let n=.5;const s=W(t),i=W(e);return i>s?n=kt(e.min,e.max-s,t.min):s>i&&(n=kt(t.min,t.max-i,e.min)),Q(0,1,n)}function uu(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Xe=.35;function hu(t=Xe){return t===!1?t=0:t===!0&&(t=Xe),{x:Us(t,"left","right"),y:Us(t,"top","bottom")}}function Us(t,e,n){return{min:Ws(t,e),max:Ws(t,n)}}function Ws(t,e){return typeof t=="number"?t:t[e]||0}const fu=new WeakMap;class du{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=F(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=f=>{n&&this.snapToCursor(Ut(f).point),this.stopAnimation()},o=(f,h)=>{const{drag:d,dragPropagation:m,onDragStart:p}=this.getProps();if(d&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Wa(d),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Z(y=>{let T=this.getAxisMotionValue(y).get()||0;if(J.test(T)){const{projection:v}=this.visualElement;if(v&&v.layout){const S=v.layout.layoutBox[y];S&&(T=W(S)*(parseFloat(T)/100))}}this.originPoint[y]=T}),p&&M.update(()=>p(f,h),!1,!0),Ue(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:d,dragDirectionLock:m,onDirectionLock:p,onDrag:g}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:y}=h;if(m&&this.currentDirection===null){this.currentDirection=pu(y),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),g&&M.update(()=>g(f,h),!1,!0)},l=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new Eo(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:s,contextWindow:Do(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!s)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&M.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Gt(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=ru(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){var r;const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(r=this.visualElement.projection)==null?void 0:r.layout,i=this.constraints;e&&pt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=au(s.layoutBox,e):this.constraints=!1,this.elastic=hu(n),i!==this.constraints&&!pt(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&Z(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=uu(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!pt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=gl(s,i.root,this.visualElement.getTransformPagePoint());let o=lu(i.layout.layoutBox,r);if(n){const a=n(dl(o));this.hasMutatedConstraints=!!a,a&&(o=Zi(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Z(c=>{if(!Gt(c,n,this.currentDirection))return;let f=l&&l[c]||{};o&&(f={min:0,max:0});const h=i?200:1e6,d=i?40:1e7,m={type:"inertia",velocity:s?e[c]:0,bounceStiffness:h,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...f};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Ue(this.visualElement,e),s.start(mn(e,s,0,n,this.visualElement,!1))}stopAnimation(){Z(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){Z(n=>{const{drag:s}=this.getProps();if(!Gt(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n],l=r.get()||0;r.set(e[n]-E(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!pt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Z(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=cu({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),Z(o=>{if(!Gt(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(E(l,u,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;fu.set(this.visualElement,this);const e=this.visualElement.current,n=Lt(e,"pointerdown",u=>{const{drag:c,dragListener:f=!0}=this.getProps(),h=u.target,d=h!==e&&_a(h);c&&f&&!d&&this.start(u)});let s;const i=()=>{const{dragConstraints:u}=this.getProps();pt(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),s||(s=mu(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),M.read(i);const a=Bt(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:c})=>{this.isDragging&&c&&(Z(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=u[f].translate,h.set(h.get()+u[f].translate))}),this.visualElement.render())}));return()=>{a(),n(),o(),l&&l(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=Xe,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function Ks(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function mu(t,e,n){const s=Xn(t,Ks(n)),i=Xn(e,Ks(n));return()=>{s(),i()}}function Gt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function pu(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class gu extends at{constructor(e){super(e),this.removeGroupControls=G,this.removeListeners=G,this.controls=new du(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||G}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const be=t=>(e,n)=>{t&&M.update(()=>t(e,n),!1,!0)};class yu extends at{constructor(){super(...arguments),this.removePointerDownListener=G}onPointerDown(e){this.session=new Eo(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Do(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:be(e),onStart:be(n),onMove:be(s),onEnd:(r,o)=>{delete this.session,i&&M.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=Lt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Ae=!1;class vu extends x.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),Ae&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Jt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,{projection:o}=s;return o&&(o.isPresent=r,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Ae=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||M.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),vn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;Ae=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Lo(t){const[e,n]=To(),s=x.useContext(qe);return I.jsx(vu,{...t,layoutGroup:s,switchLayoutGroup:x.useContext(Co),isPresent:e,safeToRemove:n})}const xu={pan:{Feature:yu},drag:{Feature:gu,ProjectionNode:xo,MeasureLayout:Lo}};function $s(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&M.postRender(()=>r(e,Ut(e)))}class Tu extends at{mount(){const{current:e}=this.node;e&&(this.unmount=$a(e,(n,s)=>($s(this.node,s,"Start"),i=>$s(this.node,i,"End"))))}unmount(){}}class wu extends at{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=jt(Bt(this.node.current,"focus",()=>this.onFocus()),Bt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function zs(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&M.postRender(()=>r(e,Ut(e)))}class Su extends at{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=Ya(e,(i,r)=>(zs(this.node,r,"Start"),(o,{success:a})=>zs(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(s==null?void 0:s.tap)===!1})}unmount(){}}const Ye=new WeakMap,Ve=new WeakMap,Pu=t=>{const e=Ye.get(t.target);e&&e(t)},bu=t=>{t.forEach(Pu)};function Au({root:t,...e}){const n=t||document;Ve.has(n)||Ve.set(n,{});const s=Ve.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(bu,{root:t,...e})),s[i]}function Vu(t,e,n){const s=Au(e);return Ye.set(t,n),s.observe(t),()=>{Ye.delete(t),s.unobserve(t)}}const Cu={some:0,all:1};class Mu extends at{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Cu[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:f}=this.node.getProps(),h=u?c:f;h&&h(l)};return Vu(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Du(e,n))&&this.startObserver()}unmount(){}}function Du({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Eu={inView:{Feature:Mu},tap:{Feature:Su},focus:{Feature:wu},hover:{Feature:Tu}},Ru={layout:{ProjectionNode:xo,MeasureLayout:Lo}},Lu={...eu,...Eu,...xu,...Ru},Gs=qc(Lu,Zc),ku={sm:"max-w-sm",md:"max-w-lg",lg:"max-w-2xl"},Hs='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ou({open:t,onClose:e,title:n,children:s,footer:i,size:r="md",hideCloseButton:o=!1,ariaLabel:a}){const l=x.useRef(null),u=x.useRef(null),c=x.useId(),f=x.useCallback(h=>{if(h.key==="Escape"){e();return}if(h.key!=="Tab"||!l.current)return;const d=Array.from(l.current.querySelectorAll(Hs)).filter(y=>y.offsetParent!==null);if(d.length===0){h.preventDefault(),l.current.focus();return}const m=d[0],p=d[d.length-1],g=document.activeElement;h.shiftKey&&(g===m||g===l.current)?(h.preventDefault(),p.focus()):!h.shiftKey&&g===p&&(h.preventDefault(),m.focus())},[e]);return x.useEffect(()=>{if(!t)return;u.current=document.activeElement,document.addEventListener("keydown",f);const h=requestAnimationFrame(()=>{const d=l.current;if(!d)return;(d.querySelector(Hs)??d).focus()});return()=>{var d,m;document.removeEventListener("keydown",f),cancelAnimationFrame(h),(m=(d=u.current)==null?void 0:d.focus)==null||m.call(d)}},[t,f]),I.jsx(Ac,{children:t&&I.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",children:[I.jsx(Gs.div,{className:"absolute inset-0 titan-menu-overlay",onClick:e,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15}}),I.jsxs(Gs.div,{ref:l,role:"dialog","aria-modal":"true","aria-labelledby":n?c:void 0,"aria-label":n?void 0:a,tabIndex:-1,className:Io("relative w-full mx-4 titan-modal-surface outline-none",ku[r]),initial:{opacity:0,y:-16,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-16,scale:.97},transition:{duration:.2,ease:"easeOut"},children:[n&&I.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--theme-menu-border)"},children:[I.jsx("h2",{id:c,className:"text-base font-semibold",style:{color:"var(--theme-ink)",fontFamily:"var(--theme-font-display)"},children:n}),!o&&I.jsx("button",{type:"button",onClick:e,className:"titan-close-btn","aria-label":"Close",children:I.jsx(Fo,{size:16})})]}),I.jsx("div",{className:"px-4 py-4",style:{color:"var(--theme-ink)",fontFamily:"var(--theme-font-display)"},children:s}),i&&I.jsx("div",{className:"flex items-center justify-end gap-2 px-4 py-3",style:{borderTop:"1px solid var(--theme-menu-border)"},children:i})]})]})})}export{Ac as A,Ou as M,Gs as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,b as y,j as e,i as U,Z as K,A as O,h as G,a8 as B,a9 as E,ao as T,E as D}from"./index-CUgepw5Q.js";import{P as L}from"./PageHeader-bnc85wQN.js";import{R as V}from"./refresh-cw-CwDpzXUn.js";import{S as $}from"./save-CjTPAQM0.js";import{C as F}from"./circle-check-big-CAFcaPPH.js";import{E as M}from"./external-link-D_ji4Bec.js";import{S as H}from"./search-BP7VlNxX.js";import"./chevron-right-CQ1NTOtd.js";const _={enabled:!1,apiKey:"",cuopt:{enabled:!1,url:"http://localhost:5000"},asr:{enabled:!1,grpcUrl:"localhost:50051",healthUrl:"http://localhost:9000"},openshell:{enabled:!1,binaryPath:"openshell",policyPath:""}};function v({status:s}){const l={unknown:"bg-border-light",checking:"bg-[#eab308] animate-pulse",healthy:"bg-success",unhealthy:"bg-error"},d={unknown:"Not checked",checking:"Checking...",healthy:"Healthy",unhealthy:"Unreachable"};return e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-text-muted",children:[e.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${l[s]}`}),d[s]]})}function f({title:s,description:l,icon:d,enabled:i,onToggle:h,children:p}){return e.jsxs("div",{className:`rounded-xl border bg-bg-secondary transition-colors ${i?"border-[#76b900]/30":"border-bg-tertiary"}`,children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`flex h-9 w-9 items-center justify-center rounded-lg ${i?"bg-nvidia/15":"bg-bg-tertiary"}`,children:e.jsx(d,{className:`h-4.5 w-4.5 ${i?"text-nvidia":"text-text-muted"}`})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text",children:s}),e.jsx("p",{className:"text-xs text-text-muted mt-0.5",children:l})]})]}),e.jsx("button",{onClick:h,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${i?"bg-nvidia":"bg-border"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform ${i?"translate-x-6":"translate-x-1"}`})})]}),i&&e.jsx("div",{className:"border-t border-bg-tertiary px-5 py-4 space-y-3",children:p})]})}function u({id:s,label:l,value:d,onChange:i,placeholder:h,type:p="text",secret:x=!1}){const[m,b]=c.useState(!1);return e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:l}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:s,name:s,type:x&&!m?"password":p,value:d,onChange:n=>i(n.target.value),placeholder:h,className:"w-full rounded-lg border border-border bg-bg px-3 py-2 pr-10 text-sm text-text outline-none focus:border-[#76b900] transition-colors"}),x&&e.jsx("button",{type:"button",onClick:()=>b(!m),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary",children:m?e.jsx(T,{className:"h-4 w-4"}):e.jsx(D,{className:"h-4 w-4"})})]})]})}function ee(){const[s,l]=c.useState(_),[d,i]=c.useState(!0),[h,p]=c.useState(!1),[x,m]=c.useState(null),[b,n]=c.useState({cuopt:"unknown",asr:"unknown",nim:"unknown"}),[g,j]=c.useState(!1),N=c.useCallback((t,a)=>{m({type:t,message:a}),setTimeout(()=>m(null),3e3)},[]);c.useEffect(()=>{(async()=>{var a,o,w,S,k,A,I,C;try{const r=await B();r.nvidia&&(l({enabled:r.nvidia.enabled??!1,apiKey:"",cuopt:{enabled:((a=r.nvidia.cuopt)==null?void 0:a.enabled)??!1,url:((o=r.nvidia.cuopt)==null?void 0:o.url)??"http://localhost:5000"},asr:{enabled:((w=r.nvidia.asr)==null?void 0:w.enabled)??!1,grpcUrl:((S=r.nvidia.asr)==null?void 0:S.grpcUrl)??"localhost:50051",healthUrl:((k=r.nvidia.asr)==null?void 0:k.healthUrl)??"http://localhost:9000"},openshell:{enabled:((A=r.nvidia.openshell)==null?void 0:A.enabled)??!1,binaryPath:((I=r.nvidia.openshell)==null?void 0:I.binaryPath)??"openshell",policyPath:((C=r.nvidia.openshell)==null?void 0:C.policyPath)??""}}),j(r.nvidia.apiKeySet??!1))}catch{}finally{i(!1)}})()},[]);const P=c.useCallback(async()=>{if(s.cuopt.enabled){n(t=>({...t,cuopt:"checking"}));try{const a=await(await y("/api/nvidia/health/cuopt")).json();n(o=>({...o,cuopt:a.healthy?"healthy":"unhealthy"}))}catch{n(t=>({...t,cuopt:"unhealthy"}))}}if(s.asr.enabled){n(t=>({...t,asr:"checking"}));try{const a=await(await y("/api/nvidia/health/asr")).json();n(o=>({...o,asr:a.healthy?"healthy":"unhealthy"}))}catch{n(t=>({...t,asr:"unhealthy"}))}}if(g||s.apiKey){n(t=>({...t,nim:"checking"}));try{const a=await(await y("/api/nvidia/health/nim")).json();n(o=>({...o,nim:a.healthy?"healthy":"unhealthy"}))}catch{n(t=>({...t,nim:"unhealthy"}))}}},[s.cuopt.enabled,s.asr.enabled,g,s.apiKey]),R=async()=>{p(!0);try{const t={nvidia:{enabled:s.enabled,cuopt:s.cuopt,asr:s.asr,openshell:s.openshell}};s.apiKey&&(t.nvidia.apiKey=s.apiKey),await E(t),N("success","NVIDIA configuration saved"),s.apiKey&&(j(!0),l(a=>({...a,apiKey:""})))}catch(t){N("error",t instanceof Error?t.message:"Failed to save")}finally{p(!1)}};return d?e.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((t,a)=>e.jsx("div",{className:"h-20 animate-pulse rounded-xl border border-border bg-bg-secondary"},a))}):e.jsxs("div",{className:"space-y-6 max-w-3xl",children:[e.jsx(L,{title:"NVIDIA",subtitle:"GPU-accelerated AI services — NIM, cuOpt, Nemotron-ASR, OpenShell",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"System"},{label:"GPU"}],actions:e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:P,className:"flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs text-text-secondary hover:bg-bg-tertiary transition-colors",children:[e.jsx(V,{className:"h-3.5 w-3.5"}),"Check Health"]}),e.jsxs("button",{onClick:R,disabled:h,className:"flex items-center gap-2 rounded-lg bg-nvidia px-4 py-1.5 text-xs font-medium text-black transition-colors hover:bg-nvidia/80 disabled:opacity-50",children:[e.jsx($,{className:"h-3.5 w-3.5"}),h?"Saving...":"Save"]})]})}),x&&e.jsxs("div",{className:`flex items-center gap-2 rounded-lg border px-4 py-2 text-sm ${x.type==="success"?"border-success/50 text-success":"border-error/50 text-error"}`,children:[x.type==="success"?e.jsx(F,{className:"h-4 w-4"}):e.jsx(U,{className:"h-4 w-4"}),x.message]}),e.jsx("div",{className:`rounded-xl border p-5 transition-colors ${s.enabled?"border-[#76b900]/30 bg-nvidia/5":"border-bg-tertiary bg-bg-secondary"}`,children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-medium text-text",children:"Enable NVIDIA Skills"}),e.jsxs("p",{className:"text-xs text-text-muted mt-0.5",children:["Load NVIDIA GPU-accelerated skills (cuOpt, AI-Q Research, etc.) when TITAN starts. Equivalent to setting ",e.jsx("code",{className:"text-nvidia/70 bg-nvidia/10 px-1 rounded",children:"TITAN_NVIDIA=1"})]})]}),e.jsx("button",{onClick:()=>l(t=>({...t,enabled:!t.enabled})),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${s.enabled?"bg-nvidia":"bg-border"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform ${s.enabled?"translate-x-6":"translate-x-1"}`})})]})}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-5 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(K,{className:"h-4 w-4 text-nvidia"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text",children:"NVIDIA NIM API"}),e.jsx("p",{className:"text-xs text-text-muted mt-0.5",children:"Cloud inference for Nemotron 3 Super and other NIM models"})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(v,{status:b.nim}),g&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-success/10 px-2.5 py-0.5 text-xs font-medium text-success",children:[e.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-success"}),"Key configured"]})]})]}),e.jsx(u,{id:"nvidia-api-key",label:"API Key",value:s.apiKey,onChange:t=>l(a=>({...a,apiKey:t})),placeholder:g?"(configured — enter new key to replace)":"nvapi-...",secret:!0}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:["Get your key at"," ",e.jsxs("a",{href:"https://build.nvidia.com",target:"_blank",rel:"noopener noreferrer",className:"text-nvidia hover:underline inline-flex items-center gap-0.5",children:["build.nvidia.com ",e.jsx(M,{className:"h-2.5 w-2.5"})]})]})]}),e.jsxs(f,{title:"cuOpt Optimization",description:"GPU-accelerated routing, scheduling, and mathematical programming (MILP/LP/QP)",icon:O,enabled:s.cuopt.enabled,onToggle:()=>l(t=>({...t,cuopt:{...t.cuopt,enabled:!t.cuopt.enabled}})),children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Service Status"}),e.jsx(v,{status:b.cuopt})]}),e.jsx(u,{id:"nvidia-cuopt-url",label:"cuOpt Server URL",value:s.cuopt.url,onChange:t=>l(a=>({...a,cuopt:{...a.cuopt,url:t}})),placeholder:"http://localhost:5000"}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:["Start cuOpt: ",e.jsx("code",{className:"bg-bg-tertiary px-1.5 py-0.5 rounded text-text-secondary",children:"docker compose -f docker-compose.nvidia.yml --profile cuopt up -d"})]})]}),e.jsxs(f,{title:"Nemotron-ASR Streaming",description:"NVIDIA speech recognition with 24ms median finalization — replaces faster-whisper for voice chat",icon:H,enabled:s.asr.enabled,onToggle:()=>l(t=>({...t,asr:{...t.asr,enabled:!t.asr.enabled}})),children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Service Status"}),e.jsx(v,{status:b.asr})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(u,{id:"nvidia-asr-grpc-url",label:"gRPC Address",value:s.asr.grpcUrl,onChange:t=>l(a=>({...a,asr:{...a.asr,grpcUrl:t}})),placeholder:"localhost:50051"}),e.jsx(u,{id:"nvidia-asr-health-url",label:"Health Check URL",value:s.asr.healthUrl,onChange:t=>l(a=>({...a,asr:{...a.asr,healthUrl:t}})),placeholder:"http://localhost:9000"})]}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:["Start ASR: ",e.jsx("code",{className:"bg-bg-tertiary px-1.5 py-0.5 rounded text-text-secondary",children:"docker compose -f docker-compose.nvidia.yml --profile asr up -d"})]}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:["VRAM: ~3-4 GB. Set ",e.jsx("code",{className:"bg-bg-tertiary px-1 rounded text-text-secondary",children:"STT_ENGINE=nemotron-asr"})," in voice agent env."]})]}),e.jsxs(f,{title:"OpenShell Sandbox",description:"NVIDIA secure sandbox runtime for code execution with declarative policy enforcement",icon:G,enabled:s.openshell.enabled,onToggle:()=>l(t=>({...t,openshell:{...t.openshell,enabled:!t.openshell.enabled}})),children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(u,{id:"nvidia-openshell-binary-path",label:"Binary Path",value:s.openshell.binaryPath,onChange:t=>l(a=>({...a,openshell:{...a.openshell,binaryPath:t}})),placeholder:"openshell"}),e.jsx(u,{id:"nvidia-openshell-policy-path",label:"Policy File Path (optional)",value:s.openshell.policyPath,onChange:t=>l(a=>({...a,openshell:{...a.openshell,policyPath:t}})),placeholder:"Auto-detected"})]}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:["When enabled, code execution uses OpenShell instead of Docker. Set ",e.jsx("code",{className:"bg-bg-tertiary px-1 rounded text-text-secondary",children:'sandbox.engine: "openshell"'})," in config."]})]}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-5",children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-3",children:"VRAM Budget (RTX 5090, 32 GB)"}),e.jsxs("div",{className:"space-y-2",children:[[{label:"Nemotron 3 Nano 30B",vram:"~24 GB",note:"Full local inference"},{label:"Nemotron 3 Nano 4B",vram:"~3 GB",note:"Lightweight variant"},{label:"Nemotron-ASR",vram:"~3-4 GB",note:"Speech recognition"},{label:"cuOpt",vram:"~2-4 GB",note:"Optimization solver"}].map(({label:t,vram:a,note:o})=>e.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-text",children:t}),e.jsx("span",{className:"text-[10px] text-text-muted ml-2",children:o})]}),e.jsx("span",{className:"text-xs font-mono text-nvidia",children:a})]},t)),e.jsx("div",{className:"border-t border-bg-tertiary pt-2 mt-2",children:e.jsx("p",{className:"text-[10px] text-text-muted",children:"Recommended: Nano 4B + ASR + cuOpt = ~10 GB, leaving room for other models. Or use NIM cloud API for LLM inference (0 GB local)."})})]})]}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-5",children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-2",children:"Quick Start"}),e.jsxs("div",{className:"space-y-2 text-xs text-text-muted",children:[e.jsx("p",{children:"Start all NVIDIA services:"}),e.jsx("code",{className:"block bg-bg border border-bg-tertiary rounded-lg px-3 py-2 text-text-secondary font-mono text-xs",children:"docker compose -f docker-compose.nvidia.yml --profile all up -d"}),e.jsx("p",{className:"mt-2",children:"Or start individual services:"}),e.jsxs("div",{className:"space-y-1 font-mono text-[10px] text-text-muted",children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-nvidia",children:"cuopt:"})," --profile cuopt"]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-nvidia",children:"asr:"})," --profile asr (includes Riva bridge)"]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-nvidia",children:"voice:"})," --profile voice (ASR + bridge)"]})]})]})]})]})}export{ee as default};
|
|
1
|
+
import{r as o,b as y,j as e,k as U,Z as K,A as O,i as G,aa as B,ab as E,aq as T,E as D}from"./index-Cml2x9pA.js";import{P as L}from"./PageHeader-DdrbS1aq.js";import{R as V}from"./refresh-cw-C-iZkzuS.js";import{S as $}from"./save-DwR9wQVu.js";import{C as F}from"./circle-check-big-Bkba568b.js";import{E as M}from"./external-link-DZ_rZsIt.js";import{S as H}from"./search-D10l0m3-.js";import"./chevron-right-DbLSHmff.js";const _={enabled:!1,apiKey:"",cuopt:{enabled:!1,url:"http://localhost:5000"},asr:{enabled:!1,grpcUrl:"localhost:50051",healthUrl:"http://localhost:9000"},openshell:{enabled:!1,binaryPath:"openshell",policyPath:""}};function v({status:s}){const l={unknown:"bg-border-light",checking:"bg-[#eab308] animate-pulse",healthy:"bg-success",unhealthy:"bg-error"},d={unknown:"Not checked",checking:"Checking...",healthy:"Healthy",unhealthy:"Unreachable"};return e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-text-muted",children:[e.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${l[s]}`}),d[s]]})}function f({title:s,description:l,icon:d,enabled:i,onToggle:h,children:p}){return e.jsxs("div",{className:`rounded-xl border bg-bg-secondary transition-colors ${i?"border-[#76b900]/30":"border-bg-tertiary"}`,children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`flex h-9 w-9 items-center justify-center rounded-lg ${i?"bg-nvidia/15":"bg-bg-tertiary"}`,children:e.jsx(d,{className:`h-4.5 w-4.5 ${i?"text-nvidia":"text-text-muted"}`})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text",children:s}),e.jsx("p",{className:"text-xs text-text-muted mt-0.5",children:l})]})]}),e.jsx("button",{onClick:h,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${i?"bg-nvidia":"bg-border"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform ${i?"translate-x-6":"translate-x-1"}`})})]}),i&&e.jsx("div",{className:"border-t border-bg-tertiary px-5 py-4 space-y-3",children:p})]})}function u({id:s,label:l,value:d,onChange:i,placeholder:h,type:p="text",secret:x=!1}){const[m,b]=o.useState(!1);return e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:l}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:s,name:s,type:x&&!m?"password":p,value:d,onChange:n=>i(n.target.value),placeholder:h,className:"w-full rounded-lg border border-border bg-bg px-3 py-2 pr-10 text-sm text-text outline-none focus:border-[#76b900] transition-colors"}),x&&e.jsx("button",{type:"button",onClick:()=>b(!m),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary",children:m?e.jsx(T,{className:"h-4 w-4"}):e.jsx(D,{className:"h-4 w-4"})})]})]})}function ee(){const[s,l]=o.useState(_),[d,i]=o.useState(!0),[h,p]=o.useState(!1),[x,m]=o.useState(null),[b,n]=o.useState({cuopt:"unknown",asr:"unknown",nim:"unknown"}),[g,j]=o.useState(!1),N=o.useCallback((t,a)=>{m({type:t,message:a}),setTimeout(()=>m(null),3e3)},[]);o.useEffect(()=>{(async()=>{var a,c,w,S,k,A,I,C;try{const r=await B();r.nvidia&&(l({enabled:r.nvidia.enabled??!1,apiKey:"",cuopt:{enabled:((a=r.nvidia.cuopt)==null?void 0:a.enabled)??!1,url:((c=r.nvidia.cuopt)==null?void 0:c.url)??"http://localhost:5000"},asr:{enabled:((w=r.nvidia.asr)==null?void 0:w.enabled)??!1,grpcUrl:((S=r.nvidia.asr)==null?void 0:S.grpcUrl)??"localhost:50051",healthUrl:((k=r.nvidia.asr)==null?void 0:k.healthUrl)??"http://localhost:9000"},openshell:{enabled:((A=r.nvidia.openshell)==null?void 0:A.enabled)??!1,binaryPath:((I=r.nvidia.openshell)==null?void 0:I.binaryPath)??"openshell",policyPath:((C=r.nvidia.openshell)==null?void 0:C.policyPath)??""}}),j(r.nvidia.apiKeySet??!1))}catch{}finally{i(!1)}})()},[]);const P=o.useCallback(async()=>{if(s.cuopt.enabled){n(t=>({...t,cuopt:"checking"}));try{const a=await(await y("/api/nvidia/health/cuopt")).json();n(c=>({...c,cuopt:a.healthy?"healthy":"unhealthy"}))}catch{n(t=>({...t,cuopt:"unhealthy"}))}}if(s.asr.enabled){n(t=>({...t,asr:"checking"}));try{const a=await(await y("/api/nvidia/health/asr")).json();n(c=>({...c,asr:a.healthy?"healthy":"unhealthy"}))}catch{n(t=>({...t,asr:"unhealthy"}))}}if(g||s.apiKey){n(t=>({...t,nim:"checking"}));try{const a=await(await y("/api/nvidia/health/nim")).json();n(c=>({...c,nim:a.healthy?"healthy":"unhealthy"}))}catch{n(t=>({...t,nim:"unhealthy"}))}}},[s.cuopt.enabled,s.asr.enabled,g,s.apiKey]),R=async()=>{p(!0);try{const t={nvidia:{enabled:s.enabled,cuopt:s.cuopt,asr:s.asr,openshell:s.openshell}};s.apiKey&&(t.nvidia.apiKey=s.apiKey),await E(t),N("success","NVIDIA configuration saved"),s.apiKey&&(j(!0),l(a=>({...a,apiKey:""})))}catch(t){N("error",t instanceof Error?t.message:"Failed to save")}finally{p(!1)}};return d?e.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((t,a)=>e.jsx("div",{className:"h-20 animate-pulse rounded-xl border border-border bg-bg-secondary"},a))}):e.jsxs("div",{className:"space-y-6 max-w-3xl",children:[e.jsx(L,{title:"NVIDIA",subtitle:"GPU-accelerated AI services — NIM, cuOpt, Nemotron-ASR, OpenShell",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"System"},{label:"GPU"}],actions:e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:P,className:"flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs text-text-secondary hover:bg-bg-tertiary transition-colors",children:[e.jsx(V,{className:"h-3.5 w-3.5"}),"Check Health"]}),e.jsxs("button",{onClick:R,disabled:h,className:"flex items-center gap-2 rounded-lg bg-nvidia px-4 py-1.5 text-xs font-medium text-black transition-colors hover:bg-nvidia/80 disabled:opacity-50",children:[e.jsx($,{className:"h-3.5 w-3.5"}),h?"Saving...":"Save"]})]})}),x&&e.jsxs("div",{className:`flex items-center gap-2 rounded-lg border px-4 py-2 text-sm ${x.type==="success"?"border-success/50 text-success":"border-error/50 text-error"}`,children:[x.type==="success"?e.jsx(F,{className:"h-4 w-4"}):e.jsx(U,{className:"h-4 w-4"}),x.message]}),e.jsx("div",{className:`rounded-xl border p-5 transition-colors ${s.enabled?"border-[#76b900]/30 bg-nvidia/5":"border-bg-tertiary bg-bg-secondary"}`,children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-medium text-text",children:"Enable NVIDIA Skills"}),e.jsxs("p",{className:"text-xs text-text-muted mt-0.5",children:["Load NVIDIA GPU-accelerated skills (cuOpt, AI-Q Research, etc.) when TITAN starts. Equivalent to setting ",e.jsx("code",{className:"text-nvidia/70 bg-nvidia/10 px-1 rounded",children:"TITAN_NVIDIA=1"})]})]}),e.jsx("button",{onClick:()=>l(t=>({...t,enabled:!t.enabled})),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${s.enabled?"bg-nvidia":"bg-border"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform ${s.enabled?"translate-x-6":"translate-x-1"}`})})]})}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-5 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(K,{className:"h-4 w-4 text-nvidia"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text",children:"NVIDIA NIM API"}),e.jsx("p",{className:"text-xs text-text-muted mt-0.5",children:"Cloud inference for Nemotron 3 Super and other NIM models"})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(v,{status:b.nim}),g&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-success/10 px-2.5 py-0.5 text-xs font-medium text-success",children:[e.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-success"}),"Key configured"]})]})]}),e.jsx(u,{id:"nvidia-api-key",label:"API Key",value:s.apiKey,onChange:t=>l(a=>({...a,apiKey:t})),placeholder:g?"(configured — enter new key to replace)":"nvapi-...",secret:!0}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:["Get your key at"," ",e.jsxs("a",{href:"https://build.nvidia.com",target:"_blank",rel:"noopener noreferrer",className:"text-nvidia hover:underline inline-flex items-center gap-0.5",children:["build.nvidia.com ",e.jsx(M,{className:"h-2.5 w-2.5"})]})]})]}),e.jsxs(f,{title:"cuOpt Optimization",description:"GPU-accelerated routing, scheduling, and mathematical programming (MILP/LP/QP)",icon:O,enabled:s.cuopt.enabled,onToggle:()=>l(t=>({...t,cuopt:{...t.cuopt,enabled:!t.cuopt.enabled}})),children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Service Status"}),e.jsx(v,{status:b.cuopt})]}),e.jsx(u,{id:"nvidia-cuopt-url",label:"cuOpt Server URL",value:s.cuopt.url,onChange:t=>l(a=>({...a,cuopt:{...a.cuopt,url:t}})),placeholder:"http://localhost:5000"}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:["Start cuOpt: ",e.jsx("code",{className:"bg-bg-tertiary px-1.5 py-0.5 rounded text-text-secondary",children:"docker compose -f docker-compose.nvidia.yml --profile cuopt up -d"})]})]}),e.jsxs(f,{title:"Nemotron-ASR Streaming",description:"NVIDIA speech recognition with 24ms median finalization — replaces faster-whisper for voice chat",icon:H,enabled:s.asr.enabled,onToggle:()=>l(t=>({...t,asr:{...t.asr,enabled:!t.asr.enabled}})),children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Service Status"}),e.jsx(v,{status:b.asr})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(u,{id:"nvidia-asr-grpc-url",label:"gRPC Address",value:s.asr.grpcUrl,onChange:t=>l(a=>({...a,asr:{...a.asr,grpcUrl:t}})),placeholder:"localhost:50051"}),e.jsx(u,{id:"nvidia-asr-health-url",label:"Health Check URL",value:s.asr.healthUrl,onChange:t=>l(a=>({...a,asr:{...a.asr,healthUrl:t}})),placeholder:"http://localhost:9000"})]}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:["Start ASR: ",e.jsx("code",{className:"bg-bg-tertiary px-1.5 py-0.5 rounded text-text-secondary",children:"docker compose -f docker-compose.nvidia.yml --profile asr up -d"})]}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:["VRAM: ~3-4 GB. Set ",e.jsx("code",{className:"bg-bg-tertiary px-1 rounded text-text-secondary",children:"STT_ENGINE=nemotron-asr"})," in voice agent env."]})]}),e.jsxs(f,{title:"OpenShell Sandbox",description:"NVIDIA secure sandbox runtime for code execution with declarative policy enforcement",icon:G,enabled:s.openshell.enabled,onToggle:()=>l(t=>({...t,openshell:{...t.openshell,enabled:!t.openshell.enabled}})),children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(u,{id:"nvidia-openshell-binary-path",label:"Binary Path",value:s.openshell.binaryPath,onChange:t=>l(a=>({...a,openshell:{...a.openshell,binaryPath:t}})),placeholder:"openshell"}),e.jsx(u,{id:"nvidia-openshell-policy-path",label:"Policy File Path (optional)",value:s.openshell.policyPath,onChange:t=>l(a=>({...a,openshell:{...a.openshell,policyPath:t}})),placeholder:"Auto-detected"})]}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:["When enabled, code execution uses OpenShell instead of Docker. Set ",e.jsx("code",{className:"bg-bg-tertiary px-1 rounded text-text-secondary",children:'sandbox.engine: "openshell"'})," in config."]})]}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-5",children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-3",children:"VRAM Budget (RTX 5090, 32 GB)"}),e.jsxs("div",{className:"space-y-2",children:[[{label:"Nemotron 3 Nano 30B",vram:"~24 GB",note:"Full local inference"},{label:"Nemotron 3 Nano 4B",vram:"~3 GB",note:"Lightweight variant"},{label:"Nemotron-ASR",vram:"~3-4 GB",note:"Speech recognition"},{label:"cuOpt",vram:"~2-4 GB",note:"Optimization solver"}].map(({label:t,vram:a,note:c})=>e.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-text",children:t}),e.jsx("span",{className:"text-[10px] text-text-muted ml-2",children:c})]}),e.jsx("span",{className:"text-xs font-mono text-nvidia",children:a})]},t)),e.jsx("div",{className:"border-t border-bg-tertiary pt-2 mt-2",children:e.jsx("p",{className:"text-[10px] text-text-muted",children:"Recommended: Nano 4B + ASR + cuOpt = ~10 GB, leaving room for other models. Or use NIM cloud API for LLM inference (0 GB local)."})})]})]}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-5",children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-2",children:"Quick Start"}),e.jsxs("div",{className:"space-y-2 text-xs text-text-muted",children:[e.jsx("p",{children:"Start all NVIDIA services:"}),e.jsx("code",{className:"block bg-bg border border-bg-tertiary rounded-lg px-3 py-2 text-text-secondary font-mono text-xs",children:"docker compose -f docker-compose.nvidia.yml --profile all up -d"}),e.jsx("p",{className:"mt-2",children:"Or start individual services:"}),e.jsxs("div",{className:"space-y-1 font-mono text-[10px] text-text-muted",children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-nvidia",children:"cuopt:"})," --profile cuopt"]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-nvidia",children:"asr:"})," --profile asr (includes Riva bridge)"]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-nvidia",children:"voice:"})," --profile voice (ASR + bridge)"]})]})]})]})]})}export{ee as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as b,r as t,bI as h,bJ as f,j as e,P as d,i as p,bK as u}from"./index-Cml2x9pA.js";import{P as j}from"./PageHeader-DdrbS1aq.js";import{R as y}from"./refresh-cw-C-iZkzuS.js";import{C as v}from"./circle-check-big-Bkba568b.js";import"./chevron-right-DbLSHmff.js";function O(){const{toast:r}=b(),[o,m]=t.useState([]),[l,x]=t.useState({}),[c,n]=t.useState(!0),i=t.useCallback(async()=>{n(!0);try{const[s,a]=await Promise.all([h(),f()]);m(s.alerts||[]),x(a)}catch(s){r("error",`Couldn't load the organism monitor — try again. ${s.message}`)}n(!1)},[r]);t.useEffect(()=>{i()},[i]);const g=async s=>{try{await u(s),r("success","Alert acknowledged."),await i()}catch(a){r("error",`Couldn't acknowledge the alert — try again. ${a.message}`)}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(j,{title:"Organism Monitor",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Safety"},{label:"Organism"}]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs("button",{onClick:i,disabled:c,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#27272a] text-[#a1a1aa] text-sm font-medium hover:bg-[#3f3f46] disabled:opacity-50",children:[e.jsx(y,{className:`w-4 h-4 ${c?"animate-spin":""}`})," Refresh"]})}),Object.keys(l).length>0&&e.jsx("div",{className:"grid grid-cols-4 gap-2",children:Object.entries(l).map(([s,a])=>e.jsxs("div",{className:"p-2 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsx("div",{className:"text-xs text-[#52525b] capitalize",children:s}),e.jsx("div",{className:"text-sm font-semibold text-[#e4e4e7]",children:typeof a=="number"?a.toFixed(2):a})]},s))}),e.jsx("div",{className:"space-y-2",children:o.map(s=>e.jsxs("div",{className:`flex items-center justify-between p-3 rounded-lg border ${s.severity==="critical"?"bg-red-950/20 border-red-900/50":s.severity==="warning"?"bg-amber-950/20 border-amber-900/50":"bg-[#0a0a0f] border-[#27272a]"}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[s.severity==="critical"?e.jsx(d,{className:"w-4 h-4 text-red-400"}):s.severity==="warning"?e.jsx(d,{className:"w-4 h-4 text-amber-400"}):e.jsx(p,{className:"w-4 h-4 text-[#6366f1]"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-[#e4e4e7]",children:s.message}),e.jsxs("div",{className:"text-xs text-[#52525b]",children:[s.source," • ",new Date(s.timestamp).toLocaleString()]})]})]}),!s.acknowledged&&e.jsxs("button",{onClick:()=>g(s.id),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md bg-[#27272a] text-[#a1a1aa] text-xs hover:bg-[#3f3f46]",children:[e.jsx(v,{className:"w-3.5 h-3.5"})," Ack"]})]},s.id))})]})}export{O as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as l,j as e,Z as v,A as x,o as f,C as h,by as p}from"./index-Cml2x9pA.js";import{S as a}from"./StatCard-DLq8aBps.js";import{P as c}from"./PageHeader-DdrbS1aq.js";import{S as g}from"./SkeletonLoader-r6OGXaU9.js";import{C as j}from"./clock-JyQAYy6X.js";import{M as b}from"./message-square-CRsG9u6_.js";import{S as y}from"./server-BzisF3LL.js";import{L as S}from"./layers-yzjtGlHB.js";import"./chevron-right-DbLSHmff.js";import"./clsx-B-dksMZM.js";function w(t){const s=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60);return s>0?`${s}d ${r}h ${i}m`:r>0?`${r}h ${i}m`:`${i}m`}function m(t){const s=t/1024/1024;return s>1024?`${(s/1024).toFixed(1)} GB`:`${s.toFixed(0)} MB`}function R(){const[t,s]=l.useState(null),[r,i]=l.useState(null),[d,u]=l.useState(!0),n=async()=>{try{const o=await p();s(o),i(null)}catch(o){i(o instanceof Error?o.message:"Failed to fetch stats")}finally{u(!1)}};return l.useEffect(()=>{n();const o=setInterval(n,1e4);return()=>clearInterval(o)},[]),d?e.jsxs("div",{className:"space-y-4 md:space-y-6",children:[e.jsx(c,{title:"System Overview",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Monitoring"},{label:"Overview"}]}),e.jsx("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:e.jsx(g,{variant:"metric",count:8})})]}):r?e.jsx("div",{className:"rounded-xl border border-error/50 bg-bg-secondary p-6 text-center text-error",children:r}):t?e.jsxs("div",{className:"space-y-4 md:space-y-6",children:[e.jsx(c,{title:"System Overview",subtitle:"Real-time system health and metrics",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Monitoring"},{label:"Overview"}]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[e.jsx(a,{title:"Uptime",value:w(t.uptime),icon:e.jsx(j,{className:"h-5 w-5"})}),e.jsx(a,{title:"Total Requests",value:t.totalRequests.toLocaleString(),icon:e.jsx(v,{className:"h-5 w-5"})}),e.jsx(a,{title:"Active Agents",value:t.activeAgents,icon:e.jsx(x,{className:"h-5 w-5"})}),e.jsx(a,{title:"Active Sessions",value:t.activeSessions,icon:e.jsx(b,{className:"h-5 w-5"})}),e.jsx(a,{title:"Memory Usage",value:m(t.memoryUsage.heapUsed),icon:e.jsx(f,{className:"h-5 w-5"}),subtitle:`${m(t.memoryUsage.heapTotal)} total`}),e.jsx(a,{title:"Model",value:t.model,icon:e.jsx(h,{className:"h-5 w-5"})}),e.jsx(a,{title:"Provider",value:t.provider,icon:e.jsx(y,{className:"h-5 w-5"})}),e.jsx(a,{title:"Version",value:t.version,icon:e.jsx(S,{className:"h-5 w-5"})})]})]}):null}export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,
|
|
1
|
+
import{j as e,K as i}from"./index-Cml2x9pA.js";import{C as r}from"./chevron-right-DbLSHmff.js";function c({title:x,subtitle:l,breadcrumbs:s,actions:n}){return e.jsxs("header",{className:"titan-window-titlebar mb-4 md:mb-6",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[s&&s.length>0&&e.jsx("nav",{className:"flex items-center gap-1 overflow-x-auto pb-1 text-[10px] text-text-muted scrollbar-thin md:text-xs","aria-label":"Breadcrumb",children:s.map((a,t)=>e.jsxs("span",{className:"flex items-center gap-1 flex-shrink-0",children:[t>0&&e.jsx(r,{size:12,className:"opacity-50 flex-shrink-0"}),a.href?e.jsx(i,{to:a.href,className:"whitespace-nowrap transition-colors hover:text-text",children:a.label}):e.jsx("span",{className:t===s.length-1?"text-text-secondary whitespace-nowrap":"",children:a.label})]},t))}),e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsxs("div",{className:"mt-1 hidden h-3.5 w-11 shrink-0 items-center gap-1.5 md:flex","aria-hidden":"true",children:[e.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-error/80"}),e.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-warning/80"}),e.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-success/80"})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"truncate text-lg font-semibold text-text md:text-xl",children:x}),l&&e.jsx("p",{className:"mt-1 max-w-3xl text-[11px] leading-5 text-text-muted md:text-sm",children:l})]})]})]}),n&&e.jsx("div",{className:"flex shrink-0 flex-wrap items-center gap-2 sm:justify-end",children:n})]})}export{c as P};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{c as j,t as g,r,bj as N,bk as u,j as e,bl as v}from"./index-Cml2x9pA.js";import{P as w}from"./PageHeader-DdrbS1aq.js";import{R as y}from"./refresh-cw-C-iZkzuS.js";import{C as h}from"./check-CuRYh4Zh.js";import{P as p}from"./pause-BT1Bc2q3.js";import{V as P}from"./volume-2-DYDBmm3M.js";import{C as k}from"./clock-JyQAYy6X.js";import"./chevron-right-DbLSHmff.js";/**
|
|
2
|
+
* @license lucide-react v0.513.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const T=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],C=j("lock",T);function V(){const{toast:x}=g(),[t,b]=r.useState(null),[a,f]=r.useState(null),[n,o]=r.useState(!0),i=r.useCallback(async()=>{o(!0);try{const[s,l]=await Promise.all([N(),u()]);b(s),f(l)}catch(s){x("error",`Couldn't load persona profiles — try again. (${s.message})`)}o(!1)},[x]);r.useEffect(()=>{i()},[i]);const c=(t==null?void 0:t.enabled)??!1,m=(t==null?void 0:t.profiles)??[];return e.jsxs("div",{className:"space-y-4",children:[e.jsx(w,{title:"Persona Profiles",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Identity"},{label:"Personas"}]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("button",{onClick:i,disabled:n,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#27272a] text-[#a1a1aa] text-sm font-medium hover:bg-[#3f3f46] disabled:opacity-50",children:[e.jsx(y,{className:`w-4 h-4 ${n?"animate-spin":""}`})," Refresh"]})}),c?e.jsxs("div",{className:"p-4 rounded-lg border border-[#27272a] bg-[#0a0a0f] text-sm flex items-start gap-3",children:[e.jsx(h,{className:"w-4 h-4 text-emerald-400 mt-0.5 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-emerald-300 mb-1",children:"Personas enabled"}),e.jsxs("div",{className:"text-[#a1a1aa]",children:["Active right now: ",e.jsx("span",{className:"text-[#e4e4e7] font-medium",children:(a==null?void 0:a.activeName)??"—"}),(a==null?void 0:a.windDown)&&e.jsxs("span",{className:"ml-2 inline-flex items-center gap-1 text-amber-300",children:[e.jsx(p,{className:"w-3 h-3"})," wind-down active"]})]}),e.jsx("div",{className:"text-xs text-[#52525b] mt-1",children:a==null?void 0:a.reason})]})]}):e.jsxs("div",{className:"p-4 rounded-lg border border-amber-900/50 bg-amber-950/20 text-sm",children:[e.jsx("div",{className:"font-semibold text-amber-300 mb-1",children:"Personas disabled"}),e.jsxs("div",{className:"text-[#a1a1aa]",children:["TITAN behaves as a single default persona. To enable Dad Mode (and any other defined profiles), add to ",e.jsx("code",{className:"px-1 py-0.5 rounded bg-[#0a0a0f] text-[#e4e4e7]",children:"~/.titan/titan.json"}),":"]}),e.jsx("pre",{className:"mt-2 p-2 rounded bg-[#0a0a0f] text-xs text-[#a1a1aa] overflow-x-auto",children:`{
|
|
7
|
+
"personas": { "enabled": true }
|
|
8
|
+
}`}),e.jsxs("div",{className:"text-[#a1a1aa] mt-1",children:["Then restart ",e.jsx("code",{className:"px-1 py-0.5 rounded bg-[#0a0a0f]",children:"titan.service"}),"."]})]}),c&&t&&Object.keys(t.channelPins).length>0&&e.jsxs("div",{className:"p-3 rounded-lg border border-[#27272a] bg-[#0a0a0f]",children:[e.jsx("div",{className:"text-xs uppercase tracking-wide text-[#52525b] mb-2",children:"Channel pins"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(t.channelPins).map(([s,l])=>e.jsxs("span",{className:"text-xs px-2 py-1 rounded bg-[#27272a] text-[#a1a1aa]",children:[s," → ",e.jsx("span",{className:"text-[#e4e4e7]",children:l})]},s))})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[m.map(s=>{const l=c&&(a==null?void 0:a.activeId)===s.id;return e.jsxs("div",{className:`p-4 rounded-lg border ${l?"border-emerald-700 bg-emerald-950/20":"border-[#27272a] bg-[#0a0a0f]"}`,children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(v,{className:"w-4 h-4 text-[#6366f1]"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-[#e4e4e7]",children:s.name}),e.jsx("div",{className:"text-xs text-[#52525b]",children:s.id})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[s.windDown&&e.jsxs("span",{title:"windDown=true: pauses autopilot when active",className:"text-xs px-1.5 py-0.5 rounded bg-amber-950/40 text-amber-300 inline-flex items-center gap-1",children:[e.jsx(p,{className:"w-3 h-3"})," wind-down"]}),s.voiceId&&e.jsxs("span",{title:`voiceId: ${s.voiceId}`,className:"text-xs px-1.5 py-0.5 rounded bg-[#27272a] text-[#a1a1aa] inline-flex items-center gap-1",children:[e.jsx(P,{className:"w-3 h-3"})," voice"]}),l&&e.jsxs("span",{className:"text-xs px-1.5 py-0.5 rounded bg-emerald-950/40 text-emerald-300 inline-flex items-center gap-1",children:[e.jsx(h,{className:"w-3 h-3"})," active"]})]})]}),s.description&&e.jsx("div",{className:"text-xs text-[#a1a1aa] mb-3",children:s.description}),s.schedule&&e.jsxs("div",{className:"text-xs text-[#a1a1aa] flex items-center gap-1 mb-2",children:[e.jsx(k,{className:"w-3 h-3"})," ",s.schedule.from," – ",s.schedule.to," local"]}),(s.allowedTools.length>0||s.deniedTools.length>0)&&e.jsxs("div",{className:"space-y-1.5 mt-2",children:[s.allowedTools.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"text-[10px] uppercase tracking-wide text-[#52525b] mb-1 flex items-center gap-1",children:[e.jsx(C,{className:"w-3 h-3"})," allowed only"]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:s.allowedTools.map(d=>e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-[#27272a] text-[#a1a1aa]",children:d},d))})]}),s.deniedTools.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wide text-[#52525b] mb-1",children:"denied"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:s.deniedTools.map(d=>e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-red-950/30 text-red-300",children:d},d))})]})]})]},s.id)}),m.length===0&&!n&&e.jsx("div",{className:"text-sm text-[#52525b] p-3",children:"No persona profiles defined."})]})]})}export{V as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,j as s,
|
|
1
|
+
import{r as a,j as s,a7 as y,a8 as j}from"./index-Cml2x9pA.js";function w(){const[r,g]=a.useState([]),[c,l]=a.useState("default"),[h,f]=a.useState(!0),[o,d]=a.useState(null),[n,x]=a.useState(null),[i,b]=a.useState("all");a.useEffect(()=>{(async()=>{try{const t=await y();g(t.personas),l(t.active)}catch(t){d(t instanceof Error?t.message:"Failed to fetch personas")}finally{f(!1)}})()},[]);const p=a.useMemo(()=>{const e=new Set(r.map(t=>t.division));return["all",...Array.from(e).sort()]},[r]),m=a.useMemo(()=>i==="all"?r:r.filter(e=>e.division===i),[r,i]),v=async e=>{if(!(e===c||n)){x(e);try{const t=await j(e);l(t.active)}catch(t){d(t instanceof Error?t.message:"Failed to switch persona")}finally{x(null)}}};return h?s.jsx("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-3",children:Array.from({length:6}).map((e,t)=>s.jsx("div",{className:"h-32 animate-pulse rounded-xl border border-border bg-bg-secondary"},t))}):o?s.jsx("div",{className:"rounded-xl border border-error/50 bg-bg-secondary p-6 text-center text-error",children:o}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h2",{className:"text-lg font-semibold text-text",children:"Personas"}),s.jsxs("span",{className:"text-sm text-text-muted",children:[r.length," available"]})]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:p.map(e=>s.jsx("button",{onClick:()=>b(e),className:`rounded-lg px-3 py-1.5 text-sm font-medium capitalize transition-colors ${i===e?"bg-accent text-white":"bg-bg-tertiary text-text-secondary hover:text-text"}`,children:e},e))}),s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[m.map(e=>{const t=e.id===c,u=e.id===n;return s.jsxs("button",{onClick:()=>v(e.id),disabled:t||!!n,className:`rounded-xl border p-4 text-left transition-all ${t?"border-accent bg-accent/10 ring-1 ring-accent/30":"border-border bg-bg-secondary hover:border-border-light hover:bg-bg-secondary"} ${u?"opacity-60":""} disabled:cursor-default`,children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[s.jsx("h3",{className:"font-medium text-text",children:e.name}),t&&s.jsx("span",{className:"rounded-full bg-accent/20 px-2 py-0.5 text-xs font-medium text-accent-hover",children:"Active"}),u&&s.jsx("span",{className:"text-xs text-text-secondary",children:"Switching..."})]}),s.jsx("p",{className:"text-sm text-text-secondary line-clamp-2",children:e.description}),s.jsx("p",{className:"mt-2 text-xs capitalize text-text-muted",children:e.division})]},e.id)}),m.length===0&&s.jsx("p",{className:"col-span-full py-12 text-center text-text-muted",children:"No personas in this division"})]})]})}export{w as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as I,r as o,
|
|
1
|
+
import{c as I,r as o,t as B,b1 as H,b2 as F,b3 as K,b4 as U,j as e,b5 as G}from"./index-Cml2x9pA.js";import"./Button-MdXmb4_n.js";import"./Input-CBTwa_Iw.js";import{S}from"./StatusBadge-BqlvIbdj.js";import{P as J}from"./PageHeader-DdrbS1aq.js";import{R as Q}from"./refresh-cw-C-iZkzuS.js";import{R as V}from"./radio-C5c9IyqX.js";import{S as X}from"./shield-check-CXlDJyAW.js";import{C as P}from"./clipboard-list-Dj9tORnu.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DbLSHmff.js";/**
|
|
2
2
|
* @license lucide-react v0.513.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -8,4 +8,4 @@ import{c as I,r as o,J as B,a$ as H,b0 as F,b1 as J,b2 as K,j as e,b3 as U}from"
|
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const ee=[["path",{d:"M13 2a9 9 0 0 1 9 9",key:"1itnx2"}],["path",{d:"M13 6a5 5 0 0 1 5 5",key:"11nki7"}],["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],te=I("phone-call",ee);function x({title:a,value:d,detail:r}){return e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary/70 p-4",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.16em] text-text-muted",children:a}),e.jsx("div",{className:"mt-1 text-lg font-semibold text-text",children:d}),r&&e.jsx("div",{className:"mt-1 text-xs text-text-secondary",children:r})]})}function R(a){const d=Date.now()-new Date(a).getTime();if(!Number.isFinite(d))return"unknown";const r=Math.max(0,Math.floor(d/1e3));return r<60?`${r}s ago`:r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:`${Math.floor(r/86400)}d ago`}function
|
|
11
|
+
*/const ee=[["path",{d:"M13 2a9 9 0 0 1 9 9",key:"1itnx2"}],["path",{d:"M13 6a5 5 0 0 1 5 5",key:"11nki7"}],["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],te=I("phone-call",ee);function x({title:a,value:d,detail:r}){return e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary/70 p-4",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.16em] text-text-muted",children:a}),e.jsx("div",{className:"mt-1 text-lg font-semibold text-text",children:d}),r&&e.jsx("div",{className:"mt-1 text-xs text-text-secondary",children:r})]})}function R(a){const d=Date.now()-new Date(a).getTime();if(!Number.isFinite(d))return"unknown";const r=Math.max(0,Math.floor(d/1e3));return r<60?`${r}s ago`:r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:`${Math.floor(r/86400)}d ago`}function ue(){var k,C,D;const[a,d]=o.useState(null),[r,O]=o.useState([]),[b,A]=o.useState([]),[p,$]=o.useState([]),[h,g]=o.useState(!0),[f,j]=o.useState(null),[n,z]=o.useState(""),[i,v]=o.useState(""),[N,M]=o.useState(""),[y,T]=o.useState("callback"),[u,w]=o.useState(!1),{toast:c}=B(),m=o.useCallback(async()=>{g(!0);try{const[t,E,_,L]=await Promise.all([H().catch(W=>({ok:!1,dograh:{error:W.message}})),F().catch(()=>({workflows:[],count:0})),K(50).catch(()=>({calls:[],count:0})),U().catch(()=>({optOuts:[],count:0}))]);d(t),O(E.workflows),A(_.calls),$(L.optOuts),j(null)}catch(t){j(t instanceof Error?t.message:"Phone Desk refresh failed")}finally{g(!1)}},[]);o.useEffect(()=>{m()},[m]);const q=async()=>{if(!(!n.trim()||!i.trim()||u)){w(!0);try{const t=await G({toNumber:n.trim(),purpose:i.trim(),mode:y,workflowId:N.trim()||void 0});t.status==="pending_approval"?c("success",`Approval queued: ${t.approvalActionId}`):t.status==="started"?c("success","Dograh call started"):c("info","Dograh request recorded"),v(""),await m()}catch(t){c("error",t instanceof Error?t.message:"Call request failed")}finally{w(!1)}}},s=a==null?void 0:a.config,l=a==null?void 0:a.dograh;return e.jsxs("div",{className:"mx-auto max-w-7xl space-y-5 px-4 py-6 md:px-8",children:[e.jsx(J,{title:"Phone Desk",breadcrumbs:[{label:"Tools"},{label:"Phone Desk"}],actions:e.jsxs("button",{onClick:m,disabled:h,className:"inline-flex items-center gap-2 rounded-md border border-border bg-bg-secondary px-3 py-1.5 text-xs text-text-secondary hover:text-text disabled:opacity-50",children:[e.jsx(Q,{size:14,className:h?"animate-spin":""})," Refresh"]})}),f&&e.jsx("div",{className:"rounded-lg border border-error/30 bg-error/10 px-4 py-3 text-sm text-error",children:f}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-4",children:[e.jsx(x,{title:"Dograh",value:a!=null&&a.ok?"Reachable":"Not ready",detail:(l==null?void 0:l.error)||((k=s==null?void 0:s.dograh)==null?void 0:k.baseUrl)||"Optional sidecar"}),e.jsx(x,{title:"Admin numbers",value:String((s==null?void 0:s.adminNumberCount)??0),detail:"Only these callers can control TITAN"}),e.jsx(x,{title:"Public numbers",value:String((s==null?void 0:s.publicNumberCount)??0),detail:"Receptionist/coworker intake lines"}),e.jsx(x,{title:"Campaign mode",value:s!=null&&s.allowCampaigns?"Enabled":"Locked",detail:`${(s==null?void 0:s.maxCallsPerHour)??0}/hour limit`})]}),e.jsxs("div",{className:"grid gap-5 lg:grid-cols-[1fr_1.2fr]",children:[e.jsxs("section",{className:"rounded-2xl border border-border bg-bg-secondary/60 p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[e.jsx(te,{size:16,className:"text-accent-light"}),e.jsx("h2",{className:"text-sm font-semibold text-text",children:"Request outbound call"})]}),e.jsx("p",{className:"mb-4 text-xs leading-relaxed text-text-secondary",children:"TITAN creates an approval request first. It does not dial until a matching Phone Desk approval is consumed."}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("input",{value:n,onChange:t=>z(t.target.value),placeholder:"E.164 number, e.g. +15551234567",className:"w-full rounded-md border border-border bg-bg-tertiary px-3 py-2 text-sm text-text outline-none focus:border-accent"}),e.jsx("input",{value:i,onChange:t=>v(t.target.value),placeholder:"Purpose / objective",className:"w-full rounded-md border border-border bg-bg-tertiary px-3 py-2 text-sm text-text outline-none focus:border-accent"}),e.jsxs("select",{value:N,onChange:t=>M(t.target.value),className:"w-full rounded-md border border-border bg-bg-tertiary px-3 py-2 text-sm text-text outline-none focus:border-accent",children:[e.jsx("option",{value:"",children:"Default outbound workflow"}),r.map(t=>e.jsxs("option",{value:t.id,children:[t.name," (",t.id,")"]},t.id))]}),e.jsxs("select",{value:y,onChange:t=>T(t.target.value),className:"w-full rounded-md border border-border bg-bg-tertiary px-3 py-2 text-sm text-text outline-none focus:border-accent",children:[e.jsx("option",{value:"test",children:"Test call"}),e.jsx("option",{value:"callback",children:"Callback / follow-up"}),e.jsx("option",{value:"campaign",children:"Campaign / cold call (compliance-gated)"})]}),e.jsx("button",{onClick:q,disabled:u||!n.trim()||!i.trim(),className:"w-full rounded-md bg-accent px-3 py-2 text-sm font-medium text-white hover:bg-accent-hover disabled:opacity-50",children:u?"Creating approval…":"Create approval request"})]})]}),e.jsxs("section",{className:"rounded-2xl border border-border bg-bg-secondary/60 p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[e.jsx(V,{size:16,className:"text-accent-light"}),e.jsx("h2",{className:"text-sm font-semibold text-text",children:"Dograh workflows"}),e.jsx(S,{status:`${r.length}`,size:"sm"})]}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:r.length===0?e.jsx("div",{className:"col-span-full rounded-lg border border-border bg-bg-tertiary/40 p-4 text-sm text-text-muted",children:"No workflows returned. Configure Dograh and API key, then refresh."}):r.map(t=>e.jsxs("div",{className:"rounded-lg border border-border bg-bg-tertiary/40 p-3",children:[e.jsx("div",{className:"text-sm font-medium text-text",children:t.name}),e.jsx("div",{className:"mt-1 font-mono text-[11px] text-text-muted",children:t.id})]},t.id))}),e.jsxs("div",{className:"mt-4 grid gap-2 text-xs text-text-secondary sm:grid-cols-2",children:[e.jsxs("div",{className:"rounded-lg border border-border bg-bg-tertiary/30 p-3",children:[e.jsx(X,{size:14,className:"mb-1 text-success"}),"API key configured: ",(C=s==null?void 0:s.dograh)!=null&&C.apiKeyConfigured?"yes":"no"]}),e.jsxs("div",{className:"rounded-lg border border-border bg-bg-tertiary/30 p-3",children:[e.jsx(P,{size:14,className:"mb-1 text-info"}),"Workflow count: ",((D=l==null?void 0:l.workflowCount)==null?void 0:D.active)??"unknown"," active"]})]})]})]}),e.jsxs("div",{className:"grid gap-5 lg:grid-cols-2",children:[e.jsxs("section",{className:"rounded-2xl border border-border bg-bg-secondary/60 p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[e.jsx(P,{size:16,className:"text-accent-light"}),e.jsx("h2",{className:"text-sm font-semibold text-text",children:"Recent call receipts"})]}),e.jsx("div",{className:"divide-y divide-border/50 overflow-hidden rounded-lg border border-border",children:b.length===0?e.jsx("div",{className:"p-4 text-sm text-text-muted",children:"No Dograh call receipts yet."}):b.map(t=>e.jsxs("div",{className:"p-3 text-xs",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"font-medium text-text",children:t.summary}),e.jsx(S,{status:t.status,size:"sm"})]}),e.jsxs("div",{className:"mt-1 flex flex-wrap gap-2 text-text-muted",children:[e.jsx("span",{children:R(t.ts)}),t.mode&&e.jsxs("span",{children:["mode: ",t.mode]}),t.direction&&e.jsx("span",{children:t.direction}),t.workflowRunId!==void 0&&e.jsxs("span",{children:["run: ",String(t.workflowRunId)]})]})]},t.actionId))})]}),e.jsxs("section",{className:"rounded-2xl border border-border bg-bg-secondary/60 p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[e.jsx(Z,{size:16,className:"text-warning"}),e.jsx("h2",{className:"text-sm font-semibold text-text",children:"Opt-outs"})]}),e.jsx("div",{className:"divide-y divide-border/50 overflow-hidden rounded-lg border border-border",children:p.length===0?e.jsx("div",{className:"p-4 text-sm text-text-muted",children:"No campaign opt-outs recorded."}):p.map(t=>e.jsxs("div",{className:"p-3 text-xs",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"font-medium text-text",children:t.phoneRedacted}),e.jsx("span",{className:"text-text-muted",children:R(t.recordedAt)})]}),e.jsx("div",{className:"mt-1 text-text-secondary",children:t.reason})]},`${t.phoneRedacted}-${t.recordedAt}`))})]})]})]})}export{ue as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as g,r as i,aC as b,j as s,aD as j,aE as y}from"./index-Cml2x9pA.js";import{P as w}from"./PageHeader-DdrbS1aq.js";import{E as N}from"./EmptyState-D9kQf1PX.js";import{C as R}from"./ConfirmDialog-VErHWAbo.js";import{R as v}from"./refresh-cw-C-iZkzuS.js";import{B as x}from"./book-open-ohEXgUsS.js";import{P as C}from"./play-Cl1nC_gc.js";import{T as k}from"./trash-2-CTeyjxD_.js";import"./chevron-right-DbLSHmff.js";import"./Button-MdXmb4_n.js";import"./clsx-B-dksMZM.js";import"./Modal-ybPGvlQs.js";function O(){const{toast:a}=g(),[l,u]=i.useState([]),[r,o]=i.useState(!0),[d,m]=i.useState(null),[p,c]=i.useState(null),n=i.useCallback(async()=>{o(!0);try{const e=await b();u(e.recipes||[])}catch(e){a("error",`Couldn't load recipes — try again. (${e.message})`)}o(!1)},[a]);i.useEffect(()=>{n()},[n]);const h=async e=>{m(e);try{await j(e),a("success","Recipe run started.")}catch(t){a("error",`Couldn't run recipe — try again. (${t.message})`)}m(null)},f=async e=>{try{await y(e),await n(),a("success","Recipe deleted.")}catch(t){a("error",`Couldn't delete recipe — try again. (${t.message})`)}};return s.jsxs("div",{className:"space-y-4",children:[s.jsx(w,{title:"Recipe Kitchen",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Tools"},{label:"Recipes"}]}),s.jsx("div",{className:"flex gap-2",children:s.jsxs("button",{onClick:n,disabled:r,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#27272a] text-[#a1a1aa] text-sm font-medium hover:bg-[#3f3f46] disabled:opacity-50",children:[s.jsx(v,{className:`w-4 h-4 ${r?"animate-spin":""}`})," Refresh"]})}),s.jsxs("div",{className:"space-y-2",children:[!r&&l.length===0&&s.jsx(N,{icon:s.jsx(x,{className:"w-8 h-8"}),title:"No recipes yet",description:'Recipes are saved, repeatable workflows — teach TITAN a multi-step task once, run it anytime. Ask in chat: "save what we just did as a recipe called Weekly Report".'}),l.map(e=>{var t;return s.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(x,{className:"w-4 h-4 text-[#6366f1] shrink-0"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm text-[#e4e4e7] truncate",children:e.name}),s.jsx("div",{className:"text-xs text-[#52525b] truncate",children:e.description}),s.jsxs("div",{className:"text-xs text-[#52525b]",children:[e.steps.length," steps • ",(t=e.tags)==null?void 0:t.join(", ")]})]})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs("button",{onClick:()=>h(e.id),disabled:d===e.id,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md bg-[#6366f1] text-white text-xs hover:bg-[#4f46e5] disabled:opacity-50",children:[s.jsx(C,{className:"w-3.5 h-3.5"})," ",d===e.id?"Running...":"Run"]}),s.jsx("button",{onClick:()=>c(e.id),className:"p-1.5 rounded-md bg-[#27272a] text-[#a1a1aa] hover:bg-[#3f3f46] hover:text-red-400",children:s.jsx(k,{className:"w-3.5 h-3.5"})})]})]},e.id)})]}),s.jsx(R,{open:p!==null,title:"Delete recipe?",message:"This can't be undone.",confirmLabel:"Delete",onConfirm:async()=>{const e=p;c(null),e&&await f(e)},onCancel:()=>c(null)})]})}export{O as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as d,b as l,j as e,ai as p}from"./index-Cml2x9pA.js";import{P as u}from"./PageHeader-DdrbS1aq.js";import{S as v}from"./shield-check-CXlDJyAW.js";import"./chevron-right-DbLSHmff.js";const o={critical:"bg-red-500/10 text-red-400 border-red-500/30",high:"bg-orange-500/10 text-orange-400 border-orange-500/30",medium:"bg-yellow-500/10 text-yellow-400 border-yellow-500/30",low:"bg-slate-500/10 text-slate-400 border-slate-500/30",info:"bg-blue-500/10 text-blue-400 border-blue-500/30"},n=["critical","high","medium","low","info"];function S(){const[c,x]=d.useState(null),[m,g]=d.useState(null),[b,h]=d.useState(!0);if(d.useEffect(()=>{Promise.all([l("/api/config",{headers:{"Content-Type":"application/json"}}).then(s=>s.json()).then(s=>s.security||{}).catch(()=>({})),l("/api/security/audit",{headers:{"Content-Type":"application/json"}}).then(s=>s.json()).then(s=>s.findings||[]).catch(()=>[])]).then(([s,r])=>{x(s),g(r)}).finally(()=>h(!1))},[]),b)return e.jsx("div",{className:"text-[var(--text-muted)]",children:"Loading security…"});const t=c||{},a=(m||[]).slice().sort((s,r)=>n.indexOf(s.severity)-n.indexOf(r.severity)),i=n.map(s=>({s,n:a.filter(r=>r.severity===s).length})).filter(s=>s.n>0);return e.jsxs("div",{className:"space-y-6",children:[e.jsx(u,{title:"Security",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Settings"},{label:"Security"}]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Sandbox Mode"}),e.jsx("p",{className:"text-lg font-semibold text-[var(--text)]",children:String(t.sandboxMode||"none")})]}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Shield"}),e.jsx("p",{className:"text-lg font-semibold text-[var(--text)]",children:t.shield?"Enabled":"Disabled"})]}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Denied Tools"}),e.jsx("p",{className:"text-lg font-semibold text-[var(--text)]",children:Array.isArray(t.deniedTools)?t.deniedTools.length:0})]})]}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.length===0?e.jsx(v,{size:18,className:"text-green-400"}):e.jsx(p,{size:18,className:"text-orange-400"}),e.jsx("h2",{className:"text-sm font-medium text-[var(--text-secondary)]",children:"Config Self-Audit"}),i.length>0&&e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:i.map(s=>`${s.n} ${s.s}`).join(" · ")})]}),a.length===0?e.jsx("p",{className:"text-sm text-green-400",children:"✓ No misconfigurations found — gateway auth, command scanning, tool permissions, secrets, and mesh all look sound."}):e.jsx("div",{className:"space-y-3",children:a.map(s=>e.jsxs("div",{className:`rounded-lg border p-3 ${o[s.severity]||o.info}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] uppercase font-bold tracking-wide",children:s.severity}),e.jsx("span",{className:"text-sm font-semibold text-[var(--text)]",children:s.title})]}),e.jsx("p",{className:"text-xs text-[var(--text-secondary)] mt-1",children:s.detail}),e.jsxs("p",{className:"text-xs mt-1",children:[e.jsx("span",{className:"opacity-70",children:"→ Fix:"})," ",s.remediation]})]},s.id))})]}),Array.isArray(t.deniedTools)&&t.deniedTools.length>0&&e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("h2",{className:"text-sm font-medium text-[var(--text-secondary)] mb-2",children:"Denied Tools"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:t.deniedTools.map(s=>e.jsx("span",{className:"px-2 py-1 text-xs rounded bg-red-500/10 text-red-400 border border-red-500/20",children:s},s))})]})]})}export{S as default};
|