elanous 0.2.7 → 0.2.8
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/apps/pwa/out/404/index.html +1 -1
- package/apps/pwa/out/404.html +1 -1
- package/apps/pwa/out/_next/static/chunks/4836-3084c58c1725a40b.js +1 -0
- package/apps/pwa/out/_next/static/chunks/7032-f4ef698518fba61c.js +1 -0
- package/apps/pwa/out/_next/static/chunks/8067-d976b441a104ab74.js +1 -0
- package/apps/pwa/out/_next/static/chunks/8519-5632377cce994f86.js +1 -0
- package/apps/pwa/out/_next/static/chunks/8894-7317998f6cb97d8c.js +1 -0
- package/apps/pwa/out/_next/static/chunks/9740-8f5ff96c522b5f55.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/approvals/page-9aa47b0bc6d570ff.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/autopilot/page-f4d2ecbbae6088d6.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/board/page-2053e49930c82748.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/botlab/{page-624f7a2f89b60c8f.js → page-d4b6df905f185055.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/bots/{page-5a5fb385a4df0ffe.js → page-a70ba27c33003dd0.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/chat/page-186fc6952f027acc.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/consult/{page-7457f52683562161.js → page-18166f885d831d3e.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/control/page-1c9d6cfe68b121c2.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/design-check/page-cbbe03c0da7b081a.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/editor/page-c108ff1fdb665c97.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/exec/{page-b7dcf5d48a854b76.js → page-147a328753d983e2.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/field/{page-51480757e7d68b92.js → page-799395a9df7d95aa.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/intake/page-6a8158b71d1fe9d7.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/layout-9567560270857531.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/live/{page-30533117beb53625.js → page-e7ed3d010153d818.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/market/page-c0c0d19d51342d3e.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/missions/[id]/{page-07267f1391b96aba.js → page-2e002ad8faa43291.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/morning/{page-55d50e9b0006a91d.js → page-b672e02e4bec8deb.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/not-found-1ba4a5d857276334.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/observatory/page-9db2226f38c542fb.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/{page-a7e37af7d0399cb8.js → page-70ee65f5f7a151dc.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/reflection/page-0bb8e43203efb23b.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/scheduler/page-092e1bcf27d751cc.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/sessions/{page-15e5a15db84c56aa.js → page-eb52580c4b75b905.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/settings/devices/{page-a2e572e4511f2a16.js → page-7464c1987dd76e6d.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/settings/{page-dd107bf1c7d52a90.js → page-e573437b0a1c728f.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/setup/done/page-294300625e49e4d3.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/setup/page-085847b088675978.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/share/page-9fe9d38c36999eb4.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/showroom/page-d8ab4d1489223459.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/tasks/page-6141f67f531d8b6a.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/term/page-295a02b1026b8255.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/trace/page-1eb9a0e1e054209d.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/vault/{page-56adbe1a1f1379bd.js → page-82efa177a30f3741.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-d0be51cec4f62606.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/workflows/page-2e367075ffdbc062.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/workspace/{page-5d422f38c052967e.js → page-647ed2b66c1d49f1.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/worktrees/page-ba058c56e38f2792.js +1 -0
- package/apps/pwa/out/_next/static/css/5ef72a618a8994f3.css +1 -0
- package/apps/pwa/out/approvals/index.html +1 -1
- package/apps/pwa/out/approvals/index.txt +13 -13
- package/apps/pwa/out/autopilot/index.html +1 -1
- package/apps/pwa/out/autopilot/index.txt +13 -13
- package/apps/pwa/out/board/index.html +1 -1
- package/apps/pwa/out/board/index.txt +13 -13
- package/apps/pwa/out/botlab/index.html +1 -1
- package/apps/pwa/out/botlab/index.txt +13 -13
- package/apps/pwa/out/bots/index.html +1 -1
- package/apps/pwa/out/bots/index.txt +13 -13
- package/apps/pwa/out/chat/index.html +1 -1
- package/apps/pwa/out/chat/index.txt +13 -13
- package/apps/pwa/out/consult/index.html +1 -1
- package/apps/pwa/out/consult/index.txt +13 -13
- package/apps/pwa/out/control/index.html +1 -1
- package/apps/pwa/out/control/index.txt +13 -13
- package/apps/pwa/out/design-check/index.html +1 -1
- package/apps/pwa/out/design-check/index.txt +13 -13
- package/apps/pwa/out/editor/index.html +1 -1
- package/apps/pwa/out/editor/index.txt +13 -13
- package/apps/pwa/out/exec/index.html +1 -1
- package/apps/pwa/out/exec/index.txt +13 -13
- package/apps/pwa/out/field/index.html +1 -1
- package/apps/pwa/out/field/index.txt +13 -13
- package/apps/pwa/out/healthz +1 -1
- package/apps/pwa/out/index.html +1 -1
- package/apps/pwa/out/index.txt +13 -13
- package/apps/pwa/out/intake/index.html +1 -1
- package/apps/pwa/out/intake/index.txt +13 -13
- package/apps/pwa/out/live/index.html +1 -1
- package/apps/pwa/out/live/index.txt +13 -13
- package/apps/pwa/out/market/index.html +1 -1
- package/apps/pwa/out/market/index.txt +13 -13
- package/apps/pwa/out/missions/placeholder/index.html +1 -1
- package/apps/pwa/out/missions/placeholder/index.txt +13 -13
- package/apps/pwa/out/morning/index.html +1 -1
- package/apps/pwa/out/morning/index.txt +13 -13
- package/apps/pwa/out/observatory/index.html +1 -1
- package/apps/pwa/out/observatory/index.txt +13 -13
- package/apps/pwa/out/reflection/index.html +1 -1
- package/apps/pwa/out/reflection/index.txt +14 -14
- package/apps/pwa/out/scheduler/index.html +1 -1
- package/apps/pwa/out/scheduler/index.txt +13 -13
- package/apps/pwa/out/sessions/index.html +1 -1
- package/apps/pwa/out/sessions/index.txt +13 -13
- package/apps/pwa/out/settings/devices/index.html +1 -1
- package/apps/pwa/out/settings/devices/index.txt +13 -13
- package/apps/pwa/out/settings/index.html +1 -1
- package/apps/pwa/out/settings/index.txt +13 -13
- package/apps/pwa/out/setup/done/index.html +1 -1
- package/apps/pwa/out/setup/done/index.txt +13 -13
- package/apps/pwa/out/setup/index.html +1 -1
- package/apps/pwa/out/setup/index.txt +13 -13
- package/apps/pwa/out/share/index.html +1 -1
- package/apps/pwa/out/share/index.txt +13 -13
- package/apps/pwa/out/showroom/index.html +1 -1
- package/apps/pwa/out/showroom/index.txt +13 -13
- package/apps/pwa/out/tasks/index.html +1 -1
- package/apps/pwa/out/tasks/index.txt +13 -13
- package/apps/pwa/out/term/index.html +1 -1
- package/apps/pwa/out/term/index.txt +13 -13
- package/apps/pwa/out/trace/index.html +1 -1
- package/apps/pwa/out/trace/index.txt +13 -13
- package/apps/pwa/out/vault/index.html +1 -1
- package/apps/pwa/out/vault/index.txt +13 -13
- package/apps/pwa/out/workflows/chat-ui/index.html +1 -1
- package/apps/pwa/out/workflows/chat-ui/index.txt +13 -13
- package/apps/pwa/out/workflows/index.html +1 -1
- package/apps/pwa/out/workflows/index.txt +13 -13
- package/apps/pwa/out/workspace/index.html +1 -1
- package/apps/pwa/out/workspace/index.txt +13 -13
- package/apps/pwa/out/worktrees/index.html +1 -1
- package/apps/pwa/out/worktrees/index.txt +13 -13
- package/graphs/test-diet/recipes.yaml +9 -0
- package/graphs/test-diet/test-diet.yaml +22 -0
- package/package.json +2 -1
- package/persona-presets/_index.yaml +10 -0
- package/persona-presets/_schema.json +146 -0
- package/persona-presets/dana.yaml +26 -0
- package/persona-presets/haru.yaml +27 -0
- package/persona-presets/kai.yaml +27 -0
- package/persona-presets/leo.yaml +27 -0
- package/persona-presets/mira.yaml +30 -0
- package/persona-presets/nari.yaml +27 -0
- package/persona-presets/sora.yaml +27 -0
- package/persona-presets/yuna.yaml +27 -0
- package/plugins/geo-check/graphs/run-step.ts +34 -10
- package/scripts/field-feed/deliver-node.ts +8 -3
- package/scripts/field-feed/lib.ts +2 -0
- package/scripts/install.sh +20 -11
- package/scripts/persona-presets/lint.ts +79 -0
- package/scripts/release-loop/checklist-gate-node.ts +2 -2
- package/scripts/release-loop/gate-node.ts +27 -3
- package/scripts/release-loop/npm-publish-node.ts +10 -4
- package/scripts/release-loop/ops-upgrade-node.ts +11 -3
- package/scripts/release-loop/publish-node.ts +23 -1
- package/scripts/release-loop/shard-plan.ts +17 -0
- package/scripts/storyboard/storyboard.ts +167 -0
- package/scripts/test-diet/lib.ts +88 -0
- package/scripts/test-diet/node.ts +102 -0
- package/src/acp/auth-methods.ts +30 -0
- package/src/acp/server.ts +5 -5
- package/src/channel-import/detect.ts +191 -0
- package/src/channel-import/run.ts +111 -0
- package/src/cli/config-test-sync.ts +4 -0
- package/src/cli/decisions-cli.ts +13 -3
- package/src/cli/doctor-bundle.ts +128 -0
- package/src/cli/doctor-cli.ts +36 -1
- package/src/cli/doctor-local-llm.ts +95 -0
- package/src/cli/import-cli.ts +60 -0
- package/src/cli/mcp-login.ts +13 -4
- package/src/cli/persona-cli.ts +116 -0
- package/src/cli/release-cli.ts +8 -7
- package/src/cli/skills-cli.ts +173 -0
- package/src/cli/start-cli.ts +13 -4
- package/src/codex/setup.ts +15 -13
- package/src/dashboard/index.ts +17 -1
- package/src/dashboard/slash-runtime/dashboard-handlers.ts +2 -2
- package/src/dashboard/slash-runtime/help-from-registry.ts +4 -2
- package/src/decisions/decision-cards.ts +291 -0
- package/src/decisions/decision-ledger.ts +5 -2
- package/src/decisions/discord-decision-cards.ts +133 -0
- package/src/decisions/telegram-decision-cards.ts +100 -0
- package/src/directives/version-at.ts +77 -0
- package/src/discord.ts +17 -0
- package/src/domains/outbound-alert.ts +44 -1
- package/src/domains/repeated-failure.ts +1 -1
- package/src/error-report/report.ts +200 -0
- package/src/exec-requests/planner.ts +8 -2
- package/src/exec-requests/runner.ts +64 -24
- package/src/exec-requests/store.ts +2 -0
- package/src/field/field-feed-auto.ts +48 -0
- package/src/field/field-reel.ts +8 -1
- package/src/hooks/error-report.ts +210 -0
- package/src/hooks/receiver.ts +41 -1
- package/src/import/apply.ts +128 -0
- package/src/import/plan.ts +197 -0
- package/src/index.ts +82 -7
- package/src/input-core/text-entry.ts +13 -5
- package/src/intake-plane/seat-answer.ts +96 -0
- package/src/intake-plane/seat-doc-route.ts +17 -3
- package/src/nexus/api/consult-requests.ts +19 -8
- package/src/nexus/api/error-reports.ts +108 -0
- package/src/nexus/api/http-server.ts +21 -1
- package/src/nexus/api/outbound-report.ts +7 -0
- package/src/nexus/api/running-runs-background.ts +68 -0
- package/src/nexus/api/running-runs-child.ts +6 -0
- package/src/nexus/api/share-captures.ts +91 -0
- package/src/nexus/api/skill-problems.ts +56 -0
- package/src/nexus/api/terminals.ts +24 -8
- package/src/nexus/index.ts +25 -1
- package/src/nexus/setup-status.ts +7 -2
- package/src/oauth/browser-availability.ts +14 -0
- package/src/oauth/codex-quota-policy.ts +16 -0
- package/src/onboarding/continue-here.ts +13 -8
- package/src/onboarding/web-first.ts +8 -1
- package/src/onboarding.ts +66 -12
- package/src/persona/presets.ts +105 -0
- package/src/release-loop/checklist.ts +28 -5
- package/src/self-dev/orchestrate.ts +18 -11
- package/src/shell-env-bootstrap.ts +44 -7
- package/src/skills/connect-claude-plugin.ts +142 -0
- package/src/skills/connect.ts +70 -0
- package/src/skills/index.ts +29 -1
- package/src/skills/repair.ts +124 -0
- package/src/skills/runner.ts +11 -2
- package/src/skills/trigger-extract.ts +1 -1
- package/src/task-orchestrator/surfaces/pod-command-job.ts +16 -8
- package/src/telegram-commands.ts +13 -0
- package/src/telegram.ts +34 -0
- package/src/user-config.ts +111 -13
- package/src/version/packed-revision.json +1 -1
- package/apps/pwa/out/_next/static/chunks/4836-2eba6079f31b88d4.js +0 -1
- package/apps/pwa/out/_next/static/chunks/8067-f74bf14d67ad98f1.js +0 -1
- package/apps/pwa/out/_next/static/chunks/8519-f6b5d8a5833a7603.js +0 -1
- package/apps/pwa/out/_next/static/chunks/8894-e92491a164192cc1.js +0 -1
- package/apps/pwa/out/_next/static/chunks/9740-67051141115ce775.js +0 -1
- package/apps/pwa/out/_next/static/chunks/9804-64c02c3c127d5014.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/approvals/page-d5ebde04844689e6.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/autopilot/page-10ed24f413ed66e9.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/board/page-211810b6c93ab66a.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/chat/page-80497e93a878ddc5.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/control/page-cee86394de407aa6.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/design-check/page-4ff8edab44196b8c.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/editor/page-92e4f44428d5e290.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/intake/page-2a05dfe80c8bdf16.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/layout-d9979633aa82f8e6.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/market/page-f7857826c2f97ad7.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/not-found-9699b1786be6171d.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/observatory/page-43dd772aee8af75f.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/reflection/page-973ab7af59c718b7.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/scheduler/page-a9f8d3865b91e436.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/setup/done/page-d42b99cdfb9f27c6.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/setup/page-2764ff40dad5a995.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/share/page-c5f1152db116ff96.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/showroom/page-f933bca81ea38a6f.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/tasks/page-c1c95739c0bff3b8.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/term/page-a7aaffcf771662d8.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/trace/page-71d18eec33b9c667.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-2c4e59079ee357ac.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/workflows/page-a81f113f3ef89d72.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/worktrees/page-fc27b00e20733146.js +0 -1
- package/apps/pwa/out/_next/static/css/f537bdb19c69306a.css +0 -1
- /package/apps/pwa/out/_next/static/{keajW7DDyghEs1y8oJe6T → lywc8m_HDzH9MKSDQhyEj}/_buildManifest.js +0 -0
- /package/apps/pwa/out/_next/static/{keajW7DDyghEs1y8oJe6T → lywc8m_HDzH9MKSDQhyEj}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8677],{26720:(e,t,r)=>{Promise.resolve().then(r.bind(r,75549))},72030:(e,t,r)=>{"use strict";r.d(t,{$:()=>i});var n=r(41121),l=r(72524),a=r(49155),s=r(82157);let o=(0,a.F)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function i(e){let{className:t,variant:r="default",size:a="default",...i}=e;return(0,n.jsx)(l.$,{"data-slot":"button",className:(0,s.cn)(o({variant:r,size:a,className:t})),...i})}},75549:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>w});var n=r(41121),l=r(91269),a=r(38519),s=r(72030),o=r(71946),i=r(38317),c=r(36296),d=r(80096);let u="wikilink:",x={aliasDivider:"|",pageResolver:e=>[e],hrefTemplate:e=>"".concat(u).concat(encodeURIComponent(e))};function m(e){let{markdown:t,onWikilink:r}=e;return(0,n.jsx)("div",{className:"text-sm text-foreground/90",children:(0,n.jsx)(o.oz,{remarkPlugins:[i.A,d.A,[c.A,x]],components:{h1:e=>{let{children:t}=e;return(0,n.jsx)("h1",{className:"mb-3 mt-5 border-b border-border pb-1 text-2xl font-bold",children:t})},h2:e=>{let{children:t}=e;return(0,n.jsx)("h2",{className:"mb-2 mt-5 text-xl font-bold",children:t})},h3:e=>{let{children:t}=e;return(0,n.jsx)("h3",{className:"mb-2 mt-4 text-lg font-semibold",children:t})},h4:e=>{let{children:t}=e;return(0,n.jsx)("h4",{className:"mb-1 mt-3 text-base font-semibold",children:t})},h5:e=>{let{children:t}=e;return(0,n.jsx)("h5",{className:"mb-1 mt-2 text-sm font-semibold text-muted-foreground",children:t})},h6:e=>{let{children:t}=e;return(0,n.jsx)("h6",{className:"mb-1 mt-2 text-xs font-semibold uppercase text-muted-foreground",children:t})},p:e=>{let{children:t}=e;return(0,n.jsx)("p",{className:"my-2 leading-relaxed",children:t})},ul:e=>{let{children:t}=e;return(0,n.jsx)("ul",{className:"my-2 list-disc space-y-1 pl-6",children:t})},ol:e=>{let{children:t}=e;return(0,n.jsx)("ol",{className:"my-2 list-decimal space-y-1 pl-6",children:t})},li:e=>{let{children:t}=e;return(0,n.jsx)("li",{className:"leading-relaxed",children:t})},blockquote:e=>{let{children:t}=e;return(0,n.jsx)("blockquote",{className:"my-3 border-l-4 border-primary/40 bg-muted/40 py-1 pl-3 text-muted-foreground",children:t})},hr:()=>(0,n.jsx)("hr",{className:"my-4 border-border"}),table:e=>{let{children:t}=e;return(0,n.jsx)("div",{className:"my-3 overflow-x-auto",children:(0,n.jsx)("table",{className:"w-full border-collapse text-sm",children:t})})},thead:e=>{let{children:t}=e;return(0,n.jsx)("thead",{className:"bg-muted/60",children:t})},th:e=>{let{children:t}=e;return(0,n.jsx)("th",{className:"border border-border px-3 py-1.5 text-left font-semibold",children:t})},td:e=>{let{children:t}=e;return(0,n.jsx)("td",{className:"border border-border px-3 py-1.5",children:t})},code:e=>{let{className:t,children:r}=e;return t?(0,n.jsx)("code",{className:"".concat(t," font-mono"),children:r}):(0,n.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.85em]",children:r})},pre:e=>{let{children:t}=e;return(0,n.jsx)("pre",{className:"my-3 overflow-x-auto rounded-lg border border-border bg-muted/40 p-3 text-xs",children:t})},img:e=>{let{src:t,alt:r}=e;return(0,n.jsx)("img",{src:"string"==typeof t?t:"",alt:null!=r?r:"",className:"my-2 max-w-full rounded"})},a:e=>{let{href:t,children:l}=e,a=null!=t?t:"";if(a.startsWith(u)){let e=decodeURIComponent(a.slice(u.length));return(0,n.jsx)("button",{type:"button",onClick:()=>null==r?void 0:r(e),className:"text-primary underline decoration-dotted underline-offset-2 hover:decoration-solid",children:l})}return(0,n.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"text-primary underline underline-offset-2",children:l})}},children:t})})}class h{get(e){return this.client.fetchJson(e)}info(){return this.get("/v1/vault/info")}list(e){return this.get("/v1/vault/list".concat(e?"?cwd=".concat(encodeURIComponent(e)):""))}read(e,t){let r=new URLSearchParams({path:e,...t?{maxBytes:String(t)}:{}});return this.get("/v1/vault/read?".concat(r.toString()))}search(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return this.get("/v1/vault/search?q=".concat(encodeURIComponent(e),"&limit=").concat(t))}notes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500;return this.get("/v1/vault/notes?".concat(e?"query=".concat(encodeURIComponent(e),"&"):"","limit=").concat(t))}backlinks(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return this.get("/v1/vault/backlinks?target=".concat(encodeURIComponent(e),"&limit=").concat(t))}tags(){return this.get("/v1/vault/tags")}templates(){return this.get("/v1/vault/templates")}graph(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:500,n=new URLSearchParams({limit:String(r),...e?{focus:e,hops:String(t)}:{}});return this.get("/v1/vault/graph?".concat(n.toString()))}pollChanges(e){return this.get("/v1/vault/poll-changes?sinceMs=".concat(e))}orphans(){return this.get("/v1/vault/orphans")}templateExpand(e,t){return this.client.fetchJson("/v1/vault/template-expand",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({templatePath:e,...t?{title:t}:{}})})}async writeNote(e){var t,r,n,l;let a=await this.client.fetchResponse("/v1/vault/file",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),s=(null!=(t=a.headers.get("content-type"))?t:"").includes("application/json")?await a.json():await a.text();if(!a.ok&&409!==a.status)throw Error(String("string"==typeof s?s:null!=(l=null!=(n=null!=(r=null==s?void 0:s.message)?r:null==s?void 0:s.reason)?n:null==s?void 0:s.error)?l:"".concat(a.status)));return s}async saveNote(e){var t,r,n;let l=await this.client.fetchResponse("/v1/notes/save",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),a=(null!=(t=l.headers.get("content-type"))?t:"").includes("application/json")?await l.json():await l.text();if(!l.ok&&409!==l.status)throw Error(String("string"==typeof a?a:null!=(n=null!=(r=null==a?void 0:a.reason)?r:null==a?void 0:a.error)?n:"".concat(l.status)));return a}constructor(e){this.client=e}}function p(e){let t=/^---\n([\s\S]*?)\n---\n?/.exec(e);return t?{frontmatter:t[1],body:e.slice(t[0].length)}:{frontmatter:null,body:e}}function g(e){let t=e.toLowerCase();return t.endsWith(".md")||t.endsWith(".markdown")?"markdown":/\.(png|jpe?g|gif|webp|svg)$/.test(t)?"image":t.endsWith(".pdf")?"pdf":/\.(txt|json|ya?ml|csv|log)$/.test(t)?"text":"other"}function f(e){let{onPickTag:t}=e,{client:r}=(0,a.Q)(),s=(0,l.useMemo)(()=>new h(r),[r]),[o,i]=(0,l.useState)([]),[c,d]=(0,l.useState)(""),[u,x]=(0,l.useState)(!0),m=(0,l.useCallback)(async()=>{x(!0);try{var e;let t=await s.tags();i((null!=(e=t.tags)?e:[]).sort((e,t)=>t.count-e.count))}catch(e){}finally{x(!1)}},[s]);(0,l.useEffect)(()=>{m()},[m]);let p=c?o.filter(e=>e.tag.toLowerCase().includes(c.toLowerCase())):o;return(0,n.jsxs)("div",{className:"flex h-full flex-col",children:[(0,n.jsx)("div",{className:"border-b border-border p-2",children:(0,n.jsx)("input",{value:c,onChange:e=>d(e.target.value),placeholder:"태그 필터…",className:"w-full rounded border border-border bg-background px-2 py-1 text-xs"})}),(0,n.jsx)("div",{className:"flex-1 overflow-auto p-1",children:u?(0,n.jsx)("p",{className:"p-2 text-xs text-muted-foreground",children:"불러오는 중…"}):0===p.length?(0,n.jsx)("p",{className:"p-2 text-xs text-muted-foreground",children:"태그 없음"}):(0,n.jsx)("ul",{className:"space-y-0.5",children:p.map(e=>(0,n.jsx)("li",{children:(0,n.jsxs)("button",{onClick:()=>t(e.tag),className:"flex w-full items-center justify-between rounded px-2 py-1 text-left text-xs hover:bg-muted",children:[(0,n.jsxs)("span",{className:"truncate",children:["#",e.tag]}),(0,n.jsx)("span",{className:"ml-2 shrink-0 rounded bg-muted px-1.5 text-[10px] text-muted-foreground",children:e.count})]})},e.tag))})})]})}function v(e){var t,r;let{onOpen:o}=e,{client:i}=(0,a.Q)(),c=(0,l.useMemo)(()=>new h(i),[i]),[d,u]=(0,l.useState)(null),[x,m]=(0,l.useState)(null),[p,g]=(0,l.useState)(!0),f=(0,l.useCallback)(async e=>{g(!0);try{u(await c.graph(null!=e?e:void 0,1,e?60:400))}catch(e){}finally{g(!1)}},[c]);(0,l.useEffect)(()=>{f(x)},[f,x]);let v=(0,l.useMemo)(()=>{if(!d)return{nodes:[],edges:[]};let e=d.nodes.map(e=>e.id),t=d.edges.map(e=>({source:e.from,target:e.to}));return{nodes:function(e,t){var r,n,l;let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{width:800,height:600},{width:s,height:o}=a,i=null!=(r=a.iterations)?r:120,c=e.length,d=new Map;for(let e of t)d.set(e.source,(null!=(n=d.get(e.source))?n:0)+1),d.set(e.target,(null!=(l=d.get(e.target))?l:0)+1);let u=s/2,x=o/2,m=.4*Math.min(s,o),h=e.map((e,t)=>{var r;return{id:e,deg:null!=(r=d.get(e))?r:0,x:u+m*Math.cos(2*Math.PI*t/Math.max(1,c)),y:x+m*Math.sin(2*Math.PI*t/Math.max(1,c))}}),p=new Map(h.map((e,t)=>[e.id,t])),g=Math.sqrt(s*o/Math.max(1,c));for(let e=0;e<i;e++){let r=h.map(()=>({x:0,y:0}));for(let e=0;e<c;e++)for(let t=e+1;t<c;t++){let n=h[e].x-h[t].x,l=h[e].y-h[t].y,a=Math.hypot(n,l)||.01,s=g*g/a;n/=a,l/=a,r[e].x+=n*s,r[e].y+=l*s,r[t].x-=n*s,r[t].y-=l*s}for(let e of t){let t=p.get(e.source),n=p.get(e.target);if(null==t||null==n)continue;let l=h[t].x-h[n].x,a=h[t].y-h[n].y,s=Math.hypot(l,a)||.01,o=s*s/g;l/=s,a/=s,r[t].x-=l*o,r[t].y-=a*o,r[n].x+=l*o,r[n].y+=a*o}let n=1-e/i;for(let e=0;e<c;e++){let t=Math.hypot(r[e].x,r[e].y)||.01,l=Math.min(t,30*n);h[e].x=Math.max(20,Math.min(s-20,h[e].x+r[e].x/t*l)),h[e].y=Math.max(20,Math.min(o-20,h[e].y+r[e].y/t*l))}}return h}(e,t,{width:900,height:640,iterations:140}),edges:t}},[d]),b=(0,l.useMemo)(()=>new Map(v.nodes.map(e=>[e.id,e])),[v]),j=Math.max(1,...v.nodes.map(e=>e.deg));return(0,n.jsxs)("div",{className:"flex h-full flex-col",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2 text-sm",children:[(0,n.jsx)("span",{className:"font-medium",children:"노트 그래프"}),x?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:["focus: ",x," (1-hop)"]}),(0,n.jsx)(s.$,{size:"sm",variant:"outline",className:"ml-auto h-6 px-2 text-xs",onClick:()=>m(null),children:"전체 그래프"})]}):(0,n.jsxs)("span",{className:"ml-auto text-xs text-muted-foreground",children:[null!=(t=null==d?void 0:d.nodes.length)?t:0," 노드 \xb7 ",null!=(r=null==d?void 0:d.edges.length)?r:0," 링크",(null==d?void 0:d.truncated)?" (일부)":""]})]}),(0,n.jsx)("div",{className:"flex-1 overflow-auto p-2",children:p?(0,n.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:"그래프 계산 중…"}):d&&0!==d.nodes.length?(0,n.jsxs)("svg",{viewBox:"0 0 ".concat(900," ").concat(640),className:"h-auto w-full",style:{maxHeight:"78vh"},children:[v.edges.map((e,t)=>{let r=b.get(e.source),l=b.get(e.target);return r&&l?(0,n.jsx)("line",{x1:r.x,y1:r.y,x2:l.x,y2:l.y,stroke:"currentColor",className:"text-border",strokeWidth:.6,opacity:.5},t):null}),v.nodes.map(e=>{let t=3+e.deg/j*9;return(0,n.jsxs)("g",{className:"cursor-pointer",onClick:()=>null==o?void 0:o(e.id),onDoubleClick:()=>m(e.id),children:[(0,n.jsx)("circle",{cx:e.x,cy:e.y,r:t,className:"fill-primary/70 hover:fill-primary"}),(e.deg>=.3*j||x)&&(0,n.jsx)("text",{x:e.x+t+2,y:e.y+3,className:"fill-foreground/70 text-[9px]",children:e.id.split("/").pop()})]},e.id)})]}):(0,n.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:"그래프가 비어있습니다."})}),(0,n.jsx)("p",{className:"border-t border-border px-3 py-1 text-[11px] text-muted-foreground",children:"클릭=노트 열기 \xb7 더블클릭=로컬 그래프(focus)"})]})}function b(e){let{onClose:t,onCreated:r}=e,{client:o}=(0,a.Q)(),i=(0,l.useMemo)(()=>new h(o),[o]),[c,d]=(0,l.useState)(""),[u,x]=(0,l.useState)([]),[m,p]=(0,l.useState)(""),[g,f]=(0,l.useState)(!1),[v,b]=(0,l.useState)(null);(0,l.useEffect)(()=>{i.templates().then(e=>{var t;return x(null!=(t=e.templates)?t:[])}).catch(()=>{})},[i]);let j=(0,l.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};f(!0),b(null);try{let t=e.daily?function(){let e=new Date;return"".concat(e.getFullYear(),"-").concat(String(e.getMonth()+1).padStart(2,"0"),"-").concat(String(e.getDate()).padStart(2,"0"))}():c.trim();if(!t){b("제목을 입력하세요"),f(!1);return}let n="# ".concat(t,"\n\n");if(m){let e=await i.templateExpand(m,t);e.content&&(n=e.content)}else e.daily&&(n="# ".concat(t,"\n\n## 오늘\n\n- \n"));let l=e.daily?"Daily/".concat(t,".md"):"".concat(t,".md"),a=await i.writeNote({path:l,content:n,createOnly:!0});if(a.error){b("file_exists"===a.error?"이미 존재하는 노트입니다":a.error),f(!1);return}r(l)}catch(e){b(e instanceof Error?e.message:String(e)),f(!1)}},[i,c,m,r]);return(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:t,children:(0,n.jsxs)("div",{className:"w-[420px] rounded-lg border border-border bg-card p-4 shadow-xl",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("h2",{className:"mb-3 text-sm font-semibold",children:"새 노트"}),(0,n.jsx)("input",{value:c,onChange:e=>d(e.target.value),onKeyDown:e=>{"Enter"===e.key&&j()},placeholder:"노트 제목…",autoFocus:!0,className:"mb-2 w-full rounded border border-border bg-background px-3 py-2 text-sm"}),u.length>0&&(0,n.jsxs)("select",{value:m,onChange:e=>p(e.target.value),className:"mb-2 w-full rounded border border-border bg-background px-2 py-1.5 text-sm",children:[(0,n.jsx)("option",{value:"",children:"템플릿 없음"}),u.map(e=>(0,n.jsx)("option",{value:e.relPath,children:e.name},e.relPath))]}),v&&(0,n.jsx)("p",{className:"mb-2 text-xs text-rose-400",children:v}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(s.$,{size:"sm",onClick:()=>void j(),disabled:g||!c.trim(),children:"생성"}),(0,n.jsx)(s.$,{size:"sm",variant:"outline",onClick:()=>void j({daily:!0}),disabled:g,children:"오늘 데일리노트"}),(0,n.jsx)(s.$,{size:"sm",variant:"ghost",className:"ml-auto",onClick:t,children:"취소"})]})]})})}function j(e){let{onEdit:t}=e,{client:r}=(0,a.Q)(),o=(0,l.useMemo)(()=>new h(r),[r]),[i,c]=(0,l.useState)(null),[d,u]=(0,l.useState)(""),[x,m]=(0,l.useState)([]),[p,j]=(0,l.useState)(null),[N,w]=(0,l.useState)(null),[k,C]=(0,l.useState)(""),[S,M]=(0,l.useState)(null),[z,E]=(0,l.useState)(!1),[D,$]=(0,l.useState)("view"),[P,R]=(0,l.useState)("files"),[_,q]=(0,l.useState)(!1),[I,O]=(0,l.useState)(0);(0,l.useEffect)(()=>{let e=Date.now(),t=setInterval(()=>{o.pollChanges(e).then(e=>{var t;return O(null!=(t=e.count)?t:0)}).catch(()=>{})},3e4);return()=>clearInterval(t)},[o]);let U=(0,l.useCallback)(e=>{C("#".concat(e)),R("files"),(async()=>{E(!0);try{var t;let r=await o.search("#".concat(e),50);M(null!=(t=r.matches)?t:[])}catch(e){M([])}finally{E(!1)}})()},[o]),T=(0,l.useCallback)(async e=>{E(!0),M(null);try{let t=await o.list(e||void 0);t.error||(m(t.entries),u(t.cwd))}catch(e){}finally{E(!1)}},[o]);(0,l.useEffect)(()=>{let e=!0;return o.info().then(t=>{e&&(c(t),t.available&&T(""))}).catch(()=>{}),()=>{e=!1}},[o,T]);let K=(0,l.useCallback)(async e=>{j(e),w(null);try{w(await o.read(e))}catch(e){}},[o]),A=(0,l.useCallback)(async()=>{let e=k.trim();if(!e)return void M(null);E(!0);try{var t;let r=await o.search(e,50);M(null!=(t=r.matches)?t:[])}catch(e){M([])}finally{E(!1)}},[o,k]),F=d&&(null==i?void 0:i.root)?d.replace(i.root,"").split("/").filter(Boolean):[],W=(null==i?void 0:i.root)?d.replace(i.root,"").replace(/^\//,""):"";return i&&!i.available?(0,n.jsxs)("div",{className:"p-6 text-sm text-muted-foreground",children:["Obsidian vault를 찾을 수 없습니다 (source: ",i.source,"). ~/.elanous/config.json 의 obsidian.vault 를 확인하세요."]}):(0,n.jsxs)("div",{className:"mx-auto flex h-[calc(100vh-3rem)] max-w-[1500px] gap-3 px-3 py-3",children:[_&&(0,n.jsx)(b,{onClose:()=>q(!1),onCreated:e=>{q(!1),T(""),null==t||t(e)}}),(0,n.jsxs)("div",{className:"flex w-[38%] min-w-[280px] flex-col rounded-lg border border-border bg-card/40",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1 border-b border-border px-2 py-1.5",children:[["files","tags","graph"].map(e=>(0,n.jsx)("button",{onClick:()=>R(e),className:["rounded px-2 py-0.5 text-xs",P===e?"bg-primary/20 text-foreground":"text-muted-foreground"].join(" "),children:{files:"파일",tags:"태그",graph:"그래프"}[e]},e)),I>0&&(0,n.jsxs)("span",{className:"rounded bg-amber-500/15 px-1.5 py-0.5 text-[10px] text-amber-300",title:"외부 변경 감지",children:["↻ ",I]}),(0,n.jsx)(s.$,{size:"sm",variant:"outline",className:"ml-auto h-6 px-2 text-xs",onClick:()=>q(!0),children:"+ 새 노트"})]}),"graph"===P?(0,n.jsx)(v,{onOpen:e=>{R("files"),K("".concat(e,".md"))}}):"tags"===P?(0,n.jsx)(f,{onPickTag:U}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"border-b border-border p-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("input",{value:k,onChange:e=>C(e.target.value),onKeyDown:e=>{"Enter"===e.key&&A()},placeholder:"vault 전문검색…",className:"min-w-0 flex-1 rounded border border-border bg-background px-2 py-1 text-sm"}),(0,n.jsx)(s.$,{size:"sm",variant:"outline",onClick:()=>void A(),children:"검색"})]}),!S&&(0,n.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-1 text-xs text-muted-foreground",children:[(0,n.jsx)("button",{className:"hover:text-foreground",onClick:()=>void T(""),children:"vault"}),F.map((e,t)=>(0,n.jsxs)("span",{children:["/ ",(0,n.jsx)("button",{className:"hover:text-foreground",onClick:()=>void T("".concat(i.root,"/").concat(F.slice(0,t+1).join("/"))),children:e})]},t))]})]}),(0,n.jsxs)("div",{className:"flex-1 overflow-auto p-1",children:[z&&(0,n.jsx)("p",{className:"p-2 text-xs text-muted-foreground",children:"불러오는 중…"}),S?0===S.length?(0,n.jsx)("p",{className:"p-2 text-xs text-muted-foreground",children:"검색 결과 없음"}):(0,n.jsx)("ul",{className:"space-y-1",children:S.map((e,t)=>(0,n.jsx)("li",{children:(0,n.jsxs)("button",{className:"w-full rounded px-2 py-1.5 text-left text-xs hover:bg-muted",onClick:()=>void K(e.path),children:[(0,n.jsx)("span",{className:"font-medium",children:e.path.split("/").pop()})," ",(0,n.jsxs)("span",{className:"text-muted-foreground",children:[":",e.lineNumber]}),(0,n.jsx)("div",{className:"truncate text-muted-foreground",children:e.snippet})]})},t))}):(0,n.jsxs)("ul",{children:[W&&(0,n.jsx)("li",{children:(0,n.jsx)("button",{className:"w-full rounded px-2 py-1.5 text-left text-sm text-muted-foreground hover:bg-muted",onClick:()=>void T("".concat(i.root,"/").concat(function(e){let t=e.split("/").filter(Boolean);return t.pop(),t.join("/")}(W))),children:"\uD83D\uDCC1 .."})}),x.map(e=>(0,n.jsx)("li",{children:(0,n.jsxs)("button",{className:["flex w-full items-center gap-1.5 rounded px-2 py-1.5 text-left text-sm hover:bg-muted",p==="".concat(W?W+"/":"").concat(e.name)?"bg-muted":""].join(" "),onClick:()=>e.isDir?void T("".concat(d,"/").concat(e.name)):void K("".concat(W?W+"/":"").concat(e.name)),children:[(0,n.jsx)("span",{children:e.isDir?"\uD83D\uDCC1":"markdown"===g(e.name)?"\uD83D\uDCDD":"image"===g(e.name)?"\uD83D\uDDBC️":"\uD83D\uDCC4"}),(0,n.jsx)("span",{className:"truncate",children:e.name})]})},e.relPath))]})]})]})]}),(0,n.jsxs)("div",{className:"flex flex-1 flex-col rounded-lg border border-border bg-card/40",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[(0,n.jsx)("span",{className:"truncate text-sm font-medium",children:null!=p?p:"파일을 선택하세요"}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[p&&"markdown"===g(p)&&(0,n.jsx)("div",{className:"flex items-center gap-0.5 rounded ring-1 ring-border",children:["view","raw"].map(e=>(0,n.jsx)("button",{onClick:()=>$(e),className:["px-2 py-0.5 text-xs",D===e?"bg-primary/20 text-foreground":"text-muted-foreground"].join(" "),children:"view"===e?"View":"Raw"},e))}),p&&"markdown"===g(p)&&t&&(0,n.jsx)(s.$,{size:"sm",variant:"outline",onClick:()=>t(p),children:"편집"})]})]}),(0,n.jsx)("div",{className:"flex-1 overflow-auto p-4",children:N?(0,n.jsx)(y,{preview:N,selected:p,mode:D,onWikilink:e=>{K("".concat(W?W+"/":"").concat(e,".md"))}}):(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:p?"로딩…":"좌측에서 노트를 선택하면 여기에 표시됩니다."})})]})]})}function y(e){let{preview:t,selected:r,mode:l,onWikilink:a}=e;if(t.error)return(0,n.jsx)("p",{className:"text-sm text-rose-400",children:t.error});let s=g(r);if("image"===s&&t.bytes)return(0,n.jsx)("img",{src:"data:".concat(t.mime,";base64,").concat(t.bytes),alt:r,className:"max-w-full rounded"});if("markdown"===s&&null!=t.content){let{frontmatter:e,body:r}=p(t.content);return"raw"===l?(0,n.jsx)("pre",{className:"whitespace-pre-wrap font-mono text-xs leading-relaxed",children:t.content}):(0,n.jsxs)("div",{children:[e&&(0,n.jsx)("pre",{className:"mb-3 rounded bg-muted/40 p-2 text-[11px] text-muted-foreground",children:e}),(0,n.jsx)(m,{markdown:r,onWikilink:a}),t.truncated&&(0,n.jsxs)("p",{className:"mt-2 text-xs text-amber-400",children:["⚠ 일부만 표시됨(",(t.size/1024).toFixed(0),"KB)"]})]})}return null!=t.content?(0,n.jsx)("pre",{className:"whitespace-pre-wrap text-sm",children:t.content}):(0,n.jsxs)("p",{className:"text-sm text-muted-foreground",children:["미리보기 불가(",t.mime,")"]})}function N(e){let{path:t,onClose:r}=e,{client:o}=(0,a.Q)(),i=(0,l.useMemo)(()=>new h(o),[o]),[c,d]=(0,l.useState)(""),[u,x]=(0,l.useState)(!1),[g,f]=(0,l.useState)("split"),[v,b]=(0,l.useState)("clean"),[j,y]=(0,l.useState)(null),N=(0,l.useRef)(void 0),w=(0,l.useRef)(null),k=(0,l.useRef)(null),[C,S]=(0,l.useState)("outline"),[M,z]=(0,l.useState)([]),[E,D]=(0,l.useState)(null),$=(0,l.useMemo)(()=>(function(e){let t=[],r=!1;return e.split("\n").forEach((e,n)=>{let l=e.trimEnd();if(/^```/.test(l.trim())){r=!r;return}if(r)return;let a=/^(#{1,6})\s+(.+)$/.exec(l);a&&t.push({level:a[1].length,text:a[2].trim(),line:n})}),t})(p(c).body),[c]);(0,l.useEffect)(()=>{let e=!0;return i.read(t,8388608).then(t=>{var r;e&&(d(null!=(r=t.content)?r:""),N.current=t.mtimeMs,x(!0),b("clean"))}).catch(()=>{e&&(y("노트를 불러오지 못했습니다"),x(!0))}),()=>{e=!1,w.current&&clearTimeout(w.current)}},[i,t]);let P=(0,l.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;b("saving"),y(null);try{let n=await i.writeNote({path:t,content:r,...e?{}:null!=N.current?{lastKnownMtime:N.current}:{}});if("mtime_conflict"===n.error||n.error&&null!=n.currentMtime)return void b("conflict");if(n.error){b("error"),y(n.error);return}null!=n.mtimeMs&&(N.current=n.mtimeMs),b("saved")}catch(e){b("error"),y(e instanceof Error?e.message:String(e))}},[i,t,c]);(0,l.useEffect)(()=>{var e;let r=!0;return i.backlinks((null!=(e=t.split("/").pop())?e:t).replace(/\.md$/i,""),100).then(e=>{var t;r&&z(null!=(t=e.matches)?t:[])}).catch(()=>{}),()=>{r=!1}},[i,t]);let R=(0,l.useCallback)((e,t)=>{let r=function(e,t){let r=e.slice(0,t),n=r.lastIndexOf("[[");if(n<0)return null;let l=r.slice(n+2);return l.includes("]]")||l.includes("\n")?null:{query:l,start:n+2}}(e,t);if(!r)return void D(null);i.notes(r.query||void 0,8).then(e=>{var n;D({query:r.query,start:r.start,caret:t,items:(null!=(n=e.notes)?n:[]).slice(0,8)})}).catch(()=>D(null))},[i]),_=(0,l.useCallback)((e,t)=>{d(e),b("dirty"),R(e,t),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{P(!1,e)},2500)},[P,R]),q=(0,l.useCallback)(e=>{if(!E)return;let t=function(e,t,r,n){let l=e.slice(0,t),a=e.slice(r),s="".concat(n,"]]");return{text:l+s+a,caret:l.length+s.length}}(c,E.start,E.caret,e.name);d(t.text),b("dirty"),D(null),requestAnimationFrame(()=>{k.current&&(k.current.focus(),k.current.setSelectionRange(t.caret,t.caret))})},[E,c]),I=(0,l.useCallback)(e=>{let t=k.current;if(!t)return;let r=c.split("\n").slice(0,e).join("\n").length;t.focus(),t.setSelectionRange(r,r),t.scrollTop=Math.max(0,20*e-100)},[c]),O=p(c).body;return u?(0,n.jsxs)("div",{className:"mx-auto flex h-[calc(100vh-3rem)] max-w-[1500px] flex-col px-3 py-3",children:[(0,n.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,n.jsx)(s.$,{size:"sm",variant:"ghost",onClick:r,children:"← 목록"}),(0,n.jsx)("span",{className:"truncate text-sm font-medium",children:t}),(0,n.jsx)("span",{className:["ml-2 rounded px-2 py-0.5 text-xs",{clean:"text-muted-foreground",dirty:"text-amber-400",saving:"text-sky-400",saved:"text-emerald-400",conflict:"text-rose-400",error:"text-rose-400"}[v]].join(" "),children:{clean:"저장됨",dirty:"● 편집 중",saving:"저장 중…",saved:"✓ 저장됨",conflict:"⚠ 충돌",error:"✗ 오류"}[v]}),(0,n.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[["edit","split","preview"].map(e=>(0,n.jsx)("button",{onClick:()=>f(e),className:["rounded px-2 py-1 text-xs ring-1",g===e?"bg-primary/20 ring-primary/40":"bg-muted text-muted-foreground ring-border"].join(" "),children:{edit:"편집",split:"분할",preview:"미리보기"}[e]},e)),(0,n.jsx)(s.$,{size:"sm",variant:"outline",onClick:()=>void P(!1),children:"저장"})]})]}),"conflict"===v&&(0,n.jsxs)("div",{className:"mb-2 flex items-center gap-2 rounded border border-rose-500/40 bg-rose-500/10 px-3 py-2 text-xs text-rose-200",children:[(0,n.jsx)("span",{children:"디스크의 노트가 외부에서 변경됐습니다."}),(0,n.jsx)(s.$,{size:"sm",variant:"outline",onClick:()=>void P(!0),children:"강제 덮어쓰기"}),(0,n.jsx)(s.$,{size:"sm",variant:"ghost",onClick:()=>void i.read(t,8388608).then(e=>{var t;d(null!=(t=e.content)?t:""),N.current=e.mtimeMs,b("clean")}),children:"디스크 버전 로드"})]}),j&&(0,n.jsx)("div",{className:"mb-2 text-xs text-rose-400",children:j}),(0,n.jsxs)("div",{className:"flex min-h-0 flex-1 gap-3",children:["preview"!==g&&(0,n.jsxs)("div",{className:"relative min-h-0 flex-1",children:[(0,n.jsx)("textarea",{ref:k,value:c,onChange:e=>_(e.target.value,e.target.selectionStart),onKeyUp:e=>R(c,e.target.selectionStart),onClick:e=>R(c,e.target.selectionStart),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"s"===e.key&&(e.preventDefault(),P(!1)),"Escape"===e.key&&E&&(e.preventDefault(),D(null)),"Enter"===e.key&&E&&E.items.length&&(e.preventDefault(),q(E.items[0]))},className:"h-full min-h-0 w-full resize-none rounded-lg border border-border bg-background p-3 font-mono text-sm leading-relaxed focus:outline-none focus:ring-1 focus:ring-ring",spellCheck:!1}),E&&E.items.length>0&&(0,n.jsxs)("div",{className:"absolute left-3 top-3 z-20 max-h-56 w-72 overflow-auto rounded-md border border-border bg-popover shadow-lg",children:[(0,n.jsxs)("div",{className:"border-b border-border px-2 py-1 text-[11px] text-muted-foreground",children:["[[wikilink: ",E.query||"…"]}),E.items.map(e=>(0,n.jsxs)("button",{className:"block w-full truncate px-2 py-1.5 text-left text-xs hover:bg-muted",onMouseDown:t=>{t.preventDefault(),q(e)},children:[(0,n.jsx)("span",{className:"font-medium",children:e.name})," ",(0,n.jsx)("span",{className:"text-muted-foreground",children:e.relPath})]},e.relPath))]})]}),"edit"!==g&&(0,n.jsx)("div",{className:"min-h-0 flex-1 overflow-auto rounded-lg border border-border bg-card/40 p-4",children:(0,n.jsx)(m,{markdown:O})}),(0,n.jsxs)("div",{className:"flex w-[220px] min-w-[180px] flex-col rounded-lg border border-border bg-card/40",children:[(0,n.jsx)("div",{className:"flex border-b border-border text-xs",children:["outline","backlinks"].map(e=>(0,n.jsx)("button",{onClick:()=>S(e),className:["flex-1 px-2 py-1.5",C===e?"border-b-2 border-primary text-foreground":"text-muted-foreground"].join(" "),children:"outline"===e?"개요":"역참조 ".concat(M.length?"(".concat(M.length,")"):"")},e))}),(0,n.jsx)("div",{className:"flex-1 overflow-auto p-1 text-xs",children:"outline"===C?0===$.length?(0,n.jsx)("p",{className:"p-2 text-muted-foreground",children:"heading 없음"}):$.map((e,t)=>(0,n.jsx)("button",{onClick:()=>I(e.line),className:"block w-full truncate rounded px-2 py-1 text-left hover:bg-muted",style:{paddingLeft:"".concat(8*e.level,"px")},children:e.text},t)):0===M.length?(0,n.jsx)("p",{className:"p-2 text-muted-foreground",children:"역참조 없음"}):M.map((e,t)=>(0,n.jsxs)("div",{className:"truncate rounded px-2 py-1",title:e.snippet,children:["\uD83D\uDCCE ",e.path.split("/").pop(),e.headingAnchor?" #".concat(e.headingAnchor):""]},t))})]})]})]}):(0,n.jsx)("div",{className:"p-6 text-sm text-muted-foreground",children:"노트 로딩…"})}function w(){let[e,t]=(0,l.useState)(null);return e?(0,n.jsx)(N,{path:e,onClose:()=>t(null)}):(0,n.jsx)(j,{onEdit:e=>t(e)})}},82157:(e,t,r)=>{"use strict";r.d(t,{cn:()=>a});var n=r(3511),l=r(97043);function a(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,l.QP)((0,n.$)(t))}}},e=>{e.O(0,[2977,216,2330,7673,8519,2367,6725,7358],()=>e(e.s=26720)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8677],{68353:(e,t,r)=>{Promise.resolve().then(r.bind(r,75549))},72030:(e,t,r)=>{"use strict";r.d(t,{$:()=>i});var n=r(41121),l=r(72524),a=r(49155),s=r(82157);let o=(0,a.F)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function i(e){let{className:t,variant:r="default",size:a="default",...i}=e;return(0,n.jsx)(l.$,{"data-slot":"button",className:(0,s.cn)(o({variant:r,size:a,className:t})),...i})}},75549:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>w});var n=r(41121),l=r(91269),a=r(38519),s=r(72030),o=r(71946),i=r(38317),c=r(36296),d=r(80096);let u="wikilink:",x={aliasDivider:"|",pageResolver:e=>[e],hrefTemplate:e=>"".concat(u).concat(encodeURIComponent(e))};function m(e){let{markdown:t,onWikilink:r}=e;return(0,n.jsx)("div",{className:"text-sm text-foreground/90",children:(0,n.jsx)(o.oz,{remarkPlugins:[i.A,d.A,[c.A,x]],components:{h1:e=>{let{children:t}=e;return(0,n.jsx)("h1",{className:"mb-3 mt-5 border-b border-border pb-1 text-2xl font-bold",children:t})},h2:e=>{let{children:t}=e;return(0,n.jsx)("h2",{className:"mb-2 mt-5 text-xl font-bold",children:t})},h3:e=>{let{children:t}=e;return(0,n.jsx)("h3",{className:"mb-2 mt-4 text-lg font-semibold",children:t})},h4:e=>{let{children:t}=e;return(0,n.jsx)("h4",{className:"mb-1 mt-3 text-base font-semibold",children:t})},h5:e=>{let{children:t}=e;return(0,n.jsx)("h5",{className:"mb-1 mt-2 text-sm font-semibold text-muted-foreground",children:t})},h6:e=>{let{children:t}=e;return(0,n.jsx)("h6",{className:"mb-1 mt-2 text-xs font-semibold uppercase text-muted-foreground",children:t})},p:e=>{let{children:t}=e;return(0,n.jsx)("p",{className:"my-2 leading-relaxed",children:t})},ul:e=>{let{children:t}=e;return(0,n.jsx)("ul",{className:"my-2 list-disc space-y-1 pl-6",children:t})},ol:e=>{let{children:t}=e;return(0,n.jsx)("ol",{className:"my-2 list-decimal space-y-1 pl-6",children:t})},li:e=>{let{children:t}=e;return(0,n.jsx)("li",{className:"leading-relaxed",children:t})},blockquote:e=>{let{children:t}=e;return(0,n.jsx)("blockquote",{className:"my-3 border-l-4 border-primary/40 bg-muted/40 py-1 pl-3 text-muted-foreground",children:t})},hr:()=>(0,n.jsx)("hr",{className:"my-4 border-border"}),table:e=>{let{children:t}=e;return(0,n.jsx)("div",{className:"my-3 overflow-x-auto",children:(0,n.jsx)("table",{className:"w-full border-collapse text-sm",children:t})})},thead:e=>{let{children:t}=e;return(0,n.jsx)("thead",{className:"bg-muted/60",children:t})},th:e=>{let{children:t}=e;return(0,n.jsx)("th",{className:"border border-border px-3 py-1.5 text-left font-semibold",children:t})},td:e=>{let{children:t}=e;return(0,n.jsx)("td",{className:"border border-border px-3 py-1.5",children:t})},code:e=>{let{className:t,children:r}=e;return t?(0,n.jsx)("code",{className:"".concat(t," font-mono"),children:r}):(0,n.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.85em]",children:r})},pre:e=>{let{children:t}=e;return(0,n.jsx)("pre",{className:"my-3 overflow-x-auto rounded-lg border border-border bg-muted/40 p-3 text-xs",children:t})},img:e=>{let{src:t,alt:r}=e;return(0,n.jsx)("img",{src:"string"==typeof t?t:"",alt:null!=r?r:"",className:"my-2 max-w-full rounded"})},a:e=>{let{href:t,children:l}=e,a=null!=t?t:"";if(a.startsWith(u)){let e=decodeURIComponent(a.slice(u.length));return(0,n.jsx)("button",{type:"button",onClick:()=>null==r?void 0:r(e),className:"text-primary underline decoration-dotted underline-offset-2 hover:decoration-solid",children:l})}return(0,n.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"text-primary underline underline-offset-2",children:l})}},children:t})})}class h{get(e){return this.client.fetchJson(e)}info(){return this.get("/v1/vault/info")}list(e){return this.get("/v1/vault/list".concat(e?"?cwd=".concat(encodeURIComponent(e)):""))}read(e,t){let r=new URLSearchParams({path:e,...t?{maxBytes:String(t)}:{}});return this.get("/v1/vault/read?".concat(r.toString()))}search(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return this.get("/v1/vault/search?q=".concat(encodeURIComponent(e),"&limit=").concat(t))}notes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500;return this.get("/v1/vault/notes?".concat(e?"query=".concat(encodeURIComponent(e),"&"):"","limit=").concat(t))}backlinks(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return this.get("/v1/vault/backlinks?target=".concat(encodeURIComponent(e),"&limit=").concat(t))}tags(){return this.get("/v1/vault/tags")}templates(){return this.get("/v1/vault/templates")}graph(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:500,n=new URLSearchParams({limit:String(r),...e?{focus:e,hops:String(t)}:{}});return this.get("/v1/vault/graph?".concat(n.toString()))}pollChanges(e){return this.get("/v1/vault/poll-changes?sinceMs=".concat(e))}orphans(){return this.get("/v1/vault/orphans")}templateExpand(e,t){return this.client.fetchJson("/v1/vault/template-expand",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({templatePath:e,...t?{title:t}:{}})})}async writeNote(e){var t,r,n,l;let a=await this.client.fetchResponse("/v1/vault/file",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),s=(null!=(t=a.headers.get("content-type"))?t:"").includes("application/json")?await a.json():await a.text();if(!a.ok&&409!==a.status)throw Error(String("string"==typeof s?s:null!=(l=null!=(n=null!=(r=null==s?void 0:s.message)?r:null==s?void 0:s.reason)?n:null==s?void 0:s.error)?l:"".concat(a.status)));return s}async saveNote(e){var t,r,n;let l=await this.client.fetchResponse("/v1/notes/save",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),a=(null!=(t=l.headers.get("content-type"))?t:"").includes("application/json")?await l.json():await l.text();if(!l.ok&&409!==l.status)throw Error(String("string"==typeof a?a:null!=(n=null!=(r=null==a?void 0:a.reason)?r:null==a?void 0:a.error)?n:"".concat(l.status)));return a}constructor(e){this.client=e}}function p(e){let t=/^---\n([\s\S]*?)\n---\n?/.exec(e);return t?{frontmatter:t[1],body:e.slice(t[0].length)}:{frontmatter:null,body:e}}function g(e){let t=e.toLowerCase();return t.endsWith(".md")||t.endsWith(".markdown")?"markdown":/\.(png|jpe?g|gif|webp|svg)$/.test(t)?"image":t.endsWith(".pdf")?"pdf":/\.(txt|json|ya?ml|csv|log)$/.test(t)?"text":"other"}function f(e){let{onPickTag:t}=e,{client:r}=(0,a.Q)(),s=(0,l.useMemo)(()=>new h(r),[r]),[o,i]=(0,l.useState)([]),[c,d]=(0,l.useState)(""),[u,x]=(0,l.useState)(!0),m=(0,l.useCallback)(async()=>{x(!0);try{var e;let t=await s.tags();i((null!=(e=t.tags)?e:[]).sort((e,t)=>t.count-e.count))}catch(e){}finally{x(!1)}},[s]);(0,l.useEffect)(()=>{m()},[m]);let p=c?o.filter(e=>e.tag.toLowerCase().includes(c.toLowerCase())):o;return(0,n.jsxs)("div",{className:"flex h-full flex-col",children:[(0,n.jsx)("div",{className:"border-b border-border p-2",children:(0,n.jsx)("input",{value:c,onChange:e=>d(e.target.value),placeholder:"태그 필터…",className:"w-full rounded border border-border bg-background px-2 py-1 text-xs"})}),(0,n.jsx)("div",{className:"flex-1 overflow-auto p-1",children:u?(0,n.jsx)("p",{className:"p-2 text-xs text-muted-foreground",children:"불러오는 중…"}):0===p.length?(0,n.jsx)("p",{className:"p-2 text-xs text-muted-foreground",children:"태그 없음"}):(0,n.jsx)("ul",{className:"space-y-0.5",children:p.map(e=>(0,n.jsx)("li",{children:(0,n.jsxs)("button",{onClick:()=>t(e.tag),className:"flex w-full items-center justify-between rounded px-2 py-1 text-left text-xs hover:bg-muted",children:[(0,n.jsxs)("span",{className:"truncate",children:["#",e.tag]}),(0,n.jsx)("span",{className:"ml-2 shrink-0 rounded bg-muted px-1.5 text-[10px] text-muted-foreground",children:e.count})]})},e.tag))})})]})}function v(e){var t,r;let{onOpen:o}=e,{client:i}=(0,a.Q)(),c=(0,l.useMemo)(()=>new h(i),[i]),[d,u]=(0,l.useState)(null),[x,m]=(0,l.useState)(null),[p,g]=(0,l.useState)(!0),f=(0,l.useCallback)(async e=>{g(!0);try{u(await c.graph(null!=e?e:void 0,1,e?60:400))}catch(e){}finally{g(!1)}},[c]);(0,l.useEffect)(()=>{f(x)},[f,x]);let v=(0,l.useMemo)(()=>{if(!d)return{nodes:[],edges:[]};let e=d.nodes.map(e=>e.id),t=d.edges.map(e=>({source:e.from,target:e.to}));return{nodes:function(e,t){var r,n,l;let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{width:800,height:600},{width:s,height:o}=a,i=null!=(r=a.iterations)?r:120,c=e.length,d=new Map;for(let e of t)d.set(e.source,(null!=(n=d.get(e.source))?n:0)+1),d.set(e.target,(null!=(l=d.get(e.target))?l:0)+1);let u=s/2,x=o/2,m=.4*Math.min(s,o),h=e.map((e,t)=>{var r;return{id:e,deg:null!=(r=d.get(e))?r:0,x:u+m*Math.cos(2*Math.PI*t/Math.max(1,c)),y:x+m*Math.sin(2*Math.PI*t/Math.max(1,c))}}),p=new Map(h.map((e,t)=>[e.id,t])),g=Math.sqrt(s*o/Math.max(1,c));for(let e=0;e<i;e++){let r=h.map(()=>({x:0,y:0}));for(let e=0;e<c;e++)for(let t=e+1;t<c;t++){let n=h[e].x-h[t].x,l=h[e].y-h[t].y,a=Math.hypot(n,l)||.01,s=g*g/a;n/=a,l/=a,r[e].x+=n*s,r[e].y+=l*s,r[t].x-=n*s,r[t].y-=l*s}for(let e of t){let t=p.get(e.source),n=p.get(e.target);if(null==t||null==n)continue;let l=h[t].x-h[n].x,a=h[t].y-h[n].y,s=Math.hypot(l,a)||.01,o=s*s/g;l/=s,a/=s,r[t].x-=l*o,r[t].y-=a*o,r[n].x+=l*o,r[n].y+=a*o}let n=1-e/i;for(let e=0;e<c;e++){let t=Math.hypot(r[e].x,r[e].y)||.01,l=Math.min(t,30*n);h[e].x=Math.max(20,Math.min(s-20,h[e].x+r[e].x/t*l)),h[e].y=Math.max(20,Math.min(o-20,h[e].y+r[e].y/t*l))}}return h}(e,t,{width:900,height:640,iterations:140}),edges:t}},[d]),b=(0,l.useMemo)(()=>new Map(v.nodes.map(e=>[e.id,e])),[v]),j=Math.max(1,...v.nodes.map(e=>e.deg));return(0,n.jsxs)("div",{className:"flex h-full flex-col",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2 text-sm",children:[(0,n.jsx)("span",{className:"font-medium",children:"노트 그래프"}),x?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:["focus: ",x," (1-hop)"]}),(0,n.jsx)(s.$,{size:"sm",variant:"outline",className:"ml-auto h-6 px-2 text-xs",onClick:()=>m(null),children:"전체 그래프"})]}):(0,n.jsxs)("span",{className:"ml-auto text-xs text-muted-foreground",children:[null!=(t=null==d?void 0:d.nodes.length)?t:0," 노드 \xb7 ",null!=(r=null==d?void 0:d.edges.length)?r:0," 링크",(null==d?void 0:d.truncated)?" (일부)":""]})]}),(0,n.jsx)("div",{className:"flex-1 overflow-auto p-2",children:p?(0,n.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:"그래프 계산 중…"}):d&&0!==d.nodes.length?(0,n.jsxs)("svg",{viewBox:"0 0 ".concat(900," ").concat(640),className:"h-auto w-full",style:{maxHeight:"78vh"},children:[v.edges.map((e,t)=>{let r=b.get(e.source),l=b.get(e.target);return r&&l?(0,n.jsx)("line",{x1:r.x,y1:r.y,x2:l.x,y2:l.y,stroke:"currentColor",className:"text-border",strokeWidth:.6,opacity:.5},t):null}),v.nodes.map(e=>{let t=3+e.deg/j*9;return(0,n.jsxs)("g",{className:"cursor-pointer",onClick:()=>null==o?void 0:o(e.id),onDoubleClick:()=>m(e.id),children:[(0,n.jsx)("circle",{cx:e.x,cy:e.y,r:t,className:"fill-primary/70 hover:fill-primary"}),(e.deg>=.3*j||x)&&(0,n.jsx)("text",{x:e.x+t+2,y:e.y+3,className:"fill-foreground/70 text-[9px]",children:e.id.split("/").pop()})]},e.id)})]}):(0,n.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:"그래프가 비어있습니다."})}),(0,n.jsx)("p",{className:"border-t border-border px-3 py-1 text-[11px] text-muted-foreground",children:"클릭=노트 열기 \xb7 더블클릭=로컬 그래프(focus)"})]})}function b(e){let{onClose:t,onCreated:r}=e,{client:o}=(0,a.Q)(),i=(0,l.useMemo)(()=>new h(o),[o]),[c,d]=(0,l.useState)(""),[u,x]=(0,l.useState)([]),[m,p]=(0,l.useState)(""),[g,f]=(0,l.useState)(!1),[v,b]=(0,l.useState)(null);(0,l.useEffect)(()=>{i.templates().then(e=>{var t;return x(null!=(t=e.templates)?t:[])}).catch(()=>{})},[i]);let j=(0,l.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};f(!0),b(null);try{let t=e.daily?function(){let e=new Date;return"".concat(e.getFullYear(),"-").concat(String(e.getMonth()+1).padStart(2,"0"),"-").concat(String(e.getDate()).padStart(2,"0"))}():c.trim();if(!t){b("제목을 입력하세요"),f(!1);return}let n="# ".concat(t,"\n\n");if(m){let e=await i.templateExpand(m,t);e.content&&(n=e.content)}else e.daily&&(n="# ".concat(t,"\n\n## 오늘\n\n- \n"));let l=e.daily?"Daily/".concat(t,".md"):"".concat(t,".md"),a=await i.writeNote({path:l,content:n,createOnly:!0});if(a.error){b("file_exists"===a.error?"이미 존재하는 노트입니다":a.error),f(!1);return}r(l)}catch(e){b(e instanceof Error?e.message:String(e)),f(!1)}},[i,c,m,r]);return(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:t,children:(0,n.jsxs)("div",{className:"w-[420px] rounded-lg border border-border bg-card p-4 shadow-xl",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("h2",{className:"mb-3 text-sm font-semibold",children:"새 노트"}),(0,n.jsx)("input",{value:c,onChange:e=>d(e.target.value),onKeyDown:e=>{"Enter"===e.key&&j()},placeholder:"노트 제목…",autoFocus:!0,className:"mb-2 w-full rounded border border-border bg-background px-3 py-2 text-sm"}),u.length>0&&(0,n.jsxs)("select",{value:m,onChange:e=>p(e.target.value),className:"mb-2 w-full rounded border border-border bg-background px-2 py-1.5 text-sm",children:[(0,n.jsx)("option",{value:"",children:"템플릿 없음"}),u.map(e=>(0,n.jsx)("option",{value:e.relPath,children:e.name},e.relPath))]}),v&&(0,n.jsx)("p",{className:"mb-2 text-xs text-rose-400",children:v}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(s.$,{size:"sm",onClick:()=>void j(),disabled:g||!c.trim(),children:"생성"}),(0,n.jsx)(s.$,{size:"sm",variant:"outline",onClick:()=>void j({daily:!0}),disabled:g,children:"오늘 데일리노트"}),(0,n.jsx)(s.$,{size:"sm",variant:"ghost",className:"ml-auto",onClick:t,children:"취소"})]})]})})}function j(e){let{onEdit:t}=e,{client:r}=(0,a.Q)(),o=(0,l.useMemo)(()=>new h(r),[r]),[i,c]=(0,l.useState)(null),[d,u]=(0,l.useState)(""),[x,m]=(0,l.useState)([]),[p,j]=(0,l.useState)(null),[N,w]=(0,l.useState)(null),[k,C]=(0,l.useState)(""),[S,M]=(0,l.useState)(null),[z,E]=(0,l.useState)(!1),[D,$]=(0,l.useState)("view"),[P,R]=(0,l.useState)("files"),[_,q]=(0,l.useState)(!1),[I,O]=(0,l.useState)(0);(0,l.useEffect)(()=>{let e=Date.now(),t=setInterval(()=>{o.pollChanges(e).then(e=>{var t;return O(null!=(t=e.count)?t:0)}).catch(()=>{})},3e4);return()=>clearInterval(t)},[o]);let U=(0,l.useCallback)(e=>{C("#".concat(e)),R("files"),(async()=>{E(!0);try{var t;let r=await o.search("#".concat(e),50);M(null!=(t=r.matches)?t:[])}catch(e){M([])}finally{E(!1)}})()},[o]),T=(0,l.useCallback)(async e=>{E(!0),M(null);try{let t=await o.list(e||void 0);t.error||(m(t.entries),u(t.cwd))}catch(e){}finally{E(!1)}},[o]);(0,l.useEffect)(()=>{let e=!0;return o.info().then(t=>{e&&(c(t),t.available&&T(""))}).catch(()=>{}),()=>{e=!1}},[o,T]);let K=(0,l.useCallback)(async e=>{j(e),w(null);try{w(await o.read(e))}catch(e){}},[o]),A=(0,l.useCallback)(async()=>{let e=k.trim();if(!e)return void M(null);E(!0);try{var t;let r=await o.search(e,50);M(null!=(t=r.matches)?t:[])}catch(e){M([])}finally{E(!1)}},[o,k]),F=d&&(null==i?void 0:i.root)?d.replace(i.root,"").split("/").filter(Boolean):[],W=(null==i?void 0:i.root)?d.replace(i.root,"").replace(/^\//,""):"";return i&&!i.available?(0,n.jsxs)("div",{className:"p-6 text-sm text-muted-foreground",children:["Obsidian vault를 찾을 수 없습니다 (source: ",i.source,"). ~/.elanous/config.json 의 obsidian.vault 를 확인하세요."]}):(0,n.jsxs)("div",{className:"mx-auto flex h-[calc(100vh-3rem)] max-w-[1500px] gap-3 px-3 py-3",children:[_&&(0,n.jsx)(b,{onClose:()=>q(!1),onCreated:e=>{q(!1),T(""),null==t||t(e)}}),(0,n.jsxs)("div",{className:"flex w-[38%] min-w-[280px] flex-col rounded-lg border border-border bg-card/40",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1 border-b border-border px-2 py-1.5",children:[["files","tags","graph"].map(e=>(0,n.jsx)("button",{onClick:()=>R(e),className:["rounded px-2 py-0.5 text-xs",P===e?"bg-primary/20 text-foreground":"text-muted-foreground"].join(" "),children:{files:"파일",tags:"태그",graph:"그래프"}[e]},e)),I>0&&(0,n.jsxs)("span",{className:"rounded bg-amber-500/15 px-1.5 py-0.5 text-[10px] text-amber-300",title:"외부 변경 감지",children:["↻ ",I]}),(0,n.jsx)(s.$,{size:"sm",variant:"outline",className:"ml-auto h-6 px-2 text-xs",onClick:()=>q(!0),children:"+ 새 노트"})]}),"graph"===P?(0,n.jsx)(v,{onOpen:e=>{R("files"),K("".concat(e,".md"))}}):"tags"===P?(0,n.jsx)(f,{onPickTag:U}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"border-b border-border p-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("input",{value:k,onChange:e=>C(e.target.value),onKeyDown:e=>{"Enter"===e.key&&A()},placeholder:"vault 전문검색…",className:"min-w-0 flex-1 rounded border border-border bg-background px-2 py-1 text-sm"}),(0,n.jsx)(s.$,{size:"sm",variant:"outline",onClick:()=>void A(),children:"검색"})]}),!S&&(0,n.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-1 text-xs text-muted-foreground",children:[(0,n.jsx)("button",{className:"hover:text-foreground",onClick:()=>void T(""),children:"vault"}),F.map((e,t)=>(0,n.jsxs)("span",{children:["/ ",(0,n.jsx)("button",{className:"hover:text-foreground",onClick:()=>void T("".concat(i.root,"/").concat(F.slice(0,t+1).join("/"))),children:e})]},t))]})]}),(0,n.jsxs)("div",{className:"flex-1 overflow-auto p-1",children:[z&&(0,n.jsx)("p",{className:"p-2 text-xs text-muted-foreground",children:"불러오는 중…"}),S?0===S.length?(0,n.jsx)("p",{className:"p-2 text-xs text-muted-foreground",children:"검색 결과 없음"}):(0,n.jsx)("ul",{className:"space-y-1",children:S.map((e,t)=>(0,n.jsx)("li",{children:(0,n.jsxs)("button",{className:"w-full rounded px-2 py-1.5 text-left text-xs hover:bg-muted",onClick:()=>void K(e.path),children:[(0,n.jsx)("span",{className:"font-medium",children:e.path.split("/").pop()})," ",(0,n.jsxs)("span",{className:"text-muted-foreground",children:[":",e.lineNumber]}),(0,n.jsx)("div",{className:"truncate text-muted-foreground",children:e.snippet})]})},t))}):(0,n.jsxs)("ul",{children:[W&&(0,n.jsx)("li",{children:(0,n.jsx)("button",{className:"w-full rounded px-2 py-1.5 text-left text-sm text-muted-foreground hover:bg-muted",onClick:()=>void T("".concat(i.root,"/").concat(function(e){let t=e.split("/").filter(Boolean);return t.pop(),t.join("/")}(W))),children:"\uD83D\uDCC1 .."})}),x.map(e=>(0,n.jsx)("li",{children:(0,n.jsxs)("button",{className:["flex w-full items-center gap-1.5 rounded px-2 py-1.5 text-left text-sm hover:bg-muted",p==="".concat(W?W+"/":"").concat(e.name)?"bg-muted":""].join(" "),onClick:()=>e.isDir?void T("".concat(d,"/").concat(e.name)):void K("".concat(W?W+"/":"").concat(e.name)),children:[(0,n.jsx)("span",{children:e.isDir?"\uD83D\uDCC1":"markdown"===g(e.name)?"\uD83D\uDCDD":"image"===g(e.name)?"\uD83D\uDDBC️":"\uD83D\uDCC4"}),(0,n.jsx)("span",{className:"truncate",children:e.name})]})},e.relPath))]})]})]})]}),(0,n.jsxs)("div",{className:"flex flex-1 flex-col rounded-lg border border-border bg-card/40",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[(0,n.jsx)("span",{className:"truncate text-sm font-medium",children:null!=p?p:"파일을 선택하세요"}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[p&&"markdown"===g(p)&&(0,n.jsx)("div",{className:"flex items-center gap-0.5 rounded ring-1 ring-border",children:["view","raw"].map(e=>(0,n.jsx)("button",{onClick:()=>$(e),className:["px-2 py-0.5 text-xs",D===e?"bg-primary/20 text-foreground":"text-muted-foreground"].join(" "),children:"view"===e?"View":"Raw"},e))}),p&&"markdown"===g(p)&&t&&(0,n.jsx)(s.$,{size:"sm",variant:"outline",onClick:()=>t(p),children:"편집"})]})]}),(0,n.jsx)("div",{className:"flex-1 overflow-auto p-4",children:N?(0,n.jsx)(y,{preview:N,selected:p,mode:D,onWikilink:e=>{K("".concat(W?W+"/":"").concat(e,".md"))}}):(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:p?"로딩…":"좌측에서 노트를 선택하면 여기에 표시됩니다."})})]})]})}function y(e){let{preview:t,selected:r,mode:l,onWikilink:a}=e;if(t.error)return(0,n.jsx)("p",{className:"text-sm text-rose-400",children:t.error});let s=g(r);if("image"===s&&t.bytes)return(0,n.jsx)("img",{src:"data:".concat(t.mime,";base64,").concat(t.bytes),alt:r,className:"max-w-full rounded"});if("markdown"===s&&null!=t.content){let{frontmatter:e,body:r}=p(t.content);return"raw"===l?(0,n.jsx)("pre",{className:"whitespace-pre-wrap font-mono text-xs leading-relaxed",children:t.content}):(0,n.jsxs)("div",{children:[e&&(0,n.jsx)("pre",{className:"mb-3 rounded bg-muted/40 p-2 text-[11px] text-muted-foreground",children:e}),(0,n.jsx)(m,{markdown:r,onWikilink:a}),t.truncated&&(0,n.jsxs)("p",{className:"mt-2 text-xs text-amber-400",children:["⚠ 일부만 표시됨(",(t.size/1024).toFixed(0),"KB)"]})]})}return null!=t.content?(0,n.jsx)("pre",{className:"whitespace-pre-wrap text-sm",children:t.content}):(0,n.jsxs)("p",{className:"text-sm text-muted-foreground",children:["미리보기 불가(",t.mime,")"]})}function N(e){let{path:t,onClose:r}=e,{client:o}=(0,a.Q)(),i=(0,l.useMemo)(()=>new h(o),[o]),[c,d]=(0,l.useState)(""),[u,x]=(0,l.useState)(!1),[g,f]=(0,l.useState)("split"),[v,b]=(0,l.useState)("clean"),[j,y]=(0,l.useState)(null),N=(0,l.useRef)(void 0),w=(0,l.useRef)(null),k=(0,l.useRef)(null),[C,S]=(0,l.useState)("outline"),[M,z]=(0,l.useState)([]),[E,D]=(0,l.useState)(null),$=(0,l.useMemo)(()=>(function(e){let t=[],r=!1;return e.split("\n").forEach((e,n)=>{let l=e.trimEnd();if(/^```/.test(l.trim())){r=!r;return}if(r)return;let a=/^(#{1,6})\s+(.+)$/.exec(l);a&&t.push({level:a[1].length,text:a[2].trim(),line:n})}),t})(p(c).body),[c]);(0,l.useEffect)(()=>{let e=!0;return i.read(t,8388608).then(t=>{var r;e&&(d(null!=(r=t.content)?r:""),N.current=t.mtimeMs,x(!0),b("clean"))}).catch(()=>{e&&(y("노트를 불러오지 못했습니다"),x(!0))}),()=>{e=!1,w.current&&clearTimeout(w.current)}},[i,t]);let P=(0,l.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;b("saving"),y(null);try{let n=await i.writeNote({path:t,content:r,...e?{}:null!=N.current?{lastKnownMtime:N.current}:{}});if("mtime_conflict"===n.error||n.error&&null!=n.currentMtime)return void b("conflict");if(n.error){b("error"),y(n.error);return}null!=n.mtimeMs&&(N.current=n.mtimeMs),b("saved")}catch(e){b("error"),y(e instanceof Error?e.message:String(e))}},[i,t,c]);(0,l.useEffect)(()=>{var e;let r=!0;return i.backlinks((null!=(e=t.split("/").pop())?e:t).replace(/\.md$/i,""),100).then(e=>{var t;r&&z(null!=(t=e.matches)?t:[])}).catch(()=>{}),()=>{r=!1}},[i,t]);let R=(0,l.useCallback)((e,t)=>{let r=function(e,t){let r=e.slice(0,t),n=r.lastIndexOf("[[");if(n<0)return null;let l=r.slice(n+2);return l.includes("]]")||l.includes("\n")?null:{query:l,start:n+2}}(e,t);if(!r)return void D(null);i.notes(r.query||void 0,8).then(e=>{var n;D({query:r.query,start:r.start,caret:t,items:(null!=(n=e.notes)?n:[]).slice(0,8)})}).catch(()=>D(null))},[i]),_=(0,l.useCallback)((e,t)=>{d(e),b("dirty"),R(e,t),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{P(!1,e)},2500)},[P,R]),q=(0,l.useCallback)(e=>{if(!E)return;let t=function(e,t,r,n){let l=e.slice(0,t),a=e.slice(r),s="".concat(n,"]]");return{text:l+s+a,caret:l.length+s.length}}(c,E.start,E.caret,e.name);d(t.text),b("dirty"),D(null),requestAnimationFrame(()=>{k.current&&(k.current.focus(),k.current.setSelectionRange(t.caret,t.caret))})},[E,c]),I=(0,l.useCallback)(e=>{let t=k.current;if(!t)return;let r=c.split("\n").slice(0,e).join("\n").length;t.focus(),t.setSelectionRange(r,r),t.scrollTop=Math.max(0,20*e-100)},[c]),O=p(c).body;return u?(0,n.jsxs)("div",{className:"mx-auto flex h-[calc(100vh-3rem)] max-w-[1500px] flex-col px-3 py-3",children:[(0,n.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,n.jsx)(s.$,{size:"sm",variant:"ghost",onClick:r,children:"← 목록"}),(0,n.jsx)("span",{className:"truncate text-sm font-medium",children:t}),(0,n.jsx)("span",{className:["ml-2 rounded px-2 py-0.5 text-xs",{clean:"text-muted-foreground",dirty:"text-amber-400",saving:"text-sky-400",saved:"text-emerald-400",conflict:"text-rose-400",error:"text-rose-400"}[v]].join(" "),children:{clean:"저장됨",dirty:"● 편집 중",saving:"저장 중…",saved:"✓ 저장됨",conflict:"⚠ 충돌",error:"✗ 오류"}[v]}),(0,n.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[["edit","split","preview"].map(e=>(0,n.jsx)("button",{onClick:()=>f(e),className:["rounded px-2 py-1 text-xs ring-1",g===e?"bg-primary/20 ring-primary/40":"bg-muted text-muted-foreground ring-border"].join(" "),children:{edit:"편집",split:"분할",preview:"미리보기"}[e]},e)),(0,n.jsx)(s.$,{size:"sm",variant:"outline",onClick:()=>void P(!1),children:"저장"})]})]}),"conflict"===v&&(0,n.jsxs)("div",{className:"mb-2 flex items-center gap-2 rounded border border-rose-500/40 bg-rose-500/10 px-3 py-2 text-xs text-rose-200",children:[(0,n.jsx)("span",{children:"디스크의 노트가 외부에서 변경됐습니다."}),(0,n.jsx)(s.$,{size:"sm",variant:"outline",onClick:()=>void P(!0),children:"강제 덮어쓰기"}),(0,n.jsx)(s.$,{size:"sm",variant:"ghost",onClick:()=>void i.read(t,8388608).then(e=>{var t;d(null!=(t=e.content)?t:""),N.current=e.mtimeMs,b("clean")}),children:"디스크 버전 로드"})]}),j&&(0,n.jsx)("div",{className:"mb-2 text-xs text-rose-400",children:j}),(0,n.jsxs)("div",{className:"flex min-h-0 flex-1 gap-3",children:["preview"!==g&&(0,n.jsxs)("div",{className:"relative min-h-0 flex-1",children:[(0,n.jsx)("textarea",{ref:k,value:c,onChange:e=>_(e.target.value,e.target.selectionStart),onKeyUp:e=>R(c,e.target.selectionStart),onClick:e=>R(c,e.target.selectionStart),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"s"===e.key&&(e.preventDefault(),P(!1)),"Escape"===e.key&&E&&(e.preventDefault(),D(null)),"Enter"===e.key&&E&&E.items.length&&(e.preventDefault(),q(E.items[0]))},className:"h-full min-h-0 w-full resize-none rounded-lg border border-border bg-background p-3 font-mono text-sm leading-relaxed focus:outline-none focus:ring-1 focus:ring-ring",spellCheck:!1}),E&&E.items.length>0&&(0,n.jsxs)("div",{className:"absolute left-3 top-3 z-20 max-h-56 w-72 overflow-auto rounded-md border border-border bg-popover shadow-lg",children:[(0,n.jsxs)("div",{className:"border-b border-border px-2 py-1 text-[11px] text-muted-foreground",children:["[[wikilink: ",E.query||"…"]}),E.items.map(e=>(0,n.jsxs)("button",{className:"block w-full truncate px-2 py-1.5 text-left text-xs hover:bg-muted",onMouseDown:t=>{t.preventDefault(),q(e)},children:[(0,n.jsx)("span",{className:"font-medium",children:e.name})," ",(0,n.jsx)("span",{className:"text-muted-foreground",children:e.relPath})]},e.relPath))]})]}),"edit"!==g&&(0,n.jsx)("div",{className:"min-h-0 flex-1 overflow-auto rounded-lg border border-border bg-card/40 p-4",children:(0,n.jsx)(m,{markdown:O})}),(0,n.jsxs)("div",{className:"flex w-[220px] min-w-[180px] flex-col rounded-lg border border-border bg-card/40",children:[(0,n.jsx)("div",{className:"flex border-b border-border text-xs",children:["outline","backlinks"].map(e=>(0,n.jsx)("button",{onClick:()=>S(e),className:["flex-1 px-2 py-1.5",C===e?"border-b-2 border-primary text-foreground":"text-muted-foreground"].join(" "),children:"outline"===e?"개요":"역참조 ".concat(M.length?"(".concat(M.length,")"):"")},e))}),(0,n.jsx)("div",{className:"flex-1 overflow-auto p-1 text-xs",children:"outline"===C?0===$.length?(0,n.jsx)("p",{className:"p-2 text-muted-foreground",children:"heading 없음"}):$.map((e,t)=>(0,n.jsx)("button",{onClick:()=>I(e.line),className:"block w-full truncate rounded px-2 py-1 text-left hover:bg-muted",style:{paddingLeft:"".concat(8*e.level,"px")},children:e.text},t)):0===M.length?(0,n.jsx)("p",{className:"p-2 text-muted-foreground",children:"역참조 없음"}):M.map((e,t)=>(0,n.jsxs)("div",{className:"truncate rounded px-2 py-1",title:e.snippet,children:["\uD83D\uDCCE ",e.path.split("/").pop(),e.headingAnchor?" #".concat(e.headingAnchor):""]},t))})]})]})]}):(0,n.jsx)("div",{className:"p-6 text-sm text-muted-foreground",children:"노트 로딩…"})}function w(){let[e,t]=(0,l.useState)(null);return e?(0,n.jsx)(N,{path:e,onClose:()=>t(null)}):(0,n.jsx)(j,{onEdit:e=>t(e)})}},82157:(e,t,r)=>{"use strict";r.d(t,{cn:()=>a});var n=r(3511),l=r(97043);function a(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,l.QP)((0,n.$)(t))}}},e=>{e.O(0,[2977,216,2330,7673,8519,2367,6725,7358],()=>e(e.s=68353)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4191],{9050:(e,t,s)=>{"use strict";var n=s(65390);s.o(n,"useParams")&&s.d(t,{useParams:function(){return n.useParams}}),s.o(n,"usePathname")&&s.d(t,{usePathname:function(){return n.usePathname}}),s.o(n,"useRouter")&&s.d(t,{useRouter:function(){return n.useRouter}}),s.o(n,"useSearchParams")&&s.d(t,{useSearchParams:function(){return n.useSearchParams}})},9285:(e,t,s)=>{Promise.resolve().then(s.bind(s,65236))},65236:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>u});var n=s(41121),a=s(91269),r=s(9050);async function o(e){var t,s;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=null!=(t=n.fetchImpl)?t:fetch,r="".concat(null!=(s=n.origin)?s:"","/v1/workflows/").concat(encodeURIComponent(e),"/chat-config"),o=await a(r);if(404===o.status)return null;if(!o.ok)throw Error("chat-config ".concat(o.status));return await o.json()}async function i(e){var t,s,n,a,r;let o=null!=(t=e.fetchImpl)?t:fetch,i="".concat(null!=(s=e.origin)?s:"","/v1/workflows/chat").concat(e.chatPath),c={"content-type":"application/json"};e.bearer&&e.bearer.length>0&&(c.authorization="Bearer ".concat(e.bearer));let d={message:e.message};e.sessionId&&(d.sessionId=e.sessionId);let u=await o(i,{method:"POST",headers:c,body:JSON.stringify(d),...e.signal?{signal:e.signal}:{}});if(!u.ok){let e=await u.text().catch(()=>"");throw Error("chat ".concat(u.status).concat(e?": "+e:""))}if((null!=(n=u.headers.get("content-type"))?n:"").includes("text/event-stream")&&u.body)return{kind:"streaming",frames:l(u.body)};let h=await u.json();return{kind:"buffered",response:null!=(a=h.response)?a:"",runId:null!=(r=h.runId)?r:""}}async function*l(e){let t=e.getReader(),s=new TextDecoder,n="";try{for(;;){let{value:e,done:a}=await t.read();if(a)break;let r=(n+=s.decode(e,{stream:!0})).indexOf("\n\n");for(;-1!==r;){let e=n.slice(0,r);n=n.slice(r+2);let t=c(e);t&&(yield t),r=n.indexOf("\n\n")}}if(n.trim().length>0){let e=c(n);e&&(yield e)}}finally{t.releaseLock()}}function c(e){let t="message",s=[];for(let n of e.split("\n")){let e=n.endsWith("\r")?n.slice(0,-1):n;if(e.startsWith(":"))continue;let a=e.indexOf(":");if(-1===a)continue;let r=e.slice(0,a),o=e.slice(a+1).replace(/^ /,"");"event"===r?t=o:"data"===r&&s.push(o)}return 0===s.length?null:{event:t,data:s.join("\n")}}function d(){var e,t;let s=(0,r.useSearchParams)(),l=null!=(e=s.get("workflow"))?e:"",c=null!=(t=s.get("token"))?t:"",[d,u]=(0,a.useState)({kind:"loading"}),[h,f]=(0,a.useState)([]),[m,x]=(0,a.useState)(""),[g,p]=(0,a.useState)(!1),[w]=(0,a.useState)(()=>"hosted-".concat(Date.now().toString(36),"-").concat(Math.random().toString(16).slice(2,6))),b=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=!1;return 0===l.length?void u({kind:"error",reason:"missing ?workflow= query param"}):(o(l).then(t=>{e||(t?u({kind:"ready",config:t}):u({kind:"not-found"}))}).catch(t=>{e||u({kind:"error",reason:t instanceof Error?t.message:String(t)})}),()=>{e=!0})},[l]),(0,a.useEffect)(()=>{b.current&&(b.current.scrollTop=b.current.scrollHeight)},[h]);let k=async()=>{if("ready"!==d.kind||g)return;let e=m.trim();if(0===e.length)return;let t={id:"u-".concat(Date.now()),role:"user",text:e},s="a-".concat(Date.now());f(e=>[...e,t,{id:s,role:"assistant",text:"",pending:!0}]),x(""),p(!0);try{let t=await i({chatPath:d.config.path,message:e,sessionId:"per-session"===d.config.sessionMode?w:void 0,bearer:c.length>0?c:void 0,streaming:d.config.streaming});if("buffered"===t.kind)f(e=>e.map(e=>e.id===s?{...e,text:t.response,pending:!1}:e));else for await(let e of t.frames)if("token"===e.event)f(t=>t.map(t=>t.id===s?{...t,text:t.text+e.data}:t));else if("done"===e.event){let t;try{t=JSON.parse(e.data).response}catch(e){}f(e=>e.map(e=>e.id===s?{...e,text:null!=t?t:e.text,pending:!1}:e))}else"error"===e.event&&f(t=>t.map(t=>t.id===s?{...t,text:t.text+"\n[error: ".concat(e.data,"]"),pending:!1,role:"system"}:t))}catch(t){let e=t instanceof Error?t.message:String(t);f(t=>t.map(t=>t.id===s?{...t,text:"[error: ".concat(e,"]"),pending:!1,role:"system"}:t))}finally{p(!1)}};return"loading"===d.kind?(0,n.jsx)("div",{className:"p-6 text-sm text-slate-500",children:"Loading workflow chat…"}):"not-found"===d.kind?(0,n.jsxs)("div",{className:"p-6 text-sm",children:[(0,n.jsx)("h1",{className:"text-lg font-medium mb-2",children:"Workflow not found"}),(0,n.jsxs)("p",{className:"text-slate-600",children:["The workflow ",(0,n.jsx)("code",{className:"px-1 bg-slate-100 rounded",children:l})," is not available for hosted chat. The workflow author needs to add",(0,n.jsxs)("code",{className:"px-1 bg-slate-100 rounded ml-1",children:["hostedUi: ","{"," enabled: true ","}"]}),"to the chat trigger node."]})]}):"error"===d.kind?(0,n.jsxs)("div",{className:"p-6 text-sm",children:[(0,n.jsx)("h1",{className:"text-lg font-medium mb-2 text-red-600",children:"Connection error"}),(0,n.jsx)("p",{className:"text-slate-600",children:d.reason})]}):(0,n.jsxs)("div",{className:"flex flex-col h-screen max-w-2xl mx-auto px-4",children:[(0,n.jsxs)("header",{className:"py-3 border-b",children:[(0,n.jsx)("h1",{className:"text-base font-medium",children:d.config.workflowName}),(0,n.jsxs)("p",{className:"text-xs text-slate-500",children:[d.config.streaming?"streaming":"buffered"," \xb7 ",d.config.sessionMode,d.config.hostedUi.requiresBearer?" \xb7 bearer required":""]})]}),d.config.hostedUi.requiresBearer&&c.length>0?(0,n.jsx)("div",{className:"text-xs px-3 py-2 bg-amber-50 border-b border-amber-200 text-amber-800",children:"⚠ The bearer token is embedded in this URL. Treat this link as a secret — sharing the URL gives anyone full access to the workflow."}):null,(0,n.jsxs)("div",{ref:b,className:"flex-1 overflow-y-auto py-4 space-y-3",children:[0===h.length?(0,n.jsx)("p",{className:"text-sm text-slate-400 italic",children:"Type a message to start the conversation."}):null,h.map(e=>(0,n.jsxs)("div",{className:"text-sm",children:[(0,n.jsxs)("div",{className:"font-medium text-xs uppercase text-slate-500",children:[e.role,e.pending?" \xb7 typing…":null]}),(0,n.jsx)("pre",{className:"whitespace-pre-wrap font-sans text-slate-800",children:e.text})]},e.id))]}),(0,n.jsxs)("div",{className:"py-3 border-t flex gap-2",children:[(0,n.jsx)("input",{className:"flex-1 px-3 py-2 border rounded text-sm",value:m,onChange:e=>x(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),k())},placeholder:"Message…",disabled:g}),(0,n.jsx)("button",{type:"button",onClick:()=>void k(),disabled:g||0===m.trim().length,className:"px-4 py-2 bg-slate-900 text-white rounded text-sm disabled:opacity-50",children:"Send"})]})]})}function u(){return(0,n.jsx)(a.Suspense,{fallback:(0,n.jsx)("div",{className:"p-6 text-sm text-slate-500",children:"Loading workflow chat…"}),children:(0,n.jsx)(d,{})})}}},e=>{e.O(0,[2367,6725,7358],()=>e(e.s=9285)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7143],{43767:(e,o,r)=>{Promise.resolve().then(r.bind(r,58082))},58082:(e,o,r)=>{"use strict";r.r(o),r.d(o,{default:()=>t});var n=r(41121),s=r(91269);function t(){return(0,s.useEffect)(()=>{window.location.replace("/app/editor/?mode=workflow")},[]),(0,n.jsx)("a",{href:"/app/editor/?mode=workflow",children:"편집기로 이동"})}}},e=>{e.O(0,[2367,6725,7358],()=>e(e.s=43767)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6364],{3373:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>O});var s=r(41121),n=r(91269),a=r(9050),l=r(48619),i=r(82157);function o(e){let{id:t,active:r,children:n}=e;return(0,s.jsx)("div",{role:"tabpanel","data-tab-id":t,"data-active":r?"true":"false",className:(0,i.cn)("h-full min-h-0",r?"block":"hidden"),children:n})}var d=r(6090),c=r(12455),u=r(60737),m=r(26320),x=r(7509),h=r(38894),p=r(41431),f=r(1428);function g(e){let{tab:t}=e;switch(t.kind){case"chat":return(0,s.jsx)(d.ChatPanel,{sessionId:t.sessionId,tabId:t.id});case"term":return(0,s.jsx)(c.zV,{});case"intake":return(0,s.jsx)(u.SY,{});case"tasks":return(0,s.jsx)(m.B,{});case"control":return(0,s.jsx)(x.U,{});case"settings":return(0,s.jsx)(h.O,{})}}function b(){return(0,s.jsx)("div",{className:"flex h-full items-center justify-center text-xs text-muted-foreground",children:(0,s.jsx)("span",{children:"(이 탭은 절약 모드 — 클릭 시 복원)"})})}function v(){let{state:e,addTab:t,activateTab:r}=(0,l.hA)(),a=(0,p.ub)(e),i=(0,n.useRef)(null);if((0,n.useEffect)(()=>{if(i.current&&!(a.length<=1))return(0,f.gI)(i.current,{shouldIgnore:e=>{if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return!!("INPUT"===t||"TEXTAREA"===t||"SELECT"===t||e.closest(".xterm"))||!!e.isContentEditable},onSwipe:t=>{let s=e.activeId?a.findIndex(t=>t.id===e.activeId):-1;if(s<0)return;let n="left"===t?Math.min(a.length-1,s+1):Math.max(0,s-1);n!==s&&r(a[n].id)}})},[a,e.activeId,r]),0===a.length)return(0,s.jsx)("div",{className:"flex h-full flex-col items-center justify-center gap-4 px-6 text-center",children:(0,s.jsxs)("div",{className:"rounded-lg border border-dashed border-border bg-card px-6 py-8 max-w-md",children:[(0,s.jsx)("h2",{className:"text-base font-semibold tracking-tight",children:"워크스페이스 시작"}),(0,s.jsxs)("p",{className:"mt-2 text-sm text-muted-foreground",children:["상단 strip 의"," ",(0,s.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs",children:"+"})," ","또는 아래 버튼으로 첫 탭을 추가하세요. 비활성 탭은 닫기 전까지 unmount 되지 않아 입력 중 텍스트가 보존됩니다."]}),(0,s.jsxs)("div",{className:"mt-4 flex flex-wrap justify-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>t({kind:"chat"}),className:"rounded-md border border-border bg-background px-3 py-1.5 text-sm hover:bg-secondary",children:"+ chat"}),(0,s.jsx)("button",{type:"button",onClick:()=>t({kind:"term"}),className:"rounded-md border border-border bg-background px-3 py-1.5 text-sm hover:bg-secondary",children:"+ terminal"})]})]})});let d=new Set(e.frozenIds);return(0,s.jsx)("div",{ref:i,className:"relative h-full min-h-0 touch-pan-y",children:a.map(t=>(0,s.jsx)(o,{id:t.id,active:e.activeId===t.id,children:d.has(t.id)?(0,s.jsx)(b,{}):(0,s.jsx)(g,{tab:t})},t.id))})}function y(){let e=(0,l.hA)();return(0,n.useEffect)(()=>{let t=t=>{if(!(t.metaKey||t.ctrlKey))return;let r=(0,p.ub)(e.state),s=e.state.activeId?r.findIndex(t=>t.id===e.state.activeId):-1;if(!t.shiftKey&&"t"===t.key.toLowerCase()){t.preventDefault(),e.openPicker({kind:"addNewChat"});return}if(!t.shiftKey&&"w"===t.key.toLowerCase()){t.preventDefault(),e.state.activeId&&r.length>0&&e.closeTab(e.state.activeId);return}if(t.shiftKey&&("]"===t.key||"["===t.key)){if(t.preventDefault(),r.length<=1||s<0)return;let n="]"===t.key?(s+1)%r.length:(s-1+r.length)%r.length;e.activateTab(r[n].id);return}if(!t.shiftKey&&/^[1-9]$/.test(t.key)){t.preventDefault();let s=parseInt(t.key,10)-1;if(s>=r.length)return;e.activateTab(r[s].id);return}};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e]),null}var j=r(72754),k=r(85576);let N=(0,r(89117).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);var w=r(69109),C=r(38519),S=r(27813),I=r(82443),E=r(47940),M=r(5159);function T(e){var t;let{open:r,session:a,onCancel:l,onConfirm:i,busy:o}=e;if((0,n.useEffect)(()=>{if(!r)return;let e=e=>{"Escape"===e.key&&l()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[r,l]),!r||!a)return null;let d=null!=(t=a.lastMsgPreview)?t:"(empty session)";return(0,s.jsx)("div",{role:"alertdialog","aria-modal":"true",className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/40",onClick:l,children:(0,s.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"w-[min(420px,calc(100vw-2rem))] rounded-lg border border-border bg-card p-5 shadow-lg",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(w.A,{className:"mt-0.5 h-5 w-5 shrink-0 text-rose-500","aria-hidden":!0}),(0,s.jsxs)("div",{className:"min-w-0 space-y-2",children:[(0,s.jsx)("h2",{className:"text-base font-semibold",children:"세션 잊기"}),(0,s.jsxs)("p",{className:"truncate font-mono text-xs text-muted-foreground",children:['"',d,'"']}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[a.origin&&(0,s.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono uppercase mr-1.5",children:a.origin}),a.msgCount," 메시지"]}),(0,s.jsx)("p",{className:"text-sm",children:"이 세션을 daemon 에서 영구 삭제합니다. 다른 디바이스 (cli/tg/dc) 에서 이 세션을 보고 있으면 unknown_session 으로 빠집니다."})]})]}),(0,s.jsxs)("div",{className:"mt-4 flex justify-end gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:l,disabled:o,className:"rounded-md border border-border bg-background px-3 py-1.5 text-sm hover:bg-secondary disabled:opacity-50",children:"취소"}),(0,s.jsx)("button",{type:"button",onClick:i,disabled:o,className:"rounded-md bg-rose-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-rose-600 disabled:opacity-50",children:o?"잊는 중…":"잊기"})]})]})})}var D=r(22967);let P={cli:"cli",pwa:"pwa",tg:"tg",dc:"dc"};function L(e){let{open:t,onClose:r,onPick:a,attachedSessions:l}=e,{client:o}=(0,C.Q)(),d=(0,I.hG)(o),c=(0,n.useMemo)(()=>new E.jU(o),[o]),u=(0,M.h)(),[m,x]=(0,n.useState)(""),[h,p]=(0,n.useState)(0),[f,g]=(0,n.useState)(null),[b,v]=(0,n.useState)(!1),[y,L]=(0,n.useState)(!1),[A,R]=(0,n.useState)(null),O=(0,n.useRef)(null),K=(0,n.useRef)(null);(0,n.useEffect)(()=>{t&&(x(""),p(0),R(null),d.forceRefresh())},[t,d]),(0,n.useEffect)(()=>{R(null)},[m]);let z=(0,n.useMemo)(()=>{if(!m.trim())return[...u];let e=m.trim().toLowerCase();return u.filter(t=>!!(t.id.toLowerCase().startsWith(e)||t.lastMsgPreview&&t.lastMsgPreview.toLowerCase().includes(e))||!!t.origin&&e==="[".concat(t.origin,"]")||!!t.origin&&e===t.origin)},[u,m]);if((0,n.useEffect)(()=>{h>=z.length&&p(Math.max(0,z.length-1))},[z.length,h]),(0,n.useEffect)(()=>{var e;if(!t)return;null==(e=O.current)||e.focus();let s=e=>{if("Escape"===e.key){e.preventDefault(),r();return}if((e.metaKey||e.ctrlKey)&&"n"===e.key.toLowerCase()){e.preventDefault(),J();return}if((e.metaKey||e.ctrlKey)&&"f"===e.key.toLowerCase()){var t;e.preventDefault(),null==(t=O.current)||t.focus();return}if("ArrowDown"===e.key)e.preventDefault(),p(e=>Math.min(z.length-1,e+1));else if("ArrowUp"===e.key)e.preventDefault(),p(e=>Math.max(0,e-1));else if("Enter"===e.key){let t=z[h];if(!t){m.trim().length>=4&&(e.preventDefault(),_());return}e.preventDefault(),U(t)}else if("Delete"===e.key||"Backspace"===e.key){if(e.target instanceof HTMLInputElement)return;let t=z[h];t&&(e.preventDefault(),g(t))}};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[t,z,h,r,m,y]),!t)return null;let J=()=>{a({kind:"new",sessionId:(0,S.f6)()})},U=e=>{let t=l.get(e.id);if(t)return void a({kind:"jumpToTab",tabId:t.tabId});a({kind:"existing",sessionId:e.id})},_=async()=>{let e=m.trim().toLowerCase();if(!(e.length<4)&&!y){L(!0);try{var t;let r=await c.list(!0),s=(0,E.nj)(null!=(t=r.sessions)?t:[],e);if("one"===s.kind){let e=l.get(s.id);e?a({kind:"jumpToTab",tabId:e.tabId}):a({kind:"existing",sessionId:s.id})}else"none"===s.kind?R("'".concat(e,"' 로 시작하는 세션이 없습니다.")):R("prefix 모호 — ".concat(s.count,"개 일치. 더 길게 입력하세요."))}catch(e){R("resolve 실패: ".concat(e instanceof Error?e.message:String(e)))}finally{L(!1)}}},B=async()=>{if(f){v(!0);try{await d.forget(f.id),g(null)}finally{v(!1)}}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":"채팅 세션 선택",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:r,children:(0,s.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"flex max-h-[min(640px,90vh)] w-[min(640px,calc(100vw-2rem))] flex-col rounded-lg border border-border bg-card shadow-lg",children:[(0,s.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-4 py-3",children:[(0,s.jsx)("h2",{className:"text-base font-semibold",children:"채팅 세션"}),(0,s.jsx)("button",{type:"button","aria-label":"close",onClick:r,className:"rounded-md p-1 text-muted-foreground hover:bg-secondary hover:text-foreground",children:(0,s.jsx)(j.A,{className:"h-4 w-4"})})]}),(0,s.jsx)("div",{className:"shrink-0 px-4 py-3",children:(0,s.jsxs)("button",{type:"button",onClick:J,className:"flex w-full items-center gap-3 rounded-lg border border-primary/40 bg-primary/10 px-3 py-2.5 text-left hover:bg-primary/15",children:[(0,s.jsx)(k.A,{className:"h-5 w-5 text-primary"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:"새 세션 시작"}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"비어있는 새 채팅을 엽니다 (⌘N)"})]})]})}),(0,s.jsx)("div",{className:"shrink-0 border-y border-border bg-muted/30 px-4 py-2",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(N,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,s.jsx)("input",{ref:O,value:m,onChange:e=>x(e.target.value),placeholder:"검색 — preview text \xb7 id \xb7 [pwa]/[cli]/[tg]/[dc]",className:"flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),m&&(0,s.jsx)("button",{type:"button","aria-label":"clear search",onClick:()=>x(""),className:"rounded p-0.5 text-muted-foreground hover:bg-background",children:(0,s.jsx)(j.A,{className:"h-3 w-3"})})]})}),(0,s.jsx)("div",{ref:K,className:"min-h-0 flex-1 overflow-y-auto",children:0===z.length?(0,s.jsxs)("div",{className:"px-4 py-12 text-center",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:0!==u.length||m.trim()?"검색과 일치하는 세션 없음.":'아직 채팅 세션이 없습니다. 위 "+ 새 세션 시작" 으로 첫 채팅을 시작하세요.'}),m.trim().length>=4&&(0,s.jsx)("button",{type:"button",disabled:y,onClick:()=>void _(),className:"mt-3 rounded-md border border-violet-500/40 bg-violet-500/10 px-3 py-1.5 text-xs text-violet-300 hover:bg-violet-500/15 disabled:opacity-50",children:y?"resolve 중…":"⑂ id prefix '".concat(m.trim(),"' 로 이어가기 (Enter)")}),A&&(0,s.jsx)("p",{className:"mt-2 text-xs text-amber-400",children:A}),0===u.length&&!m.trim()&&(0,s.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"다른 디바이스 (cli / telegram / discord) 에서 세션을 시작하면 여기에 자동으로 나타납니다."})]}):(0,s.jsx)("ul",{className:"divide-y divide-border",children:z.map((e,t)=>{var r;let n=l.get(e.id),a=t===h;return(0,s.jsx)("li",{children:(0,s.jsxs)("div",{className:(0,i.cn)("group flex items-center gap-3 px-4 py-2.5 transition-colors",a?"bg-primary/10 ring-1 ring-inset ring-primary/30":"hover:bg-secondary/50"),onMouseEnter:()=>p(t),children:[(0,s.jsxs)("button",{type:"button",onClick:()=>U(e),className:"flex min-w-0 flex-1 flex-col items-start text-left",children:[(0,s.jsxs)("div",{className:"flex w-full items-center gap-2",children:[(0,s.jsx)("span",{className:"truncate text-sm font-medium",children:null!=(r=e.lastMsgPreview)?r:(0,s.jsx)("span",{className:"text-muted-foreground italic",children:"(empty session)"})}),n&&(0,s.jsxs)("span",{className:"ml-auto shrink-0 rounded-full bg-primary/15 px-2 py-0.5 text-[10px] font-medium text-primary",children:["✓ open in ",n.label]})]}),(0,s.jsxs)("div",{className:"mt-0.5 flex items-center gap-2 text-[11px] text-muted-foreground",children:[e.origin&&(0,s.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono",children:P[e.origin]}),(0,s.jsx)("span",{children:function(e){try{let t=new Date(e).getTime();if(!Number.isFinite(t))return"";let r=Date.now()-t,s=Math.floor(r/6e4);if(s<1)return"방금 전";if(s<60)return"".concat(s,"분 전");let n=Math.floor(s/60);if(n<24)return"".concat(n,"시간 전");let a=Math.floor(n/24);if(a<7)return"".concat(a,"일 전");return new Date(t).toLocaleDateString()}catch(e){return""}}(e.lastTurnAt)}),(0,s.jsxs)("span",{children:["\xb7 ",e.msgCount," 메시지"]}),(0,s.jsx)(D.S,{sessionId:e.id,source:"picker",variant:"subtle",showCopyIcon:!1})]})]}),(0,s.jsx)("button",{type:"button","aria-label":"forget ".concat(e.id),onClick:t=>{t.stopPropagation(),g(e)},className:(0,i.cn)("shrink-0 rounded p-1.5 text-muted-foreground transition-colors hover:bg-rose-500/10 hover:text-rose-500",a?"opacity-100":"opacity-0 group-hover:opacity-100"),children:(0,s.jsx)(w.A,{className:"h-4 w-4"})})]})},e.id)})})}),(0,s.jsxs)("div",{className:"shrink-0 border-t border-border bg-muted/30 px-4 py-2 text-[10px] text-muted-foreground",children:[(0,s.jsx)("span",{className:"mr-3",children:"↑↓ 이동"}),(0,s.jsx)("span",{className:"mr-3",children:"Enter 선택"}),(0,s.jsx)("span",{className:"mr-3",children:"⌘N 새 세션"}),(0,s.jsx)("span",{className:"mr-3",children:"⌘F 검색"}),(0,s.jsx)("span",{children:"Del 잊기"})]})]})}),(0,s.jsx)(T,{open:null!==f,session:f,busy:b,onCancel:()=>g(null),onConfirm:B})]})}let A=new Set(["chat","term","intake","tasks","control","settings"]);function R(){var e;let t=(0,l.hA)(),r=(0,a.useRouter)(),i=(0,a.useSearchParams)(),o=null!=(e=null==i?void 0:i.get("intent"))?e:null,d=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(o&&d.current!==o){if(!A.has(o))return void r.replace("/workspace");if(d.current=o,"chat"===o){let e=(0,p.ub)(t.state).find(e=>"chat"===e.kind);e?t.activateTab(e.id):t.openPicker({kind:"addNewChat"})}else t.activateOrAdd(o);r.replace("/workspace")}},[o,t,r]);let c=(0,n.useMemo)(()=>{let e=new Map,r=0;for(let s of t.state.order){let n=t.state.tabs.find(e=>e.id===s);n&&"chat"===n.kind&&(r+=1,e.set(n.sessionId,{tabId:n.id,label:"chat#".concat(r)}))}return e},[t.state.order,t.state.tabs]);return(0,s.jsxs)("div",{className:"flex h-full flex-col",children:[(0,s.jsx)(y,{}),(0,s.jsx)("div",{className:"flex-1 min-h-0",children:(0,s.jsx)(v,{})}),(0,s.jsx)(L,{open:null!==t.pickerMode,onClose:t.closePicker,onPick:e=>{let r=t.pickerMode;r&&("jumpToTab"===e.kind?t.activateTab(e.tabId):"addNewChat"===r.kind?t.addTab({kind:"chat",sessionId:e.sessionId}):"attachToTab"===r.kind&&(t.updateChatTab(r.tabId,{sessionId:e.sessionId}),t.activateTab(r.tabId)),t.closePicker())},attachedSessions:c})]})}function O(){return(0,s.jsx)(n.Suspense,{fallback:(0,s.jsx)("div",{className:"h-full"}),children:(0,s.jsx)(R,{})})}},7509:(e,t,r)=>{"use strict";r.d(t,{U:()=>x});var s=r(41121),n=r(91269),a=r(38519),l=r(72030),i=r(59062);function o(e){let{items:t}=e;return 0===t.length?(0,s.jsx)("div",{className:"rounded-lg border border-dashed border-border p-6 text-center text-sm text-muted-foreground",children:"No control signals matched the current filter."}):(0,s.jsx)("ul",{className:"space-y-2",children:t.map((e,t)=>{var r,n,a,l,i;let o=[(null==(r=e.scope)?void 0:r.surface)&&"surface=".concat(e.scope.surface),(null==(n=e.scope)?void 0:n.channel)&&"channel=".concat(e.scope.channel),(null==(a=e.scope)?void 0:a.sessionId)&&"session=".concat(e.scope.sessionId)].filter(Boolean).join(" \xb7 ")||"unscoped";return(0,s.jsxs)("li",{className:"rounded-lg border border-border bg-card p-3 shadow-sm",children:[(0,s.jsxs)("div",{className:"text-sm font-medium",children:[e.kind," \xb7 ",e.urgency]}),(0,s.jsxs)("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground",children:[function(e){let t=Date.now()-new Date(e).getTime();return t<6e4?"just now":t<36e5?"".concat(Math.floor(t/6e4),"m ago"):t<864e5?"".concat(Math.floor(t/36e5),"h ago"):"".concat(Math.floor(t/864e5),"d ago")}(e.createdAt)," \xb7 ",null!=(l=e.source)?l:"unknown"," \xb7 ",o]}),(0,s.jsx)("pre",{className:"mt-2 overflow-x-auto rounded-md bg-muted p-2 text-[11px]",children:JSON.stringify(null!=(i=e.payload)?i:{},null,2)})]},t)})})}let d=["background","quick-pass","normal","priority","critical"];class c{async list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new URLSearchParams;Object.entries(e).forEach(e=>{let[r,s]=e;s&&t.set(r,s)});let r=t.toString();return this.client.fetchJson("/v1/control-signals".concat(r?"?".concat(r):""))}emit(e){return this.client.fetchJson("/v1/control-signals",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}constructor(e){this.client=e}}var u=r(66062),m=r(51215);function x(){var e,t,r,x;let{client:h}=(0,a.Q)(),p=(0,n.useMemo)(()=>new c(h),[h]),[f,g]=(0,n.useState)({items:[]}),[b,v]=(0,n.useState)(!1),[y,j]=(0,n.useState)(""),[k,N]=(0,n.useState)(""),[w,C]=(0,n.useState)(""),[S,I]=(0,n.useState)(""),[E,M]=(0,n.useState)(""),[T,D]=(0,n.useState)(""),[P,L]=(0,n.useState)("normal"),[A,R]=(0,n.useState)("operator"),[O,K]=(0,n.useState)(""),[z,J]=(0,n.useState)(""),[U,_]=(0,n.useState)(""),[B,F]=(0,n.useState)(""),[q,Y]=(0,n.useState)(!1),$=(0,n.useCallback)(async()=>{(0,m.cY)("webterm.control.list.refresh",{kind:y,surface:k,minUrgency:w,sessionId:S,limit:E}),v(!0);try{let e=await p.list({kind:y||void 0,surface:k||void 0,minUrgency:w||void 0,sessionId:S||void 0,limit:E||void 0});g(e)}catch(e){u.oR.error("signals list failed: ".concat(e instanceof Error?e.message:e))}finally{v(!1)}},[p,y,k,w,S,E]);(0,n.useEffect)(()=>{$()},[$]);let H=async e=>{if(e.preventDefault(),!T.trim())return void u.oR.error("kind required");let t={};if(B.trim())try{t=JSON.parse(B)}catch(e){u.oR.error("payload must be valid JSON");return}let r={kind:T.trim(),urgency:P,source:A.trim()||"operator",mayPreempt:q,payload:t,scope:{...O?{surface:O}:{},...z?{channel:z}:{},...U?{sessionId:U}:{}}};(0,m.cY)("webterm.control.emit",{kind:r.kind,urgency:r.urgency});try{v(!0),await p.emit(r),u.oR.success("signal emitted"),F(""),await $()}catch(e){u.oR.error("emit failed: ".concat(e instanceof Error?e.message:e))}finally{v(!1)}},Q=null!=(e=f.countsByKind)?e:{};return(0,s.jsxs)("div",{className:"mx-auto max-w-5xl space-y-4 p-4",children:[(0,s.jsxs)("header",{className:"space-y-2",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"Control signals"}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-muted-foreground",children:[(0,s.jsxs)("span",{className:"rounded-full border border-border px-2 py-0.5",children:["total ",null!=(t=f.total)?t:0]}),(0,s.jsxs)("span",{className:"rounded-full border border-border px-2 py-0.5",children:["latest ",null!=(r=f.latest)?r:"-"]}),Object.entries(Q).map(e=>{let[t,r]=e;return(0,s.jsxs)("span",{className:"rounded-full border border-border px-2 py-0.5",children:[t," ",r]},t)})]})]}),(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault(),$()},className:"flex flex-wrap items-center gap-2 rounded-lg border border-border bg-card p-3 shadow-sm",children:[(0,s.jsx)(i.p,{value:y,onChange:e=>j(e.target.value),placeholder:"kind",className:"flex-1 min-w-[140px]"}),(0,s.jsx)(i.p,{value:k,onChange:e=>N(e.target.value),placeholder:"surface",className:"flex-1 min-w-[140px]"}),(0,s.jsxs)("select",{value:w,onChange:e=>C(e.target.value),className:"h-9 flex-1 min-w-[170px] rounded-md border border-input bg-background px-2 text-sm",children:[(0,s.jsx)("option",{value:"",children:"min urgency (any)"}),d.map(e=>(0,s.jsx)("option",{value:e,children:e},e))]}),(0,s.jsx)(i.p,{value:S,onChange:e=>I(e.target.value),placeholder:"session id",className:"flex-1 min-w-[140px]"}),(0,s.jsx)(i.p,{value:E,onChange:e=>M(e.target.value),placeholder:"limit",type:"number",className:"w-[100px]"}),(0,s.jsx)(l.$,{type:"submit",size:"sm",disabled:b,children:"Filter"})]}),(0,s.jsxs)("form",{onSubmit:H,className:"space-y-2 rounded-lg border border-border bg-card p-3 shadow-sm",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold",children:"Emit a signal"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)(i.p,{value:T,onChange:e=>D(e.target.value),placeholder:"kind (required)",className:"flex-1 min-w-[140px]"}),(0,s.jsx)("select",{value:P,onChange:e=>{let t=e.target.value;"string"==typeof t&&d.includes(t)&&L(t)},className:"h-9 rounded-md border border-input bg-background px-2 text-sm",children:d.map(e=>(0,s.jsx)("option",{value:e,children:e},e))}),(0,s.jsx)(i.p,{value:A,onChange:e=>R(e.target.value),placeholder:"source",className:"flex-1 min-w-[120px]"}),(0,s.jsx)(i.p,{value:O,onChange:e=>K(e.target.value),placeholder:"scope.surface",className:"flex-1 min-w-[120px]"}),(0,s.jsx)(i.p,{value:z,onChange:e=>J(e.target.value),placeholder:"scope.channel",className:"flex-1 min-w-[120px]"}),(0,s.jsx)(i.p,{value:U,onChange:e=>_(e.target.value),placeholder:"scope.session",className:"flex-1 min-w-[120px]"}),(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs",children:[(0,s.jsx)("input",{type:"checkbox",checked:q,onChange:e=>Y(e.target.checked)}),"mayPreempt"]})]}),(0,s.jsx)("textarea",{value:B,onChange:e=>F(e.target.value),placeholder:'payload JSON (optional, e.g. {"reason":"manual"})',rows:3,className:"w-full resize-y rounded-md border border-input bg-background px-3 py-2 font-mono text-xs"}),(0,s.jsx)(l.$,{type:"submit",size:"sm",disabled:b,children:"Emit"})]}),(0,s.jsx)(o,{items:null!=(x=f.items)?x:[]})]})}},44575:(e,t,r)=>{Promise.resolve().then(r.bind(r,3373))},85576:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(89117).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])}},e=>{e.O(0,[524,8378,2977,216,920,6062,7990,6998,4114,2330,1377,1201,5080,8519,2375,3441,9454,2929,8067,6284,8142,8619,8894,4836,6090,9651,6320,2367,6725,7358],()=>e(e.s=44575)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6364],{3373:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>O});var s=r(41121),n=r(91269),a=r(9050),l=r(48619),i=r(82157);function o(e){let{id:t,active:r,children:n}=e;return(0,s.jsx)("div",{role:"tabpanel","data-tab-id":t,"data-active":r?"true":"false",className:(0,i.cn)("h-full min-h-0",r?"block":"hidden"),children:n})}var d=r(6090),c=r(12455),u=r(60737),m=r(26320),x=r(7509),h=r(38894),p=r(41431),f=r(1428);function g(e){let{tab:t}=e;switch(t.kind){case"chat":return(0,s.jsx)(d.ChatPanel,{sessionId:t.sessionId,tabId:t.id});case"term":return(0,s.jsx)(c.zV,{});case"intake":return(0,s.jsx)(u.SY,{});case"tasks":return(0,s.jsx)(m.B,{});case"control":return(0,s.jsx)(x.U,{});case"settings":return(0,s.jsx)(h.O,{})}}function b(){return(0,s.jsx)("div",{className:"flex h-full items-center justify-center text-xs text-muted-foreground",children:(0,s.jsx)("span",{children:"(이 탭은 절약 모드 — 클릭 시 복원)"})})}function v(){let{state:e,addTab:t,activateTab:r}=(0,l.hA)(),a=(0,p.ub)(e),i=(0,n.useRef)(null);if((0,n.useEffect)(()=>{if(i.current&&!(a.length<=1))return(0,f.gI)(i.current,{shouldIgnore:e=>{if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return!!("INPUT"===t||"TEXTAREA"===t||"SELECT"===t||e.closest(".xterm"))||!!e.isContentEditable},onSwipe:t=>{let s=e.activeId?a.findIndex(t=>t.id===e.activeId):-1;if(s<0)return;let n="left"===t?Math.min(a.length-1,s+1):Math.max(0,s-1);n!==s&&r(a[n].id)}})},[a,e.activeId,r]),0===a.length)return(0,s.jsx)("div",{className:"flex h-full flex-col items-center justify-center gap-4 px-6 text-center",children:(0,s.jsxs)("div",{className:"rounded-lg border border-dashed border-border bg-card px-6 py-8 max-w-md",children:[(0,s.jsx)("h2",{className:"text-base font-semibold tracking-tight",children:"워크스페이스 시작"}),(0,s.jsxs)("p",{className:"mt-2 text-sm text-muted-foreground",children:["상단 strip 의"," ",(0,s.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs",children:"+"})," ","또는 아래 버튼으로 첫 탭을 추가하세요. 비활성 탭은 닫기 전까지 unmount 되지 않아 입력 중 텍스트가 보존됩니다."]}),(0,s.jsxs)("div",{className:"mt-4 flex flex-wrap justify-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>t({kind:"chat"}),className:"rounded-md border border-border bg-background px-3 py-1.5 text-sm hover:bg-secondary",children:"+ chat"}),(0,s.jsx)("button",{type:"button",onClick:()=>t({kind:"term"}),className:"rounded-md border border-border bg-background px-3 py-1.5 text-sm hover:bg-secondary",children:"+ terminal"})]})]})});let d=new Set(e.frozenIds);return(0,s.jsx)("div",{ref:i,className:"relative h-full min-h-0 touch-pan-y",children:a.map(t=>(0,s.jsx)(o,{id:t.id,active:e.activeId===t.id,children:d.has(t.id)?(0,s.jsx)(b,{}):(0,s.jsx)(g,{tab:t})},t.id))})}function y(){let e=(0,l.hA)();return(0,n.useEffect)(()=>{let t=t=>{if(!(t.metaKey||t.ctrlKey))return;let r=(0,p.ub)(e.state),s=e.state.activeId?r.findIndex(t=>t.id===e.state.activeId):-1;if(!t.shiftKey&&"t"===t.key.toLowerCase()){t.preventDefault(),e.openPicker({kind:"addNewChat"});return}if(!t.shiftKey&&"w"===t.key.toLowerCase()){t.preventDefault(),e.state.activeId&&r.length>0&&e.closeTab(e.state.activeId);return}if(t.shiftKey&&("]"===t.key||"["===t.key)){if(t.preventDefault(),r.length<=1||s<0)return;let n="]"===t.key?(s+1)%r.length:(s-1+r.length)%r.length;e.activateTab(r[n].id);return}if(!t.shiftKey&&/^[1-9]$/.test(t.key)){t.preventDefault();let s=parseInt(t.key,10)-1;if(s>=r.length)return;e.activateTab(r[s].id);return}};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e]),null}var j=r(72754),k=r(85576);let N=(0,r(89117).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);var w=r(69109),C=r(38519),S=r(27813),I=r(82443),E=r(47940),M=r(5159);function T(e){var t;let{open:r,session:a,onCancel:l,onConfirm:i,busy:o}=e;if((0,n.useEffect)(()=>{if(!r)return;let e=e=>{"Escape"===e.key&&l()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[r,l]),!r||!a)return null;let d=null!=(t=a.lastMsgPreview)?t:"(empty session)";return(0,s.jsx)("div",{role:"alertdialog","aria-modal":"true",className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/40",onClick:l,children:(0,s.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"w-[min(420px,calc(100vw-2rem))] rounded-lg border border-border bg-card p-5 shadow-lg",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(w.A,{className:"mt-0.5 h-5 w-5 shrink-0 text-rose-500","aria-hidden":!0}),(0,s.jsxs)("div",{className:"min-w-0 space-y-2",children:[(0,s.jsx)("h2",{className:"text-base font-semibold",children:"세션 잊기"}),(0,s.jsxs)("p",{className:"truncate font-mono text-xs text-muted-foreground",children:['"',d,'"']}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[a.origin&&(0,s.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono uppercase mr-1.5",children:a.origin}),a.msgCount," 메시지"]}),(0,s.jsx)("p",{className:"text-sm",children:"이 세션을 daemon 에서 영구 삭제합니다. 다른 디바이스 (cli/tg/dc) 에서 이 세션을 보고 있으면 unknown_session 으로 빠집니다."})]})]}),(0,s.jsxs)("div",{className:"mt-4 flex justify-end gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:l,disabled:o,className:"rounded-md border border-border bg-background px-3 py-1.5 text-sm hover:bg-secondary disabled:opacity-50",children:"취소"}),(0,s.jsx)("button",{type:"button",onClick:i,disabled:o,className:"rounded-md bg-rose-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-rose-600 disabled:opacity-50",children:o?"잊는 중…":"잊기"})]})]})})}var D=r(22967);let P={cli:"cli",pwa:"pwa",tg:"tg",dc:"dc"};function L(e){let{open:t,onClose:r,onPick:a,attachedSessions:l}=e,{client:o}=(0,C.Q)(),d=(0,I.hG)(o),c=(0,n.useMemo)(()=>new E.jU(o),[o]),u=(0,M.h)(),[m,x]=(0,n.useState)(""),[h,p]=(0,n.useState)(0),[f,g]=(0,n.useState)(null),[b,v]=(0,n.useState)(!1),[y,L]=(0,n.useState)(!1),[A,R]=(0,n.useState)(null),O=(0,n.useRef)(null),K=(0,n.useRef)(null);(0,n.useEffect)(()=>{t&&(x(""),p(0),R(null),d.forceRefresh())},[t,d]),(0,n.useEffect)(()=>{R(null)},[m]);let z=(0,n.useMemo)(()=>{if(!m.trim())return[...u];let e=m.trim().toLowerCase();return u.filter(t=>!!(t.id.toLowerCase().startsWith(e)||t.lastMsgPreview&&t.lastMsgPreview.toLowerCase().includes(e))||!!t.origin&&e==="[".concat(t.origin,"]")||!!t.origin&&e===t.origin)},[u,m]);if((0,n.useEffect)(()=>{h>=z.length&&p(Math.max(0,z.length-1))},[z.length,h]),(0,n.useEffect)(()=>{var e;if(!t)return;null==(e=O.current)||e.focus();let s=e=>{if("Escape"===e.key){e.preventDefault(),r();return}if((e.metaKey||e.ctrlKey)&&"n"===e.key.toLowerCase()){e.preventDefault(),J();return}if((e.metaKey||e.ctrlKey)&&"f"===e.key.toLowerCase()){var t;e.preventDefault(),null==(t=O.current)||t.focus();return}if("ArrowDown"===e.key)e.preventDefault(),p(e=>Math.min(z.length-1,e+1));else if("ArrowUp"===e.key)e.preventDefault(),p(e=>Math.max(0,e-1));else if("Enter"===e.key){let t=z[h];if(!t){m.trim().length>=4&&(e.preventDefault(),_());return}e.preventDefault(),U(t)}else if("Delete"===e.key||"Backspace"===e.key){if(e.target instanceof HTMLInputElement)return;let t=z[h];t&&(e.preventDefault(),g(t))}};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[t,z,h,r,m,y]),!t)return null;let J=()=>{a({kind:"new",sessionId:(0,S.f6)()})},U=e=>{let t=l.get(e.id);if(t)return void a({kind:"jumpToTab",tabId:t.tabId});a({kind:"existing",sessionId:e.id})},_=async()=>{let e=m.trim().toLowerCase();if(!(e.length<4)&&!y){L(!0);try{var t;let r=await c.list(!0),s=(0,E.nj)(null!=(t=r.sessions)?t:[],e);if("one"===s.kind){let e=l.get(s.id);e?a({kind:"jumpToTab",tabId:e.tabId}):a({kind:"existing",sessionId:s.id})}else"none"===s.kind?R("'".concat(e,"' 로 시작하는 세션이 없습니다.")):R("prefix 모호 — ".concat(s.count,"개 일치. 더 길게 입력하세요."))}catch(e){R("resolve 실패: ".concat(e instanceof Error?e.message:String(e)))}finally{L(!1)}}},B=async()=>{if(f){v(!0);try{await d.forget(f.id),g(null)}finally{v(!1)}}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":"채팅 세션 선택",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:r,children:(0,s.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"flex max-h-[min(640px,90vh)] w-[min(640px,calc(100vw-2rem))] flex-col rounded-lg border border-border bg-card shadow-lg",children:[(0,s.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-4 py-3",children:[(0,s.jsx)("h2",{className:"text-base font-semibold",children:"채팅 세션"}),(0,s.jsx)("button",{type:"button","aria-label":"close",onClick:r,className:"rounded-md p-1 text-muted-foreground hover:bg-secondary hover:text-foreground",children:(0,s.jsx)(j.A,{className:"h-4 w-4"})})]}),(0,s.jsx)("div",{className:"shrink-0 px-4 py-3",children:(0,s.jsxs)("button",{type:"button",onClick:J,className:"flex w-full items-center gap-3 rounded-lg border border-primary/40 bg-primary/10 px-3 py-2.5 text-left hover:bg-primary/15",children:[(0,s.jsx)(k.A,{className:"h-5 w-5 text-primary"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:"새 세션 시작"}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"비어있는 새 채팅을 엽니다 (⌘N)"})]})]})}),(0,s.jsx)("div",{className:"shrink-0 border-y border-border bg-muted/30 px-4 py-2",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(N,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,s.jsx)("input",{ref:O,value:m,onChange:e=>x(e.target.value),placeholder:"검색 — preview text \xb7 id \xb7 [pwa]/[cli]/[tg]/[dc]",className:"flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),m&&(0,s.jsx)("button",{type:"button","aria-label":"clear search",onClick:()=>x(""),className:"rounded p-0.5 text-muted-foreground hover:bg-background",children:(0,s.jsx)(j.A,{className:"h-3 w-3"})})]})}),(0,s.jsx)("div",{ref:K,className:"min-h-0 flex-1 overflow-y-auto",children:0===z.length?(0,s.jsxs)("div",{className:"px-4 py-12 text-center",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:0!==u.length||m.trim()?"검색과 일치하는 세션 없음.":'아직 채팅 세션이 없습니다. 위 "+ 새 세션 시작" 으로 첫 채팅을 시작하세요.'}),m.trim().length>=4&&(0,s.jsx)("button",{type:"button",disabled:y,onClick:()=>void _(),className:"mt-3 rounded-md border border-violet-500/40 bg-violet-500/10 px-3 py-1.5 text-xs text-violet-300 hover:bg-violet-500/15 disabled:opacity-50",children:y?"resolve 중…":"⑂ id prefix '".concat(m.trim(),"' 로 이어가기 (Enter)")}),A&&(0,s.jsx)("p",{className:"mt-2 text-xs text-amber-400",children:A}),0===u.length&&!m.trim()&&(0,s.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"다른 디바이스 (cli / telegram / discord) 에서 세션을 시작하면 여기에 자동으로 나타납니다."})]}):(0,s.jsx)("ul",{className:"divide-y divide-border",children:z.map((e,t)=>{var r;let n=l.get(e.id),a=t===h;return(0,s.jsx)("li",{children:(0,s.jsxs)("div",{className:(0,i.cn)("group flex items-center gap-3 px-4 py-2.5 transition-colors",a?"bg-primary/10 ring-1 ring-inset ring-primary/30":"hover:bg-secondary/50"),onMouseEnter:()=>p(t),children:[(0,s.jsxs)("button",{type:"button",onClick:()=>U(e),className:"flex min-w-0 flex-1 flex-col items-start text-left",children:[(0,s.jsxs)("div",{className:"flex w-full items-center gap-2",children:[(0,s.jsx)("span",{className:"truncate text-sm font-medium",children:null!=(r=e.lastMsgPreview)?r:(0,s.jsx)("span",{className:"text-muted-foreground italic",children:"(empty session)"})}),n&&(0,s.jsxs)("span",{className:"ml-auto shrink-0 rounded-full bg-primary/15 px-2 py-0.5 text-[10px] font-medium text-primary",children:["✓ open in ",n.label]})]}),(0,s.jsxs)("div",{className:"mt-0.5 flex items-center gap-2 text-[11px] text-muted-foreground",children:[e.origin&&(0,s.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono",children:P[e.origin]}),(0,s.jsx)("span",{children:function(e){try{let t=new Date(e).getTime();if(!Number.isFinite(t))return"";let r=Date.now()-t,s=Math.floor(r/6e4);if(s<1)return"방금 전";if(s<60)return"".concat(s,"분 전");let n=Math.floor(s/60);if(n<24)return"".concat(n,"시간 전");let a=Math.floor(n/24);if(a<7)return"".concat(a,"일 전");return new Date(t).toLocaleDateString()}catch(e){return""}}(e.lastTurnAt)}),(0,s.jsxs)("span",{children:["\xb7 ",e.msgCount," 메시지"]}),(0,s.jsx)(D.S,{sessionId:e.id,source:"picker",variant:"subtle",showCopyIcon:!1})]})]}),(0,s.jsx)("button",{type:"button","aria-label":"forget ".concat(e.id),onClick:t=>{t.stopPropagation(),g(e)},className:(0,i.cn)("shrink-0 rounded p-1.5 text-muted-foreground transition-colors hover:bg-rose-500/10 hover:text-rose-500",a?"opacity-100":"opacity-0 group-hover:opacity-100"),children:(0,s.jsx)(w.A,{className:"h-4 w-4"})})]})},e.id)})})}),(0,s.jsxs)("div",{className:"shrink-0 border-t border-border bg-muted/30 px-4 py-2 text-[10px] text-muted-foreground",children:[(0,s.jsx)("span",{className:"mr-3",children:"↑↓ 이동"}),(0,s.jsx)("span",{className:"mr-3",children:"Enter 선택"}),(0,s.jsx)("span",{className:"mr-3",children:"⌘N 새 세션"}),(0,s.jsx)("span",{className:"mr-3",children:"⌘F 검색"}),(0,s.jsx)("span",{children:"Del 잊기"})]})]})}),(0,s.jsx)(T,{open:null!==f,session:f,busy:b,onCancel:()=>g(null),onConfirm:B})]})}let A=new Set(["chat","term","intake","tasks","control","settings"]);function R(){var e;let t=(0,l.hA)(),r=(0,a.useRouter)(),i=(0,a.useSearchParams)(),o=null!=(e=null==i?void 0:i.get("intent"))?e:null,d=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(o&&d.current!==o){if(!A.has(o))return void r.replace("/workspace");if(d.current=o,"chat"===o){let e=(0,p.ub)(t.state).find(e=>"chat"===e.kind);e?t.activateTab(e.id):t.openPicker({kind:"addNewChat"})}else t.activateOrAdd(o);r.replace("/workspace")}},[o,t,r]);let c=(0,n.useMemo)(()=>{let e=new Map,r=0;for(let s of t.state.order){let n=t.state.tabs.find(e=>e.id===s);n&&"chat"===n.kind&&(r+=1,e.set(n.sessionId,{tabId:n.id,label:"chat#".concat(r)}))}return e},[t.state.order,t.state.tabs]);return(0,s.jsxs)("div",{className:"flex h-full flex-col",children:[(0,s.jsx)(y,{}),(0,s.jsx)("div",{className:"flex-1 min-h-0",children:(0,s.jsx)(v,{})}),(0,s.jsx)(L,{open:null!==t.pickerMode,onClose:t.closePicker,onPick:e=>{let r=t.pickerMode;r&&("jumpToTab"===e.kind?t.activateTab(e.tabId):"addNewChat"===r.kind?t.addTab({kind:"chat",sessionId:e.sessionId}):"attachToTab"===r.kind&&(t.updateChatTab(r.tabId,{sessionId:e.sessionId}),t.activateTab(r.tabId)),t.closePicker())},attachedSessions:c})]})}function O(){return(0,s.jsx)(n.Suspense,{fallback:(0,s.jsx)("div",{className:"h-full"}),children:(0,s.jsx)(R,{})})}},7509:(e,t,r)=>{"use strict";r.d(t,{U:()=>x});var s=r(41121),n=r(91269),a=r(38519),l=r(72030),i=r(59062);function o(e){let{items:t}=e;return 0===t.length?(0,s.jsx)("div",{className:"rounded-lg border border-dashed border-border p-6 text-center text-sm text-muted-foreground",children:"No control signals matched the current filter."}):(0,s.jsx)("ul",{className:"space-y-2",children:t.map((e,t)=>{var r,n,a,l,i;let o=[(null==(r=e.scope)?void 0:r.surface)&&"surface=".concat(e.scope.surface),(null==(n=e.scope)?void 0:n.channel)&&"channel=".concat(e.scope.channel),(null==(a=e.scope)?void 0:a.sessionId)&&"session=".concat(e.scope.sessionId)].filter(Boolean).join(" \xb7 ")||"unscoped";return(0,s.jsxs)("li",{className:"rounded-lg border border-border bg-card p-3 shadow-sm",children:[(0,s.jsxs)("div",{className:"text-sm font-medium",children:[e.kind," \xb7 ",e.urgency]}),(0,s.jsxs)("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground",children:[function(e){let t=Date.now()-new Date(e).getTime();return t<6e4?"just now":t<36e5?"".concat(Math.floor(t/6e4),"m ago"):t<864e5?"".concat(Math.floor(t/36e5),"h ago"):"".concat(Math.floor(t/864e5),"d ago")}(e.createdAt)," \xb7 ",null!=(l=e.source)?l:"unknown"," \xb7 ",o]}),(0,s.jsx)("pre",{className:"mt-2 overflow-x-auto rounded-md bg-muted p-2 text-[11px]",children:JSON.stringify(null!=(i=e.payload)?i:{},null,2)})]},t)})})}let d=["background","quick-pass","normal","priority","critical"];class c{async list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new URLSearchParams;Object.entries(e).forEach(e=>{let[r,s]=e;s&&t.set(r,s)});let r=t.toString();return this.client.fetchJson("/v1/control-signals".concat(r?"?".concat(r):""))}emit(e){return this.client.fetchJson("/v1/control-signals",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}constructor(e){this.client=e}}var u=r(66062),m=r(51215);function x(){var e,t,r,x;let{client:h}=(0,a.Q)(),p=(0,n.useMemo)(()=>new c(h),[h]),[f,g]=(0,n.useState)({items:[]}),[b,v]=(0,n.useState)(!1),[y,j]=(0,n.useState)(""),[k,N]=(0,n.useState)(""),[w,C]=(0,n.useState)(""),[S,I]=(0,n.useState)(""),[E,M]=(0,n.useState)(""),[T,D]=(0,n.useState)(""),[P,L]=(0,n.useState)("normal"),[A,R]=(0,n.useState)("operator"),[O,K]=(0,n.useState)(""),[z,J]=(0,n.useState)(""),[U,_]=(0,n.useState)(""),[B,F]=(0,n.useState)(""),[q,Y]=(0,n.useState)(!1),$=(0,n.useCallback)(async()=>{(0,m.cY)("webterm.control.list.refresh",{kind:y,surface:k,minUrgency:w,sessionId:S,limit:E}),v(!0);try{let e=await p.list({kind:y||void 0,surface:k||void 0,minUrgency:w||void 0,sessionId:S||void 0,limit:E||void 0});g(e)}catch(e){u.oR.error("signals list failed: ".concat(e instanceof Error?e.message:e))}finally{v(!1)}},[p,y,k,w,S,E]);(0,n.useEffect)(()=>{$()},[$]);let H=async e=>{if(e.preventDefault(),!T.trim())return void u.oR.error("kind required");let t={};if(B.trim())try{t=JSON.parse(B)}catch(e){u.oR.error("payload must be valid JSON");return}let r={kind:T.trim(),urgency:P,source:A.trim()||"operator",mayPreempt:q,payload:t,scope:{...O?{surface:O}:{},...z?{channel:z}:{},...U?{sessionId:U}:{}}};(0,m.cY)("webterm.control.emit",{kind:r.kind,urgency:r.urgency});try{v(!0),await p.emit(r),u.oR.success("signal emitted"),F(""),await $()}catch(e){u.oR.error("emit failed: ".concat(e instanceof Error?e.message:e))}finally{v(!1)}},Q=null!=(e=f.countsByKind)?e:{};return(0,s.jsxs)("div",{className:"mx-auto max-w-5xl space-y-4 p-4",children:[(0,s.jsxs)("header",{className:"space-y-2",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"Control signals"}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-muted-foreground",children:[(0,s.jsxs)("span",{className:"rounded-full border border-border px-2 py-0.5",children:["total ",null!=(t=f.total)?t:0]}),(0,s.jsxs)("span",{className:"rounded-full border border-border px-2 py-0.5",children:["latest ",null!=(r=f.latest)?r:"-"]}),Object.entries(Q).map(e=>{let[t,r]=e;return(0,s.jsxs)("span",{className:"rounded-full border border-border px-2 py-0.5",children:[t," ",r]},t)})]})]}),(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault(),$()},className:"flex flex-wrap items-center gap-2 rounded-lg border border-border bg-card p-3 shadow-sm",children:[(0,s.jsx)(i.p,{value:y,onChange:e=>j(e.target.value),placeholder:"kind",className:"flex-1 min-w-[140px]"}),(0,s.jsx)(i.p,{value:k,onChange:e=>N(e.target.value),placeholder:"surface",className:"flex-1 min-w-[140px]"}),(0,s.jsxs)("select",{value:w,onChange:e=>C(e.target.value),className:"h-9 flex-1 min-w-[170px] rounded-md border border-input bg-background px-2 text-sm",children:[(0,s.jsx)("option",{value:"",children:"min urgency (any)"}),d.map(e=>(0,s.jsx)("option",{value:e,children:e},e))]}),(0,s.jsx)(i.p,{value:S,onChange:e=>I(e.target.value),placeholder:"session id",className:"flex-1 min-w-[140px]"}),(0,s.jsx)(i.p,{value:E,onChange:e=>M(e.target.value),placeholder:"limit",type:"number",className:"w-[100px]"}),(0,s.jsx)(l.$,{type:"submit",size:"sm",disabled:b,children:"Filter"})]}),(0,s.jsxs)("form",{onSubmit:H,className:"space-y-2 rounded-lg border border-border bg-card p-3 shadow-sm",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold",children:"Emit a signal"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)(i.p,{value:T,onChange:e=>D(e.target.value),placeholder:"kind (required)",className:"flex-1 min-w-[140px]"}),(0,s.jsx)("select",{value:P,onChange:e=>{let t=e.target.value;"string"==typeof t&&d.includes(t)&&L(t)},className:"h-9 rounded-md border border-input bg-background px-2 text-sm",children:d.map(e=>(0,s.jsx)("option",{value:e,children:e},e))}),(0,s.jsx)(i.p,{value:A,onChange:e=>R(e.target.value),placeholder:"source",className:"flex-1 min-w-[120px]"}),(0,s.jsx)(i.p,{value:O,onChange:e=>K(e.target.value),placeholder:"scope.surface",className:"flex-1 min-w-[120px]"}),(0,s.jsx)(i.p,{value:z,onChange:e=>J(e.target.value),placeholder:"scope.channel",className:"flex-1 min-w-[120px]"}),(0,s.jsx)(i.p,{value:U,onChange:e=>_(e.target.value),placeholder:"scope.session",className:"flex-1 min-w-[120px]"}),(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs",children:[(0,s.jsx)("input",{type:"checkbox",checked:q,onChange:e=>Y(e.target.checked)}),"mayPreempt"]})]}),(0,s.jsx)("textarea",{value:B,onChange:e=>F(e.target.value),placeholder:'payload JSON (optional, e.g. {"reason":"manual"})',rows:3,className:"w-full resize-y rounded-md border border-input bg-background px-3 py-2 font-mono text-xs"}),(0,s.jsx)(l.$,{type:"submit",size:"sm",disabled:b,children:"Emit"})]}),(0,s.jsx)(o,{items:null!=(x=f.items)?x:[]})]})}},70034:(e,t,r)=>{Promise.resolve().then(r.bind(r,3373))},85576:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(89117).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])}},e=>{e.O(0,[524,8378,2977,216,920,6062,7990,6998,4114,2330,1377,1201,5080,8519,2375,3441,9454,2929,8067,6284,8142,8619,8894,4836,6090,9651,6320,2367,6725,7358],()=>e(e.s=70034)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2975],{6015:(e,t,s)=>{"use strict";s.d(t,{n:()=>u});var r=s(91269),i=s(95817),a=s(83026),n=s(37963),l=s(98883),o=class extends n.Q{#e;#t=void 0;#s;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,l.f8)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,l.EN)(t.mutationKey)!==(0,l.EN)(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(e)}#i(){let e=this.#s?.state??(0,i.$)();this.#t={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#a(e){a.jG.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,s=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#r.onSuccess?.(e.data,t,s,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,s,r)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#r.onError?.(e.error,t,s,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,s,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},c=s(24818);function u(e,t){let s=(0,c.jE)(t),[i]=r.useState(()=>new o(s,e));r.useEffect(()=>{i.setOptions(e)},[i,e]);let n=r.useSyncExternalStore(r.useCallback(e=>i.subscribe(a.jG.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),u=r.useCallback((e,t)=>{i.mutate(e,t).catch(l.lQ)},[i]);if(n.error&&(0,l.GU)(i.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:u,mutateAsync:n.mutate}}},7347:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(89117).A)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]])},51215:(e,t,s)=>{"use strict";let r;s.d(t,{cY:()=>u,x8:()=>l});let i={debug:0,info:1,warn:2,error:3},a="/v1/debug-logs/batch",n=null;function l(e){n=e}class o{health(){return{pending:this.queue.length,consecutiveFailures:this.consecutiveFailures,lastOkAt:this.lastOkAt,droppedByCap:this.droppedByCap,fallbackBatches:this.fallbackBatches}}push(e){if(!(i[function(e){let t=e.slice(e.lastIndexOf(".")+1).toLowerCase();return/^(error|exception|crash|fail|failed)$/.test(t)?"error":/^(warn|degraded|timeout)$/.test(t)?"warn":/^(boot|ready|start|begin|open|ok|done|resolve|end|stop|close)$/.test(t)?"info":"debug"}(e.category)]<i[this.minLevel])){if(this.queue.push(e),this.queue.length>500){let e=this.queue.length-500;this.droppedByCap+=e,this.queue.splice(0,e)}if(this.queue.length>=100&&!this.inFlight){null!==this.timer&&(clearTimeout(this.timer),this.timer=null),this.flush();return}null===this.timer&&(this.timer=setTimeout(()=>{this.flush()},this.flushMs))}}async flush(){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this.inFlight||0===this.queue.length)return;let e=this.queue.slice(0,100);this.inFlight=!0;let t=!1,s=JSON.stringify({records:e});try{var r,i;t=await (r=this.fetchFn(s),i=this.postTimeoutMs,new Promise((e,t)=>{let s=setTimeout(()=>t(Error("debug-forward timeout after ".concat(i,"ms"))),i);r.then(t=>{clearTimeout(s),e(t)},e=>{clearTimeout(s),t(e)})}))}catch(e){t=!1}finally{this.inFlight=!1}if(!t){if(this.consecutiveFailures+=1,this.consecutiveFailures>=2&&n)try{await n(JSON.stringify({records:[...e,this.blockedNotice()]}))&&(this.fallbackBatches+=1)}catch(e){}this.wasFailing=!0,this.scheduleRetry();return}let a=this.lastOkAt;this.lastOkAt=Date.now();let l=this.consecutiveFailures;this.consecutiveFailures=0,this.queue.splice(0,e.length),this.wasFailing&&(this.wasFailing=!1,this.queue.push({ts:new Date().toISOString(),category:"pwa.debug-forwarder.recovered",event:"recovered",data:{consecutiveFailures:l,droppedByCap:this.droppedByCap,fallbackBatches:this.fallbackBatches,pending:this.queue.length,previousOkAt:a},source:{platform:"pwa"}})),this.queue.length>0&&null===this.timer&&(this.timer=setTimeout(()=>{this.flush()},this.flushMs))}scheduleRetry(){if(null!==this.timer||0===this.queue.length)return;let e=Math.min(this.flushMs*2**this.consecutiveFailures,3e4);this.timer=setTimeout(()=>{this.flush()},e)}blockedNotice(){return{ts:new Date().toISOString(),category:"pwa.debug-forwarder.http-blocked",event:"http-blocked",data:{consecutiveFailures:this.consecutiveFailures,pending:this.queue.length,droppedByCap:this.droppedByCap,lastOkAt:this.lastOkAt,via:"acp-fallback"},source:{platform:"pwa"}}}beaconFlush(){if(0!==this.queue.length)try{if("undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon){let e=this.queue.slice(0,100),t=new Blob([JSON.stringify({records:e})],{type:"application/json"});navigator.sendBeacon(a,t)&&this.queue.splice(0,e.length)}}catch(e){}}get pending(){return this.queue.length}constructor(e=c,t="debug",s=1e4,r=100){this.fetchFn=e,this.minLevel=t,this.postTimeoutMs=s,this.flushMs=r,this.queue=[],this.timer=null,this.inFlight=!1,this.consecutiveFailures=0,this.lastOkAt=null,this.droppedByCap=0,this.fallbackBatches=0,this.wasFailing=!1}}async function c(e){return(await fetch(a,{method:"POST",headers:{"content-type":"application/json"},body:e,keepalive:!0,..."undefined"!=typeof AbortSignal&&"function"==typeof AbortSignal.timeout?{signal:AbortSignal.timeout(1e4)}:{}})).ok}function u(e,t){if("undefined"==typeof console)return;let s=new Date().toISOString();if(void 0!==t){let r="";try{let e=new WeakSet;r=JSON.stringify(t,(t,s)=>{if("bigint"==typeof s)return"".concat(s.toString(),"n");if("function"==typeof s)return"[fn ".concat(s.name||"anon","]");if(s&&"object"==typeof s){if(e.has(s))return"[circular]";e.add(s)}return s})}catch(e){r="[unserializable: ".concat(String(e),"]")}r&&r.length>800&&(r=r.slice(0,797)+"..."),console.debug("[".concat(s,"] ").concat(e," ").concat(r),t),d(s,e,r)}else console.debug("[".concat(s,"] ").concat(e)),d(s,e,void 0)}function d(e,t,s){let i,a=function(){if(void 0!==r)return r;let e=function(){try{let e="off"!==window.localStorage.getItem("elanous.pwa.debug.forward"),t=window.localStorage.getItem("elanous.pwa.debug.forwardLevel");return{forward:e,level:"info"===t||"warn"===t||"error"===t?t:"debug"}}catch(e){return{forward:!0,level:"debug"}}}();if(!e.forward)return r=null,null;let t=new o(c,e.level,1e4,1500);try{window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&t.beaconFlush()})}catch(e){}return r=t,t}();if(!a)return;let n=t.slice(t.lastIndexOf(".")+1)||t;if(void 0!==s&&""!==s)try{i=JSON.parse(s)}catch(e){i=s}a.push({ts:e,category:t,event:n,...void 0!==i?{data:i}:{},source:{platform:"pwa"}})}},67089:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(89117).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},67842:(e,t,s)=>{"use strict";s.d(t,{AF:()=>r});let r={all:["nexus"],health:()=>[...r.all,"health"],snapshot:()=>[...r.all,"snapshot"],tabs:e=>e?[...r.all,"tabs",{kind:e}]:[...r.all,"tabs"],tab:e=>[...r.all,"tab",e],templates:()=>[...r.all,"templates"],template:e=>[...r.all,"template",e],config:()=>[...r.all,"config"],switches:()=>[...r.all,"switches"],switch:e=>[...r.all,"switch",e],secrets:()=>[...r.all,"secrets"],bindingChannels:()=>[...r.all,"bindings","channels"],bindings:e=>[...r.all,"bindings",e],binding:(e,t)=>[...r.all,"binding",e,t],logsTail:(e,t)=>t?[...r.all,"logs",e,{lines:t}]:[...r.all,"logs",e],workflows:()=>[...r.all,"workflows"],workflow:e=>[...r.all,"workflow",e],workflowRun:e=>[...r.all,"workflow-run",e],workflowRuns:()=>[...r.all,"workflow-runs"],pendingApprovals:()=>[...r.all,"workflow-pending-approvals"],platforms:()=>[...r.all,"platforms"],providers:()=>[...r.all,"providers"],worktrees:()=>[...r.all,"worktrees"],designCheck:()=>[...r.all,"design-check"],designPreviews:()=>[...r.all,"design-previews"],designPreview:e=>[...r.all,"design-preview",e],registryCatalog:()=>[...r.all,"registry-catalog"],resolvedView:()=>[...r.all,"resolved-view"]};r.snapshot(),r.tabs(),r.health(),r.snapshot(),r.config(),r.switches()},69109:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(89117).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},81403:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>O});var r=s(41121),i=s(91269),a=s(93981),n=s(7347),l=s(84081),o=s(89117);let c=(0,o.A)("folder-tree",[["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"}]]);var u=s(99608),d=s(67089);let h=(0,o.A)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);var p=s(69109),m=s(91514),f=s(42012),x=s(24818),g=s(6015),y=s(67842),b=s(42375);let w={orphan:0,active:1,detached:2,idle:3,main:4},v={orphan:"Orphan",active:"Active",detached:"Detached",idle:"Idle",main:"Main"},k={orphan:"bg-error/10 text-error",active:"bg-green-600/10 text-green-700",detached:"bg-warning/10 text-warning",idle:"bg-muted text-muted-foreground",main:"bg-primary/10 text-primary"},j={orphan:a.A,active:n.A,detached:l.A,idle:c,main:c};function N(){return(0,m.Qj)()?(0,r.jsx)(M,{}):(0,r.jsxs)("div",{className:"mx-auto max-w-2xl space-y-2 p-6",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"Worktrees"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"Connect to a NEXUS daemon to see active worktrees."})]})}function M(){var e,t,s,n;let{data:l,isLoading:o,error:N,refetch:M,isFetching:O}=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=(0,m.M1)();return(0,f.I)({queryKey:y.AF.worktrees(),queryFn:()=>s.getWorktrees(),enabled:null==(e=t.enabled)||e,refetchInterval:5e3})}(),S=function(){let e=(0,m.M1)(),t=(0,x.jE)();return(0,g.n)({mutationFn:async t=>{try{return await e.disposeWorktree(t)}catch(t){let e=function(e){if(e instanceof b.Iu&&e.body&&"object"==typeof e.body){let t=e.body;if("ok"in t)return t}return null}(t);if(e)return e;throw t}},onSuccess:e=>{e.ok&&t.invalidateQueries({queryKey:y.AF.worktrees()})}})}(),[C,F]=(0,i.useState)(null),q=null!=(e=null==l?void 0:l.repoRoot)?e:null,E=null!=(t=null==l?void 0:l.worktrees)?t:[],R=null!=(s=null==l?void 0:l.orphanedSessions)?s:[],I=E.map(e=>({view:e,status:e.orphan?"orphan":e.isMain?"main":e.isDetached?"detached":e.session&&e.session.alive?"active":"idle"})).sort((e,t)=>{var s,r,i,a;let n=null!=(s=w[e.status])?s:99,l=null!=(r=w[t.status])?r:99;if(n!==l)return n-l;let o=null!=(i=e.view.branch)?i:"~detached",c=null!=(a=t.view.branch)?a:"~detached";return o.localeCompare(c)}),B=function(e){let t={total:e.length,active:0,orphan:0,idle:0,detached:0,main:0};for(let s of e)t[s.status]+=1;return t}(I),P=Date.now(),T=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=!0===t.force,r=s?"Force-remove this worktree (will discard local changes)?\n\n".concat(e):t.locked?"This worktree is locked. Removing it will fail unless you force.\nProceed with --force?\n\n".concat(e):"Remove this worktree?\n\n".concat(e);if(!window.confirm(r))return;let i=await S.mutateAsync({path:e,force:s||!0===t.locked});F({path:e,result:i})};return(0,r.jsxs)("div",{className:"mx-auto max-w-5xl space-y-4 p-6",children:[(0,r.jsxs)("header",{className:"space-y-1",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("h1",{className:"flex items-center gap-2 text-xl font-semibold tracking-tight",children:[(0,r.jsx)(c,{className:"h-5 w-5"}),"Worktrees"]}),(0,r.jsxs)("button",{type:"button",onClick:()=>M(),disabled:O,"aria-label":"Refresh worktrees",className:"flex items-center gap-1 rounded-md border border-border px-2 py-1 text-[11px] hover:bg-surface-elevated disabled:opacity-50",children:[(0,r.jsx)(u.A,{className:"h-3 w-3 ".concat(O?"animate-spin":"")}),"Refresh"]})]}),q?(0,r.jsx)("p",{className:"text-[11px] font-mono text-muted-foreground",children:q}):(0,r.jsxs)("p",{className:"text-[11px] text-muted-foreground",children:["No repository found. Set ",(0,r.jsx)("code",{className:"font-mono",children:"harness.defaultRepo"})," (absolute path) in Settings, or start NEXUS inside a checkout."]})]}),N&&(0,r.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-error",children:[(0,r.jsx)(d.A,{className:"h-3 w-3"}),N instanceof Error?N.message:"Failed to load worktrees"]}),o&&!l&&(0,r.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"Querying /v1/worktrees…"}),l&&(0,r.jsx)(A,{summary:B}),C&&(0,r.jsx)("div",{"data-testid":"worktree-dispose-result","data-result-status":C.result.ok?"ok":"error",className:"rounded-md border px-2.5 py-1.5 text-[11px] ".concat(C.result.ok?"border-green-600/40 bg-green-600/5 text-green-700":"border-error/40 bg-error/5 text-error"),children:(0,r.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,r.jsxs)("span",{children:[C.result.ok?"".concat("orphan-session-cleanup"===C.result.action?"Cleared orphan session":"Removed worktree"," — ").concat(C.path):"Dispose failed — ".concat(null!=(n=C.result.error)?n:"unknown error"),C.result.detail&&(0,r.jsxs)("span",{className:"ml-1 font-mono text-[10px] opacity-80",children:["(",C.result.detail,")"]})]}),(0,r.jsx)("button",{type:"button",onClick:()=>F(null),className:"text-[10px] underline opacity-70 hover:opacity-100",children:"dismiss"})]})}),l&&I.length>0&&(0,r.jsx)("section",{"data-testid":"worktree-list",className:"overflow-x-auto rounded-md border border-border",children:(0,r.jsxs)("table",{className:"min-w-full text-[11px]",children:[(0,r.jsx)("thead",{className:"bg-surface-elevated",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"px-2 py-1.5 text-left font-medium",children:"Status"}),(0,r.jsx)("th",{className:"px-2 py-1.5 text-left font-medium",children:"Branch"}),(0,r.jsx)("th",{className:"px-2 py-1.5 text-left font-medium",children:"Path"}),(0,r.jsx)("th",{className:"px-2 py-1.5 text-left font-medium",children:"SHA"}),(0,r.jsx)("th",{className:"px-2 py-1.5 text-left font-medium",children:"Owner"}),(0,r.jsx)("th",{className:"px-2 py-1.5 text-left font-medium",children:"Entered"}),(0,r.jsx)("th",{className:"px-2 py-1.5 text-right font-medium",children:"Actions"})]})}),(0,r.jsx)("tbody",{children:I.map(e=>{var t;let{view:s,status:i}=e,a=j[i];return(0,r.jsxs)("tr",{"data-testid":"worktree-row-".concat(s.path),"data-status":i,className:"border-t border-border",children:[(0,r.jsxs)("td",{className:"px-2 py-1.5",children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-wider ".concat(k[i]),children:[(0,r.jsx)(a,{className:"h-3 w-3"}),v[i]]}),s.isLocked&&(0,r.jsx)("span",{title:"locked",className:"ml-1 inline-flex items-center text-warning",children:(0,r.jsx)(h,{className:"h-3 w-3"})})]}),(0,r.jsx)("td",{className:"px-2 py-1.5 font-mono",children:null!=(t=s.branch)?t:(0,r.jsx)("span",{className:"text-muted-foreground",children:"—"})}),(0,r.jsx)("td",{className:"px-2 py-1.5 font-mono text-[10px] text-muted-foreground",children:s.path}),(0,r.jsx)("td",{className:"px-2 py-1.5 font-mono text-[10px] text-muted-foreground",children:s.sha.slice(0,7)}),(0,r.jsx)("td",{className:"px-2 py-1.5",children:s.session?(0,r.jsxs)("span",{className:"text-[10px] ".concat(s.session.alive?"text-foreground":"text-error"),children:["pid ",s.session.sessionId,s.session.alive?" (alive)":" (dead — orphan)"]}):(0,r.jsx)("span",{className:"text-[10px] text-muted-foreground",children:"—"})}),(0,r.jsx)("td",{className:"px-2 py-1.5 text-[10px] text-muted-foreground",children:s.session?function(e,t){if(void 0===t)return"";let s=Math.floor(Math.max(0,e-t)/1e3);if(s<60)return"".concat(s,"s ago");let r=Math.floor(s/60);if(r<60)return"".concat(r,"m ago");let i=Math.floor(r/60);if(i<24)return"".concat(i,"h ago");let a=Math.floor(i/24);return"".concat(a,"d ago")}(P,s.session.enteredAt):""}),(0,r.jsx)("td",{className:"px-2 py-1.5 text-right",children:s.isMain?(0,r.jsx)("span",{className:"text-[10px] text-muted-foreground",children:"—"}):(0,r.jsxs)("button",{type:"button","data-testid":"dispose-worktree-".concat(s.path),onClick:()=>T(s.path,{locked:s.isLocked}),disabled:S.isPending,className:"inline-flex items-center gap-1 rounded-md border border-border px-1.5 py-0.5 text-[10px] text-error hover:bg-error/10 disabled:opacity-50","aria-label":"Dispose worktree ".concat(s.path),children:[(0,r.jsx)(p.A,{className:"h-3 w-3"}),"Dispose"]})})]},s.path)})})]})}),l&&0===I.length&&(0,r.jsx)("p",{className:"text-[11px] text-muted-foreground","data-testid":"worktree-empty",children:"No worktrees registered."}),l&&R.length>0&&(0,r.jsxs)("section",{"data-testid":"orphaned-sessions",className:"space-y-1",children:[(0,r.jsxs)("h2",{className:"flex items-center gap-1 text-sm font-medium text-warning",children:[(0,r.jsx)(a.A,{className:"h-4 w-4"}),"Orphaned sessions (",R.length,")"]}),(0,r.jsxs)("p",{className:"text-[10px] text-muted-foreground",children:["Worktree directory was removed (e.g., via ",(0,r.jsx)("code",{children:"git worktree remove"}),") but the session JSON wasn't cleaned. Boot-time stale-cleanup will reap these the next time NEXUS restarts."]}),(0,r.jsx)("ul",{className:"space-y-1 text-[11px]",children:R.map(e=>(0,r.jsxs)("li",{"data-testid":"orphan-session-".concat(e.sessionId),className:"rounded-md border border-warning/40 bg-warning/5 px-2 py-1.5",children:[(0,r.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("span",{className:"font-mono",children:["pid ",e.sessionId]})," ",(0,r.jsxs)("span",{className:"text-muted-foreground",children:["(",e.alive?"alive (unusual)":"dead",")"]})]}),(0,r.jsxs)("button",{type:"button","data-testid":"cleanup-orphan-".concat(e.sessionId),onClick:()=>T(e.worktreePath),disabled:S.isPending,className:"inline-flex items-center gap-1 rounded-md border border-border px-1.5 py-0.5 text-[10px] text-error hover:bg-error/10 disabled:opacity-50","aria-label":"Clear orphan session ".concat(e.sessionId),children:[(0,r.jsx)(p.A,{className:"h-3 w-3"}),"Cleanup"]})]}),(0,r.jsxs)("div",{className:"font-mono text-[10px] text-muted-foreground",children:["branch ",(0,r.jsx)("strong",{children:e.branch})," \xb7 ",e.worktreePath]})]},e.sessionId))})]})]})}function A(e){let{summary:t}=e,s=[{label:"Total",value:t.total,cls:"text-foreground"},{label:"Active",value:t.active,cls:"text-green-700"},{label:"Orphan",value:t.orphan,cls:"text-error"},{label:"Idle",value:t.idle,cls:"text-muted-foreground"},{label:"Detached",value:t.detached,cls:"text-warning"}];return(0,r.jsx)("div",{"data-testid":"worktree-summary",className:"flex flex-wrap items-baseline gap-3 text-[11px]",children:s.map(e=>(0,r.jsxs)("span",{className:"flex items-baseline gap-1",children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e.label}),(0,r.jsx)("span",{className:"font-medium ".concat(e.cls),children:e.value})]},e.label))})}function O(){return(0,r.jsx)(N,{})}},84081:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(89117).A)("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]])},90367:(e,t,s)=>{Promise.resolve().then(s.bind(s,81403))},91514:(e,t,s)=>{"use strict";s.d(t,{M1:()=>c,Qj:()=>u,tI:()=>o});var r=s(41121),i=s(91269),a=s(19855),n=s(24818);let l=(0,i.createContext)(null);function o(e){let{client:t,queryClient:s,defaultStaleTimeMs:o,children:c}=e,u=(0,i.useMemo)(()=>null!=s?s:new a.E({defaultOptions:{queries:{staleTime:null!=o?o:2e3,refetchOnWindowFocus:!1}}}),[s,o]);return(0,r.jsx)(l.Provider,{value:t,children:(0,r.jsx)(n.Ht,{client:u,children:c})})}function c(){let e=(0,i.useContext)(l);if(!e)throw Error("useNexusClient must be used within <NexusProvider>");return e}function u(){return(0,i.useContext)(l)}},91644:(e,t,s)=>{"use strict";s.d(t,{Qb:()=>n,SI:()=>o,dJ:()=>l});let r="elanous:auth-required",i=null,a=!1;function n(e){null===i&&(i=e,window.dispatchEvent(new CustomEvent(r,{detail:{path:e}})))}function l(e){let t=window,s=t=>e(t.detail);return t.addEventListener(r,s),null===i||a||e({path:i}),()=>t.removeEventListener(r,s)}function o(){a=!0}},93981:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(89117).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},99608:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(89117).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])}},e=>{e.O(0,[920,6998,2375,2367,6725,7358],()=>e(e.s=90367)),_N_E=e.O()}]);
|