@open-mercato/cezar 0.17.0-pr976.3708 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/agent-config/validate.d.ts +2 -1
- package/dist/agent-config/validate.js.map +1 -1
- package/dist/api-origin.d.ts +0 -4
- package/dist/api-origin.js +0 -22
- package/dist/api-origin.js.map +1 -1
- package/dist/cockpit-address.d.ts +5 -0
- package/dist/cockpit-address.js +7 -0
- package/dist/cockpit-address.js.map +1 -1
- package/dist/contract/health.d.ts +30 -0
- package/dist/contract/index.d.ts +1 -0
- package/dist/contract/index.js +2370 -2054
- package/dist/contract/projects.d.ts +1 -0
- package/dist/contract/runs.d.ts +178 -2
- package/dist/contract/skills.d.ts +23 -0
- package/dist/contract/webhooks.d.ts +1136 -0
- package/dist/contract/workspace.d.ts +2 -0
- package/dist/core/agent-errors.d.ts +6 -0
- package/dist/core/agent-errors.js +13 -0
- package/dist/core/agent-errors.js.map +1 -1
- package/dist/core/agent-failure-class.d.ts +24 -0
- package/dist/core/agent-failure-class.js +99 -0
- package/dist/core/agent-failure-class.js.map +1 -0
- package/dist/core/agent-runner.d.ts +1 -1
- package/dist/core/claude-cli-runner.d.ts +2 -2
- package/dist/core/claude-cli-runner.js +17 -21
- package/dist/core/claude-cli-runner.js.map +1 -1
- package/dist/core/codex-app-server-runner.d.ts +1 -1
- package/dist/core/codex-app-server-runner.js +20 -23
- package/dist/core/codex-app-server-runner.js.map +1 -1
- package/dist/core/copilot-acp-runner.d.ts +1 -1
- package/dist/core/copilot-acp-runner.js +10 -10
- package/dist/core/copilot-acp-runner.js.map +1 -1
- package/dist/core/cursor-agent-runner.js +18 -22
- package/dist/core/cursor-agent-runner.js.map +1 -1
- package/dist/core/inactivity-deadline.d.ts +21 -0
- package/dist/core/inactivity-deadline.js +49 -0
- package/dist/core/inactivity-deadline.js.map +1 -0
- package/dist/core/junie-runner.d.ts +1 -1
- package/dist/core/junie-runner.js +16 -20
- package/dist/core/junie-runner.js.map +1 -1
- package/dist/core/opencode-server-runner.d.ts +2 -2
- package/dist/core/opencode-server-runner.js +23 -15
- package/dist/core/opencode-server-runner.js.map +1 -1
- package/dist/core/pi-runner.d.ts +1 -1
- package/dist/core/pi-runner.js +8 -10
- package/dist/core/pi-runner.js.map +1 -1
- package/dist/core/provider-auth.js +18 -6
- package/dist/core/provider-auth.js.map +1 -1
- package/dist/core/runner-factory.d.ts +2 -0
- package/dist/core/runner-factory.js +39 -0
- package/dist/core/runner-factory.js.map +1 -1
- package/dist/core/secret-redaction.js +38 -6
- package/dist/core/secret-redaction.js.map +1 -1
- package/dist/data-gitignore.d.ts +1 -1
- package/dist/data-gitignore.js +1 -0
- package/dist/data-gitignore.js.map +1 -1
- package/dist/disk-space.d.ts +38 -0
- package/dist/disk-space.js +113 -0
- package/dist/disk-space.js.map +1 -0
- package/dist/dispatch/prompts.js +1 -1
- package/dist/git-worktree.d.ts +2 -0
- package/dist/git-worktree.js +16 -0
- package/dist/git-worktree.js.map +1 -1
- package/dist/handoff.d.ts +2 -2
- package/dist/handoff.js +1 -1
- package/dist/index.js +24 -3
- package/dist/index.js.map +1 -1
- package/dist/pack-check.d.ts +10 -0
- package/dist/pack-check.js +7 -0
- package/dist/pack-check.js.map +1 -1
- package/dist/release/backport.d.ts +34 -0
- package/dist/release/backport.js +33 -0
- package/dist/release/backport.js.map +1 -0
- package/dist/runs/agent-error-telemetry.d.ts +5 -1
- package/dist/runs/agent-error-telemetry.js +17 -10
- package/dist/runs/agent-error-telemetry.js.map +1 -1
- package/dist/runs/failure-kind.d.ts +1 -1
- package/dist/runs/failure-kind.js +5 -8
- package/dist/runs/failure-kind.js.map +1 -1
- package/dist/runs/lifecycle.d.ts +55 -0
- package/dist/runs/lifecycle.js +24 -0
- package/dist/runs/lifecycle.js.map +1 -0
- package/dist/runs/retention.js +36 -4
- package/dist/runs/retention.js.map +1 -1
- package/dist/runs/store.d.ts +31 -0
- package/dist/runs/store.js +59 -5
- package/dist/runs/store.js.map +1 -1
- package/dist/server/capabilities.js +3 -0
- package/dist/server/capabilities.js.map +1 -1
- package/dist/server/disk-health.d.ts +11 -0
- package/dist/server/disk-health.js +26 -0
- package/dist/server/disk-health.js.map +1 -0
- package/dist/server/forge/github.d.ts +9 -1
- package/dist/server/forge/github.js +42 -3
- package/dist/server/forge/github.js.map +1 -1
- package/dist/server/message-receipts.d.ts +27 -0
- package/dist/server/message-receipts.js +54 -0
- package/dist/server/message-receipts.js.map +1 -0
- package/dist/server/project-context.d.ts +5 -0
- package/dist/server/project-context.js +35 -1
- package/dist/server/project-context.js.map +1 -1
- package/dist/server/server.d.ts +2744 -866
- package/dist/server/server.js +191 -148
- package/dist/server/server.js.map +1 -1
- package/dist/server/webhooks.d.ts +817 -0
- package/dist/server/webhooks.js +91 -0
- package/dist/server/webhooks.js.map +1 -0
- package/dist/server/worktree-lifecycle.d.ts +88 -88
- package/dist/startup-port.d.ts +12 -0
- package/dist/startup-port.js +33 -0
- package/dist/startup-port.js.map +1 -0
- package/dist/telemetry-service.json +1 -0
- package/dist/webhooks/admission.d.ts +360 -0
- package/dist/webhooks/admission.js +294 -0
- package/dist/webhooks/admission.js.map +1 -0
- package/dist/webhooks/coordinator.d.ts +39 -0
- package/dist/webhooks/coordinator.js +215 -0
- package/dist/webhooks/coordinator.js.map +1 -0
- package/dist/webhooks/destination.d.ts +24 -0
- package/dist/webhooks/destination.js +111 -0
- package/dist/webhooks/destination.js.map +1 -0
- package/dist/webhooks/discord.d.ts +4 -0
- package/dist/webhooks/discord.js +102 -0
- package/dist/webhooks/discord.js.map +1 -0
- package/dist/webhooks/endpoints.d.ts +201 -0
- package/dist/webhooks/endpoints.js +345 -0
- package/dist/webhooks/endpoints.js.map +1 -0
- package/dist/webhooks/history.d.ts +42 -0
- package/dist/webhooks/history.js +222 -0
- package/dist/webhooks/history.js.map +1 -0
- package/dist/webhooks/lifecycle.d.ts +34 -0
- package/dist/webhooks/lifecycle.js +60 -0
- package/dist/webhooks/lifecycle.js.map +1 -0
- package/dist/webhooks/limits.d.ts +19 -0
- package/dist/webhooks/limits.js +101 -0
- package/dist/webhooks/limits.js.map +1 -0
- package/dist/webhooks/links.d.ts +12 -0
- package/dist/webhooks/links.js +40 -0
- package/dist/webhooks/links.js.map +1 -0
- package/dist/webhooks/operations.d.ts +24 -0
- package/dist/webhooks/operations.js +128 -0
- package/dist/webhooks/operations.js.map +1 -0
- package/dist/webhooks/outbox.d.ts +37 -0
- package/dist/webhooks/outbox.js +221 -0
- package/dist/webhooks/outbox.js.map +1 -0
- package/dist/webhooks/ownership.d.ts +17 -0
- package/dist/webhooks/ownership.js +254 -0
- package/dist/webhooks/ownership.js.map +1 -0
- package/dist/webhooks/payload.d.ts +6 -0
- package/dist/webhooks/payload.js +112 -0
- package/dist/webhooks/payload.js.map +1 -0
- package/dist/webhooks/platform.d.ts +9 -0
- package/dist/webhooks/platform.js +12 -0
- package/dist/webhooks/platform.js.map +1 -0
- package/dist/webhooks/privacy.d.ts +4 -0
- package/dist/webhooks/privacy.js +43 -0
- package/dist/webhooks/privacy.js.map +1 -0
- package/dist/webhooks/process-identity.d.ts +36 -0
- package/dist/webhooks/process-identity.js +240 -0
- package/dist/webhooks/process-identity.js.map +1 -0
- package/dist/webhooks/scheduler.d.ts +10 -0
- package/dist/webhooks/scheduler.js +43 -0
- package/dist/webhooks/scheduler.js.map +1 -0
- package/dist/webhooks/service.d.ts +313 -0
- package/dist/webhooks/service.js +1005 -0
- package/dist/webhooks/service.js.map +1 -0
- package/dist/webhooks/signing.d.ts +3 -0
- package/dist/webhooks/signing.js +36 -0
- package/dist/webhooks/signing.js.map +1 -0
- package/dist/webhooks/slack.d.ts +4 -0
- package/dist/webhooks/slack.js +56 -0
- package/dist/webhooks/slack.js.map +1 -0
- package/dist/webhooks/source.d.ts +178 -0
- package/dist/webhooks/source.js +23 -0
- package/dist/webhooks/source.js.map +1 -0
- package/dist/webhooks/storage.d.ts +21 -0
- package/dist/webhooks/storage.js +202 -0
- package/dist/webhooks/storage.js.map +1 -0
- package/dist/webhooks/transport.d.ts +30 -0
- package/dist/webhooks/transport.js +235 -0
- package/dist/webhooks/transport.js.map +1 -0
- package/dist/workflows/completion-reason.d.ts +4 -0
- package/dist/workflows/completion-reason.js +39 -0
- package/dist/workflows/completion-reason.js.map +1 -0
- package/dist/workflows/queued-bounds.d.ts +31 -0
- package/dist/workflows/queued-bounds.js +81 -0
- package/dist/workflows/queued-bounds.js.map +1 -0
- package/dist/workflows/run.d.ts +113 -20
- package/dist/workflows/run.js +726 -191
- package/dist/workflows/run.js.map +1 -1
- package/dist/workspace/config.d.ts +8 -0
- package/dist/workspace/config.js +62 -19
- package/dist/workspace/config.js.map +1 -1
- package/dist/workspace/ui-state.d.ts +4 -2
- package/dist/workspace/ui-state.js +13 -9
- package/dist/workspace/ui-state.js.map +1 -1
- package/package.json +4 -3
- package/scripts/check-pack.mjs +2 -4
- package/scripts/mock-claude.mjs +30 -5
- package/scripts/webhooks-schema.mjs +5 -0
- package/web/dist/assets/23I4SOAX-B4MCXPfc.js +2 -0
- package/web/dist/assets/26H2HVXD-DnN7AaEY.js +2 -0
- package/web/dist/assets/2IZ5MNOH-CgfSuFFL.js +1 -0
- package/web/dist/assets/2P3CZEXH-kInGrvHu.js +2 -0
- package/web/dist/assets/3E5HRNYT-DLbBxF6y.js +5 -0
- package/web/dist/assets/3JIRLDUO-B9tVJ8E_.js +1 -0
- package/web/dist/assets/5MJ3UKSG-nDfsJSF7.js +2 -0
- package/web/dist/assets/5THPTBWS-Ce_hS451.js +1 -0
- package/web/dist/assets/7OAKGN26-t-mlpHkx.js +25 -0
- package/web/dist/assets/7WLXJQOR-D6QVYUu9.js +1 -0
- package/web/dist/assets/A255FCTW-Bx0Z-P1v.js +1 -0
- package/web/dist/assets/AM43MQ64-C_UmP8Ka.js +2 -0
- package/web/dist/assets/AOZTNTMC-Di2iVwCo.js +5 -0
- package/web/dist/assets/AQNLM6KG-CcWg0kGq.js +4 -0
- package/web/dist/assets/BNU2RHQB-M1l5nkNs.js +2 -0
- package/web/dist/assets/C5HTQT3I-B50g1XeK.js +4 -0
- package/web/dist/assets/CPKRWH5G-DHdVktma.js +12 -0
- package/web/dist/assets/CUVCMPQX-75g4RQep.js +1 -0
- package/web/dist/assets/D4V2MWCI-Bm34L6wL.js +1 -0
- package/web/dist/assets/DHKBVIA3-Db-JqVOb.js +1 -0
- package/web/dist/assets/DKTLEL5E-DciMwFJ1.js +1 -0
- package/web/dist/assets/DUZNPW7S-4AKJemkg.js +2 -0
- package/web/dist/assets/E3FWOBN4-AT8jzYgb.js +4 -0
- package/web/dist/assets/E65FQMJL-eiWd8F8c.js +1 -0
- package/web/dist/assets/FTXIJQGB-CggtIYAM.js +1 -0
- package/web/dist/assets/G3MDBVQH-BZmnMkFw.js +1 -0
- package/web/dist/assets/G3OATVW2-D5zJu3ib.js +8 -0
- package/web/dist/assets/GUJTEFZK-DPEFMf5Q.js +1 -0
- package/web/dist/assets/IHVFDU4A-pP0Mb5Iu.js +10 -0
- package/web/dist/assets/IV52FOAS-jWHN2JLM.js +5 -0
- package/web/dist/assets/JTJEEBDN-DZeTEWqk.js +2 -0
- package/web/dist/assets/K7FUICZ3-C9JebvoP.js +2 -0
- package/web/dist/assets/LHH2HHRB-DZSZGD4x.js +2 -0
- package/web/dist/assets/MSPQPZZY-DOCBMJ70.js +4 -0
- package/web/dist/assets/OB6ZFVKF-D6V5f56z.js +2 -0
- package/web/dist/assets/PLTZDMI2-DltbYIQQ.js +1 -0
- package/web/dist/assets/R7EPXMMD-Dk_RDmvY.js +5 -0
- package/web/dist/assets/RVARI57O-CgA1WoRv.js +1 -0
- package/web/dist/assets/SPBWZ4VS-8FnOEPzw.js +1 -0
- package/web/dist/assets/SR7OOV3Q-3uZPNU1G.js +4 -0
- package/web/dist/assets/STAXBNH4-C4N6ZLTR.js +2 -0
- package/web/dist/assets/SXFARSFO-DHdVQB4G.js +1 -0
- package/web/dist/assets/TC77ISAL-BgUbI3Of.js +2 -0
- package/web/dist/assets/TYIQQHVC-S2gy0AUp.js +13 -0
- package/web/dist/assets/TZUXETIT-C6qyTEYa.js +2 -0
- package/web/dist/assets/U7N72BGE-8vTdAst9.js +6 -0
- package/web/dist/assets/UFPIB6EZ-BVjLTP07.js +3 -0
- package/web/dist/assets/UO52YEYL-EHYBNpY5.js +3 -0
- package/web/dist/assets/VIK3ONSK-Cton0Rgg.js +2 -0
- package/web/dist/assets/VVVO4ZVP-CdFWI9EE.js +2 -0
- package/web/dist/assets/WRGXZO53-DYQ4OW92.js +3 -0
- package/web/dist/assets/X5SG7MGC-DtC_vaXe.js +2 -0
- package/web/dist/assets/XLHPVVFU-MQkW7HpM.js +2 -0
- package/web/dist/assets/XXYPNCD5-Ib-xj97c.js +5 -0
- package/web/dist/assets/Z6WRYFJC-C6TE3q4J.js +7 -0
- package/web/dist/assets/ZI2QNEGF-DwOKsV8B.js +8 -0
- package/web/dist/assets/{agent-task-pickers-CJAx53eR.js → agent-task-pickers-C_2o0KYX.js} +1 -1
- package/web/dist/assets/{alert-dialog-BugYooRk.js → alert-dialog-fzSWCIyG.js} +1 -1
- package/web/dist/assets/arrow-left-CpV00riO.js +1 -0
- package/web/dist/assets/{automation-format-Bxe-TVRX.js → automation-format-BgAhuFNq.js} +1 -1
- package/web/dist/assets/automations-route-Ca648Wyc.js +1 -0
- package/web/dist/assets/bundle-mjs-rHxsej31.js +1 -0
- package/web/dist/assets/button-vdGgKu1b.js +100 -0
- package/web/dist/assets/{centered-state-Cm8_dS47.js → centered-state-C1nDqaTs.js} +1 -1
- package/web/dist/assets/check-DA3yaTey.js +1 -0
- package/web/dist/assets/chevron-left-D1eW2pzs.js +1 -0
- package/web/dist/assets/chevron-right-DwqBinJp.js +1 -0
- package/web/dist/assets/{chunk-BO2N2NFS-CFvlB0rH.js → chunk-BO2N2NFS-Bde6epwZ.js} +4 -4
- package/web/dist/assets/circle-check-G0BDdNX3.js +1 -0
- package/web/dist/assets/clipboard-B9AGRj3s.js +1 -0
- package/web/dist/assets/{collapsible-BoDLSmkP.js → collapsible-Ci-k9Y0m.js} +1 -1
- package/web/dist/assets/{commit-list-C_l41PzR.js → commit-list-B8qutNJ9.js} +1 -1
- package/web/dist/assets/{compare-variants-Du6vJ7FF.js → compare-variants-CD-H9QV0.js} +1 -1
- package/web/dist/assets/dashboard-BuNIEyIc.js +44 -0
- package/web/dist/assets/diff-DdDwJ41q.js +3 -0
- package/web/dist/assets/{diff-view-D7b6T1ik.js → diff-view-D4eUaNtD.js} +4 -4
- package/web/dist/assets/{download-CHsOA7RH.js → download-C9cyRK4D.js} +1 -1
- package/web/dist/assets/facet-filter-BpaMiUU2.js +5 -0
- package/web/dist/assets/{file-Bu00nVUj.js → file-CcDDcqzK.js} +1 -1
- package/web/dist/assets/file-preview-DyqTWb0f.js +2 -0
- package/web/dist/assets/{file-text-CISqp5LY.js → file-text-C5N0APxx.js} +1 -1
- package/web/dist/assets/{git-pull-request-draft-D2Lm-pPz.js → git-pull-request-draft-Bqwhflhv.js} +1 -1
- package/web/dist/assets/git-tab-loading-BXSixY5p.js +1 -0
- package/web/dist/assets/git-toolbar-CB3F5Ztu.js +1 -0
- package/web/dist/assets/github-CjHl4MMe.js +1 -0
- package/web/dist/assets/{highlighted-body-OFNGDK62-CDHv8VkT.js → highlighted-body-OFNGDK62-k8gmH63p.js} +1 -1
- package/web/dist/assets/{host-usage-CRNpjHr0.js → host-usage-EIcPz8s9.js} +1 -1
- package/web/dist/assets/{icon-tooltip-BrV8FoZY.js → icon-tooltip-CCXhXgac.js} +1 -1
- package/web/dist/assets/index-C_k6g6fh.js +29 -0
- package/web/dist/assets/index-DvagaaKL.css +2 -0
- package/web/dist/assets/{input-6sILF4ZL.js → input-DXFchFdf.js} +1 -1
- package/web/dist/assets/layout-cards-DrC84hQa.js +1 -0
- package/web/dist/assets/lazy-DaFjwB-q.js +11 -0
- package/web/dist/assets/lib-xgA2N1t8.js +1 -0
- package/web/dist/assets/loader-circle-B2Lhi0xN.js +1 -0
- package/web/dist/assets/{markdown-DDUUmNxl.js → markdown-3VbTQcD0.js} +1 -1
- package/web/dist/assets/markdown-DxPHdOwB.js +4 -0
- package/web/dist/assets/mermaid-GHXKKRXX-CQo8vsdt.js +1 -0
- package/web/dist/assets/{message-square-CUcOsOeK.js → message-square-9JNzSy42.js} +1 -1
- package/web/dist/assets/plus-BHSN5Uog.js +1 -0
- package/web/dist/assets/preload-helper-Czpn1I53.js +1 -0
- package/web/dist/assets/{project-router-Uv5K_t7U.js → project-router-BzcW5R3O.js} +2 -2
- package/web/dist/assets/queries-XYjXpa8s.js +1 -0
- package/web/dist/assets/reference-chip-JX3G6Wkk.js +1 -0
- package/web/dist/assets/repo-git-CZTtXETi.js +1 -0
- package/web/dist/assets/{run-diff-CaQSFkcv.js → run-diff-C_s9tHfS.js} +2 -2
- package/web/dist/assets/{save-D8UGIAXq.js → save-B4O7rFCS.js} +1 -1
- package/web/dist/assets/{scroll-within-CEDDAUiO.js → scroll-within-DTBX-TR6.js} +1 -1
- package/web/dist/assets/{search-x-CG0S6SUu.js → search-x-CQPbQgV6.js} +1 -1
- package/web/dist/assets/{settings-2-ogt1zu3P.js → settings-2-CrmZbb_8.js} +1 -1
- package/web/dist/assets/skills-DXkSdyb8.js +1 -0
- package/web/dist/assets/{square-VAdlYQJn.js → square-DCg6avOT.js} +1 -1
- package/web/dist/assets/{tabs-BP29AtfS.js → tabs-Cb8MmIEQ.js} +1 -1
- package/web/dist/assets/{tag-4juVmU06.js → tag-CEWhwfVf.js} +1 -1
- package/web/dist/assets/task-commits-BruCWCkF.js +1 -0
- package/web/dist/assets/{task-graph-4GzVwwdu.js → task-graph-D_OLXJSk.js} +1 -1
- package/web/dist/assets/{task-notes-CCT7q8Fr.js → task-notes-DzOdZjqZ.js} +1 -1
- package/web/dist/assets/task-workspace-C5Conyc1.js +29 -0
- package/web/dist/assets/{terminal-DEjD4n5K.js → terminal-BVAfyHZI.js} +1 -1
- package/web/dist/assets/terminal-drawer-Dcg67RS8.js +3 -0
- package/web/dist/assets/{textarea-DJjpA11v.js → textarea-DywMDkfl.js} +1 -1
- package/web/dist/assets/{token-metrics-BJ1naBNS.js → token-metrics-BiFl2ovY.js} +1 -1
- package/web/dist/assets/{tooltip-BieGyrAz.js → tooltip-7suUQClM.js} +1 -1
- package/web/dist/assets/{tracker-DitRxloO.js → tracker-BFYcbTEV.js} +2 -2
- package/web/dist/assets/{triangle-alert-lwmk_SnN.js → triangle-alert-hMpQrXJS.js} +1 -1
- package/web/dist/assets/{upload-Dx8IzFX_.js → upload-Ddh5Fb-A.js} +1 -1
- package/web/dist/assets/use-now-BlhSvP80.js +1 -0
- package/web/dist/assets/{use-submit-shortcut-B-uDwQhP.js → use-submit-shortcut-BC7gmgDS.js} +1 -1
- package/web/dist/assets/workflow-graph-BljUjNdF.js +13 -0
- package/web/dist/assets/worktree-lifecycle-operation-psNUwGwT.js +18 -0
- package/web/dist/index.html +41 -41
- package/web/dist/assets/arrow-left-FG-BtI91.js +0 -1
- package/web/dist/assets/automations-route-BRN9qRg1.js +0 -1
- package/web/dist/assets/bundle-mjs-BT31bpU6.js +0 -1
- package/web/dist/assets/button-DFlig-3W.js +0 -100
- package/web/dist/assets/check-Bg7-Ecuy.js +0 -1
- package/web/dist/assets/chevron-left-Cd_qkrfl.js +0 -1
- package/web/dist/assets/chevron-right-7BUoNLSN.js +0 -1
- package/web/dist/assets/circle-check-D3dWBsEI.js +0 -1
- package/web/dist/assets/dashboard-BDtFQg4f.js +0 -44
- package/web/dist/assets/diff-DZjcij_W.js +0 -3
- package/web/dist/assets/diff-stat-BIAV32IP.js +0 -1
- package/web/dist/assets/facet-filter-BCQvQXmA.js +0 -5
- package/web/dist/assets/file-preview-B0UXYkxB.js +0 -2
- package/web/dist/assets/git-tab-loading-Dcf8fCoC.js +0 -1
- package/web/dist/assets/git-toolbar-aXyXLu2P.js +0 -1
- package/web/dist/assets/github-PjL79xgT.js +0 -1
- package/web/dist/assets/index-DvwYGTi3.css +0 -2
- package/web/dist/assets/index-DxwI2MZD.js +0 -25
- package/web/dist/assets/layout-cards-Det2whh-.js +0 -1
- package/web/dist/assets/lib-BQXq3kEf.js +0 -1
- package/web/dist/assets/loader-circle-DDkRpp8X.js +0 -1
- package/web/dist/assets/markdown-lc7gwiQQ.js +0 -4
- package/web/dist/assets/mermaid-GHXKKRXX-CbLTa2tM.js +0 -1
- package/web/dist/assets/plus-BqHBcC4w.js +0 -1
- package/web/dist/assets/queries-C09jaXiS.js +0 -1
- package/web/dist/assets/reference-chip-CHF-Sbml.js +0 -1
- package/web/dist/assets/repo-git-DT0rQqvz.js +0 -1
- package/web/dist/assets/skills-Cf8xEPei.js +0 -1
- package/web/dist/assets/task-commits-CyO2Q8jS.js +0 -1
- package/web/dist/assets/task-workspace-C6o0DzgB.js +0 -29
- package/web/dist/assets/terminal-drawer-TV4K7S4u.js +0 -3
- package/web/dist/assets/use-now-Cr9QvR5I.js +0 -1
- package/web/dist/assets/workflow-graph-g3f0xPwZ.js +0 -13
- package/web/dist/assets/worktree-lifecycle-operation-COUqhS7A.js +0 -18
- package/web/dist/assets/x-BrRT8S7Q.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as e}from"./GUJTEFZK-DPEFMf5Q.js";function t(e,t){let n=e.indexOf(`
|
|
2
|
+
`,t);return n===-1?e.length:n}function n(e,t,n){for(let r=0;r<n.length;r++)if((e.charCodeAt(t+r)|32)!==n.charCodeAt(r))return!1;return!0}function r(n,r){let i=n.length,a=r;for(;a<i;){let r=n.charCodeAt(a);if(r===37&&n.charCodeAt(a+1)!==123)a=t(n,a);else{if(r===10)return a;if(e(r))do a++;while(a<i&&e(n.charCodeAt(a)));else if(r===35)a=t(n,a);else return a}}return a}function i(t,n){let r=n;for(;e(t.charCodeAt(r));)r++;return r}function a(e,r,a,o){let s=n(e,r,`accdescr`);if(!s&&!n(e,r,`acctitle`))return r;let c=e.length,l=i(e,r+8),u=e.charCodeAt(l),d=(t,n,r)=>{a.types.push(t),a.texts.push(e.slice(n,r)),a.starts.push(n)};if(u===58){l=i(e,l+1);let n=t(e,l);return d(s?o+2:o,r,l),d(s?o+3:o+1,l,n),n}if(!s||u!==123)return r;for(l=i(e,l+1);e.charCodeAt(l)!==125;){let t=e.indexOf(`}`,l);if(t===-1&&(t=c),d(o+4,l,t),l===c)return c;l=t}return l+1}export{a as i,r as n,t as r,n as t};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{f as e,l as t,p as n}from"./IHVFDU4A-pP0Mb5Iu.js";import{_ as r,a as i,b as a,g as o,h as s,i as c,o as l,p as u,r as d,t as f,u as p,x as m,y as h}from"./E3FWOBN4-AT8jzYgb.js";import{r as ee}from"./DKTLEL5E-DciMwFJ1.js";import{n as g,r as _,t as v}from"./UO52YEYL-EHYBNpY5.js";import{t as te}from"./E65FQMJL-eiWd8F8c.js";import{i as ne,r as re,s as ie}from"./SPBWZ4VS-8FnOEPzw.js";import{t as y}from"./7OAKGN26-t-mlpHkx.js";var b=class{type=`kanban`;title;sections=[];getType=v;last;sectionLevel=0;misplaced;addNode(t,n,r,i,a){let o={id:n,level:t,label:r};if(a!==void 0){let t=a.includes(`
|
|
2
|
+
`)?a+`
|
|
3
|
+
`:`{
|
|
4
|
+
`+a+`
|
|
5
|
+
}`,n;try{n=y(t)}catch(t){throw new e(`Metadata of "${o.id}" is not valid YAML. ${t.message}`,`syntax`,{type:`kanban`})}if(typeof n==`object`&&n&&!Array.isArray(n)){let t=n.shape?String(n.shape):``;if(t!==t.toLowerCase()||t.includes(`_`))throw new e(`No such shape: ${t}. Shape names should be lowercase.`,`semantic`,{type:`kanban`});n.label&&(o.label=String(n.label)),n.icon&&(o.icon=String(n.icon)),n.assigned&&(o.assigned=String(n.assigned)),n.ticket&&(o.ticket=String(n.ticket)),n.priority&&(o.priority=String(n.priority))}}if(this.misplaced)throw new e(`Items without section detected, found section ("${this.misplaced.label}")`,`semantic`,{type:`kanban`});let s=this.sections;if(s.length===0&&(this.sectionLevel=t),this.last=o,t===this.sectionLevel){let e=o;e.items=[],s.push(e)}else s[s.length-1].items.push(o),t<this.sectionLevel&&(this.misplaced=o)}decorateNode(e){let t=this.last;!e||!t||(e.icon&&(t.icon=e.icon),e.class&&(t.cssClasses=e.class))}};function x(e,t){_(e,t,!0)}var S=12,C=8,w=10,T=8,ae=4,E=6,oe=new Map([[`very high`,`stroke="${o}"`],[`high`,`stroke="${o}" opacity="0.5"`],[`low`,`stroke="var(--_m)" opacity="0.5"`],[`very low`,`stroke="var(--_m)"`]]);function D(e,t,n,r,i,a=0){let o=p(e,t,n,r,i,a);if(o.width<=i)return o;let c=[],l=[],u=0,d=[],f=0,m=()=>{c.push(d),l.push(f),u=Math.max(u,f),d=[],f=0};for(let e=0;e<o.lines.length;e++){if(o.widths[e]<=i){d=o.lines[e],f=o.widths[e],m();continue}for(let t of o.lines[e]){if(t.icon!==void 0||t.math){f>0&&f+t.width>i&&m(),d.push(t),f+=t.width;continue}let e=``,a=f;for(let o of t.text){let s=n.width(o,r,t.style);f>0&&f+s>i&&(e&&d.push({text:e,style:t.style,width:f-a}),m(),e=``,a=0),e+=o,f+=s}e&&d.push({text:e,style:t.style,width:f-a})}m()}let h={...o,lines:c,widths:l,width:u,height:c.length*o.lineHeight};return o.heights?s(h):h}function O(e,t,n,r,a,o=!1){let s=``;for(let c=0;c<e.lines.length;c++){let d=e.lines[c],p=n+u(e,c);if(d.length===1&&d[0].icon===void 0&&d[0].math===void 0&&!(d[0].style&56))s+=`<text${f(r,d[0].style)} x="${m(t)}" y="${m(p+e.size*.35)}"${o?` text-anchor="end"`:``}>${i(d[0].text)}</text>`;else{let n=e.widths[c];s+=l(h(e,c),t+(o?-n:n)/2,p,r,a)}}return s}var k=e=>!!e&&n(e)!==``;function A(e,n,o){let s=o.fontSize??16,u=Math.round(s*.875),f=Math.round(s*1.5),h=Math.round(u*1.5),_=o.measurer??t(o.fontFamily,o.fontFamilyMono),v=o.padding??8,y=o.icons,b=n.kanban??{},x=b.sectionWidth,A=u*1.25,j=0,M=(e,t,n)=>{if(!(!e||!e.includes(`$$`)))for(let r of p(e,!0,_,t,1/0).lines)for(let e of r)e.math&&(j=Math.max(j,e.math.width+n))};for(let t of e.sections){let e=_.width(String(t.items.length),u,0);M(t.label,s,2*C+8+e+12+(k(t.icon)?A+E:0));for(let e of t.items){let t=2*(C+w);M(e.label,u,t+(k(e.icon)?A+E:0)),M(e.ticket,u,t),M(e.assigned,u,t)}}let N=Math.max(typeof x==`number`&&x>0?Math.min(Math.max(x,80),2e3):200,Math.ceil(j)),P=o.maxWidth!==void 0&&o.maxWidth>0?o.maxWidth-2*v:1/0,F=e.sections.length,I=F*(N+S)-S<=P,L=I?Math.max(F,1):Math.max(1,Math.floor((P+S)/(N+S))),R=I?N:Math.max(Math.min(N,P),Math.min(Math.floor((P+S)/L)-S,N*2),Math.ceil(j)),z=typeof b.ticketBaseUrl==`string`?b.ticketBaseUrl:``,B=R-2*C,V=B-2*w,H=[],U=e.sections,W=[],G=[],K=[],q=f,J=[];for(let e of U){let t=_.width(String(e.items.length),u,0),n=t+12+(k(e.icon)?A+E:0),r=D(e.label,!0,_,s,B-8-n,1);q=Math.max(q,r.height),G.push(t),W.push(r);let i=[],a=0;for(let t of e.items){let e=D(t.label,!0,_,u,V-(k(t.icon)?A+E:0)),n=D(t.ticket,!1,_,u,V),r=D(t.assigned,!1,_,u,V),o=n.width+r.width+8>V?n.height+r.height:Math.max(n.height,r.height),s=2*w+Math.max(e.height,h)+(o?ae+o:0);i.push({item:t,label:e,ticket:n,assigned:r,meta:o,height:s}),a+=s+T}K.push(i),J.push(a)}q+=2*C;let Y=[],X=[];for(let e=0,t=0;e<U.length;e+=L){let n=T;for(let t=e;t<Math.min(e+L,U.length);t++)n=Math.max(n,J[t]);X.push(t),Y.push(q+n),t+=q+n+S}let se=Y.length>0?X[X.length-1]+Y[Y.length-1]:0,Z=te(e.title,_,s,ee(o)),ce=Z.height>0?Z.height+16:0,le=Math.max(Math.min(U.length,L)*(R+S)-S,0),ue=Math.max(le,Z.width),de=v+(ue-le)/2,fe=R-C-4,pe=``;for(let e=0;e<U.length;e++){let t=U[e],n=Math.floor(e/L),r=`<rect width="${R}" height="${m(Y[n])}" fill="var(--_s)"${d}/>`+O(W[e],C+4,C,` class="pele-cluster-label" font-weight="var(--_hw)"`,y)+`<text class="pele-count" x="${fe}" y="${m(C+f/2+u*.35)}" text-anchor="end" font-size="${u}" fill="var(--_m)">${t.items.length}</text>`;k(t.icon)&&(r+=g(t.icon,fe-G[e]-E-A,C+(f-A)/2,A,y));let s=q;for(let t of K[e]){let e=t.item,n=(e.priority??``).trim().toLowerCase(),l=oe.get(n),f=`<rect width="${B}" height="${m(t.height)}" fill="var(--_bg)" stroke="var(--_b)"${d}/>`;l!==void 0&&(f+=`<path class="pele-priority" d="M2.5,5V${m(t.height-5)}" fill="none" ${l} stroke-width="3" stroke-linecap="round"/>`),f+=O(t.label,w,w,` class="pele-label"`,y),k(e.icon)&&(f+=g(e.icon,B-w-A,w+(h-A)/2,A,y));let p=t.height-w;if(e.ticket){let n=p-t.meta,r=z?ie(ne(z.replace(`#TICKET#`,()=>e.ticket)),o):void 0;r===void 0?f+=O(t.ticket,w,n,` class="pele-ticket" fill="var(--_m)"`,y):(f+=`<a href="${i(r)}" target="_blank"${re(o)}>`+O(t.ticket,w,n,` class="pele-ticket" fill="var(--_c)"`,y)+`</a>`,H.push({id:e.id,href:r,internal:!1}))}e.assigned&&(f+=O(t.assigned,B-w,p-t.assigned.height,` class="pele-assigned" fill="var(--_m)"`,y,!0)),r+=`<g class="pele-node pele-card${l===void 0?``:` pele-priority-`+n.replace(` `,`-`)}${a(e.cssClasses??``)}" data-id="${c(e.id)}" transform="translate(${C},${m(s)})" font-size="${u}">${f}</g>`,s+=t.height+T}pe+=`<g class="pele-cluster pele-column${a(t.cssClasses??``)}" data-id="${c(t.id)}" transform="translate(${m(de+e%L*(R+S))},${m(v+ce+X[n])})">${r}</g>`}let Q=Math.ceil(ue+2*v),$=Math.ceil(se+ce+2*v);return{svg:r(`kanban`,Q,$,s,o,{},l(Z,Q/2,v+Z.height/2,` class="pele-title" font-weight="var(--_tw)"`)+pe),width:Q,height:$,links:H}}var j={type:`kanban`,math:!0,parse(e,t,n){let r=new b;return r.title=n,x(e,r),r},render:A};export{j as kanban};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{i as e}from"./GUJTEFZK-DPEFMf5Q.js";import{a as t,f as n,l as r,u as i}from"./IHVFDU4A-pP0Mb5Iu.js";import{_ as a,a as o,b as s,i as c,o as l,r as u,u as d,x as f}from"./E3FWOBN4-AT8jzYgb.js";import{o as p,r as m}from"./DKTLEL5E-DciMwFJ1.js";import{c as h,d as g,g as _,h as v,i as y,n as b,p as x,t as S}from"./C5HTQT3I-B50g1XeK.js";import{n as C,t as w}from"./DUZNPW7S-4AKJemkg.js";import{t as T}from"./D4V2MWCI-Bm34L6wL.js";var E=/[─━│┃└┗├┣]/,D=/[└┗├┣]/,O=/[─━]/,k=/^[\s│┃]+$/,A=/^[\s─━│┃└┗├┣]+$/,ee=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,j=/^\s*%%/,M=` `;function N(e){return e.some(e=>E.test(e))}function P(e){for(let t of e){let e=D.exec(t);if(e?.index&&e.index>0)return e.index}return 4}function F(e,t){return e.replace(/\bline\s+(\d+)\b/gi,(e,n)=>{let r=t.get(parseInt(n,10));return r?`line ${r}`:e})}function I(e,t){let n=0;for(let r=1;r<t;r++)n=e.indexOf(`
|
|
2
|
+
`,n)+1;return n}function L(e,r,i){let{line:a}=t(e,I(e,r+1));throw new n(`Line ${a}: ${i}`,`syntax`,{type:`treeView`,line:a})}function R(e,t){let n=0;for(let r=0;n<e.length&&r<t;n++)r+=e[n]===` `?4:1;return n}function z(e){let t=new Map,n=new Map;if(!E.test(e))return{text:e,lineMap:t,columns:n};let r=e.split(`
|
|
3
|
+
`),i=-1;for(let e=0;e<r.length;e++)if(r[e].trim()===`treeView-beta`){i=e;break}if(i===-1)return{text:e,lineMap:t,columns:n};let a=e=>e.trim()===``||j.test(e)||ee.test(e),o=[];for(let e=i+1;e<r.length;e++){let t=r[e];a(t)||k.test(t)||o.push(t.replace(/\t/g,` `))}if(!N(o))return{text:e,lineMap:t,columns:n};let s=P(o),c=[],l=(e,r,i)=>{c.push(e),t.set(c.length,r+1),i&&n.set(c.length,i)};for(let e=0;e<=i;e++)l(r[e],e);for(let t=i+1;t<r.length;t++){let n=r[t];if(a(n)){l(n,t);continue}if(k.test(n))continue;let i=n.replace(/\t/g,` `),o=D.exec(i);if(o){let r=Math.round(o.index/s)+1,a=o.index+1;for(;a<i.length&&O.test(i[a]);)a++;for(;a<i.length&&i[a]===` `;)a++;let c=i.slice(a).trimEnd();c||L(e,t,`Empty node — expected a filename or directory name after the box-drawing prefix`);let u=M.repeat(r);l(u+c,t,e=>R(n,a+Math.max(e-u.length,0)))}else{if(A.test(i))continue;E.test(i)?l(n,t):/^\s+/.test(i)?L(e,t,`Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`):l(n,t)}}return{text:c.join(`
|
|
4
|
+
`),lineMap:t,columns:n}}function B(t,n){if(t.startsWith(`##`,n)||t.startsWith(`icon(`,n))return!0;if(!t.startsWith(`:::`,n))return!1;let r=n+3;for(;e(t.charCodeAt(r));)r++;let i=t.charCodeAt(r);return i>=65&&i<=90||i>=97&&i<=122||i===95}function V(t,n){let r=t.charCodeAt(n);if(e(r)||r===10||r===13||r===34||r===39||t.startsWith(`:::`,n)||t.startsWith(`icon(`,n)||t.startsWith(`##`,n))return-1;let i=t.length,a=n+1;for(;a<i;){let n=t.charCodeAt(a);if(n===10||n===13)break;if(e(n)){let n=a+1;for(;e(t.charCodeAt(n));)n++;if(B(t,n))break;a=n}else a++}return a}var H={name:`BARE_NAME`,pattern:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/y,match:V},U=[{...y(`treeView-beta`),longer:[H]},T(),S,x,{name:`CLASS_ANNOTATION`,pattern:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/y},{name:`ICON_ANNOTATION`,pattern:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/y},{name:`DESC_ANNOTATION`,pattern:/[ \t]+##[^\n\r]*/y},{name:`INDENTATION`,pattern:/[ \t]{1,}/y},{name:`QUOTED_NAME`,pattern:/"[^"]*"|'[^']*'/y},{name:`WS`,pattern:/[ \t]+/y,hidden:!0},{name:`ML_COMMENT`,pattern:/\%\%[^\n]*/y,hidden:!0},{name:`NL`,pattern:/\r?\n/y,hidden:!0},H];function W(t){let n=t.length;for(;n>0&&e(t.charCodeAt(n-1));)n--;return n===t.length?t:t.slice(0,n)}function G(e,t){switch(e){case`INDENTATION`:return t?.length||0;case`QUOTED_NAME`:return t.substring(1,t.length-1);case`BARE_NAME`:return W(t);case`CLASS_ANNOTATION`:return t.trim().substring(3).trim();case`ICON_ANNOTATION`:{let e=t.trim();return e.substring(5,e.length-1)}case`DESC_ANNOTATION`:return t.trim().substring(2).trim();default:return}}function K(e){let t=new v(b(e,U,`treeView`),U,`treeView`),n={$type:`TreeView`,nodes:[]};for(t.expect(0);;)if(t.kind===1)n.accDescr=h(t.take());else if(t.kind===2)n.accTitle=_(t.take());else if(t.kind===3)n.title=g(t.take());else break;for(;t.kind!==-1;){let e={$type:`TreeNode`,name:``};if(t.kind===7&&(e.indent=t.take().length),t.kind===8){let n=t.take();e.name=n.substring(1,n.length-1)}else t.kind===12?e.name=W(t.take()):t.fail(`a name`);for(;;)if(t.kind===4)e.classAnnotation=G(`CLASS_ANNOTATION`,t.take());else if(t.kind===5)e.iconAnnotation=G(`ICON_ANNOTATION`,t.take());else if(t.kind===6)e.descAnnotation=G(`DESC_ANNOTATION`,t.take());else break;n.nodes.push(e)}return n}var q=class{count=1;root={id:0,level:-1,name:`/`,nodeType:`directory`,children:[]};stack=[this.root];addNode(e,t,n,r,i,a){let o=this.stack;for(;e<=o[o.length-1].level;)o.pop();let s={id:this.count++,level:e,name:t,nodeType:n,icon:i,cssClass:r,description:a,children:[]};o[o.length-1].children.push(s),o.push(s)}};function te(e,t){for(let n of e.nodes){let e=typeof n.indent==`number`?n.indent:0,r=n.name,i=r.endsWith(`/`);i&&(r=r.slice(0,-1));let a=n.iconAnnotation;t.addNode(e,r,i?`directory`:`file`,n.classAnnotation||void 0,a===void 0?void 0:a||`none`,n.descAnnotation||void 0)}}function ne(e){let{text:r,lineMap:i,columns:a}=z(e);try{return K(r)}catch(o){if(!(o instanceof n)||r===e)throw o;let s=i.get(o.line);if(s===void 0)throw o;let c=o.column>0?a.get(o.line)?.(o.column-1)??o.column-1:0,l=t(e,I(e,s)+c),u=o.message.includes(`
|
|
5
|
+
`)?o.message.indexOf(`
|
|
6
|
+
`):o.message.length,d=o.message.slice(u);throw new n(F(o.message.slice(0,u),new Map([[o.line,l.line]]))+(o.snippet?d.replace(o.snippet,()=>l.snippet):d),o.code,{type:o.type,line:l.line,column:o.column>0?l.column:0,snippet:o.snippet?l.snippet:``})}}function re(e,t){let n=new q;return te(e,n),{type:`treeView`,title:e.title||t,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
|
|
7
|
+
`):void 0,root:n.root,count:n.count}}var J=`mermaid-treeview`,Y=new Map([[`folder`,`M3 6.5A1.5 1.5 0 0 1 4.5 5h4.6l2.4 2.5h8A1.5 1.5 0 0 1 21 9v9a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 18z`],[`file`,`M6.5 3h7L19 8.5v11a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 5 19.5v-15A1.5 1.5 0 0 1 6.5 3zM13.5 3v5.5H19`]]);function X(e,t){if(e===void 0||!Object.prototype.hasOwnProperty.call(e,t))return;let n=e[t];return typeof n==`string`?n:void 0}function ie(e,t){let n=X(t?.filenameIcons,e);if(n)return n;let r=e.lastIndexOf(`.`);if(r>0){let n=e.substring(r).toLowerCase();return X(t?.extensionIcons,n)??X(t?.extensionIcons,n.slice(1))}}function Z(e,t){return e.includes(`:`)?e:Y.has(e)||!t?`${J}:${e}`:`${t}:${e}`}function ae(e,t){if(e.icon!==`none`){if(e.icon)return Z(e.icon,t.defaultIconPack);if(t.showIcons){if(e.nodeType===`file`){let n=ie(e.name,t);if(n===`none`)return;if(n)return Z(n,t.defaultIconPack)}return`${J}:${e.nodeType===`directory`?`folder`:`file`}`}}}function oe(e){let t=e=>typeof e==`object`&&e&&!Array.isArray(e)?e:void 0,n=t(e.treeView)??{};return{showIcons:!!n.showIcons,defaultIconPack:typeof n.defaultIconPack==`string`?n.defaultIconPack:``,filenameIcons:t(n.filenameIcons),extensionIcons:t(n.extensionIcons)}}var se=6,ce=16,le=7,ue=4,Q=4;function $(e,t,n,r,i){let a=e.treeView?.[t];return typeof a==`number`&&a>=r&&a<=i?a:n}function de(e){return{paddingX:$(e,`paddingX`,5,0,100),paddingY:$(e,`paddingY`,2,0,100),rowIndent:$(e,`rowIndent`,15,0,400),lineThickness:$(e,`lineThickness`,1,.25,12)}}function fe(e,t,n){return p(n,r=>pe(e,t,n,r))}function pe(e,t,n,p){let h=n.fontSize??16,g=n.measurer??r(n.fontFamily,n.fontFamilyMono),_=n.padding??8,v=oe(t),{paddingX:y,paddingY:b,rowIndent:x,lineThickness:S}=de(t),T=0,E=e.root.children.map(e=>[e,0]);for(let e=0;p&&e<E.length;e++){let[t,n]=E[e];T=Math.max(T,n);for(let e of t.children)E.push([e,n+1])}let D=p?Math.min(x+y,Math.max(2,((n.maxWidth??320)-120)/Math.max(1,T))):x+y,O=Math.round(h*1.5)+2*b,k=h,A=d(e.title,!1,g,h,p?m(n):4e3,1),ee=A.height>0?A.height+12:0,j=e=>e.some(e=>ae(e,v)!==void 0),M=[],N=new Map,P=[],F=(e,t)=>{let n=j(e);for(let r=e.length-1;r>=0;r--)P.push([e[r],t,n])};F(e.root.children,0);let I=0,L=!1,R=0;for(;P.length>0;){let[e,t,r]=P.pop(),a=t*D,o=i(e.name),s=a+(r?k+se:0),c=Math.max(40,(n.maxWidth??320)-2*_-2*Q-s),l=p?w(o,g,h,c,+(e.nodeType===`directory`)):void 0,u=p&&e.description?w(i(e.description),g,h,c,2):void 0,d=l?l.width:g.width(o,h,+(e.nodeType===`directory`));s+d>I&&(I=s+d);let f=e.cssClass!==void 0&&e.cssClass.split(/\s+/).includes(`highlight`);f&&(L=!0);let m=p?Math.max(O,(l?.height??0)+(u?.height??0)+2*b):O,y={node:e,x:a,cy:R+(p?b+Math.max(k,l?.height??0)/2:m/2),icon:ae(e,v),text:o,labelX:s,highlighted:f,label:l,description:u,top:R,height:m};R+=m,M.push(y),N.set(e,y),F(e.children,t+1)}let z=I+ce,B=I;for(let e of M){let t=e.node.description;if(!t)continue;let n=e.description?e.description.width:g.width(i(t),h,2);B=Math.max(B,(p?e.labelX:z)+n)}B=Math.max(B,A.width);let V=_+(L?Q:0),H=_+ee,U=Math.ceil(B+2*V),W=Math.ceil(H+R+_),G=``;for(let e of M){let t=e.node.children;if(t.length===0)continue;let n=V+e.x+le,r=Math.max(n,V+e.x+D-y),i=H+N.get(t[t.length-1]).cy,a=Math.min(ue,r-n),o=`M${f(n)},${f(H+e.top+e.height-2)}V${f(i-a)}`;a>0&&(o+=`Q${f(n)},${f(i)} ${f(n+a)},${f(i)}H${f(r)}`);for(let e=0;e<t.length-1&&r>n;e++)o+=`M${f(n)},${f(H+N.get(t[e]).cy)}H${f(r)}`;G+=`<path d="${o}"/>`}let K=h*.35,q=``;for(let e of M){let t=e.node,r=H+e.cy,a=t.nodeType===`directory`,l=``;if(e.highlighted){let t=V+e.x-Q;l+=`<rect class="pele-tree-highlight" x="${f(t)}" y="${f(H+e.top+1)}" width="${f(U-V+Q-t)}" height="${f(e.height-2)}" fill="var(--_c)" fill-opacity="0.14"${u}/>`}if(e.icon!==void 0){let t=e.icon.startsWith(J+`:`)?e.icon.slice(J.length+1):``,i=Y.get(t)??Y.get(a?`folder`:`file`),o=n.icons?.(e.icon)??`<path d="${i}" stroke="var(--_m)" stroke-width="1.5"/>`;l+=`<svg class="pele-icon" data-icon="${c(e.icon)}" x="${f(V+e.x)}" y="${f(r-k/2)}" width="${f(k)}" height="${f(k)}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${o}</svg>`}e.label?l+=C(e.label,V+e.labelX,H+e.top+b,` class="pele-label"${a?` font-weight="var(--_hw)"`:``}`):e.text!==``&&(l+=`<text class="pele-label" x="${f(V+e.labelX)}" y="${f(r+K)}"${a?` font-weight="var(--_hw)"`:``} xml:space="preserve">${o(e.text)}</text>`),e.description?l+=C(e.description,V+e.labelX,H+e.top+b+(e.label?.height??0),` class="pele-tree-description" font-style="italic" fill="var(--_m)"`):t.description&&(l+=`<text class="pele-tree-description" x="${f(V+z)}" y="${f(r+K)}" font-style="italic" fill="var(--_m)" xml:space="preserve">${o(i(t.description))}</text>`),q+=`<g class="pele-node pele-tree-${a?`dir`:`file`}${s(t.cssClass??``)}" data-id="${c(t.name)}">${l}</g>`}return{svg:a(`treeView`,U,W,h,n,e,l(A,U/2,_+A.height/2,` class="pele-title" font-weight="var(--_tw)"`)+(G?`<g class="pele-tree-guides" fill="none" stroke="var(--_b)" stroke-width="${f(S)}">${G}</g>`:``)+q),width:U,height:W,links:[]}}var me={type:`treeView`,parse:(e,t,n)=>re(ne(e),n),render:fe};export{me as treeView};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{n as e,t}from"./GUJTEFZK-DPEFMf5Q.js";import{f as n,l as r,n as i,o as a,s as o,u as s}from"./IHVFDU4A-pP0Mb5Iu.js";import{_ as c,a as l,b as u,d,i as f,o as p,s as m,u as h,x as g}from"./E3FWOBN4-AT8jzYgb.js";import{a as _,o as v,r as y,t as b}from"./DKTLEL5E-DciMwFJ1.js";import{a as x,d as S,i as C,l as w,s as T,u as E}from"./CUVCMPQX-75g4RQep.js";import{t as D}from"./E65FQMJL-eiWd8F8c.js";import{a as O,i as k,n as A,r as j,s as ee,t as M}from"./A255FCTW-Bx0Z-P1v.js";import{a as te,i as ne,n as re,r as ie,t as ae}from"./SPBWZ4VS-8FnOEPzw.js";import{t as N}from"./7WLXJQOR-D6QVYUu9.js";import{i as oe,n as se,r as ce,t as le}from"./DHKBVIA3-Db-JqVOb.js";import{i as ue,n as de,r as fe,t as pe}from"./3JIRLDUO-B9tVJ8E_.js";import{t as P}from"./7OAKGN26-t-mlpHkx.js";import{n as me,t as he}from"./FTXIJQGB-CggtIYAM.js";function F(e){return e===`markdown`||e===`string`||e===`text`?e:`markdown`}function ge(e){return e.startsWith(`"`)&&e.endsWith(`"`)?e.substring(1,e.length-1):e}function I(e,t){let n=0;for(let r=0;r<t.length;r++)t[r]===e&&n++;return n}function L(e){let t=e.trim(),n=`arrow_open`;switch(t[0]){case`<`:n=`arrow_point`,t=t.slice(1);break;case`x`:n=`arrow_cross`,t=t.slice(1);break;case`o`:n=`arrow_circle`,t=t.slice(1);break}let r=`normal`;return t.includes(`=`)&&(r=`thick`),t.includes(`.`)&&(r=`dotted`),{type:n,stroke:r}}function R(e){let t=e.trim(),n=t.slice(0,-1),r=`arrow_open`;switch(t.slice(-1)){case`x`:r=`arrow_cross`,t.startsWith(`x`)&&(r=`double_`+r,n=n.slice(1));break;case`>`:r=`arrow_point`,t.startsWith(`<`)&&(r=`double_`+r,n=n.slice(1));break;case`o`:r=`arrow_circle`,t.startsWith(`o`)&&(r=`double_`+r,n=n.slice(1));break}let i=`normal`,a=n.length-1;n.startsWith(`=`)&&(i=`thick`),n.startsWith(`~`)&&(i=`invisible`);let o=I(`.`,n);return o&&(i=`dotted`,a=o),{type:r,stroke:i,length:a}}var z=class{type=`flowchart`;direction;nodes=new Map;edges=[];subgraphs=[];classes=new Map;tooltips=new Map;defaultEdgeStyle;defaultInterpolate;title;accTitle;accDescr;subgraphLookup=new Map;members=new Set;edgeById=new Map;pairCount=new Map;subCount=0;options;constructor(e={}){this.options=e}addVertex(e,t,r,i,a,o,s,c){if(!e||e.trim().length===0)return;let l;if(c!==void 0){let t=c.includes(`
|
|
2
|
+
`)?c+`
|
|
3
|
+
`:`{
|
|
4
|
+
`+c+`
|
|
5
|
+
}`,r;try{r=P(t)}catch(t){throw new n(`Metadata of "${e}" is not valid YAML. ${t.message}`,`syntax`,{type:`flowchart`})}l=typeof r==`object`&&r&&!Array.isArray(r)?r:void 0}let u=this.subgraphLookup.get(e);if(u&&l){u.metadata={...u.metadata,...l};return}let d=this.edgeById.get(e);if(d){l?.animate!==void 0&&(d.animate=l.animate),l?.animation!==void 0&&(d.animation=l.animation),l?.curve!==void 0&&(d.interpolate=l.curve);return}let f=this.nodes.get(e);if(f===void 0&&(t===void 0&&r===void 0&&i!=null&&this.options.warn?.(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:`text`,styles:[],classes:[]},this.nodes.set(e,f)),t===void 0?f.text===void 0&&(f.text=e):(f.labelType=t.type,f.text=ge(t.text.trim())),r!==void 0&&(f.type=r),i!=null)for(let e of i)f.styles.push(e);if(a!=null)for(let e of a)f.classes.push(e);if(o!==void 0&&(f.dir=o),f.props===void 0?f.props=s??{}:s!==void 0&&Object.assign(f.props,s),l===void 0)return;if(l.shape){let e=String(l.shape);if(e!==e.toLowerCase()||e.includes(`_`))throw new n(`No such shape: ${e}. Shape names should be lowercase.`,`semantic`,{type:`flowchart`});if(!he(e))throw new n(`No such shape: ${e}.`,`semantic`,{type:`flowchart`});f.type=e}let p=typeof l.label==`string`?l.label:void 0;l.label&&(f.text=String(l.label),f.labelType=F(l.labelType)),l.icon&&(f.icon=String(l.icon),!p?.trim()&&f.text===e&&(f.text=``)),l.form&&(f.form=String(l.form)),l.pos&&(f.pos=String(l.pos)),l.img&&(f.img=String(l.img),!p?.trim()&&f.text===e&&(f.text=``)),l.constraint&&(f.constraint=String(l.constraint)),l.w&&(f.assetWidth=Number(l.w)),l.h&&(f.assetHeight=Number(l.h))}addSingleLink(e,t,r,i){let a={start:e,end:t,type:void 0,text:``,labelType:`text`,classes:[],isUserDefinedId:!1,interpolate:this.defaultInterpolate},o=r?.text;o!==void 0&&(a.text=ge(o.text.trim()),a.labelType=F(o.type)),r!==void 0&&(a.type=r.type,a.stroke=r.stroke,a.length=r.length>10?10:r.length);let s=e+`\0`+t,c=this.pairCount.get(s)??0;i&&!this.edgeById.has(i)?(a.id=i,a.isUserDefinedId=!0):a.id=`L_${e}_${t}_${c===0?0:c+1}`;let l=this.options.maxEdges;if(l!==void 0&&this.edges.length>=l)throw new n(`Edge limit exceeded. The limit is ${l}.`,`limit`,{type:`flowchart`});this.edges.push(a),this.pairCount.set(s,c+1),this.edgeById.has(a.id)||this.edgeById.set(a.id,a)}addLink(e,t,n){let r=typeof n?.id==`string`?n.id.replace(`@`,``):void 0,i=e[e.length-1],a=t[0];for(let o of e)for(let e of t)this.addSingleLink(o,e,n,o===i&&e===a?r:void 0)}updateLinkInterpolate(e,t){for(let n of e)n==="default"?this.defaultInterpolate=t:this.edgeAt(n).interpolate=t}updateLink(e,t){for(let n of e){if(n==="default"){this.defaultEdgeStyle=t;continue}let e=this.edgeAt(n);e.style=t,t.length>0&&!t.some(e=>e?.startsWith(`fill`))&&t.push(`fill:none`)}}edgeAt(e){let t=this.edges[Number(e)];if(t===void 0)throw new n(`The index ${e} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`,`semantic`,{type:`flowchart`});return t}addClass(e,t){let n=t.join().replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);for(let t of e.split(`,`)){let e=this.classes.get(t);e===void 0&&(e={id:t,styles:[],textStyles:[]},this.classes.set(t,e));for(let t of n)t.includes(`color`)&&e.textStyles.push(t.replace(`fill`,`bgFill`)),e.styles.push(t)}}setDirection(e){let t=e.trim();t.includes(`<`)&&(t=`RL`),t.includes(`^`)&&(t=`BT`),t.includes(`>`)&&(t=`LR`),t.includes(`v`)&&(t=`TB`),t===`TD`&&(t=`TB`),this.direction=t}setClass(e,t){for(let n of e.split(`,`))this.nodes.get(n)?.classes.push(t),this.edgeById.get(n)?.classes.push(t),this.subgraphLookup.get(n)?.classes.push(t)}setTooltip(e,t){if(t!==void 0)for(let n of e.split(`,`))this.tooltips.set(n,t)}setLink(e,t,n){let r=t.trim();for(let t of e.split(`,`)){let e=this.nodes.get(t);e!==void 0&&(e.link=r?ne(r):void 0,e.linkTarget=n)}this.setClass(e,`clickable`)}setClickEvent(e,t,n){this.setClass(e,`clickable`)}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
|
|
6
|
+
`)}addSubGraph(e,t,n){let r=e?.text.trim(),i=n?.text??``;e!==void 0&&e===n&&/\s/.test(i)&&(r=void 0);let a=new Set,o=[],s;for(let e of t)if(typeof e==`string`)e.trim()!==``&&!a.has(e)&&(a.add(e),o.push(e));else if(Array.isArray(e))for(let t of e)t.trim()!==``&&!a.has(t)&&(a.add(t),o.push(t));else s=e.value;s??=this.options.inheritDir?this.direction??this.options.direction:void 0,r??=`subGraph`+this.subCount,i||=``,this.subCount++;let c={id:r,nodes:o,title:i.trim(),classes:[],dir:s,labelType:F(n?.type)},l=this.members;c.nodes=o.filter(e=>!l.has(e)&&e!==r);for(let e of c.nodes)l.add(e);let u=this.subgraphLookup.get(r);if(u)for(let e of c.nodes)u.nodes.push(e);else this.subgraphs.push(c);return this.subgraphLookup.set(r,u??c),r}exists(e,t){for(let n of e)if(n.nodes.includes(t))return!0;return!1}makeUniq(e,t){let n=new Set;for(let e of t)for(let t of e.nodes)n.add(t);return{nodes:e.nodes.filter(e=>!n.has(e))}}destructLink(e,t){let n=R(e);if(!t)return n;let r=L(t);if(r.stroke!==n.stroke)return{type:`INVALID`,stroke:`INVALID`};if(r.type===`arrow_open`)r.type=n.type;else{if(r.type!==n.type)return{type:`INVALID`,stroke:`INVALID`};r.type=`double_`+r.type}return r.type===`double_arrow`&&(r.type=`double_arrow_point`),r.length=n.length,r}subgraph(e){return this.subgraphLookup.get(e)}},B=`$end.INVALID.acc_title.acc_title_value.acc_descr.acc_descr_value.acc_descr_multiline_value.SHAPE_DATA.CALLBACKNAME.CALLBACKARGS.MD_STR.STR.STYLE.DEFAULT.LINKSTYLE.INTERPOLATE.CLASSDEF.CLASS.HREF.CLICK.GRAPH.subgraph.end.LINK_TARGET.NODIR.DIR.direction_tb.direction_bt.direction_rl.direction_lr.direction_td.LINK_ID.NUM.BRKT.STYLE_SEPARATOR.COLON.AMP.SEMI.COMMA.MULT.LINK.START_LINK.EDGE_TEXT.-).TEXT.(-.STADIUMEND.STADIUMSTART.SUBROUTINEEND.SUBROUTINESTART.VERTEX_WITH_PROPS_START.TAGEND.CYLINDEREND.CYLINDERSTART.DOUBLECIRCLEEND.DOUBLECIRCLESTART.TRAPEND.INVTRAPEND.TRAPSTART.INVTRAPSTART.TAGSTART.UP.SEP.DOWN.NODE_STRING.MINUS.UNICODE_TEXT.PIPE.PE.PS.SQE.SQS.DIAMOND_STOP.DIAMOND_START.NEWLINE.SPACE.EOF`.split(`.`),V=new Uint8Array(128);for(let e of`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"#$%&'*+.\`?\\_/`)V[e.charCodeAt(0)]=1;var H=/accTitle\s*:\s*/y,U=/accDescr\s*:\s*/y,_e=/accDescr\s*\{\s*/y,W=/call\s+/y,ve=/click\s+/y,G=/(?:\r?\n)*\s*\n/y,K=/\s*(?:LR|RL|TB|BT|TD|BR)\b/y,ye=/\s*[<>^]/y,be=/\s*v\b/y,xe=[/.*direction\s+TB[^\n]*/y,/.*direction\s+BT[^\n]*/y,/.*direction\s+RL[^\n]*/y,/.*direction\s+LR[^\n]*/y,/.*direction\s+TD[^\n]*/y],q=/[\n\r\u2028\u2029]/g,J=/\s*[xo<]?--+[-xo>]\s*/y,Se=/\s*[xo<]?--\s*/y,Ce=/\s*[xo<]?==+[=xo>]\s*/y,Y=/\s*[xo<]?==\s*/y,X=/\s*[xo<]?-?\.+-[xo>]?\s*/y,we=/\s*[xo<]?-\.\s*/y,Z=/\s*~~~+\s*/y,Te=/(?:\r?\n)+/y,Ee=/[^\S\n\r]+/y,De=/\(\s*\)/y,Oe=/\n\s*/g;function ke(n){let r=n.length,i=[],a=[],o=[],s=[],c=0,l=0,u=!0,d=n.indexOf(`direction`),f=n.indexOf(`@`),p=-1,m=0,h=0,g=-1,_=-1,v=-1,y=(e,t,r)=>{i.push(e),a.push(n.slice(t,r)),o.push(t),l=r},b=e=>{s.push(c),c=e},x=()=>{s.length>0&&(c=s.pop())},S=(e,t)=>(e.lastIndex=t,e.test(n)?e.lastIndex:-1),C=t=>n.startsWith(t,l)&&!e(n.charCodeAt(l+t.length)),w=e=>{let i=e;if(e>=_&&e<=v)i=v;else if(t(n.charCodeAt(e))){for(;i<r&&t(n.charCodeAt(i));)i++;_=e,v=i}let a=n.charCodeAt(i);return a===120||a===111||a===60?n.charCodeAt(i+1):a},T=e=>{let i=e;if(e>=_&&e<=v)i=v;else if(t(n.charCodeAt(e))){for(;i<r&&t(n.charCodeAt(i));)i++;_=e,v=i}return n.charCodeAt(i)===126},E=()=>{n.charCodeAt(l+1)===96?(b(2),l+=2):(b(1),l++)},D=()=>{if(!T(l))return!1;let e=S(Z,l);return e<0?!1:(y(40,l,e),!0)},O=e=>{let t=n.charCodeAt(l+1);return e===40?(t===45?(b(8),y(45,l,l+2)):t===91?(b(7),y(47,l,l+2)):t===40&&n.charCodeAt(l+2)===40?(b(7),y(55,l,l+3)):(b(7),y(69,l,l+1)),!0):e===91?(t===91?(b(7),y(49,l,l+2)):t===40?(b(7),y(53,l,l+2)):t===47?(b(9),y(58,l,l+2)):t===92?(b(9),y(59,l,l+2)):(b(7),y(71,l,l+1)),!0):e===124?(b(7),y(67,l,l+1),!0):e===123?(b(7),y(73,l,l+1),!0):!1},k=e=>{u&&(u=!1,b(6)),y(20,l,l+e)},A=()=>{let e=l;for(;e<r;){let t=n.charCodeAt(e);if(t<128&&V[t]===1)e++;else if(t===45&&e+1<r){let t=n.charCodeAt(e+1);if(t===62||t===45||t===46)break;e++}else break}return e===l?!1:(y(64,l,e),!0)},j=e=>{let t=w(l),n;if(t===45){if((n=S(J,l))>=0)return y(40,l,n),!0;if((n=S(Se,l))>=0)return b(10),y(41,l,n),!0;if((n=S(X,l))>=0)return y(40,l,n),!0;if((n=S(we,l))>=0)return b(12),y(41,l,n),!0}else if(t===61){if((n=S(Ce,l))>=0)return y(40,l,n),!0;if((n=S(Y,l))>=0)return b(11),y(41,l,n),!0}else if(t===46&&(n=S(X,l))>=0)return y(40,l,n),!0;return e!==45&&e!==61&&e!==46&&D()},ee=s=>{let c;switch(s){case 97:if(n.startsWith(`acc`,l)){if((c=S(H,l))>=0)return b(3),y(2,l,c),!0;if((c=S(U,l))>=0)return b(4),y(4,l,c),!0;if((c=S(_e,l))>=0)return b(5),l=c,!0}break;case 64:if(n.charCodeAt(l+1)===123)return b(16),i.push(7),a.push(``),o.push(l),l+=2,!0;break;case 99:if((c=S(W,l))>=0)return b(14),l=c,!0;if(C(`classDef`))return y(16,l,l+8),!0;if(C(`class`))return y(17,l,l+5),!0;if((c=S(ve,l))>=0)return b(13),l=c,!0;break;case 34:return E(),!0;case 115:if(C(`style`))return y(12,l,l+5),!0;if(C(`swimlane-beta`))return k(13),!0;if(C(`subgraph`))return y(21,l,l+8),!0;break;case 100:if(C(`default`))return y(13,l,l+7),!0;break;case 108:if(C(`linkStyle`))return y(14,l,l+9),!0;break;case 105:if(C(`interpolate`))return y(15,l,l+11),!0;break;case 104:if(n.startsWith(`href`,l)&&t(n.charCodeAt(l+4)))return y(18,l,l+5),!0;break;case 102:if(C(`flowchart-elk`))return k(13),!0;if(C(`flowchart`))return k(9),!0;break;case 103:if(C(`graph`))return k(5),!0;break;case 101:if(C(`end`)){for(c=l+3;c<r&&t(n.charCodeAt(c));)c++;return y(22,l,c),!0}break;case 95:if(C(`_self`))return y(23,l,l+5),!0;if(C(`_blank`))return y(23,l,l+6),!0;if(C(`_parent`))return y(23,l,l+7),!0;if(C(`_top`))return y(23,l,l+4),!0;break}if(d!==-1&&l>=m&&(d<l&&(d=n.indexOf(`direction`,l)),d!==-1&&(p<l&&(q.lastIndex=l,p=q.test(n)?q.lastIndex-1:r),d<p))){for(let e=0;e<5;e++)if((c=S(xe[e],l))>=0)return y(26+e,l,c),!0;m=p}if(f!==-1&&s!==34&&!t(s)){if(l>=h){f<l&&(f=n.indexOf(`@`,l));let e=l;for(;e<r;){let r=n.charCodeAt(e);if(r===34||t(r))break;e++}if(h=e,g=-1,f!==-1&&f<e)for(let t=Math.min(e,r-1)-1;t>=f;t--){if(n.charCodeAt(t)!==64)continue;let e=n.charCodeAt(t+1);if(e!==123&&e!==34){g=t;break}}}if(g>l)return y(31,l,g+1),!0}if(s>=48&&s<=57){let e=l+1;for(;e<r;){let t=n.charCodeAt(e);if(t<48||t>57)break;e++}return y(32,l,e),!0}switch(s){case 35:return y(33,l,l+1),!0;case 58:return n.charCodeAt(l+1)===58&&n.charCodeAt(l+2)===58?y(34,l,l+3):y(35,l,l+1),!0;case 38:return y(36,l,l+1),!0;case 59:return y(37,l,l+1),!0;case 44:return y(38,l,l+1),!0;case 42:return y(39,l,l+1),!0;case 120:case 111:return j(s)||A();case 60:return j(s)||y(60,l,l+1),!0;case 45:return j(s)||A()||y(65,l,l+1),!0;case 61:return j(s);case 46:return j(s)||A();case 126:return D();case 40:return O(s);case 91:return n.charCodeAt(l+1)===124?(y(50,l,l+2),!0):O(s);case 124:case 123:return O(s);case 62:return b(7),y(51,l,l+1),!0;case 94:return y(61,l,l+1),!0;case 92:return n.charCodeAt(l+1)===124?(y(62,l,l+2),!0):A();case 118:return e(n.charCodeAt(l+1))?A():(y(63,l,l+1),!0)}return t(s)?j(s)?!0:(c=S(Te,l))>=0?(y(74,l,c),!0):(c=S(Ee,l))>=0?(y(75,l,c),!0):!1:s<128?A():N(s)?(y(66,l,l+1),!0):!1},M=(e,i,a,o)=>{if(e===34)return E(),!0;let s=w(l);if(s===a||s===o){let e=S(i,l);if(e>=0)return x(),y(40,l,e),!0}if(e===a&&(a!==45||n.charCodeAt(l+1)===45))return!1;let c=l+1;for(;c<r;){let e=n.charCodeAt(c);if(e===34)break;if(e===a){if(a!==45||n.charCodeAt(c+1)===45)break}else if(e===120||e===111||e===60||e===o||t(e)){let e=w(c);if((e===a||e===o)&&S(i,c)>=0)break}c++}return y(42,l,c),!0};e:for(;;){if(l>=r){let e=-1;switch(c){case 0:e=76;break;case 3:e=3;break;case 4:e=5;break;case 5:e=6;break;case 13:e=19;break;case 14:e=8;break;case 15:e=9;break}e!==-1&&y(e,r,r);break}let e=n.charCodeAt(l),s=!0;switch(c){case 0:s=ee(e);break;case 1:if(e===34)n.charCodeAt(l+1)===96?(b(2),l+=2):(x(),l++);else{let e=n.indexOf(`"`,l);y(11,l,e===-1?r:e)}break;case 2:if(e===96)n.charCodeAt(l+1)===34?(x(),l+=2):s=!1;else if(e===34)E();else{let e=l+1;for(;e<r;){let t=n.charCodeAt(e);if(t===96||t===34)break;e++}y(10,l,e)}break;case 3:case 4:{let e=n.indexOf(`
|
|
7
|
+
`,l);e===-1&&(e=r);let t=c===3?3:5;x(),y(t,l,e);break}case 5:if(e===125)x(),l++;else{let e=n.indexOf(`}`,l);e===-1&&(e=r),y(6,l,e)}break;case 6:{let t;e===34?E():(t=S(G,l))>=0?(x(),y(24,l,t)):(t=S(K,l))>=0||(t=S(ye,l))>=0||(t=S(be,l))>=0?(x(),y(25,l,t)):s=D()||O(e);break}case 7:{let i=n.charCodeAt(l+1);switch(e){case 34:E();break;case 40:case 91:case 123:O(e);break;case 93:x(),i===41?y(46,l,l+2):i===93?y(48,l,l+2):y(70,l,l+1);break;case 41:x(),i===93?y(52,l,l+2):i===41&&n.charCodeAt(l+2)===41?y(54,l,l+3):y(68,l,l+1);break;case 124:x(),y(67,l,l+1);break;case 125:x(),y(72,l,l+1);break;default:{if((e===126||t(e))&&D())break;let i=l+1;for(;i<r;){let e=n.charCodeAt(i);if(e===91||e===93||e===40||e===41||e===123||e===125||e===124||e===34)break;i++}y(44,l,i)}}break}case 8:{let i=n.charCodeAt(l+1);if(e===34)E();else{if((e===126||t(e))&&D())break;if((e===45||e===47||e===41)&&i===41)x(),y(43,l,l+2);else if(e===40||e===91||e===123)O(e);else if(e===41||e===93||e===125)s=!1;else{let e=l+1;for(;e<r;){let r=n.charCodeAt(e);if(r===34||r===40||r===41||r===91||r===93||r===123||r===125||(r===45||r===47)&&n.charCodeAt(e+1)===41||(r===126||t(r))&&T(e)&&S(Z,e)>=0)break;e++}y(44,l,e)}}break}case 9:{let i=n.charCodeAt(l+1);if(e===34){E();break}if((e===126||t(e))&&D())break;switch(e){case 40:i===45||i===91||i===40&&n.charCodeAt(l+2)===40?O(e):i===93?(x(),y(56,l,l+2)):O(e);break;case 91:case 123:O(e);break;case 92:i===93?(x(),y(56,l,l+2)):y(44,l,l+1);break;case 47:i===93?(x(),y(57,l,l+2)):y(44,l,l+1);break;case 93:case 41:i===93?(x(),y(56,l,l+2)):s=!1;break;case 125:s=!1;break;default:{if((e===63||e===61)&&i===93){x(),y(56,l,l+2);break}let t=l+1;for(;t<r;){let e=n.charCodeAt(t);if(e===92||e===91||e===93||e===40||e===41||e===123||e===125||e===47)break;t++}y(44,l,t)}}break}case 10:s=M(e,J,45,-1);break;case 11:s=M(e,Ce,61,-1);break;case 12:s=M(e,X,46,45);break;case 13:if(e===34)E();else if(t(e))x(),l++;else{let e=l+1;for(;e<r&&!t(n.charCodeAt(e));)e++;y(19,l,e)}break;case 14:if(e===40){let e=S(De,l);x(),e>=0?l=e:(b(15),l++)}else{let e=n.indexOf(`(`,l);e===-1&&(e=r),y(8,l,e)}break;case 15:if(e===41)x(),l++;else{let e=n.indexOf(`)`,l);e===-1&&(e=r),y(9,l,e)}break;case 16:if(e===34)b(17),y(7,l,l+1);else if(e===125)x(),l++;else if(e===94)s=!1;else{let e=l+1;for(;e<r;){let t=n.charCodeAt(e);if(t===125||t===94||t===34)break;e++}y(7,l,e)}break;case 17:if(e===34)x(),y(7,l,l+1);else{let e=n.indexOf(`"`,l);e===-1&&(e=r),i.push(7),a.push(n.slice(l,e).replace(Oe,`<br/>`)),o.push(l),l=e}break}if(!s)return i.push(1),a.push(``),o.push(l),{types:i,texts:a,starts:o};continue e}return i.push(0),a.push(``),o.push(r),{types:i,texts:a,starts:o}}var Ae=new Uint8Array(77);for(let e of[32,64,63,65,13,38,35,36,33,39,66])Ae[e]=1;var je=new Uint8Array(77);for(let e of[32,66,64,25,63,65,38,35,36,33,39])je[e]=1;var Me=new Uint8Array(77);for(let e of[32,64,75,65,36,66,35,39,33,12,14,16,17,19,20,25,21,22,63,61,41])Me[e]=1;var Ne=new Uint8Array(77);for(let e of[32,64,35,75,33,12])Ne[e]=1;var Pe=`'UNICODE_TEXT', 'TEXT', 'TAGSTART'`,Q=[],Fe=/}\s*\n/g;function Ie(e,t){let n=e.includes(`}`)?e.replace(Fe,`}
|
|
8
|
+
`):e,{types:r,texts:s,starts:c}=ke(n),l=0,u,d=t=>{let s=r[l],u=n===e?c[l]:i([o(e,Fe,2)],c[l]);throw s===1?a(`flowchart`,e,u,``,!0):a(`flowchart`,e,u,`Expecting ${t}, got '${B[s]}'`)},f=(e,t=``)=>(r[l]!==e&&d(`'${B[e]}'${t?`, `+t:``}`),s[l++]),p=()=>{let e=r[l];e!==74&&e!==37&&e!==76&&d(`'SEMI', 'NEWLINE', 'EOF'`),l++},m=()=>{Ae[r[l]]===0&&d(`'NODE_STRING'`);let e=s[l++];for(;Ae[r[l]]===1;)e+=s[l++];return e},h=()=>{je[r[l]]===0&&d(`'NODE_STRING'`);let e=s[l++];for(;je[r[l]]===1;)e+=s[l++];return e},g=()=>{let e=r[l],t;if(e===11)t=`string`;else if(e===10)t=`markdown`;else if(e===44||e===60||e===51||e===66)t=`text`;else return d(`${Pe}, 'TAGEND', 'STR', 'MD_STR'`);let n=s[l++];for(;;){let e=r[l];if(e!==44&&e!==60&&e!==51&&e!==66)break;n+=s[l++]}return{text:n,type:t}},_=e=>{f(e,Pe)},v=()=>{let e=r[l],t;if(e===11)t=`string`;else if(e===10)t=`markdown`;else if(e===42||e===66)t=`text`;else return d(`'EDGE_TEXT', 'STR', 'MD_STR'`);let n=s[l++];for(;r[l]===42||r[l]===66;)n+=s[l++];return{text:n,type:t}},y=()=>{let e=r[l],t;if(e===11)t=`text`;else if(e===10)t=`markdown`;else if(Me[e]===1)t=`text`;else return d(`'NODE_STRING', 'STR', 'MD_STR'`);let n=s[l++];for(;Me[r[l]]===1;)n+=s[l++];return{text:n,type:t}},b=()=>{let e=s[l++];for(;r[l]===7;)e+=s[l++];return e},x=()=>{let e=m(),n;switch(r[l]){case 71:l++,n=g(),_(70),t.addVertex(e,n,`square`);break;case 55:l++,n=g(),_(54),t.addVertex(e,n,`doublecircle`);break;case 69:l++,r[l]===69?(l++,n=g(),_(68),f(68),t.addVertex(e,n,`circle`)):(n=g(),_(68),t.addVertex(e,n,`round`));break;case 45:l++,n=g(),_(43),t.addVertex(e,n,`ellipse`);break;case 47:l++,n=g(),_(46),t.addVertex(e,n,`stadium`);break;case 49:l++,n=g(),_(48),t.addVertex(e,n,`subroutine`);break;case 50:{l++;let r=f(64);f(35);let i=f(64);f(67),n=g(),_(70),t.addVertex(e,n,`rect`,void 0,void 0,void 0,{[r]:i});break}case 53:l++,n=g(),_(52),t.addVertex(e,n,`cylinder`);break;case 73:l++,r[l]===73?(l++,n=g(),_(72),f(72),t.addVertex(e,n,`hexagon`)):(n=g(),_(72),t.addVertex(e,n,`diamond`));break;case 51:l++,n=g(),_(70),t.addVertex(e,n,`odd`);break;case 58:l++,n=g(),r[l]===57?(l++,t.addVertex(e,n,`lean_right`)):(_(56),t.addVertex(e,n,`trapezoid`));break;case 59:l++,n=g(),r[l]===56?(l++,t.addVertex(e,n,`lean_left`)):(_(57),t.addVertex(e,n,`inv_trapezoid`));break;default:t.addVertex(e)}return e},S=()=>{let e=x();return r[l]===34&&(l++,t.setClass(e,m())),e},C=()=>{let e=[S()];for(u=void 0;;){let n=r[l]===7?b():void 0;if(r[l]!==75)return u=n,e;do l++;while(r[l]===75);if(r[l]!==36)return n!==void 0&&d(`'AMP'`),e;l++,r[l]!==75&&d(`'SPACE'`);do l++;while(r[l]===75);let i=S();n!==void 0&&t.addVertex(e[e.length-1],void 0,void 0,void 0,void 0,void 0,void 0,n),e.push(i)}},w=()=>{let e;if(r[l]===31&&(e=s[l++]),r[l]===40){let n=t.destructLink(s[l++]);return e!==void 0&&(n.id=e),r[l]===67&&(l++,n.text=g(),_(67),r[l]===75&&l++),n}if(r[l]===41){let n=s[l++],r=v(),i=f(40,`'EDGE_TEXT'`),a=t.destructLink(i,n);return a.text=r,e!==void 0&&(a.id=e),a}return d(`'LINK', 'START_LINK'`)},T=e=>{let n=C();u!==void 0&&t.addVertex(n[n.length-1],void 0,void 0,void 0,void 0,void 0,void 0,u);let i=n;for(;;){let a=r[l];if(a!==40&&a!==41&&a!==31)return i;let o=w(),s=C();u!==void 0&&t.addVertex(s[s.length-1],void 0,void 0,void 0,void 0,void 0,void 0,u),t.addLink(n,s,o),e&&(i=s.concat(i)),n=s}},E=()=>{Ne[r[l]]===0&&d(`'NODE_STRING', 'NUM', 'COLON', 'BRKT'`);let e=s[l++];for(;Ne[r[l]]===1;)e+=s[l++];return e},D=()=>{let e=[E()];for(;r[l]===38;)l++,e.push(E());return e},O=()=>{l++,f(75);let e;if(r[l]===13)e=[s[l++]];else for(e=[f(32,`'DEFAULT'`)];r[l]===38;)l++,e.push(f(32));if(f(75),r[l]!==15){t.updateLink(e,D());return}l++,f(75);let n=h();if(r[l]===75){l++;let r=D();t.updateLinkInterpolate(e,n),t.updateLink(e,r)}else t.updateLinkInterpolate(e,n)},k=(e,n)=>{if(r[l]!==75){t.setLink(e,n);return}if(l++,r[l]===23){t.setLink(e,n,s[l++]);return}let i=f(11,`'LINK_TARGET'`);r[l]===75?(l++,t.setLink(e,n,f(23))):t.setLink(e,n),t.setTooltip(e,i)},A=()=>{let e=s[l++];switch(r[l]){case 8:{let n=s[l++],i=r[l]===9,a=i?s[l++]:void 0,o;r[l]===75&&(l++,o=f(11)),i?t.setClickEvent(e,n,a):t.setClickEvent(e,n),o!==void 0&&t.setTooltip(e,o);return}case 18:l++,k(e,f(11));return;case 11:k(e,s[l++]);return;default:{let n=h();if(r[l]===75){l++;let r=f(11);t.setClickEvent(e,n),t.setTooltip(e,r)}else t.setClickEvent(e,n)}}},j=()=>{l++;let e=r[l];if(e===74||e===37||e===76)return l++,{id:void 0,title:void 0,list:[],collect:!1};f(75,`'SEMI', 'NEWLINE', 'EOF'`);let t=y(),n=t;return r[l]===71&&(l++,n=g(),_(70)),e=r[l],e!==74&&e!==37&&e!==76&&d(`'SEMI', 'NEWLINE', 'EOF', 'SQS'`),l++,{id:t,title:n,list:[],collect:!1}},ee=e=>{let n=r[l];switch(n){case 12:{l++,f(75);let e=m();return f(75),t.addVertex(e,void 0,void 0,D()),p(),Q}case 14:return O(),p(),Q;case 16:{l++,f(75);let e=m();return f(75),t.addClass(e,D()),p(),Q}case 17:{l++,f(75);let e=m();return f(75),t.setClass(e,m()),p(),Q}case 19:return A(),p(),Q;case 26:case 27:case 28:case 29:case 30:return l++,{stmt:`dir`,value:Le[n-26]};case 2:{l++;let e=f(3).trim();return t.setAccTitle(e),e}case 4:{l++;let e=f(5).trim();return t.setAccDescription(e),e}case 6:{let e=s[l++].trim();return t.setAccDescription(e),e}default:{Ae[n]===0&&d(Re);let t=T(e);return p(),t}}},M=()=>{let e=[],n=[],i=!1;for(;;){let a=r[l];if(a===0)break;if(a===22){let r=e.pop();if(r===void 0)break;l++;let a=t.addSubGraph(r.id,n,r.title);n=r.list,i=r.collect,i&&n.push(a)}else if(a===37||a===74||a===75||a===76)i&&n.push(s[l]),l++;else if(a===21){let t=j();t.list=n,t.collect=i,e.push(t),n=[],i=!0}else{let e=ee(i);i&&(!Array.isArray(e)||e.length>0)&&n.push(e)}}e.length>0&&d(`'end'`)};for(;r[l]===75||r[l]===74;)l++;if(f(20,`'SPACE', 'NEWLINE'`),r[l]===24)l++,t.setDirection(`TB`);else{let e=f(25,`'NODIR'`),n=r[l];if(n===75){do l++;while(r[l]===75);n=r[l],n!==74&&d(`'NEWLINE', 'SPACE'`)}else n!==37&&n!==74&&d(`'SEMI', 'NEWLINE', 'SPACE'`);l++,t.setDirection(e)}M(),r[l]!==0&&d(Re)}var Le=[`TB`,`BT`,`RL`,`LR`,`TD`],Re=`'SEMI', 'NEWLINE', 'SPACE', 'EOF', 'subgraph', 'acc_title', 'acc_descr', 'acc_descr_multiline_value', 'STYLE', 'LINKSTYLE', 'CLASSDEF', 'CLASS', 'CLICK', 'NODE_STRING'`;function ze(e){if(e.img)return`imageSquare`;if(e.icon)return e.form===`circle`?`iconCircle`:e.form===`square`?`iconSquare`:e.form===`rounded`?`iconRounded`:`icon`;switch(e.type){case`square`:case void 0:return`squareRect`;case`round`:return`roundedRect`;default:return e.type}}function Be(e){switch(e){case`arrow_point`:case`arrow_circle`:case`arrow_cross`:return[`none`,e];case`double_arrow_point`:case`double_arrow_circle`:case`double_arrow_cross`:{let t=e.replace(`double_`,``);return[t,t]}}return[`none`,`arrow_point`]}function Ve(e,t){let n=[],r=[],i=e.subgraphs,a=t=>{let n=[];for(let r of t){let t=e.classes.get(r);if(t!==void 0){for(let e of t.styles)n.push(e.trim());for(let e of t.textStyles)n.push(e.trim())}}return n},o=new Map;for(let t of i)for(let n of t.nodes)e.subgraph(n)&&o.set(n,t.id);let s=new Map,c=new Map;for(let e of i){let t=o.get(e.id);if(t===void 0)continue;let n=c.get(t);n?n.push(e.id):c.set(t,[e.id])}let l=0;for(let e of i){if(o.has(e.id))continue;let t=[e.id];for(;t.length>0;){let e=t.pop();if(s.has(e))continue;s.set(e,l++);let n=c.get(e);if(n)for(let e=n.length-1;e>=0;e--)t.push(n[e])}}let u=t=>e.subgraph(t)?.metadata?.view===`collapsed`,d=!1;for(let e of i)e.metadata?.view===`collapsed`&&(d=!0);let f=new Map,p=e=>{let t=[],n=new Set,r=e;for(;r!==void 0&&!f.has(r)&&!n.has(r);)n.add(r),t.push(r),r=o.get(r);let i=r===void 0?void 0:f.get(r);for(let e=t.length-1;e>=0;e--)i===void 0&&u(t[e])&&(i=t[e]),f.set(t[e],i);return i},m=new Set,h=new Map;for(let e of d?i:[]){let t=p(e.id);if(t!==void 0){e.id!==t&&(m.add(e.id),h.set(e.id,t));for(let n of e.nodes)n!==t&&(m.add(n),h.set(n,t))}}let g=new Map,_=new Set;for(let e=i.length-1;e>=0;e--){let t=i[e];if(!m.has(t.id)){t.nodes.length>0&&_.add(t.id);for(let e of t.nodes)g.set(e,t.id)}}let v=new Map;for(let e=i.length-1;e>=0;e--){let t=i[e];if(m.has(t.id))continue;let r=t.metadata?.view===`collapsed`,o={id:t.id,label:t.title,labelType:t.labelType,parentId:g.get(t.id),cssStyles:[],cssCompiledStyles:a(t.classes),cssClasses:t.classes.join(` `),shape:r?`collapsedGroup`:`rect`,dir:t.dir,isGroup:!r,colorIndex:s.get(t.id)};r||(o.metadata=t.metadata),n.push(o),v.set(t.id,o)}for(let t of e.nodes.values()){if(m.has(t.id))continue;let r=v.get(t.id);if(r){r.cssStyles=t.styles,r.cssCompiledStyles=a(t.classes),r.cssClasses=t.classes.join(` `);continue}let i=_.has(t.id),o={id:t.id,label:t.text,labelType:t.labelType,parentId:g.get(t.id),cssStyles:t.styles,cssCompiledStyles:a([`default`,`node`,...t.classes]),cssClasses:`default `+t.classes.join(` `),dir:t.dir,link:t.link,linkTarget:t.linkTarget,tooltip:e.tooltips.get(t.id),icon:t.icon,pos:t.pos,img:t.img,assetWidth:t.assetWidth,assetHeight:t.assetHeight,constraint:t.constraint,isGroup:i,shape:i?`rect`:ze(t)};n.push(o)}return e.edges.forEach((n,i)=>{let o=h.get(n.start)??n.start,s=h.get(n.end)??n.end;if(o===s&&(h.has(n.start)||h.has(n.end)))return;let[c,l]=Be(n.type),u=[...e.defaultEdgeStyle??[]];n.style&&u.push(...n.style);let d=n.stroke===`invisible`||n.type===`arrow_open`;r.push({id:n.id||`L_${o}_${s}_${i}`,isUserDefinedId:n.isUserDefinedId,start:o,end:s,type:n.type??`normal`,label:n.text,labelType:n.labelType,thickness:n.stroke,pattern:n.stroke,minlen:n.length,classes:n.stroke===`invisible`?``:`edge-thickness-normal edge-pattern-solid flowchart-link`,arrowTypeStart:d?`none`:c,arrowTypeEnd:d?`none`:l,cssCompiledStyles:a(n.classes),style:u,animate:n.animate,animation:n.animation,curve:n.interpolate||e.defaultInterpolate||t})}),{nodes:n,edges:r}}var He=40,Ue=16,We=48,Ge=20,Ke=26,qe=` fill="var(--_s)" stroke="var(--_b)"`,Je=` stroke="var(--_b)"`;function Ye(e,t,n){let r=e[t];return typeof r==`number`&&r>0?Math.min(r,2e3):n}function $(e,t){return e!==void 0&&e>0&&e<=4e3?e:t}function Xe(e,t,n,r){let i=i=>v(n,a=>Ze(e,t,n,r,i,a));return _(e.direction)?b(n,i):i(!1)}function Ze(e,t,n,i,a,o){let _=o?12:Ge,v=i?t[i.type]:void 0,b=typeof v==`object`&&v&&!Array.isArray(v)?v:t.flowchart??{},N=Ve(e,typeof b.curve==`string`?b.curve:void 0);i?.prepare(N);let P=n.fontSize??16,he=Math.round(P*.875),F=n.measurer??r(n.fontFamily,n.fontFamilyMono),ge=Math.min(Ye(b,`wrappingWidth`,200),i&&o?100:1/0),I=n.padding??8,L=n.icons,R=new Map,z=[],B=[];N.nodes.forEach((e,t)=>R.set(e.id,t));for(let e of N.nodes){let t=m(e.cssStyles.length>0?e.cssCompiledStyles.concat(e.cssStyles):e.cssCompiledStyles),r=!!t.bold|(t.italic?2:0),a=e.labelType===`markdown`,s=t.fontSize??P,c,l;if(e.isGroup){let u=h(e.label,a,F,s,i&&o?Math.max(80,y(n)/2):4e3,r);c={node:e,style:t,label:u,shape:`group`,w:0,h:0,dy:0,loops:0},l=pe(0,0),l.isGroup=!0,l.dir=e.dir?fe(e.dir):void 0,l.padX=_,l.padTop=u.height>0?u.height+16:Ge,l.padBottom=_,l.minW=u.width+2*_-12}else{let n=me(e.shape),i=h(e.img||e.icon||ee(n)?e.label:void 0,a,F,s,ge,r),o,u,d=0;if(e.img||e.icon){let t=e.img?80:48,n=$(e.assetWidth,t),r=$(e.assetHeight,t);o=Math.max(n,i.width+8),u=r+(i.height>0?i.height+6:0),d=e.pos===`t`?-r/2:r/2,i.height===0&&(d=0)}else{let e=k(n,i.width,i.height);o=e.w,u=e.h,d=e.dy}c={node:e,style:t,label:i,shape:n,w:o,h:u,dy:d,loops:0},l=pe(o,u)}l.seq=z.length,z.push(c),B.push(l)}N.nodes.forEach((e,t)=>{B[t].parent=e.parentId===void 0?-1:R.get(e.parentId)??-1});let V=a?`TB`:fe(e.direction),H=e=>{let t;for(let n=B[e].parent,r=0;n>=0&&t===void 0&&r<1e4;n=B[n].parent,r++)t=B[n].dir;return t??=V,t===`LR`||t===`RL`};z.forEach((e,t)=>{e.node.isGroup?B[t].span=1/0:!e.node.img&&!e.node.icon&&(B[t].span=j(e.shape,e.w,e.h,H(t)))});let U=[],_e=[],W=[];for(let e of N.edges){let t=R.get(e.start),n=R.get(e.end);if(t===void 0||n===void 0)continue;let r=h(e.label,e.labelType===`markdown`,F,he,ge);t===n&&(z[t].loops++,H(t)?B[t].h+=2*(Ke+(r.height>0?r.height+8:0)):B[t].w+=2*(Ke+(r.width>0?r.width+12:0))),W.push(e),_e.push(r),U.push({src:t,dst:n,minlen:e.minlen??1,labelW:r.width>0?r.width+12:0,labelH:r.height>0?r.height+4:0,route:[],labelX:0,labelY:0})}let ve={nodeSep:Ye(b,`nodeSpacing`,He)*(o?.5:1),edgeSep:Ue,rankSep:Ye(b,`rankSpacing`,We)*(o?.75:1),portSep:20,tracks:typeof b.curve==`string`&&/^step/.test(b.curve),straight:b.curve===`linear`,headRoom:x(`arrow_point`)},G=i?i.layout(B,U,V,ve,o):ue(B,U,V,ve),K=D(e.title,F,P,o?y(n):4e3),ye=K.height>0?K.height+12:0,be=Math.max(G.width,K.width);de(B,U,I+(be-G.width)/2,I+ye);let xe=Math.ceil(be+2*I),q=Math.ceil(G.height+ye+2*I),J=[],Se=new Map,Ce=!1;for(let e of B)e.isGroup&&(Ce=!0);if(Ce)for(let e of U)ce(Se,e.route);let Y=``,X=``,we=``;for(let e=0;e<z.length;e++){let t=z[e],r=B[e],a=t.node,o=r.x,c=r.y,m=u(a.cssClasses.replace(/^default\s?/,``)),h=f(a.id);if(r.isGroup&&i?.drawGroup&&r.parent<0){Y+=i.drawGroup(r,t.label,t.style,m,h,V,L);continue}if(r.isGroup){let n=se(r,t.label.width,Se,_),i=c-r.h/2+8+t.label.height/2,a=` class="pele-cluster-label" fill="var(--_m)"${t.style.text}`,s=oe(r,t.label.width,n,Se);s&&(X+=le(t.label,n,i,a,h,B,e,L)),Y+=`<g class="pele-cluster${m}" data-id="${h}"><rect x="${g(o-r.w/2)}" y="${g(c-r.h/2)}" width="${g(r.w)}" height="${g(r.h)}" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)"${d(t.style.shape)}/>`+(s?``:p(t.label,n,i,a,L))+`</g>`;continue}let v=t.w,y=t.h,b;if(a.img){let e=$(a.assetWidth,80),r=$(a.assetHeight,80),i=t.label.height>0?a.pos===`t`?y/2-r:-y/2:-r/2,o=re(ne(a.img),n);b=o===void 0?``:`<image href="${l(o)}" x="${g(-e/2)}" y="${g(i)}" width="${g(e)}" height="${g(r)}" preserveAspectRatio="${a.constraint===`on`?`xMidYMid meet`:`none`}"/>`}else if(a.icon){let e=$(a.assetHeight,48),n=t.label.height>0?a.pos===`t`?y/2-e:-y/2:-e/2,r=a.shape===`icon`?``:a.shape===`iconCircle`?`<circle cy="${g(n+e/2)}" r="${g(e/2)}"${qe}${t.style.shape}/>`:`<rect x="${g(-e/2)}" y="${g(n)}" width="${g(e)}" height="${g(e)}" rx="${a.shape===`iconRounded`?8:0}"${qe}${t.style.shape}/>`,i=e*.6;b=r+`<svg class="pele-icon" data-icon="${f(a.icon)}" x="${g(-i/2)}" y="${g(n+(e-i)/2)}" width="${g(i)}" height="${g(i)}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${L?.(a.icon)??``}</svg>`}else b=O(t.shape,v,y,qe+t.style.shape,Je+t.style.line);let x=p(t.label,0,t.dy,` class="pele-label"${t.style.text}`,L);if(/ internal-link(?: |$)/.test(m+` `)&&a.label&&n.links!==!1){let e=s(a.label),t=te(e,n),r=l(e);x=`<a class="internal-link"${t?` href="${r}"${ie(n)}`:``} data-href="${r}">${x}</a>`,J.push({id:a.id,href:e,internal:!0})}let S=b+x;a.tooltip&&(S=`<title>${f(a.tooltip)}</title>`+S),a.link&&(S=ae(S,a.link,a.id,J,n,a.linkTarget?` target="${l(a.linkTarget)}"`:``)),we+=`<g class="pele-node pele-shape-${t.shape}${m}" data-id="${h}" transform="translate(${g(o)},${g(c)})">${S}</g>`}let Z=S();for(let e=0;e<U.length;e++){let t=U[e];t.src===t.dst||W[e].thickness===`invisible`||t.route.length<6||(Z.add(t.src,A(t.route,0,B[t.src]),W[e].arrowTypeStart),Z.add(t.dst,A(t.route,t.route.length-3,B[t.dst]),W[e].arrowTypeEnd))}let Te=``,Ee=``,De=new Map;for(let e=0;e<U.length;e++){let t=U[e],n=W[e],r=_e[e],i=n.style.length>0||n.cssCompiledStyles.length>0?m(n.cssCompiledStyles.concat(n.style)):void 0;if(n.thickness!==`invisible`){let e=n.arrowTypeStart,r=n.arrowTypeEnd,a;if(t.src===t.dst){let e=z[t.src],n=De.get(t.src)??0;De.set(t.src,n+1),a=E(B[t.src],e.w,e.h,n,H(t.src),Ke,x(r),t)}else{let i=t.route.slice(),o=Z.of(t.src,A(i,0,B[t.src])),s=Z.of(t.dst,A(i,i.length-3,B[t.dst]));M(i,0,z[t.src],B[t.src]),M(i,i.length-3,z[t.dst],B[t.dst]),a=w(i,n.curve,x(e),x(r),o,s)}let o=i?.stroke&&n.thickness!==`invisible`?l(i.stroke):`var(--_l)`,s=``;n.thickness===`thick`?s+=` stroke-width="2.5"`:n.thickness===`dotted`&&(s+=` stroke-dasharray="3 4"`);let c=u(n.classes.replace(/edge-thickness-normal|edge-pattern-solid|flowchart-link/g,``));Te+=`<g class="pele-edge${c}" data-id="${f(n.id)}"${i?.line??``}><path d="${a.d}"${s}/>`+T(e,a.sx,a.sy,a.sdx,a.sdy,o)+T(r,a.ex,a.ey,a.edx,a.edy,o)+`</g>`}if(r.width>0){let e=t.labelX,a=t.labelY;Ee+=C(n.id,r,e,a,i?.text??``,L)}}return{svg:c(i?.type??`flowchart`,xe,q,P,n,e,p(K,xe/2,I+K.height/2,` class="pele-title" font-weight="var(--_tw)"`)+(Y?`<g class="pele-clusters">${Y}</g>`:``)+(Te?`<g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round">${Te}</g>`:``)+(X?`<g class="pele-cluster-titles">${X}</g>`:``)+(Ee?`<g class="pele-edge-labels" font-size="${he}">${Ee}</g>`:``)+`<g class="pele-nodes">${we}</g>`),width:xe,height:q,links:J}}var Qe={type:`flowchart`,math:!0,parse(e,t,n,r,i){let a=new z({inheritDir:(t.flowchart??{}).inheritDir===!0,maxEdges:i.maxEdges});return n&&(a.title=n),Ie(e,a),a},render:Xe};export{Xe as n,Qe as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{r}from"./button-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{r}from"./button-vdGgKu1b.js";import{t as i}from"./project-router-BzcW5R3O.js";import{a,o,r as s}from"./reference-chip-JX3G6Wkk.js";import{d as c,f as l,h as u,l as d,m as f,p}from"./use-now-BlhSvP80.js";import{En as m,x as h}from"./git-tab-loading-BXSixY5p.js";import{F as g,H as _,U as v,V as y,z as b}from"./worktree-lifecycle-operation-psNUwGwT.js";import{n as x}from"./textarea-DywMDkfl.js";import{t as S}from"./check-DA3yaTey.js";import{f as C}from"./tooltip-7suUQClM.js";import{h as w}from"./git-toolbar-CB3F5Ztu.js";import{c as T}from"./index-C_k6g6fh.js";var E=n();function D({name:e,route:t,selected:n,list:i,detail:a}){return(0,E.jsxs)(`div`,{"data-route":t,className:`flex h-full min-h-0 items-stretch`,children:[(0,E.jsx)(`section`,{"data-slot":`${e}-list`,className:r(`w-full min-h-0 flex-col overflow-y-auto overscroll-contain border-border md:flex md:w-[360px] md:shrink-0 md:border-r`,n?`hidden`:`flex`),children:i}),(0,E.jsx)(`section`,{"data-slot":`${e}-detail`,className:r(`min-w-0 min-h-0 flex-1 flex-col overflow-y-auto overscroll-contain`,n?`flex`:`hidden md:flex`),children:a})]})}function O(e){return`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`}function k(e,t=[]){let n=O(e);return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=A(t)),n}function A(e){return`\n\nUse these skills where relevant: ${e.join(`, `)}.`}function j(e,t){return e.replace(/\{\{\s*number\s*\}\}/gi,()=>`#${t.number}`).replace(/\{\{\s*title\s*\}\}/gi,()=>t.title).replace(/\{\{\s*url\s*\}\}/gi,()=>t.url)}function M(e,t){if(e.includes(t.url))return!0;let n=t.kind===`pr`?String.raw`(?:pull\s+request|pr)`:String.raw`issue`;return new RegExp(String.raw`\b${n}\s*#?\s*${t.number}\b`,`i`).test(e)}function N(e,t,n){let r=(n??``).trim();if(!r)return k(e,t);let i=O(e),a=r.startsWith(i)?i+j(r.slice(i.length),e):j(r,e),o=M(a,e)?a:`${i}\n\n${a}`;return t.length?o+A(t):o}function P(e){let t=[];for(let n of e.slice(0,8)){let e=new Set(t.map(e=>e.id)),r=n;for(let t=2;e.has(r);t++)r=`${n}-${t}`;t.push({id:r,name:n,skill:n,prompt:`{{task}}`})}return t}function F(e,t,n,r,i={}){return t?{...i,workflow:t,task:N(e,n,r)}:n.length?{...i,steps:P(n),task:N(e,[],r)}:{...i,workflow:`quick-task`,task:N(e,[],r)}}function I({resolved:e,dataSlot:t}){return e.providerPending||e.canRun?null:(0,E.jsxs)(`span`,{"data-slot":t,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[e.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this item.`,(0,E.jsx)(i,{to:`/settings/agents#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]})}var L=e(t(),1);function R({workflows:e,value:t,onChange:n,slotPrefix:i=`gh`}){let[m,g]=(0,L.useState)(!1),[y,b]=(0,L.useState)(``),w=(0,L.useRef)(null),T=_(e,y);return(0,E.jsxs)(s,{open:m,onOpenChange:e=>{g(e),e||b(``)},children:[(0,E.jsx)(o,{asChild:!0,children:(0,E.jsxs)(`button`,{type:`button`,"data-slot":`${i}-workflow-trigger`,"aria-label":`Choose a workflow`,className:r(h,t&&`border-foreground/60 font-mono text-[11.5px] font-semibold text-foreground`),children:[(0,E.jsx)(x,{"aria-hidden":`true`,className:`size-3 shrink-0 text-violet`}),(0,E.jsx)(`span`,{className:`max-w-44 truncate`,children:t??`workflow`}),(0,E.jsx)(C,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,E.jsx)(a,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,E.jsxs)(d,{label:`Choose a workflow`,shouldFilter:!1,children:[(0,E.jsx)(p,{placeholder:`search workflows…`,value:y,onValueChange:b,onInput:()=>w.current?.scrollTo(0,0)}),(0,E.jsxs)(u,{ref:w,"data-slot":`${i}-workflow-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[T.length===0?(0,E.jsx)(c,{children:`Nothing matches.`}):null,(0,E.jsx)(l,{children:T.map(e=>{let r=t===e.name;return(0,E.jsxs)(f,{value:`workflow ${e.name}`,keywords:v(e.name,e.description),"data-slot":`${i}-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(r?null:e.name),g(!1)},children:[(0,E.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,E.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,r?(0,E.jsx)(S,{"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-primary`}):null]},e.name)})})]})]})})]})}function z({skills:e,skillUsage:t,selected:n,onToggle:i,maxSelections:_,slotPrefix:x=`gh`}){let[D,O]=(0,L.useState)(!1),[k,A]=(0,L.useState)(``),[j,M]=(0,L.useState)(null),N=(0,L.useRef)(null),{mostUsed:P,project:F,global:I}=b(y(e,k,t),t),R=(e,t)=>{let a=n.includes(e.name);return(0,E.jsxs)(f,{value:`skill ${e.name} ${e.path}`,keywords:v(e.name,e.description),"data-slot":`${x}-skill-option`,"data-skill":e.name,"data-selected":a?`true`:void 0,disabled:!a&&_!==void 0&&n.length>=_,onSelect:()=>i(e.name),children:[(0,E.jsx)(`span`,{className:r(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.description?(0,E.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,E.jsx)(`button`,{type:`button`,"data-slot":`${x}-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),M(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,E.jsx)(w,{"aria-hidden":`true`,className:`size-3.5`})}),a?(0,E.jsx)(S,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},e.path)};return e.length===0?null:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(T,{skill:j,onClose:()=>M(null)}),(0,E.jsxs)(s,{open:D,onOpenChange:e=>{O(e),e||A(``)},children:[(0,E.jsx)(o,{asChild:!0,children:(0,E.jsxs)(`button`,{type:`button`,"data-slot":`${x}-skills-trigger`,"aria-label":`Choose skills`,className:r(h,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,E.jsx)(m,{"aria-hidden":`true`,className:`size-3 shrink-0 text-violet`}),`skills`,n.length>0?` · ${n.length}`:``,(0,E.jsx)(C,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,E.jsx)(a,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,E.jsxs)(d,{label:`Choose skills`,shouldFilter:!1,children:[(0,E.jsx)(p,{placeholder:`search skills…`,value:k,onValueChange:A,onInput:()=>N.current?.scrollTo(0,0)}),(0,E.jsxs)(u,{ref:N,"data-slot":`${x}-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[P.length===0&&F.length===0&&I.length===0?(0,E.jsx)(c,{children:`Nothing matches.`}):null,P.length>0?(0,E.jsx)(l,{heading:`Most used`,children:P.map(e=>R(e,g(e)))}):null,F.length>0?(0,E.jsx)(l,{heading:`Project skills`,children:F.map(e=>R(e,!0))}):null,I.length>0?(0,E.jsx)(l,{heading:`Global`,children:I.map(e=>R(e,!1))}):null]})]})})]})]})}export{k as a,D as c,F as i,R as n,O as o,I as r,P as s,z as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{E as r,N as i,T as a,a as o,c as s,d as c,f as l,l as u,n as d,o as f,p,r as m,s as h,u as g}from"./button-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{E as r,N as i,T as a,a as o,c as s,d as c,f as l,l as u,n as d,o as f,p,r as m,s as h,u as g}from"./button-vdGgKu1b.js";var _=e(t(),1),v=n(),y=`AlertDialog`,[b,ee]=r(y,[p]),x=p(),S=e=>{let{__scopeAlertDialog:t,...n}=e,r=x(t);return(0,v.jsx)(o,{...r,...n,modal:!0})};S.displayName=y;var C=`AlertDialogTrigger`,w=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=x(n);return(0,v.jsx)(l,{...i,...r,ref:t})});w.displayName=C;var T=`AlertDialogPortal`,E=e=>{let{__scopeAlertDialog:t,...n}=e,r=x(t);return(0,v.jsx)(g,{...r,...n})};E.displayName=T;var D=`AlertDialogOverlay`,O=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=x(n);return(0,v.jsx)(u,{...i,...r,ref:t})});O.displayName=D;var k=`AlertDialogContent`,[A,j]=b(k),M=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...o}=e,s=x(n),c=i(t,_.useRef(null)),l=_.useRef(null);return(0,v.jsx)(A,{scope:n,cancelRef:l,children:(0,v.jsx)(h,{role:`alertdialog`,...s,...o,ref:c,onOpenAutoFocus:a(o.onOpenAutoFocus,e=>{e.preventDefault(),l.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})});M.displayName=k;var N=`AlertDialogTitle`,P=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=x(n);return(0,v.jsx)(c,{...i,...r,ref:t})});P.displayName=N;var F=`AlertDialogDescription`,I=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=x(n);return(0,v.jsx)(s,{...i,...r,ref:t})});I.displayName=F;var L=`AlertDialogAction`,R=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=x(n);return(0,v.jsx)(f,{...i,...r,ref:t})});R.displayName=L;var z=`AlertDialogCancel`,B=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=j(z,n),o=x(n),s=i(t,a);return(0,v.jsx)(f,{...o,...r,ref:s})});B.displayName=z;var V=S,H=E,U=O,W=M,G=R,K=B,q=P,J=I;function Y({...e}){return(0,v.jsx)(V,{"data-slot":`alert-dialog`,...e})}function X({...e}){return(0,v.jsx)(H,{"data-slot":`alert-dialog-portal`,...e})}function Z({className:e,...t}){return(0,v.jsx)(U,{"data-slot":`alert-dialog-overlay`,className:m(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function Q({className:e,...t}){return(0,v.jsxs)(X,{children:[(0,v.jsx)(Z,{}),(0,v.jsx)(W,{"data-slot":`alert-dialog-content`,className:m(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-md`,e),...t})]})}function $({className:e,...t}){return(0,v.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:m(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function te({className:e,...t}){return(0,v.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:m(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function ne({className:e,...t}){return(0,v.jsx)(q,{"data-slot":`alert-dialog-title`,className:m(`text-lg leading-none font-semibold`,e),...t})}function re({className:e,...t}){return(0,v.jsx)(J,{"data-slot":`alert-dialog-description`,className:m(`text-sm text-muted-foreground`,e),...t})}function ie({className:e,...t}){return(0,v.jsx)(G,{"data-slot":`alert-dialog-action`,className:m(d({variant:`contrast`}),e),...t})}function ae({className:e,...t}){return(0,v.jsx)(K,{"data-slot":`alert-dialog-cancel`,className:m(d({variant:`outline`}),e),...t})}export{re as a,ne as c,Q as i,ie as n,te as o,ae as r,$ as s,Y as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e}from"./button-vdGgKu1b.js";var t=e(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{F as n,
|
|
1
|
+
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{F as n,dt as r,gt as i,ht as a,lt as o,r as s}from"./button-vdGgKu1b.js";var c=n(`calendar-clock`,[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5`,key:`1osxxc`}],[`path`,{d:`M3 10h5`,key:`r794hk`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]);e();var l=t();function u({className:e,flush:t=!1,...n}){return(0,l.jsx)(`div`,{"data-slot":`card`,"data-flush":t?`true`:void 0,className:s(`flex flex-col rounded-lg border bg-card text-card-foreground shadow-xs`,t?`gap-0 overflow-hidden py-0`:`gap-6 py-6`,e),...n})}function d(e){return o[((e-1)%7+7)%7]??``}function f(e,t){let n=i(typeof e==`number`?e:Date.parse(e),t);return n?`${d(n.weekday)} ${r(n.hour,n.minute)}`:``}function p(e,t){let n=i(typeof e==`number`?e:Date.parse(e),t);return n?r(n.hour,n.minute):``}function m(e,t,n=Date.now()){let a=Date.parse(e),o=i(a,t);if(!o)return``;if(n-a<6*864e5)return`${d(o.weekday)} ${r(o.hour,o.minute)}`;let s=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][o.month-1];return`${o.day} ${s} ${r(o.hour,o.minute)}`}function h(e,t=Date.now()){let n=Math.max(0,Math.round((e-t)/6e4));return n<60?`in ${n}m`:n<1440?`in ${Math.round(n/60)}h`:`in ${Math.round(n/1440)}d`}function g(e){let t=Math.round(e/60),n=Math.floor(t/60);return n>0?`${n}h ${String(t%60).padStart(2,`0`)}m`:`${t}m`}function _(e){return e>=10?`$${e.toFixed(1)}`:`$${e.toFixed(2)}`}function v(e){switch(e){case`done`:return`success`;case`running`:case`queued`:case`waiting`:return`pending`;case`failed`:case`cancelled`:return`danger`;case`review`:return`violet`}}function y(e){switch(e){case`review`:return`needs review`;case`waiting`:return`needs you`;default:return e}}function b(e){if(e.kind===`schedule`&&e.schedule)return a(e.schedule);if(e.kind===`tracker`){let t=e.trackerTrigger,n=t?.association.kind===`jira`?`Jira`:t?.association.kind===`linear`?`Linear`:`Tracker`;return t?`${n} · ${t.events.join(`, `)}${t.targetStatusIds?.length?` → ${t.targetStatusIds.join(`, `)}`:``}${t.changedLabelIds?.length?` · labels ${t.changedLabelIds.join(`, `)}`:``} · every ${Math.round((e.intervalSeconds??1800)/60)} min`:`${n} · select an event to complete setup`}let t=(e.events??[]).join(`, `),n=Math.round((e.intervalSeconds??300)/60);return`on ${t||`github`} · every ${n} min`}function x(e){switch(e){case`launched`:case`manual`:case`catch-up`:return`success`;case`failed`:case`error`:case`rate-limited`:return`danger`;default:return`neutral`}}export{h as a,v as c,_ as d,u as f,m as i,p as l,d as n,x as o,c as p,f as r,y as s,g as t,b as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Da as r,Nt as i,Oa as a,Or as o,Ui as s,Ut as c,Xn as l,ca as u,ei as d,it as f,j as p,ja as m,ka as h,kr as g,ni as _,pr as v,qt as ee}from"./queries-XYjXpa8s.js";import{F as y,V as b,_t as x,ct as S,dt as C,ft as w,gt as T,lt as te,mt as ne,pt as re,r as E,t as D,ut as ie}from"./button-vdGgKu1b.js";import{T as ae,c as O,f as oe,s as se,t as k,w as ce}from"./project-router-BzcW5R3O.js";import{S as A}from"./reference-chip-JX3G6Wkk.js";import{O as le,a as ue,c as de,i as fe,l as pe,o as me,s as he,u as ge}from"./facet-filter-BpaMiUU2.js";import{a as _e,i as ve,n as ye,o as be,s as xe,t as Se}from"./use-now-BlhSvP80.js";import{I as j,In as Ce,Nn as we,_ as Te,wn as M,y as N}from"./git-tab-loading-BXSixY5p.js";import{t as Ee}from"./arrow-left-CpV00riO.js";import{R as De,c as Oe,d as ke,l as Ae}from"./worktree-lifecycle-operation-psNUwGwT.js";import{r as je,t as Me}from"./textarea-DywMDkfl.js";import{a as Ne,c as Pe,d as Fe,f as P,i as Ie,l as Le,n as Re,o as ze,p as Be,r as Ve,s as He,t as Ue,u as We}from"./automation-format-BgAhuFNq.js";import{t as Ge}from"./chevron-left-D1eW2pzs.js";import{f as Ke}from"./tooltip-7suUQClM.js";import{t as qe}from"./chevron-right-DwqBinJp.js";import{c as Je,i as F,n as Ye,r as Xe,u as Ze}from"./icon-tooltip-CCXhXgac.js";import{t as Qe}from"./terminal-BVAfyHZI.js";import{h as $e}from"./git-toolbar-CB3F5Ztu.js";import{t as et}from"./file-text-C5N0APxx.js";import{n as tt,t as nt}from"./settings-2-CrmZbb_8.js";import{r as rt}from"./use-submit-shortcut-BC7gmgDS.js";import{n as it}from"./square-DCg6avOT.js";import{t as at}from"./plus-BHSN5Uog.js";import{n as ot,o as I,r as st,t as ct}from"./collapsible-Ci-k9Y0m.js";import{a as lt,c as ut,i as dt,n as ft,o as pt,r as mt,s as ht,t as gt}from"./alert-dialog-fzSWCIyG.js";import{t as L}from"./input-DXFchFdf.js";import{i as R,r as _t}from"./token-metrics-BiFl2ovY.js";import{t as vt}from"./centered-state-C1nDqaTs.js";import{C as z,D as yt,E as bt,F as xt,I as St,O as B,S as V,T as H,d as Ct,o as wt,r as Tt,w as U,x as W}from"./index-C_k6g6fh.js";var Et=y(`layout-template`,[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]),Dt=y(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),Ot=y(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),kt=y(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),G=e(t(),1),K=n();function At({association:e,selected:t,onSelect:n,onRemove:i}){let a=r({queryKey:[`tracker`,b(),`label-suggestions`,e],initialPageParam:void 0,queryFn:({pageParam:t,signal:n})=>_({association:e,state:`all`,limit:50,cursor:t},{signal:n}),getNextPageParam:e=>e.available&&e.truncated?e.nextCursor:void 0,retry:!1,staleTime:6e4}),o=a.data?.pages??[],s=o.at(-1),c=o.find(e=>!e.available),l=a.isError||!!c,u=[...new Set([...t,...l?[]:o.flatMap(e=>e.available?e.items.flatMap(e=>e.labels):[])])].filter(e=>t.includes(e)||e.length>0&&e.length<=200).sort((e,t)=>e.localeCompare(t));return(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,"aria-label":`Project label suggestions`,children:[(0,K.jsx)(`span`,{className:`font-medium`,children:`Required labels`}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`All selected labels must match. Leave unselected to allow any label.`}),(0,K.jsx)(`div`,{role:`group`,"aria-label":`Required labels`,className:`flex flex-wrap gap-1.5`,children:u.map(e=>(0,K.jsx)(N,{active:t.includes(e),"aria-pressed":t.includes(e),disabled:!t.includes(e)&&t.length>=100,onClick:()=>t.includes(e)?i(e):n(e),children:e},e))}),a.isFetching?(0,K.jsx)(`p`,{role:`status`,children:`Loading labels…`}):null,l?(0,K.jsxs)(`div`,{role:`alert`,children:[(0,K.jsx)(`p`,{children:`Could not load labels. Your selection is preserved.`}),(0,K.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void a.refetch(),children:`Retry label suggestions`})]}):(0,K.jsxs)(K.Fragment,{children:[!a.isPending&&!a.isFetching&&u.length===0?(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No labels found in the loaded tasks.`}):null,a.hasNextPage?(0,K.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,disabled:a.isFetching,onClick:()=>void a.fetchNextPage(),children:`Load labels from more tasks`}):null,!a.hasNextPage&&s?.available&&s.truncated?(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`The provider returned a limited task list.`}):null]})]})}var jt=[`pull_request.opened`,`issue.opened`,`issue.labeled`,`issue.unlabeled`,`pull_request.reviewed`,`pull_request.review_requested`,`pull_request.rereview_requested`,`pull_request.closed`,`pull_request.merged`];function Mt(e){return[{id:`task`,name:e,skill:e,prompt:`{{task}}`}]}function Nt(e){let[t,...n]=e??[];return t&&n.length===0&&t.skill&&t.prompt===`{{task}}`?t.skill:null}function Pt(e){return e.skill?{source:`skill`,ref:e.skill}:e.workflow&&e.workflow!==`quick-task`?{source:`workflow`,ref:e.workflow}:null}function Ft(e){return e?.source===`skill`?{skill:e.ref,workflow:j,customSteps:null}:{skill:null,workflow:e?.ref??`quick-task`,customSteps:null}}var It=[2,5,10,15,30,60],Lt=[1,2,4,6,8],Rt={authors:``,assignees:``,anyLabels:``,allLabels:``,excludeLabels:``,changedLabels:``,reviewers:``,lookbackDays:7,maxRecords:25},zt={type:`daily`,hour:4,minute:0};function Bt(){return{name:``,kind:`schedule`,schedule:{...zt},events:[`issue.opened`],intervalSeconds:300,filters:{...Rt},prompt:``,workflow:j,skill:null,customSteps:null,runner:null,account:null,model:null,autonomous:!0,dispatch:!1,maxSubtasks:4,reviewChild:!0,enabled:!1}}var q=e=>(e??[]).join(`, `);function Vt(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}function Ht(e){return{authors:q(e.authors),assignees:q(e.assignees),anyLabels:q(e.anyLabels),allLabels:q(e.allLabels),excludeLabels:q(e.excludeLabels),changedLabels:q(e.changedLabels),reviewers:q(e.reviewers),lookbackDays:e.lookbackDays,maxRecords:e.maxRecords}}function Ut(e){let t=Bt(),{task:n,filters:r}=e,i=Nt(n.steps);return{...t,name:e.name,kind:e.kind,trackerTrigger:e.trackerTrigger,schedule:e.schedule?{...e.schedule}:t.schedule,events:e.events?.length?[...e.events]:t.events,intervalSeconds:e.intervalSeconds??t.intervalSeconds,filters:r?Ht(r):t.filters,prompt:n.prompt,workflow:n.workflow??t.workflow,skill:i,customSteps:n.steps&&!i?n.steps:null,runner:n.runner??null,account:n.agentProfile??null,model:n.model??null,autonomous:n.autonomous??!1,dispatch:n.dispatch!==void 0,maxSubtasks:n.dispatch?.maxSubtasks??t.maxSubtasks,reviewChild:n.dispatch?.reviewChild??t.reviewChild,enabled:e.enabled,...n.checkout===void 0?{}:{checkout:n.checkout},...n.allowForkHeads===void 0?{}:{allowForkHeads:n.allowForkHeads}}}function Wt(e){return{name:e.name,kind:e.kind,...e.schedule?{schedule:e.schedule}:{},...e.events?{events:e.events}:{},...e.intervalSeconds===void 0?{}:{intervalSeconds:e.intervalSeconds},...e.filters?{filters:e.filters}:{},prompt:e.task.prompt,...e.task.workflow?{workflow:e.task.workflow}:{},...e.task.steps?{steps:e.task.steps}:{},...e.task.runner?{runner:e.task.runner}:{},...e.task.model===void 0?{}:{model:e.task.model},...e.task.autonomous===void 0?{}:{autonomous:e.task.autonomous},...e.task.dispatch?{dispatch:e.task.dispatch}:{},...e.task.checkout?{checkout:e.task.checkout}:{},...e.task.allowForkHeads===void 0?{}:{allowForkHeads:e.task.allowForkHeads}}}var Gt=e=>e===`claude`||e===`codex`||e===`junie`||e===`opencode`||e===`cursor`||e===`pi`||e===`copilot`;function Kt(e,t){let n=Nt(t.steps);return{...e,name:t.name,kind:t.kind,schedule:t.schedule?{...t.schedule}:e.schedule,events:t.events?.length?[...t.events]:e.events,intervalSeconds:t.intervalSeconds??e.intervalSeconds,filters:t.filters?Ht(t.filters):{...Rt},prompt:t.prompt,...t.steps?{skill:n,customSteps:n?null:t.steps,workflow:j}:Ft(t.workflow?{source:`workflow`,ref:t.workflow}:null),checkout:t.checkout,allowForkHeads:t.allowForkHeads,runner:t.runner!==void 0&&Gt(t.runner)?t.runner:e.runner,account:t.runner!==void 0&&Gt(t.runner)?null:e.account,model:t.model??e.model,autonomous:t.autonomous??e.autonomous,dispatch:t.dispatch!==void 0,maxSubtasks:t.dispatch?.maxSubtasks??e.maxSubtasks,reviewChild:t.dispatch?.reviewChild??e.reviewChild}}function qt(e){let t=re(e);switch(t.type){case`hours`:return{type:`hours`,every:t.every};case`weekly`:return{type:`weekly`,hour:t.hour,minute:t.minute,day:t.day};case`once`:return{type:`once`,hour:t.hour,minute:t.minute,...t.date?{date:t.date}:{}};default:return{type:t.type,hour:t.hour,minute:t.minute}}}function Jt(e){let t={prompt:e.prompt,...e.skill?{steps:Mt(e.skill)}:e.customSteps?{steps:e.customSteps}:e.workflow?{workflow:e.workflow}:{},...e.runner?{runner:e.runner}:{},...e.account?{agentProfile:e.account}:{},...e.model?{model:e.model}:{},autonomous:e.autonomous,...e.dispatch?{dispatch:{maxSubtasks:e.maxSubtasks,reviewChild:e.reviewChild}}:{}};if(e.kind===`schedule`)return{name:e.name.trim(),kind:`schedule`,schedule:qt(e.schedule),task:t};if(e.kind===`tracker`)return{name:e.name.trim(),kind:`tracker`,trackerTrigger:e.trackerTrigger,intervalSeconds:e.intervalSeconds,filters:{lookbackDays:J(e.filters.lookbackDays,1,90),maxRecords:J(e.filters.maxRecords,1,100)},task:t};let n=e.filters,r=(e,t)=>{let n=Vt(e);return n.length>0?{[t]:n}:{}};return{name:e.name.trim(),kind:`github`,events:[...e.events],intervalSeconds:e.intervalSeconds,filters:{...r(n.authors,`authors`),...r(n.assignees,`assignees`),...r(n.anyLabels,`anyLabels`),...r(n.allLabels,`allLabels`),...r(n.excludeLabels,`excludeLabels`),...r(n.changedLabels,`changedLabels`),...r(n.reviewers,`reviewers`),lookbackDays:J(n.lookbackDays,1,90),maxRecords:J(n.maxRecords,1,100)},task:{...t,...e.checkout===void 0?{}:{checkout:e.checkout},...e.allowForkHeads===void 0?{}:{allowForkHeads:e.allowForkHeads}}}}function J(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,Math.round(e))):t}function Yt(e){let t=Jt(e);return{name:t.name,kind:e.kind,...t.trackerTrigger?{trackerTrigger:t.trackerTrigger}:{},...t.schedule?{schedule:t.schedule}:{},...t.events?{events:t.events}:{},...t.intervalSeconds===void 0?{}:{intervalSeconds:t.intervalSeconds},...t.filters?{filters:t.filters}:{},task:t.task,...e.enabled?{enable:!0}:{}}}var Xt=`([a-z\\d](?:[a-z\\d]|-(?=[a-z\\d])){0,38})`,Zt=RegExp(`\\b(?:user|author|by)\\s+(?:\`@?${Xt}\`|@${Xt}(?![\\w/-]))`,`gi`);function Qt(e){if(e.kind!==`github`)return[];let t=new Set([e.filters.authors,e.filters.assignees,e.filters.reviewers].flatMap(Vt).map(e=>e.replace(/^@/,``).toLowerCase())),n=new Map;for(let r of e.prompt.matchAll(Zt)){let e=r[1]??r[2];e&&!t.has(e.toLowerCase())&&!n.has(e.toLowerCase())&&n.set(e.toLowerCase(),e)}return[...n.values()]}function $t(e){return e.includes(`issue.labeled`)||e.includes(`issue.unlabeled`)}var en=e=>[1,2,3,4,6,8,12].includes(e);function tn({trigger:e,intervalSeconds:t,onChange:n,onValid:i}){let[a,o]=(0,G.useState)(``),s=b(),c=r({queryKey:[`tracker`,s,`automation-options`,``],initialPageParam:void 0,queryFn:({signal:e,pageParam:t})=>d({...t?{cursor:t}:{}},{signal:e}),getNextPageParam:e=>e.available?e.nextCursor:void 0,retry:!1}),l=r({queryKey:[`tracker`,s,`automation-options`,a],enabled:!!a&&c.data?.pages[0]?.available===!0,initialPageParam:void 0,queryFn:({signal:e,pageParam:t})=>d({...a?{search:a}:{},...t?{cursor:t}:{}},{signal:e}),getNextPageParam:e=>e.available?e.nextCursor:void 0,retry:!1}),u=a?l:c,f=c.data?.pages[0],p=f?.available?f:void 0,m=!!p&&!!e&&JSON.stringify(p.association)===JSON.stringify(e.association),h=m&&!!e?.events.length&&e.events.every(e=>p?.events.includes(e))&&(e.requiredLabels?.length??0)<=100&&(e.requiredLabels??[]).every(e=>e.length>0&&e.length<=200)&&(!e.events.includes(`issue.status_changed`)||!!e.targetStatusIds?.length)&&(!(e.events.includes(`issue.labeled`)||e.events.includes(`issue.unlabeled`))||!!e.changedLabelIds?.length);(0,G.useEffect)(()=>(i(h),()=>i(!1)),[h,i]);let g=u.data?.pages.flatMap(e=>e.available?[e]:[])??[],_=[...new Map(g.flatMap(e=>e.statuses).map(e=>[e.id,e])).values()],v=new Map((c.data?.pages.flatMap(e=>e.available?e.statuses:[])??[]).map(e=>[e.id,e.name])),ee=(e?.targetStatusIds??[]).filter(e=>!_.some(t=>t.id===e)),y=[...new Map(g.flatMap(e=>e.labels).map(e=>[e.id,e])).values()],x=e?.events.includes(`issue.status_changed`),S=e?.events.some(e=>e===`issue.labeled`||e===`issue.unlabeled`),C=x&&S?`Search tracker statuses and labels`:S?`Search tracker labels`:`Search tracker statuses`;return(0,K.jsxs)(`div`,{"data-slot":`editor-tracker`,className:`flex flex-col gap-3 text-sm`,children:[c.isPending?(0,K.jsx)(`p`,{children:`Loading tracker events…`}):null,c.isError||f&&!f.available?(0,K.jsxs)(`div`,{role:`alert`,children:[(0,K.jsxs)(`p`,{children:[f&&!f.available?f.reason:`Could not load tracker events.`,` Check the project’s Issue tracker settings.`]}),(0,K.jsx)(D,{variant:`outline`,size:`sm`,onClick:()=>void c.refetch(),children:`Retry`})]}):null,p?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`p`,{children:[p.association.kind===`jira`?`Jira`:`Linear`,` · `,p.association.externalName]}),e&&!m?(0,K.jsx)(`p`,{role:`alert`,children:`The tracker connection changed. Select an event again before saving.`}):null,e?null:(0,K.jsx)(`p`,{children:`Select an event to complete this automation.`}),(0,K.jsx)(`div`,{role:`group`,"aria-label":`Tracker events`,className:`flex flex-wrap gap-1.5`,children:p.events.map(t=>(0,K.jsx)(N,{active:m&&e?.events.includes(t),"aria-pressed":m&&e?.events.includes(t),onClick:()=>{let r=m?e.events:[],i=r.includes(t)?r.filter(e=>e!==t):[...r,t],a={...m?e:{},association:p.association,events:i};t===`issue.status_changed`&&!i.includes(t)&&delete a.targetStatusIds,n({trackerTrigger:a,...m?{}:{enabled:!1}})},children:t},t))}),m&&e?(0,K.jsx)(At,{association:p.association,selected:e.requiredLabels??[],onRemove:t=>n({trackerTrigger:{...e,requiredLabels:(e.requiredLabels??[]).filter(e=>e!==t)}}),onSelect:t=>n({trackerTrigger:{...e,requiredLabels:[...new Set([...e.requiredLabels??[],t])]}})},JSON.stringify(p.association)):null,(0,K.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,K.jsx)(`summary`,{className:`cursor-pointer`,children:`Integration details`}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2`,children:[(0,K.jsx)(`p`,{children:`Label choices come from loaded tasks in this project, including closed tasks. Saved selections remain available.`}),p.limitations.map(e=>(0,K.jsx)(`p`,{children:e},e))]})]}),e?.events.some(e=>e!==`issue.opened`)?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(L,{"aria-label":C,placeholder:C,value:a,onChange:e=>o(e.target.value)}),u.isFetching?(0,K.jsx)(`p`,{role:`status`,children:`Searching…`}):null,u.isError||u.data?.pages[0]&&!u.data.pages[0].available?(0,K.jsxs)(`div`,{role:`alert`,children:[`Could not load search results. `,(0,K.jsx)(D,{variant:`outline`,size:`sm`,onClick:()=>void u.refetch(),children:`Retry search`})]}):null,!u.isFetching&&u.data?.pages[0]?.available&&x&&_.length===0?(0,K.jsx)(`p`,{children:`No matching statuses.`}):null,!u.isFetching&&u.data?.pages[0]?.available&&S&&y.length===0?(0,K.jsx)(`p`,{children:`No matching labels.`}):null,e.events.includes(`issue.status_changed`)?(0,K.jsxs)(`div`,{role:`group`,"aria-label":`Target statuses`,className:`flex flex-wrap gap-1.5`,children:[_.map(t=>(0,K.jsx)(N,{active:e.targetStatusIds?.includes(t.id),"aria-pressed":e.targetStatusIds?.includes(t.id),onClick:()=>{let r=e.targetStatusIds??[];n({trackerTrigger:{...e,targetStatusIds:r.includes(t.id)?r.filter(e=>e!==t.id):[...r,t.id]}})},children:t.name},t.id)),ee.map(t=>(0,K.jsxs)(N,{active:!0,"aria-pressed":!0,onClick:()=>{n({trackerTrigger:{...e,targetStatusIds:(e.targetStatusIds??[]).filter(e=>e!==t)}})},children:[v.get(t)??t,` (not in current results)`]},t))]}):null,e.events.some(e=>e===`issue.labeled`||e===`issue.unlabeled`)?(0,K.jsx)(`div`,{role:`group`,"aria-label":`Changed labels`,className:`flex flex-wrap gap-1.5`,children:y.map(t=>(0,K.jsx)(N,{active:e.changedLabelIds?.includes(t.id),"aria-pressed":e.changedLabelIds?.includes(t.id),onClick:()=>{let r=e.changedLabelIds??[];n({trackerTrigger:{...e,changedLabelIds:r.includes(t.id)?r.filter(e=>e!==t.id):[...r,t.id]}})},children:t.name},t.id))}):null,u.hasNextPage?(0,K.jsx)(D,{variant:`outline`,size:`sm`,disabled:u.isFetchingNextPage,onClick:()=>void u.fetchNextPage(),children:`Load more`}):null]}):null]}):null,(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[`Check every`,(0,K.jsxs)(W,{value:String(t/60),onValueChange:e=>n({intervalSeconds:Number(e)*60}),children:[(0,K.jsx)(U,{"aria-label":`Tracker poll interval`,className:`w-28`,children:(0,K.jsx)(H,{})}),(0,K.jsx)(V,{children:It.map(e=>(0,K.jsxs)(z,{value:String(e),children:[e,` min`]},e))})]})]}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Only events after enabling are eligible. Existing backlog is not launched. The workflow agent receives this project’s tracker credentials to carry out your instructions; status updates are not guaranteed by the scheduler.`})]})}function nn({definition:e}){let t=(0,G.useMemo)(()=>ge(e),[e]);return(0,K.jsxs)(P,{flush:!0,"data-slot":`copy-as-cli`,className:`px-3.5 py-3`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-center`,children:[(0,K.jsx)(`span`,{className:`text-[11px] font-semibold tracking-[.05em] uppercase text-soft-foreground`,children:`Copy as CLI`}),(0,K.jsxs)(D,{variant:`ghost`,size:`sm`,className:`ml-auto h-6`,onClick:()=>void me(t),children:[(0,K.jsx)(Ce,{"aria-hidden":`true`,className:`size-3`}),`Copy`]})]}),(0,K.jsx)(`pre`,{className:`m-0 rounded-lg border border-border bg-card-2 px-2.5 py-2 font-mono text-[11.5px] leading-[1.6] break-words whitespace-pre-wrap text-muted-foreground`,children:t}),(0,K.jsxs)(`p`,{className:`mt-2 mb-0 text-[11.5px] leading-[1.5] text-soft-foreground`,children:[`The same definition the cockpit saves — `,(0,K.jsx)(`code`,{className:`text-[11px]`,children:`cez automation schema`}),` prints its shape.`]})]})}function rn({available:e,enabled:t,maxSubtasks:n,reviewChild:r,onChange:i}){if(!e)return null;let a=Lt.includes(n)?Lt:[...Lt,n].sort((e,t)=>e-t);return(0,K.jsxs)(`div`,{"data-slot":`editor-dispatch`,"data-enabled":t?`true`:void 0,title:`Let this run start its own subtasks with cez task create — each in a worktree forked off its branch, reporting back into the parent session.`,className:`flex flex-wrap items-center gap-2.5 border-t border-border pt-3 text-[13px] text-muted-foreground`,children:[(0,K.jsxs)(B,{className:`text-[13px] font-medium text-foreground`,children:[(0,K.jsx)(tt,{"aria-hidden":`true`,className:E(`size-3.5`,t?`text-violet`:`text-soft-foreground`)}),`Dispatch`,(0,K.jsx)(yt,{"aria-label":`Dispatch`,checked:t,onCheckedChange:e=>i({dispatch:e})})]}),t?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`text-soft-foreground`,children:`·`}),(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`up to`,(0,K.jsxs)(W,{value:String(n),onValueChange:e=>i({maxSubtasks:Number(e)}),children:[(0,K.jsx)(U,{size:`sm`,"aria-label":`Max subtasks`,className:`h-7 px-2 text-[12.5px]`,children:(0,K.jsx)(H,{})}),(0,K.jsx)(V,{children:a.map(e=>(0,K.jsx)(z,{value:String(e),children:e},e))})]}),`subtasks`]}),(0,K.jsx)(`span`,{className:`text-soft-foreground`,children:`·`}),(0,K.jsxs)(B,{className:`text-[13px] font-normal text-muted-foreground`,children:[(0,K.jsx)(yt,{size:`sm`,"aria-label":`Review child`,checked:r,onCheckedChange:e=>i({reviewChild:e})}),`review child`]}),(0,K.jsxs)(`span`,{"data-slot":`editor-dispatch-hint`,className:`ml-auto text-[11.5px] whitespace-nowrap text-soft-foreground`,children:[`≤ `,n+1,` agents`]})]}):null]})}function an({events:e,intervalSeconds:t,filters:n,onChange:r}){let[i,a]=(0,G.useState)([`authors`,`assignees`,`anyLabels`,`allLabels`,`excludeLabels`,`changedLabels`,`reviewers`].some(e=>n[e].trim().length>0)||n.lookbackDays!==7||n.maxRecords!==25),o=(e,t)=>r({filters:{...n,[e]:t}}),s=t=>{let n=e.includes(t)?e.filter(e=>e!==t):[...e,t];r({events:jt.filter(e=>n.includes(e))})},c=$t(e),l=c&&n.changedLabels.trim().length===0;return(0,K.jsxs)(`div`,{"data-slot":`editor-github`,className:`flex flex-col gap-3.5`,children:[(0,K.jsx)(`div`,{role:`group`,"aria-label":`GitHub events`,className:`flex flex-wrap gap-1.5`,children:jt.map(t=>(0,K.jsx)(N,{active:e.includes(t),"aria-pressed":e.includes(t),className:`font-mono`,onClick:()=>s(t),children:t},t))}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-[13px] text-muted-foreground`,children:[`poll every`,(0,K.jsxs)(W,{value:String(Math.round(t/60)),onValueChange:e=>r({intervalSeconds:Number(e)*60}),children:[(0,K.jsx)(U,{size:`sm`,"aria-label":`Poll interval`,className:`text-[13px]`,children:(0,K.jsx)(H,{})}),(0,K.jsx)(V,{children:It.map(e=>(0,K.jsxs)(z,{value:String(e),children:[e,` min`]},e))})]}),(0,K.jsxs)(`span`,{children:[`· last `,n.lookbackDays,` days · maximum `,n.maxRecords,` records`]})]}),(0,K.jsxs)(ct,{open:i,onOpenChange:a,children:[(0,K.jsx)(st,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,className:`inline-flex h-6 items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,K.jsx)(Ke,{"aria-hidden":`true`,className:E(`size-3 transition-transform`,i?``:`-rotate-90`)}),`Filters`,l?(0,K.jsx)(`span`,{className:`text-danger`,children:`· changed labels required`}):null]})}),(0,K.jsx)(ot,{children:(0,K.jsxs)(`div`,{"data-slot":`editor-github-filters`,className:`grid grid-cols-1 gap-3 pt-2 sm:grid-cols-2`,children:[(0,K.jsx)(Y,{id:`filter-authors`,label:`Authors`,value:n.authors,onChange:e=>o(`authors`,e)}),(0,K.jsx)(Y,{id:`filter-assignees`,label:`Assignees`,value:n.assignees,onChange:e=>o(`assignees`,e)}),(0,K.jsx)(Y,{id:`filter-any-labels`,label:`Any of labels`,value:n.anyLabels,onChange:e=>o(`anyLabels`,e)}),(0,K.jsx)(Y,{id:`filter-all-labels`,label:`All of labels`,value:n.allLabels,onChange:e=>o(`allLabels`,e)}),(0,K.jsx)(Y,{id:`filter-exclude-labels`,label:`Exclude labels`,value:n.excludeLabels,onChange:e=>o(`excludeLabels`,e)}),(0,K.jsx)(Y,{id:`filter-changed-labels`,label:c?`Changed labels (required)`:`Changed labels`,value:n.changedLabels,invalid:l,onChange:e=>o(`changedLabels`,e)}),(0,K.jsx)(Y,{id:`filter-reviewers`,label:`Reviewers`,value:n.reviewers,onChange:e=>o(`reviewers`,e)}),(0,K.jsx)(on,{id:`filter-lookback`,label:`Lookback days (1–90)`,value:n.lookbackDays,min:1,max:90,onChange:e=>o(`lookbackDays`,e)}),(0,K.jsx)(on,{id:`filter-max-records`,label:`Max records (1–100)`,value:n.maxRecords,min:1,max:100,onChange:e=>o(`maxRecords`,e)})]})})]})]})}function Y({id:e,label:t,value:n,invalid:r=!1,onChange:i}){return(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(B,{htmlFor:e,className:`text-xs text-muted-foreground`,children:t}),(0,K.jsx)(L,{id:e,value:n,placeholder:`comma-separated`,"aria-invalid":r||void 0,onChange:e=>i(e.target.value),className:`h-8 text-[13px]`})]})}function on({id:e,label:t,value:n,min:r,max:i,onChange:a}){return(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(B,{htmlFor:e,className:`text-xs text-muted-foreground`,children:t}),(0,K.jsx)(L,{id:e,type:`number`,min:r,max:i,value:n,onChange:e=>a(J(Number(e.target.value),r,i)),className:`h-8 w-28 font-mono text-[13px] tabular-nums`})]})}function sn({source:e,sourcesReady:t,skills:n,skillUsage:r,workflows:i,onSource:a,pick:o,onPick:s,baseBranch:c,autonomous:l,onAutonomous:u}){return(0,K.jsxs)(`div`,{"data-slot":`editor-run-as`,className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(wt,{source:e,ready:t,skills:n,skillUsage:r,workflows:i,onPick:a}),(0,K.jsx)(Ct,{pick:o,onChange:s,accounts:!0}),(0,K.jsx)(Te,{slot:`editor-base-pill`,ariaLabel:`Base branch`,readOnly:!0,hint:`Every run branches off the project's base branch.`,label:(0,K.jsxs)(`span`,{className:`font-mono text-[11.5px]`,children:[`base: `,c??`…`]}),value:c??``,options:[],onPick:()=>void 0}),(0,K.jsx)(`span`,{className:`flex-1`}),(0,K.jsxs)(B,{className:`text-[13px] font-medium`,children:[`Autonomous`,(0,K.jsx)(yt,{"aria-label":`Autonomous`,checked:l,onCheckedChange:u})]})]})}function cn({className:e,...t}){return(0,K.jsx)(`span`,{"data-slot":`branch-chip`,className:E(`inline-block rounded-md bg-muted px-1.5 py-0.5 font-mono text-[11.5px] leading-[1.3] font-medium whitespace-nowrap text-muted-foreground`,e),...t})}var ln=[[`daily`,`Every day`],[`weekdays`,`Weekdays`],[`weekly`,`Weekly`],[`hours`,`Every N hours`],[`once`,`Once`]],un=e=>String(e).padStart(2,`0`);function dn(e){let t=Date.now()+864e5,n=T(t,e);return n?`${n.year}-${un(n.month)}-${un(n.day)}`:new Date(t).toISOString().slice(0,10)}function fn({schedule:e,timeZone:t,onChange:n}){let r=re(e),i=e=>{let{date:i,...a}=r,o={...a,...i?{date:i}:{},...e};o.type===`once`&&!o.date&&(o.date=dn(t)),n(o)},a=r.type===`once`&&r.date!==null&&w({type:`once`,date:r.date,hour:r.hour,minute:r.minute},Date.now(),t)===null;return(0,K.jsxs)(`div`,{"data-slot":`editor-schedule`,className:`flex flex-col gap-3.5`,children:[(0,K.jsx)(`div`,{role:`group`,"aria-label":`Schedule type`,className:`flex flex-wrap gap-1.5`,children:ln.map(([e,t])=>(0,K.jsx)(N,{active:r.type===e,"aria-pressed":r.type===e,onClick:()=>i({type:e}),children:t},e))}),r.type===`weekly`?(0,K.jsx)(`div`,{role:`group`,"aria-label":`Weekday`,className:`flex flex-wrap gap-1.5`,children:te.map((e,t)=>(0,K.jsx)(N,{active:r.day===t+1,"aria-pressed":r.day===t+1,className:`px-[9px]`,onClick:()=>i({day:t+1}),children:e},e))}):null,r.type===`once`?(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-[13px] text-muted-foreground`,children:[`on`,(0,K.jsx)(L,{type:`date`,"aria-label":`Date`,value:r.date??``,onChange:e=>{e.target.value&&i({date:e.target.value})},className:`w-40 font-mono`})]}):null,r.type===`hours`?(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-[13px] text-muted-foreground`,children:[`every`,(0,K.jsxs)(W,{value:String(r.every),onValueChange:e=>{let t=Number(e);en(t)&&i({every:t})},children:[(0,K.jsx)(U,{size:`sm`,"aria-label":`Every N hours`,className:`text-[13px]`,children:(0,K.jsx)(H,{})}),(0,K.jsx)(V,{children:S.map(e=>(0,K.jsxs)(z,{value:String(e),children:[e,` h`]},e))})]}),`starting at 00:00`]}):(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-[13px] text-muted-foreground`,children:[`at`,(0,K.jsx)(L,{"aria-label":`Hour`,inputMode:`numeric`,value:un(r.hour),onChange:e=>i({hour:Math.min(23,Math.max(0,Number(e.target.value)||0))}),className:`w-14 text-center font-mono`}),`:`,(0,K.jsx)(L,{"aria-label":`Minute`,inputMode:`numeric`,value:un(r.minute),onChange:e=>i({minute:Math.min(59,Math.max(0,Number(e.target.value)||0))}),className:`w-14 text-center font-mono`}),(0,K.jsx)(`span`,{className:`font-mono text-xs`,children:t})]}),r.type===`once`?(0,K.jsx)(`p`,{"data-slot":`editor-once-note`,className:`m-0 text-xs ${a?`text-danger`:`text-soft-foreground`}`,children:a?`This time has passed — pick a later one to enable it.`:`Runs a single time, then pauses itself.`}):(0,K.jsxs)(`div`,{className:`flex items-center gap-2.5 font-mono text-xs text-soft-foreground`,children:[(0,K.jsx)(`span`,{children:`cron`}),(0,K.jsx)(cn,{"data-slot":`editor-cron`,children:ie(e)})]})]})}function pn({lastRun:e,onRunNow:t,onLog:n,busy:r=!1,now:i}){return(0,K.jsxs)(P,{flush:!0,"data-slot":`last-run-card`,className:`px-3.5 py-3`,children:[(0,K.jsx)(`div`,{className:`mb-2 text-[11px] font-semibold tracking-[.05em] uppercase text-soft-foreground`,children:`Last run`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-[13px]`,children:[(0,K.jsx)(R,{tone:Pe(e.status)}),He(e.status),(0,K.jsx)(`span`,{className:`text-[11.5px] text-soft-foreground`,children:_t(e.ts,i)}),null]}),(0,K.jsxs)(`div`,{className:`mt-2.5 flex gap-1.5`,children:[(0,K.jsxs)(D,{variant:`outline`,size:`sm`,disabled:r,onClick:t,children:[(0,K.jsx)(it,{"aria-hidden":`true`,className:`size-3`}),`Run now`]}),n?(0,K.jsxs)(D,{variant:`ghost`,size:`sm`,onClick:n,children:[(0,K.jsx)(kt,{"aria-hidden":`true`,className:`size-3`}),`View log`]}):null]})]})}var mn=864e5;function hn({kind:e,schedule:t,intervalSeconds:n,timeZone:r,now:i}){let[a,o]=(0,G.useState)(()=>Date.now());(0,G.useEffect)(()=>{if(i!==void 0)return;let e=setInterval(()=>o(Date.now()),6e4);return()=>clearInterval(e)},[i]);let s=i??a,c=(0,G.useMemo)(()=>{if(e!==`schedule`)return[];if(t.type===`once`){let e=w(t,s,r);return e===null?[]:[e]}return ne(t,s,s+9*mn,r,5)},[e,t,s,r]);return(0,K.jsxs)(P,{flush:!0,"data-slot":`next-runs-preview`,className:`pt-3 pb-2`,children:[(0,K.jsx)(`div`,{className:`px-3.5 pb-2 text-[11px] font-semibold tracking-[.05em] uppercase text-soft-foreground`,children:e===`schedule`?t.type===`once`?`Runs once`:`Next 5 runs`:`How it polls`}),e===`schedule`?c.length===0?(0,K.jsx)(`p`,{className:`m-0 px-3.5 pb-1.5 text-[12.5px] leading-[1.5] text-muted-foreground`,children:t.type===`once`?`This time has already passed.`:`Nothing in the next nine days.`}):c.map(e=>(0,K.jsxs)(`div`,{"data-slot":`next-run`,className:`flex gap-2.5 px-3.5 py-[5px] text-[13px]`,children:[(0,K.jsx)(`span`,{className:`w-[82px] shrink-0 font-mono text-xs font-medium whitespace-nowrap text-foreground tabular-nums`,children:Ve(e,r)}),(0,K.jsx)(`span`,{className:`text-[11.5px] whitespace-nowrap text-soft-foreground`,children:Ne(e,s)})]},e)):(0,K.jsx)(`p`,{className:`m-0 px-3.5 pb-1.5 text-[12.5px] leading-[1.5] text-muted-foreground`,children:e===`tracker`?(0,K.jsxs)(K.Fragment,{children:[`Checks the project tracker every `,Math.round(n/60),` min while this cockpit is open. No webhook or public URL required.`]}):(0,K.jsxs)(K.Fragment,{children:[`Checks GitHub every `,Math.round(n/60),` min while this cockpit is open, through your `,(0,K.jsx)(`code`,{className:`text-xs`,children:`gh`}),`. No webhook or public URL required.`]})})]})}var gn=[{name:`Nightly dependency bump`,when:`Every day at 04:00`,kind:`schedule`,schedule:{type:`daily`,hour:4,minute:0},prompt:`Run npm outdated, bump patch and minor versions, run the test suite, open a draft PR if anything changed.`},{name:`Triage new issues`,when:`On issue.opened · every 5 min`,kind:`github`,events:[`issue.opened`],intervalSeconds:300,prompt:`Read {{github.url}}. Label it, add a repro or a clarification request. Never close it.`},{name:`Weekly changelog draft`,when:`Fridays at 16:00`,kind:`schedule`,schedule:{type:`weekly`,day:5,hour:16,minute:0},prompt:`Collect merged PRs since last week, write CHANGELOG entries, open a draft PR.`},{name:`Stale PR nudge`,when:`Every 6 hours`,kind:`schedule`,schedule:{type:`hours`,every:6},prompt:`Comment on PRs idle for 48h with what is blocking them.`},{name:`Flaky test hunt`,when:`Tuesdays at 02:00`,kind:`schedule`,schedule:{type:`weekly`,day:2,hour:2,minute:0},prompt:`Run the suite 5×, quarantine intermittent tests, open an issue per test.`,dispatch:{maxSubtasks:8,reviewChild:!0}},{name:`Security advisories`,when:`Every day at 06:00`,kind:`schedule`,schedule:{type:`daily`,hour:6,minute:0},prompt:`Run npm audit; for each high/critical advisory open a task with the upgrade path.`}],_n=e=>[b(),`automation-templates`,e??``];function vn({onPick:e}){let[t,n]=(0,G.useState)(`builtin`),r=se(),i=h({queryKey:_n(r),queryFn:({signal:e})=>g(r,{signal:e}),enabled:t===`mine`}),a=t===`builtin`?gn.map(e=>({...e,key:e.name})):(i.data?.templates??[]).map(e=>({...Wt(e),key:`${e.project.id}:${e.id}`,when:We(e),project:e.project.name}));return(0,K.jsxs)(P,{flush:!0,"data-slot":`template-palette`,className:`pb-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-end gap-3 border-b border-border px-4 pt-2.5`,children:[(0,K.jsxs)(`div`,{role:`tablist`,"aria-label":`Template source`,className:`flex shrink-0`,children:[(0,K.jsx)(yn,{active:t===`builtin`,onClick:()=>n(`builtin`),children:`Built-in`}),(0,K.jsx)(yn,{active:t===`mine`,onClick:()=>n(`mine`),children:`From your other projects`})]}),(0,K.jsx)(`span`,{className:`ml-auto min-w-0 overflow-hidden pb-2 text-xs text-ellipsis whitespace-nowrap text-soft-foreground`,children:t===`builtin`?`Built-in`:`Registered in ~/.cezar/config.json`})]}),t===`mine`&&i.isPending?(0,K.jsx)(`p`,{className:`px-4 pt-3 text-xs text-soft-foreground`,children:`Loading…`}):t===`mine`&&i.isError?(0,K.jsx)(`p`,{role:`alert`,className:`px-4 pt-3 text-xs text-danger`,children:i.error.message}):a.length===0?(0,K.jsx)(`p`,{className:`px-4 pt-3 text-xs text-soft-foreground`,children:`No automations in your other projects yet.`}):(0,K.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-2.5 px-4 pt-3`,children:a.map(t=>(0,K.jsxs)(`div`,{"data-slot":`template-card`,className:`flex flex-col gap-1.5 rounded-[10px] border border-border bg-card-2 px-3 py-2.5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-[13px] font-semibold`,children:[t.kind===`github`?(0,K.jsx)(bt,{"aria-hidden":`true`,className:`size-[13px] shrink-0 text-soft-foreground`}):(0,K.jsx)(St,{"aria-hidden":`true`,className:`size-[13px] shrink-0 text-soft-foreground`}),(0,K.jsx)(`span`,{className:`min-w-0 overflow-hidden text-ellipsis whitespace-nowrap`,children:t.name}),t.project?(0,K.jsx)(cn,{className:`ml-auto`,children:t.project}):null]}),(0,K.jsx)(`div`,{className:`font-mono text-[11.5px] text-muted-foreground`,children:t.when}),(0,K.jsx)(`div`,{className:`line-clamp-2 text-xs leading-[1.45] text-soft-foreground`,children:t.prompt}),(0,K.jsx)(D,{variant:`outline`,size:`sm`,className:`mt-0.5 self-start`,"aria-label":`Use this: ${t.name}`,onClick:()=>e(t),children:`Use this`})]},t.key))})]})}function yn({active:e,onClick:t,children:n}){return(0,K.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":e,onClick:t,className:E(`-mb-px flex h-8 items-center rounded-t-md border-b-2 px-3 text-[13px] font-medium`,e?`border-foreground font-semibold text-foreground`:`border-transparent text-muted-foreground hover:bg-muted hover:text-foreground`),children:n})}function bn(e){let t=e.toLowerCase();return/\b(events?|filters?|schedule|interval|changedlabels|changed labels|lookback|maxrecords)\b/.test(t)?`when`:/\b(prompt|workflow|runner|model|dispatch)\b/.test(t)?`what`:`top`}var xn={tracker:`Implement {{tracker.key}} and prepare a pull request.`,schedule:`Describe the task the agent should do each time. Placeholders: {{date}}, {{project}}`,github:`Describe the task the agent should do for each match. Placeholders: {{github.url}}, {{github.title}}, {{github.number}}, {{github.labels}}`};function Sn({data:e,automation:t,actions:n,onBack:r,onSaved:a,onLog:o}){let s=m(),d=O(),h=p(),g=c(),_=ee(),y=i(),b=f(),[x,S]=(0,G.useState)(()=>t?Ut(t):Bt()),[C,w]=(0,G.useState)(!t),[T,te]=(0,G.useState)(!1),[ne,re]=(0,G.useState)(!1),[E,ie]=(0,G.useState)(null),[ae,oe]=(0,G.useState)(!1),se=(0,G.useRef)(null),k=t?.revision,ce=(0,G.useRef)(k);(0,G.useEffect)(()=>{!t||k===ce.current||(ce.current=k,S(Ut(t)),oe(!1),ie(null))},[t,k]);let A=e=>S(t=>({...t,...e})),le=e?.timeZone??`UTC`,de=e?.available!==!1,fe=h.data?.capabilities.dispatch===!0,pe=(0,G.useMemo)(()=>Oe(ke(g.data?.promptTemplates),h.data?.capabilities),[g.data?.promptTemplates,h.data?.capabilities]),me=_.data?.workflows??[],he=me.map(e=>e.name),ge=y.data,_e=(ge??[]).map(e=>e.name),ve=g.data?.skillUsage,ye=(0,G.useMemo)(()=>De(ge??[],ve),[ge,ve]),be=y.data!==void 0&&_.data!==void 0&&!g.isPending,xe=b.data?.baseBranch??b.data?.info?.branch??void 0,Se=(0,G.useMemo)(()=>Yt(x),[x]),j=(0,G.useMemo)(()=>Qt(x),[x]),Ce=x.name.trim().length>0&&x.prompt.trim().length>0&&!ne&&(x.kind!==`tracker`||T),we=e=>{let t=se.current,n=t?.selectionStart??x.prompt.length,r=Ae(x.prompt,n,e);A({prompt:r.text}),requestAnimationFrame(()=>{t&&(t.focus(),t.setSelectionRange(r.caret,r.caret))})},Te=async()=>{re(!0),ie(null),oe(!1);try{let e=Jt(x);t?await u(t.id,{...e,enabled:x.enabled,expectedRevision:t.revision}):await v({...e,enable:x.enabled}),await s.invalidateQueries({queryKey:ue()}),a()}catch(e){if(t&&e instanceof l&&e.status===409)oe(!0);else{let t=e instanceof Error?e.message:String(e);ie({message:t,section:e instanceof l&&e.status===400?bn(t):`top`})}}finally{re(!1)}},M=()=>void s.invalidateQueries({queryKey:ue()}),je=t?`Save changes`:x.enabled?`Save and enable`:`Save paused`;return(0,K.jsxs)(`div`,{"data-route":`automations`,"data-slot":`automation-editor`,className:`flex min-h-full flex-col`,children:[(0,K.jsxs)(`header`,{className:`sticky top-0 z-10 flex min-h-14 shrink-0 flex-wrap items-center gap-3 border-b border-border bg-background px-5 max-md:py-2 md:h-14 md:flex-nowrap`,children:[(0,K.jsx)(D,{variant:`ghost`,size:`icon-sm`,"aria-label":`Back`,onClick:r,children:(0,K.jsx)(Ee,{"aria-hidden":`true`,className:`size-[15px]`})}),(0,K.jsx)(`h1`,{className:`truncate text-base font-semibold`,children:t?`Edit automation`:`New automation`}),t?(0,K.jsx)(I,{dot:t.enabled?`success`:`neutral`,children:t.enabled?`enabled`:`paused`}):null,(0,K.jsx)(`span`,{className:`flex-1`}),t?null:(0,K.jsxs)(D,{variant:`ghost`,size:`sm`,"aria-expanded":C,"aria-label":C?`Hide templates`:`Start from a template`,onClick:()=>w(e=>!e),children:[(0,K.jsx)(Et,{"aria-hidden":`true`,className:`size-3.5`}),(0,K.jsx)(`span`,{className:`max-md:hidden`,children:C?`Hide templates`:`Start from a template`})]}),(0,K.jsx)(D,{variant:`outline`,onClick:r,children:`Cancel`}),(0,K.jsx)(D,{disabled:!Ce,onClick:()=>void Te(),children:je})]}),(0,K.jsx)(`div`,{className:`flex justify-center p-5`,children:(0,K.jsxs)(`div`,{className:`grid w-full max-w-[1080px] grid-cols-1 items-start gap-4 lg:grid-cols-[minmax(0,1fr)_320px]`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[ae?(0,K.jsxs)(`div`,{role:`alert`,"data-slot":`editor-conflict`,className:`flex flex-wrap items-center gap-3 rounded-lg border border-danger/40 bg-danger/10 px-3.5 py-2.5 text-[13px] text-foreground`,children:[`Edited elsewhere — reload to see the latest version`,(0,K.jsx)(D,{variant:`outline`,size:`sm`,className:`ml-auto`,onClick:M,children:`Reload`})]}):null,E?.section===`top`?(0,K.jsx)(wn,{children:E.message}):null,C&&!t?(0,K.jsx)(vn,{onPick:e=>{let t=e.workflow&&he.includes(e.workflow)?e.workflow:void 0,n=e.steps?.every(e=>!e.skill||_e.includes(e.skill))?e.steps:void 0;S(r=>Kt(r,{...e,workflow:t,steps:n})),w(!1)}}):null,(0,K.jsx)(Cn,{title:`Name`,children:(0,K.jsx)(L,{"aria-label":`Name`,placeholder:`Nightly dependency bump`,value:x.name,onChange:e=>A({name:e.target.value}),className:`max-w-[420px] text-[15px] md:text-[15px]`})}),(0,K.jsxs)(Cn,{title:`When`,children:[(0,K.jsx)(Tn,{value:x.kind,editing:!!t,githubAvailable:de,githubReason:e?.reason,onChange:e=>A({kind:e,...e===`tracker`?{intervalSeconds:1800,enabled:!1}:{}})}),x.kind===`schedule`?(0,K.jsx)(fn,{schedule:x.schedule,timeZone:le,onChange:e=>A({schedule:e})}):x.kind===`tracker`?(0,K.jsx)(tn,{trigger:x.trackerTrigger,intervalSeconds:x.intervalSeconds,onChange:A,onValid:te}):(0,K.jsx)(an,{events:x.events,intervalSeconds:x.intervalSeconds,filters:x.filters,onChange:e=>A(e)}),E?.section===`when`?(0,K.jsx)(wn,{children:E.message}):null]}),(0,K.jsxs)(Cn,{title:`What to run`,children:[(0,K.jsxs)(`div`,{"data-slot":`editor-prompt-templates`,className:`flex flex-wrap items-center gap-1.5 text-xs text-soft-foreground`,children:[(0,K.jsx)(et,{"aria-hidden":`true`,className:`size-3`}),`Prompt templates`,pe.map(e=>(0,K.jsx)(N,{className:`h-6 text-[11.5px]`,title:e.text,onClick:()=>we(e.text),children:e.label},e.id)),(0,K.jsx)(N,{dashed:!0,className:`h-6 text-[11.5px]`,icon:(0,K.jsx)(nt,{"aria-hidden":`true`,className:`size-3`}),onClick:()=>d(`${Tt(`project`,`instructions`)}#prompt-templates`),children:`Manage…`})]}),(0,K.jsx)(Me,{ref:se,"aria-label":`Prompt`,rows:5,placeholder:xn[x.kind],value:x.prompt,onChange:e=>A({prompt:e.target.value}),className:`min-h-[104px] text-sm leading-[1.55] md:text-sm`}),j.length>0?(0,K.jsxs)(`div`,{role:`status`,"data-slot":`editor-prompt-condition`,className:`flex flex-wrap items-center gap-2 rounded-md border border-warning/40 bg-warning/10 px-3 py-2 text-[12.5px] text-foreground`,children:[(0,K.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[`The prompt names `,j.map(e=>`@${e}`).join(`, `),`, but prompt text does not decide what launches — without a filter every matching event starts a task.`]}),(0,K.jsx)(D,{variant:`outline`,size:`sm`,onClick:()=>A({filters:{...x.filters,authors:[...Vt(x.filters.authors),...j].join(`, `)}}),children:`Add to Authors`})]}):null,(0,K.jsx)(sn,{source:Pt(x),sourcesReady:be,skills:ye,skillUsage:ve,workflows:me,onSource:e=>A(Ft(e)),pick:{runner:x.runner,model:x.model,account:x.account},onPick:e=>A({runner:e.runner,model:e.model,account:e.account}),baseBranch:xe,autonomous:x.autonomous,onAutonomous:e=>A({autonomous:e})}),(0,K.jsx)(`p`,{className:`m-0 text-xs leading-[1.5] text-soft-foreground`,children:`Each run is an ordinary cezar task in its own worktree — it queues behind the parallel cap like anything else and never auto-merges.`}),(0,K.jsx)(rn,{available:fe,enabled:x.dispatch,maxSubtasks:x.maxSubtasks,reviewChild:x.reviewChild,onChange:e=>A(e)}),E?.section===`what`?(0,K.jsx)(wn,{children:E.message}):null]}),(0,K.jsx)(Cn,{title:`Enable`,children:(0,K.jsxs)(B,{className:`text-[13px] font-medium`,children:[(0,K.jsx)(yt,{"aria-label":`Enabled`,checked:x.enabled,onCheckedChange:e=>A({enabled:e})}),`Enabled`,x.kind===`schedule`?null:(0,K.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:`— from a current-time baseline; existing matches will not launch`})]})})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 lg:sticky lg:top-[76px]`,children:[(0,K.jsx)(hn,{kind:x.kind,schedule:x.schedule,intervalSeconds:x.intervalSeconds,timeZone:le}),(0,K.jsx)(nn,{definition:Se}),t&&t.kind!==`schedule`&&n?(0,K.jsx)(D,{variant:`outline`,disabled:n.busy,onClick:()=>void n.preview(t),children:`Preview saved matches`}):null,t?.lastRun?(0,K.jsx)(pn,{lastRun:t.lastRun,busy:n?.busy,onRunNow:()=>void n?.runNow(t),onLog:o}):null]})]})})]})}function Cn({title:e,children:t}){return(0,K.jsxs)(P,{"data-slot":`editor-section`,className:`gap-0 px-6 py-0`,children:[(0,K.jsx)(`div`,{className:`pt-4 pb-1 text-sm font-semibold`,children:e}),(0,K.jsx)(`div`,{className:`flex flex-col gap-3.5 pt-2.5 pb-5`,children:t})]})}function wn({children:e}){return(0,K.jsx)(`p`,{role:`alert`,className:`m-0 rounded-md border border-danger/40 bg-danger/10 px-3 py-2 text-[12.5px] text-danger`,children:e})}function Tn({value:e,editing:t,githubAvailable:n,githubReason:r,onChange:i}){let a=`Change the kind by creating a new automation`;return(0,K.jsx)(`div`,{"data-slot":`editor-kind`,role:`group`,"aria-label":`Trigger`,className:`inline-flex flex-wrap gap-0.5 self-start rounded-md bg-muted p-[3px]`,children:[{value:`schedule`,label:`On a schedule`,disabled:t&&e!==`schedule`,...t&&e!==`schedule`?{title:a}:{}},{value:`github`,label:`When GitHub changes`,disabled:!n||t&&e!==`github`,...n?t&&e!==`github`?{title:a}:{}:{title:r??`GitHub is unavailable`}},{value:`tracker`,label:`When Jira / Linear changes`,disabled:t&&e!==`tracker`,...t&&e!==`tracker`?{title:a}:{}}].map(t=>(0,K.jsx)(`button`,{type:`button`,"data-value":t.value,"aria-pressed":t.value===e,disabled:t.disabled,title:t.title,onClick:()=>{t.value!==e&&i(t.value)},className:E(`flex h-7 items-center justify-center gap-1.5 rounded-[7px] px-3 text-[12.5px] font-medium whitespace-nowrap text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50`,t.value===e&&`bg-card font-semibold text-foreground shadow-xs`),children:t.label},t.value))})}function En({automationId:e,automation:t,timeZone:n,onBack:r}){let i=O(),c=m(),l=b(),u=(0,G.useMemo)(()=>[l,`automation-log`,e],[l,e]),d=h({queryKey:u,queryFn:({signal:t})=>o(e,{signal:t})}),[f,p]=(0,G.useState)(`all`),[g,_]=(0,G.useState)(`all`);(0,G.useEffect)(()=>le((t,n)=>{t===`automation-change`&&n.automationId===e&&c.invalidateQueries({queryKey:u})}),[e,c,u]);let v=a({mutationFn:e=>s(e),onSuccess:()=>c.invalidateQueries({queryKey:u}),onError:e=>oe(e instanceof Error?e.message:String(e),{tone:`danger`})}),ee=n??`UTC`,y=d.data?.records.filter(e=>(f===`all`||e.result===f)&&(g===`all`||e.event===g));return(0,K.jsxs)(`div`,{"data-route":`automations`,"data-slot":`automation-log`,className:`flex min-h-full flex-col`,children:[(0,K.jsxs)(`header`,{className:`sticky top-0 z-10 flex h-14 shrink-0 items-center gap-3 border-b border-border bg-background px-5`,children:[(0,K.jsx)(D,{variant:`ghost`,size:`icon-sm`,"aria-label":`Back`,onClick:r,children:(0,K.jsx)(Ee,{className:`size-[15px]`})}),(0,K.jsx)(`h1`,{className:`m-0 text-base font-semibold`,children:t?t.name:`Automation`}),(0,K.jsx)(`span`,{className:`text-[13px] text-muted-foreground`,children:`· execution log`}),(0,K.jsxs)(`div`,{className:`flex flex-1 items-center justify-end gap-2`,children:[(0,K.jsxs)(W,{value:f,onValueChange:e=>p(e),children:[(0,K.jsx)(U,{size:`sm`,"aria-label":`Filter by result`,className:`text-[12.5px]`,children:(0,K.jsx)(H,{placeholder:`All results`})}),(0,K.jsxs)(V,{children:[(0,K.jsx)(z,{value:`all`,children:`All results`}),Dn.map(e=>(0,K.jsx)(z,{value:e,children:e},e))]})]}),(0,K.jsxs)(W,{value:g,onValueChange:e=>_(e),children:[(0,K.jsx)(U,{size:`sm`,"aria-label":`Filter by event`,className:`text-[12.5px]`,children:(0,K.jsx)(H,{placeholder:`All events`})}),(0,K.jsxs)(V,{children:[(0,K.jsx)(z,{value:`all`,children:`All events`}),On.map(e=>(0,K.jsx)(z,{value:e,children:e},e))]})]})]}),(0,K.jsxs)(D,{variant:`outline`,size:`sm`,onClick:()=>i(`/automations/${encodeURIComponent(e)}`),children:[(0,K.jsx)(rt,{className:`size-[13px]`}),`Edit`]})]}),(0,K.jsx)(`div`,{className:`flex justify-center p-5`,children:d.isError?(0,K.jsx)(`div`,{className:`w-full max-w-[820px]`,children:(0,K.jsx)($,{text:d.error instanceof Error?d.error.message:String(d.error)})}):y===void 0?(0,K.jsx)(`div`,{className:`w-full max-w-[820px]`,children:(0,K.jsx)($,{text:`Loading execution log…`})}):y.length===0?(0,K.jsx)(`div`,{className:`w-full max-w-[820px]`,children:(0,K.jsx)($,{text:`No checks have run yet.`})}):(0,K.jsx)(P,{flush:!0,className:`w-full max-w-[820px]`,children:y.map((e,t)=>(0,K.jsx)(An,{record:e,run:e.runId===void 0?void 0:d.data?.runs[e.runId],last:t===y.length-1,timeZone:ee,retrying:v.isPending&&v.variables===e.receiptId,onRetry:e=>v.mutate(e)},e.seq))})})]})}var Dn=[`launched`,`no-match`,`duplicate`,`rate-limited`,`error`,`baseline`,`preview`,`manual`,`catch-up`,`skipped`,`failed`],On=[`pull_request.opened`,`issue.opened`,`issue.labeled`,`issue.unlabeled`,`pull_request.reviewed`,`pull_request.review_requested`,`pull_request.rereview_requested`,`pull_request.closed`,`pull_request.merged`];function kn(e){return e.result===`failed`&&e.runId===void 0?e.receiptId:void 0}function An({record:e,run:t,last:n,timeZone:r,retrying:i,onRetry:a}){let o=ze(e.result),s=t?.children??[],c=kn(e);return(0,K.jsxs)(`div`,{"data-slot":`log-row`,"data-result":e.result,className:`grid grid-cols-[90px_110px_1fr_auto] items-center gap-x-3 gap-y-2 px-4 py-3 text-[13px] ${n?``:`border-b border-border`}`,children:[(0,K.jsx)(`span`,{className:`font-mono text-xs font-medium text-muted-foreground tabular-nums`,children:Ie(e.ts,r)}),(0,K.jsx)(I,{dot:o,className:`w-fit`,children:e.result}),(0,K.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap ${o===`danger`?`text-danger`:`text-muted-foreground`}`,title:e.reason,children:e.reason??``}),null,e.runId===void 0?c===void 0?(0,K.jsx)(`span`,{}):(0,K.jsxs)(D,{variant:`ghost`,size:`sm`,disabled:i,onClick:()=>a(c),children:[(0,K.jsx)(xt,{className:`size-3`}),`Retry task`]}):(0,K.jsx)(D,{variant:`ghost`,size:`sm`,asChild:!0,children:(0,K.jsxs)(k,{to:`/tasks/${encodeURIComponent(e.runId)}`,children:[`Open task`,(0,K.jsx)(A,{className:`size-3`})]})}),s.length>0?(0,K.jsx)(`div`,{className:`col-span-full flex flex-col gap-1 pl-3.5`,children:s.map(e=>(0,K.jsxs)(`div`,{"data-slot":`log-child`,className:`grid grid-cols-[14px_70px_1fr_auto] items-center gap-2.5 text-[12.5px]`,children:[(0,K.jsx)(`span`,{className:`font-mono text-[11px] text-soft-foreground`,children:`└`}),(0,K.jsx)(`span`,{className:`w-fit rounded-full bg-muted px-1.5 py-px text-[10.5px] font-medium text-muted-foreground`,children:e.kind??`implement`}),(0,K.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,K.jsx)(R,{tone:Pe(e.status)}),(0,K.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap`,children:e.title})]}),null,(0,K.jsx)(D,{variant:`ghost`,size:`sm`,className:`h-6`,asChild:!0,children:(0,K.jsxs)(k,{to:`/tasks/${encodeURIComponent(e.runId)}`,children:[`Open`,(0,K.jsx)(A,{className:`size-[11px]`})]})})]},e.runId))}):null]})}function jn({automation:e,actions:t}){let n=O(),[r,i]=(0,G.useState)(!1),a=e=>e.stopPropagation(),o=`/automations/${encodeURIComponent(e.id)}`;return(0,K.jsxs)(`span`,{"data-slot":`row-actions`,className:`inline-flex gap-0.5`,onClick:a,children:[e.kind===`schedule`?null:(0,K.jsx)(D,{variant:`ghost`,size:`icon-sm`,title:`Preview matches`,"aria-label":`Preview matches`,disabled:t.busy,onClick:()=>void t.preview(e),children:(0,K.jsx)($e,{className:`size-[13px]`})}),(0,K.jsx)(D,{variant:`ghost`,size:`icon-sm`,title:`Run now`,"aria-label":`Run now`,disabled:t.busy,onClick:()=>void t.runNow(e),children:(0,K.jsx)(it,{className:`size-[13px]`})}),(0,K.jsx)(D,{variant:`ghost`,size:`icon-sm`,title:e.enabled?`Pause`:`Enable`,"aria-label":e.enabled?`Pause`:`Enable`,disabled:t.busy,onClick:()=>void t.toggleEnabled(e),children:e.enabled?(0,K.jsx)(Dt,{className:`size-[13px]`}):(0,K.jsx)(Ot,{className:`size-[13px]`})}),(0,K.jsxs)(Ye,{children:[(0,K.jsx)(Ze,{asChild:!0,children:(0,K.jsx)(D,{variant:`ghost`,size:`icon-sm`,"aria-label":`More`,children:(0,K.jsx)(we,{className:`size-3.5`})})}),(0,K.jsxs)(Xe,{align:`end`,className:`w-[200px]`,onClick:a,children:[(0,K.jsxs)(F,{onSelect:()=>n(o),children:[(0,K.jsx)(rt,{}),`Edit`]}),(0,K.jsxs)(F,{onSelect:()=>n(`${o}/log`),children:[(0,K.jsx)(kt,{}),`View log`]}),(0,K.jsxs)(F,{onSelect:()=>void t.duplicate(e),children:[(0,K.jsx)(Ce,{}),`Duplicate`]}),(0,K.jsxs)(F,{onSelect:()=>void t.copyCli(e),children:[(0,K.jsx)(Qe,{}),`Copy as CLI`]}),(0,K.jsx)(Je,{}),(0,K.jsxs)(F,{variant:`destructive`,onSelect:()=>i(!0),children:[(0,K.jsx)(je,{}),`Delete`]})]})]}),(0,K.jsx)(gt,{open:r,onOpenChange:i,children:(0,K.jsxs)(dt,{onClick:a,children:[(0,K.jsxs)(ht,{children:[(0,K.jsxs)(ut,{children:[`Delete “`,e.name,`”?`]}),(0,K.jsx)(lt,{children:`The automation is removed for good. Tasks it already launched and its execution log stay.`})]}),(0,K.jsxs)(pt,{children:[(0,K.jsx)(mt,{children:`Cancel`}),(0,K.jsx)(ft,{className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>void t.remove(e),children:`Delete`})]})]})})]})}var X=`h-[38px] border-b border-border px-[10px] text-left text-[11px] leading-none font-semibold tracking-[.05em] whitespace-nowrap text-soft-foreground uppercase`,Z=`h-12 border-b border-border px-[10px] text-[13px] leading-none whitespace-nowrap`,Q=`cz-auto-wide max-[1280px]:hidden`,Mn=(0,K.jsx)(`span`,{className:`text-xs text-soft-foreground`,children:`—`});function Nn({data:e,actions:t,now:n=Date.now()}){return(0,K.jsx)(P,{flush:!0,"data-slot":`automations-table`,className:`min-w-0 overflow-x-auto`,children:(0,K.jsxs)(`table`,{className:`w-full border-collapse [&_tbody_tr:last-child>td]:border-b-0`,children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{className:E(X,`pl-4`),children:`State`}),(0,K.jsx)(`th`,{className:X,children:`Automation`}),(0,K.jsx)(`th`,{className:X,children:`Trigger`}),(0,K.jsx)(`th`,{className:E(X,Q),children:`Runs as`}),(0,K.jsx)(`th`,{className:X,children:`Next run`}),(0,K.jsx)(`th`,{className:X,children:`Last run`}),(0,K.jsx)(`th`,{className:E(X,Q,`text-right`),children:`Runs 7d`}),null,(0,K.jsx)(`th`,{className:E(X,`pr-4`)})]})}),(0,K.jsx)(`tbody`,{children:e.automations.map(r=>(0,K.jsx)(Pn,{automation:r,actions:t,timeZone:e.timeZone,available:e.available,showCost:!1,now:n},r.id))})]})})}function Pn({automation:e,actions:t,timeZone:n,available:r,showCost:i,now:a}){let o=O(),s=e.kind===`github`,c=s&&!r,l=e.task.dispatch,u=We(e),d=[e.task.workflow,e.task.runner].filter(Boolean);return(0,K.jsxs)(`tr`,{"data-slot":`automation-row`,"data-automation":e.id,"data-enabled":e.enabled?`true`:`false`,className:E(`cursor-pointer hover:bg-muted`,!e.enabled&&`opacity-60`),onClick:()=>o(`/automations/${encodeURIComponent(e.id)}`),children:[(0,K.jsx)(`td`,{className:E(Z,`pl-4`),children:c?(0,K.jsx)(I,{dot:`neutral`,children:`paused by capability`}):(0,K.jsx)(I,{dot:e.enabled?`success`:`neutral`,pulse:e.enabled&&s,children:e.enabled?`enabled`:`paused`})}),(0,K.jsx)(`td`,{className:E(Z,`max-w-0 min-w-[200px]`),children:(0,K.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[s?(0,K.jsx)(bt,{className:`size-3.5 shrink-0 text-soft-foreground`}):e.kind===`tracker`?(0,K.jsx)(M,{className:`size-3.5 shrink-0 text-soft-foreground`}):(0,K.jsx)(St,{className:`size-3.5 shrink-0 text-soft-foreground`}),(0,K.jsx)(`span`,{className:`overflow-hidden text-[13px] font-medium text-ellipsis whitespace-nowrap`,children:e.name}),l?(0,K.jsxs)(`span`,{"data-slot":`dispatch-badge`,title:`dispatch · up to ${l.maxSubtasks??1} subtasks`,className:`inline-flex shrink-0 items-center gap-[3px] rounded-full bg-muted px-1.5 py-px text-[10.5px] font-medium text-muted-foreground`,children:[(0,K.jsx)(tt,{className:`size-2.5`}),`×`,l.maxSubtasks??1]}):null]})}),(0,K.jsx)(`td`,{className:E(Z,`max-w-[260px] overflow-hidden font-mono text-xs text-ellipsis text-muted-foreground`),title:u,children:u}),(0,K.jsx)(`td`,{className:E(Z,Q,`text-xs text-muted-foreground`),children:d.length?(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[d.map((e,t)=>(0,K.jsxs)(`span`,{className:`contents`,children:[t>0?(0,K.jsx)(`span`,{className:`text-soft-foreground`,children:`·`}):null,e]},e)),e.task.autonomous?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`text-soft-foreground`,children:`·`}),(0,K.jsx)(`span`,{title:`autonomous`,"data-slot":`autonomous-mark`,className:`inline-flex`,children:(0,K.jsx)(M,{"aria-hidden":`true`,className:`size-[11px] text-soft-foreground`})})]}):null]}):Mn}),(0,K.jsx)(`td`,{"data-slot":`next-run`,className:E(Z,`font-mono text-xs tabular-nums`,e.enabled?`text-foreground`:`text-soft-foreground`),children:Fn(e,n,a)}),(0,K.jsx)(`td`,{className:Z,children:e.lastRun?(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,K.jsx)(R,{tone:Pe(e.lastRun.status)}),(0,K.jsx)(`span`,{className:`text-[12.5px] text-muted-foreground`,children:He(e.lastRun.status)}),(0,K.jsx)(`span`,{className:`text-[11.5px] text-soft-foreground`,children:_t(e.lastRun.ts,a)}),(0,K.jsxs)(k,{to:`/tasks/${encodeURIComponent(e.lastRun.runId)}`,"data-slot":`task-link`,onClick:e=>e.stopPropagation(),className:`inline-flex items-center gap-0.5 rounded-full border border-violet/40 px-1.5 py-px font-mono text-[10.5px] font-semibold text-violet`,children:[`task`,(0,K.jsx)(A,{className:`size-[9px]`})]})]}):Mn}),(0,K.jsx)(`td`,{className:E(Z,Q,`text-right font-mono text-xs text-muted-foreground tabular-nums`),children:e.runs7d}),i?(0,K.jsx)(`td`,{className:E(Z,Q,`text-right font-mono text-xs text-muted-foreground tabular-nums`),children:e.costUsd7d===void 0?Mn:Fe(e.costUsd7d)}):null,(0,K.jsx)(`td`,{className:E(Z,`pr-3 text-right`),children:(0,K.jsx)(jn,{automation:e,actions:t})})]})}function Fn(e,t,n){if(!e.enabled)return`—`;if(e.kind!==`schedule`)return`continuous`;if(e.nextRunAt)return Ve(e.nextRunAt,t)||`—`;let r=e.schedule?w(e.schedule,n,t):null;return r===null?`—`:Ve(r,t)||`—`}function In(e){return e.hour*60+e.minute}function Ln(e,t,n=0){let r=T(e,t);if(!r)return null;let i=new Date(Date.UTC(r.year,r.month-1,r.day+n));return x(i.getUTCFullYear(),i.getUTCMonth()+1,i.getUTCDate(),0,0,t)}function Rn(e,t,n,r){let i=[];for(let a of e)if(!(a.kind!==`schedule`||!a.schedule))for(let e of ne(a.schedule,t,n,r)){let t=T(e,r);t&&i.push({automation:a,at:e,parts:t})}return i.sort((e,t)=>e.at-t.at)}function zn(e){let t=new Map;return e.map(e=>{let n=In(e.parts),r=t.get(n)??0;return t.set(n,r+1),{occurrence:e,stack:r}})}function Bn({automation:e,minute:t,stack:n=0,wide:r=!1}){let i=O(),a=C(Math.floor(t/60),t%60),o=[e.task.workflow,e.task.runner].filter(Boolean).join(` · `);return(0,K.jsxs)(`button`,{type:`button`,"data-slot":`event-block`,"data-automation":e.id,"data-enabled":e.enabled?`true`:`false`,title:`${e.name} · ${a}`,onClick:()=>i(`/automations/${encodeURIComponent(e.id)}`),className:E(`absolute right-[3px] left-[3px] flex cursor-pointer overflow-hidden rounded-[6px] border border-border bg-card text-left text-[11.5px] leading-[1.3] font-medium text-foreground shadow-xs`,r?`h-12 flex-col items-start gap-[3px] px-2 py-[5px]`:`h-6 flex-row items-center gap-1.5 px-1.5`,!e.enabled&&`opacity-50`),style:{top:t/60*34+1+26*n},children:[(0,K.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:[(0,K.jsx)(R,{tone:e.task.runner===`codex`?`violet`:`success`}),(0,K.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap`,children:e.name})]}),r?(0,K.jsxs)(`span`,{className:`max-w-full overflow-hidden font-mono text-[10.5px] leading-[1.3] font-normal text-ellipsis whitespace-nowrap text-muted-foreground`,children:[a,o?` · ${o}`:``]}):null]})}function Vn(){return(0,K.jsx)(`div`,{"data-slot":`hour-gutter`,className:`w-12 shrink-0`,children:Array.from({length:24},(e,t)=>(0,K.jsx)(`div`,{className:`-translate-y-[6px] pr-2 text-right font-mono text-[10.5px] text-soft-foreground`,style:{height:34},children:t?C(t):``},t))})}function Hn({minute:e}){return(0,K.jsx)(`div`,{"aria-hidden":`true`,"data-slot":`now-line`,className:`absolute inset-x-0 z-[2] h-[2px] bg-primary`,style:{top:e/60*34},children:(0,K.jsx)(`span`,{className:`absolute -top-[3px] -left-[3px] size-[8px] rounded-full bg-primary`})})}function Un(){return(0,K.jsx)(K.Fragment,{children:Array.from({length:24},(e,t)=>(0,K.jsx)(`div`,{"aria-hidden":`true`,className:`absolute inset-x-0 h-px bg-border`,style:{top:t*34}},t))})}function Wn({automations:e}){let t=e.filter(e=>e.kind===`github`&&e.enabled);return t.length?(0,K.jsxs)(`div`,{"data-slot":`poll-band`,className:`grid grid-cols-[48px_minmax(0,1fr)] border-b border-border`,children:[(0,K.jsx)(`div`,{className:`py-2 pr-2 text-right font-mono text-[10.5px] text-soft-foreground`,children:`poll`}),(0,K.jsx)(`div`,{className:`flex flex-col gap-1 border-l border-border px-2 py-1.5`,children:t.map(e=>(0,K.jsxs)(`div`,{"data-slot":`poll-row`,className:`flex h-[22px] min-w-0 items-center gap-2 overflow-hidden rounded-[6px] border border-violet/25 bg-violet/8 px-2 text-[11.5px] font-medium`,children:[(0,K.jsx)(bt,{className:`size-3 shrink-0 text-violet`}),(0,K.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap`,children:e.name}),(0,K.jsx)(`span`,{className:`overflow-hidden font-mono text-[10.5px] font-normal text-ellipsis whitespace-nowrap text-muted-foreground`,children:We(e)}),(0,K.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-[10.5px] font-normal whitespace-nowrap text-soft-foreground`,children:[e.runs7d,` runs`]})]},e.id))})]}):null}var Gn=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function Kn({data:e}){let t=Se(6e4),n=O(),[r,i]=(0,G.useState)(0),a=e.timeZone,o=Ln(t,a,r),s=Ln(t,a,r+1),c=o===null?null:T(o,a),l=T(t,a);if(o===null||s===null||!c||!l)return(0,K.jsx)(`div`,{"data-slot":`day-view`,className:`p-5`,children:(0,K.jsxs)(`p`,{className:`rounded-xl border border-dashed p-8 text-center text-sm text-muted-foreground`,children:[`Cannot draw the day: unknown time zone “`,a,`”.`]})});let u=r===0,d=zn(Rn(e.automations,o,s,a)),f=e.automations.filter(e=>e.kind===`github`&&e.enabled),p=`${Re(c.weekday)} ${c.day} ${Gn[c.month-1]??``}`;return(0,K.jsxs)(`div`,{"data-slot":`day-view`,className:`grid grid-cols-[minmax(0,1fr)_320px] items-start gap-4 p-5 max-md:grid-cols-1`,children:[(0,K.jsxs)(P,{flush:!0,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3.5 py-2.5`,children:[(0,K.jsx)(D,{variant:`ghost`,size:`icon-sm`,"aria-label":`Previous day`,onClick:()=>i(e=>e-1),children:(0,K.jsx)(Ge,{className:`size-3.5`})}),(0,K.jsx)(D,{variant:`ghost`,size:`icon-sm`,"aria-label":`Next day`,onClick:()=>i(e=>e+1),children:(0,K.jsx)(qe,{className:`size-3.5`})}),(0,K.jsx)(`span`,{"data-slot":`day-title`,className:`text-sm font-semibold whitespace-nowrap`,children:p}),u?(0,K.jsx)(I,{dot:`success`,children:`today`}):null,(0,K.jsxs)(`span`,{className:`ml-auto text-xs whitespace-nowrap text-muted-foreground`,children:[d.length,` scheduled runs`,f.length?` · ${f.length} GitHub poll${f.length===1?``:`s`}`:``]})]}),(0,K.jsx)(Wn,{automations:e.automations}),(0,K.jsxs)(`div`,{className:`flex max-h-[600px] overflow-y-auto`,children:[(0,K.jsx)(Vn,{}),(0,K.jsxs)(`div`,{"data-slot":`day-column`,"data-today":u?`true`:void 0,className:`relative flex-1 border-l border-border`,style:{height:816},children:[(0,K.jsx)(Un,{}),u?(0,K.jsx)(Hn,{minute:In(l)}):null,d.map(({occurrence:e,stack:t})=>(0,K.jsx)(Bn,{automation:e.automation,minute:In(e.parts),stack:t,wide:!0},`${e.automation.id}-${e.at}`))]})]})]}),(0,K.jsxs)(P,{flush:!0,"data-slot":`agenda`,className:`py-3`,children:[(0,K.jsx)(`div`,{className:`px-3.5 pb-2 text-[11px] font-semibold tracking-[.05em] text-soft-foreground uppercase`,children:`Agenda`}),f.map(e=>(0,K.jsxs)(`button`,{type:`button`,"data-slot":`agenda-poll`,onClick:()=>n(`/automations/${encodeURIComponent(e.id)}`),className:`grid w-full cursor-pointer grid-cols-[48px_1fr] gap-2.5 px-3.5 py-2 text-left hover:bg-muted`,children:[(0,K.jsx)(`span`,{className:`font-mono text-[10.5px] font-medium text-soft-foreground`,children:`poll`}),(0,K.jsxs)(`span`,{className:`min-w-0`,children:[(0,K.jsxs)(`span`,{className:`flex items-center gap-2 text-[13px] font-medium`,children:[(0,K.jsx)(bt,{className:`size-3 shrink-0 text-violet`}),(0,K.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap`,children:e.name})]}),(0,K.jsxs)(`span`,{className:`mt-0.5 block overflow-hidden font-mono text-[11.5px] leading-[1.4] text-ellipsis whitespace-nowrap text-soft-foreground`,children:[We(e),` · continuous`]})]})]},e.id)),d.map(({occurrence:e})=>{let r=e.at<t,{automation:i}=e;return(0,K.jsxs)(`button`,{type:`button`,"data-slot":`agenda-row`,"data-past":r?`true`:`false`,onClick:()=>n(`/automations/${encodeURIComponent(i.id)}`),className:`grid w-full cursor-pointer grid-cols-[48px_1fr] gap-2.5 px-3.5 py-2 text-left hover:bg-muted`,children:[(0,K.jsx)(`span`,{className:E(`font-mono text-xs font-medium tabular-nums`,r?`text-soft-foreground`:`text-foreground`),children:C(e.parts.hour,e.parts.minute)}),(0,K.jsxs)(`span`,{className:`min-w-0`,children:[(0,K.jsxs)(`span`,{className:E(`flex items-center gap-2 text-[13px] font-medium`,r&&`text-muted-foreground`),children:[(0,K.jsx)(R,{tone:r&&i.lastRun?Pe(i.lastRun.status):`neutral`}),(0,K.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap`,children:i.name})]}),(0,K.jsx)(`span`,{className:`mt-0.5 block overflow-hidden text-[11.5px] leading-[1.4] text-ellipsis whitespace-nowrap text-soft-foreground`,children:i.task.prompt})]})]},`${i.id}-${e.at}`)}),d.length===0?(0,K.jsx)(`p`,{className:`px-3.5 py-2 text-[12.5px] text-soft-foreground`,children:f.length?`Nothing scheduled — the GitHub polls above still run.`:`Nothing scheduled.`}):null]})]})}function qn(e,t,n,r=12){let i=[];for(let a of e)if(!(!a.enabled||a.kind!==`schedule`||!a.schedule))for(let e of ne(a.schedule,t,t+14*864e5,n,r))i.push({automation:a,at:e});return i.sort((e,t)=>e.at-t.at).slice(0,r)}function Jn({open:e,onOpenChange:t,upcoming:n,pollCount:r,timeZone:i,now:a}){let o=O(),s=T(a,i);return(0,K.jsx)(ye,{open:e,onOpenChange:t,children:(0,K.jsxs)(ve,{side:`right`,"data-slot":`next-runs-rail`,"aria-describedby":void 0,className:`w-[360px] gap-0 sm:max-w-[360px]`,children:[(0,K.jsxs)(be,{className:`px-4 pt-4 pb-2`,children:[(0,K.jsxs)(xe,{className:`inline-flex items-center gap-2 text-sm`,children:[(0,K.jsx)(Be,{className:`size-4`}),`Next runs`]}),(0,K.jsx)(_e,{className:`sr-only`,children:`Upcoming scheduled runs, soonest first.`})]}),(0,K.jsxs)(`div`,{className:`overflow-y-auto`,children:[n.map((e,n)=>{let r=T(e.at,i),c=r!==null&&s!==null&&r.year===s.year&&r.month===s.month&&r.day===s.day,l=r?`${c?``:`${Re(r.weekday)} `}${C(r.hour,r.minute)}`:``;return(0,K.jsxs)(`button`,{type:`button`,"data-slot":`next-run-row`,"data-automation":e.automation.id,onClick:()=>{t(!1),o(`/automations/${encodeURIComponent(e.automation.id)}`)},className:`grid w-full cursor-pointer grid-cols-[76px_1fr_auto] items-center gap-2 px-4 py-2 text-left text-[13px] hover:bg-muted`,children:[(0,K.jsx)(`span`,{className:`font-mono text-xs font-medium whitespace-nowrap text-muted-foreground tabular-nums`,children:l}),(0,K.jsx)(`span`,{className:`overflow-hidden text-[13px] font-medium text-ellipsis whitespace-nowrap`,children:e.automation.name}),(0,K.jsx)(`span`,{className:`text-[11px] whitespace-nowrap text-soft-foreground`,children:Ne(e.at,a)})]},`${e.automation.id}-${n}`)}),n.length===0?(0,K.jsx)(`p`,{className:`px-4 py-2 text-[12.5px] text-soft-foreground`,children:`No scheduled runs in the next two weeks.`}):null,(0,K.jsxs)(`div`,{"data-slot":`next-runs-footer`,className:`mt-1.5 flex items-center gap-2 border-t border-border px-3.5 pt-2.5 pb-1 text-xs text-muted-foreground`,children:[(0,K.jsx)(R,{tone:`pending`,pulse:!0}),r,` GitHub polls running continuously`]})]})]})})}function Yn({stats:e,pollCount:t,upcoming:n,timeZone:r,railOpen:i,onOpenRail:a}){let o=n[0];return(0,K.jsxs)(`div`,{"data-slot":`stats-strip`,className:`flex flex-wrap items-center gap-4 text-[12.5px] text-muted-foreground`,children:[(0,K.jsx)(`span`,{className:`text-[11px] font-semibold tracking-[.05em] text-soft-foreground uppercase`,children:`This week`}),(0,K.jsx)(Xn,{label:`runs`,value:String(e.runs)}),null,(0,K.jsx)(Xn,{label:`failed`,value:String(e.failed),danger:e.failed>0}),(0,K.jsx)(Xn,{label:`agent time`,value:Ue(e.agentSeconds)}),(0,K.jsxs)(`span`,{"data-slot":`stats-polls`,className:`inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap`,children:[(0,K.jsx)(R,{tone:`pending`,pulse:!0}),t,` GitHub polls continuous`]}),(0,K.jsx)(`span`,{className:`flex-1`}),(0,K.jsxs)(`span`,{"data-slot":`stats-next`,className:`inline-flex min-w-0 shrink-0 items-center gap-1.5 whitespace-nowrap`,children:[(0,K.jsx)(St,{className:`size-[13px] text-soft-foreground`}),`next`,` `,(0,K.jsx)(`b`,{className:`font-mono text-[12.5px] font-medium text-foreground`,children:o?Le(o.at,r):`—`}),` `,(0,K.jsx)(`span`,{className:`max-w-[180px] overflow-hidden text-ellipsis`,children:o?.automation.name??``})]}),(0,K.jsxs)(D,{variant:`outline`,size:`sm`,"aria-expanded":i,className:`shrink-0`,onClick:a,children:[(0,K.jsx)(Be,{className:`size-3.5`}),`Next runs`,(0,K.jsx)(`span`,{className:`font-mono text-[11px] font-medium text-muted-foreground`,children:n.length})]})]})}function Xn({label:e,value:t,danger:n=!1}){return(0,K.jsxs)(`span`,{"data-slot":`stat`,"data-label":e,className:`inline-flex shrink-0 items-baseline gap-[5px] whitespace-nowrap`,children:[(0,K.jsx)(`b`,{className:E(`font-mono text-sm font-semibold tabular-nums`,n?`text-danger`:`text-foreground`),children:t}),e]})}var Zn=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`];function Qn({data:e}){let t=Se(6e4),n=e.timeZone,r=T(t,n),i=r?Array.from({length:8},(e,i)=>Ln(t,n,i-(r.weekday-1))):[],a=i[0],o=i[7];if(!r||a==null||o==null)return(0,K.jsx)(`div`,{"data-slot":`week-view`,className:`p-5`,children:(0,K.jsxs)(`p`,{className:`rounded-xl border border-dashed p-8 text-center text-sm text-muted-foreground`,children:[`Cannot draw the week: unknown time zone “`,n,`”.`]})});let s=r.weekday-1,c=Rn(e.automations,a,o,n),l=Zn.map((e,t)=>{let r=i[t];return{label:e,dayOfMonth:r==null?null:T(r,n)?.day??null,isToday:t===s,blocks:zn(c.filter(e=>e.parts.weekday-1===t))}});return(0,K.jsx)(`div`,{"data-slot":`week-view`,className:`p-5`,children:(0,K.jsxs)(P,{flush:!0,children:[(0,K.jsxs)(`div`,{className:`grid grid-cols-[48px_repeat(7,minmax(0,1fr))] border-b border-border`,children:[(0,K.jsx)(`div`,{}),l.map(e=>(0,K.jsxs)(`div`,{"data-slot":`week-day-header`,"data-today":e.isToday?`true`:void 0,className:E(`flex items-center gap-2 border-l border-border px-2 py-2.5 text-[11px] font-semibold tracking-[.05em] uppercase`,e.isToday?`text-foreground`:`text-soft-foreground`),children:[e.label,(0,K.jsx)(`span`,{className:E(`rounded-full px-[7px] py-px text-[13px] font-medium tracking-normal normal-case`,e.isToday?`bg-primary text-primary-foreground`:`text-muted-foreground`),children:e.dayOfMonth??``})]},e.label))]}),(0,K.jsx)(Wn,{automations:e.automations}),(0,K.jsxs)(`div`,{className:`flex max-h-[560px] overflow-y-auto`,children:[(0,K.jsx)(Vn,{}),l.map(e=>(0,K.jsxs)(`div`,{"data-slot":`week-column`,"data-today":e.isToday?`true`:void 0,className:E(`relative min-w-0 flex-1 border-l border-border`,e.isToday&&`bg-muted/35`),style:{height:816},children:[(0,K.jsx)(Un,{}),e.isToday?(0,K.jsx)(Hn,{minute:In(r)}):null,e.blocks.map(({occurrence:e,stack:t})=>(0,K.jsx)(Bn,{automation:e.automation,minute:In(e.parts),stack:t},`${e.automation.id}-${e.at}`))]},e.label))]})]})})}function $n(e){return[{value:`list`,label:`List`,...e===void 0?{}:{count:e}},{value:`week`,label:`Week`},{value:`day`,label:`Day`}]}function er({data:e,error:t,actions:n,view:r,onViewChange:i}){let[a,o]=(0,G.useState)(!1),s=Date.now(),c=e?qn(e.automations,s,e.timeZone,12):[],l=e?e.automations.filter(e=>e.kind===`github`&&e.enabled).length:0;return(0,K.jsxs)(`div`,{"data-route":`automations`,className:`flex min-h-full flex-col`,children:[(0,K.jsxs)(`header`,{className:`sticky top-0 z-10 flex h-14 shrink-0 items-center gap-3 border-b border-border bg-background px-5`,children:[(0,K.jsx)(`h1`,{className:`text-base font-semibold`,children:`Automations`}),(0,K.jsx)(fe,{slot:`automations-view`,label:`View`,value:r,options:$n(e?.automations.length),onChange:i}),(0,K.jsx)(`div`,{className:`flex-1`}),e?(0,K.jsxs)(`span`,{"data-slot":`automations-status`,className:`inline-flex min-w-0 items-center gap-2 overflow-hidden text-[12.5px] text-ellipsis whitespace-nowrap text-muted-foreground max-[1280px]:hidden`,children:[(0,K.jsx)(R,{tone:e.scheduler.state===`scheduled`?`success`:`neutral`}),e.scheduler.state===`scheduled`?`Scheduler running`:`Scheduler idle`,(0,K.jsx)(`span`,{className:`text-soft-foreground`,children:`·`}),e.available?`GitHub available`:`GitHub unavailable${e.reason?` · ${e.reason}`:``}`,(0,K.jsx)(`span`,{className:`text-soft-foreground`,children:`·`}),(0,K.jsx)(`span`,{className:`font-mono text-xs`,children:e.timeZone})]}):null,(0,K.jsx)(D,{asChild:!0,className:`shrink-0`,children:(0,K.jsxs)(k,{to:`/automations/new`,children:[(0,K.jsx)(at,{className:`size-[15px]`}),`New automation`]})})]}),t===void 0?e?e.automations.length===0?(0,K.jsx)(vt,{icon:(0,K.jsx)(M,{}),tone:`neutral`,title:`No automations yet`,subtitle:`Create one paused, preview it, then enable it.`,heading:`h2`,actions:(0,K.jsx)(D,{asChild:!0,children:(0,K.jsxs)(k,{to:`/automations/new`,children:[(0,K.jsx)(at,{className:`size-[15px]`}),`New automation`]})})}):r===`week`?(0,K.jsx)(Qn,{data:e}):r===`day`?(0,K.jsx)(Kn,{data:e}):(0,K.jsxs)(`div`,{"data-slot":`automations-list`,className:`flex flex-col gap-3 p-5`,children:[(0,K.jsx)(Yn,{stats:e.stats,pollCount:l,upcoming:c,timeZone:e.timeZone,railOpen:a,onOpenRail:()=>o(!0)}),(0,K.jsx)(Nn,{data:e,actions:n,now:s}),(0,K.jsx)(Jn,{open:a,onOpenChange:o,upcoming:c,pollCount:l,timeZone:e.timeZone,now:s})]}):(0,K.jsx)(`div`,{className:`p-5`,children:(0,K.jsx)($,{text:`Loading automations…`})}):(0,K.jsx)(`div`,{className:`p-5`,children:(0,K.jsx)($,{text:t})})]})}function tr({mode:e=`list`}){let{automationId:t}=ce(),n=O(),r=de(),i=pe(r.known&&!r.off),a=i.data?{...i.data,automations:i.data.automations.filter(e=>!e.deferredStart)}:void 0,o=he(a),[s,c]=ae(),l=nr(s.get(`view`));if(!r.known)return(0,K.jsx)(`div`,{"data-route":`automations`,className:`flex min-h-full flex-col p-3 md:p-5`,children:(0,K.jsx)($,{text:`Loading automations…`})});if(r.off)return(0,K.jsx)(`div`,{"data-route":`automations`,className:`flex min-h-full flex-col p-3 md:p-5`,children:(0,K.jsx)(vt,{icon:(0,K.jsx)(M,{}),tone:`neutral`,title:`Automations are off`,subtitle:`This cockpit was started with CEZ_AUTOMATIONS=0. Unset it and restart the service to turn automations on.`,heading:`h2`})});let u=()=>n(`/automations`);if(e===`new`)return(0,K.jsx)(Sn,{data:a,onBack:u,onSaved:u});if(e===`edit`){let e=a?.automations.find(e=>e.id===t);return a&&!e?(0,K.jsx)(`div`,{"data-route":`automations`,className:`p-5`,children:(0,K.jsx)($,{text:`Automation not found.`})}):e?(0,K.jsx)(Sn,{data:a,automation:e,actions:o,onBack:u,onSaved:u,onLog:()=>n(`/automations/${encodeURIComponent(e.id)}/log`)}):(0,K.jsx)(`div`,{"data-route":`automations`,className:`p-5`,children:(0,K.jsx)($,{text:`Loading automation…`})})}if(e===`log`){let e=a?.automations.find(e=>e.id===t);return t?(0,K.jsx)(En,{automationId:t,automation:e,timeZone:a?.timeZone,onBack:u}):(0,K.jsx)(`div`,{"data-route":`automations`,className:`p-5`,children:(0,K.jsx)($,{text:`Automation not found.`})})}return(0,K.jsx)(er,{data:a,error:i.error?String(i.error instanceof Error?i.error.message:i.error):void 0,actions:o,view:l,onViewChange:e=>c(t=>{let n=new URLSearchParams(t);return e===`list`?n.delete(`view`):n.set(`view`,e),n},{replace:!0})})}function nr(e){return e===`week`||e===`day`?e:`list`}function $({text:e}){return(0,K.jsx)(`div`,{className:`rounded-xl border border-dashed p-8 text-center text-sm text-muted-foreground`,children:e})}export{tr as AutomationsRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(t){var n,r,i=``;if(typeof t==`string`||typeof t==`number`)i+=t;else if(typeof t==`object`)if(Array.isArray(t)){var a=t.length;for(n=0;n<a;n++)t[n]&&(r=e(t[n]))&&(i&&(i+=` `),i+=r)}else for(r in t)t[r]&&(i&&(i+=` `),i+=r);return i}function t(){for(var t,n,r=0,i=``,a=arguments.length;r<a;r++)(t=arguments[r])&&(n=e(t))&&(i&&(i+=` `),i+=n);return i}var n=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},r=(e,t)=>({classGroupId:e,validator:t}),i=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),a=`-`,o=[],s=`arbitrary..`,c=e=>{let t=d(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return u(e);let n=e.split(a);return l(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=i[e],a=r[e];return t?a?n(a,t):t:a||o}return r[e]||o}}},l=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=l(e,t+1,i);if(n)return n}let o=n.validators;if(o===null)return;let s=t===0?e.join(a):e.slice(t).join(a),c=o.length;for(let e=0;e<c;e++){let t=o[e];if(t.validator(s))return t.classGroupId}},u=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?s+r:void 0})(),d=e=>{let{theme:t,classGroups:n}=e;return ee(n,t)},ee=(e,t)=>{let n=i();for(let r in e){let i=e[r];f(i,n,r,t)}return n},f=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];p(i,t,n,r)}},p=(e,t,n,r)=>{if(typeof e==`string`){m(e,t,n);return}if(typeof e==`function`){h(e,t,n,r);return}g(e,t,n,r)},m=(e,t,n)=>{let r=e===``?t:_(t,e);r.classGroupId=n},h=(e,t,n,i)=>{if(v(e)){f(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push(r(n,e))},g=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];f(o,_(t,a),n,r)}},_=(e,t)=>{let n=e,r=t.split(a),o=r.length;for(let e=0;e<o;e++){let t=r[e],a=n.nextPart.get(t);a||(a=i(),n.nextPart.set(t,a)),n=a}return n},v=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,y=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},b=`!`,x=`:`,S=[],C=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),w=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===x){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(b)?(c=s.slice(0,-1),l=!0):s.startsWith(b)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return C(t,l,c,u)};if(t){let e=t+x,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):C(S,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},te=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},ne=e=>({cache:y(e.cacheSize),parseClassName:w(e),sortModifiers:te(e),postfixLookupClassGroupIds:T(e),...c(e)}),T=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},re=/\s+/,E=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(re),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:ee,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let m=!!p,h;if(m){h=r(f.substring(0,p));let e=h&&o[h]?r(f):void 0;e&&e!==h&&(h=e,m=!1)}else h=r(f);if(!h){if(!m){l=t+(l.length>0?` `+l:l);continue}if(h=r(f),!h){l=t+(l.length>0?` `+l:l);continue}m=!1}let g=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),_=ee?g+b:g,v=_+h;if(s.indexOf(v)>-1)continue;s.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];s.push(_+t)}l=t+(l.length>0?` `+l:l)}return l},D=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=O(n))&&(i&&(i+=` `),i+=r);return i},O=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=O(e[r]))&&(n&&(n+=` `),n+=t);return n},k=(e,...t)=>{let n,r,i,a,o=o=>(n=ne(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=E(e,n);return i(e,a),a};return a=o,(...e)=>a(D(...e))},A=[],j=e=>{let t=t=>t[e]||A;return t.isThemeGetter=!0,t},M=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,N=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ie=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ae=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,P=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,F=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,I=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,L=e=>ie.test(e),R=e=>!!e&&!Number.isNaN(Number(e)),z=e=>!!e&&Number.isInteger(Number(e)),se=e=>e.endsWith(`%`)&&R(e.slice(0,-1)),B=e=>ae.test(e),ce=()=>!0,V=e=>oe.test(e)&&!P.test(e),H=()=>!1,U=e=>F.test(e),le=e=>I.test(e),ue=e=>!W(e)&&!q(e),de=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),fe=e=>Y(e,we,H),W=e=>M.test(e),G=e=>Y(e,Te,V),pe=e=>Y(e,Ee,R),me=e=>Y(e,Oe,ce),he=e=>Y(e,De,H),ge=e=>Y(e,Z,H),_e=e=>Y(e,Q,le),K=e=>Y(e,ke,U),q=e=>N.test(e),J=e=>X(e,Te),ve=e=>X(e,De),ye=e=>X(e,Z),be=e=>X(e,we),xe=e=>X(e,Q),Se=e=>X(e,ke,!0),Ce=e=>X(e,Oe,!0),Y=(e,t,n)=>{let r=M.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},X=(e,t,n=!1)=>{let r=N.exec(e);return r?r[1]?t(r[1]):n:!1},Z=e=>e===`position`||e===`percentage`,Q=e=>e===`image`||e===`url`,we=e=>e===`length`||e===`size`||e===`bg-size`,Te=e=>e===`length`,Ee=e=>e===`number`,De=e=>e===`family-name`,Oe=e=>e===`number`||e===`weight`,ke=e=>e===`shadow`,Ae=()=>{let e=j(`color`),t=j(`font`),n=j(`text`),r=j(`font-weight`),i=j(`tracking`),a=j(`leading`),o=j(`breakpoint`),s=j(`container`),c=j(`spacing`),l=j(`radius`),u=j(`shadow`),d=j(`inset-shadow`),ee=j(`text-shadow`),f=j(`drop-shadow`),p=j(`blur`),m=j(`perspective`),h=j(`aspect`),g=j(`ease`),_=j(`animate`),v=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],y=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],b=()=>[...y(),q,W],x=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],S=()=>[`auto`,`contain`,`none`],C=()=>[q,W,c],w=()=>[L,`full`,`auto`,...C()],te=()=>[z,`none`,`subgrid`,q,W],ne=()=>[`auto`,{span:[`full`,z,q,W]},z,q,W],T=()=>[z,`auto`,q,W],re=()=>[`auto`,`min`,`max`,`fr`,q,W],E=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],D=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],O=()=>[`auto`,...C()],k=()=>[L,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...C()],A=()=>[L,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...C()],M=()=>[L,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...C()],N=()=>[e,q,W],ie=()=>[...y(),ye,ge,{position:[q,W]}],ae=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],oe=()=>[`auto`,`cover`,`contain`,be,fe,{size:[q,W]}],P=()=>[se,J,G],F=()=>[``,`none`,`full`,l,q,W],I=()=>[``,R,J,G],V=()=>[`solid`,`dashed`,`dotted`,`double`],H=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],U=()=>[R,se,ye,ge],le=()=>[``,`none`,p,q,W],Y=()=>[`none`,R,q,W],X=()=>[`none`,R,q,W],Z=()=>[R,q,W],Q=()=>[L,`full`,...C()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[B],breakpoint:[B],color:[ce],container:[B],"drop-shadow":[B],ease:[`in`,`out`,`in-out`],font:[ue],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[B],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[B],shadow:[B],spacing:[`px`,R],text:[B],"text-shadow":[B],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,L,W,q,h]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,q,W]}],"container-named":[de],columns:[{columns:[R,W,q,s]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:b()}],overflow:[{overflow:x()}],"overflow-x":[{"overflow-x":x()}],"overflow-y":[{"overflow-y":x()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{"inset-s":w(),start:w()}],end:[{"inset-e":w(),end:w()}],"inset-bs":[{"inset-bs":w()}],"inset-be":[{"inset-be":w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[z,`auto`,q,W]}],basis:[{basis:[L,`full`,`auto`,s,...C()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[R,L,`auto`,`initial`,`none`,W]}],grow:[{grow:[``,R,q,W]}],shrink:[{shrink:[``,R,q,W]}],order:[{order:[z,`first`,`last`,`none`,q,W]}],"grid-cols":[{"grid-cols":te()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":te()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":re()}],"auto-rows":[{"auto-rows":re()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...E(),`normal`]}],"justify-items":[{"justify-items":[...D(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...D()]}],"align-content":[{content:[`normal`,...E()]}],"align-items":[{items:[...D(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...D(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":E()}],"place-items":[{"place-items":[...D(),`baseline`]}],"place-self":[{"place-self":[`auto`,...D()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":C()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":C()}],"space-y-reverse":[`space-y-reverse`],size:[{size:k()}],"inline-size":[{inline:[`auto`,...A()]}],"min-inline-size":[{"min-inline":[`auto`,...A()]}],"max-inline-size":[{"max-inline":[`none`,...A()]}],"block-size":[{block:[`auto`,...M()]}],"min-block-size":[{"min-block":[`auto`,...M()]}],"max-block-size":[{"max-block":[`none`,...M()]}],w:[{w:[s,`screen`,...k()]}],"min-w":[{"min-w":[s,`screen`,`none`,...k()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...k()]}],h:[{h:[`screen`,`lh`,...k()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...k()]}],"max-h":[{"max-h":[`screen`,`lh`,...k()]}],"font-size":[{text:[`base`,n,J,G]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Ce,me]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,se,W]}],"font-family":[{font:[ve,he,t]}],"font-features":[{"font-features":[W]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,q,W]}],"line-clamp":[{"line-clamp":[R,`none`,q,pe]}],leading:[{leading:[a,...C()]}],"list-image":[{"list-image":[`none`,q,W]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,q,W]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...V(),`wavy`]}],"text-decoration-thickness":[{decoration:[R,`from-font`,`auto`,q,G]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[R,`auto`,q,W]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:C()}],"tab-size":[{tab:[z,q,W]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,q,W]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,q,W]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},z,q,W],radial:[``,q,W],conic:[z,q,W]},xe,_e]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-bs":[{"border-bs":I()}],"border-w-be":[{"border-be":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":I()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...V(),`hidden`,`none`]}],"divide-style":[{divide:[...V(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...V(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[R,q,W]}],"outline-w":[{outline:[``,R,J,G]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,u,Se,K]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,Se,K]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:I()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[R,G]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,ee,Se,K]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[R,q,W]}],"mix-blend":[{"mix-blend":[...H(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":H()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[R]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[q,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[R]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,q,W]}],filter:[{filter:[``,`none`,q,W]}],blur:[{blur:le()}],brightness:[{brightness:[R,q,W]}],contrast:[{contrast:[R,q,W]}],"drop-shadow":[{"drop-shadow":[``,`none`,f,Se,K]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,R,q,W]}],"hue-rotate":[{"hue-rotate":[R,q,W]}],invert:[{invert:[``,R,q,W]}],saturate:[{saturate:[R,q,W]}],sepia:[{sepia:[``,R,q,W]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,q,W]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[R,q,W]}],"backdrop-contrast":[{"backdrop-contrast":[R,q,W]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,R,q,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[R,q,W]}],"backdrop-invert":[{"backdrop-invert":[``,R,q,W]}],"backdrop-opacity":[{"backdrop-opacity":[R,q,W]}],"backdrop-saturate":[{"backdrop-saturate":[R,q,W]}],"backdrop-sepia":[{"backdrop-sepia":[``,R,q,W]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,q,W]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[R,`initial`,q,W]}],ease:[{ease:[`linear`,`initial`,g,q,W]}],delay:[{delay:[R,q,W]}],animate:[{animate:[`none`,_,q,W]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[m,q,W]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:Y()}],"rotate-x":[{"rotate-x":Y()}],"rotate-y":[{"rotate-y":Y()}],"rotate-z":[{"rotate-z":Y()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":[`scale-3d`],skew:[{skew:Z()}],"skew-x":[{"skew-x":Z()}],"skew-y":[{"skew-y":Z()}],transform:[{transform:[q,W,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:Q()}],"translate-x":[{"translate-x":Q()}],"translate-y":[{"translate-y":Q()}],"translate-z":[{"translate-z":Q()}],"translate-none":[`translate-none`],zoom:[{zoom:[z,q,W]}],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,q,W]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,q,W]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[R,J,G,pe]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}},je=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:i={},override:a={}})=>($(e,`cacheSize`,t),$(e,`prefix`,n),$(e,`experimentalParseClassName`,r),Me(e.theme,a.theme),Me(e.classGroups,a.classGroups),Me(e.conflictingClassGroups,a.conflictingClassGroups),Me(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),$(e,`postfixLookupClassGroups`,a.postfixLookupClassGroups),$(e,`orderSensitiveModifiers`,a.orderSensitiveModifiers),Ne(e.theme,i.theme),Ne(e.classGroups,i.classGroups),Ne(e.conflictingClassGroups,i.conflictingClassGroups),Ne(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),Pe(e,i,`postfixLookupClassGroups`),Pe(e,i,`orderSensitiveModifiers`),e),$=(e,t,n)=>{n!==void 0&&(e[t]=n)},Me=(e,t)=>{if(t)for(let n in t)$(e,n,t[n])},Ne=(e,t)=>{if(t)for(let n in t)Pe(e,t,n)},Pe=(e,t,n)=>{let r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},Fe=(e,...t)=>typeof e==`function`?k(Ae,e,...t):k(()=>je(Ae(),e),...t),Ie=k(Ae);export{Ie as n,t as r,Fe as t};
|