dorkos 0.128.0 → 0.130.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 +766 -517
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-CmQERFxo.js → AboutPage-B2CzVj5W.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-Dw231W2w.js → ActivityErrorState-Dl-P-e0R.js} +1 -1
- package/dist/client/assets/{ActivityPage-DVfeyA9u.js → ActivityPage-CW7tqLHb.js} +1 -1
- package/dist/client/assets/ActivityRow-Vy4aXWk-.js +1 -0
- package/dist/client/assets/{AdapterIcon-NqCDzgCI.js → AdapterIcon-aabKVZmM.js} +1 -1
- package/dist/client/assets/AdapterSetupWizard-C5Hs0xkG.js +2 -0
- package/dist/client/assets/{AgentOptionRow-BRJfZo2y.js → AgentOptionRow-CqIMxq9S.js} +1 -1
- package/dist/client/assets/{AgentPicker-B7upjYRk.js → AgentPicker-C6mbTDJJ.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-DXJnLk6q.js → AgentRequestCard-C8GV5Sxn.js} +4 -4
- package/dist/client/assets/AppearancePage-C0JKrHsO.js +1 -0
- package/dist/client/assets/{ApplyToOverridesDialog-C_QQhNIf.js → ApplyToOverridesDialog-DWEi0MNt.js} +1 -1
- package/dist/client/assets/AttentionSignalRow-Cpu0lKYg.js +1 -0
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-G7vrCqeA.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-_zVrHu5s.js} +3 -3
- package/dist/client/assets/BindingDialog-4UeaJfUu.js +1 -0
- package/dist/client/assets/BlintzCanvas-DCXIQZM_.js +1231 -0
- package/dist/client/assets/{CanvasCsvContent-CtLpZnTs.js → CanvasCsvContent-D-0TuvVs.js} +4 -4
- package/dist/client/assets/CanvasFileContent-DqSx7lz9.js +2 -0
- package/dist/client/assets/CanvasModel3dContent-zTx660yQ.js +2 -0
- package/dist/client/assets/ChannelComposer-D4TYVkvO.js +45 -0
- package/dist/client/assets/{ChatAppsOff-CCZUzDIH.js → ChatAppsOff-BzfyQc55.js} +2 -2
- package/dist/client/assets/{CodeMirrorDiff-BCpYdhgZ.js → CodeMirrorDiff-BLWBYGLp.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-BeCubxHV.js → CodeMirrorEditor-D0q3ETxK.js} +1 -1
- package/dist/client/assets/{CommitmentList-BZtfTnwg.js → CommitmentList-BoMiLsRe.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-DmurDgxV.js → CommitmentsPage-_7mNJVUZ.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-Bik6GLKp.js → ComputerResourceView-Bo2LaCJf.js} +1 -1
- package/dist/client/assets/{ComputerViewer-CksBDqdu.js → ComputerViewer-a4VSdAw_.js} +1 -1
- package/dist/client/assets/ConnectionAccessLists-Dvv0YO31.js +1 -0
- package/dist/client/assets/{ConnectionsPage-Cgg36gDY.js → ConnectionsPage-oO8pNgbc.js} +2 -2
- package/dist/client/assets/{ConventionPage-CNhpF6Z1.js → ConventionPage-CFJjwhBd.js} +2 -2
- package/dist/client/assets/{ExtensionPageRoute-C2zue_Pw.js → ExtensionPageRoute-BqZN9q7M.js} +2 -2
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-3v1TfY1P.js → FloatingTanStackRouterDevtools-CqogiFob-CnSp2ZEM.js} +1 -1
- package/dist/client/assets/{ForwardConsentHost-Mbo0D-zk.js → ForwardConsentHost-4LhRvCdu.js} +1 -1
- package/dist/client/assets/HandlePage-BjoYPqme.js +1 -0
- package/dist/client/assets/HeartbeatPage-rJzICayy.js +1 -0
- package/dist/client/assets/{KeyEntry-C43vkwpA.js → KeyEntry-BTTuXleL.js} +1 -1
- package/dist/client/assets/{LexicalField-iAHcvRmI.js → LexicalField-Dk_SDrjk.js} +1 -1
- package/dist/client/assets/{ManagesPage-BUIJvLmv.js → ManagesPage-Cvu3CQDn.js} +1 -1
- package/dist/client/assets/Marketplace-DPjPPlZz.js +36 -0
- package/dist/client/assets/{MarketplaceSourcesView-BZODwhxu.js → MarketplaceSourcesView-ChCys0on.js} +1 -1
- package/dist/client/assets/{McpAppFrame-D15nxVaI.js → McpAppFrame-DNamtzOp.js} +2 -2
- package/dist/client/assets/{McpSigninBody-DmBxqgxN.js → McpSigninBody-DLw3ZdZE.js} +1 -1
- package/dist/client/assets/{Model3dViewer-RGXeJd6a.js → Model3dViewer-IwCBCPZ2.js} +1 -1
- package/dist/client/assets/NamePage-FY_D0eA2.js +1 -0
- package/dist/client/assets/NewDirectMessageMenu-BB0gvClR.js +1 -0
- package/dist/client/assets/{NotificationsPage-NRfyiinS.js → NotificationsPage-aCF0AtqL.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-CgQ6uefo.js → OpenMeshSwitch-DjCWF2Vy.js} +2 -2
- package/dist/client/assets/OperatorIdentityForm-Bcveds6f.js +1 -0
- package/dist/client/assets/{PermissionHistory-DPEPq8D9.js → PermissionHistory-CYsxFYmV.js} +1 -1
- package/dist/client/assets/{PermissionsPage--k-xutbJ.js → PermissionsPage-sxHkY92V.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-DMMptmPS.js → PersonalityPopover-BZ20JTnJ.js} +1 -1
- package/dist/client/assets/PhotoPage-KBzkb0sT.js +1 -0
- package/dist/client/assets/PreviewRefusedNotice-BFQPYcUG.js +1 -0
- package/dist/client/assets/{ProfileFields-DbPJ7fvN.js → ProfileFields-sp17IFo8.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-CzwhrIlw.js → ProfilePanelContainer-mA44jh5A.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-CZEXvlJm.js → ProfileRolePicker-Chh4_ZMB.js} +1 -1
- package/dist/client/assets/PromptSuggestionChips-CEi_-fHF.js +1 -0
- package/dist/client/assets/{ReportsToPopover-YOwGLJy5.js → ReportsToPopover-D1uknwnk.js} +1 -1
- package/dist/client/assets/RoomSurface-Clf1yLrr.js +1 -0
- package/dist/client/assets/{RoomsPage-CoXjZMWL.js → RoomsPage-BtCNzvhQ.js} +1 -1
- package/dist/client/assets/RunsOnPopover-LCvBpe9J.js +1 -0
- package/dist/client/assets/RuntimeConnectFlow-C5UDeHUC.js +1 -0
- package/dist/client/assets/RuntimeSetupDialog-Bqh67Vqb.js +1 -0
- package/dist/client/assets/{SeenDevices-Bh2yh-PW.js → SeenDevices-DvCfdeDo.js} +3 -3
- package/dist/client/assets/{SessionsPage-CFvkbT9X.js → SessionsPage-DLByE-re.js} +1 -1
- package/dist/client/assets/SettingsDialog-Co-Oxtyw.js +12 -0
- package/dist/client/assets/SkillsPage-Cc79IstM.js +1 -0
- package/dist/client/assets/TaskDialogWrapper-DuYV7Zch.js +1 -0
- package/dist/client/assets/TasksEmptyState-CfmPtBra.js +3 -0
- package/dist/client/assets/{TasksPage-D0Zi6Mve.js → TasksPage-DGk0zUhO.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-CY9eLVad.js → TeamComputerEntry-CLHbeX5i.js} +1 -1
- package/dist/client/assets/{ToolsPage-0_vx5P-F.js → ToolsPage-CSkDE7rZ.js} +2 -2
- package/dist/client/assets/{TopologyGraph-DUZLZZrB.js → TopologyGraph-pBC37k5P.js} +14 -14
- package/dist/client/assets/TourHost-CS9RsLj_.js +1 -0
- package/dist/client/assets/{UnlinkDialog-ptZy3IN4.js → UnlinkDialog-CelhOUZ0.js} +1 -1
- package/dist/client/assets/{UnreadDivider-Ckey1IWn.js → UnreadDivider-B_OMR0mQ.js} +1 -1
- package/dist/client/assets/WidgetErrorCard-CsMqCyCb.js +108 -0
- package/dist/client/assets/{WithheldExtensionsNotice-7Vu1Jctn.js → WithheldExtensionsNotice-GiKb0iQu.js} +1 -1
- package/dist/client/assets/WorkQueuePage-Cu721KyM.js +1 -0
- package/dist/client/assets/WorkView-CpWEaxMr.js +51 -0
- package/dist/client/assets/_shell-CmGG8Ysk.js +80 -0
- package/dist/client/assets/{_shell._home-BRIXhYLg.js → _shell._home-BnKkAeSp.js} +1 -1
- package/dist/client/assets/_shell._home.activity-DaaLJbvO.js +1 -0
- package/dist/client/assets/_shell._home.index-CNPasFxP.js +3 -0
- package/dist/client/assets/_shell._home.tasks-DXEOJ5Nq.js +1 -0
- package/dist/client/assets/_shell._home.workspaces-UeSvmquR.js +1 -0
- package/dist/client/assets/{_shell.channels-Bx6q9xVH.js → _shell.channels-NUbf5mcb.js} +4 -4
- package/dist/client/assets/_shell.connections-BEns4DKb.js +1 -0
- package/dist/client/assets/{_shell.feedback-requests-DFznTGbN.js → _shell.feedback-requests-NyjHNdnj.js} +2 -2
- package/dist/client/assets/_shell.marketplace-BEYqsDKe.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-D6Ls30FY.js +1 -0
- package/dist/client/assets/_shell.session-CVc6i3eN.js +1 -0
- package/dist/client/assets/{_shell.team-DmA09abY.js → _shell.team-CXeOt4XD.js} +6 -6
- package/dist/client/assets/_shell.threads-BYdN1UtZ.js +1 -0
- package/dist/client/assets/_shell.x._extensionId-DtJYSfvG.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-DtJYSfvG.js +1 -0
- package/dist/client/assets/{abnfDiagram-WEYOIA3C-DxgtVd9I.js → abnfDiagram-WEYOIA3C-BLCVDt6M.js} +1 -1
- package/dist/client/assets/{access-copy-Dqct36mi.js → access-copy-BSQ3QECN.js} +1 -1
- package/dist/client/assets/{arc-C-67Ef0p.js → arc-t4OhsI5R.js} +1 -1
- package/dist/client/assets/{architectureDiagram-ZHVYKT53-B7TjdT-_.js → architectureDiagram-ZHVYKT53-BcIfbGZR.js} +1 -1
- package/dist/client/assets/{banner-C9qTs6-C.js → banner-B6xfuDA7.js} +2 -2
- package/dist/client/assets/{blockDiagram-RJAE7QA3-DNqxJ3Ww.js → blockDiagram-RJAE7QA3-DTOlrcEZ.js} +1 -1
- package/dist/client/assets/{c4Diagram-XDPPPE54-D3jNLV0j.js → c4Diagram-XDPPPE54-CHGqwaxa.js} +1 -1
- package/dist/client/assets/channel-CSk6LhO2.js +1 -0
- package/dist/client/assets/{chunk-2E7WHVMD-C6OKx0ty.js → chunk-2E7WHVMD-Bh4L_7yX.js} +1 -1
- package/dist/client/assets/{chunk-2Q5K7J3B-Dr_6hHrZ.js → chunk-2Q5K7J3B-BmouLl8r.js} +1 -1
- package/dist/client/assets/{chunk-4EMNKR2T-CSrZVDEt.js → chunk-4EMNKR2T-BVhtiAdG.js} +1 -1
- package/dist/client/assets/{chunk-55XCU76K-CIazeRXO.js → chunk-55XCU76K-BdbLnE56.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-C8IJ3zTR.js → chunk-5VM5RSS4-Qg9lQpPO.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-D9DGXb79.js → chunk-JWPE2WC7-CfIrQaMW.js} +1 -1
- package/dist/client/assets/{chunk-VQ5W62QI-B0LNYdif.js → chunk-VQ5W62QI-BP9oQzc0.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-C7IAIbvZ.js → chunk-XXDRQBXY-DKzIjnsB.js} +1 -1
- package/dist/client/assets/{chunk-ZCHMQSOR-C79hvjlu.js → chunk-ZCHMQSOR-DsvG6BGY.js} +2 -2
- package/dist/client/assets/{classDiagram-v2-4MYWR3UA-0Di1C2ZB.js → classDiagram-v2-4MYWR3UA-BSiSmGgP.js} +1 -1
- package/dist/client/assets/{command-BVQb6I3_.js → command-B_FPXirc.js} +1 -1
- package/dist/client/assets/copy-button-Bp75zBSh.js +1 -0
- package/dist/client/assets/{cose-bilkent-JH36ORCC-rZumaV4b.js → cose-bilkent-JH36ORCC-CXgyrZix.js} +1 -1
- package/dist/client/assets/{cpu-DeRuDMl4.js → cpu-DpkNIYeK.js} +1 -1
- package/dist/client/assets/{cynefin-EF2NZ3EQ-CI9l9xhM.js → cynefin-EF2NZ3EQ-DkmPO3hK.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-WF24UDRP-C8CdorJJ.js → cynefinDiagram-WF24UDRP-BDknJT17.js} +1 -1
- package/dist/client/assets/{dagre-NK4GIZVX-AHpsTq1O.js → dagre-NK4GIZVX-BR4J5E3b.js} +1 -1
- package/dist/client/assets/detail-row-C8zz6mAC.js +1 -0
- package/dist/client/assets/{diagram-CBK3MWTC-BpPLL30n.js → diagram-CBK3MWTC-CvLKqPry.js} +1 -1
- package/dist/client/assets/{diagram-I5XIIV2D-D6loMn3G.js → diagram-I5XIIV2D-CVtE60X9.js} +1 -1
- package/dist/client/assets/{diagram-ODIL2UCW-BaGNd5eN.js → diagram-ODIL2UCW-B--CpfLk.js} +1 -1
- package/dist/client/assets/{diagram-PFBEJUXE-BnDdKu_g.js → diagram-PFBEJUXE-08gch1t1.js} +1 -1
- package/dist/client/assets/{diagram-RJA3I4VV-UXagB0_c.js → diagram-RJA3I4VV-C2e-ubaD.js} +1 -1
- package/dist/client/assets/{diagram-TYUNFSNR-C-whBP-S.js → diagram-TYUNFSNR-DcpK4OXX.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-V4P3TTPT-BbG481iS.js → ebnfDiagram-V4P3TTPT-DM44BkBt.js} +1 -1
- package/dist/client/assets/{elk-QONTBCTQ-FtssIxOc.js → elk-QONTBCTQ-maYS1Zzm.js} +1 -1
- package/dist/client/assets/{empty-state-CACt-76q.js → empty-state-HtOTBAoq.js} +1 -1
- package/dist/client/assets/{erDiagram-KYQIGQAA-PpFgUf4C.js → erDiagram-KYQIGQAA-BR7z9r2M.js} +1 -1
- package/dist/client/assets/{execution-config-CGL73sRn.js → execution-config-DYYeJyJh.js} +1 -1
- package/dist/client/assets/{file-D80JE_L0.js → file-VtGYNr9E.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-CcJ_e4_m.js → file-exclamation-point-eBlQssyW.js} +1 -1
- package/dist/client/assets/{file-text-Ds9edaTZ.js → file-text-DvNAxTGZ.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-BtqFMP_f.js → find-latest-widget-fence-C2qXvASs.js} +5 -5
- package/dist/client/assets/{flowDiagram-IUGLLWBU-BIva66g9.js → flowDiagram-IUGLLWBU-DiuMtMbj.js} +1 -1
- package/dist/client/assets/form-CGIIzr1u.js +1 -0
- package/dist/client/assets/{format-cron-BpGrgPLu.js → format-cron-BzJ6ekoo.js} +1 -1
- package/dist/client/assets/format-tokens-DymkROvy.js +1 -0
- package/dist/client/assets/{ganttDiagram-R7GPNTJY-CZqips_4.js → ganttDiagram-R7GPNTJY-Cf_z8Ri1.js} +1 -1
- package/dist/client/assets/{git-branch-B8JNwQ6q.js → git-branch-BVzjBPW-.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-DoIc3lda.js → gitGraphDiagram-PDYL7XHY-RZXACCBr.js} +1 -1
- package/dist/client/assets/{graph-yizM0vwL.js → graph-DfAV_ObD.js} +1 -1
- package/dist/client/assets/{heart-BavUIV45.js → heart-BMOCYMFT.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-CGr3AgaU.js → highlighted-body-KPVGNVTW-DrrsaKBc.js} +1 -1
- package/dist/client/assets/image-lightbox-tAwBNBhm.js +1 -0
- package/dist/client/assets/{image-off-C1uTDs9-.js → image-off-BpagBHk1.js} +1 -1
- package/dist/client/assets/{index-CrTmY12y.js → index-0uCJUW_h.js} +2 -2
- package/dist/client/assets/index-0y0K3rYv.js +1 -0
- package/dist/client/assets/{index-CJXMgnYp.js → index-2GjydAcS.js} +1 -1
- package/dist/client/assets/index-6dsaPQ7-.js +1 -0
- package/dist/client/assets/{index-X282DRZf.js → index-7-yzdcAx.js} +3 -3
- package/dist/client/assets/{index-C8ZpJXTQ.js → index-A7HgzxSw.js} +1 -1
- package/dist/client/assets/{index-DW4KUPHp.js → index-BEqKTiCR.js} +1 -1
- package/dist/client/assets/{index-56EOd-zy.js → index-BIN0yv4s.js} +1 -1
- package/dist/client/assets/{index-FhWMRBQP.js → index-BL5Vmq62.js} +1 -1
- package/dist/client/assets/index-BOvFXsF_.js +1 -0
- package/dist/client/assets/index-BbcfxnHC.js +1 -0
- package/dist/client/assets/{index-DqkFtcGQ.js → index-BdKIijqB.js} +1 -1
- package/dist/client/assets/{index-BOEPL6hN.js → index-BfAymWoj.js} +1 -1
- package/dist/client/assets/{index-BKWJiERs.js → index-Bgts5its.js} +1 -1
- package/dist/client/assets/{index-n_pnc-CO.js → index-BiL3chP7.js} +1 -1
- package/dist/client/assets/{index-FI_y_dND.js → index-Bu3PEVA_.js} +1 -1
- package/dist/client/assets/{index-BOhSPP-6.js → index-C6DTV4h3.js} +1 -1
- package/dist/client/assets/{index-Cdod8zEY.js → index-CCH9c-nB.js} +1 -1
- package/dist/client/assets/{index-BkJlIXqM.js → index-CH4NJ8dD.js} +1 -1
- package/dist/client/assets/{index-CiGYtR9O.js → index-CKGJp3Cm.js} +1 -1
- package/dist/client/assets/{index-DEiSJbvu.js → index-CeqI4FFw.js} +1 -1
- package/dist/client/assets/{index-C4t0UTU-.js → index-Cj9-XXKl.js} +1 -1
- package/dist/client/assets/{index-ZR5f82z2.js → index-Cu8tnfM_.js} +1 -1
- package/dist/client/assets/{index-Dcd4NqFB.js → index-D4OWRMsG.js} +1 -1
- package/dist/client/assets/{index-Br6xDNvu.js → index-D8SP73Xw.js} +1 -1
- package/dist/client/assets/{index-CoNMlH37.js → index-DEJXVqcY.js} +1 -1
- package/dist/client/assets/{index-CoKNU2F9.js → index-DEMZynQt.js} +1 -1
- package/dist/client/assets/index-DGzMwE1Z.js +1 -0
- package/dist/client/assets/{index-1QfQImuJ.js → index-DIJdZqg2.js} +3 -3
- package/dist/client/assets/{index-YSHcMqHa.js → index-DIRqrOEK.js} +1 -1
- package/dist/client/assets/{index-CeDn1Ak1.js → index-DNbdGvs9.js} +1 -1
- package/dist/client/assets/{index-7XeZCCDI.js → index-DOBjxRe9.js} +1 -1
- package/dist/client/assets/{index-BJEt9R_G.js → index-DcBlHsnC.js} +1 -1
- package/dist/client/assets/index-DdsaTuqO.js +1 -0
- package/dist/client/assets/index-Dt4H9Tms.js +17 -0
- package/dist/client/assets/{index-DYEmUa5t.js → index-HXC63Ry8.js} +1 -1
- package/dist/client/assets/index-MHIn2TC9.js +1063 -0
- package/dist/client/assets/{index-tgbcsB6H.js → index-OjJ_8uMM.js} +1 -1
- package/dist/client/assets/index-P4Wos1Gi.css +1 -0
- package/dist/client/assets/{index-QSXJR98z.js → index-U5jTIqzv.js} +1 -1
- package/dist/client/assets/{index-CXBYgGja.js → index-ZzPr9GUI.js} +1 -1
- package/dist/client/assets/index-d9cqTUAj.js +1 -0
- package/dist/client/assets/{index-LwL5BpE4.js → index-fcfCRITA.js} +1 -1
- package/dist/client/assets/{index-SOKlO1zZ.js → index-onQlu3UR.js} +1 -1
- package/dist/client/assets/{index.esm-CAeUe7uQ.js → index.esm-DSKTDEoH.js} +1 -1
- package/dist/client/assets/{infoDiagram-MVDRKAX5-DweUdYSy.js → infoDiagram-MVDRKAX5-B8dulOBe.js} +1 -1
- package/dist/client/assets/{inline-code-SYHTKcle.js → inline-code-B3qpjdZ2.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-DKNQIv7P.js → ishikawaDiagram-HPEHV2GE-Cy8aIg0O.js} +1 -1
- package/dist/client/assets/{journeyDiagram-BOSHW7O7-DPD7F4VO.js → journeyDiagram-BOSHW7O7-BZAlejG3.js} +1 -1
- package/dist/client/assets/{kanban-definition-FNSA4HC5-B_uPSwxC.js → kanban-definition-FNSA4HC5-BxS1edpe.js} +1 -1
- package/dist/client/assets/{layers-F4mvrI2l.js → layers-ByCM7XO5.js} +1 -1
- package/dist/client/assets/{lightbulb-a6nNsrzy.js → lightbulb-KjW8YTXH.js} +1 -1
- package/dist/client/assets/{link-2-yI2Tlm7Q.js → link-2-CtFfuMO5.js} +1 -1
- package/dist/client/assets/{list-runtime-types-CsGil5te.js → list-runtime-types-DrzHejZo.js} +1 -1
- package/dist/client/assets/{markdown-content-Cjhsscbn.js → markdown-content-DgiSdNwz.js} +1 -1
- package/dist/client/assets/mention-pill-CHPHlu-U.js +1 -0
- package/dist/client/assets/{mermaid.core-9PwG-9fN.js → mermaid.core-ovqlC4PC.js} +4 -4
- package/dist/client/assets/{message-square-off-aV4NMCjd.js → message-square-off-CEOyy4Pq.js} +1 -1
- package/dist/client/assets/{mindmap-definition-6OY57UG3-BRbWmQkj.js → mindmap-definition-6OY57UG3-CsngqLzI.js} +1 -1
- package/dist/client/assets/{more-details-CRLU2HN4.js → more-details-BW9mauVT.js} +1 -1
- package/dist/client/assets/{owner-notice-CTJbhUak.js → owner-notice-BRUVafHC.js} +1 -1
- package/dist/client/assets/{package-sPggO7Dr.js → package-Bbs99yqi.js} +1 -1
- package/dist/client/assets/{page-container-CnfDuiDC.js → page-container-BVfGgaaJ.js} +1 -1
- package/dist/client/assets/{pane-resize-handle-63OC5vfI.js → pane-resize-handle-BL7Meu5R.js} +1 -1
- package/dist/client/assets/{paperclip-WhPo3_WD.js → paperclip-QOWXs8-5.js} +1 -1
- package/dist/client/assets/path-input-BDRHmgzW.js +1 -0
- package/dist/client/assets/{pegDiagram-ECIUJNBX-Ct9Li_PA.js → pegDiagram-ECIUJNBX-DPsWmWqw.js} +1 -1
- package/dist/client/assets/{pieDiagram-GNMPY74T-BAB5RA5v.js → pieDiagram-GNMPY74T-BdOIDv4F.js} +1 -1
- package/dist/client/assets/{plug-_q5iqunq.js → plug-BrsPyUhu.js} +1 -1
- package/dist/client/assets/primer-trigger-C97fRm1v.js +3 -0
- package/dist/client/assets/{profile-errors-COcBx7w5.js → profile-errors-nPLX60ha.js} +1 -1
- package/dist/client/assets/{progress-77FCPL2y.js → progress-C9TALtIa.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-D57K4MC3-BqPJVmMS.js → quadrantDiagram-D57K4MC3-MzMEunU7.js} +1 -1
- package/dist/client/assets/{query-error-state-5236P3z0.js → query-error-state-BJjgx-WC.js} +1 -1
- package/dist/client/assets/{radio-C8xmfoqO.js → radio-Biql29-B.js} +1 -1
- package/dist/client/assets/{railroadDiagram-Y72NRBL7-B8U11nT6.js → railroadDiagram-Y72NRBL7-Dzx_PYVW.js} +1 -1
- package/dist/client/assets/registry-B0HgbN69.js +1 -0
- package/dist/client/assets/registry-fiUD5cv6.js +39 -0
- package/dist/client/assets/{relay-trace-schemas-B80E4EUn.js → relay-trace-schemas-BJ4MfChd.js} +2 -2
- package/dist/client/assets/{repeat-CHmB_vD7.js → repeat-CKufDGoQ.js} +1 -1
- package/dist/client/assets/{requirementDiagram-EQYSW5RA-CzJ1gzTh.js → requirementDiagram-EQYSW5RA-J0pg6FEt.js} +1 -1
- package/dist/client/assets/{room-files-source-B0gc97Ri.js → room-files-source-iaYdshKo.js} +2 -2
- package/dist/client/assets/{rotate-ccw-clock-CCU6SVnv.js → rotate-ccw-clock-CnARSw5V.js} +1 -1
- package/dist/client/assets/{rotate-cw-B8WQa8O-.js → rotate-cw-BAn_5-Gq.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-SY24JHO5-D4vQwyve.js → sankeyDiagram-SY24JHO5-6V_uy-zQ.js} +1 -1
- package/dist/client/assets/scroll-area-XDq7yL_d.js +1 -0
- package/dist/client/assets/{sequenceDiagram-BLEHNHQU-BVnIsPQe.js → sequenceDiagram-BLEHNHQU-C4jZi3N4.js} +1 -1
- package/dist/client/assets/{shield-x-ijIbRppV.js → shield-x-CpiXuMbN.js} +1 -1
- package/dist/client/assets/signed-in-Rv3Sjk8n.js +1 -0
- package/dist/client/assets/{sizeCapture-INFHLROL-DGb1rAJL.js → sizeCapture-INFHLROL-B7nxFreb.js} +1 -1
- package/dist/client/assets/{soul-file-CXgYs25S.js → soul-file-BQz4TtHo.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-DeX3IKTm.js → stateDiagram-v2-A6IESKWZ-B5rvc4n2.js} +1 -1
- package/dist/client/assets/{swimlanes-B3ENRKFQ-DN5ljYhG.js → swimlanes-B3ENRKFQ-DnElusDo.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-DLpKz5fF.js +8 -0
- package/dist/client/assets/{table-D9ww_3Ij.js → table-NGiWzPO4.js} +1 -1
- package/dist/client/assets/{timeline-definition-JXYKGLGB-DpRthC3r.js → timeline-definition-JXYKGLGB-DMgyn3XX.js} +1 -1
- package/dist/client/assets/{trust-posture-Dn2ciEE0.js → trust-posture-BArJ9H4j.js} +1 -1
- package/dist/client/assets/{unplug-BZ8zSvfB.js → unplug-MSjeZ0tJ.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-CGy05tAO.js → unverified-catalog-notice-DA96H8Df.js} +1 -1
- package/dist/client/assets/{use-bindings-BLAWQRpe.js → use-bindings-BojBqRJS.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-ICOpilWK.js → use-composer-prefs-BDl8aMme.js} +1 -1
- package/dist/client/assets/{use-connector-management-DEMGZy9N.js → use-connector-management-FONU6FK8.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-DxGYrks3.js → use-deep-link-scroll-CtbBPBgi.js} +1 -1
- package/dist/client/assets/{use-delete-binding-Bnv3J5Fu.js → use-delete-binding-COhBv6X3.js} +1 -1
- package/dist/client/assets/{use-dev-links-BOcktLiE.js → use-dev-links-Dh0MCiGY.js} +1 -1
- package/dist/client/assets/{use-direct-message-panel-D38tSozW.js → use-direct-message-panel-CYnWunqk.js} +1 -1
- package/dist/client/assets/{use-external-adapter-catalog-9qiNBqpc.js → use-external-adapter-catalog-RTDOW8Yi.js} +1 -1
- package/dist/client/assets/use-filter-state-CSFTDx7z.js +6 -0
- package/dist/client/assets/use-full-activity-feed-DlY_ZbRZ.js +1 -0
- package/dist/client/assets/use-is-below-desktop-ClzGXlRb.js +1 -0
- package/dist/client/assets/{use-local-browser-B1huJhdg.js → use-local-browser-WwZd-FOP.js} +1 -1
- package/dist/client/assets/{use-mesh-topology-BTYAy6zc.js → use-mesh-topology-WnFkjq41.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-CaPc6Prv.js → use-mounted-ref-Dz1h70pz.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-u76DPoP0.js → use-notification-prefs-IrF5_cko.js} +1 -1
- package/dist/client/assets/use-pending-read-CnAnzOt_.js +1 -0
- package/dist/client/assets/use-personality-commit-C4hYkSPy.js +1 -0
- package/dist/client/assets/use-promo-activation-CPVANFBh.js +6 -0
- package/dist/client/assets/{use-promo-dismissals-CO7-qhEl.js → use-promo-dismissals-B9m0HT6L.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-D07Mv-Sa.js → use-pulse-freshness-DMySxN8D.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-DRQBuAIe.js → use-room-follow-claim-ByaYVY0o.js} +1 -1
- package/dist/client/assets/{use-room-sessions-Bzk7rM40.js → use-room-sessions-DPB29acU.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-CcznVldj.js → use-roving-tab-list-BO8kbs-w.js} +1 -1
- package/dist/client/assets/{use-session-canvas-CpgE7tFb.js → use-session-canvas-Cunag2K7.js} +9 -9
- package/dist/client/assets/use-status-budget-jt-9aQR0.js +21 -0
- package/dist/client/assets/{use-transform-ByJGn3hq.js → use-transform-ydtuYUNp.js} +1 -1
- package/dist/client/assets/{use-unclaimed-chats-C-z5fstJ.js → use-unclaimed-chats-ClBWJgNm.js} +1 -1
- package/dist/client/assets/use-update-config-ZHtOtve0.js +1 -0
- package/dist/client/assets/{useMutationState-BF1EFtIZ.js → useMutationState-B8ArIqeH.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-WPOLBNNX-efVKbRIX.js → usecaseDiagram-WPOLBNNX-C5JdAkG9.js} +1 -1
- package/dist/client/assets/{vennDiagram-Q3Y3IDCW-Bravmwce.js → vennDiagram-Q3Y3IDCW-CqLCy7LU.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-IVAIDKWA-fR77zByv.js → wardleyDiagram-IVAIDKWA-C9FlHLTd.js} +1 -1
- package/dist/client/assets/{xychartDiagram-4URNHDU4-BphORSLh.js → xychartDiagram-4URNHDU4-BIm-RUWd.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/drizzle/20261031012841_dor3309_file_turn_on_offer.sql +2 -0
- package/dist/drizzle/20261101122330_schedule_declined_content_key.sql +1 -0
- package/dist/drizzle/20261101195529_work_queue.sql +38 -0
- package/dist/drizzle/20261101233656_dor3644_session_launched_by.sql +1 -0
- package/dist/drizzle/20261102041558_dor3070_marketplace_summary.sql +2 -0
- package/dist/drizzle/20261102051715_dor3440_clear_origin_holds.sql +10 -0
- package/dist/drizzle/20261102135442_agent_browser_profiles.sql +15 -0
- package/dist/drizzle/meta/20261031012841_snapshot.json +14116 -0
- package/dist/drizzle/meta/20261101122330_snapshot.json +14123 -0
- package/dist/drizzle/meta/20261101195529_snapshot.json +14363 -0
- package/dist/drizzle/meta/20261101233656_snapshot.json +14370 -0
- package/dist/drizzle/meta/20261102041558_snapshot.json +14384 -0
- package/dist/drizzle/meta/20261102051715_snapshot.json +14384 -0
- package/dist/drizzle/meta/20261102135442_snapshot.json +14483 -0
- package/dist/drizzle/meta/_journal.json +49 -0
- package/dist/server/extension-child.cjs +1147 -572
- package/dist/server/index.js +45678 -38894
- package/dist/server/index.js.map +2 -2
- package/package.json +5 -5
- package/dist/client/assets/ActivityRow-DIBH4v9c.js +0 -1
- package/dist/client/assets/AdapterSetupWizard-Dle_b9qc.js +0 -2
- package/dist/client/assets/AppearancePage-DXbhUt2e.js +0 -1
- package/dist/client/assets/AttentionSignalRow-5E7TkG98.js +0 -1
- package/dist/client/assets/BindingDialog-q--8SDJF.js +0 -1
- package/dist/client/assets/BlintzCanvas-DruVZcDU.js +0 -1231
- package/dist/client/assets/CanvasFileContent-BThy5fjD.js +0 -2
- package/dist/client/assets/CanvasModel3dContent-BbgR73jh.js +0 -2
- package/dist/client/assets/ChannelComposer-qhk0KtW7.js +0 -44
- package/dist/client/assets/ConnectionAccessLists-DRwO1v0V.js +0 -1
- package/dist/client/assets/HandlePage-B4qbFi40.js +0 -1
- package/dist/client/assets/HeartbeatPage-BnNbQLCW.js +0 -1
- package/dist/client/assets/Marketplace-DbdLWz0-.js +0 -36
- package/dist/client/assets/NamePage-fhxyWDDY.js +0 -1
- package/dist/client/assets/NewDirectMessageMenu-DBAdvv5p.js +0 -1
- package/dist/client/assets/OperatorIdentityForm-Bls5Vo_u.js +0 -1
- package/dist/client/assets/PhotoPage-CNHcXbz4.js +0 -1
- package/dist/client/assets/PreviewRefusedNotice-Ds4IO32o.js +0 -1
- package/dist/client/assets/PromptSuggestionChips-BXxC799Q.js +0 -1
- package/dist/client/assets/RoomSurface-DgH3a_Fv.js +0 -1
- package/dist/client/assets/RunsOnPopover-CEkkjrGg.js +0 -1
- package/dist/client/assets/RuntimeConnectFlow-DXWGgvCW.js +0 -1
- package/dist/client/assets/RuntimeSetupDialog-D6L1QhMF.js +0 -1
- package/dist/client/assets/SettingsDialog-BOOqWKcj.js +0 -12
- package/dist/client/assets/SkillsPage-ntCEhUIM.js +0 -1
- package/dist/client/assets/TaskDialogWrapper-vBWAWwTY.js +0 -1
- package/dist/client/assets/TasksEmptyState-C_3UkAbA.js +0 -3
- package/dist/client/assets/TourHost-B69XAKpE.js +0 -1
- package/dist/client/assets/WidgetErrorCard-BlqaIsPK.js +0 -108
- package/dist/client/assets/WorkView-BekLkR4O.js +0 -51
- package/dist/client/assets/_shell-Du0F-5fK.js +0 -80
- package/dist/client/assets/_shell._home.activity-5rihXoYF.js +0 -1
- package/dist/client/assets/_shell._home.index-BsLNqt4f.js +0 -3
- package/dist/client/assets/_shell._home.tasks-Cxs5tLWA.js +0 -1
- package/dist/client/assets/_shell._home.workspaces-CEHDdfbP.js +0 -1
- package/dist/client/assets/_shell.connections-Bm0WmgXH.js +0 -1
- package/dist/client/assets/_shell.marketplace-CsQ60Mlc.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-DNyShS1x.js +0 -1
- package/dist/client/assets/_shell.session-BN42bV3w.js +0 -1
- package/dist/client/assets/_shell.threads-HH4EvufJ.js +0 -1
- package/dist/client/assets/_shell.x._extensionId-3ZlJV1iu.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-3ZlJV1iu.js +0 -1
- package/dist/client/assets/card-DUmTNXJJ.js +0 -1
- package/dist/client/assets/channel-B7zgJbnU.js +0 -1
- package/dist/client/assets/form-D93N5lrK.js +0 -1
- package/dist/client/assets/image-lightbox-vgPEvSCc.js +0 -1
- package/dist/client/assets/index-B36osK_S.js +0 -17
- package/dist/client/assets/index-B446r3dL.js +0 -1
- package/dist/client/assets/index-BGo1YiUE.js +0 -1
- package/dist/client/assets/index-BO3yPJt-.js +0 -1
- package/dist/client/assets/index-DE6uOpn4.js +0 -1
- package/dist/client/assets/index-Dag1qeZI.js +0 -1
- package/dist/client/assets/index-Dm0Tav7v.js +0 -1
- package/dist/client/assets/index-Dry_agqN.css +0 -1
- package/dist/client/assets/index-OQuvRZTD.js +0 -1058
- package/dist/client/assets/index-eVrGefuq.js +0 -1
- package/dist/client/assets/mention-pill-BsOeTJ2f.js +0 -1
- package/dist/client/assets/path-input-C2KIXdON.js +0 -1
- package/dist/client/assets/primer-trigger-B2tjuHBx.js +0 -3
- package/dist/client/assets/registry-BzXBOE9h.js +0 -34
- package/dist/client/assets/registry-sfhDu9q2.js +0 -1
- package/dist/client/assets/scroll-area-FwZwM74Q.js +0 -1
- package/dist/client/assets/search-x-Q18Wm-C5.js +0 -6
- package/dist/client/assets/signed-in-DEOMBWVX.js +0 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-D8kHFWtL.js +0 -8
- package/dist/client/assets/use-full-activity-feed-CtQquOBW.js +0 -1
- package/dist/client/assets/use-is-below-desktop-CAGEAsCC.js +0 -1
- package/dist/client/assets/use-pending-read-D0y6i7G9.js +0 -1
- package/dist/client/assets/use-personality-commit-C3h8upDo.js +0 -1
- package/dist/client/assets/use-promo-activation-5HG08FlB.js +0 -11
- package/dist/client/assets/use-status-budget-Xn2sIeM1.js +0 -16
- package/dist/client/assets/use-update-config-L5NCTj3t.js +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{fb as Ee,a5 as xe,aZ as Re,r as ve,a6 as Se,j,G as Ce}from"./index-MHIn2TC9.js";import{u as Oe}from"./index-BiL3chP7.js";import{r as Te}from"./use-session-canvas-Cunag2K7.js";import"./rotate-cw-BAn_5-Gq.js";import"./query-keys-DeYqUDia.js";import"./index.esm-DSKTDEoH.js";import"./WidgetErrorCard-CsMqCyCb.js";import"./index-DEMZynQt.js";import"./progress-C9TALtIa.js";import"./markdown-content-DgiSdNwz.js";import"./table-NGiWzPO4.js";import"./package-Bbs99yqi.js";import"./heart-BMOCYMFT.js";import"./git-branch-BVzjBPW-.js";import"./file-text-DvNAxTGZ.js";import"./file-VtGYNr9E.js";import"./McpAppFrame-DNamtzOp.js";import"./more-details-BW9mauVT.js";var he={exports:{}};/* @license
|
|
2
2
|
Papa Parse
|
|
3
3
|
v5.7.0
|
|
4
4
|
https://github.com/mholt/PapaParse
|
|
5
5
|
License: MIT
|
|
6
|
-
*/var Ie=he.exports,ke;function Ae(){return ke||(ke=1,(function(H,X){((G,m)=>{H.exports=m()})(Ie,function G(){var m=typeof self<"u"?self:typeof window<"u"?window:m!==void 0?m:{},C=!m.document&&!!m.postMessage,N=m.IS_PAPA_WORKER||!1,J={},
|
|
6
|
+
*/var Ie=he.exports,ke;function Ae(){return ke||(ke=1,(function(H,X){((G,m)=>{H.exports=m()})(Ie,function G(){var m=typeof self<"u"?self:typeof window<"u"?window:m!==void 0?m:{},C=!m.document&&!!m.postMessage,N=m.IS_PAPA_WORKER||!1,J={},Z=0,o={};function P(t){return t.charCodeAt(0)===65279?t.slice(1):t}function z(t){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(e){var r=de(e);r.chunkSize=parseInt(r.chunkSize),e.step||e.chunk||(r.chunkSize=null),this._handle=new pe(r),(this._handle.streamer=this)._config=r}).call(this,t),this.parseChunk=function(e,r){var s=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<s){let g=this._config.newline;g||(i=this._config.quoteChar||'"',g=this._handle.guessLineEndings(e,i)),e=[...e.split(g).slice(s)].join(g)}this.isFirstChunk&&E(this._config.beforeFirstChunk)&&(i=this._config.beforeFirstChunk(e))!==void 0&&(e=i),this.isFirstChunk=!1,this._halted=!1;var s=this._partialLine+e,i=(this._partialLine="",this._handle.parse(s,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(e=i.meta.cursor,s=(this._finished||(this._partialLine=s.substring(e-this._baseIndex),this._baseIndex=e),i&&i.data&&(this._rowCount+=i.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),N)m.postMessage({results:i,workerId:o.WORKER_ID,finished:s});else if(E(this._config.chunk)&&!r){if(this._config.chunk(i,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=i=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(i.data),this._completeResults.errors=this._completeResults.errors.concat(i.errors),this._completeResults.meta=i.meta),this._completed||!s||!E(this._config.complete)||i&&i.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),s||i&&i.meta.paused||this._nextChunk(),i}this._halted=!0},this._sendError=function(e){E(this._config.error)?this._config.error(e):N&&this._config.error&&m.postMessage({workerId:o.WORKER_ID,error:e,finished:!1})}}function re(t){var e;(t=t||{}).chunkSize||(t.chunkSize=o.RemoteChunkSize),z.call(this,t),this._nextChunk=C?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(r){this._input=r,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(e=new XMLHttpRequest,this._config.withCredentials&&(e.withCredentials=this._config.withCredentials),C||(e.onload=$(this._chunkLoaded,this),e.onerror=$(this._chunkError,this)),e.ontimeout=$(this._chunkTimeout,this),e.open(this._config.downloadRequestBody?"POST":"GET",this._input,!C),this._config.downloadTimeout&&!C&&(e.timeout=this._config.downloadTimeout),this._config.downloadRequestHeaders){var r,s=this._config.downloadRequestHeaders;for(r in s)e.setRequestHeader(r,s[r])}var i;this._config.chunkSize&&(i=this._start+this._config.chunkSize-1,e.setRequestHeader("Range","bytes="+this._start+"-"+i));try{e.send(this._config.downloadRequestBody)}catch(g){this._chunkError(g.message)}C&&e.status===0&&this._chunkError()}},this._chunkLoaded=function(){e.readyState===4&&(e.status<200||400<=e.status?this._chunkError():(this._start+=this._config.chunkSize||e.responseText.length,this._finished=!this._config.chunkSize||this._start>=(r=>(r=r.getResponseHeader("Content-Range"))!==null?parseInt(r.substring(r.lastIndexOf("/")+1)):-1)(e),this.parseChunk(e.responseText)))},this._chunkError=function(r){r=e.statusText||r,this._sendError(new Error(r))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function oe(t){(t=t||{}).chunkSize||(t.chunkSize=o.LocalChunkSize),z.call(this,t);var e,r,s=typeof FileReader<"u";this.stream=function(i){this._input=i,r=i.slice||i.webkitSlice||i.mozSlice,s?((e=new FileReader).onload=$(this._chunkLoaded,this),e.onerror=$(this._chunkError,this)):e=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var i=this._input,g=(this._config.chunkSize&&(g=Math.min(this._start+this._config.chunkSize,this._input.size),i=r.call(i,this._start,g)),e.readAsText(i,this._config.encoding));s||this._chunkLoaded({target:{result:g}})},this._chunkLoaded=function(i){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(i.target.result)},this._chunkError=function(){this._sendError(e.error)}}function ie(t){var e;z.call(this,t=t||{}),this.stream=function(r){return e=r,this._nextChunk()},this._nextChunk=function(){var r,s;if(!this._finished)return r=this._config.chunkSize,e=r?(s=e.substring(0,r),e.substring(r)):(s=e,""),this._finished=!e,this.parseChunk(s)}}function ue(t){z.call(this,t=t||{});var e=[],r=!0,s=!1;this.pause=function(){z.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){z.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(i){this._input=i,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){s&&e.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),e.length?this.parseChunk(e.shift()):r=!0},this._streamData=$(function(i){try{e.push(typeof i=="string"?i:i.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(e.shift()))}catch(g){this._streamError(g)}},this),this._streamError=$(function(i){this._streamCleanUp(),this._sendError(i)},this),this._streamEnd=$(function(){this._streamCleanUp(),s=!0,this._streamData("")},this),this._streamCleanUp=$(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function pe(t){var e,r,s,i,g=Math.pow(2,53),I=-g,U=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,Q=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,w=this,A=0,u=0,D=!1,l=!1,d=[],n={data:[],errors:[],meta:{}};function F(p){return t.skipEmptyLines==="greedy"?p.join("").trim()==="":p.length===1&&p[0].length===0}function k(){if(n&&s&&(M("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),s=!1),t.skipEmptyLines&&(n.data=n.data.filter(function(a){return!F(a)})),x()){let a=function(R){d.push(R)};if(n)if(Array.isArray(n.data[0])){for(var p=0;x()&&p<n.data.length;p++)n.data[p].forEach(a);n.data.splice(0,1)}else n.data.forEach(a)}function f(a,R){for(var O=t.header?{}:[],_=0;_<a.length;_++){var y=_,c=a[_],c=((q,h)=>(v=>(t.dynamicTypingFunction&&t.dynamicTyping[v]===void 0&&(t.dynamicTyping[v]=t.dynamicTypingFunction(v)),(t.dynamicTyping[v]||t.dynamicTyping)===!0))(q)?h==="true"||h==="TRUE"||h!=="false"&&h!=="FALSE"&&((v=>{if(U.test(v)&&(v=parseFloat(v),I<v&&v<g))return 1})(h)?parseFloat(h):Q.test(h)?new Date(h):h===""?null:h):h)(y=t.header?_>=d.length?"__parsed_extra":d[_]:y,c=t.transform?t.transform(c,y):c);y==="__parsed_extra"?(O[y]=O[y]||[],O[y].push(c)):O[y]=c}return t.header&&(_>d.length?M("FieldMismatch","TooManyFields","Too many fields: expected "+d.length+" fields but parsed "+_,u+R):_<d.length&&M("FieldMismatch","TooFewFields","Too few fields: expected "+d.length+" fields but parsed "+_,u+R)),O}var b;n&&(t.header||t.dynamicTyping||t.transform)&&(b=1,!n.data.length||Array.isArray(n.data[0])?(n.data=n.data.map(f),b=n.data.length):n.data=f(n.data,0),t.header&&n.meta&&(n.meta.fields=d),u+=b)}function x(){return t.header&&d.length===0}function M(p,f,b,a){p={type:p,code:f,message:b},a!==void 0&&(p.row=a),n.errors.push(p)}E(t.step)&&(i=t.step,t.step=function(p){n=p,x()?k():(k(),n.data.length!==0&&(A+=p.data.length,t.preview&&A>t.preview?r.abort():(n.data=n.data[0],i(n,w))))}),this.parse=function(p,f,b){var a=t.quoteChar||'"',a=(t.newline||(t.newline=this.guessLineEndings(p,a)),s=!1,t.delimiter?E(t.delimiter)&&(t.delimiter=t.delimiter(p),n.meta.delimiter=t.delimiter):((a=((R,O,_,y,c)=>{var q,h,v,Y;c=c||[","," ","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var ee=0;ee<c.length;ee++){for(var B,se=c[ee],T=0,K=0,S=0,L=(v=void 0,new le({comments:y,delimiter:se,newline:O,preview:10}).parse(R)),V=0;V<L.data.length;V++)_&&F(L.data[V])?S++:(B=L.data[V].length,K+=B,v===void 0?v=B:0<B&&(T+=Math.abs(B-v),v=B));0<L.data.length&&(K/=L.data.length-S),1.99<K&&(h===void 0||T<h||T===h&&Y<K)&&(h=T,q=se,Y=K)}return{successful:!!(t.delimiter=q),bestDelimiter:q}})(p,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess)).successful?t.delimiter=a.bestDelimiter:(s=!0,t.delimiter=o.DefaultDelimiter),n.meta.delimiter=t.delimiter),de(t));return a.header=x(),t.preview&&t.header&&a.preview++,e=p,r=new le(a),n=r.parse(e,f,b),k(),D?{meta:{paused:!0}}:n||{meta:{paused:!1}}},this.paused=function(){return D},this.pause=function(){D=!0,r.abort(),e=E(t.chunk)?"":e.substring(r.getCharIndex())},this.resume=function(){w.streamer._halted?(D=!1,w.streamer.parseChunk(e,!0)):setTimeout(w.resume,3)},this.aborted=function(){return l},this.abort=function(){l=!0,r.abort(),n.meta.aborted=!0,E(t.complete)&&t.complete(n),e=""},this.guessLineEndings=function(R,a){R=R.substring(0,1048576);var a=new RegExp(ne(a)+"([^]*?)"+ne(a),"gm"),b=(R=R.replace(a,"")).split("\r"),a=R.split(`
|
|
7
7
|
`),R=1<a.length&&a[0].length<b[0].length;if(b.length===1||R)return`
|
|
8
8
|
`;for(var O=0,_=0;_<b.length;_++)b[_][0]===`
|
|
9
9
|
`&&O++;return O>=b.length/2?`\r
|
|
10
10
|
`:"\r"}}function ne(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function le(t){var e=(t=t||{}).delimiter,r=t.newline,s=t.comments,i=t.step,g=t.preview,I=t.fastMode,U=null,Q=!1,w=t.quoteChar==null?'"':t.quoteChar,A=w;if(t.escapeChar!==void 0&&(A=t.escapeChar),(typeof e!="string"||-1<o.BAD_DELIMITERS.indexOf(e))&&(e=","),s===e)throw new Error("Comment character same as delimiter");s===!0?s="#":(typeof s!="string"||-1<o.BAD_DELIMITERS.indexOf(s))&&(s=!1),r!==`
|
|
11
11
|
`&&r!=="\r"&&r!==`\r
|
|
12
12
|
`&&(r=`
|
|
13
|
-
`);var u=0,D=!1;this.parse=function(l,d,n){if(typeof l!="string")throw new Error("Input must be a string");var F=l.length,k=e.length,x=r.length,M=s.length,p=E(i),f=[],b=[],a=[],R=u=0;if(!l)return T();if(I||I!==!1&&l.indexOf(w)===-1){for(var O=l.split(r),_=0;_<O.length;_++){if(a=O[_],u+=a.length,_!==O.length-1)u+=r.length;else if(n)return T();if(!s||a.substring(0,M)!==s){if(p){if(f=[],
|
|
13
|
+
`);var u=0,D=!1;this.parse=function(l,d,n){if(typeof l!="string")throw new Error("Input must be a string");var F=l.length,k=e.length,x=r.length,M=s.length,p=E(i),f=[],b=[],a=[],R=u=0;if(!l)return T();if(I||I!==!1&&l.indexOf(w)===-1){for(var O=l.split(r),_=0;_<O.length;_++){if(a=O[_],u+=a.length,_!==O.length-1)u+=r.length;else if(n)return T();if(!s||a.substring(0,M)!==s){if(p){if(f=[],Y(a.split(e)),K(),D)return T()}else Y(a.split(e));if(g&&g<=_)return f=f.slice(0,g),T(!0)}}return T()}for(var y=l.indexOf(e,u),c=l.indexOf(r,u),q=new RegExp(ne(A)+ne(w),"g"),h=l.indexOf(w,u);;)if(l[u]===w)for(h=u,u++;;){if((h=l.indexOf(w,h+1))===-1)return n||b.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:f.length,index:u}),B();if(h===F-1)return B(l.substring(u,h).replace(q,w));if(w===A&&l[h+1]===A)h++;else if(w===A||h===0||l[h-1]!==A){y!==-1&&y<h+1&&(y=l.indexOf(e,h+1));var v=ee((c=c!==-1&&c<h+1?l.indexOf(r,h+1):c)===-1?y:Math.min(y,c));if(l.substr(h+1+v,k)===e){a.push(l.substring(u,h).replace(q,w)),l[u=h+1+v+k]!==w&&(h=l.indexOf(w,u)),y=l.indexOf(e,u),c=l.indexOf(r,u);break}if(v=ee(c),l.substring(h+1+v,h+1+v+x)===r){if(a.push(l.substring(u,h).replace(q,w)),se(h+1+v+x),y=l.indexOf(e,u),h=l.indexOf(w,u),p&&(K(),D))return T();if(g&&f.length>=g)return T(!0);break}b.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:f.length,index:u}),h++}}else if(s&&a.length===0&&l.substring(u,u+M)===s){if(c===-1)return T();u=c+x,c=l.indexOf(r,u),y=l.indexOf(e,u)}else if(y!==-1&&(y<c||c===-1))a.push(l.substring(u,y)),u=y+k,y=l.indexOf(e,u);else{if(c===-1)break;if(a.push(l.substring(u,c)),se(c+x),p&&(K(),D))return T();if(g&&f.length>=g)return T(!0)}return B();function Y(S){f.push(S),R=u}function ee(S){var L=0;return L=S!==-1&&(S=l.substring(h+1,S))&&S.trim()===""?S.length:L}function B(S){return n||(S===void 0&&(S=l.substring(u)),a.push(S),u=F,Y(a),p&&K()),T()}function se(S){u=S,Y(a),a=[],c=l.indexOf(r,u)}function T(S){if(t.header&&!d&&f.length&&!Q){var L=f[0],V=Object.create(null),fe=new Set(L);let me=!1;for(let te=0;te<L.length;te++){let W=P(L[te]);if(V[W=E(t.transformHeader)?t.transformHeader(W,te):W]){let ae,ye=V[W];for(;ae=W+"_"+ye,ye++,fe.has(ae););fe.add(ae),L[te]=ae,V[W]++,me=!0,(U=U===null?{}:U)[ae]=W}else V[W]=1,L[te]=W;fe.add(W)}me&&console.warn("Duplicate headers found and renamed."),Q=!0}return{data:f,errors:b,meta:{delimiter:e,linebreak:r,aborted:D,truncated:!!S,cursor:R+(d||0),renamedHeaders:U}}}function K(){i(T()),f=[],b=[]}},this.abort=function(){D=!0},this.getCharIndex=function(){return u}}function be(t){var e=t.data,r=J[e.workerId],s=!1;if(e.error)r.userError(e.error,e.file);else if(e.results&&e.results.data){var i={abort:function(){s=!0,ge(e.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:_e,resume:_e};if(E(r.userStep)){for(var g=0;g<e.results.data.length&&(r.userStep({data:e.results.data[g],errors:e.results.errors,meta:e.results.meta},i),!s);g++);delete e.results}else E(r.userChunk)&&(r.userChunk(e.results,i,e.file),delete e.results)}e.finished&&!s&&ge(e.workerId,e.results)}function ge(t,e){var r=J[t];E(r.userComplete)&&r.userComplete(e),r.terminate(),delete J[t]}function _e(){throw new Error("Not implemented.")}function de(t){if(typeof t!="object"||t===null)return t;var e,r=Array.isArray(t)?[]:{};for(e in t)r[e]=de(t[e]);return r}function $(t,e){return function(){t.apply(e,arguments)}}function E(t){return typeof t=="function"}return o.parse=function(t,e){var r=(e=e||{}).dynamicTyping||!1;if(E(r)&&(e.dynamicTypingFunction=r,r={}),e.dynamicTyping=r,e.transform=!!E(e.transform)&&e.transform,e.downloadTimeout!==void 0){var r=parseInt(e.downloadTimeout);if(isNaN(r))throw new Error("Config downloadTimeout value ("+e.downloadTimeout+") not parsable by parseInt(val).");e.downloadTimeout=r}if(!e.worker||!o.WORKERS_SUPPORTED)return r=null,o.NODE_STREAM_INPUT,typeof t=="string"?(t=P(t),r=new(e.download?re:ie)(e)):t.readable===!0&&E(t.read)&&E(t.on)?r=new ue(e):(m.File&&t instanceof File||t instanceof Object)&&(r=new oe(e)),r.stream(t);(r=(()=>{var s;return!!o.WORKERS_SUPPORTED&&(s=(()=>{var i=m.URL||m.webkitURL||null,g=G.toString();return o.BLOB_URL||(o.BLOB_URL=i.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",g,")();"],{type:"text/javascript"})))})(),(s=new m.Worker(s)).onmessage=be,s.id=Z++,J[s.id]=s)})()).userStep=e.step,r.userChunk=e.chunk,r.userComplete=e.complete,r.userError=e.error,e.step=E(e.step),e.chunk=E(e.chunk),e.complete=E(e.complete),e.error=E(e.error),delete e.worker,r.postMessage({input:t,config:e,workerId:r.id})},o.unparse=function(t,e){var r=!1,s=!0,i=",",g=`\r
|
|
14
14
|
`,I='"',U=I+I,Q=!1,w=null,A=!1,u=((()=>{if(typeof e=="object"){if(typeof e.delimiter!="string"||o.BAD_DELIMITERS.filter(function(d){return e.delimiter.indexOf(d)!==-1}).length||(i=e.delimiter),typeof e.quotes!="boolean"&&typeof e.quotes!="function"&&!Array.isArray(e.quotes)||(r=e.quotes),typeof e.skipEmptyLines!="boolean"&&typeof e.skipEmptyLines!="string"||(Q=e.skipEmptyLines),typeof e.newline=="string"&&(g=e.newline),typeof e.quoteChar=="string"&&(I=e.quoteChar,U=I+I),typeof e.header=="boolean"&&(s=e.header),Array.isArray(e.columns)){if(e.columns.length===0)throw new Error("Option columns is empty");w=e.columns}e.escapeChar!==void 0&&(U=e.escapeChar+I),e.escapeFormulae instanceof RegExp?A=e.escapeFormulae:typeof e.escapeFormulae=="boolean"&&e.escapeFormulae&&(A=/^[=+\-@\t\r].*$/)}})(),new RegExp(ne(I),"g"));if(typeof t=="string"&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return D(null,t,Q);if(typeof t[0]=="object")return D(w||Object.keys(t[0]),t,Q)}else if(typeof t=="object")return typeof t.data=="string"&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields||w),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:typeof t.data[0]=="object"?Object.keys(t.data[0]):[]),Array.isArray(t.data[0])||typeof t.data[0]=="object"||(t.data=[t.data])),D(t.fields||[],t.data||[],Q);throw new Error("Unable to serialize unrecognized input");function D(d,n,F){var k="",x=(typeof d=="string"&&(d=JSON.parse(d)),typeof n=="string"&&(n=JSON.parse(n)),Array.isArray(d)&&0<d.length),M=!Array.isArray(n[0]);if(x&&s){for(var p=0;p<d.length;p++)0<p&&(k+=i),k+=l(d[p],p);0<n.length&&(k+=g)}for(var f=0;f<n.length;f++){var b=(x?d:n[f]).length,a=!1,R=x?Object.keys(n[f]).length===0:n[f].length===0;if(F&&!x&&(a=F==="greedy"?n[f].join("").trim()==="":n[f].length===1&&n[f][0].length===0),F==="greedy"&&x){for(var O=[],_=0;_<b;_++){var y=M?d[_]:_;O.push(n[f][y])}a=O.join("").trim()===""}if(!a){for(var c=0;c<b;c++){0<c&&!R&&(k+=i);var q=x&&M?d[c]:c;k+=l(n[f][q],c)}f<n.length-1&&(!F||0<b&&!R)&&(k+=g)}}return k}function l(d,n){var F,k,x;return d==null?"":d.constructor===Date?isNaN(d.getTime())?"":d.toISOString():(x=!1,A&&typeof d=="string"&&A.test(d)&&(d="'"+d,x=!0),k=(F=d.toString()).replace(u,U),(x=x||r===!0||typeof r=="function"&&r(d,n)||Array.isArray(r)&&r[n]||((M,p)=>{for(var f=0;f<p.length;f++)if(-1<M.indexOf(p[f]))return!0;return!1})(k,o.BAD_DELIMITERS)||-1<k.indexOf(i)||-1<F.indexOf(I)||k.charAt(0)===" "||k.charAt(k.length-1)===" ")?I+k+I:k)}},o.RECORD_SEP="",o.UNIT_SEP="",o.BYTE_ORDER_MARK="\uFEFF",o.BAD_DELIMITERS=["\r",`
|
|
15
|
-
`,'"',o.BYTE_ORDER_MARK],o.WORKERS_SUPPORTED=!C&&!!m.Worker,o.NODE_STREAM_INPUT=1,o.LocalChunkSize=10485760,o.RemoteChunkSize=5242880,o.DefaultDelimiter=",",o.Parser=le,o.ParserHandle=pe,o.NetworkStreamer=re,o.FileStreamer=oe,o.StringStreamer=ie,o.ReadableStreamStreamer=ue,N&&(m.onmessage=function(t){t=t.data,o.WORKER_ID===void 0&&t&&(o.WORKER_ID=t.workerId),typeof t.input=="string"?m.postMessage({workerId:o.WORKER_ID,results:o.parse(t.input,t.config),finished:!0}):(m.File&&t.input instanceof File||t.input instanceof Object)&&(t=o.parse(t.input,t.config))&&m.postMessage({workerId:o.WORKER_ID,results:t,finished:!0})}),(re.prototype=Object.create(z.prototype)).constructor=re,(oe.prototype=Object.create(z.prototype)).constructor=oe,(ie.prototype=Object.create(ie.prototype)).constructor=ie,(ue.prototype=Object.create(z.prototype)).constructor=ue,o})})(he)),he.exports}var De=Ae();const Le=Ee(De),we=32;function
|
|
15
|
+
`,'"',o.BYTE_ORDER_MARK],o.WORKERS_SUPPORTED=!C&&!!m.Worker,o.NODE_STREAM_INPUT=1,o.LocalChunkSize=10485760,o.RemoteChunkSize=5242880,o.DefaultDelimiter=",",o.Parser=le,o.ParserHandle=pe,o.NetworkStreamer=re,o.FileStreamer=oe,o.StringStreamer=ie,o.ReadableStreamStreamer=ue,N&&(m.onmessage=function(t){t=t.data,o.WORKER_ID===void 0&&t&&(o.WORKER_ID=t.workerId),typeof t.input=="string"?m.postMessage({workerId:o.WORKER_ID,results:o.parse(t.input,t.config),finished:!0}):(m.File&&t.input instanceof File||t.input instanceof Object)&&(t=o.parse(t.input,t.config))&&m.postMessage({workerId:o.WORKER_ID,results:t,finished:!0})}),(re.prototype=Object.create(z.prototype)).constructor=re,(oe.prototype=Object.create(z.prototype)).constructor=oe,(ie.prototype=Object.create(ie.prototype)).constructor=ie,(ue.prototype=Object.create(z.prototype)).constructor=ue,o})})(he)),he.exports}var De=Ae();const Le=Ee(De),we=32;function Xe({content:H}){const X=xe(),G=Re(P=>P.selectedCwd),m=ve.useMemo(()=>Te(H.src,P=>X.mediaUrl(G??"",P)),[H.src,X,G]),{data:C,error:N,isLoading:J}=Se({queryKey:["canvas-csv",m.url],enabled:m.url!==null,queryFn:async()=>{const P=await fetch(m.url);if(!P.ok)throw new Error(`Failed to load CSV (${P.status})`);const z=await P.text();return Le.parse(z.trim(),{skipEmptyLines:!0}).data},staleTime:6e4,retry:!1});if(m.url===null)return j.jsx(ce,{children:"This CSV source can’t be displayed here."});if(J)return j.jsx(ce,{children:"Loading CSV…"});if(N||!C||C.length===0)return j.jsx(ce,{children:"This CSV couldn’t be loaded."});const[Z,...o]=C;return j.jsx(je,{header:Z,rows:o})}function je({header:H,rows:X}){const G=ve.useRef(null),m=Oe({count:X.length,getScrollElement:()=>G.current,estimateSize:()=>we,overscan:12});return j.jsx("div",{ref:G,className:"h-full overflow-auto",children:j.jsxs("table",{className:"w-full border-collapse text-sm",children:[j.jsx("thead",{className:"bg-muted sticky top-0 z-10",children:j.jsx("tr",{children:H.map((C,N)=>j.jsx("th",{className:"text-muted-foreground border-b px-3 py-1.5 text-left font-medium whitespace-nowrap",children:C},N))})}),j.jsx("tbody",{style:{height:m.getTotalSize(),position:"relative"},children:m.getVirtualItems().map(C=>{const N=X[C.index];return j.jsx("tr",{className:Ce("absolute flex w-full",C.index%2===1&&"bg-muted/30"),style:{transform:`translateY(${C.start}px)`,height:we},children:H.map((J,Z)=>j.jsx("td",{className:"flex-1 truncate border-b px-3 py-1.5 whitespace-nowrap",title:N[Z]??"",children:N[Z]??""},Z))},C.key)})})]})})}function ce({children:H}){return j.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:j.jsx("p",{children:H})})}export{Xe as CanvasCsvContent};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-D0q3ETxK.js","assets/index-MHIn2TC9.js","assets/index-P4Wos1Gi.css","assets/index-CH4NJ8dD.js","assets/index-DIJdZqg2.js","assets/BlintzCanvas-DCXIQZM_.js","assets/index-U5jTIqzv.js","assets/BlintzCanvas-DCXOV_yN.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as a,aZ as z,ha as ce,j as t,G as O,g2 as oe,g3 as le,B as D,g4 as ue,g5 as de,g6 as Z,hb as fe,dh as he,di as pe,J as me,gj as ve,dj as xe,a7 as ge,hc as be,a_ as ee,a5 as ye,hd as je,a6 as Ce}from"./index-MHIn2TC9.js";import{u as ke,a as we,b as Re}from"./use-session-canvas-Cunag2K7.js";import{R as Te}from"./rotate-cw-BAn_5-Gq.js";import"./query-keys-DeYqUDia.js";import"./index.esm-DSKTDEoH.js";import"./WidgetErrorCard-CsMqCyCb.js";import"./index-DEMZynQt.js";import"./progress-C9TALtIa.js";import"./markdown-content-DgiSdNwz.js";import"./table-NGiWzPO4.js";import"./package-Bbs99yqi.js";import"./heart-BMOCYMFT.js";import"./git-branch-BVzjBPW-.js";import"./file-text-DvNAxTGZ.js";import"./file-VtGYNr9E.js";import"./McpAppFrame-DNamtzOp.js";import"./more-details-BW9mauVT.js";function B(e,r){return["canvas-file",e,r]}function Ne({documentId:e,sourcePath:r,binding:d,save:n,draftRef:o,revisionRef:s,finishAttemptRef:C,timerRef:y,finalSaveRef:b,invalidateConfirmedFile:p}){const x=a.useRef({binding:d,save:n,invalidateConfirmedFile:p}),_=a.useRef(null),f=a.useRef(null);return a.useLayoutEffect(()=>{x.current={binding:d,save:n,invalidateConfirmedFile:p}}),a.useLayoutEffect(()=>{const w=z.getState().openDocuments.find(m=>m.id===e);if(!w||typeof w.openedAt!="number")return;const R=ce(e,w.openedAt,r,{required:()=>!!x.current.binding,current:()=>{const m=f.current;return!!m&&m.revision===s.current&&m.attempt===C.current&&m.binding===x.current.binding&&m.save===x.current.save&&m.binding.current()},invalidateConfirmedFile:()=>x.current.invalidateConfirmedFile(),prepare:async()=>{var c;f.current=null;const{binding:m,save:T}=x.current;if(!(m!=null&&m.current()))return!1;y.current&&(clearTimeout(y.current),y.current=null);const F=o.current,g=s.current,l=++C.current,i=await T(F);return i.status!=="changed"&&i.status!=="no_op"||i.confirmed.content!==F||s.current!==g||C.current!==l||x.current.binding!==m||x.current.save!==T||!m.current()?!1:((c=b.current)==null||c.cancel(),b.current=null,f.current={revision:g,attempt:l,binding:m,save:T},!0)}});return _.current=R,()=>R.retire()},[e,r,o,s,C,y,b]),_}function M(e){return e.status==="refused"||e.status==="local_uncertain"?e.status:"unavailable"}function _e(e,r,d){var l;const n=a.useRef(e),o=a.useRef(null),s=a.useRef(null),[C,y]=a.useState({identity:e.identity,phase:"pending",busy:!1});a.useLayoutEffect(()=>{n.current=e},[e]);const b=a.useCallback((i,c)=>{o.current===i&&n.current.identity===i&&n.current.current()&&y(u=>({identity:i,...c,historical:c.historical??(u.identity===i?u.historical:void 0)}))},[]),p=a.useCallback(i=>{o.current!==i||n.current.identity!==i||y(c=>c.identity===i?{...c,phase:"unavailable",busy:!1}:{identity:i,phase:"unavailable",busy:!1})},[]),x=e.identity,_=e.supported;a.useLayoutEffect(()=>{const i=n.current;s.current=null,o.current=x;let c=!1;return _&&r==="ready"&&i.discover().then(u=>{c||(u.status==="observed"?b(x,{phase:"ready",discovery:u.value,busy:!1}):u.status!=="idle"?b(x,{phase:M(u),busy:!1}):p(x))}),()=>{c=!0,s.current=null,o.current===x&&(o.current=null)}},[x,_,r,d,b,p]);const f=C.identity===e.identity?C:void 0,w=a.useCallback(async()=>{const i=n.current,c=i.identity;if(o.current!==c||!i.current())return;s.current=null,y(j=>({identity:c,phase:"pending",busy:!0,historical:j.identity===c?j.historical:void 0}));const u=await i.discover(!0);u.status==="observed"?b(c,{phase:"ready",discovery:u.value,busy:!1}):u.status!=="idle"?b(c,{phase:M(u),busy:!1}):p(c)},[b,p]),R=a.useCallback(async i=>{const c=n.current,u=c.identity;if(o.current!==u||!c.current())return;s.current=null,y(h=>({identity:u,phase:"pending",busy:!0,discovery:h.identity===u?h.discovery:void 0,historical:h.identity===u?h.historical:void 0}));const j=await c.recover(i);j.status==="observed"?b(u,{phase:"ready",discovery:j.value.discovery,historical:j.value.result.entry,busy:!1}):j.status!=="idle"?b(u,{phase:M(j),busy:!1}):p(u)},[b,p]),m=a.useCallback(async()=>{const i=n.current,c=i.identity;if(o.current!==c||!i.current())return{status:"idle"};const u={};s.current=u,y(h=>h.identity===c?{...h,phase:"pending",busy:!0}:h);const j=await i.inspectCurrent();return s.current!==u?{status:"idle"}:(s.current=null,j.status==="idle"&&p(c),o.current===c&&n.current.identity===c&&i.current()&&j.status!=="idle"&&y(h=>h.identity===c?{...h,phase:j.status==="observed"?"ready":M(j),busy:!1}:h),j)},[p]),T=e.supported&&r==="ready",F=r==="pending"?"pending":(f==null?void 0:f.phase)??"pending",g=T&&(F!=="ready"||((l=f==null?void 0:f.discovery)==null?void 0:l.admission)==="blocked");return{supported:T,phase:F,editBlocked:g,busy:(f==null?void 0:f.busy)??F==="pending",discovery:f==null?void 0:f.discovery,historical:f==null?void 0:f.historical,refresh:w,recover:R,inspectCurrent:m}}const Fe={unavailable:"Couldn’t check previous saves, so editing is off.",refused:"This file can’t be edited from this canvas."};function Pe(e){var r,d,n;return e.supported?e.phase==="unavailable"||e.phase==="refused"||e.phase==="local_uncertain"?!0:((r=e.discovery)==null?void 0:r.admission)==="blocked"||((d=e.discovery)==null?void 0:d.entries.some(o=>o.state==="review"))===!0||((n=e.historical)==null?void 0:n.state)==="receipt":!1}function X({recovery:e,editing:r,loadCurrent:d}){var o;if(e.phase==="unavailable"||e.phase==="refused")return t.jsxs(t.Fragment,{children:[t.jsx("p",{role:"alert",className:"col-start-1 row-start-1 py-1.5",children:Fe[e.phase]}),t.jsx(D,{type:"button",size:"sm",variant:"outline",className:"col-span-2 col-start-1 row-start-2 mb-1.5 justify-self-start @md:col-span-1 @md:col-start-2 @md:row-start-1 @md:mb-0",disabled:e.busy||r,onClick:()=>void e.refresh(),children:"Check again"})]});if(e.phase==="local_uncertain")return t.jsx("p",{role:"alert",children:"Use Retry original save. Checking previous saves won’t confirm this save."});const n=e.discovery;return t.jsxs("div",{className:"space-y-1",children:[(n==null?void 0:n.admission)==="blocked"&&t.jsx("p",{role:"alert",children:"An unresolved original save blocks this file. This list may not include the blocking operation."}),(n==null?void 0:n.hasMore)&&t.jsx("p",{children:"Only the latest 25 matching saves are shown. Older evidence is omitted."}),n&&n.entries.length>0&&t.jsx(t.Fragment,{children:t.jsx("ul",{children:n.entries.map(s=>t.jsxs("li",{children:[t.jsxs("span",{children:[s.eventId,":"," ",s.state==="receipt"?"Historical save recorded":s.state==="review"?"Original save needs review":s.state==="no_op"?"Original save made no change":"Original save failed before replacement"]}),s.state==="review"&&(s.reason==="prepared_without_replacement"?t.jsx("p",{children:"This save needs manual review. These controls won’t write the file."}):t.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[t.jsx("p",{children:"The original saved replacement must be proven before its receipt can be settled."}),t.jsx(D,{type:"button",size:"sm",variant:"outline",disabled:e.busy||r,onClick:()=>void e.recover(s.eventId),children:"Recover original receipt"})]}))]},s.eventId))})}),(n==null?void 0:n.admission)==="blocked"&&n.entries.length===0&&t.jsx("p",{children:"No matching recent saves."}),((o=e.historical)==null?void 0:o.state)==="receipt"&&t.jsxs("div",{role:"status",className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[t.jsxs("div",{children:[t.jsx("p",{children:"Previous save confirmed. Your current draft may differ."}),t.jsx("p",{children:e.historical.currentFileMatch==="different"?"The current file differs from that historical save.":e.historical.currentFileMatch==="same_saved_replacement"?"The saved replacement matched when checked; current bytes still require a fresh load.":"The current file was not checked."})]}),t.jsx(D,{type:"button",size:"sm",variant:"outline",disabled:r||e.editBlocked||e.busy,onClick:d,children:"Load current file"})]})]})}function Se({recovery:e,editing:r,loadCurrent:d}){return!e.supported||r?null:t.jsxs(oe,{children:[t.jsx(le,{asChild:!0,children:t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground","aria-label":"More file actions",children:t.jsx(ue,{className:"size-4"})})}),t.jsxs(de,{align:"end",children:[t.jsx(Z,{disabled:e.busy,onSelect:()=>void e.refresh(),children:"Check previous saves"}),t.jsx(Z,{disabled:e.editBlocked||e.busy,onSelect:()=>d(),children:"Load current file"})]})]})}function De({recovery:e,editing:r,loadCurrent:d,toolbar:n}){const o=Pe(e),s=e.phase==="unavailable"||e.phase==="refused";return t.jsxs(t.Fragment,{children:[e.supported&&e.phase==="pending"&&t.jsx("p",{role:"status",className:"sr-only",children:"Checking previous saves…"}),t.jsx("div",{...o?{role:"region","aria-label":"Previous file saves"}:{},className:O("shrink-0",o?"bg-muted text-foreground mx-2 mt-2 rounded-md py-1 pr-1 pl-3 text-sm":"flex justify-end px-2 pt-1",o&&(s?"@container":"flow-root")),children:t.jsxs("div",{className:O(o&&s&&"grid grid-cols-[1fr_auto] items-center gap-x-2 @md:grid-cols-[1fr_auto_auto]"),children:[t.jsx("div",{className:O("flex items-center gap-1",o&&!s&&"float-right ml-2",o&&s&&"col-start-2 row-start-1 @md:col-start-3"),children:n}),o&&(s?t.jsx(X,{recovery:e,editing:r,loadCurrent:d}):t.jsx("div",{className:"py-1.5",children:t.jsx(X,{recovery:e,editing:r,loadCurrent:d})}))]})})]})}function Le({editing:e,off:r,observation:d,onClick:n}){return t.jsx(fe,{children:t.jsxs(he,{...r?{}:{open:!1},children:[t.jsx(pe,{asChild:!0,children:t.jsx("span",{className:"inline-flex",children:t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground",onClick:n,"aria-label":e?"Finish editing":"Edit file",disabled:r,"data-document-save-observation":d,children:e?t.jsx(me,{className:"size-4"}):t.jsx(ve,{className:"size-4"})})})}),t.jsx(xe,{children:"Editing is off"})]})})}const Ee=a.lazy(()=>ee(()=>import("./CodeMirrorEditor-D0q3ETxK.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeMirrorEditor}))),ze=a.lazy(()=>ee(()=>import("./BlintzCanvas-DCXIQZM_.js").then(e=>e.B),__vite__mapDeps([5,1,2,6,4,7])).then(e=>({default:e.BlintzCanvas}))),Be=500;function Me(e,r){return r==="markdown"||/\.(md|markdown|mdx)$/i.test(e)}function Oe(e){switch(e){case"saving":return"Saving…";case"saved":return"Saved";case"error":return"Couldn’t save";case"uncertain":return"Save not confirmed";default:return null}}function te({content:e,documentId:r,cwd:d,loaded:n,theme:o,isEditing:s,onEditingChange:C,setDocumentEditing:y,observedBinding:b,fileSaveObservation:p="unavailable",recoveryBinding:x}){const _=e.readOnly!==!0,f=Me(e.sourcePath,e.language),w=ge(),[R,m]=a.useState(n),[T,F]=a.useState(),g=a.useRef(b);a.useLayoutEffect(()=>{g.current=b},[b]);const l=ke({documentId:r,sourcePath:e.sourcePath,cwd:d,loadedContent:n,documentSaveBinding:T,documentRecoveryBinding:x}),i=_e(l.recovery,p,x),c=we({cwd:d,sourcePath:f?e.sourcePath:null,content:R,saved:l.status==="saved"}),u=a.useRef(!1),j=a.useRef(s);a.useLayoutEffect(()=>(u.current=!0,j.current=s,()=>{u.current=!1}),[s]);const h=a.useRef(null),S=a.useRef(R),L=a.useRef(0),A=a.useRef(0),I=a.useRef(l.save),K=a.useRef(l.prepareFinalSave),U=a.useRef(l.waitForCloseDrain),E=a.useRef(null),V=a.useRef(C),Y=Ne({documentId:r,sourcePath:e.sourcePath,binding:T,save:l.save,draftRef:S,revisionRef:L,finishAttemptRef:A,timerRef:h,finalSaveRef:E,invalidateConfirmedFile:()=>{w.invalidateQueries({queryKey:B(d,e.sourcePath)}).catch(()=>{})}});a.useEffect(()=>{S.current=R,I.current=l.save,K.current=l.prepareFinalSave,U.current=l.waitForCloseDrain,V.current=C});const $=a.useCallback(v=>{var k;L.current+=1,S.current=v,m(v),(k=E.current)==null||k.cancel(),E.current=K.current(v),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{h.current=null,I.current(S.current)},Be)},[]),se=()=>{var P;if(i.editBlocked||p==="pending"||p==="ready"&&!((P=g.current)!=null&&P.current()))return;const v=g.current,k=v&&Object.freeze({...v.incarnation});F(v!=null&&v.current()&&k?{incarnation:k,current:()=>{const N=g.current;return!!N&&be(k,N.incarnation)&&N.current()}}:void 0),L.current+=1,S.current=n,m(n),C(!0),y(r,!0)},ne=async()=>{h.current&&(clearTimeout(h.current),h.current=null);const v=S.current,k=L.current,P=++A.current,N=await I.current(v);if(N.status!=="changed"&&N.status!=="no_op"||L.current!==k||A.current!==P||N.confirmed.content!==v)return;const q=N.confirmed;q.content===S.current&&w.setQueryData(B(d,e.sourcePath),Q=>Q&&{...Q,content:q.content,hash:q.hash}),C(!1),y(r,!1)},re=()=>{w.invalidateQueries({queryKey:B(d,e.sourcePath)})};a.useEffect(()=>{var v;s||(h.current&&clearTimeout(h.current),h.current=null,(v=E.current)==null||v.cancel(),E.current=null)},[s]),a.useEffect(()=>{const v=Y.current;return()=>{var N;h.current&&(clearTimeout(h.current),h.current=null);const k=(N=E.current)==null?void 0:N.flush(),P=S.current;v==null||v.settleRetirement(Promise.resolve(k).then(()=>U.current(P))),E.current=null,y(r,!1),V.current(!1)}},[r,y,Y]);const G=async()=>{if(s||!u.current||i.editBlocked)return;const v=L.current,k=await i.inspectCurrent();k.status!=="observed"||!u.current||j.current||L.current!==v||!l.recovery.current()||w.setQueryData(B(d,e.sourcePath),P=>P&&{...P,...k.value})},ae=()=>{const v=l.adoptDisk();v!=null&&m(v)},ie=()=>{l.overwrite(S.current)},J=l.status==="saved"?l.confirmedContent!==R?"Unsaved changes":l.documentReceipt?"Save recorded":"Saved to file":Oe(l.status),W=s?R:n;return t.jsxs("div",{className:"relative flex h-full flex-col",children:[t.jsx(De,{recovery:i,editing:s,loadCurrent:()=>void G(),toolbar:t.jsxs(t.Fragment,{children:[_&&J&&t.jsx("span",{className:O("mr-1 text-xs",l.status==="error"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",children:J}),!s&&p==="pending"&&t.jsx("span",{role:"status",children:"Checking document…"}),!s&&t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground",onClick:re,"aria-label":"Refresh from disk",children:t.jsx(Te,{className:"size-4"})}),_&&t.jsx(Le,{editing:s,off:!s&&(p==="pending"||i.editBlocked),observation:p,onClick:s?()=>void ne():se}),t.jsx(Se,{recovery:i,editing:s,loadCurrent:()=>void G()})]})}),l.status==="uncertain"&&t.jsxs("div",{role:"status",className:"mx-2 mt-2 flex items-center gap-2 text-sm",children:[t.jsx("span",{children:"Save not confirmed. Retry the original save before saving another draft."}),t.jsx(D,{type:"button",variant:"ghost",size:"sm",onClick:()=>void l.retryUnconfirmed(),children:"Retry original save"})]}),l.status==="conflict"&&t.jsxs("div",{className:"bg-destructive/10 text-destructive mx-2 mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md px-3 py-2 text-sm",children:[t.jsx("span",{className:"flex-1",children:"This file changed on disk since you opened it."}),t.jsx(D,{type:"button",variant:"ghost",size:"sm",className:"h-7",onClick:ae,children:"Reload"}),t.jsx(D,{type:"button",variant:"destructive",size:"sm",className:"h-7",onClick:ie,children:"Overwrite"})]}),t.jsx("div",{className:"min-h-0 flex-1",children:t.jsx(a.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading editor…"}),children:f?t.jsx("div",{className:"px-2 pb-6",children:t.jsx(ze,{value:W,editable:s,onChange:s?$:void 0,wikiLinks:c})}):t.jsx(Ee,{value:W,editable:s,filename:e.sourcePath,languageHint:e.language,theme:o,onChange:s?$:void 0})})})]})}function Ae(e){const{fileSaveBinding:r,fileSaveObservation:d}=Re(e.documentId);return t.jsx(te,{...e,observedBinding:r,recoveryBinding:r,fileSaveObservation:d})}function Ie(e){switch(e==null?void 0:e.code){case"NOT_FOUND":return"This file doesn’t exist.";case"NOT_A_FILE":return"This path is a directory, not a file.";case"TOO_LARGE":return"This file is too large to open here.";case"BINARY_FILE":return"This file isn’t text, so the editor can’t show it.";default:return"This file couldn’t be loaded."}}function rt({content:e,documentId:r}){const d=ye(),n=z(g=>g.selectedCwd),o=z(g=>g.setDocumentEditing),s=z(g=>{var l;return((l=g.openDocuments.find(i=>i.id===r))==null?void 0:l.editing)??!1}),C=je(),y=z(g=>g.canvasSessionId),b=z(g=>g.roomCanvasLiveRoomId),{data:p,error:x,isLoading:_}=Ce({queryKey:B(n,e.sourcePath),enabled:n!==null,queryFn:()=>d.readFileContent(n,e.sourcePath),staleTime:3e4,retry:!1}),[f,w]=a.useState(null),R=g=>{w(g&&p?{pinnedHash:p.hash}:null)};if(n===null)return t.jsx(H,{children:"Open a chat to view files."});if(_)return t.jsx(H,{children:"Loading file…"});if(x||!p)return t.jsx(H,{children:Ie(x)});const m=f!==null&&s,T=(m?f==null?void 0:f.pinnedHash:null)??p.hash,F=y&&!b?Ae:te;return t.jsx(F,{content:e,documentId:r,cwd:n,loaded:p.content,theme:C,isEditing:m,onEditingChange:R,setDocumentEditing:o},`${e.sourcePath}:${T}`)}function H({children:e}){return t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:e})})}export{rt as CanvasFileContent};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Model3dViewer-IwCBCPZ2.js","assets/index-MHIn2TC9.js","assets/index-P4Wos1Gi.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a5 as m,aZ as n,r as s,j as t,a_ as p}from"./index-MHIn2TC9.js";import{r as u}from"./use-session-canvas-Cunag2K7.js";import"./rotate-cw-BAn_5-Gq.js";import"./query-keys-DeYqUDia.js";import"./index.esm-DSKTDEoH.js";import"./WidgetErrorCard-CsMqCyCb.js";import"./index-DEMZynQt.js";import"./progress-C9TALtIa.js";import"./markdown-content-DgiSdNwz.js";import"./table-NGiWzPO4.js";import"./package-Bbs99yqi.js";import"./heart-BMOCYMFT.js";import"./git-branch-BVzjBPW-.js";import"./file-text-DvNAxTGZ.js";import"./file-VtGYNr9E.js";import"./McpAppFrame-DNamtzOp.js";import"./more-details-BW9mauVT.js";const d=s.lazy(()=>p(()=>import("./Model3dViewer-IwCBCPZ2.js"),__vite__mapDeps([0,1,2])).then(e=>({default:e.Model3dViewer})));function f(e){var o;const r=(o=e.split(".").pop())==null?void 0:o.toLowerCase();return r==="glb"||r==="gltf"?"gltf":r==="stl"?"stl":r==="obj"?"obj":r==="3mf"?"3mf":r==="ply"?"ply":r==="fbx"?"fbx":r==="dae"?"dae":null}function V({content:e}){const r=m(),o=n(l=>l.selectedCwd),i=s.useMemo(()=>u(e.src,l=>r.mediaUrl(o??"",l)),[e.src,r,o]),a=s.useMemo(()=>f(e.src),[e.src]);return i.url===null||a===null?t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:"This 3D model can’t be displayed here."})}):t.jsx("div",{className:"bg-muted/40 h-full w-full",children:t.jsx(s.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading 3D viewer…"}),children:t.jsx(d,{url:i.url,format:a,label:e.title??"Canvas 3D model"})})})}export{V as CanvasModel3dContent,f as formatOf};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Dt4H9Tms.js","assets/index-MHIn2TC9.js","assets/index-P4Wos1Gi.css","assets/room-files-source-iaYdshKo.js","assets/markdown-content-DgiSdNwz.js","assets/file-exclamation-point-eBlQssyW.js","assets/query-keys-DeYqUDia.js","assets/composer-insert-BpyATrmR.js","assets/index-BiL3chP7.js","assets/file-drag-GDx2qhdk.js","assets/rotate-cw-BAn_5-Gq.js","assets/link-2-CtFfuMO5.js","assets/file-VtGYNr9E.js","assets/git-branch-BVzjBPW-.js","assets/more-details-BW9mauVT.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{O as L,r as c,j as l,B as ue,h7 as Rn,n7 as An,g as Sn,ka as Mn,G as z,a5 as fe,a7 as Be,a8 as Ue,aQ as H,ci as He,cj as jn,cT as _n,n8 as On,lF as En,n9 as Tn,h as $n,ay as Dn,cp as We,gy as te,q as Z,dL as ze,s as pe,m3 as Pn,na as Ln,mE as Fn,nb as Bn,eZ as Un,ga as Hn,a0 as Wn,ea as zn,n5 as Kn,nc as qn,nd as Vn,a4 as Gn,bx as Jn,ne as Yn,nf as Qn,Y as Xn,$ as Zn,gD as et,k$ as Re,ng as Ke,bV as nt,k_ as Q,l2 as qe,nh as tt,ch as ge,ak as st,bZ as he,is as Ve,c5 as ot,_ as Ge,ni as at,ct as Je,nj as rt,fm as it,kr as Ye,nk as Qe,a_ as ct,gA as Xe,l1 as lt,nl as Ze,nm as dt,nn as ut,no as mt,np as Ae,e$ as ft,nq as pt,nr as gt,ns as ht,nt as xt,nu as yt,nv as bt,l as vt,hk as kt,kS as wt,al as It,nw as Nt,nx as Ct,ny as Rt,b9 as At,nz as St,nA as Mt,nB as jt,nC as _t,Z as Se,fa as Ot}from"./index-MHIn2TC9.js";import{g as Me,m as je,h as xe,f as en,M as Et,a as Tt,E as $t,i as Dt,j as Pt,c as P,k as Lt,b as Ft,l as Bt,r as Ut,u as Ht,C as Wt}from"./registry-fiUD5cv6.js";import"./WidgetErrorCard-CsMqCyCb.js";import{R as zt,A as nn}from"./repeat-CKufDGoQ.js";import{u as Kt}from"./use-room-sessions-DPB29acU.js";import{M as qt}from"./markdown-content-DgiSdNwz.js";import{W as Vt,a as Gt}from"./find-latest-widget-fence-C2qXvASs.js";import{f as Jt}from"./format-duration-BCr6uzby.js";import{H as Yt,a as Qt,b as Xt}from"./RuntimeSetupDialog-Bqh67Vqb.js";import{M as _e}from"./mention-pill-CHPHlu-U.js";import{R as Zt}from"./rotate-ccw-clock-CnARSw5V.js";import{U as es}from"./unplug-MSjeZ0tJ.js";import{M as Oe}from"./message-square-off-CEOyy4Pq.js";import{i as ns}from"./registry-B0HgbN69.js";/**
|
|
3
|
+
* @license lucide-react v1.48.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/const tn={name:"hand",size:24,node:[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]};tn.node;const ts=L(tn);/**
|
|
8
|
+
* @license lucide-react v1.48.0 - ISC
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the ISC license.
|
|
11
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/const sn={name:"link-2-off",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]};sn.node;const ss=L(sn);/**
|
|
13
|
+
* @license lucide-react v1.48.0 - ISC
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the ISC license.
|
|
16
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/const on={name:"megaphone",size:24,node:[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]]};on.node;const os=L(on);/**
|
|
18
|
+
* @license lucide-react v1.48.0 - ISC
|
|
19
|
+
*
|
|
20
|
+
* This source code is licensed under the ISC license.
|
|
21
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
22
|
+
*/const an={name:"power-off",size:24,node:[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};an.node;const as=L(an);/**
|
|
23
|
+
* @license lucide-react v1.48.0 - ISC
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the ISC license.
|
|
26
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/const rn={name:"reply",size:24,node:[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]};rn.node;const rs=L(rn);/**
|
|
28
|
+
* @license lucide-react v1.48.0 - ISC
|
|
29
|
+
*
|
|
30
|
+
* This source code is licensed under the ISC license.
|
|
31
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
+
*/const cn={name:"timer",size:24,node:[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]};cn.node;const is=L(cn);/**
|
|
33
|
+
* @license lucide-react v1.48.0 - ISC
|
|
34
|
+
*
|
|
35
|
+
* This source code is licensed under the ISC license.
|
|
36
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
+
*/const ln={name:"user-minus",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]};ln.node;const Ee=L(ln);/**
|
|
38
|
+
* @license lucide-react v1.48.0 - ISC
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the ISC license.
|
|
41
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/const dn={name:"user-x",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]};dn.node;const cs=L(dn),ls='[data-slot="identity-hover-card-actions"] button:not(:disabled)';function ds(e){const{open:t,setOpen:s,triggerRef:n,enabled:o}=e,a=c.useRef(null),r=c.useRef(!1);c.useEffect(()=>{if(!t||!r.current)return;r.current=!1;let m=0,x=0;const b=()=>{var u;const f=(u=a.current)==null?void 0:u.querySelector(ls);if(f)return f.focus();++m<10&&(x=requestAnimationFrame(b))};return b(),()=>cancelAnimationFrame(x)},[t]);const i=c.useCallback(m=>{var x;!m&&((x=a.current)!=null&&x.contains(document.activeElement))||s(m)},[s]),d=c.useCallback(m=>{!o||m.key!=="Enter"&&m.key!==" "||(m.preventDefault(),r.current=!0,s(!0))},[o,s]),p=c.useMemo(()=>({onEscapeKeyDown:()=>{var m;return(m=n.current)==null?void 0:m.focus()},onBlur:m=>{var b,f,u;const x=m.relatedTarget;x&&((b=a.current)!=null&&b.contains(x)||(f=n.current)!=null&&f.contains(x))||(u=a.current)!=null&&u.contains(document.activeElement)||s(!1)}}),[s,n]);return{contentRef:a,handleOpenChange:i,onTriggerKeyDown:d,contentHandlers:p}}function ce(e){const t=e.key==="ArrowRight"||e.key==="ArrowDown",s=e.key==="ArrowLeft"||e.key==="ArrowUp",n=e.key==="Tab";if(!t&&!s&&!n)return;const o=e.currentTarget.closest('[data-slot="identity-hover-card-actions"]');if(!o)return;const a=Array.from(o.querySelectorAll("button:not(:disabled)")),r=a.indexOf(document.activeElement);if(r===-1||a.length===0)return;e.preventDefault();const i=s||n&&e.shiftKey?-1:1;a[(r+i+a.length)%a.length].focus()}function us({kind:e,about:t}){const n=[e==="agent"?"Agent":e==="human"?"Person":null,t.role].filter(Boolean).join(" · ");return!n&&!t.status?null:l.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5 px-3 pb-3","data-slot":"identity-hover-card-about",children:[n&&l.jsx("p",{className:"text-muted-foreground truncate text-xs",title:n,children:n}),t.status&&l.jsx("p",{className:"text-foreground/80 truncate text-xs","data-slot":"identity-hover-card-status",children:t.status})]})}function ms({actions:e,onAct:t}){const s=n=>()=>{t(),n()};return l.jsxs("div",{className:"border-border mt-auto flex flex-col gap-2 border-t p-3","data-slot":"identity-hover-card-actions",role:"group","aria-label":"Actions",children:[l.jsxs("div",{className:"flex gap-2",children:[e.onMessage&&l.jsx(ue,{size:"xs",className:"flex-1",onClick:s(e.onMessage),onKeyDown:ce,children:"Message"}),e.onViewProfile&&l.jsx(ue,{size:"xs",variant:"outline",className:"flex-1",onClick:s(e.onViewProfile),onKeyDown:ce,children:"Profile"})]}),e.session&&l.jsxs("button",{type:"button","data-slot":"identity-hover-card-session",onClick:s(e.session.onOpen),onKeyDown:ce,className:"text-muted-foreground hover:text-foreground focus-visible:ring-ring flex min-w-0 items-center gap-1.5 rounded-sm text-left text-xs transition-colors focus-visible:ring-2 focus-visible:outline-none",children:[l.jsx(Rn,{className:"size-3.5 shrink-0","aria-hidden":!0}),l.jsx("span",{className:"truncate",children:e.session.label})]})]})}const fs=300;function G({className:e,children:t}){return l.jsx("span",{className:z("bg-muted text-muted-foreground text-2xs inline-flex max-w-full items-center gap-1 truncate rounded-full px-2 py-0.5",e),children:t})}function ye({identity:e,children:t,onViewProfile:s,about:n,actions:o,onOpenChange:a,openOnClick:r=!1,className:i}){const{kind:d,displayName:p,handle:m,color:x,emoji:b,imageUrl:f,origin:u,agent:g}=e,I=x??"hsl(var(--muted-foreground))",h=typeof u=="object"&&u!==null,y=d==="agent"&&(g==null?void 0:g.working)!=null?g.working:null,[w,M]=c.useState(!1),S=c.useCallback(k=>{M(k),a==null||a(k)},[a]),R=c.useRef(!1),N=c.useRef(null),A=An({onLongPress:()=>{R.current&&S(!0)}}),{contentRef:_,handleOpenChange:j,onTriggerKeyDown:v,contentHandlers:O}=ds({open:w,setOpen:S,triggerRef:N,enabled:r&&o!==void 0});return l.jsxs(Yt,{open:w,onOpenChange:j,openDelay:fs,children:[l.jsx(Qt,{asChild:!0,ref:N,"data-gesture-priority":"",...A,onPointerDown:k=>{R.current=k.pointerType==="touch"||k.pointerType==="pen",A.onPointerDown(k)},...r?{onClick:()=>S(!0),onKeyDown:v}:{},children:t}),l.jsxs(Xt,{ref:_,...O,...o?{role:"dialog","aria-label":p}:{},"data-slot":"identity-hover-card",align:"start",className:z("flex w-64 flex-col gap-0 overflow-hidden p-0",i),children:[l.jsxs("div",{className:"flex items-center gap-3 p-3",children:[l.jsx(Sn,{"aria-hidden":!0,color:I,emoji:b,imageUrl:f,fallback:Mn(p),kind:d,origin:u,status:y?"working":"idle",size:"md"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-foreground truncate text-sm font-semibold",children:p}),m&&l.jsxs("p",{className:"text-muted-foreground truncate text-xs font-medium",children:["@",m]})]})]}),n&&l.jsx(us,{kind:d,about:n}),l.jsxs("div",{className:"flex flex-wrap gap-1.5 px-3 pb-3 empty:hidden",children:[d==="agent"&&((g==null?void 0:g.runtime)||(g==null?void 0:g.model))&&l.jsx(G,{children:[g.runtime,g.model].filter(Boolean).join(" · ")}),y&&l.jsxs(G,{className:"bg-status-success-bg text-status-success-fg",children:["Working · ",Jt(y.forMs)]}),d==="human"&&l.jsx(G,{children:h?u.platform:"On this machine"}),d==="agent"&&(g==null?void 0:g.managedBy)&&l.jsxs(G,{children:["Managed by"," ",g.managedBy.handle?`@${g.managedBy.handle}`:g.managedBy.displayName]})]}),o?l.jsx(ms,{actions:o,onAct:()=>{var k;(k=N.current)==null||k.focus(),S(!1)}}):s?l.jsx("button",{type:"button","data-slot":"identity-hover-card-profile",onClick:()=>{var k;(k=N.current)==null||k.focus(),s()},className:"border-border hover:bg-accent focus-visible:ring-ring text-brand-text mt-auto flex w-full items-center border-t px-3 py-2 text-left text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none",children:"View profile"}):l.jsxs("div",{className:"border-border mt-auto flex items-center justify-between border-t px-3 py-2",children:[l.jsx("span",{className:"text-muted-foreground text-xs font-medium",children:"View profile"}),l.jsx("span",{className:"text-muted-foreground text-3xs tracking-wide uppercase",children:"soon"})]})]})]})}function ps(){const e=fe(),t=Be();return Ue({onMutate:({roomId:s,entryId:n,emoji:o,viewerAuthorId:a})=>{var m;const r=t.getQueryData(H.entries(s)),i=(m=r==null?void 0:r.find(x=>x.id===n))==null?void 0:m.reactions,{reactions:d,on:p}=Me(i,o,a);return t.setQueryData(H.entries(s),x=>je(x,n,d)),{on:p}},mutationFn:({roomId:s,entryId:n,emoji:o,viewerAuthorId:a})=>{var d,p;const r=t.getQueryData(H.entries(s)),i=((p=(d=r==null?void 0:r.find(m=>m.id===n))==null?void 0:d.reactions)==null?void 0:p.some(m=>m.emoji===o&&m.authorIds.includes(a)))??!1;return e.toggleReaction(s,n,{emoji:o,on:i})},onError:(s,{roomId:n,entryId:o,emoji:a,viewerAuthorId:r},i)=>{i!==void 0&&t.setQueryData(H.entries(n),d=>{var x;const p=(x=d==null?void 0:d.find(b=>b.id===o))==null?void 0:x.reactions,{reactions:m}=Me(p,a,r,!i.on);return je(d,o,m)})},onSuccess:({frequents:s},{roomId:n})=>{t.setQueryData(H.detail(n),o=>o&&{...o,reactionFrequents:s})},meta:{errorLabel:"Couldn’t add your reaction",errorToastId:"room-reaction"}})}function K(e){return e.threadRootEntryId??e.parentEntryId}function gs(e){return K(e)??e.id}function hs(e,t){return Math.max(t??0,e)}function ua(e,t,s){let n=e[0],o=0;for(const a of e)a.seq>n.seq&&(n=a),t!==null&&a.seq>t&&(o+=1);return{count:hs(e.length,s),lastAt:n.createdAt,unread:o}}function xs(e){var S,R;const{agentPath:t,displayName:s,onViewProfile:n,engaged:o}=e,a=He(),r=jn(),i=a&&o&&t!==void 0,d=_n(i?t:null),p=On(d.member),m=En(),x=Tn(),b=$n(),f=Dn(),{data:u}=We({enabled:i&&r}),g=f.status==="ready"?f.roomId:null,I=u==null?void 0:u.find(N=>N.id===g),h=I?te(I):null,y=(R=(S=d.member)==null?void 0:S.agent)==null?void 0:R.effectiveRuntimeId,w=c.useCallback(()=>{t!==void 0&&(Z.getState().recordOpened("agent",t),m({agentPath:t},y?{runtime:y}:{}))},[t,m,y]),M=c.useCallback(async()=>{if(t===void 0||!b)return;const N=await x(t);if(N===null){ze(`${s} has no session in ${h??"this room"} yet`);return}b(pe({session:N}))},[t,b,x,s,h]);return c.useMemo(()=>!a||t===void 0?null:{about:{role:d.role,status:p},actions:{onMessage:w,...n?{onViewProfile:n}:{},...r&&h?{session:{label:`Session in ${h}`,onOpen:()=>void M()}}:{}}},[a,t,d.role,p,w,n,r,h,M])}function ys({identity:e,agentPath:t,onViewProfile:s,openOnClick:n=!1,children:o}){const[a,r]=c.useState(!1),i=xs({agentPath:t,displayName:e.displayName,onViewProfile:s,engaged:a}),d=c.useCallback(p=>{p&&r(!0)},[]);return l.jsx(ye,{identity:e,onViewProfile:s,onOpenChange:d,openOnClick:n&&i!==null,...i?{about:i.about,actions:i.actions}:{},children:o})}function bs(e){return l.jsx(Gt,{code:e.code,isIncomplete:e.isIncomplete})}const vs=[{language:Vt,component:bs}],ks={turn_failed:{Icon:Gn,warm:!0},agent_busy:{Icon:Vn},agent_gone:{Icon:cs,warm:!0},agent_left:{Icon:Ee,warm:!0},room_archived:{Icon:qn},agent_reseated:{Icon:Kn},handle_changed:{Icon:nn},files_set_up:{Icon:zn},handoff_shared:{Icon:Wn},handoff_declined:{Icon:Oe},runtime_gone:{Icon:as,warm:!0},agent_paused:{Icon:Hn},agent_declined:{Icon:Oe},agent_unavailable:{Icon:Un},awaiting_approval:{Icon:ts,warm:!0},halted:{Icon:Bn},budget_reached:{Icon:Fn},cascade_stopped:{Icon:Ln},addressing_changed:{Icon:os},bridge_blocked:{Icon:es,warm:!0},bridge_undelivered:{Icon:Pn,warm:!0},bridge_rate_limited:{Icon:is},bridge_second_agent_refused:{Icon:Ee},bridge_disconnected:{Icon:ss},bridge_agent_swapped:{Icon:zt},bridge_history_note:{Icon:Zt}},ws={Icon:Jn};function un(e){return(e&&ks[e])??ws}function ma(e){return un(e).warm===!0}const le=80;function Is(e){const t=e.trim();if(t.length<=le)return t;const s=t.slice(0,le),n=s.lastIndexOf(" ");return`${(n>le/2?s.slice(0,n):s).trimEnd()}…`}function Ns(e,t,s){const n=Cs(e,s),o=a=>l.jsx("a",{href:t.href,onClick:t.onOpen,"data-testid":"room-notice-session-link",className:"focus-ring hover:text-foreground rounded py-2 font-medium underline underline-offset-3",children:a});return n===null?l.jsxs(l.Fragment,{children:[e," ",o("Open chat")]}):l.jsxs(l.Fragment,{children:[e.slice(0,n.index),o(n.words),e.slice(n.index+n.words.length)]})}function Cs(e,t){if(t!==void 0){const n=Yn(t),o=e.lastIndexOf(n);if(o!==-1)return{index:o,words:n}}const s=Qn.exec(e);return s===null?null:{index:s.index,words:s[0]}}function Rs({entry:e,feedPosition:t,rowId:s,sessionLink:n,subjectName:o}){const{Icon:a,warm:r}=un(e.body.notice);return l.jsxs("p",{id:s,"data-slot":"notice-row","data-testid":"room-notice","data-notice":e.body.notice??"unknown",...t&&{role:"article","aria-label":Is(e.body.text)},...xe(t),className:z("focus-ring-inset flex items-start gap-[var(--msg-gap)] px-[var(--msg-padding-x)] py-1.5 text-xs",r?"text-foreground":"text-muted-foreground"),children:[l.jsx("span",{"data-slot":"notice-mark",className:"flex w-[var(--msg-gutter-width)] shrink-0 justify-center",children:l.jsx(a,{"aria-hidden":!0,className:z("mt-0.5 size-(--size-icon-xs) shrink-0",r?"text-status-warning-fg":"text-muted-foreground")})}),l.jsx("span",{className:"min-w-0",children:n?Ns(e.body.text,n,o):e.body.text})]})}const As=ns.moment;function Ss({entry:e,moment:t,subject:s,subjectIdentity:n,feedPosition:o,rowId:a}){const r=en(e.createdAt);return l.jsx("div",{id:a,"data-slot":"moment-row","data-testid":"room-moment","data-moment":t.kind,role:"article","aria-label":`Moment: ${e.body.text}`,...xe(o),className:"focus-ring-inset px-[var(--msg-padding-x)] py-1",children:l.jsxs("div",{className:"bg-foreground/4 flex items-center gap-2.5 rounded-lg px-3 py-2",children:[l.jsx(ye,{identity:{kind:s.kind,displayName:s.displayName,handle:n==null?void 0:n.handle,color:s.color,emoji:s.emoji,imageUrl:s.imageUrl,origin:n==null?void 0:n.origin,agent:n==null?void 0:n.agent},children:l.jsxs("span",{"data-testid":"room-moment-identity",className:"flex shrink-0 items-center",children:[l.jsx(Et,{author:s}),l.jsx("span",{className:"sr-only",children:s.displayName})]})}),l.jsx(As,{"data-testid":"room-moment-mark","aria-hidden":!0,className:"text-muted-foreground size-(--size-icon-xs) shrink-0"}),l.jsx("p",{className:"min-w-0 flex-1 text-sm",children:e.body.text}),r.length>0&&l.jsx("time",{dateTime:e.createdAt,title:Tt(e.createdAt),className:"text-msg-timestamp shrink-0 text-xs",children:r})]})})}function Ms(e,t){const s=Q.getState(),n=s.drafts[e]??"",o=n===""||n.endsWith(" ")||n.endsWith(`
|
|
43
|
+
`)?"":" ";s.set(e,`${n}${o}@${t} `)}function js({roomId:e,entry:t,author:s,viewerAuthorId:n,onViewProfile:o}){const a=gs(t),r=t.body.text,i=(s==null?void 0:s.id)===n?void 0:(s==null?void 0:s.handle)??void 0,d=s==null?void 0:s.displayName,{copy:p}=Xn({toastOnSettle:!0});return c.useMemo(()=>{const m={reply:{id:"reply",label:"Reply in thread",icon:rs,run:()=>{et.getState().openThread(e,a,!0),Re.getState().requestFocus(Ke(e,a))}},copy:{id:"copy",label:"Copy text",icon:Zn,run:()=>void p(r)}};return o!==void 0&&(m.profile={id:"profile",label:"View profile",icon:nt,run:o}),i!==void 0&&(m.mention={id:"mention",label:d===void 0?"Mention author":`Mention ${d}`,icon:nn,run:()=>{Ms(e,i),Re.getState().requestFocus(e)}}),$t.map(x=>m[x]).filter(x=>x!==void 0)},[e,a,r,i,d,o,p])}function _s(e){if(e.kind==="notice")return{kind:"notice"};const t=e.body.moment;return t?{kind:"moment",moment:t}:{kind:"message"}}function fa(e,t=[]){return new Map([...t.map(s=>[s.author.id,{...s.author,origin:s.origin}]),...e.map(s=>[s.author.id,{...s.author,origin:s.origin}])])}function pa(e,t){const s=e.body.subjectAuthorId;return s===void 0||t.has(e.authorId)?e.authorId:s}function Os(e,t,s){const n=t.get(e),o=qe({record:{kind:(n==null?void 0:n.kind)??"system",id:e,displayName:(n==null?void 0:n.displayName)??"Unknown",emoji:n==null?void 0:n.emoji,color:n==null?void 0:n.color,imageUrl:n==null?void 0:n.imageUrl},override:(n==null?void 0:n.agentRef)===void 0?null:s==null?void 0:s.get(n.agentRef)});return{kind:o.kind,id:e,displayName:(n==null?void 0:n.displayName)??"Unknown",emoji:o.emoji,imageUrl:o.imageUrl,color:o.color,isExternal:typeof(n==null?void 0:n.origin)=="object"&&(n==null?void 0:n.origin)!==null,...(n==null?void 0:n.retired)===!0?{retired:!0}:{}}}function ga(e){const t=new Set;for(const a of e)K(a)===null&&t.add(a.id);const s=[],n=new Map,o=new Set;for(const a of e){const r=K(a);if(r===null){s.push(a);continue}if(!t.has(r)){s.push(a),o.add(a.id);continue}const i=n.get(r);i?i.push(a):n.set(r,[a])}return{topLevel:s,repliesByRoot:n,orphaned:o}}function Es(e){return`thread-${e}`}function Ts(e){return`thread-row-${e}`}function ha(e){return`thread-panel-entry-${e}`}function $s(e){return`room-entry-${e}`}function Ds(e,t){const s=e.find(i=>i.id===t);if(s===void 0)return null;const n=K(s)??null,o={rowId:t,domId:$s(t)};if(n===null)return o;const a=e.find(i=>i.id===n);return a!==void 0&&(K(a)??null)===null?{rowId:Es(n),domId:Ts(n)}:o}function xa(e,t){if(t===null)return null;const s=e.find(n=>n.seq===t);return s===void 0?null:Ds(e,s.id)}const Te=48;function ya(e,t,s){const n=e.body.answersEntryId;if(n===void 0||n===e.id||t!==void 0&&t.id===n)return null;const o=s(n);if(o===void 0)return null;const a=o.body.text.replace(/\s+/gu," ").trim();return a.length===0?null:{entryId:n,excerpt:a.length>Te?`${a.slice(0,Te).trimEnd()}…`:a}}function Ps(e,t){const s=new Map;for(const n of e){const o=t[n.projectPath];if(!o)continue;const a=tt({runtime:o.runtime,model:o.model});s.set(ge(n.projectPath),{memberId:n.id,visual:st(o),runtime:a.label,...a.modelLabel!==null&&{model:a.modelLabel}})}return s}function Ls(e){const t=new Map;for(const[s,n]of e)t.set(s,n.visual);return t}const Fs={info:new Map,faces:new Map},be=c.createContext(Fs);function ba({known:e,children:t}){return l.jsx(be.Provider,{value:e,children:t})}function va(){const e=he(),t=c.useMemo(()=>{var r;return((r=e.data)==null?void 0:r.agents)??[]},[e.data]),s=c.useMemo(()=>t.map(r=>r.projectPath),[t]),n=Ve(s),o=c.useMemo(()=>Ps(t,n.data??{}),[t,n.data]),a=c.useMemo(()=>Ls(o),[o]);return c.useMemo(()=>({info:o,faces:a}),[o,a])}function ee(e){const t=c.useContext(be);return e===void 0?void 0:t.info.get(e)}function Bs(){return c.useContext(be).faces}const $e={people:"People",agents:"Agents"},Us=["people","agents"];function Hs(e,t){const s=[];for(const{author:n}of e){if(n.kind==="system"||n.id===t||n.retired)continue;const o=n.handle;s.push({section:n.kind==="agent"?"agents":"people",authorId:n.id,label:n.displayName,...o?{handle:o}:{},...n.emoji?{emoji:n.emoji}:{},...n.color?{color:n.color}:{},disabled:!o,...o?{}:{disabledReason:"No @name"}})}return s}function Ws(e,t,s){const n=t.trim().toLowerCase(),o=e.map((a,r)=>({row:a,position:r,tier:zs(a,n)})).filter(a=>a.tier!==null).sort((a,r)=>a.tier-r.tier||a.position-r.position);return s.flatMap(a=>o.filter(r=>r.row.section===a).map(({row:r})=>r))}function zs(e,t){var o;if(t==="")return 0;const s=[(o=e.handle)==null?void 0:o.toLowerCase(),e.label.toLowerCase()].filter(a=>a!==void 0);let n=null;for(const a of s){const r=a===t?0:a.startsWith(t)?1:a.includes(t)?2:null;r!==null&&(n===null||r<n)&&(n=r)}return n}function J(e,t,s){var a;const n=e.length;if(n===0)return 0;let o=(t%n+n)%n;for(let r=0;r<n;r++){if(!((a=e[o])!=null&&a.disabled))return o;o=(o+s+n)%n}return 0}function Ks(e,t,s,n){const o=e.slice(0,t),a=e.slice(t+1+s.length),r=`@${n}`,i=a.startsWith(" ")?"":" ";return{value:o+r+i+a,cursorPos:o.length+r.length+1}}const qs=/(^|\s)@([A-Za-z0-9_.-]*)$/,mn="mention-palette-listbox";function me(e){return`mention-item-${e}`}function Vs({members:e,viewerAuthorId:t,text:s,sectionOrder:n=Us}){var O;const[o,a]=c.useState(!1),[r,i]=c.useState(""),[d,p]=c.useState(-1),m=ot(s),x=c.useRef(!1),b=c.useMemo(()=>Hs(e,t),[e,t]),f=c.useMemo(()=>o?Ws(b,r,n):[],[b,r,o,n]),[u,g]=c.useState(null),I=u!==null&&u.query===r&&u.open===o?u.index:J(f,0,1),h=f[I],y=f.length===0||h!==void 0&&!h.disabled?I:J(f,0,1),w=c.useCallback((k,T)=>{const $=k.slice(0,T).match(qs);if(!$){a(!1);return}a(!0),i($[2]),p(($.index??0)+$[1].length)},[]),M=c.useCallback(k=>{m.write(k),x.current=!1},[m]),S=c.useCallback(k=>{x.current||w(m.read(),k)},[w,m]),R=c.useCallback(()=>{g({query:r,open:o,index:J(f,y+1,1)})},[f,y,r,o]),N=c.useCallback(()=>{g({query:r,open:o,index:J(f,y-1,-1)})},[f,y,r,o]),A=c.useCallback(k=>k.disabled||k.handle===void 0?null:(x.current=!0,a(!1),Ks(m.read(),d,r,k.handle)),[d,r,m]),_=c.useCallback(()=>{const k=f[y];return k?A(k):(a(!1),null)},[f,y,A]),j=c.useCallback(()=>{x.current=!0,a(!1)},[]),v=f.some(k=>!k.disabled);return{isOpen:o,hasSelectableRows:v,rows:f,selectedIndex:y,activeDescendantId:o&&((O=f[y])==null?void 0:O.disabled)===!1?me(y):void 0,listboxId:o?mn:void 0,noteTextChange:M,handleCursorChange:S,moveDown:R,moveUp:N,selectHighlighted:_,selectRow:A,dismiss:j}}function Gs({rows:e,selectedIndex:t,onSelect:s}){const n=c.useMemo(()=>{const o=[];return e.forEach((a,r)=>{const i=o[o.length-1];i&&i.section===a.section?i.items.push({row:a,index:r}):o.push({section:a.section,items:[{row:a,index:r}]})}),o},[e]);return c.useEffect(()=>{var o;(o=document.getElementById(me(t)))==null||o.scrollIntoView({block:"nearest"})},[t]),l.jsx(Ge.div,{initial:{opacity:0,scale:.98,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:4},transition:{duration:.15,ease:[0,0,.2,1]},className:"bg-popover max-h-80 overflow-hidden rounded-lg border shadow-lg",onMouseDown:o=>o.preventDefault(),children:l.jsx("div",{id:mn,role:"listbox","aria-label":"Mentions",className:"max-h-72 overflow-y-auto p-1.5",children:e.length===0?l.jsx("div",{className:"text-muted-foreground px-2 py-4 text-center text-sm",children:"No one by that name."}):n.map(({section:o,items:a},r)=>l.jsxs("div",{role:"group","aria-label":$e[o],children:[r>0&&l.jsx("div",{className:"bg-border mx-2 my-1.5 h-px"}),l.jsx("div",{"aria-hidden":!0,className:"text-muted-foreground/70 text-2xs px-2 pt-1.5 pb-1 font-medium tracking-wide uppercase",children:$e[o]}),a.map(({row:i,index:d})=>{const p=d===t;return l.jsxs("div",{id:me(d),role:"option","aria-selected":p,"aria-disabled":i.disabled,"data-selected":p,"data-disabled":i.disabled,onClick:()=>{i.disabled||s(i)},className:i.disabled?"flex cursor-not-allowed items-center gap-2 rounded-md px-2 py-1.5 opacity-45":"data-[selected=true]:bg-accent hover:bg-muted flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 transition-colors duration-100",children:[l.jsx("span",{"aria-hidden":!0,className:"size-4 shrink-0 text-center text-sm leading-none",children:i.emoji}),l.jsx("span",{className:"text-foreground truncate text-sm font-medium",children:i.label}),i.handle!==void 0&&l.jsxs("span",{className:"text-muted-foreground/70 truncate font-mono text-xs",children:["@",i.handle]}),i.disabledReason!==void 0&&l.jsx("span",{className:"text-muted-foreground/70 text-2xs ml-auto shrink-0",children:i.disabledReason})]},i.authorId)})]},o))})})}const Js=/(?:^|[^A-Za-z0-9_.@-])cc(?![A-Za-z0-9_])/i;function Ys(e,t){const s=e.lastIndexOf(`
|
|
44
|
+
`,t-1)+1;return Js.test(e.slice(s,t))}function Qs(e,t){const s=[...t].sort((a,r)=>a.offset-r.offset),n=s.map(a=>Ys(e,a.offset)),o=new Set(s.filter((a,r)=>!n[r]).map(a=>a.authorId));return s.map((a,r)=>n[r]&&!o.has(a.authorId)?{...a,cc:!0}:a)}function Xs(e,t){const s=e.length>0?`Woke ${e.join(", ")}.`:"Woke nobody.";return t.length>0?`${s} Cc: ${t.join(", ")}.`:s}function fn(e){const t=new Set(e.filter(n=>!n.cc).map(n=>n.authorId)),s=[];for(const n of e)n.cc&&!t.has(n.authorId)&&!s.includes(n.authorId)&&s.push(n.authorId);return s}const Zs=/@([A-Za-z0-9][A-Za-z0-9_.-]*)/g,eo=/[.\-_]+$/;function no(e,t){const s=new Map;for(const{author:o}of t)o.handle&&s.set(o.handle.toLowerCase(),o.handle);const n=[];for(const o of e.matchAll(Zs)){if(o.index===void 0)continue;const a=o[1].toLowerCase(),r=a.replace(eo,""),i=s.get(a)??s.get(r);if(!i)continue;const d=(s.has(a)?a.length:r.length)+1;n.push({offset:o.index,length:d,authorId:i,handle:i})}return n}function to(e,t){const s=Qs(e,no(e,t)),n=[],o=[];for(const r of s){const i=r.cc?o:n;i.includes(r.handle)||i.push(r.handle)}if(o.length===0)return null;const a=r=>r.map(i=>`@${i}`).join(", ");return`${n.length>0?`Wakes ${a(n)}`:"Wakes nobody"} · cc ${a(o)}`}function so(e,t){const s=e.mentions.filter(r=>r!==e.authorId);if(s.length===0)return null;const n=new Set(fn(e.mentionSpans??[])),o=r=>{var i,d;return`@${((i=t.get(r))==null?void 0:i.handle)??((d=t.get(r))==null?void 0:d.displayName)??r}`},a=s.filter(r=>{var i;return!n.has(r)&&((i=t.get(r))==null?void 0:i.kind)==="agent"});return Xs(a.map(o),s.filter(r=>n.has(r)).map(o))}function oo({showAuthorHeader:e,headerId:t,displayName:s,time:n,summary:o,contentId:a,summaryId:r,feedPosition:i}){return{...e?{"aria-labelledby":t}:{"aria-label":n.length>0?`${s}, ${n}`:s},"aria-describedby":o===null?a:r,...xe(i)}}const X=120,ao="code block";function ro(e){if(e.length<=X&&!e.includes("```"))return null;const t=io(e);return t.length===0?null:t}function io(e){const t=e.replace(/```[\s\S]*?(?:```|$)/g,` ${ao} `).replace(/`([^`]*)`/g,"$1").replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^\s{0,3}(?:#{1,6}\s+|>\s?|[-*+]\s+)/gm,"").replace(/^\s{0,3}\|?[\s:|-]*\|[\s:|-]*$/gm," ").replace(/\|/g," ").replace(/[*_~]{1,3}/g,"").replace(/\s+/g," ").trim();if(t.length<=X)return t;const s=co(t,X),n=s.lastIndexOf(" ");return`${(n>X/2?s.slice(0,n):s).trimEnd()}…`}function co(e,t){if(typeof Intl.Segmenter=="function"){const n=new Intl.Segmenter(void 0,{granularity:"grapheme"});let o="";for(const{segment:a}of n.segment(e)){if(o.length+a.length>t)break;o+=a}return o}let s="";for(const n of e){if(s.length+n.length>t)break;s+=n}return s}function lo({roomId:e,entry:t,viewerAuthorId:s,reactionFrequents:n,streamStalled:o,isMember:a=!0}){const r=ps(),i=o===!0||!a,d=c.useMemo(()=>t.reactions??[],[t.reactions]),p=c.useMemo(()=>d.filter(b=>Dt(b,s)).map(b=>b.emoji),[d,s]),m=c.useCallback(b=>r.mutate({roomId:e,entryId:t.id,emoji:b,viewerAuthorId:s}),[r,e,t.id,s]),x=c.useMemo(()=>({quick:n,mine:p,onToggle:m,disabled:i}),[n,p,m,i]);return{reactions:d,toggle:m,quickRow:x}}function uo({barRef:e,pillsRef:t,hasReactions:s}){return n=>{var a,r;if(n.target!==n.currentTarget)return;const{key:o}=n;if(o==="ArrowDown"&&s){n.preventDefault(),(a=t.current)==null||a.focusFirst();return}o!=="ArrowRight"&&o!=="Enter"||(n.preventDefault(),(r=e.current)==null||r.focusFirst())}}function mo(e,t){var x,b;const s=t.body.subjectAuthorId,n=t.body.notice,o=t.kind==="notice"&&n!==void 0&&s!==void 0&&at.includes(n),a=Kt(e,{enabled:o}),r=Je(),i=Be(),d=fe(),p=o?((b=(x=a.data)==null?void 0:x.bindings.find(f=>f.authorId===s))==null?void 0:b.sessionId)??null:null,m=c.useCallback(f=>{f.button!==0||f.metaKey||f.ctrlKey||f.shiftKey||f.altKey||(f.preventDefault(),!(p===null||s===void 0)&&rt({queryClient:i,transport:d},e,s).then(u=>{u.kind!=="none"&&r(pe({session:u.kind==="bound"?u.sessionId:p}))}))},[s,r,i,e,p,d]);return c.useMemo(()=>p===null?null:{href:it({session:p}),onOpen:m},[m,p])}const ne="mention",ve="author_id",fo={[ne]:[ve]},po=[ne];function go(e,t){if(!t||t.length===0)return e;const s=ho(e,t);if(s.length===0)return e;let n=e;for(let o=s.length-1;o>=0;o--){const{offset:a,length:r,authorId:i}=s[o],d=n.slice(0,a),p=n.slice(a,a+r),m=n.slice(a+r);n=`${d}<${ne} ${ve}="${i}">${p}</${ne}>${m}`}return n}function ho(e,t){const s=[...t].sort((a,r)=>a.offset-r.offset),n=[];let o=0;for(const a of s)a.offset<o||a.offset+a.length>e.length||(n.push(a),o=a.offset+a.length);return n}const xo=/(?:^|[^\p{L}\p{N}_])cc$/iu;function yo(e,t){const s=new Set;for(const n of t)n.cc&&xo.test(e.slice(0,n.offset).trimEnd())&&s.add(n.authorId);return s}const bo=new Map,pn=c.createContext(bo);function vo({authors:e,children:t}){return l.jsx(pn.Provider,{value:e,children:t})}function ko(e){const t=c.useContext(pn);return e===void 0?void 0:t.get(e)}const De=new WeakMap;function wo(e){const t=De.get(e);if(t)return t;const s=new Map(e.map(n=>[ge(n.projectPath),n.projectPath]));return De.set(e,s),s}function Io(e){var n;const s=(n=he().data)==null?void 0:n.agents;return c.useMemo(()=>e===void 0||!s?void 0:wo(s).get(e),[s,e])}function gn(e){const{agentRef:t,identity:s,onViewProfile:n}=e,o=He(),a=Io(o?t:void 0),r=ee(t);return c.useMemo(()=>{if(!o||s.kind!=="agent"||a===void 0)return null;const i={...s,agent:r&&{runtime:r.runtime,...r.model&&{model:r.model}}},d=(p,m={})=>l.jsx(ys,{identity:i,agentPath:a,onViewProfile:n,openOnClick:m.openOnClick??!1,children:p});return{wrap:d,wrapAvatar:p=>d(l.jsx("button",{type:"button",tabIndex:-1,"aria-label":s.displayName,"aria-haspopup":"dialog",className:"focus-ring inline-flex cursor-pointer rounded-sm","data-slot":"room-agent-card-face",children:p}),{openOnClick:!0}),wrapName:p=>d(l.jsx("button",{type:"button","aria-haspopup":"dialog",className:z(p.props.className,"focus-ring cursor-pointer rounded-sm text-left underline-offset-4 hover:underline"),"data-slot":"room-agent-card-name",children:s.displayName}),{openOnClick:!0})}},[o,s,a,r,n])}const No={kind:"human",displayName:""};function Co(e){return typeof e=="string"?e.replace(/^@/,""):""}function Ro({authorId:e,children:t,cc:s,ccWord:n}){const o=ko(e),a=ee(o==null?void 0:o.agentRef),{open:r}=Ye(),i=o?qe({record:o,override:a==null?void 0:a.visual}):null,d=o?Qe(o,a==null?void 0:a.memberId):void 0,p=c.useMemo(()=>d===void 0?void 0:()=>r(d),[d,r]),m=i==null?void 0:i.color,x=i==null?void 0:i.emoji,b=i==null?void 0:i.imageUrl,f=c.useMemo(()=>o?{kind:o.kind,displayName:o.displayName,handle:o.handle??void 0,color:m,emoji:x,imageUrl:b,origin:o.origin,agent:a&&{runtime:a.runtime,...a.model&&{model:a.model}}}:null,[o,m,x,b,a]),u=gn({agentRef:o==null?void 0:o.agentRef,identity:f??No,onViewProfile:p});if(!o||!f)return l.jsx(_e,{kind:"human",label:Co(t),resolved:!1});const I=u?{role:"button",tabIndex:0,"aria-haspopup":"dialog"}:p?{role:"button",tabIndex:0,"aria-label":`View ${o.displayName}’s profile`,onClick:p,onKeyDown:y=>{y.key!=="Enter"&&y.key!==" "||(y.preventDefault(),p())}}:{},h=l.jsx(_e,{kind:o.kind,label:o.displayName,handle:o.handle??void 0,color:o.color,origin:o.origin,resolved:!0,interactive:p!==void 0,...I,cc:s,ccWord:n});return u?u.wrap(h,{openOnClick:!0}):l.jsx(ye,{onViewProfile:p,identity:f,children:h})}function Ao(e,t=new Set,s=new Set){return{mention:n=>{const o=n[ve],a=typeof o=="string"?o:void 0;return!a||!e.has(a)?l.jsx(l.Fragment,{children:n.children}):l.jsx(Ro,{authorId:a,cc:t.has(a),ccWord:!s.has(a),children:n.children})}}}function So({entry:e,authors:t}){const s=c.useMemo(()=>go(e.body.text,e.mentionSpans),[e.body.text,e.mentionSpans]),n=c.useMemo(()=>{var i;return new Set(((i=e.mentionSpans)==null?void 0:i.map(d=>d.authorId))??[])},[e.mentionSpans]),o=c.useMemo(()=>new Set(fn(e.mentionSpans??[])),[e.mentionSpans]),a=c.useMemo(()=>yo(e.body.text,e.mentionSpans??[]),[e.body.text,e.mentionSpans]),r=c.useMemo(()=>Ao(n,o,a),[n,o,a]);return l.jsx(vo,{authors:t,children:l.jsx(qt,{content:s,className:"msg-prose",allowedTags:fo,literalTagContent:po,components:r,renderers:vs})})}function Mo(e){return function(s){return l.jsx(So,{entry:s,authors:e})}}const hn="the top folder";function Pe(e){return e.slice(e.lastIndexOf("/")+1)}function jo(e){const t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function _o(e){return e===""?hn:`${e}/`}function de(e){return e.target!==void 0?e.target===""?hn:e.target:_o(jo(e.paths[0]??""))}function Oo(e,t){const s=e.paths[0]??"",n=e.target;switch(e.kind){case"edit":return`${t} edited ${n??s}`;case"add":return`${t} added ${n??s}`;case"upload":return e.pathCount===1?`${t} uploaded ${Pe(s)} to ${de(e)}`:`${t} uploaded ${e.pathCount} files to ${de(e)}`;case"rename":{const o=e.from??"";return n!==void 0?`${t} renamed ${o} to ${n}`:o.endsWith("/")?`${t} renamed ${o}`:`${t} renamed ${o} to ${s}`}case"delete":return n!==void 0?`${t} deleted ${n}`:e.pathCount===1?`${t} deleted ${s}`:`${t} deleted ${e.pathCount} files`;case"from-attachment":return`${t} saved ${Pe(s)} from the chat to ${de(e)}`}}const Eo=c.lazy(()=>ct(()=>import("./index-Dt4H9Tms.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.SaveToRoomFilesButton})));function ka({roomId:e,entry:t,author:s,authorRef:n,authors:o,viewerAuthorId:a,authorNames:r,reactionFrequents:i,streamStalled:d,isMember:p=!0,grouping:m,orphanedReply:x,answers:b,feedPosition:f,rowId:u,roomKind:g,headsThread:I=!1}){const h=en(t.createdAt),y=c.useMemo(()=>{const F=ro(t.body.text),ie=Pt(t.attachments??[]);if(ie===null)return F;const Ce=F??t.body.text.trim();return Ce.length>0?`${Ce} ${ie}`:ie},[t.body.text,t.attachments]),w=c.useId(),M=`${w}-author`,S=`${w}-content`,R=`${w}-summary`,N=c.useRef(null),A=c.useRef(null),_=c.useRef(null),{reactions:j,toggle:v,quickRow:O}=lo({roomId:e,entry:t,viewerAuthorId:a,reactionFrequents:i,streamStalled:d,isMember:p}),k=ee(n==null?void 0:n.agentRef),{open:T}=Ye(),$=n===void 0?void 0:Qe(n,k==null?void 0:k.memberId),se=c.useCallback(()=>{$!==void 0&&T($)},[T,$]),U=$===void 0?void 0:se,B=js({roomId:e,entry:t,author:n,viewerAuthorId:a,onViewProfile:U}),q=(n==null?void 0:n.handle)??void 0,C=c.useMemo(()=>({kind:s.kind,displayName:s.displayName,handle:q,color:s.color,emoji:s.emoji,imageUrl:s.imageUrl}),[s.kind,s.displayName,q,s.color,s.emoji,s.imageUrl]),D=gn({agentRef:n==null?void 0:n.agentRef,identity:C,onViewProfile:U}),oe=uo({barRef:A,pillsRef:_,hasReactions:j.length>0}),we=c.useCallback(()=>{var F;return(F=N.current)==null?void 0:F.focus()},[]),kn=c.useMemo(()=>Mo(o),[o]),Ie=c.useMemo(()=>g==="channel"&&t.authorId===a?so(t,o):null,[g,t,a,o]),wn=c.useCallback(F=>l.jsx(c.Suspense,{fallback:null,children:l.jsx(Eo,{roomId:e,attachment:F})}),[e]),In=Bs(),ae=t.body.subjectAuthorId??t.authorId,E=o.get(ae),V=ee(E==null?void 0:E.agentRef),Nn=mo(e,t),re=_s(t);if(re.kind==="notice")return l.jsx(Rs,{entry:t,feedPosition:f,rowId:u,sessionLink:Nn,subjectName:E==null?void 0:E.displayName});if(re.kind==="moment")return l.jsx(Ss,{entry:t,moment:re.moment,subject:ae===t.authorId?s:Os(ae,o,In),subjectIdentity:{handle:(E==null?void 0:E.handle)??void 0,origin:E==null?void 0:E.origin,agent:V&&{runtime:V.runtime,...V.model&&{model:V.model}}},feedPosition:f,rowId:u});const Cn=m.position==="first"||m.position==="only",Ne=t.authorId===a;return l.jsxs(P.Root,{ref:N,id:u,position:m.position,className:I?"pb-0":void 0,actions:B,reactions:O,"data-testid":"room-entry",tabIndex:0,...oo({showAuthorHeader:Cn,headerId:M,displayName:s.displayName,time:h,summary:y,contentId:S,summaryId:R,feedPosition:f}),onKeyDown:oe,children:[l.jsx(P.Gutter,{author:s,at:t.createdAt,onViewProfile:D?void 0:U,isSelf:Ne,renderAvatar:D==null?void 0:D.wrapAvatar}),l.jsxs(P.Body,{children:[l.jsx(P.Author,{id:M,author:s,at:t.createdAt,origin:n==null?void 0:n.origin,isSelf:Ne,renderName:D==null?void 0:D.wrapName}),x===!0&&l.jsx("p",{"data-testid":"room-entry-orphan",className:"text-muted-foreground text-xs",children:"Replying to an earlier message"}),b!=null&&l.jsx("p",{"data-testid":"room-entry-answers",className:"text-muted-foreground mb-1 truncate text-xs",children:`Answering “${b.excerpt}”`}),t.body.via&&l.jsx(Lt,{via:t.body.via}),l.jsx(P.Content,{id:S,className:"wrap-anywhere [&_pre]:overflow-x-auto [&_pre]:wrap-normal",children:t.body.fileChange?l.jsx("p",{"data-testid":"room-entry-file-change",className:"wrap-anywhere",children:Oo(t.body.fileChange,(E==null?void 0:E.displayName)??"Somebody")}):kn(t,{rowId:t.id,isStreaming:!1})}),Ie!==null&&l.jsx("p",{"data-testid":"room-entry-reach",className:"text-muted-foreground text-xs",children:Ie}),y!==null&&l.jsx("span",{id:R,className:"hidden",children:y}),l.jsx(P.Attachments,{items:t.attachments??[],renderAction:p?wn:void 0}),l.jsx(P.Reactions,{ref:_,reactions:j,viewerAuthorId:a,names:r,frequents:i,onToggle:v,disabled:d===!0||!p,onExit:we}),l.jsx(P.Actions,{actions:B,reactions:O,barRef:A,onExit:we})]})]})}const wa={reactions:!0,threads:!0,runWith:!1,attachments:!0,mentions:!0,streamHealth:!0,presence:!0,turnStatus:!1,asks:!0};function To(e){const t=fe(),[s,n]=c.useState([]),o=c.useRef(new Map),a=c.useCallback(f=>{const u=f.map(g=>({id:crypto.randomUUID(),file:g,status:"pending",progress:0}));n(g=>[...g,...u])},[]),r=c.useCallback(f=>{o.current.delete(f),n(u=>u.filter(g=>g.id!==f))},[]),i=c.useCallback(f=>{if(!f){o.current.clear(),n([]);return}const u=new Set(f);for(const g of u)o.current.delete(g);n(g=>g.filter(I=>!u.has(I.id)))},[]),d=c.useCallback(f=>{o.current.delete(f),n(u=>u.map(g=>g.id===f&&g.status==="error"?{...g,status:"pending",progress:0,error:void 0}:g))},[]),p=c.useRef(null),m=Ue({meta:{suppressErrorToast:!0},mutationFn:async f=>{n(h=>h.map(y=>f.some(w=>w.id===y.id)?{...y,status:"uploading"}:y));const u=h=>{n(y=>y.map(w=>w.status==="uploading"?{...w,progress:h.percentage}:w))},g=new AbortController;p.current=g;const I=f.map(h=>h.file);return t.uploadRoomAttachments(e,I,u,g.signal)},onSettled:()=>{p.current=null},onSuccess:(f,u)=>{u.forEach((g,I)=>{const h=f[I];h&&o.current.set(g.id,h.id)}),n(g=>g.map(I=>u.findIndex(y=>y.id===I.id)===-1?I:{...I,status:"uploaded",progress:100}))},onError:f=>{n(u=>u.map(g=>g.status==="uploading"?{...g,status:"error",error:f.message}:g))}}),x=c.useCallback(()=>{var f;(f=p.current)==null||f.abort()},[]),b=c.useCallback(async()=>{const f=s.filter(g=>g.status==="error");if(f.length>0)throw new Error(f.length===1?`${f[0].file.name} didn’t upload. Try again or remove it.`:`${f.length} files didn’t upload. Try again or remove them.`);const u=s.filter(g=>g.status==="pending");return u.length>0&&await m.mutateAsync(u),s.map(g=>o.current.get(g.id)).filter(g=>g!==void 0)},[s,m]);return{pendingFiles:s,addFiles:a,removeFile:r,retryFile:d,clearFiles:i,cancelUpload:x,uploadAndGetIds:b,hasPendingFiles:s.length>0,hasFailedUpload:s.some(f=>f.status==="error"),isUploading:m.isPending}}function Ia(e){const{room:t,threadRootId:s}=e,n=Ft(),o=Bt(),a=To((t==null?void 0:t.id)??""),r=t!==void 0&&Xe(t.members,t.viewerAuthorId),i=c.useRef({attachments:a,post:n,reply:o,room:t,threadRootId:s});c.useEffect(()=>{i.current={attachments:a,post:n,reply:o,room:t,threadRootId:s}});const d=c.useCallback(y=>i.current.attachments.addFiles(y),[]),p=c.useCallback(y=>i.current.attachments.removeFile(y),[]),m=c.useCallback(y=>i.current.attachments.retryFile(y),[]),x=c.useCallback(()=>i.current.attachments.cancelUpload(),[]),{pendingFiles:b,hasFailedUpload:f,isUploading:u}=a,g=c.useMemo(()=>({staged:b,add:d,remove:p,retry:m,cancel:x,hasFailed:f,isUploading:u,holdsSendWhileUploading:!1}),[b,f,u,d,p,m,x]),I=c.useCallback(async y=>{const{attachments:w,post:M,reply:S,room:R,threadRootId:N}=i.current;if(R===void 0)throw new Error("That room isn’t loaded yet.");if(R.archived)throw new Error("This room is archived.");Z.getState().recordOpened("room",R.id);const A=lt(),_=w.pendingFiles.map(k=>k.file.name),j=w.pendingFiles.map(k=>k.id),v=await w.uploadAndGetIds();w.clearFiles(j);const O=y.parentEntryId??N;if(Ut({roomId:R.id,threadRootId:O??null},y.text),O!==void 0){S.mutate({roomId:R.id,rootEntryId:O,text:y.text,clientId:A,attachmentIds:v,attachmentNames:_});return}M.mutate({roomId:R.id,text:y.text,clientId:A,attachmentIds:v,attachmentNames:_})},[]);return{target:c.useMemo(()=>({kind:"room",id:(t==null?void 0:t.id)??"",placeholder:t===void 0?"Message…":s===void 0?`Message ${te(t)}…`:"Reply in this thread…",canSend:t!==void 0&&!t.archived&&r,...t===void 0?{canSendReason:"Still opening this room…"}:t.archived?{canSendReason:"This room is archived. You can read it, but not add to it."}:r?{}:{canSendReason:Ze},send:I,attachments:g}),[t,s,r,g,I]),attachments:a}}const xn=8;function yn(e){if(e==null)return null;const t=e.replace(/\s+/g," ").trim();return t.length===0?null:t}function $o(e){if(mt(e)){const s=e.unreadCount??0;return s===1?"1 new message":`${s} new messages`}const t=e.working??0;return t>0?t===1?"1 agent working":`${t} agents working`:yn(e.topic)}function Le(e){return{kind:"session",id:e.id,name:ut(e.title),summary:yn(e.lastMessagePreview),lastActivityAt:e.updatedAt,session:e}}function Do(e){return{kind:e.kind==="dm"?"dm":"channel",id:e.id,name:te(e),summary:$o(e),lastActivityAt:e.lastActivityAt,room:e}}function Y(e){if(e===void 0)return null;const t=Date.parse(e);return Number.isNaN(t)?null:t}function Po(e){return e.kind==="session"?Ae("session",e.id):Ae("room",e.id)}function Fe(e,t){const s=[Y(t[Po(e)]),...e.kind==="session"?[Y(e.session.lastTouchedByYouAt),Y(e.session.userLastMessageAt)]:[]].filter(n=>n!==null);return s.length>0?Math.max(...s):Y(e.lastActivityAt)??Number.NEGATIVE_INFINITY}function Lo(e){return(t,s)=>Fe(s,e)-Fe(t,e)||s.id.localeCompare(t.id)}function Fo(e){const t=new Set;return e.filter(s=>{const n=`${s.kind}:${s.id}`;return t.has(n)?!1:(t.add(n),!0)})}function Bo(e,t){return!(t.has(e.id)||e.unreadCount===null||e.lastActivityAt===e.createdAt)}function Uo({sessions:e,rooms:t,mutedRoomIds:s=new Set,interactions:n={},limit:o=xn}){const{yours:a,spinOffs:r,automated:i}=dt(e),d=Lo(n),p=[...a.map(Le),...t.filter(m=>Bo(m,s)).map(Do)].sort(d);return{items:Fo(p).slice(0,o),automated:[...r,...i].map(Le).sort(d).slice(0,o)}}const Ho=3,Wo=gt;function zo({limit:e=xn,mutedRoomIds:t,enabled:s=!0}={}){var p,m;const n=ft(Math.max(e*Ho,Wo),{enabled:s}),o=We({enabled:s}),a=pt(),r=(p=n.data)==null?void 0:p.sessions,i=o.data;return{...c.useMemo(()=>Uo({sessions:r??[],rooms:i??[],mutedRoomIds:t,interactions:a,limit:e}),[r,i,t,a,e]),isLoading:s&&(n.isLoading||o.isLoading),warnings:((m=n.data)==null?void 0:m.warnings)??[]}}const Ko=6,bn="jump-back-in-listbox";function ke(e){return`jump-back-in-item-${e}`}const qo='[role="combobox"]';function W(e){return e instanceof Element&&e.matches(qo)}function Vo({value:e,yieldToPalette:t=!1,enabled:s=!0}){const n=Je(),o=ht(),[a,r]=c.useState(!1),[i,d]=c.useState({stamp:"",index:0}),[p,m]=c.useState(!1),[x,b]=c.useState(!1);e.length>0&&!x&&b(!0);const f=c.useRef(!1);c.useEffect(()=>{f.current=!0},[]);const{data:u}=he({enabled:s}),g=c.useMemo(()=>((u==null?void 0:u.agents)??[]).map(C=>C.projectPath),[u]),{data:I}=Ve(g,{enabled:s}),h=c.useMemo(()=>I??{},[I]),y=c.useMemo(()=>xt(g,h),[g,h]),w=c.useMemo(()=>new Map(g.map(C=>[ge(C),C])),[g]),M=c.useCallback(C=>yt({room:C,agentsByPath:h,pathByAgentRef:w}),[h,w]),S=c.useMemo(()=>bt(o.muted),[o.muted]),{items:R}=zo({mutedRoomIds:S,enabled:s}),N=c.useMemo(()=>R.slice(0,Ko),[R]),A=s&&a&&!p&&!x&&!t&&e.length===0&&N.length>0,_=`${A}:${N.length}`,j=i.stamp===_?i.index:0,v=c.useCallback(C=>{f.current&&W(C.target)&&(m(!1),b(!1),r(!0))},[]),O=c.useCallback(C=>{W(C.target)&&r(!0)},[]),k=c.useCallback(C=>{W(C.target)&&r(!1)},[]),T=c.useCallback(C=>{N.length!==0&&d(D=>{const oe=D.stamp===_?D.index:0;return{stamp:_,index:(oe+C+N.length)%N.length}})},[N.length,_]),$=c.useCallback(()=>T(1),[T]),se=c.useCallback(()=>T(-1),[T]),U=c.useCallback(()=>{m(!0)},[]),B=c.useCallback(C=>{if(m(!0),C.kind==="session"){C.session.cwd&&Z.getState().recordOpened("agent",C.session.cwd),n(pe({dir:C.session.cwd??void 0,session:C.session.id}));return}Z.getState().recordOpened("room",C.room.id),n({...vt.channels(),search:{id:C.room.id}})},[n]),q=c.useCallback(()=>{const C=N[j];!A||!C||B(C)},[A,N,j,B]);return{isOpen:A,hasRows:N.length>0,rows:N,agents:h,displayNames:y,visualOf:M,selectedIndex:j,activeDescendantId:A&&N[j]!==void 0?ke(j):void 0,listboxId:A?bn:void 0,handleFocus:v,handleBlur:k,handlePointerDown:O,moveDown:$,moveUp:se,selectHighlighted:q,selectRow:B,dismiss:U}}function vn({mark:e,label:t,title:s,summary:n,lastActivityAt:o,index:a,isSelected:r,now:i,onSelect:d}){const p=c.useMemo(()=>Number.isNaN(Date.parse(o))?null:At(o),[o,i]);return l.jsxs("div",{id:ke(a),role:"option","aria-selected":r,"data-selected":r,title:s,onClick:d,className:"data-[selected=true]:bg-accent hover:bg-muted flex cursor-pointer items-start gap-2 rounded-md px-2 py-1.5 transition-colors duration-100",children:[l.jsx("span",{className:"mt-px flex shrink-0 items-center",children:e}),l.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[l.jsxs("span",{className:"flex w-full items-center gap-1.5",children:[l.jsx("span",{className:"text-foreground min-w-0 flex-1 truncate text-sm",children:t}),p!==null&&l.jsx("span",{className:"text-muted-foreground/60 text-3xs shrink-0",children:p})]}),n!==null&&l.jsx("span",{className:"text-muted-foreground/70 text-2xs truncate",children:n})]})]})}function Go({item:e,agent:t,displayName:s,index:n,isSelected:o,now:a,onSelect:r}){const i=wt(t,e.session.cwd??s);return l.jsx(vn,{mark:l.jsx(It,{color:i.color,emoji:i.emoji,size:"xs"}),label:e.name,title:`${s} · ${e.name}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:n,isSelected:o,now:a,onSelect:r})}function Jo({item:e,visual:t,index:s,isSelected:n,now:o,onSelect:a}){return l.jsx(vn,{mark:l.jsx(Ct,{room:e.room,participants:e.room.participants,visuals:Rt(t)}),label:l.jsx(Nt,{room:e.room}),title:e.summary===null?e.name:`${e.name} · ${e.summary}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:s,isSelected:n,now:o,onSelect:a})}function Yo({rows:e,selectedIndex:t,agents:s={},displayNames:n={},visualOf:o,onSelect:a}){const r=kt(6e4);return c.useEffect(()=>{var i,d;(d=(i=document.getElementById(ke(t)))==null?void 0:i.scrollIntoView)==null||d.call(i,{block:"nearest"})},[t]),l.jsx(Ge.div,{initial:{opacity:0,scale:.98,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:4},transition:{duration:.15,ease:[0,0,.2,1]},className:"bg-popover max-h-80 overflow-hidden rounded-lg border shadow-lg",onMouseDown:i=>i.preventDefault(),children:l.jsx("div",{id:bn,role:"listbox","aria-label":"Jump back in",className:"max-h-72 overflow-y-auto p-1.5",children:e.map((i,d)=>{var p;return i.kind==="session"?l.jsx(Go,{item:i,agent:i.session.cwd&&s[i.session.cwd]||null,displayName:i.session.cwd&&n[i.session.cwd]||((p=i.session.cwd)==null?void 0:p.split("/").pop())||"Agent",index:d,isSelected:d===t,now:r,onSelect:()=>a(i)},`session-${i.id}`):l.jsx(Jo,{item:i,visual:o(i.room),index:d,isSelected:d===t,now:r,onSelect:()=>a(i)},`room-${i.id}`)})})})}function Na({room:e,threadRootId:t,focusOnMount:s,offerJumpBackIn:n,onFocusChange:o,attachments:a}){const r=t===void 0?e.id:Ke(e.id,t),i=St(r),{target:d}=Ht(),p=Mt(),m=jt(r),x=c.useRef(null),b=Xe(e.members,e.viewerAuthorId),f=c.useRef(!1),u=Vs({members:e.members,viewerAuthorId:e.viewerAuthorId,text:i}),g=c.useMemo(()=>e.kind==="channel"?to(i,e.members):null,[e.kind,e.members,i]),I=n===!0,h=Vo({value:i,yieldToPalette:u.isOpen,enabled:I}),y=c.useRef(m);c.useEffect(()=>{var v;m!==y.current&&(y.current=m,(v=x.current)==null||v.focus())},[m]),c.useEffect(()=>{var v;s===!0&&((v=x.current)==null||v.focusUnlessTouch())},[]);const w=c.useCallback(v=>Q.getState().set(r,v),[r]),[M,S]=c.useState(null);c.useLayoutEffect(()=>{var v;M!==null&&((v=x.current)==null||v.focusAt(M.pos))},[M]);const R=c.useCallback(v=>{v&&(w(v.value),S({pos:v.cursorPos}))},[w]),N=c.useCallback(v=>R(u.selectRow(v)),[u,R]),A=c.useCallback(()=>R(u.selectHighlighted()),[u,R]),_=()=>{if(d===null||!d.canSend||f.current)return;u.dismiss();const v=Q.getState().take(r).trim();if(v==="")return;const O=a.pendingFiles.length>0;O&&(f.current=!0),d.send({text:v}).catch(()=>{const k=Q.getState(),T=k.drafts[r]??"";k.set(r,T===""?v:`${v}
|
|
45
|
+
${T}`)}).finally(()=>{O&&(f.current=!1)})};if(!b)return l.jsxs("div",{className:"flex items-center justify-between gap-3 border-t px-4 py-3",children:[l.jsx("p",{className:"text-muted-foreground text-sm",children:Ze}),l.jsx(ue,{type:"button",size:"sm",variant:"outline",disabled:p.isPending,onClick:()=>p.mutate({roomId:e.id,authorId:e.viewerAuthorId},{onSuccess:()=>ze.success(`You joined ${te(e)}`)}),children:_t})]});const j=l.jsx(Wt.Composer,{inputRef:x,value:i,onChange:v=>{w(v),u.noteTextChange(v)},onSubmit:_,footer:g?l.jsx("p",{"data-slot":"cc-line",className:"text-muted-foreground px-3 pb-2 text-xs",children:g}):void 0,head:l.jsx("span",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:u.isOpen&&u.rows.length===0?"No one by that name.":""}),mentionPicker:l.jsx(Se,{children:u.isOpen&&l.jsx(Gs,{rows:u.rows,selectedIndex:u.selectedIndex,onSelect:N})}),overlays:l.jsx(l.Fragment,{children:l.jsx(Se,{children:h.isOpen&&l.jsx(Yo,{rows:h.rows,selectedIndex:h.selectedIndex,agents:h.agents,displayNames:h.displayNames,visualOf:h.visualOf,onSelect:h.selectRow})})}),input:{onCursorChange:u.handleCursorChange,isStreaming:!1,isPaletteOpen:u.isOpen||h.isOpen,paletteHasResults:h.isOpen?h.hasRows:u.hasSelectableRows,onArrowUp:h.isOpen?h.moveUp:u.moveUp,onArrowDown:h.isOpen?h.moveDown:u.moveDown,onCommandSelect:h.isOpen?h.selectHighlighted:A,onEscape:h.isOpen?h.dismiss:u.dismiss,tabPicks:!h.isOpen,onClear:()=>{w(""),u.dismiss()},activeDescendantId:h.isOpen?h.activeDescendantId:u.activeDescendantId,paletteListboxId:h.isOpen?h.listboxId:u.listboxId,contextKey:r,...a.hasFailedUpload?{canSubmitReason:"A file didn’t upload. Try it again or remove it, then send."}:{}}});return!I&&o===void 0?j:l.jsx("section",{className:"flex flex-col","data-testid":Ot.homeComposer,onFocus:v=>{h.handleFocus(v),W(v.target)&&(o==null||o(!0))},onBlur:v=>{h.handleBlur(v),W(v.target)&&(o==null||o(!1))},onPointerDown:h.handlePointerDown,children:j})}export{ba as A,Na as C,ye as I,wa as R,fa as a,ka as b,Os as c,pa as d,va as e,ya as f,ga as g,Es as h,ma as i,hs as j,ua as k,Ts as l,$s as m,Ds as n,ha as o,xa as p,W as q,gs as r,K as t,Ia as u};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{O as m,
|
|
1
|
+
import{O as m,a5 as x,aZ as k,r as v,j as t,B as d,G as p,dL as y}from"./index-MHIn2TC9.js";import{u as O}from"./use-update-config-ZHtOtve0.js";import{I as R}from"./inline-code-B3qpjdZ2.js";/**
|
|
2
2
|
* @license lucide-react v1.48.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const g={name:"route",size:24,node:[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]};g.node;const
|
|
6
|
+
*/const g={name:"route",size:24,node:[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]};g.node;const S=m(g);function C(){const e=typeof window<"u"?window.electronAPI:void 0;if(typeof(e==null?void 0:e.restartServer)!="function"||typeof e.resetAllData!="function")return null;const{restartServer:r,resetAllData:c}=e;return{restartServer:()=>r(),resetAllData:()=>c()}}function D(e){if(!e.ok)throw new Error(e.message)}async function w(e){const r=C();r?D(await r.restartServer()):await e.restartServer()}function b(e){return e.isLoading||e.isError||e.enabled?null:e.initError?"failed":e.lockedByEnv?"env":e.enabledInConfig===!0?"restart":"off"}function I({relay:e,variant:r}){const c=x(),a=O(),h=k(i=>i.setRestartOverlayOpen),[n,u]=v.useState(!1),l=b(e);if(!l)return null;const f=async()=>{u(!0);try{await w(c),h(!0)}catch(i){y.error("Couldn’t restart DorkOS.",{description:i instanceof Error?i.message:"It may not have restarted. Try again."})}finally{u(!1)}};let s,o=null;switch(l){case"env":s=t.jsxs(t.Fragment,{children:["Chat apps are off: ",t.jsx(R,{children:"DORKOS_RELAY_ENABLED"})," overrides the setting. Remove it, then restart DorkOS."]});break;case"failed":s="Chat apps didn’t start. Restarting DorkOS tries again.",o=t.jsx(d,{size:"sm",variant:"secondary",disabled:n,onClick:()=>void f(),children:n?"Restarting…":"Restart DorkOS"});break;case"restart":s="Chat apps turn on when DorkOS restarts. Restarting stops anything running right now.",o=t.jsx(d,{size:"sm",disabled:n,onClick:()=>void f(),children:n?"Restarting…":"Restart DorkOS"});break;case"off":s="Chat apps are off. Turn them on to reach agents from Telegram, Slack or webhooks.",o=t.jsx(d,{size:"sm",disabled:a.isPending,onClick:()=>a.mutate({relay:{enabled:!0}}),children:a.isPending?"Turning on…":"Turn on chat apps"});break}return t.jsxs("div",{"data-testid":"chat-apps-off","data-reason":l,className:p(r==="line"?"flex flex-wrap items-center gap-x-3 gap-y-2":"flex flex-col items-center gap-3 p-8 text-center"),children:[r==="block"&&t.jsx(S,{className:"text-muted-foreground/50 size-8","aria-hidden":!0}),t.jsx("p",{className:p("text-muted-foreground",r==="line"?"text-xs":"text-sm"),role:"status",children:s}),o,a.isError&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Couldn’t save. Check that DorkOS is running, then try again."})]})}export{I as C,S as R,C as g,w as r,D as u};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as J,r as T}from"./index-OQuvRZTD.js";import{R as lt}from"./index-BkJlIXqM.js";import{o as Q,E as B,q as ne,C as Ge,S as G,r as Ne,u as Fe,v as st,w as H,x as M,F as Ve,R as N,W as Y,G as oe,y as ot,z as at,A as je,B as Ie,H as ft,V as dt,m as ht,n as ct}from"./index-1QfQImuJ.js";class v{constructor(e,n,l,i){this.fromA=e,this.toA=n,this.fromB=l,this.toB=i}offset(e,n=e){return new v(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function y(t,e,n,l,i,r){if(t==l)return[];let s=fe(t,e,n,l,i,r),o=de(t,e+s,n,l,i+s,r);e+=s,n-=o,i+=s,r-=o;let f=n-e,h=r-i;if(!f||!h)return[new v(e,n,i,r)];if(f>h){let d=t.slice(e,n).indexOf(l.slice(i,r));if(d>-1)return[new v(e,e+d,i,i),new v(e+d+h,n,r,r)]}else if(h>f){let d=l.slice(i,r).indexOf(t.slice(e,n));if(d>-1)return[new v(e,e,i,i+d),new v(n,n,i+d+f,r)]}if(f==1||h==1)return[new v(e,n,i,r)];let a=He(t,e,n,l,i,r);if(a){let[d,c,u]=a;return y(t,e,d,l,i,c).concat(y(t,d+u,n,l,c+u,r))}return ut(t,e,n,l,i,r)}let I=1e9,U=0,ae=!1;function ut(t,e,n,l,i,r){let s=n-e,o=r-i;if(I<1e9&&Math.min(s,o)>I*16||U>0&&Date.now()>U)return Math.min(s,o)>I*64?[new v(e,n,i,r)]:ge(t,e,n,l,i,r);let f=Math.ceil((s+o)/2);ee.reset(f),te.reset(f);let h=(u,m)=>t.charCodeAt(e+u)==l.charCodeAt(i+m),a=(u,m)=>t.charCodeAt(n-u-1)==l.charCodeAt(r-m-1),d=(s-o)%2!=0?te:null,c=d?null:ee;for(let u=0;u<f;u++){if(u>I||U>0&&!(u&63)&&Date.now()>U)return ge(t,e,n,l,i,r);let m=ee.advance(u,s,o,f,d,!1,h)||te.advance(u,s,o,f,c,!0,a);if(m)return mt(t,e,n,e+m[0],l,i,r,i+m[1])}return[new v(e,n,i,r)]}class Ue{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,n,l,i,r,s,o){for(let f=-e+this.start;f<=e-this.end;f+=2){let h=i+f,a=f==-e||f!=e&&this.vec[h-1]<this.vec[h+1]?this.vec[h+1]:this.vec[h-1]+1,d=a-f;for(;a<n&&d<l&&o(a,d);)a++,d++;if(this.vec[h]=a,a>n)this.end+=2;else if(d>l)this.start+=2;else if(r){let c=i+(n-l)-f;if(c>=0&&c<this.len&&r.vec[c]!=-1)if(s){let u=r.vec[c];if(u>=n-a)return[u,i+u-c]}else{let u=n-r.vec[c];if(a>=u)return[a,d]}}}return null}}const ee=new Ue,te=new Ue;function mt(t,e,n,l,i,r,s,o){let f=!1;return!F(t,l)&&++l==n&&(f=!0),!F(i,o)&&++o==s&&(f=!0),f?[new v(e,n,r,s)]:y(t,e,l,i,r,o).concat(y(t,l,n,i,o,s))}function We(t,e){let n=1,l=Math.min(t,e);for(;n<l;)n=n<<1;return n}function fe(t,e,n,l,i,r){if(e==n||e==r||t.charCodeAt(e)!=l.charCodeAt(i))return 0;let s=We(n-e,r-i);for(let o=e,f=i;;){let h=o+s,a=f+s;if(h>n||a>r||t.slice(o,h)!=l.slice(f,a)){if(s==1)return o-e-(F(t,o)?0:1);s=s>>1}else{if(h==n||a==r)return h-e;o=h,f=a}}}function de(t,e,n,l,i,r){if(e==n||i==r||t.charCodeAt(n-1)!=l.charCodeAt(r-1))return 0;let s=We(n-e,r-i);for(let o=n,f=r;;){let h=o-s,a=f-s;if(h<e||a<i||t.slice(h,o)!=l.slice(a,f)){if(s==1)return n-o-(F(t,o)?0:1);s=s>>1}else{if(h==e||a==i)return n-h;o=h,f=a}}}function re(t,e,n,l,i,r,s,o){let f=l.slice(i,r),h=null;for(;;){if(h||s<o)return h;for(let a=e+s;;){F(t,a)||a++;let d=a+s;if(F(t,d)||(d+=d==a+1?1:-1),d>=n)break;let c=t.slice(a,d),u=-1;for(;(u=f.indexOf(c,u+1))!=-1;){let m=fe(t,d,n,l,i+u+c.length,r),p=de(t,e,a,l,i,i+u),g=c.length+m+p;(!h||h[2]<g)&&(h=[a-p,i+u-p,g])}a=d}if(o<0)return h;s=s>>1}}function He(t,e,n,l,i,r){let s=n-e,o=r-i;if(s<o){let f=He(l,i,r,t,e,n);return f&&[f[1],f[0],f[2]]}return s<4||o*2<s?null:re(t,e,n,l,i,r,Math.floor(s/4),-1)}function ge(t,e,n,l,i,r){ae=!0;let s=n-e,o=r-i,f;if(s<o){let c=re(l,i,r,t,e,n,Math.floor(s/6),50);f=c&&[c[1],c[0],c[2]]}else f=re(t,e,n,l,i,r,Math.floor(o/6),50);if(!f)return[new v(e,n,i,r)];let[h,a,d]=f;return y(t,e,h,l,i,a).concat(y(t,h+d,n,l,a+d,r))}function ze(t,e){for(let n=1;n<t.length;n++){let l=t[n-1],i=t[n];l.toA>i.fromA-e&&l.toB>i.fromB-e&&(t[n-1]=new v(l.fromA,i.toA,l.fromB,i.toB),t.splice(n--,1))}}function gt(t,e,n){for(;;){ze(n,1);let l=!1;for(let i=0;i<n.length;i++){let r=n[i],s,o;(s=fe(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA+s,r.toA,r.fromB+s,r.toB)),(o=de(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA,r.toA-o,r.fromB,r.toB-o));let f=r.toA-r.fromA,h=r.toB-r.fromB;if(f&&h)continue;let a=r.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:t.length)-r.toA;if(!a||!d)continue;let c=f?t.slice(r.fromA,r.toA):e.slice(r.fromB,r.toB);a<=c.length&&t.slice(r.fromA-a,r.fromA)==c.slice(c.length-a)?(n[i]=new v(r.fromA-a,r.toA-a,r.fromB-a,r.toB-a),l=!0):d<=c.length&&t.slice(r.toA,r.toA+d)==c.slice(0,d)&&(n[i]=new v(r.fromA+d,r.toA+d,r.fromB+d,r.toB+d),l=!0)}if(!l)break}return n}function pt(t,e,n){for(let l=0,i=0;i<t.length;i++){let r=t[i],s=r.toA-r.fromA,o=r.toB-r.fromB;if(s&&o||s>3||o>3){let f=i==t.length-1?e.length:t[i+1].fromA,h=r.fromA-l,a=f-r.toA,d=Ce(e,r.fromA,h),c=pe(e,r.toA,a),u=r.fromA-d,m=c-r.toA;if((!s||!o)&&u&&m){let p=Math.max(s,o),[g,C,S]=s?[e,r.fromA,r.toA]:[n,r.fromB,r.toB];p>u&&e.slice(d,r.fromA)==g.slice(S-u,S)?(r=t[i]=new v(d,d+s,r.fromB-u,r.toB-u),d=r.fromA,c=pe(e,r.toA,f-r.toA)):p>m&&e.slice(r.toA,c)==g.slice(C,C+m)&&(r=t[i]=new v(c-s,c,r.fromB+m,r.toB+m),c=r.toA,d=Ce(e,r.fromA,r.fromA-l)),u=r.fromA-d,m=c-r.toA}if(u||m)r=t[i]=new v(r.fromA-u,r.toA+m,r.fromB-u,r.toB+m);else if(s){if(!o){let p=Ae(e,r.fromA,r.toA),g,C=p<0?-1:ve(e,r.toA,r.fromA);p>-1&&(g=p-r.fromA)<=a&&e.slice(r.fromA,p)==e.slice(r.toA,r.toA+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toA-C)<=h&&e.slice(r.fromA-g,r.fromA)==e.slice(C,r.toA)&&(r=t[i]=r.offset(-g))}}else{let p=Ae(n,r.fromB,r.toB),g,C=p<0?-1:ve(n,r.toB,r.fromB);p>-1&&(g=p-r.fromB)<=a&&n.slice(r.fromB,p)==n.slice(r.toB,r.toB+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toB-C)<=h&&n.slice(r.fromB-g,r.fromB)==n.slice(C,r.toB)&&(r=t[i]=r.offset(-g))}}l=r.toA}return ze(t,3),t}let E;try{E=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Pe(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function qe(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?Pe(n)?1:0:E?!Je(n)||e==t.length-1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e,e+2))?2:0:0}function _e(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?Pe(n)?1:0:E?!Ke(n)||e==1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e-2,e))?2:0:0}const $e=8;function pe(t,e,n){if(e==t.length||!_e(t,e))return e;for(let l=e,i=e+n,r=0;r<$e;r++){let s=qe(t,l);if(!s||l+s>i)return l;l+=s}return e}function Ce(t,e,n){if(!e||!qe(t,e))return e;for(let l=e,i=e-n,r=0;r<$e;r++){let s=_e(t,l);if(!s||l-s<i)return l;l-=s}return e}function ve(t,e,n){for(;e!=n;e--)if(t.charCodeAt(e-1)==10)return e;return-1}function Ae(t,e,n){for(;e!=n;e++)if(t.charCodeAt(e)==10)return e;return-1}const Je=t=>t>=55296&&t<=56319,Ke=t=>t>=56320&&t<=57343;function F(t,e){return!e||e==t.length||!Je(t.charCodeAt(e-1))||!Ke(t.charCodeAt(e))}function Ct(t,e,n){var l;let i=n==null?void 0:n.override;return i?i(t,e):(I=((l=n==null?void 0:n.scanLimit)!==null&&l!==void 0?l:1e9)>>1,U=n!=null&&n.timeout?Date.now()+n.timeout:0,ae=!1,gt(t,e,y(t,0,t.length,e,0,e.length)))}function Qe(){return!ae}function Ye(t,e,n){return pt(Ct(t,e,n),t,e)}const b=Ve.define({combine:t=>t[0]}),ie=G.define(),Ze=Ve.define(),k=H.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(ie)&&(t=n.value);for(let n of e.state.facet(Ze))t=n(t,e);return t}});function vt(t){let e=t.field(k,!1);if(!e)return null;let n=t.facet(b);return{chunks:e,side:n?n.side:null}}class O{constructor(e,n,l,i,r,s=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=i,this.toB=r,this.precise=s}offset(e,n){return e||n?new O(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,l){let i=Ye(e.toString(),n.toString(),l);return Xe(i,e,n,0,0,Qe())}static updateA(e,n,l,i,r){return be(Be(e,i,!0,l.length),e,n,l,r)}static updateB(e,n,l,i,r){return be(Be(e,i,!1,n.length),e,n,l,r)}}function xe(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.to==t&&r.to==e&&t<n.length&&e<l.length?[t+1,e+1]:[i.from,r.from]}function we(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.from==t&&r.from==e?[t,e]:[i.to+1,r.to+1]}function Xe(t,e,n,l,i,r){let s=[];for(let o=0;o<t.length;o++){let f=t[o],[h,a]=xe(f.fromA+l,f.fromB+i,e,n),[d,c]=we(f.toA+l,f.toB+i,e,n),u=[f.offset(-h+l,-a+i)];for(;o<t.length-1;){let m=t[o+1],[p,g]=xe(m.fromA+l,m.fromB+i,e,n);if(p>d+1&&g>c+1)break;u.push(m.offset(-h+l,-a+i)),[d,c]=we(m.toA+l,m.toB+i,e,n),o++}s.push(new O(u,h,Math.max(h,d),a,Math.max(a,c),r))}return s}const z=1e3;function ke(t,e,n,l){let i=0,r=t.length;for(;;){if(i==r){let a=0,d=0;i&&({toA:a,toB:d}=t[i-1]);let c=e-(n?a:d);return[a+c,d+c]}let s=i+r>>1,o=t[s],[f,h]=n?[o.fromA,o.toA]:[o.fromB,o.toB];if(f>e)r=s;else if(h<=e)i=s+1;else return l?[o.fromA,o.fromB]:[o.toA,o.toB]}}function Be(t,e,n,l){let i=[];return e.iterChangedRanges((r,s,o,f)=>{let h=0,a=n?e.length:l,d=0,c=n?l:e.length;r>z&&([h,d]=ke(t,r-z,n,!0)),s<e.length-z&&([a,c]=ke(t,s+z,n,!1));let u=f-o-(s-r),m,[p,g]=n?[u,0]:[0,u];i.length&&(m=i[i.length-1]).toA>=h?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:a,toB:c,diffA:m.diffA+p,diffB:m.diffB+g}:i.push({fromA:h,toA:a,fromB:d,toB:c,diffA:p,diffB:g})}),i}function be(t,e,n,l,i){if(!t.length)return e;let r=[];for(let s=0,o=0,f=0,h=0;;s++){let a=s==t.length?null:t[s],d=a?a.fromA+o:n.length,c=a?a.fromB+f:l.length;for(;h<e.length;){let g=e[h];if(a&&(g.toA+o>d||g.toB+f>c))break;r.push(g.offset(o,f)),h++}if(!a)break;let u=a.toA+o+a.diffA,m=a.toB+f+a.diffB,p=Ye(n.sliceString(d,u),l.sliceString(c,m),i);for(let g of Xe(p,n,l,d,c,Qe()))r.push(g);for(o+=a.diffA,f+=a.diffB;h<e.length;){let g=e[h];if(g.fromA+o>u&&g.fromB+f>m)break;h++}}return r}const et={scanLimit:500},Z=dt.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Le(t))}update(t){(t.docChanged||t.viewportChanged||At(t.startState,t.state)||xt(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Le(t.view))}},{decorations:t=>t.deco}),P=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty}}));function At(t,e){return t.field(k,!1)!=e.field(k,!1)}function xt(t,e){return t.facet(b)!=e.facet(b)}const Me=M.line({class:"cm-changedLine"}),tt=M.mark({class:"cm-changedText"}),wt=M.mark({tagName:"ins",class:"cm-insertedLine"}),kt=M.mark({tagName:"del",class:"cm-deletedLine"}),De=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function Bt(t,e,n,l,i,r){let s=n?t.fromA:t.fromB,o=n?t.toA:t.toB,f=0;if(s!=o){i.add(s,s,Me),i.add(s,o,n?kt:wt),r&&r.add(s,s,De);for(let h=e.iterRange(s,o-1),a=s;!h.next().done;){if(h.lineBreak){a++,i.add(a,a,Me),r&&r.add(a,a,De);continue}let d=a+h.value.length;if(l)for(;f<t.changes.length;){let c=t.changes[f],u=s+(n?c.fromA:c.fromB),m=s+(n?c.toA:c.toB),p=Math.max(a,u),g=Math.min(d,m);if(p<g&&i.add(p,g,tt),m<d)f++;else break}a=d}}}function Le(t){let e=t.state.field(k),{side:n,highlightChanges:l,markGutter:i,overrideChunk:r}=t.state.facet(b),s=n=="a",o=new N,f=i?new N:null,{from:h,to:a}=t.viewport;for(let d of e){if((s?d.fromA:d.fromB)>=a)break;(s?d.toA:d.toB)>h&&(!r||!r(t.state,d,o,f))&&Bt(d,t.state.doc,s,l,o,f)}return{deco:o.finish(),gutter:f&&f.finish()}}class q extends Y{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const K=G.define({map:(t,e)=>t.map(e)}),W=H.define({create:()=>M.none,update:(t,e)=>{for(let n of e.effects)if(n.is(K))return n.value;return t.map(e.changes)},provide:t=>B.decorations.from(t)}),_=.01;function Se(t,e){if(t.size!=e.size)return!1;let n=t.iter(),l=e.iter();for(;n.value;){if(n.from!=l.from||Math.abs(n.value.spec.widget.height-l.value.spec.widget.height)>1)return!1;n.next(),l.next()}return!0}function bt(t,e,n){let l=new N,i=new N,r=t.state.field(W).iter(),s=e.state.field(W).iter(),o=0,f=0,h=0,a=0,d=t.viewport,c=e.viewport;for(let g=0;;g++){let C=g<n.length?n[g]:null,S=C?C.fromA:t.state.doc.length,R=C?C.fromB:e.state.doc.length;if(o<S){let x=t.lineBlockAt(o).top+h,D=e.lineBlockAt(f).top+a,w=x-D;w<-_?(h-=w,l.add(o,o,M.widget({widget:new q(-w),block:!0,side:-1}))):w>_&&(a+=w,i.add(f,f,M.widget({widget:new q(w),block:!0,side:-1})))}if(S>o+1e3&&o<d.from&&S>d.from&&f<c.from&&R>c.from){let x=Math.min(d.from-o,c.from-f);o+=x,f+=x,g--}else if(C)o=C.toA,f=C.toB;else break;for(;r.value&&r.from<o;)h-=r.value.spec.widget.height,r.next();for(;s.value&&s.from<f;)a-=s.value.spec.widget.height,s.next()}for(;r.value;)h-=r.value.spec.widget.height,r.next();for(;s.value;)a-=s.value.spec.widget.height,s.next();let u=t.contentHeight+h-(e.contentHeight+a);u<_?l.add(t.state.doc.length,t.state.doc.length,M.widget({widget:new q(-u),block:!0,side:1})):u>_&&i.add(e.state.doc.length,e.state.doc.length,M.widget({widget:new q(u),block:!0,side:1}));let m=l.finish(),p=i.finish();Se(m,t.state.field(W))||t.dispatch({effects:K.of(m)}),Se(p,e.state.field(W))||e.dispatch({effects:K.of(p)})}const le=G.define({map:(t,e)=>e.mapPos(t)});class Mt extends Y{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let i=e.posAtDOM(l.target);e.dispatch({effects:le.of(i)});let{side:r,sibling:s}=e.state.facet(b);s&&s().dispatch({effects:le.of(Dt(i,e.state.field(k),r=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function Dt(t,e,n){let l=0,i=0;for(let r=0;;r++){let s=r<e.length?e[r]:null;if(!s||(n?s.fromA:s.fromB)>=t)return i+(t-l);[l,i]=n?[s.toA,s.toB]:[s.toB,s.toA]}}const Lt=H.define({create(t){return M.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(le)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(k)!=e.startState.field(k,!1)){let n=e.state.facet(b).side=="a",l=[];for(let i of e.state.field(k))t.between(n?i.fromA:i.fromB,n?i.toA:i.toB,r=>{l.push(r)});l.length&&(t=t.update({filter:i=>l.indexOf(i)<0}))}return t},provide:t=>B.decorations.from(t)});function se({margin:t=3,minSize:e=4}){return Lt.init(n=>St(n,t,e))}function St(t,e,n){let l=new N,i=t.facet(b).side=="a",r=t.field(k),s=1;for(let o=0;;o++){let f=o<r.length?r[o]:null,h=o?s+e:1,a=f?t.doc.lineAt(i?f.fromA:f.fromB).number-1-e:t.doc.lines,d=a-h+1;if(d>=n&&l.add(t.doc.line(h).from,t.doc.line(a).to,M.replace({widget:new Mt(d),block:!0})),!f)break;s=t.doc.lineAt(Math.min(t.doc.length,i?f.toA:f.toB)).number}return l.finish()}const Ot=B.styleModule.of(new st({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),nt=B.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),Oe=new Ge,$=new Ge;class Et{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||et;let n=[Q.low(Z),nt,Ot,W,B.updateListener.of(d=>{this.measuring<0&&(d.heightChanged||d.viewportChanged)&&!d.transactions.some(c=>c.effects.some(u=>u.is(K)))&&this.measure()})],l=[b.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&l.push(P);let i=ne.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],B.editorAttributes.of({class:"cm-merge-a"}),$.of(l),n]}),r=[b.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&r.push(P);let s=ne.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],B.editorAttributes.of({class:"cm-merge-b"}),$.of(r),n]});this.chunks=O.build(i.doc,s.doc,this.diffConf);let o=[k.init(()=>this.chunks),Oe.of(e.collapseUnchanged?se(e.collapseUnchanged):[])];i=i.update({effects:G.appendConfig.of(o)}).state,s=s.update({effects:G.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let f=e.orientation||"a-b",h=document.createElement("div");h.className="cm-mergeViewEditor";let a=document.createElement("div");a.className="cm-mergeViewEditor",this.editorDOM.appendChild(f=="a-b"?h:a),this.editorDOM.appendChild(f=="a-b"?a:h),this.a=new B({state:i,parent:h,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.a)}),this.b=new B({state:s,parent:a,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,n){if(e.some(l=>l.docChanged)){let l=e[e.length-1],i=e.reduce((s,o)=>s.compose(o.changes),Ne.empty(e[0].startState.doc.length));this.chunks=n==this.a?O.updateA(this.chunks,l.newDoc,this.b.state.doc,i,this.diffConf):O.updateB(this.chunks,this.a.state.doc,l.newDoc,i,this.diffConf),n.update([...e,l.state.update({effects:ie.of(this.chunks)})]);let r=n==this.a?this.b:this.a;r.update([r.state.update({effects:ie.of(this.chunks)})]),this.scheduleMeasure()}else n.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let r=e.orientation!="b-a";if(r!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,o=this.b.dom.parentNode;s.remove(),o.remove(),this.editorDOM.insertBefore(r?s:o,this.editorDOM.firstChild),this.editorDOM.appendChild(r?o:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let r=!!this.revertDOM,s=this.revertToA,o=this.renderRevert;"revertControls"in e&&(r=!!e.revertControls,s=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(r,s,o)}let n="highlightChanges"in e,l="gutter"in e,i="collapseUnchanged"in e;if(n||l||i){let r=[],s=[];if(n||l){let o=this.a.state.facet(b),f=l?e.gutter!==!1:o.markGutter,h=n?e.highlightChanges!==!1:o.highlightChanges;r.push($.reconfigure([b.of({side:"a",sibling:()=>this.b,highlightChanges:h,markGutter:f}),f?P:[]])),s.push($.reconfigure([b.of({side:"b",sibling:()=>this.a,highlightChanges:h,markGutter:f}),f?P:[]]))}if(i){let o=Oe.reconfigure(e.collapseUnchanged?se(e.collapseUnchanged):[]);r.push(o),s.push(o)}this.a.dispatch({effects:r}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(e,n,l){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=l,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",i=>this.revertClicked(i)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){bt(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,n=e.firstChild,l=this.a.viewport,i=this.b.viewport;for(let r=0;r<this.chunks.length;r++){let s=this.chunks[r];if(s.fromA>l.to||s.fromB>i.to)break;if(s.fromA<l.from||s.fromB<i.from)continue;let o=this.a.lineBlockAt(s.fromA).top+"px";for(;n&&+n.dataset.chunk<r;)n=Ee(n);n&&n.dataset.chunk==String(r)?(n.style.top!=o&&(n.style.top=o),n=n.nextSibling):e.insertBefore(this.renderRevertButton(o,r),n)}for(;n;)n=Ee(n)}renderRevertButton(e,n){let l;if(this.renderRevert)l=this.renderRevert();else{l=document.createElement("button");let i=this.a.state.phrase("Revert this chunk");l.setAttribute("aria-label",i),l.setAttribute("title",i),l.textContent=this.revertToLeft?"⇜":"⇝"}return l.style.top=e,l.setAttribute("data-chunk",String(n)),l}revertClicked(e){let n=e.target,l;for(;n&&n.parentNode!=this.revertDOM;)n=n.parentNode;if(n&&(l=this.chunks[n.dataset.chunk])){let[i,r,s,o,f,h]=this.revertToA?[this.b,this.a,l.fromB,l.toB,l.fromA,l.toA]:[this.a,this.b,l.fromA,l.toA,l.fromB,l.toB],a=i.state.sliceDoc(s,Math.max(s,o-1));s!=o&&h<=r.state.doc.length&&(a+=i.state.lineBreak),r.dispatch({changes:{from:f,to:Math.min(r.state.doc.length,h),insert:a},userEvent:"revert"}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function Ee(t){let e=t.nextSibling;return t.remove(),e}const yt=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Rt=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty},widgetMarker:(t,e)=>e instanceof rt?yt:null}));function Tt(t){var e;let n=typeof t.original=="string"?Fe.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||et;return[Q.low(Z),Vt,nt,B.editorAttributes.of({class:"cm-merge-b"}),Ze.of((i,r)=>{let s=r.effects.find(o=>o.is(he));return s&&(i=O.updateA(i,s.value.doc,r.startState.doc,s.value.changes,l)),r.docChanged&&(i=O.updateB(i,r.state.field(V),r.newDoc,r.changes,l)),i}),b.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:t.allowInlineDiffs?Wt:void 0,side:"b"}),V.init(()=>n),t.gutter!==!1?Rt:[],t.collapseUnchanged?se(t.collapseUnchanged):[],k.init(i=>O.build(n,i.doc,l))]}const he=G.define(),V=H.define({create:()=>Fe.empty,update(t,e){for(let n of e.effects)n.is(he)&&(t=n.value.doc);return t}}),ye=new WeakMap;class rt extends Y{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function Gt(t,e,n){let l=ye.get(e.changes);if(l)return l;let i=s=>{let{highlightChanges:o,syntaxHighlightDeletions:f,syntaxHighlightDeletionsMaxLength:h,mergeControls:a}=t.facet(b),d=document.createElement("div");if(d.className="cm-deletedChunk",a){let x=d.appendChild(document.createElement("div"));x.className="cm-chunkButtons";let D=A=>{A.preventDefault(),Nt(s,s.posAtDOM(d))},w=A=>{A.preventDefault(),Ft(s,s.posAtDOM(d))};if(typeof a=="function")x.appendChild(a("accept",D)),x.appendChild(a("reject",w));else{let A=x.appendChild(document.createElement("button"));A.name="accept",A.textContent=t.phrase("Accept"),A.onmousedown=D;let L=x.appendChild(document.createElement("button"));L.name="reject",L.textContent=t.phrase("Reject"),L.onmousedown=w}}if(n||e.fromA>=e.toA)return d;let c=s.state.field(V).sliceString(e.fromA,e.endA),u=f&&t.facet(ot),m=S(),p=e.changes,g=0,C=!1;function S(){let x=d.appendChild(document.createElement("div"));return x.className="cm-deletedLine",x.appendChild(document.createElement("del"))}function R(x,D,w){for(let A=x;A<D;){if(c.charAt(A)==`
|
|
1
|
+
import{j as J,r as T}from"./index-MHIn2TC9.js";import{R as lt}from"./index-CH4NJ8dD.js";import{o as Q,E as B,q as ne,C as Ge,S as G,r as Ne,u as Fe,v as st,w as H,x as M,F as Ve,R as N,W as Y,G as oe,y as ot,z as at,A as je,B as Ie,H as ft,V as dt,m as ht,n as ct}from"./index-DIJdZqg2.js";class v{constructor(e,n,l,i){this.fromA=e,this.toA=n,this.fromB=l,this.toB=i}offset(e,n=e){return new v(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function y(t,e,n,l,i,r){if(t==l)return[];let s=fe(t,e,n,l,i,r),o=de(t,e+s,n,l,i+s,r);e+=s,n-=o,i+=s,r-=o;let f=n-e,h=r-i;if(!f||!h)return[new v(e,n,i,r)];if(f>h){let d=t.slice(e,n).indexOf(l.slice(i,r));if(d>-1)return[new v(e,e+d,i,i),new v(e+d+h,n,r,r)]}else if(h>f){let d=l.slice(i,r).indexOf(t.slice(e,n));if(d>-1)return[new v(e,e,i,i+d),new v(n,n,i+d+f,r)]}if(f==1||h==1)return[new v(e,n,i,r)];let a=He(t,e,n,l,i,r);if(a){let[d,c,u]=a;return y(t,e,d,l,i,c).concat(y(t,d+u,n,l,c+u,r))}return ut(t,e,n,l,i,r)}let I=1e9,U=0,ae=!1;function ut(t,e,n,l,i,r){let s=n-e,o=r-i;if(I<1e9&&Math.min(s,o)>I*16||U>0&&Date.now()>U)return Math.min(s,o)>I*64?[new v(e,n,i,r)]:ge(t,e,n,l,i,r);let f=Math.ceil((s+o)/2);ee.reset(f),te.reset(f);let h=(u,m)=>t.charCodeAt(e+u)==l.charCodeAt(i+m),a=(u,m)=>t.charCodeAt(n-u-1)==l.charCodeAt(r-m-1),d=(s-o)%2!=0?te:null,c=d?null:ee;for(let u=0;u<f;u++){if(u>I||U>0&&!(u&63)&&Date.now()>U)return ge(t,e,n,l,i,r);let m=ee.advance(u,s,o,f,d,!1,h)||te.advance(u,s,o,f,c,!0,a);if(m)return mt(t,e,n,e+m[0],l,i,r,i+m[1])}return[new v(e,n,i,r)]}class Ue{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,n,l,i,r,s,o){for(let f=-e+this.start;f<=e-this.end;f+=2){let h=i+f,a=f==-e||f!=e&&this.vec[h-1]<this.vec[h+1]?this.vec[h+1]:this.vec[h-1]+1,d=a-f;for(;a<n&&d<l&&o(a,d);)a++,d++;if(this.vec[h]=a,a>n)this.end+=2;else if(d>l)this.start+=2;else if(r){let c=i+(n-l)-f;if(c>=0&&c<this.len&&r.vec[c]!=-1)if(s){let u=r.vec[c];if(u>=n-a)return[u,i+u-c]}else{let u=n-r.vec[c];if(a>=u)return[a,d]}}}return null}}const ee=new Ue,te=new Ue;function mt(t,e,n,l,i,r,s,o){let f=!1;return!F(t,l)&&++l==n&&(f=!0),!F(i,o)&&++o==s&&(f=!0),f?[new v(e,n,r,s)]:y(t,e,l,i,r,o).concat(y(t,l,n,i,o,s))}function We(t,e){let n=1,l=Math.min(t,e);for(;n<l;)n=n<<1;return n}function fe(t,e,n,l,i,r){if(e==n||e==r||t.charCodeAt(e)!=l.charCodeAt(i))return 0;let s=We(n-e,r-i);for(let o=e,f=i;;){let h=o+s,a=f+s;if(h>n||a>r||t.slice(o,h)!=l.slice(f,a)){if(s==1)return o-e-(F(t,o)?0:1);s=s>>1}else{if(h==n||a==r)return h-e;o=h,f=a}}}function de(t,e,n,l,i,r){if(e==n||i==r||t.charCodeAt(n-1)!=l.charCodeAt(r-1))return 0;let s=We(n-e,r-i);for(let o=n,f=r;;){let h=o-s,a=f-s;if(h<e||a<i||t.slice(h,o)!=l.slice(a,f)){if(s==1)return n-o-(F(t,o)?0:1);s=s>>1}else{if(h==e||a==i)return n-h;o=h,f=a}}}function re(t,e,n,l,i,r,s,o){let f=l.slice(i,r),h=null;for(;;){if(h||s<o)return h;for(let a=e+s;;){F(t,a)||a++;let d=a+s;if(F(t,d)||(d+=d==a+1?1:-1),d>=n)break;let c=t.slice(a,d),u=-1;for(;(u=f.indexOf(c,u+1))!=-1;){let m=fe(t,d,n,l,i+u+c.length,r),p=de(t,e,a,l,i,i+u),g=c.length+m+p;(!h||h[2]<g)&&(h=[a-p,i+u-p,g])}a=d}if(o<0)return h;s=s>>1}}function He(t,e,n,l,i,r){let s=n-e,o=r-i;if(s<o){let f=He(l,i,r,t,e,n);return f&&[f[1],f[0],f[2]]}return s<4||o*2<s?null:re(t,e,n,l,i,r,Math.floor(s/4),-1)}function ge(t,e,n,l,i,r){ae=!0;let s=n-e,o=r-i,f;if(s<o){let c=re(l,i,r,t,e,n,Math.floor(s/6),50);f=c&&[c[1],c[0],c[2]]}else f=re(t,e,n,l,i,r,Math.floor(o/6),50);if(!f)return[new v(e,n,i,r)];let[h,a,d]=f;return y(t,e,h,l,i,a).concat(y(t,h+d,n,l,a+d,r))}function ze(t,e){for(let n=1;n<t.length;n++){let l=t[n-1],i=t[n];l.toA>i.fromA-e&&l.toB>i.fromB-e&&(t[n-1]=new v(l.fromA,i.toA,l.fromB,i.toB),t.splice(n--,1))}}function gt(t,e,n){for(;;){ze(n,1);let l=!1;for(let i=0;i<n.length;i++){let r=n[i],s,o;(s=fe(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA+s,r.toA,r.fromB+s,r.toB)),(o=de(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA,r.toA-o,r.fromB,r.toB-o));let f=r.toA-r.fromA,h=r.toB-r.fromB;if(f&&h)continue;let a=r.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:t.length)-r.toA;if(!a||!d)continue;let c=f?t.slice(r.fromA,r.toA):e.slice(r.fromB,r.toB);a<=c.length&&t.slice(r.fromA-a,r.fromA)==c.slice(c.length-a)?(n[i]=new v(r.fromA-a,r.toA-a,r.fromB-a,r.toB-a),l=!0):d<=c.length&&t.slice(r.toA,r.toA+d)==c.slice(0,d)&&(n[i]=new v(r.fromA+d,r.toA+d,r.fromB+d,r.toB+d),l=!0)}if(!l)break}return n}function pt(t,e,n){for(let l=0,i=0;i<t.length;i++){let r=t[i],s=r.toA-r.fromA,o=r.toB-r.fromB;if(s&&o||s>3||o>3){let f=i==t.length-1?e.length:t[i+1].fromA,h=r.fromA-l,a=f-r.toA,d=Ce(e,r.fromA,h),c=pe(e,r.toA,a),u=r.fromA-d,m=c-r.toA;if((!s||!o)&&u&&m){let p=Math.max(s,o),[g,C,S]=s?[e,r.fromA,r.toA]:[n,r.fromB,r.toB];p>u&&e.slice(d,r.fromA)==g.slice(S-u,S)?(r=t[i]=new v(d,d+s,r.fromB-u,r.toB-u),d=r.fromA,c=pe(e,r.toA,f-r.toA)):p>m&&e.slice(r.toA,c)==g.slice(C,C+m)&&(r=t[i]=new v(c-s,c,r.fromB+m,r.toB+m),c=r.toA,d=Ce(e,r.fromA,r.fromA-l)),u=r.fromA-d,m=c-r.toA}if(u||m)r=t[i]=new v(r.fromA-u,r.toA+m,r.fromB-u,r.toB+m);else if(s){if(!o){let p=Ae(e,r.fromA,r.toA),g,C=p<0?-1:ve(e,r.toA,r.fromA);p>-1&&(g=p-r.fromA)<=a&&e.slice(r.fromA,p)==e.slice(r.toA,r.toA+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toA-C)<=h&&e.slice(r.fromA-g,r.fromA)==e.slice(C,r.toA)&&(r=t[i]=r.offset(-g))}}else{let p=Ae(n,r.fromB,r.toB),g,C=p<0?-1:ve(n,r.toB,r.fromB);p>-1&&(g=p-r.fromB)<=a&&n.slice(r.fromB,p)==n.slice(r.toB,r.toB+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toB-C)<=h&&n.slice(r.fromB-g,r.fromB)==n.slice(C,r.toB)&&(r=t[i]=r.offset(-g))}}l=r.toA}return ze(t,3),t}let E;try{E=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Pe(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function qe(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?Pe(n)?1:0:E?!Je(n)||e==t.length-1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e,e+2))?2:0:0}function _e(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?Pe(n)?1:0:E?!Ke(n)||e==1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e-2,e))?2:0:0}const $e=8;function pe(t,e,n){if(e==t.length||!_e(t,e))return e;for(let l=e,i=e+n,r=0;r<$e;r++){let s=qe(t,l);if(!s||l+s>i)return l;l+=s}return e}function Ce(t,e,n){if(!e||!qe(t,e))return e;for(let l=e,i=e-n,r=0;r<$e;r++){let s=_e(t,l);if(!s||l-s<i)return l;l-=s}return e}function ve(t,e,n){for(;e!=n;e--)if(t.charCodeAt(e-1)==10)return e;return-1}function Ae(t,e,n){for(;e!=n;e++)if(t.charCodeAt(e)==10)return e;return-1}const Je=t=>t>=55296&&t<=56319,Ke=t=>t>=56320&&t<=57343;function F(t,e){return!e||e==t.length||!Je(t.charCodeAt(e-1))||!Ke(t.charCodeAt(e))}function Ct(t,e,n){var l;let i=n==null?void 0:n.override;return i?i(t,e):(I=((l=n==null?void 0:n.scanLimit)!==null&&l!==void 0?l:1e9)>>1,U=n!=null&&n.timeout?Date.now()+n.timeout:0,ae=!1,gt(t,e,y(t,0,t.length,e,0,e.length)))}function Qe(){return!ae}function Ye(t,e,n){return pt(Ct(t,e,n),t,e)}const b=Ve.define({combine:t=>t[0]}),ie=G.define(),Ze=Ve.define(),k=H.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(ie)&&(t=n.value);for(let n of e.state.facet(Ze))t=n(t,e);return t}});function vt(t){let e=t.field(k,!1);if(!e)return null;let n=t.facet(b);return{chunks:e,side:n?n.side:null}}class O{constructor(e,n,l,i,r,s=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=i,this.toB=r,this.precise=s}offset(e,n){return e||n?new O(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,l){let i=Ye(e.toString(),n.toString(),l);return Xe(i,e,n,0,0,Qe())}static updateA(e,n,l,i,r){return be(Be(e,i,!0,l.length),e,n,l,r)}static updateB(e,n,l,i,r){return be(Be(e,i,!1,n.length),e,n,l,r)}}function xe(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.to==t&&r.to==e&&t<n.length&&e<l.length?[t+1,e+1]:[i.from,r.from]}function we(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.from==t&&r.from==e?[t,e]:[i.to+1,r.to+1]}function Xe(t,e,n,l,i,r){let s=[];for(let o=0;o<t.length;o++){let f=t[o],[h,a]=xe(f.fromA+l,f.fromB+i,e,n),[d,c]=we(f.toA+l,f.toB+i,e,n),u=[f.offset(-h+l,-a+i)];for(;o<t.length-1;){let m=t[o+1],[p,g]=xe(m.fromA+l,m.fromB+i,e,n);if(p>d+1&&g>c+1)break;u.push(m.offset(-h+l,-a+i)),[d,c]=we(m.toA+l,m.toB+i,e,n),o++}s.push(new O(u,h,Math.max(h,d),a,Math.max(a,c),r))}return s}const z=1e3;function ke(t,e,n,l){let i=0,r=t.length;for(;;){if(i==r){let a=0,d=0;i&&({toA:a,toB:d}=t[i-1]);let c=e-(n?a:d);return[a+c,d+c]}let s=i+r>>1,o=t[s],[f,h]=n?[o.fromA,o.toA]:[o.fromB,o.toB];if(f>e)r=s;else if(h<=e)i=s+1;else return l?[o.fromA,o.fromB]:[o.toA,o.toB]}}function Be(t,e,n,l){let i=[];return e.iterChangedRanges((r,s,o,f)=>{let h=0,a=n?e.length:l,d=0,c=n?l:e.length;r>z&&([h,d]=ke(t,r-z,n,!0)),s<e.length-z&&([a,c]=ke(t,s+z,n,!1));let u=f-o-(s-r),m,[p,g]=n?[u,0]:[0,u];i.length&&(m=i[i.length-1]).toA>=h?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:a,toB:c,diffA:m.diffA+p,diffB:m.diffB+g}:i.push({fromA:h,toA:a,fromB:d,toB:c,diffA:p,diffB:g})}),i}function be(t,e,n,l,i){if(!t.length)return e;let r=[];for(let s=0,o=0,f=0,h=0;;s++){let a=s==t.length?null:t[s],d=a?a.fromA+o:n.length,c=a?a.fromB+f:l.length;for(;h<e.length;){let g=e[h];if(a&&(g.toA+o>d||g.toB+f>c))break;r.push(g.offset(o,f)),h++}if(!a)break;let u=a.toA+o+a.diffA,m=a.toB+f+a.diffB,p=Ye(n.sliceString(d,u),l.sliceString(c,m),i);for(let g of Xe(p,n,l,d,c,Qe()))r.push(g);for(o+=a.diffA,f+=a.diffB;h<e.length;){let g=e[h];if(g.fromA+o>u&&g.fromB+f>m)break;h++}}return r}const et={scanLimit:500},Z=dt.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Le(t))}update(t){(t.docChanged||t.viewportChanged||At(t.startState,t.state)||xt(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Le(t.view))}},{decorations:t=>t.deco}),P=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty}}));function At(t,e){return t.field(k,!1)!=e.field(k,!1)}function xt(t,e){return t.facet(b)!=e.facet(b)}const Me=M.line({class:"cm-changedLine"}),tt=M.mark({class:"cm-changedText"}),wt=M.mark({tagName:"ins",class:"cm-insertedLine"}),kt=M.mark({tagName:"del",class:"cm-deletedLine"}),De=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function Bt(t,e,n,l,i,r){let s=n?t.fromA:t.fromB,o=n?t.toA:t.toB,f=0;if(s!=o){i.add(s,s,Me),i.add(s,o,n?kt:wt),r&&r.add(s,s,De);for(let h=e.iterRange(s,o-1),a=s;!h.next().done;){if(h.lineBreak){a++,i.add(a,a,Me),r&&r.add(a,a,De);continue}let d=a+h.value.length;if(l)for(;f<t.changes.length;){let c=t.changes[f],u=s+(n?c.fromA:c.fromB),m=s+(n?c.toA:c.toB),p=Math.max(a,u),g=Math.min(d,m);if(p<g&&i.add(p,g,tt),m<d)f++;else break}a=d}}}function Le(t){let e=t.state.field(k),{side:n,highlightChanges:l,markGutter:i,overrideChunk:r}=t.state.facet(b),s=n=="a",o=new N,f=i?new N:null,{from:h,to:a}=t.viewport;for(let d of e){if((s?d.fromA:d.fromB)>=a)break;(s?d.toA:d.toB)>h&&(!r||!r(t.state,d,o,f))&&Bt(d,t.state.doc,s,l,o,f)}return{deco:o.finish(),gutter:f&&f.finish()}}class q extends Y{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const K=G.define({map:(t,e)=>t.map(e)}),W=H.define({create:()=>M.none,update:(t,e)=>{for(let n of e.effects)if(n.is(K))return n.value;return t.map(e.changes)},provide:t=>B.decorations.from(t)}),_=.01;function Se(t,e){if(t.size!=e.size)return!1;let n=t.iter(),l=e.iter();for(;n.value;){if(n.from!=l.from||Math.abs(n.value.spec.widget.height-l.value.spec.widget.height)>1)return!1;n.next(),l.next()}return!0}function bt(t,e,n){let l=new N,i=new N,r=t.state.field(W).iter(),s=e.state.field(W).iter(),o=0,f=0,h=0,a=0,d=t.viewport,c=e.viewport;for(let g=0;;g++){let C=g<n.length?n[g]:null,S=C?C.fromA:t.state.doc.length,R=C?C.fromB:e.state.doc.length;if(o<S){let x=t.lineBlockAt(o).top+h,D=e.lineBlockAt(f).top+a,w=x-D;w<-_?(h-=w,l.add(o,o,M.widget({widget:new q(-w),block:!0,side:-1}))):w>_&&(a+=w,i.add(f,f,M.widget({widget:new q(w),block:!0,side:-1})))}if(S>o+1e3&&o<d.from&&S>d.from&&f<c.from&&R>c.from){let x=Math.min(d.from-o,c.from-f);o+=x,f+=x,g--}else if(C)o=C.toA,f=C.toB;else break;for(;r.value&&r.from<o;)h-=r.value.spec.widget.height,r.next();for(;s.value&&s.from<f;)a-=s.value.spec.widget.height,s.next()}for(;r.value;)h-=r.value.spec.widget.height,r.next();for(;s.value;)a-=s.value.spec.widget.height,s.next();let u=t.contentHeight+h-(e.contentHeight+a);u<_?l.add(t.state.doc.length,t.state.doc.length,M.widget({widget:new q(-u),block:!0,side:1})):u>_&&i.add(e.state.doc.length,e.state.doc.length,M.widget({widget:new q(u),block:!0,side:1}));let m=l.finish(),p=i.finish();Se(m,t.state.field(W))||t.dispatch({effects:K.of(m)}),Se(p,e.state.field(W))||e.dispatch({effects:K.of(p)})}const le=G.define({map:(t,e)=>e.mapPos(t)});class Mt extends Y{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let i=e.posAtDOM(l.target);e.dispatch({effects:le.of(i)});let{side:r,sibling:s}=e.state.facet(b);s&&s().dispatch({effects:le.of(Dt(i,e.state.field(k),r=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function Dt(t,e,n){let l=0,i=0;for(let r=0;;r++){let s=r<e.length?e[r]:null;if(!s||(n?s.fromA:s.fromB)>=t)return i+(t-l);[l,i]=n?[s.toA,s.toB]:[s.toB,s.toA]}}const Lt=H.define({create(t){return M.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(le)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(k)!=e.startState.field(k,!1)){let n=e.state.facet(b).side=="a",l=[];for(let i of e.state.field(k))t.between(n?i.fromA:i.fromB,n?i.toA:i.toB,r=>{l.push(r)});l.length&&(t=t.update({filter:i=>l.indexOf(i)<0}))}return t},provide:t=>B.decorations.from(t)});function se({margin:t=3,minSize:e=4}){return Lt.init(n=>St(n,t,e))}function St(t,e,n){let l=new N,i=t.facet(b).side=="a",r=t.field(k),s=1;for(let o=0;;o++){let f=o<r.length?r[o]:null,h=o?s+e:1,a=f?t.doc.lineAt(i?f.fromA:f.fromB).number-1-e:t.doc.lines,d=a-h+1;if(d>=n&&l.add(t.doc.line(h).from,t.doc.line(a).to,M.replace({widget:new Mt(d),block:!0})),!f)break;s=t.doc.lineAt(Math.min(t.doc.length,i?f.toA:f.toB)).number}return l.finish()}const Ot=B.styleModule.of(new st({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),nt=B.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),Oe=new Ge,$=new Ge;class Et{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||et;let n=[Q.low(Z),nt,Ot,W,B.updateListener.of(d=>{this.measuring<0&&(d.heightChanged||d.viewportChanged)&&!d.transactions.some(c=>c.effects.some(u=>u.is(K)))&&this.measure()})],l=[b.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&l.push(P);let i=ne.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],B.editorAttributes.of({class:"cm-merge-a"}),$.of(l),n]}),r=[b.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&r.push(P);let s=ne.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],B.editorAttributes.of({class:"cm-merge-b"}),$.of(r),n]});this.chunks=O.build(i.doc,s.doc,this.diffConf);let o=[k.init(()=>this.chunks),Oe.of(e.collapseUnchanged?se(e.collapseUnchanged):[])];i=i.update({effects:G.appendConfig.of(o)}).state,s=s.update({effects:G.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let f=e.orientation||"a-b",h=document.createElement("div");h.className="cm-mergeViewEditor";let a=document.createElement("div");a.className="cm-mergeViewEditor",this.editorDOM.appendChild(f=="a-b"?h:a),this.editorDOM.appendChild(f=="a-b"?a:h),this.a=new B({state:i,parent:h,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.a)}),this.b=new B({state:s,parent:a,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,n){if(e.some(l=>l.docChanged)){let l=e[e.length-1],i=e.reduce((s,o)=>s.compose(o.changes),Ne.empty(e[0].startState.doc.length));this.chunks=n==this.a?O.updateA(this.chunks,l.newDoc,this.b.state.doc,i,this.diffConf):O.updateB(this.chunks,this.a.state.doc,l.newDoc,i,this.diffConf),n.update([...e,l.state.update({effects:ie.of(this.chunks)})]);let r=n==this.a?this.b:this.a;r.update([r.state.update({effects:ie.of(this.chunks)})]),this.scheduleMeasure()}else n.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let r=e.orientation!="b-a";if(r!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,o=this.b.dom.parentNode;s.remove(),o.remove(),this.editorDOM.insertBefore(r?s:o,this.editorDOM.firstChild),this.editorDOM.appendChild(r?o:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let r=!!this.revertDOM,s=this.revertToA,o=this.renderRevert;"revertControls"in e&&(r=!!e.revertControls,s=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(r,s,o)}let n="highlightChanges"in e,l="gutter"in e,i="collapseUnchanged"in e;if(n||l||i){let r=[],s=[];if(n||l){let o=this.a.state.facet(b),f=l?e.gutter!==!1:o.markGutter,h=n?e.highlightChanges!==!1:o.highlightChanges;r.push($.reconfigure([b.of({side:"a",sibling:()=>this.b,highlightChanges:h,markGutter:f}),f?P:[]])),s.push($.reconfigure([b.of({side:"b",sibling:()=>this.a,highlightChanges:h,markGutter:f}),f?P:[]]))}if(i){let o=Oe.reconfigure(e.collapseUnchanged?se(e.collapseUnchanged):[]);r.push(o),s.push(o)}this.a.dispatch({effects:r}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(e,n,l){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=l,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",i=>this.revertClicked(i)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){bt(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,n=e.firstChild,l=this.a.viewport,i=this.b.viewport;for(let r=0;r<this.chunks.length;r++){let s=this.chunks[r];if(s.fromA>l.to||s.fromB>i.to)break;if(s.fromA<l.from||s.fromB<i.from)continue;let o=this.a.lineBlockAt(s.fromA).top+"px";for(;n&&+n.dataset.chunk<r;)n=Ee(n);n&&n.dataset.chunk==String(r)?(n.style.top!=o&&(n.style.top=o),n=n.nextSibling):e.insertBefore(this.renderRevertButton(o,r),n)}for(;n;)n=Ee(n)}renderRevertButton(e,n){let l;if(this.renderRevert)l=this.renderRevert();else{l=document.createElement("button");let i=this.a.state.phrase("Revert this chunk");l.setAttribute("aria-label",i),l.setAttribute("title",i),l.textContent=this.revertToLeft?"⇜":"⇝"}return l.style.top=e,l.setAttribute("data-chunk",String(n)),l}revertClicked(e){let n=e.target,l;for(;n&&n.parentNode!=this.revertDOM;)n=n.parentNode;if(n&&(l=this.chunks[n.dataset.chunk])){let[i,r,s,o,f,h]=this.revertToA?[this.b,this.a,l.fromB,l.toB,l.fromA,l.toA]:[this.a,this.b,l.fromA,l.toA,l.fromB,l.toB],a=i.state.sliceDoc(s,Math.max(s,o-1));s!=o&&h<=r.state.doc.length&&(a+=i.state.lineBreak),r.dispatch({changes:{from:f,to:Math.min(r.state.doc.length,h),insert:a},userEvent:"revert"}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function Ee(t){let e=t.nextSibling;return t.remove(),e}const yt=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Rt=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty},widgetMarker:(t,e)=>e instanceof rt?yt:null}));function Tt(t){var e;let n=typeof t.original=="string"?Fe.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||et;return[Q.low(Z),Vt,nt,B.editorAttributes.of({class:"cm-merge-b"}),Ze.of((i,r)=>{let s=r.effects.find(o=>o.is(he));return s&&(i=O.updateA(i,s.value.doc,r.startState.doc,s.value.changes,l)),r.docChanged&&(i=O.updateB(i,r.state.field(V),r.newDoc,r.changes,l)),i}),b.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:t.allowInlineDiffs?Wt:void 0,side:"b"}),V.init(()=>n),t.gutter!==!1?Rt:[],t.collapseUnchanged?se(t.collapseUnchanged):[],k.init(i=>O.build(n,i.doc,l))]}const he=G.define(),V=H.define({create:()=>Fe.empty,update(t,e){for(let n of e.effects)n.is(he)&&(t=n.value.doc);return t}}),ye=new WeakMap;class rt extends Y{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function Gt(t,e,n){let l=ye.get(e.changes);if(l)return l;let i=s=>{let{highlightChanges:o,syntaxHighlightDeletions:f,syntaxHighlightDeletionsMaxLength:h,mergeControls:a}=t.facet(b),d=document.createElement("div");if(d.className="cm-deletedChunk",a){let x=d.appendChild(document.createElement("div"));x.className="cm-chunkButtons";let D=A=>{A.preventDefault(),Nt(s,s.posAtDOM(d))},w=A=>{A.preventDefault(),Ft(s,s.posAtDOM(d))};if(typeof a=="function")x.appendChild(a("accept",D)),x.appendChild(a("reject",w));else{let A=x.appendChild(document.createElement("button"));A.name="accept",A.textContent=t.phrase("Accept"),A.onmousedown=D;let L=x.appendChild(document.createElement("button"));L.name="reject",L.textContent=t.phrase("Reject"),L.onmousedown=w}}if(n||e.fromA>=e.toA)return d;let c=s.state.field(V).sliceString(e.fromA,e.endA),u=f&&t.facet(ot),m=S(),p=e.changes,g=0,C=!1;function S(){let x=d.appendChild(document.createElement("div"));return x.className="cm-deletedLine",x.appendChild(document.createElement("del"))}function R(x,D,w){for(let A=x;A<D;){if(c.charAt(A)==`
|
|
2
2
|
`){m.firstChild||m.appendChild(document.createElement("br")),m=S(),A++;continue}let L=D,ce=w+(C?" cm-deletedText":""),ue=!1,X=c.indexOf(`
|
|
3
3
|
`,A);if(X>-1&&X<D&&(L=X),o&&g<p.length){let j=Math.max(0,C?p[g].toA:p[g].fromA);j<=L&&(L=j,C&&g++,ue=!0)}if(L>A){let j=document.createTextNode(c.slice(A,L));if(ce){let me=m.appendChild(document.createElement("span"));me.className=ce,me.appendChild(j)}else m.appendChild(j);A=L}ue&&(C=!C)}}if(u&&e.toA-e.fromA<=h){let x=u.parser.parse(c),D=0;at(x,{style:w=>ft(t,w)},(w,A,L)=>{w>D&&R(D,w,""),R(w,A,L),D=A}),R(D,c.length,"")}else R(0,c.length,"");return m.firstChild||m.appendChild(document.createElement("br")),d},r=M.widget({block:!0,side:-1,widget:new rt(i)});return ye.set(e.changes,r),r}function Nt(t,e){let{state:n}=t,l=e??n.selection.main.head,i=t.state.field(k).find(f=>f.fromB<=l&&f.endB>=l);if(!i)return!1;let r=t.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),s=t.state.field(V);i.fromB!=i.toB&&i.toA<=s.length&&(r+=t.state.lineBreak);let o=Ne.of({from:i.fromA,to:Math.min(s.length,i.toA),insert:r},s.length);return t.dispatch({effects:he.of({doc:o.apply(s),changes:o}),userEvent:"accept"}),!0}function Ft(t,e){let{state:n}=t,l=e??n.selection.main.head,i=n.field(k).find(o=>o.fromB<=l&&o.endB>=l);if(!i)return!1;let s=n.field(V).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=n.doc.length&&(s+=n.lineBreak),t.dispatch({changes:{from:i.fromB,to:Math.min(n.doc.length,i.toB),insert:s},userEvent:"revert"}),!0}function Re(t){let e=new N;for(let n of t.field(k)){let l=t.facet(b).overrideChunk&&it(t,n);e.add(n.fromB,n.fromB,Gt(t,n,!!l))}return e.finish()}const Vt=H.define({create:t=>Re(t),update(t,e){return e.state.field(k,!1)!=e.startState.field(k,!1)?Re(e.state):t},provide:t=>B.decorations.from(t)}),Te=new WeakMap;function it(t,e){let n=Te.get(e);if(n!==void 0)return n;n=null;let l=t.field(V),i=t.doc,r=l.lineAt(e.endA).number-l.lineAt(e.fromA).number+1,s=i.lineAt(e.endB).number-i.lineAt(e.fromB).number+1;e:if(r==s&&r<10){let o=[],f=0,h=e.fromA,a=e.fromB;for(let d of e.changes){if(d.fromA<d.toA){f+=d.toA-d.fromA;let c=l.sliceString(h+d.fromA,h+d.toA);if(/\n/.test(c))break e;o.push(M.widget({widget:new jt(c),side:-1}).range(a+d.fromB))}d.fromB<d.toB&&o.push(tt.range(a+d.fromB,a+d.toB))}f<e.endA-e.fromA-r*2&&(n=o)}return Te.set(e,n),n}class jt extends Y{constructor(e){super(),this.text=e}eq(e){return this.text==e.text}toDOM(e){let n=document.createElement("del");return n.className="cm-deletedText",n.textContent=this.text,n}}const It=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-inlineChangedLineGutter"}},Ut=M.line({class:"cm-inlineChangedLine"});function Wt(t,e,n,l){let i=it(t,e),r=0;if(!i)return!1;for(let s=t.doc.lineAt(e.fromB);;){for(l&&l.add(s.from,s.from,It),n.add(s.from,s.from,Ut);r<i.length&&i[r].to<=s.to;){let o=i[r++];n.add(o.from,o.to,o.value)}if(s.to>=e.endB)break;s=t.doc.lineAt(s.to+1)}return!0}function Ht(t){const[e,n]=T.useState([]);return T.useEffect(()=>{let l=!1;const i=ht.matchFilename(ct,t);if(!i){n([]);return}return i.load().then(r=>{l||n([r])}).catch(()=>{l||n([])}),()=>{l=!0}},[t]),e}function Kt({baseline:t,current:e,theme:n,filename:l,sideBySide:i,onRejectHunk:r,onHunkCountChange:s}){const o=Ht(l);return i?J.jsx(Pt,{baseline:t,current:e,theme:n,languageExtension:o}):J.jsx(zt,{baseline:t,current:e,theme:n,languageExtension:o,onRejectHunk:r,onHunkCountChange:s})}function zt({baseline:t,current:e,theme:n,languageExtension:l,onRejectHunk:i,onHunkCountChange:r}){const s=T.useRef(-1),o=T.useMemo(()=>[B.lineWrapping,Tt({original:t,gutter:!0,mergeControls:!0,collapseUnchanged:{margin:3,minSize:4}}),...l],[t,l]);return J.jsx(lt,{value:e,editable:!1,readOnly:!0,theme:n,height:"100%",className:"desktop:select-text h-full text-sm",extensions:o,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},onChange:f=>i(f),onUpdate:f=>{var a;const h=((a=vt(f.state))==null?void 0:a.chunks.length)??null;h!==null&&h!==s.current&&(s.current=h,r(h))}})}function Pt({baseline:t,current:e,theme:n,languageExtension:l}){const i=T.useRef(null);return T.useEffect(()=>{const r=i.current;if(!r)return;const s=[B.editable.of(!1),ne.readOnly.of(!0),B.lineWrapping,...n==="dark"?[qt()]:[],...l],o=new Et({a:{doc:t,extensions:s},b:{doc:e,extensions:s},parent:r,collapseUnchanged:{margin:3,minSize:4},highlightChanges:!0,gutter:!0});return()=>o.destroy()},[t,e,n,l]),J.jsx("div",{ref:i,className:"cm-diff-split h-full overflow-auto text-sm"})}function qt(){return B.theme({"&":{backgroundColor:"transparent",color:"inherit"}},{dark:!0})}export{Kt as CodeMirrorDiff};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,j as f}from"./index-
|
|
1
|
+
import{r as n,j as f}from"./index-MHIn2TC9.js";import{R as l}from"./index-CH4NJ8dD.js";import{m as a,n as c,E as x}from"./index-DIJdZqg2.js";function j({value:u,editable:t,filename:i,languageHint:e,theme:h,onChange:m}){const[g,r]=n.useState([]);return n.useEffect(()=>{let s=!1;const o=e?a.matchLanguageName(c,e,!0):a.matchFilename(c,i);if(!o){r([]);return}return o.load().then(p=>{s||r([p])}).catch(()=>{s||r([])}),()=>{s=!0}},[i,e]),f.jsx(l,{value:u,editable:t,readOnly:!t,onChange:m,theme:h,height:"100%",className:"desktop:select-text h-full text-sm",extensions:[x.lineWrapping,...g],basicSetup:{highlightActiveLine:t,highlightActiveLineGutter:t}})}export{j as CodeMirrorEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a5 as A,a7 as E,a8 as k,fN as I,dm as $,dn as P,dp as j,dq as o,fO as q,ds as R,dt as z,r as p,j as t,I as y,B as v,G as w,fP as W,e as F,Q as U,T as X,C as K,V as Q,f as B,dL as H}from"./index-MHIn2TC9.js";function G(){const e=A(),s=E();return k({mutationFn:({agentId:n,body:a})=>e.createCommitment(n,a),onSettled:()=>s.invalidateQueries({queryKey:I.all})})}function O(){const e=A(),s=E();return k({mutationFn:({id:n,body:a})=>e.updateCommitment(n,a),onSettled:()=>s.invalidateQueries({queryKey:I.all})})}$();const L=300,V=500,Z=200,M="external:",T=P(["open","kept","missed","dropped"]).openapi("CommitmentState"),J=j({id:o(),agentId:o(),to:o().nullable(),what:o(),dueAt:o().nullable(),state:T,overdue:R(),sourceSessionId:o().nullable(),sourceRoomEntryId:o().nullable(),createdAt:o(),closedAt:o().nullable(),note:o().nullable()}).openapi("Commitment"),_=o().datetime({offset:!0});j({what:o().trim().min(1).max(L),to:o().trim().min(1).max(Z).optional(),dueAt:_.optional()}).openapi("CreateCommitmentRequest");j({state:T,dueAt:_.nullable().optional(),note:o().trim().max(V).optional(),from:T.optional()}).openapi("UpdateCommitmentRequest");const Y=500;j({agentId:o().min(1).optional(),state:T.optional(),to:o().min(1).optional(),limit:q().int().min(1).max(Y).optional()}).openapi("ListCommitmentsQuery");j({commitments:z(J)}).openapi("ListCommitmentsResponse");function ee(e,s=new Date){if(!e)return null;const n=new Date(e);if(Number.isNaN(n.getTime()))return null;const a=n.getTime()<s.getTime()?"Overdue ·":"Due",d=n.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"});return n.toDateString()===s.toDateString()?`${a} ${d}`:Math.abs(n.getTime()-s.getTime())/864e5<6?`${a} ${n.toLocaleDateString(void 0,{weekday:"short"})} ${d}`:`${a} ${n.toLocaleDateString(void 0,{month:"short",day:"numeric"})}`}function te(e,s){return e?e.startsWith(M)?`To ${e.slice(M.length)}`:`To ${(s==null?void 0:s(e))??e}`:null}function se(e){return{open:e.filter(s=>s.state==="open"),closed:e.filter(s=>s.state!=="open")}}const ae={kept:"Kept",missed:"Missed",dropped:"Dropped"};function de(e){var n;const s=new Map;for(const a of e)s.set(a.id,a.displayName),(n=a.agent)!=null&&n.manifestId&&s.set(a.agent.manifestId,a.displayName);return a=>s.get(a)}const ne=6e4;function oe(){const e=new Date;return new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,16)}function ie({agentId:e,onDone:s}){var m;const n=G(),[a,d]=p.useState(""),[r,l]=p.useState(""),u=p.useId(),f=p.useId(),x=a.trim(),N=n.isError&&((m=n.error)==null?void 0:m.code)==="PAST_DUE",h=r?new Date(r).getTime():null,[c,S]=p.useState(!1),[b]=p.useState(oe);function i(C){if(C.preventDefault(),!x||c)return;const g=h!==null?new Date(h).toISOString():void 0;n.mutate({agentId:e,body:{what:x,...g?{dueAt:g}:{}}},{onSuccess:s})}return t.jsxs("form",{onSubmit:i,"data-slot":"add-commitment-form",className:"flex flex-col gap-2 rounded-md border p-3",children:[t.jsx("label",{htmlFor:u,className:"text-xs font-medium",children:"What was promised"}),t.jsx(y,{id:u,value:a,maxLength:L,onChange:C=>d(C.target.value),placeholder:"Send Acme the revised quote"}),t.jsx("label",{htmlFor:f,className:"text-xs font-medium",children:"Due (optional)"}),t.jsx(y,{id:f,type:"datetime-local",value:r,min:b,"aria-invalid":c||void 0,onChange:C=>{const g=C.target.value;l(g),S(g!==""&&new Date(g).getTime()<Date.now()-ne)}}),(c||N)&&t.jsx("p",{className:"text-destructive text-xs",children:"That time has passed."}),n.isError&&!N&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Couldn’t save the commitment. Try again."}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx(v,{type:"button",size:"sm",variant:"ghost",onClick:s,children:"Cancel"}),t.jsx(v,{type:"submit",size:"sm",disabled:!x||c||n.isPending,children:"Add commitment"})]})]})}function D({commitment:e,agentName:s,nameOf:n,onClose:a,busy:d}){const r=e.state==="open",l=[s,te(e.to,n)].filter(Boolean).join(" · "),u=r?ee(e.dueAt):null;return t.jsxs("li",{"data-slot":"commitment-row","data-state":e.state,"data-overdue":e.overdue||void 0,className:"flex flex-col gap-2 rounded-md px-2 py-2 sm:flex-row sm:items-center sm:gap-3",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:w("text-sm break-words",!r&&"text-muted-foreground",e.state==="dropped"&&"line-through"),children:e.what}),(l||u||!r)&&t.jsxs("div",{className:"text-muted-foreground mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[e.state!=="open"&&t.jsx("span",{children:ae[e.state]}),l&&t.jsx("span",{className:"min-w-0 truncate",children:l}),u&&t.jsx("span",{className:w(e.overdue&&"text-destructive font-medium"),children:u})]})]}),r&&a&&t.jsxs("div",{className:"flex shrink-0 gap-1",children:[t.jsx(v,{size:"xs",variant:"outline",disabled:d,onClick:()=>a("kept"),"aria-label":`Mark kept: ${e.what}`,children:"Mark kept"}),t.jsx(v,{size:"xs",variant:"ghost",disabled:d,onClick:()=>a("dropped"),"aria-label":`Drop: ${e.what}`,children:"Drop"})]})]})}const re={kept:"Marked kept",dropped:"Commitment dropped"};function ue({agentId:e,nameOf:s,canAdd:n=!1,readOnly:a=!1,canChange:d}){var b;const r=W(e?{agentId:e}:{}),l=O(),[u,f]=p.useState(!1),x=e===void 0;function N(i,m){l.mutate({id:i.id,body:{state:m}},{onSuccess:()=>H.success(re[m],{action:{label:"Undo",onClick:()=>l.mutate({id:i.id,body:{state:"open",from:m}})}})})}if(r.isPending)return t.jsx(F,{className:"h-16 w-full"});if(r.isError)return t.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read commitments."});const{open:h,closed:c}=se(r.data),S=l.isPending?(b=l.variables)==null?void 0:b.id:void 0;return t.jsxs("div",{"data-slot":"commitment-list",className:"flex flex-col gap-2",children:[h.length===0&&c.length===0&&!u&&t.jsx("p",{className:"text-muted-foreground text-sm",children:"No commitments yet."}),h.length>0&&t.jsx("ul",{className:"flex flex-col","aria-label":"Open commitments",children:h.map(i=>t.jsx(D,{commitment:i,agentName:x?s==null?void 0:s(i.agentId):void 0,nameOf:s,busy:S===i.id,...a||d&&!d(i)?{}:{onClose:m=>N(i,m)}},i.id))}),l.isError&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Couldn’t change that commitment. Try again."}),c.length>0&&t.jsxs(U,{children:[t.jsxs(X,{className:"focus-ring text-muted-foreground hover:text-foreground group flex items-center gap-1 rounded-md px-2 py-1 text-xs",children:[t.jsx(K,{"aria-hidden":!0,className:"size-3.5 transition-transform group-data-[state=open]:rotate-90"}),"Closed (",c.length,")"]}),t.jsx(Q,{children:t.jsx("ul",{className:"flex flex-col","aria-label":"Closed commitments",children:c.map(i=>t.jsx(D,{commitment:i,agentName:x?s==null?void 0:s(i.agentId):void 0,nameOf:s},i.id))})})]}),n&&!a&&e&&u&&t.jsx(ie,{agentId:e,onDone:()=>f(!1)}),n&&!a&&e&&!u&&t.jsxs(v,{size:"sm",variant:"ghost",className:"self-start",onClick:()=>f(!0),children:[t.jsx(B,{"aria-hidden":!0}),"Add commitment"]})]})}export{ue as C,de as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,d,j as m}from"./index-
|
|
1
|
+
import{r,d,j as m}from"./index-MHIn2TC9.js";import{r as c,C as l}from"./CommitmentList-BoMiLsRe.js";function u({member:s,roster:t}){var o;const e=(o=s.agent)==null?void 0:o.manifestId,i=r.useMemo(()=>c(t),[t]),n=d(s,t),a=n==="managed"||n==="system";return e?m.jsx("div",{className:"min-h-0 flex-1","data-slot":"profile-commitments",children:m.jsx(l,{agentId:e,nameOf:i,canAdd:a,readOnly:!a})}):null}export{u as CommitmentsPage};
|