dorkos 0.118.0 → 0.120.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/dist/bin/cli.js +3588 -3000
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-BOS59p1y.js → AboutPage-Y8O56Cz5.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-DOmV85tr.js → ActivityErrorState-DlROxqde.js} +1 -1
- package/dist/client/assets/{ActivityPage-DbsBpb6N.js → ActivityPage-BdV90CV2.js} +1 -1
- package/dist/client/assets/{ActivityRow-B1ZeL7Jb.js → ActivityRow-B5yiD_uD.js} +1 -1
- package/dist/client/assets/{AdapterIcon-XPLZ-NAi.js → AdapterIcon-Dyq92Eup.js} +1 -1
- package/dist/client/assets/AdapterSetupWizard-D9tqz7Hl.js +2 -0
- package/dist/client/assets/{AgentOptionRow-C15RQsub.js → AgentOptionRow-BeRqDo7c.js} +1 -1
- package/dist/client/assets/{AgentPicker-CydNJYi_.js → AgentPicker-BRyYVJZu.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-BBSbluBs.js → AgentRequestCard-xX6fAKgO.js} +4 -4
- package/dist/client/assets/AppearancePage-DKF9BqRt.js +1 -0
- package/dist/client/assets/{ApplyToOverridesDialog-Cv3KEf7T.js → ApplyToOverridesDialog-CPvtr_-f.js} +1 -1
- package/dist/client/assets/AttentionSignalRow-vBfioH1A.js +1 -0
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-Re2CfOlC.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-B50zNtwB.js} +1 -1
- package/dist/client/assets/{BindingDialog-8xnsM47D.js → BindingDialog-CSNjws3F.js} +1 -1
- package/dist/client/assets/{BlintzCanvas-DUDSNxlM.js → BlintzCanvas-ClOKWzws.js} +80 -79
- package/dist/client/assets/{CanvasCsvContent-D697P3sa.js → CanvasCsvContent-0Mb7uOuA.js} +6 -6
- package/dist/client/assets/CanvasFileContent-B_8zsIas.js +2 -0
- package/dist/client/assets/CanvasModel3dContent-UokbHY9i.js +2 -0
- package/dist/client/assets/{ChatAppsOff-CFEmPGm1.js → ChatAppsOff-CLRB0YU5.js} +1 -1
- package/dist/client/assets/{CodeMirrorDiff-B7VUevZG.js → CodeMirrorDiff-B4uFJD6g.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-BX1bJlnT.js → CodeMirrorEditor-rYOrBAZc.js} +1 -1
- package/dist/client/assets/{CommitmentList-CDocwl5K.js → CommitmentList-i-IZ4gbr.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-Cr_MvU96.js → CommitmentsPage-ChO1JkrE.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-CJMUZPDy.js → ComputerResourceView-pLuD2ie6.js} +1 -1
- package/dist/client/assets/{ComputerViewer-BA-9lBBN.js → ComputerViewer-D7tPmpY5.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-BLLpxhn3.js → ConnectionAccessLists-D6VH1vX3.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-BWVfAPd1.js → ConnectionsPage-7x5olD9q.js} +2 -2
- package/dist/client/assets/{ConventionPage-EK3WUWVa.js → ConventionPage-BTYLWw6p.js} +1 -1
- package/dist/client/assets/{ExtensionPageRoute-C9hsJNX2.js → ExtensionPageRoute-A9AdBBbw.js} +2 -2
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-BeyAgBfh.js → FloatingTanStackRouterDevtools-CqogiFob-ayv0yz1C.js} +1 -1
- package/dist/client/assets/HandlePage-BdRWgke2.js +1 -0
- package/dist/client/assets/{HeartbeatPage-DfbNenFv.js → HeartbeatPage-Dh6W9Qg5.js} +1 -1
- package/dist/client/assets/KeyEntry-owhPGtw3.js +1 -0
- package/dist/client/assets/{LexicalField-DC_6Z-Ye.js → LexicalField-B1NFMLD6.js} +2 -2
- package/dist/client/assets/{ManagesPage-CYnGvNM2.js → ManagesPage-BAnBmBdo.js} +1 -1
- package/dist/client/assets/{Marketplace-CWiiq8of.js → Marketplace-67maxdwz.js} +2 -2
- package/dist/client/assets/{MarketplaceSourcesView-DF3cHMR0.js → MarketplaceSourcesView-CzPBNJJj.js} +1 -1
- package/dist/client/assets/{McpAppFrame-D5Muf5Sf.js → McpAppFrame-CuObpQTg.js} +2 -2
- package/dist/client/assets/McpSigninBody-B-ayj6bQ.js +1 -0
- package/dist/client/assets/{Model3dViewer-C9ODHy5I.js → Model3dViewer-DRVqxazk.js} +1 -1
- package/dist/client/assets/NamePage-DyH8JAqT.js +1 -0
- package/dist/client/assets/NewDirectMessageMenu-B3DxayR2.js +1 -0
- package/dist/client/assets/{NotificationsPage-ldulSpVu.js → NotificationsPage-BavEo7VZ.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-BfEvR7s7.js → OpenMeshSwitch-BwkX2Toa.js} +2 -2
- package/dist/client/assets/{OperatorIdentityForm-ZM_zDnjM.js → OperatorIdentityForm-CtWgz2yi.js} +1 -1
- package/dist/client/assets/{PermissionHistory-liL_pJDR.js → PermissionHistory-DvM0F2bS.js} +1 -1
- package/dist/client/assets/{PermissionsPage-DFMjDQby.js → PermissionsPage-D1DJHezV.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-CITFG0_N.js → PersonalityPopover-BV-9wfIl.js} +1 -1
- package/dist/client/assets/PhotoPage-BHvRQnex.js +1 -0
- package/dist/client/assets/{PresetPicker-CpYu7nb6.js → PresetPicker-BOQKgYAK.js} +2 -2
- package/dist/client/assets/{PreviewRefusedNotice-CF3bzfSe.js → PreviewRefusedNotice-BdhUln2h.js} +1 -1
- package/dist/client/assets/{ProfileFields-D4p6bhIa.js → ProfileFields-DFRnRR38.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-XCuCnd1t.js → ProfilePanelContainer-CkxX9Dps.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-qRf3DSdk.js → ProfileRolePicker-BSYi_luB.js} +1 -1
- package/dist/client/assets/PromptSuggestionChips-r08GqBH1.js +1 -0
- package/dist/client/assets/{ReportsToPopover-Cu-Cnzij.js → ReportsToPopover-BcsM5Eia.js} +1 -1
- package/dist/client/assets/{RoomSurface-CsAifwp2.js → RoomSurface-DaRCf4og.js} +7 -7
- package/dist/client/assets/{RoomsPage-DZYMR2in.js → RoomsPage-CQqsdVvB.js} +1 -1
- package/dist/client/assets/RunsOnPopover-DFb4xEhP.js +1 -0
- package/dist/client/assets/RuntimeConnectFlow-pKFJlNSJ.js +1 -0
- package/dist/client/assets/RuntimeSetupDialog-DvBJbrmj.js +1 -0
- package/dist/client/assets/{SessionsPage-thndqcpY.js → SessionsPage-CGgnEPh7.js} +1 -1
- package/dist/client/assets/SettingsDialog-D0cmzjrH.js +12 -0
- package/dist/client/assets/{SkillsPage-CmXyAw3J.js → SkillsPage-DDoPlsn2.js} +1 -1
- package/dist/client/assets/TaskDialogWrapper-DoIVzbKU.js +1 -0
- package/dist/client/assets/TasksEmptyState-B68O6dnT.js +3 -0
- package/dist/client/assets/{TasksPage-DGNXrDAk.js → TasksPage-BsBDphim.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-CIfFRo6-.js → TeamComputerEntry-CoQ4EsDm.js} +1 -1
- package/dist/client/assets/{ToolsPage-BKZkSarf.js → ToolsPage-Cl1aOpev.js} +2 -2
- package/dist/client/assets/{TopologyGraph-og2tlLj7.js → TopologyGraph-D3CxaLGX.js} +2 -2
- package/dist/client/assets/TourHost-4O6TJzc-.js +1 -0
- package/dist/client/assets/{UnlinkDialog-BTYC_Sit.js → UnlinkDialog-DIMY60Fi.js} +1 -1
- package/dist/client/assets/WidgetErrorCard-CzWw_SPD.js +108 -0
- package/dist/client/assets/_shell-BRH2Y-U-.js +80 -0
- package/dist/client/assets/{_shell._home-CP7HQ7Cs.js → _shell._home-DG3Vw7S5.js} +1 -1
- package/dist/client/assets/_shell._home.activity-COI96oAO.js +1 -0
- package/dist/client/assets/_shell._home.index-CTwsTjcQ.js +3 -0
- package/dist/client/assets/_shell._home.tasks-DOVoPYaf.js +1 -0
- package/dist/client/assets/{_shell._home.workspaces-Cdsw2-jI.js → _shell._home.workspaces-ApZhnjwy.js} +1 -1
- package/dist/client/assets/_shell.channels-CRkJHU5R.js +10 -0
- package/dist/client/assets/{_shell.connections-sF5vS-Lm.js → _shell.connections-bhAK3jnE.js} +1 -1
- package/dist/client/assets/{_shell.feedback-requests-hu21WXyA.js → _shell.feedback-requests-k43R8-rW.js} +2 -2
- package/dist/client/assets/_shell.marketplace-DGN_IdZY.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-2YMpLInp.js +1 -0
- package/dist/client/assets/_shell.session-D871zZl3.js +61 -0
- package/dist/client/assets/{_shell.team-raG7wRwF.js → _shell.team-DHCM1QoO.js} +6 -6
- package/dist/client/assets/_shell.x._extensionId-D3-n5IRW.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-D3-n5IRW.js +1 -0
- package/dist/client/assets/{access-copy-CcG3wpsK.js → access-copy-BVzi1REx.js} +1 -1
- package/dist/client/assets/{banner-nt7EFLr6.js → banner-3xXXsU5J.js} +2 -2
- package/dist/client/assets/{card-B_zeSZiU.js → card-Bt6IU-Bh.js} +1 -1
- package/dist/client/assets/{command-CDfYcQI6.js → command-CWokzKS1.js} +1 -1
- package/dist/client/assets/{cpu-D861493C.js → cpu-BzByzE9V.js} +1 -1
- package/dist/client/assets/{empty-state-CQ1oXLFa.js → empty-state-BgnQDiMZ.js} +1 -1
- package/dist/client/assets/{execution-config-on8kVvnW.js → execution-config-D5-SEt2t.js} +1 -1
- package/dist/client/assets/{file-Bwo21EVR.js → file-VHDTQub2.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-BedYLbs2.js → file-exclamation-point-DbWvGys0.js} +1 -1
- package/dist/client/assets/{file-text-BTj3WyHS.js → file-text-BAhi2zct.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-B8fM5rIs.js → find-latest-widget-fence-Z0HPVqeK.js} +2 -2
- package/dist/client/assets/{form-lSBktWDn.js → form-Blrb1xBU.js} +1 -1
- package/dist/client/assets/{format-cron-W7G0In8e.js → format-cron-lKWqEmle.js} +1 -1
- package/dist/client/assets/{git-branch-CKlZ81Bg.js → git-branch-BObm8Rlz.js} +1 -1
- package/dist/client/assets/{heart-BSVjeGLA.js → heart-Du7nuefC.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-Ct8vmPkj.js → highlighted-body-KPVGNVTW-B_GO7V1P.js} +1 -1
- package/dist/client/assets/image-lightbox-BZ1TV3mN.js +1 -0
- package/dist/client/assets/image-off-hnjcBIzN.js +6 -0
- package/dist/client/assets/{index-6pYWHTBx.js → index-1I8qHZDt.js} +1 -1
- package/dist/client/assets/{index-CeZ13dpH.js → index-4GC2fkeO.js} +1 -1
- package/dist/client/assets/index-4PAAWURd.js +1 -0
- package/dist/client/assets/{index-CaKe9EaL.js → index-B0tAedq7.js} +1 -1
- package/dist/client/assets/{index-BVedye9r.js → index-BP68J4pb.js} +1 -1
- package/dist/client/assets/{index-gbNK9zj5.js → index-BUOcbPfv.js} +3 -3
- package/dist/client/assets/{index-DShrfGYE.js → index-BVKXIbLh.js} +1 -1
- package/dist/client/assets/{index-CeeHkxIC.js → index-BaRQVgiN.js} +1 -1
- package/dist/client/assets/{index-B-C_A3lP.js → index-BeVbHOwX.js} +2 -2
- package/dist/client/assets/{index-KaSZDcGa.js → index-BgzgdvDn.js} +1 -1
- package/dist/client/assets/{index-C0TknRcB.js → index-Bm0z9mHt.js} +1 -1
- package/dist/client/assets/{index-bvqpTKLz.js → index-BnNTKsbt.js} +1 -1
- package/dist/client/assets/{index-DjI5vH_U.js → index-BtbZpz4b.js} +1 -1
- package/dist/client/assets/{index-D7kjWnlR.js → index-BvjuGXcS.js} +1 -1
- package/dist/client/assets/{index-7Fd_Eeda.js → index-C60RrnTd.js} +1 -1
- package/dist/client/assets/{index-CQrM6oF9.js → index-CBm3whA-.js} +1 -1
- package/dist/client/assets/{index-C96eZrOR.js → index-CCg7yRe1.js} +1 -1
- package/dist/client/assets/{index-Dh8D-3Sb.js → index-CQCN6kWR.js} +1 -1
- package/dist/client/assets/index-Cdyszxoa.js +17 -0
- package/dist/client/assets/index-Ch-ON5gw.js +1 -0
- package/dist/client/assets/{index-UNxDevG6.js → index-Ci74HAFs.js} +1 -1
- package/dist/client/assets/{index-Dq4bx2np.js → index-CiQxS4Bn.js} +1 -1
- package/dist/client/assets/{index-DEOzZEcu.js → index-CqoIjNC2.js} +3 -3
- package/dist/client/assets/index-CrflCTqO.css +1 -0
- package/dist/client/assets/index-D5TZCu8j.js +1 -0
- package/dist/client/assets/{index-CNnnXzI4.js → index-D6y4WeTi.js} +1 -1
- package/dist/client/assets/{index-BjTJ6p2k.js → index-DB8TDRSm.js} +1 -1
- package/dist/client/assets/index-DCOOlbEt.js +1 -0
- package/dist/client/assets/index-DHYvT3nr.js +23 -0
- package/dist/client/assets/{index-GINKfP45.js → index-DRea_Gi0.js} +1 -1
- package/dist/client/assets/index-Dain_3cO.js +1 -0
- package/dist/client/assets/index-Dc5cpBoO.js +1023 -0
- package/dist/client/assets/{index-DOuj--Yi.js → index-Df7a-2P5.js} +1 -1
- package/dist/client/assets/{index-BHt5KOZA.js → index-DkhM0fDi.js} +1 -1
- package/dist/client/assets/{index-CCWSicoJ.js → index-DoMJUxt_.js} +1 -1
- package/dist/client/assets/{index-09EqfhW0.js → index-EZHlD3gf.js} +1 -1
- package/dist/client/assets/{index-SdTS2P3x.js → index-HxT_wkaZ.js} +1 -1
- package/dist/client/assets/{index-RFknyjho.js → index-Lh82Rz5C.js} +1 -1
- package/dist/client/assets/{index-DgRqCuFH.js → index-WxtASL5_.js} +1 -1
- package/dist/client/assets/{index-CF73kwtO.js → index-_5Dn0bFm.js} +17 -17
- package/dist/client/assets/{index-V_EcsvR4.js → index-aXm0xP_2.js} +1 -1
- package/dist/client/assets/{index-DeNVXdMl.js → index-ox3ce99A.js} +1 -1
- package/dist/client/assets/{index-BdrbKBym.js → index-r_O6CmXY.js} +1 -1
- package/dist/client/assets/index.esm-DXsF3Bua.js +41 -0
- package/dist/client/assets/{inline-code-Beal0546.js → inline-code-DAEoWvTf.js} +1 -1
- package/dist/client/assets/{layers-DUfQMkMa.js → layers-CsM34LRv.js} +1 -1
- package/dist/client/assets/{lightbulb-DTSn-mNB.js → lightbulb-B8JAixK_.js} +1 -1
- package/dist/client/assets/{link-2-CHr2s4m2.js → link-2-Csc6okl3.js} +1 -1
- package/dist/client/assets/{list-runtime-types-CwEp9Lg4.js → list-runtime-types-DQrZNB7x.js} +1 -1
- package/dist/client/assets/markdown-content-DPc7aD1j.js +1 -0
- package/dist/client/assets/{mention-pill-XE9mX9G8.js → mention-pill-8P_w4muj.js} +1 -1
- package/dist/client/assets/{message-square-off-DUkKSITA.js → message-square-off-D5DXu2cY.js} +1 -1
- package/dist/client/assets/{more-details-3dDtVYc6.js → more-details-DEeu2M-p.js} +1 -1
- package/dist/client/assets/{owner-notice-BKmuWRki.js → owner-notice-BW4k1ycg.js} +1 -1
- package/dist/client/assets/{package-DM7e-GVa.js → package-BSwwAFVm.js} +1 -1
- package/dist/client/assets/{page-container-nGewlFnj.js → page-container-CjPUNtNw.js} +1 -1
- package/dist/client/assets/{paperclip-BgXlvBBI.js → paperclip-DQaRz34E.js} +1 -1
- package/dist/client/assets/{path-input-RzOiTE45.js → path-input-CgXSYNZn.js} +1 -1
- package/dist/client/assets/plug-BaUXMfIl.js +11 -0
- package/dist/client/assets/primer-trigger-DHB0vilf.js +3 -0
- package/dist/client/assets/{profile-errors-CFZN0y6a.js → profile-errors-JW2XTgia.js} +1 -1
- package/dist/client/assets/{progress-Cvnh4Qcr.js → progress-CErAw8zp.js} +1 -1
- package/dist/client/assets/{query-error-state-CfJfYpa3.js → query-error-state-BFWpEXsl.js} +1 -1
- package/dist/client/assets/{radio-BOcAjXVO.js → radio-Bkx216ga.js} +1 -1
- package/dist/client/assets/registry-Ce1VRIS3.js +1 -0
- package/dist/client/assets/{relay-trace-schemas-Cvb7RGjg.js → relay-trace-schemas-DiZj_AFV.js} +2 -2
- package/dist/client/assets/{room-files-source-B-ZJA_NM.js → room-files-source-BilZvdpf.js} +2 -2
- package/dist/client/assets/{rotate-ccw-clock-vRQP4hWE.js → rotate-ccw-clock-D_SO1stN.js} +1 -1
- package/dist/client/assets/{rotate-cw-DD2nOAQ-.js → rotate-cw-C68kM23F.js} +1 -1
- package/dist/client/assets/{scroll-area-DTvv8_DS.js → scroll-area-CVWFUmJV.js} +1 -1
- package/dist/client/assets/{search-x-Ig8nk-DU.js → search-x-BTFVvyA2.js} +1 -1
- package/dist/client/assets/{shield-check-DjnWx7aT.js → shield-check-Dpxi6WqO.js} +1 -1
- package/dist/client/assets/{shield-x-BrtccpM7.js → shield-x-CdCCgyXk.js} +1 -1
- package/dist/client/assets/signed-in-BxAnDo0S.js +1 -0
- package/dist/client/assets/{soul-file-C5mMIP4v.js → soul-file-CRfKVJX3.js} +1 -1
- package/dist/client/assets/{table-Rll_Jxd8.js → table-BL3xUC41.js} +1 -1
- package/dist/client/assets/{terminal-Bjss9oke.js → terminal-u_UCRzSM.js} +1 -1
- package/dist/client/assets/{trust-posture-Dmk2WlZv.js → trust-posture-B-v4BWo7.js} +1 -1
- package/dist/client/assets/{unplug-BHYMc4ND.js → unplug-CFbC-L5W.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-BmIVQhjE.js → unverified-catalog-notice-ZUqscVFM.js} +1 -1
- package/dist/client/assets/{use-adapter-catalog-RzlxX2Wa.js → use-adapter-catalog-Z4MDWZAZ.js} +1 -1
- package/dist/client/assets/{use-bindings-Ds_MAC67.js → use-bindings-CsTavmf-.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-ckA_eZQS.js → use-composer-prefs-BY2dTvep.js} +1 -1
- package/dist/client/assets/{use-connector-management-oEqok0QG.js → use-connector-management-L9l21yTi.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-Clu9Sz2-.js → use-deep-link-scroll-Bn2ZUtDY.js} +1 -1
- package/dist/client/assets/{use-delete-binding-B_zHPcy8.js → use-delete-binding-DLvdHtPD.js} +1 -1
- package/dist/client/assets/{use-dev-links-BO7-IHe9.js → use-dev-links-DFvL8mIg.js} +1 -1
- package/dist/client/assets/{use-external-adapter-catalog-7lRWtn7J.js → use-external-adapter-catalog-Be57G4tz.js} +1 -1
- package/dist/client/assets/{use-full-activity-feed-DrcMJL9m.js → use-full-activity-feed-Cp3lYXdi.js} +1 -1
- package/dist/client/assets/use-is-below-desktop-DmekpHAF.js +1 -0
- package/dist/client/assets/use-is-hub-el7LTkg3.js +1 -0
- package/dist/client/assets/{use-jump-back-in-Dav0ttfs.js → use-jump-back-in-ChH1FSEK.js} +3 -3
- package/dist/client/assets/{use-local-browser-CtltDlof.js → use-local-browser-zA8gMhcC.js} +1 -1
- package/dist/client/assets/{use-mesh-topology-CiS9XQsg.js → use-mesh-topology-CvoD-L1G.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-DuK0vm9N.js → use-mounted-ref-Ch0wqQry.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-Chf4UNbq.js → use-notification-prefs-DeR05zhp.js} +1 -1
- package/dist/client/assets/{use-panel-tab-placements-C5y831aL.js → use-panel-tab-placements-DdjrmaoK.js} +1 -1
- package/dist/client/assets/use-pending-read-DBpte0GI.js +1 -0
- package/dist/client/assets/use-personality-commit-qQfISO2-.js +1 -0
- package/dist/client/assets/use-promo-activation-CwGoE7b-.js +11 -0
- package/dist/client/assets/{use-promo-dismissals-8-hGry_v.js → use-promo-dismissals-BBqVN4hx.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-CWudgqNc.js → use-pulse-freshness-BKW7tjvX.js} +1 -1
- package/dist/client/assets/{use-relay-config-8mXfegbP.js → use-relay-config-D5iieBXl.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-DgEWUsoP.js → use-room-follow-claim-BwZh2ZPH.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-CXy0Hv5J.js → use-roving-tab-list-Ct7yDAUE.js} +1 -1
- package/dist/client/assets/use-session-canvas-CJrfZrYG.js +24 -0
- package/dist/client/assets/{use-session-diagnostics-LKiXub1H.js → use-session-diagnostics-Dn-Wnyhh.js} +4 -4
- package/dist/client/assets/{use-unclaimed-chats-Cr812OTh.js → use-unclaimed-chats-M-c5tjXH.js} +1 -1
- package/dist/client/assets/use-update-config-DhlbZldm.js +1 -0
- package/dist/client/assets/{useMutationState-BnXJ-0A_.js → useMutationState-Cd-VqRAv.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/drizzle/20261017113300_session_public_computer.sql +1 -0
- package/dist/drizzle/meta/20261017113300_snapshot.json +14020 -0
- package/dist/drizzle/meta/_journal.json +7 -0
- package/dist/server/index.js +128843 -121508
- package/dist/server/index.js.map +2 -2
- package/package.json +5 -5
- package/dist/client/assets/AdapterSetupWizard-DfNJz5SD.js +0 -2
- package/dist/client/assets/AppearancePage-8ALtWGZZ.js +0 -1
- package/dist/client/assets/AttentionSignalRow-c-u1cE1l.js +0 -1
- package/dist/client/assets/CanvasFileContent-BJ39nHuR.js +0 -2
- package/dist/client/assets/CanvasModel3dContent-TaunlbT2.js +0 -2
- package/dist/client/assets/HandlePage-CfeEzfDk.js +0 -1
- package/dist/client/assets/KeyEntry-CEbe5Xvn.js +0 -6
- package/dist/client/assets/McpSigninBody-CLZFoQgC.js +0 -1
- package/dist/client/assets/NamePage-B4YrH-ug.js +0 -1
- package/dist/client/assets/NewDirectMessageMenu-Co9Uv5t5.js +0 -1
- package/dist/client/assets/PhotoPage-DYDJPBfu.js +0 -1
- package/dist/client/assets/PromptSuggestionChips-CUwLk83h.js +0 -1
- package/dist/client/assets/RunsOnPopover-CTBEMstG.js +0 -1
- package/dist/client/assets/RuntimeConnectFlow-DY4sjRgN.js +0 -1
- package/dist/client/assets/RuntimeSetupDialog-DJu_-eNa.js +0 -1
- package/dist/client/assets/SettingsDialog-CKmcLF66.js +0 -12
- package/dist/client/assets/TaskDialogWrapper-Boxr_hgF.js +0 -1
- package/dist/client/assets/TasksEmptyState-CQf1YroK.js +0 -3
- package/dist/client/assets/TourHost-DzEG8bZP.js +0 -1
- package/dist/client/assets/WidgetErrorCard-CT4sl_T6.js +0 -108
- package/dist/client/assets/_shell-BDlkTSin.js +0 -90
- package/dist/client/assets/_shell._home.activity-DGXa_ouh.js +0 -1
- package/dist/client/assets/_shell._home.index-D5kOfqnL.js +0 -3
- package/dist/client/assets/_shell._home.tasks-BSMD-atB.js +0 -1
- package/dist/client/assets/_shell.channels-B4VQ7tiZ.js +0 -10
- package/dist/client/assets/_shell.marketplace-B-T-ALMv.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-Chu-9-Vi.js +0 -1
- package/dist/client/assets/_shell.session-Bz6wvDBp.js +0 -66
- package/dist/client/assets/_shell.x._extensionId-DSqMu6Ey.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-DSqMu6Ey.js +0 -1
- package/dist/client/assets/index-BDCqg2iM.css +0 -1
- package/dist/client/assets/index-C8-dwIPp.js +0 -1018
- package/dist/client/assets/index-CAv_6Po4.js +0 -1
- package/dist/client/assets/index-ClELcMX1.js +0 -1
- package/dist/client/assets/index-CrEyJcPM.js +0 -17
- package/dist/client/assets/index-DQJM5kjJ.js +0 -1
- package/dist/client/assets/index-DURo45pu.js +0 -1
- package/dist/client/assets/index-sfSRuIXm.js +0 -23
- package/dist/client/assets/markdown-content-GoymYcRL.js +0 -1
- package/dist/client/assets/primer-trigger-B60oEVY7.js +0 -3
- package/dist/client/assets/registry-B9wsS5De.js +0 -1
- package/dist/client/assets/use-is-below-desktop-BhzXZsbH.js +0 -1
- package/dist/client/assets/use-pending-read-i6TB4gGQ.js +0 -1
- package/dist/client/assets/use-personality-commit-KKJ2ve1V.js +0 -1
- package/dist/client/assets/use-promo-activation-D45fuXdT.js +0 -11
- package/dist/client/assets/use-session-canvas-CUvHGgMf.js +0 -64
- package/dist/client/assets/use-update-config-Bad4g6mB.js +0 -1
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{j as e,hf as _e,G as _,r as m,dw as Ve,$ as fe,I as qe,dP as W,dQ as U,dR as G,dS as H,dT as L,bw as le,O as ce,hg as de,hh as ue,ez as Re,al as We,J as me,dW as R,e as ge,ai as Ue,aj as Ge,ak as He,hi as Ke,a1 as Ye,ds as xe,a2 as Qe,hj as Xe,dv as ne,dO as Ze,hk as Ee,hl as Oe,hm as Je,B as Z,hn as et,gD as je,_ as ve,gC as tt,gE as st,gB as nt,da as rt,em as at,ho as ot,hp as it,bP as lt,ar as ct,y as dt,gG as ut,gH as mt,aY as ht,a$ as ft,cx as xt,cy as pt,cA as gt,hq as jt,cB as vt,cC as yt,g7 as bt,en as Nt,eo as wt,ep as Ct,eq as St,er as kt,es as Rt}from"./index-C8-dwIPp.js";import{I as Et}from"./inline-code-Beal0546.js";import{a as Ot,u as Mt}from"./form-lSBktWDn.js";import{C as Ft,a as At,b as Dt,c as $t,d as ye,e as he}from"./command-CDfYcQI6.js";import{A as Lt}from"./AgentPicker-CydNJYi_.js";import{d as It,k as zt,e as be}from"./execution-config-on8kVvnW.js";import{s as Tt}from"./settings-for-runtime-BoOa-ZFG.js";import{l as Pt}from"./list-runtime-types-CwEp9Lg4.js";import{f as Bt,u as _t}from"./format-cron-W7G0In8e.js";function ys({icon:t,name:n,description:s,command:o,commandHint:a="Restart DorkOS from your terminal with:",className:l,...c}){return e.jsxs("div",{"data-slot":"feature-disabled-state",className:_("flex flex-col items-center justify-center gap-3 p-8 text-center",l),...c,children:[e.jsx(t,{className:"text-muted-foreground/50 size-8"}),e.jsxs("div",{children:[e.jsxs("p",{className:"font-medium",children:[n," is off"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm",children:s})]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:a}),e.jsxs("div",{className:"flex max-w-full items-center gap-1.5",children:[e.jsx(Et,{className:"min-w-0 px-3 py-1.5 text-sm break-all",children:o}),e.jsx(_e,{value:o,label:`Copy the command for ${n}`})]})]})}const z=(t,n=o=>o,s)=>Ot(t,n,{compare:s});function Vt(){const[t,n]=m.useState({x:0,y:0}),[s,o]=m.useState(!1),a=Ve(),l=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(hover: none)").matches,c=a||l,d=m.useCallback(x=>{if(c)return;const j=x.currentTarget.getBoundingClientRect();n({x:x.clientX-j.left,y:x.clientY-j.top}),o(!0)},[c]),h=m.useCallback(()=>{o(!1)},[]),v=!c&&s?{background:`radial-gradient(350px circle at ${t.x}px ${t.y}px, rgba(59,130,246,0.06), transparent 80%)`}:void 0;return{position:t,isActive:s,onMouseMove:d,onMouseLeave:h,spotlightStyle:v}}function qt({preset:t,variant:n,checked:s,onCheckedChange:o,onSelect:a,selected:l=!1,className:c}){const{onMouseMove:d,onMouseLeave:h,spotlightStyle:v}=Vt(),x=()=>{n==="toggle"?o==null||o(!s):a==null||a(t)};return e.jsxs("button",{type:"button",onClick:x,onMouseMove:d,onMouseLeave:h,"aria-label":`${t.name}: ${t.description}`,className:_("relative flex w-full items-start gap-4 rounded-lg border p-4 text-left transition","hover:bg-accent/50 focus-ring","min-h-11",n==="toggle"&&s&&"border-primary/40 bg-accent/30",n==="selectable"&&l&&"border-primary ring-primary bg-accent/30 ring-1",c),children:[v&&e.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-lg",style:v}),n==="toggle"&&e.jsx("div",{className:"flex size-11 shrink-0 items-center justify-center",children:e.jsx(fe,{checked:s??!1,onCheckedChange:o,"aria-label":`Enable ${t.name}`,onClick:j=>j.stopPropagation()})}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("div",{className:"font-medium",children:t.name}),e.jsx("p",{className:"text-muted-foreground text-sm",children:t.description}),e.jsx("p",{"aria-hidden":"true",className:"text-muted-foreground text-xs",children:Bt(t.cron)}),e.jsx("p",{"aria-hidden":"true",className:"text-muted-foreground/80 line-clamp-2 text-sm",children:t.prompt})]})]})}function Me({onSelect:t,selectedId:n,className:s}){const{data:o,isLoading:a,isError:l}=_t();return a?e.jsx("div",{className:_("grid grid-cols-2 gap-3",s),children:[0,1,2,3].map(c=>e.jsx("div",{className:"bg-muted animate-breath h-28 rounded-lg border"},c))}):l?e.jsx("p",{className:"text-destructive text-sm",children:"Couldn’t load ready-made tasks. Start from scratch instead."}):!o||o.length===0?e.jsx("p",{className:"text-muted-foreground text-sm",children:"No ready-made tasks yet."}):e.jsx("div",{className:_("grid grid-cols-2 gap-3",s),children:o.map(c=>e.jsx(qt,{preset:c,variant:"selectable",selected:c.id===n,onSelect:t},c.id))})}const q={frequency:"daily",hour:9,days:[1,2,3,4,5],dayOfMonth:1},Wt=[{value:"15m",label:"Every 15 minutes"},{value:"hourly",label:"Every hour"},{value:"daily",label:"Every day"},{value:"weekly",label:"Every week"},{value:"monthly",label:"Every month"}],Ut=[{value:1,label:"Mon"},{value:2,label:"Tue"},{value:3,label:"Wed"},{value:4,label:"Thu"},{value:5,label:"Fri"},{value:6,label:"Sat"},{value:0,label:"Sun"}],Gt=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ht=[1,2,3,4,5],Kt=[0,6];function Ne(t){const n=t.trim();if(!n)return null;const s=n.split(/\s+/);if(s.length!==5)return null;const[o,a,l,c,d]=s;if(c!=="*")return null;if(o==="*/15"&&a==="*"&&l==="*"&&d==="*")return{...q,frequency:"15m"};if(o!=="0")return null;if(a==="*"&&l==="*"&&d==="*")return{...q,frequency:"hourly"};const h=Number(a);if(!Number.isInteger(h)||h<0||h>23)return null;if(l!=="*"&&d==="*"){const v=Number(l);return!Number.isInteger(v)||v<1||v>31?null:{...q,frequency:"monthly",hour:h,dayOfMonth:v}}if(l==="*"&&d==="*")return{...q,frequency:"daily",hour:h};if(l==="*"&&d!=="*"){const v=Yt(d);return v?{...q,frequency:"weekly",hour:h,days:v}:null}return null}function Yt(t){const n=[];for(const s of t.split(",")){const o=s.match(/^(\d)-(\d)$/);if(o){const a=Number(o[1]),l=Number(o[2]);if(a>6||l>6||a>l)return null;for(let c=a;c<=l;c++)n.push(c)}else{const a=Number(s);if(!Number.isInteger(a)||a<0||a>6)return null;n.push(a)}}return n.length>0?n.sort((s,o)=>s-o):null}function we(t){switch(t.frequency){case"15m":return"*/15 * * * *";case"hourly":return"0 * * * *";case"daily":return`0 ${t.hour} * * *`;case"weekly":return`0 ${t.hour} * * ${t.days.join(",")}`;case"monthly":return`0 ${t.hour} ${t.dayOfMonth} * *`}}function Fe(t){const n=t<12?"AM":"PM";return`${t%12||12}:00 ${n}`}function Ae(t){const n=t%100;if(n>=11&&n<=13)return`${t}th`;const s=t%10;return s===1?`${t}st`:s===2?`${t}nd`:s===3?`${t}rd`:`${t}th`}function Ce(t,n){return t.length===n.length&&t.every((s,o)=>s===n[o])}function Qt(t){const n=Fe(t.hour);switch(t.frequency){case"15m":return"Runs every 15 minutes";case"hourly":return"Runs every hour, on the hour";case"daily":return`Runs every day at ${n}`;case"weekly":{const s=[...t.days].sort((c,d)=>c-d);if(Ce(s,Ht))return`Runs every weekday at ${n}`;if(Ce(s,Kt))return`Runs every Saturday and Sunday at ${n}`;const a=s.filter(c=>c!==0).concat(s.includes(0)?[0]:[]).map(c=>Gt[c]);if(a.length===1)return`Runs every ${a[0]} at ${n}`;if(a.length===2)return`Runs every ${a[0]} and ${a[1]} at ${n}`;const l=a.pop();return`Runs every ${a.join(", ")}, and ${l} at ${n}`}case"monthly":return`Runs on the ${Ae(t.dayOfMonth)} of every month at ${n}`}}const Xt="Can’t read this timing. Check the format.";function oe(t){const n=t.trim();if(!n)return!0;try{return Re.toString(n),!0}catch{return!1}}function Zt(t){const n=t.trim();return n?oe(n)?Re.toString(n):Xt:""}function Jt({value:t,onChange:n}){const s=Ne(t),[o,a]=m.useState(s?"simple":t.trim()?"cron":"simple"),[l,c]=m.useState(s??q),d=m.useRef(t);m.useEffect(()=>{if(t===d.current)return;d.current=t;const i=Ne(t);i?(a("simple"),c(i)):t.trim()&&a("cron")},[t]);function h(i){c(i);const g=we(i);d.current=g,n(g)}function v(i){h({...l,frequency:i})}function x(i){h({...l,hour:Number(i)})}function j(i){const g=l.days.includes(i);if(g&&l.days.length<=1)return;const w=g?l.days.filter(S=>S!==i):[...l.days,i].sort((S,N)=>S-N);h({...l,days:w})}function p(i){h({...l,dayOfMonth:Number(i)})}function k(){a("cron")}function C(){a("simple");const i=we(l);d.current=i,n(i)}const u=l.frequency!=="15m"&&l.frequency!=="hourly";return o==="cron"?e.jsxs("div",{className:"space-y-2",children:[e.jsx("button",{type:"button",onClick:C,className:"text-muted-foreground hover:text-foreground text-xs underline-offset-4 hover:underline",children:"Back to simple schedule"}),e.jsx(qe,{className:"font-mono",value:t,onChange:i=>n(i.target.value),placeholder:"0 9 * * 1-5"}),t.trim()&&e.jsx("p",{className:_("text-xs",oe(t)?"text-muted-foreground":"text-destructive"),children:Zt(t)}),e.jsx("a",{href:"https://crontab.guru",target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground block text-xs hover:underline",children:"Learn about cron expressions"})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs(W,{value:l.frequency,onValueChange:v,children:[e.jsx(U,{"aria-label":"Frequency",children:e.jsx(G,{})}),e.jsx(H,{children:Wt.map(i=>e.jsx(L,{value:i.value,children:i.label},i.value))})]}),e.jsx(le,{initial:!1,mode:"wait",children:u&&e.jsx(ce.div,{variants:ue,initial:"initial",animate:"animate",exit:"exit",transition:de,className:"overflow-hidden",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground text-sm",children:"at"}),e.jsxs(W,{value:String(l.hour),onValueChange:x,children:[e.jsx(U,{className:"w-32","aria-label":"Time",children:e.jsx(G,{})}),e.jsx(H,{children:Array.from({length:24},(i,g)=>e.jsx(L,{value:String(g),children:Fe(g)},g))})]})]})},"time")}),e.jsx(le,{initial:!1,children:l.frequency==="weekly"&&e.jsx(ce.div,{variants:ue,initial:"initial",animate:"animate",exit:"exit",transition:de,className:"overflow-hidden",children:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:Ut.map(i=>{const g=l.days.includes(i.value);return e.jsx("button",{type:"button","aria-label":i.label,"aria-pressed":g,className:_("inline-flex min-h-11 items-center justify-center rounded-md border px-2.5 py-1 text-xs font-medium transition-colors md:min-h-0",g?"border-primary bg-primary/10 text-primary":"border-input text-muted-foreground hover:bg-accent hover:text-accent-foreground"),onClick:()=>j(i.value),children:i.label},i.value)})})},"days")}),e.jsx(le,{initial:!1,children:l.frequency==="monthly"&&e.jsx(ce.div,{variants:ue,initial:"initial",animate:"animate",exit:"exit",transition:de,className:"overflow-hidden",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground text-sm",children:"on day"}),e.jsxs(W,{value:String(l.dayOfMonth),onValueChange:p,children:[e.jsx(U,{className:"w-20","aria-label":"Day of month",children:e.jsx(G,{})}),e.jsx(H,{children:Array.from({length:31},(i,g)=>e.jsx(L,{value:String(g+1),children:Ae(g+1)},g+1))})]})]})},"dom")}),e.jsx("p",{className:"text-muted-foreground text-xs",children:Qt(l)}),e.jsx("button",{type:"button",onClick:k,className:"text-muted-foreground hover:text-foreground text-xs underline-offset-4 hover:underline",children:"Use a cron expression"})]})}function es(t){const n=new Map;for(const s of t){const[o]=s.split("/");n.has(o)||n.set(o,[]),n.get(o).push(s)}return n}function ts({value:t,onChange:n}){const[s,o]=m.useState(!1),a=m.useRef(null),l=m.useMemo(()=>{try{return Intl.supportedValuesOf("timeZone")}catch{return[]}},[]),c=m.useMemo(()=>es(l),[l]),d=m.useMemo(()=>Intl.DateTimeFormat().resolvedOptions().timeZone,[]);m.useEffect(()=>{if(!s)return;function x(j){a.current&&!a.current.contains(j.target)&&o(!1)}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[s]);const h=t||"System default";function v(x){n(x),o(!1)}return e.jsxs("div",{ref:a,className:"relative w-full",children:[e.jsxs("button",{type:"button","aria-expanded":s,"aria-haspopup":"listbox",className:_("border-input ring-offset-background flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm transition-colors","focus-visible:ring-ring focus-visible:ring-1 focus-visible:outline-none","hover:bg-accent/50"),onClick:()=>o(x=>!x),children:[e.jsx("span",{className:"truncate",children:h}),e.jsx(We,{className:"ml-2 size-4 shrink-0 opacity-50"})]}),s&&e.jsx("div",{className:"bg-popover text-popover-foreground absolute top-full left-0 z-50 mt-1 w-full rounded-md border shadow-md",children:e.jsxs(Ft,{children:[e.jsx(At,{placeholder:"Search timezone…"}),e.jsxs(Dt,{className:"max-h-60",children:[e.jsx($t,{children:"No timezone found."}),e.jsxs(ye,{heading:"Default",children:[e.jsxs(he,{value:"system-default",onSelect:()=>v(""),children:[e.jsx("span",{children:"System default"}),t===""&&e.jsx(me,{className:"ml-auto size-4"})]}),d&&e.jsxs(he,{value:`${d}-detected`,onSelect:()=>v(d),children:[e.jsxs("span",{children:[d," (detected)"]}),t===d&&e.jsx(me,{className:"ml-auto size-4"})]})]}),[...c.entries()].map(([x,j])=>e.jsx(ye,{heading:x,children:j.map(p=>e.jsxs(he,{value:p,onSelect:()=>v(p),children:[e.jsx("span",{children:p.replace(`${x}/`,"").replace(/_/g," ")}),p===t&&e.jsx(me,{className:"ml-auto size-4"})]},p))},x))]})]})})]})}function ss({roster:t,value:n}){const s="flex h-9 w-full items-center gap-2 text-sm";if(!n)return e.jsx("p",{"data-testid":"settled-agent",className:`${s} text-muted-foreground`,children:"No agent"});if(t.unreadable)return e.jsx("p",{"data-testid":"settled-agent",className:`${s} text-muted-foreground`,children:"Couldn’t load your agents to show this one."});if(!t.answered)return e.jsxs("div",{"data-testid":"settled-agent-loading",className:s,"aria-hidden":!0,children:[e.jsx(ge,{className:"size-5 rounded-full"}),e.jsx(ge,{className:"h-4 w-32"})]});const o=t.agents.find(l=>l.id===n);if(!o)return e.jsx("p",{"data-testid":"settled-agent",className:`${s} text-muted-foreground`,children:"This agent isn’t registered any more."});const a=Ue(o);return e.jsxs("p",{"data-testid":"settled-agent",className:s,children:[e.jsx(Ge,{color:a.color,emoji:a.emoji,size:"xs"}),e.jsx("span",{className:"truncate",children:He(o)})]})}function ns({roster:t,value:n,locked:s,onChange:o}){return e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{children:"Agent"}),s?e.jsxs(e.Fragment,{children:[e.jsx(ss,{roster:t,value:n}),e.jsx("p",{"data-testid":"agent-locked-note",className:"text-muted-foreground text-xs leading-relaxed",children:"The agent is set once. For another agent, make a new task."})]}):e.jsx(Lt,{agents:t.agents,value:n||void 0,onValueChange:a=>o(a??"")})]})}function De(t,n){var c,d;const s=t.map(h=>h.projectPath).join(`
|
|
2
|
-
`),o=m.useMemo(()=>s?s.split(`
|
|
3
|
-
`):[],[s]),{data:a}=Ke(o),l=n?(c=t.find(h=>h.id===n))==null?void 0:c.projectPath:void 0;return l?((d=a==null?void 0:a[l])==null?void 0:d.runtime)??null:null}const $="__inherit__";function rs(t){var P;const{runtime:n,model:s,effort:o,agentRuntime:a}=t,l=Ye(),{data:c}=xe(),d=c?Object.keys(c.capabilities):void 0,h=(c==null?void 0:c.defaultRuntime)??null,x=(y=>y!==null&&d!==void 0&&d.includes(y))(a),j=x?a:h,p=n||j,k=p??void 0,C=k!==void 0&&d!==void 0&&d.includes(k),{data:u}=Qe({...Xe(l,k?{runtime:k}:{}),enabled:C,retry:!1}),i=s?u==null?void 0:u.find(y=>y.value===s):void 0,g=(P=Tt(c,p))==null?void 0:P.supportsEffort,w=p?It({agent:{runtime:p,model:s||null,effort:o||null},defaultRuntime:p,knownRuntimes:d,knownModels:zt(u),modelSupportsEffort:i?i.supportsEffort??!1:void 0,runtimeSupportsEffort:g,runtimeLabel:y=>ne(y).label}):null,S=y=>{var b;return((b=w==null?void 0:w.breakages.find(M=>y.includes(M.kind)))==null?void 0:b.message)??null},N=d==null?void 0:d.join(","),T=m.useMemo(()=>{const y=N===void 0?[]:N.split(",").filter(Boolean),b=Pt(y).filter(M=>y.includes(M));return n&&!b.includes(n)&&b.push(n),b.map(M=>({value:M,label:ne(M).label}))},[N,n]),A=m.useMemo(()=>{const y=(u??[]).map(b=>({value:b.value,label:b.displayName}));return s&&!y.some(b=>b.value===s)&&y.push({value:s,label:s}),y},[u,s]),K=m.useMemo(()=>{const y=Ze.filter(b=>!(i!=null&&i.supportedEffortLevels)||i.supportedEffortLevels.includes(b)).map(b=>({value:b,label:be(b)}));return o&&!y.some(b=>b.value===o)&&y.push({value:o,label:be(o)}),y},[i,o]),D=j===null?"Same as agent":x?`Same as agent (${ne(j).label})`:`Server default (${ne(j).label})`;return{effectiveRuntime:p,runtimeOptions:T,inheritRuntimeLabel:D,modelOptions:A,supportsEffort:g===!0,effortOptions:K,runtimeWarning:S(["runtime-not-connected"]),modelWarning:S(["model-unavailable"]),effortWarning:S(["effort-unsupported-runtime","effort-unsupported-model"])}}const re="text-xs text-status-warning-fg";function as({runtime:t,model:n,effort:s,execution:o,onRuntimeChange:a,onModelChange:l,onEffortChange:c}){const{runtimeOptions:d,inheritRuntimeLabel:h,modelOptions:v,supportsEffort:x,effortOptions:j,runtimeWarning:p,modelWarning:k,effortWarning:C}=o;return e.jsxs("fieldset",{className:"space-y-3",children:[e.jsx("legend",{className:"mb-1.5 text-sm font-medium",children:"Runs on"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-runtime",children:"Runs on"}),e.jsxs(W,{value:t||$,onValueChange:u=>a(u===$?"":u),children:[e.jsx(U,{id:"schedule-runtime",responsive:!1,className:"text-sm","data-testid":"task-runtime-select",children:e.jsx(G,{})}),e.jsxs(H,{children:[e.jsx(L,{value:$,children:h}),d.map(u=>e.jsx(L,{value:u.value,children:u.label},u.value))]})]}),p&&e.jsx("p",{"data-testid":"task-runtime-warning",className:re,children:p})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-model",children:"Model"}),e.jsxs(W,{value:n||$,onValueChange:u=>l(u===$?"":u),children:[e.jsx(U,{id:"schedule-model",responsive:!1,className:"text-sm","data-testid":"task-model-select",children:e.jsx(G,{})}),e.jsxs(H,{children:[e.jsx(L,{value:$,children:"Agent default"}),v.map(u=>e.jsx(L,{value:u.value,children:u.label},u.value))]})]}),k&&e.jsx("p",{"data-testid":"task-model-warning",className:re,children:k})]}),x?e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-effort",children:"Effort"}),e.jsxs(W,{value:s||$,onValueChange:u=>c(u===$?"":u),children:[e.jsx(U,{id:"schedule-effort",responsive:!1,className:"text-sm","data-testid":"task-effort-select",children:e.jsx(G,{})}),e.jsxs(H,{children:[e.jsx(L,{value:$,children:"Agent default"}),j.map(u=>e.jsx(L,{value:u.value,children:u.label},u.value))]})]}),C&&e.jsx("p",{"data-testid":"task-effort-warning",className:re,children:C})]}):s&&e.jsxs("div",{className:"space-y-1.5","data-testid":"task-effort-stranded",children:[e.jsx(R,{children:"Effort"}),e.jsx("p",{className:re,children:C??"No effort setting here, so this does nothing."}),e.jsx("button",{type:"button",onClick:()=>c(""),className:"focus-ring text-status-warning-fg rounded-sm text-xs underline-offset-2 hover:underline","data-testid":"task-effort-clear",children:"Clear it"})]})]})}const ae="10m";function os(t){return`${Math.round(t/6e4)}m`}function B(t,n,s,o="acceptEdits"){return t?{name:t.name,description:t.description??"",prompt:t.prompt,cron:t.cron??"",agentId:t.agentId??"",timezone:t.timezone??"",permissionMode:t.permissionMode,maxRuntime:t.maxRuntime?os(t.maxRuntime):ae,sticky:t.sticky,runtime:t.runtime??"",model:t.model??"",effort:t.effort??""}:n?{name:n.name,description:n.description,prompt:n.prompt,cron:n.cron,agentId:s??"",timezone:n.timezone??"",permissionMode:o,maxRuntime:ae,sticky:!1,runtime:"",model:"",effort:""}:{name:"",description:"",prompt:"",cron:"",agentId:s??"",timezone:"",permissionMode:o,maxRuntime:ae,sticky:!1,runtime:"",model:"",effort:""}}function Se(t){const n=t.cron.trim();return{name:t.name.trim(),description:t.description.trim(),prompt:t.prompt.trim(),cron:n||null,...n&&t.timezone?{timezone:t.timezone}:{},permissionMode:t.permissionMode,maxRuntime:t.maxRuntime.trim()||void 0,sticky:t.sticky,runtime:t.runtime||null,model:t.model||null,effort:t.effort||null}}function is(t,n){const s=Se(t),o=Se(n);return Object.fromEntries(Object.entries(o).filter(([a,l])=>l!==s[a]))}const $e=100;function ls(t,n=[]){const s=new Set([...n].map(a=>a.toLowerCase())),o=t.name.trim();for(let a=1;;a++){const l=a===1?"-copy":`-copy-${a}`,c=`${o.slice(0,$e-l.length)}${l}`;if(!s.has(c.toLowerCase()))return{...t,name:c}}}const cs={record:["This schedule came with a package. Only the package can change what it does.","You can still turn it on or off, or change when it runs."],legacy:["This schedule came with a package from an older DorkOS.","DorkOS can’t yet tell its files from yours.","You can still turn it on or off, or change when it runs.","To edit the rest, choose Check files on its package in Marketplace › Installed."]};function ke(t){var s;const n=t;return(n==null?void 0:n.code)!==ot?null:{message:n.message,ownedBy:((s=n.body)==null?void 0:s.ownedBy)==="legacy"?"legacy":"record"}}function ds({defaultValues:t,roster:n,editTask:s,onSubmitSuccess:o,onCancel:a,onDeleteClick:l,isPending:c,onMakeCopy:d,leading:h}){var ee,te;const v=Ee(),x=m.useRef(!0);m.useEffect(()=>(x.current=!0,()=>{x.current=!1}),[]);const j=Oe({isShownInline:r=>x.current&&ke(r)!==null}),p=s?ke(j.error):null,k=(s==null?void 0:s.packageOwned)??null,C=k??(p==null?void 0:p.ownedBy)??null,u=k!==null,i=Mt({defaultValues:t,onSubmit:({value:r})=>{const f=r.agentId.trim()||void 0,F=r.cron.trim();if(s){const O=is(t,r);if(Object.keys(O).length===0){o();return}j.mutate({id:s.id,...O},{onSuccess:o})}else{const O=f??"global",se={name:r.name.trim(),description:r.description.trim()||r.name.trim(),prompt:r.prompt.trim(),target:O,cron:F||void 0,...F&&r.timezone?{timezone:r.timezone}:{},permissionMode:r.permissionMode,maxRuntime:r.maxRuntime.trim()||void 0,...r.sticky?{sticky:!0}:{},...r.runtime?{runtime:r.runtime}:{},...r.model?{model:r.model}:{},...r.effort?{effort:r.effort}:{}};v.mutate(se,{onSuccess:o})}}}),g=z(i.store,r=>r.values.agentId),w=z(i.store,r=>r.values.runtime),S=z(i.store,r=>r.values.model),N=z(i.store,r=>r.values.effort),T=z(i.store,r=>r.values.permissionMode),A=z(i.store,r=>r.values.cron),[K,D]=m.useState(!!t.cron),[P,y]=m.useState(!1),b=z(i.store,r=>r.values.maxRuntime),M=z(i.store,r=>r.values.sticky),I=[w!=="",S!=="",N!=="",b!==ae,M,Je(T)].filter(Boolean).length,J=De(n.agents,g),V=rs({runtime:w,model:S,effort:N,agentRuntime:J}),{data:Y}=xe(),Q=(V.effectiveRuntime?(te=(ee=Y==null?void 0:Y.capabilities[V.effectiveRuntime])==null?void 0:ee.permissionModes)==null?void 0:te.values:void 0)??[];return e.jsxs(i.AppForm,{children:[e.jsx("form",{onSubmit:r=>{r.preventDefault(),i.handleSubmit()},id:"schedule-form",className:"min-h-0 flex-1 overflow-y-auto",children:e.jsxs("div",{className:"space-y-5 px-4 py-5",children:[C!==null&&e.jsxs("div",{role:"status","data-slot":"package-owned-notice",className:"bg-muted/40 space-y-2 rounded-md border px-3 py-2 text-xs",children:[p?e.jsx("p",{children:p.message}):cs[C].map(r=>e.jsx("p",{children:r},r)),C==="record"&&d&&e.jsxs(Z,{type:"button",variant:"outline",size:"xs",onClick:()=>d(i.state.values),children:[e.jsx(et,{}),"Make a copy"]})]}),h,e.jsx(ns,{roster:n,value:g,locked:s!==void 0,onChange:r=>i.setFieldValue("agentId",r)}),e.jsxs("fieldset",{disabled:u,className:"min-w-0 space-y-5",children:[e.jsx(i.AppField,{name:"name",children:r=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-name",children:"Name *"}),e.jsx("input",{id:"schedule-name",className:"border-input focus-visible:ring-ring disabled:bg-muted/40 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm focus-visible:ring-1 focus-visible:outline-none disabled:cursor-default",value:r.state.value,onChange:f=>r.handleChange(f.target.value),onBlur:r.handleBlur,maxLength:$e,placeholder:"Daily code review"}),r.state.meta.isTouched&&r.state.meta.errors.length>0&&e.jsx("p",{className:"text-destructive text-xs",children:String(r.state.meta.errors[0])})]})}),e.jsx(i.AppField,{name:"description",children:r=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-description",children:"Description *"}),e.jsx("input",{id:"schedule-description",className:"border-input focus-visible:ring-ring disabled:bg-muted/40 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm focus-visible:ring-1 focus-visible:outline-none disabled:cursor-default",value:r.state.value,onChange:f=>r.handleChange(f.target.value),onBlur:r.handleBlur,placeholder:"A short description of this schedule"}),r.state.meta.isTouched&&r.state.meta.errors.length>0&&e.jsx("p",{className:"text-destructive text-xs",children:String(r.state.meta.errors[0])})]})}),e.jsx(i.AppField,{name:"prompt",children:r=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-prompt",children:"Prompt *"}),e.jsx("textarea",{id:"schedule-prompt",className:"border-input focus-visible:ring-ring disabled:bg-muted/40 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm focus-visible:ring-1 focus-visible:outline-none disabled:cursor-default",value:r.state.value,onChange:f=>r.handleChange(f.target.value),onBlur:r.handleBlur,rows:4,placeholder:"Review all pending PRs and summarize findings…"}),r.state.meta.isTouched&&r.state.meta.errors.length>0&&e.jsx("p",{className:"text-destructive text-xs",children:String(r.state.meta.errors[0])})]})})]}),e.jsx(je,{open:K,onOpenChange:D,trigger:"Schedule",badge:e.jsx(ve,{variant:"secondary",className:"text-xs",children:A?"On a schedule":"Optional"}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(i.AppField,{name:"cron",children:r=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{children:"When it runs"}),e.jsx(Jt,{value:r.state.value,onChange:f=>r.handleChange(f)})]})}),e.jsx(i.AppField,{name:"timezone",children:r=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{children:"Timezone"}),e.jsx(ts,{value:r.state.value,onChange:f=>r.handleChange(f)})]})})]})}),e.jsx(i.Subscribe,{selector:r=>!oe(r.values.cron),children:r=>r?e.jsx("p",{role:"alert","data-testid":"cron-blocks-save",className:"text-destructive text-xs",children:"Fix the timing under Schedule before saving."}):null}),e.jsx(je,{open:P,onOpenChange:y,trigger:"Advanced settings",badge:I>0?e.jsxs(ve,{variant:"secondary",className:"text-xs",children:[I," changed"]}):void 0,children:e.jsxs("fieldset",{disabled:u,className:"min-w-0 space-y-4",children:[e.jsx(as,{runtime:w,model:S,effort:N,execution:V,onRuntimeChange:r=>i.setFieldValue("runtime",r),onModelChange:r=>i.setFieldValue("model",r),onEffortChange:r=>i.setFieldValue("effort",r)}),e.jsx(i.AppField,{name:"permissionMode",children:r=>{const f=Q.find(O=>O.id===r.state.value),F=(f==null?void 0:f.label)??tt(r.state.value);return Q.length===0?e.jsxs("fieldset",{className:"space-y-2",children:[e.jsx("legend",{className:"mb-1.5 text-sm font-medium",children:"Permissions"}),e.jsxs("p",{"data-testid":"trust-dial-unavailable",className:"text-muted-foreground px-1 text-xs leading-relaxed",children:["Set to “",F,"”. No other options to choose yet. Saving keeps it."]})]}):e.jsxs("fieldset",{className:"space-y-2",children:[e.jsx("legend",{className:"mb-1.5 text-sm font-medium",children:"Permissions"}),e.jsx(st,{mode:r.state.value,descriptors:Q,onChangeMode:O=>r.handleChange(O),strandsWorkingMode:!0,strandedNote:e.jsxs(e.Fragment,{children:["Set to “",F,"”, which isn’t listed. Saving keeps it. Pick a stop to change it."]})}),f!==void 0&&f.asks!=="never"&&e.jsxs("div",{"data-testid":"task-unattended-note",className:"text-muted-foreground space-y-1 px-1 text-xs leading-relaxed",children:[e.jsx("p",{children:"Nobody watches a scheduled run, so any ask is turned down."}),e.jsx("p",{children:"The run carries on without that tool and says so. “Run now” still asks you."})]}),e.jsx(nt,{mode:r.state.value,...f?{descriptor:f}:{},className:"px-1"})]})}}),e.jsx(i.AppField,{name:"maxRuntime",children:r=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-max-runtime",children:"Stop after"}),e.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:"Ends the run if it takes longer."}),e.jsx("input",{id:"schedule-max-runtime",className:"border-input focus-visible:ring-ring disabled:bg-muted/40 w-24 rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm focus-visible:ring-1 focus-visible:outline-none disabled:cursor-default",value:r.state.value,onChange:f=>r.handleChange(f.target.value),onBlur:r.handleBlur,placeholder:"10m"})]})}),e.jsx(i.AppField,{name:"sticky",children:r=>e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(R,{htmlFor:"schedule-sticky",children:"Remember the last run"}),e.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:"Pick up where the last run left off. Off starts fresh each time."})]}),e.jsx(fe,{id:"schedule-sticky",checked:r.state.value,onCheckedChange:f=>r.handleChange(f)})]})})]})})]})}),e.jsxs(rt,{className:"shrink-0 border-t px-4 py-3",children:[s&&e.jsxs(Z,{type:"button",variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive mr-auto",onClick:l,children:[e.jsx(at,{className:"mr-1.5 size-4"}),"Delete"]}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:a,children:"Cancel"}),e.jsx(i.Subscribe,{selector:r=>r.values.name.trim()!==""&&r.values.prompt.trim()!==""&&oe(r.values.cron),children:r=>e.jsx(Z,{type:"submit",size:"sm",form:"schedule-form",disabled:!r||c,children:c?"Saving…":s?"Save":"Create task"})})]})]})}function bs({open:t,onOpenChange:n,editTask:s,initialPreset:o,initialAgentId:a}){var pe;const l=it(),c=Oe(),d=Ee(),{data:h,isError:v}=lt(),x={agents:(h==null?void 0:h.agents)??[],answered:h!==void 0,unreadable:v},{data:j}=xe(),p=De(x.agents,a),C=p!==null&&j!==void 0&&Object.hasOwn(j.capabilities,p)?p:(j==null?void 0:j.defaultRuntime)??null,{data:u}=ct(),i=dt(C),g=ut(C?mt(u==null?void 0:u.executionDefaults,C):null,((pe=i==null?void 0:i.permissionModes)==null?void 0:pe.values)??[]),w=m.useRef(g);m.useLayoutEffect(()=>{w.current=g},[g]);const[S,N]=m.useState(()=>s?"form":"preset-picker"),[T,A]=m.useState(null),[K,D]=m.useState(!1),[P,y]=m.useState((s==null?void 0:s.enabled)??!0),[b,M]=m.useState(!1),I=b?void 0:s,[J,V]=m.useState(!0),{data:Y}=ht(),[Q,ee]=m.useState(()=>B(s,void 0,a,g)),[te,r]=m.useState(0);function f(E,ie=!1){ee(E),r(X=>X+1),M(ie)}m.useEffect(()=>{if(!t){f(B(s,void 0,a,w.current)),A(null),D(!1),N(s?"form":"preset-picker");return}s?(f(B(s)),y(s.enabled),N("form")):o?(f(B(void 0,o,a,w.current)),A(o),N("form")):(f(B(void 0,void 0,a,w.current)),N("preset-picker"))},[s,t,o,a]);const{pendingTemplate:F,externalTrigger:O,clear:se}=ft();m.useEffect(()=>{O&&F&&(f(B(void 0,F,a,w.current)),A(F),N("form"),se())},[O,F,se,a]);function Le(E){f(B(void 0,E,a,w.current)),A(E),N("form")}function Ie(E){const ie=(Y??[]).filter(X=>(X.agentId??"")===E.agentId).map(X=>X.name);V(!0),f(ls(E,ie),!0)}function ze(){b&&J&&s&&c.mutate({id:s.id,enabled:!1}),n(!1)}function Te(){s&&l.mutate(s.id,{onSuccess:()=>{D(!1),n(!1)}})}function Pe(E){s&&(y(E),c.mutate({id:s.id,enabled:E},{onError:()=>y(s.enabled)}))}const Be=d.isPending||c.isPending;return e.jsxs(xt,{open:t,onOpenChange:n,children:[e.jsxs(pt,{className:"flex max-h-[85vh] max-w-lg flex-col gap-0 p-0",children:[e.jsxs(gt,{className:"shrink-0 border-b px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[S==="form"&&!I&&!b&&e.jsxs("button",{type:"button",onClick:()=>N("preset-picker"),className:"text-muted-foreground hover:text-foreground flex items-center gap-1 text-sm","aria-label":"Back to preset picker",children:[e.jsx(jt,{className:"size-4"}),"Back"]}),e.jsx(vt,{children:I?"Edit schedule":"New schedule"}),I&&e.jsx(fe,{className:"ml-auto",checked:P,onCheckedChange:Pe,disabled:c.isPending,"aria-label":P?"Disable schedule":"Enable schedule"})]}),e.jsx(yt,{className:"sr-only",children:I?"Edit an existing schedule":"Create a new schedule"})]}),S==="preset-picker"&&e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsxs("div",{className:"space-y-4 px-4 py-5",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:"Start from a template"}),e.jsx(Me,{onSelect:Le,selectedId:T==null?void 0:T.id}),e.jsx("button",{type:"button",onClick:()=>{A(null),N("form")},className:"text-muted-foreground hover:text-foreground w-full text-center text-sm transition-colors",children:"Start from scratch"})]})}),S==="form"&&e.jsx(ds,{defaultValues:Q,roster:x,editTask:I,onSubmitSuccess:ze,onCancel:()=>n(!1),onDeleteClick:()=>D(!0),isPending:Be,onMakeCopy:Ie,leading:b&&s?e.jsxs("div",{className:"flex items-start gap-2 rounded-md border px-3 py-2",children:[e.jsx(bt,{id:"copy-switch-off-original",checked:J,onCheckedChange:E=>V(E===!0)}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(R,{htmlFor:"copy-switch-off-original",className:"text-sm font-normal",children:"Switch off the package’s schedule"}),e.jsxs("p",{className:"text-muted-foreground text-xs",children:["So “",s.name,"” and your copy don’t both run."]})]})]}):void 0},te)]}),s&&e.jsx(Nt,{open:K,onOpenChange:D,children:e.jsxs(wt,{children:[e.jsxs(Ct,{children:[e.jsxs(St,{children:["Delete “",s.name,"”?"]}),e.jsx(kt,{children:"Its run history is deleted too. This can’t be undone."})]}),e.jsxs(Rt,{children:[e.jsx("button",{onClick:()=>D(!1),className:"border-input hover:bg-accent hover:text-accent-foreground inline-flex items-center rounded-md border bg-transparent px-3 py-1.5 text-sm font-medium shadow-sm transition-colors",children:"Cancel"}),e.jsx("button",{onClick:Te,disabled:l.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 dark:bg-destructive/60 inline-flex items-center rounded-md px-3 py-1.5 text-sm font-medium shadow-sm transition-colors",children:l.isPending?"Deleting…":"Delete task"})]})]})})]})}function Ns({onCreateWithPreset:t,onCreateBlank:n}){return e.jsxs("div",{className:"flex flex-col items-center pb-8 md:pb-12",children:[e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No schedules yet"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-sm text-center text-sm",children:"Put a skill on a timer and it runs without you."}),e.jsx("div",{className:"w-full max-w-lg",children:e.jsx(Me,{onSelect:t})}),e.jsx(Z,{variant:"ghost",className:"mt-4",onClick:n,children:"New custom schedule"})]})}export{bs as C,ys as F,Ns as T};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as d,hX as b,j as L,B as ve,G as Ue,hY as Ce,ad as Ze,d_ as Xe,dF as U,l as Q,hZ as Qe,a1 as Je,a3 as et,a2 as tt,at as me,a4 as nt,eb as rt,ec as ot,bc as it,aY as st,cu as at,c5 as lt,ei as ct,aV as ge}from"./index-C8-dwIPp.js";import{D as z}from"./dorkbot-templates-8Yu9POWJ.js";import{u as ut}from"./use-relay-config-8mXfegbP.js";import{u as ft}from"./use-external-adapter-catalog-7lRWtn7J.js";var dt={attributes:!0,characterData:!0,subtree:!0,childList:!0};function ht(e,t,n=dt){d.useEffect(()=>{if(e.current){const r=new MutationObserver(t);return r.observe(e.current,n),()=>{r.disconnect()}}},[t,n])}var Le=(function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,s){return o[0]===n?(r=s,!0):!1}),r}return(function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,s=this.__entries__;o<s.length;o++){var i=s[o];n.call(r,i[1],i[0])}},t})()})(),ue=typeof window<"u"&&typeof document<"u"&&window.document===document,te=(function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()})(),pt=(function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(te):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}})(),vt=2;function mt(e,t){var n=!1,r=!1,o=0;function s(){n&&(n=!1,e()),r&&a()}function i(){pt(s)}function a(){var c=Date.now();if(n){if(c-o<vt)return;r=!0}else n=!0,r=!1,setTimeout(i,t);o=c}return a}var gt=20,bt=["top","right","bottom","left","width","height","size","weight"],yt=typeof MutationObserver<"u",wt=(function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=mt(this.refresh.bind(this),gt)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!ue||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),yt?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!ue||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=bt.some(function(s){return!!~r.indexOf(s)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e})(),Me=(function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e}),q=(function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||te}),Te=ie(0,0,0,0);function ne(e){return parseFloat(e)||0}function be(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var s=e["border-"+o+"-width"];return r+ne(s)},0)}function _t(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var s=o[r],i=e["padding-"+s];n[s]=ne(i)}return n}function Et(e){var t=e.getBBox();return ie(0,0,t.width,t.height)}function Ot(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Te;var r=q(e).getComputedStyle(e),o=_t(r),s=o.left+o.right,i=o.top+o.bottom,a=ne(r.width),c=ne(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+s)!==t&&(a-=be(r,"left","right")+s),Math.round(c+i)!==n&&(c-=be(r,"top","bottom")+i)),!Rt(e)){var u=Math.round(a+s)-t,l=Math.round(c+i)-n;Math.abs(u)!==1&&(a-=u),Math.abs(l)!==1&&(c-=l)}return ie(o.left,o.top,a,c)}var xt=(function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof q(e).SVGGraphicsElement}:function(e){return e instanceof q(e).SVGElement&&typeof e.getBBox=="function"}})();function Rt(e){return e===q(e).document.documentElement}function St(e){return ue?xt(e)?Et(e):Ot(e):Te}function kt(e){var t=e.x,n=e.y,r=e.width,o=e.height,s=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,i=Object.create(s.prototype);return Me(i,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),i}function ie(e,t,n,r){return{x:e,y:t,width:n,height:r}}var Ct=(function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ie(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=St(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e})(),Lt=(function(){function e(t,n){var r=kt(n);Me(this,{target:t,contentRect:r})}return e})(),Mt=(function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new Le,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof q(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new Ct(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof q(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new Lt(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e})(),Ae=typeof WeakMap<"u"?new WeakMap:new Le,Ie=(function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=wt.getInstance(),r=new Mt(t,n,this);Ae.set(this,r)}return e})();["observe","unobserve","disconnect"].forEach(function(e){Ie.prototype[e]=function(){var t;return(t=Ae.get(this))[e].apply(t,arguments)}});var Tt=(function(){return typeof te.ResizeObserver<"u"?te.ResizeObserver:Ie})(),At=({mutationObservables:e,resizeObservables:t,refresh:n})=>{const[r,o]=d.useState(0),s=d.useRef(document.documentElement||document.body);function i(c){const u=Array.from(c);for(const l of u)if(e){if(!l.attributes)continue;e.find(v=>l.matches(v))&&n(!0)}}function a(c){const u=Array.from(c);for(const l of u)if(t){if(!l.attributes)continue;t.find(v=>l.matches(v))&&o(r+1)}}return ht(s,c=>{for(const u of c)u.addedNodes.length!==0&&(i(u.addedNodes),a(u.addedNodes)),u.removedNodes.length!==0&&(i(u.removedNodes),a(u.removedNodes))},{childList:!0,subtree:!0}),d.useEffect(()=>{if(!t)return;const c=new Tt(()=>{n()});for(const u of t){const l=document.querySelector(u);l&&c.observe(l)}return()=>{c.disconnect()}},[t,r]),null},It=At;function ee(e){let t=Pe;return e&&(t=e.getBoundingClientRect()),t}function Pt(e,t){const[n,r]=d.useState(Pe),o=d.useCallback(()=>{e!=null&&e.current&&r(ee(e==null?void 0:e.current))},[e==null?void 0:e.current]);return d.useEffect(()=>(o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)),[e==null?void 0:e.current,t]),n}var Pe={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function Dt(e,t){return new Promise(n=>{if(!(e instanceof Element))throw new TypeError("Argument 1 must be an Element");let r=0,o=null;const s=Object.assign({behavior:"smooth"},t);e.scrollIntoView(s),requestAnimationFrame(i);function i(){const a=e==null?void 0:e.getBoundingClientRect().top;if(a===o){if(r++>2)return n(null)}else r=0,o=a;requestAnimationFrame(i)}})}function J(e){return e<0?0:e}function Ht(e){return typeof e=="object"&&e!==null?{thresholdX:e.x||0,thresholdY:e.y||0}:{thresholdX:e||0,thresholdY:e||0}}function se(){const e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight,window.innerHeight||0);return{w:e,h:t}}function Nt({top:e,right:t,bottom:n,left:r,threshold:o}){const{w:s,h:i}=se(),{thresholdX:a,thresholdY:c}=Ht(o);return e<0&&n-e>i?!0:e>=0+c&&r>=0+a&&n<=i-c&&t<=s-a}var ye=(e,t)=>e>t,we=(e,t)=>e>t;function jt(e,t=[]){const n=(r,o)=>t.includes(r)?1:t.includes(o)?-1:0;return Object.keys(e).map(r=>({position:r,value:e[r]})).sort((r,o)=>o.value-r.value).sort((r,o)=>n(r.position,o.position)).filter(r=>r.value>0).map(r=>r.position)}var ce=10;function fe(e=ce){return Array.isArray(e)?e.length===1?[e[0],e[0],e[0],e[0]]:e.length===2?[e[1],e[0],e[1],e[0]]:e.length===3?[e[0],e[1],e[2],e[1]]:e.length>3?[e[0],e[1],e[2],e[3]]:[ce,ce]:[e,e,e,e]}var $t={maskWrapper:()=>({opacity:.7,left:0,top:0,position:"fixed",zIndex:99999,pointerEvents:"none",color:"#000"}),svgWrapper:({windowWidth:e,windowHeight:t,wpt:n,wpl:r})=>({width:e,height:t,left:Number(r),top:Number(n),position:"fixed"}),maskArea:({x:e,y:t,width:n,height:r})=>({x:e,y:t,width:n,height:r,fill:"black",rx:0}),maskRect:({windowWidth:e,windowHeight:t,maskID:n})=>({x:0,y:0,width:e,height:t,fill:"currentColor",mask:`url(#${n})`}),clickArea:({windowWidth:e,windowHeight:t,clipID:n})=>({x:0,y:0,width:e,height:t,fill:"currentcolor",pointerEvents:"auto",clipPath:`url(#${n})`}),highlightedArea:({x:e,y:t,width:n,height:r})=>({x:e,y:t,width:n,height:r,pointerEvents:"auto",fill:"transparent",display:"none"})};function zt(e){return(t,n)=>{const r=$t[t](n),o=e[t];return o?o(r,n):r}}var Ft=({padding:e=10,wrapperPadding:t=0,onClick:n,onClickHighlighted:r,styles:o={},sizes:s,className:i,highlightedAreaClassName:a,maskId:c,clipId:u})=>{const l=c||_e("mask__"),f=u||_e("clip__"),v=zt(o),[g,_,O,y]=fe(e),[p,E,x,k]=fe(t),{w:h,h:T}=se(),M=J((s==null?void 0:s.width)+y+_),C=J((s==null?void 0:s.height)+g+O),w=J((s==null?void 0:s.top)-g-p),R=J((s==null?void 0:s.left)-y-k),A=h-k-E,S=T-p-x,j=v("maskArea",{x:R,y:w,width:M,height:C}),$=v("highlightedArea",{x:R,y:w,width:M,height:C});return b.createElement("div",{style:v("maskWrapper",{}),onClick:n,className:i},b.createElement("svg",{width:A,height:S,xmlns:"http://www.w3.org/2000/svg",style:v("svgWrapper",{windowWidth:A,windowHeight:S,wpt:p,wpl:k})},b.createElement("defs",null,b.createElement("mask",{id:l},b.createElement("rect",{x:0,y:0,width:A,height:S,fill:"white"}),b.createElement("rect",{style:j,rx:j.rx?1:void 0})),b.createElement("clipPath",{id:f},b.createElement("polygon",{points:`0 0, 0 ${S}, ${R} ${S}, ${R} ${w}, ${R+M} ${w}, ${R+M} ${w+C}, ${R} ${w+C}, ${R} ${S}, ${A} ${S}, ${A} 0`}))),b.createElement("rect",{style:v("maskRect",{windowWidth:A,windowHeight:S,maskID:l})}),b.createElement("rect",{style:v("clickArea",{windowWidth:A,windowHeight:S,top:w,left:R,width:M,height:C,clipID:f})}),b.createElement("rect",{style:$,className:a,onClick:r,rx:$.rx?1:void 0})))},Vt=Ft;function _e(e){return e+Math.random().toString(36).substring(2,16)}var Wt=Object.defineProperty,re=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable,Ee=(e,t,n)=>t in e?Wt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Oe=(e,t)=>{for(var n in t||(t={}))De.call(t,n)&&Ee(e,n,t[n]);if(re)for(var n of re(t))He.call(t,n)&&Ee(e,n,t[n]);return e},qt=(e,t)=>{var n={};for(var r in e)De.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&re)for(var r of re(e))t.indexOf(r)<0&&He.call(e,r)&&(n[r]=e[r]);return n},Bt={popover:()=>({position:"fixed",maxWidth:353,backgroundColor:"#fff",padding:"24px 30px",boxShadow:"0 0.5em 3em rgba(0, 0, 0, 0.3)",color:"inherit",zIndex:1e5,transition:"transform 0.3s",top:0,left:0})};function Gt(e){return(t,n)=>{const r=Bt[t](n),o=e[t];return o?o(r,n):r}}var Kt=e=>{var t=e,{children:n,position:r="bottom",padding:o=10,styles:s={},sizes:i,refresher:a}=t,c=qt(t,["children","position","padding","styles","sizes","refresher"]);const u=d.useRef(null),l=d.useRef(""),f=d.useRef(""),v=d.useRef(""),{w:g,h:_}=se(),O=Gt(s),y=Pt(u,a),{width:p,height:E}=y,[x,k,h,T]=fe(o),M=(i==null?void 0:i.left)-T,C=(i==null?void 0:i.top)-x,w=(i==null?void 0:i.right)+k,R=(i==null?void 0:i.bottom)+h,A=r&&typeof r=="function"?r({width:p,height:E,windowWidth:g,windowHeight:_,top:C,left:M,right:w,bottom:R,x:i.x,y:i.y},y):r,S={left:M,right:g-w,top:C,bottom:_-R},j=(I,D,H)=>{switch(I){case"top":return S.top>E+h;case"right":return D?!1:S.right>p+T;case"bottom":return H?!1:S.bottom>E+x;case"left":return S.left>p+k;default:return!1}},$=(I,D,H)=>{const m=jt(S,H?["right","left"]:D?["top","bottom"]:[]);for(let N=0;N<m.length;N++)if(j(m[N],D,H))return l.current=m[N],I[m[N]];return l.current="center",I.center},G=(I=>{if(Array.isArray(I)){const V=ye(I[0],g),le=we(I[1],_);return l.current="custom",[V?g/2-p/2:I[0],le?_/2-E/2:I[1]]}const D=ye(M+p,g),H=we(R+E,_),m=D?Math.min(M,g-p):Math.max(M,0),N=H?E>S.bottom?Math.max(R-E,0):Math.max(C,0):C;H&&E>S.bottom?f.current="bottom":f.current="top",D?v.current="left":v.current="right";const K={top:[m-T,C-E-h],right:[w+T,N-x],bottom:[m-T,R+x],left:[M-p-k,N-x],center:[g/2-p/2,_/2-E/2]};return I==="center"||j(I,D,H)&&!D&&!H?(l.current=I,K[I]):$(K,D,H)})(A);return b.createElement("div",Oe({className:"reactour__popover",style:Oe({transform:`translate(${Math.round(G[0])}px, ${Math.round(G[1])}px)`},O("popover",{position:l.current,verticalAlign:f.current,horizontalAlign:v.current,helperRect:y,targetRect:i})),ref:u},c),n)},Yt=Kt,Ut=Object.defineProperty,Zt=Object.defineProperties,Xt=Object.getOwnPropertyDescriptors,oe=Object.getOwnPropertySymbols,Ne=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,xe=(e,t,n)=>t in e?Ut(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t)=>{for(var n in t||(t={}))Ne.call(t,n)&&xe(e,n,t[n]);if(oe)for(var n of oe(t))je.call(t,n)&&xe(e,n,t[n]);return e},he=(e,t)=>Zt(e,Xt(t)),Z=(e,t)=>{var n={};for(var r in e)Ne.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&oe)for(var r of oe(e))t.indexOf(r)<0&&je.call(e,r)&&(n[r]=e[r]);return n},Qt={bottom:0,height:0,left:0,right:0,top:0,width:0,windowWidth:0,windowHeight:0,x:0,y:0};function Jt(e,t={block:"center",behavior:"smooth",inViewThreshold:0}){const[n,r]=d.useState(!1),[o,s]=d.useState(!1),[i,a]=d.useState(!1),[c,u]=d.useState(null),[l,f]=d.useState(Qt),v=(e==null?void 0:e.selector)instanceof Element?e==null?void 0:e.selector:document.querySelector(e==null?void 0:e.selector),g=d.useCallback(()=>{const O=Re(v,e==null?void 0:e.highlightedSelectors,e==null?void 0:e.bypassElem),{hasHighligtedElems:y}=O,p=Z(O,["hasHighligtedElems"]);Object.entries(l).some(([E,x])=>p[E]!==x)&&f(p)},[v,e==null?void 0:e.highlightedSelectors,l]);d.useEffect(()=>(g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)),[v,e==null?void 0:e.highlightedSelectors,c]),d.useEffect(()=>{!Nt(he(P({},l),{threshold:t.inViewThreshold}))&&v&&(r(!0),Dt(v,t).then(()=>{o||u(Date.now())}).finally(()=>{r(!1)}))},[l]);const _=d.useCallback(()=>{s(!0);const O=Re(v,e==null?void 0:e.highlightedSelectors,e==null?void 0:e.bypassElem),{hasHighligtedElems:y}=O,p=Z(O,["hasHighligtedElems"]);a(y),f(p),s(!1)},[v,e==null?void 0:e.highlightedSelectors,l]);return{sizes:l,transition:n,target:v,observableRefresher:_,isHighlightingObserved:i}}function Re(e,t=[],n=!0){let r=!1;const{w:o,h:s}=se();if(!t)return he(P({},ee(e)),{windowWidth:o,windowHeight:s,hasHighligtedElems:!1});let i=ee(e),a={bottom:0,height:0,left:o,right:0,top:s,width:0};for(const u of t){const l=document.querySelector(u);if(!l||l.style.display==="none"||l.style.visibility==="hidden")continue;const f=ee(l);r=!0,n||!e?(f.top<a.top&&(a.top=f.top),f.right>a.right&&(a.right=f.right),f.bottom>a.bottom&&(a.bottom=f.bottom),f.left<a.left&&(a.left=f.left),a.width=a.right-a.left,a.height=a.bottom-a.top):(f.top<i.top&&(i.top=f.top),f.right>i.right&&(i.right=f.right),f.bottom>i.bottom&&(i.bottom=f.bottom),f.left<i.left&&(i.left=f.left),i.width=i.right-i.left,i.height=i.bottom-i.top)}const c=n||!e?a.width>0&&a.height>0:!1;return{left:(c?a:i).left,top:(c?a:i).top,right:(c?a:i).right,bottom:(c?a:i).bottom,width:(c?a:i).width,height:(c?a:i).height,windowWidth:o,windowHeight:s,hasHighligtedElems:r,x:i.x,y:i.y}}var en=({disableKeyboardNavigation:e,setCurrentStep:t,currentStep:n,setIsOpen:r,stepsLength:o,disable:s,rtl:i,clickProps:a,keyboardHandler:c})=>{function u(l){if(l.stopPropagation(),e===!0||s)return;let f,v,g;e&&(f=e.includes("esc"),v=e.includes("right"),g=e.includes("left"));function _(){t(Math.min(n+1,o-1))}function O(){t(Math.max(n-1,0))}c&&typeof c=="function"?c(l,a,{isEscDisabled:f,isRightDisabled:v,isLeftDisabled:g}):(l.keyCode===27&&!f&&(l.preventDefault(),r(!1)),l.keyCode===39&&!v&&(l.preventDefault(),i?O():_()),l.keyCode===37&&!g&&(l.preventDefault(),i?_():O()))}return d.useEffect(()=>(window.addEventListener("keydown",u,!1),()=>{window.removeEventListener("keydown",u)}),[s,t,n]),null},tn=en,nn={badge:()=>({position:"absolute",fontFamily:"monospace",background:"var(--reactour-accent,#007aff)",height:"1.875em",lineHeight:2,paddingLeft:"0.8125em",paddingRight:"0.8125em",fontSize:"1em",borderRadius:"1.625em",color:"white",textAlign:"center",boxShadow:"0 0.25em 0.5em rgba(0, 0, 0, 0.3)",top:"-0.8125em",left:"-0.8125em"}),controls:()=>({display:"flex",marginTop:24,alignItems:"center",justifyContent:"space-between"}),navigation:()=>({counterReset:"dot",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"}),button:({disabled:e})=>({display:"block",padding:0,border:0,background:"none",cursor:e?"not-allowed":"pointer"}),arrow:({disabled:e})=>({color:e?"#caccce":"#646464",width:16,height:12,flex:"0 0 16px"}),dot:({current:e,disabled:t,showNumber:n})=>({counterIncrement:"dot",width:8,height:8,border:e?"0":"1px solid #caccce",borderRadius:"100%",padding:0,display:"block",margin:4,transition:"opacity 0.3s, transform 0.3s",cursor:t?"not-allowed":"pointer",transform:`scale(${e?1.25:1})`,color:e?"var(--reactour-accent, #007aff)":"#caccce",background:e?"var(--reactour-accent, #007aff)":"none"}),close:({disabled:e})=>({position:"absolute",top:22,right:22,width:9,height:9,"--rt-close-btn":e?"#caccce":"#5e5e5e","--rt-close-btn-disabled":e?"#caccce":"#000"}),svg:()=>({display:"block"})};function ae(e){return(t,n)=>{const r=nn[t](n),o=e[t];return o?o(r,n):r}}var rn=({styles:e={},children:t})=>{const n=ae(e);return b.createElement("span",{style:n("badge",{})},t)},on=rn,sn=e=>{var t=e,{styles:n={},onClick:r,disabled:o}=t,s=Z(t,["styles","onClick","disabled"]);const i=ae(n);return b.createElement("button",P({className:"reactour__close-button",style:P(P({},i("button",{})),i("close",{disabled:o})),onClick:r},s),b.createElement("svg",{viewBox:"0 0 9.1 9.1","aria-hidden":!0,role:"presentation",style:P({},i("svg",{}))},b.createElement("path",{fill:"currentColor",d:"M5.9 4.5l2.8-2.8c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0L4.5 3.1 1.7.3C1.3-.1.7-.1.3.3c-.4.4-.4 1 0 1.4l2.8 2.8L.3 7.4c-.4.4-.4 1 0 1.4.2.2.4.3.7.3s.5-.1.7-.3L4.5 6l2.8 2.8c.3.2.5.3.8.3s.5-.1.7-.3c.4-.4.4-1 0-1.4L5.9 4.5z"})))},an=sn,ln=({content:e,setCurrentStep:t,transition:n,isHighlightingObserved:r,currentStep:o,setIsOpen:s})=>typeof e=="function"?e({setCurrentStep:t,transition:n,isHighlightingObserved:r,currentStep:o,setIsOpen:s}):e,cn=ln,un=({styles:e={},steps:t,setCurrentStep:n,currentStep:r,setIsOpen:o,nextButton:s,prevButton:i,disableDots:a,hideDots:c,hideButtons:u,disableAll:l,rtl:f,Arrow:v=$e})=>{const g=t.length,_=ae(e),O=({onClick:y,kind:p="next",children:E,hideArrow:x})=>{function k(){l||(y&&typeof y=="function"?y():n(p==="next"?Math.min(r+1,g-1):Math.max(r-1,0)))}return b.createElement("button",{style:_("button",{kind:p,disabled:l||(p==="next"?g-1===r:r===0)}),onClick:k,"aria-label":`Go to ${p} step`},x?null:b.createElement(v,{styles:e,inverted:f?p==="prev":p==="next",disabled:l||(p==="next"?g-1===r:r===0)}),E)};return b.createElement("div",{style:_("controls",{}),dir:f?"rtl":"ltr"},u?null:i&&typeof i=="function"?i({Button:O,setCurrentStep:n,currentStep:r,stepsLength:g,setIsOpen:o,steps:t}):b.createElement(O,{kind:"prev"}),c?null:b.createElement("div",{style:_("navigation",{})},Array.from({length:g},(y,p)=>p).map(y=>{var p;return b.createElement("button",{style:_("dot",{current:y===r,disabled:a||l}),onClick:()=>{!a&&!l&&n(y)},key:`navigation_dot_${y}`,"aria-label":((p=t[y])==null?void 0:p.navDotAriaLabel)||`Go to step ${y+1}`})})),u?null:s&&typeof s=="function"?s({Button:O,setCurrentStep:n,currentStep:r,stepsLength:g,setIsOpen:o,steps:t}):b.createElement(O,null))},fn=un,$e=({styles:e={},inverted:t=!1,disabled:n})=>{const r=ae(e);return b.createElement("svg",{viewBox:"0 0 18.4 14.4",style:r("arrow",{inverted:t,disabled:n})},b.createElement("path",{d:t?"M17 7.2H1M10.8 1L17 7.2l-6.2 6.2":"M1.4 7.2h16M7.6 1L1.4 7.2l6.2 6.2",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeMiterlimit:"10"}))},dn={Badge:on,Close:an,Content:cn,Navigation:fn,Arrow:$e},hn=e=>P(P({},dn),e),pn=({styles:e,components:t={},badgeContent:n,accessibilityOptions:r,disabledActions:o,onClickClose:s,steps:i,setCurrentStep:a,currentStep:c,transition:u,isHighlightingObserved:l,setIsOpen:f,nextButton:v,prevButton:g,disableDotsNavigation:_,rtl:O,showPrevNextButtons:y=!0,showCloseButton:p=!0,showNavigation:E=!0,showBadge:x=!0,showDots:k=!0,meta:h,setMeta:T,setSteps:M})=>{const C=i[c],{Badge:w,Close:R,Content:A,Navigation:S,Arrow:j}=hn(t),$=n&&typeof n=="function"?n({currentStep:c,totalSteps:i.length,transition:u}):c+1;function B(){o||(s&&typeof s=="function"?s({setCurrentStep:a,setIsOpen:f,currentStep:c,steps:i,meta:h,setMeta:T,setSteps:M}):f(!1))}return b.createElement(b.Fragment,null,x?b.createElement(w,{styles:e},$):null,p?b.createElement(R,{styles:e,"aria-label":r==null?void 0:r.closeButtonAriaLabel,disabled:o,onClick:B}):null,b.createElement(A,{content:C==null?void 0:C.content,setCurrentStep:a,currentStep:c,transition:u,isHighlightingObserved:l,setIsOpen:f}),E?b.createElement(S,{setCurrentStep:a,currentStep:c,setIsOpen:f,steps:i,styles:e,"aria-hidden":!(r!=null&&r.showNavigationScreenReaders),nextButton:v,prevButton:g,disableDots:_,hideButtons:!y,hideDots:!k,disableAll:o,rtl:O,Arrow:j}):null)},vn=pn,mn=e=>{var t=e,{currentStep:n,setCurrentStep:r,setIsOpen:o,steps:s=[],setSteps:i,styles:a={},scrollSmooth:c,afterOpen:u,beforeClose:l,padding:f=10,position:v,onClickMask:g,onClickHighlighted:_,keyboardHandler:O,className:y="reactour__popover",maskClassName:p="reactour__mask",highlightedMaskClassName:E,clipId:x,maskId:k,disableInteraction:h,disableKeyboardNavigation:T,inViewThreshold:M,disabledActions:C,setDisabledActions:w,disableWhenSelectorFalsy:R,rtl:A,accessibilityOptions:S={closeButtonAriaLabel:"Close Tour",showNavigationScreenReaders:!0},ContentComponent:j,Wrapper:$,meta:B,setMeta:G,onTransition:I=()=>"center"}=t,D=Z(t,["currentStep","setCurrentStep","setIsOpen","steps","setSteps","styles","scrollSmooth","afterOpen","beforeClose","padding","position","onClickMask","onClickHighlighted","keyboardHandler","className","maskClassName","highlightedMaskClassName","clipId","maskId","disableInteraction","disableKeyboardNavigation","inViewThreshold","disabledActions","setDisabledActions","disableWhenSelectorFalsy","rtl","accessibilityOptions","ContentComponent","Wrapper","meta","setMeta","onTransition"]),H;const m=s[n],N=P(P({},a),m==null?void 0:m.styles),{sizes:K,transition:V,observableRefresher:le,isHighlightingObserved:pe,target:W}=Jt(m,{block:"center",behavior:c?"smooth":"auto",inViewThreshold:M});d.useEffect(()=>(u&&typeof u=="function"&&u(W),()=>{l&&typeof l=="function"&&l(W)}),[]);const{maskPadding:Ve,popoverPadding:We,wrapperPadding:qe}=bn((H=m==null?void 0:m.padding)!=null?H:f),X={setCurrentStep:r,setIsOpen:o,currentStep:n,setSteps:i,steps:s,setMeta:G,meta:B};function Be(){C||(g&&typeof g=="function"?g(X):o(!1))}const Ge=typeof(m==null?void 0:m.stepInteraction)=="boolean"?!(m!=null&&m.stepInteraction):h?typeof h=="boolean"?h:h(X):!1;d.useEffect(()=>(m!=null&&m.action&&typeof(m==null?void 0:m.action)=="function"&&(m==null||m.action(W)),(m==null?void 0:m.disableActions)!==void 0&&w(m==null?void 0:m.disableActions),()=>{m!=null&&m.actionAfter&&typeof(m==null?void 0:m.actionAfter)=="function"&&(m==null||m.actionAfter(W))}),[m]);const Ke=V?I:m!=null&&m.position?m==null?void 0:m.position:v,Ye=$||b.Fragment;return m?b.createElement(Ye,null,b.createElement(It,{mutationObservables:m==null?void 0:m.mutationObservables,resizeObservables:m==null?void 0:m.resizeObservables,refresh:le}),b.createElement(tn,{setCurrentStep:r,currentStep:n,setIsOpen:o,stepsLength:s.length,disableKeyboardNavigation:T,disable:C,rtl:A,clickProps:X,keyboardHandler:O}),(!R||W)&&b.createElement(Vt,{sizes:V?yn:K,onClick:Be,styles:P({highlightedArea:Y=>he(P({},Y),{display:Ge?"block":"none"})},N),padding:V?0:Ve,highlightedAreaClassName:E,className:p,onClickHighlighted:Y=>{Y.preventDefault(),Y.stopPropagation(),_&&_(Y,X)},wrapperPadding:qe,clipId:x,maskId:k}),(!R||W)&&b.createElement(Yt,{sizes:K,styles:N,position:Ke,padding:We,"aria-labelledby":S==null?void 0:S.ariaLabelledBy,className:y,refresher:n},j?b.createElement(j,P({styles:N,setCurrentStep:r,currentStep:n,setIsOpen:o,steps:s,accessibilityOptions:S,disabledActions:C,transition:V,isHighlightingObserved:pe,rtl:A},D)):b.createElement(vn,P({styles:N,setCurrentStep:r,currentStep:n,setIsOpen:o,steps:s,setSteps:i,accessibilityOptions:S,disabledActions:C,transition:V,isHighlightingObserved:pe,rtl:A,meta:B,setMeta:G},D)))):null},gn=mn;function bn(e){return typeof e=="object"&&e!==null?{maskPadding:e.mask,popoverPadding:e.popover,wrapperPadding:e.wrapper}:{maskPadding:e,popoverPadding:e,wrapperPadding:0}}var yn={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0},wn={isOpen:!1,setIsOpen:()=>!1,currentStep:0,setCurrentStep:()=>0,steps:[],setSteps:()=>[],setMeta:()=>"",disabledActions:!1,setDisabledActions:()=>!1,components:{}},_n=b.createContext(wn),En=e=>{var t=e,{children:n,defaultOpen:r=!1,startAt:o=0,steps:s,setCurrentStep:i,currentStep:a}=t,c=Z(t,["children","defaultOpen","startAt","steps","setCurrentStep","currentStep"]);const[u,l]=d.useState(r),[f,v]=d.useState(o),[g,_]=d.useState(s),[O,y]=d.useState(""),[p,E]=d.useState(!1),x=P({isOpen:u,setIsOpen:l,currentStep:a||f,setCurrentStep:i&&typeof i=="function"?i:v,steps:g,setSteps:_,disabledActions:p,setDisabledActions:E,meta:O,setMeta:y},c);return b.createElement(_n.Provider,{value:x},n,u?b.createElement(gn,P({},x)):null)};const On={default:"#1A1A1A",white:"#FFFFFF",orange:"#CE2021",current:"currentColor"};function Se({variant:e="default",size:t=40,className:n,style:r}){const o=On[e],s=t*(799/2325);return L.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:s,viewBox:"0 0 2325 799",fill:"none",className:n,style:r,"aria-hidden":"true",children:[L.jsx("rect",{x:"50",y:"50",width:"2225",height:"699",stroke:o,strokeWidth:"100"}),L.jsx("path",{d:"M492.333 199.627L599.833 295.627L600 295.776V491.707L492.207 599.5H199.5V199.5H492.19L492.333 199.627ZM334 347.5V448.5H435V347.5H334Z",fill:o}),L.jsx("path",{d:"M1108.5 497.715L1108.34 497.862L1001.34 599.362L1001.2 599.5H699V296.283L699.158 296.135L802.158 199.635L802.303 199.5H1108.5V497.715ZM855 347.5V448.5H956V347.5H855Z",fill:o}),L.jsx("path",{d:"M1616.94 200.24L1510.07 395.005L1616.94 598.768L1617.64 600.103L1616.28 599.451L1409 500.056L1208.22 599.448L1207.5 599.806V199.5H1617.34L1616.94 200.24ZM1332 337.5V439.207L1433.71 337.5H1332Z",fill:o}),L.jsx("path",{d:"M1716.5 599V200L1841 291.5L2125 200L2017.5 400L2125 599L1841 501L1716.5 599Z",fill:o,stroke:o})]})}function xn({caption:e,chipLabel:t,isLast:n,onAdvance:r,onEnd:o}){const s=t??(n?"Got it":"Next");return L.jsxs("div",{className:Ue("flex max-w-[min(20rem,calc(100vw-2rem))] flex-col gap-3 rounded-lg border","bg-popover text-popover-foreground shadow-floating p-4"),children:[L.jsxs("div",{className:"flex items-start gap-3",children:[L.jsxs("span",{className:"mt-0.5 shrink-0",children:[L.jsx(Se,{size:28,className:"dark:hidden"}),L.jsx(Se,{variant:"white",size:28,className:"hidden dark:block"})]}),L.jsx("p",{className:"text-sm leading-relaxed",children:e})]}),L.jsxs("div",{className:"flex items-center justify-end gap-2",children:[L.jsx(ve,{variant:"ghost",size:"sm",onClick:o,children:"Done"}),L.jsx(ve,{variant:"default",size:"sm",onClick:r,children:s})]})]})}const Rn=4e3,Sn=100;function kn(e){const[t,n]=d.useState({element:null,status:"resolving",anchor:e}),[r,o]=d.useState(e);return e!==r&&(o(e),n({element:null,status:"resolving",anchor:e})),d.useEffect(()=>{if(e===null)return;const s=Ce(e);let i=null,a=!1;const c=Date.now()+Rn,u=()=>{const f=document.querySelector(s);return f?(f!==i&&(f.scrollIntoView({block:"center",inline:"center"}),i=f,a=!0,n({element:f,status:"found",anchor:e})),!1):a?!1:Date.now()>=c?(n({element:null,status:"timeout",anchor:e}),!0):!1},l=setInterval(()=>{u()&&clearInterval(l)},Sn);return()=>clearInterval(l)},[e]),t}const Cn=".reactour__popover",Ln=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function ke(e){return Array.from(e.querySelectorAll(Ln))}function Mn(e,t){d.useEffect(()=>{var o;if(!e)return;const n=document.querySelector(Cn);if(!n)return;(o=ke(n)[0])==null||o.focus();const r=s=>{if(s.key!=="Tab")return;const i=ke(n);if(i.length===0)return;const a=i[0],c=i[i.length-1],u=document.activeElement;n.contains(u)?s.shiftKey&&u===a?(s.preventDefault(),c.focus()):!s.shiftKey&&u===c&&(s.preventDefault(),a.focus()):(s.preventDefault(),a.focus())};return document.addEventListener("keydown",r,!0),()=>document.removeEventListener("keydown",r,!0)},[e,t])}const ze="(prefers-reduced-motion: reduce)";function Tn(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(ze).matches}function An(){const[e,t]=d.useState(Tn);return d.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const n=window.matchMedia(ze),r=o=>t(o.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const In="dork-tour-mask--reduced-motion",Pn={mask:8,popover:10},Dn="x 280ms ease, y 280ms ease, width 280ms ease, height 280ms ease";function Hn({steps:e,activeIndex:t,onAdvance:n,onEnd:r}){const o=e[t],s=t>=e.length-1,i=Ze(),a=An(),c=kn((o==null?void 0:o.anchor)??null),[u,l]=d.useState(null);c.status==="found"&&c.element!==null&&c.anchor===(o==null?void 0:o.anchor)&&u!==t?l(t):!o&&u!==null&&l(null);const f=u!==null,v=u!==null?e[u]:void 0,g=d.useCallback(()=>{s?r():n()},[s,r,n]),_=d.useRef(g);d.useEffect(()=>{_.current=g},[g]),d.useEffect(()=>{c.status==="timeout"&&_.current()},[c.status]);const O=d.useRef(n),y=d.useRef(r);d.useEffect(()=>{O.current=n,y.current=r},[n,r]);const p=d.useRef(!1);d.useEffect(()=>{p.current=u===t},[u,t]);const[E,x]=d.useState(!1);d.useEffect(()=>{if(f&&!E){const w=requestAnimationFrame(()=>x(!0));return()=>cancelAnimationFrame(w)}},[f,E]),d.useEffect(()=>{if(!f)return;const w=document.getElementById("root");if(w)return w.inert=!0,()=>{w.inert=!1}},[f]),Mn(f,u??-1);const k=d.useMemo(()=>w=>{const R={...w,backgroundColor:"transparent",padding:0,boxShadow:"none",maxWidth:"none",color:"inherit"};return i?{...R,position:"fixed",top:"auto",left:0,right:0,bottom:0,transform:"none",display:"flex",justifyContent:"center",padding:"0 1rem 1rem"}:R},[i]),h=d.useCallback(w=>E?{...w,transition:Dn}:w,[E]),T=d.useMemo(()=>({popover:k,maskArea:h}),[k,h]),M=d.useMemo(()=>e.map((w,R)=>{const A=R===e.length-1;return{selector:Ce(w.anchor),stepInteraction:!1,content:L.jsx(xn,{caption:w.caption,chipLabel:w.chipLabel,isLast:A,onAdvance:()=>A?y.current():O.current(),onEnd:()=>y.current()})}}),[e]),C=d.useMemo(()=>e.map(w=>w.anchor).join("|"),[e]);return o?Xe.createPortal(L.jsxs(L.Fragment,{children:[L.jsx("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:f?(v==null?void 0:v.caption)??"":""}),f&&L.jsx(En,{steps:M,currentStep:u??0,defaultOpen:!0,showNavigation:!1,showPrevNextButtons:!1,showCloseButton:!1,showBadge:!1,showDots:!1,disableInteraction:!0,padding:Pn,styles:T,maskClassName:a?In:void 0,onClickMask:()=>r(),keyboardHandler:w=>{w.key==="Escape"?(w.preventDefault(),y.current()):w.key==="ArrowRight"&&p.current&&_.current()},children:L.jsx("span",{className:"hidden","aria-hidden":!0})},C)]}),document.body):null}const de={general:{id:"general",deepLink:{kind:"route",...Q.home()},steps:[{anchor:U.homeComposer,caption:z.general.composer,chipLabel:"Next"},{anchor:U.homeTabs,caption:z.general.homeTabs,chipLabel:"Got it"}]},tasks:{id:"tasks",occasion:"tasks",offerLine:z.offers.tasks,deepLink:{kind:"route",...Q.tasks()},steps:[{anchor:U.tasksList,caption:z.tasks.tasksList,chipLabel:"Got it"}]},relay:{id:"relay",occasion:"relay",offerLine:z.offers.relay,deepLink:{kind:"route",...Q.connections()},steps:[{anchor:U.relayIntegrations,caption:z.relay.relayIntegrations,chipLabel:"Got it"}]},mesh:{id:"mesh",occasion:"mesh",offerLine:z.offers.mesh,deepLink:{kind:"route",...Q.team()},steps:[{anchor:U.teamRoster,caption:z.mesh.teamRoster,chipLabel:"Got it"}]}},F=Qe()(e=>({runningTourId:null,activeIndex:0,pendingOfferId:null,startTour:t=>e({runningTourId:t,activeIndex:0,pendingOfferId:null}),advanceStep:()=>e(t=>({activeIndex:t.activeIndex+1})),endTour:()=>e({runningTourId:null,activeIndex:0}),setPendingOffer:t=>e({pendingOfferId:t}),clearPendingOffer:()=>e({pendingOfferId:null})}));function Fe(){var x,k;const e=Je(),t=et(),{data:n}=tt({queryKey:me.current(),queryFn:()=>e.getConfig(),staleTime:rt}),r=((x=n==null?void 0:n.tours)==null?void 0:x.seen)??[],o=((k=n==null?void 0:n.tours)==null?void 0:k.declined)??[],s=F(h=>h.runningTourId),i=F(h=>h.activeIndex),a=F(h=>h.pendingOfferId),c=F(h=>h.startTour),u=F(h=>h.advanceStep),l=F(h=>h.endTour),f=F(h=>h.setPendingOffer),v=F(h=>h.clearPendingOffer),g=nt({mutationFn:h=>e.updateConfig({tours:h}),onSuccess:()=>t.invalidateQueries({queryKey:me.all}),meta:{errorLabel:"Couldn’t save your tour progress"}});function _(h){r.includes(h)||g.mutate({seen:[...r,h]})}function O(h){o.includes(h)||g.mutate({declined:[...o,h]})}function y(h){return r.includes(h)||o.includes(h)}function p(h){_(h),c(h)}function E(h){O(h),v()}return{seen:r,declined:o,isSuppressed:y,runningDefinition:s?de[s]:null,activeIndex:i,pendingOffer:a?de[a]:null,pendingOfferId:a,runTour:c,acceptOffer:p,declineOffer:E,setPendingOffer:f,advanceStep:u,endTour:l}}const Nn=1,jn=1,$n=2;function zn(){const{isSuppressed:e,setPendingOffer:t,pendingOfferId:n,runningDefinition:r}=Fe(),o=ot(y=>Object.values(y.statuses).some(p=>p.lifecycle==="streaming")),s=ut(),i=it(),{data:a}=st(i),{data:c}=ft(s),{data:u}=at(),l=a==null?void 0:a.length,f=s&&c?c.reduce((y,p)=>y+p.instances.length,0):void 0,v=u==null?void 0:u.agents.length,g=d.useRef(void 0),_=d.useRef(void 0),O=d.useRef(void 0);d.useEffect(()=>{const y=(E,x,k,h,T)=>{if(x===void 0)return T;const M=h.current;return M===void 0||!(M<k&&x>=k)?(h.current=x,T):o||T||(h.current=x,e(E))?T:(t(E),!0)};let p=n!==null||r!==null;p=y("tasks",l,Nn,g,p),p=y("relay",f,jn,_,p),y("mesh",v,$n,O,p)},[l,f,v,o,n,r,e,t])}function Bn(){zn();const{runningDefinition:e,activeIndex:t,advanceStep:n,endTour:r,runTour:o}=Fe(),s=lt(),i=ct({select:l=>l.location.pathname}),a=ge(l=>l.requestedTour),c=ge(l=>l.clearRequestedTour),u=(e==null?void 0:e.id)??null;return d.useEffect(()=>{if(a!==null){if(!(a in de)){c();return}if(u===a){c();return}o(a)}},[a,u,o,c]),d.useEffect(()=>{if(!e)return;const{to:l}=e.deepLink;i!==l&&s({to:l})},[e,i,s]),e?L.jsx(Hn,{steps:e.steps,activeIndex:t,onAdvance:n,onEnd:r}):null}export{Se as D,de as T,Bn as a,zn as b,Fe as u};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import{mX as zn,mY as Wn,mZ as Pn,m_ as Bn,m$ as Fn,n0 as At,n1 as Mt,n2 as Vn,n3 as Gn,n4 as Un,n5 as Kn,n6 as Hn,n7 as Yn,n8 as qn,n9 as Qn,na as Xn,nb as Jn,nc as Zn,nd as Ne,ne as es,nf as ts,ng as ns,nh as ss,W as D,r as g,fq as y,fr as h,fB as M,ni as as,nj as z,l3 as Be,fu as L,ft as ae,fz as Ae,fx as Fe,fy as It,fp as K,fs as Se,nk as rs,nl as re,nm as is,nn as os,fA as cs,no as ls,ld as ds,lb as us,np as fs,iF as ps,a1 as ms,nq as Te,nr as hs,ns as _t,aV as gs,iI as xs,j as n,fi as ys,fj as bs,dw as vs,nt as js,h8 as Et,k9 as ks,kt as Ns,O as b,G as _,c8 as Ss,el as De,aN as ws,cd as Cs,bL as As,em as Ms,nu as Is,j7 as Tt,d4 as _s,dh as Es,fV as Ts,fl as $s,nv as Ds,b7 as Ls,nw as Os,bv as Rs,hs as zs,dU as Ws,b6 as Ps,J as Ve,nx as Bs,hr as Fs,lZ as Vs,a0 as $t,bM as Gs,B as Dt,dW as Ge,dP as Us,dQ as Ks,dR as Hs,dS as Ys,dT as qs,I as Qs,x as Xs,k5 as Lt,cN as Ot,cO as Rt,cP as zt,ny as Wt,a7 as Pt,g7 as Js,X as Zs,nz as ea,C as ta}from"./index-C8-dwIPp.js";import{C as Bt,a as na,b as sa,c as aa,d as ra,e as ia}from"./card-B_zeSZiU.js";import{P as oa,S as ca}from"./progress-Cvnh4Qcr.js";import{M as la}from"./markdown-content-GoymYcRL.js";import{T as Ft,d as Vt,b as Me,e as Le,c as Oe,a as Gt}from"./table-Rll_Jxd8.js";import{T as da}from"./terminal-Bjss9oke.js";import{P as ua}from"./package-DM7e-GVa.js";import{H as fa}from"./heart-BSVjeGLA.js";import{G as pa}from"./git-branch-CKlZ81Bg.js";import{F as ma}from"./file-text-BTj3WyHS.js";import{F as ha}from"./file-Bwo21EVR.js";const ga=(e,t,s)=>{const a=t-e;return((s-e)%a+a)%a+e};function Ut(e,t){return zn(e)?e[ga(0,e.length,t)]:e}class xa{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,s){for(let a=0;a<this.animations.length;a++)this.animations[a][t]=s}attachTimeline(t){const s=this.animations.map(a=>a.attachTimeline(t));return()=>{s.forEach((a,r)=>{a&&a(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return ot(this.animations,"duration")}get iterationDuration(){return ot(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(s=>s[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function ot(e,t){let s=0;for(let a=0;a<e.length;a++){const r=e[a][t];r!==null&&r>s&&(s=r)}return s}class ya extends xa{then(t,s){return this.finished.finally(t).then(()=>{})}}function ba(e,t){return e in t}class va extends Wn{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,s){if(ba(s,t)){const a=t[s];if(typeof a=="string"||typeof a=="number")return a}}getBaseTargetFromProps(){}removeValueFromRenderState(t,s){delete s.output[t]}measureInstanceViewportBox(){return Pn()}build(t,s){Object.assign(t.output,s)}renderInstance(t,{output:s}){Object.assign(t,s)}sortInstanceNodePosition(){return 0}}function Ue(e){return typeof e=="object"&&!Array.isArray(e)}function Kt(e,t,s,a){return e==null?[]:typeof e=="string"&&Ue(t)?Bn(e,s,a):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(r=>r!=null):[e]}function ja(e,t,s){return e*(t+1)+s*t}function ct(e,t,s,a){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?s:t.startsWith("<")?Math.max(0,s+parseFloat(t.slice(1))):a.get(t)??e}function ka(e,t,s){for(let a=0;a<e.length;a++){const r=e[a];r.at>t&&r.at<s&&(At(e,r),a--)}}function Na(e,t,s,a,r,o){ka(e,r,o);for(let i=0;i<t.length;i++)e.push({value:t[i],at:Fn(r,o,a[i]),easing:Ut(s,i)})}function Sa(e,t,s=0){const a=t+1+t*s;for(let r=0;r<e.length;r++)e[r]=e[r]/a}function wa(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const Ca="easeInOut",Aa=20;function Ma(e,{defaultTransition:t={},...s}={},a,r){const o=t.duration||.3,i=new Map,c=new Map,d={},u=new Map;let m=0,p=0,v=0;for(let k=0;k<e.length;k++){const S=e[k];if(typeof S=="string"){u.set(S,p);continue}else if(!Array.isArray(S)){u.set(S.name,ct(p,S.at,m,u));continue}let[j,A,I={}]=S;I.at!==void 0&&(p=ct(p,I.at,m,u));let N=0;const C=(l,f,x,T=0,R=0)=>{const w=Ia(l),{delay:O=0,times:E=Vn(w),type:B=t.type||"keyframes",repeat:Y,repeatType:V,repeatDelay:G=0,...U}=f;let{ease:$=t.ease||"easeOut",duration:F}=f;const ye=typeof O=="function"?O(T,R):O,Qe=w.length,Xe=Hn(B)?B:r==null?void 0:r[B||"keyframes"];if(Qe<=2&&Xe){let ne=100;if(Qe===2&&Ta(w)){const ue=w[1]-w[0];ne=Math.abs(ue)}const se={...t,...U};F!==void 0&&(se.duration=Yn(F));const be=Gn(se,ne,Xe);$=be.ease,F=be.duration}F??(F=o);const Je=p+ye;E.length===1&&E[0]===0&&(E[1]=1);const Ze=E.length-w.length;if(Ze>0&&Un(E,Ze),w.length===1&&w.unshift(null),Y&&Y<Aa){const ne=F>0?G/F:0;F=ja(F,Y,G);const se=[...w],be=[...E];$=Array.isArray($)?[...$]:[$];const ue=[...$],tt=V==="reverse"||V==="mirror";let nt=se,st=ue;tt&&(nt=[...se].reverse(),V==="reverse"&&(st=[...ue].reverse().map(Q=>typeof Q=="function"?Kn(Q):Q)));for(let Q=0;Q<Y;Q++){const at=tt&&Q%2===0,rt=at?nt:se,Rn=at?st:ue,it=(Q+1)*(1+ne);ne>0&&(w.push(w[w.length-1]),E.push(it),$.push("linear")),w.push(...rt);for(let fe=0;fe<rt.length;fe++)E.push(be[fe]+it),$.push(fe===0?"linear":Ut(Rn,fe-1))}Sa(E,Y,ne)}const et=Je+F;Na(x,w,$,E,Je,et),N=Math.max(ye+F,N),v=Math.max(et,v)};if(Mt(j)){const l=lt(j,c);C(A,I,dt("default",l))}else{const l=Kt(j,A,a,d),f=l.length;for(let x=0;x<f;x++){A=A,I=I;const T=l[x],R=lt(T,c);for(const w in A)C(A[w],_a(I,w),dt(w,R),x,f)}}m=p,p+=N}return c.forEach((k,S)=>{for(const j in k){const A=k[j];A.sort(wa);const I=[],N=[],C=[];for(let T=0;T<A.length;T++){const{at:R,value:w,easing:O}=A[T];I.push(w),N.push(qn(0,v,R)),C.push(O||"easeOut")}N[0]!==0&&(N.unshift(0),I.unshift(I[0]),C.unshift(Ca)),N[N.length-1]!==1&&(N.push(1),I.push(null)),i.has(S)||i.set(S,{keyframes:{},transition:{}});const l=i.get(S);l.keyframes[j]=I;const{type:f,...x}=t;l.transition[j]={...x,duration:v,ease:C,times:N,...s}}}),i}function lt(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function dt(e,t){return t[e]||(t[e]=[]),t[e]}function Ia(e){return Array.isArray(e)?e:[e]}function _a(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const Ea=e=>typeof e=="number",Ta=e=>e.every(Ea);function $a(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},s=Qn(e)&&!Xn(e)?new Jn(t):new Zn(t);s.mount(e),Ne.set(e,s)}function Da(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},s=new va(t);s.mount(e),Ne.set(e,s)}function La(e,t){return Mt(e)||typeof e=="number"||typeof e=="string"&&!Ue(t)}function Ht(e,t,s,a){const r=[];if(La(e,t))r.push(es(e,Ue(t)&&t.default||t,s&&(s.default||s)));else{if(e==null)return r;const o=Kt(e,t,a),i=o.length;for(let c=0;c<i;c++){const d=o[c],u=d instanceof Element?$a:Da;Ne.has(d)||u(d);const m=Ne.get(d),p={...s};"delay"in p&&typeof p.delay=="function"&&(p.delay=p.delay(c,i)),r.push(...ts(m,{...t,transition:p},{}))}}return r}function Oa(e,t,s){const a=[],r=e.map(i=>{if(Array.isArray(i)&&typeof i[0]=="function"){const c=i[0],d=ns(0);return d.on("change",c),i.length===1?[d,[0,1]]:i.length===2?[d,[0,1],i[1]]:[d,i[1],i[2]]}return i});return Ma(r,t,s,{spring:ss}).forEach(({keyframes:i,transition:c},d)=>{a.push(...Ht(d,i,c))}),a}function Ra(e){return Array.isArray(e)&&e.some(Array.isArray)}function za(e={}){const{scope:t,reduceMotion:s,skipAnimations:a}=e;function r(o,i,c){let d=[],u;const m={};if(s!==void 0&&(m.reduceMotion=s),a!==void 0&&(m.skipAnimations=a),Ra(o)){const{onComplete:v,...k}=i||{};typeof v=="function"&&(u=v),d=Oa(o,{...m,...k},t)}else{const{onComplete:v,...k}=c||{};typeof v=="function"&&(u=v),d=Ht(o,i,{...m,...k},t)}const p=new ya(d);return u&&p.finished.then(u),t&&(t.animations.push(p),p.finished.then(()=>{At(t.animations,p)})),p}return r}const Wa=za();/**
|
|
2
|
-
* @license lucide-react v1.48.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 Yt={name:"bookmark",size:24,node:[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]]};Yt.node;const Pa=D(Yt);/**
|
|
7
|
-
* @license lucide-react v1.48.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const qt={name:"circle-check-big",size:24,node:[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],aliases:["check-circle"]};qt.node;const Ba=D(qt);/**
|
|
12
|
-
* @license lucide-react v1.48.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const Qt={name:"cloud",size:24,node:[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]};Qt.node;const Fa=D(Qt);/**
|
|
17
|
-
* @license lucide-react v1.48.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const Xt={name:"code",size:24,node:[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]};Xt.node;const Va=D(Xt);/**
|
|
22
|
-
* @license lucide-react v1.48.0 - ISC
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the ISC license.
|
|
25
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const Jt={name:"cog",size:24,node:[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]]};Jt.node;const Ga=D(Jt);/**
|
|
27
|
-
* @license lucide-react v1.48.0 - ISC
|
|
28
|
-
*
|
|
29
|
-
* This source code is licensed under the ISC license.
|
|
30
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const Zt={name:"coins",size:24,node:[["path",{d:"M13.744 17.736a6 6 0 1 1-7.48-7.48",key:"bq4yh3"}],["path",{d:"M15 6h1v4",key:"11y1tn"}],["path",{d:"m6.134 14.768.866-.5 2 3.464",key:"17snzx"}],["circle",{cx:"16",cy:"8",r:"6",key:"14bfc9"}]]};Zt.node;const Ua=D(Zt);/**
|
|
32
|
-
* @license lucide-react v1.48.0 - ISC
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the ISC license.
|
|
35
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const en={name:"database",size:24,node:[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]};en.node;const Ka=D(en);/**
|
|
37
|
-
* @license lucide-react v1.48.0 - ISC
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the ISC license.
|
|
40
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const tn={name:"dice-1",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M12 12h.01",key:"1mp3jc"}]]};tn.node;const Ha=D(tn);/**
|
|
42
|
-
* @license lucide-react v1.48.0 - ISC
|
|
43
|
-
*
|
|
44
|
-
* This source code is licensed under the ISC license.
|
|
45
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const nn={name:"dice-2",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M15 9h.01",key:"x1ddxp"}],["path",{d:"M9 15h.01",key:"fzyn71"}]]};nn.node;const Ya=D(nn);/**
|
|
47
|
-
* @license lucide-react v1.48.0 - ISC
|
|
48
|
-
*
|
|
49
|
-
* This source code is licensed under the ISC license.
|
|
50
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const sn={name:"dice-3",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M16 8h.01",key:"cr5u4v"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]};sn.node;const qa=D(sn);/**
|
|
52
|
-
* @license lucide-react v1.48.0 - ISC
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the ISC license.
|
|
55
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const an={name:"dice-4",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M16 8h.01",key:"cr5u4v"}],["path",{d:"M8 8h.01",key:"1e4136"}],["path",{d:"M8 16h.01",key:"18s6g9"}],["path",{d:"M16 16h.01",key:"1f9h7w"}]]};an.node;const Qa=D(an);/**
|
|
57
|
-
* @license lucide-react v1.48.0 - ISC
|
|
58
|
-
*
|
|
59
|
-
* This source code is licensed under the ISC license.
|
|
60
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/const rn={name:"dice-5",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M16 8h.01",key:"cr5u4v"}],["path",{d:"M8 8h.01",key:"1e4136"}],["path",{d:"M8 16h.01",key:"18s6g9"}],["path",{d:"M16 16h.01",key:"1f9h7w"}],["path",{d:"M12 12h.01",key:"1mp3jc"}]]};rn.node;const Xa=D(rn);/**
|
|
62
|
-
* @license lucide-react v1.48.0 - ISC
|
|
63
|
-
*
|
|
64
|
-
* This source code is licensed under the ISC license.
|
|
65
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const on={name:"dice-6",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M16 8h.01",key:"cr5u4v"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M16 16h.01",key:"1f9h7w"}],["path",{d:"M8 8h.01",key:"1e4136"}],["path",{d:"M8 12h.01",key:"czm47f"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]};on.node;const Ja=D(on);/**
|
|
67
|
-
* @license lucide-react v1.48.0 - ISC
|
|
68
|
-
*
|
|
69
|
-
* This source code is licensed under the ISC license.
|
|
70
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/const cn={name:"dices",size:24,node:[["rect",{width:"12",height:"12",x:"2",y:"10",rx:"2",ry:"2",key:"6agr2n"}],["path",{d:"m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6",key:"1o487t"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 14h.01",key:"ssrbsk"}],["path",{d:"M15 6h.01",key:"cblpky"}],["path",{d:"M18 9h.01",key:"2061c0"}]]};cn.node;const Za=D(cn);/**
|
|
72
|
-
* @license lucide-react v1.48.0 - ISC
|
|
73
|
-
*
|
|
74
|
-
* This source code is licensed under the ISC license.
|
|
75
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const ln={name:"flag",size:24,node:[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]};ln.node;const er=D(ln);/**
|
|
77
|
-
* @license lucide-react v1.48.0 - ISC
|
|
78
|
-
*
|
|
79
|
-
* This source code is licensed under the ISC license.
|
|
80
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const dn={name:"house",size:24,node:[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],aliases:["home"]};dn.node;const tr=D(dn);/**
|
|
82
|
-
* @license lucide-react v1.48.0 - ISC
|
|
83
|
-
*
|
|
84
|
-
* This source code is licensed under the ISC license.
|
|
85
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/const un={name:"map-pin",size:24,node:[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]};un.node;const nr=D(un);/**
|
|
87
|
-
* @license lucide-react v1.48.0 - ISC
|
|
88
|
-
*
|
|
89
|
-
* This source code is licensed under the ISC license.
|
|
90
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const fn={name:"rocket",size:24,node:[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]};fn.node;const sr=D(fn);/**
|
|
92
|
-
* @license lucide-react v1.48.0 - ISC
|
|
93
|
-
*
|
|
94
|
-
* This source code is licensed under the ISC license.
|
|
95
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const pn={name:"tag",size:24,node:[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]};pn.node;const ar=D(pn);/**
|
|
97
|
-
* @license lucide-react v1.48.0 - ISC
|
|
98
|
-
*
|
|
99
|
-
* This source code is licensed under the ISC license.
|
|
100
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const mn={name:"trending-down",size:24,node:[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]]};mn.node;const rr=D(mn);/**
|
|
102
|
-
* @license lucide-react v1.48.0 - ISC
|
|
103
|
-
*
|
|
104
|
-
* This source code is licensed under the ISC license.
|
|
105
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const hn={name:"trending-up",size:24,node:[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]};hn.node;const ir=D(hn),gn=g.createContext(void 0),or=gn.Provider;function cr(){return g.useContext(gn)}const lr=/[\u0000-\u001f\u007f-\u009f]+/g;function xn(e,t){const s=new RegExp(`<\\s*/\\s*${t}`,"gi");return e.replace(s,`<\\/${t}`)}function $e(e,t){return xn(e.replace(lr," ").trim(),t)}const ie="ui_action";function dr(e){const t=e.widgetTitle?$e(e.widgetTitle,ie):"",s=[`<${ie}>`,"The user interacted with a widget you rendered.",`Widget: ${t||"(untitled)"}`,`Action: ${$e(e.actionId,ie)}`];e.widgetId&&s.push(`Widget ID: ${$e(e.widgetId,ie)}`);const a=e.payload&&Object.keys(e.payload).length>0;return s.push(a?`Payload:
|
|
107
|
-
${xn(JSON.stringify(e.payload,null,2),ie)}`:"Payload: (none)"),s.push("Respond to this interaction now. If the widget represents ongoing state (a game, a checklist), re-emit exactly ONE updated widget reflecting it — trust this payload over your memory of prior turns."),s.push(`</${ie}>`),s.join(`
|
|
108
|
-
`)}const ur=K(["default","success","warning","error","info"]),yn=y({kind:M("agent"),id:h().min(1),label:h().optional(),payload:It(h(),cs()).optional()}),bn=y({kind:M("emit"),type:ls,payload:ds.optional(),coalesceKey:h().min(1).max(128).optional()}).strict(),ut=Be("kind",[yn,bn]),Re=Be("kind",[yn,bn,y({kind:M("ui"),command:os}),y({kind:M("url"),href:h().url().refine(e=>e.startsWith("https://"),{message:"Widget URLs must be https"})})]),ft=Ae([h(),Fe(),Se(),is()]),fr=["sm","md","lg"],pt={sm:4,md:12};function pr(e){const t=typeof e=="number"?e:typeof e=="string"&&e.trim()!==""&&!Number.isNaN(Number(e))?Number(e):null;if(t!==null)return t<=pt.sm?"sm":t<=pt.md?"md":"lg";if(typeof e=="string"){const s=e.trim().toLowerCase();if(s==="none"||s==="xs"||s==="small"||s==="sm")return"sm";if(s==="medium"||s==="normal"||s==="md")return"md";if(s==="large"||s==="xl"||s==="xxl"||s==="lg")return"lg"}return e}const mr=z(pr,K(fr));function J(e){return t=>{if(typeof t!="string")return t;const s=t.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(e,s)?e[s]:t}}const Ke=z(J({default:"default",neutral:"default",muted:"default",normal:"default",gray:"default",grey:"default",success:"success",ok:"success",okay:"success",good:"success",positive:"success",done:"success",complete:"success",completed:"success",green:"success",warning:"warning",warn:"warning",caution:"warning",pending:"warning",yellow:"warning",orange:"warning",error:"error",danger:"error",critical:"error",fail:"error",failed:"error",failure:"error",negative:"error",blocked:"error",red:"error",info:"info",information:"info",note:"info",blue:"info"}),ur),hr=z(J({vertical:"vertical",vert:"vertical",column:"vertical",col:"vertical",stack:"vertical",horizontal:"horizontal",horiz:"horizontal",row:"horizontal",inline:"horizontal"}),K(["vertical","horizontal"])),gr=z(J({default:"default",primary:"default",secondary:"secondary",destructive:"destructive",danger:"destructive",delete:"destructive",outline:"outline",ghost:"outline",link:"outline"}),K(["default","secondary","destructive","outline"])),xr=z(J({bar:"bar",bars:"bar",column:"bar",columns:"bar",histogram:"bar",line:"line",lines:"line",area:"area",pie:"pie",donut:"pie",doughnut:"pie"}),K(["bar","line","area","pie"])),yr=z(J({up:"up",increase:"up",increased:"up",positive:"up",rise:"up",rising:"up",gain:"up",down:"down",decrease:"down",decreased:"down",negative:"down",fall:"down",falling:"down",drop:"down",loss:"down",flat:"flat",none:"flat",neutral:"flat",same:"flat",unchanged:"flat",steady:"flat"}),K(["up","down","flat"])),br=z(e=>{const t=typeof e=="number"?e:typeof e=="string"&&e.trim()!==""&&!Number.isNaN(Number(e))?Number(e):null;return t===null?e:Math.min(3,Math.max(1,Math.round(t)))},Ae([M(1),M(2),M(3)])),vr=z(e=>typeof e=="string"?{value:e,direction:"flat"}:typeof e=="number"?{value:e,direction:e>0?"up":e<0?"down":"flat"}:e,y({value:Ae([h(),Fe()]),direction:yr.default("flat")})),jr=z(e=>typeof e=="string"?{text:e}:e,y({text:h(),tone:Ke.optional()})),kr=z(J({done:"done",complete:"done",completed:"done",finished:"done",past:"done",active:"active",current:"active",now:"active","in-progress":"active",in_progress:"active",inprogress:"active",ongoing:"active",upcoming:"upcoming",pending:"upcoming",next:"upcoming",todo:"upcoming",future:"upcoming",planned:"upcoming"}),K(["done","active","upcoming"])),mt=z(e=>{if(typeof e=="number")return e===1?!0:e===0?!1:e;if(typeof e=="string"){const t=e.trim().toLowerCase();if(t==="true"||t==="yes"||t==="checked")return!0;if(t==="false"||t==="no"||t==="unchecked")return!1}return e},Se()),Nr=z(J({happy:"happy",proud:"happy",joy:"happy",joyful:"happy",glad:"happy",thinking:"thinking",confused:"thinking",pondering:"thinking",curious:"thinking",hmm:"thinking",celebrating:"celebrating",excited:"celebrating",party:"celebrating",hyped:"celebrating",sheepish:"sheepish",embarrassed:"sheepish",oops:"sheepish",awkward:"sheepish",shy:"sheepish",determined:"determined",focused:"determined",serious:"determined",resolute:"determined",surprised:"surprised",shocked:"surprised",wow:"surprised",amazed:"surprised","mind-blown":"surprised",sad:"sad",unhappy:"sad",disappointed:"sad",down:"sad",love:"love",heart:"love",hearts:"love",adore:"love"}),K(["happy","thinking","celebrating","sheepish","determined","surprised","sad","love"])),Sr=z(J({coin:"coin",flip:"coin",coinflip:"coin",d6:"d6",dice:"d6",die:"d6",d20:"d20","8ball":"8ball",magic8ball:"8ball","8-ball":"8ball",eightball:"8ball","magic-8-ball":"8ball"}),K(["coin","d6","d20","8ball"])),wr=z(e=>typeof e=="number"?String(e):e,h()),ht=12;function Cr(e){return typeof e!="string"?e:e.trim()===""?{}:{glyph:e}}const Ar=h().max(8).optional().transform(e=>{const t=e==null?void 0:e.trim();return t||void 0}),Mr=z(Cr,y({glyph:Ar,icon:h().optional(),tone:Ke.optional(),action:Re.optional()})),Ir=z(e=>Array.isArray(e)?e.slice(0,ht).map(t=>Array.isArray(t)?t.slice(0,ht):t):e,L(L(Mr))),ee={text:y({text:re.optional()}).strict(),stat:y({value:re.optional()}).strict(),progress:y({value:re.optional(),label:re.optional()}).strict(),table:y({rows:re.optional()}).strict(),chart:y({data:re.optional()}).strict()},pe=as(()=>z((e,t)=>{if(typeof e=="object"&&e!==null&&Object.hasOwn(e,"bind")){const s=e,a=typeof s.type=="string"&&Object.hasOwn(ee,s.type)?ee[s.type]:void 0;if(!a||!a.safeParse(s.bind).success)return t.addIssue({code:"custom",path:["bind"],message:"This element needs a supported display field and a safe state path."}),rs}return e},Be("type",[y({type:M("stack"),direction:hr,gap:mr.optional(),children:L(pe)}),y({type:M("card"),title:h().optional(),description:h().optional(),children:L(pe),footer:L(pe).optional()}),y({type:M("divider")}),y({type:M("heading"),text:h(),level:br.optional()}),y({type:M("text"),text:h(),bind:ee.text.optional()}),y({type:M("badge"),text:h(),tone:Ke.optional()}),y({type:M("stat"),bind:ee.stat.optional(),label:h(),value:Ae([h(),Fe()]),delta:vr.optional(),hint:h().optional(),trend:L(ae().finite()).max(50).optional()}),y({type:M("keyValue"),items:L(y({key:h(),value:h()}))}),y({type:M("image"),src:h().refine(e=>e.startsWith("https://")||e.startsWith("data:"),{message:"Widget image sources must be https or data URIs"}),alt:h(),caption:h().optional()}),y({type:M("progress"),bind:ee.progress.optional(),value:ae().finite().transform(e=>Math.min(100,Math.max(0,e))),label:h().optional()}),y({type:M("table"),bind:ee.table.optional(),columns:L(y({key:h(),label:h(),align:K(["left","center","right"]).optional()})),rows:L(It(h(),ft))}),y({type:M("list"),items:L(y({title:h(),subtitle:h().optional(),icon:h().optional(),image:h().refine(e=>e.startsWith("https://")||e.startsWith("data:"),{message:"Widget image sources must be https or data URIs"}).optional(),meta:h().optional(),badge:jr.optional(),actions:L(Re).optional()}))}),y({type:M("chart"),bind:ee.chart.optional(),kind:xr,data:L(y({label:h(),value:ae().finite().min(0)})),height:ae().finite().positive().optional()}),y({type:M("button"),label:h(),variant:gr.optional(),action:Re}),y({type:M("input"),name:h().min(1),label:h().optional(),placeholder:h().optional(),kind:K(["text","number"]).optional(),required:Se().optional()}),y({type:M("select"),required:Se().optional(),name:h().min(1),label:h().optional(),options:L(y({label:h(),value:h()}))}),y({type:M("form"),children:L(pe),submit:y({label:h(),action:ut})}),y({type:M("timeline"),items:L(y({time:h().optional(),title:h(),subtitle:h().optional(),icon:h().optional(),status:kr.optional()})).min(1)}),y({type:M("checklist"),items:L(y({label:h(),checked:mt.optional(),note:h().optional()})),action:ut.optional(),submitLabel:h().optional()}),y({type:M("compare"),options:L(y({name:h(),recommended:mt.optional()})).min(1),rows:L(y({label:h(),values:L(ft)}))}),y({type:M("rating"),value:ae().finite().transform(e=>Math.min(5,Math.max(0,e))),count:ae().int().nonnegative().optional(),label:h().optional()}),y({type:M("mood"),emotion:Nr,message:h().optional()}),y({type:M("board"),rows:Ir,label:h().optional()}),y({type:M("reveal"),kind:Sr,result:wr,label:h().optional()})]))),_r=y({version:M(1),title:h().optional(),root:pe});function ze(e){return e.some(t=>fs(t,"widget.action"))}const Er=100,Tr=3e4;function vn(e){if(e!==null&&typeof e=="object"){for(const t of Object.values(e))vn(t);Object.freeze(e)}return e}function $r(e,t){var C;const[s,a]=g.useState([]),r=g.useRef(new Map),o=g.useRef(e),i=g.useRef({documentId:e==null?void 0:e.documentId,owner:e==null?void 0:e.submissionOwner}),c=g.useRef(!0),d=g.useRef(0),u=g.useCallback(()=>{const l=++d.current,f=[...r.current.values()].map(x=>x.value);a(x=>d.current===l?f:x)},[]),m=g.useCallback(l=>{const f=l.operation;l.operation=void 0,f&&(f.active=!1,clearTimeout(f.timer),f.controller.abort())},[]),p=g.useCallback(l=>{l.retired=!0,l.start=void 0,++d.current,m(l)},[m]),v=g.useCallback(l=>c.current&&!l.retired&&r.current.get(l.value.event.id)===l,[]),k=g.useCallback(l=>{const f=o.current;return i.current.documentId===l.value.documentId&&i.current.owner===l.owner&&(f==null?void 0:f.documentId)===l.value.documentId&&(f==null?void 0:f.submissionOwner)===l.owner},[]),S=g.useCallback((l,f)=>{if(!v(l)||!k(l))return!1;const x=o.current;return!(l.host.current?l.host.current(f):x.enabled)||!v(l)||!k(l)?!1:l.original.current(f)&&v(l)&&k(l)},[v,k]);g.useLayoutEffect(()=>{const l={documentId:e==null?void 0:e.documentId,owner:e==null?void 0:e.submissionOwner};o.current=e,i.current=l;for(const f of r.current.values())k(f)||p(f)},[e,e==null?void 0:e.documentId,e==null?void 0:e.submissionOwner,k,p]),g.useEffect(()=>{c.current=!0;const l=r.current;return()=>{c.current=!1;for(const f of l.values())p(f)}},[p]);const j=g.useCallback((l,f)=>{l.value={...l.value,...f},u()},[u]);g.useEffect(()=>{var l;for(const f of r.current.values()){if(!v(f)||!k(f)||f.value.phase==="refused")continue;const x=f.start,T=f.operation;if(!S(f,"read")||f.start!==x||f.operation!==T)continue;const R=(l=e==null?void 0:e.snapshot)==null?void 0:l.receipts.find(w=>w.receipt.id===f.value.event.id);!S(f,"read")||f.start!==x||f.operation!==T||R&&R!==f.value.receipt&&(f.start=void 0,f.value={...f.value,phase:"accepted",receipt:R},m(f),u())}},[(C=e==null?void 0:e.snapshot)==null?void 0:C.receipts,e==null?void 0:e.submissionOwner,v,k,S,m,u]);const A=l=>[...r.current.values()].some(f=>f.value.controlId===l&&!f.retired&&["sending","retry","review"].includes(f.value.phase)),I=async(l,f=!1)=>{var Y;if(!v(l)||!k(l))return;const x=Object.freeze({});l.start=x,++d.current,m(l);const T=()=>v(l)&&k(l)&&l.start===x&&l.operation===void 0;if(!T())return;const R=S(l,f?"read":"submit");if(!T())return;if(!R){j(l,{phase:f?"retry":"refused",message:f?"Save not confirmed. Review the document before trying again.":"Document actions are unavailable. Review this action before trying again."});return}const w=new AbortController;if(!T()){w.abort();return}const O={token:Object.freeze({}),controller:w,active:!0};l.operation=O,l.start=void 0;const E=()=>v(l)&&k(l)&&l.operation===O&&O.active&&!w.signal.aborted,B=V=>E()?S(l,V)&&E():!1;if(O.timer=setTimeout(()=>{E()&&(O.active=!1,l.operation=void 0,l.uncertain=!0,j(l,{phase:"retry",message:"Save not confirmed. Check your network and try again."}),w.abort())},Tr),!E()){clearTimeout(O.timer),w.abort();return}j(l,{phase:"sending",message:void 0});try{if(f)try{if(!B("read")){E()&&j(l,{phase:"retry",message:"Save not confirmed. Review the document before trying again."});return}const $=await l.original.inspect(w.signal);if(!B("read")){E()&&j(l,{phase:"retry",message:"Save not confirmed. Review the document before trying again."});return}j(l,{phase:"accepted",receipt:$});return}catch($){if(!E()||!E())return;throw $}if(!B("submit")){E()&&j(l,{phase:"review",message:"Document approval changed. Review this action before trying again."});return}const V=[...((Y=o.current)==null?void 0:Y.approvedEventTypes)??[]],G=!l.value.normalized||ze(V);if(!E())return;if(!G){j(l,{phase:"review",message:"Document approval changed. Review this action before trying again."});return}if(!B("submit"))return;l.uncertain=!0;const U=await l.original.submit(w.signal);if(!B("read")){E()&&j(l,{phase:"retry",message:"Save not confirmed. Review the document before trying again."});return}j(l,{phase:"accepted",receipt:U})}catch(V){if(!E())return;const G=V.status;if(!E())return;const U=G!==void 0&&[400,401,403,404,409,413,422].includes(G),$=!f&&U;l.uncertain=f||!$,j(l,{phase:$?"refused":U?"review":"retry",message:$?"This action could not be saved. Review the document before trying again.":U?"Save not confirmed. Review this action before trying again.":"Save not confirmed. Check your network and try again."})}finally{l.operation===O&&(l.operation=void 0,O.active=!1,clearTimeout(O.timer),w.abort())}};return{dispatch:async(l,f)=>{var G;const x=o.current;if(!(x!=null&&x.enabled)||A(f))return;const T=l.kind==="agent";if(T&&!ze(x.approvedEventTypes)||l.kind!=="emit"&&!T)return;const R=us.parse({v:1,id:crypto.randomUUID(),type:T?"widget.action":l.type,payload:T?{actionId:l.id,payload:l.payload??{},widget:{documentId:x.documentId,nodeId:f,...t?{title:t}:{}}}:{...l.payload??{},widget:{documentId:x.documentId,nodeId:f,...t?{title:t}:{}}},...!T&&l.coalesceKey?{coalesceKey:l.coalesceKey}:{}}),w=JSON.stringify(R),O=x.documentId,E=x.submissionOwner,B=(G=x.captureOriginal)==null?void 0:G.call(x,R);if(!B||B.id!==R.id||B.bytes!==w||!c.current||o.current!==x||x.documentId!==O||x.submissionOwner!==E||!B.current("submit")||!c.current||o.current!==x||x.documentId!==O||x.submissionOwner!==E)return;const Y={...x.current?{current:x.current.bind(x)}:{}};if(!c.current||o.current!==x||A(f))return;if(r.current.size>=Er){const U=[...r.current.values()].find($=>{var F;return $.value.phase==="refused"||$.value.phase==="accepted"&&((F=$.value.receipt)==null?void 0:F.deliveries.every(ye=>["handled","rejected","turn_done","expired","failed","cancelled","superseded","unavailable"].includes(ye.status)))});if(!U)throw new Error("Too many actions are waiting. Try again after they finish.");if(r.current.delete(U.value.event.id),p(U),!c.current||o.current!==x||A(f))return}const V={host:Y,owner:x.submissionOwner,original:B,retired:!1,uncertain:!1,value:{controlId:f,documentId:x.documentId,normalized:T,event:vn(JSON.parse(w)),phase:"sending"}};r.current.set(R.id,V),u(),await I(V)},pending:A,records:s,retry:l=>{const f=r.current.get(l);return f&&f.uncertain&&(f.value.phase==="retry"||f.value.phase==="sending")?I(f,!0):Promise.resolve()}}}const jn=g.createContext("root"),Dr=jn.Provider;function Z(){return g.useContext(jn)}function kn(e){return e.id+":"+JSON.stringify(e.payload??null)}const gt=()=>Promise.resolve(),Nn=g.createContext({onAction:gt,hasSession:!1,channelRecords:[],channelPending:()=>!1,retryChannel:gt,superseded:!1,latched:!1,dispatchedActionKey:null,dispatchStatus:"idle"});function Lr({children:e,channel:t,sessionId:s,widgetTitle:a,isLatestMessage:r=!0}){const{setTheme:o}=ps(),i=ms(),c=$r(t,a),[d,u]=g.useState(null),[m,p]=g.useState(null),v=g.useRef(!1),k=g.useCallback(async(j,A)=>{if(j.kind==="emit"||t&&j.kind==="agent"){await c.dispatch(j,(A==null?void 0:A.controlId)??"root");return}switch(j.kind){case"ui":{if(!s&&!_t(j.command))return;const I={getStore:gs.getState,setTheme:o,supportsTerminal:i.supportsTerminal,celebrationOrigin:A==null?void 0:A.origin,sessionId:s};xs(I,j.command,"user");return}case"url":u(j.href);return;case"agent":{if(!s||v.current)return;v.current=!0;const I={actionId:j.id,payload:j.payload,widgetTitle:a},N=Te.getState();N.setOptimisticUserMessage(s,{id:crypto.randomUUID(),content:dr(I)}),N.setTriggerPending(s,!0);const C=kn(j);p({key:C,status:"pending"});try{await i.sendUiAction(s,I),p({key:C,status:"sent"}),setTimeout(()=>{var f;const l=Te.getState().getSession(s);l.triggerPending&&((f=l.status)==null?void 0:f.lifecycle)!=="streaming"&&Te.getState().setTriggerPending(s,!1)},hs.TRIGGER_PENDING_TIMEOUT_MS)}catch(l){throw v.current=!1,N.setOptimisticUserMessage(s,null),N.setTriggerPending(s,!1),p(null),l}return}}},[o,i,s,a,t,c]),S=g.useMemo(()=>({onAction:k,channel:t,channelRecords:c.records,channelPending:c.pending,retryChannel:c.retry,hasSession:!!s,superseded:!r,latched:m!==null,dispatchedActionKey:(m==null?void 0:m.key)??null,dispatchStatus:(m==null?void 0:m.status)??"idle"}),[k,s,r,m,t,c]);return n.jsxs(Nn.Provider,{value:S,children:[e,n.jsx(ys,{url:d??"",isOpen:d!==null,onClose:()=>u(null),onConfirm:()=>{d&&bs(d),u(null)}})]})}function ge(){return g.useContext(Nn)}function Sn(e,t){var N;const s=Z(),a=ge();if(e.kind==="emit"||e.kind==="agent"&&a.channel!==void 0){const C=!((N=a.channel)!=null&&N.enabled)||e.kind==="agent"&&!ze(a.channel.approvedEventTypes),l=a.channelPending(t??s);return{isAgent:!1,unavailable:C,superseded:!1,latched:!1,isDispatched:l,dispatchStatus:l?"pending":"idle",interactive:!C&&!l}}const{hasSession:o,superseded:i,latched:c,dispatchedActionKey:d,dispatchStatus:u}=a,m=e.kind==="agent",p=e.kind==="agent"?kn(e):null,v=p!==null&&p===d,S=(m||e.kind==="ui"&&!_t(e.command))&&!o,j=m&&i;return{isAgent:m,unavailable:S,superseded:j,latched:m&&c&&!v,isDispatched:v,dispatchStatus:v?u:"idle",interactive:m?!S&&!j&&!c:!S}}const H={type:"spring",stiffness:400,damping:32,mass:.8},le=[.22,1,.36,1],He=.05,Ye=.9,xe={hidden:{opacity:0,y:6,scale:.985},visible:{opacity:1,y:0,scale:1,transition:H}},Ie={hidden:{},visible:{transition:{staggerChildren:He}}};function W(){return!vs()}function wn(e,t,s=Ye*1e3){const[a,r]=g.useState(()=>t?0:e),o=g.useRef(t?0:e);return g.useEffect(()=>{if(!t){o.current=e;return}const i=Wa(o.current,e,{duration:s/1e3,ease:le,onUpdate:c=>{o.current=c,r(c)}});return()=>i.stop()},[e,t,s]),t?a:e}const Cn=new Set(["__proto__","prototype","constructor"]),Or={text:["text"],stat:["value"],progress:["value","label"],table:["rows"],chart:["data"]},Rr=100,xt=50,zr=16384;function oe(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function X(e,t){const s=Object.getOwnPropertyDescriptor(e,t);if(!s||!("value"in s))throw new Error("missing");return s.value}function Wr(e,t){if(!oe(e)||!js.safeParse(t).success)throw new Error("path");let s=e;if(t==="")return s;for(const a of t.slice(1).split("/")){const r=a.replaceAll("~1","/").replaceAll("~0","~");if(Cn.has(r))throw new Error("path");if(Array.isArray(s)){if(!/^(0|[1-9]\d*)$/u.test(r)||Number(r)>=s.length)throw new Error("index")}else if(!oe(s))throw new Error("object");s=X(s,r)}return s}function me(e,t=zr){return typeof e=="string"&&e.length<=t}function ke(e){return typeof e=="number"&&Number.isFinite(e)}function Pr(e){return e===null||typeof e=="boolean"||ke(e)||me(e)}function Br(e,t,s){if(e.type==="text"&&t==="text"&&me(s)||e.type==="stat"&&t==="value"&&(me(s,1024)||ke(s))||e.type==="progress"&&(t==="label"&&me(s,1024)||t==="value"&&ke(s)&&s>=0&&s<=100))return s;if(!Array.isArray(s)||s.length>Rr)throw new Error("type");if(e.type==="table"&&t==="rows"){if(e.columns.length>xt)throw new Error("columns");const a=new Set(e.columns.map(r=>r.key));return Array.from({length:s.length},(r,o)=>{const i=X(s,String(o));if(!oe(i))throw new Error("row");const c=Object.keys(i);if(c.length>xt)throw new Error("columns");const d=Object.create(null);for(const u of c){if(Cn.has(u)||!a.has(u))throw new Error("column");const m=X(i,u);if(!Pr(m))throw new Error("cell");d[u]=m}return d})}if(e.type==="chart"&&t==="data")return Array.from({length:s.length},(a,r)=>{const o=X(s,String(r));if(!oe(o)||Object.keys(o).some(d=>d!=="label"&&d!=="value"))throw new Error("point");const i=X(o,"label"),c=X(o,"value");if(!me(i,1024)||!ke(c)||c<0)throw new Error("point");return{label:i,value:c}});throw new Error("type")}function Fr(e,t){if(!("bind"in e)||e.bind===void 0)return{node:e};const s=Or[e.type],a=e.bind;if(!s||!oe(a))return{error:"This element has an unsupported state binding."};const r=Object.keys(a);if(r.length===0)return{node:e};const o={};for(const i of r)try{if(!s.includes(i))throw new Error("field");const c=X(a,i);if(!oe(c)||Object.keys(c).length!==1||!Object.hasOwn(c,"path"))throw new Error("binding");const d=X(c,"path");if(typeof d!="string")throw new Error("path");const u=Br(e,i,Wr(t,d));if(new TextEncoder().encode(JSON.stringify(u)).byteLength>65536)throw new Error("size");o[i]=u}catch{return{error:`Cannot show ${i}: its state value is missing or has the wrong type.`}}return{node:{...e,...o}}}const An=g.createContext(null),Vr=An.Provider;function Mn(){return g.useContext(An)}const Gr={default:"bg-secondary text-secondary-foreground border-transparent",success:"bg-status-success-bg text-status-success-fg border-status-success-border",warning:"bg-status-warning-bg text-status-warning-fg border-status-warning-border",error:"bg-status-error-bg text-status-error-fg border-status-error-border",info:"bg-status-info-bg text-status-info-fg border-status-info-border"};function _e(e){return Gr[e??"default"]}function Ur(e){var c;if(typeof e=="number")return Number.isFinite(e)?{prefix:"",suffix:"",decimals:0,grouped:!1,value:e}:null;const t=e.match(/^(.*?)(-?\d[\d,]*(?:\.\d+)?)(.*)$/s);if(!t)return null;const[,s,a,r]=t,o=Number(a.replace(/,/g,""));if(!Number.isFinite(o))return null;const i=a.includes(".")?((c=a.split(".")[1])==null?void 0:c.length)??0:0;return{prefix:s,suffix:r,decimals:i,grouped:a.includes(","),value:o}}function Kr(e,t){const s=t.toFixed(e.decimals),a=e.grouped?Number(s).toLocaleString("en-US",{minimumFractionDigits:e.decimals,maximumFractionDigits:e.decimals}):s;return`${e.prefix}${a}${e.suffix}`}const Hr={1:"text-lg font-semibold",2:"text-base font-semibold",3:"text-sm font-semibold"};function Yr({node:e}){const t=e.level??3,s=_(Hr[t],"text-foreground");return t===1?n.jsx("h1",{className:s,children:e.text}):t===2?n.jsx("h2",{className:s,children:e.text}):n.jsx("h3",{className:s,children:e.text})}function qr({node:e}){return n.jsx(la,{content:e.text,className:"text-sm"})}function Qr({node:e}){const t=W();return n.jsx(b.span,{className:_("inline-flex w-fit items-center rounded-md border px-2 py-0.5 text-xs font-medium",_e(e.tone)),initial:t?{opacity:0,scale:.8}:!1,animate:t?{opacity:1,scale:1}:!1,transition:H,children:e.text})}function Xr(){return n.jsx(Ss,{})}const Jr={up:Ns,down:ks,flat:Et},Zr={up:"text-status-success",down:"text-status-error",flat:"text-muted-foreground"};function ei({node:e}){const t=W(),s=Ur(e.value),a=wn((s==null?void 0:s.value)??0,t&&s!==null),r=s?Kr(s,a):String(e.value),o=e.delta?Jr[e.delta.direction]:null;return n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-muted-foreground text-xs font-medium",children:e.label}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex items-baseline gap-2",children:[n.jsx("span",{className:"text-foreground text-2xl font-semibold tabular-nums",children:r}),e.delta&&o&&n.jsxs(b.span,{className:_("inline-flex items-center gap-0.5 text-xs font-medium",Zr[e.delta.direction]),initial:t?{opacity:0,x:-4}:!1,animate:t?{opacity:1,x:0}:!1,transition:{...H,delay:.25},children:[n.jsx(o,{className:"size-3","aria-hidden":!0}),e.delta.value]})]}),e.trend&&e.trend.length>=2&&n.jsx(ti,{values:e.trend})]}),e.hint&&n.jsx("span",{className:"text-muted-foreground text-xs",children:e.hint})]})}function ti({values:e}){const t=W(),s=`spark-wipe-${g.useId().replace(/:/g,"")}`,a=Math.min(...e),r=Math.max(...e),o=r-a||1,i=e.map((c,d)=>{const u=d/(e.length-1)*100,m=r===a?50:100-(c-a)/o*100;return`${u},${m}`}).join(" ");return n.jsxs("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"h-5 w-16 shrink-0 overflow-visible","aria-hidden":!0,children:[t&&n.jsx("defs",{children:n.jsx("clipPath",{id:s,children:n.jsx(b.rect,{x:-4,y:-12,height:124,initial:{width:0},animate:{width:108},transition:{duration:Ye,ease:le}})})}),n.jsx("g",{clipPath:t?`url(#${s})`:void 0,children:n.jsx("polyline",{points:i,fill:"none",stroke:"hsl(var(--chart-1))",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"})})]})}function ni({node:e}){return n.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-sm",children:e.items.map((t,s)=>n.jsxs("div",{className:"contents",children:[n.jsx("dt",{className:"text-muted-foreground",children:t.key}),n.jsx("dd",{className:"text-foreground text-right break-words",children:t.value})]},`${t.key}-${s}`))})}function si({node:e}){const t=W(),s=wn(e.value,t);return n.jsxs("div",{className:"flex flex-col gap-1",children:[(e.label||e.label==="")&&n.jsxs("div",{className:"text-muted-foreground flex items-center justify-between text-xs",children:[n.jsx("span",{children:e.label}),n.jsxs("span",{className:"tabular-nums",children:[Math.round(s),"%"]})]}),n.jsx(oa,{value:s})]})}function ai({node:e}){return n.jsxs("figure",{className:"flex flex-col gap-1",children:[n.jsx("img",{src:e.src,alt:e.alt,className:"max-h-80 w-full rounded-md border object-contain",loading:"lazy"}),e.caption&&n.jsx("figcaption",{className:"text-muted-foreground text-xs",children:e.caption})]})}const ri=b.create(Gt),ii=b.create(Me),yt={left:"text-left",center:"text-center",right:"text-right"};function oi(e){return e===null?"—":typeof e=="boolean"?e?"Yes":"No":String(e)}function ci({node:e}){const t=W();return n.jsx("div",{className:"overflow-x-auto",children:n.jsxs(Ft,{children:[n.jsx(Vt,{children:n.jsx(Me,{children:e.columns.map(s=>n.jsx(Le,{className:_(s.align&&yt[s.align]),children:s.label},s.key))})}),n.jsx(ri,{variants:t?Ie:void 0,initial:t?"hidden":!1,animate:t?"visible":!1,children:e.rows.map((s,a)=>n.jsx(ii,{variants:t?xe:void 0,children:e.columns.map(r=>n.jsx(Oe,{className:_("tabular-nums",r.align&&yt[r.align]),children:oi(s[r.key]??null)},r.key))},a))})]})})}const li={"alert-circle":Gs,"alert-triangle":$t,archive:Vs,"arrow-right":Et,bell:Fs,bookmark:Pa,calendar:Bs,check:Ve,"check-circle":Ba,circle:De,clock:Ps,cloud:Fa,code:Va,cog:Ga,database:Ka,file:ha,"file-text":ma,flag:er,folder:Ws,"git-branch":pa,globe:zs,heart:fa,home:tr,info:Rs,link:Os,lock:Ls,mail:Ds,"map-pin":nr,"message-square":$s,package:ua,play:Ts,rocket:sr,search:Es,server:ca,settings:_s,star:Tt,tag:ar,terminal:da,"thumbs-up":Is,trash:Ms,"trending-down":rr,"trending-up":ir,user:As,users:Cs,zap:ws};function qe(e){if(!e)return De;const t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase();return li[t]??De}function di(e,t){var a;if(e.phase==="sending")return"Saving…";if(e.phase!=="accepted")return e.message??"This action could not be saved.";const s=((a=e.receipt)==null?void 0:a.deliveries)??[];return s.length?s.map(r=>{if(r.ackOutcome==="handled"||r.status==="handled")return`${t} reported that it handled this action.`;if(r.ackOutcome==="rejected"||r.status==="rejected")return`${t} could not handle this action.`;switch(r.status){case"turn_started":return`${t} started working.`;case"turn_done":return`${t} finished. Handling is not confirmed yet.`;case"in_doubt":return"Saved; outcome unknown. Review before replaying.";case"failed":return"Saved; the agent request failed.";case"expired":return"Saved; expired before the agent started.";case"superseded":return"Saved; replaced by a newer change.";case"cancelled":return"Saved; the agent request was cancelled.";case"unavailable":return"Saved; the destination is not available.";default:return`Saved; waiting for ${t}.`}}).join(" "):"Saved to the document."}function In({controlId:e,descendants:t=!1}){const{channel:s,channelRecords:a,retryChannel:r}=ge();if(!s)return null;const o=a.filter(i=>i.controlId===e||t&&i.controlId.startsWith(`${e}.`));return o.length?n.jsx("ul",{className:"text-muted-foreground mt-2 flex max-h-32 flex-col gap-1.5 overflow-y-auto text-xs","aria-live":"polite","aria-relevant":"additions text","data-testid":"widget-action-statuses",children:o.map((i,c)=>n.jsxs("li",{"data-testid":"widget-action-status","data-event-id":i.event.id,className:"flex flex-wrap items-center gap-2",children:[n.jsxs("span",{children:[o.length>1?`Action ${c+1}: `:"",di(i,s.destinationLabel)]}),i.phase==="retry"&&n.jsx(Dt,{size:"sm",variant:"ghost",onClick:()=>void r(i.event.id),"data-testid":"widget-action-retry",children:"Try again"})]},i.event.id))}):null}function Ee({action:e,label:t,variant:s,fullWidth:a,controlId:r,submit:o}){const{onAction:i,channel:c}=ge(),d=Z(),u=r??d,m=e.kind==="emit"||e.kind==="agent"&&c!==void 0,p=Sn(e,u),v=W(),k=p.isDispatched&&p.dispatchStatus==="pending",S=p.isDispatched&&p.dispatchStatus==="sent",j=!p.interactive,A=v&&p.interactive,I=l=>{var T;if(j){l.preventDefault();return}if(o&&!((T=l.currentTarget.form)!=null&&T.reportValidity())){l.preventDefault();return}const f=Wt(l.currentTarget.getBoundingClientRect()),x=i(e,{origin:f,controlId:u});e.kind!=="agent"&&e.kind!=="emit"||x.catch(()=>{Pt.error(m?"This action could not be saved.":"Couldn’t send the action",{description:m?"Check the action size and document permissions, then try again.":"Your agent may be busy. Try again."})})};let N=null;p.superseded?N="This one’s from an earlier message.":p.unavailable?N=m?e.kind==="agent"&&(c!=null&&c.enabled)?"This action needs an approved document route.":"Document actions are not available here.":"Interactions aren’t available here":p.latched&&(N="Sent. Waiting for the agent’s reply");const C=n.jsxs(Dt,{type:o?"submit":"button","data-testid":m?"widget-channel-action":void 0,size:"sm",variant:s??"default","aria-disabled":j||void 0,disabled:k,onClick:j?void 0:I,className:_(a&&"w-full",j&&"cursor-default",(p.unavailable||p.superseded)&&"opacity-50",S&&"opacity-70"),children:[k&&n.jsx(Xs,{size:"xs"}),S&&n.jsx(Ve,{className:"size-(--size-icon-xs)","aria-hidden":!0}),t]});return m?n.jsxs("div",{className:_(a&&"w-full"),children:[n.jsx("div",{className:"text-muted-foreground mb-1 text-xs",children:c!=null&&c.destinationLabel?`To ${c.destinationLabel}`:"Document action"}),C,N&&n.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:N}),n.jsx(In,{controlId:u})]}):N?n.jsx(Lt,{children:n.jsxs(Ot,{children:[n.jsx(Rt,{asChild:!0,children:C}),n.jsx(zt,{children:N})]})}):!A&&!m?C:n.jsx(b.div,{className:_("inline-flex",a&&"w-full"),whileHover:{scale:1.02},transition:H,children:C})}function ui({node:e}){return n.jsx(Ee,{action:e.action,label:e.label,variant:e.variant})}function fi({node:e}){const t=Mn(),s=g.useId(),[a,r]=g.useState(!1),[o,i]=g.useState(""),c=t?t.values[e.name]??"":o,d=u=>t?t.setValue(e.name,u):i(u);return n.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.label&&n.jsx(Ge,{htmlFor:s,children:e.label}),n.jsx(Qs,{id:s,name:e.name,type:e.kind==="number"?"number":"text",required:e.required,"aria-label":e.label??e.name,placeholder:e.placeholder,value:c,"aria-invalid":a||void 0,"aria-describedby":a?`${s}-error`:void 0,onInvalid:u=>{u.preventDefault(),r(!0),u.currentTarget.focus()},onChange:u=>{r(!1),d(u.target.value)}}),a&&n.jsxs("p",{id:`${s}-error`,className:"text-destructive text-xs",role:"alert",children:["Enter ",e.label??e.name,"."]})]})}function pi({node:e}){const t=g.useRef(null),s=Mn(),a=g.useId(),[r,o]=g.useState(!1),[i,c]=g.useState(""),d=s?s.values[e.name]??"":i,u=m=>s?s.setValue(e.name,m):c(m);return n.jsxs("div",{className:"flex flex-col gap-1.5",onInvalidCapture:m=>{var p;m.preventDefault(),o(!0),(p=t.current)==null||p.focus()},children:[e.label&&n.jsx(Ge,{htmlFor:a,children:e.label}),n.jsxs(Us,{name:e.name,required:e.required,value:d||void 0,onValueChange:m=>{o(!1),u(m)},children:[n.jsx(Ks,{ref:t,"aria-invalid":r||void 0,"aria-describedby":r?`${a}-error`:void 0,id:a,"aria-label":e.label??e.name,children:n.jsx(Hs,{placeholder:"Select…"})}),n.jsx(Ys,{children:e.options.map(m=>n.jsx(qs,{value:m.value,children:m.label},m.value))})]}),r&&n.jsxs("p",{id:`${a}-error`,className:"text-destructive text-xs",role:"alert",children:["Choose ",e.label??e.name,"."]})]})}function mi({node:e}){const t=W(),s=Z();return n.jsx(b.ul,{className:"divide-border divide-y",variants:t?Ie:void 0,initial:t?"hidden":!1,animate:t?"visible":!1,children:e.items.map((a,r)=>{const o=qe(a.icon);return n.jsxs(b.li,{className:"hover:bg-muted/40 -mx-2 flex items-center gap-3 rounded-md px-2 py-2 transition-colors first:pt-0 last:pb-0",variants:t?xe:void 0,children:[a.image&&n.jsx("img",{src:a.image,alt:"",className:"size-10 shrink-0 rounded-md border object-cover",loading:"lazy"}),a.icon&&n.jsx(o,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":!0}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("p",{className:"text-foreground truncate text-sm font-medium",children:a.title}),a.subtitle&&n.jsx("p",{className:"text-muted-foreground truncate text-xs",children:a.subtitle})]}),a.meta&&n.jsx("span",{className:"text-muted-foreground shrink-0 text-sm tabular-nums",children:a.meta}),a.badge&&n.jsx("span",{className:_("inline-flex shrink-0 items-center rounded-md border px-2 py-0.5 text-xs font-medium",_e(a.badge.tone)),children:a.badge.text}),a.actions&&a.actions.length>0&&n.jsx("div",{className:"flex shrink-0 items-center gap-1.5",children:a.actions.map((i,c)=>n.jsx(Ee,{action:i,controlId:`${s}.items.${r}.actions.${c}`,label:i.kind==="agent"?i.label??"Action":i.kind==="emit"?"Send":hi(i)},c))})]},r)})})}function hi(e){return e.kind==="url"?"Open":"Run"}const te=["hsl(var(--chart-1))","hsl(var(--chart-2))","hsl(var(--chart-3))","hsl(var(--chart-4))","hsl(var(--chart-5))"],gi=180,xi=.15;function yi({node:e}){const t=e.height??gi,s=`${e.kind} chart`;return e.data.length===0?n.jsx("p",{className:"text-muted-foreground text-xs",children:"No data to chart."}):e.kind==="bar"?n.jsx(vi,{data:e.data,height:t,label:s}):e.kind==="pie"?n.jsx(Ni,{data:e.data,height:t,label:s}):n.jsx(ji,{data:e.data,height:t,area:e.kind==="area",label:s})}const bi=18;function vi({data:e,height:t,label:s}){const a=W(),r=Math.max(...e.map(i=>i.value),0)||1,o=Math.max(0,t-bi);return n.jsxs("div",{role:"img","aria-label":s,className:"flex flex-col gap-1",children:[n.jsx("div",{className:"flex items-end gap-2",style:{height:t},children:e.map((i,c)=>n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col items-center justify-end gap-1",children:[n.jsx("span",{className:"text-muted-foreground text-2xs tabular-nums",children:i.value}),n.jsx(b.div,{className:"w-full origin-bottom rounded-t-sm",style:{height:i.value/r*o,backgroundColor:te[c%te.length]},initial:a?{scaleY:0}:!1,animate:a?{scaleY:1}:!1,transition:{...H,delay:c*He}})]},c))}),n.jsx(_n,{data:e})]})}function ji({data:e,height:t,area:s,label:a}){const r=Math.max(...e.map(v=>v.value),0)||1,o=e.length,c=e.map((v,k)=>{const S=o===1?50:k/(o-1)*100,j=100-v.value/r*100;return{x:S,y:j}}).map(v=>`${v.x},${v.y}`).join(" "),d=`0,100 ${c} 100,100`,u=te[0],m=W(),p=`chart-wipe-${g.useId().replace(/:/g,"")}`;return n.jsxs("div",{role:"img","aria-label":a,className:"flex flex-col gap-1",children:[n.jsxs("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",style:{height:t},className:"w-full overflow-visible",children:[m&&n.jsx("defs",{children:n.jsx("clipPath",{id:p,children:n.jsx(b.rect,{x:-4,y:-12,height:124,initial:{width:0},animate:{width:108},transition:{duration:Ye,ease:le}})})}),n.jsxs("g",{clipPath:m?`url(#${p})`:void 0,children:[s&&n.jsx("polygon",{points:d,fill:u,opacity:xi}),n.jsx("polyline",{points:c,fill:"none",stroke:u,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"})]})]}),n.jsx(_n,{data:e})]})}const ki=359.99;function Ni({data:e,height:t,label:s}){const a=W(),r=e.reduce((i,c)=>i+c.value,0)||1,o=e.map((i,c)=>{const u=-90+e.slice(0,c).reduce((v,k)=>v+k.value,0)/r*360,m=i.value/r*360,p=m>=ki;return{d:i,full:p,path:p?"":Si(u,u+m)}});return n.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[n.jsx("svg",{viewBox:"0 0 100 100",role:"img","aria-label":s,style:{height:t,width:t},children:o.map((i,c)=>{const d=te[c%te.length],u={initial:a?{opacity:0,scale:.6}:!1,animate:a?{opacity:1,scale:1}:!1,transition:{...H,delay:c*He},style:{transformOrigin:"50px 50px"}};return i.full?n.jsx(b.circle,{cx:50,cy:50,r:50,fill:d,...u},c):n.jsx(b.path,{d:i.path,fill:d,...u},c)})}),n.jsx("ul",{className:"flex flex-col gap-1 text-xs",children:e.map((i,c)=>n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"size-2.5 shrink-0 rounded-sm",style:{backgroundColor:te[c%te.length]},"aria-hidden":!0}),n.jsx("span",{className:"text-foreground",children:i.label}),n.jsx("span",{className:"text-muted-foreground tabular-nums",children:i.value})]},c))})]})}function _n({data:e}){return n.jsx("div",{className:"flex gap-2",children:e.map((t,s)=>n.jsx("span",{className:_("text-muted-foreground text-2xs min-w-0 flex-1 truncate text-center"),title:t.label,children:t.label},s))})}function Si(e,t){const o=bt(50,50,50,e),i=bt(50,50,50,t),c=t-e>180?1:0;return`M 50 50 L ${o.x} ${o.y} A 50 50 0 ${c} 1 ${i.x} ${i.y} Z`}function bt(e,t,s,a){const r=a*Math.PI/180;return{x:e+s*Math.cos(r),y:t+s*Math.sin(r)}}const wi={done:"border-status-success bg-status-success text-white dark:text-status-success-bg",active:"border-primary bg-primary text-primary-foreground",upcoming:"border-border bg-background text-muted-foreground"};function Ci({node:e}){const t=W();return n.jsx(b.ol,{className:"flex flex-col",variants:t?Ie:void 0,initial:t?"hidden":!1,animate:t?"visible":!1,children:e.items.map((s,a)=>{const r=s.status??"upcoming",o=a===e.items.length-1,i=s.icon?qe(s.icon):null;return n.jsxs(b.li,{className:"flex gap-3",variants:t?xe:void 0,children:[n.jsxs("div",{className:"flex flex-col items-center",children:[n.jsxs("span",{className:"relative flex size-5 shrink-0 items-center justify-center",children:[r==="active"&&t&&n.jsx(b.span,{className:"border-primary absolute inset-0 rounded-full border",initial:{opacity:.6,scale:1},animate:{opacity:0,scale:1.8},transition:{duration:1.6,repeat:1/0,ease:"easeOut"},"aria-hidden":!0}),n.jsx("span",{className:_("flex size-3 items-center justify-center rounded-full border",wi[r],r==="active"&&"ring-primary/30 ring-2"),children:i&&n.jsx(i,{className:"size-2.5","aria-hidden":!0})})]}),!o&&n.jsx("span",{className:"bg-border w-px flex-1","aria-hidden":!0})]}),n.jsxs("div",{className:_("min-w-0 flex-1",!o&&"pb-4"),children:[s.time&&n.jsx("p",{className:"text-muted-foreground text-xs tabular-nums",children:s.time}),n.jsx("p",{className:_("text-foreground text-sm",r==="active"?"font-semibold":"font-medium"),children:s.title}),s.subtitle&&n.jsx("p",{className:"text-muted-foreground text-xs",children:s.subtitle})]})]},a)})})}function Ai({node:e}){const t=g.useId(),[s,a]=g.useState(()=>e.items.map(o=>o.checked??!1)),r=g.useMemo(()=>{if(!e.action)return null;const o=e.items.filter((d,u)=>s[u]).map(d=>d.label),i=e.items.filter((d,u)=>!s[u]).map(d=>d.label),c={checked:o,unchecked:i};return e.action.kind==="emit"?{...e.action,payload:{...e.action.payload??{},...c}}:{...e.action,payload:{...e.action.payload??{},...c}}},[e.action,e.items,s]);return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("ul",{className:"flex flex-col gap-2",children:e.items.map((o,i)=>{const c=`${t}-${i}`;return n.jsxs("li",{className:"flex items-start gap-2.5",children:[n.jsx(Js,{id:c,checked:s[i],onCheckedChange:d=>a(u=>u.map((m,p)=>p===i?d===!0:m)),className:"mt-0.5"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx(Ge,{htmlFor:c,className:_("text-sm font-normal transition-colors",s[i]&&"text-muted-foreground line-through"),children:o.label}),o.note&&n.jsx("p",{className:"text-muted-foreground text-xs",children:o.note})]})]},i)})}),r&&n.jsx(Ee,{action:r,label:e.submitLabel??"Send",fullWidth:!0})]})}const Mi=b.create(Gt),Ii=b.create(Me);function _i({value:e}){return e==null?n.jsx("span",{className:"text-muted-foreground",children:"—"}):typeof e=="boolean"?e?n.jsx(Ve,{className:"text-status-success mx-auto size-4","aria-label":"Yes"}):n.jsx(Zs,{className:"text-muted-foreground mx-auto size-4","aria-label":"No"}):n.jsx("span",{className:"tabular-nums",children:String(e)})}function Ei({node:e}){const t=W();return n.jsx("div",{className:"overflow-x-auto",children:n.jsxs(Ft,{children:[n.jsx(Vt,{children:n.jsxs(Me,{children:[n.jsx(Le,{}),e.options.map((s,a)=>n.jsxs(Le,{className:_("text-center",s.recommended&&"bg-primary/5"),children:[n.jsx("span",{className:"text-foreground font-medium",children:s.name}),s.recommended&&n.jsx("span",{className:_("text-2xs mt-1 flex w-fit items-center justify-center rounded-md border px-1.5 py-0.5 font-medium","mx-auto",_e("success")),children:"Recommended"})]},a))]})}),n.jsx(Mi,{variants:t?Ie:void 0,initial:t?"hidden":!1,animate:t?"visible":!1,children:e.rows.map((s,a)=>n.jsxs(Ii,{variants:t?xe:void 0,children:[n.jsx(Oe,{className:"text-muted-foreground font-medium",children:s.label}),e.options.map((r,o)=>n.jsx(Oe,{className:_("text-center",r.recommended&&"bg-primary/5"),children:n.jsx(_i,{value:s.values[o]??null})},o))]},a))})]})})}const We=5,Ti=Array.from({length:We});function vt({className:e}){return n.jsx("div",{className:"flex","aria-hidden":!0,children:Ti.map((t,s)=>n.jsx(Tt,{className:_("size-4",e)},s))})}function $i({node:e}){const t=W(),s=e.value/We*100;return n.jsxs(b.div,{className:"flex items-center gap-2",initial:t?{opacity:0,y:4}:!1,animate:t?{opacity:1,y:0}:!1,transition:H,children:[n.jsxs("div",{className:"relative w-fit",role:"img","aria-label":`Rated ${e.value.toFixed(1)} out of ${We}`,children:[n.jsx(vt,{className:"text-muted-foreground"}),n.jsx("div",{className:"absolute inset-y-0 left-0 overflow-hidden",style:{width:`${s}%`},children:n.jsx(vt,{className:"fill-status-warning text-status-warning"})})]}),n.jsx("span",{className:"text-foreground text-sm font-medium tabular-nums",children:e.value.toFixed(1)}),e.count!==void 0&&n.jsxs("span",{className:"text-muted-foreground text-sm tabular-nums",children:["(",e.count.toLocaleString(),")"]}),e.label&&n.jsx("span",{className:"text-muted-foreground text-sm",children:e.label})]})}const Di=7.4,Li=[1,.1,1,1,.1,1,.1,1,1],Oi=[0,.02,.045,.52,.54,.565,.585,.61,1];function q({cx:e,cy:t,r:s=3,openness:a=1,active:r=!0,popIn:o=!1,motionOn:i}){const c=i&&r,d=a;return n.jsx(b.circle,{cx:e,cy:t,r:s,fill:"currentColor",style:{transformOrigin:`${e}px ${t}px`,scaleY:i?void 0:d},initial:i&&o?{scale:.2}:void 0,animate:i?{scale:1,...c?{scaleY:Li.map(u=>u*d)}:{scaleY:d}}:void 0,transition:i?{scale:{type:"spring",stiffness:500,damping:15},...c?{scaleY:{duration:Di,times:Oi,repeat:1/0,ease:"easeInOut"}}:{}}:void 0})}function jt({cx:e,cy:t}){return n.jsx("path",{d:`M ${e-4.5} ${t+1.5} Q ${e} ${t-4.5} ${e+4.5} ${t+1.5}`,fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round"})}function kt({cx:e,cy:t,motionOn:s,pulseDuration:a,delay:r=0,wobble:o=3}){const i=`M ${e} ${t+4} C ${e-8} ${t-2}, ${e-4} ${t-8}, ${e} ${t-4} C ${e+4} ${t-8}, ${e+8} ${t-2}, ${e} ${t+4} Z`;return n.jsx(b.path,{d:i,fill:"currentColor",className:"text-status-error",style:{transformOrigin:`${e}px ${t}px`},animate:s?{scale:[1,1.16,1],rotate:[-o,o,-o]}:void 0,transition:s?{scale:{duration:a,repeat:1/0,ease:"easeInOut",delay:r},rotate:{duration:a*2.1,repeat:1/0,ease:"easeInOut",delay:r}}:void 0})}function P({d:e}){return n.jsx("path",{d:e,fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round"})}function ce({cx:e,cy:t,opacity:s=.3}){return n.jsx("ellipse",{cx:e,cy:t,rx:3.6,ry:2.1,className:"text-status-error",fill:"currentColor",fillOpacity:s})}const Nt="M 0 -3.2 C 2.2 -0.6, 2.6 1.4, 0 3.2 C -2.6 1.4, -2.2 -0.6, 0 -3.2 Z";function En({x:e,y:t,motionOn:s,duration:a,repeatDelay:r}){return s?n.jsx(b.g,{style:{x:e,y:t},animate:{y:[t,t+2,t+9,t+11],opacity:[0,.85,.85,0],scale:[.5,1,1,.85]},transition:{duration:a,times:[0,.3,.85,1],repeat:1/0,repeatDelay:r,ease:"easeIn"},children:n.jsx("path",{d:Nt,className:"text-status-info",fill:"currentColor"})}):n.jsx("g",{transform:`translate(${e} ${t+4})`,opacity:.5,children:n.jsx("path",{d:Nt,className:"text-status-info",fill:"currentColor"})})}function Ri({motionOn:e}){return n.jsx(En,{x:47,y:13,motionOn:e,duration:3.4,repeatDelay:2.6})}function zi({motionOn:e}){return n.jsx(En,{x:24,y:30,motionOn:e,duration:3.6,repeatDelay:3.2})}function Wi({motionOn:e}){return e?n.jsx(n.Fragment,{children:[{x:49,y:15,delay:0},{x:53.5,y:19,delay:.9}].map((t,s)=>n.jsx(b.circle,{cx:t.x,cy:t.y,r:2,fill:"currentColor",style:{transformOrigin:`${t.x}px ${t.y}px`},animate:{opacity:[0,.45,0],y:[0,-3,-6],scale:[.6,1,1.4]},transition:{duration:2,repeat:1/0,repeatDelay:1.4,delay:t.delay,ease:"easeOut"}},s))}):null}const de={fill:"none",stroke:"currentColor",strokeLinecap:"round"};function Pi({motionOn:e}){const t={scaleY:[1,.1,1,1,.15,.15,1],times:[0,.03,.06,.84,.87,.96,1]},s={opacity:[0,0,.4,.4,0],times:[0,.84,.88,.96,1]},a={duration:8,repeat:1/0,ease:"easeInOut"};return n.jsxs(n.Fragment,{children:[n.jsx(P,{d:"M18 18 Q24 14.5 30 18"}),n.jsx(P,{d:"M34 18 Q40 14.5 46 18"}),[24,40].map(r=>n.jsx(b.circle,{cx:r,cy:26,r:3,fill:"currentColor",style:{transformOrigin:`${r}px 26px`},animate:e?{scaleY:t.scaleY}:void 0,transition:e?{...a,times:t.times}:void 0},r)),e&&n.jsxs(b.g,{animate:{opacity:s.opacity},transition:{...a,times:s.times},children:[n.jsx(ce,{cx:16.5,cy:33,opacity:1}),n.jsx(ce,{cx:47.5,cy:33,opacity:1})]}),n.jsx("path",{d:"M19 38 Q32 51 45 38",...de,strokeWidth:3})]})}function Bi({motionOn:e}){return n.jsxs(n.Fragment,{children:[n.jsx(P,{d:"M20 20 L29 20"}),n.jsx(b.g,{animate:e?{y:[0,-1.2,0]}:void 0,transition:e?{duration:3.4,repeat:1/0,ease:"easeInOut"}:void 0,children:n.jsx(P,{d:"M36 16 Q41 13 46 16"})}),n.jsxs(b.g,{animate:e?{x:[0,0,-3.5,-3.5,0,0,2,0]}:void 0,transition:e?{duration:7,times:[0,.3,.36,.52,.58,.78,.84,1],repeat:1/0,ease:"easeInOut"}:void 0,children:[n.jsx(q,{cx:27,cy:23,motionOn:e}),n.jsx(q,{cx:43,cy:23,motionOn:e})]}),n.jsx("path",{d:"M27 43 L37 41.5",...de,strokeWidth:2.5})]})}function Fi(){return n.jsxs(n.Fragment,{children:[n.jsx(P,{d:"M18 16 Q24 12.5 30 16"}),n.jsx(P,{d:"M34 16 Q40 12.5 46 16"}),n.jsx(jt,{cx:24,cy:26}),n.jsx(jt,{cx:40,cy:26}),n.jsx("path",{d:"M19 37 Q32 54 45 37 Q32 44 19 37 Z",fill:"currentColor",stroke:"currentColor",strokeWidth:1,strokeLinejoin:"round"})]})}function Vi({motionOn:e}){return n.jsxs(n.Fragment,{children:[n.jsx(P,{d:"M17 20 L27 17"}),n.jsx(P,{d:"M33 17 L43 20"}),n.jsx(q,{cx:21,cy:30,motionOn:e}),n.jsx(q,{cx:37,cy:30,motionOn:e}),n.jsx(ce,{cx:14.5,cy:36}),n.jsx(ce,{cx:44.5,cy:36}),n.jsx(Ri,{motionOn:e}),n.jsx("path",{d:"M23 42 Q27.5 39.5 32 42 T41 42",...de,strokeWidth:2.5})]})}function Gi({motionOn:e}){return n.jsxs(n.Fragment,{children:[n.jsxs(b.g,{animate:e?{y:[0,1.4,1.4,0]}:void 0,transition:e?{duration:5,times:[0,.12,.5,.62],repeat:1/0,ease:"easeInOut"}:void 0,children:[n.jsx(P,{d:"M18 15 L29 19.5"}),n.jsx(P,{d:"M35 19.5 L46 15"})]}),n.jsx(q,{cx:24,cy:27,openness:.8,motionOn:e}),n.jsx(q,{cx:40,cy:27,openness:.8,motionOn:e}),n.jsx(Wi,{motionOn:e}),n.jsx("path",{d:"M23 42 L41 42",...de,strokeWidth:3})]})}function Ui({motionOn:e}){return n.jsxs(n.Fragment,{children:[n.jsxs(b.g,{initial:e?{y:7}:void 0,animate:e?{y:0}:void 0,transition:e?{type:"spring",stiffness:420,damping:11,delay:.08}:void 0,children:[n.jsx(P,{d:"M18 14 Q24 10.5 30 14"}),n.jsx(P,{d:"M34 14 Q40 10.5 46 14"})]}),n.jsx(q,{cx:24,cy:26,r:4.5,popIn:!0,motionOn:e}),n.jsx(q,{cx:40,cy:26,r:4.5,popIn:!0,motionOn:e}),n.jsx(b.circle,{cx:32,cy:44,r:4,fill:"none",stroke:"currentColor",strokeWidth:2.5,style:{transformOrigin:"32px 44px"},initial:e?{scale:.2}:void 0,animate:e?{scale:1}:void 0,transition:e?{type:"spring",stiffness:500,damping:12,delay:.14}:void 0})]})}function Ki({motionOn:e}){return n.jsxs(n.Fragment,{children:[n.jsx(P,{d:"M19 20.5 L29 16.5"}),n.jsx(P,{d:"M35 16.5 L45 20.5"}),n.jsx(q,{cx:24,cy:26,motionOn:e}),n.jsx(q,{cx:40,cy:26,motionOn:e}),n.jsx(zi,{motionOn:e}),n.jsx("path",{d:"M20 47 Q32 37.5 44 47",...de,strokeWidth:3})]})}function Hi({motionOn:e}){return n.jsxs(n.Fragment,{children:[n.jsx(P,{d:"M18 17.5 Q24 15 30 17.5"}),n.jsx(P,{d:"M34 17.5 Q40 15 46 17.5"}),n.jsx(kt,{cx:24,cy:27,motionOn:e,pulseDuration:1.5,wobble:3}),n.jsx(kt,{cx:40,cy:27,motionOn:e,pulseDuration:1.9,delay:.35,wobble:-3}),n.jsx(ce,{cx:15,cy:35,opacity:.25}),n.jsx(ce,{cx:49,cy:35,opacity:.25}),n.jsx("path",{d:"M21 40 Q32 48 43 40",...de,strokeWidth:2.5})]})}function Yi({emotion:e,motionOn:t}){switch(e){case"happy":return n.jsx(Pi,{motionOn:t});case"thinking":return n.jsx(Bi,{motionOn:t});case"celebrating":return n.jsx(Fi,{});case"sheepish":return n.jsx(Vi,{motionOn:t});case"determined":return n.jsx(Gi,{motionOn:t});case"surprised":return n.jsx(Ui,{motionOn:t});case"sad":return n.jsx(Ki,{motionOn:t});case"love":return n.jsx(Hi,{motionOn:t})}}const qi={initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},transition:{type:"spring",stiffness:380,damping:16,mass:.9}},Qi={surprised:{initial:{opacity:0,scale:.4},animate:{opacity:1,scale:[.4,1.14,.94,1.03,1]},transition:{duration:.65,times:[0,.4,.62,.82,1],ease:"easeOut"}},sad:{initial:{opacity:0,scale:.92,y:-3},animate:{opacity:1,scale:1,y:0},transition:{duration:.7,ease:"easeOut"}}},Xi={happy:{animate:{y:[0,-1.5,0]},transition:{duration:2.8,repeat:1/0,ease:"easeInOut"}},thinking:{animate:{rotate:[0,-1.2,0,1.2,0]},transition:{duration:6,repeat:1/0,ease:"easeInOut"}},celebrating:{animate:{y:[0,-4,0,0],scaleY:[1,1.06,.9,1],scaleX:[1,.96,1.08,1]},transition:{duration:1.3,times:[0,.35,.7,1],repeat:1/0,ease:"easeInOut"}},sheepish:{animate:{rotate:[0,-2.5,-2.5,0]},transition:{duration:5,times:[0,.2,.7,1],repeat:1/0,ease:"easeInOut"}},determined:{animate:{scale:[1,1.02,1]},transition:{duration:2.4,repeat:1/0,ease:"easeInOut"}},sad:{animate:{y:[0,2,0],rotate:[0,-1.5,0]},transition:{duration:5,repeat:1/0,ease:"easeInOut"}},love:{animate:{rotate:[0,2.5,0,-2.5,0]},transition:{duration:4,repeat:1/0,ease:"easeInOut"}}};function Ji({node:e}){const t=W(),s=g.useRef(!1),a=g.useRef(null);g.useEffect(()=>{var c;if(e.emotion!=="celebrating"||!t||s.current)return;s.current=!0;const i=(c=a.current)==null?void 0:c.getBoundingClientRect();ea({origin:i?Wt(i):void 0})},[e.emotion,t]);const r=Qi[e.emotion]??qi,o=Xi[e.emotion];return n.jsxs("div",{className:"flex items-center gap-3",role:"img","aria-label":`Mood: ${e.emotion}`,children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(b.div,{initial:t?r.initial:!1,animate:t?r.animate:!1,transition:t?r.transition:void 0,children:n.jsx(b.div,{ref:a,className:"bg-muted text-foreground relative flex size-14 shrink-0 items-center justify-center overflow-hidden rounded-full",animate:t&&o?o.animate:void 0,transition:t&&o?o.transition:void 0,children:n.jsx("svg",{viewBox:"0 0 64 64",className:"size-full","aria-hidden":!0,children:n.jsx(Yi,{emotion:e.emotion,motionOn:t})})})}),e.emotion==="thinking"&&n.jsx(Zi,{motionOn:t})]}),e.message&&n.jsx(b.div,{className:"bg-muted/40 rounded-lg border px-3 py-2 text-sm",initial:t?{opacity:0,x:-4}:!1,animate:t?{opacity:1,x:0}:!1,transition:t?{duration:.3,delay:.15,ease:"easeOut"}:void 0,children:e.message})]})}function Zi({motionOn:e}){return n.jsx("div",{className:"flex items-end gap-1","aria-hidden":!0,children:[0,1,2].map(t=>n.jsx(b.span,{className:"bg-muted-foreground/60 size-1.5 rounded-full",animate:e?{y:[0,-3.5,0],opacity:[.3,1,.3]}:void 0,transition:e?{duration:1.3,repeat:1/0,repeatDelay:.4,delay:t*.16,ease:"easeInOut"}:void 0},t))})}const eo=2,to=5;function St(e){var s;const t=(s=e==null?void 0:e.glyph)==null?void 0:s.trim();return t||null}function no(e,t){var a,r;const s=St((a=e[t[0].row])==null?void 0:a[t[0].col]);if(!s)return null;for(const{row:o,col:i}of t)if(St((r=e[o])==null?void 0:r[i])!==s)return null;return s}function so(e){const t=e.length;if(t<eo||t>to||e.some(a=>a.length!==t))return null;const s=[];for(let a=0;a<t;a++)s.push(Array.from({length:t},(r,o)=>({row:a,col:o}))),s.push(Array.from({length:t},(r,o)=>({row:o,col:a})));s.push(Array.from({length:t},(a,r)=>({row:r,col:r}))),s.push(Array.from({length:t},(a,r)=>({row:r,col:t-1-r})));for(const a of s){const r=no(e,a);if(r)return{glyph:r,cells:a}}return null}function ao(e,t,s){return e!==null&&e.cells.some(a=>a.row===t&&a.col===s)}const ro=new Set(["."," ","-","_"]),Tn=".";function io(e,t){const s=o=>o.map(i=>ro.has(i)?Tn:i),a=[...e];if(a.length===t)return s(a);const r=[...e.trim()];return r.length===t?s(r):null}function oo(e,t){const s=e.split("/");if(s.length!==t.length)return null;const a=[];for(let r=0;r<s.length;r++){const o=io(s[r],t[r].length);if(!o)return null;a.push(o)}return a}function co(e){var s,a;const t=[];for(const r of e)for(const o of r){if(((s=o.action)==null?void 0:s.kind)!=="agent")continue;const i=(a=o.action.payload)==null?void 0:a.state;typeof i=="string"&&i.trim()!==""&&t.push(i)}return t}function lo(e,t){const s=new Map;for(const r of e){const o=oo(r,t);if(!o)continue;const i=o.map(d=>d.join("")).join("/"),c=s.get(i);c?c.count+=1:s.set(i,{parsed:o,count:1})}if(s.size===0)return null;const a=[...s.values()].sort((r,o)=>o.count-r.count);return a.length>1&&a[0].count===a[1].count?null:a[0].parsed}function uo(e){const t=co(e);if(t.length===0)return e;const s=lo(t,e);if(!s)return e;let a=!1;const r=e.map((o,i)=>o.map((c,d)=>{const u=s[i][d];if(c.glyph||c.icon||u===Tn)return c;a=!0;const{action:m,...p}=c;return{...p,glyph:u}}));return a?r:e}const wt=.12,fo=.2,$n="0 0 24 24";function Dn(e){const t=e.trim().toLowerCase();return t==="x"?"x":t==="o"||t==="0"||t==="⭕"||t==="◯"?"o":"glyph"}function po(e){const t=Dn(e);return t==="x"?"text-status-info":t==="o"?"text-status-warning":null}const Pe={className:"stroke-current",fill:"none",strokeWidth:2.75,strokeLinecap:"round"};function mo({motionOn:e,colorClass:t}){const s=a=>({duration:wt,ease:le,delay:a});return n.jsxs("svg",{viewBox:$n,className:_("size-[1.15em]",t),"aria-hidden":!0,focusable:"false",children:[n.jsx(b.path,{...Pe,d:"M7 7 L17 17",initial:e?{pathLength:0}:!1,animate:e?{pathLength:1}:!1,transition:e?s(0):void 0}),n.jsx(b.path,{...Pe,d:"M17 7 L7 17",initial:e?{pathLength:0}:!1,animate:e?{pathLength:1}:!1,transition:e?s(wt):void 0})]})}function ho({motionOn:e,colorClass:t}){return n.jsx("svg",{viewBox:$n,className:_("size-[1.15em]",t),"aria-hidden":!0,focusable:"false",children:n.jsx(b.circle,{...Pe,cx:12,cy:12,r:6.5,transform:"rotate(-90 12 12)",initial:e?{pathLength:0}:!1,animate:e?{pathLength:1}:!1,transition:e?{duration:fo,ease:le}:void 0})})}function go({motionOn:e}){return n.jsx(b.span,{"aria-hidden":!0,className:"bg-foreground/70 block size-[0.5em] rounded-full",initial:e?{scale:0,opacity:0}:!1,animate:e?{scale:1,opacity:1}:!1,transition:e?H:void 0})}function we({mark:e,motionOn:t,colorClass:s}){if(!e.trim())return n.jsx(go,{motionOn:t});const a=Dn(e);return a==="x"?n.jsx(mo,{motionOn:t,colorClass:s}):a==="o"?n.jsx(ho,{motionOn:t,colorClass:s}):n.jsx(b.span,{"aria-hidden":!0,className:_("block leading-none",s),initial:t?{scale:.4,opacity:0}:!1,animate:t?{scale:1,opacity:1}:!1,transition:t?H:void 0,children:e})}function ve(e){if(!e||e.kind!=="agent")return"";const t=e.payload,s=(t==null?void 0:t.glyph)??(t==null?void 0:t.mark);return typeof s=="string"?s:""}function Ln(e){return e.glyph?e.glyph:e.icon?e.icon:"filled"}function On(e){return _("relative flex aspect-square items-center justify-center rounded-md border text-2xl leading-none",e.tone&&_e(e.tone))}function Ce(e,t){if(!t.tone)return po(e)??void 0}function xo({cell:e,icon:t,motionOn:s,row:a,col:r,winRole:o}){const i=!!(e.glyph||e.icon);return n.jsxs(b.div,{role:"gridcell","aria-label":i?`Row ${a+1}, column ${r+1}: ${Ln(e)}`:void 0,className:_(On(e),o==="loser"&&"opacity-60"),animate:s&&o==="winner"?{scale:[1,1.08,1]}:void 0,transition:s&&o==="winner"?{duration:1.4,repeat:1/0,ease:"easeInOut",delay:.6}:void 0,children:[e.glyph&&n.jsx(we,{mark:e.glyph,motionOn:s,colorClass:Ce(e.glyph,e)}),!e.glyph&&t&&n.jsx(t,{className:"size-6","aria-hidden":!0})]})}function yo({cell:e,icon:t,motionOn:s,row:a,col:r,winRole:o}){const{onAction:i,channel:c}=ge(),u=`${Z()}.rows.${a}.${r}`,m=e.action.kind==="emit"||e.action.kind==="agent"&&c!==void 0,p=Sn(e.action,u),v=p.isDispatched?ve(e.action):null,k=p.interactive&&e.action.kind==="agent"&&!!ve(e.action),S=!p.interactive,j=()=>{if(!p.interactive)return;const C=i(e.action,{controlId:u});e.action.kind!=="agent"&&e.action.kind!=="emit"||C.catch(()=>{Pt.error("Couldn’t send the move",{description:m?"Check the action size and document permissions, then try again.":"Your agent may be busy. Try again."})})},A=(()=>{const C=`Row ${a+1}, column ${r+1}`;return p.isDispatched?`${C}: ${v||"played"}`:e.glyph||e.icon?`${C}: ${Ln(e)}`:p.interactive?`${C}: empty, play here`:`${C}: empty`})();let I=null;p.superseded?I="This board is from an earlier turn. Play on the newest one.":p.unavailable?I=m?"This document action is not available or needs approval.":"Interactions aren’t available here":p.latched&&(I="Move sent. Waiting for the agent’s reply");const N=n.jsxs(b.button,{type:"button","aria-label":A,"aria-disabled":S||void 0,onClick:S?void 0:j,className:_(On(e),"group focus-ring w-full transition-colors",p.interactive&&"hover:bg-muted/60 cursor-pointer",S&&"cursor-default",o==="loser"&&"opacity-60"),whileHover:p.interactive?{scale:1.05}:void 0,whileTap:p.interactive?{scale:.95}:void 0,transition:H,children:[k&&n.jsx("span",{className:"pointer-events-none absolute inset-0 flex items-center justify-center text-2xl opacity-0 transition-opacity duration-150 group-hover:opacity-20",children:n.jsx(we,{mark:ve(e.action),motionOn:!1,colorClass:Ce(ve(e.action),e)})}),n.jsx(bo,{cell:e,optimisticMark:v,icon:t,motionOn:s})]});return n.jsx(b.div,{role:"gridcell",animate:s&&o==="winner"?{scale:[1,1.08,1]}:void 0,transition:s&&o==="winner"?{duration:1.4,repeat:1/0,ease:"easeInOut",delay:.6}:void 0,children:I?n.jsx(Lt,{children:n.jsxs(Ot,{children:[n.jsx(Rt,{asChild:!0,children:N}),n.jsx(zt,{children:I})]})}):N})}function bo({cell:e,optimisticMark:t,icon:s,motionOn:a}){return t!==null?n.jsx(we,{mark:t,motionOn:a,colorClass:Ce(t,e)}):e.glyph?n.jsx(we,{mark:e.glyph,motionOn:a,colorClass:Ce(e.glyph,e)}):s?n.jsx(s,{className:"size-6","aria-hidden":!0}):null}function vo(e){return e.cell.action?n.jsx(yo,{...e,cell:e.cell}):n.jsx(xo,{...e})}const Ct=.28,jo=.3,ko=.12,No=.8;function je(e,t,s){return e*(t+s)+t/2}function So({win:e,size:t,cellUnit:s,gapUnit:a,colorClass:r,motionOn:o}){const i=t*s+(t-1)*a,c=e.cells[0],d=e.cells[e.cells.length-1],u=je(c.col,s,a),m=je(c.row,s,a),p=je(d.col,s,a),v=je(d.row,s,a);return n.jsx("svg",{viewBox:`0 0 ${i} ${i}`,className:_("pointer-events-none absolute inset-0 h-full w-full",r),"aria-hidden":!0,focusable:"false",children:n.jsx(b.line,{x1:u,y1:m,x2:p,y2:v,className:"stroke-current",strokeWidth:s*ko,strokeOpacity:No,strokeLinecap:"round",initial:o?{pathLength:0,opacity:0}:!1,animate:o?{pathLength:1,opacity:1}:!1,transition:o?{pathLength:{duration:jo,ease:le,delay:Ct},opacity:{duration:.12,delay:Ct}}:void 0})})}const wo={},Co=.02,Ao={hidden:{},visible:{transition:{staggerChildren:Co}}};function Mo(e,t,s,a){return e?ao(e,t,s)?"winner":a.glyph?"loser":"none":"none"}const Io=4,_o=3.25,Eo=2.5,To=.25,$o={default:"text-status-success",success:"text-status-success",warning:"text-status-warning",error:"text-status-error",info:"text-status-info"};function Do({node:e}){var k,S;const t=W(),{latched:s,superseded:a,channel:r}=ge(),o=Z(),i=uo(e.rows),c=Math.max(1,...i.map(j=>j.length)),d=c<=Io?_o:Eo,u=so(i),m=u?((S=(k=i[u.cells[0].row])==null?void 0:k[u.cells[0].col])==null?void 0:S.tone)??"default":"default",p=$o[m],v=s&&!a;return n.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&n.jsxs("p",{className:"text-muted-foreground text-xs",children:["To ",r.destinationLabel]}),e.label&&n.jsx("p",{className:"text-muted-foreground text-xs",children:e.label}),n.jsxs("div",{className:_("relative w-fit",a&&"saturate-[0.9]"),children:[v&&n.jsx(b.div,{"aria-hidden":!0,className:"ring-primary/40 pointer-events-none absolute -inset-1 rounded-lg ring-2",initial:t?{opacity:.25}:!1,animate:t?{opacity:[.25,.6,.25]}:{opacity:.4},transition:t?{duration:2,repeat:1/0,ease:"easeInOut"}:void 0}),n.jsx(b.div,{role:"grid","aria-label":e.label??"Board",className:"grid w-fit gap-1",style:{gridTemplateColumns:`repeat(${c}, minmax(0, ${d}rem))`},variants:t?Ao:void 0,initial:t?"hidden":!1,animate:t?"visible":!1,children:i.map((j,A)=>n.jsx("div",{role:"row",className:"contents",children:Array.from({length:c},(I,N)=>{const C=j[N]??wo,l=!C.glyph&&C.icon?qe(C.icon):null,f=Mo(u,A,N,C);return n.jsx(vo,{cell:C,icon:l,motionOn:t,row:A,col:N,winRole:f},`${A}-${N}`)})},A))}),u&&n.jsx(So,{win:u,size:c,cellUnit:d,gapUnit:To,colorClass:p,motionOn:t})]}),n.jsx(In,{controlId:o,descendants:!0})]})}const Lo=1.2,Oo={coin:"rounded-full bg-status-warning-bg border-status-warning-border text-status-warning-fg",d6:"rounded-xl bg-muted border-border text-foreground",d20:"rounded-xl bg-muted border-border text-foreground","8ball":"rounded-full bg-foreground border-foreground text-background"},Ro=[Ha,Ya,qa,Qa,Xa,Ja];function zo(e){const t={duration:Lo,ease:"easeOut"};switch(e){case"coin":return{animate:{rotateY:[0,360,720,1080]},transition:t};case"d6":case"d20":return{animate:{rotate:[0,-15,15,-10,10,0],x:[0,-2,2,-2,2,0]},transition:t};case"8ball":return{animate:{x:[0,-6,6,-4,4,-2,2,0]},transition:t}}}function Wo({kind:e,result:t}){switch(e){case"coin":return n.jsx(Ua,{className:"size-7","aria-hidden":!0});case"8ball":return n.jsx("span",{"aria-hidden":!0,children:"8"});case"d20":return n.jsx("svg",{viewBox:"0 0 24 24",className:"size-7","aria-hidden":!0,children:n.jsx("polygon",{points:"12,2 21,8 21,16 12,22 3,16 3,8",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round"})});case"d6":{const s=Number(t),a=Number.isInteger(s)&&s>=1&&s<=6?Ro[s-1]:Za;return n.jsx(a,{className:"size-7","aria-hidden":!0})}}}function Po({node:e}){const t=W(),[s,a]=g.useState(0),[r,o]=g.useState(!t),{animate:i,transition:c}=zo(e.kind);return n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{type:"button","aria-label":`Replay the ${e.kind} reveal`,onClick:()=>{t&&(o(!1),a(d=>d+1))},className:_("focus-ring flex size-16 shrink-0 items-center justify-center border-2 text-lg font-bold",Oo[e.kind]),children:n.jsx(b.span,{className:"flex items-center justify-center",initial:t?{rotate:0,x:0,rotateY:0}:!1,animate:t?i:!1,transition:t?c:void 0,onAnimationComplete:()=>o(!0),children:n.jsx(Wo,{kind:e.kind,result:e.result})},s)}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.label&&n.jsx("span",{className:"text-muted-foreground text-xs",children:e.label}),n.jsx(b.span,{"aria-live":"polite",className:"text-foreground text-lg font-semibold tabular-nums",initial:t?{opacity:0,scale:1.3}:!1,animate:r?{opacity:1,scale:1}:{opacity:0,scale:1.3},transition:H,children:r?e.result:""})]})]})}const Bo={sm:"gap-2",md:"gap-3",lg:"gap-5"};function he({node:e,path:t="root"}){return n.jsx(Dr,{value:t,children:n.jsx(Fo,{node:e})})}function Fo({node:e}){const t=cr();if(t===void 0&&"bind"in e&&e.bind!==void 0&&Object.keys(e.bind).length>0)return n.jsx("p",{role:"status",className:"text-muted-foreground text-xs",children:"Waiting for document state."});const s=Fr(e,t==null?void 0:t.state);if(s.error!==void 0)return n.jsx("p",{role:"status",className:"text-muted-foreground text-xs",children:s.error});const a=s.node;switch(a.type){case"stack":return n.jsx(Vo,{node:a});case"card":return n.jsx(Go,{node:a});case"form":return n.jsx(Uo,{node:a});case"divider":return n.jsx(Xr,{});case"heading":return n.jsx(Yr,{node:a});case"text":return n.jsx(qr,{node:a});case"badge":return n.jsx(Qr,{node:a});case"stat":return n.jsx(ei,{node:a});case"keyValue":return n.jsx(ni,{node:a});case"progress":return n.jsx(si,{node:a});case"image":return n.jsx(ai,{node:a});case"table":return n.jsx(ci,{node:a});case"list":return n.jsx(mi,{node:a});case"chart":return n.jsx(yi,{node:a});case"timeline":return n.jsx(Ci,{node:a});case"checklist":return n.jsx(Ai,{node:a});case"compare":return n.jsx(Ei,{node:a});case"rating":return n.jsx($i,{node:a});case"mood":return n.jsx(Ji,{node:a});case"board":return n.jsx(Do,{node:a});case"reveal":return n.jsx(Po,{node:a});case"button":return n.jsx(ui,{node:a});case"input":return n.jsx(fi,{node:a});case"select":return n.jsx(pi,{node:a});default:return n.jsx(Ko,{nodeType:a.type})}}function Vo({node:e}){const t=Z();return n.jsx("div",{className:_("flex",e.direction==="horizontal"?"flex-row flex-wrap items-start":"flex-col",Bo[e.gap??"md"]),children:e.children.map((s,a)=>n.jsx(he,{path:`${t}.children.${a}`,node:s},a))})}function Go({node:e}){const t=Z(),s=!!(e.title||e.description);return n.jsxs(Bt,{className:"shadow-soft",children:[s&&n.jsxs(na,{children:[e.title&&n.jsx(sa,{children:e.title}),e.description&&n.jsx(aa,{children:e.description})]}),n.jsx(ra,{children:e.children.map((a,r)=>n.jsx(he,{path:`${t}.children.${r}`,node:a},r))}),e.footer&&e.footer.length>0&&n.jsx(ia,{children:e.footer.map((a,r)=>n.jsx(he,{path:`${t}.footer.${r}`,node:a},r))})]})}function Uo({node:e}){const t=Z(),[s,a]=g.useState({}),r=g.useCallback((c,d)=>{a(u=>({...u,[c]:d}))},[]),o=g.useMemo(()=>({values:s,setValue:r}),[s,r]),i=g.useMemo(()=>e.submit.action.kind==="emit"?{...e.submit.action,payload:{...e.submit.action.payload??{},...s}}:{...e.submit.action,payload:{...e.submit.action.payload??{},...s}},[e.submit.action,s]);return n.jsxs("form",{onSubmit:c=>c.preventDefault(),className:"flex flex-col gap-3",children:[n.jsx(Vr,{value:o,children:e.children.map((c,d)=>n.jsx(he,{path:`${t}.children.${d}`,node:c},d))}),n.jsx(Ee,{action:i,label:e.submit.label,controlId:`${t}.submit`,submit:!0,fullWidth:!0})]})}function Ko({nodeType:e}){return n.jsxs("div",{className:"text-muted-foreground rounded-md border border-dashed p-2 text-xs",children:["Unsupported widget element",e?`: ${e}`:""]})}function ic({document:e,sessionId:t,isLatestMessage:s,channel:a}){const r=W();return n.jsx(Lr,{channel:a,sessionId:t,widgetTitle:e.title,isLatestMessage:s,children:n.jsx(or,{value:a==null?void 0:a.snapshot,children:n.jsx(b.section,{"aria-label":e.title??"Widget",className:"text-sm",variants:r?xe:void 0,initial:r?"hidden":!1,animate:r?"visible":!1,children:n.jsx(he,{node:e.root})})})})}function Ho(e,t){const s=_r.safeParse(e);if(!s.success){const a=s.error.issues[0],r=(a==null?void 0:a.path.join("."))??"";return{ok:!1,error:a?`${r?`${r}: `:""}${a.message}`:"The widget isn’t in a shape DorkOS knows",raw:t??Yo(e)}}return{ok:!0,document:s.data}}function oc(e){let t;try{t=JSON.parse(e)}catch(s){return{ok:!1,error:s instanceof Error?s.message:"The widget isn’t readable JSON",raw:e}}return Ho(t,e)}function Yo(e){try{return JSON.stringify(e,null,2)??String(e)}catch{return String(e)}}function cc({error:e,raw:t}){const[s,a]=g.useState(!1);return n.jsx(Bt,{gap:"none",className:"p-3 text-sm",children:n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsx($t,{className:"text-muted-foreground mt-0.5 size-4 shrink-0","aria-hidden":!0}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("p",{className:"font-medium",children:"Couldn’t show this widget"}),n.jsx("p",{className:"text-muted-foreground mt-0.5 text-xs break-words",children:e}),n.jsxs("button",{type:"button",onClick:()=>a(r=>!r),"aria-expanded":s,className:"text-muted-foreground hover:text-foreground focus-visible:ring-ring mt-2 inline-flex items-center gap-1 rounded text-xs focus-visible:ring-2 focus-visible:outline-none",children:[n.jsx(ta,{className:_("size-3 transition-transform",s&&"rotate-90")}),s?"Hide":"Show"," raw JSON"]}),s&&n.jsx("pre",{className:"bg-muted text-muted-foreground mt-2 max-h-64 overflow-auto rounded-md p-2 text-xs",children:n.jsx("code",{children:t})})]})]})})}export{cc as W,ic as a,H as b,oc as p,W as u,Ho as v};
|