ompchamber 1.2.1 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +143 -147
- package/dist/client/index.html +4 -2
- package/dist/client/static/css/index.5f630421b7.css +2 -0
- package/dist/client/static/js/77.0d81c74cf0.js +139 -0
- package/dist/client/static/js/async/1k.973e8e21fc.js +2 -0
- package/dist/client/static/js/async/{3y.3186ecdd63.js → 3y.3530b824ad.js} +6 -6
- package/dist/client/static/js/async/{q.b453193538.js → 4m.928a1dde85.js} +10 -10
- package/dist/client/static/js/async/66.5dfa29f957.js +93 -0
- package/dist/client/static/js/async/7g.a7814350c3.js +1 -0
- package/dist/client/static/js/async/ar.9303e5f2e8.js +2 -0
- package/dist/client/static/js/async/{cx.9c8268d542.js → cx.3cb0242a3a.js} +1 -1
- package/dist/client/static/js/async/e.93214d622b.js +79 -0
- package/dist/client/static/js/async/g.cb81980498.js +2 -0
- package/dist/client/static/js/async/h1.393f066d09.js +1 -0
- package/dist/client/static/js/async/jl.874d352278.js +1 -0
- package/dist/client/static/js/async/{k.d16cd09ae7.js → k.3210286401.js} +1 -1
- package/dist/client/static/js/async/{m.2e1ea3db9e.js → m.eb2e6752e2.js} +3 -3
- package/dist/client/static/js/async/m.eb2e6752e2.js.LICENSE.txt +11 -0
- package/dist/client/static/js/async/mt.0352e976d8.js +1 -0
- package/dist/client/static/js/async/{oc.eb22093f05.js → oc.b73042e8bd.js} +1 -1
- package/dist/client/static/js/async/{og.53f068804c.js → og.8eb577893a.js} +1 -1
- package/dist/client/static/js/async/px.fc6877924b.js +1 -0
- package/dist/client/static/js/async/q.22588845a9.js +21 -0
- package/dist/client/static/js/async/{q5.88b50ffa95.js → q5.97dc1481b6.js} +1 -1
- package/dist/client/static/js/async/s.0f395cdda5.js +94 -0
- package/dist/client/static/js/async/{tr.2a0d2b7600.js → tr.e878658140.js} +1 -1
- package/dist/client/static/js/async/vt.42416b707d.js +1 -0
- package/dist/client/static/js/async/x1.da8687159b.js +90 -0
- package/dist/client/static/js/async/xe.da8dcc2015.js +2 -0
- package/dist/client/static/js/async/xe.da8dcc2015.js.LICENSE.txt +11 -0
- package/dist/client/static/js/async/{xn.6360379f71.js → xn.6510c0abe2.js} +2 -2
- package/dist/client/static/js/async/{yx.af2936c368.js → xn1.83a7784fe1.js} +3 -3
- package/dist/client/static/js/async/xn1.83a7784fe1.js.LICENSE.txt +11 -0
- package/dist/client/static/js/async/yg.35bebd6d0c.js +149 -0
- package/dist/client/static/js/async/yv.d99d829136.js +1 -0
- package/dist/client/static/js/index.1fd9e1c543.js +38 -0
- package/package.json +3 -3
- package/src/client/components/common/ComposerTextarea.tsx +9 -1
- package/src/client/components/common/MarkdownRenderer.tsx +50 -12
- package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +9 -3
- package/src/client/components/settings/Modal.tsx +11 -2
- package/src/client/components/settings/categories/AppearanceSettings.tsx +7 -30
- package/src/client/components/settings/categories/ProviderSettings.tsx +2 -0
- package/src/client/components/settings/categories/appearance-settings/ThemeCard.tsx +61 -0
- package/src/client/components/settings/categories/appearance-settings/ThemeGrid.tsx +80 -0
- package/src/client/components/settings/categories/chat-settings/TitleSection.tsx +1 -1
- package/src/client/components/settings/categories/provider-settings/AddProviderModal.tsx +43 -6
- package/src/client/components/settings/categories/provider-settings/ModelConfigModal.tsx +54 -54
- package/src/client/components/workspace/SearchPanel.tsx +16 -3
- package/src/client/components/workspace/btw-panel/AskCard.tsx +11 -6
- package/src/client/components/workspace/btw-panel/Messages.tsx +105 -51
- package/src/client/components/workspace/btw-panel/index.tsx +124 -45
- package/src/client/components/workspace/chat-timeline/AiMessageFooter.tsx +30 -14
- package/src/client/components/workspace/chat-timeline/ComposerDock.tsx +10 -1
- package/src/client/components/workspace/chat-timeline/GeneratingIndicator.tsx +8 -2
- package/src/client/components/workspace/chat-timeline/MessageItem.tsx +27 -16
- package/src/client/components/workspace/chat-timeline/MessageList.tsx +11 -0
- package/src/client/components/workspace/chat-timeline/RunFooter.tsx +8 -0
- package/src/client/components/workspace/chat-timeline/chat-input/index.tsx +12 -1
- package/src/client/components/workspace/chat-timeline/index.tsx +7 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionBlock.tsx +42 -15
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.tsx +13 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/index.tsx +13 -4
- package/src/client/components/workspace/diff-panel/SplitView.tsx +4 -1
- package/src/client/components/workspace/diff-panel/UnifiedView.tsx +70 -65
- package/src/client/components/workspace/diff-panel/index.tsx +8 -1
- package/src/client/components/workspace/editor/index.tsx +18 -2
- package/src/client/components/workspace/file-explorer/GitRepoDropdown.tsx +15 -41
- package/src/client/components/workspace/file-explorer/index.tsx +86 -16
- package/src/client/components/workspace/git-panel/index.tsx +60 -78
- package/src/client/components/workspace/terminal-panel/Header.tsx +16 -1
- package/src/client/components/workspace/terminal-panel/RealtimeXtermView.tsx +5 -5
- package/src/client/components/workspace/terminal-panel/index.tsx +6 -2
- package/src/client/components/workspace/terminal-panel/mount.ts +2 -2
- package/src/client/data/theme/terminal.ts +50 -52
- package/src/client/hooks/chat/btw/index.ts +139 -18
- package/src/client/hooks/chat/btw/intercept.ts +8 -8
- package/src/client/hooks/chat/btw/mode.ts +111 -16
- package/src/client/hooks/chat/composer/index.ts +10 -4
- package/src/client/hooks/chat/timeline/access-mode.ts +41 -0
- package/src/client/hooks/chat/timeline/ask-frames.test.ts +87 -0
- package/src/client/hooks/chat/timeline/ask-frames.ts +20 -1
- package/src/client/hooks/chat/timeline/auto-scroll.ts +13 -4
- package/src/client/hooks/chat/timeline/index.ts +8 -20
- package/src/client/hooks/chat/timeline/queue.ts +66 -9
- package/src/client/hooks/chat/timeline/scroll.test.ts +260 -0
- package/src/client/hooks/chat/timeline/scroll.ts +93 -20
- package/src/client/hooks/chat/timeline/session-load.ts +7 -1
- package/src/client/hooks/chat/timeline/session-pagination.test.ts +167 -0
- package/src/client/hooks/chat/timeline/session-pagination.ts +37 -11
- package/src/client/hooks/editor/save-file.ts +62 -0
- package/src/client/hooks/editor/use-file-editor.test.ts +61 -5
- package/src/client/hooks/editor/use-file-editor.ts +38 -29
- package/src/client/hooks/editor/use-file-transfer.ts +5 -2
- package/src/client/hooks/settings/providers.ts +34 -3
- package/src/client/hooks/ui/open-file.ts +7 -1
- package/src/client/hooks/ui/theme.ts +82 -57
- package/src/client/hooks/workspace/file-tabs.ts +5 -1
- package/src/client/hooks/workspace/repo-scope/index.ts +119 -0
- package/src/client/hooks/workspace/repo-scope/store.test.ts +161 -0
- package/src/client/hooks/workspace/repo-scope/store.ts +201 -0
- package/src/client/hooks/workspace/search-stream.ts +24 -5
- package/src/client/main.tsx +6 -0
- package/src/client/tailwind.css +19 -56
- package/src/server/lib/btw/child.server.ts +41 -0
- package/src/server/lib/btw/lifecycle.server.ts +254 -0
- package/src/server/lib/btw/prompt.ts +13 -5
- package/src/server/lib/btw/registry.server.ts +13 -4
- package/src/server/lib/btw/runtime.server.ts +149 -156
- package/src/server/lib/btw/schema.server.ts +27 -0
- package/src/server/lib/btw/service.server.ts +106 -5
- package/src/server/lib/btw/store.server.ts +57 -6
- package/src/server/lib/db/schema.ts +4 -0
- package/src/server/lib/db/settings-store.test.ts +65 -0
- package/src/server/lib/db/settings-store.ts +25 -0
- package/src/server/lib/fs/atomic-write.ts +42 -4
- package/src/server/lib/fs/config-lock.ts +74 -0
- package/src/server/lib/fs/git-ignore.ts +55 -5
- package/src/server/lib/fs/ripgrep.ts +119 -0
- package/src/server/lib/lifecycle/identity.ts +10 -64
- package/src/server/lib/lifecycle/proc/darwin.ts +238 -0
- package/src/server/lib/lifecycle/proc/index.ts +38 -0
- package/src/server/lib/lifecycle/proc/linux.ts +80 -0
- package/src/server/lib/lifecycle/proc/ps.ts +86 -0
- package/src/server/lib/lifecycle/proc/types.ts +33 -0
- package/src/server/lib/lifecycle/proc/win32.ts +53 -0
- package/src/server/lib/models/provider-registry.server.ts +2 -2
- package/src/server/lib/models/registry.server.ts +1 -1
- package/src/server/lib/omp/config/behavior.ts +17 -17
- package/src/server/lib/omp/config/disabled-providers.ts +84 -35
- package/src/server/lib/omp/config/document.ts +128 -0
- package/src/server/lib/omp/config/extensions.ts +11 -10
- package/src/server/lib/omp/config/mcp.ts +4 -57
- package/src/server/lib/omp/config/model-overrides.ts +123 -0
- package/src/server/lib/omp/config/models-config.ts +92 -0
- package/src/server/lib/omp/config/models-validation.ts +159 -0
- package/src/server/lib/omp/config/path-scoped.ts +74 -0
- package/src/server/lib/omp/config/providers.ts +241 -211
- package/src/server/lib/omp/config/roles.ts +6 -14
- package/src/server/lib/omp/core/auth-credentials.ts +1 -1
- package/src/server/lib/omp/rpc/frame-fold.test.ts +124 -0
- package/src/server/lib/omp/rpc/frame-fold.ts +43 -24
- package/src/server/lib/omp/rpc/lifecycle.test.ts +41 -0
- package/src/server/lib/omp/rpc/manager.ts +21 -21
- package/src/server/lib/omp/rpc/pending-ui-dialogs.ts +11 -7
- package/src/server/lib/omp/rpc/session-commands.ts +17 -29
- package/src/server/lib/omp/rpc/session-registry.ts +5 -66
- package/src/server/lib/omp/rpc/web-state.ts +0 -6
- package/src/server/lib/omp/session/auto-title.server.test.ts +109 -11
- package/src/server/lib/omp/session/auto-title.server.ts +95 -20
- package/src/server/lib/omp/session/sidebar-data.server.ts +11 -6
- package/src/server/lib/queue/delivery-dispatch.server.test.ts +162 -0
- package/src/server/lib/queue/delivery-harness.ts +88 -0
- package/src/server/lib/queue/delivery.server.test.ts +78 -149
- package/src/server/lib/queue/delivery.server.ts +105 -13
- package/src/server/lib/queue/store.server.ts +30 -5
- package/src/server/lib/terminal/foreground.test.ts +164 -0
- package/src/server/lib/terminal/foreground.ts +34 -6
- package/src/server/lib/terminal/history.ts +8 -7
- package/src/server/plugins/compress.ts +33 -5
- package/src/server/plugins/ssr.ts +14 -7
- package/src/server/routes/btw/topics.ts +89 -2
- package/src/server/routes/fs/action.test.ts +64 -0
- package/src/server/routes/fs/action.ts +10 -1
- package/src/server/routes/fs/git.ts +5 -6
- package/src/server/routes/fs/search.ts +17 -26
- package/src/server/routes/sessions/queue.ts +17 -4
- package/src/server/routes/settings/index.ts +2 -0
- package/src/server/routes/settings/model-override.ts +69 -0
- package/src/server/routes/settings/provider-models.ts +35 -12
- package/src/server/routes/settings/providers.ts +31 -1
- package/src/server/routes/settings/root.ts +8 -3
- package/src/shared/lib/chat/btw/client.ts +34 -0
- package/src/shared/lib/chat/timeline/tool-phrases.ts +7 -0
- package/src/shared/lib/code/line-endings.test.ts +38 -0
- package/src/shared/lib/code/line-endings.ts +56 -0
- package/src/shared/lib/code/shiki-themes.ts +9 -5
- package/src/shared/lib/fs/file-tree.ts +17 -12
- package/src/shared/lib/markdown/autolink.test.ts +32 -0
- package/src/shared/lib/markdown/autolink.ts +50 -0
- package/src/shared/lib/markdown/document-urls.test.ts +68 -0
- package/src/shared/lib/markdown/document-urls.ts +118 -0
- package/src/shared/lib/markdown/marked.ts +27 -15
- package/src/shared/lib/markdown/mermaid.ts +2 -2
- package/src/shared/lib/models/catalog.ts +1 -1
- package/src/shared/lib/omp/session/schema-migrations.ts +30 -0
- package/src/shared/lib/omp/session/stream-state.server.test.ts +54 -0
- package/src/shared/lib/omp/session/stream-state.server.ts +70 -21
- package/src/shared/lib/settings/client.ts +10 -4
- package/src/shared/lib/settings/diff.test.ts +31 -0
- package/src/shared/lib/settings/diff.ts +37 -0
- package/src/shared/lib/theme/catalog.test.ts +168 -0
- package/src/shared/lib/theme/catalog.ts +98 -0
- package/src/shared/lib/theme/color.ts +88 -0
- package/src/shared/lib/theme/css.ts +70 -0
- package/src/shared/lib/theme/palettes/chamber.ts +61 -0
- package/src/shared/lib/theme/palettes/dark.ts +313 -0
- package/src/shared/lib/theme/palettes/light.ts +313 -0
- package/src/shared/types/btw.ts +83 -4
- package/src/shared/types/index.ts +1 -0
- package/src/shared/types/settings/provider.ts +8 -1
- package/src/shared/types/settings/state.ts +10 -4
- package/src/shared/types/theme.ts +48 -0
- package/dist/client/static/css/index.b938f4a693.css +0 -2
- package/dist/client/static/js/77.8022a800b5.js +0 -139
- package/dist/client/static/js/async/1k.a411fe5b43.js +0 -2
- package/dist/client/static/js/async/66.86544ad741.js +0 -93
- package/dist/client/static/js/async/7g.db82aca7ba.js +0 -1
- package/dist/client/static/js/async/ar.ad5c8822a8.js +0 -2
- package/dist/client/static/js/async/e.6443e739a2.js +0 -79
- package/dist/client/static/js/async/g.ee41bfed7f.js +0 -2
- package/dist/client/static/js/async/h1.d7091cef78.js +0 -1
- package/dist/client/static/js/async/jl.4911fa3383.js +0 -1
- package/dist/client/static/js/async/m.2e1ea3db9e.js.LICENSE.txt +0 -6
- package/dist/client/static/js/async/mt.853be2b5aa.js +0 -1
- package/dist/client/static/js/async/ot.84c71b308f.js +0 -2
- package/dist/client/static/js/async/px.783b6f91f2.js +0 -1
- package/dist/client/static/js/async/q8.7f1b48e9cd.js +0 -21
- package/dist/client/static/js/async/q8.7f1b48e9cd.js.LICENSE.txt +0 -6
- package/dist/client/static/js/async/s.aad2ecebc6.js +0 -94
- package/dist/client/static/js/async/vt.20406a5604.js +0 -1
- package/dist/client/static/js/async/x1.fe8af17016.js +0 -90
- package/dist/client/static/js/async/xn.6360379f71.js.LICENSE.txt +0 -6
- package/dist/client/static/js/async/yg.5a94e1fc8a.js +0 -149
- package/dist/client/static/js/async/yv.2fa22f009a.js +0 -1
- package/dist/client/static/js/index.5fe7a2cb64.js +0 -34
- package/src/client/components/workspace/btw-panel/Composer.tsx +0 -183
- package/src/client/components/workspace/btw-panel/attachments.ts +0 -80
- /package/dist/client/static/js/{77.8022a800b5.js.LICENSE.txt → 77.0d81c74cf0.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{g.ee41bfed7f.js.LICENSE.txt → 1k.973e8e21fc.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{3y.3186ecdd63.js.LICENSE.txt → 3y.3530b824ad.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{ot.84c71b308f.js.LICENSE.txt → 4m.928a1dde85.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{q.b453193538.js.LICENSE.txt → ar.9303e5f2e8.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{yx.af2936c368.js.LICENSE.txt → g.cb81980498.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{1k.a411fe5b43.js.LICENSE.txt → q.22588845a9.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{ar.ad5c8822a8.js.LICENSE.txt → xn.6510c0abe2.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/{index.5fe7a2cb64.js.LICENSE.txt → index.1fd9e1c543.js.LICENSE.txt} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! LICENSE: m.
|
|
2
|
-
"use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["m"],{ABt(e,t,n){n.d(t,{GitPanel:()=>ea});var s=n("j"),a=n("H"),r=n("X"),i=n("E6"),o=n("DB"),l=n("t"),c=n("hw"),d=n("Wb0"),h=n("S"),p=n("t3");function m(e){let{isGraphMode:t,onToggleMode:n,searchQuery:a,onSearchChange:r,onRefresh:i,onClose:l,isRefreshing:m,totalCommits:f,totalCount:u}=e;return(0,s.FD)("div",{className:"flex flex-col gap-2 px-3 lg:px-5 py-3 border-b border-ink/10 bg-paper select-none\n pl-[max(0.75rem,env(safe-area-inset-left,0px))] pr-[max(0.75rem,env(safe-area-inset-right,0px))]",children:[(0,s.FD)("div",{className:"flex items-center justify-between gap-2 lg:gap-4",children:[(0,s.FD)("div",{className:"flex flex-col min-w-0",children:[(0,s.FD)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,s.Y)("h2",{className:"text-base font-semibold text-ink tracking-tight",children:t?"Graph":"History"}),(0,s.Y)("span",{className:"text-[11px] font-mono px-2 py-0.5 rounded-full bg-ink/5 text-ink/50 border border-ink/10 whitespace-nowrap",children:u&&u>f?`${f} of ${u}`:`${f} commits`})]}),(0,s.Y)("p",{className:"text-xs text-ink/50 mt-0.5 hidden lg:block",children:"Browse recent commits and inspect changed files."})]}),(0,s.FD)("div",{className:"flex items-center gap-1.5 lg:gap-2 flex-shrink-0",children:[(0,s.FD)("div",{className:"flex items-center bg-ink/5 p-0.5 rounded-lg border border-ink/10 text-xs",children:[(0,s.FD)("button",{type:"button",onClick:()=>n(!1),title:"History view",className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md font-medium transition-colors cursor-pointer ${!t?"bg-paper text-ink shadow-xs":"text-ink/60 hover:text-ink hover:bg-ink/5"}`,children:[(0,s.Y)(c.A,{size:13}),(0,s.Y)("span",{className:"hidden lg:inline",children:"History"})]}),(0,s.FD)("button",{type:"button",onClick:()=>n(!0),title:"Graph view",className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md font-medium transition-colors cursor-pointer ${t?"bg-paper text-ink shadow-xs":"text-ink/60 hover:text-ink hover:bg-ink/5"}`,children:[(0,s.Y)(o.A,{size:13}),(0,s.Y)("span",{className:"hidden lg:inline",children:"Graph"})]})]}),(0,s.FD)("button",{type:"button",onClick:i,disabled:m,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md border border-ink/15 hover:bg-ink/5 text-ink/70 hover:text-ink transition-colors cursor-pointer text-xs disabled:opacity-40",title:"Refresh commit history",children:[(0,s.Y)(d.A,{size:13,className:m?"animate-spin text-ink":""}),(0,s.Y)("span",{className:"hidden lg:inline",children:"refresh"})]}),(0,s.Y)("button",{type:"button",onClick:l,className:"p-2 -mr-1 rounded-md hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors cursor-pointer",title:"Close modal",children:(0,s.Y)(h.A,{size:16})})]})]}),(0,s.FD)("div",{className:"relative mt-1",children:[(0,s.Y)(p.A,{size:13,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-ink/40"}),(0,s.Y)("input",{type:"text",value:a,onChange:e=>r(e.currentTarget.value),placeholder:"Filter commits by message, author, or hash...",className:"w-full bg-ink/[0.03] border border-ink/15 rounded-md pl-8 pr-3 py-1.5 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),a&&(0,s.Y)("button",{type:"button",onClick:()=>r(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-ink/40 hover:text-ink cursor-pointer",children:(0,s.Y)(h.A,{size:12})})]})]})}let f=["#38bdf8","#f97316","#a855f7","#10b981","#ec4899","#eab308","#06b6d4","#6366f1"];function u(e,t){if(!e||!t)return!1;if(e===t)return!0;let n=Math.min(e.length,t.length);return n>=4&&e.substring(0,n)===t.substring(0,n)}function x(e){let t=new Map,n=[];for(let s of e){if("number"==typeof s.lane){t.set(s.hash,s.lane);continue}let e=n.findIndex(e=>u(e,s.hash)||u(e,s.shortHash));-1===e&&(-1===(e=n.indexOf(null))?(e=n.length,n.push(s.hash)):n[e]=s.hash),t.set(s.hash,e);let a=s.parents&&s.parents[0];if(a?n[e]=a:n[e]=null,s.parents&&s.parents.length>1)for(let e=1;e<s.parents.length;e++){let t=s.parents[e];if(!n.some(e=>u(e,t))){let e=n.indexOf(null);-1===e?n.push(t):n[e]=t}}}return t}function b(e){let{commits:t,nodePositions:n,selectedHash:r,hoveredHash:i,isGraphMode:o,laneWidth:l=18,paddingLeft:c=16,totalHeight:d}=e,h=(0,a.Kr)(()=>{if(!o){let e=new Map;return t.forEach(t=>e.set(t.hash,0)),e}return x(t)},[t,o]),p=(0,a.Kr)(()=>{let e=0;return h.forEach(t=>{t>e&&(e=t)}),e},[h]),m=o?(p+1)*l+2*c:36,u=(0,a.Kr)(()=>{if(!o){let e=[];for(let s=0;s<t.length-1;s++){let a=n[t[s].hash]??60*s+20,r=n[t[s+1].hash]??(s+1)*60+20;e.push({fromHash:t[s].hash,toHash:t[s+1].hash,fromLane:0,toLane:0,fromY:a,toY:r,color:"var(--theme-ink)"})}return e}return function(e,t,n,s){let a=[],r=new Map;for(let i of(e.forEach((e,t)=>{r.set(e.hash,t),e.shortHash&&r.set(e.shortHash,t),e.hash.length>=7&&r.set(e.hash.substring(0,7),t)}),e)){let o=t.get(i.hash)??0,l=n[i.hash]??0,c=f[o%f.length];if(i.parents&&0!==i.parents.length)for(let d of i.parents){let h=r.get(d);if("number"!=typeof h&&d.length>=7&&(h=r.get(d.substring(0,7))),"number"==typeof h){let s=e[h],r=t.get(s.hash)??o,c=n[s.hash]??l+60;a.push({fromHash:i.hash,toHash:s.hash,fromLane:o,toLane:r,fromY:l,toY:c,color:f[o%f.length]})}else a.push({fromHash:i.hash,toHash:"tail-"+i.hash,fromLane:o,toLane:o,fromY:l,toY:Math.max(l+80,s),color:c})}}return a}(t,h,n,d)},[t,h,n,d,o]);return(0,s.Y)("div",{className:"absolute top-0 left-0 pointer-events-none z-10",style:{width:m,height:d},children:(0,s.FD)("svg",{className:"w-full h-full overflow-visible",style:{width:m,height:d},children:[(0,s.Y)("defs",{children:(0,s.Y)("filter",{id:"node-glow",x:"-20%",y:"-20%",width:"140%",height:"140%",children:(0,s.Y)("feDropShadow",{dx:"0",dy:"0",stdDeviation:"2",floodOpacity:"0.35"})})}),u.map(e=>{let t=o?c+e.fromLane*l:16,n=o?c+e.toLane*l:16,a=o?e.color:"currentColor",r=o?.95:.25,i=function(e,t,n,s){if(1>Math.abs(e-n))return`M ${e} ${t} L ${n} ${s}`;let a=s-t;return`M ${e} ${t} C ${e} ${t+.45*a}, ${n} ${s-.45*a}, ${n} ${s}`}(t,e.fromY,n,e.toY);return(0,s.Y)("path",{d:i,fill:"none",stroke:a,strokeWidth:o?2.25:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:r},`${e.fromHash}->${e.toHash}`)}),t.map(e=>{let t=h.get(e.hash)??0,a=o?c+t*l:16,d=n[e.hash]??20,p=r===e.hash||r===e.shortHash,m=i===e.hash||i===e.shortHash,u=o?f[t%f.length]:"var(--theme-success)";return(0,s.FD)("g",{children:[(p||m)&&(0,s.Y)("circle",{cx:a,cy:d,r:8,fill:u,fillOpacity:p?.35:.2,stroke:u,strokeWidth:1}),(0,s.Y)("circle",{cx:a,cy:d,r:o?4:4.5,fill:o?"var(--theme-paper)":u,stroke:u,strokeWidth:o?2.5:1.5,filter:"url(#node-glow)"}),o&&(0,s.Y)("circle",{cx:a,cy:d,r:1.8,fill:u})]},`node-${e.hash}`)})]})})}var g=n("z"),k=n("b0"),v=n("Go"),y=n("Nf");function w(e){let{commit:t,onAction:n,isBusy:a}=e;return(0,s.FD)("div",{className:"flex flex-wrap items-center gap-1.5 pt-1.5 pb-2",children:[(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("checkout",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"checkout"}),(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("create_branch_here",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"create branch here"}),(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("cherry_pick",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"cherry-pick"}),(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("revert",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"revert"}),(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("reset",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"reset..."}),(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("merge",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"merge into current"}),(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("rebase",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"rebase onto this"})]})}var N=n("Wb"),Y=n("DU"),C=n("Po");function A(e){let{diffText:t,isLoading:n,filePath:r}=e,[i,o]=(0,a.J0)(!1),l=(0,C.w)(),c=(0,a.Kr)(()=>{if(!t)return[];let e=[],n=1,s=1,a=t.split(/\r?\n/);for(let t of a.some(e=>e.startsWith("@@"))?a:[`@@ -0,0 +1,${a.length} @@`,...a.map(e=>e.startsWith("+")||e.startsWith("-")?e:`+${e}`)])if(!(t.startsWith("diff --git")||t.startsWith("index ")||t.startsWith("---")||t.startsWith("+++")||t.startsWith("new file mode")||t.startsWith("deleted file mode")||t.startsWith("similarity index")||t.startsWith("old mode")||t.startsWith("new mode")||t.startsWith("\\ No newline")))if(t.startsWith("@@")){let a=t.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);a&&(n=parseInt(a[1],10),s=parseInt(a[2],10)),e.push({type:"meta",text:t})}else if(t.startsWith("+"))e.push({type:"add",text:t.slice(1),newNum:s++});else if(t.startsWith("-"))e.push({type:"del",text:t.slice(1),oldNum:n++});else{let a=t.startsWith(" ")?t.slice(1):t;e.push({type:"context",text:a,oldNum:n++,newNum:s++})}return e},[t]),d=(0,Y.sQ)(r),h=(0,a.Kr)(()=>{let e=Array(c.length).fill(""),t=-1,n=n=>{if(t<0)return;let s=(0,Y.O9)(c.slice(t,n).map(e=>e.text).join("\n"),d);for(let a=t;a<n;a++)e[a]=s[a-t]??"";t=-1};return c.forEach((e,s)=>{"meta"===e.type?n(s):t<0&&(t=s)}),n(c.length),e},[c,d,l]);return n?(0,s.Y)("div",{className:"my-2 p-4 rounded bg-canvas border border-ink/10 text-ink/40 font-mono text-xs flex items-center justify-center",children:"Loading commit diff..."}):t&&0!==c.length?(0,s.FD)("div",{className:"my-2 rounded border border-ink/15 bg-paper overflow-hidden text-[11px] font-mono leading-relaxed shadow-xs text-ink",children:[(0,s.FD)("div",{className:"flex items-center justify-between px-3 py-1.5 bg-canvas border-b border-ink/10 text-ink/70 text-[10.5px]",children:[(0,s.Y)("span",{className:"font-semibold text-meta",children:"Diff preview"}),(0,s.Y)("button",{type:"button",onClick:()=>o(!i),className:"hover:text-ink flex items-center gap-1 cursor-pointer transition-colors",children:i?(0,s.FD)(s.FK,{children:[(0,s.Y)(N.A,{size:12})," Collapse context"]}):(0,s.FD)(s.FK,{children:[(0,s.Y)(v.A,{size:12})," Expand all context"]})})]}),(0,s.Y)("div",{className:"overflow-x-auto max-h-72 select-text",children:(0,s.Y)("div",{className:"w-max min-w-full divide-y divide-ink/[0.04]",children:c.map((e,t)=>{if("meta"===e.type)return(0,s.FD)("div",{className:"flex items-center gap-2 px-3 py-1 bg-canvas border-y border-ink/10 text-meta text-[10px] font-semibold",children:[(0,s.Y)("span",{children:"↕"}),(0,s.Y)("span",{children:e.text})]},t);let n="add"===e.type,a="del"===e.type;return(0,s.FD)("div",{className:`flex items-start font-mono ${n?"bg-success/10 hover:bg-success/15":a?"bg-error/10 hover:bg-error/15":"text-ink hover:bg-ink/[0.02]"}`,children:[(0,s.Y)("div",{className:`w-10 flex-shrink-0 text-right pr-2 py-0.5 select-none border-r border-ink/10 text-[10px] tabular-nums font-mono ${a?"bg-error/15 text-error font-semibold":n?"bg-success/15 text-success/70":"bg-canvas/50 text-ink/40"}`,children:e.oldNum??(n?"+":"")}),(0,s.Y)("div",{className:`w-10 flex-shrink-0 text-right pr-2 py-0.5 select-none border-r border-ink/10 text-[10px] tabular-nums font-mono ${n?"bg-success/15 text-success font-semibold":a?"bg-error/15 text-error/70":"bg-canvas/50 text-ink/40"}`,children:e.newNum??(a?"-":"")}),(0,s.Y)("div",{className:`w-4 flex-shrink-0 text-center py-0.5 select-none font-bold ${n?"text-success":a?"text-error":"opacity-0"}`,children:n?"+":a?"-":" "}),(0,s.Y)("div",{className:"flex-1 py-0.5 pr-3 whitespace-pre text-ink",children:e.text?(0,s.Y)("span",{className:"shiki",dangerouslySetInnerHTML:{__html:h[t]}}):" "})]},t)})})})]}):(0,s.Y)("div",{className:"my-2 p-3 rounded bg-canvas border border-ink/10 text-ink/40 font-mono text-xs text-center",children:"No diff content available for this file."})}function F(e){let{commit:t,isSelected:n,isGraphMode:r,onSelect:i,onAction:o,onToggleFile:l,isExpandedFile:c,isLoadingFile:d,fileDiffs:h,headerRef:p}=e,[m,f]=(0,a.J0)(!1);return(0,s.Y)("div",{onClick:()=>i(t),className:`border-b border-ink/5 transition-colors cursor-pointer ${n?"bg-ink/[0.03]":"hover:bg-ink/[0.015]"}`,children:(0,s.FD)("div",{className:"py-2.5 pr-4 pl-1 flex flex-col",children:[(0,s.FD)("div",{className:"flex flex-col gap-1",children:[t.refs&&t.refs.length>0&&(0,s.Y)("div",{className:"flex flex-wrap items-center gap-1.5 pb-0.5",children:t.refs.map((e,t)=>{let n=e.includes("stash"),a=e.includes("HEAD")||e.includes("main")||e.includes("master");return(0,s.Y)("span",{className:`px-2 py-0.5 rounded text-[10px] font-mono border ${n?"bg-warning/10 text-warning border-warning/25 font-semibold":a?"bg-ink/10 text-ink font-semibold border-ink/20":"bg-canvas text-meta border-ink/10 font-medium"}`,children:e},t)})}),(0,s.Y)("div",{ref:p,className:"text-[13px] font-semibold text-ink leading-snug break-words",children:t.message}),(0,s.FD)("div",{className:"flex items-center gap-2 text-[11px] text-ink/50 font-mono flex-wrap",children:[(0,s.Y)("span",{children:t.author}),(0,s.Y)("span",{children:"•"}),(0,s.Y)("span",{children:t.date}),(0,s.Y)("span",{children:"•"}),(0,s.FD)("button",{type:"button",onClick:e=>{e.stopPropagation(),navigator.clipboard.writeText(t.hash),f(!0),setTimeout(()=>f(!1),2e3)},title:"Copy commit hash",className:"inline-flex items-center gap-1 hover:text-ink transition-colors cursor-pointer text-ink/70",children:[(0,s.Y)("span",{children:t.shortHash}),m?(0,s.Y)(g.A,{size:11,className:"text-success"}):(0,s.Y)(k.A,{size:11})]})]})]}),(n||r)&&(0,s.Y)("div",{className:"mt-2",children:(0,s.Y)(w,{commit:t,onAction:o})}),t.files&&t.files.length>0&&(0,s.Y)("div",{className:"mt-2 flex flex-col gap-1",children:t.files.map((e,n)=>{let a=c(t.hash,e.file),r=`${t.hash}:${e.file}`,i=void 0!==h[r]?h[r]:e.diff,o=d(t.hash,e.file),p="A"===e.status?"text-success font-bold":"D"===e.status?"text-error font-bold":"R"===e.status?"text-meta font-bold":"text-info font-bold";return(0,s.FD)("div",{className:"flex flex-col",children:[(0,s.FD)("div",{onClick:n=>{n.stopPropagation(),l(t.hash,e)},className:"flex items-center gap-2 py-1 px-2 rounded hover:bg-ink/5 text-[11.5px] font-mono text-ink/80 transition-colors group cursor-pointer border border-transparent hover:border-ink/10",children:[(0,s.Y)("span",{className:`w-3.5 text-center flex-shrink-0 text-[11px] ${p}`,children:e.status||"M"}),(0,s.Y)("span",{className:"truncate flex-1 min-w-0 text-ink/90 group-hover:text-ink font-medium",children:e.file}),(0,s.FD)("span",{className:"flex items-center gap-1 text-[10.5px] tabular-nums flex-shrink-0 font-medium",children:[(0,s.FD)("span",{className:"text-success",children:["+",e.additions]}),(0,s.Y)("span",{className:"text-ink/30",children:"/"}),(0,s.FD)("span",{className:"text-error",children:["-",e.deletions]})]}),(0,s.Y)("span",{className:"text-ink/40 group-hover:text-ink flex-shrink-0",children:a?(0,s.Y)(v.A,{size:13}):(0,s.Y)(y.A,{size:13})})]}),a&&(0,s.Y)("div",{className:"pl-4 pr-1",children:(0,s.Y)(A,{diffText:i,isLoading:o,filePath:e.file})})]},n)})})]})})}let D=[{hash:"8f8ca583e7162b190f898394e1e3ad81472a1290",shortHash:"8f8ca583",author:"Wijarnako Putra Rajeb",date:"Sep 10, 2026, 12:40 PM",message:"feat(chat): persist composer draft and attachments per session",parents:["6d3bac50"],refs:["HEAD -> main","origin/main"],lane:0,files:[{file:"app/hooks/chat/timeline/index.ts",status:"M",additions:3,deletions:2,diff:`@@ -7,6 +7,7 @@
|
|
1
|
+
/*! LICENSE: m.eb2e6752e2.js.LICENSE.txt */
|
|
2
|
+
"use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["m"],{ABt(e,t,n){n.d(t,{GitPanel:()=>ea});var s=n("j"),r=n("H"),a=n("X"),i=n("E6"),o=n("DB"),l=n("t"),c=n("hw"),d=n("Wb0"),h=n("S"),p=n("t3");function m(e){let{isGraphMode:t,onToggleMode:n,searchQuery:r,onSearchChange:a,onRefresh:i,onClose:l,isRefreshing:m,totalCommits:u,totalCount:f}=e;return(0,s.FD)("div",{className:"flex flex-col gap-2 px-3 lg:px-5 py-3 border-b border-ink/10 bg-paper select-none\n pl-[max(0.75rem,env(safe-area-inset-left,0px))] pr-[max(0.75rem,env(safe-area-inset-right,0px))]",children:[(0,s.FD)("div",{className:"flex items-center justify-between gap-2 lg:gap-4",children:[(0,s.FD)("div",{className:"flex flex-col min-w-0",children:[(0,s.FD)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,s.Y)("h2",{className:"text-base font-semibold text-ink tracking-tight",children:t?"Graph":"History"}),(0,s.Y)("span",{className:"text-[11px] font-mono px-2 py-0.5 rounded-full bg-ink/5 text-ink/50 border border-ink/10 whitespace-nowrap",children:f&&f>u?`${u} of ${f}`:`${u} commits`})]}),(0,s.Y)("p",{className:"text-xs text-ink/50 mt-0.5 hidden lg:block",children:"Browse recent commits and inspect changed files."})]}),(0,s.FD)("div",{className:"flex items-center gap-1.5 lg:gap-2 flex-shrink-0",children:[(0,s.FD)("div",{className:"flex items-center bg-ink/5 p-0.5 rounded-lg border border-ink/10 text-xs",children:[(0,s.FD)("button",{type:"button",onClick:()=>n(!1),title:"History view",className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md font-medium transition-colors cursor-pointer ${!t?"bg-paper text-ink shadow-xs":"text-ink/60 hover:text-ink hover:bg-ink/5"}`,children:[(0,s.Y)(c.A,{size:13}),(0,s.Y)("span",{className:"hidden lg:inline",children:"History"})]}),(0,s.FD)("button",{type:"button",onClick:()=>n(!0),title:"Graph view",className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md font-medium transition-colors cursor-pointer ${t?"bg-paper text-ink shadow-xs":"text-ink/60 hover:text-ink hover:bg-ink/5"}`,children:[(0,s.Y)(o.A,{size:13}),(0,s.Y)("span",{className:"hidden lg:inline",children:"Graph"})]})]}),(0,s.FD)("button",{type:"button",onClick:i,disabled:m,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md border border-ink/15 hover:bg-ink/5 text-ink/70 hover:text-ink transition-colors cursor-pointer text-xs disabled:opacity-40",title:"Refresh commit history",children:[(0,s.Y)(d.A,{size:13,className:m?"animate-spin text-ink":""}),(0,s.Y)("span",{className:"hidden lg:inline",children:"refresh"})]}),(0,s.Y)("button",{type:"button",onClick:l,className:"p-2 -mr-1 rounded-md hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors cursor-pointer",title:"Close modal",children:(0,s.Y)(h.A,{size:16})})]})]}),(0,s.FD)("div",{className:"relative mt-1",children:[(0,s.Y)(p.A,{size:13,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-ink/40"}),(0,s.Y)("input",{type:"text",value:r,onChange:e=>a(e.currentTarget.value),placeholder:"Filter commits by message, author, or hash...",className:"w-full bg-ink/[0.03] border border-ink/15 rounded-md pl-8 pr-3 py-1.5 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),r&&(0,s.Y)("button",{type:"button",onClick:()=>a(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-ink/40 hover:text-ink cursor-pointer",children:(0,s.Y)(h.A,{size:12})})]})]})}let u=["#38bdf8","#f97316","#a855f7","#10b981","#ec4899","#eab308","#06b6d4","#6366f1"];function f(e,t){if(!e||!t)return!1;if(e===t)return!0;let n=Math.min(e.length,t.length);return n>=4&&e.substring(0,n)===t.substring(0,n)}function x(e){let t=new Map,n=[];for(let s of e){if("number"==typeof s.lane){t.set(s.hash,s.lane);continue}let e=n.findIndex(e=>f(e,s.hash)||f(e,s.shortHash));-1===e&&(-1===(e=n.indexOf(null))?(e=n.length,n.push(s.hash)):n[e]=s.hash),t.set(s.hash,e);let r=s.parents&&s.parents[0];if(r?n[e]=r:n[e]=null,s.parents&&s.parents.length>1)for(let e=1;e<s.parents.length;e++){let t=s.parents[e];if(!n.some(e=>f(e,t))){let e=n.indexOf(null);-1===e?n.push(t):n[e]=t}}}return t}function b(e){let{commits:t,nodePositions:n,selectedHash:a,hoveredHash:i,isGraphMode:o,laneWidth:l=18,paddingLeft:c=16,totalHeight:d}=e,h=(0,r.Kr)(()=>{if(!o){let e=new Map;return t.forEach(t=>e.set(t.hash,0)),e}return x(t)},[t,o]),p=(0,r.Kr)(()=>{let e=0;return h.forEach(t=>{t>e&&(e=t)}),e},[h]),m=o?(p+1)*l+2*c:36,f=(0,r.Kr)(()=>{if(!o){let e=[];for(let s=0;s<t.length-1;s++){let r=n[t[s].hash]??60*s+20,a=n[t[s+1].hash]??(s+1)*60+20;e.push({fromHash:t[s].hash,toHash:t[s+1].hash,fromLane:0,toLane:0,fromY:r,toY:a,color:"var(--theme-ink)"})}return e}return function(e,t,n,s){let r=[],a=new Map;for(let i of(e.forEach((e,t)=>{a.set(e.hash,t),e.shortHash&&a.set(e.shortHash,t),e.hash.length>=7&&a.set(e.hash.substring(0,7),t)}),e)){let o=t.get(i.hash)??0,l=n[i.hash]??0,c=u[o%u.length];if(i.parents&&0!==i.parents.length)for(let d of i.parents){let h=a.get(d);if("number"!=typeof h&&d.length>=7&&(h=a.get(d.substring(0,7))),"number"==typeof h){let s=e[h],a=t.get(s.hash)??o,c=n[s.hash]??l+60;r.push({fromHash:i.hash,toHash:s.hash,fromLane:o,toLane:a,fromY:l,toY:c,color:u[o%u.length]})}else r.push({fromHash:i.hash,toHash:"tail-"+i.hash,fromLane:o,toLane:o,fromY:l,toY:Math.max(l+80,s),color:c})}}return r}(t,h,n,d)},[t,h,n,d,o]);return(0,s.Y)("div",{className:"absolute top-0 left-0 pointer-events-none z-10",style:{width:m,height:d},children:(0,s.FD)("svg",{className:"w-full h-full overflow-visible",style:{width:m,height:d},children:[(0,s.Y)("defs",{children:(0,s.Y)("filter",{id:"node-glow",x:"-20%",y:"-20%",width:"140%",height:"140%",children:(0,s.Y)("feDropShadow",{dx:"0",dy:"0",stdDeviation:"2",floodOpacity:"0.35"})})}),f.map(e=>{let t=o?c+e.fromLane*l:16,n=o?c+e.toLane*l:16,r=o?e.color:"currentColor",a=o?.95:.25,i=function(e,t,n,s){if(1>Math.abs(e-n))return`M ${e} ${t} L ${n} ${s}`;let r=s-t;return`M ${e} ${t} C ${e} ${t+.45*r}, ${n} ${s-.45*r}, ${n} ${s}`}(t,e.fromY,n,e.toY);return(0,s.Y)("path",{d:i,fill:"none",stroke:r,strokeWidth:o?2.25:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:a},`${e.fromHash}->${e.toHash}`)}),t.map(e=>{let t=h.get(e.hash)??0,r=o?c+t*l:16,d=n[e.hash]??20,p=a===e.hash||a===e.shortHash,m=i===e.hash||i===e.shortHash,f=o?u[t%u.length]:"var(--theme-success)";return(0,s.FD)("g",{children:[(p||m)&&(0,s.Y)("circle",{cx:r,cy:d,r:8,fill:f,fillOpacity:p?.35:.2,stroke:f,strokeWidth:1}),(0,s.Y)("circle",{cx:r,cy:d,r:o?4:4.5,fill:o?"var(--theme-paper)":f,stroke:f,strokeWidth:o?2.5:1.5,filter:"url(#node-glow)"}),o&&(0,s.Y)("circle",{cx:r,cy:d,r:1.8,fill:f})]},`node-${e.hash}`)})]})})}var g=n("z"),k=n("b0"),y=n("Go"),v=n("Nf");function w(e){let{commit:t,onAction:n,isBusy:r}=e;return(0,s.FD)("div",{className:"flex flex-wrap items-center gap-1.5 pt-1.5 pb-2",children:[(0,s.Y)("button",{type:"button",disabled:r,onClick:e=>{e.stopPropagation(),n("checkout",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"checkout"}),(0,s.Y)("button",{type:"button",disabled:r,onClick:e=>{e.stopPropagation(),n("create_branch_here",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"create branch here"}),(0,s.Y)("button",{type:"button",disabled:r,onClick:e=>{e.stopPropagation(),n("cherry_pick",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"cherry-pick"}),(0,s.Y)("button",{type:"button",disabled:r,onClick:e=>{e.stopPropagation(),n("revert",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"revert"}),(0,s.Y)("button",{type:"button",disabled:r,onClick:e=>{e.stopPropagation(),n("reset",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"reset..."}),(0,s.Y)("button",{type:"button",disabled:r,onClick:e=>{e.stopPropagation(),n("merge",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"merge into current"}),(0,s.Y)("button",{type:"button",disabled:r,onClick:e=>{e.stopPropagation(),n("rebase",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"rebase onto this"})]})}var N=n("Wb"),Y=n("DU"),C=n("Po");function A(e){let{diffText:t,isLoading:n,filePath:a}=e,[i,o]=(0,r.J0)(!1),l=(0,C.w)(),c=(0,r.Kr)(()=>{if(!t)return[];let e=[],n=1,s=1,r=t.split(/\r?\n/);for(let t of r.some(e=>e.startsWith("@@"))?r:[`@@ -0,0 +1,${r.length} @@`,...r.map(e=>e.startsWith("+")||e.startsWith("-")?e:`+${e}`)])if(!(t.startsWith("diff --git")||t.startsWith("index ")||t.startsWith("---")||t.startsWith("+++")||t.startsWith("new file mode")||t.startsWith("deleted file mode")||t.startsWith("similarity index")||t.startsWith("old mode")||t.startsWith("new mode")||t.startsWith("\\ No newline")))if(t.startsWith("@@")){let r=t.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);r&&(n=parseInt(r[1],10),s=parseInt(r[2],10)),e.push({type:"meta",text:t})}else if(t.startsWith("+"))e.push({type:"add",text:t.slice(1),newNum:s++});else if(t.startsWith("-"))e.push({type:"del",text:t.slice(1),oldNum:n++});else{let r=t.startsWith(" ")?t.slice(1):t;e.push({type:"context",text:r,oldNum:n++,newNum:s++})}return e},[t]),d=(0,Y.sQ)(a),h=(0,r.Kr)(()=>{let e=Array(c.length).fill(""),t=-1,n=n=>{if(t<0)return;let s=(0,Y.O9)(c.slice(t,n).map(e=>e.text).join("\n"),d);for(let r=t;r<n;r++)e[r]=s[r-t]??"";t=-1};return c.forEach((e,s)=>{"meta"===e.type?n(s):t<0&&(t=s)}),n(c.length),e},[c,d,l]);return n?(0,s.Y)("div",{className:"my-2 p-4 rounded bg-canvas border border-ink/10 text-ink/40 font-mono text-xs flex items-center justify-center",children:"Loading commit diff..."}):t&&0!==c.length?(0,s.FD)("div",{className:"my-2 rounded border border-ink/15 bg-paper overflow-hidden text-[11px] font-mono leading-relaxed shadow-xs text-ink",children:[(0,s.FD)("div",{className:"flex items-center justify-between px-3 py-1.5 bg-canvas border-b border-ink/10 text-ink/70 text-[10.5px]",children:[(0,s.Y)("span",{className:"font-semibold text-meta",children:"Diff preview"}),(0,s.Y)("button",{type:"button",onClick:()=>o(!i),className:"hover:text-ink flex items-center gap-1 cursor-pointer transition-colors",children:i?(0,s.FD)(s.FK,{children:[(0,s.Y)(N.A,{size:12})," Collapse context"]}):(0,s.FD)(s.FK,{children:[(0,s.Y)(y.A,{size:12})," Expand all context"]})})]}),(0,s.Y)("div",{className:"overflow-x-auto max-h-72 select-text",children:(0,s.Y)("div",{className:"w-max min-w-full divide-y divide-ink/[0.04]",children:c.map((e,t)=>{if("meta"===e.type)return(0,s.FD)("div",{className:"flex items-center gap-2 px-3 py-1 bg-canvas border-y border-ink/10 text-meta text-[10px] font-semibold",children:[(0,s.Y)("span",{children:"↕"}),(0,s.Y)("span",{children:e.text})]},t);let n="add"===e.type,r="del"===e.type;return(0,s.FD)("div",{className:`flex items-start font-mono ${n?"bg-success/10 hover:bg-success/15":r?"bg-error/10 hover:bg-error/15":"text-ink hover:bg-ink/[0.02]"}`,children:[(0,s.Y)("div",{className:`w-10 flex-shrink-0 text-right pr-2 py-0.5 select-none border-r border-ink/10 text-[10px] tabular-nums font-mono ${r?"bg-error/15 text-error font-semibold":n?"bg-success/15 text-success/70":"bg-canvas/50 text-ink/40"}`,children:e.oldNum??(n?"+":"")}),(0,s.Y)("div",{className:`w-10 flex-shrink-0 text-right pr-2 py-0.5 select-none border-r border-ink/10 text-[10px] tabular-nums font-mono ${n?"bg-success/15 text-success font-semibold":r?"bg-error/15 text-error/70":"bg-canvas/50 text-ink/40"}`,children:e.newNum??(r?"-":"")}),(0,s.Y)("div",{className:`w-4 flex-shrink-0 text-center py-0.5 select-none font-bold ${n?"text-success":r?"text-error":"opacity-0"}`,children:n?"+":r?"-":" "}),(0,s.Y)("div",{className:"flex-1 py-0.5 pr-3 whitespace-pre text-ink",children:e.text?(0,s.Y)("span",{className:"shiki",dangerouslySetInnerHTML:{__html:h[t]}}):" "})]},t)})})})]}):(0,s.Y)("div",{className:"my-2 p-3 rounded bg-canvas border border-ink/10 text-ink/40 font-mono text-xs text-center",children:"No diff content available for this file."})}function F(e){let{commit:t,isSelected:n,isGraphMode:a,onSelect:i,onAction:o,onToggleFile:l,isExpandedFile:c,isLoadingFile:d,fileDiffs:h,headerRef:p}=e,[m,u]=(0,r.J0)(!1);return(0,s.Y)("div",{onClick:()=>i(t),className:`border-b border-ink/5 transition-colors cursor-pointer ${n?"bg-ink/[0.03]":"hover:bg-ink/[0.015]"}`,children:(0,s.FD)("div",{className:"py-2.5 pr-4 pl-1 flex flex-col",children:[(0,s.FD)("div",{className:"flex flex-col gap-1",children:[t.refs&&t.refs.length>0&&(0,s.Y)("div",{className:"flex flex-wrap items-center gap-1.5 pb-0.5",children:t.refs.map((e,t)=>{let n=e.includes("stash"),r=e.includes("HEAD")||e.includes("main")||e.includes("master");return(0,s.Y)("span",{className:`px-2 py-0.5 rounded text-[10px] font-mono border ${n?"bg-warning/10 text-warning border-warning/25 font-semibold":r?"bg-ink/10 text-ink font-semibold border-ink/20":"bg-canvas text-meta border-ink/10 font-medium"}`,children:e},t)})}),(0,s.Y)("div",{ref:p,className:"text-[13px] font-semibold text-ink leading-snug break-words",children:t.message}),(0,s.FD)("div",{className:"flex items-center gap-2 text-[11px] text-ink/50 font-mono flex-wrap",children:[(0,s.Y)("span",{children:t.author}),(0,s.Y)("span",{children:"•"}),(0,s.Y)("span",{children:t.date}),(0,s.Y)("span",{children:"•"}),(0,s.FD)("button",{type:"button",onClick:e=>{e.stopPropagation(),navigator.clipboard.writeText(t.hash),u(!0),setTimeout(()=>u(!1),2e3)},title:"Copy commit hash",className:"inline-flex items-center gap-1 hover:text-ink transition-colors cursor-pointer text-ink/70",children:[(0,s.Y)("span",{children:t.shortHash}),m?(0,s.Y)(g.A,{size:11,className:"text-success"}):(0,s.Y)(k.A,{size:11})]})]})]}),(n||a)&&(0,s.Y)("div",{className:"mt-2",children:(0,s.Y)(w,{commit:t,onAction:o})}),t.files&&t.files.length>0&&(0,s.Y)("div",{className:"mt-2 flex flex-col gap-1",children:t.files.map((e,n)=>{let r=c(t.hash,e.file),a=`${t.hash}:${e.file}`,i=void 0!==h[a]?h[a]:e.diff,o=d(t.hash,e.file),p="A"===e.status?"text-success font-bold":"D"===e.status?"text-error font-bold":"R"===e.status?"text-meta font-bold":"text-info font-bold";return(0,s.FD)("div",{className:"flex flex-col",children:[(0,s.FD)("div",{onClick:n=>{n.stopPropagation(),l(t.hash,e)},className:"flex items-center gap-2 py-1 px-2 rounded hover:bg-ink/5 text-[11.5px] font-mono text-ink/80 transition-colors group cursor-pointer border border-transparent hover:border-ink/10",children:[(0,s.Y)("span",{className:`w-3.5 text-center flex-shrink-0 text-[11px] ${p}`,children:e.status||"M"}),(0,s.Y)("span",{className:"truncate flex-1 min-w-0 text-ink/90 group-hover:text-ink font-medium",children:e.file}),(0,s.FD)("span",{className:"flex items-center gap-1 text-[10.5px] tabular-nums flex-shrink-0 font-medium",children:[(0,s.FD)("span",{className:"text-success",children:["+",e.additions]}),(0,s.Y)("span",{className:"text-ink/30",children:"/"}),(0,s.FD)("span",{className:"text-error",children:["-",e.deletions]})]}),(0,s.Y)("span",{className:"text-ink/40 group-hover:text-ink flex-shrink-0",children:r?(0,s.Y)(y.A,{size:13}):(0,s.Y)(v.A,{size:13})})]}),r&&(0,s.Y)("div",{className:"pl-4 pr-1",children:(0,s.Y)(A,{diffText:i,isLoading:o,filePath:e.file})})]},n)})})]})})}let D=[{hash:"8f8ca583e7162b190f898394e1e3ad81472a1290",shortHash:"8f8ca583",author:"Wijarnako Putra Rajeb",date:"Sep 10, 2026, 12:40 PM",message:"feat(chat): persist composer draft and attachments per session",parents:["6d3bac50"],refs:["HEAD -> main","origin/main"],lane:0,files:[{file:"app/hooks/chat/timeline/index.ts",status:"M",additions:3,deletions:2,diff:`@@ -7,6 +7,7 @@
|
|
3
3
|
import { useChatTimelineActions } from '@/client/hooks/chat/timeline/actions';
|
|
4
4
|
import { useChatTimelineSend } from '@/client/hooks/chat/timeline/send';
|
|
5
5
|
import { normalizeNoticePositions } from '@/shared/lib/chat/order';
|
|
@@ -25,4 +25,4 @@
|
|
|
25
25
|
.env.*
|
|
26
26
|
!.env.example
|
|
27
27
|
.git
|
|
28
|
-
2 unmodified lines`},{file:"docker-compose.yml",status:"M",additions:5,deletions:0}]},{hash:"008cbe0711112222333344445555666677778888",shortHash:"008cbe07",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 01:25 PM",message:"feat(logging): structured timestamped logging across all web flows, bridged to docker logs",parents:["81ad44d5","b3b71ed5"],refs:["origin/feat/whatsapp-notification","feat/whatsapp-notification"],lane:0,files:[{file:"server.ts",status:"M",additions:19,deletions:3}]},{hash:"81ad44d522223333444455556666777788889999",shortHash:"81ad44d5",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 01:07 PM",message:"WIP on main: b3b71ed fix(pbpmd): history modal reads live BOFIS API instead of sqlite cache",parents:["9616fad9"],refs:["refs/stash"],lane:1,files:[{file:"app/routes/api/pb-pmd/$id.history.ts",status:"M",additions:22,deletions:6}]},{hash:"9616fad933334444555566667777888899990000",shortHash:"9616fad9",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 01:07 PM",message:"index on main: b3b71ed fix(pbpmd): history modal reads live BOFIS API instead of sqlite cache",parents:["b3b71ed5"],lane:1,files:[{file:"app/routes/api/pb-pmd/$id.history.ts",status:"M",additions:15,deletions:4}]},{hash:"b3b71ed544445555666677778888999900001111",shortHash:"b3b71ed5",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 12:55 PM",message:"fix(pbpmd): history modal reads live BOFIS API instead of sqlite cache",parents:["4dc73776"],lane:0,files:[{file:"app/routes/api/pb-pmd/$id.history.ts",status:"M",additions:8,deletions:12}]},{hash:"4dc7377655556666777788889999000011112222",shortHash:"4dc73776",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 12:50 PM",message:"feat(ui): 13th KPI card TOTAL MANDAYS + gapless 6-col dashboard grid",parents:["acab6465"],lane:0,files:[{file:"app/components/dashboard/KPIGrid.tsx",status:"M",additions:35,deletions:7}]},{hash:"acab646566667777888899990000111122223333",shortHash:"acab6465",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 12:45 PM",message:"feat(pbpmd): history modal table layout, wider modal, drop edit scenario action",parents:["86a6d6c5"],lane:0,files:[{file:"app/components/pbpmd/HistoryModal.tsx",status:"M",additions:24,deletions:18}]},{hash:"86a6d6c577778888999900001111222233334444",shortHash:"86a6d6c5",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 12:45 PM",message:"feat(pbpmd): pb history modal reads sqlite cache via /api/pb-pmd/:id/history",parents:["9ffea446"],lane:0,files:[{file:"app/routes/api/pb-pmd/$id.history.ts",status:"M",additions:42,deletions:5}]},{hash:"9ffea44688889999000011112222333344445555",shortHash:"9ffea446",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 12:45 PM",message:"feat(dashboard): crdApproved threshold shifted 5 minutes from history date_end",parents:[],lane:0,files:[{file:"app/lib/dashboard/calculator.ts",status:"M",additions:12,deletions:2}]}];function M(e){let{output:t,onClose:n,onRefresh:r,onExecuteAction:i,rootPath:o,activeRepo:c}=e;if(!t)return null;let d=t.title.toLowerCase().includes("graph"),[h,p]=(0,a.J0)(d),[f,u]=(0,a.J0)(""),[g,k]=(0,a.J0)(""),[v,y]=(0,a.J0)(!1),{commits:w,hasMore:N,totalCount:Y,isLoadingMore:C,handleLoadMore:A}=function(e){let{output:t,isGraphMode:n,rootPath:s,activeRepo:r}=e,[i,o]=(0,a.J0)(!1),[l,c]=(0,a.J0)(t?.hasMore??t?.data?.length===50),[d,h]=(0,a.J0)(t?.total),p=(0,a.Kr)(()=>{let e=t?.data||[];return 0===e.length?D:e[0]&&"object"==typeof e[0]&&("hash"in e[0]||"shortHash"in e[0])?e.map(e=>({hash:e.hash||e.shortHash||"unknown",shortHash:e.shortHash||(e.hash?e.hash.slice(0,8):"unknown"),author:e.author||"Unknown",date:e.date||e.time||"",message:e.message||"",parents:Array.isArray(e.parents)?e.parents:[],refs:Array.isArray(e.refs)?e.refs:[],files:Array.isArray(e.files)?e.files:[],lane:"number"==typeof e.lane?e.lane:void 0})):D},[t?.data]),[m,f]=(0,a.J0)(p);(0,a.vJ)(()=>{f(p),c(t?.hasMore??t?.data?.length===50),"number"==typeof t?.total&&h(t.total)},[p,t?.hasMore,t?.data?.length,t?.total]);let u=(0,a.hb)(async()=>{if(!i&&l){o(!0);try{let e=new FormData;e.set("actionType",n?"graph":"history"),e.set("limit","50"),e.set("skip",String(m.length)),s&&e.set("root",s),r&&e.set("repo",r);let t=await fetch("/api/fs/git",{method:"POST",body:e}),a=await t.json();if(a.success&&Array.isArray(a.data)){let e=a.data.map(e=>({hash:e.hash||e.shortHash||"unknown",shortHash:e.shortHash||(e.hash?e.hash.slice(0,8):"unknown"),author:e.author||"Unknown",date:e.date||e.time||"",message:e.message||"",parents:Array.isArray(e.parents)?e.parents:[],refs:Array.isArray(e.refs)?e.refs:[],files:Array.isArray(e.files)?e.files:[],lane:"number"==typeof e.lane?e.lane:void 0}));f(t=>{let n=new Set(t.map(e=>e.hash));return[...t,...e.filter(e=>!n.has(e.hash))]}),c(!!(a.hasMore??50===e.length)),"number"==typeof a.total&&h(a.total)}else c(!1)}catch(e){console.error("Failed to load more commits:",e)}finally{o(!1)}}},[i,l,n,m.length,s,r]);return{commits:m,setCommits:f,hasMore:l,totalCount:d,isLoadingMore:i,handleLoadMore:u}}({output:t,isGraphMode:h,rootPath:o,activeRepo:c}),{fileDiffs:M,expandedFiles:S,loadingFiles:j,handleToggleFile:P,handleCommitAction:$}=function(e){let{onExecuteAction:t,rootPath:n,activeRepo:s}=e,[r,i]=(0,a.J0)({}),[o,l]=(0,a.J0)(new Set),[c,d]=(0,a.J0)(new Set),h=(0,a.hb)(async(e,t)=>{let a=`${e}:${t.file}`,c=o.has(a);if(l(e=>{let t=new Set(e);return t.has(a)?t.delete(a):t.add(a),t}),!c&&void 0===r[a]&&!t.diff){d(e=>new Set(e).add(a));try{let r=new FormData;r.set("actionType","commit_diff"),r.set("hash",e),r.set("file",t.file),n&&r.set("root",n),s&&"."!==s&&r.set("repo",s);let o=await fetch("/api/fs/git",{method:"POST",body:r}),l=await o.json();l&&"string"==typeof l.diff?i(e=>({...e,[a]:l.diff})):l&&l.error&&i(e=>({...e,[a]:`// Error: ${l.error}`}))}catch(e){console.error("Failed to load file diff:",e),i(t=>({...t,[a]:`// Error loading diff: ${e?.message||"Network error"}`}))}finally{d(e=>{let t=new Set(e);return t.delete(a),t})}}},[o,r,n,s]);return{fileDiffs:r,expandedFiles:o,loadingFiles:c,handleToggleFile:h,handleCommitAction:(0,a.hb)((e,n)=>{if(t)if("checkout"===e)t("checkout",void 0,{branch:n.hash});else if("create_branch_here"===e){let e=window.prompt(`Create new branch at commit ${n.shortHash}:`,`branch-${n.shortHash}`);e?.trim()&&t("create_branch",void 0,{branch:e.trim()})}else if("cherry_pick"===e)window.confirm(`Cherry-pick commit ${n.shortHash} onto current branch?`)&&t("cherry_pick",void 0,{hash:n.hash});else if("revert"===e)window.confirm(`Revert commit ${n.shortHash}?`)&&t("revert_commit",void 0,{hash:n.hash});else if("reset"===e){let e=window.prompt(`Reset current branch to ${n.shortHash} (soft, mixed, hard):`,"soft");e&&["soft","mixed","hard"].includes(e.toLowerCase())&&t("reset_commit",void 0,{hash:n.hash,mode:e.toLowerCase()})}else"merge"===e?window.confirm(`Merge commit ${n.shortHash} into current branch?`)&&t("merge_commit",void 0,{hash:n.hash}):"rebase"===e&&window.confirm(`Rebase current branch onto commit ${n.shortHash}?`)&&t("rebase_commit",void 0,{hash:n.hash})},[t])}}({onExecuteAction:i,rootPath:o,activeRepo:c});(0,a.vJ)(()=>{w.length>0&&!g&&k(w[0].hash)},[w,g]);let z=(0,a.Kr)(()=>{if(!f.trim())return w;let e=f.toLowerCase().trim();return w.filter(t=>t.message.toLowerCase().includes(e)||t.author.toLowerCase().includes(e)||t.shortHash.toLowerCase().includes(e)||t.hash.toLowerCase().includes(e)||t.refs?.some(t=>t.toLowerCase().includes(e)))},[w,f]),H=(0,a.li)(null),R=(0,a.li)(null),L=(0,a.li)(null),W=(0,a.li)({}),[J,T]=(0,a.J0)({}),[O,E]=(0,a.J0)(800);(0,a.vJ)(()=>{let e=L.current;if(!e||!N||C||f.trim())return;let t=new IntersectionObserver(e=>{e[0].isIntersecting&&A()},{root:H.current,threshold:.1});return t.observe(e),()=>t.disconnect()},[N,C,f,A]);let K=(0,a.hb)(()=>{if(!H.current||!R.current)return;let e=H.current.getBoundingClientRect(),t=H.current.scrollTop,n={};z.forEach((s,a)=>{let r=W.current[s.hash];if(r){let a=r.getBoundingClientRect();n[s.hash]=a.top+a.height/2-e.top+t}else n[s.hash]=60*a+20}),T(n),E(Math.max(R.current.offsetHeight,H.current.clientHeight,600))},[z]);(0,a.Nf)(()=>{K();let e=requestAnimationFrame(()=>{K()});return()=>cancelAnimationFrame(e)},[K,z,M,S,h]),(0,a.vJ)(()=>{let e=R.current;if(!e)return;let t=new ResizeObserver(()=>{K()});return t.observe(e),()=>t.disconnect()},[K]);let I=(0,a.Kr)(()=>x(z),[z]),_=(0,a.Kr)(()=>{let e=0;return I.forEach(t=>{t>e&&(e=t)}),e},[I]),B=h?(_+1)*18+32:36,G=async()=>{y(!0),r&&await r(),setTimeout(()=>y(!1),600)};return(0,s.Y)("div",{className:"fixed inset-0 z-50 bg-canvas/80 backdrop-blur-xs flex items-center justify-center p-0 lg:p-5",onClick:n,role:"dialog","aria-modal":"true",children:(0,s.FD)("div",{className:"bg-paper border-ink/20 shadow-2xl flex flex-col overflow-hidden\n w-full h-full rounded-none border-0\n lg:w-[min(96vw,980px)] lg:h-[88vh] lg:rounded-xl lg:border\n pt-[env(safe-area-inset-top,0px)] lg:pt-0",onClick:e=>e.stopPropagation(),children:[(0,s.Y)(m,{isGraphMode:h,onToggleMode:p,searchQuery:f,onSearchChange:u,onRefresh:G,onClose:n,isRefreshing:v,totalCommits:z.length,totalCount:Y}),(0,s.Y)("div",{ref:H,className:"flex-1 overflow-y-auto scrollbar-overlay-container relative select-text",children:0===z.length?(0,s.Y)("div",{className:"flex flex-col items-center justify-center py-20 text-ink/40 font-mono text-xs",children:"No matching commits found."}):(0,s.FD)("div",{className:"relative min-h-full pb-8",children:[(0,s.Y)(b,{commits:z,nodePositions:J,selectedHash:g,isGraphMode:h,laneWidth:18,paddingLeft:16,totalHeight:O}),(0,s.FD)("div",{ref:R,className:"flex flex-col relative z-20",style:{paddingLeft:`${B}px`},children:[z.map(e=>(0,s.Y)(F,{commit:e,isSelected:g===e.hash,isGraphMode:h,onSelect:e=>k(e.hash),onAction:$,onToggleFile:P,isExpandedFile:(e,t)=>S.has(`${e}:${t}`),isLoadingFile:(e,t)=>j.has(`${e}:${t}`),fileDiffs:M,headerRef:t=>{W.current[e.hash]=t}},e.hash)),(0,s.Y)("div",{ref:L,className:"pt-3 pb-4 px-4 flex items-center justify-center",children:C?(0,s.FD)("div",{className:"flex items-center gap-2 text-xs text-ink/60 font-mono py-2",children:[(0,s.Y)(l.A,{size:14,className:"animate-spin text-info"}),(0,s.Y)("span",{children:"Loading more commits..."})]}):N&&!f.trim()?(0,s.Y)("button",{type:"button",onClick:A,className:"px-3 py-1.5 text-xs font-mono text-ink/70 hover:text-ink bg-ink/5 hover:bg-ink/10 rounded-md border border-ink/10 transition-colors cursor-pointer",children:"Load more commits..."}):z.length>10?(0,s.FD)("div",{className:"text-[11px] font-mono text-ink/40 py-2",children:["End of commit history (",z.length," commits)"]}):null})]})]})})]})})}function S(e){let{children:t,onClose:n,wide:a}=e;return(0,s.Y)("div",{className:"fixed inset-0 z-50 bg-canvas/80 flex items-center justify-center p-4",onClick:n,role:"dialog","aria-modal":"true",children:(0,s.Y)("div",{className:`bg-paper border border-ink/20 rounded-lg shadow-xl flex flex-col overflow-hidden ${a?"w-[min(94vw,680px)] max-h-[82vh]":"w-[min(94vw,420px)] max-h-[80vh]"}`,onClick:e=>e.stopPropagation(),children:t})})}function j(e){let{modal:t,onClose:n,onConfirm:a}=e;return t?(0,s.FD)(S,{onClose:n,children:[(0,s.FD)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-ink/10",children:[(0,s.Y)(i.A,{size:16,className:"text-error flex-shrink-0"}),(0,s.Y)("h3",{className:"text-sm font-semibold text-ink",children:"Confirm Action"})]}),(0,s.Y)("div",{className:"px-4 py-4 text-xs text-ink/80 leading-relaxed",children:t.message}),(0,s.FD)("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[(0,s.Y)("button",{type:"button",onClick:n,className:"px-3 py-1.5 rounded border border-ink/20 text-ink/70 hover:bg-ink/5 hover:text-ink transition-colors cursor-pointer text-xs",children:"Cancel"}),(0,s.Y)("button",{type:"button",onClick:a,className:"px-3 py-1.5 rounded bg-error text-canvas hover:bg-error/90 transition-colors cursor-pointer text-xs font-medium",children:"Confirm"})]})]}):null}function P(e){let{isOpen:t,branchName:n,inputRef:r,onChange:i,onClose:l,onCreate:c}=e;if(!t)return null;let d=(0,a.hb)(()=>{n.trim()&&c()},[n,c]);return(0,s.FD)(S,{onClose:l,children:[(0,s.FD)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-ink/10",children:[(0,s.Y)(o.A,{size:16,className:"text-ink/60 flex-shrink-0"}),(0,s.Y)("h3",{className:"text-sm font-semibold text-ink",children:"Create New Branch"})]}),(0,s.Y)("div",{className:"px-4 py-4",children:(0,s.Y)("input",{ref:r,type:"text",value:n,onChange:e=>i(e.currentTarget.value),onKeyDown:e=>{"Enter"===e.key&&d(),"Escape"===e.key&&l()},placeholder:"branch-name",className:"w-full bg-canvas border border-ink/20 rounded px-3 py-2 text-xs focus:outline-none focus:border-ink/40 text-ink placeholder-ink/40 transition-colors"})}),(0,s.FD)("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[(0,s.Y)("button",{type:"button",onClick:l,className:"px-3 py-1.5 rounded border border-ink/20 text-ink/70 hover:bg-ink/5 hover:text-ink transition-colors cursor-pointer text-xs",children:"Cancel"}),(0,s.Y)("button",{type:"button",onClick:d,disabled:!n.trim(),className:"px-3 py-1.5 rounded bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:"Create"})]})]})}function $(e){let{message:t,hasStagedChanges:n,isBusy:a=!1,onChangeMessage:r,onCommit:i}=e,o=n&&t.trim().length>0&&!a;return(0,s.FD)("div",{className:"border-t border-ink/10 bg-canvas/50 p-3 flex flex-col gap-2",children:[(0,s.Y)("textarea",{value:t,onChange:e=>r(e.currentTarget.value),onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&o&&(e.preventDefault(),i())},placeholder:"Commit message (⌘/Ctrl+Enter to commit)",rows:5,className:"w-full resize-y min-h-[100px] max-h-[200px] bg-paper border border-ink/20 rounded px-2.5 py-1.5 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),(0,s.FD)("button",{type:"button",onClick:i,disabled:!o,title:n?"Commit staged changes":"Stage changes first",className:"flex items-center justify-center gap-1.5 px-3 py-1.5 rounded bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[(0,s.Y)(g.A,{size:12}),"Commit"]})]})}var z=n("vZ"),H=n("r"),R=n("n"),L=n("Sj"),W=n("y");let J=(0,W.A)({name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]}),T=(0,W.A)({name:"folder-tree",size:24,node:[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]});function O(e){let{branchRef:t,showBranchMenu:n,setShowBranchMenu:a,branch:r,branches:i,remoteBranches:l,onCheckout:d,onOpenBranchPrompt:h,optionsRef:p,showOptions:m,setShowOptions:f,onHistory:u,onGraph:x,viewMode:b,setViewMode:k,isBusy:y=!1,syncCount:w={ahead:0,behind:0},onSync:N}=e;return(0,s.FD)("div",{className:"p-3 border-b border-ink/10 bg-canvas/50 flex items-center justify-between",children:[(0,s.FD)("div",{className:"relative",ref:t,children:[(0,s.FD)("button",{onClick:()=>a(!n),className:"flex items-center space-x-1.5 hover:bg-ink/5 px-2 py-1 -ml-2 rounded transition-colors text-[11px] text-ink/80 font-medium",children:[(0,s.Y)(z.A,{size:12,className:"text-ink/60"}),(0,s.Y)("span",{className:"truncate max-w-[140px]",children:r}),(0,s.Y)(v.A,{size:12,className:"text-ink/40"})]}),n&&(0,s.Y)("div",{className:"absolute top-full left-0 mt-1 w-48 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs",children:(0,s.FD)("div",{className:"max-h-48 scrollbar-overlay-container scrollbar-overlay-static py-1",children:[i.length>0&&(0,s.FD)(s.FK,{children:[(0,s.Y)("div",{className:"px-3 py-1 text-[9px] uppercase tracking-wider text-ink/40 font-semibold",children:"Local"}),i.map(e=>(0,s.FD)("button",{onClick:()=>{d(e),a(!1)},className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,s.Y)("span",{className:"truncate",children:e}),r===e&&(0,s.Y)(g.A,{size:12,className:"text-ink"})]},e))]}),l.length>0&&(0,s.FD)(s.FK,{children:[(0,s.Y)("div",{className:"px-3 py-1 text-[9px] uppercase tracking-wider text-ink/40 font-semibold",children:"Remote"}),l.map(e=>(0,s.FD)("button",{onClick:()=>{d(e),a(!1)},className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,s.Y)("span",{className:"truncate",children:e}),r===e&&(0,s.Y)(g.A,{size:12,className:"text-ink"})]},e))]}),(0,s.Y)("div",{className:"w-full h-px bg-ink/10 my-1"}),(0,s.FD)("button",{onClick:()=>{h(),a(!1)},className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center space-x-2 transition-colors text-ink/80 italic",children:[(0,s.Y)(H.A,{size:12}),(0,s.Y)("span",{children:"Create new branch..."})]})]})})]}),(0,s.FD)("div",{className:"flex items-center space-x-2 text-ink/40 relative",ref:p,children:[(0,s.FD)("button",{type:"button",onClick:N,disabled:y,title:w.ahead>0&&w.behind>0?`Pull ${w.behind} then push ${w.ahead} commit(s)`:w.ahead>0?`Push ${w.ahead} commit(s)`:w.behind>0?`Pull ${w.behind} commit(s)`:"Up to date — sync anyway",className:"flex items-center gap-1 p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:[(0,s.Y)(R.A,{size:13}),(0,s.FD)("span",{className:"font-mono tabular-nums text-[10px]",children:["↑",w.ahead," ↓",w.behind]})]}),(0,s.Y)("button",{type:"button",onClick:u,title:"Commit History",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:(0,s.Y)(c.A,{size:13})}),(0,s.Y)("button",{type:"button",onClick:x,title:"Git Graph",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:(0,s.Y)(o.A,{size:13})}),(0,s.Y)("button",{type:"button",onClick:()=>f(!m),title:"View Options",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:(0,s.Y)(L.A,{size:13})}),m&&(0,s.FD)("div",{className:"absolute right-0 top-full mt-1 w-36 bg-paper border border-ink/15 rounded-md shadow-lg z-50 py-1 font-mono text-xs",children:[(0,s.FD)("button",{type:"button",onClick:()=>{k("flat"),f(!1)},className:"w-full px-3 py-1.5 text-left text-ink hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,s.FD)("div",{className:"flex items-center space-x-1.5",children:[(0,s.Y)(J,{size:12,className:"text-ink/60"}),(0,s.Y)("span",{children:"View as List"})]}),"flat"===b&&(0,s.Y)(g.A,{size:12,className:"text-ink"})]}),(0,s.FD)("button",{type:"button",onClick:()=>{k("tree"),f(!1)},className:"w-full px-3 py-1.5 text-left text-ink hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,s.FD)("div",{className:"flex items-center space-x-1.5",children:[(0,s.Y)(T,{size:12,className:"text-ink/60"}),(0,s.Y)("span",{children:"View as Tree"})]}),"tree"===b&&(0,s.Y)(g.A,{size:12,className:"text-ink"})]})]})]})]})}var E=n("rm"),K=n("Ir"),I=n("FL");function _(e){let{repoRef:t,showRepoMenu:n,setShowRepoMenu:a,activeRepo:r,repos:i,isLoading:o,rootPath:l,reposScanning:c,onSelectRepo:d,onRefresh:h,onRefreshRepos:m}=e,[f,u]=(0,I.bL)("git.repoQuery",""),x=function(e){if(!e)return"workspace root";let t=e.replace(/\\/g,"/").split("/").filter(Boolean);return t.length>0?t[t.length-1]:"workspace root"}(l),b=e=>"."===e?x:e,k=i.filter(e=>!f.trim()||b(e).toLowerCase().includes(f.toLowerCase()));return(0,s.FD)("div",{className:"p-3 border-b border-ink/10 flex items-center justify-between",children:[(0,s.FD)("div",{className:"relative",ref:t,children:[(0,s.FD)("button",{onClick:()=>a(!n),className:"flex items-center space-x-1.5 hover:bg-ink/5 px-2 py-1 -ml-2 rounded transition-colors text-xs text-ink/80 font-medium",children:[(0,s.Y)(E.A,{size:12,className:"text-ink/60"}),(0,s.FD)("span",{className:"flex items-center space-x-1 truncate max-w-[150px]",children:[(0,s.Y)("span",{className:"text-ink/50 font-normal uppercase tracking-wider text-[10px]",children:"GIT"}),(0,s.Y)("span",{className:"text-ink/30",children:"•"}),(0,s.Y)("span",{children:"."===r?x:r.split("/").pop()})]}),(0,s.Y)(v.A,{size:12,className:"text-ink/40"})]}),n&&(0,s.FD)("div",{className:"absolute top-full left-0 mt-1 w-52 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs",children:[(0,s.FD)("div",{className:"px-2 py-1.5 border-b border-ink/10 flex items-center space-x-1.5",children:[(0,s.Y)(p.A,{size:11,className:"text-ink/40 flex-shrink-0"}),(0,s.Y)("input",{type:"text",value:f,onChange:e=>u(e.currentTarget.value),placeholder:"Search repos...",title:"Search repositories",className:"w-full bg-transparent outline-none text-xs text-ink placeholder-ink/40",autoFocus:!0}),f&&(0,s.Y)("button",{type:"button",onClick:()=>u(""),title:"Clear search",className:"text-ink/40 hover:text-ink flex-shrink-0",children:"×"}),(0,s.Y)("button",{type:"button",onClick:m,title:"Refresh nested repos",disabled:c,className:"text-ink/40 hover:text-ink flex-shrink-0 transition-colors disabled:opacity-40 disabled:hover:text-ink/40",children:(0,s.Y)(K.A,{size:11,className:c?"animate-spin":""})})]}),(0,s.Y)("div",{className:"max-h-48 scrollbar-overlay-container scrollbar-overlay-static py-1",children:0===k.length?(0,s.Y)("div",{className:"px-3 py-2 text-ink/40 italic",children:"No repos found"}):k.map(e=>(0,s.FD)("button",{onClick:()=>{d(e),a(!1),u("")},title:b(e),className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,s.Y)("span",{className:"truncate",children:b(e)}),r===e&&(0,s.Y)(g.A,{size:12,className:"text-ink"})]},e))})]})]}),(0,s.Y)("div",{className:"flex space-x-2 text-ink/40",children:(0,s.Y)("button",{type:"button",onClick:h,title:"Refresh",className:"hover:text-ink cursor-pointer inline-flex",children:(0,s.Y)(K.A,{size:14,className:o?"animate-spin":""})})})]})}var B=n("DV"),G=n("I"),V=n("pX"),U=n("LQ");function q(e){let{change:t,isStaged:n,repo:a,rootPath:r,onAction:i}=e,o=(0,U.R)(t.status,n),l=o.charStatus,c=o.colorClass,d=t.file.split("/"),h=d.pop()||t.file,p=d.length>0?d.join("/"):"";return(0,s.FD)("div",{className:"flex items-center justify-between px-3 py-1 hover:bg-ink/5 cursor-pointer group text-[11px] transition-colors",onClick:()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:t.file,staged:n,status:l,repo:a||".",root:r}}))},children:[(0,s.FD)("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-2",children:[(0,s.Y)("span",{className:`font-bold font-mono text-[9px] w-3 flex-shrink-0 text-center ${c}`,title:`Status: ${o.label}`,children:l}),(0,s.Y)(V.o,{name:h,size:12,className:"flex-shrink-0"}),(0,s.Y)("span",{className:`truncate ${c}`,title:t.file,children:h}),p&&(0,s.Y)("span",{className:"text-[9px] text-ink/40 truncate ml-1",children:p})]}),(0,s.Y)("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:(0,s.FD)("div",{className:"flex items-center opacity-0 group-hover:opacity-100 space-x-1",children:[!n&&(0,s.FD)(s.FK,{children:[(0,s.Y)("button",{type:"button",onClick:()=>i("revert",t.file),title:"Discard Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:(0,s.Y)(G.A,{size:11})}),(0,s.Y)("button",{type:"button",onClick:()=>i("stage",t.file),title:"Stage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(H.A,{size:11})})]}),n&&(0,s.Y)("button",{type:"button",onClick:()=>i("unstage",t.file),title:"Unstage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(B.A,{size:11})})]})})]})}function Q(e){let{node:t,isStaged:n,isFolderOpen:a,toggleFolder:r,onAction:i,depth:o=0,repo:l,rootPath:c}=e,d="folder"===t.type,h=!!d&&a(t.id);if(d)return(0,s.FD)("div",{className:"select-none",children:[(0,s.FD)("div",{className:"flex items-center justify-between px-2 py-1 hover:bg-ink/5 cursor-pointer rounded group transition-colors text-[11px]",onClick:()=>r(t.id),children:[(0,s.FD)("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-1",children:[(0,s.Y)("span",{className:"w-3.5 h-3.5 flex items-center justify-center text-ink/40 flex-shrink-0",children:h?(0,s.Y)(v.A,{size:12}):(0,s.Y)(y.A,{size:12})}),(0,s.Y)(V.o,{name:t.name,isFolder:!0,isOpen:h,size:13,className:"flex-shrink-0"}),(0,s.Y)("span",{className:"font-medium text-ink truncate",children:t.name}),(0,s.Y)("span",{className:"text-[9px] text-ink/40 font-normal px-1 py-0.2 bg-ink/5 rounded-full ml-1",children:t.changeCount})]}),(0,s.Y)("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:(0,s.Y)("div",{className:"flex items-center opacity-0 group-hover:opacity-100 space-x-1",children:n?(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),i("unstage",t.path)},title:`Unstage ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(B.A,{size:11})}):(0,s.FD)(s.FK,{children:[(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),i("revert",t.path)},title:`Discard changes in ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:(0,s.Y)(G.A,{size:11})}),(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),i("stage",t.path)},title:`Stage ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(H.A,{size:11})})]})})})]}),h&&t.children&&t.children.length>0&&(0,s.Y)("div",{className:"ml-3 border-l border-ink/10 pl-1",children:t.children.map(e=>(0,s.Y)(Q,{node:e,isStaged:n,isFolderOpen:a,toggleFolder:r,onAction:i,depth:o+1,repo:l,rootPath:c},e.id))})]});let p=t.change,m=(0,U.R)(p?.status||"M",n),f=m.charStatus,u=m.colorClass,x=p?p.file:t.path;return(0,s.FD)("div",{className:"flex items-center justify-between px-2 py-0.5 hover:bg-ink/5 cursor-pointer rounded group transition-colors text-[11px]",onClick:()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:x,staged:n,status:f,repo:l||".",root:c}}))},children:[(0,s.FD)("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-1",children:[(0,s.Y)("span",{className:"w-3.5 h-3.5 flex items-center justify-center flex-shrink-0",children:(0,s.Y)("span",{className:`font-bold font-mono text-[9px] ${u}`,title:`Status: ${m.label}`,children:f})}),(0,s.Y)(V.o,{name:t.name,size:12,className:"flex-shrink-0"}),(0,s.Y)("span",{className:`truncate ${u}`,title:x,children:t.name})]}),(0,s.Y)("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:(0,s.Y)("div",{className:"flex items-center opacity-0 group-hover:opacity-100 space-x-1",children:n?(0,s.Y)("button",{type:"button",onClick:()=>i("unstage",x),title:"Unstage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(B.A,{size:11})}):(0,s.FD)(s.FK,{children:[(0,s.Y)("button",{type:"button",onClick:()=>i("revert",x),title:"Discard Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:(0,s.Y)(G.A,{size:11})}),(0,s.Y)("button",{type:"button",onClick:()=>i("stage",x),title:"Stage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(H.A,{size:11})})]})})})]})}function Z(e){let{changes:t,isStaged:n,repo:r,rootPath:i,onAction:o}=e,{tree:l,isFolderOpen:c,toggleFolder:d}=function(e){let{sessionId:t,ready:n,read:s}=(0,I.p0)(),r=(0,a.Kr)(()=>(function(e){let t={id:"",name:"",path:"",type:"folder",children:[],changeCount:0};for(let n of e){let e=n.file.replace(/^[./]+/,""),s=e.endsWith("/"),a=e.replace(/\/$/,"").split("/").filter(Boolean),r=t,i="";for(let e=0;e<a.length;e++){let t=a[e];i=i?`${i}/${t}`:t;let o=e===a.length-1;if(o&&!s)r.children.push({id:i,name:t,path:i,type:"file",change:n,children:[],changeCount:1});else{let e=r.children.find(e=>"folder"===e.type&&e.name===t);e||(e={id:i,name:t,path:i,type:"folder",children:[],changeCount:0,change:o&&s?n:void 0},r.children.push(e)),r=e}}}return!function e(t){if("file"===t.type)return 1;let n=+!!t.change;for(let s of t.children)n+=e(s);return t.changeCount=n,t.children.sort((e,t)=>"folder"===e.type&&"file"===t.type?-1:"file"===e.type&&"folder"===t.type?1:e.name.localeCompare(t.name)),n}(t),t.children})(e),[e]),i=(0,a.Kr)(()=>{let e=new Set;return!function t(n){for(let s of n)"folder"===s.type&&(e.add(s.id),s.children&&s.children.length>0&&t(s.children))}(r),e},[r]),[o,l]=(0,I.bL)("git.expandedFolders",[]),c=(0,a.Kr)(()=>new Set(o),[o]),d=(0,a.li)(null);(0,a.vJ)(()=>{!n||d.current===t||0===i.size||(d.current=t,s("git.expandedFolders",[]).length>0||l(Array.from(i)))},[n,t,i,s,l]);let h=(0,a.hb)(e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),Array.from(n)})},[l]),p=(0,a.hb)(e=>c.has(e),[c]);return{tree:r,expandedFolders:c,toggleFolder:h,isFolderOpen:p,expandAll:()=>l(Array.from(i)),collapseAll:()=>l([])}}(t);return 0===l.length?null:(0,s.Y)("div",{className:"py-0.5",children:l.map(e=>(0,s.Y)(Q,{node:e,isStaged:n,isFolderOpen:c,toggleFolder:d,onAction:o,repo:r,rootPath:i},e.id))})}function X(e){let{changes:t,isLoading:n,viewMode:a,repo:r,rootPath:i,onAction:o}=e,[l,c]=(0,I.bL)("git.stagedExpanded",!0),[d,h]=(0,I.bL)("git.unstagedExpanded",!0),p=t.filter(e=>{let t=e.status;return t&&" "!==t[0]&&"?"!==t[0]}),m=t.filter(e=>{let t=e.status;return t&&" "!==t[1]&&"?"!==t[1]||"??"===t});return n&&0===t.length?(0,s.Y)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static font-mono text-[11px] text-ink/80",children:(0,s.Y)("div",{className:"p-4 text-center text-ink/40 italic",children:"Loading..."})}):0===t.length?(0,s.Y)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static font-mono text-[11px] text-ink/80",children:(0,s.Y)("div",{className:"p-4 text-center text-ink/40 italic",children:"No changes found."})}):(0,s.Y)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static font-mono text-[11px] text-ink/80",children:(0,s.FD)("div",{className:"py-1",children:[p.length>0&&(0,s.FD)("div",{className:"mb-2",children:[(0,s.FD)("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-ink/5 cursor-pointer transition-colors",onClick:()=>c(!l),children:[(0,s.FD)("div",{className:"flex items-center space-x-1 font-semibold text-ink text-xs",children:[(0,s.Y)("span",{className:"w-3 text-center",children:l?"▾":"▸"}),(0,s.Y)("span",{children:"Staged Changes"}),(0,s.Y)("span",{className:"text-ink/40 font-normal ml-1 border border-ink/20 rounded-full px-1.5 text-[9px] bg-paper",children:p.length})]}),(0,s.Y)("div",{className:"opacity-0 group-hover:opacity-100 flex items-center space-x-1 text-ink/40 flex-shrink-0",children:(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),o("unstage_all")},title:"Unstage All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(B.A,{size:12})})})]}),l&&("tree"===a?(0,s.Y)(Z,{changes:p,isStaged:!0,repo:r,rootPath:i,onAction:o}):p.map(e=>(0,s.Y)(q,{change:e,isStaged:!0,repo:r,rootPath:i,onAction:o},e.file+"staged")))]}),m.length>0&&(0,s.FD)("div",{children:[(0,s.FD)("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-ink/5 cursor-pointer transition-colors",onClick:()=>h(!d),children:[(0,s.FD)("div",{className:"flex items-center space-x-1 font-semibold text-ink text-xs",children:[(0,s.Y)("span",{className:"w-3 text-center",children:d?"▾":"▸"}),(0,s.Y)("span",{children:"Changes"}),(0,s.Y)("span",{className:"text-ink/40 font-normal ml-1 border border-ink/20 rounded-full px-1.5 text-[9px] bg-paper",children:m.length})]}),(0,s.FD)("div",{className:"opacity-0 group-hover:opacity-100 flex items-center space-x-1 text-ink/40 flex-shrink-0",children:[(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),o("revert_all")},title:"Discard All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:(0,s.Y)(G.A,{size:12})}),(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),o("stage_all")},title:"Stage All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(H.A,{size:12})})]})]}),d&&("tree"===a?(0,s.Y)(Z,{changes:m,isStaged:!1,repo:r,rootPath:i,onAction:o}):m.map(e=>(0,s.Y)(q,{change:e,isStaged:!1,repo:r,rootPath:i,onAction:o},e.file+"unstaged")))]})]})})}var ee=n("wu"),et=n("oZ"),en=n("Af"),es=n("oj");function ea(e){let{className:t="",enabled:n=!0,rootPath:i,refreshKey:o=0}=e,l=(0,r.L)(),c=(0,r.L)(),[d,h,p]=(0,I.bL)("git.activeRepo","."),m=l.data?.activeRepo||d||".",f=e=>{if(!n)return;let t=void 0!==e?e:d,s=new URLSearchParams;i&&s.set("root",i),t&&"."!==t&&s.set("repo",t),s.set("sync","1"),s.set("t",String(Date.now())),l.load(`/api/fs/git?${s.toString()}`)},[u,x]=(0,I.bL)("git.commitDraft",""),[b,g]=(0,I.bL)("git.viewMode","flat"),[k,v]=(0,a.J0)(!1),y=(0,a.li)(null),[w,N]=(0,a.J0)(!1),Y=(0,a.li)(null),[C,A]=(0,a.J0)(!1),F=(0,a.li)(null),[D,S]=(0,a.J0)(null),[z,H]=(0,a.J0)(!1),[R,L]=(0,a.J0)(""),W=(0,a.li)(null),[J,T]=(0,a.J0)(null),[E,K]=(0,a.J0)(!1),{toasts:B,pushToast:G,dismissToast:V}=(0,et.Y)(),[U,q]=(0,a.J0)(null),[Q,Z]=(0,a.J0)(!1),[ea,er]=(0,a.J0)(!1);(0,a.vJ)(()=>{K(!0)},[]),(0,a.vJ)(()=>{p&&f(d)},[o,i,n,p]),(0,en.n)(()=>f(d),n&&p),(0,en.w)(()=>f(d),n&&p),(0,a.vJ)(()=>{l.data?.activeRepo&&l.data.activeRepo!==d&&h(l.data.activeRepo)},[l.data?.activeRepo,d,h]),(0,a.vJ)(()=>{l.data?.reposPending&&Z(!0)},[l.data]),(0,a.vJ)(()=>{ea&&l.data&&!l.data.reposPending&&Array.isArray(l.data.repos)&&(q(l.data.repos),er(!1))},[l.data,ea]),(0,a.vJ)(()=>{if(!Q)return;let e=new URLSearchParams({reposOnly:"1"});i&&e.set("root",i);let t=setInterval(async()=>{let t=await fetch(`/api/fs/git?${e.toString()}`).then(e=>e.json()).catch(()=>null);t&&!t.reposPending&&Array.isArray(t.repos)&&(q(t.repos),Z(!1),er(!1),f(d))},1500);return()=>clearInterval(t)},[Q,i,d]),(0,a.vJ)(()=>{z&&W.current&&W.current.focus()},[z]),(0,a.vJ)(()=>{"idle"===c.state&&c.data&&("history"===c.data.type?T({title:"Commit History",data:c.data.data||[]}):"graph"===c.data.type?T({title:"Git Graph",data:c.data.data||[]}):c.data.success?f(m):G(c.data.error||"Git operation failed"))},[c.state,c.data]),(0,es.W)(y,()=>v(!1)),(0,es.W)(Y,()=>N(!1)),(0,es.W)(F,()=>A(!1));let ei=(e,t,n)=>{let s=new FormData;s.append("actionType",e),s.append("repo",m),i&&s.append("root",i),t&&s.append("file",t),n&&Object.entries(n).forEach(e=>{let[t,n]=e;return s.append(t,n)}),c.submit(s,{method:"POST",action:"/api/fs/git"}),"commit"===e&&x("")},eo=l.data?.branch||"main",el=l.data?.branches||["main"],ec=l.data?.remoteBranches||[],ed=U??(l.data?.repos||["."]),eh=l.data?.changes||[],ep="loading"===l.state||"idle"!==c.state,em=eh.filter(e=>{let t=e.status;return t&&" "!==t[0]&&"?"!==t[0]});return n?(0,s.FD)("div",{className:`flex flex-col h-full bg-paper relative ${t}`,children:[E&&(0,s.FD)(s.FK,{children:[(0,s.Y)(j,{modal:D,onClose:()=>S(null),onConfirm:()=>{D&&(ei(D.type,D.file),S(null))}}),(0,s.Y)(P,{isOpen:z,branchName:R,inputRef:W,onChange:L,onClose:()=>{H(!1),L("")},onCreate:()=>{R.trim()&&(ei("create_branch",void 0,{branch:R.trim()}),H(!1),L(""))}}),(0,s.Y)(M,{output:J,onClose:()=>T(null),onRefresh:()=>{J&&ei(J.title.toLowerCase().includes("graph")?"graph":"history")},onExecuteAction:(e,t,n)=>ei(e,t,n),rootPath:i,activeRepo:m})]}),(0,s.Y)(ee.y,{toasts:B,onDismiss:V}),(0,s.Y)(_,{repoRef:Y,showRepoMenu:w,setShowRepoMenu:N,activeRepo:m,repos:ed,isLoading:ep,rootPath:i,reposScanning:Q||ea,onSelectRepo:e=>{h(e),f(e)},onRefresh:()=>f(m),onRefreshRepos:()=>{if(!n||Q||ea)return;q(ed),er(!0);let e=new URLSearchParams({rescan:"1",sync:"1"});i&&e.set("root",i),"."!==m&&e.set("repo",m),e.set("t",String(Date.now())),l.load(`/api/fs/git?${e.toString()}`)}}),(0,s.Y)(O,{branchRef:F,showBranchMenu:C,setShowBranchMenu:A,branch:eo,branches:el,remoteBranches:ec,onCheckout:e=>ei("checkout",void 0,{branch:e}),onOpenBranchPrompt:()=>H(!0),optionsRef:y,showOptions:k,setShowOptions:v,onHistory:()=>ei("history"),onGraph:()=>ei("graph"),viewMode:b,setViewMode:g,isBusy:ep,syncCount:l.data?.syncCount,onSync:()=>ei("sync")}),(0,s.Y)($,{message:u,hasStagedChanges:em.length>0,isBusy:ep,onChangeMessage:x,onCommit:()=>ei("commit",void 0,{message:u})}),(0,s.Y)(X,{changes:eh,isLoading:ep,viewMode:b,repo:m,rootPath:i,onAction:(e,t,n)=>{"revert"===e?S({type:e,file:t,message:`Are you sure you want to discard changes in ${t}?`}):"revert_all"===e?S({type:e,message:"Are you sure you want to discard ALL unstaged changes? This cannot be undone."}):ei(e,t,n)}})]}):(0,s.Y)("div",{className:`flex flex-col h-full bg-paper items-center justify-center text-ink/40 ${t}`,children:(0,s.Y)("span",{className:"text-xs font-mono",children:"No session selected"})})}},rm(e,t,n){let s=(0,n("y").A)({name:"folder-git-2",size:24,node:[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]});n.d(t,{},{A:s})},Wb0(e,t,n){let s=(0,n("y").A)({name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]});n.d(t,{},{A:s})}}]);
|
|
28
|
+
2 unmodified lines`},{file:"docker-compose.yml",status:"M",additions:5,deletions:0}]},{hash:"008cbe0711112222333344445555666677778888",shortHash:"008cbe07",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 01:25 PM",message:"feat(logging): structured timestamped logging across all web flows, bridged to docker logs",parents:["81ad44d5","b3b71ed5"],refs:["origin/feat/whatsapp-notification","feat/whatsapp-notification"],lane:0,files:[{file:"server.ts",status:"M",additions:19,deletions:3}]},{hash:"81ad44d522223333444455556666777788889999",shortHash:"81ad44d5",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 01:07 PM",message:"WIP on main: b3b71ed fix(pbpmd): history modal reads live BOFIS API instead of sqlite cache",parents:["9616fad9"],refs:["refs/stash"],lane:1,files:[{file:"app/routes/api/pb-pmd/$id.history.ts",status:"M",additions:22,deletions:6}]},{hash:"9616fad933334444555566667777888899990000",shortHash:"9616fad9",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 01:07 PM",message:"index on main: b3b71ed fix(pbpmd): history modal reads live BOFIS API instead of sqlite cache",parents:["b3b71ed5"],lane:1,files:[{file:"app/routes/api/pb-pmd/$id.history.ts",status:"M",additions:15,deletions:4}]},{hash:"b3b71ed544445555666677778888999900001111",shortHash:"b3b71ed5",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 12:55 PM",message:"fix(pbpmd): history modal reads live BOFIS API instead of sqlite cache",parents:["4dc73776"],lane:0,files:[{file:"app/routes/api/pb-pmd/$id.history.ts",status:"M",additions:8,deletions:12}]},{hash:"4dc7377655556666777788889999000011112222",shortHash:"4dc73776",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 12:50 PM",message:"feat(ui): 13th KPI card TOTAL MANDAYS + gapless 6-col dashboard grid",parents:["acab6465"],lane:0,files:[{file:"app/components/dashboard/KPIGrid.tsx",status:"M",additions:35,deletions:7}]},{hash:"acab646566667777888899990000111122223333",shortHash:"acab6465",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 12:45 PM",message:"feat(pbpmd): history modal table layout, wider modal, drop edit scenario action",parents:["86a6d6c5"],lane:0,files:[{file:"app/components/pbpmd/HistoryModal.tsx",status:"M",additions:24,deletions:18}]},{hash:"86a6d6c577778888999900001111222233334444",shortHash:"86a6d6c5",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 12:45 PM",message:"feat(pbpmd): pb history modal reads sqlite cache via /api/pb-pmd/:id/history",parents:["9ffea446"],lane:0,files:[{file:"app/routes/api/pb-pmd/$id.history.ts",status:"M",additions:42,deletions:5}]},{hash:"9ffea44688889999000011112222333344445555",shortHash:"9ffea446",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 12:45 PM",message:"feat(dashboard): crdApproved threshold shifted 5 minutes from history date_end",parents:[],lane:0,files:[{file:"app/lib/dashboard/calculator.ts",status:"M",additions:12,deletions:2}]}];function M(e){let{output:t,onClose:n,onRefresh:a,onExecuteAction:i,rootPath:o,activeRepo:c}=e;if(!t)return null;let d=t.title.toLowerCase().includes("graph"),[h,p]=(0,r.J0)(d),[u,f]=(0,r.J0)(""),[g,k]=(0,r.J0)(""),[y,v]=(0,r.J0)(!1),{commits:w,hasMore:N,totalCount:Y,isLoadingMore:C,handleLoadMore:A}=function(e){let{output:t,isGraphMode:n,rootPath:s,activeRepo:a}=e,[i,o]=(0,r.J0)(!1),[l,c]=(0,r.J0)(t?.hasMore??t?.data?.length===50),[d,h]=(0,r.J0)(t?.total),p=(0,r.Kr)(()=>{let e=t?.data||[];return 0===e.length?D:e[0]&&"object"==typeof e[0]&&("hash"in e[0]||"shortHash"in e[0])?e.map(e=>({hash:e.hash||e.shortHash||"unknown",shortHash:e.shortHash||(e.hash?e.hash.slice(0,8):"unknown"),author:e.author||"Unknown",date:e.date||e.time||"",message:e.message||"",parents:Array.isArray(e.parents)?e.parents:[],refs:Array.isArray(e.refs)?e.refs:[],files:Array.isArray(e.files)?e.files:[],lane:"number"==typeof e.lane?e.lane:void 0})):D},[t?.data]),[m,u]=(0,r.J0)(p);(0,r.vJ)(()=>{u(p),c(t?.hasMore??t?.data?.length===50),"number"==typeof t?.total&&h(t.total)},[p,t?.hasMore,t?.data?.length,t?.total]);let f=(0,r.hb)(async()=>{if(!i&&l){o(!0);try{let e=new FormData;e.set("actionType",n?"graph":"history"),e.set("limit","50"),e.set("skip",String(m.length)),s&&e.set("root",s),a&&e.set("repo",a);let t=await fetch("/api/fs/git",{method:"POST",body:e}),r=await t.json();if(r.success&&Array.isArray(r.data)){let e=r.data.map(e=>({hash:e.hash||e.shortHash||"unknown",shortHash:e.shortHash||(e.hash?e.hash.slice(0,8):"unknown"),author:e.author||"Unknown",date:e.date||e.time||"",message:e.message||"",parents:Array.isArray(e.parents)?e.parents:[],refs:Array.isArray(e.refs)?e.refs:[],files:Array.isArray(e.files)?e.files:[],lane:"number"==typeof e.lane?e.lane:void 0}));u(t=>{let n=new Set(t.map(e=>e.hash));return[...t,...e.filter(e=>!n.has(e.hash))]}),c(!!(r.hasMore??50===e.length)),"number"==typeof r.total&&h(r.total)}else c(!1)}catch(e){console.error("Failed to load more commits:",e)}finally{o(!1)}}},[i,l,n,m.length,s,a]);return{commits:m,setCommits:u,hasMore:l,totalCount:d,isLoadingMore:i,handleLoadMore:f}}({output:t,isGraphMode:h,rootPath:o,activeRepo:c}),{fileDiffs:M,expandedFiles:S,loadingFiles:j,handleToggleFile:P,handleCommitAction:z}=function(e){let{onExecuteAction:t,rootPath:n,activeRepo:s}=e,[a,i]=(0,r.J0)({}),[o,l]=(0,r.J0)(new Set),[c,d]=(0,r.J0)(new Set),h=(0,r.hb)(async(e,t)=>{let r=`${e}:${t.file}`,c=o.has(r);if(l(e=>{let t=new Set(e);return t.has(r)?t.delete(r):t.add(r),t}),!c&&void 0===a[r]&&!t.diff){d(e=>new Set(e).add(r));try{let a=new FormData;a.set("actionType","commit_diff"),a.set("hash",e),a.set("file",t.file),n&&a.set("root",n),s&&"."!==s&&a.set("repo",s);let o=await fetch("/api/fs/git",{method:"POST",body:a}),l=await o.json();l&&"string"==typeof l.diff?i(e=>({...e,[r]:l.diff})):l&&l.error&&i(e=>({...e,[r]:`// Error: ${l.error}`}))}catch(e){console.error("Failed to load file diff:",e),i(t=>({...t,[r]:`// Error loading diff: ${e?.message||"Network error"}`}))}finally{d(e=>{let t=new Set(e);return t.delete(r),t})}}},[o,a,n,s]);return{fileDiffs:a,expandedFiles:o,loadingFiles:c,handleToggleFile:h,handleCommitAction:(0,r.hb)((e,n)=>{if(t)if("checkout"===e)t("checkout",void 0,{branch:n.hash});else if("create_branch_here"===e){let e=window.prompt(`Create new branch at commit ${n.shortHash}:`,`branch-${n.shortHash}`);e?.trim()&&t("create_branch",void 0,{branch:e.trim()})}else if("cherry_pick"===e)window.confirm(`Cherry-pick commit ${n.shortHash} onto current branch?`)&&t("cherry_pick",void 0,{hash:n.hash});else if("revert"===e)window.confirm(`Revert commit ${n.shortHash}?`)&&t("revert_commit",void 0,{hash:n.hash});else if("reset"===e){let e=window.prompt(`Reset current branch to ${n.shortHash} (soft, mixed, hard):`,"soft");e&&["soft","mixed","hard"].includes(e.toLowerCase())&&t("reset_commit",void 0,{hash:n.hash,mode:e.toLowerCase()})}else"merge"===e?window.confirm(`Merge commit ${n.shortHash} into current branch?`)&&t("merge_commit",void 0,{hash:n.hash}):"rebase"===e&&window.confirm(`Rebase current branch onto commit ${n.shortHash}?`)&&t("rebase_commit",void 0,{hash:n.hash})},[t])}}({onExecuteAction:i,rootPath:o,activeRepo:c});(0,r.vJ)(()=>{w.length>0&&!g&&k(w[0].hash)},[w,g]);let $=(0,r.Kr)(()=>{if(!u.trim())return w;let e=u.toLowerCase().trim();return w.filter(t=>t.message.toLowerCase().includes(e)||t.author.toLowerCase().includes(e)||t.shortHash.toLowerCase().includes(e)||t.hash.toLowerCase().includes(e)||t.refs?.some(t=>t.toLowerCase().includes(e)))},[w,u]),H=(0,r.li)(null),R=(0,r.li)(null),L=(0,r.li)(null),W=(0,r.li)({}),[J,T]=(0,r.J0)({}),[O,E]=(0,r.J0)(800);(0,r.vJ)(()=>{let e=L.current;if(!e||!N||C||u.trim())return;let t=new IntersectionObserver(e=>{e[0].isIntersecting&&A()},{root:H.current,threshold:.1});return t.observe(e),()=>t.disconnect()},[N,C,u,A]);let K=(0,r.hb)(()=>{if(!H.current||!R.current)return;let e=H.current.getBoundingClientRect(),t=H.current.scrollTop,n={};$.forEach((s,r)=>{let a=W.current[s.hash];if(a){let r=a.getBoundingClientRect();n[s.hash]=r.top+r.height/2-e.top+t}else n[s.hash]=60*r+20}),T(n),E(Math.max(R.current.offsetHeight,H.current.clientHeight,600))},[$]);(0,r.Nf)(()=>{K();let e=requestAnimationFrame(()=>{K()});return()=>cancelAnimationFrame(e)},[K,$,M,S,h]),(0,r.vJ)(()=>{let e=R.current;if(!e)return;let t=new ResizeObserver(()=>{K()});return t.observe(e),()=>t.disconnect()},[K]);let I=(0,r.Kr)(()=>x($),[$]),_=(0,r.Kr)(()=>{let e=0;return I.forEach(t=>{t>e&&(e=t)}),e},[I]),B=h?(_+1)*18+32:36,G=async()=>{v(!0),a&&await a(),setTimeout(()=>v(!1),600)};return(0,s.Y)("div",{className:"fixed inset-0 z-50 bg-canvas/80 backdrop-blur-xs flex items-center justify-center p-0 lg:p-5",onClick:n,role:"dialog","aria-modal":"true",children:(0,s.FD)("div",{className:"bg-paper border-ink/20 shadow-2xl flex flex-col overflow-hidden\n w-full h-full rounded-none border-0\n lg:w-[min(96vw,980px)] lg:h-[88vh] lg:rounded-xl lg:border\n pt-[env(safe-area-inset-top,0px)] lg:pt-0",onClick:e=>e.stopPropagation(),children:[(0,s.Y)(m,{isGraphMode:h,onToggleMode:p,searchQuery:u,onSearchChange:f,onRefresh:G,onClose:n,isRefreshing:y,totalCommits:$.length,totalCount:Y}),(0,s.Y)("div",{ref:H,className:"flex-1 overflow-y-auto scrollbar-overlay-container relative select-text",children:0===$.length?(0,s.Y)("div",{className:"flex flex-col items-center justify-center py-20 text-ink/40 font-mono text-xs",children:"No matching commits found."}):(0,s.FD)("div",{className:"relative min-h-full pb-8",children:[(0,s.Y)(b,{commits:$,nodePositions:J,selectedHash:g,isGraphMode:h,laneWidth:18,paddingLeft:16,totalHeight:O}),(0,s.FD)("div",{ref:R,className:"flex flex-col relative z-20",style:{paddingLeft:`${B}px`},children:[$.map(e=>(0,s.Y)(F,{commit:e,isSelected:g===e.hash,isGraphMode:h,onSelect:e=>k(e.hash),onAction:z,onToggleFile:P,isExpandedFile:(e,t)=>S.has(`${e}:${t}`),isLoadingFile:(e,t)=>j.has(`${e}:${t}`),fileDiffs:M,headerRef:t=>{W.current[e.hash]=t}},e.hash)),(0,s.Y)("div",{ref:L,className:"pt-3 pb-4 px-4 flex items-center justify-center",children:C?(0,s.FD)("div",{className:"flex items-center gap-2 text-xs text-ink/60 font-mono py-2",children:[(0,s.Y)(l.A,{size:14,className:"animate-spin text-info"}),(0,s.Y)("span",{children:"Loading more commits..."})]}):N&&!u.trim()?(0,s.Y)("button",{type:"button",onClick:A,className:"px-3 py-1.5 text-xs font-mono text-ink/70 hover:text-ink bg-ink/5 hover:bg-ink/10 rounded-md border border-ink/10 transition-colors cursor-pointer",children:"Load more commits..."}):$.length>10?(0,s.FD)("div",{className:"text-[11px] font-mono text-ink/40 py-2",children:["End of commit history (",$.length," commits)"]}):null})]})]})})]})})}function S(e){let{children:t,onClose:n,wide:r}=e;return(0,s.Y)("div",{className:"fixed inset-0 z-50 bg-canvas/80 flex items-center justify-center p-4",onClick:n,role:"dialog","aria-modal":"true",children:(0,s.Y)("div",{className:`bg-paper border border-ink/20 rounded-lg shadow-xl flex flex-col overflow-hidden ${r?"w-[min(94vw,680px)] max-h-[82vh]":"w-[min(94vw,420px)] max-h-[80vh]"}`,onClick:e=>e.stopPropagation(),children:t})})}function j(e){let{modal:t,onClose:n,onConfirm:r}=e;return t?(0,s.FD)(S,{onClose:n,children:[(0,s.FD)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-ink/10",children:[(0,s.Y)(i.A,{size:16,className:"text-error flex-shrink-0"}),(0,s.Y)("h3",{className:"text-sm font-semibold text-ink",children:"Confirm Action"})]}),(0,s.Y)("div",{className:"px-4 py-4 text-xs text-ink/80 leading-relaxed",children:t.message}),(0,s.FD)("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[(0,s.Y)("button",{type:"button",onClick:n,className:"px-3 py-1.5 rounded border border-ink/20 text-ink/70 hover:bg-ink/5 hover:text-ink transition-colors cursor-pointer text-xs",children:"Cancel"}),(0,s.Y)("button",{type:"button",onClick:r,className:"px-3 py-1.5 rounded bg-error text-canvas hover:bg-error/90 transition-colors cursor-pointer text-xs font-medium",children:"Confirm"})]})]}):null}function P(e){let{isOpen:t,branchName:n,inputRef:a,onChange:i,onClose:l,onCreate:c}=e;if(!t)return null;let d=(0,r.hb)(()=>{n.trim()&&c()},[n,c]);return(0,s.FD)(S,{onClose:l,children:[(0,s.FD)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-ink/10",children:[(0,s.Y)(o.A,{size:16,className:"text-ink/60 flex-shrink-0"}),(0,s.Y)("h3",{className:"text-sm font-semibold text-ink",children:"Create New Branch"})]}),(0,s.Y)("div",{className:"px-4 py-4",children:(0,s.Y)("input",{ref:a,type:"text",value:n,onChange:e=>i(e.currentTarget.value),onKeyDown:e=>{"Enter"===e.key&&d(),"Escape"===e.key&&l()},placeholder:"branch-name",className:"w-full bg-canvas border border-ink/20 rounded px-3 py-2 text-xs focus:outline-none focus:border-ink/40 text-ink placeholder-ink/40 transition-colors"})}),(0,s.FD)("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[(0,s.Y)("button",{type:"button",onClick:l,className:"px-3 py-1.5 rounded border border-ink/20 text-ink/70 hover:bg-ink/5 hover:text-ink transition-colors cursor-pointer text-xs",children:"Cancel"}),(0,s.Y)("button",{type:"button",onClick:d,disabled:!n.trim(),className:"px-3 py-1.5 rounded bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:"Create"})]})]})}function z(e){let{message:t,hasStagedChanges:n,isBusy:r=!1,onChangeMessage:a,onCommit:i}=e,o=n&&t.trim().length>0&&!r;return(0,s.FD)("div",{className:"border-t border-ink/10 bg-canvas/50 p-3 flex flex-col gap-2",children:[(0,s.Y)("textarea",{value:t,onChange:e=>a(e.currentTarget.value),onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&o&&(e.preventDefault(),i())},placeholder:"Commit message (⌘/Ctrl+Enter to commit)",rows:5,className:"w-full resize-y min-h-[100px] max-h-[200px] bg-paper border border-ink/20 rounded px-2.5 py-1.5 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),(0,s.FD)("button",{type:"button",onClick:i,disabled:!o,title:n?"Commit staged changes":"Stage changes first",className:"flex items-center justify-center gap-1.5 px-3 py-1.5 rounded bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[(0,s.Y)(g.A,{size:12}),"Commit"]})]})}var $=n("vZ"),H=n("r"),R=n("n"),L=n("Sj"),W=n("y");let J=(0,W.A)({name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]}),T=(0,W.A)({name:"folder-tree",size:24,node:[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]});function O(e){let{branchRef:t,showBranchMenu:n,setShowBranchMenu:r,branch:a,branches:i,remoteBranches:l,onCheckout:d,onOpenBranchPrompt:h,optionsRef:p,showOptions:m,setShowOptions:u,onHistory:f,onGraph:x,viewMode:b,setViewMode:k,isBusy:v=!1,syncCount:w={ahead:0,behind:0},onSync:N}=e;return(0,s.FD)("div",{className:"p-3 border-b border-ink/10 bg-canvas/50 flex items-center justify-between",children:[(0,s.FD)("div",{className:"relative",ref:t,children:[(0,s.FD)("button",{onClick:()=>r(!n),className:"flex items-center space-x-1.5 hover:bg-ink/5 px-2 py-1 -ml-2 rounded transition-colors text-[11px] text-ink/80 font-medium",children:[(0,s.Y)($.A,{size:12,className:"text-ink/60"}),(0,s.Y)("span",{className:"truncate max-w-[140px]",children:a}),(0,s.Y)(y.A,{size:12,className:"text-ink/40"})]}),n&&(0,s.Y)("div",{className:"absolute top-full left-0 mt-1 w-48 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs",children:(0,s.FD)("div",{className:"max-h-48 scrollbar-overlay-container scrollbar-overlay-static py-1",children:[i.length>0&&(0,s.FD)(s.FK,{children:[(0,s.Y)("div",{className:"px-3 py-1 text-[9px] uppercase tracking-wider text-ink/40 font-semibold",children:"Local"}),i.map(e=>(0,s.FD)("button",{onClick:()=>{d(e),r(!1)},className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,s.Y)("span",{className:"truncate",children:e}),a===e&&(0,s.Y)(g.A,{size:12,className:"text-ink"})]},e))]}),l.length>0&&(0,s.FD)(s.FK,{children:[(0,s.Y)("div",{className:"px-3 py-1 text-[9px] uppercase tracking-wider text-ink/40 font-semibold",children:"Remote"}),l.map(e=>(0,s.FD)("button",{onClick:()=>{d(e),r(!1)},className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,s.Y)("span",{className:"truncate",children:e}),a===e&&(0,s.Y)(g.A,{size:12,className:"text-ink"})]},e))]}),(0,s.Y)("div",{className:"w-full h-px bg-ink/10 my-1"}),(0,s.FD)("button",{onClick:()=>{h(),r(!1)},className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center space-x-2 transition-colors text-ink/80 italic",children:[(0,s.Y)(H.A,{size:12}),(0,s.Y)("span",{children:"Create new branch..."})]})]})})]}),(0,s.FD)("div",{className:"flex items-center space-x-2 text-ink/40 relative",ref:p,children:[(0,s.FD)("button",{type:"button",onClick:N,disabled:v,title:w.ahead>0&&w.behind>0?`Pull ${w.behind} then push ${w.ahead} commit(s)`:w.ahead>0?`Push ${w.ahead} commit(s)`:w.behind>0?`Pull ${w.behind} commit(s)`:"Up to date — sync anyway",className:"flex items-center gap-1 p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:[(0,s.Y)(R.A,{size:13}),(0,s.FD)("span",{className:"font-mono tabular-nums text-[10px]",children:["↑",w.ahead," ↓",w.behind]})]}),(0,s.Y)("button",{type:"button",onClick:f,title:"Commit History",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:(0,s.Y)(c.A,{size:13})}),(0,s.Y)("button",{type:"button",onClick:x,title:"Git Graph",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:(0,s.Y)(o.A,{size:13})}),(0,s.Y)("button",{type:"button",onClick:()=>u(!m),title:"View Options",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:(0,s.Y)(L.A,{size:13})}),m&&(0,s.FD)("div",{className:"absolute right-0 top-full mt-1 w-36 bg-paper border border-ink/15 rounded-md shadow-lg z-50 py-1 font-mono text-xs",children:[(0,s.FD)("button",{type:"button",onClick:()=>{k("flat"),u(!1)},className:"w-full px-3 py-1.5 text-left text-ink hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,s.FD)("div",{className:"flex items-center space-x-1.5",children:[(0,s.Y)(J,{size:12,className:"text-ink/60"}),(0,s.Y)("span",{children:"View as List"})]}),"flat"===b&&(0,s.Y)(g.A,{size:12,className:"text-ink"})]}),(0,s.FD)("button",{type:"button",onClick:()=>{k("tree"),u(!1)},className:"w-full px-3 py-1.5 text-left text-ink hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,s.FD)("div",{className:"flex items-center space-x-1.5",children:[(0,s.Y)(T,{size:12,className:"text-ink/60"}),(0,s.Y)("span",{children:"View as Tree"})]}),"tree"===b&&(0,s.Y)(g.A,{size:12,className:"text-ink"})]})]})]})]})}var E=n("rm"),K=n("Ir"),I=n("FL");function _(e){let{repoRef:t,showRepoMenu:n,setShowRepoMenu:r,activeRepo:a,repos:i,isLoading:o,rootPath:l,reposScanning:c,onSelectRepo:d,onRefresh:h,onRefreshRepos:m}=e,[u,f]=(0,I.bL)("git.repoQuery",""),x=function(e){if(!e)return"workspace root";let t=e.replace(/\\/g,"/").split("/").filter(Boolean);return t.length>0?t[t.length-1]:"workspace root"}(l),b=e=>"."===e?x:e,k=i.filter(e=>!u.trim()||b(e).toLowerCase().includes(u.toLowerCase()));return(0,s.FD)("div",{className:"p-3 border-b border-ink/10 flex items-center justify-between",children:[(0,s.FD)("div",{className:"relative",ref:t,children:[(0,s.FD)("button",{onClick:()=>r(!n),className:"flex items-center space-x-1.5 hover:bg-ink/5 px-2 py-1 -ml-2 rounded transition-colors text-xs text-ink/80 font-medium",children:[(0,s.Y)(E.A,{size:12,className:"text-ink/60"}),(0,s.FD)("span",{className:"flex items-center space-x-1 truncate max-w-[150px]",children:[(0,s.Y)("span",{className:"text-ink/50 font-normal uppercase tracking-wider text-[10px]",children:"GIT"}),(0,s.Y)("span",{className:"text-ink/30",children:"•"}),(0,s.Y)("span",{children:"."===a?x:a.split("/").pop()})]}),(0,s.Y)(y.A,{size:12,className:"text-ink/40"})]}),n&&(0,s.FD)("div",{className:"absolute top-full left-0 mt-1 w-52 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs",children:[(0,s.FD)("div",{className:"px-2 py-1.5 border-b border-ink/10 flex items-center space-x-1.5",children:[(0,s.Y)(p.A,{size:11,className:"text-ink/40 flex-shrink-0"}),(0,s.Y)("input",{type:"text",value:u,onChange:e=>f(e.currentTarget.value),placeholder:"Search repos...",title:"Search repositories",className:"w-full bg-transparent outline-none text-xs text-ink placeholder-ink/40",autoFocus:!0}),u&&(0,s.Y)("button",{type:"button",onClick:()=>f(""),title:"Clear search",className:"text-ink/40 hover:text-ink flex-shrink-0",children:"×"}),(0,s.Y)("button",{type:"button",onClick:m,title:"Refresh nested repos",disabled:c,className:"text-ink/40 hover:text-ink flex-shrink-0 transition-colors disabled:opacity-40 disabled:hover:text-ink/40",children:(0,s.Y)(K.A,{size:11,className:c?"animate-spin":""})})]}),(0,s.Y)("div",{className:"max-h-48 scrollbar-overlay-container scrollbar-overlay-static py-1",children:0===k.length?(0,s.Y)("div",{className:"px-3 py-2 text-ink/40 italic",children:"No repos found"}):k.map(e=>(0,s.FD)("button",{onClick:()=>{d(e),r(!1),f("")},title:b(e),className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,s.Y)("span",{className:"truncate",children:b(e)}),a===e&&(0,s.Y)(g.A,{size:12,className:"text-ink"})]},e))})]})]}),(0,s.Y)("div",{className:"flex space-x-2 text-ink/40",children:(0,s.Y)("button",{type:"button",onClick:h,title:"Refresh",className:"hover:text-ink cursor-pointer inline-flex",children:(0,s.Y)(K.A,{size:14,className:o?"animate-spin":""})})})]})}var B=n("DV"),G=n("I"),V=n("pX"),U=n("LQ");function q(e){let{change:t,isStaged:n,repo:r,rootPath:a,onAction:i}=e,o=(0,U.R)(t.status,n),l=o.charStatus,c=o.colorClass,d=t.file.split("/"),h=d.pop()||t.file,p=d.length>0?d.join("/"):"";return(0,s.FD)("div",{className:"flex items-center justify-between px-3 py-1 hover:bg-ink/5 cursor-pointer group text-[11px] transition-colors",onClick:()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:t.file,staged:n,status:l,repo:r||".",root:a}}))},children:[(0,s.FD)("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-2",children:[(0,s.Y)("span",{className:`font-bold font-mono text-[9px] w-3 flex-shrink-0 text-center ${c}`,title:`Status: ${o.label}`,children:l}),(0,s.Y)(V.o,{name:h,size:12,className:"flex-shrink-0"}),(0,s.Y)("span",{className:`truncate ${c}`,title:t.file,children:h}),p&&(0,s.Y)("span",{className:"text-[9px] text-ink/40 truncate ml-1",children:p})]}),(0,s.Y)("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:(0,s.FD)("div",{className:"flex items-center opacity-0 group-hover:opacity-100 space-x-1",children:[!n&&(0,s.FD)(s.FK,{children:[(0,s.Y)("button",{type:"button",onClick:()=>i("revert",t.file),title:"Discard Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:(0,s.Y)(G.A,{size:11})}),(0,s.Y)("button",{type:"button",onClick:()=>i("stage",t.file),title:"Stage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(H.A,{size:11})})]}),n&&(0,s.Y)("button",{type:"button",onClick:()=>i("unstage",t.file),title:"Unstage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(B.A,{size:11})})]})})]})}function Q(e){let{node:t,isStaged:n,isFolderOpen:r,toggleFolder:a,onAction:i,depth:o=0,repo:l,rootPath:c}=e,d="folder"===t.type,h=!!d&&r(t.id);if(d)return(0,s.FD)("div",{className:"select-none",children:[(0,s.FD)("div",{className:"flex items-center justify-between px-2 py-1 hover:bg-ink/5 cursor-pointer rounded group transition-colors text-[11px]",onClick:()=>a(t.id),children:[(0,s.FD)("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-1",children:[(0,s.Y)("span",{className:"w-3.5 h-3.5 flex items-center justify-center text-ink/40 flex-shrink-0",children:h?(0,s.Y)(y.A,{size:12}):(0,s.Y)(v.A,{size:12})}),(0,s.Y)(V.o,{name:t.name,isFolder:!0,isOpen:h,size:13,className:"flex-shrink-0"}),(0,s.Y)("span",{className:"font-medium text-ink truncate",children:t.name}),(0,s.Y)("span",{className:"text-[9px] text-ink/40 font-normal px-1 py-0.2 bg-ink/5 rounded-full ml-1",children:t.changeCount})]}),(0,s.Y)("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:(0,s.Y)("div",{className:"flex items-center opacity-0 group-hover:opacity-100 space-x-1",children:n?(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),i("unstage",t.path)},title:`Unstage ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(B.A,{size:11})}):(0,s.FD)(s.FK,{children:[(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),i("revert",t.path)},title:`Discard changes in ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:(0,s.Y)(G.A,{size:11})}),(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),i("stage",t.path)},title:`Stage ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(H.A,{size:11})})]})})})]}),h&&t.children&&t.children.length>0&&(0,s.Y)("div",{className:"ml-3 border-l border-ink/10 pl-1",children:t.children.map(e=>(0,s.Y)(Q,{node:e,isStaged:n,isFolderOpen:r,toggleFolder:a,onAction:i,depth:o+1,repo:l,rootPath:c},e.id))})]});let p=t.change,m=(0,U.R)(p?.status||"M",n),u=m.charStatus,f=m.colorClass,x=p?p.file:t.path;return(0,s.FD)("div",{className:"flex items-center justify-between px-2 py-0.5 hover:bg-ink/5 cursor-pointer rounded group transition-colors text-[11px]",onClick:()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:x,staged:n,status:u,repo:l||".",root:c}}))},children:[(0,s.FD)("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-1",children:[(0,s.Y)("span",{className:"w-3.5 h-3.5 flex items-center justify-center flex-shrink-0",children:(0,s.Y)("span",{className:`font-bold font-mono text-[9px] ${f}`,title:`Status: ${m.label}`,children:u})}),(0,s.Y)(V.o,{name:t.name,size:12,className:"flex-shrink-0"}),(0,s.Y)("span",{className:`truncate ${f}`,title:x,children:t.name})]}),(0,s.Y)("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:(0,s.Y)("div",{className:"flex items-center opacity-0 group-hover:opacity-100 space-x-1",children:n?(0,s.Y)("button",{type:"button",onClick:()=>i("unstage",x),title:"Unstage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(B.A,{size:11})}):(0,s.FD)(s.FK,{children:[(0,s.Y)("button",{type:"button",onClick:()=>i("revert",x),title:"Discard Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:(0,s.Y)(G.A,{size:11})}),(0,s.Y)("button",{type:"button",onClick:()=>i("stage",x),title:"Stage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(H.A,{size:11})})]})})})]})}function Z(e){let{changes:t,isStaged:n,repo:a,rootPath:i,onAction:o}=e,{tree:l,isFolderOpen:c,toggleFolder:d}=function(e){let{sessionId:t,ready:n,read:s}=(0,I.p0)(),a=(0,r.Kr)(()=>(function(e){let t={id:"",name:"",path:"",type:"folder",children:[],changeCount:0};for(let n of e){let e=n.file.replace(/^[./]+/,""),s=e.endsWith("/"),r=e.replace(/\/$/,"").split("/").filter(Boolean),a=t,i="";for(let e=0;e<r.length;e++){let t=r[e];i=i?`${i}/${t}`:t;let o=e===r.length-1;if(o&&!s)a.children.push({id:i,name:t,path:i,type:"file",change:n,children:[],changeCount:1});else{let e=a.children.find(e=>"folder"===e.type&&e.name===t);e||(e={id:i,name:t,path:i,type:"folder",children:[],changeCount:0,change:o&&s?n:void 0},a.children.push(e)),a=e}}}return!function e(t){if("file"===t.type)return 1;let n=+!!t.change;for(let s of t.children)n+=e(s);return t.changeCount=n,t.children.sort((e,t)=>"folder"===e.type&&"file"===t.type?-1:"file"===e.type&&"folder"===t.type?1:e.name.localeCompare(t.name)),n}(t),t.children})(e),[e]),i=(0,r.Kr)(()=>{let e=new Set;return!function t(n){for(let s of n)"folder"===s.type&&(e.add(s.id),s.children&&s.children.length>0&&t(s.children))}(a),e},[a]),[o,l]=(0,I.bL)("git.expandedFolders",[]),c=(0,r.Kr)(()=>new Set(o),[o]),d=(0,r.li)(null);(0,r.vJ)(()=>{!n||d.current===t||0===i.size||(d.current=t,s("git.expandedFolders",[]).length>0||l(Array.from(i)))},[n,t,i,s,l]);let h=(0,r.hb)(e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),Array.from(n)})},[l]),p=(0,r.hb)(e=>c.has(e),[c]);return{tree:a,expandedFolders:c,toggleFolder:h,isFolderOpen:p,expandAll:()=>l(Array.from(i)),collapseAll:()=>l([])}}(t);return 0===l.length?null:(0,s.Y)("div",{className:"py-0.5",children:l.map(e=>(0,s.Y)(Q,{node:e,isStaged:n,isFolderOpen:c,toggleFolder:d,onAction:o,repo:a,rootPath:i},e.id))})}function X(e){let{changes:t,isLoading:n,viewMode:r,repo:a,rootPath:i,onAction:o}=e,[l,c]=(0,I.bL)("git.stagedExpanded",!0),[d,h]=(0,I.bL)("git.unstagedExpanded",!0),p=t.filter(e=>{let t=e.status;return t&&" "!==t[0]&&"?"!==t[0]}),m=t.filter(e=>{let t=e.status;return t&&" "!==t[1]&&"?"!==t[1]||"??"===t});return n&&0===t.length?(0,s.Y)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static font-mono text-[11px] text-ink/80",children:(0,s.Y)("div",{className:"p-4 text-center text-ink/40 italic",children:"Loading..."})}):0===t.length?(0,s.Y)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static font-mono text-[11px] text-ink/80",children:(0,s.Y)("div",{className:"p-4 text-center text-ink/40 italic",children:"No changes found."})}):(0,s.Y)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static font-mono text-[11px] text-ink/80",children:(0,s.FD)("div",{className:"py-1",children:[p.length>0&&(0,s.FD)("div",{className:"mb-2",children:[(0,s.FD)("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-ink/5 cursor-pointer transition-colors",onClick:()=>c(!l),children:[(0,s.FD)("div",{className:"flex items-center space-x-1 font-semibold text-ink text-xs",children:[(0,s.Y)("span",{className:"w-3 text-center",children:l?"▾":"▸"}),(0,s.Y)("span",{children:"Staged Changes"}),(0,s.Y)("span",{className:"text-ink/40 font-normal ml-1 border border-ink/20 rounded-full px-1.5 text-[9px] bg-paper",children:p.length})]}),(0,s.Y)("div",{className:"opacity-0 group-hover:opacity-100 flex items-center space-x-1 text-ink/40 flex-shrink-0",children:(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),o("unstage_all")},title:"Unstage All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(B.A,{size:12})})})]}),l&&("tree"===r?(0,s.Y)(Z,{changes:p,isStaged:!0,repo:a,rootPath:i,onAction:o}):p.map(e=>(0,s.Y)(q,{change:e,isStaged:!0,repo:a,rootPath:i,onAction:o},e.file+"staged")))]}),m.length>0&&(0,s.FD)("div",{children:[(0,s.FD)("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-ink/5 cursor-pointer transition-colors",onClick:()=>h(!d),children:[(0,s.FD)("div",{className:"flex items-center space-x-1 font-semibold text-ink text-xs",children:[(0,s.Y)("span",{className:"w-3 text-center",children:d?"▾":"▸"}),(0,s.Y)("span",{children:"Changes"}),(0,s.Y)("span",{className:"text-ink/40 font-normal ml-1 border border-ink/20 rounded-full px-1.5 text-[9px] bg-paper",children:m.length})]}),(0,s.FD)("div",{className:"opacity-0 group-hover:opacity-100 flex items-center space-x-1 text-ink/40 flex-shrink-0",children:[(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),o("revert_all")},title:"Discard All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:(0,s.Y)(G.A,{size:12})}),(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),o("stage_all")},title:"Stage All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(H.A,{size:12})})]})]}),d&&("tree"===r?(0,s.Y)(Z,{changes:m,isStaged:!1,repo:a,rootPath:i,onAction:o}):m.map(e=>(0,s.Y)(q,{change:e,isStaged:!1,repo:a,rootPath:i,onAction:o},e.file+"unstaged")))]})]})})}var ee=n("wu"),et=n("oZ"),en=n("SW"),es=n("Af"),er=n("oj");function ea(e){let{className:t="",enabled:n=!0,rootPath:i,refreshKey:o=0}=e,l=(0,a.L)(),c=(0,a.L)(),{activeRepo:d,setActiveRepo:h,ready:p}=(0,en.Og)(i,"git.activeRepo"),{repos:m,scanning:u,rescan:f}=(0,en.Ml)(i,n),x=(0,en.gv)(d,m),b=(0,r.li)(x);b.current=x;let g=(0,r.li)("");g.current=`${i??""}\0${x}`;let k=(0,r.li)(""),y=(0,r.li)(""),v=(0,r.li)(void 0);l.data!==v.current&&(v.current=l.data,y.current=k.current);let w=y.current===g.current?l.data:void 0,N=e=>{if(!n)return;let t=e??b.current,s=new URLSearchParams;i&&s.set("root",i),t&&"."!==t&&s.set("repo",t),s.set("sync","1"),s.set("t",String(Date.now())),k.current=g.current,l.load(`/api/fs/git?${s.toString()}`)},[Y,C]=(0,I.bL)("git.commitDraft",""),[A,F]=(0,I.bL)("git.viewMode","flat"),[D,S]=(0,r.J0)(!1),$=(0,r.li)(null),[H,R]=(0,r.J0)(!1),L=(0,r.li)(null),[W,J]=(0,r.J0)(!1),T=(0,r.li)(null),[E,K]=(0,r.J0)(null),[B,G]=(0,r.J0)(!1),[V,U]=(0,r.J0)(""),q=(0,r.li)(null),[Q,Z]=(0,r.J0)(null),[ea,ei]=(0,r.J0)(!1),{toasts:eo,pushToast:el,dismissToast:ec}=(0,et.Y)();(0,r.vJ)(()=>{ei(!0)},[]),(0,r.vJ)(()=>{p&&N()},[o,i,n,p,x]),(0,es.n)(()=>N(),n&&p),(0,es.w)(()=>N(),n&&p),(0,r.vJ)(()=>{B&&q.current&&q.current.focus()},[B]),(0,r.vJ)(()=>{"idle"===c.state&&c.data&&("history"===c.data.type?Z({title:"Commit History",data:c.data.data||[]}):"graph"===c.data.type?Z({title:"Git Graph",data:c.data.data||[]}):c.data.success?N():el(c.data.error||"Git operation failed"))},[c.state,c.data]),(0,er.W)($,()=>S(!1)),(0,er.W)(L,()=>R(!1)),(0,er.W)(T,()=>J(!1));let ed=(e,t,n)=>{let s=new FormData;s.append("actionType",e),s.append("repo",x),i&&s.append("root",i),t&&s.append("file",t),n&&Object.entries(n).forEach(e=>{let[t,n]=e;return s.append(t,n)}),c.submit(s,{method:"POST",action:"/api/fs/git"}),"commit"===e&&C("")},eh=w?.branch||"main",ep=w?.branches||["main"],em=w?.remoteBranches||[],eu=w?.changes||[],ef="loading"===l.state||"idle"!==c.state,ex=eu.filter(e=>{let t=e.status;return t&&" "!==t[0]&&"?"!==t[0]});return n?(0,s.FD)("div",{className:`flex flex-col h-full bg-paper relative ${t}`,children:[ea&&(0,s.FD)(s.FK,{children:[(0,s.Y)(j,{modal:E,onClose:()=>K(null),onConfirm:()=>{E&&(ed(E.type,E.file),K(null))}}),(0,s.Y)(P,{isOpen:B,branchName:V,inputRef:q,onChange:U,onClose:()=>{G(!1),U("")},onCreate:()=>{V.trim()&&(ed("create_branch",void 0,{branch:V.trim()}),G(!1),U(""))}}),(0,s.Y)(M,{output:Q,onClose:()=>Z(null),onRefresh:()=>{Q&&ed(Q.title.toLowerCase().includes("graph")?"graph":"history")},onExecuteAction:(e,t,n)=>ed(e,t,n),rootPath:i,activeRepo:x})]}),(0,s.Y)(ee.y,{toasts:eo,onDismiss:ec}),(0,s.Y)(_,{repoRef:L,showRepoMenu:H,setShowRepoMenu:R,activeRepo:x,repos:m,isLoading:ef,rootPath:i,reposScanning:u,onSelectRepo:e=>{e!==x&&h(e)},onRefresh:()=>N(),onRefreshRepos:f}),(0,s.Y)(O,{branchRef:T,showBranchMenu:W,setShowBranchMenu:J,branch:eh,branches:ep,remoteBranches:em,onCheckout:e=>ed("checkout",void 0,{branch:e}),onOpenBranchPrompt:()=>G(!0),optionsRef:$,showOptions:D,setShowOptions:S,onHistory:()=>ed("history"),onGraph:()=>ed("graph"),viewMode:A,setViewMode:F,isBusy:ef,syncCount:w?.syncCount,onSync:()=>ed("sync")}),(0,s.Y)(z,{message:Y,hasStagedChanges:ex.length>0,isBusy:ef,onChangeMessage:C,onCommit:()=>ed("commit",void 0,{message:Y})}),(0,s.Y)(X,{changes:eu,isLoading:ef,viewMode:A,repo:x,rootPath:i,onAction:(e,t,n)=>{"revert"===e?K({type:e,file:t,message:`Are you sure you want to discard changes in ${t}?`}):"revert_all"===e?K({type:e,message:"Are you sure you want to discard ALL unstaged changes? This cannot be undone."}):ed(e,t,n)}})]}):(0,s.Y)("div",{className:`flex flex-col h-full bg-paper items-center justify-center text-ink/40 ${t}`,children:(0,s.Y)("span",{className:"text-xs font-mono",children:"No session selected"})})}},SW(e,t,n){n.d(t,{gv:()=>c,Ml:()=>h,Og:()=>d});var s=n("G"),r=n("FL"),a=n("oS");let i={repos:["."],scanning:!1},o=(e,t)=>{let n=setTimeout(e,t);return()=>clearTimeout(n)},l=function(e){let{fetch:t,scheduler:n=o}=e,s=new Map;function r(e){let t=s.get(e);return t||(t={snapshot:i,loaded:!1,listeners:new Set,controller:null,cancelRetry:null,pending:null},s.set(e,t)),t}function l(e,t){let n=s.get(e);if(!n)return;let r={...n.snapshot,...t};if(r.repos!==n.snapshot.repos||r.scanning!==n.snapshot.scanning)for(let e of(n.snapshot=r,n.listeners))e()}function c(e){e.cancelRetry?.(),e.cancelRetry=null}function d(e,s){let i=r(e);i.controller?.abort();let o=new AbortController;i.controller=o,l(e,{scanning:!0});let h=new URLSearchParams({reposOnly:"1"});e&&h.set("root",e),s&&h.set("rescan","1"),h.set("t",String(Date.now()));let p=(async()=>{let s=await t(`/api/fs/git?${h.toString()}`).catch(()=>null);if(i.controller!==o)return;i.controller=null;let r=(0,a.u)(s)&&Array.isArray(s.repos)?s.repos:null;if(!r)return void l(e,{scanning:!1});let p=(0,a.u)(s)&&!0===s.reposPending;i.loaded=!0,l(e,{repos:r.filter(e=>"string"==typeof e),scanning:p}),p?(c(i),i.cancelRetry=n(()=>{i.cancelRetry=null,0!==i.listeners.size&&d(e,!1)},1500)):c(i)})();return i.pending=p,p}return{snapshot:e=>s.get(e)?.snapshot??i,settled:e=>s.get(e)?.pending??Promise.resolve(),subscribe:function(e,t){let n=r(e);return n.listeners.add(t),null===n.controller&&null===n.cancelRetry&&(!n.loaded||n.snapshot.scanning)&&d(e,!1),()=>{n.listeners.delete(t),n.listeners.size>0||(n.controller?.abort(),n.controller=null,c(n))}},rescan:e=>void d(e,!0)}}({fetch:async e=>(await fetch(e)).json()});function c(e,t){return"."!==e||t.includes(".")?e:t[0]??"."}function d(e,t){let[n,a,i]=(0,r.bL)(t,null),o=e??"",l=(0,s.li)(o);l.current=o;let c=(0,s.li)(a);c.current=a;let d=(0,s.hb)(e=>{c.current({root:l.current,repo:e})},[]);return{activeRepo:n&&"object"==typeof n&&n.root===o&&"string"==typeof n.repo&&n.repo?n.repo:".",setActiveRepo:d,ready:i}}function h(e,t){let n=e??"",r=(0,s.hb)(e=>t?l.subscribe(n,e):()=>{},[n,t]),a=(0,s.hb)(()=>t?l.snapshot(n):i,[n,t]),o=(0,s.rz)(r,a),c=(0,s.hb)(()=>{t&&l.rescan(n)},[n,t]);return{repos:o.repos,scanning:o.scanning,rescan:c}}},rm(e,t,n){let s=(0,n("y").A)({name:"folder-git-2",size:24,node:[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]});n.d(t,{},{A:s})},Wb0(e,t,n){let s=(0,n("y").A)({name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]});n.d(t,{},{A:s})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["mt"],{Ag(e,t,n){var r=n("ix"),a=n("LC"),i=n("bQ"),d=n("Ut"),o=n("NH"),l=n("Yr"),s=n("M4"),g=n("Gt"),c=n("v2");function u(e,{edgePathsClass:t="edges edgePaths"}={}){let n=e.insert("g").attr("class","root"),r=n.insert("g").attr("class","clusters");return{clusters:r,edgePaths:n.insert("g").attr("class",t),edgeLabels:n.insert("g").attr("class","edgeLabels"),nodes:n.insert("g").attr("class","nodes"),rootGroups:n}}async function f(e,t,n){if(t.label){let{shapeSvg:r,bbox:a}=await (0,d.Zk)(e,void 0===n?t:{...t,width:n});t.labelBBox={width:a.width,height:a.height},r.remove()}else t.labelBBox={width:0,height:0}}async function h(e,t,n){let r=await (0,i.on)(e,t,n),a=r.node()?.getBBox()??{width:0,height:0};return t.width=a.width,t.height=a.height,r}function p(e,t,n){let r=e,a=new Set;for(;r;){if(r.dir)return r.dir;if(!r.parentId||a.has(r.parentId))break;a.add(r.parentId),r=t.get(r.parentId)}return n}async function w(e,t,r={}){let i=new c.T({multigraph:!0,compound:!0}),d=[...t.edges],o=(0,l.D7)(),s=u(e),{edgeLabels:g,nodes:b}=s,m=new Map,R=new Map(t.nodes.map(e=>[e.id,e])),y=t.direction,v=null!=e.node();for(let e of(await Promise.all(t.nodes.map(async e=>{if(e.isGroup){if(v){let t=r.unwrapGroupLabels&&"markdown"!==e.labelType;await f(b,e,t?1/0:void 0)}i.setNode(e.id,{...e})}else{if(v){let t=await h(b,e,{config:o,dir:p(e,R,y)});m.set(e.id,t)}i.setNode(e.id,{...e})}})),d))v&&(0,a.a6)(e)&&await (0,a.jP)(g,e),i.setEdge(e.start,e.end,{...e},e.id),t.edges.some(t=>t.id===e.id)||t.edges.push(e);if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:r}=await n.e("0k").then(n.bind(n,"GE"));r(e,t)}return{graph:i,groups:s,nodeElements:m}}(0,g.K)(u,"createLayoutElementGroups"),(0,g.K)(f,"measureGroupLabel"),(0,g.K)(h,"insertMeasuredNode"),(0,g.K)(p,"resolveNodeDir"),(0,g.K)(w,"createGraphWithElements");var b=new Map,m=new Map,R=new Map,y=(0,g.K)(()=>{m.clear(),R.clear(),b.clear()},"clear"),v=(0,g.K)((e,t)=>{let n=m.get(t)||[];return s.R.trace("In isDescendant",t," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),x=(0,g.K)((e,t)=>{let n=m.get(t)||[];return s.R.info("Descendants of ",t," is ",n),s.R.info("Edge is ",e),e.v!==t&&e.w!==t&&(n?n.includes(e.v)||v(e.v,t)||v(e.w,t)||n.includes(e.w):(s.R.debug("Tilt, ",t,",not in descendants"),!1))},"edgeInCluster"),K=(0,g.K)((e,t,n,r)=>{s.R.debug("Copying children of ",e,"root",r,"data",t.node(e),r);let a=t.children(e)||[];e!==r&&a.push(e),s.R.debug("Copying (nodes) clusterId",e,"nodes",a),a.forEach(a=>{if(t.children(a).length>0)K(a,t,n,r);else{let i=t.node(a);s.R.info("cp ",a," to ",r," with parent ",e),n.setNode(a,i),r!==t.parent(a)&&(s.R.debug("Setting parent",a,t.parent(a)),n.setParent(a,t.parent(a))),e!==r&&a!==e?(s.R.debug("Setting parent",a,e),n.setParent(a,e)):(s.R.info("In copy ",e,"root",r,"data",t.node(e),r),s.R.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==r,"node!==clusterId",a!==e));let d=t.edges(a);s.R.debug("Copying Edges",d),d.forEach(a=>{s.R.info("Edge",a);let i=t.edge(a.v,a.w,a.name);s.R.info("Edge data",i,r);try{x(a,r)?(s.R.info("Copying as ",a.v,a.w,i,a.name),n.setEdge(a.v,a.w,i,a.name),s.R.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):s.R.info("Skipping copy of edge ",a.v,"--\x3e",a.w," rootId: ",r," clusterId:",e)}catch(e){s.R.error(e)}})}s.R.debug("Removing node",a),t.removeNode(a)})},"copy"),C=(0,g.K)((e,t)=>{let n=t.children(e),r=[...n];for(let a of n)R.set(a,e),r=[...r,...C(a,t)];return r},"extractDescendants"),E=(0,g.K)((e,t,n)=>{let r=e.edges().filter(e=>e.v===t||e.w===t),a=e.edges().filter(e=>e.v===n||e.w===n),i=r.map(e=>({v:e.v===t?n:e.v,w:e.w===t?t:e.w})),d=a.map(e=>({v:e.v,w:e.w}));return i.filter(e=>d.some(t=>e.v===t.v&&e.w===t.w))},"findCommonEdges"),L=(0,g.K)((e,t,n)=>{let r,a=t.children(e);if(s.R.trace("Searching children of id ",e,a),a.length<1)return e;for(let e of a){let a=L(e,t,n),i=E(t,n,a);if(a)if(!(i.length>0))return a;else r=a}return r},"findNonClusterChild"),N=(0,g.K)(e=>b.has(e)&&b.get(e).externalConnections&&b.has(e)?b.get(e).id:e,"getAnchorId"),k=(0,g.K)((e,t)=>{if(!e||t>10)return void s.R.debug("Opting out, no graph ");for(let t of(s.R.debug("Opting in, graph "),e.nodes().forEach(function(t){e.children(t).length>0&&(s.R.debug("Cluster identified",t," Replacement id in edges: ",L(t,e,t)),m.set(t,C(t,e)),b.set(t,{id:L(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){let n=e.children(t),r=e.edges();n.length>0?(s.R.debug("Cluster identified",t,m),r.forEach(e=>{v(e.v,t)^v(e.w,t)&&(s.R.debug("Edge: ",e," leaves cluster ",t),s.R.debug("Descendants of XXX ",t,": ",m.get(t)),b.get(t).externalConnections=!0)})):s.R.debug("Not a cluster ",t,m)}),b.keys())){let n=b.get(t).id,r=e.parent(n);r!==t&&b.has(r)&&!b.get(r).externalConnections&&(b.get(t).id=r);let a=e.edges().some(e=>e.v===t);if(n&&b.get(t)?.externalConnections&&a&&S(e,n,t)){let r=T(e,t,e.parent(n));r&&(b.get(t).id=r)}}e.edges().forEach(function(t){let n=e.edge(t);s.R.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),s.R.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let r=t.v,a=t.w;if(s.R.debug("Fix XXX",b,"ids:",t.v,t.w,"Translating: ",b.get(t.v)," --- ",b.get(t.w)),b.get(t.v)||b.get(t.w)){if(s.R.debug("Fixing and trying - removing XXX",t.v,t.w,t.name),r=N(t.v),a=N(t.w),e.removeEdge(t.v,t.w,t.name),r!==t.v){let a=e.parent(r);b.get(a).externalConnections=!0,n.fromCluster=t.v}if(a!==t.w){let r=e.parent(a);b.get(r).externalConnections=!0,n.toCluster=t.w}s.R.debug("Fix Replacing with XXX",r,a,t.name),e.setEdge(r,a,n,t.name)}}),I(e,0),s.R.trace(b)},"adjustClustersAndEdges"),I=(0,g.K)((e,t)=>{if(t>10)return void s.R.error("Bailing out");let n=e.nodes(),r=!1;for(let t of n){let n=e.children(t);r=r||n.length>0}if(!r)return void s.R.debug("Done, no node has children",e.nodes());for(let r of(s.R.debug("Nodes = ",n,t),n))if(s.R.debug("Extracting node",r,b,b.has(r)&&!b.get(r).externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",t),b.has(r))if(!b.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){s.R.debug("Cluster without external connections, without a parent and with children",r,t);let n="TB"===e.graph().rankdir?"LR":"TB";b.get(r)?.clusterData?.dir&&(n=b.get(r).clusterData.dir,s.R.debug("Fixing dir",b.get(r).clusterData.dir,n));let a=new c.T({multigraph:!0,compound:!0}).setGraph({rankdir:n,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});K(r,e,a,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:b.get(r).clusterData,label:b.get(r).label,graph:a})}else s.R.debug("Cluster ** ",r," **not meeting the criteria !externalConnections:",!b.get(r).externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),t),s.R.debug(b);else s.R.debug("Not a cluster",r,t);for(let r of(n=e.nodes(),s.R.debug("New list of nodes",n),n)){let n=e.node(r);s.R.debug(" Now next level",r,n),n?.clusterNode&&I(n.graph,t+1)}},"extractor"),D=(0,g.K)((e,t)=>{if(0===t.length)return[];let n=Object.assign([],t);return t.forEach(t=>{let r=e.children(t),a=D(e,r);n=[...n,...a]}),n},"sorter"),P=(0,g.K)(e=>D(e,e.children()),"sortNodesByHierarchy"),S=(0,g.K)((e,t,n)=>{let r=e.parent(t);for(;r&&r!==n;){let t=b.get(r);if(t&&!t.externalConnections)return!0;r=e.parent(r)}return!1},"isNodeInExtractableCluster"),T=(0,g.K)((e,t,n)=>{for(let r of e.children(t)??[]){if(r===n||v(r,n))continue;let a=L(r,e,t);if(a&&!S(e,a,t))return a}return null},"findSafeAnchorNode");function M({prepareLayout:e,measureLayout:t,runLayoutCore:n,paintLayout:r,afterPaint:i,paintOptions:d}){let o=t??B;return(0,g.K)(async function(t,l,s,g){let c=l.select("g");(s?.insertMarkers??a.g0)(c,t.markers,t.type,t.diagramId),X();let u={element:c,helpers:s,options:g};u.preparedLayout=await e?.(t,u);let f=await o(t,u),h=await n(t,u),p={...u,measure:f};r?await r(t,p,h):await U(t,p,d),await i?.(t,p,h)},"render")}function X(){(0,i.IU)(),(0,a.IU)(),(0,r.IU)(),y()}async function B(e,{element:t},n){return await w(t,e,n)}async function U(e,t,n={}){let{measure:r}=t,{groups:a}=r;for(let r of n.getNodes?.(e,t)??e.nodes)n.skipNode?.(r,t)||await _(a,r,t,n);let i=$(e.nodes);for(let r of e.edges)O(r,n)||await j(a,r,i,e,n,t)}async function _(e,t,n,a){t.clusterNode?(0,i.U_)(t):G(t,n,a)?await (0,r.U)(e.clusters,t):(0,i.U_)(t)}function G(e,t,n){return!0===e.isGroup&&(n.isCluster?.(e,t)??!0)}function $(e){let t=new Map;for(let n of e)n?.id&&t.set(n.id,n);return t}function O(e,t){return e.isLayoutOnly||!!t.skipEdge?.(e)}async function j(e,t,n,r,i,d){let o=(0,a.Jo)(e.edgePaths,{...t},i.clusterDb??new Map,r.type,Q(t.start,t,n,d,i),Q(t.end,t,n,d,i),r.diagramId,A(t,i));(0,a.a6)(t)&&(a.lP.has(t.id)||await (0,a.jP)(e.edgeLabels,t),F(t,o))}function Q(e,t,n,r,a){return a.getEdgeNode?.(e,t,r)??(e?n.get(e)??{}:{})}function A(e,t){return"function"==typeof t.skipIntersect?t.skipIntersect(e):t.skipIntersect??!1}function F(e,t){let n=t?.updatedPath??t?.originalPath,r=(0,l.zj)(),{subGraphTitleTotalMargin:d}=(0,i.Oi)({flowchart:r.flowchart??{}});if(e.label){let r=a.lP.get(e.id),i=e.x,l=e.y;if(n){let r=o._K.calcLabelPosition(n);s.R.debug("Moving label "+e.label+" from (",i,",",l,") to (",r.x,",",r.y,") abc88"),t?.updatedPath&&(i=r.x,l=r.y)}r.attr("transform",`translate(${i}, ${l+d/2})`)}if(e?.startLabelLeft){let t=a.UQ.get(e.id).startLeft,r=e?.x,i=e?.y;if(n){let t=o._K.calcTerminalLabelPosition(10*!!e.arrowTypeStart,"start_left",n);r=t.x,i=t.y}t.attr("transform",`translate(${r}, ${i})`)}if(e.startLabelRight){let t=a.UQ.get(e.id).startRight,r=e.x,i=e.y;if(n){let t=o._K.calcTerminalLabelPosition(10*!!e.arrowTypeStart,"start_right",n);r=t.x,i=t.y}t.attr("transform",`translate(${r}, ${i})`)}if(e.endLabelLeft){let t=a.UQ.get(e.id).endLeft,r=e.x,i=e.y;if(n){let t=o._K.calcTerminalLabelPosition(10*!!e.arrowTypeEnd,"end_left",n);r=t.x,i=t.y}t.attr("transform",`translate(${r}, ${i})`)}if(e.endLabelRight){let t=a.UQ.get(e.id).endRight,r=e.x,i=e.y;if(n){let t=o._K.calcTerminalLabelPosition(10*!!e.arrowTypeEnd,"end_right",n);r=t.x,i=t.y}t.attr("transform",`translate(${r}, ${i})`)}}(0,g.K)(M,"createCommonLayoutRenderer"),(0,g.K)(X,"clearLayoutRenderState"),(0,g.K)(B,"defaultMeasureLayout"),(0,g.K)(U,"paintLayoutData"),(0,g.K)(_,"paintLayoutNode"),(0,g.K)(G,"shouldPaintAsCluster"),(0,g.K)($,"buildNodeLookup"),(0,g.K)(O,"shouldSkipPaintEdge"),(0,g.K)(j,"paintLayoutEdge"),(0,g.K)(Q,"getRenderedNode"),(0,g.K)(A,"shouldSkipIntersect"),(0,g.K)(F,"positionRenderedEdgeLabel"),n.d(t,{B:()=>u,OS:()=>k,QV:()=>B,dc:()=>L,ju:()=>b,sc:()=>P,sv:()=>h,xY:()=>M})}}]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["oc"],{WK(r,t,e){var a=e("a6");e("VV8"),e("OT"),e("WJ"),e("Wf"),e("mW"),e("Q"),e("v0"),e("ix"),e("LC"),e("
|
|
1
|
+
"use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["oc"],{WK(r,t,e){var a=e("a6");e("VV8"),e("OT"),e("WJ"),e("Wf"),e("mW"),e("Q"),e("v0"),e("ix"),e("LC"),e("bQ"),e("Ut"),e("PF"),e("iV"),e("h5"),e("pK"),e("NH"),e("Yr"),e("M4");var s=(0,e("Gt").K)(r=>`${(0,a.tM)(r)}
|
|
2
2
|
.swimlane.cluster:not([data-color-id]) rect {
|
|
3
3
|
stroke: ${r.clusterBorder} !important;
|
|
4
4
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
stroke: revert;
|
|
13
13
|
stroke-width: revert;
|
|
14
14
|
}
|
|
15
|
-
`,"getIconStyles");s.d(t,{o:()=>i})},v0(e,t,s){var i=s("Yr"),r=s("Gt"),a=s("tP"),n=s("El"),o=(0,r.K)((e,t)=>{let s=e.append("rect");if(s.attr("x",t.x),s.attr("y",t.y),s.attr("fill",t.fill),s.attr("stroke",t.stroke),s.attr("width",t.width),s.attr("height",t.height),t.name&&s.attr("name",t.name),t.rx&&s.attr("rx",t.rx),t.ry&&s.attr("ry",t.ry),void 0!==t.attrs)for(let e in t.attrs)s.attr(e,t.attrs[e]);return t.class&&s.attr("class",t.class),s},"drawRect"),l=(0,r.K)((e,t)=>{o(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"}).lower()},"drawBackgroundRect"),u=(0,r.K)((e,t)=>{let s=t.text.replace(i.H1," "),r=e.append("text");r.attr("x",t.x),r.attr("y",t.y),r.attr("class","legend"),r.style("text-anchor",t.anchor),t.class&&r.attr("class",t.class);let a=r.append("tspan");return a.attr("x",t.x+2*t.textMargin),a.text(s),r},"drawText"),d=(0,r.K)((e,t,s,i)=>{let r=e.append("image");r.attr("x",t),r.attr("y",s);let n=(0,a.J)(i);r.attr("xlink:href",n)},"drawImage"),h=(0,r.K)((e,t,s,i)=>{let r=e.append("use");r.attr("x",t),r.attr("y",s);let n=(0,a.J)(i);r.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),c=(0,r.K)(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),p=(0,r.K)(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),g=(0,r.K)(()=>{let e=(0,n.Ltv)(".mermaidTooltip");return e.empty()&&(e=(0,n.Ltv)("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),e},"createTooltip");s.d(t,{CP:()=>h,Ck:()=>g,HT:()=>p,PB:()=>c,aC:()=>d,lC:()=>l,m:()=>u,tk:()=>o})},WJ(e,t,s){var i=s("Yr"),r=s("M4"),a=s("Gt"),n=(0,a.K)((e,t,s,a)=>{e.attr("class",s);let{width:n,height:u,x:d,y:h}=o(e,t);(0,i.a$)(e,u,n,a);let c=l(d,h,n,u,t);e.attr("viewBox",c),r.R.debug(`viewBox configured: ${c} with padding: ${t}`)},"setupViewPortForSVG"),o=(0,a.K)((e,t)=>{let s=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:s.width+2*t,height:s.height+2*t,x:s.x,y:s.y}},"calculateDimensionsWithPadding"),l=(0,a.K)((e,t,s,i,r)=>`${e-r} ${t-r} ${s} ${i}`,"createViewBox");s.d(t,{P:()=>n})},OT(e,t,s){var i=s("Gt"),r=s("El"),a=(0,i.K)((e,t)=>{let s;return"sandbox"===t&&(s=(0,r.Ltv)("#i"+e)),("sandbox"===t?(0,r.Ltv)(s.nodes()[0].contentDocument.body):(0,r.Ltv)("body")).select(`[id="${e}"]`)},"getDiagramElement");s.d(t,{A:()=>a})},WU(e,t,s){var i=s("VV8"),r=s("OT"),a=s("WJ"),n=s("Wf"),o=s("mW");s("Q");var l=s("v0");s("ix"),s("LC"),s("bQ1");var u=s("Ut");s("PF"),s("iV"),s("h5");var d=s("pK"),h=s("NH"),c=s("Yr"),p=s("M4"),g=s("Gt"),f=s("El"),m=s("L"),y=s("gj"),b=s("Cv"),A={SHAPE_UNSUPPORTED:"SHAPE_UNSUPPORTED",SHAPE_REMOVED:"SHAPE_REMOVED",EDGE_OPERATOR_UNSUPPORTED:"EDGE_OPERATOR_UNSUPPORTED",REFERENCE_EDGE_LABEL_REJECTED:"REFERENCE_EDGE_LABEL_REJECTED",CONNECTOR_REF_UNRESOLVED:"CONNECTOR_REF_UNRESOLVED",CONNECTOR_REF_NOT_A_CONNECTOR:"CONNECTOR_REF_NOT_A_CONNECTOR",METADATA_KEY_MISAPPLIED:"METADATA_KEY_MISAPPLIED",DUPLICATE_ID_NODE:"DUPLICATE_ID_NODE",RESERVED_SYNTHETIC_ID:"RESERVED_SYNTHETIC_ID",CONTAINMENT_VIOLATION:"CONTAINMENT_VIOLATION",EDGE_SEMANTIC_CONTRADICTION:"EDGE_SEMANTIC_CONTRADICTION",FLOW_NO_INPUT:"FLOW_NO_INPUT"},k=new Set([A.SHAPE_UNSUPPORTED,A.SHAPE_REMOVED,A.CONTAINMENT_VIOLATION]);new Set(Object.values(A).filter(e=>!k.has(e)));var E=new Map([["task","roundedRect"],["tool","subroutine"],["input","lean-right"],["decision","diamond"],["refdoc","lin-doc"],["action","hexagon"],["round","rect"]]),x=new Set(["doc","stadium","terminal","circle","trapezoid","inv_trapezoid","inv-trapezoid","doublecircle","double-circle","typeDeclaration","procs","lean_left","lean-left","in-out","cylinder","ellipse","odd","tag-rect","tagged-rectangle","delay","half-rounded-rectangle","lin-rect","lined-rectangle","win-pane","window-pane","curv-trap","curved-trapezoid"]),C=new Set(["roundedRect","subroutine","subprocess","subproc","framed-rectangle","lean-right","diamond","lin-doc","lined-document","hexagon","hex","connector","collapsedGroup"]),S="roundedRect";function T(e){return e?E.get(e)??e:e}function D(e,t){for(let s of e)if(!s.isGroup){if(s.shape&&"squareRect"!==s.shape&&"rect"!==s.shape||(s.shape=S),x.has(s.shape)){let e=`shape "${s.shape}" was removed in v0.8.1, using "${S}"`;t?.emitError?t.emitError("SHAPE_REMOVED",e,{nodeId:s.id}):p.R.warn(`agentflow: ${e}`),s.shape=S;continue}if(!C.has(s.shape)){let e=`shape "${s.shape}" is not supported, using "${S}"`;t?.emitWarning?t.emitWarning("SHAPE_UNSUPPORTED",e,{nodeId:s.id}):p.R.warn(`agentflow: ${e}`),s.shape=S}}}(0,g.K)(T,"resolveShapeAlias"),(0,g.K)(D,"normaliseNodeShapes");var _=new Map([["tool",0],["task",1],["decision",2],["input",3],["refdoc",4],["connector",5],["action",6]]),v=_.size,F=(0,g.K)(e=>`af-kind-${e}`,"kindClass"),$=[..._.keys()],L=(0,g.K)(e=>Math.max(1,e-v),"containerSlotCount"),B=(0,g.K)((e,t)=>{let s=v+e%L(t);return t>0?s%t:s},"containerSlot");function w(e,t,s){let i=(0,c.D7)().themeVariables?.borderColorArray,r=Array.isArray(i)?i.length:0,a=s.size;for(let i of e??[]){if(i.isGroup||"collapsedGroup"===i.shape){let e=s.get(String(i.id))??a++;i.colorIndex=B(e,r);continue}let e=t(String(i.id));e&&_.has(e)&&(i.cssClasses=`${i.cssClasses??""} ${F(e)}`.replace(/\s+/g," ").trim())}}(0,g.K)(w,"assignColorSlots");var I="agentflow-",M=new Set(["shape","view","icon","img","form","pos","w","h","class","style","labelType"]),N=new Set(["subroutine","subprocess","subproc","framed-rectangle","tool"]),R={flow:"flowGroup"};function O(e){if(Array.isArray(e))return e.map(e=>O(e));if(null===e||"object"!=typeof e)return e;let t={};for(let s of Object.keys(e))"__proto__"!==s&&"constructor"!==s&&"prototype"!==s&&(t[s]=O(e[s]));return t}function V(e){let t,s=!1,i=!1,r=0,a=[];for(let n of e.split("\n")){if(void 0!==t){let e=n.length-n.trimStart().length;if(""===n.trim()||e>t){a.push(n);continue}t=void 0}let e=-1;for(let t=0;t<n.length;t++){let a=n[t];if(i)"\\"===a?t++:'"'===a&&(i=!1);else if(s)"'"===a&&(s=!1);else if('"'===a)i=!0;else if("'"===a)s=!0;else if("#"===a&&(0===t||" "===n[t-1]||" "===n[t-1])){e=t;break}else"["===a||"{"===a?r++:("]"===a||"}"===a)&&(r=Math.max(0,r-1))}if(s||i||r>0){a.push(n);continue}let o=e>=0?n.slice(0,e):n,l=e>=0?n.slice(e):"";if(/:\s*[>|][\d+-]*\s*$/.test(o)){t=n.length-n.trimStart().length,a.push(n);continue}a.push(o.replace(/,([\t ]*)$/,"$1")+l)}return a.join("\n")}(0,g.K)(O,"stripPrototypeKeys"),(0,g.K)(V,"stripLineTrailingCommas");var P=class{constructor(){this.vertexCounter=0,this.config=(0,c.D7)(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.diagramId="",this.preserveCommentsWhenParsing=!0,this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,this.funs=[],this.setAccTitle=c.SV,this.setAccDescription=c.EI,this.setDiagramTitle=c.ke,this.getAccTitle=c.iN,this.getAccDescription=c.m7,this.getDiagramTitle=c.ab,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addGlobal=this.addGlobal.bind(this),this.addConnector=this.addConnector.bind(this),this.addConnectorMapping=this.addConnectorMapping.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.setFrontmatterLineOffset=this.setFrontmatterLineOffset.bind(this),this.addVertexMapping=this.addVertexMapping.bind(this),this.extendVertexMapping=this.extendVertexMapping.bind(this),this.addEdgeMapping=this.addEdgeMapping.bind(this),this.addSubgraphMapping=this.addSubgraphMapping.bind(this),this.emitWarning=this.emitWarning.bind(this),this.emitError=this.emitError.bind(this),this.getDiagnostics=this.getDiagnostics.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{(0,g.K)(this,"AgentFlowDB")}sanitizeText(e){return c.Y2.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let t of this.vertices.values())if(t.id===e)return this.diagramId?`${this.diagramId}-${t.domId}`:t.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,t,s,i,r,a,o={},l,d){let h,p,g;if(!e||0===e.trim().length)return;if(void 0!==l){let e;e=l.includes("\n")?l+"\n":"{\n"+l+"\n}";try{h=(0,n.H)(e,{schema:n.r})??{}}catch(t){let e=l.includes("\n")?V(l):l;if(e!==l)try{h=(0,n.H)(e+"\n",{schema:n.r})??{}}catch{this.rethrowMetadataYamlError(t,l,d)}else this.rethrowMetadataYamlError(t,l,d)}h=O(h)}if(h&&"string"==typeof h.shape){let e=h,t=T(p=e.shape);t&&t!==p&&(e.shape=t)}let f=this.subGraphLookup.get(e);if(f&&h){f.metadata={...f.metadata,...h};return}let m=this.connectors.get(e);if(m&&h){m.metadata={...m.metadata,...h};return}if("connectors"===e)return;let y=this.edges.find(t=>t.id===e);if(y){let e=h;e?.animate!==void 0&&(y.animate=e.animate),e?.animation!==void 0&&(y.animation=e.animation),e?.curve!==void 0&&(y.interpolate=e.curve),h&&(y.metadata={...y.metadata,...h});return}let b=this.vertices.get(e);if(void 0===b&&(b={id:e,labelType:"text",domId:I+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,b)),this.vertexCounter++,void 0!==t?(this.config=(0,c.D7)(),g=this.sanitizeText(t.text.trim()),b.labelType=t.type,g.startsWith('"')&&g.endsWith('"')&&(g=g.substring(1,g.length-1)),b.text=g):void 0===b.text&&(b.text=e),void 0!==s&&(b.type=s),null!=i&&i.forEach(e=>{b.styles.push(e)}),null!=r&&r.forEach(e=>{b.classes.push(e)}),void 0!==a&&(b.dir=a),void 0===b.props?b.props=o:void 0!==o&&Object.assign(b.props,o),h){if(b.metadata={...b.metadata,...h},h.shape){let e=p??h.shape;if("string"!=typeof e)throw this.positionedShapeError(`No such shape: ${JSON.stringify(e)}.`,d);if(e!==e.toLowerCase()||e.includes("_"))throw this.positionedShapeError(`No such shape: ${e}. Shape names should be lowercase.`,d);if(!(0,u.aP)(h.shape))throw this.positionedShapeError(`No such shape: ${h.shape}.`,d);b.type=h?.shape}h?.label&&(b.text=this.sanitizeText(h.label),b.labelType=this.sanitizeNodeLabelType(h?.labelType))}}positionedShapeError(e,t){let s=Error(e);if(!t)return s;let i=t.first_line+this.frontmatterLineOffset;return Object.assign(s,{hash:{text:"",token:null,line:i-1,loc:{first_line:i,last_line:t.last_line+this.frontmatterLineOffset,first_column:t.first_column,last_column:t.last_column},expected:[]}}),s}rethrowMetadataYamlError(e,t,s){let i;if(!e||"YAMLException"!==e.name||!e.mark||!s)throw e;try{let r=!t.includes("\n"),a=r?"{\n"+t+"\n}":t+"\n",n=s.first_line+this.frontmatterLineOffset,o=s.first_column+2,l=(0,g.K)((e,t)=>r?{line:n,column:o+(1===e?t:0)}:{line:n+e,column:0===e?o+t:t},"toSource"),u=l(e.mark.line,e.mark.column),d=e.reason??(e.message??"").split("\n")[0].replace(/\s*\(\d+:\d+\)\s*$/,""),h=a.split("\n"),c=[];if(r)c.push(1);else for(let t=e.mark.line-1;t<=e.mark.line+1;t++)t<0||t>=h.length||(t!==h.length-1||""!==h[t]||t===e.mark.line)&&c.push(t);let p=Math.max(...c.map(e=>String(l(e,0).line).length)),f=[];for(let t of c){let s=l(t,0).line,i=` ${String(s).padStart(p)} | `;f.push(i+h[t].replace(/\t/g,"→")),t===e.mark.line&&f.push("-".repeat(i.length+e.mark.column)+"^")}i={message:`${d} (${u.line}:${u.column+1})
|
|
15
|
+
`,"getIconStyles");s.d(t,{o:()=>i})},v0(e,t,s){var i=s("Yr"),r=s("Gt"),a=s("tP"),n=s("El"),o=(0,r.K)((e,t)=>{let s=e.append("rect");if(s.attr("x",t.x),s.attr("y",t.y),s.attr("fill",t.fill),s.attr("stroke",t.stroke),s.attr("width",t.width),s.attr("height",t.height),t.name&&s.attr("name",t.name),t.rx&&s.attr("rx",t.rx),t.ry&&s.attr("ry",t.ry),void 0!==t.attrs)for(let e in t.attrs)s.attr(e,t.attrs[e]);return t.class&&s.attr("class",t.class),s},"drawRect"),l=(0,r.K)((e,t)=>{o(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"}).lower()},"drawBackgroundRect"),u=(0,r.K)((e,t)=>{let s=t.text.replace(i.H1," "),r=e.append("text");r.attr("x",t.x),r.attr("y",t.y),r.attr("class","legend"),r.style("text-anchor",t.anchor),t.class&&r.attr("class",t.class);let a=r.append("tspan");return a.attr("x",t.x+2*t.textMargin),a.text(s),r},"drawText"),d=(0,r.K)((e,t,s,i)=>{let r=e.append("image");r.attr("x",t),r.attr("y",s);let n=(0,a.J)(i);r.attr("xlink:href",n)},"drawImage"),h=(0,r.K)((e,t,s,i)=>{let r=e.append("use");r.attr("x",t),r.attr("y",s);let n=(0,a.J)(i);r.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),c=(0,r.K)(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),p=(0,r.K)(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),g=(0,r.K)(()=>{let e=(0,n.Ltv)(".mermaidTooltip");return e.empty()&&(e=(0,n.Ltv)("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),e},"createTooltip");s.d(t,{CP:()=>h,Ck:()=>g,HT:()=>p,PB:()=>c,aC:()=>d,lC:()=>l,m:()=>u,tk:()=>o})},WJ(e,t,s){var i=s("Yr"),r=s("M4"),a=s("Gt"),n=(0,a.K)((e,t,s,a)=>{e.attr("class",s);let{width:n,height:u,x:d,y:h}=o(e,t);(0,i.a$)(e,u,n,a);let c=l(d,h,n,u,t);e.attr("viewBox",c),r.R.debug(`viewBox configured: ${c} with padding: ${t}`)},"setupViewPortForSVG"),o=(0,a.K)((e,t)=>{let s=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:s.width+2*t,height:s.height+2*t,x:s.x,y:s.y}},"calculateDimensionsWithPadding"),l=(0,a.K)((e,t,s,i,r)=>`${e-r} ${t-r} ${s} ${i}`,"createViewBox");s.d(t,{P:()=>n})},OT(e,t,s){var i=s("Gt"),r=s("El"),a=(0,i.K)((e,t)=>{let s;return"sandbox"===t&&(s=(0,r.Ltv)("#i"+e)),("sandbox"===t?(0,r.Ltv)(s.nodes()[0].contentDocument.body):(0,r.Ltv)("body")).select(`[id="${e}"]`)},"getDiagramElement");s.d(t,{A:()=>a})},WU(e,t,s){var i=s("VV8"),r=s("OT"),a=s("WJ"),n=s("Wf"),o=s("mW");s("Q");var l=s("v0");s("ix"),s("LC"),s("bQ");var u=s("Ut");s("PF"),s("iV"),s("h5");var d=s("pK"),h=s("NH"),c=s("Yr"),p=s("M4"),g=s("Gt"),f=s("El"),m=s("Lu"),y=s("gj"),b=s("Cv"),A={SHAPE_UNSUPPORTED:"SHAPE_UNSUPPORTED",SHAPE_REMOVED:"SHAPE_REMOVED",EDGE_OPERATOR_UNSUPPORTED:"EDGE_OPERATOR_UNSUPPORTED",REFERENCE_EDGE_LABEL_REJECTED:"REFERENCE_EDGE_LABEL_REJECTED",CONNECTOR_REF_UNRESOLVED:"CONNECTOR_REF_UNRESOLVED",CONNECTOR_REF_NOT_A_CONNECTOR:"CONNECTOR_REF_NOT_A_CONNECTOR",METADATA_KEY_MISAPPLIED:"METADATA_KEY_MISAPPLIED",DUPLICATE_ID_NODE:"DUPLICATE_ID_NODE",RESERVED_SYNTHETIC_ID:"RESERVED_SYNTHETIC_ID",CONTAINMENT_VIOLATION:"CONTAINMENT_VIOLATION",EDGE_SEMANTIC_CONTRADICTION:"EDGE_SEMANTIC_CONTRADICTION",FLOW_NO_INPUT:"FLOW_NO_INPUT"},k=new Set([A.SHAPE_UNSUPPORTED,A.SHAPE_REMOVED,A.CONTAINMENT_VIOLATION]);new Set(Object.values(A).filter(e=>!k.has(e)));var E=new Map([["task","roundedRect"],["tool","subroutine"],["input","lean-right"],["decision","diamond"],["refdoc","lin-doc"],["action","hexagon"],["round","rect"]]),x=new Set(["doc","stadium","terminal","circle","trapezoid","inv_trapezoid","inv-trapezoid","doublecircle","double-circle","typeDeclaration","procs","lean_left","lean-left","in-out","cylinder","ellipse","odd","tag-rect","tagged-rectangle","delay","half-rounded-rectangle","lin-rect","lined-rectangle","win-pane","window-pane","curv-trap","curved-trapezoid"]),C=new Set(["roundedRect","subroutine","subprocess","subproc","framed-rectangle","lean-right","diamond","lin-doc","lined-document","hexagon","hex","connector","collapsedGroup"]),S="roundedRect";function T(e){return e?E.get(e)??e:e}function D(e,t){for(let s of e)if(!s.isGroup){if(s.shape&&"squareRect"!==s.shape&&"rect"!==s.shape||(s.shape=S),x.has(s.shape)){let e=`shape "${s.shape}" was removed in v0.8.1, using "${S}"`;t?.emitError?t.emitError("SHAPE_REMOVED",e,{nodeId:s.id}):p.R.warn(`agentflow: ${e}`),s.shape=S;continue}if(!C.has(s.shape)){let e=`shape "${s.shape}" is not supported, using "${S}"`;t?.emitWarning?t.emitWarning("SHAPE_UNSUPPORTED",e,{nodeId:s.id}):p.R.warn(`agentflow: ${e}`),s.shape=S}}}(0,g.K)(T,"resolveShapeAlias"),(0,g.K)(D,"normaliseNodeShapes");var _=new Map([["tool",0],["task",1],["decision",2],["input",3],["refdoc",4],["connector",5],["action",6]]),v=_.size,F=(0,g.K)(e=>`af-kind-${e}`,"kindClass"),$=[..._.keys()],L=(0,g.K)(e=>Math.max(1,e-v),"containerSlotCount"),B=(0,g.K)((e,t)=>{let s=v+e%L(t);return t>0?s%t:s},"containerSlot");function w(e,t,s){let i=(0,c.D7)().themeVariables?.borderColorArray,r=Array.isArray(i)?i.length:0,a=s.size;for(let i of e??[]){if(i.isGroup||"collapsedGroup"===i.shape){let e=s.get(String(i.id))??a++;i.colorIndex=B(e,r);continue}let e=t(String(i.id));e&&_.has(e)&&(i.cssClasses=`${i.cssClasses??""} ${F(e)}`.replace(/\s+/g," ").trim())}}(0,g.K)(w,"assignColorSlots");var I="agentflow-",M=new Set(["shape","view","icon","img","form","pos","w","h","class","style","labelType"]),N=new Set(["subroutine","subprocess","subproc","framed-rectangle","tool"]),R={flow:"flowGroup"};function O(e){if(Array.isArray(e))return e.map(e=>O(e));if(null===e||"object"!=typeof e)return e;let t={};for(let s of Object.keys(e))"__proto__"!==s&&"constructor"!==s&&"prototype"!==s&&(t[s]=O(e[s]));return t}function V(e){let t,s=!1,i=!1,r=0,a=[];for(let n of e.split("\n")){if(void 0!==t){let e=n.length-n.trimStart().length;if(""===n.trim()||e>t){a.push(n);continue}t=void 0}let e=-1;for(let t=0;t<n.length;t++){let a=n[t];if(i)"\\"===a?t++:'"'===a&&(i=!1);else if(s)"'"===a&&(s=!1);else if('"'===a)i=!0;else if("'"===a)s=!0;else if("#"===a&&(0===t||" "===n[t-1]||" "===n[t-1])){e=t;break}else"["===a||"{"===a?r++:("]"===a||"}"===a)&&(r=Math.max(0,r-1))}if(s||i||r>0){a.push(n);continue}let o=e>=0?n.slice(0,e):n,l=e>=0?n.slice(e):"";if(/:\s*[>|][\d+-]*\s*$/.test(o)){t=n.length-n.trimStart().length,a.push(n);continue}a.push(o.replace(/,([\t ]*)$/,"$1")+l)}return a.join("\n")}(0,g.K)(O,"stripPrototypeKeys"),(0,g.K)(V,"stripLineTrailingCommas");var P=class{constructor(){this.vertexCounter=0,this.config=(0,c.D7)(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.diagramId="",this.preserveCommentsWhenParsing=!0,this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,this.funs=[],this.setAccTitle=c.SV,this.setAccDescription=c.EI,this.setDiagramTitle=c.ke,this.getAccTitle=c.iN,this.getAccDescription=c.m7,this.getDiagramTitle=c.ab,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addGlobal=this.addGlobal.bind(this),this.addConnector=this.addConnector.bind(this),this.addConnectorMapping=this.addConnectorMapping.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.setFrontmatterLineOffset=this.setFrontmatterLineOffset.bind(this),this.addVertexMapping=this.addVertexMapping.bind(this),this.extendVertexMapping=this.extendVertexMapping.bind(this),this.addEdgeMapping=this.addEdgeMapping.bind(this),this.addSubgraphMapping=this.addSubgraphMapping.bind(this),this.emitWarning=this.emitWarning.bind(this),this.emitError=this.emitError.bind(this),this.getDiagnostics=this.getDiagnostics.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{(0,g.K)(this,"AgentFlowDB")}sanitizeText(e){return c.Y2.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let t of this.vertices.values())if(t.id===e)return this.diagramId?`${this.diagramId}-${t.domId}`:t.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,t,s,i,r,a,o={},l,d){let h,p,g;if(!e||0===e.trim().length)return;if(void 0!==l){let e;e=l.includes("\n")?l+"\n":"{\n"+l+"\n}";try{h=(0,n.H)(e,{schema:n.r})??{}}catch(t){let e=l.includes("\n")?V(l):l;if(e!==l)try{h=(0,n.H)(e+"\n",{schema:n.r})??{}}catch{this.rethrowMetadataYamlError(t,l,d)}else this.rethrowMetadataYamlError(t,l,d)}h=O(h)}if(h&&"string"==typeof h.shape){let e=h,t=T(p=e.shape);t&&t!==p&&(e.shape=t)}let f=this.subGraphLookup.get(e);if(f&&h){f.metadata={...f.metadata,...h};return}let m=this.connectors.get(e);if(m&&h){m.metadata={...m.metadata,...h};return}if("connectors"===e)return;let y=this.edges.find(t=>t.id===e);if(y){let e=h;e?.animate!==void 0&&(y.animate=e.animate),e?.animation!==void 0&&(y.animation=e.animation),e?.curve!==void 0&&(y.interpolate=e.curve),h&&(y.metadata={...y.metadata,...h});return}let b=this.vertices.get(e);if(void 0===b&&(b={id:e,labelType:"text",domId:I+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,b)),this.vertexCounter++,void 0!==t?(this.config=(0,c.D7)(),g=this.sanitizeText(t.text.trim()),b.labelType=t.type,g.startsWith('"')&&g.endsWith('"')&&(g=g.substring(1,g.length-1)),b.text=g):void 0===b.text&&(b.text=e),void 0!==s&&(b.type=s),null!=i&&i.forEach(e=>{b.styles.push(e)}),null!=r&&r.forEach(e=>{b.classes.push(e)}),void 0!==a&&(b.dir=a),void 0===b.props?b.props=o:void 0!==o&&Object.assign(b.props,o),h){if(b.metadata={...b.metadata,...h},h.shape){let e=p??h.shape;if("string"!=typeof e)throw this.positionedShapeError(`No such shape: ${JSON.stringify(e)}.`,d);if(e!==e.toLowerCase()||e.includes("_"))throw this.positionedShapeError(`No such shape: ${e}. Shape names should be lowercase.`,d);if(!(0,u.aP)(h.shape))throw this.positionedShapeError(`No such shape: ${h.shape}.`,d);b.type=h?.shape}h?.label&&(b.text=this.sanitizeText(h.label),b.labelType=this.sanitizeNodeLabelType(h?.labelType))}}positionedShapeError(e,t){let s=Error(e);if(!t)return s;let i=t.first_line+this.frontmatterLineOffset;return Object.assign(s,{hash:{text:"",token:null,line:i-1,loc:{first_line:i,last_line:t.last_line+this.frontmatterLineOffset,first_column:t.first_column,last_column:t.last_column},expected:[]}}),s}rethrowMetadataYamlError(e,t,s){let i;if(!e||"YAMLException"!==e.name||!e.mark||!s)throw e;try{let r=!t.includes("\n"),a=r?"{\n"+t+"\n}":t+"\n",n=s.first_line+this.frontmatterLineOffset,o=s.first_column+2,l=(0,g.K)((e,t)=>r?{line:n,column:o+(1===e?t:0)}:{line:n+e,column:0===e?o+t:t},"toSource"),u=l(e.mark.line,e.mark.column),d=e.reason??(e.message??"").split("\n")[0].replace(/\s*\(\d+:\d+\)\s*$/,""),h=a.split("\n"),c=[];if(r)c.push(1);else for(let t=e.mark.line-1;t<=e.mark.line+1;t++)t<0||t>=h.length||(t!==h.length-1||""!==h[t]||t===e.mark.line)&&c.push(t);let p=Math.max(...c.map(e=>String(l(e,0).line).length)),f=[];for(let t of c){let s=l(t,0).line,i=` ${String(s).padStart(p)} | `;f.push(i+h[t].replace(/\t/g,"→")),t===e.mark.line&&f.push("-".repeat(i.length+e.mark.column)+"^")}i={message:`${d} (${u.line}:${u.column+1})
|
|
16
16
|
|
|
17
17
|
${f.join("\n")}`,markLine:u.line-1,markColumn:u.column,hash:{text:"",token:null,line:u.line-1,loc:{first_line:u.line,last_line:u.line,first_column:u.column,last_column:u.column+1},expected:[]}}}catch{}throw i&&(e.message=i.message,e.mark.line=i.markLine,e.mark.column=i.markColumn,e.hash=i.hash),e}addSingleLink(e,t,s,i){let r={start:e,end:t,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};p.R.info("abc78 Got edge...",r);let a=s.text;if(void 0!==a&&(r.text=this.sanitizeText(a.text.trim()),r.text.startsWith('"')&&r.text.endsWith('"')&&(r.text=r.text.substring(1,r.text.length-1)),r.labelType=this.sanitizeNodeLabelType(a.type)),void 0!==s&&(r.type=s.type,r.stroke=s.stroke,r.length=s.length>10?10:s.length,s.edgeSemantic&&(r.edgeSemantic=s.edgeSemantic)),i&&!this.edges.some(e=>e.id===i))r.id=i,r.isUserDefinedId=!0;else{let e=this.edges.filter(e=>e.start===r.start&&e.end===r.end);0===e.length?r.id=(0,h.rY)(r.start,r.end,{counter:0,prefix:"L"}):r.id=(0,h.rY)(r.start,r.end,{counter:e.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))p.R.info("Pushing edge..."),this.edges.push(r);else throw Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
|
|
18
18
|
|