@kabmo-labs/kabmo 0.32.0 → 0.32.1
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 +308 -308
- package/dist/client/static/js/{CsvGrid-amafmq3z.js → CsvGrid-4gx0jevc.js} +2 -2
- package/dist/client/static/js/{DocxView-851ps9t0.js → DocxView-0667nr8h.js} +5 -5
- package/dist/client/static/js/{DrawioView-kw1vy3r2.js → DrawioView-522v0d0r.js} +2 -2
- package/dist/client/static/js/ImageView-t8xp60hm.js +1 -0
- package/dist/client/static/js/LayoutWrapper-xjnveecv.js +2 -0
- package/dist/client/static/js/{Modal-f8x3j3be.js → Modal-k2jr9hc4.js} +14 -14
- package/dist/client/static/js/{PdfView-f5jkm0rs.js → PdfView-3fx172xh.js} +1 -1
- package/dist/client/static/js/SessionsView-n3agmf5t.js +1 -0
- package/dist/client/static/js/{SheetView-23zxy30b.js → SheetView-nmrdb1b8.js} +23 -23
- package/dist/client/static/js/{SvgPreview-c341y50e.js → SvgPreview-0xsc6xam.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-2dc3mpk6.js → abnfDiagram-O67JEVCF-jj31rs62.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-1y9zvsyt.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-7jmrr5ja.js → architectureDiagram-NJMV4G6O-ay3yr7pf.js} +3 -3
- package/dist/client/static/js/{astro-sjtf954j.js → astro-qgx1r159.js} +1 -1
- package/dist/client/static/js/bash-m0qjsyy0.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-jrk2m0ea.js → blockDiagram-BEXU5L5S-4x33e16k.js} +3 -3
- package/dist/client/static/js/c-wkgxb1t1.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-48cyncjd.js → c4Diagram-YGBWAQC7-dtb81cgz.js} +2 -2
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-gm7jt1cd.js → classDiagram-v2-NBCMYWYE-vk5a2n9w.js} +3 -3
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-g0g3z0xp.js → cose-bilkent-JH36ORCC-6rbjbe19.js} +1 -1
- package/dist/client/static/js/cpp-y0t6mynx.js +1 -0
- package/dist/client/static/js/css-t4ngafan.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-k2188qcq.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-6vjde6am.js → cynefinDiagram-VND7K2PF-vyjksedr.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-q6k8bx1j.js → dagre-6A5THRUB-7hey38z5.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-87cmze2n.js → diagram-22UHCM2B-aes06jde.js} +11 -11
- package/dist/client/static/js/{diagram-3UASUU5V-1ejbr2p4.js → diagram-3UASUU5V-3cfkgm3x.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-vaw1r6k2.js → diagram-ATOU4E4O-z8mfhwpy.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-gxm9zv7d.js → diagram-CDSNMT55-t4821ctz.js} +2 -2
- package/dist/client/static/js/{diagram-MLGK6HIB-x010xswm.js → diagram-MLGK6HIB-23yxbfrx.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-qtcq7e6c.js → diagram-MPIPVDR6-chhtf7v0.js} +2 -2
- package/dist/client/static/js/{dockerfile-k5xbramm.js → dockerfile-5b87ghm7.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-nwwbasfh.js → ebnfDiagram-ZINNZB2B-9jejcvfr.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-xcp7thax.js → elk-276RUBZZ-xhhtkf58.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-xj1tp716.js → erDiagram-OPXOYQCR-mt2apjjb.js} +5 -5
- package/dist/client/static/js/{erlang-rz1g9mxy.js → erlang-6m6tpt72.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-pdr0qn0n.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-zvz0mxne.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-f7q96bea.js → ganttDiagram-FUAMR5RP-8cm7a29w.js} +3 -3
- package/dist/client/static/js/gitGraph-4MIJSDKK-wmqf046s.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-1rydkyq9.js → gitGraphDiagram-X574FWY7-5s0gbnx2.js} +2 -2
- package/dist/client/static/js/graphql-692h0n2x.js +1 -0
- package/dist/client/static/js/{index-52bgxh6f.js → index-2gfc25tq.js} +1 -1
- package/dist/client/static/js/{index-x64kqgen.js → index-2xj14800.js} +2 -2
- package/dist/client/static/js/{index-8m3q2zpb.js → index-360d7j0d.js} +1 -1
- package/dist/client/static/js/{index-123e8tqq.js → index-3vhznzgr.js} +1 -1
- package/dist/client/static/js/{index-y139vc12.js → index-4s8ttfxj.js} +175 -175
- package/dist/client/static/js/{index-9nbxb421.js → index-532btjmp.js} +2 -2
- package/dist/client/static/js/{index-c8jzx6b0.js → index-59jb53v3.js} +1 -1
- package/dist/client/static/js/{index-2t2tnc3x.js → index-5x95n3hx.js} +1 -1
- package/dist/client/static/js/{index-f63y3mjj.js → index-5y7c62sm.js} +4 -4
- package/dist/client/static/js/index-61tm0v57.js +1 -0
- package/dist/client/static/js/{index-fc2j6bq2.js → index-629kfbcb.js} +2 -2
- package/dist/client/static/js/{index-0n9c85ke.js → index-6q80csr0.js} +2 -2
- package/dist/client/static/js/{index-6sdctwv2.js → index-7fdp9c7m.js} +2 -2
- package/dist/client/static/js/index-7n68yx6m.js +2 -0
- package/dist/client/static/js/{index-pe9j88d4.js → index-9sd0vjmh.js} +2 -2
- package/dist/client/static/js/{index-m6wwc5h6.js → index-9t82sx0w.js} +2 -2
- package/dist/client/static/js/{index-xa7nrnda.js → index-a0bdavdr.js} +2 -2
- package/dist/client/static/js/{index-xpf2ra60.js → index-a6k2hqke.js} +1 -1
- package/dist/client/static/js/{index-e26rd868.js → index-a733k69t.js} +2 -2
- package/dist/client/static/js/{index-31jrebvn.js → index-ay34b398.js} +6 -6
- package/dist/client/static/js/{index-w4re5r8w.js → index-bbggh3f8.js} +2 -2
- package/dist/client/static/js/{index-73xfkyea.js → index-brj8qwa6.js} +2 -2
- package/dist/client/static/js/{index-fmxn1rzs.js → index-c0x6s6f7.js} +2 -2
- package/dist/client/static/js/{index-vmvcse63.js → index-c93sp4yh.js} +1 -1
- package/dist/client/static/js/{index-e7a3fkvv.js → index-dnp07j57.js} +1 -1
- package/dist/client/static/js/{index-pkyrkkbt.js → index-dq1kdt03.js} +2 -2
- package/dist/client/static/js/{index-ggaqh9rt.js → index-dt7e1328.js} +2 -2
- package/dist/client/static/js/{index-hkq0y3pn.js → index-ehcpzk5b.js} +2 -2
- package/dist/client/static/js/{index-tr8754r0.js → index-ejgd8w3s.js} +45 -45
- package/dist/client/static/js/{index-0a1ekhqf.js → index-fdbfzshx.js} +2 -2
- package/dist/client/static/js/{index-c20a46ww.js → index-g33knza2.js} +2 -2
- package/dist/client/static/js/{index-hhm62nfj.js → index-gbfg0anm.js} +2 -2
- package/dist/client/static/js/{index-2n5wy1sh.js → index-h06bcfds.js} +1 -1
- package/dist/client/static/js/{index-22jaxtz1.js → index-h7pn9qw6.js} +2 -2
- package/dist/client/static/js/{index-qmh0h87h.js → index-hc2jmzpx.js} +48 -48
- package/dist/client/static/js/{index-nsrnyqcm.js → index-jppt5mgc.js} +2 -2
- package/dist/client/static/js/{index-deex10rz.js → index-jz9fpznk.js} +5 -5
- package/dist/client/static/js/{index-r416e9dt.js → index-kg86e3sy.js} +11 -11
- package/dist/client/static/js/{index-e6rar25v.js → index-kpspnztv.js} +2 -2
- package/dist/client/static/js/index-nmmxb4va.js +2 -0
- package/dist/client/static/js/{index-zca66d5d.js → index-p7btwjvj.js} +3 -3
- package/dist/client/static/js/{index-gvwqjpcr.js → index-pf5sbesf.js} +2 -2
- package/dist/client/static/js/{index-ynqnbvn2.js → index-pf7syd7t.js} +3 -3
- package/dist/client/static/js/{index-3anc30zh.js → index-qkscve6n.js} +2 -2
- package/dist/client/static/js/index-qnwqaczk.js +4 -0
- package/dist/client/static/js/{index-5zd1jx9r.js → index-rg8jpbsw.js} +2 -2
- package/dist/client/static/js/{index-hyry1n8x.js → index-sa9cp6km.js} +2 -2
- package/dist/client/static/js/{index-f519m6s3.js → index-vd0e25p0.js} +1 -1
- package/dist/client/static/js/{index-cwaz6geq.js → index-vtbbfwx0.js} +2 -2
- package/dist/client/static/js/{index-14wppnkx.js → index-wzma5n54.js} +2 -2
- package/dist/client/static/js/{index-s9vp6p70.js → index-x07kp3jz.js} +2 -2
- package/dist/client/static/js/{index-8a3tmm1h.js → index-xj9649ac.js} +7 -7
- package/dist/client/static/js/{index-vrbcj11n.js → index-xya34x4v.js} +2 -2
- package/dist/client/static/js/{index-yvcpdk5f.js → index-ye3sr7db.js} +2 -2
- package/dist/client/static/js/{index-w5131mtt.js → index-z4v1xmh1.js} +2 -2
- package/dist/client/static/js/{index-0g25yrc0.js → index-z5s27s26.js} +1 -1
- package/dist/client/static/js/info-A6RAGUB7-zg3twte6.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-ptg07tp2.js → infoDiagram-VRGFBTTK-3w1yz32c.js} +1 -1
- package/dist/client/static/js/ini-cg0a5wm3.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-bdk2dkf5.js → ishikawaDiagram-OU5B5YK6-ckt471dy.js} +1 -1
- package/dist/client/static/js/java-vcck089n.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-kez0ha4c.js → journeyDiagram-ZHPQQLJL-kfvn4w7e.js} +2 -2
- package/dist/client/static/js/json-j5q8nt57.js +1 -0
- package/dist/client/static/js/jsx-ht9zyzwa.js +1 -0
- package/dist/client/static/js/{julia-nmr85k8z.js → julia-0j0gsjvc.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-dhzp3qg5.js → kanban-definition-PNTS6WVX-0q36cm83.js} +3 -3
- package/dist/client/static/js/lua-ke895s2q.js +1 -0
- package/dist/client/static/js/markdown-gwmsh53r.js +1 -0
- package/dist/client/static/js/{mermaid.core-h7wttbss.js → mermaid.core-b1ssa824.js} +7 -7
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-tq5dd1em.js → mindmap-definition-NLK3R4M7-e2ym5en8.js} +4 -4
- package/dist/client/static/js/one-dark-pro-4geyzhjj.js +1 -0
- package/dist/client/static/js/one-light-tqssjm9t.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-3pav51g0.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-e5hrdfzv.js → pegDiagram-GJSIUBJH-t8bbdyhe.js} +1 -1
- package/dist/client/static/js/{perl-prxcva8r.js → perl-7n7e9ncg.js} +1 -1
- package/dist/client/static/js/{php-m9kcctzs.js → php-32vy69vd.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-wqfh7zdk.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-axvbvnz8.js → pieDiagram-5QR66LMP-envv4brj.js} +2 -2
- package/dist/client/static/js/properties-mzvvbqg5.js +1 -0
- package/dist/client/static/js/python-3w64wsyd.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-wtn28cfm.js → quadrantDiagram-O4NWA36T-72rk137a.js} +3 -3
- package/dist/client/static/js/r-32re2zwb.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-w7qjdr2g.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-rhr99kkj.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-c4jeea3m.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-x2ee66ex.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-yw8wjfwg.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-avjkq945.js → railroadDiagram-XR7U4H2S-1ej0f5hr.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-bntx7r6q.js → requirementDiagram-PLB6GJNP-rvdaknpd.js} +3 -3
- package/dist/client/static/js/{ruby-t06c0e7g.js → ruby-5ty7fys7.js} +1 -1
- package/dist/client/static/js/{rust-6gqjxyf0.js → rust-2geezrcs.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-ps8nkdm2.js → sankeyDiagram-IPEJSGJF-nxvhtdaw.js} +3 -3
- package/dist/client/static/js/{sass-gsbyn3wh.js → sass-mey5150f.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-3ckf1q6z.js → sequenceDiagram-PO4LG4MO-n5cn5qrt.js} +6 -6
- package/dist/client/static/js/{sizeCapture-INFHLROL-akvcr1x7.js → sizeCapture-INFHLROL-r074kj7s.js} +1 -1
- package/dist/client/static/js/sql-g8wcshpc.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-c82914fz.js → stateDiagram-v2-GCMORJYK-vxghxdb0.js} +3 -3
- package/dist/client/static/js/{svelte-j54gfrvq.js → svelte-3ewx0hzx.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-scgdefh4.js → swimlanes-2SLR337P-qkkv894p.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-y81h9n27.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-z2ha1rhq.js → timeline-definition-EJHVYXUP-5tbq4ex2.js} +2 -2
- package/dist/client/static/js/treeView-Q6P3EWNA-ekz05ccs.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-aq6qymjr.js +1 -0
- package/dist/client/static/js/tsx-0p183w2f.js +1 -0
- package/dist/client/static/js/typescript-t9a5jyvv.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-3wdmrfmk.js → usecaseDiagram-POWQR4AR-6p8hf0b7.js} +15 -15
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-7m5tatzv.js → vennDiagram-UO4OBE2U-7k5jsxf9.js} +1 -1
- package/dist/client/static/js/{vue-y8bb5f3h.js → vue-06rdf4wh.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-z34tj4y3.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-55ps9s4z.js → wardleyDiagram-VNRHLVJA-km2x4er8.js} +3 -3
- package/dist/client/static/js/xml-81hxjjt4.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-8bsjtm4t.js → xychartDiagram-PMCCYNJV-kr3sgr4m.js} +2 -2
- package/dist/client/static/js/yaml-yssayv8a.js +1 -0
- package/package.json +1 -1
- package/src/client/components/common/session-actions-menu/index.tsx +6 -1
- package/src/client/components/layout/session-sidebar/SessionsView.tsx +20 -33
- package/src/client/components/mobile/LayoutWrapper.tsx +16 -26
- package/src/client/components/mobile/worktree-session.ts +4 -1
- package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +16 -15
- package/src/client/components/workspace/chat-timeline/fork-preview.test.tsx +11 -0
- package/src/client/hooks/chat/btw/mode.ts +5 -1
- package/src/client/hooks/chat/omp/session-sidebar-controller.ts +9 -3
- package/src/client/hooks/chat/timeline/new-chat.ts +4 -1
- package/src/client/hooks/chat/timeline/pending-dispatch.ts +6 -10
- package/src/client/hooks/chat/waiting/dispatch.ts +4 -1
- package/src/client/hooks/workspace/batch-delete-run.ts +5 -1
- package/src/client/hooks/workspace/session-delete.ts +5 -1
- package/src/client/lib/router/branch-params.test.ts +62 -0
- package/src/client/lib/router/branch-params.ts +48 -0
- package/src/server/lib/assets/shell-settings.server.test.ts +35 -0
- package/src/server/lib/assets/shell-settings.server.ts +33 -0
- package/src/server/lib/realtime/topics/peer-relay.server.test.ts +1 -11
- package/src/server/plugins/ssr.ts +20 -8
- package/src/test-support/peer-harness.ts +13 -5
- package/dist/client/static/js/ImageView-ksx9bbct.js +0 -1
- package/dist/client/static/js/LayoutWrapper-9ftz050x.js +0 -2
- package/dist/client/static/js/SessionsView-wzdf1cp6.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-4wsd6vk0.js +0 -1
- package/dist/client/static/js/bash-h6pkqvth.js +0 -1
- package/dist/client/static/js/c-thbdzmwv.js +0 -1
- package/dist/client/static/js/cpp-r1za1kke.js +0 -1
- package/dist/client/static/js/css-qsv4vvke.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-eycwde8c.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-srqbnmey.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-yj98317w.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-5jcrvn94.js +0 -1
- package/dist/client/static/js/graphql-275pg7ya.js +0 -1
- package/dist/client/static/js/index-b08zd4eq.js +0 -1
- package/dist/client/static/js/index-g0pkzanm.js +0 -2
- package/dist/client/static/js/index-ga2xdef3.js +0 -2
- package/dist/client/static/js/index-xzfsaqyz.js +0 -4
- package/dist/client/static/js/info-A6RAGUB7-mbt0ryx5.js +0 -1
- package/dist/client/static/js/ini-jqdrx98c.js +0 -1
- package/dist/client/static/js/java-70zqqrkr.js +0 -1
- package/dist/client/static/js/json-kxk8gfet.js +0 -1
- package/dist/client/static/js/jsx-h1035eqk.js +0 -1
- package/dist/client/static/js/lua-j2356waf.js +0 -1
- package/dist/client/static/js/markdown-ffw6rgk6.js +0 -1
- package/dist/client/static/js/one-dark-pro-8acf6cn2.js +0 -1
- package/dist/client/static/js/one-light-ysc1knem.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-a5yw789s.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-x0y4v4r2.js +0 -1
- package/dist/client/static/js/properties-55mrarxr.js +0 -1
- package/dist/client/static/js/python-dhypc3j4.js +0 -1
- package/dist/client/static/js/r-6b8dt1wp.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-trrc3ta1.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-dxgvx21w.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-rbgkd8sk.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-exgw7j47.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-28tpamzk.js +0 -1
- package/dist/client/static/js/sql-9dq913c8.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-0x2ashav.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-1a00b6kc.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-2q4f2f7m.js +0 -1
- package/dist/client/static/js/tsx-wh5xgm7f.js +0 -1
- package/dist/client/static/js/typescript-ge85req5.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-x9v91the.js +0 -1
- package/dist/client/static/js/xml-7bgz40qa.js +0 -1
- package/dist/client/static/js/yaml-4ht9416k.js +0 -1
- package/src/client/components/layout/session-sidebar/new-session-context.test.ts +0 -55
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{t,l,
|
|
1
|
+
import{t,l,Lt,K,E,X,te,R,M,O,P,z,j,G,ai,On,Cs,ue,ae,wf}from"./index-hc2jmzpx.js";import{ta}from"./index-kpspnztv.js";function _t(e,i,s){e=+e,i=+i,s=(a=arguments.length)<2?(i=e,e=0,1):a<3?1:+s;var n=-1,a=Math.max(0,Math.ceil((i-e)/s))|0,h=Array(a);while(++n<a)h[n]=e+n*s;return h}function gt(){var e=On().unknown(void 0),{domain:i,range:s}=e,n=0,a=1,h,c,x=!1,f=0,S=0,D=0.5;delete e.unknown;function _(){var y=i().length,W=a<n,I=W?a:n,B=W?n:a;if(h=(B-I)/Math.max(1,y-f+S*2),x)h=Math.floor(h);if(I+=(B-I-h*(y-f))*D,c=h*(1-f),x)I=Math.round(I),c=Math.round(c);var N=_t(y).map(function(J){return I+h*J});return s(W?N.reverse():N)}return e.domain=function(y){return arguments.length?(i(y),_()):i()},e.range=function(y){return arguments.length?([n,a]=y,n=+n,a=+a,_()):[n,a]},e.rangeRound=function(y){return[n,a]=y,n=+n,a=+a,x=!0,_()},e.bandwidth=function(){return c},e.step=function(){return h},e.round=function(y){return arguments.length?(x=!!y,_()):x},e.padding=function(y){return arguments.length?(f=Math.min(1,S=+y),_()):f},e.paddingInner=function(y){return arguments.length?(f=Math.min(1,y),_()):f},e.paddingOuter=function(y){return arguments.length?(S=+y,_()):S},e.align=function(y){return arguments.length?(D=Math.max(0,Math.min(1,y)),_()):D},e.copy=function(){return gt(i(),[n,a]).round(x).paddingInner(f).paddingOuter(S).align(D)},ai.apply(_(),arguments)}var Tt=function(){var e=t(function(q,r,g,d){for(g=g||{},d=q.length;d--;g[q[d]]=r);return g},"o"),i=[1,10,12,14,16,18,19,21,23],s=[2,6],n=[1,3],a=[1,5],h=[1,6],c=[1,7],x=[1,5,10,12,14,16,18,19,21,23,36,37,38],f=[1,25],S=[1,26],D=[1,28],_=[1,29],y=[1,30],W=[1,31],I=[1,32],B=[1,33],N=[1,34],J=[1,35],et=[1,36],w=[1,37],H=[1,43],u=[1,42],Y=[1,47],U=[1,50],A=[1,10,12,14,16,18,19,21,23,36,37,38],st=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],V=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],ht=[1,65],v=[26,28],k={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:t(function(r,g,d,p,C,o,nt){var m=o.length-1;switch(C){case 5:p.setOrientation(o[m]);break;case 9:p.setDiagramTitle(o[m].text.trim());break;case 12:p.setLineData({text:"",type:"text"},o[m]);break;case 13:p.setLineData(o[m-1],o[m]);break;case 14:p.setBarData({text:"",type:"text"},o[m]);break;case 15:p.setBarData(o[m-1],o[m]);break;case 16:this.$=o[m].trim(),p.setAccTitle(this.$);break;case 17:case 18:this.$=o[m].trim(),p.setAccDescription(this.$);break;case 19:this.$=o[m-1];break;case 20:case 30:this.$=[o[m-2],...o[m]];break;case 21:case 31:this.$=[o[m]];break;case 22:this.$={value:Number(o[m-1]),label:o[m]};break;case 23:this.$={value:Number(o[m]),label:""};break;case 24:p.setXAxisTitle(o[m]);break;case 25:p.setXAxisTitle(o[m-1]);break;case 26:p.setXAxisTitle({type:"text",text:""});break;case 27:p.setXAxisBand(o[m]);break;case 28:p.setXAxisRangeData(Number(o[m-2]),Number(o[m]));break;case 29:this.$=o[m-1];break;case 32:p.setYAxisTitle(o[m]);break;case 33:p.setYAxisTitle(o[m-1]);break;case 34:p.setYAxisTitle({type:"text",text:""});break;case 35:p.setYAxisRangeData(Number(o[m-2]),Number(o[m]));break;case 39:this.$={text:o[m],type:"text"};break;case 40:this.$={text:o[m],type:"text"};break;case 41:this.$={text:o[m],type:"markdown"};break;case 42:this.$=o[m];break;case 43:this.$=o[m-1]+""+o[m];break}},"anonymous"),table:[e(i,s,{3:1,4:2,7:4,5:n,36:a,37:h,38:c}),{1:[3]},e(i,s,{4:2,7:4,3:8,5:n,36:a,37:h,38:c}),e(i,s,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:a,37:h,38:c}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(x,[2,36]),e(x,[2,37]),e(x,[2,38]),{1:[2,1]},e(i,s,{4:2,7:4,3:21,5:n,36:a,37:h,38:c}),{1:[2,3]},e(x,[2,5]),e(i,[2,7],{4:22,36:a,37:h,38:c}),{11:23,30:f,39:24,40:S,41:27,42:D,43:_,44:y,45:W,46:I,47:B,48:N,49:J,50:et,51:w},{11:39,13:38,24:H,29:u,30:f,31:40,32:41,39:24,40:S,41:27,42:D,43:_,44:y,45:W,46:I,47:B,48:N,49:J,50:et,51:w},{11:45,15:44,29:Y,30:f,35:46,39:24,40:S,41:27,42:D,43:_,44:y,45:W,46:I,47:B,48:N,49:J,50:et,51:w},{11:49,17:48,24:U,30:f,39:24,40:S,41:27,42:D,43:_,44:y,45:W,46:I,47:B,48:N,49:J,50:et,51:w},{11:52,17:51,24:U,30:f,39:24,40:S,41:27,42:D,43:_,44:y,45:W,46:I,47:B,48:N,49:J,50:et,51:w},{20:[1,53]},{22:[1,54]},e(A,[2,18]),{1:[2,2]},e(A,[2,8]),e(A,[2,9]),e(st,[2,39],{41:55,42:D,43:_,44:y,45:W,46:I,47:B,48:N,49:J,50:et,51:w}),e(st,[2,40]),e(st,[2,41]),e(V,[2,42]),e(V,[2,44]),e(V,[2,45]),e(V,[2,46]),e(V,[2,47]),e(V,[2,48]),e(V,[2,49]),e(V,[2,50]),e(V,[2,51]),e(V,[2,52]),e(V,[2,53]),e(A,[2,10]),e(A,[2,24],{32:41,31:56,24:H,29:u}),e(A,[2,26]),e(A,[2,27]),{33:[1,57]},{11:59,30:f,34:58,39:24,40:S,41:27,42:D,43:_,44:y,45:W,46:I,47:B,48:N,49:J,50:et,51:w},e(A,[2,11]),e(A,[2,32],{35:60,29:Y}),e(A,[2,34]),{33:[1,61]},e(A,[2,12]),{17:62,24:U},{25:63,27:64,29:ht},e(A,[2,14]),{17:66,24:U},e(A,[2,16]),e(A,[2,17]),e(V,[2,43]),e(A,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(A,[2,33]),{29:[1,70]},e(A,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(v,[2,23],{30:[1,73]}),e(A,[2,15]),e(A,[2,28]),e(A,[2,29]),{11:59,30:f,34:74,39:24,40:S,41:27,42:D,43:_,44:y,45:W,46:I,47:B,48:N,49:J,50:et,51:w},e(A,[2,35]),e(A,[2,19]),{25:75,27:64,29:ht},e(v,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:t(function(r,g){if(g.recoverable)this.trace(r);else{var d=Error(r);throw d.hash=g,d}},"parseError"),parse:t(function(r){var g=this,d=[0],p=[],C=[null],o=[],nt=this.table,m="",ft=0,Wt=0,Xt=0,xe=2,Nt=1,fe=o.slice.call(arguments,1),L=Object.create(this.lexer),at={yy:{}};for(var kt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,kt))at.yy[kt]=this.yy[kt];if(L.setInput(r,at.yy),at.yy.lexer=L,at.yy.parser=this,typeof L.yylloc>"u")L.yylloc={};var At=L.yylloc;o.push(At);var pe=L.options&&L.options.ranges;if(typeof at.yy.parseError==="function")this.parseError=at.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function me(Z){d.length=d.length-2*Z,C.length=C.length-Z,o.length=o.length-Z}t(me,"popStack");function Yt(){var Z=p.pop()||L.lex()||Nt;if(typeof Z!=="number"){if(Z instanceof Array)p=Z,Z=p.pop();Z=g.symbols_[Z]||Z}return Z}t(Yt,"lex");var F,Ct,ot,Q,Be,St,lt={},pt,it,Ht,mt;while(!0){if(ot=d[d.length-1],this.defaultActions[ot])Q=this.defaultActions[ot];else{if(F===null||typeof F>"u")F=Yt();Q=nt[ot]&&nt[ot][F]}if(typeof Q>"u"||!Q.length||!Q[0]){var Rt="";mt=[];for(pt in nt[ot])if(this.terminals_[pt]&&pt>xe)mt.push("'"+this.terminals_[pt]+"'");if(L.showPosition)Rt="Parse error on line "+(ft+1)+`:
|
|
2
2
|
`+L.showPosition()+`
|
|
3
3
|
Expecting `+mt.join(", ")+", got '"+(this.terminals_[F]||F)+"'";else Rt="Parse error on line "+(ft+1)+": Unexpected "+(F==Nt?"end of input":"'"+(this.terminals_[F]||F)+"'");this.parseError(Rt,{text:L.match,token:this.terminals_[F]||F,line:L.yylineno,loc:At,expected:mt})}if(Q[0]instanceof Array&&Q.length>1)throw Error("Parse Error: multiple actions possible at state: "+ot+", token: "+F);switch(Q[0]){case 1:if(d.push(F),C.push(L.yytext),o.push(L.yylloc),d.push(Q[1]),F=null,!Ct){if(Wt=L.yyleng,m=L.yytext,ft=L.yylineno,At=L.yylloc,Xt>0)Xt--}else F=Ct,Ct=null;break;case 2:if(it=this.productions_[Q[1]][1],lt.$=C[C.length-it],lt._$={first_line:o[o.length-(it||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(it||1)].first_column,last_column:o[o.length-1].last_column},pe)lt._$.range=[o[o.length-(it||1)].range[0],o[o.length-1].range[1]];if(St=this.performAction.apply(lt,[m,Wt,ft,at.yy,Q[1],C,o].concat(fe)),typeof St<"u")return St;if(it)d=d.slice(0,-1*it*2),C=C.slice(0,-1*it),o=o.slice(0,-1*it);d.push(this.productions_[Q[1]][0]),C.push(lt.$),o.push(lt._$),Ht=nt[d[d.length-2]][d[d.length-1]],d.push(Ht);break;case 3:return!0}}return!0},"parse")},tt=function(){var q={EOF:1,parseError:t(function(g,d){if(this.yy.parser)this.yy.parser.parseError(g,d);else throw Error(g)},"parseError"),setInput:t(function(r,g){if(this.yy=g||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var g=r.match(/(?:\r\n?|\n).*/g);if(g)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),r},"input"),unput:t(function(r){var g=r.length,d=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var p=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),d.length-1)this.yylineno-=d.length-1;var C=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:d?(d.length===p.length?this.yylloc.first_column:0)+p[p.length-d.length].length-d[0].length:this.yylloc.first_column-g},this.options.ranges)this.yylloc.range=[C[0],C[0]+this.yyleng-g];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(r){this.unput(this.match.slice(r))},"less"),pastInput:t(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var r=this.match;if(r.length<20)r+=this._input.substr(0,20-r.length);return(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var r=this.pastInput(),g=Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
5
5
|
`+g+"^"},"showPosition"),test_match:t(function(r,g){var d,p,C;if(this.options.backtrack_lexer){if(C={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)C.yylloc.range=this.yylloc.range.slice(0)}if(p=r[0].match(/(?:\r\n?|\n).*/g),p)this.yylineno+=p.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],d=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(d)return d;else if(this._backtrack){for(var o in C)this[o]=C[o];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var r,g,d,p;if(!this._more)this.yytext="",this.match="";var C=this._currentRules();for(var o=0;o<C.length;o++)if(d=this._input.match(this.rules[C[o]]),d&&(!g||d[0].length>g[0].length)){if(g=d,p=o,this.options.backtrack_lexer)if(r=this.test_match(d,C[o]),r!==!1)return r;else if(this._backtrack){g=!1;continue}else return!1;else if(!this.options.flex)break}if(g){if(r=this.test_match(g,C[p]),r!==!1)return r;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var g=this.next();if(g)return g;else return this.lex()},"lex"),begin:t(function(g){this.conditionStack.push(g)},"begin"),popState:t(function(){var g=this.conditionStack.length-1;if(g>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(g){if(g=this.conditionStack.length-1-Math.abs(g||0),g>=0)return this.conditionStack[g];else return"INITIAL"},"topState"),pushState:t(function(g){this.begin(g)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(g,d,p,C){var o=C;switch(p){case 0:break;case 1:break;case 2:return this.popState(),36;break;case 3:return this.popState(),36;break;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.pushState("acc_descr"),21;break;case 10:return this.popState(),"acc_descr_value";break;case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";break;case 18:return this.pushState("axis_data"),"Y_AXIS";break;case 19:return this.pushState("axis_band_data"),24;break;case 20:return 33;case 21:return this.pushState("data"),16;break;case 22:return this.pushState("data"),18;break;case 23:return this.pushState("data_inner"),24;break;case 24:return 29;case 25:return this.popState(),26;break;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return q}();k.lexer=tt;function T(){this.yy={}}return t(T,"Parser"),T.prototype=k,k.Parser=T,new T}();Tt.parser=Tt;var be=Tt;function bt(e){return e.type==="bar"}t(bt,"isBarPlot");function yt(e){return e.type==="band"}t(yt,"isBandAxisData");function ct(e){return e.type==="linear"}t(ct,"isLinearAxisData");var Lt=class{constructor(e){this.parentGroup=e}static{t(this,"TextDimensionCalculatorWithFont")}getMaxDimension(e,i){if(!this.parentGroup)return{width:e.reduce((a,h)=>Math.max(h.length,a),0)*i,height:i};let s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(let a of e){let h=kf(n,1,a),c=h?h.width:a.length*i,x=h?h.height:i;s.width=Math.max(s.width,c),s.height=Math.max(s.height,x)}return n.remove(),s}},$t=0.7,Ut=0.2,qt=class{constructor(e,i,s,n){this.axisConfig=e,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{t(this,"BaseAxis")}setRange(e){if(this.range=e,this.axisPosition==="left"||this.axisPosition==="right")this.boundingRect.height=e[1]-e[0];else this.boundingRect.width=e[1]-e[0];this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map((e)=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){if($t*this.getTickDistance()>this.outerPadding*2)this.outerPadding=Math.floor($t*this.getTickDistance()/2);this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let i=e.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Ut*e.width;this.outerPadding=Math.min(s.width/2,n);let a=s.height;if(this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0)a=Math.max(a,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*s.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*s.height));if(a+=this.axisConfig.labelPadding*2,this.labelTextHeight=s.height,a<=i)i-=a,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width,this.boundingRect.height=e.height-i}calculateSpaceIfDrawnVertical(e){let i=e.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Ut*e.height;this.outerPadding=Math.min(s.height/2,n);let a=s.width+this.axisConfig.labelPadding*2;if(a<=i)i-=a,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width-i,this.boundingRect.height=e.height}calculateSpace(e){if(this.axisPosition==="left"||this.axisPosition==="right")this.calculateSpaceIfDrawnVertical(e);else this.calculateSpaceIfDrawnHorizontally(e);return this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){let i=this.normalizedLabelRotationInRad;if(i===0)return 0;return Math.sin(i)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))});if(this.showTick){let i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");if(this.axisPosition==="bottom")return this.getDrawableElementsForBottomAxis();if(this.axisPosition==="top")return this.getDrawableElementsForTopAxis();return[]}},ye=class extends qt{static{t(this,"BandAxis")}constructor(e,i,s,n,a){super(e,n,a,i);this.categories=s,this.scale=gt().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=gt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5),l.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},we=class extends qt{static{t(this,"LinearAxis")}constructor(e,i,s,n,a){super(e,n,a,i);this.domain=s,this.scale=ea().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];if(this.axisPosition==="left")e.reverse();this.scale=ea().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function Dt(e,i,s,n){let a=new Lt(n);if(yt(e))return new ye(i,s,e.categories,e.title,a);return new we(i,s,[e.min,e.max],e.title,a)}t(Dt,"getAxis");var ke=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{t(this,"ChartTitle")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,e.width),n=i.height+2*this.chartConfig.titlePadding;if(i.width<=s&&i.height<=n&&this.chartConfig.showTitle&&this.chartData.title)this.boundingRect.width=s,this.boundingRect.height=n,this.showChartTitle=!0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let e=[];if(this.showChartTitle)e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]});return e}};function Gt(e,i,s,n){let a=new Lt(n);return new ke(a,e,i,s)}t(Gt,"getChartTitleComponent");var Ae=0.75,Ce=0.5,Se=0.35;function vt(e){return{fontSize:e,markerSize:e*Ae,markerSpacing:e*Se,itemSpacing:e*Ce}}t(vt,"getLegendLayout");var Re=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{t(this,"ChartLegend")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter((f)=>f.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};let{fontSize:i,markerSize:s,markerSpacing:n,itemSpacing:a}=vt(this.chartConfig.legendFontSize),h=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map((f)=>f.title),i),c=this.chartConfig.legendPadding*2+s+n+h.width,x=this.chartConfig.legendPadding*2+this.visiblePlots.length*i+(this.visiblePlots.length-1)*a;if(c<=e.width&&x<=e.height)this.boundingRect.width=c,this.boundingRect.height=x;else this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];let{fontSize:e,markerSize:i,markerSpacing:s,itemSpacing:n}=vt(this.chartConfig.legendFontSize),a=e+n,h=this.boundingRect.x+this.chartConfig.legendPadding,c=this.boundingRect.y+this.chartConfig.legendPadding,x=[],f=[];for(let[S,D]of this.visiblePlots.entries())if(bt(D))x.push({x:h,y:c+S*a,width:i,height:i,fill:D.fill,strokeFill:D.fill,strokeWidth:0});else{let _=c+S*a+i/2;f.push({path:`M ${h},${_} L ${h+i},${_}`,strokeFill:D.strokeFill,strokeWidth:D.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:x},{groupTexts:["legend","markers"],type:"path",data:f},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((S,D)=>({text:S.title,x:h+i+s,y:c+D*a+i/2,fill:this.chartThemeConfig.legendTextColor,fontSize:e,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}};function jt(e,i,s,n){let a=new Lt(n);return new Re(a,e,i,s)}t(jt,"getChartLegendComponent");var _e=class{constructor(e,i,s,n,a){this.plotData=e,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=a}static{t(this,"LinePlot")}getDrawableElement(){let e=this.plotData.data.map((n)=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),i;if(this.orientation==="horizontal")i=Cs().y((n)=>n[0]).x((n)=>n[1])(e);else i=Cs().x((n)=>n[0]).y((n)=>n[1])(e);if(!i)return[];let s=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let h=[];for(let[c,[x,f]]of e.entries()){let S=this.plotData.pointLabels[c];if(!S)continue;if(this.orientation==="horizontal")h.push({x:f+10,y:x,text:S,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0});else h.push({x,y:f-10,text:S,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0})}if(h.length>0)s.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:h})}return s}},Te=class{constructor(e,i,s,n,a,h){this.barData=e,this.boundingRect=i,this.xAxis=s,this.yAxis=n,this.orientation=a,this.plotIndex=h}static{t(this,"BarPlot")}getDrawableElement(){let e=this.barData.data.map((a)=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),i=0.05,s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*0.95,n=s/2;if(this.orientation==="horizontal")return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((a)=>({x:this.boundingRect.x,y:a[0]-n,height:s,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}];return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((a)=>({x:a[0]-n,y:a[1],width:s,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},De=class{constructor(e,i,s){this.chartConfig=e,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}static{t(this,"BasePlot")}setAxes(e,i){this.xAxis=e,this.yAxis=i}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");let e=[];for(let[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{let n=new _e(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break;case"bar":{let n=new Te(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break}return e}};function Qt(e,i,s){return new De(e,i,s)}t(Qt,"getPlotComponent");var ve=class{constructor(e,i,s,n){this.chartConfig=e,this.chartData=i,this.componentStore={title:Gt(e,i,s,n),plot:Qt(e,i,s),legend:jt(e,i,s,n),xAxis:Dt(i.xAxis,e.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},n),yAxis:Dt(i.yAxis,e.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},n)}}static{t(this,"Orchestrator")}calculateVerticalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,a={width:0,height:0},h=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),c=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),x=this.componentStore.plot.calculateSpace({width:h,height:c});if(e-=x.width,i-=x.height,x=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=x.height,i-=x.height,this.componentStore.xAxis.setAxisPosition("bottom"),x=this.componentStore.xAxis.calculateSpace({width:e,height:i}),i-=x.height,this.componentStore.yAxis.setAxisPosition("left"),x=this.componentStore.yAxis.calculateSpace({width:e,height:i}),s=x.width,e-=x.width,a=this.componentStore.legend.calculateSpace({width:e,height:c}),e-=a.width,e>0)h+=e,e=0;if(i>0)c+=i,i=0;if(this.componentStore.plot.calculateSpace({width:h,height:c}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.legend.setBoundingBoxXY({x:s+h,y:n+Math.max((c-a.height)/2,0)}),this.componentStore.xAxis.setRange([s,s+h]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:n+c}),this.componentStore.yAxis.setRange([n,n+c]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some((f)=>bt(f)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,a=0,h={width:0,height:0},c=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),x=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),f=this.componentStore.plot.calculateSpace({width:c,height:x});if(e-=f.width,i-=f.height,f=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=f.height,i-=f.height,this.componentStore.xAxis.setAxisPosition("left"),f=this.componentStore.xAxis.calculateSpace({width:e,height:i}),e-=f.width,n=f.width,this.componentStore.yAxis.setAxisPosition("top"),f=this.componentStore.yAxis.calculateSpace({width:e,height:i}),i-=f.height,a=s+f.height,h=this.componentStore.legend.calculateSpace({width:e,height:x}),e-=h.width,e>0)c+=e,e=0;if(i>0)x+=i,i=0;if(this.componentStore.plot.calculateSpace({width:c,height:x}),this.componentStore.plot.setBoundingBoxXY({x:n,y:a}),this.componentStore.legend.setBoundingBoxXY({x:n+c,y:a+Math.max((x-h.height)/2,0)}),this.componentStore.yAxis.setRange([n,n+c]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:s}),this.componentStore.xAxis.setRange([a,a+x]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some((S)=>bt(S)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){if(this.chartConfig.chartOrientation==="horizontal")this.calculateHorizontalSpace();else this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let i of Object.values(this.componentStore))e.push(...i.getDrawableElements());return e}},Pe=class{static{t(this,"XYChartBuilder")}static build(e,i,s,n){return new ve(e,i,s,n).getDrawableElement()}},ut=0,Kt,dt=Bt(),xt=It(),b=zt(),Pt=xt.plotColorPalette.split(",").map((e)=>e.trim()),wt=!1,Et=!1;function It(){let e=Mt(),i=E();return ae(e.xyChart,i.themeVariables.xyChart)}t(It,"getChartDefaultThemeConfig");function Bt(){let e=E();return ae(K.xyChart,e.xyChart)}t(Bt,"getChartDefaultConfig");function zt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}t(zt,"getChartDefaultData");function rt(e){let i=E();return X(e.trim(),i)}t(rt,"textSanitizer");function Zt(e){Kt=e}t(Zt,"setTmpSVGG");function Jt(e){if(e==="horizontal")dt.chartOrientation="horizontal";else dt.chartOrientation="vertical"}t(Jt,"setOrientation");function ee(e){b.xAxis.title=rt(e.text)}t(ee,"setXAxisTitle");function Ot(e,i){b.xAxis={type:"linear",title:b.xAxis.title,min:e,max:i},wt=!0}t(Ot,"setXAxisRangeData");function ie(e){b.xAxis={type:"band",title:b.xAxis.title,categories:e.map((i)=>rt(i.text))},wt=!0}t(ie,"setXAxisBand");function se(e){b.yAxis.title=rt(e.text)}t(se,"setYAxisTitle");function ne(e,i){b.yAxis={type:"linear",title:b.yAxis.title,min:e,max:i},Et=!0}t(ne,"setYAxisRangeData");function oe(e){let i=Math.min(...e),s=Math.max(...e),n=ct(b.yAxis)?b.yAxis.min:1/0,a=ct(b.yAxis)?b.yAxis.max:-1/0;b.yAxis={type:"linear",title:b.yAxis.title,min:Math.min(n,i),max:Math.max(a,s)}}t(oe,"setYAxisRangeFromPlotData");function Vt(e){let i=[];if(e.length===0)return i;if(!wt){let s=ct(b.xAxis)?b.xAxis.min:1/0,n=ct(b.xAxis)?b.xAxis.max:-1/0;Ot(Math.min(s,1),Math.max(n,e.length))}if(yt(b.xAxis)&&e.length>b.xAxis.categories.length)e=e.slice(0,b.xAxis.categories.length);if(!Et)oe(e);if(yt(b.xAxis))i=b.xAxis.categories.map((s,n)=>[s,e[n]]);if(ct(b.xAxis)){let s=b.xAxis.min,n=b.xAxis.max;if(e.length===1)i=[[`${s}`,e[0]]];else{let a=(n-s)/(e.length-1);i=e.map((h,c)=>[`${s+c*a}`,h])}}return i}t(Vt,"transformDataWithoutCategory");function Ft(e){return Pt[e===0?0:e%Pt.length]}t(Ft,"getPlotColorFromPalette");function re(e,i){let s=i.map((c)=>c.value),n=i.map((c)=>c.label?rt(c.label):""),a=Vt(s),h=n.some((c)=>c!=="");b.plots.push({type:"line",title:rt(e.text),strokeFill:Ft(ut),strokeWidth:2,data:a,...h?{pointLabels:n}:{}}),ut++}t(re,"setLineData");function he(e,i){let s=i.map((a)=>a.value),n=Vt(s);b.plots.push({type:"bar",title:rt(e.text),fill:Ft(ut),data:n}),ut++}t(he,"setBarData");function le(){if(b.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return b.title=G(),Pe.build(dt,b,xt,Kt)}t(le,"getDrawableElem");function ce(){return xt}t(ce,"getChartThemeConfig");function ge(){return dt}t(ge,"getChartConfig");function de(){return b}t(de,"getXYChartData");var Le=t(function(){R(),ut=0,dt=Bt(),b=zt(),xt=It(),Pt=xt.plotColorPalette.split(",").map((e)=>e.trim()),wt=!1,Et=!1},"clear"),Ee={getDrawableElem:le,clear:Le,setAccTitle:M,getAccTitle:O,setDiagramTitle:j,getDiagramTitle:G,getAccDescription:z,setAccDescription:P,setOrientation:Jt,setXAxisTitle:ee,setXAxisRangeData:Ot,setXAxisBand:ie,setYAxisTitle:se,setYAxisRangeData:ne,setLineData:re,setBarData:he,setTmpSVGG:Zt,getChartThemeConfig:ce,getChartConfig:ge,getXYChartData:de},Ie=t((e,i,s,n)=>{let a=n.db,h=a.getChartThemeConfig(),c=a.getChartConfig(),x=a.getXYChartData().plots[0].data.map((w)=>w[1]);function f(w){return w==="top"?"text-before-edge":"middle"}t(f,"getDominantBaseLine");function S(w){return w==="left"?"start":w==="right"?"end":"middle"}t(S,"getTextAnchor");function D(w){return`translate(${w.x}, ${w.y}) rotate(${w.rotation||0})`}t(D,"getTextTransformation"),l.debug(`Rendering xychart chart
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var g=this.next();if(g)return g;else return this.lex()},"lex"),begin:t(function(g){this.conditionStack.push(g)},"begin"),popState:t(function(){var g=this.conditionStack.length-1;if(g>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(g){if(g=this.conditionStack.length-1-Math.abs(g||0),g>=0)return this.conditionStack[g];else return"INITIAL"},"topState"),pushState:t(function(g){this.begin(g)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(g,d,p,C){var o=C;switch(p){case 0:break;case 1:break;case 2:return this.popState(),36;break;case 3:return this.popState(),36;break;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.pushState("acc_descr"),21;break;case 10:return this.popState(),"acc_descr_value";break;case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";break;case 18:return this.pushState("axis_data"),"Y_AXIS";break;case 19:return this.pushState("axis_band_data"),24;break;case 20:return 33;case 21:return this.pushState("data"),16;break;case 22:return this.pushState("data"),18;break;case 23:return this.pushState("data_inner"),24;break;case 24:return 29;case 25:return this.popState(),26;break;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return q}();k.lexer=tt;function T(){this.yy={}}return t(T,"Parser"),T.prototype=k,k.Parser=T,new T}();Tt.parser=Tt;var be=Tt;function bt(e){return e.type==="bar"}t(bt,"isBarPlot");function yt(e){return e.type==="band"}t(yt,"isBandAxisData");function ct(e){return e.type==="linear"}t(ct,"isLinearAxisData");var Et=class{constructor(e){this.parentGroup=e}static{t(this,"TextDimensionCalculatorWithFont")}getMaxDimension(e,i){if(!this.parentGroup)return{width:e.reduce((a,h)=>Math.max(h.length,a),0)*i,height:i};let s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(let a of e){let h=wf(n,1,a),c=h?h.width:a.length*i,x=h?h.height:i;s.width=Math.max(s.width,c),s.height=Math.max(s.height,x)}return n.remove(),s}},$t=0.7,Ut=0.2,qt=class{constructor(e,i,s,n){this.axisConfig=e,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{t(this,"BaseAxis")}setRange(e){if(this.range=e,this.axisPosition==="left"||this.axisPosition==="right")this.boundingRect.height=e[1]-e[0];else this.boundingRect.width=e[1]-e[0];this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map((e)=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){if($t*this.getTickDistance()>this.outerPadding*2)this.outerPadding=Math.floor($t*this.getTickDistance()/2);this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let i=e.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Ut*e.width;this.outerPadding=Math.min(s.width/2,n);let a=s.height;if(this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0)a=Math.max(a,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*s.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*s.height));if(a+=this.axisConfig.labelPadding*2,this.labelTextHeight=s.height,a<=i)i-=a,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width,this.boundingRect.height=e.height-i}calculateSpaceIfDrawnVertical(e){let i=e.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Ut*e.height;this.outerPadding=Math.min(s.height/2,n);let a=s.width+this.axisConfig.labelPadding*2;if(a<=i)i-=a,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width-i,this.boundingRect.height=e.height}calculateSpace(e){if(this.axisPosition==="left"||this.axisPosition==="right")this.calculateSpaceIfDrawnVertical(e);else this.calculateSpaceIfDrawnHorizontally(e);return this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){let i=this.normalizedLabelRotationInRad;if(i===0)return 0;return Math.sin(i)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))});if(this.showTick){let i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");if(this.axisPosition==="bottom")return this.getDrawableElementsForBottomAxis();if(this.axisPosition==="top")return this.getDrawableElementsForTopAxis();return[]}},ye=class extends qt{static{t(this,"BandAxis")}constructor(e,i,s,n,a){super(e,n,a,i);this.categories=s,this.scale=gt().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=gt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5),l.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},we=class extends qt{static{t(this,"LinearAxis")}constructor(e,i,s,n,a){super(e,n,a,i);this.domain=s,this.scale=ta().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];if(this.axisPosition==="left")e.reverse();this.scale=ta().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function Dt(e,i,s,n){let a=new Et(n);if(yt(e))return new ye(i,s,e.categories,e.title,a);return new we(i,s,[e.min,e.max],e.title,a)}t(Dt,"getAxis");var ke=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{t(this,"ChartTitle")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,e.width),n=i.height+2*this.chartConfig.titlePadding;if(i.width<=s&&i.height<=n&&this.chartConfig.showTitle&&this.chartData.title)this.boundingRect.width=s,this.boundingRect.height=n,this.showChartTitle=!0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let e=[];if(this.showChartTitle)e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]});return e}};function Gt(e,i,s,n){let a=new Et(n);return new ke(a,e,i,s)}t(Gt,"getChartTitleComponent");var Ae=0.75,Ce=0.5,Se=0.35;function vt(e){return{fontSize:e,markerSize:e*Ae,markerSpacing:e*Se,itemSpacing:e*Ce}}t(vt,"getLegendLayout");var Re=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{t(this,"ChartLegend")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter((f)=>f.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};let{fontSize:i,markerSize:s,markerSpacing:n,itemSpacing:a}=vt(this.chartConfig.legendFontSize),h=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map((f)=>f.title),i),c=this.chartConfig.legendPadding*2+s+n+h.width,x=this.chartConfig.legendPadding*2+this.visiblePlots.length*i+(this.visiblePlots.length-1)*a;if(c<=e.width&&x<=e.height)this.boundingRect.width=c,this.boundingRect.height=x;else this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];let{fontSize:e,markerSize:i,markerSpacing:s,itemSpacing:n}=vt(this.chartConfig.legendFontSize),a=e+n,h=this.boundingRect.x+this.chartConfig.legendPadding,c=this.boundingRect.y+this.chartConfig.legendPadding,x=[],f=[];for(let[S,D]of this.visiblePlots.entries())if(bt(D))x.push({x:h,y:c+S*a,width:i,height:i,fill:D.fill,strokeFill:D.fill,strokeWidth:0});else{let _=c+S*a+i/2;f.push({path:`M ${h},${_} L ${h+i},${_}`,strokeFill:D.strokeFill,strokeWidth:D.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:x},{groupTexts:["legend","markers"],type:"path",data:f},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((S,D)=>({text:S.title,x:h+i+s,y:c+D*a+i/2,fill:this.chartThemeConfig.legendTextColor,fontSize:e,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}};function jt(e,i,s,n){let a=new Et(n);return new Re(a,e,i,s)}t(jt,"getChartLegendComponent");var _e=class{constructor(e,i,s,n,a){this.plotData=e,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=a}static{t(this,"LinePlot")}getDrawableElement(){let e=this.plotData.data.map((n)=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),i;if(this.orientation==="horizontal")i=Cs().y((n)=>n[0]).x((n)=>n[1])(e);else i=Cs().x((n)=>n[0]).y((n)=>n[1])(e);if(!i)return[];let s=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let h=[];for(let[c,[x,f]]of e.entries()){let S=this.plotData.pointLabels[c];if(!S)continue;if(this.orientation==="horizontal")h.push({x:f+10,y:x,text:S,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0});else h.push({x,y:f-10,text:S,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0})}if(h.length>0)s.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:h})}return s}},Te=class{constructor(e,i,s,n,a,h){this.barData=e,this.boundingRect=i,this.xAxis=s,this.yAxis=n,this.orientation=a,this.plotIndex=h}static{t(this,"BarPlot")}getDrawableElement(){let e=this.barData.data.map((a)=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),i=0.05,s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*0.95,n=s/2;if(this.orientation==="horizontal")return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((a)=>({x:this.boundingRect.x,y:a[0]-n,height:s,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}];return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((a)=>({x:a[0]-n,y:a[1],width:s,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},De=class{constructor(e,i,s){this.chartConfig=e,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}static{t(this,"BasePlot")}setAxes(e,i){this.xAxis=e,this.yAxis=i}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");let e=[];for(let[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{let n=new _e(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break;case"bar":{let n=new Te(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break}return e}};function Qt(e,i,s){return new De(e,i,s)}t(Qt,"getPlotComponent");var ve=class{constructor(e,i,s,n){this.chartConfig=e,this.chartData=i,this.componentStore={title:Gt(e,i,s,n),plot:Qt(e,i,s),legend:jt(e,i,s,n),xAxis:Dt(i.xAxis,e.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},n),yAxis:Dt(i.yAxis,e.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},n)}}static{t(this,"Orchestrator")}calculateVerticalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,a={width:0,height:0},h=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),c=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),x=this.componentStore.plot.calculateSpace({width:h,height:c});if(e-=x.width,i-=x.height,x=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=x.height,i-=x.height,this.componentStore.xAxis.setAxisPosition("bottom"),x=this.componentStore.xAxis.calculateSpace({width:e,height:i}),i-=x.height,this.componentStore.yAxis.setAxisPosition("left"),x=this.componentStore.yAxis.calculateSpace({width:e,height:i}),s=x.width,e-=x.width,a=this.componentStore.legend.calculateSpace({width:e,height:c}),e-=a.width,e>0)h+=e,e=0;if(i>0)c+=i,i=0;if(this.componentStore.plot.calculateSpace({width:h,height:c}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.legend.setBoundingBoxXY({x:s+h,y:n+Math.max((c-a.height)/2,0)}),this.componentStore.xAxis.setRange([s,s+h]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:n+c}),this.componentStore.yAxis.setRange([n,n+c]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some((f)=>bt(f)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,a=0,h={width:0,height:0},c=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),x=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),f=this.componentStore.plot.calculateSpace({width:c,height:x});if(e-=f.width,i-=f.height,f=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=f.height,i-=f.height,this.componentStore.xAxis.setAxisPosition("left"),f=this.componentStore.xAxis.calculateSpace({width:e,height:i}),e-=f.width,n=f.width,this.componentStore.yAxis.setAxisPosition("top"),f=this.componentStore.yAxis.calculateSpace({width:e,height:i}),i-=f.height,a=s+f.height,h=this.componentStore.legend.calculateSpace({width:e,height:x}),e-=h.width,e>0)c+=e,e=0;if(i>0)x+=i,i=0;if(this.componentStore.plot.calculateSpace({width:c,height:x}),this.componentStore.plot.setBoundingBoxXY({x:n,y:a}),this.componentStore.legend.setBoundingBoxXY({x:n+c,y:a+Math.max((x-h.height)/2,0)}),this.componentStore.yAxis.setRange([n,n+c]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:s}),this.componentStore.xAxis.setRange([a,a+x]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some((S)=>bt(S)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){if(this.chartConfig.chartOrientation==="horizontal")this.calculateHorizontalSpace();else this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let i of Object.values(this.componentStore))e.push(...i.getDrawableElements());return e}},Pe=class{static{t(this,"XYChartBuilder")}static build(e,i,s,n){return new ve(e,i,s,n).getDrawableElement()}},ut=0,Kt,dt=Bt(),xt=Mt(),b=zt(),Pt=xt.plotColorPalette.split(",").map((e)=>e.trim()),wt=!1,It=!1;function Mt(){let e=Lt(),i=E();return ae(e.xyChart,i.themeVariables.xyChart)}t(Mt,"getChartDefaultThemeConfig");function Bt(){let e=E();return ae(K.xyChart,e.xyChart)}t(Bt,"getChartDefaultConfig");function zt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}t(zt,"getChartDefaultData");function rt(e){let i=E();return X(e.trim(),i)}t(rt,"textSanitizer");function Zt(e){Kt=e}t(Zt,"setTmpSVGG");function Jt(e){if(e==="horizontal")dt.chartOrientation="horizontal";else dt.chartOrientation="vertical"}t(Jt,"setOrientation");function ee(e){b.xAxis.title=rt(e.text)}t(ee,"setXAxisTitle");function Ot(e,i){b.xAxis={type:"linear",title:b.xAxis.title,min:e,max:i},wt=!0}t(Ot,"setXAxisRangeData");function ie(e){b.xAxis={type:"band",title:b.xAxis.title,categories:e.map((i)=>rt(i.text))},wt=!0}t(ie,"setXAxisBand");function se(e){b.yAxis.title=rt(e.text)}t(se,"setYAxisTitle");function ne(e,i){b.yAxis={type:"linear",title:b.yAxis.title,min:e,max:i},It=!0}t(ne,"setYAxisRangeData");function oe(e){let i=Math.min(...e),s=Math.max(...e),n=ct(b.yAxis)?b.yAxis.min:1/0,a=ct(b.yAxis)?b.yAxis.max:-1/0;b.yAxis={type:"linear",title:b.yAxis.title,min:Math.min(n,i),max:Math.max(a,s)}}t(oe,"setYAxisRangeFromPlotData");function Vt(e){let i=[];if(e.length===0)return i;if(!wt){let s=ct(b.xAxis)?b.xAxis.min:1/0,n=ct(b.xAxis)?b.xAxis.max:-1/0;Ot(Math.min(s,1),Math.max(n,e.length))}if(yt(b.xAxis)&&e.length>b.xAxis.categories.length)e=e.slice(0,b.xAxis.categories.length);if(!It)oe(e);if(yt(b.xAxis))i=b.xAxis.categories.map((s,n)=>[s,e[n]]);if(ct(b.xAxis)){let s=b.xAxis.min,n=b.xAxis.max;if(e.length===1)i=[[`${s}`,e[0]]];else{let a=(n-s)/(e.length-1);i=e.map((h,c)=>[`${s+c*a}`,h])}}return i}t(Vt,"transformDataWithoutCategory");function Ft(e){return Pt[e===0?0:e%Pt.length]}t(Ft,"getPlotColorFromPalette");function re(e,i){let s=i.map((c)=>c.value),n=i.map((c)=>c.label?rt(c.label):""),a=Vt(s),h=n.some((c)=>c!=="");b.plots.push({type:"line",title:rt(e.text),strokeFill:Ft(ut),strokeWidth:2,data:a,...h?{pointLabels:n}:{}}),ut++}t(re,"setLineData");function he(e,i){let s=i.map((a)=>a.value),n=Vt(s);b.plots.push({type:"bar",title:rt(e.text),fill:Ft(ut),data:n}),ut++}t(he,"setBarData");function le(){if(b.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return b.title=G(),Pe.build(dt,b,xt,Kt)}t(le,"getDrawableElem");function ce(){return xt}t(ce,"getChartThemeConfig");function ge(){return dt}t(ge,"getChartConfig");function de(){return b}t(de,"getXYChartData");var Le=t(function(){R(),ut=0,dt=Bt(),b=zt(),xt=Mt(),Pt=xt.plotColorPalette.split(",").map((e)=>e.trim()),wt=!1,It=!1},"clear"),Ee={getDrawableElem:le,clear:Le,setAccTitle:M,getAccTitle:O,setDiagramTitle:j,getDiagramTitle:G,getAccDescription:z,setAccDescription:P,setOrientation:Jt,setXAxisTitle:ee,setXAxisRangeData:Ot,setXAxisBand:ie,setYAxisTitle:se,setYAxisRangeData:ne,setLineData:re,setBarData:he,setTmpSVGG:Zt,getChartThemeConfig:ce,getChartConfig:ge,getXYChartData:de},Ie=t((e,i,s,n)=>{let a=n.db,h=a.getChartThemeConfig(),c=a.getChartConfig(),x=a.getXYChartData().plots[0].data.map((w)=>w[1]);function f(w){return w==="top"?"text-before-edge":"middle"}t(f,"getDominantBaseLine");function S(w){return w==="left"?"start":w==="right"?"end":"middle"}t(S,"getTextAnchor");function D(w){return`translate(${w.x}, ${w.y}) rotate(${w.rotation||0})`}t(D,"getTextTransformation"),l.debug(`Rendering xychart chart
|
|
7
7
|
`+e);let _=ue(i),y=_.append("g").attr("class","main"),W=y.append("rect").attr("width",c.width).attr("height",c.height).attr("class","background");te(_,c.height,c.width,!0),_.attr("viewBox",`0 0 ${c.width} ${c.height}`),W.attr("fill",h.backgroundColor),a.setTmpSVGG(_.append("g").attr("class","mermaid-tmp-group"));let I=a.getDrawableElem(),B={};function N(w){let H=y,u="";for(let[Y]of w.entries()){let U=y;if(Y>0&&B[u])U=B[u];if(u+=w[Y],H=B[u],!H)H=B[u]=U.append("g").attr("class",w[Y])}return H}t(N,"getGroup");for(let w of I){if(w.data.length===0)continue;let H=N(w.groupTexts);switch(w.type){case"rect":if(H.selectAll("rect").data(w.data).enter().append("rect").attr("x",(u)=>u.x).attr("y",(u)=>u.y).attr("width",(u)=>u.width).attr("height",(u)=>u.height).attr("fill",(u)=>u.fill).attr("stroke",(u)=>u.strokeFill).attr("stroke-width",(u)=>u.strokeWidth),c.showDataLabel){let u=c.showDataLabelOutsideBar;if(c.chartOrientation==="horizontal"){let Y=function(k,tt){let{data:T,label:q}=k;return tt*q.length*U<=T.width-A};var J=Y;t(Y,"fitsHorizontally");let U=0.7,A=10,st=w.data.map((k,tt)=>({data:k,label:x[tt].toString()})).filter((k)=>k.data.width>0&&k.data.height>0),V=st.map((k)=>{let{data:tt}=k,T=tt.height*0.7;while(!Y(k,T)&&T>0)T-=1;return T}),ht=Math.floor(Math.min(...V)),v=t((k)=>{if(u)return k.data.x+k.data.width+A;else return k.data.x+k.data.width-A},"determineLabelXPosition");H.selectAll("text").data(st).enter().append("text").attr("x",v).attr("y",(k)=>k.data.y+k.data.height/2).attr("text-anchor",u?"start":"end").attr("dominant-baseline","middle").attr("fill",h.dataLabelColor).attr("font-size",`${ht}px`).text((k)=>k.label)}else{let Y=function(v,k,tt){let{data:T,label:q}=v,r=0.7,g=k*q.length*0.7,d=T.x+T.width/2,p=d-g/2,C=d+g/2,o=p>=T.x&&C<=T.x+T.width,nt=T.y+tt+k<=T.y+T.height;return o&&nt};var et=Y;t(Y,"fitsInBar");let U=10,A=w.data.map((v,k)=>({data:v,label:x[k].toString()})).filter((v)=>v.data.width>0&&v.data.height>0),st=A.map((v)=>{let{data:k,label:tt}=v,T=k.width/(tt.length*0.7);while(!Y(v,T,U)&&T>0)T-=1;return T}),V=Math.floor(Math.min(...st)),ht=t((v)=>{if(u)return v.data.y-U;else return v.data.y+U},"determineLabelYPosition");H.selectAll("text").data(A).enter().append("text").attr("x",(v)=>v.data.x+v.data.width/2).attr("y",ht).attr("text-anchor","middle").attr("dominant-baseline",u?"auto":"hanging").attr("fill",h.dataLabelColor).attr("font-size",`${V}px`).text((v)=>v.label)}}break;case"text":H.selectAll("text").data(w.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",(u)=>u.fill).attr("font-size",(u)=>u.fontSize).attr("dominant-baseline",(u)=>f(u.verticalPos)).attr("text-anchor",(u)=>S(u.horizontalPos)).attr("transform",(u)=>D(u)).text((u)=>u.text);break;case"path":H.selectAll("path").data(w.data).enter().append("path").attr("d",(u)=>u.path).attr("fill",(u)=>u.fill?u.fill:"none").attr("stroke",(u)=>u.strokeFill).attr("stroke-width",(u)=>u.strokeWidth);break}}},"draw"),Me={draw:Ie},Ke={parser:be,db:Ee,renderer:Me};export{Ke as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Df}from"./index-dt7e1328.js";export{Df as default};
|
package/package.json
CHANGED
|
@@ -31,6 +31,7 @@ import { createPortal } from 'preact/compat';
|
|
|
31
31
|
import { placeMenu, type MenuPlacement } from '@/shared/lib/ui/menu-anchor';
|
|
32
32
|
import { Archive, ArchiveRestore, GitBranch, GitFork, Hourglass, Pencil, Trash2, WandSparkles } from 'lucide-preact';
|
|
33
33
|
import { useSearchParams } from '@/client/lib/router/search-params';
|
|
34
|
+
import { clearBranchParams } from '@/client/lib/router/branch-params';
|
|
34
35
|
import { startPendingSession } from '@/client/hooks/chat/omp/pending-sessions';
|
|
35
36
|
import { expandSessionBranch } from '@/client/hooks/workspace/expanded-sessions';
|
|
36
37
|
import { setHarnessPick } from '@/client/hooks/chat/timeline/session-harness';
|
|
@@ -163,7 +164,11 @@ export function SessionActionsMenu({
|
|
|
163
164
|
if (harness) setHarnessPick(pendingId, harness);
|
|
164
165
|
expandSessionBranch(parentId);
|
|
165
166
|
setSearchParams((prev) => {
|
|
166
|
-
|
|
167
|
+
// A fork the user backed out of leaves `forkFrom`/`forkAt` in the URL, and
|
|
168
|
+
// this chat would otherwise be read as that fork (the fork check runs
|
|
169
|
+
// before the child one). Start from a branchless query and set only the
|
|
170
|
+
// parent this child really has.
|
|
171
|
+
const next = clearBranchParams(prev);
|
|
167
172
|
next.set('sessionId', pendingId);
|
|
168
173
|
next.set('parentSessionId', parentId);
|
|
169
174
|
if (folderId !== undefined) next.set('folderId', String(folderId));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useState } from 'preact/hooks';
|
|
2
2
|
import { useSearchParams } from '@/client/lib/router/search-params';
|
|
3
|
+
import { newSessionParams } from '@/client/lib/router/branch-params';
|
|
3
4
|
import { NewWorkspaceModal } from '@/client/components/layout/session-sidebar/Modals';
|
|
4
5
|
import { SchedulerModal } from '@/client/components/layout/session-sidebar/scheduler-modal';
|
|
5
6
|
import { ClassicSidebarView } from '@/client/components/layout/session-sidebar/ClassicView';
|
|
@@ -118,28 +119,21 @@ export function SessionsView({
|
|
|
118
119
|
if (cwd) triggerSessionPrewarm(cwd);
|
|
119
120
|
};
|
|
120
121
|
|
|
122
|
+
/**
|
|
123
|
+
* The sidebar's primary action opens the EMPTY WORKSPACE — the landing, with
|
|
124
|
+
* no query at all.
|
|
125
|
+
*
|
|
126
|
+
* It used to mint a pending `new-…` chat, which made the button inherit the
|
|
127
|
+
* open session's folder and put `?sessionId=new-…&folderId=…` in the URL.
|
|
128
|
+
* That is not empty: the sidebar grew a draft row the user never asked for,
|
|
129
|
+
* and the URL named a chat that did not exist. A landing is the one screen
|
|
130
|
+
* whose contract is "nothing has been chosen yet" — the workspace picker is
|
|
131
|
+
* right there, and the first send spawns the real session from whatever the
|
|
132
|
+
* user picks. Per-folder `+` and New child are different actions and keep
|
|
133
|
+
* their own pending session, because those DO choose a context up front.
|
|
134
|
+
*/
|
|
121
135
|
const handleNewSession = () => {
|
|
122
|
-
|
|
123
|
-
setSearchParams(prev => {
|
|
124
|
-
const currentSessionId = prev.get('sessionId');
|
|
125
|
-
const next = new URLSearchParams(prev);
|
|
126
|
-
// The row this chat will show in the sidebar while omp has not written
|
|
127
|
-
// its transcript yet. The store mints the id (and keeps the row), so the
|
|
128
|
-
// URL carries what the sidebar reads rather than a second source.
|
|
129
|
-
const currentFolder = currentSessionId
|
|
130
|
-
? folders.find(f => f.sessions?.some((s) => String(s.id) === String(currentSessionId)))
|
|
131
|
-
: undefined;
|
|
132
|
-
// The folder the chat will run in: the active session's, else the one the
|
|
133
|
-
// URL already names. Dropping the URL's own `folderId` (the previous
|
|
134
|
-
// `else next.delete`) left a chat opened with `?folderId=` with NO context
|
|
135
|
-
// — its composer then stayed disabled ("Please select a workspace above")
|
|
136
|
-
// and the first send never happened.
|
|
137
|
-
const contextFolderId = currentFolder?.id ?? (prev.get('folderId') ? Number(prev.get('folderId')) : null);
|
|
138
|
-
next.set('sessionId', startPendingSession(contextFolderId));
|
|
139
|
-
if (contextFolderId != null) next.set('folderId', String(contextFolderId));
|
|
140
|
-
else next.delete('folderId');
|
|
141
|
-
return next;
|
|
142
|
-
}, { replace: true });
|
|
136
|
+
setSearchParams(new URLSearchParams(), { replace: true });
|
|
143
137
|
};
|
|
144
138
|
|
|
145
139
|
/**
|
|
@@ -156,22 +150,15 @@ export function SessionsView({
|
|
|
156
150
|
prewarmForNewSession(folderId);
|
|
157
151
|
const pendingId = startPendingSession(folderId);
|
|
158
152
|
setSessionKey(pendingId, 'chat.spawnTarget', { folderId, worktreePath });
|
|
159
|
-
setSearchParams(prev => {
|
|
160
|
-
const next = new URLSearchParams(prev);
|
|
161
|
-
next.set('sessionId', pendingId);
|
|
162
|
-
next.set('folderId', folderId.toString());
|
|
163
|
-
return next;
|
|
164
|
-
}, { replace: true });
|
|
153
|
+
setSearchParams(prev => newSessionParams(prev, pendingId, folderId), { replace: true });
|
|
165
154
|
};
|
|
166
155
|
|
|
167
156
|
const handleNewSessionForFolder = (folderId: number) => {
|
|
168
157
|
prewarmForNewSession(folderId);
|
|
169
|
-
setSearchParams(
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
return next;
|
|
174
|
-
}, { replace: true });
|
|
158
|
+
setSearchParams(
|
|
159
|
+
prev => newSessionParams(prev, startPendingSession(folderId), folderId),
|
|
160
|
+
{ replace: true },
|
|
161
|
+
);
|
|
175
162
|
};
|
|
176
163
|
|
|
177
164
|
const variantProps: SessionSidebarVariantProps = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useCallback, useState } from 'preact/hooks';
|
|
2
2
|
import { useSearchParams } from '@/client/lib/router/search-params';
|
|
3
|
+
import { clearBranchParams, newSessionParams } from '@/client/lib/router/branch-params';
|
|
3
4
|
import { useKabmoEvent } from '@/client/hooks/ui/window-event';
|
|
4
5
|
import { useMobileBackStack } from '@/client/hooks/workspace/mobile-back';
|
|
5
6
|
import type { SettingsCategoryId } from '@/shared/types';
|
|
@@ -170,32 +171,23 @@ export function MobileLayoutWrapper({ onDesktopToggle, appSettings = {} }: Mobil
|
|
|
170
171
|
|
|
171
172
|
const handleSelectSession = (id: number | string) => {
|
|
172
173
|
setSearchParams(prev => {
|
|
173
|
-
|
|
174
|
+
// The branch hints describe a pending draft. A real session selected here
|
|
175
|
+
// is not that draft, and the next New Session must not inherit them.
|
|
176
|
+
const next = clearBranchParams(prev);
|
|
177
|
+
next.set('sessionId', id.toString());
|
|
174
178
|
// Navigating away from a session must also exit its transcript view.
|
|
175
|
-
if (
|
|
176
|
-
return
|
|
179
|
+
if (next.has('subagent')) next.delete('subagent');
|
|
180
|
+
return next;
|
|
177
181
|
}, { replace: true });
|
|
178
182
|
setCurrentScreen('main');
|
|
179
183
|
};
|
|
180
184
|
|
|
181
|
-
//
|
|
182
|
-
//
|
|
183
|
-
//
|
|
185
|
+
// The drawer's primary action mirrors the desktop's: open the EMPTY
|
|
186
|
+
// WORKSPACE — the landing, with a clean URL. A pending `new-…` chat would
|
|
187
|
+
// name a session in the URL and grow a sidebar row before anything was
|
|
188
|
+
// chosen; the landing's own workspace picker is where the choice belongs.
|
|
184
189
|
const handleNewSession = () => {
|
|
185
|
-
|
|
186
|
-
// URL folderId) so the prewarmed cwd matches the eventual spawn cwd.
|
|
187
|
-
const cwd = spawnCwdForNewSession(folders, sessionParam, folderId ?? undefined);
|
|
188
|
-
if (cwd) triggerSessionPrewarm(cwd);
|
|
189
|
-
setSearchParams(prev => {
|
|
190
|
-
const currentSessionId = prev.get('sessionId');
|
|
191
|
-
const next = new URLSearchParams(prev);
|
|
192
|
-
const currentFolder = currentSessionId
|
|
193
|
-
? folders.find(f => f.sessions?.some((s) => String(s.id) === String(currentSessionId)))
|
|
194
|
-
: undefined;
|
|
195
|
-
next.set('sessionId', startPendingSession(currentFolder?.id ?? folderId ?? null));
|
|
196
|
-
if (currentFolder) next.set('folderId', currentFolder.id.toString());
|
|
197
|
-
return next;
|
|
198
|
-
}, { replace: true });
|
|
190
|
+
setSearchParams(new URLSearchParams(), { replace: true });
|
|
199
191
|
setCurrentScreen('main');
|
|
200
192
|
};
|
|
201
193
|
|
|
@@ -205,12 +197,10 @@ export function MobileLayoutWrapper({ onDesktopToggle, appSettings = {} }: Mobil
|
|
|
205
197
|
const handleNewSessionForFolder = (targetFolderId: number) => {
|
|
206
198
|
const cwd = spawnCwdForNewSession(folders, sessionParam, targetFolderId);
|
|
207
199
|
if (cwd) triggerSessionPrewarm(cwd);
|
|
208
|
-
setSearchParams(
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
return next;
|
|
213
|
-
}, { replace: true });
|
|
200
|
+
setSearchParams(
|
|
201
|
+
prev => newSessionParams(prev, startPendingSession(targetFolderId), targetFolderId),
|
|
202
|
+
{ replace: true },
|
|
203
|
+
);
|
|
214
204
|
setCurrentScreen('main');
|
|
215
205
|
};
|
|
216
206
|
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
import { startPendingSession } from '@/client/hooks/chat/omp/pending-sessions';
|
|
21
|
+
import { clearBranchParams } from '@/client/lib/router/branch-params';
|
|
21
22
|
import { triggerSessionPrewarm } from '@/shared/lib/omp/session/prewarm';
|
|
22
23
|
import { setSessionKey } from '@/shared/lib/workspace/session-state/store';
|
|
23
24
|
import { SPAWN_TARGET_KEY } from '@/client/hooks/chat/timeline/spawn-target';
|
|
@@ -41,7 +42,9 @@ export function startWorktreeSession(
|
|
|
41
42
|
const pendingId = startPendingSession(folderId);
|
|
42
43
|
setSessionKey(pendingId, SPAWN_TARGET_KEY, { folderId, worktreePath });
|
|
43
44
|
deps.setSearchParams((prev) => {
|
|
44
|
-
|
|
45
|
+
// A worktree chat is top-level; a fork the user backed out of left its
|
|
46
|
+
// source hints in the URL, and this chat would be drawn as that fork.
|
|
47
|
+
const next = clearBranchParams(prev);
|
|
45
48
|
next.set('sessionId', pendingId);
|
|
46
49
|
next.set('folderId', folderId.toString());
|
|
47
50
|
return next;
|
|
@@ -249,21 +249,6 @@ export function EmptyWorkspacePrompt({
|
|
|
249
249
|
>
|
|
250
250
|
{docked ? (
|
|
251
251
|
<>
|
|
252
|
-
{/* A fork is composed, not created: the source it branches from is
|
|
253
|
-
still switchable, so its picker stays above the transcript the
|
|
254
|
-
preview draws. Every other pending chat loses the row once docked
|
|
255
|
-
because its first send already dispatched the spawn. */}
|
|
256
|
-
{branchPreview && onParentSessionChange && (
|
|
257
|
-
<div className={`shrink-0 flex items-center gap-1 flex-wrap ${isMobile ? 'pl-4 pr-3 pt-3' : 'px-4 pt-3'}`}>
|
|
258
|
-
<ParentSessionPicker
|
|
259
|
-
folders={folders as WorkspaceFolderData[]}
|
|
260
|
-
value={parentSessionId}
|
|
261
|
-
onChange={onParentSessionChange}
|
|
262
|
-
label={branchLabel ?? 'Fork from'}
|
|
263
|
-
allowNone={branchAllowNone ?? false}
|
|
264
|
-
/>
|
|
265
|
-
</div>
|
|
266
|
-
)}
|
|
267
252
|
{/* The pending transcript reserves the box the real timeline's own
|
|
268
253
|
scroller does (`TimelineBody`), so adoption moves no text either. */}
|
|
269
254
|
<div
|
|
@@ -302,6 +287,22 @@ export function EmptyWorkspacePrompt({
|
|
|
302
287
|
/>
|
|
303
288
|
)}
|
|
304
289
|
{heldPrompt}
|
|
290
|
+
{/* A fork is composed, not created, so its source stays switchable
|
|
291
|
+
until the first send. The picker is dock furniture: it belongs
|
|
292
|
+
directly above the composer, where the control it affects is,
|
|
293
|
+
not pinned to the top of the transcript where it reads as part
|
|
294
|
+
of the source history. */}
|
|
295
|
+
{branchPreview && onParentSessionChange && (
|
|
296
|
+
<div className="flex items-center gap-1 flex-wrap px-1 pb-1">
|
|
297
|
+
<ParentSessionPicker
|
|
298
|
+
folders={folders as WorkspaceFolderData[]}
|
|
299
|
+
value={parentSessionId}
|
|
300
|
+
onChange={onParentSessionChange}
|
|
301
|
+
label={branchLabel ?? 'Fork from'}
|
|
302
|
+
allowNone={branchAllowNone ?? false}
|
|
303
|
+
/>
|
|
304
|
+
</div>
|
|
305
|
+
)}
|
|
305
306
|
{composer}
|
|
306
307
|
</ComposerDockFrame>
|
|
307
308
|
</>
|
|
@@ -119,6 +119,17 @@ describe('fork preview in the pending composer', () => {
|
|
|
119
119
|
expect(el.querySelector('[aria-label="Undo this message"]')).toBeNull();
|
|
120
120
|
});
|
|
121
121
|
|
|
122
|
+
test('the fork picker is dock furniture, not part of the transcript', async () => {
|
|
123
|
+
const el = mount({});
|
|
124
|
+
await settle();
|
|
125
|
+
const dock = el.querySelector('[data-composer-dock]');
|
|
126
|
+
const trigger = el.querySelector('[data-testid="parent-session-picker"]');
|
|
127
|
+
expect(trigger, 'the fork picker is missing').not.toBeNull();
|
|
128
|
+
// It used to sit above the preview rows, at the top of the pane; the control
|
|
129
|
+
// it affects is the composer, so it belongs inside the dock.
|
|
130
|
+
expect(dock?.contains(trigger as Node), 'the fork picker is outside the composer dock').toBe(true);
|
|
131
|
+
});
|
|
132
|
+
|
|
122
133
|
test('"Fork from" stays reachable while the preview is docked, and reports a new source', async () => {
|
|
123
134
|
const picked: string[] = [];
|
|
124
135
|
const el = mount({ onParentSessionChange: (id: string | null) => picked.push(String(id)) });
|
|
@@ -26,6 +26,7 @@ import { useBtwSession, type BtwLiveAnswer } from '@/client/hooks/chat/btw';
|
|
|
26
26
|
import { useKabmoEvent } from '@/client/hooks/ui/window-event';
|
|
27
27
|
import { useSessionState } from '@/client/hooks/workspace/session-state';
|
|
28
28
|
import { useSearchParams } from '@/client/lib/router/search-params';
|
|
29
|
+
import { clearBranchParams } from '@/client/lib/router/branch-params';
|
|
29
30
|
import { PHASE_VERBS } from '@/shared/lib/chat/timeline/tool-phrases';
|
|
30
31
|
|
|
31
32
|
/** Question sent when a question arrived carrying only images. */
|
|
@@ -152,7 +153,10 @@ export function useBtwMode(sessionId: string | null): BtwMode {
|
|
|
152
153
|
setOpen(false);
|
|
153
154
|
setSelectedTopicId(null);
|
|
154
155
|
setSearchParams((prev) => {
|
|
155
|
-
|
|
156
|
+
// The promoted topic is a real session, not the draft whose branch hints
|
|
157
|
+
// may still be in the URL (a backed-out fork) — they would describe it as
|
|
158
|
+
// a fork of another chat.
|
|
159
|
+
const next = clearBranchParams(prev);
|
|
156
160
|
next.set('sessionId', created);
|
|
157
161
|
if (next.has('subagent')) next.delete('subagent');
|
|
158
162
|
return next;
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'preact/hooks';
|
|
24
24
|
import { useSearchParams } from '@/client/lib/router/search-params';
|
|
25
|
+
import { clearBranchParams } from '@/client/lib/router/branch-params';
|
|
25
26
|
import { DEFAULT_SESSION_SORT_OPTION, isValidSessionSortOption, sortFolders } from '@/shared/lib/workspace/sidebar-sort';
|
|
26
27
|
import { useSessionStatusAck } from '@/client/hooks/chat/omp/session-statuses';
|
|
27
28
|
import { useSidebarData } from '@/client/hooks/chat/omp/session-list';
|
|
@@ -250,10 +251,15 @@ export function useSessionSidebarController(
|
|
|
250
251
|
onSelectSession(id);
|
|
251
252
|
} else {
|
|
252
253
|
setSearchParams(prev => {
|
|
253
|
-
|
|
254
|
+
// The branch hints belong to a PENDING draft's URL. Selecting a real
|
|
255
|
+
// session must not leave them behind: they would describe this chat as
|
|
256
|
+
// a fork of another, and the next New Session would inherit the source
|
|
257
|
+
// transcript the user already backed out of.
|
|
258
|
+
const next = clearBranchParams(prev);
|
|
259
|
+
next.set('sessionId', id.toString());
|
|
254
260
|
// Navigating away from a session must also exit its transcript view.
|
|
255
|
-
if (
|
|
256
|
-
return
|
|
261
|
+
if (next.has('subagent')) next.delete('subagent');
|
|
262
|
+
return next;
|
|
257
263
|
}, { replace: true });
|
|
258
264
|
}
|
|
259
265
|
onAfterSelect?.();
|
|
@@ -25,6 +25,7 @@ import { useCallback, useEffect, useRef } from 'preact/hooks';
|
|
|
25
25
|
import type { Dispatch, SetStateAction } from 'preact/compat';
|
|
26
26
|
import type { Attachment, ChatMessageData, PromptDispatchResult, WorkspaceFolderData } from '@/shared/types';
|
|
27
27
|
import type { SetSearchParams } from '@/client/lib/router/search-params';
|
|
28
|
+
import { clearBranchParams } from '@/client/lib/router/branch-params';
|
|
28
29
|
import { activeProjectForSession } from '@/shared/lib/workspace/active-project';
|
|
29
30
|
import { startPendingSession, patchPendingEntry } from '@/client/hooks/chat/omp/pending-sessions';
|
|
30
31
|
import { setHarnessPick } from '@/client/hooks/chat/timeline/session-harness';
|
|
@@ -82,7 +83,9 @@ export function useNewChatSubmit(
|
|
|
82
83
|
}
|
|
83
84
|
parkedRef.current = { pendingId, text, attachments, ...(harness ? { harness } : {}) };
|
|
84
85
|
setSearchParams((prev) => {
|
|
85
|
-
|
|
86
|
+
// New Chat starts a top-level chat: a fork that was backed out of left
|
|
87
|
+
// `forkFrom`/`forkAt` in the URL, and this chat would be drawn as it.
|
|
88
|
+
const next = clearBranchParams(prev);
|
|
86
89
|
next.set('sessionId', pendingId);
|
|
87
90
|
// Carry the workspace the chat was started from: the first send SPAWNS a
|
|
88
91
|
// real omp session in that folder's cwd, and a dialog opened from a
|
|
@@ -20,6 +20,7 @@ import type { Attachment, ChatMessageData, PromptDispatchResult } from '@/shared
|
|
|
20
20
|
import type { ArmedGoal } from '@/shared/lib/omp/mode/actions';
|
|
21
21
|
import type { ChatTimelineSendDeps } from '@/client/hooks/chat/timeline/send-props';
|
|
22
22
|
import { adoptPendingSession, pendingEntryFor } from '@/client/hooks/chat/omp/pending-sessions';
|
|
23
|
+
import { clearBranchParams } from '@/client/lib/router/branch-params';
|
|
23
24
|
import { recordSpawnHarness } from '@/client/hooks/chat/timeline/spawn-harness';
|
|
24
25
|
import { childSpawnBody } from '@/client/hooks/chat/timeline/child-spawn';
|
|
25
26
|
import { forkRequestBody } from '@/client/hooks/chat/timeline/fork-request';
|
|
@@ -184,11 +185,8 @@ export async function dispatchPendingChat(
|
|
|
184
185
|
deps.pendingHarnessRef.current = null;
|
|
185
186
|
persistUserTurn(body.sessionId, input.newUserMsg);
|
|
186
187
|
deps.setSearchParams((prev) => {
|
|
187
|
-
const next =
|
|
188
|
+
const next = clearBranchParams(prev);
|
|
188
189
|
next.set('sessionId', body.sessionId!);
|
|
189
|
-
next.delete('forkFrom');
|
|
190
|
-
next.delete('forkAt');
|
|
191
|
-
next.delete('parentSessionId');
|
|
192
190
|
return next;
|
|
193
191
|
}, { replace: true });
|
|
194
192
|
prependInheritedHistory(
|
|
@@ -243,11 +241,10 @@ export async function dispatchPendingChat(
|
|
|
243
241
|
deps.pendingHarnessRef.current = null;
|
|
244
242
|
persistUserTurn(body.sessionId, input.newUserMsg);
|
|
245
243
|
deps.setSearchParams((prev) => {
|
|
246
|
-
|
|
244
|
+
// The branch hints belonged to the pending chat; a real session's URL must
|
|
245
|
+
// not keep them, or the next draft opened here is read as this branch.
|
|
246
|
+
const next = clearBranchParams(prev);
|
|
247
247
|
next.set('sessionId', body.sessionId!);
|
|
248
|
-
// The parameter belonged to the pending chat; a real session's URL must
|
|
249
|
-
// not keep a stale parent hint for a later pending chat.
|
|
250
|
-
next.delete('parentSessionId');
|
|
251
248
|
return next;
|
|
252
249
|
}, { replace: true });
|
|
253
250
|
return { ok: true, busy: false };
|
|
@@ -292,9 +289,8 @@ export async function dispatchPendingChat(
|
|
|
292
289
|
deps.pendingHarnessRef.current = null;
|
|
293
290
|
persistUserTurn(session.sessionId, input.newUserMsg);
|
|
294
291
|
deps.setSearchParams((prev) => {
|
|
295
|
-
const next =
|
|
292
|
+
const next = clearBranchParams(prev);
|
|
296
293
|
next.set('sessionId', session.sessionId);
|
|
297
|
-
next.delete('parentSessionId');
|
|
298
294
|
return next;
|
|
299
295
|
}, { replace: true });
|
|
300
296
|
return { ok: true, busy: false };
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
import { markPendingSessionDraft, pendingSessionWait } from '@/client/hooks/chat/omp/pending-waiting';
|
|
26
26
|
import { restoreHeldDraft } from '@/client/hooks/chat/waiting/restore';
|
|
27
27
|
import { useSearchParams } from '@/client/lib/router/search-params';
|
|
28
|
+
import { clearBranchParams } from '@/client/lib/router/branch-params';
|
|
28
29
|
import type { ToastTone } from '@/shared/lib/ui/toast-duration';
|
|
29
30
|
|
|
30
31
|
export interface WaitingDispatchOptions {
|
|
@@ -74,7 +75,9 @@ export function useWaitingDispatch({ onNotice }: WaitingDispatchOptions = {}): v
|
|
|
74
75
|
// while the dispatch happened elsewhere.
|
|
75
76
|
setSearchParams((prev) => {
|
|
76
77
|
if (prev.get('sessionId') !== pendingId) return prev;
|
|
77
|
-
|
|
78
|
+
// The real session now owns this chat; the draft's branch hints do
|
|
79
|
+
// not belong to it (its fork/child edge is already in the store).
|
|
80
|
+
const next = clearBranchParams(prev);
|
|
78
81
|
next.set('sessionId', prompt.sessionId as string);
|
|
79
82
|
return next;
|
|
80
83
|
}, { replace: true });
|