@kabmo-labs/kabmo 0.57.1 → 0.58.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 +523 -506
- package/dist/client/static/js/Body-karkrzkc.js +3 -0
- package/dist/client/static/js/{CsvGrid-563qmmmr.js → CsvGrid-j03knmbe.js} +2 -2
- package/dist/client/static/js/{DocxView-5j69q3s0.js → DocxView-e8408vzs.js} +2 -2
- package/dist/client/static/js/{DrawioView-gd6k3hvn.js → DrawioView-fj4mfzch.js} +2 -2
- package/dist/client/static/js/{HtmlPreview-6gnktzzp.js → HtmlPreview-9g8xwzgw.js} +1 -1
- package/dist/client/static/js/ImageView-sz4fzz9k.js +1 -0
- package/dist/client/static/js/LayoutWrapper-q6q4h04a.js +2 -0
- package/dist/client/static/js/MergeDiffView-b8f013ws.js +1 -0
- package/dist/client/static/js/Modal-ahecatp5.js +60 -0
- package/dist/client/static/js/{PdfView-n1zq27td.js → PdfView-8jtdx5hd.js} +1 -1
- package/dist/client/static/js/SessionsView-jwp8xvw5.js +1 -0
- package/dist/client/static/js/{SheetView-nes7j86v.js → SheetView-hwx8s864.js} +11 -11
- package/dist/client/static/js/{SvgPreview-vv0qzkt7.js → SvgPreview-ete36nzv.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-02g96sn6.js → abnfDiagram-O67JEVCF-7nsqzz6z.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-dc7zys46.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-7qj2fpwt.js → architectureDiagram-NJMV4G6O-xvpkfq2f.js} +11 -11
- package/dist/client/static/js/{astro-asmathwv.js → astro-rsrqgjjx.js} +1 -1
- package/dist/client/static/js/bash-n5d0esqg.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-grdr1j2h.js → blockDiagram-BEXU5L5S-0saahcs6.js} +7 -7
- package/dist/client/static/js/c-pk766wx0.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-7y980xpx.js → c4Diagram-YGBWAQC7-ktpqnb4a.js} +2 -2
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-29ag4js1.js → classDiagram-v2-NBCMYWYE-x67cz3ms.js} +5 -5
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-e5dvgehd.js → cose-bilkent-JH36ORCC-9wzmhkz8.js} +1 -1
- package/dist/client/static/js/cpp-3pt91jvm.js +1 -0
- package/dist/client/static/js/css-sp1cgdbr.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-9fx59e89.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-eq6fmx0b.js → cynefinDiagram-VND7K2PF-dmmgmv99.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-xfhwp8ha.js → dagre-6A5THRUB-ygkkms1t.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-1bw6x6zt.js → diagram-22UHCM2B-qxj0pqb4.js} +14 -14
- package/dist/client/static/js/{diagram-3UASUU5V-076ej5n5.js → diagram-3UASUU5V-77k8w5dt.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-cvf9fhdq.js → diagram-ATOU4E4O-m0h86vf4.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-hn1wdx54.js → diagram-CDSNMT55-5v28kaeg.js} +5 -5
- package/dist/client/static/js/{diagram-MLGK6HIB-76gk27b5.js → diagram-MLGK6HIB-zgcg9gaz.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-0cbajhpx.js → diagram-MPIPVDR6-10c9s6e6.js} +2 -2
- package/dist/client/static/js/{dockerfile-7atfjhnf.js → dockerfile-dr9sdsqp.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-n0g3b9m2.js → ebnfDiagram-ZINNZB2B-mz4022dz.js} +1 -1
- package/dist/client/static/js/{elixir-7q2k61zb.js → elixir-3dy25ex8.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-f6wrjcv9.js → elk-276RUBZZ-ccerbsag.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-jz622yrg.js → erDiagram-OPXOYQCR-a8vjyrrw.js} +5 -5
- package/dist/client/static/js/{erlang-tjsd7n4d.js → erlang-v7344938.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-61d2ee91.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-104ywb7w.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-2ex4nxyg.js → ganttDiagram-FUAMR5RP-sz1g29fp.js} +4 -4
- package/dist/client/static/js/gitGraph-4MIJSDKK-zkb30q0t.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-38eyay6g.js → gitGraphDiagram-X574FWY7-efqk42q0.js} +15 -15
- package/dist/client/static/js/graphql-2ntm7jyh.js +1 -0
- package/dist/client/static/js/html-mt2yb43b.js +1 -0
- package/dist/client/static/js/{index-db7vsjkd.js → index-2a0b9ya2.js} +1 -1
- package/dist/client/static/js/index-2f6psebk.js +2 -0
- package/dist/client/static/js/{index-j9y4tjk0.js → index-3m1dksmy.js} +2 -2
- package/dist/client/static/js/{index-668fc1df.js → index-3p732mvs.js} +2 -2
- package/dist/client/static/js/{index-3x88t8g9.js → index-3ymw778n.js} +2 -2
- package/dist/client/static/js/{index-rbkvw2xs.js → index-5tp3emtg.js} +2 -2
- package/dist/client/static/js/{index-8444mec5.js → index-6ac860yz.js} +2 -2
- package/dist/client/static/js/{index-zzggk17b.js → index-6ey6y9em.js} +2 -2
- package/dist/client/static/js/index-6h46r2de.js +1 -0
- package/dist/client/static/js/index-6qqsy78z.js +1 -0
- package/dist/client/static/js/{index-25zpywv7.js → index-6x0kn8pb.js} +2 -2
- package/dist/client/static/js/{index-zv8wrvha.js → index-7ma44af3.js} +3 -3
- package/dist/client/static/js/index-7s4dge1z.js +1 -0
- package/dist/client/static/js/{index-my856e49.js → index-7ynf3s2w.js} +2 -2
- package/dist/client/static/js/index-8aqjj2x2.js +1 -0
- package/dist/client/static/js/index-bkwax812.js +1 -0
- package/dist/client/static/js/{index-60g0e74a.js → index-dqf0srrp.js} +2 -2
- package/dist/client/static/js/{index-jaxhfk9x.js → index-dz18nn65.js} +2 -2
- package/dist/client/static/js/{index-9gfn1a3h.js → index-e42ys2q3.js} +7 -7
- package/dist/client/static/js/{index-wxs0x3g1.js → index-ewryzs4g.js} +2 -2
- package/dist/client/static/js/{index-55v3qv04.js → index-f31c6jg8.js} +22 -22
- package/dist/client/static/js/index-f44k9k8d.css +1 -0
- package/dist/client/static/js/{index-nnqyew8n.js → index-fhtnvqgf.js} +2 -2
- package/dist/client/static/js/{index-396g4zz4.js → index-gaa39w5q.js} +2 -2
- package/dist/client/static/js/{index-63mk2qk6.js → index-gqsnyh8k.js} +2 -2
- package/dist/client/static/js/index-gw4c5n3a.js +2 -0
- package/dist/client/static/js/index-j863hg0d.js +9 -0
- package/dist/client/static/js/{index-e4yj4kbe.js → index-jnxmvxb8.js} +12 -12
- package/dist/client/static/js/{index-0prwdwyb.js → index-jxsha63v.js} +2 -2
- package/dist/client/static/js/index-k1576e2m.js +2 -0
- package/dist/client/static/js/index-k4qshngy.js +4 -0
- package/dist/client/static/js/{index-ep99arz1.js → index-k56patms.js} +2 -2
- package/dist/client/static/js/{index-8pqx5n2p.js → index-kc5yt2cd.js} +2 -2
- package/dist/client/static/js/index-mkp3gwag.js +1 -0
- package/dist/client/static/js/{index-g2e0m757.js → index-nzq51nbb.js} +7 -7
- package/dist/client/static/js/{index-1q934wfk.js → index-q5q8a3qn.js} +2 -2
- package/dist/client/static/js/{index-tksrpqkh.js → index-qbqm3c91.js} +5 -5
- package/dist/client/static/js/{index-zynbvm7x.js → index-qkcmspxq.js} +2 -2
- package/dist/client/static/js/index-r1wrke3j.js +1 -0
- package/dist/client/static/js/index-rr79n77k.js +470 -0
- package/dist/client/static/js/{index-y1j18rha.js → index-rxt8sf9a.js} +2 -2
- package/dist/client/static/js/{index-tdryzzy9.js → index-ssepzdaz.js} +6 -6
- package/dist/client/static/js/{index-rsyqf691.js → index-sxag9ptg.js} +2 -2
- package/dist/client/static/js/{index-ewst55j2.js → index-t71k3b28.js} +2 -2
- package/dist/client/static/js/index-tc07gd33.js +2 -0
- package/dist/client/static/js/{index-m6eh5g1q.js → index-tdg7hz80.js} +2 -2
- package/dist/client/static/js/{index-nt17ejrm.js → index-th61y26d.js} +2 -2
- package/dist/client/static/js/{index-n1xmkf2g.js → index-tnxp90ac.js} +1 -1
- package/dist/client/static/js/{index-ms80nne4.js → index-tq3t3qm4.js} +2 -2
- package/dist/client/static/js/index-ts8rhd06.js +1 -0
- package/dist/client/static/js/{index-xtrsvm0d.js → index-v8xhgfeq.js} +2 -2
- package/dist/client/static/js/{index-ays8t3t3.js → index-vb5a3g01.js} +4 -4
- package/dist/client/static/js/{index-pjf5wak8.js → index-ver116ed.js} +1 -1
- package/dist/client/static/js/{index-hge0y4vn.js → index-vf01q99d.js} +2 -2
- package/dist/client/static/js/{index-4cff0zg2.js → index-w5j1wgcz.js} +1 -1
- package/dist/client/static/js/{index-cwwg7k5f.js → index-wnk9k57k.js} +27 -27
- package/dist/client/static/js/{index-6z30g3ha.js → index-x7h04xzf.js} +2 -2
- package/dist/client/static/js/{index-xfnjwhan.js → index-xfyxmaj1.js} +85 -85
- package/dist/client/static/js/index-xygk0v3e.js +2 -0
- package/dist/client/static/js/{index-kt7c42n7.js → index-y0f3wbc3.js} +2 -2
- package/dist/client/static/js/index-zh550byg.js +2 -0
- package/dist/client/static/js/info-A6RAGUB7-xxvyt8p8.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-c55t0tvd.js → infoDiagram-VRGFBTTK-rykcacj5.js} +1 -1
- package/dist/client/static/js/ini-bdk46a3d.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-r9kg5kg5.js → ishikawaDiagram-OU5B5YK6-rj752kd8.js} +3 -3
- package/dist/client/static/js/java-3g3925cf.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-zmmst4v8.js → journeyDiagram-ZHPQQLJL-mtetwn6f.js} +5 -5
- package/dist/client/static/js/json-hdyzmffz.js +1 -0
- package/dist/client/static/js/jsx-y8r9mrdq.js +1 -0
- package/dist/client/static/js/{julia-d18zhpyp.js → julia-mxe3pnz3.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-3tt6sc9a.js → kanban-definition-PNTS6WVX-4h5pw5mm.js} +3 -3
- package/dist/client/static/js/lua-wf5k6p3r.js +1 -0
- package/dist/client/static/js/markdown-9bf16dx7.js +1 -0
- package/dist/client/static/js/{mermaid.core-pkrs8zp5.js → mermaid.core-bs542jma.js} +8 -8
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-b4c6gxg4.js → mindmap-definition-NLK3R4M7-67s4xy7h.js} +5 -5
- package/dist/client/static/js/one-dark-pro-541ed4b7.js +1 -0
- package/dist/client/static/js/one-light-nr79mykt.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-cm8jeesg.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-9jkat1mz.js → pegDiagram-GJSIUBJH-qykb6ssk.js} +1 -1
- package/dist/client/static/js/{perl-sns2qvmf.js → perl-a8eeaqkn.js} +1 -1
- package/dist/client/static/js/{php-3q6v9eey.js → php-6gq92zt8.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-8b9xgcxv.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-6pbchjh7.js → pieDiagram-5QR66LMP-mymrrvck.js} +2 -2
- package/dist/client/static/js/properties-xk4dn00p.js +1 -0
- package/dist/client/static/js/python-7sgz05n4.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-p9brea19.js → quadrantDiagram-O4NWA36T-6f8ahd40.js} +6 -6
- package/dist/client/static/js/r-w4qxm0pv.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-fxr2x2mf.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-5qd45xk1.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-6fa00vpk.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-pcbtg7tj.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-r0fdhdtp.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-3cep8css.js → railroadDiagram-XR7U4H2S-c3habpvw.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-x1yjgsrr.js → requirementDiagram-PLB6GJNP-nysqy6te.js} +12 -12
- package/dist/client/static/js/{ruby-f9k99tfq.js → ruby-mc826p2e.js} +1 -1
- package/dist/client/static/js/{rust-yy8gekx8.js → rust-m4f4vpvn.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-23wzf4aj.js → sankeyDiagram-IPEJSGJF-s5dtfp3z.js} +4 -4
- package/dist/client/static/js/{sass-2syegq28.js → sass-8bq5r2tz.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-w4wr3zzr.js → sequenceDiagram-PO4LG4MO-bb3yp049.js} +21 -21
- package/dist/client/static/js/{sizeCapture-INFHLROL-aabfesnr.js → sizeCapture-INFHLROL-0m2msee7.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-t0n288xw.js → stateDiagram-v2-GCMORJYK-cd0qgj6t.js} +3 -3
- package/dist/client/static/js/{svelte-mm3jfpje.js → svelte-5vrwkc13.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-1nnm0p7h.js → swimlanes-2SLR337P-rpb01f7p.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-zx36y2c8.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-8pyssn0q.js → timeline-definition-EJHVYXUP-tqw2e6y1.js} +5 -5
- package/dist/client/static/js/treeView-Q6P3EWNA-9sn2h4ea.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-9fzms0pq.js +1 -0
- package/dist/client/static/js/tsx-h5yzg80q.js +1 -0
- package/dist/client/static/js/typescript-qy1sbhea.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-vveepvt6.js → usecaseDiagram-POWQR4AR-dhf4d5xg.js} +41 -41
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-tqyvmqxc.js → vennDiagram-UO4OBE2U-ztkk79dv.js} +7 -7
- package/dist/client/static/js/{vue-e8e3q3hj.js → vue-gmjnxjm3.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-vy6rp5gp.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-p8rs34em.js → wardleyDiagram-VNRHLVJA-ahre5tmv.js} +5 -5
- package/dist/client/static/js/xml-mrk4xakv.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-pgnvxtps.js → xychartDiagram-PMCCYNJV-vak2c50n.js} +6 -6
- package/dist/client/static/js/yaml-xaza6dra.js +1 -0
- package/package.json +6 -6
- package/src/client/bootstrap.d.ts +11 -0
- package/src/client/borders.css +3 -4
- package/src/client/components/auth/login-screen/index.tsx +1 -1
- package/src/client/components/common/ComposerPicker.tsx +1 -1
- package/src/client/components/common/CopyButton.tsx +1 -1
- package/src/client/components/common/FolderPicker.tsx +1 -1
- package/src/client/components/common/SubagentStatusIcon.tsx +2 -2
- package/src/client/components/common/ViewportSelector.tsx +2 -2
- package/src/client/components/common/batch-selection/BatchActionBar.tsx +1 -1
- package/src/client/components/common/batch-selection/BatchDeleteModal.tsx +4 -4
- package/src/client/components/common/checkbox/style.ts +1 -1
- package/src/client/components/common/context-usage-button/McpSection.tsx +3 -2
- package/src/client/components/common/file-icon/index.tsx +3 -3
- package/src/client/components/common/harness-glyph/index.tsx +4 -3
- package/src/client/components/common/image-viewer/fullscreen.tsx +1 -1
- package/src/client/components/common/image-viewer/index.tsx +2 -2
- package/src/client/components/common/markdown-review/ReviewPopover.tsx +2 -2
- package/src/client/components/common/markdown-review/ReviewSummary.tsx +3 -3
- package/src/client/components/common/plugin-render-boundary/index.tsx +1 -1
- package/src/client/components/common/server-control/Panel.tsx +1 -1
- package/src/client/components/common/server-control/Row.tsx +3 -3
- package/src/client/components/common/session-actions-menu/MenuItem.tsx +2 -2
- package/src/client/components/common/session-branch/SubagentRow.tsx +1 -1
- package/src/client/components/common/session-delete-modal/index.tsx +4 -4
- package/src/client/components/common/session-row/StatusSlot.tsx +1 -1
- package/src/client/components/common/session-row/index.tsx +40 -2
- package/src/client/components/common/session-row/session-row.test.tsx +46 -3
- package/src/client/components/common/shell-update-button/Modal.tsx +1 -1
- package/src/client/components/common/todo-row/index.tsx +1 -1
- package/src/client/components/common/window-controls/index.tsx +1 -1
- package/src/client/components/common/workspace-options-menu/index.tsx +4 -4
- package/src/client/components/layout/session-sidebar/Toolbar.tsx +2 -2
- package/src/client/components/layout/session-sidebar/WorktreeBadge.tsx +1 -1
- package/src/client/components/layout/session-sidebar/about-modal/UpdateLogDialog.tsx +1 -1
- package/src/client/components/layout/session-sidebar/about-modal/UpdateSection.tsx +3 -3
- package/src/client/components/layout/session-sidebar/about-modal/index.tsx +1 -1
- package/src/client/components/layout/session-sidebar/modern/FilterChips.tsx +1 -1
- package/src/client/components/layout/session-sidebar/new-workspace-modal/DirectoryList.tsx +2 -2
- package/src/client/components/layout/session-sidebar/new-workspace-modal/index.tsx +1 -1
- package/src/client/components/layout/session-sidebar/scheduler-modal/ModelFields.tsx +1 -1
- package/src/client/components/layout/session-sidebar/scheduler-modal/TaskForm.tsx +1 -1
- package/src/client/components/layout/session-sidebar/scheduler-modal/TaskList.tsx +4 -4
- package/src/client/components/layout/session-sidebar/scheduler-modal/index.tsx +1 -1
- package/src/client/components/layout/update-popup/Actions.tsx +1 -1
- package/src/client/components/mobile/mobile-right-sidebar/Action.tsx +1 -1
- package/src/client/components/mobile/mobile-right-sidebar/Header.tsx +3 -3
- package/src/client/components/mobile/mobile-right-sidebar/MissingFileBanner.tsx +2 -2
- package/src/client/components/mobile/mobile-right-sidebar/PreviewScroller.tsx +2 -2
- package/src/client/components/mobile/mobile-right-sidebar/StatusBar.tsx +2 -2
- package/src/client/components/mobile/mobile-session-sidebar/Toolbar.tsx +3 -3
- package/src/client/components/settings/Modal.tsx +8 -3
- package/src/client/components/settings/SettingsSidebarList.tsx +2 -2
- package/src/client/components/settings/Sidebar.tsx +3 -3
- package/src/client/components/settings/apply-side-effects.test.ts +46 -0
- package/src/client/components/settings/apply-side-effects.ts +8 -0
- package/src/client/components/settings/categories/BehaviorSettings.tsx +1 -1
- package/src/client/components/settings/categories/OmpSettings.tsx +3 -3
- package/src/client/components/settings/categories/UsageSettings.tsx +3 -3
- package/src/client/components/settings/categories/agent-settings/DetailPane.tsx +5 -5
- package/src/client/components/settings/categories/appearance-settings/CustomThemeEditor.tsx +177 -0
- package/src/client/components/settings/categories/appearance-settings/CustomThemeSection.test.tsx +136 -0
- package/src/client/components/settings/categories/appearance-settings/CustomThemeSection.tsx +180 -0
- package/src/client/components/settings/categories/appearance-settings/ThemeCard.tsx +1 -1
- package/src/client/components/settings/categories/appearance-settings/ThemeGrid.tsx +6 -5
- package/src/client/components/settings/categories/appearance-settings/ThemePreview.tsx +106 -0
- package/src/client/components/settings/categories/appearance-settings/ThemeSection.tsx +7 -3
- package/src/client/components/settings/categories/behavior-settings/Editor.tsx +1 -1
- package/src/client/components/settings/categories/chat-settings/ToolRenderSection.tsx +1 -1
- package/src/client/components/settings/categories/command-settings/DetailPane.tsx +4 -4
- package/src/client/components/settings/categories/dictation-settings/ExternalSection.tsx +1 -1
- package/src/client/components/settings/categories/git-settings/CommitMessageSection.tsx +1 -1
- package/src/client/components/settings/categories/git-settings/IdentitySection.tsx +2 -2
- package/src/client/components/settings/categories/harness-settings/AccountLoginPanel.tsx +3 -3
- package/src/client/components/settings/categories/harness-settings/AccountsPanel.tsx +13 -83
- package/src/client/components/settings/categories/harness-settings/HarnessImportControls.tsx +1 -1
- package/src/client/components/settings/categories/mcp-settings/ConnectionTest.tsx +1 -1
- package/src/client/components/settings/categories/mcp-settings/DetailPane.tsx +5 -5
- package/src/client/components/settings/categories/mcp-settings/ImportModal.tsx +1 -1
- package/src/client/components/settings/categories/mcp-settings/KeyValueSection.tsx +1 -1
- package/src/client/components/settings/categories/mcp-settings/SidebarList.tsx +2 -2
- package/src/client/components/settings/categories/omp-settings/ConfigTabs.tsx +4 -4
- package/src/client/components/settings/categories/omp-settings/OrderedChips.tsx +1 -1
- package/src/client/components/settings/categories/omp-settings/PresetBar.tsx +3 -3
- package/src/client/components/settings/categories/omp-settings/RoleEditor.tsx +2 -2
- package/src/client/components/settings/categories/omp-settings/RowEditor.tsx +2 -2
- package/src/client/components/settings/categories/panel-plugins/GitFreshness.tsx +2 -2
- package/src/client/components/settings/categories/panel-plugins/InstallForm.tsx +3 -3
- package/src/client/components/settings/categories/panel-plugins/InstalledList.tsx +1 -1
- package/src/client/components/settings/categories/panel-plugins/Meta.tsx +1 -1
- package/src/client/components/settings/categories/panel-plugins/PluginCard.tsx +5 -5
- package/src/client/components/settings/categories/panel-plugins/ReadmeModal.tsx +1 -1
- package/src/client/components/settings/categories/panel-plugins/Registries.tsx +4 -4
- package/src/client/components/settings/categories/panel-plugins/Section.tsx +3 -3
- package/src/client/components/settings/categories/panel-plugins/SettingsModal.tsx +2 -2
- package/src/client/components/settings/categories/panel-plugins/SyncBlockedNotice.tsx +2 -2
- package/src/client/components/settings/categories/panel-plugins/Toolbar.tsx +1 -1
- package/src/client/components/settings/categories/plugin-settings/DetailPane.tsx +2 -2
- package/src/client/components/settings/categories/plugin-settings/MarketplacePane.tsx +4 -4
- package/src/client/components/settings/categories/plugin-settings/SettingsSection.tsx +1 -1
- package/src/client/components/settings/categories/plugin-settings/SidebarList.tsx +4 -4
- package/src/client/components/settings/categories/project-settings/AddProjectModal.tsx +1 -1
- package/src/client/components/settings/categories/project-settings/DeleteProjectModal.tsx +3 -3
- package/src/client/components/settings/categories/project-settings/DetailsHeader.tsx +1 -1
- package/src/client/components/settings/categories/project-settings/IconGrid.tsx +3 -3
- package/src/client/components/settings/categories/project-settings/SidebarList.tsx +1 -1
- package/src/client/components/settings/categories/project-settings/WorktreeSettings.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/AddModelModal.tsx +3 -3
- package/src/client/components/settings/categories/provider-settings/AddProviderModal.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/AuthSection.tsx +3 -3
- package/src/client/components/settings/categories/provider-settings/DeleteProviderModal.tsx +3 -3
- package/src/client/components/settings/categories/provider-settings/EntryAdvanced.tsx +1 -1
- package/src/client/components/settings/categories/provider-settings/EntryModal.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/LoginModal.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/LogoutProviderModal.tsx +3 -3
- package/src/client/components/settings/categories/provider-settings/ModelCapabilitiesModal.tsx +1 -1
- package/src/client/components/settings/categories/provider-settings/PriceFields.tsx +1 -1
- package/src/client/components/settings/categories/skill-catalog/GitImportPanel.tsx +1 -1
- package/src/client/components/settings/categories/skill-catalog/SkillCard.tsx +1 -1
- package/src/client/components/settings/categories/skill-catalog/SourceRail.tsx +1 -1
- package/src/client/components/settings/categories/skill-settings/DetailHeader.tsx +7 -7
- package/src/client/components/settings/categories/skill-settings/DetailPane.tsx +1 -1
- package/src/client/components/settings/categories/skill-settings/SidebarList.tsx +2 -2
- package/src/client/components/settings/categories/usage-settings/ProviderCard.tsx +1 -1
- package/src/client/components/settings/categories/usage-settings/SavedResetsSection.tsx +2 -2
- package/src/client/components/settings/categories/usage-settings/SidebarList.tsx +1 -1
- package/src/client/components/settings/categories/usage-settings/TokenHarborCard.tsx +1 -1
- package/src/client/components/settings/categories/voice-settings/speech/EndpointSection.tsx +2 -2
- package/src/client/components/settings/categories/voice-settings/speech/EngineSection.tsx +5 -5
- package/src/client/components/settings/categories/voice-settings/speech/ModelsSection.tsx +4 -4
- package/src/client/components/workspace/browser-panel/ActivityToasts.tsx +2 -2
- package/src/client/components/workspace/browser-panel/EngineNotice.tsx +1 -1
- package/src/client/components/workspace/browser-panel/index.tsx +2 -2
- package/src/client/components/workspace/browser-toolbar/clusters.tsx +2 -2
- package/src/client/components/workspace/btw-panel/Messages.tsx +2 -2
- package/src/client/components/workspace/btw-panel/TopicMenu.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/AiMessageFooterSheet.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/ChangedFilesSummary.tsx +7 -7
- package/src/client/components/workspace/chat-timeline/ComposerDock.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/IrcNotice.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/MessageItem.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/OrchestrationNotice.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/QueueList.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/SubagentControls.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/SystemNotice.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/TaskResultContent.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/UndoConfirmModal.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/block-chrome.test.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/ComposerNotice.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.tsx +11 -11
- package/src/client/components/workspace/chat-timeline/chat-input/GoalModal.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/chat-input/VoiceNotice.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/props.ts +3 -3
- package/src/client/components/workspace/chat-timeline/plan-review/index.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormAsk.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormDialog.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionCard.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/SwipeDeck.tsx +7 -7
- package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/ApprovalBody.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/hashline-patch/index.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/AstEdit.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.tsx +9 -9
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Debug.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Edit.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Eval.tsx +6 -6
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/FileMatches.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Github.tsx +7 -7
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Goal.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/GoalRecord.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Lsp.tsx +9 -9
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/ManageSkill.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Proc.tsx +8 -8
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Resolve.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/SecurityScan.tsx +6 -6
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/TaskResult.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Todo.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.tsx +7 -7
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ArtifactChip.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/DiffView.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/EnvelopeHeader.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolCardShell.tsx +4 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolFactChips.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolRowActions.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/status-glyph.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.test.tsx +35 -9
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.tsx +17 -12
- package/src/client/components/workspace/context-panel/RawJsonViewer.tsx +2 -2
- package/src/client/components/workspace/diff-panel/ConflictBanner.tsx +3 -3
- package/src/client/components/workspace/diff-panel/Toolbar.tsx +3 -3
- package/src/client/components/workspace/diff-panel/index.tsx +3 -3
- package/src/client/components/workspace/diff-panel/toolbar-git-actions.tsx +1 -1
- package/src/client/components/workspace/editor/ConflictStrip.tsx +2 -2
- package/src/client/components/workspace/editor/ExternalChangeStrip.tsx +2 -2
- package/src/client/components/workspace/editor/FilePane.tsx +6 -6
- package/src/client/components/workspace/editor/FindWidget.tsx +2 -2
- package/src/client/components/workspace/editor/GoToLineModal.tsx +1 -1
- package/src/client/components/workspace/editor/SaveAsModal.tsx +3 -3
- package/src/client/components/workspace/editor/SaveDeletedFileModal.tsx +2 -2
- package/src/client/components/workspace/editor/StatusBar.tsx +1 -1
- package/src/client/components/workspace/editor/Tabs.test.ts +3 -3
- package/src/client/components/workspace/editor/Tabs.tsx +6 -6
- package/src/client/components/workspace/editor/Toolbar.tsx +4 -4
- package/src/client/components/workspace/editor/toolbar-clusters.tsx +1 -1
- package/src/client/components/workspace/editor/viewers/DataGrid.tsx +1 -1
- package/src/client/components/workspace/editor/viewers/GridToolbar.tsx +2 -2
- package/src/client/components/workspace/editor/viewers/SheetView.tsx +2 -2
- package/src/client/components/workspace/editor/viewers/ViewerError.tsx +2 -2
- package/src/client/components/workspace/file-explorer/ArchiveModals.tsx +1 -1
- package/src/client/components/workspace/file-explorer/ContextMenu.tsx +3 -3
- package/src/client/components/workspace/file-explorer/Modals.tsx +3 -3
- package/src/client/components/workspace/file-explorer/RowLabel.test.tsx +2 -2
- package/src/client/components/workspace/git-panel/BranchToolbar.tsx +2 -2
- package/src/client/components/workspace/git-panel/ChangesList.tsx +3 -3
- package/src/client/components/workspace/git-panel/ConflictItem.tsx +3 -3
- package/src/client/components/workspace/git-panel/FileItem.tsx +1 -1
- package/src/client/components/workspace/git-panel/Modals.tsx +1 -1
- package/src/client/components/workspace/git-panel/OperationBar.tsx +4 -4
- package/src/client/components/workspace/git-panel/StashSection.tsx +1 -1
- package/src/client/components/workspace/git-panel/TreeItem.tsx +2 -2
- package/src/client/components/workspace/git-panel/branch-modal/BranchRow.tsx +2 -2
- package/src/client/components/workspace/git-panel/branch-modal/DeleteDialog.tsx +2 -2
- package/src/client/components/workspace/git-panel/branch-modal/index.tsx +2 -2
- package/src/client/components/workspace/model-dropdown/HarnessTabs.tsx +31 -76
- package/src/client/components/workspace/model-dropdown/Item.tsx +2 -2
- package/src/client/components/workspace/model-dropdown/Panel.tsx +15 -9
- package/src/client/components/workspace/model-dropdown/Section.tsx +1 -1
- package/src/client/components/workspace/model-dropdown/harness-tabs.test.tsx +12 -83
- package/src/client/components/workspace/model-dropdown/index.tsx +2 -2
- package/src/client/components/workspace/model-dropdown/picker-close.test.tsx +16 -2
- package/src/client/components/workspace/plan-panel/PageView.tsx +2 -2
- package/src/client/components/workspace/plan-panel/index.tsx +2 -2
- package/src/client/components/workspace/plugin-panel/Error.tsx +1 -1
- package/src/client/components/workspace/repo-picker/Modal.tsx +3 -3
- package/src/client/components/workspace/repo-picker/Row.tsx +5 -5
- package/src/client/components/workspace/search-panel/Body.tsx +2 -2
- package/src/client/components/workspace/terminal-panel/Header.tsx +3 -3
- package/src/client/components/workspace/terminal-panel/KeyBar.tsx +2 -2
- package/src/client/components/workspace/terminal-panel/QuickActions.tsx +1 -1
- package/src/client/components/workspace/terminal-panel/RealtimeTerminalView.tsx +1 -1
- package/src/client/components/workspace/terminal-panel/index.tsx +1 -1
- package/src/client/components/workspace/usage-panel/index.tsx +3 -3
- package/src/client/components/workspace/user-browser-panel/AddressBar.tsx +1 -1
- package/src/client/components/workspace/wiki-panel/PageView.tsx +2 -2
- package/src/client/components/workspace/wiki-panel/index.tsx +2 -2
- package/src/client/components/workspace/worktree-modal/index.tsx +1 -1
- package/src/client/data/settings/omp-schema.json +27 -7
- package/src/client/hooks/chat/timeline/session-harness.ts +2 -1
- package/src/client/hooks/editor/use-unload-guard.tsx +2 -2
- package/src/client/hooks/models/use-harness-accounts-panel.ts +142 -0
- package/src/client/hooks/ui/border-style.test.ts +1 -2
- package/src/client/hooks/ui/theme.ts +23 -2
- package/src/client/main.tsx +7 -1
- package/src/client/tailwind-contrast.test.ts +22 -7
- package/src/client/tailwind.css +115 -18
- package/src/server/lib/assets/theme-css.server.test.ts +31 -1
- package/src/server/lib/assets/theme-css.server.ts +15 -1
- package/src/server/lib/harness/accounts.test.ts +5 -3
- package/src/server/lib/harness/acp/acp-todos.test.ts +23 -0
- package/src/server/lib/omp/session/delete.server.ts +4 -0
- package/src/server/lib/realtime/topics/session-data.server.ts +63 -1
- package/src/server/lib/realtime/topics/session-data.test.ts +154 -0
- package/src/server/lib/tray/runtime.server.ts +5 -0
- package/src/server/plugins/ssr.ts +16 -4
- package/src/server/routes/settings/root.ts +11 -0
- package/src/server/routes/settings/settings-store-routes.test.ts +37 -0
- package/src/shared/lib/chat/timeline/block-chrome.ts +2 -2
- package/src/shared/lib/chat/todo/flat-list.test.ts +81 -0
- package/src/shared/lib/chat/todo/flat-list.ts +29 -0
- package/src/shared/lib/chat/todo/parser.ts +7 -53
- package/src/shared/lib/chat/todo/progress.test.ts +3 -3
- package/src/shared/lib/chat/todo/progress.ts +3 -3
- package/src/shared/lib/fs/git-status.test.ts +22 -22
- package/src/shared/lib/fs/git-status.ts +31 -31
- package/src/shared/lib/icons/icon-paint-authority.ts +5 -4
- package/src/shared/lib/omp/config/schema-releases-19-4.test.ts +20 -3
- package/src/shared/lib/settings/defaults.ts +1 -0
- package/src/shared/lib/theme/catalog.test.ts +42 -0
- package/src/shared/lib/theme/catalog.ts +66 -11
- package/src/shared/lib/theme/css.ts +25 -1
- package/src/shared/lib/theme/custom.test.ts +156 -0
- package/src/shared/lib/theme/custom.ts +260 -0
- package/src/shared/lib/theme/ink-scale.test.ts +83 -2
- package/src/shared/lib/theme/ink-scale.ts +74 -9
- package/src/shared/lib/theme/shell-palette.ts +3 -3
- package/src/shared/lib/theme/theme.test.ts +28 -13
- package/src/shared/types/settings/state.ts +11 -3
- package/tsconfig.json +6 -0
- package/dist/client/static/js/Body-p6zwk0nx.js +0 -3
- package/dist/client/static/js/ImageView-fkfq3fwv.js +0 -1
- package/dist/client/static/js/LayoutWrapper-mdb1qm26.js +0 -2
- package/dist/client/static/js/MergeDiffView-7kpjxcg9.js +0 -1
- package/dist/client/static/js/Modal-0p9cr2tn.js +0 -60
- package/dist/client/static/js/SessionsView-gptt0rq8.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-3hkq8grc.js +0 -1
- package/dist/client/static/js/bash-n7wcmq3s.js +0 -1
- package/dist/client/static/js/c-20y64hcp.js +0 -1
- package/dist/client/static/js/cpp-ty6n0dg9.js +0 -1
- package/dist/client/static/js/css-ncvxaxt0.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-9m18e6m5.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-d4egnv9v.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-5bvd5k2t.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-grqv890n.js +0 -1
- package/dist/client/static/js/graphql-6rwdfcnf.js +0 -1
- package/dist/client/static/js/html-p76eszt9.js +0 -1
- package/dist/client/static/js/index-28wv94gz.js +0 -2
- package/dist/client/static/js/index-3wgjtp2k.js +0 -9
- package/dist/client/static/js/index-7trfm17d.js +0 -2
- package/dist/client/static/js/index-cxe75e06.js +0 -2
- package/dist/client/static/js/index-dmb1pykr.js +0 -1
- package/dist/client/static/js/index-fqc1snjw.js +0 -1
- package/dist/client/static/js/index-jsn2kedv.js +0 -1
- package/dist/client/static/js/index-pe4d9wht.js +0 -1
- package/dist/client/static/js/index-sm8gpk3g.js +0 -4
- package/dist/client/static/js/index-st6a8q5z.js +0 -470
- package/dist/client/static/js/index-stmwbavz.js +0 -1
- package/dist/client/static/js/index-swaveqxg.css +0 -1
- package/dist/client/static/js/index-t82q5t6m.js +0 -1
- package/dist/client/static/js/index-t9zjfxvc.js +0 -1
- package/dist/client/static/js/index-tdbcp70z.js +0 -2
- package/dist/client/static/js/index-v38j2zxn.js +0 -2
- package/dist/client/static/js/index-x17y7xdr.js +0 -2
- package/dist/client/static/js/index-xrb4kjr3.js +0 -1
- package/dist/client/static/js/info-A6RAGUB7-rzpg7qk1.js +0 -1
- package/dist/client/static/js/ini-kjcpgebh.js +0 -1
- package/dist/client/static/js/java-0bcyv1jt.js +0 -1
- package/dist/client/static/js/json-xha2drny.js +0 -1
- package/dist/client/static/js/jsx-8p6dqgpq.js +0 -1
- package/dist/client/static/js/lua-njwwdj4s.js +0 -1
- package/dist/client/static/js/markdown-8gbyxxjd.js +0 -1
- package/dist/client/static/js/one-dark-pro-sstqnzcf.js +0 -1
- package/dist/client/static/js/one-light-6fpxxq2j.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-eac14hsq.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-a9xqvysf.js +0 -1
- package/dist/client/static/js/properties-d5bwhgwz.js +0 -1
- package/dist/client/static/js/python-fdwwjjhh.js +0 -1
- package/dist/client/static/js/r-4d2ygtfj.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-jv2pm0fe.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-j74sc0b6.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-eaf19baz.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-d4j5nq31.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-ba862a9p.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-cx3f29mq.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-e8yb44pd.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-zvdv84vp.js +0 -1
- package/dist/client/static/js/tsx-dk8rpgtw.js +0 -1
- package/dist/client/static/js/typescript-5txwpd9t.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-hbv0cg4s.js +0 -1
- package/dist/client/static/js/xml-8516fzfp.js +0 -1
- package/dist/client/static/js/yaml-6k1tmwtm.js +0 -1
|
@@ -3,14 +3,26 @@
|
|
|
3
3
|
import type { ThemePalette } from '@kabmo-labs/kabmo-app-contracts/theme';
|
|
4
4
|
import { mixHex, parseHexColor, relativeLuminance } from '@/shared/lib/theme/color';
|
|
5
5
|
|
|
6
|
-
/** The fifteen steps, lightest first.
|
|
7
|
-
*
|
|
6
|
+
/** The fifteen steps, lightest first. On the RAW ramp the number IS the
|
|
7
|
+
* percentage of ink over the paper (`--theme-ink-40`). The text utility of the
|
|
8
|
+
* same name reads the solved ramp (`--theme-text-40`) instead, so a low rung
|
|
9
|
+
* used as a word is clamped to the palette's AA floor. */
|
|
8
10
|
export const MUTED_STEPS = [20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90] as const;
|
|
9
11
|
|
|
10
|
-
/** The lightest step that clears AA on the default palette: `/65` at 5.
|
|
11
|
-
* `/60` is 4.
|
|
12
|
+
/** The lightest step that clears AA on the default palette: `/65` at 5.65:1.
|
|
13
|
+
* `/60` is 4.74:1, so the boundary sits where it is needed, not safely above it. */
|
|
12
14
|
export const TEXT_CONTRAST_FLOOR = 65;
|
|
13
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Alpha levels a signal chip uses as a background (`bg-error/10` and friends).
|
|
18
|
+
*
|
|
19
|
+
* The chip moves its ground TOWARD the signal, so contrast solved against the
|
|
20
|
+
* paper alone does not hold on it: measured, `paper`'s error is 5.03:1 on the
|
|
21
|
+
* page but 4.33:1 on its own 10% tint, and `one-dark-pro-soft`'s is 4.38 then
|
|
22
|
+
* 3.87. The solver has to treat every one of these as a surface.
|
|
23
|
+
*/
|
|
24
|
+
export const SIGNAL_TINT_STEPS = [5, 10, 15, 20, 25] as const;
|
|
25
|
+
|
|
14
26
|
/**
|
|
15
27
|
* Strength of the inline-code chip's fill, as a percentage of ink over paper.
|
|
16
28
|
*
|
|
@@ -49,6 +61,12 @@ export interface InkScale {
|
|
|
49
61
|
ink: string;
|
|
50
62
|
/** The fifteen steps, lightest first. Each is the ink at that percentage. */
|
|
51
63
|
ladder: readonly string[];
|
|
64
|
+
/**
|
|
65
|
+
* The same fifteen rungs solved for TEXT: a rung below this palette's AA
|
|
66
|
+
* floor is replaced by `muted`. Icons and separators keep `ladder`, so the
|
|
67
|
+
* decorative ramp's shape survives while a word cannot fall under AA.
|
|
68
|
+
*/
|
|
69
|
+
textLadder: readonly string[];
|
|
52
70
|
/** The lightest step that clears AA on both surfaces; the OS shells read it. */
|
|
53
71
|
muted: string;
|
|
54
72
|
/** The inline-code chip's fill: opaque ink over this palette's paper. */
|
|
@@ -75,6 +93,10 @@ export function inkScale(palette: ThemePalette): InkScale {
|
|
|
75
93
|
const scale: InkScale = {
|
|
76
94
|
ink: palette.ink,
|
|
77
95
|
ladder,
|
|
96
|
+
// Below the floor every rung resolves to the same legal level. Collapsing
|
|
97
|
+
// there is not a style choice: once a rung must clear 4.5:1, the palette's
|
|
98
|
+
// headroom is what limits the number of distinct legal steps.
|
|
99
|
+
textLadder: ladder.map((color) => (worstTextContrast(color, palette) >= MUTED_CONTRAST_FLOOR ? color : muted)),
|
|
78
100
|
muted,
|
|
79
101
|
// Opaque: the paper base is what makes the chip independent of its backdrop.
|
|
80
102
|
codeFill: mixHex(palette.paper, palette.ink, CODE_FILL_PERCENT / 100),
|
|
@@ -103,13 +125,33 @@ export type SignalSlot = 'error' | 'success' | 'info' | 'warning' | 'meta';
|
|
|
103
125
|
|
|
104
126
|
export const SIGNAL_SLOTS: readonly SignalSlot[] = ['error', 'success', 'info', 'warning', 'meta'];
|
|
105
127
|
|
|
106
|
-
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
128
|
+
/**
|
|
129
|
+
* The worst contrast a signal WORD reaches: the page, the panel, and the
|
|
130
|
+
* signal's own tinted chip (see `SIGNAL_TINT_STEPS`).
|
|
131
|
+
*
|
|
132
|
+
* A chip's ground is the signal itself at 5-25% over the surface, so it is
|
|
133
|
+
* always closer to the word than the paper is. Solving for the paper alone is
|
|
134
|
+
* what left `one-dark-pro-soft`'s error at 3.87:1 inside its own 10% badge.
|
|
135
|
+
*/
|
|
136
|
+
export function signalWorstContrast(color: string, palette: ThemePalette, slot: SignalSlot): number {
|
|
137
|
+
let worst = worstTextContrast(color, palette);
|
|
138
|
+
for (const surface of [palette.paper, palette.canvas]) {
|
|
139
|
+
for (const step of SIGNAL_TINT_STEPS) {
|
|
140
|
+
const chip = mixHex(surface, palette[slot], step / 100);
|
|
141
|
+
const contrast = contrastBetween(color, chip);
|
|
142
|
+
if (contrast < worst) worst = contrast;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return Number.isFinite(worst) ? worst : 0;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** A signal colour mixed toward the extreme until it reads as TEXT anywhere it
|
|
149
|
+
* lands: paper, canvas, or its own tinted chip. The fill itself (`bg-error`)
|
|
150
|
+
* keeps the palette colour. */
|
|
109
151
|
export function signalTextColor(palette: ThemePalette, slot: SignalSlot): string {
|
|
110
152
|
const base = palette[slot];
|
|
111
153
|
if (!parseHexColor(base)) return base;
|
|
112
|
-
if (
|
|
154
|
+
if (signalWorstContrast(base, palette, slot) >= MUTED_CONTRAST_FLOOR) return base;
|
|
113
155
|
|
|
114
156
|
// Toward BLACK on a light palette and WHITE on a dark one: the signal keeps
|
|
115
157
|
// its hue and moves away from its surface, which is what "make this readable
|
|
@@ -117,7 +159,30 @@ export function signalTextColor(palette: ThemePalette, slot: SignalSlot): string
|
|
|
117
159
|
const extreme = palette.variant === 'dark' ? '#ffffff' : '#000000';
|
|
118
160
|
for (let ratio = MIX_STEP; ratio <= 1; ratio += MIX_STEP) {
|
|
119
161
|
const mixed = mixHex(base, extreme, ratio);
|
|
120
|
-
if (
|
|
162
|
+
if (signalWorstContrast(mixed, palette, slot) >= MUTED_CONTRAST_FLOOR) return mixed;
|
|
121
163
|
}
|
|
122
164
|
return extreme;
|
|
123
165
|
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* The colour to put ON a solid signal fill (`bg-error text-error-on`).
|
|
169
|
+
*
|
|
170
|
+
* `text-canvas` was the pair: it only works while the fill is on the far side of
|
|
171
|
+
* the canvas from it. Measured, `bg-error text-canvas` failed on 12 of 32 light
|
|
172
|
+
* palettes (2.85:1 on `mono-light`) and 8 of 31 dark ones (3.40:1 on
|
|
173
|
+
* `fields-of-the-shire-dark`). This picks the palette surface with the most
|
|
174
|
+
* contrast, falling back to pure white or black when both surfaces lose.
|
|
175
|
+
*/
|
|
176
|
+
export function onSignalTextColor(palette: ThemePalette, slot: SignalSlot): string {
|
|
177
|
+
const fill = palette[slot];
|
|
178
|
+
let best = palette.paper;
|
|
179
|
+
let bestContrast = 0;
|
|
180
|
+
for (const candidate of [palette.paper, palette.canvas, '#ffffff', '#000000']) {
|
|
181
|
+
const contrast = contrastBetween(candidate, fill);
|
|
182
|
+
if (contrast > bestContrast) {
|
|
183
|
+
best = candidate;
|
|
184
|
+
bestContrast = contrast;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return best;
|
|
188
|
+
}
|
|
@@ -44,13 +44,13 @@ export interface ShellPalette {
|
|
|
44
44
|
variant: 'light' | 'dark';
|
|
45
45
|
/** The page's own ground: what the overlay and the web view paint. */
|
|
46
46
|
canvas: string;
|
|
47
|
-
/**
|
|
47
|
+
/** The secondary surface: an outlined button's fill (`--theme-paper`). */
|
|
48
48
|
paper: string;
|
|
49
49
|
/** Foreground text, and the progress bar's fill. */
|
|
50
50
|
ink: string;
|
|
51
|
-
/** Secondary text
|
|
51
|
+
/** Secondary text: the overlay's status line, the solved AA level. */
|
|
52
52
|
muted: string;
|
|
53
|
-
/** The bar's trough and a button's border (
|
|
53
|
+
/** The bar's trough and a button's border (ink at 14% over the canvas). */
|
|
54
54
|
hairline: string;
|
|
55
55
|
/** The failure sentence's colour. */
|
|
56
56
|
error: string;
|
|
@@ -28,7 +28,14 @@ import { describe, expect, test } from 'bun:test';
|
|
|
28
28
|
|
|
29
29
|
import { mixHex, parseHexColor, relativeLuminance, rgbaToHex } from '@/shared/lib/theme/color';
|
|
30
30
|
import { THEME_STYLE_ELEMENT_ID, themeStyleSheet } from '@/shared/lib/theme/css';
|
|
31
|
-
import {
|
|
31
|
+
import {
|
|
32
|
+
CODE_FILL_PERCENT,
|
|
33
|
+
MUTED_STEPS,
|
|
34
|
+
inkScale,
|
|
35
|
+
onInkTextColor,
|
|
36
|
+
onSignalTextColor,
|
|
37
|
+
signalTextColor,
|
|
38
|
+
} from '@/shared/lib/theme/ink-scale';
|
|
32
39
|
import { KABMO_PALETTES } from '@/shared/lib/theme/palettes/kabmo';
|
|
33
40
|
import { DARK_PALETTES } from '@/shared/lib/theme/palettes/dark';
|
|
34
41
|
import { DARK_EXTENDED_PALETTES } from '@/shared/lib/theme/palettes/dark-extended';
|
|
@@ -137,10 +144,13 @@ describe('generated stylesheet', () => {
|
|
|
137
144
|
` --theme-paper: ${paper.paper};`,
|
|
138
145
|
` --theme-canvas: ${paper.canvas};`,
|
|
139
146
|
` --theme-ink: ${paper.ink};`,
|
|
140
|
-
// The fifteen
|
|
141
|
-
//
|
|
142
|
-
//
|
|
147
|
+
// The fifteen DECORATIVE rungs, stated per palette: the ink at N% over
|
|
148
|
+
// this palette's paper (`ink-scale.ts`). Their contrast varies by palette,
|
|
149
|
+
// so only the separate `--theme-text-*` ladder may carry a word.
|
|
143
150
|
...MUTED_STEPS.map((step, index) => ` --theme-ink-${step}: ${inkScale(paper).ladder[index]};`),
|
|
151
|
+
// The same rungs solved for TEXT: below the palette's AA floor they
|
|
152
|
+
// resolve to `muted`, so a word cannot be dimmer than 4.5:1.
|
|
153
|
+
...MUTED_STEPS.map((step, index) => ` --theme-text-${step}: ${inkScale(paper).textLadder[index]};`),
|
|
144
154
|
// The inline-code chip's own opaque fill (never an alpha: see the
|
|
145
155
|
// `--theme-code-fill` rule in `tailwind.css`).
|
|
146
156
|
` --theme-code-fill: ${inkScale(paper).codeFill};`,
|
|
@@ -159,6 +169,7 @@ describe('generated stylesheet', () => {
|
|
|
159
169
|
` --theme-info-text: ${signalTextColor(paper, 'info')};`,
|
|
160
170
|
` --theme-warning-text: ${signalTextColor(paper, 'warning')};`,
|
|
161
171
|
` --theme-meta-text: ${signalTextColor(paper, 'meta')};`,
|
|
172
|
+
` --theme-error-on: ${onSignalTextColor(paper, 'error')};`,
|
|
162
173
|
' --theme-info-hover: color-mix(in srgb, var(--theme-info) 85%, var(--theme-ink));',
|
|
163
174
|
' --theme-warning-hover: color-mix(in srgb, var(--theme-warning) 85%, var(--theme-ink));',
|
|
164
175
|
` color-scheme: ${paper.variant};`,
|
|
@@ -169,20 +180,24 @@ describe('generated stylesheet', () => {
|
|
|
169
180
|
|
|
170
181
|
test('names every slot --theme-* and nothing else', () => {
|
|
171
182
|
const names = [...css.matchAll(/--theme-[a-z0-9-]+:/g)].map((match) => match[0]);
|
|
172
|
-
// Eight palette slots, fifteen
|
|
173
|
-
// the
|
|
174
|
-
// the five solved signal levels,
|
|
175
|
-
|
|
183
|
+
// Eight palette slots, fifteen decorative ink steps, fifteen solved text
|
|
184
|
+
// steps, the inline-code chip's fill, the inverted-surface level, the
|
|
185
|
+
// palette's own AA level (`--theme-muted`), the five solved signal levels,
|
|
186
|
+
// the word on a solid error fill, and the two hover mixes.
|
|
187
|
+
expect(new Set(names).size).toBe(49);
|
|
176
188
|
expect(names[0]).toBe('--theme-paper:');
|
|
177
189
|
// Slot order is the swatch order the appearance cards render.
|
|
178
190
|
expect(names[2]).toBe('--theme-ink:');
|
|
179
191
|
expect(names[3]).toBe('--theme-ink-20:');
|
|
180
192
|
expect(names[17]).toBe('--theme-ink-90:');
|
|
181
|
-
expect(names[18]).toBe('--theme-
|
|
182
|
-
expect(names[
|
|
183
|
-
expect(names[
|
|
184
|
-
expect(names[
|
|
185
|
-
expect(names[
|
|
193
|
+
expect(names[18]).toBe('--theme-text-20:');
|
|
194
|
+
expect(names[32]).toBe('--theme-text-90:');
|
|
195
|
+
expect(names[33]).toBe('--theme-code-fill:');
|
|
196
|
+
expect(names[34]).toBe('--theme-on-ink-muted:');
|
|
197
|
+
expect(names[35]).toBe('--theme-muted:');
|
|
198
|
+
expect(names[40]).toBe('--theme-meta:');
|
|
199
|
+
expect(names[41]).toBe('--theme-error-text:');
|
|
200
|
+
expect(names[46]).toBe('--theme-error-on:');
|
|
186
201
|
});
|
|
187
202
|
|
|
188
203
|
test('states the inline-code chip fill as an opaque colour, per palette', () => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ThemePalette } from '@kabmo-labs/kabmo-app-contracts/theme';
|
|
1
2
|
import type { ThemeId } from '@/shared/lib/theme/catalog';
|
|
2
3
|
import type { ChatWidthMode } from '@/shared/lib/chat/timeline/width-mode';
|
|
3
4
|
import type { ToolRenderMode } from '@/shared/lib/chat/timeline/tool-render-mode';
|
|
@@ -66,10 +67,17 @@ export interface SettingsCategoryItem {
|
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
export interface SettingsState {
|
|
69
|
-
/** Palette id from the theme catalog (`shared/lib/theme/catalog.ts`).
|
|
70
|
-
*
|
|
71
|
-
*
|
|
70
|
+
/** Palette id from the theme catalog (`shared/lib/theme/catalog.ts`). A
|
|
71
|
+
* built-in is the catalog's own union; a user-defined palette carries the
|
|
72
|
+
* `custom-` prefix and is resolved through the registered table. */
|
|
72
73
|
theme: ThemeId;
|
|
74
|
+
/**
|
|
75
|
+
* Palettes the user defined in Appearance → Palette. They live in the same
|
|
76
|
+
* settings blob as `theme`, so the SSR shell can paint the first frame without
|
|
77
|
+
* a second request, and they are validated before they reach CSS
|
|
78
|
+
* (`shared/lib/theme/custom.ts`).
|
|
79
|
+
*/
|
|
80
|
+
customThemes: ThemePalette[];
|
|
73
81
|
/**
|
|
74
82
|
* Font family the code editors are set in (`EDITOR_FONT_FAMILIES` in
|
|
75
83
|
* `shared/lib/code/editor/typography.ts`). The value is a CSS family name the
|
package/tsconfig.json
CHANGED
|
@@ -73,6 +73,9 @@
|
|
|
73
73
|
"@kabmo-labs/kabmo-acp/control/session-notifications": [
|
|
74
74
|
"./packages/kabmo-acp/src/control/session-notifications.ts"
|
|
75
75
|
],
|
|
76
|
+
"@kabmo-labs/kabmo-acp/control/acp-plan": [
|
|
77
|
+
"./packages/kabmo-acp/src/control/acp-plan.ts"
|
|
78
|
+
],
|
|
76
79
|
"@kabmo-labs/kabmo-acp/control/acp-todos.server": [
|
|
77
80
|
"./packages/kabmo-acp/src/control/acp-todos.server.ts"
|
|
78
81
|
],
|
|
@@ -145,6 +148,9 @@
|
|
|
145
148
|
"@kabmo-labs/kabmo-acp/session-core/acp-goal-state.server": [
|
|
146
149
|
"./packages/kabmo-acp/src/session-core/acp-goal-state.server.ts"
|
|
147
150
|
],
|
|
151
|
+
"@kabmo-labs/kabmo-acp/session-core/acp-plan-state.server": [
|
|
152
|
+
"./packages/kabmo-acp/src/session-core/acp-plan-state.server.ts"
|
|
153
|
+
],
|
|
148
154
|
"@kabmo-labs/kabmo-acp/session-core/background-probe": [
|
|
149
155
|
"./packages/kabmo-acp/src/session-core/background-probe.ts"
|
|
150
156
|
],
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{d,n,o,i,u,a,e,s,B,p,dn,I,f,ae,Xe,fe,Nt,et,tn,S,U,Cr,wi,cr,X,ys,El,Bl}from"./index-st6a8q5z.js";import{Oe,oe,Mt,D,ye}from"./index-e4yj4kbe.js";import{Zs}from"./index-tdryzzy9.js";import"./index-ewst55j2.js";import{ht,Ru,Lu,Mu,Ps,Fi,cp}from"./index-7trfm17d.js";import{uu,Xd,ep,du,pr,Rs,pu,mu,fu,gu,Au,Ri,hu,$l,bu}from"./index-ays8t3t3.js";import{EA,Ls,ku,Xo,zl,Su}from"./index-9gfn1a3h.js";import{Wa,Ka,ai}from"./index-8444mec5.js";var $e={name:"git-commit-vertical",size:24,node:[["path",{d:"M12 3v6",key:"1holv5"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M12 15v6",key:"a9ows0"}]]},me=s($e);var _e={name:"maximize",size:24,node:[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]},te=s(_e);var Ue={name:"minimize",size:24,node:[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]},ne=s(Ue);var Ke={name:"save-all",size:24,node:[["path",{d:"M10 2v3a1 1 0 0 0 1 1h5",key:"1xspal"}],["path",{d:"M18 18v-6a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6",key:"1ra60u"}],["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"M8 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9.172a2 2 0 0 1 1.414.586l2.828 2.828A2 2 0 0 1 22 6.828V16a2 2 0 0 1-2.01 2z",key:"1yve0x"}]]},re=s(Ke);function de(t){if(t.byteViewer)return[];return[{id:"save",pinned:!0,actions:[{label:"Save file",icon:re,onSelect:t.onSave,disabled:t.saveDisabled}],children:t.saveButton},{id:"save-as",actions:[{label:"Save as…",icon:re,onSelect:t.onSaveAs}],children:e("button",{type:"button",onClick:t.onSaveAs,className:`${pr} hover:bg-ink/5 hover:text-ink`,title:"Save the buffer to a new file","aria-label":"Save as",children:e(re,{size:14})})}]}function ue(t){if(!t.hasReview)return[];let r=t.isReviewing?"Exit review mode":"Review this document";return[{id:"review",actions:[{label:r,icon:tn,onSelect:t.onToggleReview,active:t.isReviewing}],children:e(Rs,{label:r,pressed:t.isReviewing,title:t.isReviewing?"Review mode is on — click a block to judge it":"Review: click blocks to mark them good or needing work",onClick:t.onToggleReview,children:e(tn,{size:14})})}]}function pe(t){if(!t.hasPreview)return[];return[{id:"preview",actions:[{label:t.previewLabel,icon:t.isPreview?Nt:et,onSelect:t.onTogglePreview,active:t.isPreview}],children:e(Rs,{label:t.previewLabel,pressed:t.isPreview,onClick:t.onTogglePreview,children:t.isPreview?e(Nt,{size:14}):e(et,{size:14})})}]}function be(t){let r=[];if(r.push(...de(t),...ue(t),...pe(t)),!t.byteViewer)r.push({id:"find",actions:[{label:t.findLabel,icon:U,onSelect:t.onToggleFind,active:t.findOpen}],children:e(Rs,{label:t.findLabel,pressed:t.findOpen,title:`${t.findLabel} (Ctrl+F)`,onClick:t.onToggleFind,children:e(U,{size:14})})}),r.push({id:"wrap",actions:[{label:t.wordWrapLabel,icon:dn,onSelect:t.onToggleWordWrap,active:t.wordWrap}],children:e(Rs,{label:t.wordWrapLabel,pressed:t.wordWrap,onClick:t.onToggleWordWrap,children:e(dn,{size:14})})}),r.push({id:"blame",actions:[{label:t.blameInline?"Hide line blame":"Show line blame",icon:me,onSelect:t.onToggleBlameInline,active:t.blameInline}],children:e(Rs,{label:t.blameInline?"Hide line blame":"Show line blame",pressed:t.blameInline,title:"Who last changed each block, from git (hover a line for the commit)",onClick:t.onToggleBlameInline,children:e(me,{size:14})})}),r.push({id:"zoom",actions:[{label:"Decrease font size",icon:Ka,onSelect:t.onZoomOut},{label:"Increase font size",icon:Wa,onSelect:t.onZoomIn}],children:e(d,{children:[e("button",{type:"button",onClick:t.onZoomOut,className:`${pr} hover:bg-ink/5 hover:text-ink`,title:"Decrease font size","aria-label":"Decrease font size",children:e(Ka,{size:14})}),e("button",{type:"button",onClick:t.onZoomIn,className:`${pr} hover:bg-ink/5 hover:text-ink`,title:"Increase font size","aria-label":"Increase font size",children:e(Wa,{size:14})})]})}),r.push({id:"reload",actions:[{label:"Reload from disk",icon:S,onSelect:t.onReload,disabled:!t.canReload}],children:e("button",{type:"button",onClick:t.onReload,disabled:!t.canReload||t.refreshing,"aria-busy":t.refreshing,className:`${pr} hover:bg-ink/5 hover:text-ink`,title:!t.canReload?"Nothing to reload — this tab has no file on disk":t.reloadDiscardsEdits?"Discard my changes and reload from disk":"Reload from disk","aria-label":"Reload from disk",children:e(S,{size:14,className:t.refreshing?"animate-spin":void 0})})});return r.push({id:"copy",actions:[{label:t.copyLabel,icon:ae,onSelect:t.onCopy},{label:"Download file",icon:fe,onSelect:t.onDownload}],children:e(d,{children:[e("button",{type:"button",onClick:t.onCopy,className:`${pr} hover:bg-ink/5 hover:text-ink`,title:t.copyLabel,"aria-label":t.copyLabel,children:t.copied?e(ae,{size:14,className:"text-success"}):e(ae,{size:14})}),e("button",{type:"button",onClick:t.onDownload,className:`${pr} hover:bg-ink/5 hover:text-ink`,title:"Download file","aria-label":"Download file",children:e(fe,{size:14})})]})}),r.push({id:"view-modes",pinned:!0,actions:t.viewModeActions,children:t.viewModeButtons}),r.push({id:"maximize",pinned:!0,actions:[{label:t.maximizeLabel,icon:t.isMaximized?ne:te,onSelect:t.onToggleMaximize,active:t.isMaximized}],children:t.maximizeButton}),r}function he({path:t,saveStatus:r,wordWrap:l,hasPreview:m,isPreview:c,hasReview:b,isReviewing:w,copied:k,byteViewer:y=!1,saveDisabled:h=!1,unsupported:x=!1,handleMissing:T=!1,readOnly:M=!1,isMaximized:g=!1,findOpen:v=!1,onToggleFind:C,onSave:P,onTogglePreview:N,onToggleReview:R,onToggleWordWrap:V,onZoomIn:_,onZoomOut:E,onCopy:O,onDownload:H,onReload:F,canReload:A,refreshing:z=!1,reloadDiscardsEdits:Z,onSaveAs:W,onToggleMaximize:K}){let Q=h?M?"Read-only — this file was opened from the phone, not from a workspace":T?"Cannot save — reopen the file from the system to restore write access":x?"Nothing to save — this file cannot be opened as a document":"Nothing to save — this file could not be read":r==="needs-permission"?"Click Save to allow writing this file":r==="saving"?"Saving…":r==="error"?"Save failed — the file on disk was not changed":"Save file (Ctrl+S)",se=e("button",{type:"button",onClick:P,disabled:h||r==="saving",className:`${pr} hover:bg-ink/5`,title:Q,"aria-label":Q,children:r==="saving"?e(ht,{size:14,className:"text-warning animate-pulse"}):r==="saved"?e(f,{size:14,className:"text-success"}):r==="error"?e(B,{size:14,className:"text-error"}):r==="needs-permission"?e(ht,{size:14,className:"text-warning"}):e(ht,{size:14,className:"hover:text-ink"})}),q=g?"Exit full screen":"Full screen",j=e("button",{type:"button",onClick:K,className:`${pr} hover:bg-ink/5 hover:text-ink ${g?"text-ink":""}`,title:q,"aria-label":q,"aria-pressed":g,children:g?e(ne,{size:14}):e(te,{size:14})}),ee=cp(),G=Xd(),Y=be({byteViewer:y,hasPreview:m,isPreview:c,wordWrap:l,hasReview:b,isReviewing:w,blameInline:ee.inline,findOpen:v,copied:k,isMaximized:g,saveDisabled:h,canReload:A,refreshing:z,reloadDiscardsEdits:Z,saveButton:se,maximizeButton:j,viewModeButtons:e(ep,{size:14}),viewModeActions:G,previewLabel:c?"Show source":"Show preview",findLabel:"Find and replace",wordWrapLabel:l?"Word wrap on":"Word wrap off",copyLabel:k?"Copied":y?"Copy image":"Copy content",maximizeLabel:q,onTogglePreview:N,onToggleReview:R,onToggleFind:C,onToggleWordWrap:V,onToggleBlameInline:()=>{let ce={...Fi(),inline:!ee.inline};Cr({editorBlameInline:ce.inline}),window.dispatchEvent(new CustomEvent(Ps,{detail:ce}))},onZoomIn:_,onZoomOut:E,onCopy:O,onDownload:H,onReload:F,onSaveAs:W,onToggleMaximize:K,onSave:P});return e("div",{className:`@container ${wi.desktop} flex items-center justify-between gap-2 px-3 border-b border-ink/10 bg-paper flex-shrink-0`,children:[e("div",{className:"hidden @[420px]:flex items-center space-x-2 text-xs font-mono text-ink/40 min-w-0",children:e("span",{className:"truncate max-w-[300px]",title:t,children:t})}),e(ai,{clusters:Y,className:"text-ink/40 ml-auto"})]})}function ge({content:t,file:r,zoomLevel:l,reviewActive:m,onExitReview:c,scrollRef:b,onScroll:w}){return e("div",{ref:b,onScroll:w,"data-testid":"editor-scroller",className:"flex-1 overflow-auto bg-paper flex",children:e("div",{className:"p-6 max-w-4xl mx-auto font-sans flex-1",style:{fontSize:`${l}px`},children:e(pu,{content:t,file:r,active:m,onExit:c})})})}function Ze(t,r){return r?`Spaces: ${t}`:"Tabs"}function ve({caret:t,eol:r,onSetEol:l,indentWidth:m,insertSpaces:c,language:b,byteViewer:w,viewerKind:k,lineCount:y,conflicts:h=0}){return e("footer",{className:"flex bg-canvas border-t border-ink/10 px-3 items-center justify-between text-[10px] text-ink/50 flex-shrink-0 font-mono h-6","data-editor-status-bar":"",children:[e("div",{className:"flex items-center gap-3 min-w-0",children:w?e("span",{className:"uppercase",children:Xo[k]}):e(d,{children:[e("span",{className:"tabular-nums",children:t?`Ln ${t.line}, Col ${t.column}`:"Ln —, Col —"}),e("span",{children:Ze(m,c)}),e("button",{type:"button",onClick:()=>l(r==="lf"?"crlf":"lf"),className:"uppercase hover:text-ink transition-colors cursor-pointer",title:`Line endings: ${r.toUpperCase()} — click to switch`,"aria-label":`Line endings ${r.toUpperCase()}, switch`,children:r}),e("span",{children:[y," lines"]})]})}),e("div",{className:"flex items-center gap-3 min-w-0",children:[h>0&&e("span",{className:"text-error font-semibold tabular-nums",title:`${h} unresolved conflict${h===1?"":"s"} — markers are highlighted in the file`,children:["⚠ ",h," conflict",h===1?"":"s"]}),e("span",{className:"uppercase text-ink/40",children:b})]})]})}function Ge(t){if(t===0)return 0;return Math.max(-1,Math.min(1,-Math.sign(t)))}function qe(t,r,l=El,m=Bl){return Math.max(l,Math.min(m,t+r))}function je(t,r){let l=t instanceof HTMLElement?t:null;while(l&&l!==r){let m=getComputedStyle(l);if(/(auto|scroll)/.test(m.overflowY)&&l.scrollHeight>l.clientHeight)return!0;l=l.parentElement}return!1}function xe(t,r){o(()=>{if(!t)return;let l=t.closest("[data-code-surface]"),m=l instanceof HTMLElement?l:t,c=(b)=>{if(!b.ctrlKey&&!b.metaKey)return;if(b.preventDefault(),je(b.target,m))return;let w=Ge(b.deltaY);if(w===0)return;r((k)=>qe(k,w))};return t.addEventListener("wheel",c,{passive:!1}),()=>t.removeEventListener("wheel",c)},[t,r])}function we(t,r){let l=t.trim();if(!/^\d+$/.test(l))return null;let m=Number(l);if(m<1)return null;return Math.min(m,Math.max(r,1))}function ke({lineCount:t,onGo:r,onClose:l}){let[m,c]=n(""),b=i(null);o(()=>{b.current?.focus(),b.current?.select()},[]);let w=()=>{let h=we(m,t);if(h===null)return;r(h)},k=(h)=>{if(h.key==="Enter"){h.preventDefault(),w();return}if(h.key==="Escape")h.preventDefault(),l()},y=we(m,t);return e(X,{onClose:l,maxWidthClass:"max-w-xs",header:e("span",{className:"text-sm font-semibold text-ink",children:"Go to line"}),children:e("div",{className:"px-4 py-3 space-y-2",children:[e("div",{className:"flex items-center gap-2",children:[e("input",{ref:b,value:m,onInput:(h)=>c(h.target.value),onKeyDown:k,inputMode:"numeric",placeholder:"1","aria-label":"Line number",className:"flex-1 bg-paper border border-ink/20 rounded px-2 py-1 text-xs font-mono text-ink outline-none focus:border-ink/40"}),e("span",{className:"text-[10px] font-mono text-ink/40",children:["/ ",t]}),e("button",{type:"button",onClick:w,disabled:y===null,className:"flex items-center gap-1 px-2 py-1 rounded bg-ink text-paper text-xs disabled:opacity-40 disabled:cursor-default cursor-pointer",children:[e(Xe,{size:12}),"Go"]})]}),m&&y!==null&&String(y)!==m.trim()?e("div",{className:"text-[10px] text-ink/50 font-mono",children:["line ",y," (the last line)"]}):null,m&&y===null?e("div",{className:"text-[10px] text-error font-mono",children:"Enter a line number"}):null]})})}var Ee={status:"idle",payload:null,message:null};function Se(t){if(!t?.path)return"";return`${t.root??""}\x00${t.repo??""}\x00${t.path}`}function Te(t,r={}){let l=r.enabled!==!1&&Boolean(t?.path)&&t?.deviceFile!==!0,m=r.dirty===!0,c=Se(t),[b,w]=n({key:"",value:Ee}),k=i(t);k.current=t;let y=i(c);y.current=c;let h=i(l);h.current=l;let x=i(m);x.current=m;let T=i(b);T.current=b;let M=i(0),g=i(""),v=i(new Map),C=i(new Set),P=a(async()=>{let E=k.current;if(!E?.path)return;let O=Se(E),H=++M.current;g.current=O,w((A)=>({key:O,value:{status:"loading",payload:A.key===O?A.value.payload:null,message:null}}));let F=new URLSearchParams({blame:"1",file:E.path,repo:E.repo||"."});if(E.root)F.set("root",E.root);try{let A=await fetch(`/api/fs/git?${F.toString()}`),z=await A.json().catch(()=>null);if(H!==M.current)return;if(!A.ok||!z){w({key:O,value:{status:"error",payload:null,message:z?.error??`Blame request failed (HTTP ${A.status})`}});return}w({key:O,value:z.available?{status:"ready",payload:z,message:null}:{status:"unavailable",payload:z,message:z.message??null}})}catch(A){if(H!==M.current)return;w({key:O,value:{status:"error",payload:null,message:A instanceof Error?A.message:"Blame failed"}})}finally{if(g.current===O)g.current=""}},[]),N=a(async(E)=>{let O=v.current.get(E);if(O)return O;let H=k.current;if(!H?.path)return{entries:[],truncated:!1};let F=new URLSearchParams({blameHistory:"1",file:H.path,line:String(E),repo:H.repo||"."});if(H.root)F.set("root",H.root);try{let z=await(await fetch(`/api/fs/git?${F.toString()}`)).json().catch(()=>null),Z={entries:Array.isArray(z?.entries)?z.entries:[],truncated:z?.truncated===!0};return v.current.set(E,Z),Z}catch{return{entries:[],truncated:!1}}},[]),R=i(null);if(!R.current)R.current={ensure:()=>{if(!h.current||x.current)return;let E=T.current;if(E.key===y.current&&E.value.status!=="idle")return;if(g.current===y.current)return;P()},reload:()=>{v.current.clear(),P()},history:N,snapshot:()=>{let E=T.current;return E.key===y.current?E.value:Ee},stale:()=>x.current,subscribe:(E)=>(C.current.add(E),()=>{C.current.delete(E)})};o(()=>{if(!l||m||!c)return;v.current.clear(),P()},[l,m,c,P]);let V=i(m);return o(()=>{if(V.current===m)return;V.current=m;for(let E of C.current)E()},[m]),o(()=>{for(let E of C.current)E()},[b]),R.current}var Ye="0".repeat(40);function ie(t){return t===Ye}function J(t,r=Date.now()){let l=Math.max(0,Math.floor(r/1000)-t);if(l<60)return"just now";let m=Math.floor(l/60);if(m<60)return`${m}m ago`;let c=Math.floor(m/60);if(c<24)return`${c}h ago`;let b=Math.floor(c/24);if(b<30)return`${b}d ago`;let w=Math.floor(b/30);if(w<12)return`${w}mo ago`;return`${Math.floor(b/365)}y ago`}function Ce(t,r){switch(t){case"not-repo":return"This folder is not a git repository.";case"no-commit":return"This repository has no commits yet.";case"untracked":return"This file has never been committed, so it has no history.";case"too-large":return r??"This file is too large to blame.";case"empty":return"This file is empty.";default:return r??"git could not read this file."}}var Le="fixed z-50 w-[min(340px,92vw)] rounded-xl border border-ink/20 bg-paper p-3 shadow-xl font-sans text-xs text-ink",Be="flex items-baseline justify-between gap-2",Re="truncate text-xs font-semibold text-ink",Je="shrink-0 font-mono text-[10px] text-ink/40",Qe="mt-1 line-clamp-2 text-[11px] leading-snug text-ink/80",tt="mt-2 border-t border-ink/10 pt-2",ot="flex items-center gap-2 font-mono text-[10px] text-ink/40",Me="mt-1 text-[10px] leading-snug text-ink/50",nt="mt-2 flex w-full items-center gap-1.5 text-left text-[10px] text-ink/50 hover:text-ink cursor-pointer",rt="mt-1.5 space-y-1 border-t border-ink/10 pt-1.5",le="flex items-center gap-1.5 font-mono text-[10px]";function L(t,r,l){let m=document.createElement(t);if(m.className=r,l!==void 0)m.textContent=l;return m}function it(t){return new Date(t*1000).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"})}function at(t){let r=t.payload;if(t.status==="error")return{title:"Blame failed",body:t.message??"git could not read this file."};if(t.status==="unavailable")return{title:r?.reason==="untracked"?"Not tracked":"No history",body:Ce(r?.reason??"error",t.message??void 0)};if(!r)return null;if(t.stale)return{title:"Not committed yet",body:"This line changed in the editor. Save the file to see its blame."};if(t.line>r.lines)return{title:"Not committed yet",body:`Line ${t.line} is past the end of the file at HEAD (${r.lines} lines).`};let l=r.runs.length>0?Ne(r,t.line):null;if(!l)return{title:"Not committed yet",body:`git has no attribution for line ${t.line}.`};if(ie(l.sha))return{title:"Not committed yet",body:"This line differs from the last commit."};return null}function Ne(t,r){for(let l of t.runs)if(r>=l.from&&r<=l.to)return t.commits[l.sha]??null;return null}function lt(t,r){t.replaceChildren(),t.className=Le;let l=at(r);if(l){let h=L("div",Be);if(h.append(L("span",Re,l.title)),r.status==="error"&&r.message){let x=L("button","shrink-0 cursor-pointer text-[10px] text-ink/50 hover:text-ink","Try again");x.type="button",x.setAttribute("aria-label","Read the blame again"),h.append(x)}t.append(h,L("p",Me,l.body));return}let m=r.payload;if(!m){t.append(L("p",Me,"Reading blame…"));return}let c=Ne(m,r.line),b=L("div",Be);if(b.append(L("span",Re,c.author.trim()||"Unknown"),L("span",Je,J(c.time))),t.append(b),c.summary)t.append(L("p",Qe,c.summary));let w=L("div",`${ot} ${tt}`);if(w.append(L("code","truncate",c.sha.slice(0,7)),L("span","",it(c.time))),c.mail){let h=L("span","truncate",c.mail);h.title=c.mail,w.append(h)}t.append(w);let k=L("button",nt);if(k.type="button",k.setAttribute("aria-expanded",r.historyOpen?"true":"false"),k.textContent=`${r.historyOpen?"▾":"▸"} Line history`,t.append(k),!r.historyOpen)return;let y=L("ol",rt);if(r.historyLoading)y.append(L("li",`${le} text-ink/40`,"Reading history…"));else if(!r.history||r.history.entries.length===0)y.append(L("li",`${le} text-ink/40`,"No commits touched this line."));else{let h=r.history.entries;if(h.forEach((x,T)=>{let M=L("li",le),g=T===h.length-1?"new":"edit";M.append(L("span","text-ink/40",T===0?"●":"○"),L("code","text-ink/60",x.sha.slice(0,7)),L("span","truncate text-ink/80",x.author.trim()||"Unknown"),L("span","ml-auto shrink-0 text-ink/40",J(x.time)),L("span","shrink-0 rounded bg-ink/5 px-1 text-[8.5px] uppercase tracking-wider text-ink/45",g)),y.append(M)}),r.history.truncated)y.append(L("li",`${le} text-ink/40`,"Older commits are not shown."))}t.append(y)}function Pe(t,r,l){let m=L("div",Le);m.setAttribute("role","dialog"),m.setAttribute("aria-label","Line blame"),m.addEventListener("mousedown",(x)=>x.stopPropagation());let c=null,b=!1,w=!1,k=()=>{let x=r.snapshot();return{line:t,status:x.status,payload:x.payload,message:x.message,stale:r.stale(),history:c,historyOpen:b,historyLoading:w}},y=()=>{lt(m,k());let x=m.querySelector('[aria-label="Read the blame again"]');if(x)x.addEventListener("click",(T)=>{T.stopPropagation(),l()});m.querySelector("button[aria-expanded]")?.addEventListener("click",(T)=>{if(T.stopPropagation(),b=!b,y(),!b||c||w)return;w=!0,y(),r.history(t).then((M)=>{c=M,w=!1,y()})})};y();let h=r.subscribe(y);return{element:m,place(x){let T=m.ownerDocument.defaultView,M=T?.innerWidth??1024,g=T?.innerHeight??768,v=m.offsetWidth||340,C=m.offsetHeight||120,P=8,N=Math.max(8,Math.min(x.left,M-v-8)),R=x.bottom+6,V=x.top-C-6,_=R+C>g-8&&V>8?V:R;m.style.left=`${N}px`,m.style.top=`${Math.max(8,_)}px`},destroy(){h(),m.remove()}}}function De(t){return ye.define((r)=>{let l=null,m=0,c,b=()=>{clearTimeout(c),c=void 0,l?.destroy(),l=null,m=0},w=(g,v)=>{let C=g.getBoundingClientRect();if(C.width>0)return{left:C.left,top:C.top,bottom:C.bottom};let P=r.state.doc.line(Math.min(v,r.state.doc.lines)),N=null;try{N=r.coordsAtPos(P.from)}catch{N=null}if(N)return N;let R=r.scrollDOM.getBoundingClientRect();return{left:R.left,top:R.top+24,bottom:R.top+24}},k=(g,v)=>{if(m===g&&l)return;b(),m=g,l=Pe(g,t,()=>{t.reload(),b()}),document.body.append(l.element),l.place(v)},y=(g)=>{let v=g.target,C=v?.closest?.(".cm-blame-label");if(C){let R=Number(C.dataset.blameLine);return Number.isInteger(R)&&R>0?{line:R,anchor:C}:null}let P=v?.closest?.(".cm-lineNumbers .cm-gutterElement");if(!P)return null;let N=Number((P.textContent??"").trim());return Number.isInteger(N)&&N>0?{line:N,anchor:P}:null},h=(g)=>{let v=y(g);if(!v)return;k(v.line,w(v.anchor,v.line))},x=(g)=>{let v=y(g);if(v){g.preventDefault(),k(v.line,w(v.anchor,v.line));return}if(l&&!l.element.contains(g.target))b()},T=(g)=>{if(g.key==="Escape"&&l)b(),g.stopPropagation()},M=(g)=>{if(!l)return;let v=g.relatedTarget;if(v&&(l.element.contains(v)||r.scrollDOM.contains(v)))return;c=setTimeout(b,200)};return r.scrollDOM.addEventListener("mouseover",h),r.scrollDOM.addEventListener("mouseleave",M),r.scrollDOM.addEventListener("mousedown",x),document.addEventListener("mousedown",x),document.addEventListener("keydown",T,!0),{update(g){if(g.docChanged&&l)b()},destroy(){b(),r.scrollDOM.removeEventListener("mouseover",h),r.scrollDOM.removeEventListener("mouseleave",M),r.scrollDOM.removeEventListener("mousedown",x),document.removeEventListener("mousedown",x),document.removeEventListener("keydown",T,!0)}}})}var Ae=40,ze=oe.define();function st(t){return Oe.define({create:()=>({payload:t.snapshot().payload,stale:!1}),update(r,l){let m=r;for(let c of l.effects){if(!c.is(ze))continue;m=c.value.payload!==r.payload?{payload:c.value.payload,stale:!1}:{payload:r.payload,stale:r.stale}}if(l.docChanged&&!m.stale)m={payload:m.payload,stale:!0};return m}})}function mt(t,r,l){let m=t.commits[r];if(!m||ie(r))return null;let c=m.author.trim()||"Unknown";return l?c:`${c} · ${J(m.time)}`}class He extends Mt{constructor(t,r,l){super();this.line=t;this.text=r;this.title=l}eq(t){return t.line===this.line&&t.text===this.text&&t.title===this.title}toDOM(){let t=document.createElement("span");return t.className="cm-blame-label",t.dataset.blameLine=String(this.line),t.title=this.title,t.textContent=this.text,t}}function Ie(t,r,l){let{payload:m,stale:c}=t;if(!m?.available||c)return D.none;let b=Math.min(m.lines,r.state.doc.lines);if(b<1)return D.none;let w=r.state.doc.lineAt(Math.max(0,Math.min(r.viewport.from,r.state.doc.length))).number,k=r.state.doc.lineAt(Math.max(0,Math.min(r.viewport.to,r.state.doc.length))).number,y=Math.max(1,w-Ae),h=Math.min(b,k+Ae),x=[];for(let T of m.runs){let M=Math.max(T.from,y);if(M>T.to||M>h)continue;let g=mt(m,T.sha,l);if(!g)continue;let v=m.commits[T.sha],C=r.state.doc.line(M);x.push({from:C.to,deco:D.widget({widget:new He(C.number,g,v.summary||v.sha),side:1})})}return D.set(x.map((T)=>T.deco.range(T.from)),!0)}function ct(t,r){return ye.fromClass(class{constructor(l){this.view=l;this.decorations=Ie(l.state.field(t),l,r)}update(l){if(l.startState.field(t)===l.state.field(t)&&!l.docChanged&&!l.viewportChanged)return;this.decorations=Ie(l.state.field(t),l.view,r)}},{decorations:(l)=>l.decorations})}function dt(t){return ye.define((r)=>{let l=!0,m=()=>{if(!l)return;let b=t.snapshot();r.dispatch({effects:ze.of({payload:b.payload,stale:!1})})},c=t.subscribe(m);return{destroy(){l=!1,c()}}})}function Ve({controller:t,inline:r=!0,compact:l=!1}){let m=st(t);return[m,dt(t),r?ct(m,l):[],De(t)]}function Fe({activeFile:t,editor:r,find:l,surfaceRef:m,goToLineRequest:c,rootPath:b=null,repoPath:w=null,onRunCommand:k,wordWrap:y,zoomLevel:h,setZoomLevel:x,editorFontFamily:T,editorTheme:M,viewerKind:g,isPreview:v,reviewActive:C,onToggleReview:P,revealActive:N}){let R=g==="markdown",V=Lu(),_=Mu(),E=cp(),O=Te({name:t.name,path:t.path,root:t.root??b??void 0,repo:t.repo??w??"."},{enabled:E.enabled,dirty:r.isDirty}),H=u(()=>E.enabled?Ve({controller:O,inline:E.inline}):null,[E.enabled,E.inline,O]),[F,A]=n(null),z=u(()=>mu(r.content),[r.content]),[Z,W]=n(!1);o(()=>{if(c>0)W(!0)},[c]);let[K,Q]=n(null),[se,q]=n(null);xe(K,x);let j=Zs({tabKey:String(t.id),surface:R&&v?"rendered":"code",ready:r.loaded,element:R&&v?void 0:K}),ee=a((G)=>{j.ref(G),q(G)},[j.ref]);return Au({path:t.path,scroller:se,preview:R&&v}),e("div",{className:"relative flex-1 min-h-0 flex flex-col",children:[l.open?e(gu,{find:l}):null,Z?e(ke,{lineCount:r.content?r.content.split(`
|
|
2
|
-
`).length:1,onGo:(G)=>{W(!1);let Y=cr(r.content,G-1);m.current?.select(Y,Y,!0),m.current?.revealOffset(Y)},onClose:()=>W(!1)}):null,R&&v?e(ge,{content:r.content,file:{name:t.name,path:t.path,root:t.root,repo:t.repo},zoomLevel:h,reviewActive:C,onExitReview:P,scrollRef:ee,onScroll:j.onScroll}):e(fu,{ref:m,value:r.content,onValueChange:r.onChange,language:r.language,wordWrap:y,documentKey:String(t.id),marks:l.open||N?l.matches:void 0,currentMark:l.currentIndex,onCommand:k,onScroller:Q,onCaret:A,scrollTestId:"editor-scroller",className:"flex-1 min-h-0 text-ink select-text",blame:H,themeVars:M.vars,themes:M.themes,indentUnitText:Ru(V),typing:_,padding:16,placeholder:"This file is empty",style:{fontFamily:T,fontSize:`${h}px`,lineHeight:ys}}),!R||!v?e(ve,{caret:F,eol:r.eol,onSetEol:r.setEol,indentWidth:V.width,insertSpaces:V.insertSpaces,language:r.language,byteViewer:r.isBinaryViewer,viewerKind:g,lineCount:r.content?r.content.split(`
|
|
3
|
-
`).length:0,conflicts:z}):null]})}function We({activeFile:t,editor:r,find:l,surfaceRef:m,pluginFileView:c,wordWrap:b,setWordWrap:w,viewerKind:k,isPreview:y,isReviewing:h,onToggleReview:x,isMaximized:T,setIsMaximized:M,zoomLevel:g,setZoomLevel:v,goToLineRequest:C,onSaveAs:P,rootPath:N=null,repoPath:R=null,runCommand:V,editorFontFamily:_,editorTheme:E,togglePreview:O,revealActive:H,missing:F}){let A=Ls[k]===!0,z=ku[k]===!0,Z=a(async(W)=>{let K=await bu(t,W,{interactive:!0,baseMtimeMs:r.baseMtimeMs});if(K.status==="written")return{ok:!0};if(K.status==="conflict")return{ok:!1,error:"This file changed on disk since it was opened."};if(K.status==="needs-permission")return{ok:!1,error:"Click Save again to grant write access."};return{ok:!1,error:K.error}},[t,r.baseMtimeMs]);return e(d,{children:[e(he,{path:t.path,saveStatus:r.saveStatus,wordWrap:b,hasPreview:z,isPreview:y,hasReview:k==="markdown"&&y,isReviewing:h,copied:r.copied,byteViewer:A,saveDisabled:Boolean(r.loadError)||r.handleMissing||r.deviceBacked,unsupported:Boolean(r.unsupported),handleMissing:r.handleMissing,readOnly:r.deviceBacked,isMaximized:T,findOpen:l.open,onToggleFind:()=>l.open?l.close():l.openFind(),onSave:r.saveNow,onTogglePreview:O,onToggleReview:x,onToggleWordWrap:()=>w(!b),onZoomIn:()=>v((W)=>Math.min(Bl,W+1)),onZoomOut:()=>v((W)=>Math.max(El,W-1)),onCopy:r.copy,onDownload:r.download,onReload:r.reloadFromDisk,onSaveAs:P,canReload:zl(t)&&!r.loadError&&!r.unsupported,refreshing:r.isReading,reloadDiscardsEdits:r.isDirty,onToggleMaximize:()=>M(!T)}),F&&e("div",{className:"flex items-start gap-2 px-3 py-2 border-b border-error/30 bg-error/10 text-error",children:[e(I,{size:14,className:"shrink-0 mt-0.5"}),e("div",{className:"min-w-0",children:[e("div",{className:"text-[11.5px] font-sans",children:"This file was deleted from disk."}),e("div",{className:"text-[11px] font-sans text-error/80",children:"The buffer is still here. Saving recreates the file — autosave is off until then."})]})]}),r.conflict&&e(Su,{diskMtimeMs:r.conflict.diskMtimeMs,fileName:t.name,onReload:r.resolveConflictByReload,onKeepMine:r.resolveConflictByKeepingMine}),r.handleMissing&&e("div",{className:"flex items-start gap-2 px-3 py-2 border-b border-warning/30 bg-warning/10 text-warning",children:[e(I,{size:14,className:"shrink-0 mt-0.5"}),e("div",{className:"min-w-0",children:[e("div",{className:"text-[11.5px] font-sans",children:"This file was opened by the system, not from a workspace."}),e("div",{className:"text-[11px] font-sans text-warning/80",children:"Its write permission ended with the last page load. Reopen the file from the OS to edit it again."})]})]}),r.deviceBacked&&e("div",{className:"flex items-start gap-2 px-3 py-2 border-b border-ink/20 bg-ink/5 text-ink/70",children:[e(I,{size:14,className:"shrink-0 mt-0.5"}),e("div",{className:"min-w-0",children:[e("div",{className:"text-[11.5px] font-sans",children:r.deviceMissing?"The bytes for this file did not survive the reload.":"Opened from this device, so it is read-only here."}),e("div",{className:"text-[11px] font-sans text-ink/50",children:r.deviceMissing?"A phone's file lives only on the phone, so it cannot be re-read. Open it again from the app that shared it.":"The console cannot reach a file on your phone. Copy it into a workspace to edit it."})]})]}),r.isImage&&r.imageUrl?e(Ri,{src:r.imageUrl,name:t.name,className:"flex-1 min-h-0"}):r.isImage?e($l,{kind:"image",path:t.path,name:t.name,source:r.byteSource,content:r.content,revision:r.revision}):r.isLoading?e("div",{className:"flex-1 flex items-center justify-center gap-2 text-ink/40 text-xs font-mono",children:[e(p,{size:14,className:"animate-spin"}),e("span",{children:"Loading file content…"})]}):r.unsupported?e("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 px-6 text-center",children:[e(uu,{size:20,className:"text-ink/40"}),e("span",{className:"text-xs text-ink/70 font-sans",children:[t.name," cannot be opened here"]}),e("span",{className:"text-[11px] text-ink/50 font-sans max-w-[42ch]",children:r.unsupported})]}):r.loadError?e("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 px-6 text-center",children:[e(I,{size:20,className:"text-error"}),e("span",{className:"text-xs text-error font-sans",children:["Could not read ",t.name]}),e("span",{className:"text-[11px] text-ink/50 font-mono break-all",children:r.loadError})]}):c&&!r.isImage?e(EA,{view:c}):hu(k)&&(A||y)?e($l,{kind:k,path:t.path,name:t.name,source:r.byteSource,content:r.content,root:t.root??N,repo:t.repo??R,revision:r.revision,onContentChange:r.onChange,onSaveBytes:r.deviceBacked?void 0:Z,onDirtyChange:r.setBinaryDirty}):e(Fe,{activeFile:t,editor:r,find:l,surfaceRef:m,goToLineRequest:C,rootPath:N,repoPath:R,onRunCommand:V,wordWrap:b,zoomLevel:g,setZoomLevel:v,editorFontFamily:_,editorTheme:E,isPreview:y,reviewActive:h,onToggleReview:x,viewerKind:k,revealActive:H})]})}function en({activeFile:t,editor:r,find:l,surfaceRef:m,pluginFileView:c,wordWrap:b,setWordWrap:w,viewerKind:k,isPreview:y,isReviewing:h,onToggleReview:x,isMaximized:T,setIsMaximized:M,zoomLevel:g,setZoomLevel:v,goToLineRequest:C,onSaveAs:P,rootPath:N=null,repoPath:R=null,runCommand:V,editorFontFamily:_,editorTheme:E,togglePreview:O,revealActive:H,missing:F,onConvertDiffToEditor:A,onFileSaved:z}){if(!t)return e("div",{className:"flex-1 flex items-center justify-center text-ink/40",children:e("p",{className:"font-mono text-sm",children:"Select a tab to view content"})});if(t.isDiff)return e(du,{filePath:t.path,status:t.diffStatus||"M",isStaged:Boolean(t.diffStaged),root:t.root,repo:t.repo||".",journalDiff:t.journalDiff,readOnly:t.diffSource==="journal",onOpenInEditor:()=>A(t.id),onFileSaved:z,className:"flex-1",tabKey:String(t.id)});return e(We,{activeFile:t,editor:r,find:l,surfaceRef:m,pluginFileView:c,wordWrap:b,setWordWrap:w,viewerKind:k,isPreview:y,isReviewing:h,onToggleReview:x,isMaximized:T,setIsMaximized:M,zoomLevel:g,setZoomLevel:v,goToLineRequest:C,onSaveAs:P,rootPath:N,repoPath:R,runCommand:V,editorFontFamily:_,editorTheme:E,togglePreview:O,revealActive:H,missing:F})}export{en as EditorBody};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e,p,zr}from"./index-st6a8q5z.js";import{Ri}from"./index-ays8t3t3.js";import{Nu}from"./index-9gfn1a3h.js";function g({source:t,name:r,revision:s=0}){let{url:i,loading:m,error:o}=Nu(t,s);if(o)return e(zr,{name:r,message:o});if(m||!i)return e("div",{className:"flex flex-1 items-center justify-center gap-2 text-xs text-ink/40",children:[e(p,{size:14,className:"animate-spin"}),e("span",{children:"Loading image…"})]});return e(Ri,{src:i,name:r,className:"flex-1 min-h-0"})}export{g as ImageView};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d,n,o,K,i,u,a,Me,le,Ut,Bc,e,s,Le,_e,p,un,dn,I,dt,pn,f,E,ue,pt,ae,fe,Nt,et,yn,de,Ke,pe,Sa,ia,tn,Da,ir,F,S,U,Al,h,sr,hl,He,we,rn,xh,io,Sm,kn,Qe,Qt,Fo,Ve,vl,Pr,he,X,mt,It,Rt,Mo,fs,Td,Sc,se,We,As,Dc,Yh,Qc,Ft,Lc,ys,Oo,El,Bl,Uo,rt,st,pa,at,Sl,mo,Tl,Xc,$a,eu,Od,Bs,za,jo,Ho,qo,St,ur,Ts,Wo,Ko,Vo,fo,Nl,Ql,Rl,Ll,dr,Lf,Ff,Yo,au,Mf,Ds,Ns,Pf,Qs,$f,zf,Uf,ou,Si,Fl,Ua,Ti,Gf,jf,iu,Hf,qf,q0,Hd,V0,Zo,qd,_n,Wf,Kf,Vf,Yf,AA,Ml,Zf,Xf,su,Ol,ag,og,Jd,ig,X0}from"./index-st6a8q5z.js";import{rp}from"./index-28wv94gz.js";import"./index-e4yj4kbe.js";import{uu,du,pu,mu,fu,gu,Au,Ri,hu,$l,bu}from"./index-ays8t3t3.js";import{Zs}from"./index-tdryzzy9.js";import"./index-ewst55j2.js";import{Ls,ku,xu,Xo,Fs,wu,Cu,Eu,Bu,Iu,_u,Tu,Du}from"./index-9gfn1a3h.js";import{yd,vd,di,kd,xd}from"./index-zv8wrvha.js";import{ht,Li,Ru,Lu,Mu}from"./index-7trfm17d.js";import{Os,ja,Ur,Pu,Ou,ei,$u,$s,dp,DA,zs,Us,Gs,Gr,js,Hs,ti,qs,Ws,Ks,Vs,Mi,ni,Ys,Js,zu,pp,Uu,Gu,ju,Hu,qu,Wu}from"./index-sm8gpk3g.js";import{Wa,Ka}from"./index-8444mec5.js";import{Ed}from"./index-6z30g3ha.js";function Xe(t){let{editorOpen:r,diffOpen:l,settingsOpen:m,offMainScreen:b,onCloseEditor:g,onCloseDiff:x,onCloseSettings:v,onReturnToMain:w}=t;o(()=>X0(()=>{if(r)return g(),!0;if(l)return x(),!0;if(m)return v(),!0;if(b)return w(),!0;return!1}),[r,l,m,b,g,x,v,w])}var gt="terminal";function $e(t){return t===gt}function Te(t){if($e(t))Yh()}function qe({dock:t,sessionId:r,currentScreen:l,setCurrentScreen:m}){let[b,g]=n(0),[x,v]=n(0),w=a(()=>{let y=we(r,"layout.mobileRightPanel")??Bc;Te(y),g((N)=>N+1),m("right")},[r,m]),c=a(()=>{v((y)=>y+1),m("session")},[m]),k=a((y)=>{let N=V0(y,t);if(!N)return;let M=we(r,"layout.mobileRightPanel");if(N==="right"&&(l!=="right"||M!==y))Te(y);if(rn(r,N==="left"?"layout.mobileLeftPanel":"layout.mobileRightPanel",y),N==="right")g(0);m(N==="left"?"session":"right")},[t,r,l,m]);return se(Hd,(y)=>{let N=y.detail?.panelKey;if(N)k(N)}),{right:b,left:x,openSessionDrawer:c,openRightDrawer:w,openNamedPanel:k}}var vt={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]},Ye=s(vt);function Ae(){let t=As(),[r,l]=n(null),m=a((x,v)=>{l({top:v,bottom:v,left:x,right:x})},[]),b=yd({enabled:t,onLongPress:m}),g=a(()=>l(null),[]);return{anchor:r,close:g,surfaceProps:{onContextMenu:(x)=>{x.preventDefault();let v=x.currentTarget.getBoundingClientRect();l({top:v.top,bottom:v.bottom,left:v.left,right:v.right})},onTouchStart:b.onTouchStart,onTouchMove:b.onTouchMove,onTouchEnd:b.onTouchEnd,onTouchCancel:b.onTouchCancel,onClickCapture:(x)=>{if(!b.consume())return;x.preventDefault(),x.stopPropagation()}}}}var xt=10,Ze=600000;function Je({activeSessionTitle:t,activeSessionId:r,onOpenSessionSidebar:l,onOpenRightSidebar:m,onNewSession:b,onSelectSession:g}){let{folders:x}=at(),v=Jd(),w=za(r),[c,k]=n(null),{hidden:y,setHidden:N}=Kf(),M=Ae(),T=qd("mobile"),W=u(()=>{let P=Date.now(),A=[];for(let D of x)for(let O of D.sessions??[]){if(O.is_archived===1)continue;let R=xh(String(O.id)),B=O.updated_at?Date.parse(O.updated_at):0,Y=R!==void 0&&P-R<=Ze?R:B;if(R!==void 0&&P-R>Ze)continue;A.push({id:O.id,title:O.title,folderName:D.name,modified:Y})}return A.sort((D,O)=>O.modified-D.modified).slice(0,xt)},[x]),C=t?t.charAt(0).toUpperCase()+t.slice(1):"New session";return e("header",{className:`flex-shrink-0 bg-canvas border-b border-ink/10 flex items-center justify-between ${vl} px-3 z-20 titlebar-drag-region select-none`,...Ua(),...M.surfaceProps,style:Zo(),children:[e("div",{className:"flex items-center space-x-2 flex-1 min-w-0 titlebar-no-drag",children:[e("button",{type:"button",onClick:l,className:"w-9 h-9 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink transition-colors flex-shrink-0 inline-flex items-center justify-center",title:"Open Sessions","aria-label":"Open Sessions",children:e(Ye,{size:20,strokeWidth:2})}),e("span",{className:"relative font-bold text-sm tracking-tight flex items-center flex-shrink-0",children:[e($a,{glow:!0}),e("span",{className:"absolute -top-0.5 -right-1.5 flex",children:e(ou,{status:v})})]}),e("span",{className:"text-ink/25 font-light text-xs flex-shrink-0 select-none",children:"/"}),e("div",{className:"relative min-w-0 flex-1 max-w-[150px]","data-testid":"session-picker",children:[e("button",{type:"button",onClick:(P)=>{k((A)=>A?null:It(P.currentTarget))},className:"tap-chip flex w-full items-center space-x-1 text-xs font-semibold text-ink hover:text-ink/80 transition-colors py-1 min-w-0",title:C,"aria-haspopup":"menu","aria-expanded":c!==null,children:[e("span",{className:"truncate",children:C}),w&&e(p,{size:12,className:"animate-spin text-ink/50 flex-shrink-0",role:"status","aria-label":"Generating a session name…"}),e(E,{size:13,className:"text-ink/50 flex-shrink-0"})]}),c&&e(Rt,{anchor:c,align:"start",className:"w-72 bg-paper border border-ink/15 rounded-xl shadow-lg p-2 text-xs",onClose:()=>k(null),children:[e("button",{type:"button",onClick:()=>{k(null),b()},className:"w-full text-left px-3 py-2 rounded-lg bg-ink text-canvas flex items-center space-x-2 font-medium mb-1.5",children:[e(F,{size:14}),e("span",{children:"Start New Session"})]}),e("div",{className:"px-2 py-1 text-[10px] uppercase font-bold text-ink/40",children:"Recent Sessions"}),e("div",{className:"max-h-64 scrollbar-overlay-container space-y-0.5",children:W.length===0?e("div",{className:"px-2.5 py-2 text-ink/40 italic",children:"No sessions yet"}):W.map((P)=>e("button",{type:"button",onClick:()=>{k(null),g(P.id)},className:`w-full text-left px-2.5 py-1.5 rounded-lg flex items-center justify-between space-x-2 transition-colors ${String(r)===String(P.id)?"bg-ink/10 font-semibold text-ink":"hover:bg-ink/5 text-ink/80"}`,children:[e("span",{className:"min-w-0 flex flex-col",children:[e("span",{className:"truncate",children:P.title?P.title.charAt(0).toUpperCase()+P.title.slice(1):"Untitled"}),e("span",{className:"truncate text-[10px] text-ink/40 font-mono",children:P.folderName})]}),String(r)===String(P.id)&&e(f,{size:12,className:"flex-shrink-0"})]},P.id))})]})]})]}),e(Vf,{layout:"mobile",sessionId:r==null?null:String(r),showRightPanel:!1,onToggleRightPanel:m,entries:T,hidden:y}),M.anchor?e(Yo,{anchor:M.anchor,title:"Navbar",align:"right",items:Wf([...T.inline,...T.folded]).filter((P)=>P.id!==_n.install).map((P)=>({...P,removable:!0})),hidden:y,onToggle:N,onClose:M.close}):null]})}function eo({activeSessionId:t,onSelectSession:r,onNewSession:l,onOpenSessionSidebar:m,onOpenRightSidebar:b,appSettings:g={}}){let{folders:x}=at(),[v,w]=n(null),c=u(()=>{if(!t)return"New session";for(let y of x){let N=y.sessions?.find((M)=>String(M.id)===String(t));if(N)return N.title}return null},[t,x]);return e("div",{className:"flex flex-col h-full w-full bg-canvas text-ink relative",children:[e(Je,{activeSessionTitle:v||c||"New session",activeSessionId:t,onOpenSessionSidebar:m,onOpenRightSidebar:b,onNewSession:l,onSelectSession:r}),e("main",{className:"flex-1 min-h-0",children:e(Xf,{appSettings:g,onSessionTitle:w,variant:"mobile"})})]})}function oo({onClose:t,viewLabel:r="Sessions",menuProps:l}){return e("div",{className:"border-b border-ink/10 flex items-center justify-between px-3 flex-shrink-0 bg-canvas titlebar-drag-region select-none",...Ua(),...l,style:{...Zo()},children:[e("div",{className:"flex items-center space-x-2.5 titlebar-no-drag min-w-0",children:[e("span",{className:"font-bold text-sm tracking-tight flex items-center flex-shrink-0",children:e($a,{className:"text-[16px]",glow:!0})}),e("span",{className:"text-ink/25 text-xs select-none flex-shrink-0",children:"/"}),e("span",{className:"text-[11px] font-semibold text-ink/60 uppercase tracking-wider font-mono truncate",children:r})]}),e("div",{className:"flex items-center gap-1 titlebar-no-drag flex-shrink-0",children:[e(Yf,{variant:"chip"}),e("button",{type:"button",onClick:t,className:"w-9 h-9 rounded-xl hover:bg-ink/5 active:bg-ink/10 text-ink flex items-center justify-center transition-colors cursor-pointer",title:"Close sidebar","aria-label":"Close sidebar",children:e(h,{size:19,strokeWidth:2})})]})]})}function to({onSettings:t,onKeyBindings:r,onAbout:l,updateAvailable:m,onUpdateClick:b,onDesktopToggle:g,shellDownload:x}){return e("div",{className:"px-3 pt-3 border-t border-ink/10 flex items-center justify-between flex-shrink-0 bg-canvas text-xs text-ink/60",style:{paddingBottom:"max(0.75rem, env(safe-area-inset-bottom, 0px))"},children:[e("div",{className:"flex items-center space-x-3",children:[e("button",{type:"button",onClick:t,className:"flex items-center space-x-1 hover:text-ink transition-colors",children:[e(Al,{size:14}),e("span",{children:"Settings"})]}),e("button",{type:"button",onClick:r,className:"flex items-center space-x-1 hover:text-ink transition-colors",children:[e(Sa,{size:14}),e("span",{children:"Keys"})]}),e("button",{type:"button",onClick:l,className:"flex items-center space-x-1 hover:text-ink transition-colors",children:[e(pe,{size:14}),e("span",{children:"About"})]}),x&&e(Uf,{download:x,variant:"label"}),g&&e("button",{type:"button",onClick:g,className:"flex items-center space-x-1 hover:text-ink transition-colors",title:"Switch to desktop view",children:[e(Da,{size:14}),e("span",{children:"Desktop"})]})]}),e("div",{className:"flex items-center gap-2",children:[e("span",{className:"font-mono text-[10px] text-ink/40",children:["v",Xc.version]}),m&&e("button",{type:"button",onClick:b,className:"px-2 py-0.5 rounded-full border border-ink/20 text-[10px] font-semibold text-ink hover:border-ink/40",children:"update"})]})]})}function no(t){let r=Gf(),l=zf();return se(eu,()=>{t.onClose(),t.openAbout(),r.apply("kabmo").then((m)=>{if(!m)return;t.pushToast(m.message,Sc(m))})}),jf(r,t.pushToast),{updates:r,shellDownload:l}}function ro(t,r,l){return t.filter((m)=>m.id!==r&&!(l&&m.side==="left"))}function so(t){return t}var wt=8;function Fe({panels:t,activeId:r,onSelect:l,hasGitChanges:m=!1}){let b=i(null),g=i(new Map),x=i({activeId:r,panels:t});x.current={activeId:r,panels:t};let v=i({signature:"",width:0}),w=a(()=>{let c=b.current,k=g.current.get(x.current.activeId);if(!c||!k||c.clientWidth<=0)return;let y=`${x.current.activeId}\x00${x.current.panels.map((C)=>C.id).join("\x00")}`,N=v.current;if(N.signature===y&&N.width===c.clientWidth)return;v.current={signature:y,width:c.clientWidth};let M=c.getBoundingClientRect(),T=k.getBoundingClientRect(),W=Mf({scrollLeft:c.scrollLeft,clientWidth:c.clientWidth,scrollWidth:c.scrollWidth,start:T.left-M.left+c.scrollLeft,size:T.width},wt);if(W!==c.scrollLeft)c.scrollLeft=W},[]);return K(w,[r,t,w]),o(()=>{let c=b.current;if(!c||typeof ResizeObserver>"u")return;let k=new ResizeObserver(w);return k.observe(c),()=>k.disconnect()},[w]),e("div",{ref:b,className:"flex items-center space-x-1.5 overflow-x-auto no-scrollbar py-1",children:t.map((c)=>{let k=c.id===r;return e("button",{ref:(y)=>{if(y)g.current.set(c.id,y);else g.current.delete(c.id)},type:"button",onClick:()=>l(c.id),"aria-pressed":k,"aria-label":c.title,className:`tap-chip relative flex shrink-0 items-center transition-all cursor-pointer ${k?"space-x-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold bg-ink text-canvas shadow-sm":"p-2 rounded-lg text-ink/70 hover:bg-ink/5"}`,title:c.title,children:[e(mo,{panelId:c.id,builtin:c.builtin,icon:c.builtin?c.icon:void 0,name:c.builtin?c.label:c.name,...c.iconUrl?{iconUrl:c.iconUrl}:{},...c.color?{color:c.color}:{},size:Ut}),k&&e("span",{className:`shrink-0 whitespace-nowrap ${c.id==="git"?"tracking-wide":""}`,children:c.label}),c.id==="git"&&m&&e("span",{className:"absolute top-1 right-1 w-1.5 h-1.5 rounded-full bg-info",title:"Uncommitted changes"})]},c.id)})})}function ao({panels:t,activeId:r,onSelect:l,menuProps:m}){return e("div",{className:"px-3 py-1.5 border-b border-ink/10 bg-canvas flex-shrink-0",...m,children:e(Fe,{panels:t,activeId:r,onSelect:l})})}function lo({panelKey:t,panel:r,body:l}){if(!r)return e("div",{className:"flex-1 min-h-0",children:e(au,{panelKey:t})});return e("div",{className:"flex-1 min-h-0 overflow-hidden relative",children:e(Me,{fallback:e("div",{className:"h-full flex items-center justify-center text-ink/40",children:e("span",{className:"text-xs font-mono",children:"Loading…"})}),children:e(Fo,{value:l,children:r.render(l)})})})}var Ee="w-9.5 h-9.5 rounded-xl border flex items-center justify-center transition-all flex-shrink-0 cursor-pointer shadow-xs",De="border-ink/15 bg-paper hover:bg-ink/5 text-ink/80 hover:text-ink",co="bg-ink/10 text-ink border-ink/30";function po({searchQuery:t,sortOption:r,optionsOpen:l,showArchived:m,optionsRef:b,onNewSession:g,onNewWorkspace:x,onScheduler:v,scheduledCount:w,onRefresh:c,refreshing:k,onToggleOptions:y,onSortChange:N,onResetSort:M,onToggleArchived:T,onHideArchived:W,onSearchChange:C,onClearSearch:P,onSelectWorkspaces:A,selecting:D}){let{ref:O,width:R}=$s(0),B=DA(R),Y={};for(let q of dp.slice(0,B))Y[q]=!0;let z=dp.slice(B),L=m?"Hide archived sessions":"Show archived sessions",te=w>0?`Scheduled tasks (${w} armed)`:"Scheduled tasks",H=[];if(z.includes("new-workspace"))H.push({id:"new-workspace",label:"New Workspace",icon:yn,onSelect:x});if(z.includes("refresh"))H.push({id:"refresh",label:"Refresh sessions",icon:S,onSelect:c});if(z.includes("scheduler"))H.push({id:"scheduler",label:te,icon:ja,onSelect:v});if(z.includes("archive"))H.push({id:"archive",label:L,icon:dt,onSelect:T,active:m});if(z.includes("select"))H.push({id:"select",label:D?"Cancel selection":"Select workspaces",icon:Ur,onSelect:A,active:D});return e("div",{className:"p-3 border-b border-ink/10 flex flex-col space-y-2.5 flex-shrink-0 bg-canvas",children:[e("div",{ref:O,className:"flex items-center space-x-2",children:[e("button",{type:"button",onClick:g,"aria-label":"New Session",title:"New Session",className:"flex-1 min-w-0 h-9.5 flex items-center justify-center space-x-2 px-3.5 rounded-xl bg-ink text-canvas hover:bg-ink/90 text-xs font-semibold transition-all shadow-xs",children:[e(F,{size:15,strokeWidth:2.4,className:"shrink-0"}),e("span",{className:"min-w-0 truncate",children:"New Session"})]}),Y["new-workspace"]&&e("button",{type:"button",onClick:x,className:`${Ee} ${De}`,title:"New Workspace","aria-label":"New Workspace",children:e(yn,{size:16,strokeWidth:1.8})}),Y.scheduler&&e("button",{type:"button",onClick:v,className:`relative ${Ee} ${De}`,title:te,"aria-label":w>0?`Scheduled tasks, ${w} armed`:"Scheduled tasks",children:[e(ja,{size:16,strokeWidth:1.8}),w>0&&e("span",{className:"absolute -top-0.5 -right-0.5 min-w-[13px] h-[13px] px-[3px] rounded-full bg-ink text-canvas text-[10px] leading-[13px] text-center font-semibold",children:w>9?"9+":w})]}),Y.archive&&e("button",{type:"button",onClick:T,"aria-pressed":m,className:`${Ee} ${m?"bg-warning/15 border-warning/40 text-warning":De}`,title:L,"aria-label":L,children:e(dt,{size:16,strokeWidth:1.8})}),Y.select&&e("button",{type:"button",onClick:A,"aria-pressed":D,className:`${Ee} ${D?co:De}`,title:D?"Cancel selection":"Select workspaces","aria-label":D?"Cancel selection":"Select workspaces",children:e(Ur,{size:16,strokeWidth:1.8})}),Y.refresh&&e("button",{type:"button",onClick:c,className:`${Ee} ${De}`,title:"Refresh sessions","aria-label":"Refresh sessions","aria-busy":k,children:e(S,{size:15,strokeWidth:1.8,className:k?"animate-spin":void 0})}),Y.sort&&e("div",{className:"relative flex-shrink-0",ref:b,children:[e("button",{type:"button",onClick:y,className:`${Ee} ${l||r!=="A-Z"?co:De}`,title:"Sort workspaces","aria-label":"Sort workspaces",children:e(Os,{size:15,strokeWidth:1.8})}),l&&e("div",{className:"glass-popover absolute right-0 top-full mt-2 w-52 bg-paper border border-ink/15 rounded-xl shadow-xl z-50 p-2 text-xs",children:e(ei,{variant:"mobile",sortOption:r,onSortChange:N})})]}),z.length>0&&e($u,{actions:H,sortHidden:z.includes("sort"),sortOption:r,onSortChange:N,layout:"mobile"})]}),e("div",{className:"relative flex items-center",children:[e(U,{size:14,className:"absolute left-3 text-ink/40"}),e("input",{type:"text",value:t,onChange:(q)=>C(q.currentTarget.value),placeholder:"Search workspaces & sessions...",className:"w-full bg-paper border border-ink/15 rounded-xl pl-8 pr-8 py-2 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),t&&e("button",{type:"button",onClick:P,className:"absolute right-2.5 text-ink/40 hover:text-ink p-1","aria-label":"Clear search",children:e(h,{size:13})})]}),(m||r!=="A-Z")&&e("div",{className:"flex items-center space-x-1.5 flex-wrap gap-y-1 pt-0.5",children:[r!=="A-Z"&&e("span",{className:"inline-flex items-center space-x-1 bg-ink/5 border border-ink/10 text-ink/80 rounded-lg px-2 py-0.5 text-[10px] font-mono",children:[e("span",{children:["Sort: ",r.replace("_"," ")]}),e("button",{type:"button",onClick:M,className:"hover:text-ink ml-0.5",title:"Reset sort",children:e(h,{size:10})})]}),m&&e("span",{className:"inline-flex items-center space-x-1 bg-warning/15 border border-warning/25 text-warning rounded-lg px-2 py-0.5 text-[10px] font-mono",children:[e(dt,{size:10}),e("span",{children:"Archived"}),e("button",{type:"button",onClick:W,className:"hover:text-warning-hover ml-0.5",title:"Hide archived",children:e(h,{size:10})})]})]})]})}var kt="p-1.5 rounded-lg hover:bg-ink/10 active:bg-ink/15 text-ink/60 hover:text-ink";function uo({folder:t,canWorktree:r,onOpenFolder:l,onNewWorktree:m,onSelectSessions:b,confirmDelete:g,onPin:x,onDelete:v,onRequestDelete:w,onCancelDelete:c}){let[k,y]=n(!1),N=i(null),[M,T]=n(null),W=(C)=>()=>{y(!1),C()};return e("div",{className:"relative flex items-center",onClick:(C)=>C.stopPropagation(),children:[e("button",{ref:N,type:"button",onClick:(C)=>{if(C.stopPropagation(),N.current)T(It(N.current));y((P)=>!P)},className:kt,title:"Workspace options","aria-label":`Options for ${t.name}`,"aria-haspopup":"menu","aria-expanded":k,children:e(_e,{size:15})}),e(Rt,{anchor:k?M:null,align:"end",ariaLabel:`Options for ${t.name}`,className:"w-48 rounded-lg border border-ink/15 bg-paper py-1 text-xs shadow-lg",onClose:()=>{y(!1),c()},children:e(Ks,{variant:"mobile",isPinned:t.isPinned,onOpenFolder:l?W(l):void 0,onNewWorktree:r&&m?W(m):void 0,onSelectSessions:b?W(b):void 0,confirmDelete:g,onPin:W(x),onDelete:W(v),onRequestDelete:w,onCancelDelete:c})})]})}var ho={inset:"",insetPx:0,slotWidth:16,markGap:8,padding:"py-2",glyph:st.touch};function bo({session:t,harness:r,isActive:l,status:m,awaitingInput:b=!1,timeAgo:g,timeTitle:x,runStartedAt:v,expandable:w=!1,isExpanded:c=!1,onToggleExpand:k,isChild:y=!1,folderId:N,onSelect:M,onArchive:T,onDelete:W,onRename:C,onRenameWithAi:P,waitingFor:A,onCancelWait:D,selectable:O=!1,selected:R=!1,onToggleSelect:B}){let{isEditing:Y,draft:z,setDraft:L,inputRef:te,startRename:H,handleKeyDown:q,handleBlur:re}=qo(t.title,C),_=za(t.id),ne=Wo(),ie=ne.anchor!==null,ee=Boolean(C||T||W||D),J=Boolean(A),ce=w&&Boolean(k),Q=t.title.charAt(0).toUpperCase()+t.title.slice(1);if(Y)return e("div",{className:"w-full rounded-lg flex items-center bg-ink/10",children:e("input",{ref:te,autoFocus:!0,value:z,onChange:(oe)=>L(oe.currentTarget.value),onKeyDown:q,onBlur:re,className:"flex-1 min-w-0 mx-2 my-1.5 bg-paper border border-ink/25 rounded px-2 py-1 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.id),"data-menu-open":ie?"true":void 0,onContextMenu:ee&&!O?ne.openAtCursor:void 0,className:`w-full rounded-lg flex items-center transition-colors ${O&&R||ie?Ws:l?"bg-ink/10 font-medium text-ink":"hover:bg-ink/5 text-ink/85"}`,children:[e("button",{type:"button",onClick:O?B:M,className:"flex-1 text-left py-2 flex items-center justify-between min-w-0",children:[e("div",{className:"flex items-center min-w-0 pr-2",children:[O?e(Gr,{checked:R,label:`Select ${t.title}`,onChange:()=>B?.()}):e("span",{className:"w-4 flex-shrink-0 flex items-center justify-center",children:_?e("span",{role:"status","aria-label":"Generating a name…",children:e(p,{size:13,className:"text-ink/50 animate-spin"})}):b?e(Le,{size:13,className:"text-ink/70 animate-pulse"}):J?e("span",{role:"status","aria-label":`Waiting for ${A?.title??"another session"}`,children:e(Ke,{size:13,className:"text-ink/60 animate-pulse"})}):m==="stream"?e("span",{role:"status","aria-label":"Running",children:e(p,{size:13,className:"text-ink/50 animate-spin"})}):m?e(f,{size:13,className:"text-ink/50"}):y?e("span",{"data-testid":"child-indicator",className:"text-ink/35","aria-hidden":"true",children:e(de,{size:13})}):null}),e("span",{className:"flex flex-col min-w-0 ml-2 leading-snug",children:[e("span",{className:"flex min-w-0 items-center",children:[r&&e("span",{className:"mr-1.5 flex shrink-0 items-center",children:e(rt,{harness:r,size:st.touch})}),e("span",{className:"min-w-0 truncate text-xs",children:Q})]}),J&&e("span",{className:"text-[10px] text-ink/40 truncate",children:["waiting for ",A?.title??"another session"]}),t.worktree?e(js,{worktree:t.worktree}):null]})]}),e(qs,{timeAgo:g,timeTitle:x,runStartedAt:v,className:"text-[11px] font-mono flex-shrink-0 ml-2",restingClassName:"text-ink/45"})]}),ee&&!O&&e("button",{type:"button",onClick:ne.openBelow,title:"Session actions","aria-label":"Session actions","aria-haspopup":"menu","aria-expanded":ie,className:"flex-shrink-0 py-1.5 pl-1.5 pr-1 text-ink/35 hover:text-ink rounded-lg cursor-pointer",children:e(_e,{size:16})}),ce&&!O&&e("button",{type:"button",onClick:k,title:c?"Collapse sessions and subagents":"Expand sessions and subagents","aria-expanded":c,"aria-label":c?"Collapse sessions and subagents":"Expand sessions and subagents",className:"flex-shrink-0 py-1.5 pl-1.5 pr-1 flex items-center justify-center text-ink/50 hover:text-ink rounded-lg cursor-pointer",children:c?e(E,{size:14}):e(ue,{size:14})})]}),ne.anchor&&e(Ko,{anchor:ne.anchor,sessionId:t.id,...r?{harness:r}:{},...N!==void 0?{folderId:N}:{},isArchived:t.is_archived===1,onRename:C?H:void 0,onRenameWithAi:P,onArchive:T,onDelete:W,onCancelWait:D,onClose:ne.close})]})}function go(t,r){let[l,m]=n(!1);return{open:()=>m(!0),dialog:l?e(Vo,{isOpen:!0,onClose:()=>m(!1),root:t.project_path??null,folderId:t.id,folderName:t.name,onCreated:(b)=>{m(!1),r(b.path)}}):null}}function vo({hiddenCount:t,canShowLess:r,onShowMore:l,onShowLess:m}){if(t<=0&&!r)return null;return e("div",{className:"flex items-center gap-1",children:[t>0&&e("button",{type:"button",onClick:l,className:"flex items-center min-w-0 text-left py-2 pr-3 text-xs text-ink/60 hover:text-ink",children:[e("span",{className:"w-4 h-4 flex-shrink-0 flex items-center justify-center",children:e(E,{size:12})}),e("span",{className:"w-2 shrink-0"}),e("span",{className:"truncate",children:["Show more sessions (",t,")"]})]}),r&&e("button",{type:"button",onClick:m,className:"ml-auto shrink-0 flex items-center gap-1 text-xs text-ink/60 hover:text-ink pl-3 py-2",children:[e(pt,{size:12}),e("span",{className:"truncate",children:"Show less"})]})]})}function So(t){return t?"mb-4":"mb-1"}function xo({folder:t,activeSessionId:r,onSelectSession:l,onNewSessionForFolder:m,onNewWorktreeSession:b,isExpanded:g,onToggleExpand:x,showArchived:v=!1,sessionStatus:w={},onToast:c,batch:k,onStartSessionSelection:y,onCancelWait:N}){let{visibleCount:M,showMore:T,showLess:W,canShowLess:C}=Us(),P=go(t,(G)=>b?.(t.id,G)),{refresh:A,runStartedAtMap:D}=at(),{expandedSessionIds:O,toggleSession:R}=Ts(),[B]=le(),Y=B.get("subagent"),z=B.get("sessionId"),{confirmDelete:L,requestDelete:te,cancelDelete:H,handlePin:q,handleDelete:re,handleArchive:_,handleRename:ne,handleRenameWithAi:ie,handleOpenFolder:ee}=Gs(t,A,c),J=jo(),ce=q,Q=re,oe=ee??void 0,me=(t.sessions||[]).filter((G)=>v?G.is_archived===1:G.is_archived!==1),ke=pa(t.icon),{folderCheckbox:ge,sessionCheckboxes:be,folderSummary:V,toggleFolderSelection:j,rendered:Z,hiddenCount:ye}=Ys({batch:k,folder:t,sessions:me,showArchived:v,visibleCount:M,activeSessionId:r,sessionStatus:w}),Pe=ni(Z),Se=g||be,Ne=(G,Re)=>{let ve=String(G.id),je=String(r)===ve,ft=je&&z===ve&&Boolean(Y),ze=St(ve);return e(bo,{session:G,harness:G.harness,folderId:G.folder_id,isActive:je&&!ft,status:w[ve],awaitingInput:Boolean(G.awaitingInput),timeAgo:Hs(G.updated_at??G.created_at),timeTitle:ti(G.updated_at??G.created_at),runStartedAt:w[ve]==="stream"?D[ve]:void 0,expandable:Re.expandable,isChild:Re.isChild,isExpanded:Re.isExpanded,onToggleExpand:Re.onToggleExpand,onSelect:()=>l(G.id),onArchive:()=>_(G),onDelete:ze?void 0:()=>J.requestDelete(G),onRename:ze?void 0:(bt)=>void ne(G,bt),onRenameWithAi:ze?void 0:()=>void ie(G),waitingFor:G.waitingFor?{title:G.waitingFor.title}:void 0,onCancelWait:G.waitingFor?()=>N?.(G.waitingFor.waitId):void 0,selectable:be,selected:Boolean(k?.selected.includes(ve)),onToggleSelect:k?()=>k.toggle(ve):void 0})},ut=(G)=>Vs(G,Pe.childrenOf,O,R);return e("div",{className:So(Se),"data-testid":"session-folder",children:[e("div",{onClick:k?void 0:x,className:"flex items-center justify-between gap-2 py-1 cursor-pointer hover:bg-ink/5 rounded-lg select-none transition-colors",children:[e("div",{className:"flex items-center space-x-2 min-w-0",children:[ge&&V?e(Gr,{size:"md",checked:V.all,indeterminate:V.some,label:`Select ${t.name}`,onChange:j}):e(d,{children:e("span",{className:"w-4 h-4 flex items-center justify-center flex-shrink-0",children:t.customIconUrl?e("img",{src:t.customIconUrl,alt:"",className:"w-[15px] h-[15px] rounded-xs object-contain",referrerPolicy:"no-referrer"}):t.iconType==="chat"?e(tn,{size:15,className:"text-ink/80"}):e(ke,{size:15,className:"text-ink/80",style:{color:t.accentColor||void 0}})})}),e("span",{className:"text-sm font-semibold text-ink truncate",children:t.name})]}),e("div",{className:"flex items-center space-x-2 text-xs text-ink/60",children:[e("span",{className:"font-mono text-[11px] text-ink/70",children:me.length}),t.project_path&&e(de,{size:13,className:"text-ink/50 ml-1"}),!k&&e(d,{children:[e("button",{type:"button",onClick:(G)=>{G.stopPropagation(),m(t.id)},className:"p-1.5 rounded-lg hover:bg-ink/10 active:bg-ink/15 text-ink/60 hover:text-ink",title:"New Session","aria-label":`New session in ${t.name}`,children:e(F,{size:15})}),e(uo,{folder:t,canWorktree:Boolean(b&&t.project_path),onOpenFolder:oe,onNewWorktree:b?()=>P.open():void 0,onSelectSessions:y?()=>y(t.id):void 0,confirmDelete:L,onPin:ce,onDelete:Q,onRequestDelete:te,onCancelDelete:H}),e("span",{className:"flex items-center justify-center pr-1",children:g?e(E,{size:14}):e(ue,{size:14})})]})]})]}),Se&&e("div",{className:"mt-0.5 space-y-0.5",children:[Pe.roots.map((G)=>{let Re=String(G.id),ve=ut(G);return e("div",{className:"space-y-0.5",children:[Ne(G,ve),ve.isExpanded&&e(Mi,{parentId:Re,hasSubagents:Boolean(G.hasSubagents),childrenOf:Pe.childrenOf,expandedIds:O,onToggle:R,activeSessionId:r===null?null:String(r),renderSession:Ne,style:ho})]},G.id)}),e(vo,{hiddenCount:be?0:ye,canShowLess:!be&&C,onShowMore:T,onShowLess:W})]}),e(Ho,{session:J.pending,isDeleting:J.isDeleting,error:J.error,onClose:J.cancelDelete,onConfirm:()=>void J.confirmDelete()}),P.dialog]})}function wo({folders:t,activeSessionId:r,expandedFolders:l,showArchived:m,sessionStatus:b,onSelectSession:g,onNewSessionForFolder:x,onNewWorktreeSession:v,onToggleFolder:w,onToast:c,batch:k,onStartSessionSelection:y,onCancelWait:N}){return e("div",{className:"flex-1 scrollbar-overlay-container pl-3 pr-2 py-3",children:t.length===0?e("div",{className:"text-center py-12 text-xs text-ink/50 italic",children:"No matching sessions found"}):t.map((M)=>e(xo,{folder:M,activeSessionId:r,onSelectSession:g,onNewSessionForFolder:x,onNewWorktreeSession:v,isExpanded:l[M.id]??!0,onToggleExpand:()=>w(M.id),showArchived:m,sessionStatus:b,onToast:c,batch:k,onStartSessionSelection:y,onCancelWait:N},M.id))})}var yt=[3,2];function ko(){return e("div",{className:"flex-1 p-3 space-y-4","aria-hidden":"true",children:yt.map((t,r)=>e("div",{className:"space-y-2",children:[e("div",{className:"flex items-center gap-2 py-2",children:[e("span",{className:"w-4 h-4 rounded-sm animate-pulse bg-ink/10"}),e("span",{className:"h-3 w-24 rounded animate-pulse bg-ink/10"})]}),Array.from({length:t},(l,m)=>e("div",{className:"flex items-center gap-2 rounded py-2",children:[e("span",{className:"w-4 h-4 rounded-full animate-pulse bg-ink/10"}),e("span",{className:"h-3 rounded animate-pulse bg-ink/10",style:{width:`${58-m%3*12}%`}})]},m))]},r))})}function yo({folders:t,initializing:r,failed:l,activeSessionId:m,expandedFolders:b,sessionStatus:g,searchQuery:x,sortOption:v,optionsOpen:w,showArchived:c,harnessFilter:k,onHarnessFilterChange:y,harnessOptions:N,optionsRef:M,scheduledCount:T,refreshing:W,selecting:C,batch:P,onNewSession:A,onNewWorkspace:D,onScheduler:O,onRefresh:R,onToggleOptions:B,onSortChange:Y,onResetSort:z,onToggleArchived:L,onHideArchived:te,onSearchChange:H,onClearSearch:q,onSelectWorkspaces:re,onSelectSession:_,onNewSessionForFolder:ne,onNewWorktreeSession:ie,onToggleFolder:ee,onToast:J,onStartSessionSelection:ce,onCancelWait:Q}){return e(d,{children:[e(po,{searchQuery:x,sortOption:v,optionsOpen:w,showArchived:c,optionsRef:M,onNewSession:A,onNewWorkspace:D,onScheduler:O,scheduledCount:T,onRefresh:R,refreshing:W,onToggleOptions:B,onSortChange:Y,onResetSort:z,onToggleArchived:L,onHideArchived:te,onSearchChange:H,onClearSearch:q,onSelectWorkspaces:re,selecting:C}),e("div",{className:"px-3 pt-2 pb-1",children:e(zs,{options:N,value:k,onChange:y,touch:!0})}),l?e(Js,{touch:!0,onRetry:R,refreshing:W}):r?e(ko,{}):e(wo,{folders:t,activeSessionId:m,expandedFolders:b,showArchived:c,sessionStatus:g,onSelectSession:_,onNewSessionForFolder:ne,onNewWorktreeSession:ie,onToggleFolder:ee,onToast:J,batch:P,onStartSessionSelection:ce,onCancelWait:Q})]})}function No({sidebarStyle:t,controller:r,batch:l,dock:m,dockBody:b,expandedFolders:g,optionsRef:x,activeSessionId:v,scheduledCount:w,onToggleFolder:c,onNewSession:k,onNewWorkspace:y,onScheduler:N,onToggleArchived:M,onNewSessionForFolder:T,onNewWorktreeSession:W,onToast:C,onArchiveSelected:P,onCancelWait:A}){let{initializing:D,failed:O,refreshNow:R,isRefreshing:B,searchQuery:Y,setSearchQuery:z,showArchived:L,setShowArchived:te,optionsOpen:H,setOptionsOpen:q,sortOption:re,handleSortChange:_,harnessFilter:ne,setHarnessFilter:ie,harnessOptions:ee,processedFolders:J,sessionStatus:ce,handleSelectSession:Q}=r,{selection:oe,deleteRun:me,archiveRun:ke,binding:ge,scopeFolder:be,available:V,selected:j}=l,Z={className:"flex-1 min-h-0 w-full",folders:J,initializing:D,failed:O,activeSessionId:v,sessionStatus:ce,searchQuery:Y,onSearchChange:z,showArchived:L,onToggleArchived:M,sortOption:re,optionsOpen:H,onToggleOptions:()=>q(!H),onCloseOptions:()=>q(!1),onSortChange:_,harnessFilter:ne,onHarnessFilterChange:ie,harnessOptions:ee,onRefresh:R,refreshing:B,scheduledCount:w,onNewSession:k,onNewWorkspace:y,onScheduler:N,onSelectSession:Q,onNewSessionForFolder:T,onNewWorktreeSession:W,onToast:C,onCancelWait:A,batch:ge,onSelectWorkspaces:l.toggleWorkspaceSelection,onStartSessionSelection:(ye)=>oe.begin("session",ye)};return e(d,{children:[e("div",{className:m.showingSessions?"contents":"hidden",children:[t==="modern"?e(zu,{...Z,touch:!0}):e(yo,{folders:J,initializing:D,failed:O,activeSessionId:v,expandedFolders:g,sessionStatus:ce,searchQuery:Y,sortOption:re,optionsOpen:H,showArchived:L,harnessFilter:ne,onHarnessFilterChange:ie,harnessOptions:ee,optionsRef:x,scheduledCount:w,refreshing:B,selecting:oe.mode!==null,batch:ge,onNewSession:k,onNewWorkspace:y,onScheduler:N,onRefresh:R,onToggleOptions:()=>q(!H),onSortChange:_,onResetSort:()=>_("A-Z"),onToggleArchived:M,onHideArchived:()=>te(!1),onSearchChange:z,onClearSearch:()=>z(""),onSelectWorkspaces:l.toggleWorkspaceSelection,onSelectSession:Q,onNewSessionForFolder:T,onNewWorktreeSession:W,onToggleFolder:c,onToast:C,onStartSessionSelection:(ye)=>oe.begin("session",ye),onCancelWait:A}),oe.mode&&e(qu,{drawer:!0,mode:oe.mode,count:j.length,total:V.length,busy:me.isDeleting,archiving:ke.isArchiving,scopeLabel:be?.name,onSelectAll:()=>oe.selectAllOf(V),onUnselectAll:()=>oe.unselectAllOf(V),onDelete:()=>me.request(j),onArchive:P,onCancel:oe.end})]}),m.showingSessions?null:e(lo,{panelKey:m.activeView,panel:m.activePanel,body:b})]})}function Co(t,r){let l=t.tabs;Qs({enabled:t.tabsMode,revealed:Pf(r),storedView:t.activeView,home:l?.home??!1,chosenHome:l?.chosenHome??!1,openTab:l?.open??null,known:new Set(t.catalog.map((g)=>g.id))});let m=i(!1),b=l?{...l,select:(g)=>{m.current=!0,l.select(g)},open:(g)=>{m.current=!0,l.open(g)},close:(g)=>{m.current=!0,l.close(g)}}:null;return o(()=>{if(!t.tabsMode||!l)return;if(l.active!==null&&l.active!==t.activeView)t.setActiveView(l.active)},[t.tabsMode,l?.active,t.activeView,t.setActiveView]),o(()=>{if(!t.tabsMode||!l)return;if(m.current){m.current=!1;return}if(l.tabs.includes(t.activeView))return;if(!t.catalog.some((g)=>g.id===t.activeView))return;l.open(t.activeView)},[t.tabsMode,l,t.activeView,t.catalog]),{tabs:b}}function Ie(t){return{dragRegion:!0,layout:"mobile",rootProps:{...Ua(),...t},style:{paddingLeft:Ti(Si("0.75rem",!0)),paddingRight:Fl("0.75rem",!0)}}}function Po({side:t,onClose:r}){let l=t==="left"?un:ir;return e("button",{type:"button",onClick:r,className:`${Ve.mobile} flex-none cursor-pointer rounded-lg text-ink/60 transition-colors hover:bg-ink/5 hover:text-ink titlebar-no-drag`,title:t==="left"?"Tutup panel kiri":"Tutup panel kanan","aria-label":t==="left"?"Close left sidebar":"Close right sidebar",children:e(l,{size:Pr.mobile,strokeWidth:1.8})})}function Ro({activeSessionId:t,newWorkspaceOpen:r,onCloseNewWorkspace:l,schedulerOpen:m,onCloseScheduler:b,aboutOpen:g,onCloseAbout:x,updates:v,pushToast:w,batchDelete:c,batchMode:k,onEndBatch:y,scopeLabel:N}){return e(d,{children:[e(Bs,{isOpen:r,onClose:l,onCreate:Rl,onClone:Ll}),e(Ou,{isOpen:m,onClose:b,activeSessionId:t===null?null:String(t),onToast:w}),e(Od,{isOpen:g,onClose:x,updates:v,onToast:w}),e($f,{updates:v}),e(Wu,{mode:k??"session",count:c.pending.length,scopeLabel:N,isDeleting:c.isDeleting,progress:c.progress,outcome:c.outcome,onClose:()=>{let M=c.outcome?.refused.length??0;if(c.cancel(),c.outcome&&M===0)y()},onConfirm:()=>{let M=k??"session";c.confirm(M).then((T)=>{if(T&&T.refused.length===0)y()})}})]})}function To(){let t=Qt(),r=dr("left"),[l,m]=io("layout.mobileLeftPanel",Qe),b=Lf(l,t.enabled),g=rp("left"),x=t.enabled&&g==="tabs",v=u(()=>new Set(r.map((c)=>c.id)),[r]),w=Ns("left",v,Qe);return{catalog:r,activeView:b,setActiveView:m,showingSessions:b===Qe,activePanel:r.find((c)=>c.id===b),enabled:t.enabled,tabsMode:x,tabs:x?w:null}}function Eo(t){return{className:"w-full h-full",sessionId:t.sessionId===null?null:String(t.sessionId),enabled:t.requiresWorkspace?t.hasActiveContext===!0:!0,active:!0,refreshKey:t.refreshKey,...t.rootPath?{rootPath:t.rootPath}:{},...t.onRefresh?{onRefresh:t.onRefresh}:{},...t.onOpenFile?{onOpenFile:t.onOpenFile}:{},onClose:t.onClose,showHeader:!1,layout:"phone"}}function Do({appSettings:t,onSelectSession:r,onClose:l,rootPath:m,refreshKey:b,onRefresh:g,onOpenFile:x}){let v=Uu(t,{onSelectSession:r,onAfterSelect:l}),{folders:w,processedFolders:c,refreshNow:k,showArchived:y,activeSessionId:N}=v,M=Hu(c,y,k),[T,W]=n({1:!0,2:!0,3:!0}),C=i(null);he(C,()=>v.setOptionsOpen(!1));let P=(R)=>{W((z)=>({...z,[R]:!z[R]}));let B=w.find((z)=>z.id===R),Y=!(T[R]??B?.isExpanded??!0);pp(R,Y)},A=c.map((R)=>`${R.id}:${R.isExpanded}`).join("|");o(()=>{W(Object.fromEntries(c.map((R)=>[R.id,R.isExpanded])))},[A]);let D=To(),O=Eo({sessionId:N,refreshKey:b,rootPath:m,onRefresh:g,onOpenFile:x,onClose:l,requiresWorkspace:D.activePanel?.requiresWorkspace??!1,hasActiveContext:Boolean(m)});return{controller:v,batch:M,expandedFolders:T,toggleFolder:P,optionsRef:C,dock:D,dockBody:O}}function Be(t){let{disabledPanels:r}=kn(),{setEnabled:l}=Sl(),m=Ae(),b=Ff(t),g=a((x,v)=>{l(x,v)},[l]);return{...m,items:b,hidden:r,toggle:g}}function Ao({activeSessionId:t,onSelectSession:r,onNewSession:l,onNewSessionForFolder:m,onNewWorktreeSession:b,onClose:g,onDesktopToggle:x,appSettings:v={},rootPath:w,refreshKey:c=0,onRefresh:k,onOpenFile:y,revealSignal:N=0}){let{controller:M,batch:T,expandedFolders:W,toggleFolder:C,optionsRef:P,dock:A,dockBody:D}=Do({appSettings:v,onSelectSession:r,onClose:g,rootPath:w,refreshKey:c,onRefresh:k,onOpenFile:y}),{showArchived:O,setShowArchived:R}=M,{selection:B,deleteRun:Y,archiveRun:z,selected:L,scopeFolder:te}=T,H=Ed(),q=Be("left"),[re,_]=n(!1),[ne,ie]=n(!1),ee=Pu(),[J,ce]=n(!1),{pushToast:Q}=We(),oe=Ql(Q);Gu({onNotice:Q});let{updates:me,shellDownload:ke}=no({onClose:g,openAbout:()=>ce(!0),pushToast:Q}),{tabs:ge}=Co(A,N),be=()=>{l(),g()},V=()=>{z.archive(L).then((Se)=>{if(!Se)return;let Ne=ju(Se);if(Ne)Q(Ne.message,Ne.tone);if(!Se.error)B.end()})},j=(Se)=>{m(Se),g()},Z=()=>{R(!O)},ye=b?(Se,Ne)=>{b(Se,Ne),g()}:void 0,Pe=e(No,{sidebarStyle:H,controller:M,batch:T,dock:A,dockBody:D,expandedFolders:W,optionsRef:P,activeSessionId:t,scheduledCount:ee,onToggleFolder:C,onNewSession:be,onNewWorkspace:()=>_(!0),onScheduler:()=>ie(!0),onToggleArchived:Z,onNewSessionForFolder:j,...ye?{onNewWorktreeSession:ye}:{},onToast:Q,onArchiveSelected:V,onCancelWait:oe});return e("div",{className:"flex flex-col h-full w-full bg-canvas text-ink relative select-none",children:[e(oo,{onClose:g,viewLabel:A.showingSessions?"Sessions":A.activePanel?.label??"Panel",menuProps:q.surfaceProps}),!A.tabsMode&&so(A.enabled)?e(ao,{panels:A.catalog,activeId:A.activeView,onSelect:A.setActiveView,menuProps:q.surfaceProps}):null,A.tabsMode&&ge?e("div",{className:"flex-1 min-h-0 flex flex-col",children:e(Ds,{catalog:A.catalog,tabs:ge,pinned:Qe,homeTitle:"Panel kiri",stripProps:Ie(q.surfaceProps),children:e("div",{className:"h-full w-full",children:Pe})})}):null,q.anchor?e(Yo,{anchor:q.anchor,items:q.items,hidden:q.hidden,onToggle:q.toggle,onClose:q.close}):null,A.tabsMode?null:e("div",{className:"contents",children:Pe}),e(to,{onSettings:()=>window.dispatchEvent(new CustomEvent("omp:open-settings",{detail:{}})),onKeyBindings:Dc,onAbout:()=>ce(!0),shellDownload:ke,onDesktopToggle:x,updateAvailable:me.hasUpdate,onUpdateClick:()=>{ce(!0),me.check()}}),e(Ro,{activeSessionId:t,newWorkspaceOpen:re,onCloseNewWorkspace:()=>_(!1),schedulerOpen:ne,onCloseScheduler:()=>ie(!1),aboutOpen:J,onCloseAbout:()=>ce(!1),updates:me,pushToast:Q,batchDelete:Y,batchMode:B.mode,onEndBatch:B.end,scopeLabel:te?.name})]})}function Io({catalog:t,activeId:r,onSelect:l,hasGitChanges:m,onClose:b,menuProps:g}){return e("div",{className:"border-b border-ink/10 flex items-center justify-between px-3 flex-shrink-0 bg-canvas titlebar-drag-region select-none",...Ua(),...g,style:Zo(),children:[e("div",{className:"flex items-center min-w-0 titlebar-no-drag",children:e(Fe,{panels:t,activeId:r,onSelect:l,hasGitChanges:m})}),e("button",{type:"button",onClick:b,className:"p-1.5 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink transition-colors flex-shrink-0 ml-2 titlebar-no-drag",title:"Close right sidebar","aria-label":"Close right sidebar",children:e(h,{size:20,strokeWidth:1.8})})]})}function Ue({panel:t,body:r}){if(!t)return e("div",{className:"h-full flex items-center justify-center text-ink/40",children:e("span",{className:"text-xs font-mono text-muted",children:"No session selected"})});return e(Me,{fallback:e("div",{className:"h-full flex items-center justify-center text-ink/40",children:e("span",{className:"text-xs font-mono",children:"Loading…"})}),children:e(Fo,{value:r,children:t.render(r)})})}function Lo({enabled:t=!0,rootPath:r,refreshKey:l=0,onRefresh:m,onOpenFile:b,onClose:g,revealSignal:x=0}){let[v,w]=io("layout.mobileRightPanel",Bc),{sessionId:c}=He(),k=Qt(),y=ro(dr("all"),Qe,k.enabled),N=y.find((_)=>_.id===v)??y[0],T=rp("right")==="tabs",W=u(()=>new Set(y.map((_)=>_.id)),[y]),C=Ns("right",W,null),P=we(c,"layout.mobileRightPanel")!==void 0;Qs({enabled:T,revealed:Pf(x),storedView:P?v:null,home:C.home,chosenHome:C.chosenHome,openTab:C.open,known:W});let{open:A,tabs:D}=C,O=(_)=>{if(_!==N?.id)Te(_)},R=i(!1),B={...C,select:(_)=>{R.current=!0,O(_),C.select(_)},open:(_)=>{R.current=!0,O(_),C.open(_)},close:(_)=>{R.current=!0,C.close(_)}};o(()=>{if(!T)return;if(C.active!==null&&C.active!==v)w(C.active)},[T,C.active,v,w]),o(()=>{if(!T||C.home)return;if(R.current){R.current=!1;return}if(!P)return;if(D.includes(v)||!W.has(v))return;A(v)},[T,C.home,P,v,D,A,W]);let Y=Sm(r,t),{changes:z}=hl(r,Y,t),L=z.length>0,te=a((_)=>{if(_!==N?.id)Te(_);w(_)},[N?.id,w]);o(()=>{if(!$e(N?.id))Qc()},[N?.id]);let H=Be(k.enabled?"right":"all"),q=k.enabled?H.items:H.items.filter((_)=>_.id!==Qe),re={className:"h-full w-full",enabled:t||!N?.requiresWorkspace,active:!0,refreshKey:l,...r?{rootPath:r}:{},onRefresh:m,onOpenFile:b,onClose:g,showHeader:!1,layout:"phone"};return e("div",{className:"flex flex-col h-full w-full bg-paper text-ink relative select-none",children:[T?null:e(Io,{catalog:y,activeId:N?.id??v,onSelect:te,hasGitChanges:L,onClose:g,menuProps:H.surfaceProps}),T?e("div",{className:"flex-1 min-h-0 flex flex-col",children:e(Ds,{catalog:y,tabs:B,homeTitle:"Panel kanan",stripProps:Ie(H.surfaceProps),actions:e(Po,{side:"right",onClose:g}),children:e("div",{className:"h-full w-full",children:e(Ue,{panel:N,body:re})})})}):null,H.anchor?e(Yo,{anchor:H.anchor,align:"right",items:q,hidden:H.hidden,onToggle:H.toggle,onClose:H.close}):null,T?null:e("div",{className:"flex-1 min-h-0 overflow-hidden relative",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:e(Ue,{panel:N,body:re})})]})}function Ce({label:t,onClick:r,active:l=!1,danger:m=!1,children:b}){let g=m?"bg-error text-canvas hover:bg-error/90":l?"bg-ink text-canvas":"text-ink/70 hover:bg-ink/10 hover:text-ink";return e("button",{type:"button",onClick:r,title:t,"aria-label":t,"aria-pressed":l||void 0,className:`${Ve.mobile} flex-none cursor-pointer rounded-lg transition-colors ${g}`,children:b})}var xe=Pr.mobile;function Bo({actions:t}){let[r,l]=n(!1),m=i(null);return he(m,()=>l(!1),r),o(()=>{if(!r)return;let b=(g)=>{if(g.key==="Escape")l(!1)};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[r]),e("div",{className:"relative flex-none",ref:m,children:[e("button",{type:"button",onClick:()=>l((b)=>!b),title:"More file actions","aria-label":"More file actions","aria-haspopup":"menu","aria-expanded":r,className:`${Ve.mobile} flex-none cursor-pointer rounded-lg text-ink/70 transition-colors hover:bg-ink/10 hover:text-ink`,children:e(_e,{size:Pr.mobile})}),r?e("div",{role:"menu","aria-label":"File actions",className:"absolute right-0 top-full z-50 mt-1 w-52 overflow-hidden rounded-xl border border-ink/15 bg-paper py-1 text-xs shadow-lg",children:t.map((b)=>{let g=b.icon;return e("button",{type:"button",role:"menuitem",onClick:()=>{l(!1),b.onSelect()},className:"flex w-full items-center gap-2 px-3 py-2.5 text-left text-ink/80 transition-colors hover:bg-ink/5 hover:text-ink",children:[e(g,{size:15,className:"flex-none text-ink/60"}),e("span",{className:"truncate",children:b.label})]},b.id)})}):null]})}var Ct=420;function _o({fileName:t,hasPreview:r,isPreview:l,hasReview:m,isReviewing:b,onToggleReview:g,wordWrap:x,copied:v,byteViewer:w=!1,missing:c=!1,onSave:k,onClose:y,onTogglePreview:N,onToggleFind:M,findOpen:T,onToggleWrap:W,onZoomOut:C,onZoomIn:P,onCopy:A,onDownload:D}){let O=iu(Ct),R=u(()=>{let B=[];if(!w)B.push({id:"wrap",label:x?"Word wrap: on":"Word wrap: off",icon:dn,onSelect:W},{id:"zoom-out",label:"Decrease font size",icon:Ka,onSelect:C},{id:"zoom-in",label:"Increase font size",icon:Wa,onSelect:P});if(!O)B.push({id:"copy",label:v?"Copied":"Copy content",icon:v?f:ae,onSelect:A},{id:"download",label:"Download file",icon:fe,onSelect:D});return B},[w,O,x,v,W,C,P,A,D]);return e("header",{className:"bg-canvas border-b border-ink/10 flex items-center justify-between gap-1 px-3 flex-shrink-0 titlebar-drag-region",style:Zo(),children:[e("div",{className:"flex items-center gap-1 min-w-0 titlebar-no-drag",children:[e(Ce,{label:"Close editor",onClick:y,children:e(pn,{size:xe,strokeWidth:2})}),e("div",{className:"flex min-w-0 items-center gap-1.5",children:[e(mt,{name:t,size:15,className:`flex-shrink-0${c?" text-error":""}`}),e("span",{className:`truncate font-semibold text-xs${c?" text-error line-through":" text-ink"}`,children:t})]})]}),e("div",{className:"flex flex-none items-center gap-0.5 text-ink/70 titlebar-no-drag",children:[c&&k&&e(Ce,{label:"Save and recreate the file",onClick:k,danger:!0,children:e(ht,{size:xe})}),!w&&e(Ce,{label:T?"Close find":"Find in file",onClick:M,active:T,children:e(U,{size:xe})}),m&&e(Ce,{label:b?"Exit review mode":"Review this document",onClick:g,active:b,children:e(tn,{size:xe})}),r&&e(Ce,{label:l?"View source":"Show preview",onClick:N,active:l,children:l?e(Nt,{size:xe}):e(et,{size:xe})}),O&&e(d,{children:[e(Ce,{label:"Copy content",onClick:A,children:v?e(f,{size:xe,className:"text-success"}):e(ae,{size:xe})}),e(Ce,{label:"Download file",onClick:D,children:e(fe,{size:xe})})]}),R.length>0&&e(Bo,{actions:R})]})]})}function zo({fileName:t,content:r,path:l,root:m,repo:b,fontSize:g,scrollRef:x,onScroll:v,isLoading:w,unsupported:c,loadError:k,reviewActive:y,onExitReview:N}){return e("div",{ref:x,onScroll:v,"data-testid":"editor-scroller",className:"flex-1 min-h-0 overflow-auto relative bg-paper text-ink select-text",children:w?e("div",{className:"flex items-center justify-center h-full text-ink/40 text-xs gap-2",children:[e(p,{size:14,className:"animate-spin"}),e("span",{children:"Loading file content..."})]}):c?e("div",{className:"flex flex-col items-center justify-center h-full gap-2 px-6 text-center",children:[e(uu,{size:20,className:"text-ink/40"}),e("span",{className:"text-xs text-ink/70 font-sans",children:[t," cannot be opened here"]}),e("span",{className:"text-[11px] text-ink/50 font-sans max-w-[42ch]",children:c})]}):k?e("div",{className:"flex flex-col items-center justify-center h-full gap-2 px-6 text-center",children:[e(I,{size:20,className:"text-error"}),e("span",{className:"text-xs text-error font-sans",children:["Could not read ",t]}),e("span",{className:"text-[11px] text-ink/50 font-mono break-all",children:k})]}):e("div",{className:"p-4 bg-paper text-ink min-h-full font-sans",style:{fontSize:`${g}px`},children:e(pu,{content:r,file:{name:t,path:l,root:m,repo:b},active:y,onExit:N})})})}function $o({file:t,editor:r,viewerKind:l,byteViewer:m,isPreview:b,isMd:g,content:x,language:v,wordWrap:w,fileKey:c,revealMarks:k,currentMark:y,surfaceRef:N,setCodeScroller:M,previewRef:T,scroll:W,fontSize:C,reviewActive:P,onExitReview:A,editorTheme:D,editorFontFamily:O,indentUnitText:R,typing:B}){let Y=a(async(z)=>{let L=await bu(t,z,{interactive:!0,baseMtimeMs:r.baseMtimeMs});if(L.status==="written")return{ok:!0};if(L.status==="conflict")return{ok:!1,error:"This file changed on disk since it was opened."};if(L.status==="needs-permission")return{ok:!1,error:"Tap Save again to grant write access."};return{ok:!1,error:L.error}},[t,r.baseMtimeMs]);if(r.isImage&&r.imageUrl)return e(Ri,{src:r.imageUrl,name:t.name,className:"flex-1 min-h-0"});if(r.isImage||hu(l)&&(m||b))return e($l,{kind:l,path:t.path??t.name,name:t.name,source:r.byteSource,content:r.content,root:t.root,repo:t.repo,revision:r.revision,onContentChange:r.onChange,onSaveBytes:r.deviceBacked?void 0:Y,onDirtyChange:r.setBinaryDirty});if(r.isLoading||r.unsupported||r.loadError||g&&b)return e(zo,{fileName:t.name,content:x,path:t.path??t.name,root:t.root,repo:t.repo,fontSize:C,scrollRef:T,onScroll:W.onScroll,isLoading:r.isLoading,unsupported:r.unsupported,loadError:r.loadError,reviewActive:P,onExitReview:A});return e(fu,{ref:N,value:x,onValueChange:r.onChange,language:v,wordWrap:w,documentKey:c,marks:k,currentMark:y,onScroller:M,scrollTestId:"editor-scroller",className:"flex-1 min-h-0 text-ink select-text",themeVars:D.vars,themes:D.themes,indentUnitText:R,typing:B,padding:12,placeholder:"This file is empty",style:{fontFamily:O,fontSize:`${C}px`,lineHeight:ys}})}function Go(){return e("div",{className:"flex items-start gap-2 px-3 py-2 border-b border-error/30 bg-error/10 text-error shrink-0",children:[e(I,{size:14,className:"shrink-0 mt-0.5"}),e("div",{className:"min-w-0",children:[e("div",{className:"text-[11.5px] font-sans",children:"This file was deleted from disk."}),e("div",{className:"text-[11px] font-sans text-error/80",children:"The buffer is still here. Saving recreates the file — autosave is off until then."})]})]})}function Jo({isImage:t,byteViewer:r,viewerKind:l,lineCount:m,charCount:b,language:g,saveStatus:x,path:v,conflicts:w=0}){return e("footer",{className:"bg-canvas border-t border-ink/10 px-3 flex items-center justify-between text-[10px] text-ink/60 flex-shrink-0 font-mono",style:{height:"calc(1.75rem + env(safe-area-inset-bottom, 0px))",paddingBottom:"env(safe-area-inset-bottom, 0px)",paddingLeft:"max(0.75rem, env(safe-area-inset-left, 0px))",paddingRight:"max(0.75rem, env(safe-area-inset-right, 0px))"},children:[e("div",{className:"flex items-center space-x-3",children:t?e("span",{className:"uppercase",children:"Image"}):r?e("span",{className:"uppercase",children:Xo[l]}):e(d,{children:[w>0&&e("span",{className:"text-error font-semibold tabular-nums",children:["⚠ ",w]}),e("span",{children:[m," lines"]}),e("span",{children:[b," chars"]}),e("span",{className:"uppercase",children:g})]})}),e("div",{className:"flex items-center space-x-2",children:[x==="saving"&&e(d,{children:[e(p,{size:10,className:"animate-spin"}),e("span",{children:"Saving…"})]}),x==="saved"&&e(d,{children:[e("span",{className:"w-1.5 h-1.5 rounded-full bg-success"}),e("span",{children:"Saved"})]}),x==="error"&&e(d,{children:[e("span",{className:"w-1.5 h-1.5 rounded-full bg-error"}),e("span",{className:"text-error",children:"Save failed"})]}),x==="idle"&&v&&e("span",{className:"truncate max-w-[140px]",children:v})]})]})}function Qo({path:t,content:r,ready:l,surfaceRef:m}){let b=Bu(t,r,l),g=i(null);return o(()=>{if(!b||g.current===b.request)return;g.current=b.request;let x=b.matches[b.currentIndex];if(!x)return;m.current?.select(x.start,x.end,!1),m.current?.revealOffset(x.start)},[b,m]),{matches:b?.matches??[],currentIndex:b?.currentIndex??-1}}function ot({path:t,content:r,documentKey:l,ready:m,surfaceRef:b,toggleWordWrap:g}){let x=Qo({path:t,content:r,ready:m,surfaceRef:b}),v=Eu({text:r,documentKey:l,readSelection:()=>b.current?.getSelection()??null,select:(w,c,k=!0)=>b.current?.select(w,c,k),reveal:(w)=>b.current?.revealOffset(w),applyDocument:(w,c,k)=>b.current?.applyDocument(w,c,k),toggleWordWrap:g});if(v.open&&v.matches.length>0)return{find:v,revealMarks:v.matches,currentMark:v.currentIndex};return{find:v,revealMarks:x.matches.length>0?x.matches:void 0,currentMark:x.currentIndex}}function tt({path:t,symbols:r,total:l,truncated:m,emptyNotice:b,preview:g=!1}){let[x,v]=n(!1);if(!t)return null;let w=(c,k)=>{if(v(!1),g){let y=Td(r,k);if(y)fs({path:t,...y});return}Mo({path:t,line:c.line,column:c.column,length:c.name.length})};return e(d,{children:[e("div",{className:"absolute bottom-14 right-3 z-20",children:e("button",{type:"button",onClick:()=>v(!0),"aria-label":`Outline (${l} symbols)`,title:"Outline",className:"flex h-9 w-9 items-center justify-center rounded-full border border-ink/20 bg-paper text-ink/60 shadow-sm transition-all hover:bg-ink/5 hover:text-ink",children:e(ia,{size:16})})}),x&&e(X,{onClose:()=>v(!1),maxWidthClass:"max-w-sm",zClass:"z-[70]",header:e("div",{className:"flex min-w-0 items-center gap-2",children:[e(ia,{size:15,className:"flex-shrink-0 text-ink/50"}),e("span",{className:"text-sm font-medium",children:"Outline"}),e("span",{className:"font-mono text-[11px] text-ink/40",children:m?`${r.length}/${l}`:l})]}),children:e("div",{className:"max-h-[60vh] overflow-y-auto scrollbar-overlay-container py-1",children:[r.length===0?e("div",{className:"px-4 py-3 text-[11px] italic text-ink/40",children:b}):r.map((c,k)=>e("button",{type:"button",onClick:()=>w(c,k),"aria-label":g?`${di(c.kind)} ${c.name}`:`${di(c.kind)} ${c.name}, line ${c.line}`,className:"flex w-full min-w-0 items-center gap-2 px-4 py-2 text-left transition-colors hover:bg-ink/5 active:bg-ink/10",style:{paddingLeft:`${16+c.depth*12}px`},children:[e(vd,{kind:c.kind,size:13}),e("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-ink",children:c.name}),!g&&e("span",{className:"flex-shrink-0 font-mono text-[10px] text-ink/40",children:c.line})]},`${c.line}:${c.kind}:${c.name}`)),m&&e("div",{className:"px-4 py-2 text-[11px] italic text-ink/40",children:kd(l)})]})})]})}function nt({file:t,missing:r=!1,onClose:l,onFileSaved:m,onDropResult:b}){let g=Fs(t.path??t.name),[x,v]=n({}),[w,c]=n(Oo),[k,y]=n(!0),N=Uo(),M=Li(),T=Lu(),W=Mu(),C=g==="markdown",P=Ls[g]===!0,A=ku[g]===!0,D=t.path??t.name,O=x[D]??xu(g),R=Du(String(D)),B=C&&O,Y=()=>v((Z)=>({...Z,[D]:!O})),z=su({enabled:Boolean(t.root),onResult:b}),L=Cu(t,{flushOnUnmount:!0,reportSaveError:!0,downloadMimeType:"text/plain;charset=utf-8",onFileSaved:m,missing:r}),[te,H]=n(null),q=Zs({tabKey:D,surface:C&&O?"rendered":"code",ready:L.loaded,slot:q0,element:C&&O?void 0:te}),[re,_]=n(null),ne=a((Z)=>{q.ref(Z),_(Z)},[q.ref]);Au({path:t.path??null,scroller:re,preview:C&&O});let ie=i(null),{find:ee,revealMarks:J,currentMark:ce}=ot({path:t.path??null,content:L.content,documentKey:`${D}\x00${L.language}`,ready:L.loaded&&!L.loadError,surfaceRef:ie,toggleWordWrap:()=>y((Z)=>!Z)}),{content:Q,language:oe}=L,me=Q.split(`
|
|
2
|
-
`).length,ke=mu(Q);Iu({file:{id:D,name:t.name,path:t.path??D},editor:L,surfaceRef:ie,isPreview:O,exitPreview:()=>v((Z)=>({...Z,[D]:!1})),publish:!1});let{symbols:ge,total:be,truncated:V,notice:j}=xd({content:Q,language:oe,path:t.path??null,state:P?"not-a-document":L.loadError?"error":L.loaded?"ready":"loading",note:P?`${Xo[g]} files have no text outline.`:L.loadError});return e("div",{className:"fixed inset-x-0 top-0 h-dvh z-[60] bg-paper flex flex-col font-mono text-xs select-none",...z.dropProps,...z.captureDropProps,children:[e(Ol,{visible:z.isDragging}),e(_o,{fileName:t.name,hasPreview:A,isPreview:O,wordWrap:k,copied:L.copied,byteViewer:P,missing:r,onSave:L.saveNow,onClose:l,onTogglePreview:Y,hasReview:B,isReviewing:B&&R.active,onToggleReview:R.toggle,onToggleFind:()=>ee.open?ee.close():ee.openFind(),findOpen:ee.open,onToggleWrap:()=>y(!k),onZoomOut:()=>c((Z)=>Math.max(El,Z-1)),onZoomIn:()=>c((Z)=>Math.min(Bl,Z+1)),onCopy:L.copy,onDownload:L.download}),r&&e(Go,{}),L.diskChange&&e(_u,{fileName:t.name,onReload:L.reloadFromDisk,onKeepMine:L.keepMineAgainstDisk}),ee.open&&!P&&e("div",{className:"relative shrink-0 h-9 border-b border-ink/10 bg-paper",children:e(gu,{find:ee})}),e($o,{file:t,editor:L,viewerKind:g,byteViewer:P,isPreview:O,isMd:C,content:Q,language:oe,wordWrap:k,fileKey:D,revealMarks:J,currentMark:ce,surfaceRef:ie,setCodeScroller:H,previewRef:ne,scroll:q,fontSize:w,reviewActive:B&&R.active,onExitReview:R.toggle,editorTheme:M,editorFontFamily:N,indentUnitText:Ru(T),typing:W}),!P&&e(tt,{path:t.path??null,symbols:ge,total:be,truncated:V,emptyNotice:j,preview:C&&O}),e(Jo,{isImage:L.isImage,byteViewer:P,viewerKind:g,lineCount:me,charCount:Q.length,language:oe,saveStatus:L.saveStatus,path:t.path,conflicts:ke}),L.saveMissingConfirm&&t.path&&e(Tu,{fileName:t.name,filePath:t.path,onClose:L.cancelSaveMissing,onConfirm:L.confirmSaveMissing})]})}function it({diff:t,onClose:r,onFileSaved:l}){let m=t.path.split("/").pop()||t.path,b=Boolean(t.staged),g=t.status||"M",x=sr(g,b);return e("div",{className:"fixed inset-x-0 top-0 h-dvh z-[60] bg-paper flex flex-col",children:[e("header",{className:"bg-canvas border-b border-ink/10 flex items-center justify-between px-3 flex-shrink-0",style:Zo(),children:[e("div",{className:"flex items-center space-x-2 min-w-0 pr-2",children:[e("button",{type:"button",onClick:r,className:"p-1.5 -ml-1 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink transition-colors flex-shrink-0",title:"Back","aria-label":"Close diff",children:e(pn,{size:18,strokeWidth:1.9})}),e(mt,{name:m,size:14,className:"flex-shrink-0"}),e("span",{className:"font-mono text-xs text-ink font-medium truncate",title:t.path,children:m})]}),e("span",{className:`px-1.5 py-0.5 text-[10px] font-mono font-semibold rounded border flex-shrink-0 ${x.badgeBgClass}`,children:[x.charStatus," ",x.label]})]}),e("div",{className:"flex-1 min-h-0",children:e(du,{className:"h-full",viewModeButtons:!1,filePath:t.path,status:g,isStaged:b,root:t.root,repo:t.repo||".",journalDiff:t.journal,readOnly:Boolean(t.journal),onFileSaved:l,tabKey:t.journal?qf(t.journal.path,t.journal.from,t.journal.to):Hf(t.path,b)})})]})}function Oe(t,r){let l=t[r];return typeof l==="string"&&l.length>0?l:void 0}function Pt(t){let r=t.content;return typeof r==="string"?r:void 0}function Ge(t,r){let l=typeof t==="object"&&t!==null?t:{},m=(Oe(l,"path")??"").replace(/^\/+/,"");if(!m)return null;return{name:Oe(l,"name")??m.split("/").pop()??"file",path:m,content:Pt(l),root:Oe(l,"root")??r??void 0,repo:Oe(l,"repo"),handleId:Oe(l,"handleId"),deviceFile:l.deviceFile===!0?!0:void 0}}function lt(t){if(!t)return[];return[{id:"mobile-editor",path:t.path,root:t.root,repo:t.repo,content:t.content,handleId:t.handleId,deviceFile:t.deviceFile}]}function ct(t,r,l){fo(l);let m=ur(r);return rn(m,AA,{folderId:r,worktreePath:l}),t.setSearchParams((b)=>{let g=Ft(b);return g.set("sessionId",m),g.set("folderId",r.toString()),g},{replace:!0}),t.afterNavigate?.(),m}function op({onDesktopToggle:t,appSettings:r={}}){let{folders:l,isMock:m}=at(),b=Qt(),{sessionId:g}=He(),[x,v]=le(),w=x.get("sessionId"),c=w?Number.isNaN(Number(w))?w:Number(w):null,k=x.get("folderId"),y=k?Number.isNaN(Number(k))?k:Number(k):null,[N,M]=n("main"),T=qe({dock:b,sessionId:g,currentScreen:N,setCurrentScreen:M}),[W,C]=n(null),[P,A]=n(null),[D,O]=n(0),[R,B]=n(!1),[Y,z]=n("appearance"),[L,te]=n(!1),H=a(()=>O((V)=>V+1),[]),q=wu(lt(W),D),{pushToast:re}=We(),_=a((V)=>re(V.message,V.ok?"success":"error"),[re]),ne=q.size>0;Xe({editorOpen:W!==null,diffOpen:P!==null,settingsOpen:R,offMainScreen:N!=="main",onCloseEditor:()=>C(null),onCloseDiff:()=>A(null),onCloseSettings:()=>{B(!1),te(!1)},onReturnToMain:()=>M("main")});let{folder:ie}=Ml(l,c),ee=ie??(y?l.find((V)=>String(V.id)===String(y))??null:null),J=Zf(l,c)??ee?.project_path??null,ce=!!ee,Q=su({enabled:ce,onResult:_});se("omp:open-file",(V)=>{let Z=Ge(V.detail,J);if(Z)C(Z)}),se("omp:open-diff",(V)=>{let j=V.detail;if(!j?.file)return;A({path:j.file.replace(/^\/+/,""),status:j.status,staged:j.staged,repo:j.repo,root:j.root??J??void 0,...j.source==="journal"&&j.journal?{journal:j.journal}:{}})}),se("omp:view-subagent",()=>M("main")),se("omp:open-settings",(V)=>{let j=V.detail;z(j?.category??"appearance"),te(Boolean(j?.autoOpenAdd)),B(!0)});let oe=(V)=>{v((j)=>{let Z=Ft(j);if(Z.set("sessionId",V.toString()),Z.has("subagent"))Z.delete("subagent");return Z},{replace:!0}),M("main")},me=()=>{v(new URLSearchParams,{replace:!0}),M("main")},ke=(V)=>{let j=Nl(l,w,V);if(j)fo(j);v((Z)=>Lc(Z,ur(V),V),{replace:!0}),M("main")},ge=(V,j)=>ct({setSearchParams:v,afterNavigate:()=>M("main")},V,j),be=a((V)=>{let j=Ge(V,J);if(j)C(j)},[J]);return e("div",{"data-testid":"app-root",className:"app-window flex flex-col h-dvh w-screen overflow-hidden bg-canvas text-ink font-sans selection:bg-ink selection:text-canvas relative",children:[e(ag,{}),e(og,{isMock:m}),e(ig,{workspacePath:J}),e("div",{className:`flex-1 min-h-0 w-full relative ${N==="main"?"block":"hidden"}`,...Q.dropProps,...Q.captureDropProps,children:[e(Ol,{visible:Q.isDragging}),e(eo,{activeSessionId:c,onSelectSession:oe,onNewSession:me,onOpenSessionSidebar:T.openSessionDrawer,onOpenRightSidebar:T.openRightDrawer,appSettings:r})]}),e("div",{className:`flex-1 min-h-0 w-full ${N==="session"?"block":"hidden"}`,children:e(Ao,{activeSessionId:c,onSelectSession:oe,onNewSession:me,onNewSessionForFolder:ke,onNewWorktreeSession:ge,onClose:()=>M("main"),onDesktopToggle:t,appSettings:r,rootPath:J??void 0,refreshKey:D,onRefresh:H,onOpenFile:be,revealSignal:T.left})}),N==="right"&&e("div",{className:"flex-1 min-h-0 w-full",children:e(Lo,{enabled:ce,rootPath:J??void 0,refreshKey:D,onRefresh:H,onOpenFile:be,onClose:()=>M("main"),revealSignal:T.right})}),W&&e(nt,{file:W,missing:ne,onClose:()=>C(null),onFileSaved:H}),P&&e(it,{diff:P,onClose:()=>A(null),onFileSaved:H}),e(Tl,{isOpen:R,onClose:()=>{B(!1),te(!1)},initialCategory:Y,autoOpenAddProvider:L,appSettings:r})]})}export{op as MobileLayoutWrapper};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{pg}from"./index-tdryzzy9.js";import"./index-e4yj4kbe.js";import"./index-ewst55j2.js";export{pg as MergeDiffView};
|