@kabmo-labs/kabmo 0.38.1 → 0.39.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/client/index.html +1 -1
- package/dist/client/index.js +566 -538
- package/dist/client/static/js/{CsvGrid-t1n057vw.js → CsvGrid-kfcp4sd6.js} +2 -2
- package/dist/client/static/js/{DocxView-c9g6teks.js → DocxView-atff5w38.js} +4 -4
- package/dist/client/static/js/DrawioView-yfnq4c99.js +5 -0
- package/dist/client/static/js/ImageView-nreh25s0.js +1 -0
- package/dist/client/static/js/LayoutWrapper-0x1q1q5z.js +2 -0
- package/dist/client/static/js/Modal-2xqd3sss.js +38 -0
- package/dist/client/static/js/{PdfView-cybz0xbj.js → PdfView-mk8paxt1.js} +1 -1
- package/dist/client/static/js/SessionsView-ner25qxn.js +1 -0
- package/dist/client/static/js/{SheetView-1kk5y326.js → SheetView-s6n3fawm.js} +31 -31
- package/dist/client/static/js/{SvgPreview-mp4tk37p.js → SvgPreview-8bxvz3ez.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-78qb3can.js → abnfDiagram-O67JEVCF-tvvz9fha.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-y0zb4vqa.js +1 -0
- package/dist/client/static/js/architectureDiagram-NJMV4G6O-bybv3wg4.js +36 -0
- package/dist/client/static/js/{astro-p3f5p9p2.js → astro-4ybhkc9b.js} +1 -1
- package/dist/client/static/js/bash-k6p3y3pr.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-2xemfrzh.js → blockDiagram-BEXU5L5S-h3fs79x6.js} +8 -8
- package/dist/client/static/js/c-ve09y19q.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-zxfdx3eb.js → c4Diagram-YGBWAQC7-h8p3h54v.js} +5 -5
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-z9sasy3k.js → classDiagram-v2-NBCMYWYE-q645r4q6.js} +6 -6
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-9byp0czh.js → cose-bilkent-JH36ORCC-p4mm1zcv.js} +1 -1
- package/dist/client/static/js/cpp-vhqp7bcy.js +1 -0
- package/dist/client/static/js/css-77mvf0ca.js +1 -0
- package/dist/client/static/js/css-tys2rrny.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-nt1ed192.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-gnm129fx.js → cynefinDiagram-VND7K2PF-v2hbc3aq.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-sc5tfv1w.js → dagre-6A5THRUB-4edpda33.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-hq11eek7.js → diagram-22UHCM2B-b6gp813w.js} +19 -19
- package/dist/client/static/js/{diagram-3UASUU5V-7bk532gd.js → diagram-3UASUU5V-s1f3b0ng.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-yt8wxttm.js → diagram-ATOU4E4O-ga06kjp5.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-n3978w6p.js → diagram-CDSNMT55-wdbmv4td.js} +5 -5
- package/dist/client/static/js/{diagram-MLGK6HIB-004x4gyw.js → diagram-MLGK6HIB-fkntefcq.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-498nt489.js → diagram-MPIPVDR6-k2zh7edp.js} +3 -3
- package/dist/client/static/js/{dockerfile-6hbcmkc8.js → dockerfile-srcym0bs.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-5fkmymqn.js → ebnfDiagram-ZINNZB2B-4vc4vz9c.js} +1 -1
- package/dist/client/static/js/{elixir-jwphgp8j.js → elixir-v9bbxsgg.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-6xrfa2kd.js → elk-276RUBZZ-g2ppf1by.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-byz4zbkn.js → erDiagram-OPXOYQCR-rmnwkb5q.js} +9 -9
- package/dist/client/static/js/{erlang-6m6tpt72.js → erlang-55r0skxa.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-v4edaxx7.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-jvrvhb9d.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-4fkw1k01.js → ganttDiagram-FUAMR5RP-ptfvae64.js} +5 -5
- package/dist/client/static/js/gitGraph-4MIJSDKK-adzhec96.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-19g84yw8.js → gitGraphDiagram-X574FWY7-ne9n3cyf.js} +14 -14
- package/dist/client/static/js/graphql-g97hycb3.js +1 -0
- package/dist/client/static/js/html-2syect3n.js +1 -0
- package/dist/client/static/js/{index-3az1w5f8.js → index-0j518hqm.js} +2 -2
- package/dist/client/static/js/index-1jeyjqkh.js +2 -0
- package/dist/client/static/js/{index-t5t71dhp.js → index-1sgad84m.js} +2 -2
- package/dist/client/static/js/{index-4qt2e84b.js → index-270y5r9k.js} +2 -2
- package/dist/client/static/js/{index-sa9cp6km.js → index-2rs03vfy.js} +2 -2
- package/dist/client/static/js/index-3fw3sd10.js +474 -0
- package/dist/client/static/js/{index-xya34x4v.js → index-442mbhwb.js} +2 -2
- package/dist/client/static/js/{index-kdgcbt17.js → index-4pehdq5h.js} +2 -2
- package/dist/client/static/js/{index-dt7e1328.js → index-4wtr5wjp.js} +2 -2
- package/dist/client/static/js/{index-gr6jng0x.js → index-4wvtar0v.js} +2 -2
- package/dist/client/static/js/{index-g252205p.js → index-56w8m083.js} +2 -2
- package/dist/client/static/js/index-5a4w58r2.js +1 -0
- package/dist/client/static/js/{index-57z8mtmx.js → index-5kvvb0zm.js} +2 -2
- package/dist/client/static/js/{index-zj45wj1x.js → index-61qjr1k0.js} +98 -98
- package/dist/client/static/js/{index-6k3e5dph.js → index-72289dgx.js} +2 -2
- package/dist/client/static/js/{index-cj9193d5.js → index-7h5n5rz4.js} +2 -2
- package/dist/client/static/js/{index-zw7qjx65.js → index-7z63xr1s.js} +1 -1
- package/dist/client/static/js/index-878d61js.js +1 -0
- package/dist/client/static/js/{index-fghst0kd.js → index-8egjccbq.js} +34 -34
- package/dist/client/static/js/index-8qgwj6m8.js +1 -0
- package/dist/client/static/js/{index-5gn56236.js → index-8w2tx2k9.js} +2 -2
- package/dist/client/static/js/{index-x07kp3jz.js → index-9d6x1f3t.js} +2 -2
- package/dist/client/static/js/{index-vb6t44dw.js → index-9gepbvdt.js} +2 -2
- package/dist/client/static/js/index-a7qccdq2.js +1 -0
- package/dist/client/static/js/{index-7fdp9c7m.js → index-b08hx4tw.js} +2 -2
- package/dist/client/static/js/{index-nd4p98mc.js → index-c1be3rva.js} +2 -2
- package/dist/client/static/js/{index-3zc1b0dv.js → index-c36pag9y.js} +2 -2
- package/dist/client/static/js/{index-qkscve6n.js → index-cfnxda13.js} +2 -2
- package/dist/client/static/js/index-cst843zs.css +1 -0
- package/dist/client/static/js/{index-gxtgyya0.js → index-dmd26a1y.js} +1 -1
- package/dist/client/static/js/{index-1y9r4frb.js → index-drjtwfp5.js} +2 -2
- package/dist/client/static/js/index-dt22v9ns.js +2 -0
- package/dist/client/static/js/{index-h7pn9qw6.js → index-enmh3w27.js} +2 -2
- package/dist/client/static/js/{index-ray2czf6.js → index-fjnkzk12.js} +4 -4
- package/dist/client/static/js/index-gvkc9e32.js +1 -0
- package/dist/client/static/js/{index-epbqzayj.js → index-hh05xd1d.js} +2 -2
- package/dist/client/static/js/{index-qntytvt0.js → index-jkph8wqq.js} +3 -3
- package/dist/client/static/js/index-k3c3n69j.js +12 -0
- package/dist/client/static/js/{index-rgdhyry3.js → index-k5a6r25s.js} +2 -2
- package/dist/client/static/js/{index-8j90mdgz.js → index-k61tdd4a.js} +2 -2
- package/dist/client/static/js/{index-8acv5b77.js → index-k7sdsmgv.js} +2 -2
- package/dist/client/static/js/{index-ehnztdd2.js → index-m3r0j562.js} +6 -6
- package/dist/client/static/js/{index-4jbbdq6n.js → index-mdxnhndy.js} +2 -2
- package/dist/client/static/js/index-me7m3516.js +9 -0
- package/dist/client/static/js/index-mmsszqvn.js +1 -0
- package/dist/client/static/js/index-ntx3bbmb.js +1 -0
- package/dist/client/static/js/index-p89z1qmj.js +1 -0
- package/dist/client/static/js/{index-e3w46vsc.js → index-pr7gk5eq.js} +13 -13
- package/dist/client/static/js/index-pzqsp5jw.js +4 -0
- package/dist/client/static/js/{index-qn4pkjfh.js → index-q0bph5x0.js} +2 -2
- package/dist/client/static/js/{index-gbfg0anm.js → index-qsrw5c67.js} +2 -2
- package/dist/client/static/js/{index-ashpbfqv.js → index-rj81xrvw.js} +2 -2
- package/dist/client/static/js/{index-b9b2nwdd.js → index-t6gznaxm.js} +2 -2
- package/dist/client/static/js/{index-3y6krykq.js → index-v8vjh5jj.js} +2 -2
- package/dist/client/static/js/{index-0v8b5pzb.js → index-xdqsqhnn.js} +9 -9
- package/dist/client/static/js/{index-9wd9y6m0.js → index-xrp2zv8z.js} +2 -2
- package/dist/client/static/js/{index-jbwns6sc.js → index-y2prm0xm.js} +2 -2
- package/dist/client/static/js/{index-y3hdv561.js → index-y3qxrs90.js} +2 -2
- package/dist/client/static/js/index-ymp2wqtc.js +3 -0
- package/dist/client/static/js/index-ywpdhntc.js +1 -0
- package/dist/client/static/js/info-A6RAGUB7-2ye26vqn.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-aw6ter0a.js → infoDiagram-VRGFBTTK-ctfwcm3n.js} +2 -2
- package/dist/client/static/js/ini-7ffv28px.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-62gst5wh.js → ishikawaDiagram-OU5B5YK6-b0b0pn4y.js} +3 -3
- package/dist/client/static/js/java-4x5yky4a.js +1 -0
- package/dist/client/static/js/javascript-4kw2j9t3.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-6kgv5a4j.js → journeyDiagram-ZHPQQLJL-kdq12drs.js} +5 -5
- package/dist/client/static/js/json-h3kwpty2.js +1 -0
- package/dist/client/static/js/jsx-jk20f0dr.js +1 -0
- package/dist/client/static/js/{julia-237yk557.js → julia-jhe2vd4f.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-8p3515b7.js → kanban-definition-PNTS6WVX-65x6xn2q.js} +6 -6
- package/dist/client/static/js/lua-k02dpxq8.js +1 -0
- package/dist/client/static/js/markdown-fhhg7ms6.js +1 -0
- package/dist/client/static/js/{mermaid.core-b6ga2y8y.js → mermaid.core-0fq63jpa.js} +8 -8
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-na9e9b4a.js → mindmap-definition-NLK3R4M7-p86myex3.js} +6 -6
- package/dist/client/static/js/one-dark-pro-c4q810z4.js +1 -0
- package/dist/client/static/js/one-light-czk9dzya.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-b0j3te0q.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-d1hk7fnq.js → pegDiagram-GJSIUBJH-p2hkk9xb.js} +1 -1
- package/dist/client/static/js/{perl-dvz4y1tb.js → perl-qhj6tk7k.js} +1 -1
- package/dist/client/static/js/{php-n6y7dzhm.js → php-arycc4w7.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-28qq62fn.js +1 -0
- package/dist/client/static/js/pieDiagram-5QR66LMP-bza19wkx.js +39 -0
- package/dist/client/static/js/properties-qhvcxc13.js +1 -0
- package/dist/client/static/js/python-3qsrs510.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-q4wxgmhg.js → quadrantDiagram-O4NWA36T-bxqec9w1.js} +6 -6
- package/dist/client/static/js/r-z2ng7mza.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-fyrcbpyd.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-9s62qncd.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-f7yjmhrk.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-sfrw8gkz.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-4mm4cern.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-jngq1qx4.js → railroadDiagram-XR7U4H2S-1g3hx3sm.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-6xph3b72.js → requirementDiagram-PLB6GJNP-qbjjm48v.js} +13 -13
- package/dist/client/static/js/{ruby-7zye3g0e.js → ruby-fb6zzevm.js} +1 -1
- package/dist/client/static/js/{rust-w6hen2h4.js → rust-jatm47v6.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-ncfzgdj8.js → sankeyDiagram-IPEJSGJF-t2ythbh7.js} +6 -6
- package/dist/client/static/js/{sass-m0h9yzfb.js → sass-fzs6a0kr.js} +1 -1
- package/dist/client/static/js/{scss-2pwwfkvn.js → scss-gdb52d0c.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-sqz0yfg0.js → sequenceDiagram-PO4LG4MO-mqsfek2j.js} +21 -21
- package/dist/client/static/js/{sizeCapture-INFHLROL-vt8qp04d.js → sizeCapture-INFHLROL-xj67pgds.js} +1 -1
- package/dist/client/static/js/sql-ypk53ntb.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-myjtrmfe.js → stateDiagram-v2-GCMORJYK-gj4fezak.js} +3 -3
- package/dist/client/static/js/{svelte-x8f8c8hq.js → svelte-8s3k6qjd.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-z9vx7z4j.js → swimlanes-2SLR337P-pgtdd1pk.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-zk37paj9.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-z815np57.js → timeline-definition-EJHVYXUP-q013vdd1.js} +7 -7
- package/dist/client/static/js/treeView-Q6P3EWNA-a5vgg4gz.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-ctqhajgg.js +1 -0
- package/dist/client/static/js/tsx-zy7hb2hw.js +1 -0
- package/dist/client/static/js/typescript-2hr53c8j.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-06ntggng.js → usecaseDiagram-POWQR4AR-7swsbqnq.js} +51 -51
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-nmtaf5rp.js → vennDiagram-UO4OBE2U-9dygxdxf.js} +5 -5
- package/dist/client/static/js/{vue-myjjd0gd.js → vue-k3f3chre.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-ns7e0fqf.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-zgsxmak8.js → wardleyDiagram-VNRHLVJA-aaaa9kj3.js} +4 -4
- package/dist/client/static/js/xml-p4742r9b.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-8bg9qdra.js → xychartDiagram-PMCCYNJV-tamf39gx.js} +6 -6
- package/dist/client/static/js/yaml-qbckg671.js +1 -0
- package/marketplace/plugins/command-runner/README.md +5 -0
- package/marketplace/plugins/command-runner/package.json +2 -2
- package/marketplace/plugins/command-runner/src/panel/Output.test.tsx +177 -0
- package/marketplace/plugins/command-runner/src/panel/Output.tsx +53 -2
- package/package.json +3 -1
- package/public/tray-monochrome-dark.png +0 -0
- package/public/tray-monochrome-light.png +0 -0
- package/src/client/App.tsx +4 -0
- package/src/client/components/common/NotificationPermissionDialog.test.tsx +166 -0
- package/src/client/components/common/NotificationPermissionDialog.tsx +167 -0
- package/src/client/components/common/batch-selection/BatchDeleteModal.test.tsx +97 -0
- package/src/client/components/common/batch-selection/BatchDeleteModal.tsx +24 -1
- package/src/client/components/common/context-usage-button/SessionStats.tsx +4 -8
- package/src/client/components/common/context-usage-button/TokenTotals.tsx +51 -0
- package/src/client/components/common/context-usage-button/index.test.tsx +26 -3
- package/src/client/components/common/context-usage-button/index.tsx +2 -0
- package/src/client/components/common/diagram-viewer/index.tsx +11 -235
- package/src/client/components/common/fullscreen-viewer/fullscreen-viewer.test.tsx +108 -0
- package/src/client/components/common/fullscreen-viewer/index.tsx +326 -0
- package/src/client/components/common/header-button/index.test.tsx +97 -0
- package/src/client/components/common/header-button/index.tsx +67 -0
- package/src/client/components/common/header-controls/index.test.tsx +17 -1
- package/src/client/components/common/header-controls/index.tsx +18 -8
- package/src/client/components/common/image-viewer/fullscreen.tsx +64 -0
- package/src/client/components/common/progress-bar/index.tsx +53 -0
- package/src/client/components/common/session-actions-menu/MenuItem.tsx +36 -0
- package/src/client/components/common/session-actions-menu/index.test.tsx +79 -0
- package/src/client/components/common/session-actions-menu/index.tsx +62 -69
- package/src/client/components/common/session-delete-modal/index.tsx +5 -0
- package/src/client/components/common/session-row/TimeCell.tsx +22 -6
- package/src/client/components/common/session-row/TrailingSlot.tsx +3 -3
- package/src/client/components/common/session-row/index.tsx +6 -3
- package/src/client/components/common/session-row/row-state.ts +18 -0
- package/src/client/components/common/session-row/session-row.test.tsx +24 -0
- package/src/client/components/common/session-row/time-cell.test.tsx +110 -0
- package/src/client/components/layout/ActivityBar.test.ts +10 -116
- package/src/client/components/layout/ActivityBar.tsx +138 -134
- package/src/client/components/layout/ActivityBarDrag.test.ts +334 -0
- package/src/client/components/layout/LeftActivityBar.test.ts +30 -5
- package/src/client/components/layout/LeftDock.tsx +19 -1
- package/src/client/components/layout/PanelButton.tsx +93 -0
- package/src/client/components/layout/{PanelVisibilityMenu.tsx → VisibilityMenu.tsx} +37 -18
- package/src/client/components/layout/desktop-layout/LeftColumn.tsx +30 -1
- package/src/client/components/layout/desktop-layout/PanelSuspense.tsx +30 -0
- package/src/client/components/layout/desktop-layout/ResizeHandle.tsx +24 -3
- package/src/client/components/layout/desktop-layout/TopNavbar.tsx +62 -6
- package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +28 -19
- package/src/client/components/layout/desktop-layout/index.tsx +7 -5
- package/src/client/components/layout/desktop-layout/resizer/index.tsx +17 -4
- package/src/client/components/layout/session-sidebar/CategoryItem.tsx +4 -2
- package/src/client/components/layout/session-sidebar/Footer.test.tsx +76 -0
- package/src/client/components/layout/session-sidebar/Footer.tsx +13 -9
- package/src/client/components/layout/session-sidebar/SessionItem.batch.test.ts +3 -0
- package/src/client/components/layout/session-sidebar/SessionItem.test.ts +21 -0
- package/src/client/components/layout/session-sidebar/SessionItem.tsx +7 -4
- package/src/client/components/layout/session-sidebar/SessionList.tsx +1 -1
- package/src/client/components/layout/session-sidebar/SessionsView.tsx +1 -0
- package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +3 -1
- package/src/client/components/layout/session-sidebar/modern/index.tsx +1 -1
- package/src/client/components/layout/session-sidebar/search-results.test.tsx +127 -0
- package/src/client/components/mobile/mobile-session-sidebar/Dialogs.tsx +1 -0
- package/src/client/components/mobile/mobile-session-sidebar/SessionRow.test.ts +31 -0
- package/src/client/components/mobile/mobile-session-sidebar/SessionRow.tsx +8 -4
- package/src/client/components/mobile/mobile-session-sidebar/use-dock.test.ts +41 -0
- package/src/client/components/mobile/mobile-session-sidebar/use-dock.ts +4 -1
- package/src/client/components/mobile/mobile-session-sidebar/use-drawer.ts +2 -0
- package/src/client/components/mobile/panel-chips.test.tsx +18 -11
- package/src/client/components/settings/categories/AppearanceSettings.tsx +3 -0
- package/src/client/components/settings/categories/HarnessSettings.tsx +3 -1
- package/src/client/components/settings/categories/NotificationSettings.test.tsx +56 -2
- package/src/client/components/settings/categories/NotificationSettings.tsx +46 -6
- package/src/client/components/settings/categories/appearance-settings/TrayIconSection.test.tsx +81 -0
- package/src/client/components/settings/categories/appearance-settings/TrayIconSection.tsx +118 -0
- package/src/client/components/settings/categories/harness-settings/HarnessCard.import.test.tsx +124 -0
- package/src/client/components/settings/categories/harness-settings/HarnessCard.tsx +21 -2
- package/src/client/components/settings/categories/harness-settings/HarnessImportControls.tsx +143 -0
- package/src/client/components/settings/categories/notification-settings/PermissionNotice.tsx +50 -0
- package/src/client/components/settings/categories/panel-plugins/GitFreshness.test.tsx +1 -1
- package/src/client/components/settings/categories/panel-plugins/LeftDockSettings.test.tsx +107 -0
- package/src/client/components/settings/categories/panel-plugins/LeftDockSettings.tsx +49 -24
- package/src/client/components/settings/categories/panel-plugins/Placement.test.tsx +3 -0
- package/src/client/components/settings/categories/panel-plugins/PluginCard.test.tsx +4 -0
- package/src/client/components/settings/categories/panel-plugins/Section.tsx +1 -1
- package/src/client/components/settings/categories/panel-plugins/Toolbar.tsx +6 -10
- package/src/client/components/settings/categories/plugin-settings/DetailPane.tsx +45 -38
- package/src/client/components/settings/categories/plugin-settings/MarketplacePane.tsx +20 -18
- package/src/client/components/settings/categories/plugin-settings/PaneHeader.tsx +40 -0
- package/src/client/components/settings/categories/plugin-settings/SidebarList.tsx +6 -9
- package/src/client/components/settings/categories/usage-settings/usage-icons.test.tsx +1 -25
- package/src/client/components/workspace/chat-timeline/GeneratingIndicator.test.ts +9 -1
- package/src/client/components/workspace/chat-timeline/MessageItem.gutter.test.ts +4 -0
- package/src/client/components/workspace/chat-timeline/chat-input/expansion.test.ts +22 -2
- package/src/client/components/workspace/chat-timeline/chat-input/expansion.ts +15 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/wait-parts.tsx +6 -11
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolScreenshots.test.tsx +9 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolScreenshots.tsx +9 -18
- package/src/client/components/workspace/context-panel/index.tsx +18 -19
- package/src/client/components/workspace/editor/SplitColumn.tsx +5 -1
- package/src/client/components/workspace/file-explorer/Toolbar.tsx +40 -28
- package/src/client/components/workspace/git-panel/RepoHeader.tsx +27 -25
- package/src/client/components/workspace/git-panel/commit-modal/CommitActions.tsx +28 -77
- package/src/client/components/workspace/git-panel/commit-modal/CommitDiffViewer.tsx +15 -15
- package/src/client/components/workspace/git-panel/commit-modal/CommitRow.test.ts +79 -5
- package/src/client/components/workspace/git-panel/commit-modal/CommitRow.tsx +66 -45
- package/src/client/components/workspace/git-panel/commit-modal/GraphCanvas.tsx +1 -7
- package/src/client/components/workspace/git-panel/commit-modal/Header.test.tsx +90 -0
- package/src/client/components/workspace/git-panel/commit-modal/Header.tsx +28 -18
- package/src/client/components/workspace/git-panel/commit-modal/index.tsx +24 -7
- package/src/client/components/workspace/git-panel/commit-modal.test.ts +16 -0
- package/src/client/components/workspace/panel-header/index.test.tsx +80 -0
- package/src/client/components/workspace/panel-header/index.tsx +46 -0
- package/src/client/components/workspace/plan-panel/index.tsx +24 -22
- package/src/client/components/workspace/plugin-panel/catalog.tsx +21 -13
- package/src/client/components/workspace/search-panel/Body.tsx +42 -37
- package/src/client/components/workspace/terminal-panel/Header.tsx +37 -38
- package/src/client/components/workspace/terminal-panel/fonts.test.ts +40 -0
- package/src/client/components/workspace/terminal-panel/fonts.ts +27 -0
- package/src/client/components/workspace/terminal-panel/mount.ts +2 -5
- package/src/client/components/workspace/todo-panel/index.tsx +28 -26
- package/src/client/components/workspace/usage-panel/index.test.tsx +91 -0
- package/src/client/components/workspace/usage-panel/index.tsx +31 -55
- package/src/client/components/workspace/wiki-panel/index.tsx +47 -46
- package/src/client/data/context-data/index.ts +16 -0
- package/src/client/data/settings/omp-schema.json +201 -151
- package/src/client/hooks/chat/composer/auto-grow.ts +13 -3
- package/src/client/hooks/chat/omp/session-sidebar-controller.folder-open.test.ts +140 -0
- package/src/client/hooks/chat/omp/session-sidebar-controller.test.ts +33 -203
- package/src/client/hooks/chat/omp/session-sidebar-controller.ts +8 -6
- package/src/client/hooks/chat/timeline/jump-landing.ts +27 -9
- package/src/client/hooks/chat/timeline/jump-rail.ts +1 -0
- package/src/client/hooks/chat/timeline/reader-input.ts +39 -0
- package/src/client/hooks/chat/timeline/restore-history.ts +55 -0
- package/src/client/hooks/chat/timeline/row-window.test.ts +36 -3
- package/src/client/hooks/chat/timeline/row-window.ts +12 -3
- package/src/client/hooks/chat/timeline/scroll-geometry.ts +95 -0
- package/src/client/hooks/chat/timeline/scroll-probe.test-util.ts +17 -4
- package/src/client/hooks/chat/timeline/scroll.test.ts +53 -0
- package/src/client/hooks/chat/timeline/scroll.ts +30 -70
- package/src/client/hooks/chat/timeline/session-load.test.ts +25 -0
- package/src/client/hooks/chat/timeline/session-load.ts +8 -1
- package/src/client/hooks/chat/timeline/session-shapes.ts +3 -0
- package/src/client/hooks/models/use-harnesses-controller.ts +8 -1
- package/src/client/hooks/models/use-harnesses.ts +68 -1
- package/src/client/hooks/ui/navbar-controls.test.ts +50 -0
- package/src/client/hooks/ui/navbar-controls.ts +118 -0
- package/src/client/hooks/ui/pointer-hover.test.ts +94 -0
- package/src/client/hooks/ui/pointer-hover.ts +62 -0
- package/src/client/hooks/ui/ui-sounds.test.ts +4 -0
- package/src/client/hooks/workspace/batch-archive.ts +19 -3
- package/src/client/hooks/workspace/batch-delete-run.ts +15 -3
- package/src/client/hooks/workspace/batch-delete.test.ts +112 -0
- package/src/client/hooks/workspace/batch-delete.ts +51 -5
- package/src/client/hooks/workspace/left-dock.ts +14 -0
- package/src/client/hooks/workspace/panel-drop-target.test.tsx +119 -0
- package/src/client/hooks/workspace/panel-drop-target.ts +76 -0
- package/src/client/hooks/workspace/panel-menu-items.ts +57 -0
- package/src/client/hooks/workspace/panel-reorder.ts +5 -2
- package/src/client/lib/browser/download.ts +12 -1
- package/src/client/lib/notifications/active.ts +26 -0
- package/src/client/lib/notifications/native-banner-sound.test.ts +34 -1
- package/src/client/lib/notifications/native-banner-sound.ts +7 -0
- package/src/client/lib/notifications/os.test.ts +53 -0
- package/src/client/lib/notifications/os.ts +129 -5
- package/src/client/lib/session-export.test.ts +72 -0
- package/src/client/lib/session-export.ts +60 -0
- package/src/client/lib/ui/control-plate.test.ts +29 -0
- package/src/client/lib/ui/control-plate.ts +42 -0
- package/src/client/main.tsx +7 -0
- package/src/client/tailwind.css +18 -7
- package/src/server/lib/changes/attach.test.ts +3 -1
- package/src/server/lib/changes/capture-bash.server.ts +15 -1
- package/src/server/lib/changes/capture-fs.server.ts +0 -8
- package/src/server/lib/changes/capture.server.ts +3 -2
- package/src/server/lib/changes/capture.test.ts +40 -0
- package/src/server/lib/changes/classify-command.test.ts +20 -0
- package/src/server/lib/changes/classify-command.ts +46 -23
- package/src/server/lib/changes/classify-git.ts +12 -11
- package/src/server/lib/changes/classify-tokenize.ts +9 -1
- package/src/server/lib/changes/journal-read.server.ts +204 -0
- package/src/server/lib/changes/reader.server.ts +28 -184
- package/src/server/lib/changes/reader.test.ts +40 -0
- package/src/server/lib/changes/scan.server.ts +102 -23
- package/src/server/lib/changes/scan.test.ts +56 -0
- package/src/server/lib/changes/sessions.server.ts +15 -0
- package/src/server/lib/changes/temp-path.test.ts +45 -0
- package/src/server/lib/changes/temp-path.ts +102 -0
- package/src/server/lib/db/schema.ts +9 -0
- package/src/server/lib/harness/acp/client.ts +12 -6
- package/src/server/lib/harness/acp/frames-replay.test.ts +55 -0
- package/src/server/lib/harness/acp/frames.ts +45 -3
- package/src/server/lib/harness/acp/protocol.ts +29 -0
- package/src/server/lib/harness/acp/replay-transcript.test.ts +47 -0
- package/src/server/lib/harness/acp/replay-transcript.ts +55 -0
- package/src/server/lib/harness/acp/replay.ts +78 -0
- package/src/server/lib/harness/acp/session-config.ts +36 -1
- package/src/server/lib/harness/acp/session-handshake.ts +32 -8
- package/src/server/lib/harness/acp/session-observers.test.ts +2 -2
- package/src/server/lib/harness/acp/session-options.ts +9 -0
- package/src/server/lib/harness/acp/session-start.ts +62 -0
- package/src/server/lib/harness/acp/session.test-util.ts +2 -0
- package/src/server/lib/harness/acp/session.ts +33 -37
- package/src/server/lib/harness/acp/v2.test.ts +44 -0
- package/src/server/lib/harness/acp/v2.ts +38 -0
- package/src/server/lib/harness/acp/verbs.test.ts +37 -1
- package/src/server/lib/harness/acp/verbs.ts +52 -6
- package/src/server/lib/harness/auto-import.server.test.ts +92 -0
- package/src/server/lib/harness/auto-import.server.ts +209 -0
- package/src/server/lib/harness/auto-probe.server.ts +9 -3
- package/src/server/lib/harness/codex/transcript.server.test.ts +67 -0
- package/src/server/lib/harness/codex/transcript.server.ts +222 -0
- package/src/server/lib/harness/schema.server.ts +15 -7
- package/src/server/lib/harness/session-delete.server.test.ts +156 -0
- package/src/server/lib/harness/session-delete.server.ts +198 -0
- package/src/server/lib/harness/session-import.server.ts +177 -0
- package/src/server/lib/harness/session-store.server.test.ts +85 -0
- package/src/server/lib/harness/session-store.server.ts +70 -3
- package/src/server/lib/harness/session-transcript.server.test.ts +183 -0
- package/src/server/lib/harness/session-transcript.server.ts +301 -0
- package/src/server/lib/harness/session.ts +4 -2
- package/src/server/lib/harness/spawn.server.ts +9 -0
- package/src/server/lib/lifecycle/after-listen.ts +11 -5
- package/src/server/lib/model-roles/mock.server.test.ts +35 -0
- package/src/server/lib/model-roles/mock.server.ts +1 -1
- package/src/server/lib/omp/rpc/frame-fold-frames.test.ts +15 -4
- package/src/server/lib/omp/session/delete-flow.server.ts +62 -9
- package/src/server/lib/omp/session/delete.server.ts +6 -0
- package/src/server/lib/omp/session/sidebar-data.harness.test.ts +86 -1
- package/src/server/lib/omp/session/sidebar-data.server.ts +41 -70
- package/src/server/lib/omp/session/sidebar-status.server.ts +82 -0
- package/src/server/lib/omp/session/telemetry/compute.ts +18 -0
- package/src/server/lib/omp/session/telemetry.test.ts +21 -0
- package/src/server/lib/realtime/topics/catalog.server.ts +2 -1
- package/src/server/lib/realtime/topics.server.ts +2 -1
- package/src/server/lib/sessions/deleted-sessions.server.test.ts +49 -0
- package/src/server/lib/sessions/deleted-sessions.server.ts +45 -0
- package/src/server/lib/tray/config.ts +19 -4
- package/src/server/lib/tray/host/darwin.js +6 -1
- package/src/server/lib/tray/host/linux.js +2 -1
- package/src/server/lib/tray/host/win32.ps1 +7 -1
- package/src/server/lib/tray/runtime.server.ts +81 -3
- package/src/server/lib/tray/tray.test.ts +20 -0
- package/src/server/routes/agent/command.ts +4 -0
- package/src/server/routes/agent/harness-command.ts +77 -3
- package/src/server/routes/agent/restore.ts +50 -0
- package/src/server/routes/chat/imported.ts +32 -0
- package/src/server/routes/chat/session.ts +33 -21
- package/src/server/routes/chat/window.ts +25 -0
- package/src/server/routes/folders/batch-delete.ts +3 -4
- package/src/server/routes/harness/root.ts +17 -1
- package/src/server/routes/harness/session-actions.ts +60 -0
- package/src/server/routes/harness/session-import.test.ts +81 -0
- package/src/server/routes/sessions/batch-archive.ts +5 -4
- package/src/server/routes/sessions/batch-delete.ts +23 -12
- package/src/server/routes/sessions/delete-acp.test.ts +70 -0
- package/src/server/routes/sessions/export.test.ts +83 -0
- package/src/server/routes/sessions/export.ts +59 -0
- package/src/server/routes/sessions/index.ts +4 -0
- package/src/server/routes/sessions/list.ts +5 -0
- package/src/server/routes/settings/root.ts +13 -0
- package/src/shared/lib/chat/export-markdown.test.ts +110 -0
- package/src/shared/lib/chat/export-markdown.ts +141 -0
- package/src/shared/lib/omp/config/schema-releases.test.ts +193 -0
- package/src/shared/lib/omp/config/schema.test.ts +0 -117
- package/src/shared/lib/realtime/connection.ts +4 -0
- package/src/shared/lib/sessions/batch-limits.test.ts +51 -0
- package/src/shared/lib/sessions/batch-limits.ts +42 -0
- package/src/shared/lib/settings/defaults.ts +2 -0
- package/src/shared/lib/theme/tray-icon-style.test.ts +43 -0
- package/src/shared/lib/theme/tray-icon-style.ts +69 -0
- package/src/shared/lib/workspace/left-dock-width.ts +23 -3
- package/src/shared/lib/workspace/left-dock.test.ts +38 -10
- package/src/shared/lib/workspace/left-dock.ts +39 -14
- package/src/shared/lib/workspace/panel-drag.test.ts +52 -0
- package/src/shared/lib/workspace/panel-drag.ts +34 -0
- package/src/shared/lib/workspace/panel-open.test.ts +7 -1
- package/src/shared/lib/workspace/session-state/store.ts +0 -1
- package/src/shared/types/context.ts +20 -0
- package/src/shared/types/harness.ts +26 -0
- package/src/shared/types/settings/state.ts +9 -0
- package/src/test-support/fake-acp-delete.ts +63 -0
- package/src/test-support/sidebar-controller-harness.test-util.ts +121 -0
- package/dist/client/static/js/DrawioView-gd14j54m.js +0 -5
- package/dist/client/static/js/ImageView-57f1ecdp.js +0 -1
- package/dist/client/static/js/LayoutWrapper-x7srbpz1.js +0 -2
- package/dist/client/static/js/Modal-0bn3f77b.js +0 -38
- package/dist/client/static/js/SessionsView-gx5q68tp.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-r8sz34h3.js +0 -1
- package/dist/client/static/js/architectureDiagram-NJMV4G6O-n0fr4hb6.js +0 -36
- package/dist/client/static/js/bash-b3rwyg5p.js +0 -1
- package/dist/client/static/js/c-jkdstn33.js +0 -1
- package/dist/client/static/js/cpp-9d3xdpe3.js +0 -1
- package/dist/client/static/js/css-r3wja1ze.js +0 -1
- package/dist/client/static/js/css-sebxkh5f.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-w2f2vev7.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-k5n61zzh.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-s3fbfwrz.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-2gf053bx.js +0 -1
- package/dist/client/static/js/graphql-p4cskvad.js +0 -1
- package/dist/client/static/js/html-f26r6vv5.js +0 -1
- package/dist/client/static/js/index-1j1s91c4.js +0 -1
- package/dist/client/static/js/index-20vhkcb9.js +0 -1
- package/dist/client/static/js/index-2mx9ej4k.css +0 -1
- package/dist/client/static/js/index-3wpsr2bc.js +0 -474
- package/dist/client/static/js/index-74scnfpk.js +0 -1
- package/dist/client/static/js/index-7kafzae0.js +0 -12
- package/dist/client/static/js/index-89a2702q.js +0 -1
- package/dist/client/static/js/index-baet2nv8.js +0 -1
- package/dist/client/static/js/index-bhng2dax.js +0 -2
- package/dist/client/static/js/index-dd4q54y0.js +0 -1
- package/dist/client/static/js/index-e99ec2f0.js +0 -1
- package/dist/client/static/js/index-fpf1jkwd.js +0 -3
- package/dist/client/static/js/index-j314me09.js +0 -1
- package/dist/client/static/js/index-m4bjsyj2.js +0 -7
- package/dist/client/static/js/index-pfwd0160.js +0 -1
- package/dist/client/static/js/index-r83kr4s5.js +0 -2
- package/dist/client/static/js/index-sjnnv1gd.js +0 -4
- package/dist/client/static/js/info-A6RAGUB7-3tr0y3s6.js +0 -1
- package/dist/client/static/js/ini-cg0a5wm3.js +0 -1
- package/dist/client/static/js/java-vcck089n.js +0 -1
- package/dist/client/static/js/javascript-nyf39d5r.js +0 -1
- package/dist/client/static/js/json-j5q8nt57.js +0 -1
- package/dist/client/static/js/jsx-ht9zyzwa.js +0 -1
- package/dist/client/static/js/lua-86fjqj8v.js +0 -1
- package/dist/client/static/js/markdown-gwmsh53r.js +0 -1
- package/dist/client/static/js/one-dark-pro-xp6ssk4z.js +0 -1
- package/dist/client/static/js/one-light-xgab7b02.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-xbsyjzrh.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-j2tpz0cs.js +0 -1
- package/dist/client/static/js/pieDiagram-5QR66LMP-7b9f4x0y.js +0 -39
- package/dist/client/static/js/properties-mzvvbqg5.js +0 -1
- package/dist/client/static/js/python-3w64wsyd.js +0 -1
- package/dist/client/static/js/r-32re2zwb.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-m3tsyfv0.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-5p202a4q.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-hj0y9tgn.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-8c5dct8f.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-3tx8z65q.js +0 -1
- package/dist/client/static/js/sql-0e9mnrda.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-5vha7thx.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-mf0rb2yv.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-0x5gf06b.js +0 -1
- package/dist/client/static/js/tsx-nm94hed6.js +0 -1
- package/dist/client/static/js/typescript-5nmrzgkj.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-x7ej8dms.js +0 -1
- package/dist/client/static/js/xml-3dd1pter.js +0 -1
- package/dist/client/static/js/yaml-yssayv8a.js +0 -1
- package/src/client/components/workspace/usage-panel/ProviderSelect.tsx +0 -229
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{d,n,i,V,o,u,a,Ar,e,gr,ui,Gn,gp,we,S,bp,Rf,ir,or,s,Pa,Be,Oa,m,In,M,D,Xe,f,B,ie,et,ae,he,fe,Tn,Jt,Dn,Y,C,ut,va,F,gi,tn,b,ce,Tu,ro,J,at,it,pt,Ve,ge}from"./index-3wpsr2bc.js";import{pp,fr}from"./index-4qt2e84b.js";var Tt={name:"folder-tree",size:24,node:[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]},_e=s(Tt);var At={name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]},je=s(At);function Ue({message:t,hasStagedChanges:c,isBusy:l=!1,amend:r=!1,seeded:p=!1,onToggleAmend:h,onChangeMessage:g,onCommit:v}){let y=t.trim().length>0&&!l&&(r||c),L=r?"Rewrite the previous commit with this message":c?"Commit staged changes":"Stage changes first";return e("div",{className:"border-t border-ink/10 bg-canvas/50 p-3 flex flex-col gap-2",children:[e("textarea",{value:t,onChange:(N)=>g(N.currentTarget.value),onKeyDown:(N)=>{if(N.key==="Enter"&&(N.metaKey||N.ctrlKey)&&y)N.preventDefault(),v()},placeholder:r?"New message for the previous commit (⌘/Ctrl+Enter to commit)":"Commit message (⌘/Ctrl+Enter to commit)",rows:5,className:"w-full resize-y min-h-[100px] max-h-[200px] bg-paper border border-ink/20 rounded px-2.5 py-1.5 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),e("div",{className:"flex items-center gap-2",children:[e("label",{className:"flex items-center gap-1.5 text-[11px] text-ink/70 cursor-pointer select-none",children:[e("input",{type:"checkbox",checked:r,onChange:(N)=>h?.(N.currentTarget.checked),className:`${ge} accent-ink cursor-pointer`}),"Amend"]}),r&&p&&e("span",{className:"text-[10px] text-ink/40",title:"The previous commit's message, loaded as an editable starting point",children:"previous message loaded"}),e("button",{type:"button",onClick:v,disabled:!y,title:L,className:"ml-auto flex items-center justify-center gap-1.5 px-3 py-1.5 rounded bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[e(f,{size:12}),r?"Amend commit":"Commit"]})]})]})}function We({operation:t,conflicts:c,isBusy:l,onAbort:r,onContinue:p}){let h=ui[t],g=c.length,v=g===0,y=t!=="stash-pop";return e("div",{className:"border-t border-warning/30 bg-warning/5 p-3 flex flex-col gap-2",children:[e("div",{className:"flex items-center gap-2 text-xs text-ink",children:[e(D,{size:13,className:"text-warning flex-shrink-0"}),e("span",{className:"font-medium",children:[h.charAt(0).toUpperCase()+h.slice(1)," in progress"]}),e("span",{className:`font-mono tabular-nums text-[10px] ${v?"text-success":"text-warning"}`,children:v?"all conflicts resolved":`${g} conflict${g===1?"":"s"} left`})]}),!v&&e("div",{className:"max-h-20 overflow-y-auto scrollbar-overlay-container font-mono text-[10px] text-warning/90 space-y-0.5",children:c.map((L)=>e("div",{className:"truncate",title:L,children:L},L))}),e("div",{className:"flex items-stretch gap-2",children:[e("button",{type:"button",onClick:r,disabled:l,title:`Abort the ${h} and restore the previous state`,className:"flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 rounded border border-error/40 text-error hover:bg-error/10 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[e(tn,{size:12}),"Abort ",h]}),y&&e("button",{type:"button",onClick:p,disabled:l||!v,title:v?`Conclude the ${h}`:`Resolve all ${g} conflict(s) first`,className:"flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 rounded border border-transparent bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[e(Tn,{size:12}),"Continue ",h]})]})]})}function qe({branchRef:t,showBranchMenu:c,setShowBranchMenu:l,branch:r,branches:p,remoteBranches:h,onCheckout:g,onMerge:v,onOpenBranchPrompt:y,onManageBranches:L,optionsRef:N,showOptions:G,setShowOptions:R,onHistory:P,onGraph:T,viewMode:k,setViewMode:x,isBusy:w=!1,syncCount:E={ahead:0,behind:0},syncing:z=!1,onSync:I,onFetch:A,detached:H=!1}){return e("div",{className:"p-3 border-b border-ink/10 bg-canvas/50 flex items-center justify-between",children:[e("div",{className:"relative",ref:t,children:[e("button",{onClick:()=>l(!c),className:"flex items-center space-x-1.5 hover:bg-ink/5 px-2 py-1 -ml-2 rounded transition-colors text-[11px] text-ink/80 font-medium",title:H?`Detached HEAD at ${r}`:`On branch ${r}`,children:[e(fe,{size:12,className:H?"text-warning":"text-ink/60"}),e("span",{className:`truncate max-w-[140px] ${H?"font-mono text-warning":""}`,children:r}),e(B,{size:12,className:"text-ink/40"})]}),c&&e("div",{className:"glass-popover absolute top-full left-0 mt-1 w-56 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs",children:e("div",{className:"max-h-48 scrollbar-overlay-container py-1",children:[p.length>0&&e(d,{children:[e("div",{className:"px-3 py-1 text-[10px] uppercase tracking-wider text-ink/40 font-semibold",children:"Local"}),p.map((O)=>e("div",{className:"flex items-center group/branch",children:[e("button",{onClick:()=>{g(O),l(!1)},className:"flex-1 min-w-0 text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[e("span",{className:"truncate",children:O}),r===O&&e(f,{size:12,className:"text-ink flex-shrink-0"})]}),r!==O&&e("button",{type:"button",onClick:()=>{v(O),l(!1)},title:`Merge ${O} into ${r}`,"aria-label":`Merge ${O} into ${r}`,className:"touch-visible opacity-0 group-hover/branch:opacity-100 px-2 py-2 text-ink/40 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer flex-shrink-0",children:e(Tn,{size:12})})]},O))]}),h.length>0&&e(d,{children:[e("div",{className:"px-3 py-1 text-[10px] uppercase tracking-wider text-ink/40 font-semibold",children:"Remote"}),h.map((O)=>e("div",{className:"flex items-center group/branch",children:[e("button",{onClick:()=>{g(O),l(!1)},className:"flex-1 min-w-0 text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[e("span",{className:"truncate",children:O}),r===O&&e(f,{size:12,className:"text-ink flex-shrink-0"})]}),r!==O&&e("button",{type:"button",onClick:()=>{v(O),l(!1)},title:`Merge ${O} into ${r}`,"aria-label":`Merge ${O} into ${r}`,className:"touch-visible opacity-0 group-hover/branch:opacity-100 px-2 py-2 text-ink/40 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer flex-shrink-0",children:e(Tn,{size:12})})]},O))]}),e("div",{className:"w-full h-px bg-ink/10 my-1"}),e("button",{onClick:()=>{y(),l(!1)},className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center space-x-2 transition-colors text-ink/80 italic",children:[e(Y,{size:12}),e("span",{children:"Create new branch..."})]}),e("button",{onClick:L,className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center space-x-2 transition-colors text-ink/80",children:[e(gi,{size:12}),e("span",{children:"Manage branches..."})]})]})})]}),e("div",{className:"flex items-center space-x-2 text-ink/40 relative",ref:N,children:[e("button",{type:"button",onClick:A,disabled:w,title:"Fetch from all remotes and prune deleted branches","aria-label":"Fetch",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:e(Pa,{size:13})}),e("button",{type:"button",onClick:I,disabled:w,title:z?"Syncing with upstream…":E.ahead>0&&E.behind>0?`Pull ${E.behind} then push ${E.ahead} commit(s)`:E.ahead>0?`Push ${E.ahead} commit(s)`:E.behind>0?`Pull ${E.behind} commit(s)`:"Up to date — sync anyway","aria-label":"Sync with upstream","aria-busy":z,className:`flex items-center gap-1 p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors disabled:cursor-not-allowed ${z?"":"disabled:opacity-40"}`,children:[e(C,{size:13,className:z?"animate-spin":"","aria-hidden":"true"}),e("span",{className:"font-mono tabular-nums text-[10px]",children:["↑",E.ahead," ↓",E.behind]})]}),e("button",{type:"button",onClick:P,title:"Commit History","aria-label":"Commit History",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:e(In,{size:13})}),e("button",{type:"button",onClick:T,title:"Git Graph","aria-label":"Git Graph",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:e(Tn,{size:13})}),e("button",{type:"button",onClick:()=>R(!G),title:"View Options","aria-label":"View Options","aria-expanded":G,className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:e(Be,{size:13})}),G&&e("div",{className:"glass-popover absolute right-0 top-full mt-1 w-36 bg-paper border border-ink/15 rounded-md shadow-lg z-50 py-1 font-mono text-xs",children:[e("button",{type:"button",onClick:()=>{x("flat"),R(!1)},className:"w-full px-3 py-1.5 text-left text-ink hover:bg-ink/5 flex items-center justify-between transition-colors",children:[e("div",{className:"flex items-center space-x-1.5",children:[e(je,{size:12,className:"text-ink/60"}),e("span",{children:"View as List"})]}),k==="flat"&&e(f,{size:12,className:"text-ink"})]}),e("button",{type:"button",onClick:()=>{x("tree"),R(!1)},className:"w-full px-3 py-1.5 text-left text-ink hover:bg-ink/5 flex items-center justify-between transition-colors",children:[e("div",{className:"flex items-center space-x-1.5",children:[e(_e,{size:12,className:"text-ink/60"}),e("span",{children:"View as Tree"})]}),k==="tree"&&e(f,{size:12,className:"text-ink"})]})]})]})]})}function Ke({activeRepo:t,repos:c,isRefreshing:l,rootPath:r,reposScanning:p,onSelectRepo:h,onRefresh:g,onRefreshRepos:v}){return e("div",{className:"p-3 border-b border-ink/10 flex items-center justify-between",children:[e("div",{className:"flex items-center gap-1.5 min-w-0",children:[e(pp,{size:12,className:"text-ink/50 flex-shrink-0","aria-hidden":!0}),e(fr,{rootPath:r,activeRepo:t,onSelectRepo:h,repos:c,scanning:p,onRefreshRepos:v})]}),e("div",{className:"flex space-x-2 text-ink/40",children:e("button",{type:"button",onClick:g,title:"Refresh","aria-label":"Refresh",className:"hover:text-ink cursor-pointer inline-flex",children:e(ut,{size:14,className:l?"animate-spin":""})})})]})}function Te({change:t,isStaged:c,repo:l,rootPath:r,onAction:p}){let h=Gn(t.status,c),{charStatus:g,colorClass:v}=h,y=t.file.split("/"),L=y.pop()||t.file,N=y.length>0?y.join("/"):"";return e("div",{className:"flex items-center justify-between px-3 py-1 hover:bg-ink/5 cursor-pointer group text-[11px] transition-colors",onClick:()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:t.file,staged:c,status:g,repo:l||".",root:r}}))},children:[e("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-2",children:[e("span",{className:`font-bold font-mono text-[10px] w-3 flex-shrink-0 text-center ${v}`,title:`Status: ${h.label}`,children:g}),e(at,{name:L,size:12,className:"flex-shrink-0"}),e("span",{className:`truncate ${v}`,title:t.file,children:L}),N&&e("span",{className:"text-[10px] text-ink/40 truncate ml-1",children:N})]}),e("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:e("div",{className:"flex items-center touch-visible opacity-0 group-hover:opacity-100 space-x-1",children:[!c&&e(d,{children:[e("button",{type:"button",onClick:(R)=>{R.stopPropagation(),p("revert",t.file)},title:"Discard Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(tn,{size:11})}),e("button",{type:"button",onClick:(R)=>{R.stopPropagation(),p("stage",t.file)},title:"Stage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Y,{size:11})})]}),c&&e("button",{type:"button",onClick:(R)=>{R.stopPropagation(),p("unstage",t.file)},title:"Unstage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Jt,{size:11})})]})})]})}function Ye({change:t,repo:c,rootPath:l,onResolve:r}){let[p,h]=n(!1),[g,v]=n(null),y=t.file.split("/"),L=y.pop()||t.file,N=y.length>0?y.join("/"):"",G=()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:t.file,staged:!1,status:t.status,repo:c,root:l}}))},R=async()=>{let k=!p;if(h(k),k&&g===null){let x=new URLSearchParams({conflictMarkers:"1",file:t.file,repo:c||"."});if(l)x.set("root",l);try{let E=await(await fetch(`/api/fs/git?${x.toString()}`)).json();v(E.markers??{})}catch{v({})}}},P=g?.ours||"ours",T=g?.theirs||"theirs";return e("div",{className:"border-b border-warning/20 last:border-b-0",children:[e("div",{className:"flex items-center justify-between px-3 py-1 hover:bg-warning/5 cursor-pointer group text-[11px] transition-colors",onClick:G,children:[e("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-2",children:[e(Oa,{size:11,className:"text-warning flex-shrink-0"}),e(at,{name:L,size:12,className:"flex-shrink-0"}),e("span",{className:"truncate text-warning",title:t.file,children:L}),N&&e("span",{className:"text-[10px] text-ink/40 truncate ml-1",children:N}),gr(t.status)&&e("span",{className:"text-[10px] text-warning/70 font-mono flex-shrink-0",children:t.status})]}),e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),R()},title:p?"Hide resolve actions":"Show resolve actions","aria-label":p?"Hide resolve actions":"Show resolve actions","aria-expanded":p,className:"w-5 h-5 flex items-center justify-center rounded text-ink/40 hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors flex-shrink-0",children:p?e(et,{size:11}):e(B,{size:11})})]}),p&&e("div",{className:"px-3 pb-2 pt-0.5 flex flex-wrap items-center gap-1.5",children:[e("button",{type:"button",onClick:()=>r(t.file,"ours"),title:`Take ${P} — \`git checkout --ours\` then stage`,className:"px-2 py-0.5 text-[10px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer max-w-[45%] truncate",children:["take ",P]}),e("button",{type:"button",onClick:()=>r(t.file,"theirs"),title:`Take ${T} — \`git checkout --theirs\` then stage`,className:"px-2 py-0.5 text-[10px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer max-w-[45%] truncate",children:["take ",T]}),e("button",{type:"button",onClick:()=>r(t.file,""),title:"Mark resolved: the file was edited by hand, this stages it",className:"px-2 py-0.5 text-[10px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer flex items-center gap-1",children:[e(f,{size:10}),"mark resolved"]})]})]})}function Bt(t){let c={id:"",name:"",path:"",type:"folder",children:[],changeCount:0};for(let r of t){let p=r.file.replace(/^[./]+/,""),h=p.endsWith("/"),g=p.replace(/\/$/,"").split("/").filter(Boolean),v=c,y="";for(let L=0;L<g.length;L++){let N=g[L];y=y?`${y}/${N}`:N;let G=L===g.length-1;if(G&&!h)v.children.push({id:y,name:N,path:y,type:"file",change:r,children:[],changeCount:1});else{let P=v.children.find((T)=>T.type==="folder"&&T.name===N);if(!P)P={id:y,name:N,path:y,type:"folder",children:[],changeCount:0,change:G&&h?r:void 0},v.children.push(P);v=P}}}function l(r){if(r.type==="file")return 1;let p=r.change?1:0;for(let h of r.children)p+=l(h);return r.changeCount=p,r.children.sort((h,g)=>{if(h.type==="folder"&&g.type==="file")return-1;if(h.type==="file"&&g.type==="folder")return 1;return h.name.localeCompare(g.name)}),p}return l(c),c.children}function Ze(t){let{sessionId:c,ready:l,read:r}=bp(),p=u(()=>Bt(t),[t]),h=u(()=>{let R=new Set;function P(T){for(let k of T)if(k.type==="folder"){if(R.add(k.id),k.children&&k.children.length>0)P(k.children)}}return P(p),R},[p]),[g,v]=S("git.expandedFolders",[]),y=u(()=>new Set(g),[g]),L=o(null);i(()=>{if(!l||L.current===c)return;if(h.size===0)return;if(L.current=c,r("git.expandedFolders",[]).length>0)return;v(Array.from(h))},[l,c,h,r,v]);let N=a((R)=>{v((P)=>{let T=new Set(P);if(T.has(R))T.delete(R);else T.add(R);return Array.from(T)})},[v]),G=a((R)=>y.has(R),[y]);return{tree:p,expandedFolders:y,toggleFolder:N,isFolderOpen:G,expandAll:()=>v(Array.from(h)),collapseAll:()=>v([])}}function Ae({node:t,isStaged:c,isFolderOpen:l,toggleFolder:r,onAction:p,repo:h,rootPath:g}){let v=t.type==="folder",y=v?l(t.id):!1;if(v)return e("div",{className:"select-none",children:[e("div",{className:"flex items-center justify-between px-2 py-1 hover:bg-ink/5 cursor-pointer rounded group transition-colors text-[11px]",onClick:()=>r(t.id),children:[e("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-1",children:[e("span",{className:"w-3.5 h-3.5 flex items-center justify-center text-ink/40 flex-shrink-0",children:y?e(B,{size:12}):e(ie,{size:12})}),e(at,{name:t.name,isFolder:!0,isOpen:y,size:13,className:"flex-shrink-0"}),e("span",{className:"font-medium text-ink truncate",children:t.name}),e("span",{className:"text-[10px] text-ink/40 font-normal px-1 py-0.2 bg-ink/5 rounded-full ml-1",children:t.changeCount})]}),e("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:e("div",{className:"flex items-center touch-visible opacity-0 group-hover:opacity-100 space-x-1",children:!c?e(d,{children:[e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),p("revert",t.path)},title:`Discard changes in ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(tn,{size:11})}),e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),p("stage",t.path)},title:`Stage ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Y,{size:11})})]}):e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),p("unstage",t.path)},title:`Unstage ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Jt,{size:11})})})})]}),y&&t.children&&t.children.length>0&&e("div",{className:"ml-3 border-l border-ink/10 pl-1",children:t.children.map((k)=>e(Ae,{node:k,isStaged:c,isFolderOpen:l,toggleFolder:r,onAction:p,repo:h,rootPath:g},k.id))})]});let L=t.change,N=Gn(L?.status||"M",c),{charStatus:G,colorClass:R}=N,P=L?L.file:t.path;return e("div",{className:"flex items-center justify-between px-2 py-0.5 hover:bg-ink/5 cursor-pointer rounded group transition-colors text-[11px]",onClick:()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:P,staged:c,status:G,repo:h||".",root:g}}))},children:[e("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-1",children:[e("span",{className:"w-3.5 h-3.5 flex items-center justify-center flex-shrink-0",children:e("span",{className:`font-bold font-mono text-[10px] ${R}`,title:`Status: ${N.label}`,children:G})}),e(at,{name:t.name,size:12,className:"flex-shrink-0"}),e("span",{className:`truncate ${R}`,title:P,children:t.name})]}),e("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:e("div",{className:"flex items-center touch-visible opacity-0 group-hover:opacity-100 space-x-1",children:!c?e(d,{children:[e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),p("revert",P)},title:"Discard Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(tn,{size:11})}),e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),p("stage",P)},title:"Stage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Y,{size:11})})]}):e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),p("unstage",P)},title:"Unstage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Jt,{size:11})})})})]})}function Fe({changes:t,isStaged:c,repo:l,rootPath:r,onAction:p}){let{tree:h,isFolderOpen:g,toggleFolder:v}=Ze(t);if(h.length===0)return null;return e("div",{className:"py-0.5",children:h.map((y)=>e(Ae,{node:y,isStaged:c,isFolderOpen:g,toggleFolder:v,onAction:p,repo:l,rootPath:r},y.id))})}function Qe({changes:t,isLoading:c,viewMode:l,repo:r,rootPath:p,onAction:h,onResolve:g}){let[v,y]=S("git.stagedExpanded",!0),[L,N]=S("git.unstagedExpanded",!0),[G,R]=S("git.conflictsExpanded",!0),P=t.filter((x)=>gr(x.status)),T=t.filter((x)=>{if(gr(x.status))return!1;let w=x.status;return w&&w[0]!==" "&&w[0]!=="?"}),k=t.filter((x)=>{if(gr(x.status))return!1;let w=x.status;return w&&w[1]!==" "&&w[1]!=="?"||w==="??"});if(c&&t.length===0)return e("div",{className:"flex-1 scrollbar-overlay-container font-mono text-[11px] text-ink/80",children:e("div",{className:"p-4 text-center text-ink/40 italic",children:"Loading..."})});if(t.length===0)return e("div",{className:"flex-1 scrollbar-overlay-container font-mono text-[11px] text-ink/80",children:e("div",{className:"p-4 text-center text-ink/40 italic",children:"No changes found."})});return e("div",{className:"flex-1 scrollbar-overlay-container font-mono text-[11px] text-ink/80",children:e("div",{className:"py-1",children:[P.length>0&&e("div",{className:"mb-2",children:[e("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-warning/5 cursor-pointer transition-colors",onClick:()=>R(!G),children:e("div",{className:"flex items-center space-x-1 font-semibold text-warning text-xs",children:[e("span",{className:"w-3 text-center",children:G?"▾":"▸"}),e("span",{children:"Conflicts"}),e("span",{className:"text-warning/70 font-normal ml-1 border border-warning/30 rounded-full px-1.5 text-[10px] bg-paper",children:P.length})]})}),G&&P.map((x)=>e(Ye,{change:x,repo:r,rootPath:p,onResolve:g??(()=>{})},`conflict-${x.file}`))]}),T.length>0&&e("div",{className:"mb-2",children:[e("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-ink/5 cursor-pointer transition-colors",onClick:()=>y(!v),children:[e("div",{className:"flex items-center space-x-1 font-semibold text-ink text-xs",children:[e("span",{className:"w-3 text-center",children:v?"▾":"▸"}),e("span",{children:"Staged Changes"}),e("span",{className:"text-ink/40 font-normal ml-1 border border-ink/20 rounded-full px-1.5 text-[10px] bg-paper",children:T.length})]}),e("div",{className:"touch-visible opacity-0 group-hover:opacity-100 flex items-center space-x-1 text-ink/40 flex-shrink-0",children:e("button",{type:"button",onClick:(x)=>{x.stopPropagation(),h("unstage_all")},title:"Unstage All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Jt,{size:12})})})]}),v&&(l==="tree"?e(Fe,{changes:T,isStaged:!0,repo:r,rootPath:p,onAction:h}):T.map((x)=>e(Te,{change:x,isStaged:!0,repo:r,rootPath:p,onAction:h},x.file+"staged")))]}),k.length>0&&e("div",{children:[e("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-ink/5 cursor-pointer transition-colors",onClick:()=>N(!L),children:[e("div",{className:"flex items-center space-x-1 font-semibold text-ink text-xs",children:[e("span",{className:"w-3 text-center",children:L?"▾":"▸"}),e("span",{children:"Changes"}),e("span",{className:"text-ink/40 font-normal ml-1 border border-ink/20 rounded-full px-1.5 text-[10px] bg-paper",children:k.length})]}),e("div",{className:"touch-visible opacity-0 group-hover:opacity-100 flex items-center space-x-1 text-ink/40 flex-shrink-0",children:[e("button",{type:"button",onClick:(x)=>{x.stopPropagation(),h("revert_all")},title:"Discard All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(tn,{size:12})}),e("button",{type:"button",onClick:(x)=>{x.stopPropagation(),h("stage_all")},title:"Stage All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Y,{size:12})})]})]}),L&&(l==="tree"?e(Fe,{changes:k,isStaged:!1,repo:r,rootPath:p,onAction:h}):k.map((x)=>e(Te,{change:x,isStaged:!1,repo:r,rootPath:p,onAction:h},x.file+"unstaged")))]})]})})}function Je({matches:t,loaded:c,total:l,hasMore:r,isFiltering:p}){if(p)return`${t} of ${c} loaded`;if(typeof l==="number"&&l>0)return r||c<l?`${c} of ${l}`:`${l} commits`;return r?`${c}+ commits`:`${c} commits`}function tt({isGraphMode:t,onToggleMode:c,searchQuery:l,onSearchChange:r,onRefresh:p,onClose:h,isRefreshing:g,totalCommits:v,loadedCount:y,totalCount:L,hasMore:N}){let G=Je({matches:v,loaded:y,total:L,hasMore:N,isFiltering:l.trim().length>0});return e("div",{className:`flex flex-col gap-2 px-3 lg:px-5 py-3 border-b border-ink/10 bg-paper select-none
|
|
2
|
-
pl-[max(0.75rem,env(safe-area-inset-left,0px))] pr-[max(0.75rem,env(safe-area-inset-right,0px))]`,children:[e("div",{className:"flex items-center justify-between gap-2 lg:gap-4",children:[e("div",{className:"flex flex-col min-w-0",children:[e("div",{className:"flex items-center gap-2.5 min-w-0",children:[e("h2",{className:"text-base font-semibold text-ink tracking-tight",children:t?"Graph":"History"}),e("span",{className:"text-[11px] font-mono px-2 py-0.5 rounded-full bg-ink/5 text-ink/50 border border-ink/10 whitespace-nowrap",children:G})]}),e("p",{className:"text-xs text-ink/50 mt-0.5 hidden lg:block",children:"Browse recent commits and inspect changed files."})]}),e("div",{className:"flex items-center gap-1.5 lg:gap-2 flex-shrink-0",children:[e("div",{className:"flex items-center bg-ink/5 p-0.5 rounded-lg border border-ink/10 text-xs",children:[e("button",{type:"button",onClick:()=>c(!1),title:"History view",className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md font-medium transition-colors cursor-pointer ${!t?"bg-paper text-ink shadow-xs":"text-ink/60 hover:text-ink hover:bg-ink/5"}`,children:[e(In,{size:13}),e("span",{className:"hidden lg:inline",children:"History"})]}),e("button",{type:"button",onClick:()=>c(!0),title:"Graph view",className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md font-medium transition-colors cursor-pointer ${t?"bg-paper text-ink shadow-xs":"text-ink/60 hover:text-ink hover:bg-ink/5"}`,children:[e(Tn,{size:13}),e("span",{className:"hidden lg:inline",children:"Graph"})]})]}),e("button",{type:"button",onClick:p,disabled:g,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md border border-ink/15 hover:bg-ink/5 text-ink/70 hover:text-ink transition-colors cursor-pointer text-xs disabled:opacity-40",title:"Refresh commit history",children:[e(va,{size:13,className:g?"animate-spin text-ink":""}),e("span",{className:"hidden lg:inline",children:"refresh"})]}),e("button",{type:"button",onClick:h,className:"p-2 -mr-1 rounded-md hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors cursor-pointer",title:"Close modal",children:e(b,{size:16})})]})]}),e("div",{className:"relative mt-1",children:[e(F,{size:13,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-ink/40"}),e("input",{type:"text",value:l,onChange:(R)=>r(R.currentTarget.value),placeholder:"Filter commits by message, author, or hash...",className:"w-full bg-ink/[0.03] border border-ink/15 rounded-md pl-8 pr-3 py-1.5 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),l&&e("button",{type:"button",onClick:()=>r(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-ink/40 hover:text-ink cursor-pointer",children:e(b,{size:12})})]})]})}var le=["#38bdf8","#f97316","#a855f7","#10b981","#ec4899","#eab308","#06b6d4","#6366f1"];function Ee(t,c){if(!t||!c)return!1;if(t===c)return!0;let l=Math.min(t.length,c.length);if(l>=4)return t.substring(0,l)===c.substring(0,l);return!1}function Re(t){let c=new Map,l=[];for(let r of t){if(typeof r.lane==="number"){c.set(r.hash,r.lane);continue}let p=l.findIndex((g)=>Ee(g,r.hash)||Ee(g,r.shortHash));if(p===-1)if(p=l.indexOf(null),p===-1)p=l.length,l.push(r.hash);else l[p]=r.hash;c.set(r.hash,p);let h=r.parents&&r.parents[0];if(h)l[p]=h;else l[p]=null;if(r.parents&&r.parents.length>1)for(let g=1;g<r.parents.length;g++){let v=r.parents[g];if(!l.some((L)=>Ee(L,v))){let L=l.indexOf(null);if(L===-1)l.push(v);else l[L]=v}}}return c}function nt(t,c,l,r){let p=[],h=new Map;t.forEach((g,v)=>{if(h.set(g.hash,v),g.shortHash)h.set(g.shortHash,v);if(g.hash.length>=7)h.set(g.hash.substring(0,7),v)});for(let g of t){let v=c.get(g.hash)??0,y=l[g.hash]??0,L=le[v%le.length];if(!g.parents||g.parents.length===0)continue;for(let N of g.parents){let G=h.get(N);if(typeof G!=="number"&&N.length>=7)G=h.get(N.substring(0,7));if(typeof G==="number"){let R=t[G],P=c.get(R.hash)??v,T=l[R.hash]??y+60;p.push({fromHash:g.hash,toHash:R.hash,fromLane:v,toLane:P,fromY:y,toY:T,color:le[v%le.length]})}else p.push({fromHash:g.hash,toHash:"tail-"+g.hash,fromLane:v,toLane:v,fromY:y,toY:Math.max(y+80,r),color:L})}}return p}function ot(t,c,l,r){if(Math.abs(t-l)<1)return`M ${t} ${c} L ${l} ${r}`;let p=r-c,h=c+p*0.45,g=r-p*0.45;return`M ${t} ${c} C ${t} ${h}, ${l} ${g}, ${l} ${r}`}function st({commits:t,nodePositions:c,selectedHash:l,hoveredHash:r,isGraphMode:p,laneWidth:h=18,paddingLeft:g=16,totalHeight:v}){let y=u(()=>{if(!p){let R=new Map;return t.forEach((P)=>R.set(P.hash,0)),R}return Re(t)},[t,p]),L=u(()=>{let R=0;return y.forEach((P)=>{if(P>R)R=P}),R},[y]),N=p?(L+1)*h+g*2:36,G=u(()=>{if(!p){let R=[];for(let P=0;P<t.length-1;P++){let T=c[t[P].hash]??P*60+20,k=c[t[P+1].hash]??(P+1)*60+20;R.push({fromHash:t[P].hash,toHash:t[P+1].hash,fromLane:0,toLane:0,fromY:T,toY:k,color:"var(--theme-ink)"})}return R}return nt(t,y,c,v)},[t,y,c,v,p]);return e("div",{className:"absolute top-0 left-0 pointer-events-none z-10",style:{width:N,height:v},children:e("svg",{className:"w-full h-full overflow-visible",style:{width:N,height:v},children:[e("defs",{children:e("filter",{id:"node-glow",x:"-20%",y:"-20%",width:"140%",height:"140%",children:e("feDropShadow",{dx:"0",dy:"0",stdDeviation:"2",floodOpacity:"0.35"})})}),G.map((R)=>{let P=p?g+R.fromLane*h:16,T=p?g+R.toLane*h:16,k=p?R.color:"currentColor",x=p?0.95:0.25,w=ot(P,R.fromY,T,R.toY);return e("path",{d:w,fill:"none",stroke:k,strokeWidth:p?2.25:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:x},`${R.fromHash}->${R.toHash}`)}),t.map((R)=>{let P=y.get(R.hash)??0,T=p?g+P*h:16,k=c[R.hash]??20,x=l===R.hash||l===R.shortHash,w=r===R.hash||r===R.shortHash,E=p?le[P%le.length]:"var(--theme-success)";return e("g",{"data-commit-node":R.hash,children:[(x||w)&&e("circle",{cx:T,cy:k,r:8,fill:E,fillOpacity:x?0.35:0.2,stroke:E,strokeWidth:1}),e("circle",{"data-commit-dot":"",cx:T,cy:k,r:p?4:4.5,fill:p?"var(--theme-paper)":E,stroke:E,strokeWidth:p?2.5:1.5,filter:"url(#node-glow)"}),p&&e("circle",{cx:T,cy:k,r:1.8,fill:E})]},`node-${R.hash}`)})]})})}function rt({commit:t,onAction:c}){return e("div",{className:"flex flex-wrap items-center gap-1.5 pt-1.5 pb-2",children:[e("button",{type:"button",onClick:(l)=>{l.stopPropagation(),c("checkout",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"checkout"}),e("button",{type:"button",onClick:(l)=>{l.stopPropagation(),c("create_branch_here",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"create branch here"}),e("button",{type:"button",onClick:(l)=>{l.stopPropagation(),c("cherry_pick",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"cherry-pick"}),e("button",{type:"button",onClick:(l)=>{l.stopPropagation(),c("revert",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"revert"}),e("button",{type:"button",onClick:(l)=>{l.stopPropagation(),c("reset",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"reset..."}),e("button",{type:"button",onClick:(l)=>{l.stopPropagation(),c("merge",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"merge into current"}),e("button",{type:"button",onClick:(l)=>{l.stopPropagation(),c("rebase",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"rebase onto this"})]})}var Ge=3;function Ft(t){let c=[];for(let l=0;l<t.length;l+=1){if(t[l].type!=="context"){c.push({row:t[l],index:l});continue}let r=l;while(r<t.length&&t[r].type==="context")r+=1;let p=r-l;if(p>Ge*2+1){for(let h=l;h<l+Ge;h+=1)c.push({row:t[h],index:h});c.push({row:{type:"elided",count:p-Ge*2},index:-1});for(let h=r-Ge;h<r;h+=1)c.push({row:t[h],index:h})}else for(let h=l;h<r;h+=1)c.push({row:t[h],index:h});l=r-1}return c}function lt({diffText:t,isLoading:c,filePath:l,fullContext:r=!1,onToggleContext:p}){let h=ro(),g=u(()=>{if(!t)return[];let N=[],G=1,R=1,P=t.split(/\r?\n/),k=P.some((x)=>x.startsWith("@@"))?P:[`@@ -0,0 +1,${P.length} @@`,...P.map((x)=>x.startsWith("+")||x.startsWith("-")?x:`+${x}`)];for(let x of k){if(x.startsWith("diff --git")||x.startsWith("index ")||x.startsWith("---")||x.startsWith("+++")||x.startsWith("new file mode")||x.startsWith("deleted file mode")||x.startsWith("similarity index")||x.startsWith("old mode")||x.startsWith("new mode")||x.startsWith("\\ No newline"))continue;if(x.startsWith("@@")){let w=x.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(w)G=parseInt(w[1],10),R=parseInt(w[2],10);N.push({type:"meta",text:x})}else if(x.startsWith("+"))N.push({type:"add",text:x.slice(1),newNum:R++});else if(x.startsWith("-"))N.push({type:"del",text:x.slice(1),oldNum:G++});else{let w=x.startsWith(" ")?x.slice(1):x;N.push({type:"context",text:w,oldNum:G++,newNum:R++})}}return N},[t]),v=pt(l),y=u(()=>{let N=Array(g.length).fill(""),G=-1,R=(P)=>{if(G<0)return;let T=Tu(g.slice(G,P).map((k)=>k.text).join(`
|
|
3
|
-
`),v);for(let k=G;k<P;k++)N[k]=T[k-G]??"";G=-1};return g.forEach((P,T)=>{if(P.type==="meta")R(T);else if(G<0)G=T}),R(g.length),N},[g,v,h]),L=u(()=>r?g.map((N,G)=>({row:N,index:G})):Ft(g),[g,r]);if(c)return e("div",{className:"my-2 p-4 rounded bg-canvas border border-ink/10 text-ink/40 font-mono text-xs flex items-center justify-center",children:"Loading commit diff..."});if(!t||g.length===0)return e("div",{className:"my-2 p-3 rounded bg-canvas border border-ink/10 text-ink/40 font-mono text-xs text-center",children:"No diff content available for this file."});return e("div",{className:"my-2 rounded border border-ink/15 bg-paper overflow-hidden text-[11px] font-mono leading-relaxed shadow-xs text-ink",children:[e("div",{className:"flex items-center justify-between px-3 py-1.5 bg-canvas border-b border-ink/10 text-ink/70 text-[10.5px]",children:[e("span",{className:"font-semibold text-meta",children:"Diff preview"}),e("button",{type:"button",onClick:p,disabled:!p,className:"hover:text-ink flex items-center gap-1 cursor-pointer transition-colors disabled:opacity-40 disabled:cursor-default",title:r?"Show only the changed hunks":"Read the whole file around the change","aria-pressed":r,children:r?e(d,{children:[e(et,{size:12})," Collapse context"]}):e(d,{children:[e(B,{size:12})," Expand all context"]})})]}),e("div",{className:"overflow-x-auto max-h-72 select-text",children:e("div",{className:"w-max min-w-full divide-y divide-ink/[0.04]",children:L.map(({row:N,index:G},R)=>{if(N.type==="elided")return e("div",{className:"px-3 py-1 bg-canvas text-ink/40 text-[10px] text-center select-none",title:`${N.count} unchanged line(s) hidden`,children:["⋯ ",N.count," unchanged line",N.count===1?"":"s"," hidden ⋯"]},`elided-${R}`);let P=N,T=G;if(P.type==="meta")return e("div",{className:"flex items-center gap-2 px-3 py-1 bg-canvas border-y border-ink/10 text-meta text-[10px] font-semibold",children:[e("span",{children:"↕"}),e("span",{children:P.text})]},T);let k=P.type==="add",x=P.type==="del";return e("div",{className:`flex items-start font-mono ${k?"bg-success/10 hover:bg-success/15":x?"bg-error/10 hover:bg-error/15":"text-ink hover:bg-ink/[0.02]"}`,children:[e("div",{className:`w-10 flex-shrink-0 text-right pr-2 py-0.5 select-none border-r border-ink/10 text-[10px] tabular-nums font-mono ${x?"bg-error/15 text-error font-semibold":k?"bg-success/15 text-success/70":"bg-canvas/50 text-ink/40"}`,children:P.oldNum??(k?"+":"")}),e("div",{className:`w-10 flex-shrink-0 text-right pr-2 py-0.5 select-none border-r border-ink/10 text-[10px] tabular-nums font-mono ${k?"bg-success/15 text-success font-semibold":x?"bg-error/15 text-error/70":"bg-canvas/50 text-ink/40"}`,children:P.newNum??(x?"-":"")}),e("div",{className:`w-4 flex-shrink-0 text-center py-0.5 select-none font-bold ${k?"text-success":x?"text-error":"opacity-0"}`,children:k?"+":x?"-":" "}),e("div",{className:"flex-1 py-0.5 pr-3 whitespace-pre text-ink",children:P.text?e("span",{className:"shiki",dangerouslySetInnerHTML:{__html:y[T]}}):" "})]},T)})})})]})}function ct({commit:t,isSelected:c,isGraphMode:l,onSelect:r,onAction:p,onToggleFile:h,isExpandedFile:g,isLoadingFile:v,isFullContextFile:y,onToggleContext:L,fileDiffs:N,headerRef:G}){let[R,P]=n(!1),[T,k]=n(!1),x=t.body?.trim()??"",w=x.length>0,E=(A)=>{A.stopPropagation(),navigator.clipboard.writeText(t.hash),P(!0),setTimeout(()=>P(!1),2000)},z=(A,H)=>{A.stopPropagation(),h(t.hash,H)};return e("div",{onClick:()=>{if(r(t),!w)return;let A=globalThis.getSelection?.();if(A&&!A.isCollapsed)return;k((H)=>!H)},"data-testid":"commit-row","data-commit-hash":t.hash,className:`border-b border-ink/5 transition-colors cursor-pointer ${c?"bg-ink/[0.03]":"hover:bg-ink/[0.015]"}`,children:e("div",{className:"py-2.5 pr-4 pl-1 flex flex-col",children:[e("div",{className:"flex flex-col gap-1",children:[t.refs&&t.refs.length>0&&e("div",{className:"flex flex-wrap items-center gap-1.5 pb-0.5",children:t.refs.map((A,H)=>{let O=A.includes("stash"),X=A.includes("HEAD")||A.includes("main")||A.includes("master");return e("span",{className:`px-2 py-0.5 rounded text-[10px] font-mono border ${O?"bg-warning/10 text-warning border-warning/25 font-semibold":X?"bg-ink/10 text-ink font-semibold border-ink/20":"bg-canvas text-meta border-ink/10 font-medium"}`,children:A},H)})}),e("div",{ref:G,className:"flex items-start gap-1.5",children:[e("span",{"data-commit-title":"",className:"text-[13px] font-semibold text-ink leading-snug break-words flex-1 min-w-0",children:t.message}),w&&e("span",{className:"text-ink/40 flex-shrink-0 mt-0.5","aria-hidden":"true",children:T?e(B,{size:13}):e(ie,{size:13})})]}),w&&T&&e("div",{className:"text-[12px] text-ink/70 leading-relaxed whitespace-pre-wrap break-words border-l-2 border-ink/15 pl-2.5 py-0.5 font-mono",children:x}),e("div",{className:"flex items-center gap-2 text-[11px] text-ink/50 font-mono flex-wrap",children:[e("span",{children:t.author}),e("span",{children:"•"}),e("span",{children:t.date}),e("span",{children:"•"}),e("button",{type:"button",onClick:E,title:"Copy commit hash",className:"inline-flex items-center gap-1 hover:text-ink transition-colors cursor-pointer text-ink/70",children:[e("span",{children:t.shortHash}),R?e(f,{size:11,className:"text-success"}):e(ae,{size:11})]})]})]}),(c||l)&&e("div",{className:"mt-2",children:e(rt,{commit:t,onAction:p})}),t.files&&t.files.length>0&&e("div",{className:"mt-2 flex flex-col gap-1",children:t.files.map((A,H)=>{let O=g(t.hash,A.file),X=`${t.hash}:${A.file}`,te=N[X]!==void 0?N[X]:A.diff,j=v(t.hash,A.file),K=A.status==="A"?"text-success font-bold":A.status==="D"?"text-error font-bold":A.status==="R"?"text-meta font-bold":"text-info font-bold";return e("div",{className:"flex flex-col",children:[e("div",{onClick:(W)=>z(W,A),className:"flex items-center gap-2 py-1 px-2 rounded hover:bg-ink/5 text-[11.5px] font-mono text-ink/80 transition-colors group cursor-pointer border border-transparent hover:border-ink/10",children:[e("span",{className:`w-3.5 text-center flex-shrink-0 text-[11px] ${K}`,children:A.status||"M"}),e("span",{className:"truncate flex-1 min-w-0 text-ink/90 group-hover:text-ink font-medium",children:A.file}),e("span",{className:"flex items-center gap-1 text-[10.5px] tabular-nums flex-shrink-0 font-medium",children:[e("span",{className:"text-success",children:["+",A.additions]}),e("span",{className:"text-ink/30",children:"/"}),e("span",{className:"text-error",children:["-",A.deletions]})]}),e("span",{className:"text-ink/40 group-hover:text-ink flex-shrink-0",children:O?e(B,{size:13}):e(ie,{size:13})})]}),O&&e("div",{className:"pl-4 pr-1",children:e(lt,{diffText:te,isLoading:j,filePath:A.file,fullContext:y(t.hash,A.file),onToggleContext:()=>L(t.hash,A)})})]},H)})})]})})}var xe=50;function Et(t){if(!Array.isArray(t))return[];let c=[];for(let l of t){if(!l||typeof l!=="object")continue;let r=l;if(typeof r.file!=="string"||!r.file)continue;c.push({file:r.file,status:typeof r.status==="string"?r.status:"M",additions:typeof r.additions==="number"&&Number.isFinite(r.additions)?r.additions:0,deletions:typeof r.deletions==="number"&&Number.isFinite(r.deletions)?r.deletions:0,diff:typeof r.diff==="string"?r.diff:void 0})}return c}function ze(t){if(!Array.isArray(t))return[];let c=[];for(let l of t){if(!l||typeof l!=="object")continue;let r=l,p=typeof r.hash==="string"&&r.hash?r.hash:"";if(!p)continue;c.push({hash:p,shortHash:typeof r.shortHash==="string"&&r.shortHash?r.shortHash:p.slice(0,8),author:typeof r.author==="string"?r.author:"Unknown",date:typeof r.date==="string"?r.date:typeof r.time==="string"?r.time:"",message:typeof r.message==="string"?r.message:"",body:typeof r.body==="string"?r.body:void 0,parents:Array.isArray(r.parents)?r.parents.filter((h)=>typeof h==="string"):[],refs:Array.isArray(r.refs)?r.refs.filter((h)=>typeof h==="string"):[],files:Et(r.files),lane:typeof r.lane==="number"?r.lane:void 0})}return c}function dt({output:t,isGraphMode:c,rootPath:l,activeRepo:r}){let[p,h]=n(!1),[g,v]=n(t?.hasMore??t?.data?.length===xe),[y,L]=n(t?.total),N=u(()=>ze(t?.data),[t?.data]),G=Array.isArray(t?.data)?t.data.length:0,[R,P]=n(N),[T,k]=n(G);i(()=>{if(P(N),k(G),v(t?.hasMore??G===xe),typeof t?.total==="number")L(t.total)},[N,G,t?.hasMore,t?.total]);let x=a(async()=>{if(p||!g)return;h(!0);try{let w=new FormData;if(w.set("actionType",c?"graph":"history"),w.set("limit",String(xe)),w.set("skip",String(T)),l)w.set("root",l);if(r)w.set("repo",r);let z=await(await fetch("/api/fs/git",{method:"POST",body:w})).json();if(z.success&&Array.isArray(z.data)){let I=ze(z.data),A=z.data.length;if(P((H)=>{let O=new Set(H.map((te)=>te.hash)),X=I.filter((te)=>!O.has(te.hash));return[...H,...X]}),k((H)=>H+A),v(Boolean(z.hasMore??A===xe)),typeof z.total==="number")L(z.total)}else v(!1)}catch(w){console.error("Failed to load more commits:",w)}finally{h(!1)}},[p,g,c,T,l,r]);return{commits:R,hasMore:g,totalCount:y,isLoadingMore:p,handleLoadMore:x}}function mt({onExecuteAction:t,rootPath:c,activeRepo:l}){let[r,p]=n({}),[h,g]=n(new Set),[v,y]=n(new Set),[L,N]=n(new Set),G=a(async(k,x,w)=>{let E=`${k}:${x.file}`;y((z)=>new Set(z).add(E));try{let z=new FormData;if(z.set("actionType","commit_diff"),z.set("hash",k),z.set("file",x.file),w)z.set("full","1");if(c)z.set("root",c);if(l&&l!==".")z.set("repo",l);let A=await(await fetch("/api/fs/git",{method:"POST",body:z})).json();if(A&&typeof A.diff==="string")p((H)=>({...H,[E]:A.diff}));else if(A&&A.error)p((H)=>({...H,[E]:`// Error: ${A.error}`}))}catch(z){console.error("Failed to load file diff:",z);let I=z instanceof Error?z.message:"Network error";p((A)=>({...A,[E]:`// Error loading diff: ${I}`}))}finally{y((z)=>{let I=new Set(z);return I.delete(E),I})}},[c,l]),R=a(async(k,x)=>{let w=`${k}:${x.file}`,E=!h.has(w);if(g((z)=>{let I=new Set(z);if(I.has(w))I.delete(w);else I.add(w);return I}),E&&r[w]===void 0&&!x.diff)await G(k,x,!1)},[h,r,G]),P=a(async(k,x)=>{let w=`${k}:${x.file}`,E=!L.has(w);N((z)=>{let I=new Set(z);if(I.has(w))I.delete(w);else I.add(w);return I}),await G(k,x,E)},[L,G]),T=a((k,x)=>{if(!t)return;if(k==="checkout")t("checkout",void 0,{branch:x.hash});else if(k==="create_branch_here"){let w=window.prompt(`Create new branch at commit ${x.shortHash}:`,`branch-${x.shortHash}`);if(w?.trim())t("create_branch_at",void 0,{branch:w.trim(),hash:x.hash})}else if(k==="cherry_pick"){if(window.confirm(`Cherry-pick commit ${x.shortHash} onto current branch?`))t("cherry_pick",void 0,{hash:x.hash})}else if(k==="revert"){if(window.confirm(`Revert commit ${x.shortHash}?`))t("revert_commit",void 0,{hash:x.hash})}else if(k==="reset"){let w=window.prompt(`Reset current branch to ${x.shortHash} (soft, mixed, hard):`,"soft");if(w&&["soft","mixed","hard"].includes(w.toLowerCase()))t("reset_commit",void 0,{hash:x.hash,mode:w.toLowerCase()})}else if(k==="merge"){if(window.confirm(`Merge commit ${x.shortHash} into current branch?`))t("merge_commit",void 0,{hash:x.hash})}else if(k==="rebase"){if(window.confirm(`Rebase current branch onto commit ${x.shortHash}?`))t("rebase_commit",void 0,{hash:x.hash})}},[t]);return{fileDiffs:r,expandedFiles:h,loadingFiles:v,fullContextFiles:L,handleToggleFile:R,handleToggleContext:P,handleCommitAction:T}}function He({output:t,onClose:c,onRefresh:l,onExecuteAction:r,rootPath:p,activeRepo:h}){if(!t)return null;let[g,v]=n(()=>({title:t.title,graph:t.title.toLowerCase().includes("graph")}));if(g.title!==t.title)v({title:t.title,graph:t.title.toLowerCase().includes("graph")});let y=g.graph,L=(U)=>v((_)=>({..._,graph:U})),[N,G]=n(""),[R,P]=n(""),[T,k]=n(!1),{commits:x,hasMore:w,totalCount:E,isLoadingMore:z,handleLoadMore:I}=dt({output:t,isGraphMode:y,rootPath:p,activeRepo:h}),{fileDiffs:A,expandedFiles:H,loadingFiles:O,fullContextFiles:X,handleToggleFile:te,handleToggleContext:j,handleCommitAction:K}=mt({onExecuteAction:r,rootPath:p,activeRepo:h});i(()=>{if(x.length>0&&!R)P(x[0].hash)},[x,R]);let W=u(()=>{if(!N.trim())return x;let U=N.toLowerCase().trim();return x.filter((_)=>_.message.toLowerCase().includes(U)||_.author.toLowerCase().includes(U)||_.shortHash.toLowerCase().includes(U)||_.hash.toLowerCase().includes(U)||_.refs?.some((ee)=>ee.toLowerCase().includes(U)))},[x,N]),ne=o(null),se=o(null),be=o(null),de=o({}),[pe,ve]=n({}),[Se,Pe]=n(800);i(()=>{let U=be.current;if(!U||!w||z||N.trim())return;let _=new IntersectionObserver((ee)=>{if(ee[0].isIntersecting)I()},{root:ne.current,threshold:0.1});return _.observe(U),()=>_.disconnect()},[w,z,N,I]);let re=a(()=>{if(!ne.current||!se.current)return;let U=ne.current.getBoundingClientRect(),_=ne.current.scrollTop,ee={};W.forEach((me,Le)=>{let ue=de.current[me.hash];if(ue){let oe=ue.getBoundingClientRect();ee[me.hash]=oe.top+oe.height/2-U.top+_}else ee[me.hash]=Le*60+20}),ve(ee);let Ce=se.current.offsetHeight;Pe(Math.max(Ce,ne.current.clientHeight,600))},[W]);V(()=>{re();let U=requestAnimationFrame(()=>{re()});return()=>cancelAnimationFrame(U)},[re,W,A,H,y,R]),i(()=>{let U=se.current;if(!U)return;let _=new ResizeObserver(()=>{re()});_.observe(U);for(let ee of Array.from(U.children))_.observe(ee);return()=>_.disconnect()},[re,W]);let Z=u(()=>Re(W),[W]),$e=u(()=>{let U=0;return Z.forEach((_)=>{if(_>U)U=_}),U},[Z]),ye=18,ke=16,Me=y?($e+1)*ye+ke*2:36;return e("div",{className:"fixed inset-0 z-50 modal-scrim backdrop-blur-xs flex items-center justify-center p-0 lg:p-5",onClick:c,role:"dialog","aria-modal":"true",children:e("div",{className:`glass-overlay bg-paper border-ink/20 shadow-2xl flex flex-col overflow-hidden
|
|
4
|
-
w-full h-full rounded-none border-0
|
|
5
|
-
lg:w-[min(94vw,1200px)] lg:h-[88vh] lg:rounded-xl lg:border
|
|
6
|
-
pt-[env(safe-area-inset-top,0px)] lg:pt-0`,onClick:(U)=>U.stopPropagation(),children:[e(tt,{isGraphMode:y,onToggleMode:L,searchQuery:N,onSearchChange:G,onRefresh:()=>{k(!0),l?.(),setTimeout(()=>k(!1),600)},onClose:c,isRefreshing:T,totalCommits:W.length,loadedCount:x.length,totalCount:E,hasMore:w}),e("div",{ref:ne,className:"flex-1 overflow-y-auto scrollbar-overlay-container relative select-text",children:W.length===0?e("div",{className:"flex flex-col items-center justify-center py-20 text-ink/40 font-mono text-xs",children:N.trim()?"No matching commits found.":"No commits in this branch."}):e("div",{className:"relative min-h-full pb-8",children:[e(st,{commits:W,nodePositions:pe,selectedHash:R,isGraphMode:y,laneWidth:ye,paddingLeft:ke,totalHeight:Se}),e("div",{ref:se,className:"flex flex-col relative z-20",style:{paddingLeft:`${Me}px`},children:[W.map((U)=>e(ct,{commit:U,isSelected:R===U.hash,isGraphMode:y,onSelect:(_)=>P(_.hash),onAction:K,onToggleFile:te,isExpandedFile:(_,ee)=>H.has(`${_}:${ee}`),isLoadingFile:(_,ee)=>O.has(`${_}:${ee}`),isFullContextFile:(_,ee)=>X.has(`${_}:${ee}`),onToggleContext:j,fileDiffs:A,headerRef:(_)=>{de.current[U.hash]=_}},U.hash)),e("div",{ref:be,className:"pt-3 pb-4 px-4 flex items-center justify-center",children:z?e("div",{className:"flex items-center gap-2 text-xs text-ink/60 font-mono py-2",children:[e(m,{size:14,className:"animate-spin text-info"}),e("span",{children:"Loading more commits..."})]}):w&&!N.trim()?e("button",{type:"button",onClick:I,className:"px-3 py-1.5 text-xs font-mono text-ink/70 hover:text-ink bg-ink/5 hover:bg-ink/10 rounded-md border border-ink/10 transition-colors cursor-pointer",children:"Load more commits..."}):W.length>10?e("div",{className:"text-[11px] font-mono text-ink/40 py-2",children:["End of commit history (",typeof E==="number"&&E>0?E:x.length," commits)"]}):null})]})]})})]})})}function ft({children:t,onClose:c}){return e("div",{className:"fixed inset-0 z-50 modal-scrim flex items-center justify-center p-4",onClick:c,role:"dialog","aria-modal":"true",children:e("div",{className:"glass-overlay bg-paper border border-ink/20 rounded-lg shadow-xl flex flex-col overflow-hidden w-[min(94vw,420px)] max-h-[80vh]",onClick:(l)=>l.stopPropagation(),children:t})})}function ht({modal:t,onClose:c,onConfirm:l}){if(!t)return null;return e(ft,{onClose:c,children:[e("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-ink/10",children:[e(D,{size:16,className:"text-error flex-shrink-0"}),e("h3",{className:"text-sm font-semibold text-ink",children:"Confirm Action"})]}),e("div",{className:"px-4 py-4 text-xs text-ink/80 leading-relaxed",children:t.message}),e("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[e("button",{type:"button",onClick:c,className:"px-3 py-1.5 rounded border border-ink/20 text-ink/70 hover:bg-ink/5 hover:text-ink transition-colors cursor-pointer text-xs",children:"Cancel"}),e("button",{type:"button",onClick:l,className:"px-3 py-1.5 rounded bg-error text-canvas hover:bg-error/90 transition-colors cursor-pointer text-xs font-medium",children:"Confirm"})]})]})}function gt({isOpen:t,branchName:c,inputRef:l,onChange:r,onClose:p,onCreate:h}){if(!t)return null;let g=a(()=>{if(c.trim())h()},[c,h]);return e(ft,{onClose:p,children:[e("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-ink/10",children:[e(Tn,{size:16,className:"text-ink/60 flex-shrink-0"}),e("h3",{className:"text-sm font-semibold text-ink",children:"Create New Branch"})]}),e("div",{className:"px-4 py-4",children:e("input",{ref:l,type:"text",value:c,onChange:(v)=>r(v.currentTarget.value),onKeyDown:(v)=>{if(v.key==="Enter")g();if(v.key==="Escape")p()},placeholder:"branch-name",className:"w-full bg-canvas border border-ink/20 rounded px-3 py-2 text-xs focus:outline-none focus:border-ink/40 text-ink placeholder-ink/40 transition-colors"})}),e("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[e("button",{type:"button",onClick:p,className:"px-3 py-1.5 rounded border border-ink/20 text-ink/70 hover:bg-ink/5 hover:text-ink transition-colors cursor-pointer text-xs",children:"Cancel"}),e("button",{type:"button",onClick:g,disabled:!c.trim(),className:"px-3 py-1.5 rounded bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:"Create"})]})]})}function xt({branch:t,detached:c,onCheckout:l,onMerge:r,onRename:p,onDelete:h}){let g=t.current&&!c;return e("div",{className:"grid grid-cols-[1rem_minmax(0,1fr)_minmax(0,9.5rem)_4.25rem_4rem] items-start gap-x-2 px-4 py-2 border-b border-ink/5 last:border-b-0 hover:bg-ink/[0.02] group/row transition-colors",children:[e("div",{className:"h-5 flex items-center justify-center",children:g&&e(f,{size:12,className:"text-ink","aria-label":"Current branch"})}),e("button",{type:"button",onClick:l,disabled:g,title:g?"Already on this branch":`Check out ${t.name}`,className:"min-w-0 text-left cursor-pointer disabled:cursor-default",children:[e("div",{className:"h-5 flex items-center gap-1.5 min-w-0",children:[e(fe,{size:11,className:g?"text-ink/60 flex-shrink-0":"text-ink/40 flex-shrink-0"}),e("span",{className:`truncate text-xs ${g?"font-semibold text-ink":"text-ink/90"}`,children:t.name})]}),t.subject&&e("div",{className:"h-4 flex items-center pl-[18px] min-w-0",children:e("span",{className:"truncate text-[10px] text-ink/40",title:t.subject,children:t.subject})})]}),e("div",{className:"h-5 flex items-center justify-end min-w-0",children:e(zt,{branch:t})}),e("div",{className:"h-5 flex items-center justify-end",children:t.date&&e("span",{className:"text-[10px] text-ink/40 truncate",children:t.date})}),e("div",{className:"h-5 flex items-center justify-end gap-0.5 touch-visible opacity-0 group-hover/row:opacity-100",children:[!g&&e("button",{type:"button",onClick:r,title:`Merge ${t.name} into the current branch`,"aria-label":`Merge ${t.name} into the current branch`,className:"w-5 h-5 flex items-center justify-center rounded text-ink/40 hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Tn,{size:11})}),e("button",{type:"button",onClick:p,title:`Rename ${t.name}`,"aria-label":`Rename ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded text-ink/40 hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Dn,{size:11})}),!g&&e("button",{type:"button",onClick:h,title:`Delete ${t.name}`,"aria-label":`Delete ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded text-ink/40 hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(M,{size:11})})]})]})}function zt({branch:t}){if(t.gone)return e("span",{className:"text-[10px] font-mono text-warning border border-warning/30 rounded px-1 truncate",title:`${t.upstream} no longer exists on the remote — fetch --prune to drop it`,children:"gone"});if(!t.upstream)return e("span",{className:"text-[10px] font-mono text-ink/40 truncate",title:"No upstream: this branch has never been published",children:"unpublished"});return e("span",{className:"flex items-center gap-1 text-[10px] font-mono text-ink/50 min-w-0",children:[e("span",{className:"truncate",title:t.upstream,children:t.upstream}),(t.ahead>0||t.behind>0)&&e("span",{className:"tabular-nums text-ink/70 flex-shrink-0",children:[t.ahead>0&&`↑${t.ahead}`,t.behind>0&&`↓${t.behind}`]})]})}function bt({branch:t,onClose:c,onSubmit:l}){if(!t)return null;return e(Ht,{branch:t,onClose:c,onSubmit:l})}function Ht({branch:t,onClose:c,onSubmit:l}){let[r,p]=n(t.name),[h,g]=n(!1),v=r.trim(),y=v===t.name,L=v.length>0&&!y,N=()=>{if(L)l(t.name,v,h)};return e(J,{onClose:c,maxWidthClass:"max-w-[min(94vw,460px)]",header:e("div",{className:"flex items-center gap-2",children:[e("h2",{className:"text-sm font-semibold text-ink",children:"Rename branch"}),e("span",{className:"text-[10px] font-mono text-ink/50 truncate",children:t.name})]}),children:[e("div",{className:"px-5 py-4 flex flex-col gap-3",children:[e("div",{children:[e("label",{className:"text-[10px] uppercase tracking-wider text-ink/50 font-semibold",htmlFor:"branch-rename-input",children:"New name"}),e("input",{id:"branch-rename-input",type:"text",value:r,autoFocus:!0,onChange:(G)=>p(G.currentTarget.value),onKeyDown:(G)=>{if(G.key==="Enter")N();if(G.key==="Escape")c()},className:"mt-1 w-full bg-paper border border-ink/20 rounded px-2.5 py-1.5 text-xs font-mono text-ink focus:outline-none focus:border-ink/40 transition-colors"}),y&&v.length>0&&e("p",{className:"mt-1 text-[10px] text-ink/50",children:"The name is unchanged."})]}),e("div",{className:"text-[10px] font-mono text-ink/60 flex flex-col gap-0.5 border border-ink/10 rounded p-2 bg-canvas/40",children:[e("div",{className:"flex items-center justify-between gap-2",children:[e("span",{className:"text-ink/40",children:"upstream"}),e("span",{className:"truncate",children:t.upstream||"none (unpublished)"})]}),e("p",{className:"text-ink/40 leading-relaxed mt-0.5",children:"A local rename keeps this upstream unchanged — a plain push afterwards will refuse until the upstream matches the new name, which is what the remote option below does."})]}),e("label",{className:"flex items-start gap-2 text-[11px] text-ink/80 cursor-pointer select-none",children:[e("input",{type:"checkbox",checked:h,onChange:(G)=>g(G.currentTarget.checked),className:`${ge} accent-ink cursor-pointer mt-0.5`}),e("span",{className:"flex flex-col gap-0.5",children:[e("span",{children:"Also rename it on the remote"}),e("span",{className:"text-[10px] font-mono text-ink/50",children:["git push -u ",t.upstream?t.upstream.split("/")[0]:"origin"," ",v||"<new>",e("br",{}),"git push ",t.upstream?t.upstream.split("/")[0]:"origin"," --delete ",t.name,e("br",{}),"git fetch --prune"]})]})]})]}),e("div",{className:"flex items-center justify-end gap-2 px-5 py-3 border-t border-ink/10",children:[e("button",{type:"button",onClick:c,className:"px-3 py-1.5 rounded border border-ink/20 text-ink/70 hover:bg-ink/5 hover:text-ink transition-colors cursor-pointer text-xs",children:"Cancel"}),e("button",{type:"button",onClick:N,disabled:!L,className:"px-3 py-1.5 rounded bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:"Rename"})]})]})}function vt({branch:t,force:c,onForceChange:l,onClose:r,onConfirm:p}){if(!t)return null;return e(J,{onClose:r,maxWidthClass:"max-w-[min(94vw,440px)]",header:e("div",{className:"flex items-center gap-2",children:[e(D,{size:15,className:"text-error flex-shrink-0"}),e("h2",{className:"text-sm font-semibold text-ink",children:"Delete branch"})]}),children:[e("div",{className:"px-5 py-4 flex flex-col gap-3 text-xs text-ink/80 leading-relaxed",children:[e("p",{children:["Delete ",e("span",{className:"font-mono font-semibold text-ink",children:t.name}),t.upstream&&e(d,{children:[" ","(tracks ",e("span",{className:"font-mono",children:t.upstream}),")"]}),"?"]}),e("div",{className:"text-[10px] font-mono text-ink/60 border border-ink/10 rounded p-2 bg-canvas/40 flex flex-col gap-0.5",children:[e("div",{className:"flex items-center justify-between gap-2",children:[e("span",{className:"text-ink/40",children:"last commit"}),e("span",{className:"truncate",children:t.subject||"–"})]}),e("div",{className:"flex items-center justify-between gap-2",children:[e("span",{className:"text-ink/40",children:"when"}),e("span",{children:t.date||"–"})]})]}),e("label",{className:"flex items-start gap-2 cursor-pointer select-none text-[11px]",children:[e("input",{type:"checkbox",checked:c,onChange:(h)=>l(h.currentTarget.checked),className:`${ge} accent-error cursor-pointer mt-0.5`}),e("span",{className:"flex flex-col gap-0.5",children:[e("span",{className:"text-error font-medium",children:"Delete even if its commits are not merged"}),e("span",{className:"text-[10px] font-mono text-ink/50",children:["git branch ",c?"-D":"-d"," ",t.name]}),e("span",{className:"text-ink/50",children:"Without this, git refuses when the branch holds commits no other branch has. Leaving it off is the safe default."})]})]})]}),e("div",{className:"flex items-center justify-end gap-2 px-5 py-3 border-t border-ink/10",children:[e("button",{type:"button",onClick:r,className:"px-3 py-1.5 rounded border border-ink/20 text-ink/70 hover:bg-ink/5 hover:text-ink transition-colors cursor-pointer text-xs",children:"Cancel"}),e("button",{type:"button",onClick:()=>p(t.name),className:"px-3 py-1.5 rounded bg-error text-canvas hover:bg-error/90 transition-colors cursor-pointer text-xs font-medium",children:["Delete ",c?"(force)":""]})]})]})}function yt({isOpen:t,rootPath:c,repo:l,currentBranch:r,detached:p,isBusy:h,onClose:g,onAction:v,onConfirmDelete:y}){let[L,N]=n([]),[G,R]=n(!1),[P,T]=n(null),[k,x]=n(""),[w,E]=n(null),[z,I]=n(null),[A,H]=n(!1),O=a(async()=>{R(!0),T(null);let j=new URLSearchParams({branches:"1",repo:l||"."});if(c)j.set("root",c);try{let K=await fetch(`/api/fs/git?${j.toString()}`),W=await K.json();if(W.success&&Array.isArray(W.branches))N(W.branches);else T(W.error||`Failed to read branches (HTTP ${K.status})`)}catch(K){T(K instanceof Error?K.message:"Failed to read branches")}finally{R(!1)}},[c,l]);i(()=>{if(t)O()},[t,O]);let X=o(!1);i(()=>{if(!t){X.current=!1;return}if(X.current&&!h)O();X.current=h},[t,h,O]),i(()=>{if(!t)E(null),I(null),H(!1),x("")},[t]);let te=u(()=>{let j=k.trim().toLowerCase();if(!j)return L;return L.filter((K)=>K.name.toLowerCase().includes(j)||K.upstream.toLowerCase().includes(j))},[L,k]);if(!t)return null;return e(d,{children:[e(J,{onClose:g,maxWidthClass:"max-w-[min(96vw,720px)]",header:e("div",{className:"flex items-center gap-2 min-w-0",children:[e("h2",{className:"text-sm font-semibold text-ink",children:"Branches"}),e("span",{className:"text-[10px] font-mono text-ink/50",children:p?`detached at ${r}`:`on ${r}`})]}),children:[e("div",{className:"px-5 py-3 flex items-center gap-2 border-b border-ink/10",children:[e(F,{size:12,className:"text-ink/40 flex-shrink-0"}),e("input",{type:"text",value:k,onChange:(j)=>x(j.currentTarget.value),placeholder:"Filter branches…","aria-label":"Filter branches",className:"flex-1 min-w-0 bg-transparent outline-none text-xs text-ink placeholder-ink/40",autoFocus:!0}),e("button",{type:"button",onClick:()=>void O(),disabled:G,title:"Refresh","aria-label":"Refresh branches",className:"text-ink/40 hover:text-ink transition-colors cursor-pointer disabled:opacity-40 flex-shrink-0",children:e(C,{size:12,className:G?"animate-spin":""})})]}),e("div",{className:"min-h-[40vh] max-h-[60vh] overflow-y-auto scrollbar-overlay-container",children:G&&L.length===0?e("div",{className:"flex items-center justify-center gap-2 py-12 text-xs text-ink/50 font-mono",children:[e(m,{size:14,className:"animate-spin text-info"}),"Loading branches…"]}):P?e("div",{className:"py-12 px-6 text-center text-xs text-error font-mono",children:P}):te.length===0?e("div",{className:"py-12 text-center text-xs text-ink/40 font-mono",children:k.trim()?"No matching branches.":"No branches."}):te.map((j)=>e(xt,{branch:j,detached:p,onCheckout:()=>{v("checkout",{branch:j.name}),g()},onMerge:()=>{v("merge_branch",{branch:j.name}),g()},onRename:()=>E(j),onDelete:()=>{I(j),H(!1)}},j.name))})]}),e(bt,{branch:w,onClose:()=>E(null),onSubmit:(j,K,W)=>{v("rename_branch",{branch:j,newName:K,...W?{remote:"1"}:{}}),E(null)}},w?.name??"none"),e(vt,{branch:z,force:A,onForceChange:H,onClose:()=>{I(null),H(!1)},onConfirm:(j)=>{y(j,A),I(null),H(!1)}})]})}function kt({mounted:t,confirmModal:c,onCloseConfirm:l,onConfirm:r,branchPrompt:p,newBranchName:h,newBranchInputRef:g,onNewBranchNameChange:v,onCloseBranchPrompt:y,onCreateBranch:L,viewingOutput:N,onCloseOutput:G,onRefreshOutput:R,onExecuteAction:P,branchModalOpen:T,onCloseBranchModal:k,rootPath:x,activeRepo:w,currentBranch:E,detached:z,isBusy:I,onBranchAction:A,onConfirmDeleteBranch:H}){if(!t)return null;return e(d,{children:[e(ht,{modal:c,onClose:l,onConfirm:r}),e(gt,{isOpen:p,branchName:h,inputRef:g,onChange:v,onClose:y,onCreate:L}),e(He,{output:N,onClose:G,onRefresh:R,onExecuteAction:P,rootPath:x,activeRepo:w}),e(yt,{isOpen:T,rootPath:x,repo:w,currentBranch:E,detached:z,isBusy:I,onClose:k,onAction:A,onConfirmDelete:H})]})}function Ct({rootPath:t,repo:c,isBusy:l,onAction:r}){let[p,h]=S("git.stashExpanded",!1),[g,v]=n([]),[y,L]=n(!1),[N,G]=n(""),[R,P]=n(!1),T=Ar(),k=a(async()=>{L(!0);let w=new URLSearchParams({stashes:"1",repo:c||"."});if(t)w.set("root",t);try{let z=await(await fetch(`/api/fs/git?${w.toString()}`)).json();v(z.stashes??[])}catch{v([])}finally{L(!1)}},[t,c]);i(()=>{if(p)k()},[p,k,l]);let x=(w,E)=>{if(r(w,E),w==="stash_push")G(""),P(!1)};return e("div",{className:"border-t border-ink/10 bg-canvas/30 flex-shrink-0",children:[e("div",{className:"flex items-center hover:bg-ink/5 transition-colors",children:[e("button",{type:"button",onClick:()=>h(!p),"aria-expanded":p,"aria-controls":T,title:p?"Hide stashes":"Show stashes",className:"flex flex-1 min-w-0 items-center space-x-1 py-1.5 pl-3 pr-2 text-left font-semibold text-xs text-ink transition-colors cursor-pointer",children:[e("span",{className:"w-3 text-center font-mono","aria-hidden":"true",children:p?"▾":"▸"}),e(Xe,{size:12}),e("span",{children:"Stash"}),g.length>0&&e("span",{className:"font-normal ml-1 border border-ink/20 rounded-full px-1.5 text-[10px] text-ink/50",children:g.length})]}),e("button",{type:"button",onClick:()=>x("stash_push",{...N.trim()?{message:N.trim()}:{},...R?{untracked:"1"}:{}}),disabled:l,title:"Stash the working tree",className:"mr-3 flex flex-shrink-0 items-center gap-1 px-2 py-0.5 text-[10px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/70 hover:text-ink transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",children:[e(Y,{size:10}),"Save"]})]}),e("div",{className:"section-reveal","data-expanded":p,id:T,inert:!p,children:e("div",{children:e("div",{className:"px-3 pb-2 flex flex-col gap-1.5",children:[e("div",{className:"flex items-center gap-1.5",children:[e("input",{type:"text",value:N,onChange:(w)=>G(w.currentTarget.value),placeholder:"Stash message (optional)","aria-label":"Stash message",className:"flex-1 min-w-0 bg-paper border border-ink/20 rounded px-2 py-1 text-[11px] text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),e("label",{className:"flex items-center gap-1 text-[10px] text-ink/60 cursor-pointer select-none flex-shrink-0",title:"Also stash untracked files (-u)",children:[e("input",{type:"checkbox",checked:R,onChange:(w)=>P(w.currentTarget.checked),className:`${ge} accent-ink cursor-pointer`}),"-u"]})]}),y&&g.length===0?e("div",{className:"text-[10px] text-ink/40 italic py-1",children:"Loading…"}):g.length===0?e("div",{className:"text-[10px] text-ink/40 italic py-1",children:"No stash entries."}):e("div",{className:"max-h-40 overflow-y-auto scrollbar-overlay-container flex flex-col",children:g.map((w)=>e("div",{className:"grid grid-cols-[4rem_minmax(0,1fr)_3.5rem_4.5rem] items-center gap-x-1 group/stash py-0.5",children:[e("span",{className:"text-[10px] font-mono text-ink/50 truncate",children:w.ref}),e("span",{className:"min-w-0 truncate text-[10px] text-ink/80",title:w.subject,children:w.subject}),e("span",{className:"text-[10px] text-ink/40 text-right truncate",children:w.date}),e("div",{className:"flex items-center justify-end gap-0.5 touch-visible opacity-0 group-hover/stash:opacity-100",children:[e("button",{type:"button",onClick:()=>x("stash_apply",{ref:w.ref,pop:"1"}),disabled:l,title:"Pop: apply and remove the entry","aria-label":"Pop stash",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors disabled:opacity-40",children:e(he,{size:10})}),e("button",{type:"button",onClick:()=>x("stash_apply",{ref:w.ref}),disabled:l,title:"Apply: keep the entry","aria-label":"Apply stash",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors disabled:opacity-40",children:e(Xe,{size:10})}),e("button",{type:"button",onClick:()=>x("stash_drop",{ref:w.ref}),disabled:l,title:"Drop: discard the entry (the stash is not recoverable from the panel)","aria-label":"Drop stash",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors disabled:opacity-40",children:e(M,{size:10})})]})]},w.ref))})]})})})]})}function Nt({repo:t,isBusy:c,onInit:l}){let r=t==="."?"this folder":t;return e("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[e(fe,{size:26,className:"text-ink/25","aria-hidden":!0}),e("div",{className:"font-mono space-y-1",children:[e("p",{className:"text-xs text-ink/70",children:"Not a Git repository"}),e("p",{className:"text-[11px] leading-4 text-ink/40",children:["Initialize one in ",r," to track changes, commit and manage branches."]})]}),e("button",{type:"button",onClick:l,disabled:c,"aria-label":"Initialize Git repository",title:`git init in ${r}`,className:"flex items-center justify-center gap-1.5 px-3 py-1.5 rounded bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[e(fe,{size:12,"aria-hidden":!0}),"Initialize repository"]})]})}function wt(t,c,l){let r=it(),{activeRepo:p,setActiveRepo:h,ready:g}=ir(t),{repos:v,scanning:y,rescan:L}=or(t,c),N=Rf(p,v),G=o(N);G.current=N;let R=o("");R.current=`${t??""}\x00${N}`;let P=o(""),T=o(""),k=o(void 0);if(r.data!==k.current)k.current=r.data,T.current=P.current;let x=c&&g?gp(`${t??""}\x00${N}`):null,w=we(x),E=o(w.refresh);E.current=w.refresh;let z=T.current===R.current?r.data:void 0,I=w.data??z,A=I?.syncCount??z?.syncCount,H=a((te)=>{if(!c)return;let j=te??G.current,K=new URLSearchParams;if(t)K.set("root",t);if(j&&j!==".")K.set("repo",j);K.set("sync","1"),K.set("t",String(Date.now())),P.current=R.current;let W=E.current;r.load(`/api/fs/git?${K.toString()}`).then(()=>W())},[c,t,r.load]);i(()=>{if(!g)return;H()},[l,t,c,g,N,H]);let O=r.state==="loading",X=O||w.refreshing;return{activeRepo:N,setActiveRepo:h,repos:v,reposScanning:y,refreshRepos:L,isReading:O,isRefreshing:X,data:I,syncCount:A,loadRepo:H,refreshTopic:w.refresh}}function Rt(t,c){let l=it(),r=o(null),p=a((h,g,v)=>{r.current={actionType:h,extra:v};let y=new FormData;if(y.append("actionType",h),y.append("repo",c),t)y.append("root",t);if(g)y.append("file",g);if(v)Object.entries(v).forEach(([L,N])=>y.append(L,N));l.submit(y,{method:"POST",action:"/api/fs/git"})},[c,t,l]);return{state:l.state,execute:p,data:l.data,lastAction:r.current}}function Gt({rootPath:t,repo:c,execute:l}){let{sessionId:r}=bp(),[p,h]=S("git.commitDraft",""),[g,v]=S("git.amend",!1),y=o(null),L=o(p);L.current=p;let N=o(g);N.current=g;let G=o(h);G.current=h,i(()=>{if(!g)return;if(L.current.trim().length>0)return;let T=new URLSearchParams({headMessage:"1"});if(t)T.set("root",t);if(c&&c!==".")T.set("repo",c);let k=!1;return fetch(`/api/fs/git?${T.toString()}`).then((x)=>x.json()).then((x)=>{if(k)return;if(!N.current||L.current.trim().length>0)return;let w=typeof x?.message==="string"?x.message:"";if(w.length===0)return;y.current=w,G.current(w)}).catch(()=>{}),()=>{k=!0}},[g,r,t,c]);let R=a((T)=>{if(T){v(!0);return}if(y.current!==null&&L.current===y.current)h("");y.current=null,v(!1)},[v,h]),P=a(()=>{l("commit",void 0,{message:L.current,...N.current?{amend:"1"}:{}}),h(""),v(!1),y.current=null},[l,v,h]);return{message:p,setMessage:h,amend:g,seeded:y.current!==null&&p===y.current,toggleAmend:R,commit:P}}var St=48;function Ot(t,c){let l=c?.branch?.trim()??"",r=(c?.hash??"").slice(0,7),p=c?.ref?.trim()||"stash@{0}";switch(t){case"init":return{done:"Initialized the repository"};case"fetch":return{done:"Fetched every remote"};case"push":return{done:"Pushed to upstream"};case"pull":return{done:"Pulled from upstream",stopped:"Pulled"};case"sync":return{done:"Synced with upstream",stopped:"Pulled, but nothing was pushed"};case"abort_operation":return{done:"Aborted the operation in progress"};case"continue_operation":return{done:"Concluded the operation"};case"commit":{if(c?.amend==="1")return{done:"Amended the last commit"};let h=(c?.message??"").split(`
|
|
7
|
-
`)[0].trim();if(!h)return{done:"Commit created"};return{done:`Committed “${h.length>St?`${h.slice(0,St-1)}…`:h}”`}}case"checkout":return{done:l?`Switched to ${l}`:"Switched branch"};case"create_branch":case"create_branch_at":return{done:l?`Created branch ${l}`:"Created branch"};case"rename_branch":{let h=c?.newName?.trim()??"";return{done:l&&h?`Renamed ${l} to ${h}`:"Renamed branch"}}case"delete_branch":return{done:l?`Deleted branch ${l}`:"Deleted branch"};case"merge_branch":return{done:l?`Merged ${l}`:"Merged branch",stopped:l?`Merging ${l}`:"Merging the branch"};case"merge_commit":return{done:r?`Merged commit ${r}`:"Merged commit",stopped:r?`Merging ${r}`:"Merging the commit"};case"cherry_pick":return{done:r?`Cherry-picked ${r}`:"Cherry-picked commit",stopped:r?`Cherry-picking ${r}`:"Cherry-picking the commit"};case"revert_commit":return{done:r?`Reverted commit ${r}`:"Reverted commit",stopped:r?`Reverting ${r}`:"Reverting the commit"};case"rebase_commit":return{done:r?`Rebased onto ${r}`:"Rebased",stopped:r?`Rebasing onto ${r}`:"Rebasing"};case"reset_commit":{let h=c?.mode??"mixed";return{done:r?`Reset to ${r} (${h})`:`Reset (${h})`}}case"stash_push":return{done:"Stashed your changes"};case"stash_apply":return{done:c?.pop==="1"?`Popped ${p}`:`Applied ${p}`,stopped:c?.pop==="1"?`Popping ${p}`:`Applying ${p}`};case"stash_drop":return{done:`Dropped ${p}`};default:return null}}function Pt({actionType:t,extra:c,stopped:l}){let r=Ot(t,c);if(!l)return r?.done??null;let p=ui[l]??l,h=r?.stopped??r?.done??"",g=t==="sync"?"resolve it above, then Sync again":"resolve it above";return h?`${h} — the ${p} stopped on a conflict; ${g}`:`The ${p} stopped on a conflict; ${g}`}function $t(t){let{fetcher:c,onPage:l,onReload:r,onSuccess:p,onError:h}=t,g=o(null),v=o({onPage:l,onReload:r,onSuccess:p,onError:h});v.current={onPage:l,onReload:r,onSuccess:p,onError:h},i(()=>{if(c.state!=="idle"||!c.data)return;let y=c.data;if(y===g.current)return;g.current=y;let L=v.current;if(y.type==="history"||y.type==="graph"){L.onPage({title:y.type==="graph"?"Git Graph":"Commit History",data:y.data||[],hasMore:y.hasMore,total:y.total});return}if(!y.success){L.onError(y.error||"Git operation failed");return}L.onReload();let N=c.lastAction,G=N?Pt({...N,stopped:y.stopped}):null;if(G)L.onSuccess(G,y.stopped?"warning":"success")},[c.state,c.data,c.lastAction])}function Mt(t,c,l,r){if(t==="revert")return{type:t,file:c,message:`Are you sure you want to discard changes in ${c}?`};if(t==="revert_all")return{type:t,message:"Are you sure you want to discard ALL unstaged changes? This cannot be undone."};if(t==="abort_operation"){let p=r?ui[r]:"operation";return{type:t,message:`Abort the ${p}? Everything resolved so far is discarded and the working tree returns to its pre-${p} state.`}}if(t==="delete_branch"){let p=l?.branch??"",h=l?.force==="1";return{type:t,extra:{branch:p,...h?{force:"1"}:{}},message:h?`Delete branch ${p} even though its commits are not merged? This cannot be undone from the panel.`:`Delete branch ${p}?`}}if(t==="stash_drop"){let p=l?.ref||"the top entry";return{type:t,extra:{ref:l?.ref??""},message:`Drop ${p}? The stash entry is removed — this cannot be undone from the panel.`}}return null}function sr({className:t="",enabled:c=!0,rootPath:l,refreshKey:r=0}){let{activeRepo:p,setActiveRepo:h,repos:g,reposScanning:v,refreshRepos:y,isReading:L,isRefreshing:N,data:G,syncCount:R,loadRepo:P,refreshTopic:T}=wt(l,c,r),k=Rt(l,p),[x,w]=S("git.viewMode","flat"),[E,z]=n(!1),I=o(null),[A,H]=n(!1),O=o(null),[X,te]=n(null),[j,K]=n(!1),[W,ne]=n(""),se=o(null),[be,de]=n(!1),[pe,ve]=n(null),[Se,Pe]=n(!1),{pushToast:re}=Ve();i(()=>{Pe(!0)},[]),i(()=>{if(j&&se.current)se.current.focus()},[j]),$t({fetcher:k,onPage:ve,onReload:P,onSuccess:(q,Q)=>re(q,Q),onError:(q)=>re(q,"error")}),ce(I,()=>z(!1)),ce(O,()=>H(!1));let Z=k.execute,{message:$e,setMessage:ye,amend:ke,seeded:Me,toggleAmend:Oe,commit:U}=Gt({rootPath:l,repo:p,execute:Z}),_=(q,Q,Ne)=>{let Ie=Mt(q,Q,Ne,G?.state?.operation??null);if(Ie){te(Ie);return}Z(q,Q,Ne)},ee=(q,Q)=>{Z("resolve_conflict",q,Q?{side:Q}:void 0)},Ce=G?.branch||"main",me=G?.branches||["main"],Le=G?.remoteBranches||[],ue=G?.changes||[],oe=L||k.state!=="idle",De=k.state==="idle"?null:k.lastAction?.actionType??null,Lt=De==="sync"||De==="push"||De==="pull",Dt=ue.filter((q)=>{if(gr(q.status))return!1;let Q=q.status;return Q&&Q[0]!==" "&&Q[0]!=="?"});if(!c)return e("div",{className:`flex flex-col h-full bg-paper items-center justify-center text-ink/40 ${t}`,children:e("span",{className:"text-xs font-mono text-muted",children:"No session selected"})});return e("div",{className:`flex flex-col h-full bg-paper relative ${t}`,children:[e(kt,{mounted:Se,confirmModal:X,onCloseConfirm:()=>te(null),onConfirm:()=>{if(X)Z(X.type,X.file,X.extra),te(null)},branchPrompt:j,newBranchName:W,newBranchInputRef:se,onNewBranchNameChange:ne,onCloseBranchPrompt:()=>{K(!1),ne("")},onCreateBranch:()=>{if(W.trim())Z("create_branch",void 0,{branch:W.trim()}),K(!1),ne("")},viewingOutput:pe,onCloseOutput:()=>ve(null),onRefreshOutput:()=>{if(pe)Z(pe.title.toLowerCase().includes("graph")?"graph":"history")},onExecuteAction:(q,Q,Ne)=>Z(q,Q,Ne),branchModalOpen:be,onCloseBranchModal:()=>de(!1),rootPath:l,activeRepo:p,currentBranch:Ce,detached:G?.state?.detached??!1,isBusy:oe,onBranchAction:(q,Q)=>Z(q,void 0,Q),onConfirmDeleteBranch:(q,Q)=>{Z("delete_branch",void 0,{branch:q,...Q?{force:"1"}:{}})}}),e(Ke,{activeRepo:p,repos:g,isRefreshing:N,rootPath:l,reposScanning:v,onSelectRepo:(q)=>{if(q!==p)h(q)},onRefresh:()=>{T(),P()},onRefreshRepos:y}),G?.isRepo===!1?e(Nt,{repo:p,isBusy:oe,onInit:()=>Z("init")}):e(d,{children:[e(qe,{branchRef:O,showBranchMenu:A,setShowBranchMenu:H,branch:Ce,branches:me,remoteBranches:Le,onCheckout:(q)=>Z("checkout",void 0,{branch:q}),onMerge:(q)=>Z("merge_branch",void 0,{branch:q}),onOpenBranchPrompt:()=>K(!0),onManageBranches:()=>{de(!0),H(!1)},optionsRef:I,showOptions:E,setShowOptions:z,onHistory:()=>Z("history"),onGraph:()=>Z("graph"),viewMode:x,setViewMode:w,isBusy:oe,syncCount:R,syncing:Lt,onSync:()=>Z("sync"),onFetch:()=>Z("fetch"),detached:G?.state?.detached??!1}),G?.state?.operation?e(We,{operation:G.state.operation,conflicts:G.state.conflicts,isBusy:oe,onAbort:()=>_("abort_operation"),onContinue:()=>Z("continue_operation")}):e(Ue,{message:$e,hasStagedChanges:Dt.length>0,isBusy:oe,amend:ke,seeded:Me,onToggleAmend:Oe,onChangeMessage:ye,onCommit:U}),e(Qe,{changes:ue,isLoading:oe,viewMode:x,repo:p,rootPath:l,onAction:_,onResolve:ee}),e(Ct,{rootPath:l,repo:p,isBusy:oe,onAction:(q,Q)=>_(q,void 0,Q)})]})]})}export{sr as GitPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d,u,le,e,IA,we,I,B,ie,vr,C,Fs,Fu,Lp,lg,Mp,Pp}from"./index-3wpsr2bc.js";function k({phase:t,index:o,collapsed:a,currentKey:i,onToggle:x}){let m=Mp(t),r=t.tasks.length>0&&m===t.tasks.length;return e("div",{className:"overflow-hidden rounded-lg border border-ink/10 bg-paper",children:[e("button",{type:"button",onClick:x,"aria-expanded":!a,className:"flex w-full items-center gap-1.5 border-b border-ink/8 bg-canvas/40 px-2.5 py-1.5 text-left hover:bg-ink/5",children:[a?e(ie,{size:12,className:"shrink-0 text-ink/40"}):e(B,{size:12,className:"shrink-0 text-ink/40"}),e("span",{className:`min-w-0 flex-1 truncate text-[10px] font-semibold uppercase tracking-wider ${r?"text-ink/35":"text-ink/60"}`,title:t.name,children:[o+1,". ",t.name]}),e("span",{className:"shrink-0 font-mono text-[10px] text-ink/40",children:[m,"/",t.tasks.length]})]}),!a&&e("div",{className:"divide-y divide-ink/[0.05] p-0.5",children:t.tasks.length===0?e("div",{className:"px-2.5 py-1.5 text-[11px] text-ink/40",children:"No tasks in this phase"}):t.tasks.map((l,f)=>e(Pp,{task:l,current:i===`${o}:${f}`},`${f}-${l.content}`))})]})}function j({className:t="",active:o=!0}){let[a]=le(),i=a.get("sessionId"),[x,m]=Fs("todo.collapsedPhases",{}),{data:r,isLoading:l,refreshing:f,stale:g,refresh:b}=we(i?IA(i):null,{enabled:o}),s=r?.snapshot??null,p=r?.progress??null,v=u(()=>{let n=lg(s?.phases??[]);return n?`${n.phase}:${n.task}`:null},[s]);if(!i)return e("div",{className:`flex h-full flex-col items-center justify-center bg-paper text-ink/40 ${t}`,children:e("span",{className:"text-xs font-mono text-muted",children:"No session selected"})});return e("div",{className:`flex h-full w-full min-w-0 flex-col overflow-hidden bg-paper text-ink ${t}`,children:[e("div",{className:"flex flex-shrink-0 items-center justify-between gap-3 border-b border-ink/10 px-3.5 py-2.5",children:[e("div",{className:"flex min-w-0 items-center gap-2",children:[e("h2",{className:"text-xs font-semibold uppercase tracking-wider text-ink",children:"Todos"}),s&&e("span",{className:"truncate font-mono text-[10.5px] text-ink/50",title:Fu(p),children:Fu(p)}),r?.isMock&&e("span",{className:"flex-shrink-0 rounded border border-ink/15 bg-ink/5 px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wider text-ink/60",children:"Mock"})]}),e("button",{type:"button",onClick:b,disabled:l,title:"Refresh todos","aria-label":"Refresh todos",className:"flex-shrink-0 rounded-md border border-ink/15 bg-paper p-1.5 text-ink/80 transition-colors hover:bg-ink/5 disabled:opacity-50",children:e(C,{size:12,className:l||f?"animate-spin text-ink":""})})]}),p&&p.total>0&&e("div",{className:"flex-shrink-0 border-b border-ink/10 px-3.5 py-2.5",children:e("div",{className:"h-1.5 overflow-hidden rounded-full bg-ink/8",children:e("div",{className:"h-full rounded-full bg-success transition-all duration-300",style:{width:`${Lp(p)}%`}})})}),e("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto scrollbar-overlay-container p-3.5",children:[g&&e("div",{className:"flex items-start gap-2 rounded-lg border border-ink/15 bg-ink/5 px-3 py-2 text-[11px] text-ink/60",children:[e(I,{size:13,className:"mt-[1px] shrink-0"}),e("span",{className:"min-w-0 break-words",children:"Reconnecting: this list may be out of date."})]}),!s?e("div",{className:"flex flex-col items-center justify-center gap-2 py-12 text-center text-ink/40",children:[e(vr,{size:20}),e("p",{className:"max-w-[240px] text-[11.5px] leading-relaxed",children:["No todo list in this session. The agent writes one with the ",e("span",{className:"font-mono",children:"todo"})," tool when a task is worth planning."]})]}):e(d,{children:[s.phases.map((n,c)=>e(k,{phase:n,index:c,collapsed:Boolean(x[String(c)]),currentKey:v,onToggle:()=>m((h)=>({...h,[String(c)]:!h[String(c)]}))},`${c}-${n.name}`)),e("p",{className:"pt-1 text-[10.5px] leading-relaxed text-ink/35",children:["Read from this session's transcript",s.updatedAt?` · updated ${N(s.updatedAt)}`:"",s.source==="custom"?" · edited by hand":"","."]})]})]})]})}function N(t){let o=new Date(t);if(Number.isNaN(o.getTime()))return t;return o.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}export{j as TodoPanel};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{mn}from"./index-b9b2nwdd.js";var X={};mn(X,{default:()=>aa});var J={};mn(J,{default:()=>Xa});var cr=typeof global=="object"&&global&&global.Object===Object&&global,H=cr;var gr=typeof self=="object"&&self&&self.Object===Object&&self,yr=H||gr||Function("return this")(),Rt=yr;var _r=Rt.Symbol,fn=_r;var yt=Object.prototype,{hasOwnProperty:br,toString:vr}=yt,G=fn?fn.toStringTag:void 0;function Or(t){var e=br.call(t,G),r=t[G];try{t[G]=void 0;var o=!0}catch(f){}var a=vr.call(t);if(o)if(e)t[G]=r;else delete t[G];return a}var _t=Or;var Ar=Object.prototype,wr=Ar.toString;function Sr(t){return wr.call(t)}var bt=Sr;var Pr="[object Null]",Cr="[object Undefined]",Ot=fn?fn.toStringTag:void 0;function Er(t){if(t==null)return t===void 0?Cr:Pr;return Ot&&Ot in Object(t)?_t(t):bt(t)}var Xn=Er;function Ir(t){return t!=null&&typeof t=="object"}var qt=Ir;var Lr="[object Symbol]";function jr(t){return typeof t=="symbol"||qt(t)&&Xn(t)==Lr}var Tr=jr;function Mr(t,e){var r=-1,o=t==null?0:t.length,a=Array(o);while(++r<o)a[r]=e(t[r],r,t);return a}var Ja=Mr;var Nr=Array.isArray,ve=Nr;var Rr=1/0,At=fn?fn.prototype:void 0,Tt=At?At.toString:void 0;function wt(t){if(typeof t=="string")return t;if(ve(t))return Ja(t,wt)+"";if(Tr(t))return Tt?Tt.call(t):"";var e=t+"";return e=="0"&&1/t==-Rr?"-0":e}var St=wt;function Fr(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var vt=Fr;function Br(t){return t}var pr=Br;var Gr="[object AsyncFunction]",Ur="[object Function]",zr="[object GeneratorFunction]",Wr="[object Proxy]";function Kr(t){if(!vt(t))return!1;var e=Xn(t);return e==Ur||e==zr||e==Gr||e==Wr}var Za=Kr;var Hr=Rt["__core-js_shared__"],q=Hr;var Pt=function(){var t=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function qr(t){return!!Pt&&Pt in t}var Ct=qr;var $r=Function.prototype,kr=$r.toString;function Yr(t){if(t!=null){try{return kr.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var y=Yr;var Xr=/[\\^$.*+?()[\]{}|]/g,Zr=/^\[object .+?Constructor\]$/,Jr=Function.prototype,Vr=Object.prototype,to=Jr.toString,eo=Vr.hasOwnProperty,ro=RegExp("^"+to.call(eo).replace(Xr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function oo(t){if(!vt(t)||Ct(t))return!1;var e=Za(t)?ro:Zr;return e.test(y(t))}var Et=oo;function ao(t,e){return t==null?void 0:t[e]}var It=ao;function fo(t,e){var r=It(t,e);return Et(r)?r:void 0}var x=fo;var io=x(Rt,"WeakMap"),k=io;function no(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var jt=no;function so(){}var Mt=so;var po=800,uo=16,mo=Date.now;function lo(t){var e=0,r=0;return function(){var o=mo(),a=uo-(o-r);if(r=o,a>0){if(++e>=po)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Nt=lo;function co(t){return function(){return t}}var mr=co;var go=function(){try{var t=x(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),hl=go;var _o=!hl?pr:function(t,e){return hl(t,"toString",{configurable:!0,enumerable:!1,value:mr(e),writable:!0})},Dt=_o;var Oo=Nt(Dt),yd=Oo;function Ao(t,e){var r=-1,o=t==null?0:t.length;while(++r<o)if(e(t[r],r,t)===!1)break;return t}var vd=Ao;function To(t,e,r,o){var a=t.length,f=r+(o?1:-1);while(o?f--:++f<a)if(e(t[f],f,t))return f;return-1}var kd=To;function So(t){return t!==t}var Bt=So;function Po(t,e,r){var o=r-1,a=t.length;while(++o<a)if(t[o]===e)return o;return-1}var Gt=Po;function Eo(t,e,r){return e===e?Gt(t,e,r):kd(t,Bt,r)}var Ut=Eo;function Io(t,e){var r=t==null?0:t.length;return!!r&&Ut(t,e,0)>-1}var zt=Io;var Lo=9007199254740991,jo=/^(?:0|[1-9]\d*)$/;function Mo(t,e){var r=typeof t;return e=e==null?Lo:e,!!e&&(r=="number"||r!="symbol"&&jo.test(t))&&(t>-1&&t%1==0&&t<e)}var ho=Mo;function No(t,e){return t===e||t!==t&&e!==e}var ra=No;var Wt=Math.max;function Do(t,e,r){return e=Wt(e===void 0?t.length-1:e,0),function(){var o=arguments,a=-1,f=Wt(o.length-e,0),i=Array(f);while(++a<f)i[a]=o[e+a];a=-1;var n=Array(e+1);while(++a<e)n[a]=o[a];return n[e]=r(i),jt(t,this,n)}}var xd=Do;function Ro(t,e){return yd(xd(t,e,pr),t+"")}var bo=Ro;var Fo=9007199254740991;function Bo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Fo}var j=Bo;function Go(t){return t!=null&&j(t.length)&&!Za(t)}var An=Go;var Uo=Object.prototype;function zo(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Uo;return t===r}var yo=zo;function Wo(t,e){var r=-1,o=Array(t);while(++r<t)o[r]=e(r);return o}var Kt=Wo;var Ko="[object Arguments]";function Ho(t){return qt(t)&&Xn(t)==Ko}var ut=Ho;var Ht=Object.prototype,{hasOwnProperty:qo,propertyIsEnumerable:$o}=Ht,Yo=ut(function(){return arguments}())?ut:function(t){return qt(t)&&qo.call(t,"callee")&&!$o.call(t,"callee")},Na=Yo;function Xo(){return!1}var $t=Xo;var Xt=typeof X=="object"&&X&&!X.nodeType&&X,kt=Xt&&typeof Y=="object"&&Y&&!Y.nodeType&&Y,Zo=kt&&kt.exports===Xt,Yt=Zo?Rt.Buffer:void 0,Jo=Yt?Yt.isBuffer:void 0,Qo=Jo||$t,aa=Qo;var Vo="[object Arguments]",ta="[object Array]",ea="[object Boolean]",oa="[object Date]",fa="[object Error]",ia="[object Function]",na="[object Map]",sa="[object Number]",pa="[object Object]",ua="[object RegExp]",ma="[object Set]",la="[object String]",da="[object WeakMap]",xa="[object ArrayBuffer]",ha="[object DataView]",ca="[object Float32Array]",ga="[object Float64Array]",ya="[object Int8Array]",_a="[object Int16Array]",ba="[object Int32Array]",va="[object Uint8Array]",Oa="[object Uint8ClampedArray]",Aa="[object Uint16Array]",Ta="[object Uint32Array]",u={};u[ca]=u[ga]=u[ya]=u[_a]=u[ba]=u[va]=u[Oa]=u[Aa]=u[Ta]=!0;u[Vo]=u[ta]=u[xa]=u[ea]=u[ha]=u[oa]=u[fa]=u[ia]=u[na]=u[sa]=u[pa]=u[ua]=u[ma]=u[la]=u[da]=!1;function wa(t){return qt(t)&&j(t.length)&&!!u[Xn(t)]}var Zt=wa;function Sa(t){return function(e){return t(e)}}var vo=Sa;var Jt=typeof J=="object"&&J&&!J.nodeType&&J,U=Jt&&typeof Z=="object"&&Z&&!Z.nodeType&&Z,Pa=U&&U.exports===Jt,mt=Pa&&H.process,Ca=function(){try{var t=U&&U.require&&U.require("util").types;if(t)return t;return mt&&mt.binding&&mt.binding("util")}catch(e){}}(),Xa=Ca;var Qt=Xa&&Xa.isTypedArray,Ea=Qt?vo(Qt):Zt,ko=Ea;var Ia=Object.prototype,La=Ia.hasOwnProperty;function ja(t,e){var r=ve(t),o=!r&&Na(t),a=!r&&!o&&aa(t),f=!r&&!o&&!a&&ko(t),i=r||o||a||f,n=i?Kt(t.length,String):[],s=n.length;for(var p in t)if((e||La.call(t,p))&&!(i&&(p=="length"||a&&(p=="offset"||p=="parent")||f&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||ho(p,s))))n.push(p);return n}var wd=ja;function Ma(t,e){return function(r){return t(e(r))}}var Cd=Ma;var Da=Cd(Object.keys,Object),Vt=Da;var Ra=Object.prototype,Fa=Ra.hasOwnProperty;function Ba(t){if(!yo(t))return Vt(t);var e=[];for(var r in Object(t))if(Fa.call(t,r)&&r!="constructor")e.push(r);return e}var bl=Ba;function Ga(t){return An(t)?wd(t):bl(t)}var Ft=Ga;var Ua=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,za=/^\w*$/;function Wa(t,e){if(ve(t))return!1;var r=typeof t;if(r=="number"||r=="symbol"||r=="boolean"||t==null||Tr(t))return!0;return za.test(t)||!Ua.test(t)||e!=null&&t in Object(e)}var M=Wa;var Ka=x(Object,"create"),_=Ka;function Ha(){this.__data__=_?_(null):{},this.size=0}var te=Ha;function qa(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var ee=qa;var $a="__lodash_hash_undefined__",ka=Object.prototype,Ya=ka.hasOwnProperty;function Qa(t){var e=this.__data__;if(_){var r=e[t];return r===$a?void 0:r}return Ya.call(e,t)?e[t]:void 0}var re=Qa;var Va=Object.prototype,tf=Va.hasOwnProperty;function ef(t){var e=this.__data__;return _?e[t]!==void 0:tf.call(e,t)}var oe=ef;var rf="__lodash_hash_undefined__";function of(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=_&&e===void 0?rf:e,this}var ae=of;function N(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}N.prototype.clear=te;N.prototype.delete=ee;N.prototype.get=re;N.prototype.has=oe;N.prototype.set=ae;var lt=N;function af(){this.__data__=[],this.size=0}var fe=af;function ff(t,e){var r=t.length;while(r--)if(ra(t[r][0],e))return r;return-1}var O=ff;var nf=Array.prototype,sf=nf.splice;function pf(t){var e=this.__data__,r=O(e,t);if(r<0)return!1;var o=e.length-1;if(r==o)e.pop();else sf.call(e,r,1);return--this.size,!0}var ie=pf;function uf(t){var e=this.__data__,r=O(e,t);return r<0?void 0:e[r][1]}var ne=uf;function mf(t){return O(this.__data__,t)>-1}var se=mf;function lf(t,e){var r=this.__data__,o=O(r,t);if(o<0)++this.size,r.push([t,e]);else r[o][1]=e;return this}var pe=lf;function D(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}D.prototype.clear=fe;D.prototype.delete=ie;D.prototype.get=ne;D.prototype.has=se;D.prototype.set=pe;var A=D;var df=x(Rt,"Map"),T=df;function xf(){this.size=0,this.__data__={hash:new lt,map:new(T||A),string:new lt}}var ue=xf;function hf(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var me=hf;function cf(t,e){var r=t.__data__;return me(e)?r[typeof e=="string"?"string":"hash"]:r.map}var w=cf;function gf(t){var e=w(this,t).delete(t);return this.size-=e?1:0,e}var le=gf;function yf(t){return w(this,t).get(t)}var de=yf;function _f(t){return w(this,t).has(t)}var xe=_f;function bf(t,e){var r=w(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}var he=bf;function R(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}R.prototype.clear=ue;R.prototype.delete=le;R.prototype.get=de;R.prototype.has=xe;R.prototype.set=he;var E=R;var vf="Expected a function";function dt(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw TypeError(vf);var r=function(){var o=arguments,a=e?e.apply(this,o):o[0],f=r.cache;if(f.has(a))return f.get(a);var i=t.apply(this,o);return r.cache=f.set(a,i)||f,i};return r.cache=new(dt.Cache||E),r}dt.Cache=E;var ce=dt;var Of=500;function Af(t){var e=ce(t,function(o){if(r.size===Of)r.clear();return o}),r=e.cache;return e}var ge=Af;var Tf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wf=/\\(\\)?/g,Sf=ge(function(t){var e=[];if(t.charCodeAt(0)===46)e.push("");return t.replace(Tf,function(r,o,a,f){e.push(a?f.replace(wf,"$1"):o||r)}),e}),ye=Sf;function Pf(t){return t==null?"":St(t)}var Ed=Pf;function Cf(t,e){if(ve(t))return t;return M(t,e)?[t]:ye(Ed(t))}var xo=Cf;var Ef=1/0;function If(t){if(typeof t=="string"||Tr(t))return t;var e=t+"";return e=="0"&&1/t==-Ef?"-0":e}var ei=If;function Lf(t,e){e=xo(e,t);var r=0,o=e.length;while(t!=null&&r<o)t=t[ei(e[r++])];return r&&r==o?t:void 0}var wo=Lf;function jf(t,e,r){var o=t==null?void 0:wo(t,e);return o===void 0?r:o}var _e=jf;function Mf(t,e){var r=-1,o=e.length,a=t.length;while(++r<o)t[a+r]=e[r];return t}var yl=Mf;var be=fn?fn.isConcatSpreadable:void 0;function Nf(t){return ve(t)||Na(t)||!!(be&&t&&t[be])}var Oe=Nf;function Ae(t,e,r,o,a){var f=-1,i=t.length;r||(r=Oe),a||(a=[]);while(++f<i){var n=t[f];if(e>0&&r(n))if(e>1)Ae(n,e-1,r,o,a);else yl(a,n);else if(!o)a[a.length]=n}return a}var vl=Ae;function Df(t,e,r,o){var a=-1,f=t==null?0:t.length;if(o&&f)r=t[++a];while(++a<f)r=e(r,t[a],a,t);return r}var Te=Df;function Rf(){this.__data__=new A,this.size=0}var we=Rf;function Ff(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var Se=Ff;function Bf(t){return this.__data__.get(t)}var Pe=Bf;function Gf(t){return this.__data__.has(t)}var Ce=Gf;var Uf=200;function zf(t,e){var r=this.__data__;if(r instanceof A){var o=r.__data__;if(!T||o.length<Uf-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new E(o)}return r.set(t,e),this.size=r.size,this}var Ee=zf;function F(t){var e=this.__data__=new A(t);this.size=e.size}F.prototype.clear=we;F.prototype.delete=Se;F.prototype.get=Pe;F.prototype.has=Ce;F.prototype.set=Ee;var ti=F;function Wf(t,e){var r=-1,o=t==null?0:t.length,a=0,f=[];while(++r<o){var i=t[r];if(e(i,r,t))f[a++]=i}return f}var Q=Wf;function Kf(){return[]}var Bd=Kf;var Hf=Object.prototype,qf=Hf.propertyIsEnumerable,Ie=Object.getOwnPropertySymbols,$f=!Ie?Bd:function(t){if(t==null)return[];return t=Object(t),Q(Ie(t),function(e){return qf.call(t,e)})},kl=$f;function kf(t,e,r){var o=e(t);return ve(t)?o:yl(o,r(t))}var Id=kf;function Yf(t){return Id(t,Ft,kl)}var mu=Yf;var Xf=x(Rt,"DataView"),V=Xf;var Zf=x(Rt,"Promise"),tt=Zf;var Jf=x(Rt,"Set"),S=Jf;var Le="[object Map]",Qf="[object Object]",je="[object Promise]",Me="[object Set]",Ne="[object WeakMap]",De="[object DataView]",Vf=y(V),ri=y(T),oi=y(tt),ai=y(S),fi=y(k),I=Xn;if(V&&I(new V(new ArrayBuffer(1)))!=De||T&&I(new T)!=Le||tt&&I(tt.resolve())!=je||S&&I(new S)!=Me||k&&I(new k)!=Ne)I=function(t){var e=Xn(t),r=e==Qf?t.constructor:void 0,o=r?y(r):"";if(o)switch(o){case Vf:return De;case ri:return Le;case oi:return je;case ai:return Me;case fi:return Ne}return e};var Dr=I;var ii=Rt.Uint8Array,xl=ii;var si="__lodash_hash_undefined__";function pi(t){return this.__data__.set(t,si),this}var Re=pi;function ui(t){return this.__data__.has(t)}var Fe=ui;function et(t){var e=-1,r=t==null?0:t.length;this.__data__=new E;while(++e<r)this.add(t[e])}et.prototype.add=et.prototype.push=Re;et.prototype.has=Fe;var rt=et;function mi(t,e){var r=-1,o=t==null?0:t.length;while(++r<o)if(e(t[r],r,t))return!0;return!1}var Be=mi;function li(t,e){return t.has(e)}var ot=li;var di=1,xi=2;function hi(t,e,r,o,a,f){var i=r&di,n=t.length,s=e.length;if(n!=s&&!(i&&s>n))return!1;var p=f.get(t),d=f.get(e);if(p&&d)return p==e&&d==t;var l=-1,m=!0,g=r&xi?new rt:void 0;f.set(t,e),f.set(e,t);while(++l<n){var h=t[l],c=e[l];if(o)var b=i?o(c,h,l,e,t,f):o(h,c,l,t,e,f);if(b!==void 0){if(b)continue;m=!1;break}if(g){if(!Be(e,function(P,C){if(!ot(g,C)&&(h===P||a(h,P,r,o,f)))return g.push(C)})){m=!1;break}}else if(!(h===c||a(h,c,r,o,f))){m=!1;break}}return f.delete(t),f.delete(e),m}var at=hi;function ci(t){var e=-1,r=Array(t.size);return t.forEach(function(o,a){r[++e]=[a,o]}),r}var Ge=ci;function gi(t){var e=-1,r=Array(t.size);return t.forEach(function(o){r[++e]=o}),r}var B=gi;var yi=1,_i=2,bi="[object Boolean]",vi="[object Date]",Oi="[object Error]",Ai="[object Map]",Ti="[object Number]",wi="[object RegExp]",Si="[object Set]",Pi="[object String]",Ci="[object Symbol]",Ei="[object ArrayBuffer]",Ii="[object DataView]",Ue=fn?fn.prototype:void 0,xt=Ue?Ue.valueOf:void 0;function Li(t,e,r,o,a,f,i){switch(r){case Ii:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Ei:if(t.byteLength!=e.byteLength||!f(new xl(t),new xl(e)))return!1;return!0;case bi:case vi:case Ti:return ra(+t,+e);case Oi:return t.name==e.name&&t.message==e.message;case wi:case Pi:return t==e+"";case Ai:var n=Ge;case Si:var s=o&yi;if(n||(n=B),t.size!=e.size&&!s)return!1;var p=i.get(t);if(p)return p==e;o|=_i,i.set(t,e);var d=at(n(t),n(e),o,a,f,i);return i.delete(t),d;case Ci:if(xt)return xt.call(t)==xt.call(e)}return!1}var ze=Li;var ji=1,Mi=Object.prototype,Ni=Mi.hasOwnProperty;function Di(t,e,r,o,a,f){var i=r&ji,n=mu(t),s=n.length,p=mu(e),d=p.length;if(s!=d&&!i)return!1;var l=s;while(l--){var m=n[l];if(!(i?m in e:Ni.call(e,m)))return!1}var g=f.get(t),h=f.get(e);if(g&&h)return g==e&&h==t;var c=!0;f.set(t,e),f.set(e,t);var b=i;while(++l<s){m=n[l];var P=t[m],C=e[m];if(o)var gt=i?o(C,P,m,e,t,f):o(P,C,m,t,e,f);if(!(gt===void 0?P===C||a(P,C,r,o,f):gt)){c=!1;break}b||(b=m=="constructor")}if(c&&!b){var W=t.constructor,K=e.constructor;if(W!=K&&(("constructor"in t)&&("constructor"in e))&&!(typeof W=="function"&&W instanceof W&&typeof K=="function"&&K instanceof K))c=!1}return f.delete(t),f.delete(e),c}var We=Di;var Ri=1,Ke="[object Arguments]",He="[object Array]",ft="[object Object]",Fi=Object.prototype,qe=Fi.hasOwnProperty;function Bi(t,e,r,o,a,f){var i=ve(t),n=ve(e),s=i?He:Dr(t),p=n?He:Dr(e);s=s==Ke?ft:s,p=p==Ke?ft:p;var d=s==ft,l=p==ft,m=s==p;if(m&&aa(t)){if(!aa(e))return!1;i=!0,d=!1}if(m&&!d)return f||(f=new ti),i||ko(t)?at(t,e,r,o,a,f):ze(t,e,s,r,o,a,f);if(!(r&Ri)){var g=d&&qe.call(t,"__wrapped__"),h=l&&qe.call(e,"__wrapped__");if(g||h){var c=g?t.value():t,b=h?e.value():e;return f||(f=new ti),a(c,b,r,o,f)}}if(!m)return!1;return f||(f=new ti),We(t,e,r,o,a,f)}var ke=Bi;function Ye(t,e,r,o,a){if(t===e)return!0;if(t==null||e==null||!qt(t)&&!qt(e))return t!==t&&e!==e;return ke(t,e,r,o,Ye,a)}var it=Ye;var Gi=1,Ui=2;function zi(t,e,r,o){var a=r.length,f=a,i=!o;if(t==null)return!f;t=Object(t);while(a--){var n=r[a];if(i&&n[2]?n[1]!==t[n[0]]:!(n[0]in t))return!1}while(++a<f){n=r[a];var s=n[0],p=t[s],d=n[1];if(i&&n[2]){if(p===void 0&&!(s in t))return!1}else{var l=new ti;if(o)var m=o(p,d,s,t,e,l);if(!(m===void 0?it(d,p,Gi|Ui,o,l):m))return!1}}return!0}var Xe=zi;function Wi(t){return t===t&&!vt(t)}var nt=Wi;function Ki(t){var e=Ft(t),r=e.length;while(r--){var o=e[r],a=t[o];e[r]=[o,a,nt(a)]}return e}var Ze=Ki;function Hi(t,e){return function(r){if(r==null)return!1;return r[t]===e&&(e!==void 0||(t in Object(r)))}}var st=Hi;function qi(t){var e=Ze(t);if(e.length==1&&e[0][2])return st(e[0][0],e[0][1]);return function(r){return r===t||Xe(r,t,e)}}var Je=qi;function $i(t,e){return t!=null&&e in Object(t)}var Qe=$i;function ki(t,e,r){e=xo(e,t);var o=-1,a=e.length,f=!1;while(++o<a){var i=ei(e[o]);if(!(f=t!=null&&r(t,i)))break;t=t[i]}if(f||++o!=a)return f;return a=t==null?0:t.length,!!a&&j(a)&&ho(i,a)&&(ve(t)||Na(t))}var _d=ki;function Yi(t,e){return t!=null&&_d(t,e,Qe)}var Sd=Yi;var Xi=1,Zi=2;function Ji(t,e){if(M(t)&&nt(e))return st(ei(t),e);return function(r){var o=_e(r,t);return o===void 0&&o===e?Sd(r,t):it(e,o,Xi|Zi)}}var Ve=Ji;function Qi(t){return function(e){return e==null?void 0:e[t]}}var Td=Qi;function Vi(t){return function(e){return wo(e,t)}}var tr=Vi;function tn(t){return M(t)?Td(ei(t)):tr(t)}var rr=tn;function en(t){if(typeof t=="function")return t;if(t==null)return pr;if(typeof t=="object")return ve(t)?Ve(t[0],t[1]):Je(t);return rr(t)}var Pn=en;function rn(t){return function(e,r,o){var a=-1,f=Object(e),i=o(e),n=i.length;while(n--){var s=i[t?n:++a];if(r(f[s],s,f)===!1)break}return e}}var or=rn;var on=or(),wl=on;function an(t,e){return t&&wl(t,e,Ft)}var Cl=an;function nn(t,e){return function(r,o){if(r==null)return r;if(!An(r))return t(r,o);var a=r.length,f=e?a:-1,i=Object(r);while(e?f--:++f<a)if(o(i[f],f,i)===!1)break;return r}}var ar=nn;var sn=ar(Cl),Co=sn;function pn(t){return qt(t)&&An(t)}var Dd=pn;function un(t,e,r){var o=-1,a=t==null?0:t.length;while(++o<a)if(r(e,t[o]))return!0;return!1}var fr=un;function ln(t){return typeof t=="function"?t:pr}var El=ln;function dn(t,e){var r=ve(t)?vd:Co;return r(t,El(e))}var v=dn;function xn(t,e){var r=[];return Co(t,function(o,a,f){if(e(o,a,f))r.push(o)}),r}var ir=xn;function hn(t,e){var r=ve(t)?Q:ir;return r(t,Pn(e,3))}var er=hn;function cn(t,e){return Ja(e,function(r){return t[r]})}var nr=cn;function gn(t){return t==null?[]:nr(t,Ft(t))}var Qr=gn;var yn="[object Map]",_n="[object Set]",bn=Object.prototype,vn=bn.hasOwnProperty;function On(t){if(t==null)return!0;if(An(t)&&(ve(t)||typeof t=="string"||typeof t.splice=="function"||aa(t)||ko(t)||Na(t)))return!t.length;var e=Dr(t);if(e==yn||e==_n)return!t.size;if(yo(t))return!bl(t).length;for(var r in t)if(vn.call(t,r))return!1;return!0}var pt=On;function Tn(t){return t===void 0}var Lt=Tn;function wn(t,e,r,o,a){return a(t,function(f,i,n){r=o?(o=!1,f):e(r,f,i,n)}),r}var sr=wn;function Sn(t,e,r){var o=ve(t)?Te:sr,a=arguments.length<3;return o(t,Pn(e,4),r,a,Co)}var ni=Sn;var Cn=1/0,En=!(S&&1/B(new S([,-0]))[1]==Cn)?Mt:function(t){return new S(t)},ur=En;var In=200;function Ln(t,e,r){var o=-1,a=zt,f=t.length,i=!0,n=[],s=n;if(r)i=!1,a=fr;else if(f>=In){var p=e?null:ur(t);if(p)return B(p);i=!1,a=ot,s=new rt}else s=e?[]:n;t:while(++o<f){var d=t[o],l=e?e(d):d;if(d=r||d!==0?d:0,i&&l===l){var m=s.length;while(m--)if(s[m]===l)continue t;if(e)s.push(l);n.push(d)}else if(!a(s,l,r)){if(s!==n)s.push(l);n.push(d)}}return n}var lr=Ln;var jn=bo(function(t){return lr(vl(t,1,Dd,!0))}),ht=jn;var Nn="\x00",L="\x00",dr="\x01";class $e{constructor(t={}){if(this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=mr(void 0),this._defaultEdgeLabelFn=mr(void 0),this._nodes={},this._isCompound)this._parent={},this._children={},this._children[L]={};this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){if(!Za(t))t=mr(t);return this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return Ft(this._nodes)}sources(){var t=this;return er(this.nodes(),function(e){return pt(t._in[e])})}sinks(){var t=this;return er(this.nodes(),function(e){return pt(t._out[e])})}setNodes(t,e){var r=arguments,o=this;return v(t,function(a){if(r.length>1)o.setNode(a,e);else o.setNode(a)}),this}setNode(t,e){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){if(arguments.length>1)this._nodes[t]=e;return this}if(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound)this._parent[t]=L,this._children[t]={},this._children[L][t]=!0;return this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var e=(r)=>this.removeEdge(this._edgeObjs[r]);if(delete this._nodes[t],this._isCompound)this._removeFromParentsChildList(t),delete this._parent[t],v(this.children(t),(r)=>{this.setParent(r)}),delete this._children[t];v(Ft(this._in[t]),e),delete this._in[t],delete this._preds[t],v(Ft(this._out[t]),e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(Lt(e))e=L;else{e+="";for(var r=e;!Lt(r);r=this.parent(r))if(r===t)throw Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var e=this._parent[t];if(e!==L)return e}}children(t){if(Lt(t))t=L;if(this._isCompound){var e=this._children[t];if(e)return Ft(e)}else if(t===L)return this.nodes();else if(this.hasNode(t))return[]}predecessors(t){var e=this._preds[t];if(e)return Ft(e)}successors(t){var e=this._sucs[t];if(e)return Ft(e)}neighbors(t){var e=this.predecessors(t);if(e)return ht(e,this.successors(t))}isLeaf(t){var e;if(this.isDirected())e=this.successors(t);else e=this.neighbors(t);return e.length===0}filterNodes(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var r=this;v(this._nodes,function(f,i){if(t(i))e.setNode(i,f)}),v(this._edgeObjs,function(f){if(e.hasNode(f.v)&&e.hasNode(f.w))e.setEdge(f,r.edge(f))});var o={};function a(f){var i=r.parent(f);if(i===void 0||e.hasNode(i))return o[f]=i,i;else if(i in o)return o[i];else return a(i)}if(this._isCompound)v(e.nodes(),function(f){e.setParent(f,a(f))});return e}setDefaultEdgeLabel(t){if(!Za(t))t=mr(t);return this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Qr(this._edgeObjs)}setPath(t,e){var r=this,o=arguments;return ni(t,function(a,f){if(o.length>1)r.setEdge(a,f,e);else r.setEdge(a,f);return f}),this}setEdge(){var t,e,r,o,a=!1,f=arguments[0];if(typeof f==="object"&&f!==null&&"v"in f){if(t=f.v,e=f.w,r=f.name,arguments.length===2)o=arguments[1],a=!0}else if(t=f,e=arguments[1],r=arguments[3],arguments.length>2)o=arguments[2],a=!0;if(t=""+t,e=""+e,!Lt(r))r=""+r;var i=z(this._isDirected,t,e,r);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,i)){if(a)this._edgeLabels[i]=o;return this}if(!Lt(r)&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[i]=a?o:this._defaultEdgeLabelFn(t,e,r);var n=Dn(this._isDirected,t,e,r);return t=n.v,e=n.w,Object.freeze(n),this._edgeObjs[i]=n,xr(this._preds[e],t),xr(this._sucs[t],e),this._in[e][i]=n,this._out[t][i]=n,this._edgeCount++,this}edge(t,e,r){var o=arguments.length===1?ct(this._isDirected,arguments[0]):z(this._isDirected,t,e,r);return this._edgeLabels[o]}hasEdge(t,e,r){var o=arguments.length===1?ct(this._isDirected,arguments[0]):z(this._isDirected,t,e,r);return Object.prototype.hasOwnProperty.call(this._edgeLabels,o)}removeEdge(t,e,r){var o=arguments.length===1?ct(this._isDirected,arguments[0]):z(this._isDirected,t,e,r),a=this._edgeObjs[o];if(a)t=a.v,e=a.w,delete this._edgeLabels[o],delete this._edgeObjs[o],hr(this._preds[e],t),hr(this._sucs[t],e),delete this._in[e][o],delete this._out[t][o],this._edgeCount--;return this}inEdges(t,e){var r=this._in[t];if(r){var o=Qr(r);if(!e)return o;return er(o,function(a){return a.v===e})}}outEdges(t,e){var r=this._out[t];if(r){var o=Qr(r);if(!e)return o;return er(o,function(a){return a.w===e})}}nodeEdges(t,e){var r=this.inEdges(t,e);if(r)return r.concat(this.outEdges(t,e))}}$e.prototype._nodeCount=0;$e.prototype._edgeCount=0;function xr(t,e){if(t[e])t[e]++;else t[e]=1}function hr(t,e){if(!--t[e])delete t[e]}function z(t,e,r,o){var a=""+e,f=""+r;if(!t&&a>f){var i=a;a=f,f=i}return a+dr+f+dr+(Lt(o)?Nn:o)}function Dn(t,e,r,o){var a=""+e,f=""+r;if(!t&&a>f){var i=a;a=f,f=i}var n={v:a,w:f};if(o)n.name=o;return n}function ct(t,e){return z(t,e.v,e.w,e.name)}
|
|
2
|
-
export{Rt,fn,Xn,qt,Tr,Ja,ve,vt,pr,Za,mr,hl,yd,vd,kd,ho,ra,xd,bo,An,yo,Na,aa,vo,Xa,ko,wd,Cd,bl,Ft,Ed,xo,ei,wo,yl,vl,ti,Bd,kl,Id,mu,Dr,xl,_d,Sd,Td,Pn,wl,Cl,Co,Dd,El,v,er,Qr,Lt,ni,$e};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{d,n,i,V,o,u,a,le,e,w,Nf,we,Or,hp,s,I,ne,De,Be,sr,m,M,D,Xe,xt,f,B,ie,et,Sn,tt,Dt,Xt,nt,fe,yr,Ue,fi,Dn,ya,Y,C,F,Hn,b,At,ce,J,it,ge,zt,Ut,Et,gt,Bt,un,ja,Yr,js,Dg,je,Jo,am,Ou,dc,Ea,im,Bi,Ii,_i,bt,om,Zo,Xo,pc,Qg,Ng,sm,es,Si,Ti,lm,Di,cm,Rg,um,Fg,dm,pm,mm,Lg,fm,Hs,rn,mc,Ws,Am,$u,Mg,fc,zu}from"./index-3wpsr2bc.js";import{cl,_a,md,ys}from"./index-cj9193d5.js";var Wn={name:"arrow-up-down",size:24,node:[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]},ss=s(Wn);var zn={name:"calendar",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}]]},Ia=s(zn);var Un={name:"check-check",size:24,node:[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]},rt=s(Un);var Gn={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]},_r=s(Gn);function st({value:t,onInput:r,onSubmit:l,onRefresh:c,onNewFolder:p,loading:g,creating:h,resolved:x}){return e("div",{children:[e("div",{className:"flex items-center space-x-2",children:[e("form",{onSubmit:(y)=>{y.preventDefault(),l()},className:"flex-1 flex items-center bg-paper border border-ink/20 rounded overflow-hidden focus-within:border-ink/50",children:[e("div",{className:"px-2 text-ink/40 bg-ink/5 h-full flex items-center border-r border-ink/10",children:e(sr,{size:14})}),e("input",{type:"text",value:t,onChange:(y)=>r(y.currentTarget.value),placeholder:"~/projects/my-project",spellcheck:!1,"aria-label":"Project path",className:"w-full px-3 py-2 outline-none text-sm bg-transparent font-mono"})]}),e("button",{type:"button",onClick:c,disabled:g,title:"Refresh folders","aria-label":"Refresh folders","aria-busy":g,className:"px-2.5 py-2 bg-ink/5 border border-ink/10 rounded text-ink/70 hover:bg-ink/10 hover:text-ink disabled:opacity-40 transition-colors flex-shrink-0",children:e(C,{size:13,className:g?"animate-spin":void 0})}),e("button",{type:"button",onClick:p,disabled:h||g||!x,title:"New folder here","aria-label":"New folder here","aria-busy":h,className:"px-2.5 py-2 bg-ink/5 border border-ink/10 rounded text-ink/70 hover:bg-ink/10 hover:text-ink disabled:opacity-40 transition-colors flex-shrink-0",children:h?e(m,{size:13,className:"animate-spin"}):e(Xt,{size:13})})]}),x&&x!==t.trim()&&e("p",{className:"mt-1 text-[10px] text-ink/40 font-mono truncate",children:["Listing: ",x]})]})}function at({directories:t,loading:r,error:l,onOpen:c,onRetry:p,creating:g,name:h,onNameChange:x,onCreate:S,onCancelCreate:y,createError:v,creatingBusy:T}){return e("div",{className:"border border-ink/15 rounded overflow-hidden",children:[g&&e("form",{onSubmit:(N)=>{if(N.preventDefault(),h.trim())S(h.trim())},className:"flex items-center space-x-1.5 px-2 py-1.5 border-b border-ink/10 bg-ink/5",children:[e(nt,{size:13,className:"text-ink/40 flex-shrink-0"}),e("input",{type:"text",value:h,onChange:(N)=>x(N.currentTarget.value),placeholder:"new-folder-name","aria-label":"New folder name",spellcheck:!1,className:"flex-1 bg-paper border border-ink/20 rounded px-2 py-1 outline-none focus:border-ink/50 text-xs"}),e("button",{type:"submit",disabled:T||!h.trim(),className:"px-2 py-1 rounded bg-ink text-canvas text-[11px] font-medium hover:bg-ink/90 disabled:opacity-40 transition-colors",children:T?"Creating…":"Create"}),e("button",{type:"button",onClick:y,"aria-label":"Cancel new folder",className:"p-1 rounded text-ink/40 hover:text-ink hover:bg-ink/10 transition-colors",children:e(b,{size:12})})]}),g&&v&&e("p",{className:"px-2.5 py-1.5 text-[11px] text-error border-b border-ink/10",children:v}),e("div",{className:"max-h-52 overflow-y-auto scrollbar-overlay-container",children:r?e("div",{className:"flex items-center justify-center py-8 text-ink/40",children:e(m,{size:16,className:"animate-spin"})}):l?e("div",{className:"flex flex-col items-center justify-center py-6 px-3 text-xs text-error space-y-2",children:[e("span",{className:"text-center",children:l}),e("button",{type:"button",onClick:p,className:"px-2 py-1 rounded bg-ink/5 border border-ink/10 text-ink/70 hover:bg-ink/10 flex items-center space-x-1",children:[e(C,{size:11})," ",e("span",{children:"Retry"})]})]}):t.length===0?e("div",{className:"text-center py-8 text-xs text-ink/40",children:"No subfolders"}):t.map((N)=>e("button",{type:"button",onClick:()=>c(N),title:N.path,className:"w-full flex items-center space-x-2 px-2.5 py-1.5 text-left hover:bg-ink/5 transition-colors group",children:[e(nt,{size:14,className:"text-ink/50 flex-shrink-0"}),e("span",{className:"text-xs truncate text-ink/85 flex-1",children:N.name}),e(tt,{size:11,className:"text-ink/20 group-hover:text-ink/50 flex-shrink-0 transition-colors"})]},N.path))})]})}function lt(t){let r=t.trim();if(!r||/\s/.test(r))return!1;if(/^https?:\/\/\S+$/i.test(r))return!0;if(/^ssh:\/\/\S+$/i.test(r))return!0;if(/^git@[^:/\s]+:\S+$/.test(r))return!0;if(/^file:\/\/\S+$/i.test(r))return!0;if(r.startsWith("/")||r.startsWith("~"))return!0;if(/^[a-z]:[\\/]/i.test(r))return!0;if(/^\\\\[^\\]+\\/.test(r))return!0;return!1}function ct(t){let c=t.replace(/^[a-z]:/i,"").replace(/\\/g,"/").replace(/\/+$/,"").split(/[/:]/).filter(Boolean),p=c.length===0?"":c[c.length-1];if(p===""||/^[a-z]+:$/i.test(p)||/^https?:?$/i.test(p))return"";return p.replace(/\.git$/i,"").replace(/[^a-z0-9._-]/gi,"-")}function dt({parent:t,busy:r,onClone:l}){let[c,p]=n(""),g=c.trim(),h=lt(g),x=h?ct(g):"",S=()=>{if(h&&!r)l(g)};return e("div",{children:[e("label",{className:"block text-xs font-semibold mb-1 text-ink",children:["Clone Git Repository"," ",e("span",{className:"text-ink/40 font-normal",children:"(optional: clones into the path above)"})]}),e("div",{className:"flex items-center space-x-2",children:[e("input",{type:"text",value:c,onChange:(y)=>p(y.currentTarget.value),onKeyDown:(y)=>{if(y.key==="Enter")y.preventDefault(),S()},disabled:r,placeholder:"https://github.com/org/repo.git",spellcheck:!1,"aria-label":"Git repository URL",className:"flex-1 bg-paper border border-ink/20 rounded px-3 py-2 outline-none focus:border-ink/50 text-sm font-mono disabled:opacity-60"}),e("button",{type:"button",onClick:S,disabled:!h||r,title:h?`Clone into ${t}/${x}`:"Enter an https, ssh, git@ or local path","aria-label":"Clone repository",className:"px-3 py-2 bg-ink/5 border border-ink/10 rounded text-xs font-medium hover:bg-ink/10 disabled:opacity-40 transition-colors flex items-center space-x-1.5 flex-shrink-0",children:[r?e(m,{size:13,className:"animate-spin"}):e(yr,{size:13}),e("span",{children:r?"Cloning…":"Clone"})]})]}),h&&x&&!r&&e("p",{className:"mt-1 text-[10px] text-ink/40 font-mono truncate",children:["Creates workspace “",x.toLowerCase(),"” at ",t,"/",x]})]})}function ut(t){let[r,l]=n(t??""),[c,p]=n([]),[g,h]=n(null),[x,S]=n(!1),[y,v]=n(null),T=o(0),O=a(async(k)=>{let R=++T.current;S(!0),v(null);try{let P=await md(k);if(R!==T.current)return;l(P.path??k??""),h(P.parentPath??null),p(P.directories??[])}catch(P){if(R!==T.current)return;v(P instanceof Error?P.message:String(P)),p([])}finally{if(R===T.current)S(!1)}},[]);i(()=>{O(t||void 0)},[O]);let N=a(()=>O(r||void 0),[O,r]);return{current:r,directories:c,parentPath:g,loading:x,error:y,navigate:O,refresh:N}}function ll({isOpen:t,onClose:r,onCreate:l,onClone:c}){if(!t)return null;return e(jn,{onClose:r,onCreate:l,onClone:c})}function jn({onClose:t,onCreate:r,onClone:l}){let[c,p]=n("create"),[g,h]=n(""),[x,S]=n(""),[y,v]=n(!1),[T,O]=n(null),[N,k]=n(!1),[R,P]=n(!1),[E,L]=n(""),[A,W]=n(null),[q,ee]=n(!1),U=ut(),te=async(z)=>{ee(!0),W(null);try{let K=await fetch("/api/folders/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({parent:U.current,name:z})}),_=await K.json().catch(()=>({}));if(!K.ok||!_.success)throw Error(_.error||`HTTP ${K.status}`);P(!1),await U.refresh()}catch(K){W(K instanceof Error?K.message:String(K))}finally{ee(!1)}},oe=async()=>{if(!r)return t();if(!g.trim()&&!x.trim()){O("Enter a name or a project path.");return}v(!0),O(null);try{await r({name:g.trim(),path:x.trim()||void 0}),t()}catch(z){O(z instanceof Error?z.message:String(z)),v(!1)}},Z=async(z)=>{if(!l)return t();if(!U.current){O("Enter the folder the repository should be cloned into.");return}v(!0),O(null);try{await l({url:z,parent:U.current,name:g.trim()||void 0}),t()}catch(K){O(K instanceof Error?K.message:String(K)),v(!1)}};return e("div",{className:"fixed inset-0 modal-scrim z-50 flex items-center justify-center p-4",children:[e("div",{className:"glass-overlay bg-paper border border-ink/10 rounded-lg shadow-xl w-[30rem] max-w-full max-h-full overflow-y-auto flex flex-col",children:[e("div",{className:"flex justify-between items-center px-4 pt-4 pb-2 border-b border-ink/10",children:[e("h3",{className:"font-semibold text-sm",children:"New Workspace"}),e("button",{type:"button",onClick:t,"aria-label":"Close",className:"p-1 rounded text-ink/60 hover:text-ink hover:bg-ink/10 transition-colors",children:e(b,{size:14})})]}),e("div",{className:"flex px-4 pt-2 space-x-1",children:["create","clone"].map((z)=>e("button",{type:"button",onClick:()=>{p(z),O(null)},"aria-pressed":c===z,className:`px-3 py-1.5 text-xs font-medium rounded-t transition-colors ${c===z?"text-ink border-b-2 border-ink":"text-ink/50 hover:text-ink"}`,children:z==="create"?"Create":"Clone"},z))}),e("div",{className:"px-4 py-3 space-y-3 text-sm text-ink/80",children:[e("div",{children:[e("label",{className:"block text-xs font-semibold mb-1 text-ink",children:["Workspace Name"," ",e("span",{className:"text-ink/40 font-normal",children:c==="clone"?"(optional: defaults to the repository name)":""})]}),e("input",{type:"text",value:g,onChange:(z)=>h(z.currentTarget.value),placeholder:"e.g. bofis-pro",className:"w-full bg-paper border border-ink/20 rounded px-3 py-2 outline-none focus:border-ink/50 text-sm"})]}),e("div",{children:[e("label",{className:"block text-xs font-semibold mb-1 text-ink",children:[c==="clone"?"Clone Into":"Project Path"," ",e("span",{className:"text-ink/40 font-normal",children:c==="create"?"(optional: binds omp sessions)":""})]}),e(st,{value:x,onInput:S,onSubmit:()=>void U.navigate(x.trim()||void 0),onRefresh:()=>void U.refresh(),onNewFolder:()=>{L(""),P(!0),W(null)},loading:U.loading,creating:q,resolved:U.current})]}),e(at,{directories:U.directories,loading:U.loading,error:U.error,onOpen:(z)=>{S(z.path),U.navigate(z.path)},onRetry:()=>void U.refresh(),creating:R,name:E,onNameChange:L,onCreate:(z)=>void te(z),onCancelCreate:()=>{P(!1),L(""),W(null)},createError:A,creatingBusy:q}),e("div",{className:"flex items-center justify-between",children:[e("button",{type:"button",onClick:()=>k(!0),className:"px-3 py-1.5 bg-ink/5 border border-ink/10 rounded text-xs font-medium hover:bg-ink/10 transition-colors flex items-center space-x-1.5",children:[e(Dt,{size:13}),e("span",{children:"Browse…"})]}),U.parentPath&&e("button",{type:"button",onClick:()=>void U.navigate(U.parentPath??void 0),className:"text-[11px] text-ink/50 hover:text-ink transition-colors",children:"↑ Up one level"})]}),c==="clone"&&e(dt,{parent:U.current,busy:y,onClone:(z)=>void Z(z)}),T&&e("div",{className:"text-xs text-error",children:T})]}),e("div",{className:"px-4 py-3 border-t border-ink/10 flex justify-end space-x-2",children:[e("button",{type:"button",className:"px-3 py-1.5 text-xs font-medium text-ink/60 hover:text-ink transition-colors",onClick:t,disabled:y,children:"Cancel"}),c==="create"&&e("button",{type:"button",className:"px-4 py-1.5 text-xs font-medium bg-ink text-canvas rounded hover:bg-ink/90 transition-colors disabled:opacity-50",onClick:()=>void oe(),disabled:y,children:y?"Creating…":"Create Workspace"})]})]}),N&&e(ys,{initialPath:x||void 0,onSelect:(z)=>{if(S(z),k(!1),!g.trim()){let K=z.replace(/[\\/]+$/,"").split(/[\\/]/).pop()||"";if(K)h(K)}U.navigate(z)},onClose:()=>k(!1)})]})}async function Kn(t){let r=await t.json().catch(()=>null);if(!t.ok||!r||r.error)return null;return{tasks:r.tasks??[],serverTimeZone:r.serverTimeZone??""}}function pt(t){let[r,l]=n([]),[c,p]=n(""),[g,h]=n(!1),[x,S]=n(null),y=a(async()=>{h(!0);try{let E=await Kn(await fetch("/api/schedule"));if(E){if(l(E.tasks),E.serverTimeZone)p(E.serverTimeZone);S(null)}else S("Could not load scheduled tasks.")}catch(E){S(E instanceof Error?E.message:String(E))}finally{h(!1)}},[]),v=we(Nf,{enabled:t});i(()=>{if(!v.data)return;if(l(v.data.tasks),v.data.serverTimeZone)p(v.data.serverTimeZone);h(!1),S(null)},[v.data]);let T=a(async(E,L)=>{try{let A=await fetch(E,L),W=await A.json().catch(()=>null);if(!A.ok||!W||W.error){let q=W?.error??`HTTP ${A.status}`;return S(q),q}if(W.tasks)l(W.tasks);return S(null),null}catch(A){let W=A instanceof Error?A.message:String(A);return S(W),W}},[]),O=a(async(E)=>await T("/api/schedule",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(E)}),[T]),N=a(async(E,L)=>T(`/api/schedule?id=${encodeURIComponent(E)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)}),[T]),k=a(async(E)=>T(`/api/schedule?id=${encodeURIComponent(E)}`,{method:"DELETE"}),[T]),R=a(async(E)=>await T(`/api/schedule?id=${encodeURIComponent(E)}&run=now`,{method:"POST"}),[T]),P=a(async(E)=>{try{let L=await fetch(`/api/schedule/${encodeURIComponent(E)}/runs`),A=await L.json().catch(()=>null);return L.ok?A?.runs??[]:[]}catch{return[]}},[]);return{tasks:r,serverTimeZone:c,loading:g,error:x,refresh:y,create:O,patch:N,remove:k,runNow:R,loadRuns:P}}function Wc(){let t=we(Nf);return u(()=>(t.data?.tasks??[]).filter((r)=>r.enabled).length,[t.data])}var mt=new Map;function ht(t){let r=mt.get(t);if(!r)r=new Intl.DateTimeFormat("en-US",{timeZone:t,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}),mt.set(t,r);return r}function kt(t){if(!t)return!1;try{return ht(t),!0}catch{return!1}}function St(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}function Pe(t,r){let l=ht(r).formatToParts(new Date(t)),c=(p)=>{let g=l.find((h)=>h.type===p);return g?Number(g.value):0};return{year:c("year"),month:c("month"),day:c("day"),hour:c("hour"),minute:c("minute"),second:c("second")}}function ft(t,r){let l=Pe(t,r);return Date.UTC(l.year,l.month-1,l.day,l.hour,l.minute,l.second)-Math.floor(t/1000)*1000}function Ge(t,r,l,c,p,g){let h=Date.UTC(t,r-1,l,c,p),x=ft(h,g),S=h-x,y=ft(S,g);if(y!==x)S=h-y;let v=Pe(S,g);if(v.year!==t||v.month!==r||v.day!==l||v.hour!==c||v.minute!==p)return null;return S}var Xn=60000,Zn={s:1000,sec:1000,secs:1000,second:1000,seconds:1000,m:60000,min:60000,mins:60000,minute:60000,minutes:60000,h:3600000,hr:3600000,hrs:3600000,hour:3600000,hours:3600000,d:86400000,day:86400000,days:86400000,w:604800000,week:604800000,weeks:604800000};function vt(t){let r=t.trim().toLowerCase();if(!r)return null;if(/^\d+(\.\d+)?$/.test(r)){let g=Number(r);return g>0?Math.round(g*60000):null}let l=r.match(/(\d+(?:\.\d+)?)\s*([a-z]+)/g);if(!l)return null;if(l.join("").replace(/\s+/g,"").length!==r.replace(/\s+/g,"").length)return null;let p=0;for(let g of l){let h=g.match(/^(\d+(?:\.\d+)?)\s*([a-z]+)$/);if(!h)return null;let x=Zn[h[2]];if(!x)return null;p+=Number(h[1])*x}return p>0?Math.round(p):null}var Yn=[[0,59],[0,23],[1,31],[1,12],[0,7]];function qn(t,r,l){let c=new Set;for(let p of t.split(",")){let[g,h]=p.split("/"),x=h===void 0?1:Number(h);if(!Number.isInteger(x)||x<1)return null;let S,y;if(g==="*")S=r,y=l;else if(g.includes("-")){let[v,T]=g.split("-");S=Number(v),y=Number(T)}else S=Number(g),y=h===void 0?S:l;if(!Number.isInteger(S)||!Number.isInteger(y))return null;if(S<r||y>l||S>y)return null;for(let v=S;v<=y;v+=x)c.add(v)}return c.size?[...c].sort((p,g)=>p-g):null}function Vn(t){let r=t.trim().split(/\s+/);if(r.length!==5)return null;let l=r.map((S,y)=>{let[v,T]=Yn[y];return qn(S,v,T)});if(l.some((S)=>S===null))return null;let[c,p,g,h,x]=l;return{minutes:c,hours:p,daysOfMonth:g,months:h,daysOfWeek:[...new Set(x.map((S)=>S===7?0:S))].sort((S,y)=>S-y),domRestricted:r[2].trim()!=="*",dowRestricted:r[4].trim()!=="*"}}function Jn(t,r,l,c){let p=new Date(Date.UTC(r,l-1,c)).getUTCDay(),g=t.daysOfMonth.includes(c),h=t.daysOfWeek.includes(p);if(t.domRestricted&&t.dowRestricted)return g||h;if(t.domRestricted)return g;if(t.dowRestricted)return h;return!0}function Qn(t,r,l){let c=l&&kt(l)?l:St(),p=Pe(r.getTime(),c),g=Date.UTC(p.year+8,p.month-1,p.day);for(let h=Date.UTC(p.year,p.month-1,p.day);h<=g;){let x=new Date(h),S=x.getUTCFullYear(),y=x.getUTCMonth()+1,v=x.getUTCDate();if(!t.months.includes(y)){h=Date.UTC(S,y,1);continue}if(Jn(t,S,y,v))for(let T of t.hours)for(let O of t.minutes){let N=Ge(S,y,v,T,O,c);if(N!==null&&N>r.getTime())return N}h=Date.UTC(S,y-1,v+1)}return null}var eo=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/;function yt(t,r){let l=t.trim();if(!l)return null;if(/^\d+$/.test(l)){let p=Number(l);return p>0?p:null}if(r){let p=l.match(eo);if(p){let[,g,h,x,S,y,v,T]=p,O=Ge(Number(g),Number(h),Number(x),Number(S),Number(y),r);if(O===null)return null;let N=(v?Number(v)*1000:0)+(T?Number(T.padEnd(3,"0")):0);return O+N}}let c=Date.parse(l);return Number.isNaN(c)?null:c}function wt(t,r,l=Date.now(),c){if(!r.trim())return{ok:!1,error:"Enter a schedule."};if(t==="once"){let h=yt(r,c);if(h===null)return{ok:!1,error:"Use an ISO timestamp, e.g. 2026-10-01T09:00."};if(h<=l)return{ok:!1,error:"That time is already in the past."};return{ok:!0,nextRunAt:h}}if(t==="every"){let h=vt(r);if(h===null)return{ok:!1,error:"Use a duration, e.g. 30m, 1h30m, 2 days."};if(h<Xn)return{ok:!1,error:"The shortest interval is 1 minute."};return{ok:!0,nextRunAt:l+h}}let p=Vn(r);if(!p)return{ok:!1,error:"Use 5 fields: minute hour day-of-month month day-of-week."};let g=Qn(p,new Date(l),c);if(g===null)return{ok:!1,error:"That expression never matches a date."};return{ok:!0,nextRunAt:g}}function Nt(t,r,l){let c=r.trim();if(t==="once"){let p=yt(c,l);return p===null?c:`Once at ${new Date(p).toLocaleString(void 0,l?{timeZone:l}:void 0)}`}if(t==="every"){let p=vt(c);return p===null?c:`Every ${Ke(p)}`}return`Cron ${c}`}function Ke(t){let r=Math.round(t/1000),l=Math.floor(r/86400),c=Math.floor(r%86400/3600),p=Math.floor(r%3600/60),g=r%60,h=[];if(l)h.push(`${l}d`);if(c)h.push(`${c}h`);if(p)h.push(`${p}m`);if(g&&!l)h.push(`${g}s`);return h.length?h.join(" "):"0s"}var to={"always-ask":"Ask before writes",write:"Auto-write, ask before exec",yolo:"Auto-run everything"};function Ze(t){return`${t.provider}/${t.id}`}function no(t){if(!Array.isArray(t))return[];let r=[];for(let l of t){if(!l||typeof l!=="object")continue;if(!("id"in l)||typeof l.id!=="string")continue;if(!("name"in l)||typeof l.name!=="string")continue;if(!("provider"in l)||typeof l.provider!=="string")continue;let c="thinkingLevels"in l&&Array.isArray(l.thinkingLevels)?l.thinkingLevels.filter((p)=>typeof p==="string"):void 0;r.push({id:l.id,name:l.name,provider:l.provider,...c?{thinkingLevels:c}:{}})}return r}function Tt({harness:t,model:r,onHarnessChange:l,onModelChange:c}){let{harnesses:p}=un(),g=ja((k)=>{let R=Array.isArray(k.modelList)&&k.modelList.length>0?k.modelList:k.models;return no(R)}),h=Jo(p,t,g??[]),x=h.models,S=r?x.find((k)=>k.provider===r.provider&&k.id===r.modelId):void 0,y=dc(S?.thinkingLevels),v=am(p,t),T=(k)=>{if(!k){c(null);return}let R=x.find((P)=>Ze(P)===k);if(!R)return;c({provider:R.provider,modelId:R.id,thinkingLevel:"auto",accessMode:r?.accessMode??"always-ask"})},O=(k)=>{if(!r)return;c({...r,thinkingLevel:k})},N=(k)=>{if(!r)return;c({...r,accessMode:k})};return e("div",{className:"space-y-2",children:[e("div",{className:"grid grid-cols-2 gap-2",children:[e("div",{children:[e("label",{className:"block font-semibold mb-1 text-ink",children:"Harness"}),e("select",{value:t,onChange:(k)=>l(k.currentTarget.value),className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 outline-none focus:border-ink/50 text-xs",children:[!v.some((k)=>k.id===t)&&e("option",{value:t,children:t}),v.map((k)=>e("option",{value:k.id,children:k.label},k.id))]})]}),e("div",{children:[e("label",{className:"block font-semibold mb-1 text-ink",children:"Model"}),e("select",{value:r?`${r.provider}/${r.modelId}`:"",onChange:(k)=>T(k.currentTarget.value),className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 outline-none focus:border-ink/50 text-xs",children:[e("option",{value:"",children:t==="omp-rpc"?"Default (composer selection)":"Harness default"}),r&&!x.some((k)=>k.provider===r.provider&&k.id===r.modelId)&&e("option",{value:`${r.provider}/${r.modelId}`,children:[r.provider,"/",r.modelId]}),x.map((k)=>e("option",{value:Ze(k),children:[k.name," · ",k.provider]},Ze(k)))]})]})]}),e("div",{className:"grid grid-cols-2 gap-2",children:[e("div",{children:[e("label",{className:"block font-semibold mb-1 text-ink",children:"Thinking"}),e("select",{value:r?.thinkingLevel??"auto",disabled:!r||y.length===0,onChange:(k)=>O(k.currentTarget.value),className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 outline-none focus:border-ink/50 text-xs disabled:opacity-40",children:[e("option",{value:"auto",children:"Auto"}),r&&r.thinkingLevel!=="auto"&&!y.includes(r.thinkingLevel)&&e("option",{value:r.thinkingLevel,children:r.thinkingLevel}),y.map((k)=>e("option",{value:k,children:k},k))]})]}),e("div",{children:[e("label",{className:"block font-semibold mb-1 text-ink",children:"Access"}),e("select",{value:r?.accessMode??"always-ask",disabled:!r,onChange:(k)=>N(k.currentTarget.value),className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 outline-none focus:border-ink/50 text-xs disabled:opacity-40",children:Ou.map((k)=>e("option",{value:k,children:to[k]},k))})]})]}),h.blocked&&e("p",{className:"text-[11px] text-error",children:h.blocked}),h.unprobed&&e("p",{className:"text-[11px] text-ink/40",children:"This harness has not been probed yet; its models appear after a status check."})]})}var Ct={once:"Once",every:"Every",cron:"Cron"},oo={once:"An ISO timestamp, e.g. 2026-10-01T09:00",every:"A duration, e.g. 30m, 1h30m, 2 days",cron:"5 fields: minute hour day-of-month month day-of-week"},ro={once:"2026-10-01T09:00",every:"1h30m",cron:"0 9 * * 1-5"};function so(t){let r=t-Date.now();if(r<=0)return"due now";let l=Math.round(r/60000);if(l<60)return`in ${l}m`;let c=Math.round(l/60);if(c<24)return`in ${c}h`;return`in ${Math.round(c/24)}d`}var Ae=null;function io(){if(Ae)return Ae;let t=Intl,r=[];try{r=t.supportedValuesOf?.("timeZone")??[]}catch{r=[]}return Ae=r.length?r:["UTC"],Ae}function ao(t){let r=io();return t&&!r.includes(t)?[t,...r]:r}function Ot({folders:t,initial:r,activeSessionId:l,serverTimeZone:c,busy:p,onSubmit:g,onCancel:h}){let[x,S]=n(""),[y,v]=n(""),[T,O]=n("every"),[N,k]=n("1h"),[R,P]=n("omp-rpc"),[E,L]=n(null),A=c||Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC",[W,q]=n(A),[ee,U]=n(null),[te,oe]=n(!1);i(()=>{S(r?.name??""),v(r?.prompt??""),O(r?.kind??"every"),k(r?.spec??"1h"),P(r?.harness??"omp-rpc"),L(r?.model??null),q(r?.timezone??A),U(r?.folderId??null),oe(Boolean(r?.sessionId))},[r?.id,A]);let Z=wt(T,N,Date.now(),W),z=Boolean(y.trim())&&Z.ok&&!p,K=()=>{if(!z||!Z.ok)return;g({name:x.trim(),prompt:y.trim(),kind:T,spec:N.trim(),harness:R,timezone:W,folderId:ee,sessionId:te?r?.sessionId??l:null,model:E})};return e("div",{className:"space-y-3 text-xs",children:[e("div",{children:[e("label",{className:"block font-semibold mb-1 text-ink",children:["Name ",e("span",{className:"text-ink/40 font-normal",children:"(optional)"})]}),e("input",{type:"text",value:x,onInput:(_)=>S(_.currentTarget.value),placeholder:"Morning standup digest",className:"w-full bg-paper border border-ink/20 rounded px-2.5 py-1.5 outline-none focus:border-ink/50 text-xs"})]}),e("div",{children:[e("label",{className:"block font-semibold mb-1 text-ink",children:"Prompt"}),e("textarea",{value:y,onInput:(_)=>v(_.currentTarget.value),placeholder:"Describe the task, ask a question, or paste commands…",rows:4,className:"w-full bg-paper border border-ink/20 rounded px-2.5 py-1.5 outline-none focus:border-ink/50 text-xs resize-y min-h-[80px]"})]}),e("div",{className:"flex items-end gap-2",children:[e("div",{className:"w-28 flex-shrink-0",children:[e("label",{className:"block font-semibold mb-1 text-ink",children:"Schedule"}),e("select",{value:T,onChange:(_)=>O(_.currentTarget.value),className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 outline-none focus:border-ink/50 text-xs",children:Object.keys(Ct).map((_)=>e("option",{value:_,children:Ct[_]},_))})]}),e("div",{className:"flex-1",children:[e("label",{className:"block font-semibold mb-1 text-ink",children:"When"}),e("input",{type:"text",value:N,onInput:(_)=>k(_.currentTarget.value),placeholder:ro[T],className:`w-full bg-paper border rounded px-2.5 py-1.5 outline-none text-xs font-mono ${Z.ok?"border-ink/20 focus:border-ink/50":"border-error/50 focus:border-error"}`})]})]}),e("p",{className:`text-[11px] ${Z.ok?"text-ink/50":"text-error"}`,children:Z.ok?`Next run ${so(Z.nextRunAt)} · ${new Date(Z.nextRunAt).toLocaleString(void 0,{timeZone:W})} · ${W}`:Z.error}),e("p",{className:"text-[11px] text-ink/40",children:oo[T]}),e("div",{className:"grid grid-cols-2 gap-2",children:[e("div",{children:[e("label",{className:"block font-semibold mb-1 text-ink",children:"Timezone"}),e("select",{value:W,onChange:(_)=>q(_.currentTarget.value),className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 outline-none focus:border-ink/50 text-xs",children:ao(W).map((_)=>e("option",{value:_,children:_},_))})]}),e("div",{children:[e("label",{className:"block font-semibold mb-1 text-ink",children:"Run in"}),e("select",{value:ee===null?"":String(ee),onChange:(_)=>U(_.currentTarget.value?Number(_.currentTarget.value):null),className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 outline-none focus:border-ink/50 text-xs",children:[e("option",{value:"",children:"Server default directory"}),t.map((_)=>e("option",{value:_.id,children:_.name},_.id))]})]})]}),e(Tt,{harness:R,model:E,onHarnessChange:(_)=>{P(_),L(null)},onModelChange:L}),e("label",{className:`flex items-center gap-2 text-[11px] ${l?"text-ink/70":"text-ink/35"}`,children:[e("input",{type:"checkbox",checked:te,disabled:!l,onChange:(_)=>oe(_.currentTarget.checked),className:`${ge} accent-ink`}),e("span",{children:"Resume the open session each run"})]}),e("div",{className:"flex justify-end gap-2 pt-1",children:[e("button",{type:"button",onClick:h,disabled:p,className:"px-3 py-1.5 text-xs font-medium text-ink/60 hover:text-ink transition-colors",children:"Cancel"}),e("button",{type:"button",onClick:K,disabled:!z,className:"inline-flex items-center gap-1.5 px-4 py-1.5 text-xs font-medium bg-ink text-canvas rounded hover:bg-ink/90 transition-colors disabled:opacity-40",children:[p&&e(m,{size:12,className:"animate-spin"}),r?"Save changes":"Schedule task"]})]})]})}function lo(t){return t===null?"–":new Date(t).toLocaleString()}function co(t){if(t.name)return t.name;let r=t.prompt.replace(/\s+/g," ").trim();return r.length>60?`${r.slice(0,57)}…`:r||"(empty prompt)"}function It({tasks:t,loading:r,pending:l,onRunNow:c,onToggleEnabled:p,onEdit:g,onDelete:h,loadRuns:x}){let[S,y]=n(null),[v,T]=n([]),[O,N]=n(!1);if(i(()=>{if(!S)return;let k=!0;return N(!0),x(S).then((R)=>{if(!k)return;T(R),N(!1)}),()=>{k=!1}},[S,x]),t.length===0)return e("div",{className:"px-3 py-8 text-center text-[11px] text-ink/50 border border-dashed border-ink/15 rounded-lg",children:r?"Loading…":"No scheduled tasks yet. Create one above."});return e("ul",{className:"space-y-2",children:t.map((k)=>{let R=l===k.id,P=S===k.id;return e("li",{className:"border border-ink/10 rounded-lg bg-paper",children:[e("div",{className:"flex items-start gap-2 p-2.5",children:[e("span",{className:"mt-0.5 shrink-0","aria-hidden":"true",children:!k.enabled?e(fi,{size:14,className:"text-ink/40"}):k.lastStatus==="error"?e(I,{size:14,className:"text-error"}):k.lastStatus==="success"?e(ne,{size:14,className:"text-ink/60"}):e(Sn,{size:14,className:"text-ink/60"})}),e("div",{className:"min-w-0 flex-1",children:[e("p",{className:"text-xs font-medium text-ink truncate",children:co(k)}),e("p",{className:"text-[11px] text-ink/60 mt-0.5",children:[Nt(k.kind,k.spec,k.timezone),k.kind!=="every"&&e(d,{children:[e("span",{className:"text-ink/30",children:" · "}),k.timezone]}),e("span",{className:"text-ink/30",children:" · "}),!k.enabled?k.kind==="once"&&k.lastRunAt!==null?"Ran once, with no next run":"Paused":`Next ${lo(k.nextRunAt)}`]}),k.cwd&&e("p",{className:"text-[10.5px] text-ink/40 font-mono truncate mt-0.5",children:k.cwd}),e("p",{className:"text-[10.5px] text-ink/40 truncate mt-0.5",children:[k.harness,k.model&&` · ${k.model.provider}/${k.model.modelId}`]}),k.sessionId&&e("p",{className:"text-[10.5px] text-ink/40 font-mono truncate mt-0.5",children:["resumes ",k.sessionId.slice(0,8)]}),k.lastStatus==="error"&&k.lastError&&e("p",{className:"text-[10.5px] text-error mt-0.5 break-words",children:k.lastError}),k.runCount>0&&e("p",{className:"text-[10.5px] text-ink/40 mt-0.5",children:["Fired ",k.runCount,"×"]})]}),e("div",{className:"flex items-center gap-1 shrink-0",children:[e("button",{type:"button",title:"Run now","aria-label":"Run now",disabled:R,onClick:()=>c(k.id),className:"p-1.5 rounded hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors disabled:opacity-40",children:R?e(m,{size:13,className:"animate-spin"}):e(ya,{size:13})}),e("button",{type:"button",title:k.enabled?"Pause":"Resume","aria-label":k.enabled?"Pause":"Resume","aria-pressed":k.enabled,disabled:R,onClick:()=>p(k),className:"p-1.5 rounded hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors disabled:opacity-40",children:k.enabled?e(fi,{size:13}):e(ya,{size:13})}),e("button",{type:"button",title:"Edit","aria-label":"Edit",disabled:R,onClick:()=>g(k),className:"p-1.5 rounded hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors disabled:opacity-40",children:e(Dn,{size:13})}),e("button",{type:"button",title:"Delete","aria-label":"Delete",disabled:R,onClick:()=>h(k.id),className:"p-1.5 rounded hover:bg-ink/5 text-ink/60 hover:text-error transition-colors disabled:opacity-40",children:e(M,{size:13})})]})]}),e("button",{type:"button",onClick:()=>y(P?null:k.id),"aria-expanded":P,className:"w-full text-left px-2.5 py-1.5 border-t border-ink/5 text-[10.5px] text-ink/50 hover:text-ink transition-colors",children:P?"Hide run history":"Run history"}),P&&e("div",{className:"px-2.5 pb-2.5 space-y-1",children:[O&&e("p",{className:"text-[10.5px] text-ink/40",children:"Loading…"}),!O&&v.length===0&&e("p",{className:"text-[10.5px] text-ink/40",children:"This task has not run yet."}),!O&&v.map((E)=>e("div",{className:"flex items-start gap-2 text-[10.5px]",children:[e("span",{className:"w-16 shrink-0 text-ink/50",children:new Date(E.startedAt).toLocaleTimeString()}),e("span",{className:`w-14 shrink-0 font-medium ${E.status==="error"?"text-error":E.status==="running"?"text-ink/60":"text-ink/70"}`,children:E.status}),e("span",{className:"w-12 shrink-0 text-ink/40",children:E.finishedAt===null?"…":Ke(E.finishedAt-E.startedAt)}),e("span",{className:"min-w-0 flex-1 text-ink/60 break-words",children:[E.detail||"–",E.sessionId&&e("span",{className:"block font-mono text-[10px] text-ink/40",children:["session ",E.sessionId.slice(0,8)]})]})]},E.id))]})]},k.id)})})}function Rt(){let[t,r]=n([]);return i(()=>{let l=!0;return fetch("/api/settings/projects").then((c)=>c.json()).then((c)=>{if(!l)return;r((c.projects??[]).filter((p)=>typeof p.folderId==="number").map((p)=>({id:p.folderId,name:p.name})))}).catch((c)=>console.error("Failed to load workspace folders:",c)),()=>{l=!1}},[]),t}function Kc({isOpen:t,onClose:r,activeSessionId:l=null,onToast:c}){let p=pt(t),g=Rt(),[h,x]=n(null),[S,y]=n(!1),[v,T]=n(!1),[O,N]=n(null);if(i(()=>{if(t)return;x(null),y(!1),T(!1),N(null)},[t]),i(()=>{let A=(W)=>{if(W.key!=="Escape"||v)return;if(W.preventDefault(),h||S){x(null),y(!1);return}r()};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[r,v,h,S]),!t)return null;let k=async(A)=>{T(!0);let W=h?await p.patch(h.id,A):await p.create(A);if(T(!1),W){c?.(W,"error");return}c?.(h?"Scheduled task updated.":"Scheduled task created.","success"),x(null),y(!1)},R=async(A)=>{N(A.id);let W=await p.patch(A.id,{enabled:!A.enabled});if(N(null),W)c?.(W,"error")},P=async(A)=>{N(A);let W=await p.runNow(A);if(N(null),W){c?.(W,"error");return}c?.("Task dispatched. Open the session to watch it run.","success")},E=async(A)=>{N(A);let W=await p.remove(A);if(N(null),W){c?.(W,"error");return}if(h?.id===A)x(null)},L=h!==null||S;return e("div",{className:"fixed inset-0 modal-scrim backdrop-blur-[2px] z-50 flex items-center justify-center p-4",onClick:v?void 0:r,role:"dialog","aria-modal":"true","aria-label":"Scheduled tasks",children:e("div",{className:"glass-overlay bg-paper border border-ink/15 rounded-xl shadow-2xl w-[min(94vw,640px)] max-h-[88vh] flex flex-col overflow-hidden text-ink",onClick:(A)=>A.stopPropagation(),children:[e("div",{className:"flex items-center justify-between px-4 py-3 border-b border-ink/10",children:[e("div",{className:"flex items-center gap-2",children:[e(Ia,{size:15}),e("h3",{className:"font-semibold text-sm",children:"Scheduled Tasks"})]}),e("button",{type:"button",onClick:r,"aria-label":"Close",className:"p-1.5 -m-1.5 rounded text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors",children:e(b,{size:16})})]}),e("div",{className:"p-4 overflow-y-auto space-y-4",children:[p.error&&!L&&e("p",{className:"text-[11px] text-error border border-error/30 bg-error/5 rounded px-2.5 py-1.5",children:p.error}),L?e(Ot,{folders:g,initial:h,activeSessionId:l,serverTimeZone:p.serverTimeZone,busy:v,onSubmit:k,onCancel:()=>{x(null),y(!1)}}):e("button",{type:"button",onClick:()=>y(!0),className:"w-full py-2 rounded-lg border border-dashed border-ink/20 text-xs font-medium text-ink/70 hover:text-ink hover:border-ink/40 transition-colors",children:"+ New scheduled task"}),!L&&e(It,{tasks:p.tasks,loading:p.loading,pending:O,onRunNow:P,onToggleEnabled:R,onEdit:(A)=>x({id:A.id,name:A.name,prompt:A.prompt,kind:A.kind,spec:A.spec,harness:A.harness,timezone:A.timezone,folderId:A.folderId,sessionId:A.sessionId,model:A.model}),onDelete:E,loadRuns:p.loadRuns})]})]})})}var Ye=["A-Z","Z-A","LATEST_SESSION","LATEST_ADDED"],Pt={"A-Z":"A-Z","Z-A":"Z-A",LATEST_SESSION:"Latest Session",LATEST_ADDED:"Latest Added"};function Mi({variant:t,sortOption:r,onSortChange:l}){if(t==="mobile")return e(d,{children:[e("div",{className:"px-2 py-1 text-[10px] uppercase font-bold text-ink/40 font-mono",children:"Sort Workspaces"}),Ye.map((c)=>e("button",{type:"button",onClick:()=>l(c),className:`w-full text-left px-2.5 py-1.5 rounded-lg flex items-center justify-between transition-colors ${r===c?"bg-ink/10 font-semibold text-ink":"hover:bg-ink/5 text-ink/80"}`,children:[e("span",{children:c.replace("_"," ")}),r===c&&e(f,{size:13,className:"text-ink"})]},c))]});return e(d,{children:[e("div",{className:"px-3 py-1 text-[10px] uppercase font-bold text-ink/40 tracking-wider",children:"Sort Workspaces"}),Ye.map((c)=>e("div",{className:`px-3 py-1.5 text-xs cursor-pointer flex items-center justify-between ${r===c?"bg-ink/5 text-ink font-medium":"text-ink/70 hover:bg-ink/5 hover:text-ink"}`,onClick:()=>l(c),children:[e("span",{children:Pt[c]}),r===c&&e("div",{className:"w-1.5 h-1.5 rounded-full bg-ink"})]},c))]})}function Vc({actions:t,sortHidden:r,sortOption:l,onSortChange:c,layout:p="desktop"}){let g=p==="mobile",[h,x]=n(!1),S=o(null);ce(S,()=>x(!1)),i(()=>{if(!h)return;let v=(T)=>{if(T.key==="Escape")x(!1)};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[h]);let y=(v)=>{x(!1),v.onSelect()};return e("div",{className:"relative shrink-0",ref:S,children:[e("button",{type:"button",title:"More sidebar actions","aria-label":"More sidebar actions","aria-haspopup":"menu","aria-expanded":h,onClick:()=>x(!h),className:`inline-flex items-center justify-center transition-colors cursor-pointer ${g?"w-9.5 h-9.5 rounded-xl border active:scale-95 shadow-xs":"w-7 h-7 rounded border"} ${h?"border-ink/30 bg-ink/10 text-ink":"border-ink/15 bg-paper text-ink/70 hover:bg-ink/5 hover:text-ink"}`,children:e(Be,{size:g?16:14})}),h&&e("div",{role:"menu",className:`glass-popover absolute right-0 top-full mt-2 w-52 bg-paper border border-ink/15 shadow-lg z-50 py-1 text-xs ${g?"rounded-xl p-2":"rounded-lg"}`,children:[t.map((v)=>e("button",{type:"button",role:"menuitem",onClick:()=>y(v),"aria-pressed":v.active,className:`w-full text-left flex items-center gap-2 transition-colors ${g?"px-2.5 py-1.5 rounded-lg":"px-3 py-1.5"} ${v.active?"bg-ink/5 text-ink font-medium":"text-ink/75 hover:bg-ink/5 hover:text-ink"}`,children:[e(v.icon,{size:13}),e("span",{children:v.label})]},v.id)),r&&e("div",{className:"mt-1 border-t border-ink/10 pt-1",children:e(Mi,{variant:p,sortOption:l,onSortChange:c})})]})]})}function ls(t){let r=o(null),[l,c]=n(0);return V(()=>{let p=r.current;if(!p)return;let g=()=>c(Math.max(0,p.clientWidth-t));if(g(),typeof ResizeObserver>"u")return;let h=new ResizeObserver(g);return h.observe(p),()=>h.disconnect()},[t]),{ref:r,width:l}}var ud=["new-workspace","refresh","search","select","archive","scheduler","sort"];var nA=8;function rA(t){let r=ud.length;if(!(t>0))return r;let l=t-112-6-8;if(r*28+(r-1)*6<=l)return r;let p=Math.floor((l-28-8)/34);return Math.max(2,Math.min(r,p))}var uo=38,po=8,fo=126,ho=1,dd=["new-workspace","refresh","archive","sort","scheduler","select"];function aA(t){let r=dd.length;if(!(t>0))return r;let l=uo+po,c=Math.floor((t-fo)/l);if(c>=r)return r;return Math.max(ho,Math.min(r,c-1))}function cs(t=5,r=7){let[l,c]=n(t),p=a(()=>c((h)=>h+r),[r]),g=a(()=>c(t),[t]);return{visibleCount:l,showMore:p,showLess:g,canShowLess:l>t}}function us(t,r,l){let[c,p]=n(!1),g=it(),h=it(),{handleArchive:x,handleRename:S,handleRenameWithAi:y}=im(r,l),v=()=>{if(typeof t.id!=="number")return;g.submit({isPinned:String(!t.isPinned)},{method:"POST",action:`/api/folders/${t.id}/pin`}),r()},T=()=>{if(typeof t.id!=="number")return;h.submit({},{method:"POST",action:`/api/folders/${t.id}/delete`}),p(!1),r()},O=t.project_path?()=>{(async()=>{try{let N=await fetch(`/api/folders/${encodeURIComponent(String(t.id))}/open`,{method:"POST"}),k=await N.json().catch(()=>({}));if(!N.ok)l?.(k.error||`Could not open the folder (HTTP ${N.status})`)}catch(N){l?.(N instanceof Error?N.message:String(N))}})()}:void 0;return{confirmDelete:c,requestDelete:()=>p(!0),cancelDelete:()=>p(!1),handlePin:v,handleOpenFolder:O,handleDelete:T,handleArchive:x,handleRename:S,handleRenameWithAi:y}}function Sr({checked:t,indeterminate:r=!1,label:l,onChange:c,size:p="sm"}){let g=o(null);return i(()=>{if(g.current)g.current.indeterminate=r},[r]),e("input",{ref:g,type:"checkbox",checked:t,"aria-label":l,onChange:c,onClick:(h)=>h.stopPropagation(),className:`${ge} shrink-0 accent-ink cursor-pointer ${p==="md"?"w-3.5 h-3.5":"w-3 h-3"}`})}function bo(t){let r=t.branch||(t.detached?"detached":"worktree");return t.status==="missing"?`${r} · ${"missing"}`:r}function go(t){if(t.status==="missing")return`Worktree folder is missing: ${t.path}`;return t.detached?`Detached HEAD in worktree ${t.path}`:`Runs in worktree ${t.path}`}function ds({worktree:t}){let r=t.status==="missing";return e("span",{className:`flex min-w-0 items-center gap-1 truncate text-[10px] font-normal ${r?"text-warning":"text-ink/45"}`,title:go(t),"data-worktree-status":t.status,children:[e("span",{"aria-hidden":"true",className:"shrink-0 font-mono",children:"⑂"}),e("span",{className:"truncate",children:bo(t)})]})}var xo=1000,Ee=new Set,Oe=null;function ko(){let t=Date.now();for(let r of Ee)r(t)}function So(t){if(Ee.add(t),Oe===null)Oe=setInterval(ko,xo);return()=>{if(Ee.delete(t),Ee.size===0&&Oe!==null)clearInterval(Oe),Oe=null}}function Ft(t=!0){let[r,l]=n(()=>Date.now());return i(()=>{if(!t)return;return So(l)},[t]),r}function ps(t,r=Date.now()){if(t===null||t===void 0||t==="")return null;let l=typeof t==="number"?t:Date.parse(t);if(Number.isNaN(l))return null;let c=Math.round((r-l)/1000);if(c<45)return"now";let p=Math.round(c/60);if(p<60)return`${p}m`;let g=Math.round(p/60);if(g<24)return`${g}h`;let h=Math.round(g/24);if(h<7)return`${h}d`;let x=Math.round(h/7);if(x<5)return`${x}w`;let S=new Date(l),y=S.getFullYear()===new Date(r).getFullYear(),v=S.getDate(),T=S.toLocaleString("en-US",{month:"short"});return y?`${v} ${T}`:`${v} ${T} ${S.getFullYear()}`}function Pi(t){if(t===null||t===void 0||t==="")return null;let r=typeof t==="number"?t:Date.parse(t);if(Number.isNaN(r))return null;return new Date(r).toLocaleString("en-US",{weekday:"short",day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})}function Lt(t){if(!Number.isFinite(t)||t<1000)return"0s";return lm(t)??"0s"}function _t({startedAt:t,className:r}){let l=Ft(),c=Lt(Math.max(0,l-t)),p=u(()=>Pi(t),[t]);return e("span",{role:"timer",className:`tabular-nums ${r??""}`,title:p?`Started ${p}`:void 0,"aria-label":`Running for ${c}`,children:c})}function ms({timeAgo:t,timeTitle:r,runStartedAt:l,className:c}){if(l!==void 0)return e(_t,{startedAt:l,className:c});if(!t)return null;return e("span",{className:c,title:r??void 0,children:t})}function fs({variant:t,isPinned:r=!1,onOpenFolder:l,onSelectSessions:c,onNewWorktree:p,confirmDelete:g,onPin:h,onDelete:x,onRequestDelete:S,onCancelDelete:y}){if(t==="mobile")return g?e(d,{children:[e("div",{className:"px-3 py-2 text-ink/80 font-medium",children:"Delete workspace?"}),e("button",{type:"button",onClick:x,className:"w-full text-left px-3 py-2 hover:bg-error/10 text-error flex items-center space-x-2",children:[e(M,{size:13}),e("span",{children:"Yes, delete"})]}),e("button",{type:"button",onClick:y,className:"w-full text-left px-3 py-2 hover:bg-ink/5 text-ink/70",children:"Cancel"})]}):e(d,{children:[l&&e("button",{type:"button",onClick:l,className:"w-full text-left px-3 py-2 hover:bg-ink/5 text-ink/80 flex items-center space-x-2",children:[e(Dt,{size:13}),e("span",{children:"Go to Explorer"})]}),e("button",{type:"button",onClick:h,className:"w-full text-left px-3 py-2 hover:bg-ink/5 text-ink/80 flex items-center space-x-2",children:[r?e(cl,{size:13}):e(_a,{size:13}),e("span",{children:r?"Unpin Workspace":"Pin Workspace"})]}),c&&e("button",{type:"button",onClick:c,className:"w-full text-left px-3 py-2 hover:bg-ink/5 text-ink/80 flex items-center space-x-2",children:[e(_r,{size:13}),e("span",{children:"Select sessions"})]}),p&&e("button",{type:"button",onClick:p,className:"w-full text-left px-3 py-2 hover:bg-ink/5 text-ink/80 flex items-center space-x-2",children:[e(fe,{size:13}),e("span",{children:"New worktree…"})]}),e("button",{type:"button",onClick:S,className:"w-full text-left px-3 py-2 hover:bg-error/10 text-error flex items-center space-x-2",children:[e(M,{size:13}),e("span",{children:"Delete Workspace"})]})]});return g?e(d,{children:[e("div",{className:"px-3 py-1.5 text-xs text-ink/80 font-medium",children:"Delete workspace?"}),e("button",{type:"button",onClick:x,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-error",children:[e(M,{size:12}),e("span",{children:"Yes, delete"})]}),e("button",{type:"button",onClick:y,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-ink/70",children:e("span",{children:"Cancel"})})]}):e(d,{children:[l&&e("button",{type:"button",onClick:l,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-ink/80",children:[e(Dt,{size:12}),e("span",{children:"Go to Explorer"})]}),e("button",{type:"button",onClick:h,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-ink/80",children:[r?e(cl,{size:12}):e(_a,{size:12}),e("span",{children:r?"Unpin Workspace":"Pin Workspace"})]}),c&&e("button",{type:"button",onClick:c,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-ink/80",children:[e(_r,{size:12}),e("span",{children:"Select sessions"})]}),p&&e("button",{type:"button",onClick:p,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-ink/80",children:[e(fe,{size:12}),e("span",{children:"New worktree…"})]}),e("button",{type:"button",onClick:S,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-error",children:[e(M,{size:12}),e("span",{children:"Delete Workspace"})]})]})}function Fe({ancestors:t,isLast:r,first:l,style:c}){let p=c.insetPx+c.slotWidth/2,g=c.slotWidth/2+c.markGap+c.glyph/2,h=g+c.insetPx-p,x=2,S=p-1,y=l?r?{left:S,top:-6,height:"calc(50% + 6px)"}:{left:S,top:-6,bottom:-2}:r?{left:S,top:0,height:"50%"}:{left:S,top:0,bottom:-2};return e(d,{children:[t.map((v,T)=>e("span",{"data-guide":"ancestor","data-continues":v?void 0:"true","aria-hidden":"true",className:"relative shrink-0",style:{width:g},children:!v&&e("span",{className:"absolute z-10 bg-ink/40",style:{left:S,top:0,bottom:-2,width:2}})},T)),e("span",{"data-guide":"connector","data-last":r?"true":void 0,"data-first":l?"true":void 0,"aria-hidden":"true",className:"relative shrink-0",style:{width:g},children:[e("span",{className:"absolute z-10 bg-ink/40",style:{width:2,...y}}),e("span",{className:"absolute z-10 bg-ink/40",style:{left:S,top:"calc(50% - 1px)",width:h+1,height:2}})]})]})}function Mt({subagent:t,sessionId:r,style:l,running:c}){let[p]=le(),g=t.id===p.get("subagent"),h=Rg(t),x=t.task??t.assignment??t.description??h;return e("div",{className:"group/subagent-row flex items-center",children:[e("button",{type:"button",title:x,onClick:()=>window.dispatchEvent(new CustomEvent("omp:view-subagent",{detail:{sessionId:r,subagent:t}})),className:`flex-1 min-w-0 flex items-center text-left text-xs rounded-md ${l.inset} ${l.padding} cursor-pointer transition-colors select-none ${g?"bg-ink/10 font-medium text-ink":"text-ink/70 hover:text-ink hover:bg-ink/5"}`,children:[e("span",{"data-testid":"subagent-status-slot",className:"w-4 h-4 flex items-center justify-center shrink-0",children:e(cm,{status:t.status,live:c,size:11})}),e("span",{className:"w-2 shrink-0"}),e("span",{"data-testid":"subagent-mark",className:"mr-1.5 flex shrink-0 items-center text-ink/55",children:e(xt,{size:l.glyph,"aria-hidden":"true"})}),e("span",{className:"flex-1 min-w-0 truncate leading-snug",children:h})]}),c&&e("button",{type:"button",title:"Stop this subagent","aria-label":"Stop this subagent",onClick:()=>void um(r,t.id),className:"touch-visible shrink-0 mr-1 w-5 h-5 flex items-center justify-center rounded text-ink/40 hover:text-error hover:bg-error/5 opacity-0 group-hover/subagent-row:opacity-100 transition-opacity cursor-pointer",children:e(Hn,{size:10})})]})}var vo={pending:"started",running:"started",completed:"completed",failed:"failed",aborted:"aborted"};function yo(t,r){return t.map((l)=>{if(r.id!==void 0){if(l.id!==r.id)return l}else if(r.index===void 0||r.index<0||l.index!==r.index)return l;let c=r.status&&l.status==="started"?vo[r.status]??l.status:l.status;return{...l,status:c,progress:{...l.progress,...r},lastUpdate:Date.now()}})}function $t(t,r,l){let[c,p]=n([]),[g,h]=n(!1);return i(()=>{if(!l)return;let x=!1;return p([]),h(!0),Fg(t).then((S)=>{if(x||!S)return;let y=S.map(dm);p((v)=>fm(v,y))}).finally(()=>{if(!x)h(!1)}),()=>{x=!0}},[t,l]),i(()=>{if(!l||!r)return;let x=!1,S=Date.now(),y=(O)=>O.sessionId===t?O.payload:null,v=Hs("subagent_lifecycle",(O)=>{let N=pm(y(O));if(N)p((k)=>fm(k,[N]))}),T=Hs("subagent_progress",(O)=>{let N=mm(y(O));if(N)p((k)=>yo(k,N))});return fetch(`/api/agent/${encodeURIComponent(t)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"get_subagents"})}).then((O)=>O.ok?O.json():null).then((O)=>{if(x||!w(O))return;let N="data"in O?O.data:O;p((k)=>fm(k,Lg(N),S))}).catch(()=>{}),()=>{x=!0,v(),T()}},[l,r,t]),{subagents:c,isLoading:g}}function As(t,r,l,c,p=!1){let g=String(t.id);return{expandable:(r.get(g)?.length??0)>0||Boolean(t.hasSubagents),isExpanded:l.has(g),onToggleExpand:()=>c(g),isChild:p}}function mo({parentId:t,hasSubagents:r,childrenOf:l,expandedIds:c,onToggle:p,activeSessionId:g,renderSession:h,style:x,ancestors:S=[]}){let y=l.get(t)??[],{subagents:v,isLoading:T}=$t(t,g===t,r),O=[...y.map((N)=>({kind:"session",session:N})),...v.map((N)=>({kind:"subagent",subagent:N}))];if(O.length===0){if(!T)return null;return e("div",{"data-testid":"session-branch",className:"space-y-0.5",children:e("div",{className:"flex items-stretch",children:[e(Fe,{ancestors:S,isLast:!0,first:!0,style:x}),e("div",{className:`flex min-w-0 flex-1 items-center text-xs italic text-ink/40 ${x.inset} ${x.padding}`,children:"Loading subagents…"})]})})}return e("div",{"data-testid":"session-branch",className:"space-y-0.5",children:O.map((N,k)=>{let R=k===O.length-1;if(N.kind==="subagent")return e("div",{className:"flex items-stretch",children:[e(Fe,{ancestors:S,isLast:R,first:k===0,style:x}),e("div",{className:"min-w-0 flex-1",children:e(Mt,{subagent:N.subagent,sessionId:t,style:x,running:g===t&&N.subagent.status==="started"})})]},`subagent:${N.subagent.id}`);let P=String(N.session.id),L={expandable:(l.get(P)?.length??0)>0||Boolean(N.session.hasSubagents),isExpanded:c.has(P),onToggleExpand:()=>p(P),isChild:!0};return e(d,{children:[e("div",{className:"flex items-stretch",children:[e(Fe,{ancestors:S,isLast:R,first:k===0,style:x}),e("div",{className:"min-w-0 flex-1",children:h(N.session,L)})]}),L.isExpanded&&e(mo,{parentId:P,hasSubagents:Boolean(N.session.hasSubagents),childrenOf:l,expandedIds:c,onToggle:p,activeSessionId:g,renderSession:h,style:x,ancestors:[...S,R]})]},P)})})}function gs(t){let r=new Set(t.map((p)=>String(p.id))),l=new Map,c=[];for(let p of t){let g=p.parentSessionId;if(!g||!r.has(g)||g===String(p.id)){c.push(p);continue}let h=l.get(g);if(h)h.push(p);else l.set(g,[p])}return{roots:c,childrenOf:l}}function Wt(t,r){return t.includes(r)?t.filter((l)=>l!==r):[...t,r]}function Ht(t,r){let l=new Set(t),c=r.filter((p)=>l.has(p)).length;return{count:c,all:r.length>0&&c===r.length,some:c>0&&c<r.length}}function Le(t,r){return t.filter((l)=>r?l.is_archived===1:l.is_archived!==1).map((l)=>String(l.id))}function Gt(t,r){let l=new Set(r);return t.filter((c)=>l.has(c))}function jt(t,r,{activeSessionId:l,sessionStatus:c={}}){if(t.length<=r)return{rendered:t,hiddenCount:0};let p=[],g=0;for(let h=0;h<t.length;h+=1){let x=t[h],S=String(x.id),v=(l!==null?String(l)===S:x.is_active===1)||c[S]==="stream"||Boolean(x.awaitingInput);if(h<r||v)p.push(x);else g+=1}return{rendered:p,hiddenCount:g}}function Kt(t,r){return t.mode==="workspace"||t.mode==="session"&&t.scopeFolderId===r}function Zt(t,r){return t.mode==="session"&&t.scopeFolderId===r}function hs({batch:t,folder:r,sessions:l,showArchived:c,visibleCount:p,activeSessionId:g,sessionStatus:h}){let x=t?Kt(t,r.id):!1,S=t?Zt(t,r.id):!1,y=S?Le(l,c):x?[String(r.id)]:[],v=t&&x?t.summaryOf(y):null,T=jt(l,p,{activeSessionId:g,sessionStatus:h});return{folderCheckbox:x,sessionCheckboxes:S,folderSummary:v,selectableIds:y,toggleFolderSelection:()=>{if(!t)return;if(x&&!S){t.toggle(String(r.id));return}if(!S)return;if(v?.all)t.unselectAllOf(y);else t.selectAllOf(y)},rendered:S?l:T.rendered,hiddenCount:S?0:T.hiddenCount}}function bs({touch:t=!1,onRetry:r,refreshing:l=!1}){return e("div",{role:"alert",className:`flex flex-col items-center justify-center gap-2 px-4 text-center ${t?"py-10":"py-8"}`,children:[e("span",{className:"flex h-8 w-8 items-center justify-center rounded-md border border-ink/10 bg-ink/5 text-muted",children:e(D,{size:15,"aria-hidden":"true"})}),e("p",{className:"text-xs font-semibold text-ink",children:"The session list could not be loaded."}),e("p",{className:`text-muted leading-relaxed ${t?"text-xs":"text-[11px]"}`,children:"The live connection closed before the first reply arrived. Your sessions are still on disk; they are not shown here because this tab never received them."}),e("button",{type:"button",onClick:r,disabled:l,"aria-busy":l,className:`mt-1 inline-flex items-center gap-1.5 rounded-md border border-ink/20 bg-paper px-2.5 font-medium text-ink transition-colors hover:bg-ink/5 disabled:opacity-60 ${t?"h-11 text-sm":"h-7 text-xs"}`,children:[e(C,{size:13,className:l?"animate-spin":void 0,"aria-hidden":"true"}),"Try again"]})]})}function Yt({value:t,onChange:r,touch:l=!1}){return e("div",{className:l?"px-3 pt-3 pb-2":"px-3 pt-2 pb-2",children:e("div",{className:`flex items-center gap-1.5 rounded-lg border border-ink/10 bg-ink/[0.04] px-2 transition-colors focus-within:border-ink/30 focus-within:bg-paper ${l?"h-9":"h-7"}`,children:[e(F,{size:l?15:13,"aria-hidden":"true",className:"shrink-0 text-ink/35"}),e("input",{type:"search",value:t,onChange:(c)=>r(c.currentTarget.value),placeholder:"Search workspaces & sessions","aria-label":"Search workspaces and sessions",className:`min-w-0 flex-1 bg-transparent text-ink outline-none placeholder:text-ink/40 ${l?"text-[13px]":"text-xs"}`}),t.length>0&&e("button",{type:"button",onClick:()=>r(""),title:"Clear search","aria-label":"Clear search",className:"-mr-0.5 shrink-0 rounded p-0.5 text-ink/40 transition-colors cursor-pointer hover:bg-ink/10 hover:text-ink",children:e(b,{size:l?14:12})})]})})}var Ie={all:32,running:72,runningCount:14,archived:79,select:66};function wo(t,r){let l=[Ie.all,Ie.running+(t>0?Ie.runningCount:0),Ie.archived,...r?[Ie.select]:[]];return l.reduce((c,p)=>c+p,0)+(l.length-1)*4}function qt(t,r){if(!(t>0))return"button";return wo(r,!0)<=t?"chip":"button"}var _e="inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-[11px] font-medium transition-colors cursor-pointer",qe="border-ink bg-ink text-paper",Me="border-ink/15 text-ink/60 hover:border-ink/30 hover:text-ink",No=(t)=>t?"Cancel":"Select";function Vt({focus:t,onFocusChange:r,runningCount:l,showArchived:c,onToggleArchived:p,selecting:g,onToggleSelect:h}){let{ref:x,width:S}=ls(0),y=qt(S,l),v=g?e(b,{size:10}):e(_r,{size:10});return e("div",{className:"px-3 pb-2",children:e("div",{ref:x,className:"flex flex-nowrap items-center gap-1",children:[e("div",{className:"flex shrink-0 items-center gap-1",role:"group","aria-label":"Session filters",children:[e("button",{type:"button",onClick:()=>r("all"),"aria-pressed":t==="all",className:`${_e} ${t==="all"?qe:Me}`,children:"All"}),e("button",{type:"button",onClick:()=>r("running"),"aria-pressed":t==="running",title:l>0?`${l} running or waiting`:"Nothing running",className:`${_e} ${t==="running"?qe:Me}`,children:[e("span",{"aria-hidden":"true",className:`h-1.5 w-1.5 rounded-full ${l>0?"bg-current":"bg-current opacity-30"}`}),"Running",l>0&&e("span",{className:"font-mono tabular-nums opacity-70",children:l})]}),e("button",{type:"button",onClick:p,"aria-pressed":c,title:c?"Hide archived sessions":"Show archived sessions",className:`${_e} ${c?"border-warning/40 bg-warning/10 text-warning hover:bg-warning/15":Me}`,children:[e(Xe,{size:10}),"Archived"]})]}),y==="chip"?e("button",{type:"button",onClick:h,"aria-pressed":g,title:g?"Cancel selection":"Select workspaces",className:`${_e} ml-auto ${g?qe:Me}`,children:[v,No(g)]}):e("button",{type:"button",onClick:h,title:g?"Cancel selection":"Select workspaces","aria-label":g?"Cancel selection":"Select workspaces","aria-pressed":g,className:`ml-auto inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md transition-colors cursor-pointer ${g?"bg-ink/10 text-ink":"text-ink/55 hover:bg-ink/[0.06] hover:text-ink"}`,children:g?e(b,{size:14}):e(_r,{size:14})})]})})}var To="shrink-0 inline-flex items-center justify-center rounded-md text-ink/55 transition-colors cursor-pointer hover:bg-ink/[0.06] hover:text-ink",Co="bg-ink/10 text-ink",Jt={"A-Z":"A–Z","Z-A":"Z–A",LATEST_SESSION:"Latest chat",LATEST_ADDED:"Latest added"};function Qt({onNewSession:t,onNewWorkspace:r,onScheduler:l,scheduledCount:c,onRefresh:p,refreshing:g,sortOption:h,optionsOpen:x,onToggleOptions:S,onCloseOptions:y,onSortChange:v,touch:T=!1}){let O=`${To} ${T?rn.mobile:rn.desktop}`,N=c>0?`Scheduled tasks (${c} armed)`:"Scheduled tasks";return e("div",{className:`flex items-center ${Ws} px-3 pb-2`,children:[e("button",{type:"button",onClick:t,title:"New Session","aria-label":"New Session",className:`flex min-w-0 flex-1 items-center justify-center gap-1.5 rounded-md bg-ink px-2 font-semibold text-canvas transition-colors cursor-pointer hover:bg-ink/90 ${T?"h-9 text-[13px]":"h-7 text-xs"}`,children:[e(Y,{size:T?16:14,className:"shrink-0"}),e("span",{className:"truncate",children:"New Session"})]}),e("div",{className:`flex shrink-0 items-center ${mc}`,children:[e("button",{type:"button",onClick:r,title:"New Workspace","aria-label":"New Workspace",className:O,children:e(Xt,{size:T?16:14})}),e("button",{type:"button",onClick:l,title:N,"aria-label":c>0?`Scheduled tasks, ${c} armed`:"Scheduled tasks",className:`relative ${O}`,children:[e(Ia,{size:T?16:14}),c>0&&e("span",{className:"absolute right-0.5 top-0.5 min-w-[10px] rounded-full bg-ink px-[2px] text-center text-[7px] font-semibold leading-[10px] text-canvas",children:c>9?"9+":c})]}),e("button",{type:"button",onClick:p,title:"Refresh sessions","aria-label":"Refresh sessions","aria-busy":g,className:O,children:e(C,{size:T?16:14,className:g?"animate-spin":""})}),e("div",{className:"relative",children:[e("button",{type:"button",onClick:S,title:`Sort: ${Jt[h]}`,"aria-label":`Sort workspaces, currently ${Jt[h]}`,"aria-haspopup":"menu","aria-expanded":x,className:`${O} ${x||h!=="A-Z"?Co:""}`,children:e(ss,{size:T?16:14})}),x&&e("div",{className:"glass-popover absolute right-0 top-full z-50 mt-1 w-48 rounded-lg border border-ink/15 bg-paper py-1 shadow-lg",onMouseLeave:y,children:e(Mi,{variant:"desktop",sortOption:h,onSortChange:v})})]})]})]})}function en({title:t,status:r,awaitingInput:l=!1,renaming:c=!1,waitingFor:p,expandable:g=!1,isExpanded:h=!1,onToggleExpand:x,child:S=!1,selectable:y=!1,selected:v=!1,onToggleSelect:T,touch:O=!1}){if(y)return e("span",{className:"flex shrink-0 items-center",children:[e(Sr,{checked:v,label:`Select ${t}`,onChange:()=>T?.()}),e("span",{className:"w-2 shrink-0"})]});let N=O?14:13,k=Boolean(p),R=l||r==="stream"||k,P=Boolean(g&&x)&&!R&&!c,E=Boolean(c||l||k||r)&&!P;return e(d,{children:[e("span",{className:`relative shrink-0 ${O?"w-[18px] h-5":"w-4 h-4"}`,children:[g&&x&&e("button",{type:"button",onClick:(L)=>{L.stopPropagation(),x(L)},title:h?"Collapse sessions and subagents":"Expand sessions and subagents","aria-expanded":h,"aria-label":h?"Collapse sessions and subagents":"Expand sessions and subagents",className:`peer absolute inset-0 flex items-center justify-center rounded cursor-pointer transition-opacity ${P?"text-ink/55 hover:text-ink":"text-ink/40 opacity-0 hover:text-ink group-hover/item:opacity-100 focus-visible:opacity-100"}`,children:h?e(B,{size:N}):e(ie,{size:N})}),E&&e("span",{className:`pointer-events-none absolute inset-0 flex items-center justify-center text-ink/60 transition-opacity ${g?"group-hover/item:opacity-0 peer-focus-visible:opacity-0":""}`,children:c?e("span",{role:"status","aria-label":"Generating a name…",children:e(m,{size:N-1,className:"animate-spin"})}):l?e(De,{size:N-1,className:"animate-pulse text-warning"}):k?e("span",{role:"status","aria-label":`Waiting for ${p?.title??"another session"}`,children:e(Ue,{size:N-1,className:"animate-pulse"})}):r==="stream"?e("span",{role:"status","aria-label":"Running",children:e(m,{size:N-1,className:"animate-spin"})}):e(f,{size:N-1})}),S&&!(g&&x)&&!E&&e("span",{"data-testid":"child-indicator","aria-hidden":"true",className:"pointer-events-none absolute inset-0 flex items-center justify-center text-ink/35",children:e(fe,{size:N-1,"aria-hidden":"true"})})]}),e("span",{className:"w-2 shrink-0"})]})}function tn({timeAgo:t,timeTitle:r,runStartedAt:l,onOpenMenu:c,menuOpen:p=!1,touch:g=!1}){let h=(S)=>e(ms,{timeAgo:t,timeTitle:r,runStartedAt:l,className:S});if(!c)return h("ml-2 shrink-0 font-mono text-[10px] text-ink/40");let x=e("button",{type:"button",onClick:c,title:"Session actions","aria-label":"Session actions","aria-haspopup":"menu","aria-expanded":p,className:`shrink-0 rounded text-ink/40 hover:bg-ink/10 hover:text-ink cursor-pointer ${g?"p-1.5":"p-1"} ${g?"":"opacity-0 transition-opacity group-hover/item:opacity-100 group-focus-within/item:opacity-100 focus-visible:opacity-100"}`,children:e(Be,{size:g?16:14})});if(g)return e("span",{className:"ml-1 flex shrink-0 items-center gap-0.5",children:[h("font-mono text-[10px] text-ink/40"),x]});return e("span",{className:"relative ml-2 flex h-4 min-w-8 shrink-0 items-center justify-end pr-1",children:[h("whitespace-nowrap font-mono text-[10px] leading-none text-ink/40 transition-opacity group-hover/item:opacity-0 group-focus-within/item:opacity-0"),e("span",{className:"absolute right-0 -my-1 flex",children:x})]})}function nn(t){return{inset:"pl-1 pr-1",insetPx:4,slotWidth:t?18:16,markGap:8,padding:t?"py-0.5":"py-[7px]",glyph:t?Bt.touch:Bt.compact}}function on({sessionId:t,title:r,harness:l,isActive:c=!1,isArchived:p=!1,status:g,awaitingInput:h=!1,timeAgo:x,timeTitle:S,runStartedAt:y,worktree:v,waitingFor:T,expandable:O=!1,isExpanded:N=!1,onToggleExpand:k,isChild:R=!1,folderId:P,onClick:E,onRename:L,onRenameWithAi:A,onArchive:W,onDelete:q,onCancelWait:ee,selectable:U=!1,selected:te=!1,onToggleSelect:oe,density:Z="compact"}){let z=Z==="touch",K=Ea(t),_=Si(),{isEditing:ue,draft:ae,setDraft:xe,inputRef:me,startRename:re,handleKeyDown:Q,handleBlur:Ne}=_i(r,L),ke=Boolean(L||W||q||ee),Se=Boolean(T),he=r.charAt(0).toUpperCase()+r.slice(1);if(ue)return e("div",{className:`flex w-full items-center rounded-lg bg-ink/10 ${z?"px-2 py-1.5":"px-2 py-1"}`,children:e("input",{ref:me,autoFocus:!0,value:ae,onChange:(se)=>xe(se.currentTarget.value),onClick:(se)=>se.stopPropagation(),onKeyDown:Q,onBlur:Ne,"aria-label":"Session name",className:"min-w-0 flex-1 rounded border border-ink/25 bg-paper px-2 py-0.5 text-xs text-ink outline-none focus:border-ink/50"})});return e(d,{children:[e("div",{"data-testid":"session-item","data-session-id":String(t),"data-selected":U&&te?"true":void 0,onClick:U?oe:E,onContextMenu:ke&&!U?_.openAtCursor:void 0,className:`group/item relative flex w-full items-center rounded-lg text-xs transition-colors select-none cursor-pointer ${z?"py-0.5 pl-1 pr-1":"py-[7px] pl-1 pr-1"} ${U&&te?"bg-ink/10 text-ink ring-1 ring-inset ring-ink/20":c?"bg-ink/[0.08] font-medium text-ink":"text-ink/75 hover:bg-ink/[0.04] hover:text-ink"}`,children:[c&&!U&&e("span",{"aria-hidden":"true",className:"absolute left-0 top-1.5 bottom-1.5 w-[2px] rounded-full bg-ink"}),e(en,{title:r,status:g,awaitingInput:h,renaming:K,waitingFor:T,expandable:O,isExpanded:N,onToggleExpand:k,child:R,selectable:U,selected:te,onToggleSelect:oe,touch:z}),l&&e("span",{className:"mr-1.5 flex shrink-0 items-center",children:e(gt,{harness:l,size:z?Bt.touch:Bt.compact})}),e("span",{className:`flex min-w-0 flex-1 flex-col leading-snug ${p?"text-ink/45":""}`,children:[e("span",{className:"min-w-0 truncate",children:he}),Se&&e("span",{className:"truncate text-[10px] font-normal text-ink/40",children:["waiting for ",T?.title??"another session"]}),v&&e(ds,{worktree:v})]}),e(tn,{timeAgo:x,timeTitle:S,runStartedAt:y,touch:z,menuOpen:_.anchor!==null,onOpenMenu:ke&&!U?_.openBelow:void 0})]}),_.anchor&&e(Ti,{anchor:_.anchor,sessionId:t,...l?{harness:l}:{},...P!==void 0?{folderId:P}:{},isArchived:p,onRename:L?re:void 0,onRenameWithAi:A,onArchive:W,onDelete:q,onCancelWait:ee,onClose:_.close})]})}function Oo(t){let r=t.parentElement;while(r){let l=getComputedStyle(r);if(/(auto|scroll|overlay)/.test(l.overflowY))return r;r=r.parentElement}return null}function sn(t){let[r,l]=n(!1);return i(()=>{let c=t.current;if(!c)return;let p=Oo(c),g=!1,h=()=>{g=!1;let y=p?p.getBoundingClientRect():{top:0},v=p?p.scrollTop>0:window.scrollY>0,T=c.getBoundingClientRect();l(v&&T.top<=y.top+0.5&&T.bottom>y.top)},x=()=>{if(g)return;g=!0,requestAnimationFrame(h)};h();let S=typeof ResizeObserver>"u"?null:new ResizeObserver(x);if(S?.observe(c),p)S?.observe(p);return(p??window).addEventListener("scroll",x,{passive:!0}),window.addEventListener("resize",x),()=>{g=!1,S?.disconnect(),(p??window).removeEventListener("scroll",x),window.removeEventListener("resize",x)}},[t]),r}function an({folder:t,isOpen:r,onToggleFolder:l,sessionCount:c,checkbox:p,batchActive:g,showMenu:h,onToggleMenu:x,onCloseMenu:S,onNewSession:y,menu:v,touch:T=!1}){let O=Yr(t.icon),N=t.accentColor||void 0,k=o(null),[R,P]=n(null),E=o(null),L=sn(E);return e("div",{ref:E,"data-stuck":L?"":void 0,className:`group/ws sticky top-0 z-10 -mx-1 flex items-center gap-1 rounded-md px-1 text-xs font-semibold text-ink ${T?"h-8 bg-canvas glass-sticky":"h-[26px] bg-paper glass-sticky"}`,children:[e("button",{type:"button",onClick:g?void 0:l,"aria-expanded":r,"aria-label":`${t.name}${r?", collapse":", expand"}`,className:"flex h-full min-w-0 flex-1 items-center gap-2 rounded-md px-1 text-left cursor-pointer hover:bg-ink/[0.04]",children:[p?e(Sr,{size:"md",checked:p.checked,indeterminate:p.indeterminate,label:p.label,onChange:p.onChange}):e("span",{className:`relative flex shrink-0 items-center justify-center ${T?"h-[18px] w-[18px]":"h-4 w-4"}`,children:t.customIconUrl?e("img",{src:t.customIconUrl,alt:"",className:"h-[15px] w-[15px] shrink-0 rounded-xs object-contain",referrerPolicy:"no-referrer"}):e(O,{size:15,className:"project-accent-mark text-ink/70",style:js(N)})}),e("span",{className:"glass-sticky-label truncate text-[13px] font-semibold tracking-tight",children:t.name}),t.isPinned&&e(_a,{size:10,className:"shrink-0 text-ink/45"}),N&&!p&&e("span",{"aria-hidden":"true",className:"h-1.5 w-1.5 shrink-0 rounded-full",style:{backgroundColor:N}}),e("span",{className:"glass-sticky-label shrink-0 font-mono text-[10px] font-normal tabular-nums text-ink/35",children:c}),e("span",{className:"ml-auto shrink-0 text-ink/40",children:r?e(B,{size:T?14:12}):e(ie,{size:T?14:12})})]}),!g&&e("div",{className:"flex shrink-0 items-center gap-0.5 pr-1",children:[e("button",{type:"button",title:"New Session","aria-label":`New session in ${t.name}`,onClick:(A)=>{A.stopPropagation(),y()},className:`flex items-center justify-center rounded text-ink/40 transition-colors cursor-pointer hover:bg-ink/10 hover:text-ink ${T?"h-7 w-7":"h-[22px] w-[22px]"}`,children:e(Y,{size:T?15:12})}),e("div",{className:"relative flex items-center",children:[e("button",{ref:k,type:"button",title:`Options for ${t.name}`,"aria-label":`Options for ${t.name}`,"aria-haspopup":"menu","aria-expanded":h,onClick:(A)=>{if(A.stopPropagation(),k.current)P(zt(k.current));x()},className:`flex items-center justify-center rounded text-ink/40 transition-colors cursor-pointer hover:bg-ink/10 hover:text-ink ${T?"h-7 w-7":"h-[22px] w-[22px]"}`,children:e(Be,{size:T?15:12})}),e(Ut,{anchor:h&&v?R:null,align:"end",ariaLabel:`Options for ${t.name}`,className:"glass-popover w-44 rounded-md border border-ink/15 bg-paper py-1 text-xs shadow-lg",onClose:S,children:v})]})]})]})}function ln({hiddenCount:t,canShowLess:r,onShowMore:l,onShowLess:c}){if(t<=0&&!r)return null;return e("div",{className:"flex items-center gap-1 pl-6",children:[t>0&&e("button",{type:"button",onClick:l,className:"min-w-0 truncate rounded-md px-1 py-1 text-[11px] text-ink/45 transition-colors cursor-pointer hover:bg-ink/[0.04] hover:text-ink/80",children:[e(B,{size:11,className:"mr-1 inline align-[-2px]"}),t," more"]}),r&&e("button",{type:"button",onClick:c,className:"ml-auto shrink-0 rounded-md px-1 py-1 text-[11px] text-ink/45 transition-colors cursor-pointer hover:bg-ink/[0.04] hover:text-ink/80",children:[e(et,{size:11,className:"mr-1 inline align-[-2px]"}),"Less"]})]})}function cn({folder:t,activeSessionId:r,sessionStatus:l,showArchived:c,forceExpanded:p=!1,density:g="compact",batch:h,onSelectSession:x,onNewSessionForFolder:S,onNewWorktreeSession:y,onToast:v,onStartSessionSelection:T,onCancelWait:O}){let[N,k]=n(t.isExpanded||!1),[R,P]=n(!1),[E,L]=n(!1),{visibleCount:A,showMore:W,showLess:q,canShowLess:ee}=cs(),[U]=le(),te=U.get("subagent"),oe=U.get("sessionId"),{expandedSessionIds:Z,toggleSession:z}=es(),{refresh:K,runStartedAtMap:_}=je(),ue=it(),{confirmDelete:ae,requestDelete:xe,cancelDelete:me,handlePin:re,handleDelete:Q,handleArchive:Ne,handleRename:ke,handleRenameWithAi:Se,handleOpenFolder:he}=us(t,K,v),se=Bi();i(()=>{if(typeof t.isExpanded==="boolean")k(t.isExpanded)},[t.isExpanded]);let We=()=>{P(!1),me()},Re=()=>{let H=!N;if(k(H),typeof t.id!=="number")return;ue.submit({isExpanded:String(H)},{method:"POST",action:`/api/folders/${t.id}/toggle`})},Ce=t.sessions.filter((H)=>c?H.is_archived===1:H.is_archived!==1),{folderCheckbox:ze,sessionCheckboxes:G,folderSummary:X,toggleFolderSelection:j,rendered:pe,hiddenCount:ve}=hs({batch:h,folder:t,sessions:Ce,showArchived:c,visibleCount:A,activeSessionId:r,sessionStatus:l}),ye=gs(pe),Ve=p||N||G,Je=(H,Te)=>{let de=String(H.id),ot=r===null?H.is_active===1:String(r)===de,Mn=ot&&oe===de&&Boolean(te),He=bt(de);return e(on,{sessionId:H.id,title:H.title,harness:H.harness,folderId:H.folder_id,density:g,isActive:ot&&!Mn,isArchived:H.is_archived===1,status:l[de],awaitingInput:Boolean(H.awaitingInput),timeAgo:ps(H.updated_at??H.created_at),timeTitle:Pi(H.updated_at??H.created_at),runStartedAt:l[de]==="stream"?_[de]:void 0,worktree:H.worktree,waitingFor:H.waitingFor?{title:H.waitingFor.title}:void 0,expandable:Te.expandable,isChild:Te.isChild,isExpanded:Te.isExpanded,onToggleExpand:Te.onToggleExpand,onClick:()=>x(H.id),onArchive:()=>Ne(H),onDelete:He?void 0:()=>se.requestDelete(H),onRename:He?void 0:($n)=>void ke(H,$n),onRenameWithAi:He?void 0:()=>void Se(H),onCancelWait:H.waitingFor?()=>O?.(H.waitingFor.waitId):void 0,selectable:G,selected:Boolean(h?.selected.includes(de)),onToggleSelect:h?()=>h.toggle(de):void 0})},_n=(H)=>As(H,ye.childrenOf,Z,z),Qe=Boolean(y&&t.project_path);return e("div",{className:"space-y-0.5",children:[e(an,{folder:t,isOpen:Ve,onToggleFolder:Re,sessionCount:Ce.length,checkbox:ze&&X?{checked:X.all,indeterminate:X.some,label:`Select ${t.name}`,onChange:j}:null,batchActive:Boolean(h),showMenu:R,onToggleMenu:()=>P((H)=>!H),onCloseMenu:We,onNewSession:()=>S(t.id),touch:g==="touch",menu:e(fs,{variant:"desktop",isPinned:t.isPinned,onOpenFolder:he?()=>{he(),P(!1)}:void 0,onSelectSessions:T?()=>{P(!1),T(t.id)}:void 0,onNewWorktree:Qe?()=>{P(!1),L(!0)}:void 0,confirmDelete:ae,onPin:()=>{re(),P(!1)},onDelete:()=>{Q(),P(!1)},onRequestDelete:xe,onCancelDelete:me})}),Ve&&e("div",{className:"space-y-0.5",children:[ye.roots.map((H)=>{let Te=String(H.id),de=_n(H);return e("div",{className:"space-y-0.5",children:[Je(H,de),de.isExpanded&&e(mo,{parentId:Te,hasSubagents:Boolean(H.hasSubagents),childrenOf:ye.childrenOf,expandedIds:Z,onToggle:z,activeSessionId:r===null?null:String(r),renderSession:Je,style:nn(g==="touch")})]},H.id)}),!p&&!G&&e(ln,{hiddenCount:ve,canShowLess:ee,onShowMore:W,onShowLess:q}),Ce.length===0&&e("div",{className:"px-1 py-1 pl-6 text-[11px] italic text-ink/40",children:c?"No archived sessions.":"No sessions."})]}),e(Ii,{session:se.pending,isDeleting:se.isDeleting,error:se.error,onClose:se.cancelDelete,onConfirm:()=>void se.confirmDelete()}),Qe&&e(Di,{isOpen:E,onClose:()=>L(!1),root:t.project_path??null,folderId:t.id,folderName:t.name,onCreated:(H)=>{L(!1),y?.(t.id,H.path)}})]})}var Io=[3,2];function dn({touch:t=!1}){return e("div",{className:"space-y-3","aria-hidden":"true",children:Io.map((r,l)=>e("div",{className:"space-y-0.5",children:[e("div",{className:`flex items-center gap-2 px-1 ${t?"h-8":"h-[26px]"}`,children:[e("span",{className:`animate-pulse rounded-sm bg-ink/10 ${t?"h-[18px] w-[18px]":"h-4 w-4"}`}),e("span",{className:"h-3 w-24 animate-pulse rounded bg-ink/10"})]}),Array.from({length:r},(c,p)=>e("div",{className:`flex items-center gap-2 pl-1 pr-2 ${t?"h-8":"h-[31px]"}`,children:[e("span",{className:`shrink-0 animate-pulse rounded-full bg-ink/10 ${t?"h-[18px] w-[18px]":"h-4 w-4"}`}),e("span",{className:"h-3 animate-pulse rounded bg-ink/10",style:{width:`${58-p%3*12}%`}})]},p))]},l))})}function pn(t,r){if(t.awaitingInput)return!0;if(t.waitingFor)return!0;return r==="stream"}function mn(t,{focus:r,statusOf:l}){if(r==="all")return t;return t.map((c)=>({...c,sessions:c.sessions.filter((p)=>pn(p,l(String(p.id))))})).filter((c)=>c.sessions.length>0)}function fn(t,r){let l=0;for(let c of t)for(let p of c.sessions)if(pn(p,r(String(p.id))))l+=1;return l}function Yc({className:t="",folders:r,initializing:l,failed:c,activeSessionId:p,sessionStatus:g,searchQuery:h,onSearchChange:x,showArchived:S,onToggleArchived:y,sortOption:v,optionsOpen:T,onToggleOptions:O,onCloseOptions:N,onSortChange:k,onRefresh:R,refreshing:P,scheduledCount:E,onNewSession:L,onNewWorkspace:A,onScheduler:W,onSelectSession:q,onNewSessionForFolder:ee,onNewWorktreeSession:U,onToast:te,onCancelWait:oe,batch:Z,onSelectWorkspaces:z,onStartSessionSelection:K,touch:_=!1}){let[ue,ae]=n("all"),xe=u(()=>fn(r,(Q)=>g[Q]),[r,g]),me=u(()=>mn(r,{focus:ue,statusOf:(Q)=>g[Q]}),[r,ue,g]),re=Boolean(Z);return e("div",{className:`flex flex-col ${t}`,children:[e(Yt,{value:h,onChange:x,touch:_}),e(Vt,{focus:ue,onFocusChange:ae,runningCount:xe,showArchived:S,onToggleArchived:y,selecting:re,onToggleSelect:z}),e(Qt,{onNewSession:L,onNewWorkspace:A,onScheduler:W,scheduledCount:E,onRefresh:R,refreshing:P,sortOption:v,optionsOpen:T,onToggleOptions:O,onCloseOptions:N,onSortChange:k,touch:_}),e("div",{className:"mt-1 flex-1 scrollbar-overlay-container px-2 pb-3",children:c?e(bs,{touch:_,onRetry:R,refreshing:P}):l?e(dn,{touch:_}):me.length===0?e("div",{className:"px-1 py-8 text-center text-[11px] leading-relaxed text-muted",children:ue==="running"?"Nothing is running right now.":h?"No workspace or chat matches that search.":"No workspaces yet."}):e("div",{className:"space-y-3",children:me.map((Q)=>e(cn,{folder:Q,activeSessionId:p,sessionStatus:g,showArchived:S,forceExpanded:Boolean(h),density:_?"touch":"compact",batch:Z,onSelectSession:q,onNewSessionForFolder:ee,onNewWorktreeSession:U,onToast:te,onStartSessionSelection:K,onCancelWait:oe},Q.id))})})]})}function Ro(t){if(!t)return Number.NaN;let r=Date.parse(t);return Number.isFinite(r)?r:Number.NaN}function hn(t){let r=Number.NEGATIVE_INFINITY;for(let l of t.sessions??[]){let c=Ro(l.updated_at??l.created_at);if(c>r)r=c}return r}function bn(t){let r=Number.NEGATIVE_INFINITY;for(let l of t.sessions??[]){let c=Number(l.id);if(Number.isFinite(c)&&c>r)r=c}return r}function be(t){let r=Number(t.id);return Number.isFinite(r)?r:Number.NEGATIVE_INFINITY}function $e(t,r){if(t===r)return 0;return t>r?-1:1}function gn(t,r){if(t===r)return 0;return t>r?1:-1}function Po(t,r,l){let c=Boolean(t.isPinned),p=Boolean(r.isPinned);if(c!==p)return c?-1:1;switch(l){case"Z-A":{let g=r.name.localeCompare(t.name);return g!==0?g:gn(be(t),be(r))}case"LATEST_SESSION":{let g=$e(hn(t),hn(r));if(g!==0)return g;let h=$e(bn(t),bn(r));if(h!==0)return h;let x=$e(be(t),be(r));return x!==0?x:t.name.localeCompare(r.name)}case"LATEST_ADDED":{let g=$e(be(t),be(r));return g!==0?g:t.name.localeCompare(r.name)}case"A-Z":default:{let g=t.name.localeCompare(r.name);return g!==0?g:gn(be(t),be(r))}}}function xn(t,r){return[...t].sort((l,c)=>Po(l,c,r))}var Ao=["A-Z","Z-A","LATEST_SESSION","LATEST_ADDED"],kn="LATEST_SESSION";function vn(t){return typeof t==="string"&&Ao.includes(t)}function yn(t,r,l){if(r.length===0||t.length===0)return t;let c=new Set;for(let h of t)for(let x of h.sessions??[])c.add(String(x.id));let p=r.filter((h)=>!c.has(String(h.id)));if(p.length===0)return t;let g=t;for(let h of p){let x=Nn(g,h,l);if(!x)continue;let S=new Date(h.createdAt).toISOString(),y={id:h.id,folder_id:x.id,title:h.title??l.titleFor?.(String(h.id))??om(h.id),created_at:S,updated_at:S,...h.parentSessionId?{parentSessionId:h.parentSessionId}:{},...h.harness?{harness:h.harness}:{},...h.waiting?{waitingFor:{waitId:h.waiting.waitId,sessionId:h.waiting.dependsOn,title:h.waiting.dependsOnTitle}}:{}};g=g.map((v)=>v.id===x.id?{...v,isExpanded:!0,sessions:[y,...v.sessions??[]]}:v)}return g}function wn(t,r,l){if(r.length===0||t.length===0)return[];let c=new Set;for(let p of r){let g=Nn(t,p,l);if(g)c.add(String(g.id))}return[...c]}function Nn(t,r,l){if(r.folderId!==null&&r.folderId!==void 0){let c=t.find((p)=>String(p.id)===String(r.folderId));if(c)return c}if(l.activeId){let c=t.find((p)=>(p.sessions??[]).some((g)=>String(g.id)===String(l.activeId)));if(c)return c}if(l.urlFolderId){let c=t.find((p)=>String(p.id)===String(l.urlFolderId));if(c)return c}return t[0]}async function pd(t,r){try{return(await fetch(`/api/folders/${encodeURIComponent(String(t))}/toggle`,{method:"POST",body:new URLSearchParams({isExpanded:String(r)})})).ok}catch(l){return console.error("Failed to save workspace expansion:",l),!1}}function Tn(t,r){return t.find((l)=>(l.sessions??[]).some((c)=>String(c.id)===r))}function Cn(t){let{folders:r,initializing:l,runningIds:c,pendingEntries:p,activeId:g,urlFolderId:h}=t,x=u(()=>{let y=new Set;for(let v of c){let T=Tn(r,v);if(T)y.add(String(T.id))}return y},[r,c]),S=o({running:new Set,pending:new Set});return i(()=>{if(l||r.length===0)return;let y=S.current,v=new Set,T=new Set,O=new Set;for(let k of c){if(y.running.has(k)){v.add(k);continue}let R=Tn(r,k);if(!R)continue;v.add(k),O.add(String(R.id))}let N={activeId:g,urlFolderId:h};for(let k of p){let R=String(k.id);if(y.pending.has(R)){T.add(R);continue}T.add(R);for(let P of wn(r,[k],N))O.add(P)}y.running=v,y.pending=T;for(let k of O){let R=r.find((P)=>String(P.id)===k);if(!R||R.isExpanded)continue;pd(k,!0)}},[l,r,c,p,g,h]),x}var Do=200;function Jc(t={},r={}){let{expandSearchMatches:l=!1,onSelectSession:c,onAfterSelect:p}=r,{folders:g,initializing:h,failed:x,refresh:S,refreshNow:y,refreshing:v,isRefreshing:T,markSeen:O,hasSeen:N,streamStatusMap:k,titleHint:R}=je(),[P,E]=le(),L=P.get("sessionId"),A=P.get("folderId"),W=L?Number.isNaN(Number(L))?L:Number(L):null,q=o(S);q.current=S;let ee=a(()=>q.current(),[]),[U,te]=n(""),[oe,Z]=n(!1),[z,K]=n(!1),[_,ue]=n(()=>vn(t.omp_sidebar_sort)?t.omp_sidebar_sort:kn),ae=o(null),xe=a((G)=>{if(ae.current)clearTimeout(ae.current);ae.current=setTimeout(()=>{At("omp_sidebar_sort",G)},Do)},[]);i(()=>()=>{if(ae.current)clearTimeout(ae.current)},[]);let me=(G)=>{ue(G),K(!1),xe(G)},re=k;Dg(re,W,ee,N);let Q=sm(),{prompts:Ne,loaded:ke}=fc(),Se=u(()=>new Set(Object.entries(re).filter(([,G])=>G==="stream").map(([G])=>G)),[re]),he=Cn({folders:g,initializing:h,runningIds:Se,pendingEntries:Q,activeId:L,urlFolderId:A});i(()=>{if(!L||h)return;if(g.some((G)=>(G.sessions??[]).some((X)=>String(X.id)===L)))return;Qg(L,A,re[L]==="stream")},[L,g,h,A,re]),i(()=>{if(h||!ke)return;for(let G of Q){let X=String(G.id),j=Ne.find((pe)=>pe.pendingId===X&&pe.status==="waiting");if(!j||G.waiting?.waitId===j.id)continue;Am(X,{waitId:j.id,dependsOn:j.dependsOn,dependsOnTitle:j.dependsOnTitle})}},[Q,Ne,ke,h]);let[se,We]=n(0),Re=Q.map((G)=>String(G.id)).join(`
|
|
2
|
-
`);i(()=>{let G=()=>We((j)=>j+1),X=Re.split(`
|
|
3
|
-
`).filter(Boolean).flatMap((j)=>[Or(j,Zo,G),Or(j,Xo,G)]);return()=>{for(let j of X)j()}},[Re]),i(()=>{if(h)return;let G=new Set;for(let X of g)for(let j of X.sessions??[])G.add(String(j.id));Ng({listed:G,running:Se,activeId:L})},[g,h,Se,L,se]);let Ce=(G)=>{if(O(G),c)c(G);else E((X)=>{let j=Et(X);if(j.set("sessionId",G.toString()),j.has("subagent"))j.delete("subagent");return j},{replace:!0});p?.()},ze=u(()=>{let G=yn(g,Q,{activeId:L,urlFolderId:A,titleFor:R});if(U.trim()){let X=U.toLowerCase();if(l)G=G.filter((j)=>{let pe=j.name.toLowerCase().includes(X),ve=j.sessions?.some((ye)=>ye.title.toLowerCase().includes(X));return pe||ve}).map((j)=>{let pe=j.sessions?.filter((ve)=>j.name.toLowerCase().includes(X)||ve.title.toLowerCase().includes(X));return{...j,sessions:pe,isExpanded:!0}});else G=G.map((j)=>{let pe=j.name.toLowerCase().includes(X),ve=(j.sessions||[]).filter((ye)=>ye.title.toLowerCase().includes(X));if(pe)return j;return{...j,sessions:ve}}).filter((j)=>j.sessions&&j.sessions.length>0)}if(he.size>0)G=G.map((X)=>he.has(String(X.id))?{...X,isExpanded:!0}:X);return G=xn(G,_),G},[g,Q,U,_,L,A,l,R,he]);return{folders:g,initializing:h,failed:x,refresh:ee,refreshNow:y,refreshing:v,isRefreshing:T,activeSessionId:W,sessionParam:L,searchQuery:U,setSearchQuery:te,showArchived:oe,setShowArchived:Z,optionsOpen:z,setOptionsOpen:K,sortOption:_,handleSortChange:me,processedFolders:ze,sessionStatus:re,handleSelectSession:Ce}}function Zc({onNotice:t}={}){let{prompts:r}=fc(),[,l]=le(),c=o(t);c.current=t;let p=o(new Set);i(()=>{let g=new URLSearchParams(window.location.search).get("sessionId");for(let h of r){let{pendingId:x,targetSessionId:S}=h,y=x?Mg(x):null,v=Boolean(x)&&(Boolean(y)||g===x),T=Boolean(S)&&g===S;if(!x&&!S)continue;let O=`${h.id}:${h.status}`;if(p.current.has(O))continue;if(h.status==="dispatched"&&h.sessionId){if(p.current.add(O),x&&v)pc(x,h.sessionId,h.folderId),l((N)=>{if(N.get("sessionId")!==x)return N;let k=Et(N);return k.set("sessionId",h.sessionId),k},{replace:!0}),c.current?.("Waiting finished — your prompt is now running in a new session.","success");else if(S&&T)c.current?.("Waiting finished — your prompt is now running in this chat.","success");continue}if(h.status==="error"){if(p.current.add(O),!v&&!T)continue;if(zu(h),x)$u(x);c.current?.(`The prompt you held was not sent: ${h.error??"the dispatch failed."} Your draft is back in the composer.`,"error");continue}if(h.status==="cancelled"){if(p.current.add(O),!v&&!T)continue;if(zu(h),x)$u(x)}}},[r,l])}async function Xc(t){let r=await fetch("/api/folders",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),l=await r.json().catch(()=>({}));if(!r.ok||!l.success)throw Error(l.error||`HTTP ${r.status}`);window.location.reload()}async function eu(t){let r=await fetch("/api/folders/clone",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),l=await r.json().catch(()=>({}));if(!r.ok||!l.success)throw Error(l.error||`HTTP ${r.status}`);window.location.reload()}function On(){let[t,r]=n(null),[l,c]=n(null),[p,g]=n([]),h=a((O,N)=>{r(O),c(O==="session"?N??null:null),g([])},[]),x=a(()=>{r(null),c(null),g([])},[]),S=a((O)=>{g((N)=>Wt(N,O))},[]),y=a((O)=>{g((N)=>[...new Set([...N,...O])])},[]),v=a((O)=>{g((N)=>{let k=new Set(O);return N.filter((R)=>!k.has(R))})},[]),T=a((O)=>Ht(p,O),[p]);return u(()=>({mode:t,scopeFolderId:l,selected:p,begin:h,end:x,toggle:S,selectAllOf:y,unselectAllOf:v,summaryOf:T}),[t,l,p,h,x,S,y,v,T])}var In={removed:[],refused:[]};async function Rn(t,r){try{let l=await fetch(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({ids:r})}),c=await l.json().catch(()=>null);if(!l.ok)return{...In,error:c?.error||`Could not delete (HTTP ${l.status}).`};return{removed:Array.isArray(c?.removed)?c.removed:[],refused:Array.isArray(c?.refused)?c.refused:[]}}catch(l){return{...In,error:l instanceof Error?l.message:"Could not reach the server."}}}function Pn(t){return Rn("/api/sessions/batch-delete",t)}function An(t){return Rn("/api/folders/batch-delete",t)}function En(t){let[r,l]=n([]),[c,p]=n(!1),[g,h]=n(null),[x,S]=le(),y=a((O)=>{h(null),l([...O])},[]),v=a(()=>{h(null),l([])},[]),T=a(async(O)=>{if(r.length===0||c)return null;p(!0),h(null);let N=r,k=O==="workspace"?await An(N):await Pn(N);if(O==="session"&&k.removed.length>0){for(let P of k.removed)hp(P);let R=x.get("sessionId");if(R&&k.removed.includes(R))S((P)=>{let E=Et(P);return E.delete("sessionId"),E.delete("subagent"),E},{replace:!0})}if(k.removed.length>0)t();if(h(k),p(!1),k.removed.length===N.length)l([]);return k},[r,c,x,S,t]);return{pending:r,isDeleting:c,outcome:g,request:y,cancel:v,confirm:T}}var Fn={archived:[],refused:[]};async function Eo(t,r){try{let l=await fetch(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({ids:r})}),c=await l.json().catch(()=>null);if(!l.ok)return{...Fn,error:c?.error||`Could not archive (HTTP ${l.status}).`};return{archived:Array.isArray(c?.archived)?c.archived:[],refused:Array.isArray(c?.refused)?c.refused:[]}}catch(l){return{...Fn,error:l instanceof Error?l.message:"Could not reach the server."}}}function Bn(t){return Eo("/api/sessions/batch-archive",t)}function tu(t){if(t.error)return{message:t.error,tone:"error"};let r=t.archived.length,l=t.refused.length;if(r===0&&l===0)return null;if(l===0)return{message:`Archived ${r} ${r===1?"session":"sessions"}.`,tone:"success"};if(r===0)return{message:`${l} ${l===1?"session":"sessions"} could not be archived.`,tone:"error"};return{message:`Archived ${r} ${r===1?"session":"sessions"}; ${l} refused.`,tone:"warning"}}function Ln(t){let[r,l]=n(!1),c=a(async(p)=>{if(p.length===0||r)return null;l(!0);let g=await Bn(p);if(g.archived.length>0)t();return l(!1),g},[r,t]);return{isArchiving:r,archive:c}}function nu(t,r,l){let c=On(),p=En(l),g=Ln(l),h=c.scopeFolderId===null?null:t.find((T)=>T.id===c.scopeFolderId)??null,x=c.mode==="workspace"?t.map((T)=>String(T.id)):c.mode==="session"?Le(h?.sessions??[],r):[],S=Gt(c.selected,x),y=c.mode?{mode:c.mode,scopeFolderId:c.scopeFolderId,selected:c.selected,toggle:c.toggle,selectAllOf:c.selectAllOf,unselectAllOf:c.unselectAllOf,summaryOf:c.summaryOf}:void 0,v=a(()=>{if(c.mode==="workspace")c.end();else c.begin("workspace")},[c]);return{selection:c,deleteRun:p,archiveRun:g,binding:y,scopeFolder:h,available:x,selected:S,toggleWorkspaceSelection:v}}function ru({mode:t,count:r,total:l,busy:c,archiving:p=!1,scopeLabel:g,onSelectAll:h,onUnselectAll:x,onDelete:S,onArchive:y,onCancel:v,drawer:T=!1}){let O=t==="workspace"?"workspace":"session",N=r===1?O:`${O}s`,k=t==="session"&&g?` in ${g}`:"",R=c||p,P=R||r===0,E=t==="session"&&Boolean(y),L="min-w-0 w-full h-7 flex items-center justify-center gap-1 px-2 rounded border text-[11px] font-medium transition-colors cursor-pointer disabled:opacity-40",A="border-ink/20 text-ink hover:bg-ink/5";return e("div",{"data-testid":"batch-action-bar",className:`border-t border-ink/15 bg-paper ${T?"px-3":"px-2.5"} py-2 flex flex-col gap-1.5 flex-shrink-0`,children:[e("div",{className:"flex items-center justify-between gap-2 text-[11px]",children:[e("span",{className:"min-w-0 truncate text-ink/70",children:[e("span",{className:"font-semibold text-ink",children:r})," ","of ",l," ",l===1?O:`${O}s`," selected",k]}),e("button",{type:"button",onClick:v,disabled:R,title:"Cancel selection","aria-label":"Cancel selection",className:"shrink-0 w-5 h-5 flex items-center justify-center rounded text-ink/50 hover:text-ink hover:bg-ink/10 transition-colors cursor-pointer disabled:opacity-50",children:e(b,{size:13})})]}),e("div",{className:`grid gap-1.5 ${E?"grid-cols-2":"grid-cols-3"}`,children:[e("button",{type:"button",onClick:h,disabled:R||l===0||r===l,className:"min-w-0 w-full h-7 flex items-center justify-center gap-1 px-2 rounded border text-[11px] font-medium transition-colors cursor-pointer disabled:opacity-40 border-ink/20 text-ink hover:bg-ink/5",children:[e(rt,{size:12,className:"shrink-0"}),e("span",{className:"truncate",children:"Select all"})]}),e("button",{type:"button",onClick:x,disabled:R||r===0,className:"min-w-0 w-full h-7 flex items-center justify-center gap-1 px-2 rounded border text-[11px] font-medium transition-colors cursor-pointer disabled:opacity-40 border-ink/20 text-ink hover:bg-ink/5",children:e("span",{className:"truncate",children:"Unselect all"})}),E&&e("button",{type:"button",onClick:y,disabled:P,className:"min-w-0 w-full h-7 flex items-center justify-center gap-1 px-2 rounded border text-[11px] font-medium transition-colors cursor-pointer disabled:opacity-40 border-ink/20 text-ink hover:bg-ink/5",children:p?e(d,{children:[e(m,{size:12,className:"animate-spin shrink-0"}),e("span",{className:"truncate",children:"Archiving…"})]}):e(d,{children:[e(Xe,{size:12,className:"shrink-0"}),e("span",{className:"truncate",children:["Archive ",r>0?`${r} ${N}`:N]})]})}),e("button",{type:"button",onClick:S,disabled:P,className:"min-w-0 w-full h-7 flex items-center justify-center gap-1 px-2 rounded bg-error text-canvas text-[11px] font-semibold hover:opacity-90 transition-opacity cursor-pointer disabled:opacity-40",children:c?e(d,{children:[e(m,{size:12,className:"animate-spin shrink-0"}),e("span",{className:"truncate",children:"Deleting…"})]}):e(d,{children:[e(M,{size:12,className:"shrink-0"}),e("span",{className:"truncate",children:["Delete ",r>0?`${r} ${N}`:N]})]})})]})]})}function au({mode:t,count:r,scopeLabel:l,isDeleting:c,outcome:p,onClose:g,onConfirm:h}){if(i(()=>{let k=(R)=>{if(R.key!=="Escape"||c)return;R.preventDefault(),g()};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[g,c]),r===0)return null;let x=t==="session",S=x?"session":"workspace",y=r===1?S:`${S}s`,v=x&&l?` in ${l}`:"",T=!c&&p!==null,O=p?.removed.length??0,N=p?.refused??[];return e(J,{onClose:c?()=>{}:g,zClass:"z-[70]",maxWidthClass:"max-w-[460px]",header:e("div",{className:"flex items-center gap-3 min-w-0",children:[e(M,{size:16,className:"text-error shrink-0"}),e("div",{className:"min-w-0",children:[e("h2",{className:"text-sm font-semibold text-ink",children:["Delete ",r," ",y,"?"]}),e("p",{className:"text-[11px] text-ink/50 truncate",children:v?v.trim():"Selected rows"})]})]}),footer:e("div",{className:"flex items-center justify-end gap-2 px-5 py-3.5 border-t border-ink/10",children:[e("button",{type:"button",onClick:g,disabled:c,className:"px-3.5 py-1.5 rounded-md border border-ink/20 text-xs font-medium text-ink hover:bg-ink/5 transition-colors cursor-pointer disabled:opacity-50",children:T?"Close":"Cancel"}),e("button",{type:"button",onClick:h,disabled:c||T,className:"px-3.5 py-1.5 rounded-md bg-error text-canvas text-xs font-medium hover:opacity-90 transition-opacity cursor-pointer disabled:opacity-50 flex items-center gap-1.5",children:c?e(d,{children:[e(m,{size:13,className:"animate-spin"}),e("span",{children:"Deleting…"})]}):e(d,{children:[e(M,{size:13}),e("span",{children:["Delete ",r," ",y]})]})})]}),children:e("div",{className:"px-5 py-4 space-y-3",children:[x?e("ul",{className:"text-[11.5px] leading-relaxed text-ink/70 space-y-1.5",children:[e("li",{children:["Each transcript is removed from"," ",e("span",{className:"font-mono text-ink",children:"~/.omp/agent/sessions"})," — the conversations are gone from the sidebar and from oh-my-pi."]}),e("li",{children:"Their subagent transcripts, side questions, queued messages and saved layout go too."}),e("li",{children:"A session that is mid-run is refused rather than interrupted; stop it and delete again."})]}):e("ul",{className:"text-[11.5px] leading-relaxed text-ink/70 space-y-1.5",children:[e("li",{children:"The workspaces are removed from this sidebar."}),e("li",{children:["Their directories and every transcript on disk are left alone — re-add a workspace with"," ",e("span",{className:"font-mono text-ink",children:"New Workspace"})," when you want it back."]})]}),p?.error?e("div",{className:"flex items-start gap-2 px-3 py-2 rounded-md border border-error/30 bg-error/5 text-[11px] text-ink/75",children:[e(D,{size:13,className:"mt-0.5 shrink-0 text-error"}),e("span",{children:p.error})]}):T?e("div",{className:"flex items-start gap-2 px-3 py-2 rounded-md border border-ink/15 bg-ink/5 text-[11px] text-ink/75",children:e("span",{children:["Removed ",O," ",O===1?S:`${S}s`,N.length>0?`, ${N.length} refused:`:"."]})}):e("div",{className:"flex items-start gap-2 px-3 py-2 rounded-md border border-error/30 bg-error/5 text-[11px] text-ink/75",children:[e(D,{size:13,className:"mt-0.5 shrink-0 text-error"}),e("span",{children:x?"This cannot be undone from the UI. Archive a session instead to keep its transcript.":"This removes the sidebar entry only. The folder itself is not deleted."})]}),N.length>0&&e("ul",{className:"max-h-40 overflow-y-auto scrollbar-overlay-container space-y-1 text-[11px] text-ink/70",children:N.map((k)=>e("li",{className:"flex items-start gap-1.5",children:[e("span",{className:"font-mono text-ink/50 shrink-0 max-w-[7rem] truncate",title:k.id,children:k.id}),e("span",{className:"min-w-0",children:k.error})]},k.id))})]})})}
|
|
4
|
-
export{ss,Ia,_r,ll,Wc,Kc,Mi,Vc,ls,ud,nA,rA,dd,aA,cs,us,Sr,ds,ps,Pi,ms,fs,As,mo,gs,hs,bs,Yc,pd,Jc,Zc,Xc,eu,tu,nu,ru,au};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{rf}from"./index-fghst0kd.js";export{rf as createInfoServices};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{EA}from"./index-qkscve6n.js";export{EA as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Tf}from"./index-7fdp9c7m.js";export{Tf as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Oe}from"./index-3az1w5f8.js";export{Oe as default};
|