elanous 0.2.17 → 0.2.18

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.
Files changed (309) hide show
  1. package/apps/pwa/out/404/index.html +1 -1
  2. package/apps/pwa/out/404.html +1 -1
  3. package/apps/pwa/out/_next/static/P6YTVgzuZz5oTZhY4Din_/_buildManifest.js +1 -0
  4. package/apps/pwa/out/_next/static/chunks/{1307-aac7332576c4d6fc.js → 1307-30dff22c9e1f3073.js} +1 -1
  5. package/apps/pwa/out/_next/static/chunks/195-fb1d7690bf30bab4.js +1 -0
  6. package/apps/pwa/out/_next/static/chunks/1986-33e13d648a9df765.js +1 -0
  7. package/apps/pwa/out/_next/static/chunks/2537-6c289376caa88ca1.js +1 -0
  8. package/apps/pwa/out/_next/static/chunks/2699-325cc923ba7b8631.js +1 -0
  9. package/apps/pwa/out/_next/static/chunks/3857-4f936cdb30322aa6.js +1 -0
  10. package/apps/pwa/out/_next/static/chunks/4554-5761612531d0146b.js +1 -0
  11. package/apps/pwa/out/_next/static/chunks/4565-3d7e3fdeb43686a8.js +1 -0
  12. package/apps/pwa/out/_next/static/chunks/5977-a11f37254196b659.js +1 -0
  13. package/apps/pwa/out/_next/static/chunks/{6158.9c0449a9a8d0064b.js → 6158.af2e93b7adff709b.js} +1 -1
  14. package/apps/pwa/out/_next/static/chunks/6877-74399f69c7da1433.js +1 -0
  15. package/apps/pwa/out/_next/static/chunks/7797-df5aa0381fdc078f.js +1 -0
  16. package/apps/pwa/out/_next/static/chunks/8401-8615a660c84cdb03.js +1 -0
  17. package/apps/pwa/out/_next/static/chunks/8695-846034ce44852c70.js +1 -0
  18. package/apps/pwa/out/_next/static/chunks/app/approvals/{page-3143b07a817d1da9.js → page-d92f7ee3994e84c7.js} +1 -1
  19. package/apps/pwa/out/_next/static/chunks/app/autopilot/{page-17ba086ef82d339b.js → page-4733c967b56a4277.js} +1 -1
  20. package/apps/pwa/out/_next/static/chunks/app/board/{page-7eb661ff23af7da2.js → page-d22fd849cc22f104.js} +1 -1
  21. package/apps/pwa/out/_next/static/chunks/app/botlab/page-bb742f995c6769e7.js +1 -0
  22. package/apps/pwa/out/_next/static/chunks/app/bots/{page-6e5c3a867557298b.js → page-02b073a2ac793b83.js} +1 -1
  23. package/apps/pwa/out/_next/static/chunks/app/ceo/page-60c3da708f9a0ccc.js +1 -0
  24. package/apps/pwa/out/_next/static/chunks/app/chat/page-8a9b3594bc23289b.js +1 -0
  25. package/apps/pwa/out/_next/static/chunks/app/consult/{page-5e77cd1802567c89.js → page-a0eb02638b1e6f31.js} +1 -1
  26. package/apps/pwa/out/_next/static/chunks/app/control/page-308111abadf35670.js +1 -0
  27. package/apps/pwa/out/_next/static/chunks/app/decisions/page-6eaf7bac37830c21.js +1 -0
  28. package/apps/pwa/out/_next/static/chunks/app/design-check/{page-4187666132fc98c4.js → page-5d97b2901e0d1ea6.js} +1 -1
  29. package/apps/pwa/out/_next/static/chunks/app/editor/{page-09328d499162bae4.js → page-c39554c321576982.js} +1 -1
  30. package/apps/pwa/out/_next/static/chunks/app/exec/{page-29ff3a8f84f03b6a.js → page-8c3d8e63ae2e1c98.js} +1 -1
  31. package/apps/pwa/out/_next/static/chunks/app/field/{page-80ec7401bc83f511.js → page-9b72a07d424701c6.js} +1 -1
  32. package/apps/pwa/out/_next/static/chunks/app/inside/page-bd5d586429167fea.js +1 -0
  33. package/apps/pwa/out/_next/static/chunks/app/intake/{page-fc7d86467291ae38.js → page-a572f58cd3ca5864.js} +1 -1
  34. package/apps/pwa/out/_next/static/chunks/app/layout-59b7834d497c2255.js +1 -0
  35. package/apps/pwa/out/_next/static/chunks/app/live/page-be5ea965a07fbc41.js +1 -0
  36. package/apps/pwa/out/_next/static/chunks/app/loops/{page-0e2d6985fb42cd2f.js → page-c130b63862437814.js} +1 -1
  37. package/apps/pwa/out/_next/static/chunks/app/market/{page-13e4108999f58d13.js → page-fa244bd146a00ae8.js} +1 -1
  38. package/apps/pwa/out/_next/static/chunks/app/missions/[id]/{page-e8296ee284aa1293.js → page-44d56d6391965a6a.js} +1 -1
  39. package/apps/pwa/out/_next/static/chunks/app/morning/{page-043a9111e74f6b24.js → page-83a700d4c754d802.js} +1 -1
  40. package/apps/pwa/out/_next/static/chunks/app/{not-found-23a4601ceb7f452e.js → not-found-7b3170f374f77b9d.js} +1 -1
  41. package/apps/pwa/out/_next/static/chunks/app/observatory/page-5f23d0c66a3b4793.js +1 -0
  42. package/apps/pwa/out/_next/static/chunks/app/ops/checklist/{page-10d958605a77b3bd.js → page-a3c58f5c72a5f3f9.js} +1 -1
  43. package/apps/pwa/out/_next/static/chunks/app/ops/release/page-a2c4625596f8d69c.js +1 -0
  44. package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-0e9099531d239f11.js +1 -0
  45. package/apps/pwa/out/_next/static/chunks/app/outputs/{page-7a1d85e121065cc8.js → page-e8e1ecaea7cd71d2.js} +1 -1
  46. package/apps/pwa/out/_next/static/chunks/app/page-a1b7ffed710a93e0.js +1 -0
  47. package/apps/pwa/out/_next/static/chunks/app/reflection/{page-12916918988ac97e.js → page-1467047104141297.js} +1 -1
  48. package/apps/pwa/out/_next/static/chunks/app/scheduler/{page-d8a3347a9d0c3f4a.js → page-2da6f9b8a38c6978.js} +1 -1
  49. package/apps/pwa/out/_next/static/chunks/app/sessions/page-102310930791197a.js +1 -0
  50. package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-f331e38fefc00393.js +1 -0
  51. package/apps/pwa/out/_next/static/chunks/app/settings/page-6ed0b73bae8351d8.js +1 -0
  52. package/apps/pwa/out/_next/static/chunks/app/setup/done/{page-1d824510df025d18.js → page-44d5f767491692bf.js} +1 -1
  53. package/apps/pwa/out/_next/static/chunks/app/setup/page-43336055451f6e37.js +1 -0
  54. package/apps/pwa/out/_next/static/chunks/app/share/{page-7f49fe645d5132f7.js → page-3cc47dca0922ab9a.js} +1 -1
  55. package/apps/pwa/out/_next/static/chunks/app/showroom/page-a77ee355a2304ff0.js +1 -0
  56. package/apps/pwa/out/_next/static/chunks/app/tasks/{page-27d71f131acd9320.js → page-b17cd46cf0e9b8cf.js} +1 -1
  57. package/apps/pwa/out/_next/static/chunks/app/term/page-61553851aa606146.js +1 -0
  58. package/apps/pwa/out/_next/static/chunks/app/today/page-a1f585e154e61c59.js +1 -0
  59. package/apps/pwa/out/_next/static/chunks/app/trace/{page-424659bacfb8cdd7.js → page-7bf54c9bb9274af8.js} +1 -1
  60. package/apps/pwa/out/_next/static/chunks/app/vault/page-5150ef17b5383a57.js +1 -0
  61. package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-b9d8ce70792c1672.js +1 -0
  62. package/apps/pwa/out/_next/static/chunks/app/workflows/page-a5a3de231f2cc7d5.js +1 -0
  63. package/apps/pwa/out/_next/static/chunks/app/workspace/{page-5d4fef9ccd7d406b.js → page-134da468538baf48.js} +1 -1
  64. package/apps/pwa/out/_next/static/chunks/app/worktrees/page-31ac4afa2dcd915c.js +1 -0
  65. package/apps/pwa/out/_next/static/chunks/{webpack-539cde99554be20f.js → webpack-c2782b330447ffb6.js} +1 -1
  66. package/apps/pwa/out/_next/static/css/7fa358fec7da7c47.css +1 -0
  67. package/apps/pwa/out/approvals/index.html +1 -1
  68. package/apps/pwa/out/approvals/index.txt +14 -14
  69. package/apps/pwa/out/autopilot/index.html +1 -1
  70. package/apps/pwa/out/autopilot/index.txt +14 -14
  71. package/apps/pwa/out/board/index.html +1 -1
  72. package/apps/pwa/out/board/index.txt +14 -14
  73. package/apps/pwa/out/botlab/index.html +1 -1
  74. package/apps/pwa/out/botlab/index.txt +14 -14
  75. package/apps/pwa/out/bots/index.html +1 -1
  76. package/apps/pwa/out/bots/index.txt +14 -14
  77. package/apps/pwa/out/ceo/index.html +1 -1
  78. package/apps/pwa/out/ceo/index.txt +14 -14
  79. package/apps/pwa/out/chat/index.html +1 -1
  80. package/apps/pwa/out/chat/index.txt +14 -14
  81. package/apps/pwa/out/consult/index.html +1 -1
  82. package/apps/pwa/out/consult/index.txt +14 -14
  83. package/apps/pwa/out/control/index.html +1 -1
  84. package/apps/pwa/out/control/index.txt +14 -14
  85. package/apps/pwa/out/decisions/index.html +1 -0
  86. package/apps/pwa/out/decisions/index.txt +30 -0
  87. package/apps/pwa/out/design-check/index.html +1 -1
  88. package/apps/pwa/out/design-check/index.txt +14 -14
  89. package/apps/pwa/out/editor/index.html +1 -1
  90. package/apps/pwa/out/editor/index.txt +14 -14
  91. package/apps/pwa/out/exec/index.html +1 -1
  92. package/apps/pwa/out/exec/index.txt +14 -14
  93. package/apps/pwa/out/field/index.html +1 -1
  94. package/apps/pwa/out/field/index.txt +14 -14
  95. package/apps/pwa/out/healthz +1 -1
  96. package/apps/pwa/out/index.html +1 -1
  97. package/apps/pwa/out/index.txt +14 -14
  98. package/apps/pwa/out/inside/index.html +1 -1
  99. package/apps/pwa/out/inside/index.txt +14 -14
  100. package/apps/pwa/out/intake/index.html +1 -1
  101. package/apps/pwa/out/intake/index.txt +14 -14
  102. package/apps/pwa/out/live/index.html +1 -1
  103. package/apps/pwa/out/live/index.txt +14 -14
  104. package/apps/pwa/out/loops/index.html +1 -1
  105. package/apps/pwa/out/loops/index.txt +14 -14
  106. package/apps/pwa/out/market/index.html +1 -1
  107. package/apps/pwa/out/market/index.txt +14 -14
  108. package/apps/pwa/out/missions/placeholder/index.html +1 -1
  109. package/apps/pwa/out/missions/placeholder/index.txt +14 -14
  110. package/apps/pwa/out/morning/index.html +1 -1
  111. package/apps/pwa/out/morning/index.txt +14 -14
  112. package/apps/pwa/out/observatory/index.html +1 -1
  113. package/apps/pwa/out/observatory/index.txt +14 -14
  114. package/apps/pwa/out/ops/checklist/index.html +1 -1
  115. package/apps/pwa/out/ops/checklist/index.txt +14 -14
  116. package/apps/pwa/out/ops/release/index.html +1 -1
  117. package/apps/pwa/out/ops/release/index.txt +14 -14
  118. package/apps/pwa/out/ops/seats/index.html +1 -1
  119. package/apps/pwa/out/ops/seats/index.txt +14 -14
  120. package/apps/pwa/out/outputs/index.html +1 -1
  121. package/apps/pwa/out/outputs/index.txt +14 -14
  122. package/apps/pwa/out/reflection/index.html +1 -1
  123. package/apps/pwa/out/reflection/index.txt +15 -15
  124. package/apps/pwa/out/scheduler/index.html +1 -1
  125. package/apps/pwa/out/scheduler/index.txt +14 -14
  126. package/apps/pwa/out/sessions/index.html +1 -1
  127. package/apps/pwa/out/sessions/index.txt +14 -14
  128. package/apps/pwa/out/settings/devices/index.html +1 -1
  129. package/apps/pwa/out/settings/devices/index.txt +14 -14
  130. package/apps/pwa/out/settings/index.html +1 -1
  131. package/apps/pwa/out/settings/index.txt +14 -14
  132. package/apps/pwa/out/setup/done/index.html +1 -1
  133. package/apps/pwa/out/setup/done/index.txt +14 -14
  134. package/apps/pwa/out/setup/index.html +1 -1
  135. package/apps/pwa/out/setup/index.txt +14 -14
  136. package/apps/pwa/out/share/index.html +1 -1
  137. package/apps/pwa/out/share/index.txt +14 -14
  138. package/apps/pwa/out/showroom/index.html +1 -1
  139. package/apps/pwa/out/showroom/index.txt +14 -14
  140. package/apps/pwa/out/tasks/index.html +1 -1
  141. package/apps/pwa/out/tasks/index.txt +14 -14
  142. package/apps/pwa/out/term/index.html +1 -1
  143. package/apps/pwa/out/term/index.txt +14 -14
  144. package/apps/pwa/out/today/index.html +1 -1
  145. package/apps/pwa/out/today/index.txt +14 -14
  146. package/apps/pwa/out/trace/index.html +1 -1
  147. package/apps/pwa/out/trace/index.txt +14 -14
  148. package/apps/pwa/out/vault/index.html +1 -1
  149. package/apps/pwa/out/vault/index.txt +14 -14
  150. package/apps/pwa/out/workflows/chat-ui/index.html +1 -1
  151. package/apps/pwa/out/workflows/chat-ui/index.txt +14 -14
  152. package/apps/pwa/out/workflows/index.html +1 -1
  153. package/apps/pwa/out/workflows/index.txt +14 -14
  154. package/apps/pwa/out/workspace/index.html +1 -1
  155. package/apps/pwa/out/workspace/index.txt +14 -14
  156. package/apps/pwa/out/worktrees/index.html +1 -1
  157. package/apps/pwa/out/worktrees/index.txt +14 -14
  158. package/package.json +2 -1
  159. package/samples/workflows/templates/approval-gated-deploy.yaml +30 -0
  160. package/samples/workflows/templates/chat-driven-research.yaml +35 -0
  161. package/samples/workflows/templates/discord-listen-and-respond.yaml +29 -0
  162. package/samples/workflows/templates/http-poll-then-alert.yaml +30 -0
  163. package/samples/workflows/templates/manual-quickstart.yaml +21 -0
  164. package/samples/workflows/templates/scheduled-daily-digest.yaml +30 -0
  165. package/samples/workflows/templates/webhook-deploy-hook.yaml +27 -0
  166. package/scripts/ci-public-export-import-gate.ts +7 -2
  167. package/scripts/ci-typecheck-changed.ts +21 -6
  168. package/scripts/discord-seat-probe.ts +3 -2
  169. package/scripts/docs/generate-cli-anatomy.ts +162 -0
  170. package/scripts/goals/authoring-metrics.ts +73 -0
  171. package/scripts/landing-heal/must-fix-match.ts +7 -7
  172. package/scripts/landing-heal/run-mission.ts +3 -2
  173. package/scripts/public-export-test-run.ts +37 -2
  174. package/scripts/release-loop/checklist-gate-node.ts +13 -11
  175. package/scripts/release-loop/cut-branch.ts +2 -1
  176. package/scripts/release-loop/cutoff.ts +4 -2
  177. package/scripts/release-loop/docs-land-node.ts +8 -1
  178. package/scripts/release-loop/docs-node.ts +1 -1
  179. package/scripts/release-loop/gate-node.ts +99 -14
  180. package/scripts/release-loop/node-verdict.ts +2 -1
  181. package/scripts/release-loop/npm-publish-node.ts +11 -7
  182. package/scripts/release-loop/ops-upgrade-node.ts +8 -1
  183. package/scripts/release-loop/preflight.ts +246 -0
  184. package/scripts/release-loop/publish-node.ts +8 -1
  185. package/scripts/release-loop/release-readiness.ts +11 -6
  186. package/scripts/release-loop/release-version.ts +48 -0
  187. package/scripts/release-loop/resume-release.ts +115 -0
  188. package/scripts/release-loop/unattended-release.ts +43 -7
  189. package/scripts/release-loop/version-node.ts +145 -40
  190. package/scripts/rhythm/daily.ts +25 -4
  191. package/scripts/skills/public-check.ts +62 -12
  192. package/scripts/test-deterministic.ts +51 -33
  193. package/scripts/test-diet/effectiveness.ts +62 -1
  194. package/scripts/test-diet/lib.ts +1 -1
  195. package/scripts/test-diet/node.ts +8 -1
  196. package/src/agent-mission/review-loop.ts +4 -3
  197. package/src/agent-substrate/pr-comment-meta.ts +20 -0
  198. package/src/autopilot/build/llm-conflict-merge.ts +28 -8
  199. package/src/briefing/brief-items.ts +86 -17
  200. package/src/cli/autopilot-cli.ts +30 -11
  201. package/src/cli/brief-cli.ts +36 -2
  202. package/src/cli/freeze-cli.ts +3 -2
  203. package/src/cli/intake-cli.ts +73 -1
  204. package/src/cli/notify-cli.ts +75 -0
  205. package/src/cli/provider-cli.ts +12 -2
  206. package/src/cli/release-cli.ts +101 -17
  207. package/src/cli/tasks-cli.ts +309 -3
  208. package/src/context-bus/condense.ts +19 -3
  209. package/src/context-bus/context-day.ts +77 -24
  210. package/src/context-bus/context-first.ts +33 -0
  211. package/src/discord-self-message.ts +20 -2
  212. package/src/discord-slash-wire.ts +1 -0
  213. package/src/domains/outbound-alert.ts +200 -27
  214. package/src/domains/outbound-log-probe.ts +16 -1
  215. package/src/domains/release-tool.ts +2 -2
  216. package/src/execution-loop/gates.ts +11 -2
  217. package/src/flow-loop/split.ts +8 -4
  218. package/src/git-fs/worktree.ts +23 -3
  219. package/src/harness/harness-cli-command.ts +10 -2
  220. package/src/harness/harness-queue.ts +388 -33
  221. package/src/harness/helper-scan.ts +10 -3
  222. package/src/hq/seats.ts +369 -0
  223. package/src/index.ts +133 -15
  224. package/src/intake-plane/adopt-gate.ts +49 -0
  225. package/src/intake-plane/check.ts +3 -0
  226. package/src/intake-plane/collect-github.ts +57 -25
  227. package/src/intake-plane/discord-seat-work.ts +8 -2
  228. package/src/intake-plane/requirement-funnel.ts +316 -0
  229. package/src/knowledge/know-find.ts +10 -1
  230. package/src/loops/budget.ts +36 -0
  231. package/src/loops/orchestrator/finish-rate.ts +73 -1
  232. package/src/loops/orchestrator/grid-place.ts +11 -0
  233. package/src/loops/orchestrator/tick.ts +295 -20
  234. package/src/maturity/feature-maturity.ts +3 -2
  235. package/src/nexus/api/decisions-route.ts +11 -1
  236. package/src/nexus/api/loop-edges.ts +69 -13
  237. package/src/nexus/api/ops-seats-sources.ts +2 -2
  238. package/src/nexus/api/workflow-templates.ts +3 -0
  239. package/src/oauth/codex.ts +38 -0
  240. package/src/onboarding/first-chat-gate.ts +29 -0
  241. package/src/release-loop/checklist.ts +104 -6
  242. package/src/release-loop/feature-store.ts +10 -9
  243. package/src/release-loop/landing-freeze.ts +6 -4
  244. package/src/release-loop/placement.ts +13 -3
  245. package/src/release-loop/rubric.ts +80 -0
  246. package/src/seat-dispatch/seat-ask.ts +79 -16
  247. package/src/seat-loop/seat-loop.ts +12 -6
  248. package/src/self-dev/ask-launch-flow.ts +24 -3
  249. package/src/self-dev/ask-path-candidates.ts +68 -0
  250. package/src/self-dev/dev-pipeline.ts +4 -0
  251. package/src/self-dev/draft-triage-rules.ts +1 -1
  252. package/src/self-dev/orchestrate-cli.ts +22 -0
  253. package/src/self-dev/round-pr-supersede.ts +244 -0
  254. package/src/self-dev/run-supervisor.ts +14 -0
  255. package/src/self-implement/follow-up-goals.ts +2 -2
  256. package/src/self-implement/gate-remote.ts +427 -0
  257. package/src/self-implement/goal-author.ts +8 -3
  258. package/src/self-implement/l8-merge-queue.ts +29 -5
  259. package/src/self-implement/orchestrator.ts +59 -12
  260. package/src/self-implement/prior-draft-findings.ts +4 -3
  261. package/src/skills/skill-feedback.ts +76 -0
  262. package/src/task-agent/actions.ts +39 -6
  263. package/src/task-agent/judge.ts +31 -5
  264. package/src/task-agent/mission.ts +423 -0
  265. package/src/task-agent/shadow.ts +90 -0
  266. package/src/task-agent/task-hand.ts +235 -0
  267. package/src/task-orchestrator/surfaces/pod-failure-reason.ts +10 -0
  268. package/src/task-orchestrator/surfaces/self-implement-pod.ts +86 -18
  269. package/src/telegram-loops-command.ts +1 -1
  270. package/src/telegram.ts +5 -20
  271. package/src/user-config.ts +63 -3
  272. package/src/version/packed-revision.json +1 -1
  273. package/apps/pwa/out/_next/static/chunks/2699-63b73fa4d3bcf6ff.js +0 -1
  274. package/apps/pwa/out/_next/static/chunks/4554-3565eea1f1495ba7.js +0 -1
  275. package/apps/pwa/out/_next/static/chunks/4614-21403aac730d4586.js +0 -1
  276. package/apps/pwa/out/_next/static/chunks/5135-44008fe8b1f2aa41.js +0 -1
  277. package/apps/pwa/out/_next/static/chunks/5233-bf28bd6bd7a32099.js +0 -1
  278. package/apps/pwa/out/_next/static/chunks/5977-c952712c87a1f757.js +0 -1
  279. package/apps/pwa/out/_next/static/chunks/6877-fe94e76a5841ee9b.js +0 -1
  280. package/apps/pwa/out/_next/static/chunks/7395-164e238f471b5d7b.js +0 -1
  281. package/apps/pwa/out/_next/static/chunks/7787-02a1c0b04e25e811.js +0 -1
  282. package/apps/pwa/out/_next/static/chunks/8401-4ce1c42c8d89903f.js +0 -1
  283. package/apps/pwa/out/_next/static/chunks/8949-ecb4128a0858b911.js +0 -1
  284. package/apps/pwa/out/_next/static/chunks/899-f41be85e8a680651.js +0 -1
  285. package/apps/pwa/out/_next/static/chunks/app/botlab/page-6b8444914da74ca6.js +0 -1
  286. package/apps/pwa/out/_next/static/chunks/app/ceo/page-7110f732f45bf944.js +0 -1
  287. package/apps/pwa/out/_next/static/chunks/app/chat/page-9a41d65355fc25b9.js +0 -1
  288. package/apps/pwa/out/_next/static/chunks/app/control/page-41afec0b255ed2bb.js +0 -1
  289. package/apps/pwa/out/_next/static/chunks/app/inside/page-ab93b240f687d69a.js +0 -1
  290. package/apps/pwa/out/_next/static/chunks/app/layout-de43a186e5ba5683.js +0 -1
  291. package/apps/pwa/out/_next/static/chunks/app/live/page-8b08cafad27759c9.js +0 -1
  292. package/apps/pwa/out/_next/static/chunks/app/observatory/page-1ed1324b1dc36754.js +0 -1
  293. package/apps/pwa/out/_next/static/chunks/app/ops/release/page-166745e51ac0c7b0.js +0 -1
  294. package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-a04260b8ccc968d4.js +0 -1
  295. package/apps/pwa/out/_next/static/chunks/app/page-1f50e3d4e13435f4.js +0 -1
  296. package/apps/pwa/out/_next/static/chunks/app/sessions/page-a9117d2cd3093d36.js +0 -1
  297. package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-5a64cb5208c6a8fd.js +0 -1
  298. package/apps/pwa/out/_next/static/chunks/app/settings/page-1407ec83ea64c1f9.js +0 -1
  299. package/apps/pwa/out/_next/static/chunks/app/setup/page-6e878ebbe1737d00.js +0 -1
  300. package/apps/pwa/out/_next/static/chunks/app/showroom/page-81a4e7f8dbfe74cb.js +0 -1
  301. package/apps/pwa/out/_next/static/chunks/app/term/page-3ab59d19913b200e.js +0 -1
  302. package/apps/pwa/out/_next/static/chunks/app/today/page-bf85b2f5bf077925.js +0 -1
  303. package/apps/pwa/out/_next/static/chunks/app/vault/page-ab32a8f522a60371.js +0 -1
  304. package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-fc2df261f8a2c7df.js +0 -1
  305. package/apps/pwa/out/_next/static/chunks/app/workflows/page-09461366af82ef13.js +0 -1
  306. package/apps/pwa/out/_next/static/chunks/app/worktrees/page-ea90a8ac73ce2749.js +0 -1
  307. package/apps/pwa/out/_next/static/css/001d5fbaee388a25.css +0 -1
  308. package/apps/pwa/out/_next/static/yRA5ur6DcPl0YHSRheH2O/_buildManifest.js +0 -1
  309. /package/apps/pwa/out/_next/static/{yRA5ur6DcPl0YHSRheH2O → P6YTVgzuZz5oTZhY4Din_}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3933],{5997:(e,t,s)=>{"use strict";s.d(t,{Zr:()=>l,f6:()=>n,oD:()=>r});let a="elanous.daemon.sessionId";function n(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"s-".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2,10))}function r(){let e=function(){let e=new URLSearchParams(window.location.search).get("session");return e?(localStorage.setItem(a,e),e):localStorage.getItem(a)}();if(e)return e;let t=n();return localStorage.setItem(a,t),t}function l(){let e=n();return localStorage.setItem(a,e),e}},12980:(e,t,s)=>{Promise.resolve().then(s.bind(s,29744))},15151:(e,t,s)=>{"use strict";s.d(t,{C:()=>i,DaemonProvider:()=>d,Q:()=>m});var a=s(55539),n=s(46124),r=s(8101),l=s(5997),o=s(18060),c=s(72215);let i=(0,n.createContext)(null);function d(e){let{children:t}=e,s={baseUrl:"",token:"",provider:""},[d,m]=(0,n.useState)(s),[u,p]=(0,n.useState)(""),[x]=(0,n.useState)(()=>new o.ki(s));(0,n.useEffect)(()=>{let e=(0,r.Fp)();m(e),x.updateConfig(e),p((0,l.oD)()),(0,c.cY)("webterm.provider.daemon.init",{baseUrl:e.baseUrl,hasToken:!!e.token})},[x]),(0,n.useEffect)(()=>{let e=e=>{if("elanous.daemon.token"===e.key||"elanous.nexus.baseUrl"===e.key){let t=(0,r.Fp)();x.updateConfig(t),m(t),(0,c.cY)("webterm.provider.daemon.config-cross-tab",{key:e.key,hasToken:!!t.token});return}"elanous.daemon.sessionId"===e.key&&e.newValue&&p(t=>t===e.newValue?t:((0,c.cY)("webterm.provider.daemon.session-cross-tab",{previous:t||"(empty)",next:e.newValue}),e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[x]);let f=e=>{m(t=>{let s={...t,...e};return(0,r.Qc)(e),x.updateConfig(s),(0,c.cY)("webterm.provider.daemon.config-update",{keys:Object.keys(e)}),s})},h=e=>{p(e),localStorage.setItem("elanous.daemon.sessionId",e),(0,c.cY)("webterm.provider.daemon.session-set",{sessionId:e})},g=(0,n.useMemo)(()=>({config:d,setConfig:f,client:x,sessionId:u,setSessionId:h}),[d,x,u]);return(0,a.jsx)(i.Provider,{value:g,children:t})}function m(){let e=(0,n.useContext)(i);if(!e)throw Error("useDaemon must be used inside <DaemonProvider>");return e}},29744:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>c});var a=s(55539),n=s(46124),r=s(15151);let l="user@elanvital.ai",o={name:"이름",org:"회사명",kind:"회사/개인",interest:"관심 분야",contact:"연락처",consent:"동의"};function c(){let{client:e}=(0,r.Q)(),[t,s]=(0,n.useState)(""),[c,i]=(0,n.useState)(""),[d,m]=(0,n.useState)("personal"),[u,p]=(0,n.useState)("A"),[x,f]=(0,n.useState)(""),[h,g]=(0,n.useState)(!1),[b,y]=(0,n.useState)(!1),[j,v]=(0,n.useState)(""),[k,N]=(0,n.useState)(!1);async function w(s){if(s.preventDefault(),!h||b)return;let a={name:t.trim(),..."company"===d?{org:c.trim()}:{},kind:d,interest:u,contact:x.trim(),consent:!0},n=a.name?"company"!==d||a.org?a.contact?null:"contact":"org":"name";if(n){N(!0),v("".concat(o[n]," 항목을 입력해 주세요."));return}y(!0),v("");try{let t=await e.submitConsultRequest(a);if("receiptId"in t)N(!1),v("접수했습니다 \xb7 ".concat(t.receiptId," — 곧 연락드리겠습니다"));else{var r;N(!0),v("".concat(null!=(r=o[t.field])?r:"필수"," 항목을 확인해 주세요."))}}catch(e){N(!0),v("접수하지 못했습니다. 연결 상태를 확인하고 다시 보내 주세요.")}finally{y(!1)}}return(0,a.jsxs)("main",{className:"mx-auto w-full max-w-xl px-5 py-10 sm:py-16",children:[(0,a.jsxs)("header",{className:"mb-8",children:[(0,a.jsx)("p",{className:"mb-2 text-sm font-medium text-primary",children:"AX \xb7 상담 문의"}),(0,a.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:"어떤 도움이 필요하신가요?"}),(0,a.jsx)("p",{className:"mt-3 text-sm text-muted-foreground",children:"도입 상담이나 교육 과정에 대해 남겨 주세요. 확인 후 연락드리겠습니다."}),(0,a.jsxs)("p",{className:"mt-2 text-sm text-muted-foreground",children:["메일로 바로 문의: ",(0,a.jsx)("a",{className:"underline",href:"mailto:".concat(l),children:l})]})]}),(0,a.jsxs)("form",{onSubmit:w,noValidate:!0,className:"space-y-6 rounded-xl border border-border bg-card p-5 sm:p-8",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{htmlFor:"consult-name",className:"block text-sm font-medium",children:"이름"}),(0,a.jsx)("input",{id:"consult-name",name:"name",required:!0,autoComplete:"name",value:t,onChange:e=>s(e.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm"})]}),(0,a.jsxs)("fieldset",{className:"space-y-2",children:[(0,a.jsx)("legend",{className:"text-sm font-medium",children:"회사/개인"}),(0,a.jsxs)("div",{className:"flex gap-5 text-sm",children:[(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"radio",name:"kind",value:"company",checked:"company"===d,onChange:()=>m("company")}),"회사"]}),(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"radio",name:"kind",value:"personal",checked:"personal"===d,onChange:()=>m("personal")}),"개인"]})]})]}),"company"===d&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{htmlFor:"consult-org",className:"block text-sm font-medium",children:"회사명"}),(0,a.jsx)("input",{id:"consult-org",name:"org",required:!0,autoComplete:"organization",value:c,onChange:e=>i(e.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm"})]}),(0,a.jsxs)("fieldset",{className:"space-y-2",children:[(0,a.jsx)("legend",{className:"text-sm font-medium",children:"관심 분야"}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 text-sm",children:[(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"radio",name:"interest",value:"A",checked:"A"===u,onChange:()=>p("A")}),"A \xb7 AX 도입 상담"]}),(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"radio",name:"interest",value:"B",checked:"B"===u,onChange:()=>p("B")}),"B \xb7 과정\xb7교육 문의"]})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{htmlFor:"consult-contact",className:"block text-sm font-medium",children:"연락처 (메일 또는 전화)"}),(0,a.jsx)("input",{id:"consult-contact",name:"contact",required:!0,value:x,onChange:e=>f(e.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm"})]}),(0,a.jsxs)("label",{className:"flex items-start gap-3 text-sm leading-6",children:[(0,a.jsx)("input",{type:"checkbox",name:"consent",checked:h,onChange:e=>g(e.target.checked),className:"mt-1"}),(0,a.jsx)("span",{children:"입력한 정보는 상담 연락을 위해 서버로 전송하며, 상담 연락에만 사용합니다"})]}),j&&(0,a.jsx)("p",{role:k?"alert":"status",className:k?"text-sm text-destructive":"text-sm text-primary",children:j}),(0,a.jsx)("button",{type:"submit",disabled:!h||b,className:"w-full rounded-md bg-primary px-4 py-2.5 text-sm font-medium text-primary-foreground disabled:cursor-not-allowed disabled:opacity-50",children:b?"보내는 중…":"보내기"})]})]})}}},e=>{e.O(0,[8060,2463,2196,7358],()=>e(e.s=12980)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3933],{5997:(e,t,s)=>{"use strict";s.d(t,{Zr:()=>l,f6:()=>n,oD:()=>r});let a="elanous.daemon.sessionId";function n(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"s-".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2,10))}function r(){let e=function(){let e=new URLSearchParams(window.location.search).get("session");return e?(localStorage.setItem(a,e),e):localStorage.getItem(a)}();if(e)return e;let t=n();return localStorage.setItem(a,t),t}function l(){let e=n();return localStorage.setItem(a,e),e}},12665:(e,t,s)=>{Promise.resolve().then(s.bind(s,29744))},15151:(e,t,s)=>{"use strict";s.d(t,{C:()=>i,DaemonProvider:()=>d,Q:()=>m});var a=s(55539),n=s(46124),r=s(8101),l=s(5997),o=s(18060),c=s(72215);let i=(0,n.createContext)(null);function d(e){let{children:t}=e,s={baseUrl:"",token:"",provider:""},[d,m]=(0,n.useState)(s),[u,p]=(0,n.useState)(""),[x]=(0,n.useState)(()=>new o.ki(s));(0,n.useEffect)(()=>{let e=(0,r.Fp)();m(e),x.updateConfig(e),p((0,l.oD)()),(0,c.cY)("webterm.provider.daemon.init",{baseUrl:e.baseUrl,hasToken:!!e.token})},[x]),(0,n.useEffect)(()=>{let e=e=>{if("elanous.daemon.token"===e.key||"elanous.nexus.baseUrl"===e.key){let t=(0,r.Fp)();x.updateConfig(t),m(t),(0,c.cY)("webterm.provider.daemon.config-cross-tab",{key:e.key,hasToken:!!t.token});return}"elanous.daemon.sessionId"===e.key&&e.newValue&&p(t=>t===e.newValue?t:((0,c.cY)("webterm.provider.daemon.session-cross-tab",{previous:t||"(empty)",next:e.newValue}),e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[x]);let f=e=>{m(t=>{let s={...t,...e};return(0,r.Qc)(e),x.updateConfig(s),(0,c.cY)("webterm.provider.daemon.config-update",{keys:Object.keys(e)}),s})},h=e=>{p(e),localStorage.setItem("elanous.daemon.sessionId",e),(0,c.cY)("webterm.provider.daemon.session-set",{sessionId:e})},g=(0,n.useMemo)(()=>({config:d,setConfig:f,client:x,sessionId:u,setSessionId:h}),[d,x,u]);return(0,a.jsx)(i.Provider,{value:g,children:t})}function m(){let e=(0,n.useContext)(i);if(!e)throw Error("useDaemon must be used inside <DaemonProvider>");return e}},29744:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>c});var a=s(55539),n=s(46124),r=s(15151);let l="user@elanvital.ai",o={name:"이름",org:"회사명",kind:"회사/개인",interest:"관심 분야",contact:"연락처",consent:"동의"};function c(){let{client:e}=(0,r.Q)(),[t,s]=(0,n.useState)(""),[c,i]=(0,n.useState)(""),[d,m]=(0,n.useState)("personal"),[u,p]=(0,n.useState)("A"),[x,f]=(0,n.useState)(""),[h,g]=(0,n.useState)(!1),[b,y]=(0,n.useState)(!1),[j,v]=(0,n.useState)(""),[k,N]=(0,n.useState)(!1);async function w(s){if(s.preventDefault(),!h||b)return;let a={name:t.trim(),..."company"===d?{org:c.trim()}:{},kind:d,interest:u,contact:x.trim(),consent:!0},n=a.name?"company"!==d||a.org?a.contact?null:"contact":"org":"name";if(n){N(!0),v("".concat(o[n]," 항목을 입력해 주세요."));return}y(!0),v("");try{let t=await e.submitConsultRequest(a);if("receiptId"in t)N(!1),v("접수했습니다 \xb7 ".concat(t.receiptId," — 곧 연락드리겠습니다"));else{var r;N(!0),v("".concat(null!=(r=o[t.field])?r:"필수"," 항목을 확인해 주세요."))}}catch(e){N(!0),v("접수하지 못했습니다. 연결 상태를 확인하고 다시 보내 주세요.")}finally{y(!1)}}return(0,a.jsxs)("main",{className:"mx-auto w-full max-w-xl px-5 py-10 sm:py-16",children:[(0,a.jsxs)("header",{className:"mb-8",children:[(0,a.jsx)("p",{className:"mb-2 text-sm font-medium text-primary",children:"AX \xb7 상담 문의"}),(0,a.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:"어떤 도움이 필요하신가요?"}),(0,a.jsx)("p",{className:"mt-3 text-sm text-muted-foreground",children:"도입 상담이나 교육 과정에 대해 남겨 주세요. 확인 후 연락드리겠습니다."}),(0,a.jsxs)("p",{className:"mt-2 text-sm text-muted-foreground",children:["메일로 바로 문의: ",(0,a.jsx)("a",{className:"underline",href:"mailto:".concat(l),children:l})]})]}),(0,a.jsxs)("form",{onSubmit:w,noValidate:!0,className:"space-y-6 rounded-xl border border-border bg-card p-5 sm:p-8",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{htmlFor:"consult-name",className:"block text-sm font-medium",children:"이름"}),(0,a.jsx)("input",{id:"consult-name",name:"name",required:!0,autoComplete:"name",value:t,onChange:e=>s(e.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm"})]}),(0,a.jsxs)("fieldset",{className:"space-y-2",children:[(0,a.jsx)("legend",{className:"text-sm font-medium",children:"회사/개인"}),(0,a.jsxs)("div",{className:"flex gap-5 text-sm",children:[(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"radio",name:"kind",value:"company",checked:"company"===d,onChange:()=>m("company")}),"회사"]}),(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"radio",name:"kind",value:"personal",checked:"personal"===d,onChange:()=>m("personal")}),"개인"]})]})]}),"company"===d&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{htmlFor:"consult-org",className:"block text-sm font-medium",children:"회사명"}),(0,a.jsx)("input",{id:"consult-org",name:"org",required:!0,autoComplete:"organization",value:c,onChange:e=>i(e.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm"})]}),(0,a.jsxs)("fieldset",{className:"space-y-2",children:[(0,a.jsx)("legend",{className:"text-sm font-medium",children:"관심 분야"}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 text-sm",children:[(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"radio",name:"interest",value:"A",checked:"A"===u,onChange:()=>p("A")}),"A \xb7 AX 도입 상담"]}),(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"radio",name:"interest",value:"B",checked:"B"===u,onChange:()=>p("B")}),"B \xb7 과정\xb7교육 문의"]})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{htmlFor:"consult-contact",className:"block text-sm font-medium",children:"연락처 (메일 또는 전화)"}),(0,a.jsx)("input",{id:"consult-contact",name:"contact",required:!0,value:x,onChange:e=>f(e.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm"})]}),(0,a.jsxs)("label",{className:"flex items-start gap-3 text-sm leading-6",children:[(0,a.jsx)("input",{type:"checkbox",name:"consent",checked:h,onChange:e=>g(e.target.checked),className:"mt-1"}),(0,a.jsx)("span",{children:"입력한 정보는 상담 연락을 위해 서버로 전송하며, 상담 연락에만 사용합니다"})]}),j&&(0,a.jsx)("p",{role:k?"alert":"status",className:k?"text-sm text-destructive":"text-sm text-primary",children:j}),(0,a.jsx)("button",{type:"submit",disabled:!h||b,className:"w-full rounded-md bg-primary px-4 py-2.5 text-sm font-medium text-primary-foreground disabled:cursor-not-allowed disabled:opacity-50",children:b?"보내는 중…":"보내기"})]})]})}}},e=>{e.O(0,[8060,2463,2196,7358],()=>e(e.s=12665)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2580],{5997:(e,t,r)=>{"use strict";r.d(t,{Zr:()=>o,f6:()=>n,oD:()=>s});let a="elanous.daemon.sessionId";function n(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"s-".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2,10))}function s(){let e=function(){let e=new URLSearchParams(window.location.search).get("session");return e?(localStorage.setItem(a,e),e):localStorage.getItem(a)}();if(e)return e;let t=n();return localStorage.setItem(a,t),t}function o(){let e=n();return localStorage.setItem(a,e),e}},9734:(e,t,r)=>{"use strict";r.d(t,{$:()=>l});var a=r(55539),n=r(89545),s=r(17154),o=r(44373);let i=(0,s.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 l(e){let{className:t,variant:r="default",size:s="default",...l}=e;return(0,a.jsx)(n.$,{"data-slot":"button",className:(0,o.cn)(i({variant:r,size:s,className:t})),...l})}},15151:(e,t,r)=>{"use strict";r.d(t,{C:()=>d,DaemonProvider:()=>c,Q:()=>u});var a=r(55539),n=r(46124),s=r(8101),o=r(5997),i=r(18060),l=r(72215);let d=(0,n.createContext)(null);function c(e){let{children:t}=e,r={baseUrl:"",token:"",provider:""},[c,u]=(0,n.useState)(r),[p,m]=(0,n.useState)(""),[g]=(0,n.useState)(()=>new i.ki(r));(0,n.useEffect)(()=>{let e=(0,s.Fp)();u(e),g.updateConfig(e),m((0,o.oD)()),(0,l.cY)("webterm.provider.daemon.init",{baseUrl:e.baseUrl,hasToken:!!e.token})},[g]),(0,n.useEffect)(()=>{let e=e=>{if("elanous.daemon.token"===e.key||"elanous.nexus.baseUrl"===e.key){let t=(0,s.Fp)();g.updateConfig(t),u(t),(0,l.cY)("webterm.provider.daemon.config-cross-tab",{key:e.key,hasToken:!!t.token});return}"elanous.daemon.sessionId"===e.key&&e.newValue&&m(t=>t===e.newValue?t:((0,l.cY)("webterm.provider.daemon.session-cross-tab",{previous:t||"(empty)",next:e.newValue}),e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[g]);let x=e=>{u(t=>{let r={...t,...e};return(0,s.Qc)(e),g.updateConfig(r),(0,l.cY)("webterm.provider.daemon.config-update",{keys:Object.keys(e)}),r})},v=e=>{m(e),localStorage.setItem("elanous.daemon.sessionId",e),(0,l.cY)("webterm.provider.daemon.session-set",{sessionId:e})},f=(0,n.useMemo)(()=>({config:c,setConfig:x,client:g,sessionId:p,setSessionId:v}),[c,g,p]);return(0,a.jsx)(d.Provider,{value:f,children:t})}function u(){let e=(0,n.useContext)(d);if(!e)throw Error("useDaemon must be used inside <DaemonProvider>");return e}},30158:(e,t,r)=>{"use strict";r.d(t,{p:()=>o});var a=r(55539);r(46124);var n=r(8085),s=r(44373);function o(e){let{className:t,type:r,...o}=e;return(0,a.jsx)(n.p,{type:r,"data-slot":"input",className:(0,s.cn)("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",t),...o})}},44373:(e,t,r)=>{"use strict";r.d(t,{cn:()=>s});var a=r(20852),n=r(30984);function s(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,n.QP)((0,a.$)(t))}},62698:(e,t,r)=>{Promise.resolve().then(r.bind(r,65137))},65137:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var a=r(55539),n=r(93521);function s(){return(0,a.jsx)(n.U,{})}},93521:(e,t,r)=>{"use strict";r.d(t,{U:()=>m});var a=r(55539),n=r(46124),s=r(15151),o=r(9734),i=r(30158);function l(e){let{items:t}=e;return 0===t.length?(0,a.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,a.jsx)("ul",{className:"space-y-2",children:t.map((e,t)=>{var r,n,s,o,i;let l=[(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==(s=e.scope)?void 0:s.sessionId)&&"session=".concat(e.scope.sessionId)].filter(Boolean).join(" \xb7 ")||"unscoped";return(0,a.jsxs)("li",{className:"rounded-lg border border-border bg-card p-3 shadow-sm",children:[(0,a.jsxs)("div",{className:"text-sm font-medium",children:[e.kind," \xb7 ",e.urgency]}),(0,a.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!=(o=e.source)?o:"unknown"," \xb7 ",l]}),(0,a.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,a]=e;a&&t.set(r,a)});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(67327),p=r(72215);function m(){var e,t,r,m;let{client:g}=(0,s.Q)(),x=(0,n.useMemo)(()=>new c(g),[g]),[v,f]=(0,n.useState)({items:[]}),[b,h]=(0,n.useState)(!1),[y,w]=(0,n.useState)(""),[k,j]=(0,n.useState)(""),[N,S]=(0,n.useState)(""),[C,z]=(0,n.useState)(""),[I,E]=(0,n.useState)(""),[U,D]=(0,n.useState)(""),[_,O]=(0,n.useState)("normal"),[P,J]=(0,n.useState)("operator"),[R,Y]=(0,n.useState)(""),[M,V]=(0,n.useState)(""),[$,F]=(0,n.useState)(""),[L,Q]=(0,n.useState)(""),[T,q]=(0,n.useState)(!1),A=(0,n.useCallback)(async()=>{(0,p.cY)("webterm.control.list.refresh",{kind:y,surface:k,minUrgency:N,sessionId:C,limit:I}),h(!0);try{let e=await x.list({kind:y||void 0,surface:k||void 0,minUrgency:N||void 0,sessionId:C||void 0,limit:I||void 0});f(e)}catch(e){u.oR.error("signals list failed: ".concat(e instanceof Error?e.message:e))}finally{h(!1)}},[x,y,k,N,C,I]);(0,n.useEffect)(()=>{A()},[A]);let B=async e=>{if(e.preventDefault(),!U.trim())return void u.oR.error("kind required");let t={};if(L.trim())try{t=JSON.parse(L)}catch(e){u.oR.error("payload must be valid JSON");return}let r={kind:U.trim(),urgency:_,source:P.trim()||"operator",mayPreempt:T,payload:t,scope:{...R?{surface:R}:{},...M?{channel:M}:{},...$?{sessionId:$}:{}}};(0,p.cY)("webterm.control.emit",{kind:r.kind,urgency:r.urgency});try{h(!0),await x.emit(r),u.oR.success("signal emitted"),Q(""),await A()}catch(e){u.oR.error("emit failed: ".concat(e instanceof Error?e.message:e))}finally{h(!1)}},K=null!=(e=v.countsByKind)?e:{};return(0,a.jsxs)("div",{className:"mx-auto max-w-5xl space-y-4 p-4",children:[(0,a.jsxs)("header",{className:"space-y-2",children:[(0,a.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"Control signals"}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-muted-foreground",children:[(0,a.jsxs)("span",{className:"rounded-full border border-border px-2 py-0.5",children:["total ",null!=(t=v.total)?t:0]}),(0,a.jsxs)("span",{className:"rounded-full border border-border px-2 py-0.5",children:["latest ",null!=(r=v.latest)?r:"-"]}),Object.entries(K).map(e=>{let[t,r]=e;return(0,a.jsxs)("span",{className:"rounded-full border border-border px-2 py-0.5",children:[t," ",r]},t)})]})]}),(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),A()},className:"flex flex-wrap items-center gap-2 rounded-lg border border-border bg-card p-3 shadow-sm",children:[(0,a.jsx)(i.p,{value:y,onChange:e=>w(e.target.value),placeholder:"kind",className:"flex-1 min-w-[140px]"}),(0,a.jsx)(i.p,{value:k,onChange:e=>j(e.target.value),placeholder:"surface",className:"flex-1 min-w-[140px]"}),(0,a.jsxs)("select",{value:N,onChange:e=>S(e.target.value),className:"h-9 flex-1 min-w-[170px] rounded-md border border-input bg-background px-2 text-sm",children:[(0,a.jsx)("option",{value:"",children:"min urgency (any)"}),d.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]}),(0,a.jsx)(i.p,{value:C,onChange:e=>z(e.target.value),placeholder:"session id",className:"flex-1 min-w-[140px]"}),(0,a.jsx)(i.p,{value:I,onChange:e=>E(e.target.value),placeholder:"limit",type:"number",className:"w-[100px]"}),(0,a.jsx)(o.$,{type:"submit",size:"sm",disabled:b,children:"Filter"})]}),(0,a.jsxs)("form",{onSubmit:B,className:"space-y-2 rounded-lg border border-border bg-card p-3 shadow-sm",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold",children:"Emit a signal"}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)(i.p,{value:U,onChange:e=>D(e.target.value),placeholder:"kind (required)",className:"flex-1 min-w-[140px]"}),(0,a.jsx)("select",{value:_,onChange:e=>{let t=e.target.value;"string"==typeof t&&d.includes(t)&&O(t)},className:"h-9 rounded-md border border-input bg-background px-2 text-sm",children:d.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}),(0,a.jsx)(i.p,{value:P,onChange:e=>J(e.target.value),placeholder:"source",className:"flex-1 min-w-[120px]"}),(0,a.jsx)(i.p,{value:R,onChange:e=>Y(e.target.value),placeholder:"scope.surface",className:"flex-1 min-w-[120px]"}),(0,a.jsx)(i.p,{value:M,onChange:e=>V(e.target.value),placeholder:"scope.channel",className:"flex-1 min-w-[120px]"}),(0,a.jsx)(i.p,{value:$,onChange:e=>F(e.target.value),placeholder:"scope.session",className:"flex-1 min-w-[120px]"}),(0,a.jsxs)("label",{className:"flex items-center gap-1.5 text-xs",children:[(0,a.jsx)("input",{type:"checkbox",checked:T,onChange:e=>q(e.target.checked)}),"mayPreempt"]})]}),(0,a.jsx)("textarea",{value:L,onChange:e=>Q(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,a.jsx)(o.$,{type:"submit",size:"sm",disabled:b,children:"Emit"})]}),(0,a.jsx)(l,{items:null!=(m=v.items)?m:[]})]})}}},e=>{e.O(0,[211,8682,7327,8085,8060,2463,2196,7358],()=>e(e.s=62698)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1422],{5997:(e,t,n)=>{"use strict";n.d(t,{Zr:()=>a,f6:()=>r,oD:()=>l});let s="elanous.daemon.sessionId";function r(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"s-".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2,10))}function l(){let e=function(){let e=new URLSearchParams(window.location.search).get("session");return e?(localStorage.setItem(s,e),e):localStorage.getItem(s)}();if(e)return e;let t=r();return localStorage.setItem(s,t),t}function a(){let e=r();return localStorage.setItem(s,e),e}},15151:(e,t,n)=>{"use strict";n.d(t,{C:()=>d,DaemonProvider:()=>c,Q:()=>u});var s=n(55539),r=n(46124),l=n(8101),a=n(5997),i=n(18060),o=n(72215);let d=(0,r.createContext)(null);function c(e){let{children:t}=e,n={baseUrl:"",token:"",provider:""},[c,u]=(0,r.useState)(n),[m,p]=(0,r.useState)(""),[x]=(0,r.useState)(()=>new i.ki(n));(0,r.useEffect)(()=>{let e=(0,l.Fp)();u(e),x.updateConfig(e),p((0,a.oD)()),(0,o.cY)("webterm.provider.daemon.init",{baseUrl:e.baseUrl,hasToken:!!e.token})},[x]),(0,r.useEffect)(()=>{let e=e=>{if("elanous.daemon.token"===e.key||"elanous.nexus.baseUrl"===e.key){let t=(0,l.Fp)();x.updateConfig(t),u(t),(0,o.cY)("webterm.provider.daemon.config-cross-tab",{key:e.key,hasToken:!!t.token});return}"elanous.daemon.sessionId"===e.key&&e.newValue&&p(t=>t===e.newValue?t:((0,o.cY)("webterm.provider.daemon.session-cross-tab",{previous:t||"(empty)",next:e.newValue}),e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[x]);let h=e=>{u(t=>{let n={...t,...e};return(0,l.Qc)(e),x.updateConfig(n),(0,o.cY)("webterm.provider.daemon.config-update",{keys:Object.keys(e)}),n})},f=e=>{p(e),localStorage.setItem("elanous.daemon.sessionId",e),(0,o.cY)("webterm.provider.daemon.session-set",{sessionId:e})},b=(0,r.useMemo)(()=>({config:c,setConfig:h,client:x,sessionId:m,setSessionId:f}),[c,x,m]);return(0,s.jsx)(d.Provider,{value:b,children:t})}function u(){let e=(0,r.useContext)(d);if(!e)throw Error("useDaemon must be used inside <DaemonProvider>");return e}},15237:(e,t,n)=>{"use strict";n.d(t,{DecisionBoard:()=>d});var s=n(55539),r=n(46124),l=n(15151),a=n(33626);let i=e=>new Intl.DateTimeFormat("ko-KR",{timeZone:"Asia/Seoul",year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(new Date(e)),o=e=>(null==e?void 0:e.trim())||"(비움)";function d(){let{client:e}=(0,l.Q)(),[t,n]=(0,r.useState)({items:[],error:null,loading:!0}),[d,c]=(0,r.useState)({}),[u,m]=(0,r.useState)(null),[p,x]=(0,r.useState)(null),[h,f]=(0,r.useState)({}),[b,g]=(0,r.useState)({}),j=(0,r.useRef)(null),v=(0,r.useRef)(0),y=(0,r.useRef)(e);y.current=e,(0,r.useEffect)(()=>{let t=!0;j.current=null;let s=++v.current;return n({items:[],error:null,loading:!0}),c({}),m(null),x(null),f({}),g({}),(0,a.q)(e).then(e=>{t&&v.current===s&&n({items:[...e].sort((e,t)=>{var n,s;return(e.dueAt?Date.parse(e.dueAt):1/0)-(t.dueAt?Date.parse(t.dueAt):1/0)||(null!=(n=e.raisedAt)?n:"").localeCompare(null!=(s=t.raisedAt)?s:"")||e.id.localeCompare(t.id)}),error:null,loading:!1})}).catch(e=>{t&&v.current===s&&n({items:[],error:e instanceof Error?e.message:String(e),loading:!1})}),()=>{t=!1,++v.current}},[e]);let w=async function(t,n){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(j.current||h[t.id])return;if(t.irreversible&&(!s||(null==u?void 0:u.id)!==t.id||u.key!==n))return void m({id:t.id,key:n});let r=v.current;j.current=t.id,x(t.id),m(null),g(e=>({...e,[t.id]:""}));try{var l,i,o;let s=await (0,a.L)(e,t.id,n,(null!=(i=d[t.id])?i:"").replace(/\s+/g," ").trim().slice(0,300)||void 0);if(y.current!==e||v.current!==r)return;let c=null!=(o=null==(l=t.options.find(e=>e.id===n))?void 0:l.label)?o:n;f(e=>({...e,[t.id]:{label:c,at:s.decidedAt}}))}catch(s){if(y.current!==e||v.current!==r)return;let n=s instanceof Error?s.message:String(s);g(e=>({...e,[t.id]:n.includes("decision failed: 409")?"이미 결정됨":n.includes("decision failed: 404")?"사라진 결정":"결정 실패 \xb7 ".concat(n)}))}finally{y.current===e&&v.current===r&&(j.current=null,x(null))}};return(0,s.jsxs)("main",{className:"mx-auto w-full max-w-3xl px-3 py-5 text-foreground sm:px-6",children:[(0,s.jsxs)("header",{className:"mb-5",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"운영 \xb7 결정"}),(0,s.jsx)("h1",{className:"text-xl font-semibold",children:"결정 대기 카드"})]}),t.loading?(0,s.jsx)("p",{role:"status",children:"읽는 중"}):t.error?(0,s.jsxs)("p",{role:"alert",children:["못 읽음 \xb7 ",t.error]}):0===t.items.length?(0,s.jsx)("p",{children:"열린 결정이 없습니다."}):(0,s.jsx)("ol",{className:"space-y-4",children:t.items.map(e=>{var t,n,r,l,a,x,f,g,j,v;let y=h[e.id],k=(null==u?void 0:u.id)===e.id?e.options.find(e=>e.id===u.key):void 0,N=e.recommendation;return(0,s.jsx)("li",{className:"min-w-0 rounded-xl border border-border bg-card p-4",children:y?(0,s.jsxs)("details",{children:[(0,s.jsxs)("summary",{className:"cursor-pointer font-medium",children:["결정됨: ",y.label," \xb7 ",y.at?"".concat(i(y.at)," KST"):"시각 미상"]}),(0,s.jsx)("p",{className:"mt-2 text-sm",children:e.title})]}):(0,s.jsxs)("article",{"aria-label":e.title,className:"space-y-3 break-words",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:e.title}),(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:["올린 자리: ",null!=(x=null==(t=e.raisedBy)?void 0:t.agent)?x:"(비움)",(null==(n=e.raisedBy)?void 0:n.track)?"(".concat(e.raisedBy.track,")"):""]}),e.category&&(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:["분류: ",e.category]}),e.irreversible&&(0,s.jsx)("p",{className:"font-medium text-amber-700",children:"⚠️ 되돌릴 수 없음"})]}),(0,s.jsx)("dl",{className:"space-y-1 text-sm",children:["s","c","q","a"].map(t=>{var n,r;return(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)("dt",{className:"font-semibold",children:[t.toUpperCase(),":"]}),(0,s.jsx)("dd",{className:"min-w-0 whitespace-pre-wrap",children:o(null!=(r=null==(n=e.scqa)?void 0:n[t])?r:"s"===t?e.situation:void 0)})]},t)})}),(0,s.jsx)("p",{className:"text-sm font-medium",children:"skipped"in N?"권고 없음: ".concat(N.reason):"권고: ".concat(null!=(f=null==(r=e.options.find(e=>e.id===N.option))?void 0:r.label)?f:N.option," — ").concat(N.why)}),e.alternative&&(0,s.jsxs)("p",{className:"text-sm",children:["대안: ",null!=(g=null==(l=e.options.find(t=>t.id===e.alternative))?void 0:l.label)?g:e.alternative]}),(0,s.jsx)("ul",{className:"space-y-2",children:e.options.map(t=>(0,s.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-border p-2 text-sm",children:[(0,s.jsxs)("span",{children:[t.id.toUpperCase(),") ",t.label," — ",o(t.consequence)]}),(0,s.jsxs)("button",{type:"button",disabled:null!==p,onClick:()=>{w(e,t.id)},className:"rounded-md border border-border px-3 py-1 font-medium hover:bg-muted disabled:opacity-50",children:[t.label," 선택"]})]},t.id))}),(0,s.jsx)("p",{className:"text-sm",children:(null==(a=e.crossCheck)?void 0:a.length)?"교차 확인: ".concat(e.crossCheck.map(e=>"".concat(e.seat," ✓ ").concat(e.note).concat(e.at?" \xb7 ".concat(i(e.at)," KST"):"")).join(" \xb7 ")):"교차 확인 없음(".concat(null!=(j=e.crossCheckSkipped)?j:"미기재",")")}),e.dissent&&(0,s.jsxs)("p",{className:"text-sm",children:["이견: ",e.dissent]}),e.dueAt&&(0,s.jsxs)("p",{className:"text-sm",children:["기한: ",(0,s.jsxs)("time",{dateTime:e.dueAt,children:[i(e.dueAt)," KST"]})]}),e.pendingQuestion&&(0,s.jsxs)("details",{className:"text-sm",children:[(0,s.jsx)("summary",{className:"cursor-pointer",children:"대기 질문 전문"}),(0,s.jsx)("p",{className:"mt-2 whitespace-pre-wrap",children:e.pendingQuestion})]}),(0,s.jsxs)("label",{className:"block text-sm",children:["한 줄 의견 (최대 300자)",(0,s.jsx)("input",{type:"text",maxLength:300,value:null!=(v=d[e.id])?v:"",onChange:t=>c(n=>({...n,[e.id]:t.target.value.slice(0,300)})),className:"mt-1 block w-full rounded-md border border-border bg-background px-3 py-2"})]}),k&&(0,s.jsxs)("div",{role:"alert",className:"rounded-md border border-amber-600 p-2 text-sm",children:[(0,s.jsxs)("p",{children:["되돌릴 수 없습니다 — 이것으로 정할까요? (",k.label,")"]}),(0,s.jsx)("button",{type:"button",disabled:null!==p,onClick:()=>{w(e,k.id,!0)},className:"mr-3 underline",children:"예, 결정"}),(0,s.jsx)("button",{type:"button",onClick:()=>m(null),className:"underline",children:"취소"})]}),p===e.id&&(0,s.jsx)("p",{role:"status",children:"기록 중"}),b[e.id]&&(0,s.jsx)("p",{role:"alert",children:b[e.id]})]})},e.id)})})]})}},33626:(e,t,n)=>{"use strict";async function s(e){let t=await e.fetchResponse("/v1/decisions?status=open");if(!t.ok)throw Error("decisions list failed: ".concat(t.status));return(await t.json()).decisions}async function r(e,t,n,s){let r=await e.fetchResponse("/v1/decisions/".concat(encodeURIComponent(t),"/decide"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({choice:n,...void 0===s?{}:{note:s}})});if(!r.ok)throw Error("decision failed: ".concat(r.status));return r.json()}n.d(t,{L:()=>r,q:()=>s})},67546:(e,t,n)=>{Promise.resolve().then(n.bind(n,15237))}},e=>{e.O(0,[8060,2463,2196,7358],()=>e(e.s=67546)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6348],{3004:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(3704).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},18068:(e,t,s)=>{"use strict";s.d(t,{Qb:()=>a,SI:()=>o,dJ:()=>l});let n="elanous:auth-required",r=null,i=!1;function a(e){null===r&&(r=e,window.dispatchEvent(new CustomEvent(n,{detail:{path:e}})))}function l(e){let t=window,s=t=>e(t.detail);return t.addEventListener(n,s),null===r||i||e({path:r}),()=>t.removeEventListener(n,s)}function o(){i=!0}},24231:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(3704).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"}]])},47106:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>E});var n=s(55539),r=s(81694),i=s(3004);let a=(0,s(3704).A)("circle-dashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]);var l=s(74227),o=s(24231),c=s(46124),d=s(94306),u=s(21501),h=s(50363),m=s(67264),p=s(65354),g=s(79247);function f(e){let{available:t,declared:s,onPick:r,pendingId:i,previews:a,onPreview:l}=e,{systems:o,themes:c}=function(e){let t=[],s=[];for(let n of e)("design-system"===n.source?t:s).push(n);return{systems:t,themes:s}}(t);return(0,n.jsxs)("div",{className:"space-y-4",children:[o.length>0&&(0,n.jsx)(x,{title:"Design systems",hint:"Web \xb7 copies tokens.css and DESIGN.md into design/system/",items:o,declared:s,onPick:r,pendingId:i,previews:a,onPreview:l}),c.length>0&&(0,n.jsx)(x,{title:"Terminal themes",hint:"One line in DESIGN.md",items:c,declared:s,onPick:r,pendingId:i,previews:a,onPreview:l})]})}function x(e){let{title:t,hint:s,items:r,declared:i,onPick:a,pendingId:l,previews:o,onPreview:c}=e;return(0,n.jsxs)("section",{className:"space-y-2","aria-label":t,children:[(0,n.jsxs)("h3",{className:"flex items-baseline gap-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:[t,(0,n.jsxs)("span",{className:"normal-case tracking-normal",children:[r.length," \xb7 ",s]})]}),(0,n.jsx)("ul",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:r.map(e=>(0,n.jsx)(b,{direction:e,chosen:e.id===i,onPick:a,pending:l===e.id,busy:null!==l,hasPreview:(null==o?void 0:o.has(e.id))===!0&&void 0!==c,onPreview:c},e.id))})]})}function b(e){var t,s,r,a,l,o,c,d,u;let{direction:h,chosen:m,onPick:p,pending:g,busy:f,hasPreview:x,onPreview:b}=e,y=null!=(r=h.swatch.bg)?r:h.isDark?"#111111":"#ffffff",v=null!=(a=h.swatch.fg)?a:h.swatch.text,w=null!=(o=null!=(l=null==(t=h.typography)?void 0:t.display)?l:null==(s=h.typography)?void 0:s.body)?o:null;return(0,n.jsxs)("li",{"data-direction":h.id,"data-direction-id":h.id,className:"flex flex-col gap-2 rounded-md border p-3 text-sm ".concat(m?"border-primary ring-1 ring-primary":""),children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5","aria-hidden":!0,children:[[y,v,h.swatch.accent].map((e,t)=>(0,n.jsx)("span",{className:"h-5 w-5 rounded-full border",style:{backgroundColor:e,borderColor:h.swatch.muted}},t)),h.category&&(0,n.jsx)("span",{className:"ml-auto truncate text-[11px] text-muted-foreground",children:h.category})]}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"truncate font-medium",children:null!=(c=h.label)?c:h.id}),(0,n.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[(0,n.jsx)("code",{children:h.id}),w?" \xb7 ".concat(w):""]}),(0,n.jsx)("p",{className:"mt-1 line-clamp-2 text-xs text-muted-foreground",children:h.mood})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[x&&(0,n.jsx)("button",{type:"button",onClick:()=>null==b?void 0:b(h.id),className:"self-start rounded-md border px-2.5 py-1 text-xs hover:bg-muted","aria-label":"Preview ".concat(null!=(d=h.label)?d:h.id),children:"Preview"}),m?(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-primary",children:[(0,n.jsx)(i.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Selected"]}):(0,n.jsx)("button",{type:"button",disabled:f,onClick:()=>p(h.id),className:"self-start rounded-md border px-2.5 py-1 text-xs hover:bg-muted disabled:opacity-50","aria-label":"Select ".concat(null!=(u=h.label)?u:h.id),children:g?"Selecting…":"Select"})]})]})}let y=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;function v(e){return e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean)}function w(e,t){if("undefined"==typeof document)return t;let s=document.getElementById(e);return s&&"value"in s&&"string"==typeof s.value?s.value:t}function k(e){let{onCreate:t,onSelect:s,pending:r,result:i,error:a}=e,[l,o]=(0,c.useState)("url"),[d,u]=(0,c.useState)(""),[h,m]=(0,c.useState)(""),[p,g]=(0,c.useState)(""),f=v(h).filter(e=>y.test(e)),x=v(h).length,b=x>=2&&x<=6&&p.trim().length>0&&f.length===x;return(0,n.jsxs)("section",{className:"rounded-md border p-3","aria-label":"Make my system","data-make-my-system":"",children:[(0,n.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,n.jsx)("h3",{className:"text-sm font-medium",children:"Make my system"}),(0,n.jsxs)("div",{className:"flex gap-1",role:"tablist",children:[(0,n.jsx)("button",{type:"button",role:"tab","aria-selected":"url"===l,className:"rounded-md px-2 py-1 text-xs ".concat("url"===l?"bg-muted":""),onClick:()=>o("url"),children:"From a website"}),(0,n.jsx)("button",{type:"button",role:"tab","aria-selected":"colors"===l,className:"rounded-md px-2 py-1 text-xs ".concat("colors"===l?"bg-muted":""),onClick:()=>o("colors"),children:"From colors"})]})]}),(0,n.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"Reference, not a copy — logos, names, images and text are not taken."}),"url"===l?(0,n.jsxs)("form",{className:"mt-2 flex flex-col gap-2 sm:flex-row",onSubmit:e=>{e.preventDefault();let s=d.trim();s&&!r&&t({kind:"url",url:s})},children:[(0,n.jsx)("label",{className:"sr-only",htmlFor:"make-system-url",children:"Website URL"}),(0,n.jsx)("input",{id:"make-system-url",type:"url",value:d,disabled:r,placeholder:"https://example.com",onChange:e=>u(e.target.value),className:"min-w-0 flex-1 rounded-md border bg-transparent px-2 py-1.5 text-sm"}),(0,n.jsx)("button",{type:"button",disabled:r,onClick:()=>{let e=w("make-system-url",d).trim();e&&!r&&t({kind:"url",url:e})},className:"rounded-md border px-3 py-1.5 text-sm hover:bg-muted disabled:opacity-50",children:r?"Measuring…":"Make it"})]}):(0,n.jsxs)("form",{className:"mt-2 space-y-2",onSubmit:e=>{e.preventDefault(),b&&!r&&t({kind:"palette",colors:f,id:p.trim()})},children:[(0,n.jsx)("label",{className:"block text-xs text-muted-foreground",htmlFor:"make-system-colors",children:"2–6 colors"}),(0,n.jsx)("input",{id:"make-system-colors",value:h,disabled:r,placeholder:"#f4efe6, #1f3a2e, #c8553d",onChange:e=>m(e.target.value),className:"w-full rounded-md border bg-transparent px-2 py-1.5 text-sm"}),f.length>0&&(0,n.jsx)("ul",{className:"flex gap-1","aria-label":"Color preview",children:f.map(e=>(0,n.jsx)("li",{className:"h-6 w-6 rounded-sm border",style:{backgroundColor:e},title:e},e))}),(0,n.jsx)("label",{className:"block text-xs text-muted-foreground",htmlFor:"make-system-id",children:"id"}),(0,n.jsx)("input",{id:"make-system-id",value:p,disabled:r,placeholder:"stumptowncoffee",onChange:e=>g(e.target.value),className:"w-full rounded-md border bg-transparent px-2 py-1.5 text-sm"}),(0,n.jsx)("button",{type:"button",disabled:r,onClick:()=>{let e=v(w("make-system-colors",h)).filter(e=>y.test(e)),s=w("make-system-id",p).trim();r||e.length<2||e.length>6||0===s.length||t({kind:"palette",colors:e,id:s})},className:"rounded-md border px-3 py-1.5 text-sm hover:bg-muted disabled:opacity-50",children:r?"Measuring…":"Make it"})]}),r&&(0,n.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Measuring…"}),a&&(0,n.jsx)("p",{className:"mt-2 text-sm text-error",role:"alert",children:a}),i&&(0,n.jsxs)("div",{className:"mt-2 space-y-1 text-sm",children:[(0,n.jsxs)("p",{children:["Made ",i.id," — ",i.tokens.length," tokens \xb7 ",i.unread," unread"]}),i.warnings.map(e=>(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:e},e)),(0,n.jsx)("button",{type:"button",onClick:()=>s(i.id),className:"rounded-md border px-2.5 py-1 text-xs hover:bg-muted",children:"Select it"})]})]})}let j={missing:"Missing",declared:"Declared",available:"Not declared"},N={missing:"bg-error/10 text-error",declared:"bg-green-600/10 text-green-700",available:"bg-muted text-muted-foreground"},S={missing:r.A,declared:i.A,available:a};function C(){return(0,d.Qj)()?(0,n.jsx)(M,{}):(0,n.jsxs)("div",{className:"mx-auto max-w-2xl space-y-2 p-6",children:[(0,n.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"Design check"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Connect to a NEXUS daemon to see this repository's craft rulebooks."})]})}function M(){let{data:e,isLoading:t,error:s,refetch:i,isFetching:a}=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=(0,d.M1)();return(0,u.I)({queryKey:p.AF.designCheck(),queryFn:()=>s.getDesignCheck(),enabled:null==(e=t.enabled)||e,refetchInterval:3e4})}();return(0,n.jsxs)("div",{className:"mx-auto max-w-3xl space-y-4 p-6",children:[(0,n.jsxs)("header",{className:"flex items-start justify-between gap-4",children:[(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsxs)("h1",{className:"flex items-center gap-2 text-xl font-semibold tracking-tight",children:[(0,n.jsx)(l.A,{className:"h-5 w-5","aria-hidden":!0}),"Design check"]}),(0,n.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Craft rulebooks declared by this repository's ",(0,n.jsx)("code",{children:"DESIGN.md"}),"."]})]}),(0,n.jsxs)("button",{type:"button",onClick:()=>void i(),className:"inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-sm hover:bg-muted","aria-label":"Refresh design check",children:[(0,n.jsx)(o.A,{className:"h-4 w-4 ".concat(a?"animate-spin":""),"aria-hidden":!0}),"Refresh"]})]}),t&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading…"}),s&&(0,n.jsxs)("p",{className:"rounded-md bg-error/10 p-3 text-sm text-error",children:["Could not reach the daemon: ",s instanceof Error?s.message:String(s)]}),e&&!1===e.ok&&(0,n.jsxs)("div",{className:"space-y-2 rounded-md border border-warning/40 bg-warning/5 p-4",children:[(0,n.jsxs)("p",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,n.jsx)(r.A,{className:"h-4 w-4 text-warning","aria-hidden":!0}),"Design check blocked"]}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:function(e,t){switch(e){case"no-repository":return"The daemon is not running inside a git checkout, so there is no DESIGN.md to check.";case"craft-directory":return"elanous's craft rulebook directory could not be read: ".concat(null!=t?t:"(unknown path)");case"design-document":return"This repository has no readable DESIGN.md: ".concat(null!=t?t:"(unknown path)");default:return"The design check is blocked (".concat(e,").")}}(e.blockedOn,e.path)})]}),e&&!0===e.ok&&(0,n.jsx)(F,{data:e})]})}function F(e){let{data:t}=e,s=function(e){let t=new Set(e.unavailableRulebooks),s=new Map;for(let t of e.availableRulebooks)s.set(t,"available");for(let n of e.declaredRulebooks)s.set(n,t.has(n)?"missing":"declared");let n={missing:0,declared:1,available:2};return[...s.entries()].map(e=>{let[t,s]=e;return{name:t,status:s}}).sort((e,t)=>n[e.status]-n[t.status]||e.name.localeCompare(t.name))}(t),r=t.unavailableRulebooks.length;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"rounded-md p-3 text-sm ".concat(r?"bg-error/10 text-error":"bg-green-600/10 text-green-700"),children:r?"".concat(r," declared rulebook").concat(1===r?"":"s"," could not be found."):"All ".concat(t.declaredRulebooks.length," declared rulebook").concat(1===t.declaredRulebooks.length?"":"s"," resolve.")}),(0,n.jsxs)("dl",{className:"grid grid-cols-1 gap-1 text-xs text-muted-foreground sm:grid-cols-2",children:[(0,n.jsxs)("div",{className:"truncate sm:col-span-2",children:[(0,n.jsx)("dt",{className:"inline font-medium",children:"Repository: "}),(0,n.jsxs)("dd",{className:"inline",children:[(0,n.jsx)("code",{children:t.repoRoot}),t.repoSource&&(0,n.jsxs)("span",{className:"ml-1",children:["(","config"===t.repoSource?"harness.defaultRepo":"daemon folder",")"]})]})]}),(0,n.jsxs)("div",{className:"truncate",children:[(0,n.jsx)("dt",{className:"inline font-medium",children:"Document: "}),(0,n.jsx)("dd",{className:"inline",children:(0,n.jsx)("code",{children:t.documentPath})})]}),(0,n.jsxs)("div",{className:"truncate",children:[(0,n.jsx)("dt",{className:"inline font-medium",children:"Rulebooks: "}),(0,n.jsx)("dd",{className:"inline",children:(0,n.jsx)("code",{children:t.craftDirectory})})]})]}),(0,n.jsx)(O,{data:t}),0===s.length?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"elanous ships no craft rulebooks and this document declares none."}):(0,n.jsx)("ul",{className:"divide-y rounded-md border",children:s.map(e=>{let t=S[e.status];return(0,n.jsxs)("li",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[(0,n.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,n.jsx)(t,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),(0,n.jsx)("code",{children:e.name})]}),(0,n.jsx)("span",{className:"shrink-0 rounded-full px-2 py-0.5 text-xs ".concat(N[e.status]),children:j[e.status]})]},e.name)})})]})}function O(e){var t,s,r,i;let{data:a}=e,l=function(){let e=(0,d.M1)(),t=(0,h.jE)();return(0,m.n)({mutationFn:t=>e.setDesignDirection(t),onSuccess:()=>t.invalidateQueries({queryKey:p.AF.designCheck()})})}(),o=function(){let e=(0,d.M1)(),t=(0,h.jE)();return(0,m.n)({mutationFn:t=>e.createDesignSystem(t),onSuccess:()=>t.invalidateQueries({queryKey:p.AF.designCheck()})})}(),x=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=(0,d.M1)();return(0,u.I)({queryKey:p.AF.designPreviews(),queryFn:()=>s.listDesignPreviews(),enabled:null==(e=t.enabled)||e,refetchInterval:3e4})}(),[b,y]=(0,c.useState)(null),[v,w]=(0,c.useState)(null),j=a.directions;if((0,c.useEffect)(()=>{if(!v||!j)return;let e=document.querySelector('[data-direction-id="'.concat(v.replace(/"/g,""),'"]'));null==e||e.scrollIntoView({block:"nearest"})},[v,j]),!j)return null;let N=l.isPending&&null!=(s=l.variables)?s:null;return(0,n.jsxs)("section",{className:"space-y-2",children:[(0,n.jsx)("h2",{className:"text-sm font-medium",children:"Design direction"}),(0,n.jsx)(k,{pending:o.isPending,result:null!=(r=o.data)?r:null,error:o.isError?function(e){switch(e instanceof g.Iu&&e.body&&"object"==typeof e.body?e.body.reason:void 0){case"bad-url":return"That address is not an http or https URL.";case"bad-id":return"The id may only use lowercase letters, digits, and hyphens.";case"id-taken":return"That id is already taken.";case"extract-failed":return"The page could not be measured.";case"no-colors":return"Give between 2 and 6 colors.";case"busy":return"Another system is being made — wait for it to finish.";default:if(e instanceof g.Iu&&401===e.status)return"Only the owner can make a system — sign in first.";return"Could not make the system: ".concat(e instanceof Error?e.message:String(e))}}(o.error):null,onCreate:e=>{o.mutate(e,{onSuccess:e=>w(e.id)})},onSelect:e=>{w(e),l.mutate(e)}}),j.unavailable&&(0,n.jsxs)("p",{className:"rounded-md bg-error/10 p-2 text-sm text-error",children:["Declared direction ",(0,n.jsx)("code",{children:j.unavailable})," is not registered."]}),null===j.declared&&!j.unavailable&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"None declared — pick one below."}),l.isError&&(0,n.jsx)("p",{className:"rounded-md bg-error/10 p-2 text-sm text-error",children:function(e){switch(e instanceof g.Iu&&e.body&&"object"==typeof e.body?e.body.reason:void 0){case"unknown-direction":return"The daemon does not know this direction.";case"no-repository":return"The daemon has no repository to write to (set harness.defaultRepo).";case"conflicting-system-file":return"design/system/ already holds a file the daemon will not overwrite.";case"cannot-read":return"The DESIGN.md could not be read.";case"cannot-write":return"The DESIGN.md could not be written.";default:if(e instanceof g.Iu&&401===e.status)return"Only the owner can pick a direction — sign in first.";return"Could not set the direction: ".concat(e instanceof Error?e.message:String(e))}}(l.error)}),b&&(0,n.jsx)(A,{system:b,onClose:()=>y(null),onSelect:()=>l.mutate(b),selecting:N===b,busy:null!==N,alreadySelected:j.declared===b}),(0,n.jsx)(f,{available:j.available,declared:j.declared,pendingId:N,previews:new Set((null!=(i=null==(t=x.data)?void 0:t.previews)?i:[]).map(e=>e.system)),onPreview:e=>y(e),onPick:e=>l.mutate(e)})]})}function A(e){let{system:t,onClose:s,onSelect:r,selecting:i,busy:a,alreadySelected:l}=e,o=function(e){let t=(0,d.M1)();return(0,u.I)({queryKey:p.AF.designPreview(null!=e?e:""),queryFn:()=>t.getDesignPreview(e),enabled:null!==e&&""!==e})}(t);return(0,n.jsxs)("div",{className:"space-y-2 rounded-md border p-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("p",{className:"text-sm font-medium",children:["Preview \xb7 ",(0,n.jsx)("code",{children:t})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[l?(0,n.jsx)("span",{className:"text-xs text-primary",children:"Selected"}):(0,n.jsx)("button",{type:"button",disabled:a,onClick:r,className:"rounded-md border px-2.5 py-1 text-xs hover:bg-muted disabled:opacity-50","aria-label":"Select ".concat(t),children:i?"Selecting…":"Select"}),(0,n.jsx)("button",{type:"button",onClick:s,className:"rounded-md border px-2.5 py-1 text-xs hover:bg-muted","aria-label":"Close preview",children:"Close"})]})]}),o.isLoading&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading preview…"}),o.isError&&(0,n.jsxs)("p",{className:"text-sm text-error",children:["Could not load the preview: ",o.error instanceof Error?o.error.message:String(o.error)]}),o.data&&(0,n.jsx)("iframe",{sandbox:"",srcDoc:o.data.html,title:"Preview \xb7 ".concat(t),className:"h-80 w-full rounded-md border bg-white"})]})}function E(){return(0,n.jsx)(C,{})}},65354:(e,t,s)=>{"use strict";s.d(t,{AF:()=>n});let n={all:["nexus"],health:()=>[...n.all,"health"],snapshot:()=>[...n.all,"snapshot"],tabs:e=>e?[...n.all,"tabs",{kind:e}]:[...n.all,"tabs"],tab:e=>[...n.all,"tab",e],templates:()=>[...n.all,"templates"],template:e=>[...n.all,"template",e],config:()=>[...n.all,"config"],switches:()=>[...n.all,"switches"],switch:e=>[...n.all,"switch",e],secrets:()=>[...n.all,"secrets"],bindingChannels:()=>[...n.all,"bindings","channels"],bindings:e=>[...n.all,"bindings",e],binding:(e,t)=>[...n.all,"binding",e,t],logsTail:(e,t)=>t?[...n.all,"logs",e,{lines:t}]:[...n.all,"logs",e],workflows:()=>[...n.all,"workflows"],workflow:e=>[...n.all,"workflow",e],workflowRun:e=>[...n.all,"workflow-run",e],workflowRuns:()=>[...n.all,"workflow-runs"],pendingApprovals:()=>[...n.all,"workflow-pending-approvals"],platforms:()=>[...n.all,"platforms"],providers:()=>[...n.all,"providers"],worktrees:()=>[...n.all,"worktrees"],designCheck:()=>[...n.all,"design-check"],designPreviews:()=>[...n.all,"design-previews"],designPreview:e=>[...n.all,"design-preview",e],registryCatalog:()=>[...n.all,"registry-catalog"],resolvedView:()=>[...n.all,"resolved-view"]};n.snapshot(),n.tabs(),n.health(),n.snapshot(),n.config(),n.switches()},67264:(e,t,s)=>{"use strict";s.d(t,{n:()=>d});var n=s(46124),r=s(17600),i=s(92477),a=s(33814),l=s(40404),o=class extends a.Q{#e;#t=void 0;#s;#n;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#r()}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.#r(),this.#i(e)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#r(),this.#i()}mutate(e,t){return this.#n=t,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(e)}#r(){let e=this.#s?.state??(0,r.$)();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}}#i(e){i.jG.batch(()=>{if(this.#n&&this.hasListeners()){let t=this.#t.variables,s=this.#t.context,n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#n.onSuccess?.(e.data,t,s,n)}catch(e){Promise.reject(e)}try{this.#n.onSettled?.(e.data,null,t,s,n)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#n.onError?.(e.error,t,s,n)}catch(e){Promise.reject(e)}try{this.#n.onSettled?.(void 0,e.error,t,s,n)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},c=s(50363);function d(e,t){let s=(0,c.jE)(t),[r]=n.useState(()=>new o(s,e));n.useEffect(()=>{r.setOptions(e)},[r,e]);let a=n.useSyncExternalStore(n.useCallback(e=>r.subscribe(i.jG.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),d=n.useCallback((e,t)=>{r.mutate(e,t).catch(l.lQ)},[r]);if(a.error&&(0,l.GU)(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:d,mutateAsync:a.mutate}}},72215:(e,t,s)=>{"use strict";let n;s.d(t,{cY:()=>d,x8:()=>l});let r={debug:0,info:1,warn:2,error:3},i="/v1/debug-logs/batch",a=null;function l(e){a=e}class o{health(){return{pending:this.queue.length,consecutiveFailures:this.consecutiveFailures,lastOkAt:this.lastOkAt,droppedByCap:this.droppedByCap,fallbackBatches:this.fallbackBatches}}push(e){if(!(r[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)]<r[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 n,r;t=await (n=this.fetchFn(s),r=this.postTimeoutMs,new Promise((e,t)=>{let s=setTimeout(()=>t(Error("debug-forward timeout after ".concat(r,"ms"))),r);n.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&&a)try{await a(JSON.stringify({records:[...e,this.blockedNotice()]}))&&(this.fallbackBatches+=1)}catch(e){}this.wasFailing=!0,this.scheduleRetry();return}let i=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:i},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(i,t)&&this.queue.splice(0,e.length)}}catch(e){}}get pending(){return this.queue.length}constructor(e=c,t="debug",s=1e4,n=100){this.fetchFn=e,this.minLevel=t,this.postTimeoutMs=s,this.flushMs=n,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(i,{method:"POST",headers:{"content-type":"application/json"},body:e,keepalive:!0,..."undefined"!=typeof AbortSignal&&"function"==typeof AbortSignal.timeout?{signal:AbortSignal.timeout(1e4)}:{}})).ok}function d(e,t){if("undefined"==typeof console)return;let s=new Date().toISOString();if(void 0!==t){let n="";try{let e=new WeakSet;n=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){n="[unserializable: ".concat(String(e),"]")}n&&n.length>800&&(n=n.slice(0,797)+"..."),console.debug("[".concat(s,"] ").concat(e," ").concat(n),t),u(s,e,n)}else console.debug("[".concat(s,"] ").concat(e)),u(s,e,void 0)}function u(e,t,s){let r,i=function(){if(void 0!==n)return n;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 n=null,null;let t=new o(c,e.level,1e4,1500);try{window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&t.beaconFlush()})}catch(e){}return n=t,t}();if(!i)return;let a=t.slice(t.lastIndexOf(".")+1)||t;if(void 0!==s&&""!==s)try{r=JSON.parse(s)}catch(e){r=s}i.push({ts:e,category:t,event:a,...void 0!==r?{data:r}:{},source:{platform:"pwa"}})}},73057:(e,t,s)=>{Promise.resolve().then(s.bind(s,47106))},74227:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(3704).A)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])},81694:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(3704).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"}]])},94306:(e,t,s)=>{"use strict";s.d(t,{M1:()=>c,Qj:()=>d,tI:()=>o});var n=s(55539),r=s(46124),i=s(76642),a=s(50363);let l=(0,r.createContext)(null);function o(e){let{client:t,queryClient:s,defaultStaleTimeMs:o,children:c}=e,d=(0,r.useMemo)(()=>null!=s?s:new i.E({defaultOptions:{queries:{staleTime:null!=o?o:2e3,refetchOnWindowFocus:!1}}}),[s,o]);return(0,n.jsx)(l.Provider,{value:t,children:(0,n.jsx)(a.Ht,{client:d,children:c})})}function c(){let e=(0,r.useContext)(l);if(!e)throw Error("useNexusClient must be used within <NexusProvider>");return e}function d(){return(0,r.useContext)(l)}}},e=>{e.O(0,[3324,1844,9247,2463,2196,7358],()=>e(e.s=73057)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6348],{3004:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(3704).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},18068:(e,t,s)=>{"use strict";s.d(t,{Qb:()=>a,SI:()=>o,dJ:()=>l});let n="elanous:auth-required",r=null,i=!1;function a(e){null===r&&(r=e,window.dispatchEvent(new CustomEvent(n,{detail:{path:e}})))}function l(e){let t=window,s=t=>e(t.detail);return t.addEventListener(n,s),null===r||i||e({path:r}),()=>t.removeEventListener(n,s)}function o(){i=!0}},24231:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(3704).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"}]])},47106:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>E});var n=s(55539),r=s(81694),i=s(3004);let a=(0,s(3704).A)("circle-dashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]);var l=s(74227),o=s(24231),c=s(46124),d=s(94306),u=s(21501),h=s(50363),m=s(67264),p=s(65354),g=s(79247);function f(e){let{available:t,declared:s,onPick:r,pendingId:i,previews:a,onPreview:l}=e,{systems:o,themes:c}=function(e){let t=[],s=[];for(let n of e)("design-system"===n.source?t:s).push(n);return{systems:t,themes:s}}(t);return(0,n.jsxs)("div",{className:"space-y-4",children:[o.length>0&&(0,n.jsx)(x,{title:"Design systems",hint:"Web \xb7 copies tokens.css and DESIGN.md into design/system/",items:o,declared:s,onPick:r,pendingId:i,previews:a,onPreview:l}),c.length>0&&(0,n.jsx)(x,{title:"Terminal themes",hint:"One line in DESIGN.md",items:c,declared:s,onPick:r,pendingId:i,previews:a,onPreview:l})]})}function x(e){let{title:t,hint:s,items:r,declared:i,onPick:a,pendingId:l,previews:o,onPreview:c}=e;return(0,n.jsxs)("section",{className:"space-y-2","aria-label":t,children:[(0,n.jsxs)("h3",{className:"flex items-baseline gap-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:[t,(0,n.jsxs)("span",{className:"normal-case tracking-normal",children:[r.length," \xb7 ",s]})]}),(0,n.jsx)("ul",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:r.map(e=>(0,n.jsx)(b,{direction:e,chosen:e.id===i,onPick:a,pending:l===e.id,busy:null!==l,hasPreview:(null==o?void 0:o.has(e.id))===!0&&void 0!==c,onPreview:c},e.id))})]})}function b(e){var t,s,r,a,l,o,c,d,u;let{direction:h,chosen:m,onPick:p,pending:g,busy:f,hasPreview:x,onPreview:b}=e,y=null!=(r=h.swatch.bg)?r:h.isDark?"#111111":"#ffffff",v=null!=(a=h.swatch.fg)?a:h.swatch.text,w=null!=(o=null!=(l=null==(t=h.typography)?void 0:t.display)?l:null==(s=h.typography)?void 0:s.body)?o:null;return(0,n.jsxs)("li",{"data-direction":h.id,"data-direction-id":h.id,className:"flex flex-col gap-2 rounded-md border p-3 text-sm ".concat(m?"border-primary ring-1 ring-primary":""),children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5","aria-hidden":!0,children:[[y,v,h.swatch.accent].map((e,t)=>(0,n.jsx)("span",{className:"h-5 w-5 rounded-full border",style:{backgroundColor:e,borderColor:h.swatch.muted}},t)),h.category&&(0,n.jsx)("span",{className:"ml-auto truncate text-[11px] text-muted-foreground",children:h.category})]}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"truncate font-medium",children:null!=(c=h.label)?c:h.id}),(0,n.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[(0,n.jsx)("code",{children:h.id}),w?" \xb7 ".concat(w):""]}),(0,n.jsx)("p",{className:"mt-1 line-clamp-2 text-xs text-muted-foreground",children:h.mood})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[x&&(0,n.jsx)("button",{type:"button",onClick:()=>null==b?void 0:b(h.id),className:"self-start rounded-md border px-2.5 py-1 text-xs hover:bg-muted","aria-label":"Preview ".concat(null!=(d=h.label)?d:h.id),children:"Preview"}),m?(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-primary",children:[(0,n.jsx)(i.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Selected"]}):(0,n.jsx)("button",{type:"button",disabled:f,onClick:()=>p(h.id),className:"self-start rounded-md border px-2.5 py-1 text-xs hover:bg-muted disabled:opacity-50","aria-label":"Select ".concat(null!=(u=h.label)?u:h.id),children:g?"Selecting…":"Select"})]})]})}let y=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;function v(e){return e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean)}function w(e,t){if("undefined"==typeof document)return t;let s=document.getElementById(e);return s&&"value"in s&&"string"==typeof s.value?s.value:t}function k(e){let{onCreate:t,onSelect:s,pending:r,result:i,error:a}=e,[l,o]=(0,c.useState)("url"),[d,u]=(0,c.useState)(""),[h,m]=(0,c.useState)(""),[p,g]=(0,c.useState)(""),f=v(h).filter(e=>y.test(e)),x=v(h).length,b=x>=2&&x<=6&&p.trim().length>0&&f.length===x;return(0,n.jsxs)("section",{className:"rounded-md border p-3","aria-label":"Make my system","data-make-my-system":"",children:[(0,n.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,n.jsx)("h3",{className:"text-sm font-medium",children:"Make my system"}),(0,n.jsxs)("div",{className:"flex gap-1",role:"tablist",children:[(0,n.jsx)("button",{type:"button",role:"tab","aria-selected":"url"===l,className:"rounded-md px-2 py-1 text-xs ".concat("url"===l?"bg-muted":""),onClick:()=>o("url"),children:"From a website"}),(0,n.jsx)("button",{type:"button",role:"tab","aria-selected":"colors"===l,className:"rounded-md px-2 py-1 text-xs ".concat("colors"===l?"bg-muted":""),onClick:()=>o("colors"),children:"From colors"})]})]}),(0,n.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"Reference, not a copy — logos, names, images and text are not taken."}),"url"===l?(0,n.jsxs)("form",{className:"mt-2 flex flex-col gap-2 sm:flex-row",onSubmit:e=>{e.preventDefault();let s=d.trim();s&&!r&&t({kind:"url",url:s})},children:[(0,n.jsx)("label",{className:"sr-only",htmlFor:"make-system-url",children:"Website URL"}),(0,n.jsx)("input",{id:"make-system-url",type:"url",value:d,disabled:r,placeholder:"https://example.com",onChange:e=>u(e.target.value),className:"min-w-0 flex-1 rounded-md border bg-transparent px-2 py-1.5 text-sm"}),(0,n.jsx)("button",{type:"button",disabled:r,onClick:()=>{let e=w("make-system-url",d).trim();e&&!r&&t({kind:"url",url:e})},className:"rounded-md border px-3 py-1.5 text-sm hover:bg-muted disabled:opacity-50",children:r?"Measuring…":"Make it"})]}):(0,n.jsxs)("form",{className:"mt-2 space-y-2",onSubmit:e=>{e.preventDefault(),b&&!r&&t({kind:"palette",colors:f,id:p.trim()})},children:[(0,n.jsx)("label",{className:"block text-xs text-muted-foreground",htmlFor:"make-system-colors",children:"2–6 colors"}),(0,n.jsx)("input",{id:"make-system-colors",value:h,disabled:r,placeholder:"#f4efe6, #1f3a2e, #c8553d",onChange:e=>m(e.target.value),className:"w-full rounded-md border bg-transparent px-2 py-1.5 text-sm"}),f.length>0&&(0,n.jsx)("ul",{className:"flex gap-1","aria-label":"Color preview",children:f.map(e=>(0,n.jsx)("li",{className:"h-6 w-6 rounded-sm border",style:{backgroundColor:e},title:e},e))}),(0,n.jsx)("label",{className:"block text-xs text-muted-foreground",htmlFor:"make-system-id",children:"id"}),(0,n.jsx)("input",{id:"make-system-id",value:p,disabled:r,placeholder:"stumptowncoffee",onChange:e=>g(e.target.value),className:"w-full rounded-md border bg-transparent px-2 py-1.5 text-sm"}),(0,n.jsx)("button",{type:"button",disabled:r,onClick:()=>{let e=v(w("make-system-colors",h)).filter(e=>y.test(e)),s=w("make-system-id",p).trim();r||e.length<2||e.length>6||0===s.length||t({kind:"palette",colors:e,id:s})},className:"rounded-md border px-3 py-1.5 text-sm hover:bg-muted disabled:opacity-50",children:r?"Measuring…":"Make it"})]}),r&&(0,n.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Measuring…"}),a&&(0,n.jsx)("p",{className:"mt-2 text-sm text-error",role:"alert",children:a}),i&&(0,n.jsxs)("div",{className:"mt-2 space-y-1 text-sm",children:[(0,n.jsxs)("p",{children:["Made ",i.id," — ",i.tokens.length," tokens \xb7 ",i.unread," unread"]}),i.warnings.map(e=>(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:e},e)),(0,n.jsx)("button",{type:"button",onClick:()=>s(i.id),className:"rounded-md border px-2.5 py-1 text-xs hover:bg-muted",children:"Select it"})]})]})}let j={missing:"Missing",declared:"Declared",available:"Not declared"},N={missing:"bg-error/10 text-error",declared:"bg-green-600/10 text-green-700",available:"bg-muted text-muted-foreground"},S={missing:r.A,declared:i.A,available:a};function C(){return(0,d.Qj)()?(0,n.jsx)(M,{}):(0,n.jsxs)("div",{className:"mx-auto max-w-2xl space-y-2 p-6",children:[(0,n.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"Design check"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Connect to a NEXUS daemon to see this repository's craft rulebooks."})]})}function M(){let{data:e,isLoading:t,error:s,refetch:i,isFetching:a}=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=(0,d.M1)();return(0,u.I)({queryKey:p.AF.designCheck(),queryFn:()=>s.getDesignCheck(),enabled:null==(e=t.enabled)||e,refetchInterval:3e4})}();return(0,n.jsxs)("div",{className:"mx-auto max-w-3xl space-y-4 p-6",children:[(0,n.jsxs)("header",{className:"flex items-start justify-between gap-4",children:[(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsxs)("h1",{className:"flex items-center gap-2 text-xl font-semibold tracking-tight",children:[(0,n.jsx)(l.A,{className:"h-5 w-5","aria-hidden":!0}),"Design check"]}),(0,n.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Craft rulebooks declared by this repository's ",(0,n.jsx)("code",{children:"DESIGN.md"}),"."]})]}),(0,n.jsxs)("button",{type:"button",onClick:()=>void i(),className:"inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-sm hover:bg-muted","aria-label":"Refresh design check",children:[(0,n.jsx)(o.A,{className:"h-4 w-4 ".concat(a?"animate-spin":""),"aria-hidden":!0}),"Refresh"]})]}),t&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading…"}),s&&(0,n.jsxs)("p",{className:"rounded-md bg-error/10 p-3 text-sm text-error",children:["Could not reach the daemon: ",s instanceof Error?s.message:String(s)]}),e&&!1===e.ok&&(0,n.jsxs)("div",{className:"space-y-2 rounded-md border border-warning/40 bg-warning/5 p-4",children:[(0,n.jsxs)("p",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,n.jsx)(r.A,{className:"h-4 w-4 text-warning","aria-hidden":!0}),"Design check blocked"]}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:function(e,t){switch(e){case"no-repository":return"The daemon is not running inside a git checkout, so there is no DESIGN.md to check.";case"craft-directory":return"elanous's craft rulebook directory could not be read: ".concat(null!=t?t:"(unknown path)");case"design-document":return"This repository has no readable DESIGN.md: ".concat(null!=t?t:"(unknown path)");default:return"The design check is blocked (".concat(e,").")}}(e.blockedOn,e.path)})]}),e&&!0===e.ok&&(0,n.jsx)(F,{data:e})]})}function F(e){let{data:t}=e,s=function(e){let t=new Set(e.unavailableRulebooks),s=new Map;for(let t of e.availableRulebooks)s.set(t,"available");for(let n of e.declaredRulebooks)s.set(n,t.has(n)?"missing":"declared");let n={missing:0,declared:1,available:2};return[...s.entries()].map(e=>{let[t,s]=e;return{name:t,status:s}}).sort((e,t)=>n[e.status]-n[t.status]||e.name.localeCompare(t.name))}(t),r=t.unavailableRulebooks.length;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"rounded-md p-3 text-sm ".concat(r?"bg-error/10 text-error":"bg-green-600/10 text-green-700"),children:r?"".concat(r," declared rulebook").concat(1===r?"":"s"," could not be found."):"All ".concat(t.declaredRulebooks.length," declared rulebook").concat(1===t.declaredRulebooks.length?"":"s"," resolve.")}),(0,n.jsxs)("dl",{className:"grid grid-cols-1 gap-1 text-xs text-muted-foreground sm:grid-cols-2",children:[(0,n.jsxs)("div",{className:"truncate sm:col-span-2",children:[(0,n.jsx)("dt",{className:"inline font-medium",children:"Repository: "}),(0,n.jsxs)("dd",{className:"inline",children:[(0,n.jsx)("code",{children:t.repoRoot}),t.repoSource&&(0,n.jsxs)("span",{className:"ml-1",children:["(","config"===t.repoSource?"harness.defaultRepo":"daemon folder",")"]})]})]}),(0,n.jsxs)("div",{className:"truncate",children:[(0,n.jsx)("dt",{className:"inline font-medium",children:"Document: "}),(0,n.jsx)("dd",{className:"inline",children:(0,n.jsx)("code",{children:t.documentPath})})]}),(0,n.jsxs)("div",{className:"truncate",children:[(0,n.jsx)("dt",{className:"inline font-medium",children:"Rulebooks: "}),(0,n.jsx)("dd",{className:"inline",children:(0,n.jsx)("code",{children:t.craftDirectory})})]})]}),(0,n.jsx)(O,{data:t}),0===s.length?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"elanous ships no craft rulebooks and this document declares none."}):(0,n.jsx)("ul",{className:"divide-y rounded-md border",children:s.map(e=>{let t=S[e.status];return(0,n.jsxs)("li",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[(0,n.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,n.jsx)(t,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),(0,n.jsx)("code",{children:e.name})]}),(0,n.jsx)("span",{className:"shrink-0 rounded-full px-2 py-0.5 text-xs ".concat(N[e.status]),children:j[e.status]})]},e.name)})})]})}function O(e){var t,s,r,i;let{data:a}=e,l=function(){let e=(0,d.M1)(),t=(0,h.jE)();return(0,m.n)({mutationFn:t=>e.setDesignDirection(t),onSuccess:()=>t.invalidateQueries({queryKey:p.AF.designCheck()})})}(),o=function(){let e=(0,d.M1)(),t=(0,h.jE)();return(0,m.n)({mutationFn:t=>e.createDesignSystem(t),onSuccess:()=>t.invalidateQueries({queryKey:p.AF.designCheck()})})}(),x=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=(0,d.M1)();return(0,u.I)({queryKey:p.AF.designPreviews(),queryFn:()=>s.listDesignPreviews(),enabled:null==(e=t.enabled)||e,refetchInterval:3e4})}(),[b,y]=(0,c.useState)(null),[v,w]=(0,c.useState)(null),j=a.directions;if((0,c.useEffect)(()=>{if(!v||!j)return;let e=document.querySelector('[data-direction-id="'.concat(v.replace(/"/g,""),'"]'));null==e||e.scrollIntoView({block:"nearest"})},[v,j]),!j)return null;let N=l.isPending&&null!=(s=l.variables)?s:null;return(0,n.jsxs)("section",{className:"space-y-2",children:[(0,n.jsx)("h2",{className:"text-sm font-medium",children:"Design direction"}),(0,n.jsx)(k,{pending:o.isPending,result:null!=(r=o.data)?r:null,error:o.isError?function(e){switch(e instanceof g.Iu&&e.body&&"object"==typeof e.body?e.body.reason:void 0){case"bad-url":return"That address is not an http or https URL.";case"bad-id":return"The id may only use lowercase letters, digits, and hyphens.";case"id-taken":return"That id is already taken.";case"extract-failed":return"The page could not be measured.";case"no-colors":return"Give between 2 and 6 colors.";case"busy":return"Another system is being made — wait for it to finish.";default:if(e instanceof g.Iu&&401===e.status)return"Only the owner can make a system — sign in first.";return"Could not make the system: ".concat(e instanceof Error?e.message:String(e))}}(o.error):null,onCreate:e=>{o.mutate(e,{onSuccess:e=>w(e.id)})},onSelect:e=>{w(e),l.mutate(e)}}),j.unavailable&&(0,n.jsxs)("p",{className:"rounded-md bg-error/10 p-2 text-sm text-error",children:["Declared direction ",(0,n.jsx)("code",{children:j.unavailable})," is not registered."]}),null===j.declared&&!j.unavailable&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"None declared — pick one below."}),l.isError&&(0,n.jsx)("p",{className:"rounded-md bg-error/10 p-2 text-sm text-error",children:function(e){switch(e instanceof g.Iu&&e.body&&"object"==typeof e.body?e.body.reason:void 0){case"unknown-direction":return"The daemon does not know this direction.";case"no-repository":return"The daemon has no repository to write to (set harness.defaultRepo).";case"conflicting-system-file":return"design/system/ already holds a file the daemon will not overwrite.";case"cannot-read":return"The DESIGN.md could not be read.";case"cannot-write":return"The DESIGN.md could not be written.";default:if(e instanceof g.Iu&&401===e.status)return"Only the owner can pick a direction — sign in first.";return"Could not set the direction: ".concat(e instanceof Error?e.message:String(e))}}(l.error)}),b&&(0,n.jsx)(A,{system:b,onClose:()=>y(null),onSelect:()=>l.mutate(b),selecting:N===b,busy:null!==N,alreadySelected:j.declared===b}),(0,n.jsx)(f,{available:j.available,declared:j.declared,pendingId:N,previews:new Set((null!=(i=null==(t=x.data)?void 0:t.previews)?i:[]).map(e=>e.system)),onPreview:e=>y(e),onPick:e=>l.mutate(e)})]})}function A(e){let{system:t,onClose:s,onSelect:r,selecting:i,busy:a,alreadySelected:l}=e,o=function(e){let t=(0,d.M1)();return(0,u.I)({queryKey:p.AF.designPreview(null!=e?e:""),queryFn:()=>t.getDesignPreview(e),enabled:null!==e&&""!==e})}(t);return(0,n.jsxs)("div",{className:"space-y-2 rounded-md border p-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("p",{className:"text-sm font-medium",children:["Preview \xb7 ",(0,n.jsx)("code",{children:t})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[l?(0,n.jsx)("span",{className:"text-xs text-primary",children:"Selected"}):(0,n.jsx)("button",{type:"button",disabled:a,onClick:r,className:"rounded-md border px-2.5 py-1 text-xs hover:bg-muted disabled:opacity-50","aria-label":"Select ".concat(t),children:i?"Selecting…":"Select"}),(0,n.jsx)("button",{type:"button",onClick:s,className:"rounded-md border px-2.5 py-1 text-xs hover:bg-muted","aria-label":"Close preview",children:"Close"})]})]}),o.isLoading&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading preview…"}),o.isError&&(0,n.jsxs)("p",{className:"text-sm text-error",children:["Could not load the preview: ",o.error instanceof Error?o.error.message:String(o.error)]}),o.data&&(0,n.jsx)("iframe",{sandbox:"",srcDoc:o.data.html,title:"Preview \xb7 ".concat(t),className:"h-80 w-full rounded-md border bg-white"})]})}function E(){return(0,n.jsx)(C,{})}},65354:(e,t,s)=>{"use strict";s.d(t,{AF:()=>n});let n={all:["nexus"],health:()=>[...n.all,"health"],snapshot:()=>[...n.all,"snapshot"],tabs:e=>e?[...n.all,"tabs",{kind:e}]:[...n.all,"tabs"],tab:e=>[...n.all,"tab",e],templates:()=>[...n.all,"templates"],template:e=>[...n.all,"template",e],config:()=>[...n.all,"config"],switches:()=>[...n.all,"switches"],switch:e=>[...n.all,"switch",e],secrets:()=>[...n.all,"secrets"],bindingChannels:()=>[...n.all,"bindings","channels"],bindings:e=>[...n.all,"bindings",e],binding:(e,t)=>[...n.all,"binding",e,t],logsTail:(e,t)=>t?[...n.all,"logs",e,{lines:t}]:[...n.all,"logs",e],workflows:()=>[...n.all,"workflows"],workflow:e=>[...n.all,"workflow",e],workflowRun:e=>[...n.all,"workflow-run",e],workflowRuns:()=>[...n.all,"workflow-runs"],pendingApprovals:()=>[...n.all,"workflow-pending-approvals"],platforms:()=>[...n.all,"platforms"],providers:()=>[...n.all,"providers"],worktrees:()=>[...n.all,"worktrees"],designCheck:()=>[...n.all,"design-check"],designPreviews:()=>[...n.all,"design-previews"],designPreview:e=>[...n.all,"design-preview",e],registryCatalog:()=>[...n.all,"registry-catalog"],resolvedView:()=>[...n.all,"resolved-view"]};n.snapshot(),n.tabs(),n.health(),n.snapshot(),n.config(),n.switches()},67264:(e,t,s)=>{"use strict";s.d(t,{n:()=>d});var n=s(46124),r=s(17600),i=s(92477),a=s(33814),l=s(40404),o=class extends a.Q{#e;#t=void 0;#s;#n;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#r()}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.#r(),this.#i(e)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#r(),this.#i()}mutate(e,t){return this.#n=t,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(e)}#r(){let e=this.#s?.state??(0,r.$)();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}}#i(e){i.jG.batch(()=>{if(this.#n&&this.hasListeners()){let t=this.#t.variables,s=this.#t.context,n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#n.onSuccess?.(e.data,t,s,n)}catch(e){Promise.reject(e)}try{this.#n.onSettled?.(e.data,null,t,s,n)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#n.onError?.(e.error,t,s,n)}catch(e){Promise.reject(e)}try{this.#n.onSettled?.(void 0,e.error,t,s,n)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},c=s(50363);function d(e,t){let s=(0,c.jE)(t),[r]=n.useState(()=>new o(s,e));n.useEffect(()=>{r.setOptions(e)},[r,e]);let a=n.useSyncExternalStore(n.useCallback(e=>r.subscribe(i.jG.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),d=n.useCallback((e,t)=>{r.mutate(e,t).catch(l.lQ)},[r]);if(a.error&&(0,l.GU)(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:d,mutateAsync:a.mutate}}},72215:(e,t,s)=>{"use strict";let n;s.d(t,{cY:()=>d,x8:()=>l});let r={debug:0,info:1,warn:2,error:3},i="/v1/debug-logs/batch",a=null;function l(e){a=e}class o{health(){return{pending:this.queue.length,consecutiveFailures:this.consecutiveFailures,lastOkAt:this.lastOkAt,droppedByCap:this.droppedByCap,fallbackBatches:this.fallbackBatches}}push(e){if(!(r[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)]<r[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 n,r;t=await (n=this.fetchFn(s),r=this.postTimeoutMs,new Promise((e,t)=>{let s=setTimeout(()=>t(Error("debug-forward timeout after ".concat(r,"ms"))),r);n.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&&a)try{await a(JSON.stringify({records:[...e,this.blockedNotice()]}))&&(this.fallbackBatches+=1)}catch(e){}this.wasFailing=!0,this.scheduleRetry();return}let i=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:i},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(i,t)&&this.queue.splice(0,e.length)}}catch(e){}}get pending(){return this.queue.length}constructor(e=c,t="debug",s=1e4,n=100){this.fetchFn=e,this.minLevel=t,this.postTimeoutMs=s,this.flushMs=n,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(i,{method:"POST",headers:{"content-type":"application/json"},body:e,keepalive:!0,..."undefined"!=typeof AbortSignal&&"function"==typeof AbortSignal.timeout?{signal:AbortSignal.timeout(1e4)}:{}})).ok}function d(e,t){if("undefined"==typeof console)return;let s=new Date().toISOString();if(void 0!==t){let n="";try{let e=new WeakSet;n=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){n="[unserializable: ".concat(String(e),"]")}n&&n.length>800&&(n=n.slice(0,797)+"..."),console.debug("[".concat(s,"] ").concat(e," ").concat(n),t),u(s,e,n)}else console.debug("[".concat(s,"] ").concat(e)),u(s,e,void 0)}function u(e,t,s){let r,i=function(){if(void 0!==n)return n;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 n=null,null;let t=new o(c,e.level,1e4,1500);try{window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&t.beaconFlush()})}catch(e){}return n=t,t}();if(!i)return;let a=t.slice(t.lastIndexOf(".")+1)||t;if(void 0!==s&&""!==s)try{r=JSON.parse(s)}catch(e){r=s}i.push({ts:e,category:t,event:a,...void 0!==r?{data:r}:{},source:{platform:"pwa"}})}},72802:(e,t,s)=>{Promise.resolve().then(s.bind(s,47106))},74227:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(3704).A)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])},81694:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(3704).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"}]])},94306:(e,t,s)=>{"use strict";s.d(t,{M1:()=>c,Qj:()=>d,tI:()=>o});var n=s(55539),r=s(46124),i=s(76642),a=s(50363);let l=(0,r.createContext)(null);function o(e){let{client:t,queryClient:s,defaultStaleTimeMs:o,children:c}=e,d=(0,r.useMemo)(()=>null!=s?s:new i.E({defaultOptions:{queries:{staleTime:null!=o?o:2e3,refetchOnWindowFocus:!1}}}),[s,o]);return(0,n.jsx)(l.Provider,{value:t,children:(0,n.jsx)(a.Ht,{client:d,children:c})})}function c(){let e=(0,r.useContext)(l);if(!e)throw Error("useNexusClient must be used within <NexusProvider>");return e}function d(){return(0,r.useContext)(l)}}},e=>{e.O(0,[3324,1844,9247,2463,2196,7358],()=>e(e.s=72802)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6766],{3219:(e,s,r)=>{"use strict";r.r(s),r.d(s,{default:()=>m});var a=r(55539),l=r(46124),t=r(21501),n=r(58603),c=r(94306),i=r(75764),d=r(43431),x=r(55519);function o(e){let{palette:s,fallback:r}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("strong",{children:"노드 팔레트"}),s.map(e=>{var s;return(0,a.jsxs)("span",{title:e.description,className:"rounded border border-border px-2 py-0.5",children:[e.kind," ",e.plugin&&(0,a.jsx)("small",{className:"rounded bg-accent/15 px-1 text-accent",children:e.plugin})]},"".concat(null!=(s=e.plugin)?s:"core",":").concat(e.kind))})]}),r&&(0,a.jsx)("p",{role:"status",className:"mt-1 text-warning",children:"어휘 목록을 불러오지 못해 코어 팔레트를 표시합니다."})]})}function p(e){let{palette:s,fallback:r}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("details",{className:"border-b border-border px-3 py-2 text-xs min-[640px]:hidden","aria-label":"노드 팔레트",children:[(0,a.jsxs)("summary",{className:"cursor-pointer",children:["노드 더하기 (",s.length,")"]}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)(o,{palette:s,fallback:r})})]}),(0,a.jsx)("div",{className:"hidden border-b border-border px-3 py-2 text-xs min-[640px]:block","aria-label":"노드 팔레트",children:(0,a.jsx)(o,{palette:s,fallback:r})})]})}function h(){let e="harness"===(0,n.useSearchParams)().get("mode")?"harness":"workflow",s=(0,c.Qj)(),r=(0,t.I)({queryKey:["graph-kinds",e],queryFn:()=>s.getGraphKinds(e),enabled:null!==s,retry:!1}),o=(0,l.useMemo)(()=>{var s;return(null==(s=r.data)?void 0:s.kinds.length)?r.data.kinds:("harness"===e?x.DN:x.CF).map(s=>({graph:e,kind:s,plugin:null,description:"",schema:{},core:!0}))},[r.data,e]),h=r.isError||r.isSuccess&&!r.data.kinds.length;return(0,a.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,a.jsxs)("header",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-border px-4 py-2",children:[(0,a.jsx)("h1",{className:"text-sm font-semibold",children:"편집기"}),(0,a.jsx)("nav",{"aria-label":"그래프 편집 모드",className:"flex gap-1",children:["workflow","harness"].map(s=>(0,a.jsx)("a",{href:"/app/editor/?mode=".concat(s),"aria-current":e===s?"page":void 0,className:"rounded px-3 py-1 text-xs ".concat(e===s?"bg-accent/15 text-text-primary":"text-text-tertiary hover:bg-surface-elevated"),children:"workflow"===s?"워크플로":"실행 그래프"},s))})]}),(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[s&&(0,a.jsx)(p,{palette:o,fallback:h}),"workflow"===e?(0,a.jsx)(i.N,{palette:o}):s?(0,a.jsx)(d.F,{palette:o}):(0,a.jsx)("p",{className:"p-4 text-sm text-text-tertiary",children:"Daemon 연결이 설정되지 않았습니다. Settings 에서 Base URL 을 입력하세요."})]})]})}function m(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)("p",{className:"p-4 text-sm",children:"편집기를 불러오는 중…"}),children:(0,a.jsx)(h,{})})}},11379:(e,s,r)=>{Promise.resolve().then(r.bind(r,3219))}},e=>{e.O(0,[9901,9182,3324,1844,1866,8868,8060,9247,8949,4554,2463,2196,7358],()=>e(e.s=11379)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6766],{3219:(e,s,r)=>{"use strict";r.r(s),r.d(s,{default:()=>m});var a=r(55539),l=r(46124),t=r(21501),n=r(58603),c=r(94306),i=r(75764),d=r(43431),x=r(55519);function o(e){let{palette:s,fallback:r}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("strong",{children:"노드 팔레트"}),s.map(e=>{var s;return(0,a.jsxs)("span",{title:e.description,className:"rounded border border-border px-2 py-0.5",children:[e.kind," ",e.plugin&&(0,a.jsx)("small",{className:"rounded bg-accent/15 px-1 text-accent",children:e.plugin})]},"".concat(null!=(s=e.plugin)?s:"core",":").concat(e.kind))})]}),r&&(0,a.jsx)("p",{role:"status",className:"mt-1 text-warning",children:"어휘 목록을 불러오지 못해 코어 팔레트를 표시합니다."})]})}function p(e){let{palette:s,fallback:r}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("details",{className:"border-b border-border px-3 py-2 text-xs min-[640px]:hidden","aria-label":"노드 팔레트",children:[(0,a.jsxs)("summary",{className:"cursor-pointer",children:["노드 더하기 (",s.length,")"]}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)(o,{palette:s,fallback:r})})]}),(0,a.jsx)("div",{className:"hidden border-b border-border px-3 py-2 text-xs min-[640px]:block","aria-label":"노드 팔레트",children:(0,a.jsx)(o,{palette:s,fallback:r})})]})}function h(){let e="harness"===(0,n.useSearchParams)().get("mode")?"harness":"workflow",s=(0,c.Qj)(),r=(0,t.I)({queryKey:["graph-kinds",e],queryFn:()=>s.getGraphKinds(e),enabled:null!==s,retry:!1}),o=(0,l.useMemo)(()=>{var s;return(null==(s=r.data)?void 0:s.kinds.length)?r.data.kinds:("harness"===e?x.DN:x.CF).map(s=>({graph:e,kind:s,plugin:null,description:"",schema:{},core:!0}))},[r.data,e]),h=r.isError||r.isSuccess&&!r.data.kinds.length;return(0,a.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,a.jsxs)("header",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-border px-4 py-2",children:[(0,a.jsx)("h1",{className:"text-sm font-semibold",children:"편집기"}),(0,a.jsx)("nav",{"aria-label":"그래프 편집 모드",className:"flex gap-1",children:["workflow","harness"].map(s=>(0,a.jsx)("a",{href:"/app/editor/?mode=".concat(s),"aria-current":e===s?"page":void 0,className:"rounded px-3 py-1 text-xs ".concat(e===s?"bg-accent/15 text-text-primary":"text-text-tertiary hover:bg-surface-elevated"),children:"workflow"===s?"워크플로":"실행 그래프"},s))})]}),(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[s&&(0,a.jsx)(p,{palette:o,fallback:h}),"workflow"===e?(0,a.jsx)(i.N,{palette:o}):s?(0,a.jsx)(d.F,{palette:o}):(0,a.jsx)("p",{className:"p-4 text-sm text-text-tertiary",children:"Daemon 연결이 설정되지 않았습니다. Settings 에서 Base URL 을 입력하세요."})]})]})}function m(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)("p",{className:"p-4 text-sm",children:"편집기를 불러오는 중…"}),children:(0,a.jsx)(h,{})})}},22480:(e,s,r)=>{Promise.resolve().then(r.bind(r,3219))}},e=>{e.O(0,[9901,9182,3324,1844,1866,8868,8060,9247,8695,4554,2463,2196,7358],()=>e(e.s=22480)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[650],{4977:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>m});var n=r(55539),s=r(46124),a=r(15151),l=r(12958);let o={report:"보고서",pdf:"PDF",video:"영상",image:"그림",text:"글",link:"링크"};function c(e,t){if(e.startsWith("/v1/exec-requests/".concat(encodeURIComponent(t),"/files/")))return{url:e,daemonFile:!0};try{let t=new URL(e);if(("https:"===t.protocol||"http:"===t.protocol)&&!t.username&&!t.password)return{url:t.href,daemonFile:!1}}catch(e){}return null}function i(e){let{client:t,id:r,result:a}=e,[l,i]=(0,s.useState)(""),[u,d]=(0,s.useState)(!1),[m,p]=(0,s.useState)(null),f=c(a.url,r),x=a.title||o[a.kind],h=(null==f?void 0:f.daemonFile)&&("video"===a.kind||"image"===a.kind);if((0,s.useEffect)(()=>{let e;if(!h||!f)return;let r=!0;return p(null),i(""),t.fetchResponse(f.url).then(async t=>{if(!t.ok)throw Error("HTTP ".concat(t.status));let n=await t.blob();r&&p(e=URL.createObjectURL(n))}).catch(()=>{r&&i("결과 파일을 열지 못했습니다. 다시 시도해 주세요.")}),()=>{r=!1,e&&URL.revokeObjectURL(e)}},[t,h,null==f?void 0:f.url]),!f)return null;async function b(){if(!(null==f?void 0:f.daemonFile)||u)return;let e="pdf"===a.kind?window.open("","_blank"):null;if("pdf"===a.kind&&!e)return void i("결과 파일을 열지 못했습니다. 다시 시도해 주세요.");e&&(e.opener=null),d(!0),i("");try{let n=await t.fetchResponse(f.url);if(!n.ok)throw Error("HTTP ".concat(n.status));let s=URL.createObjectURL(await n.blob());if(e)e.closed?URL.revokeObjectURL(s):(e.location.replace(s),setTimeout(()=>URL.revokeObjectURL(s),6e4));else{var r;let e=document.createElement("a");e.href=s,e.download=decodeURIComponent(null!=(r=f.url.split("/").at(-1))?r:x),document.body.appendChild(e),e.click(),e.remove(),setTimeout(()=>URL.revokeObjectURL(s),6e4)}}catch(t){null==e||e.close(),i("결과 파일을 열지 못했습니다. 다시 시도해 주세요.")}finally{d(!1)}}return(0,n.jsxs)("li",{className:"rounded-lg border border-border bg-background px-4 py-3 text-sm",children:[h?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"font-medium",children:x}),m&&("video"===a.kind?(0,n.jsx)("video",{controls:!0,src:m,"aria-label":x,className:"mt-2 max-w-full"}):(0,n.jsx)("img",{src:m,alt:x,className:"mt-2 max-w-full"}))]}):f.daemonFile?(0,n.jsx)("button",{type:"button",onClick:()=>void b(),disabled:u,className:"font-medium text-primary underline underline-offset-4 disabled:opacity-50",children:u?"여는 중…":x}):(0,n.jsx)("a",{href:f.url,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-primary underline underline-offset-4",children:x}),(0,n.jsxs)("span",{className:"ml-2 text-muted-foreground",children:[a.seat.toUpperCase()," \xb7 ",o[a.kind]]}),a.sources&&a.sources.length>0&&(0,n.jsx)("ul",{className:"mt-2 flex flex-wrap gap-2","aria-label":"출처",children:a.sources.slice(0,3).map((e,t)=>{let s=c(e.url,r);return s&&!s.daemonFile?(0,n.jsx)("li",{children:(0,n.jsx)("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-4",children:e.title})},"".concat(e.url,":").concat(t)):null})}),l&&(0,n.jsx)("p",{role:"alert",className:"mt-1 text-destructive",children:l})]})}function u(e){switch(e){case"planning":return"계획 중";case"running":return"진행 중";case"done":return"완료";case"failed":return"멈춤"}}function d(e){switch(e){case"waiting":return"대기";case"running":return"진행 중";case"done":return"완료";case"failed":return"못 함"}}function m(){var e,t,r,o;let{client:c}=(0,a.Q)(),[m,p]=(0,s.useState)(""),[f,x]=(0,s.useState)(!1),[h,b]=(0,s.useState)([]),[g,y]=(0,s.useState)(!1),[v,j]=(0,s.useState)(""),[N,w]=(0,s.useState)(""),[k,R]=(0,s.useState)(null),[S,U]=(0,s.useState)(null),[C,I]=(0,s.useState)(""),[E,L]=(0,s.useState)(0),[O,P]=(0,s.useState)(null),D=(0,s.useRef)(new Map),F=(0,s.useRef)(0),T=(0,s.useRef)(k);T.current=k;let _=(0,s.useRef)(null),H=(0,s.useRef)(0),M=h.some(e=>"planning"===e.status||"running"===e.status),q=null==(e=h.find(e=>e.id===k))?void 0:e.status,Y=(null==S?void 0:S.id)===k&&(null===O?S.approvals.length>0:O>0);(0,s.useEffect)(()=>{var e,t;return F.current+=1,H.current+=1,_.current=null,D.current=new Map,p(""),x(!1),b([]),y(!1),j(""),w(""),R(new URLSearchParams(null!=(t=null==(e=window.location)?void 0:e.search)?t:"").get("request")),U(null),I(""),P(null),()=>{F.current+=1}},[c]),(0,s.useEffect)(()=>{let e=!0,t=!1;async function r(){if(!t){t=!0;try{let t=await c.listExecRequests();if(!e)return;for(let e of t.items)D.current.delete(e.id);b([...D.current.values(),...t.items].sort((e,t)=>t.createdAt.localeCompare(e.createdAt)||t.id.localeCompare(e.id))),j("")}catch(t){e&&j("맡긴 일을 읽지 못했습니다. 연결을 확인해 주세요.")}finally{t=!1,e&&y(!0)}}}r();let n=M?setInterval(()=>void r(),5e3):null;return()=>{e=!1,n&&clearInterval(n)}},[c,M]);let A=(0,s.useCallback)(async()=>{if(!k)return;let e=F.current,t=H.current,r="".concat(e,":").concat(t,":").concat(k);if(_.current!==r){_.current=r;try{let r=await c.getExecRequest(k);if(F.current!==e||H.current!==t||T.current!==k)return;U(r),I("")}catch(r){F.current===e&&H.current===t&&T.current===k&&I("상세를 읽지 못했습니다. 잠시 뒤 다시 시도해 주세요.")}finally{_.current===r&&(_.current=null)}}},[c,k]);async function V(e){e.preventDefault();let t=m.trim();if(!t||f)return;let r=F.current;x(!0),w("");try{let e=await c.submitExecRequest(t);if(F.current!==r)return;let n={id:e.id,text:t,createdAt:new Date().toISOString(),status:e.status,seats:[],resultCount:0};D.current.set(n.id,n),b(e=>[n,...e.filter(e=>e.id!==n.id)]),p("")}catch(e){F.current===r&&w("보내지 못했습니다. 연결을 확인하고 다시 시도해 주세요.")}finally{F.current===r&&x(!1)}}(0,s.useEffect)(()=>{k&&A()},[A,E]),(0,s.useEffect)(()=>{if(!k||"planning"!==q&&"running"!==q&&!Y)return;let e=setInterval(()=>void A(),5e3);return()=>clearInterval(e)},[k,q,Y,A]);let z=h.find(e=>e.id===k),J=(null==S?void 0:S.id)===k?S:null;return(0,n.jsxs)("main",{className:"mx-auto w-full max-w-2xl space-y-8 px-5 py-10 sm:py-14",children:[(0,n.jsxs)("section",{"aria-labelledby":"exec-compose",className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{id:"exec-compose",className:"text-2xl font-semibold tracking-tight",children:"COO 에게 맡기기"}),(0,n.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"할 일을 한 줄로 적어 보내세요. 자리별 진행과 결과를 여기서 볼 수 있습니다."})]}),(0,n.jsxs)("form",{onSubmit:V,className:"flex gap-2",children:[(0,n.jsx)("label",{htmlFor:"exec-text",className:"sr-only",children:"한 줄로 맡길 일"}),(0,n.jsx)("input",{id:"exec-text",name:"text",value:m,onChange:e=>p(e.target.value),placeholder:"한 줄로 맡길 일",className:"min-w-0 flex-1 rounded-lg border border-input bg-background px-3 py-2 text-sm"}),(0,n.jsx)("button",{type:"submit",disabled:!m.trim()||f,className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50",children:f?"보내는 중…":"보내기"})]}),N&&(0,n.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:N})]}),(0,n.jsxs)("section",{"aria-labelledby":"exec-list",className:"space-y-3",children:[(0,n.jsx)("h2",{id:"exec-list",className:"text-xl font-semibold",children:"맡긴 일"}),v&&(0,n.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:v}),!g&&0===h.length&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"불러오는 중…"}),g&&0===h.length&&!v&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"아직 맡긴 일이 없습니다."}),(0,n.jsx)("ul",{className:"space-y-2",children:h.map(e=>{var t;return(0,n.jsx)("li",{children:(0,n.jsxs)("button",{type:"button",onClick:()=>{k!==e.id&&(H.current+=1,R(e.id),U(null),I(""),P(null))},"aria-expanded":k===e.id,className:"w-full rounded-xl border border-border bg-card p-4 text-left hover:border-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary",children:[(0,n.jsxs)("span",{className:"flex items-start justify-between gap-3",children:[(0,n.jsx)("span",{className:"min-w-0 truncate text-sm font-semibold",children:null!=(t=e.text.trim().split(/\r?\n/,1)[0])?t:""}),(0,n.jsx)("span",{className:"shrink-0 text-sm font-medium text-primary",children:u(e.status)})]}),e.seats.length>0&&(0,n.jsx)("span",{className:"mt-2 block truncate text-xs text-muted-foreground",children:e.seats.map(e=>"".concat(e.seat.toUpperCase()," ").concat(d(e.status))).join(" \xb7 ")}),e.resultCount>0&&(0,n.jsxs)("span",{className:"mt-1 block text-xs text-muted-foreground",children:["결과 ",e.resultCount,"개"]})]})},e.id)})})]}),k&&(0,n.jsxs)("section",{"aria-labelledby":"exec-detail",className:"space-y-5 rounded-xl border border-border bg-card p-5",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsx)("h2",{id:"exec-detail",className:"text-lg font-semibold",children:"맡긴 일 상세"}),(0,n.jsx)("button",{type:"button",onClick:()=>{H.current+=1,R(null),U(null),P(null)},className:"text-sm text-primary underline underline-offset-4",children:"닫기"})]}),(0,n.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:null!=(t=null==J?void 0:J.text)?t:null==z?void 0:z.text}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:u(null!=(o=null!=(r=null==J?void 0:J.status)?r:null==z?void 0:z.status)?o:"planning")}),C&&(0,n.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:C}),!J&&!C&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"상세 불러오는 중…"}),J&&(0,n.jsxs)(n.Fragment,{children:[J.summary&&(0,n.jsx)("p",{className:"text-sm",children:J.summary}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("h3",{className:"font-semibold",children:"이렇게 나눠 맡겼습니다"}),0===J.seats.length&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"planning"===J.status?"COO 가 나누는 중입니다":"맡은 자리가 없습니다"}),(0,n.jsx)("ul",{className:"space-y-2",children:J.seats.map(e=>(0,n.jsxs)("li",{className:"rounded-lg border border-border bg-background px-4 py-3 text-sm",children:[(0,n.jsxs)("div",{className:"flex justify-between gap-2",children:[(0,n.jsxs)("span",{className:"font-semibold",children:[e.seat.toUpperCase()," \xb7 ",e.title]}),(0,n.jsx)("span",{className:"shrink-0 text-muted-foreground",children:d(e.status)})]}),"failed"===e.status&&e.reason&&(0,n.jsxs)("p",{className:"mt-2 text-destructive",children:["못 한 이유 \xb7 ",e.reason]})]},"".concat(e.seat,":").concat(e.title)))})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("h3",{className:"font-semibold",children:"결과"}),0===J.results.length&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"아직 결과가 없습니다."}),(0,n.jsx)("ul",{className:"space-y-2",children:J.results.map(e=>(0,n.jsx)(i,{client:c,id:J.id,result:e},e.url))})]}),(0,n.jsx)(l.a,{client:c,approvals:J.approvals,onDecided:()=>L(e=>e+1),onPendingChange:P},J.id)]})]})]})}},5997:(e,t,r)=>{"use strict";r.d(t,{Zr:()=>l,f6:()=>s,oD:()=>a});let n="elanous.daemon.sessionId";function s(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"s-".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2,10))}function a(){let e=function(){let e=new URLSearchParams(window.location.search).get("session");return e?(localStorage.setItem(n,e),e):localStorage.getItem(n)}();if(e)return e;let t=s();return localStorage.setItem(n,t),t}function l(){let e=s();return localStorage.setItem(n,e),e}},12958:(e,t,r)=>{"use strict";r.d(t,{a:()=>o});var n=r(55539),s=r(46124),a=r(74780);let l=e=>JSON.stringify([e.graphId,e.runId]);function o(e){let{client:t,approvals:r,onDecided:o,onPendingChange:c}=e,i=(0,s.useMemo)(()=>(0,a.ll)({client:t}),[t]),[u,d]=(0,s.useState)([]),[m,p]=(0,s.useState)({}),[f,x]=(0,s.useState)(null),[h,b]=(0,s.useState)(""),g=(0,s.useRef)(0),y=r.map(l).join("|");function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m;d(e),c(r.filter(r=>!t[l(r)]&&e.some(e=>l(e)===l(r))).length)}async function j(e,t){let n=l(e);if(f||m[n]||!r.some(e=>l(e)===n)||!u.some(e=>l(e)===n))return;let s=g.current;x(n),b("");try{if(await i.decide(e.graphId,e.runId,t),g.current!==s)return;let r={...m,[n]:t};p(r),v(u,r),o();let a=await i.list();g.current===s&&v(a.items,r)}catch(e){g.current===s&&b((0,a.LP)(e,"decide"))}finally{g.current===s&&x(null)}}return((0,s.useEffect)(()=>{let e=++g.current;return(d([]),b(""),y)?(i.list().then(t=>{g.current===e&&v(t.items)}).catch(t=>{g.current===e&&b((0,a.LP)(t,"list"))}),()=>{g.current+=1}):(c(0),()=>{g.current+=1})},[i,y]),0===r.length)?null:(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("h3",{className:"font-semibold",children:"게시 승인"}),h&&(0,n.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:h}),(0,n.jsx)("ul",{className:"space-y-2",children:r.map(e=>{let t=l(e),r=u.some(e=>l(e)===t);return(0,n.jsxs)("li",{className:"rounded-lg border border-border bg-background px-4 py-3 text-sm",children:[(0,n.jsx)("p",{children:e.message}),m[t]?(0,n.jsx)("p",{className:"mt-2 text-muted-foreground",children:"approved"===m[t]?"승인됨":"보류됨"}):r?(0,n.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,n.jsx)("button",{type:"button",disabled:null!==f,onClick:()=>void j(e,"approved"),className:"rounded-lg bg-primary px-3 py-1 text-primary-foreground disabled:opacity-50",children:"승인"}),(0,n.jsx)("button",{type:"button",disabled:null!==f,onClick:()=>void j(e,"rejected"),className:"rounded-lg border border-border px-3 py-1 disabled:opacity-50",children:"보류"})]}):(0,n.jsx)("p",{className:"mt-2 text-muted-foreground",children:"대기 중인 승인이 아닙니다."})]},t)})})]})}},15151:(e,t,r)=>{"use strict";r.d(t,{C:()=>i,DaemonProvider:()=>u,Q:()=>d});var n=r(55539),s=r(46124),a=r(8101),l=r(5997),o=r(18060),c=r(72215);let i=(0,s.createContext)(null);function u(e){let{children:t}=e,r={baseUrl:"",token:"",provider:""},[u,d]=(0,s.useState)(r),[m,p]=(0,s.useState)(""),[f]=(0,s.useState)(()=>new o.ki(r));(0,s.useEffect)(()=>{let e=(0,a.Fp)();d(e),f.updateConfig(e),p((0,l.oD)()),(0,c.cY)("webterm.provider.daemon.init",{baseUrl:e.baseUrl,hasToken:!!e.token})},[f]),(0,s.useEffect)(()=>{let e=e=>{if("elanous.daemon.token"===e.key||"elanous.nexus.baseUrl"===e.key){let t=(0,a.Fp)();f.updateConfig(t),d(t),(0,c.cY)("webterm.provider.daemon.config-cross-tab",{key:e.key,hasToken:!!t.token});return}"elanous.daemon.sessionId"===e.key&&e.newValue&&p(t=>t===e.newValue?t:((0,c.cY)("webterm.provider.daemon.session-cross-tab",{previous:t||"(empty)",next:e.newValue}),e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[f]);let x=e=>{d(t=>{let r={...t,...e};return(0,a.Qc)(e),f.updateConfig(r),(0,c.cY)("webterm.provider.daemon.config-update",{keys:Object.keys(e)}),r})},h=e=>{p(e),localStorage.setItem("elanous.daemon.sessionId",e),(0,c.cY)("webterm.provider.daemon.session-set",{sessionId:e})},b=(0,s.useMemo)(()=>({config:u,setConfig:x,client:f,sessionId:m,setSessionId:h}),[u,f,m]);return(0,n.jsx)(i.Provider,{value:b,children:t})}function d(){let e=(0,s.useContext)(i);if(!e)throw Error("useDaemon must be used inside <DaemonProvider>");return e}},74780:(e,t,r)=>{"use strict";function n(e){return{slides:e.slides.map(e=>{let{image:t,caption:r,include:n}=e;return{image:t,caption:r,include:n}}),caption:{hook:e.caption.hook,body:e.caption.body},hashtags:[...e.hashtags],cover:{text:e.cover.text,sub:e.cover.sub},location:e.location}}r.d(t,{$Y:()=>l,LP:()=>c,Mz:()=>n,ll:()=>u,rH:()=>o});class s extends Error{constructor(e,t){super(t),this.status=e,this.name="GraphApprovalsApiError"}}let a={list:"목록을 보려면",decide:"승인하려면",save:"초안을 저장하려면"},l="/app/settings/#bearer-token";function o(e){return e instanceof s&&(401===e.status||403===e.status)}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"decide";return e instanceof s?401===e.status||403===e.status?"".concat(a[t]," 이 기기를 데몬에 연결해야 합니다 — 설정 › 데몬 연결 › 연결 토큰 칸에 토큰을 넣어 주세요."):404===e.status?"이 실행을 찾지 못했습니다. 목록을 다시 확인해 주세요.":409===e.status?"이미 결정된 실행입니다. 목록을 다시 확인해 주세요.":400===e.status?"결정 내용을 확인한 뒤 다시 시도해 주세요.":"승인 요청을 처리하지 못했습니다. 잠시 뒤 다시 시도해 주세요.":e instanceof TypeError?"서버에 연결하지 못했습니다. 연결 상태를 확인해 주세요.":"승인 요청을 처리하지 못했습니다. 잠시 뒤 다시 시도해 주세요."}let i="/v1/graph-approvals";function u(e){var t,r;let n=(null!=(t=e.baseUrl)?t:"").replace(/\/+$/,""),a=null!=(r=e.fetchImpl)?r:fetch;async function l(t,r){let l={...r,headers:{"content-type":"application/json",...e.authHeader?{authorization:e.authHeader}:{}}},o=e.client?await e.client.fetchResponse(t,l):await a("".concat(n).concat(t),l),c=await o.json().catch(()=>null);if(!o.ok){let e=c&&"object"==typeof c&&"error"in c&&"string"==typeof c.error?c.error:"request-failed";throw new s(o.status,e)}return c}return{list:()=>l(i),decide:(e,t,r)=>l("".concat(i,"/").concat(encodeURIComponent(e),"/").concat(encodeURIComponent(t)),{method:"POST",body:JSON.stringify({decision:r})}),saveFeedDraft:(e,t,r)=>l("".concat(i,"/").concat(encodeURIComponent(e),"/").concat(encodeURIComponent(t),"/feed-draft"),{method:"PUT",body:JSON.stringify(r)}),feedMedia:async(t,r,l)=>{let o="".concat(i,"/").concat(encodeURIComponent(t),"/").concat(encodeURIComponent(r),"/media?path=").concat(encodeURIComponent(l)),c={headers:e.authHeader?{authorization:e.authHeader}:{}},u=e.client?await e.client.fetchResponse(o,c):await a("".concat(n).concat(o),c);if(!u.ok)throw new s(u.status,"media-failed");return u.blob()}}}},98675:(e,t,r)=>{Promise.resolve().then(r.bind(r,4977))}},e=>{e.O(0,[8060,2463,2196,7358],()=>e(e.s=98675)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[650],{4977:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>m});var n=r(55539),s=r(46124),a=r(15151),l=r(12958);let o={report:"보고서",pdf:"PDF",video:"영상",image:"그림",text:"글",link:"링크"};function c(e,t){if(e.startsWith("/v1/exec-requests/".concat(encodeURIComponent(t),"/files/")))return{url:e,daemonFile:!0};try{let t=new URL(e);if(("https:"===t.protocol||"http:"===t.protocol)&&!t.username&&!t.password)return{url:t.href,daemonFile:!1}}catch(e){}return null}function i(e){let{client:t,id:r,result:a}=e,[l,i]=(0,s.useState)(""),[u,d]=(0,s.useState)(!1),[m,p]=(0,s.useState)(null),f=c(a.url,r),x=a.title||o[a.kind],h=(null==f?void 0:f.daemonFile)&&("video"===a.kind||"image"===a.kind);if((0,s.useEffect)(()=>{let e;if(!h||!f)return;let r=!0;return p(null),i(""),t.fetchResponse(f.url).then(async t=>{if(!t.ok)throw Error("HTTP ".concat(t.status));let n=await t.blob();r&&p(e=URL.createObjectURL(n))}).catch(()=>{r&&i("결과 파일을 열지 못했습니다. 다시 시도해 주세요.")}),()=>{r=!1,e&&URL.revokeObjectURL(e)}},[t,h,null==f?void 0:f.url]),!f)return null;async function b(){if(!(null==f?void 0:f.daemonFile)||u)return;let e="pdf"===a.kind?window.open("","_blank"):null;if("pdf"===a.kind&&!e)return void i("결과 파일을 열지 못했습니다. 다시 시도해 주세요.");e&&(e.opener=null),d(!0),i("");try{let n=await t.fetchResponse(f.url);if(!n.ok)throw Error("HTTP ".concat(n.status));let s=URL.createObjectURL(await n.blob());if(e)e.closed?URL.revokeObjectURL(s):(e.location.replace(s),setTimeout(()=>URL.revokeObjectURL(s),6e4));else{var r;let e=document.createElement("a");e.href=s,e.download=decodeURIComponent(null!=(r=f.url.split("/").at(-1))?r:x),document.body.appendChild(e),e.click(),e.remove(),setTimeout(()=>URL.revokeObjectURL(s),6e4)}}catch(t){null==e||e.close(),i("결과 파일을 열지 못했습니다. 다시 시도해 주세요.")}finally{d(!1)}}return(0,n.jsxs)("li",{className:"rounded-lg border border-border bg-background px-4 py-3 text-sm",children:[h?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"font-medium",children:x}),m&&("video"===a.kind?(0,n.jsx)("video",{controls:!0,src:m,"aria-label":x,className:"mt-2 max-w-full"}):(0,n.jsx)("img",{src:m,alt:x,className:"mt-2 max-w-full"}))]}):f.daemonFile?(0,n.jsx)("button",{type:"button",onClick:()=>void b(),disabled:u,className:"font-medium text-primary underline underline-offset-4 disabled:opacity-50",children:u?"여는 중…":x}):(0,n.jsx)("a",{href:f.url,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-primary underline underline-offset-4",children:x}),(0,n.jsxs)("span",{className:"ml-2 text-muted-foreground",children:[a.seat.toUpperCase()," \xb7 ",o[a.kind]]}),a.sources&&a.sources.length>0&&(0,n.jsx)("ul",{className:"mt-2 flex flex-wrap gap-2","aria-label":"출처",children:a.sources.slice(0,3).map((e,t)=>{let s=c(e.url,r);return s&&!s.daemonFile?(0,n.jsx)("li",{children:(0,n.jsx)("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-4",children:e.title})},"".concat(e.url,":").concat(t)):null})}),l&&(0,n.jsx)("p",{role:"alert",className:"mt-1 text-destructive",children:l})]})}function u(e){switch(e){case"planning":return"계획 중";case"running":return"진행 중";case"done":return"완료";case"failed":return"멈춤"}}function d(e){switch(e){case"waiting":return"대기";case"running":return"진행 중";case"done":return"완료";case"failed":return"못 함"}}function m(){var e,t,r,o;let{client:c}=(0,a.Q)(),[m,p]=(0,s.useState)(""),[f,x]=(0,s.useState)(!1),[h,b]=(0,s.useState)([]),[g,y]=(0,s.useState)(!1),[v,j]=(0,s.useState)(""),[N,w]=(0,s.useState)(""),[k,R]=(0,s.useState)(null),[S,U]=(0,s.useState)(null),[C,I]=(0,s.useState)(""),[E,L]=(0,s.useState)(0),[O,P]=(0,s.useState)(null),D=(0,s.useRef)(new Map),F=(0,s.useRef)(0),T=(0,s.useRef)(k);T.current=k;let _=(0,s.useRef)(null),H=(0,s.useRef)(0),M=h.some(e=>"planning"===e.status||"running"===e.status),q=null==(e=h.find(e=>e.id===k))?void 0:e.status,Y=(null==S?void 0:S.id)===k&&(null===O?S.approvals.length>0:O>0);(0,s.useEffect)(()=>{var e,t;return F.current+=1,H.current+=1,_.current=null,D.current=new Map,p(""),x(!1),b([]),y(!1),j(""),w(""),R(new URLSearchParams(null!=(t=null==(e=window.location)?void 0:e.search)?t:"").get("request")),U(null),I(""),P(null),()=>{F.current+=1}},[c]),(0,s.useEffect)(()=>{let e=!0,t=!1;async function r(){if(!t){t=!0;try{let t=await c.listExecRequests();if(!e)return;for(let e of t.items)D.current.delete(e.id);b([...D.current.values(),...t.items].sort((e,t)=>t.createdAt.localeCompare(e.createdAt)||t.id.localeCompare(e.id))),j("")}catch(t){e&&j("맡긴 일을 읽지 못했습니다. 연결을 확인해 주세요.")}finally{t=!1,e&&y(!0)}}}r();let n=M?setInterval(()=>void r(),5e3):null;return()=>{e=!1,n&&clearInterval(n)}},[c,M]);let A=(0,s.useCallback)(async()=>{if(!k)return;let e=F.current,t=H.current,r="".concat(e,":").concat(t,":").concat(k);if(_.current!==r){_.current=r;try{let r=await c.getExecRequest(k);if(F.current!==e||H.current!==t||T.current!==k)return;U(r),I("")}catch(r){F.current===e&&H.current===t&&T.current===k&&I("상세를 읽지 못했습니다. 잠시 뒤 다시 시도해 주세요.")}finally{_.current===r&&(_.current=null)}}},[c,k]);async function V(e){e.preventDefault();let t=m.trim();if(!t||f)return;let r=F.current;x(!0),w("");try{let e=await c.submitExecRequest(t);if(F.current!==r)return;let n={id:e.id,text:t,createdAt:new Date().toISOString(),status:e.status,seats:[],resultCount:0};D.current.set(n.id,n),b(e=>[n,...e.filter(e=>e.id!==n.id)]),p("")}catch(e){F.current===r&&w("보내지 못했습니다. 연결을 확인하고 다시 시도해 주세요.")}finally{F.current===r&&x(!1)}}(0,s.useEffect)(()=>{k&&A()},[A,E]),(0,s.useEffect)(()=>{if(!k||"planning"!==q&&"running"!==q&&!Y)return;let e=setInterval(()=>void A(),5e3);return()=>clearInterval(e)},[k,q,Y,A]);let z=h.find(e=>e.id===k),J=(null==S?void 0:S.id)===k?S:null;return(0,n.jsxs)("main",{className:"mx-auto w-full max-w-2xl space-y-8 px-5 py-10 sm:py-14",children:[(0,n.jsxs)("section",{"aria-labelledby":"exec-compose",className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{id:"exec-compose",className:"text-2xl font-semibold tracking-tight",children:"COO 에게 맡기기"}),(0,n.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"할 일을 한 줄로 적어 보내세요. 자리별 진행과 결과를 여기서 볼 수 있습니다."})]}),(0,n.jsxs)("form",{onSubmit:V,className:"flex gap-2",children:[(0,n.jsx)("label",{htmlFor:"exec-text",className:"sr-only",children:"한 줄로 맡길 일"}),(0,n.jsx)("input",{id:"exec-text",name:"text",value:m,onChange:e=>p(e.target.value),placeholder:"한 줄로 맡길 일",className:"min-w-0 flex-1 rounded-lg border border-input bg-background px-3 py-2 text-sm"}),(0,n.jsx)("button",{type:"submit",disabled:!m.trim()||f,className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50",children:f?"보내는 중…":"보내기"})]}),N&&(0,n.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:N})]}),(0,n.jsxs)("section",{"aria-labelledby":"exec-list",className:"space-y-3",children:[(0,n.jsx)("h2",{id:"exec-list",className:"text-xl font-semibold",children:"맡긴 일"}),v&&(0,n.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:v}),!g&&0===h.length&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"불러오는 중…"}),g&&0===h.length&&!v&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"아직 맡긴 일이 없습니다."}),(0,n.jsx)("ul",{className:"space-y-2",children:h.map(e=>{var t;return(0,n.jsx)("li",{children:(0,n.jsxs)("button",{type:"button",onClick:()=>{k!==e.id&&(H.current+=1,R(e.id),U(null),I(""),P(null))},"aria-expanded":k===e.id,className:"w-full rounded-xl border border-border bg-card p-4 text-left hover:border-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary",children:[(0,n.jsxs)("span",{className:"flex items-start justify-between gap-3",children:[(0,n.jsx)("span",{className:"min-w-0 truncate text-sm font-semibold",children:null!=(t=e.text.trim().split(/\r?\n/,1)[0])?t:""}),(0,n.jsx)("span",{className:"shrink-0 text-sm font-medium text-primary",children:u(e.status)})]}),e.seats.length>0&&(0,n.jsx)("span",{className:"mt-2 block truncate text-xs text-muted-foreground",children:e.seats.map(e=>"".concat(e.seat.toUpperCase()," ").concat(d(e.status))).join(" \xb7 ")}),e.resultCount>0&&(0,n.jsxs)("span",{className:"mt-1 block text-xs text-muted-foreground",children:["결과 ",e.resultCount,"개"]})]})},e.id)})})]}),k&&(0,n.jsxs)("section",{"aria-labelledby":"exec-detail",className:"space-y-5 rounded-xl border border-border bg-card p-5",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsx)("h2",{id:"exec-detail",className:"text-lg font-semibold",children:"맡긴 일 상세"}),(0,n.jsx)("button",{type:"button",onClick:()=>{H.current+=1,R(null),U(null),P(null)},className:"text-sm text-primary underline underline-offset-4",children:"닫기"})]}),(0,n.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:null!=(t=null==J?void 0:J.text)?t:null==z?void 0:z.text}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:u(null!=(o=null!=(r=null==J?void 0:J.status)?r:null==z?void 0:z.status)?o:"planning")}),C&&(0,n.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:C}),!J&&!C&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"상세 불러오는 중…"}),J&&(0,n.jsxs)(n.Fragment,{children:[J.summary&&(0,n.jsx)("p",{className:"text-sm",children:J.summary}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("h3",{className:"font-semibold",children:"이렇게 나눠 맡겼습니다"}),0===J.seats.length&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"planning"===J.status?"COO 가 나누는 중입니다":"맡은 자리가 없습니다"}),(0,n.jsx)("ul",{className:"space-y-2",children:J.seats.map(e=>(0,n.jsxs)("li",{className:"rounded-lg border border-border bg-background px-4 py-3 text-sm",children:[(0,n.jsxs)("div",{className:"flex justify-between gap-2",children:[(0,n.jsxs)("span",{className:"font-semibold",children:[e.seat.toUpperCase()," \xb7 ",e.title]}),(0,n.jsx)("span",{className:"shrink-0 text-muted-foreground",children:d(e.status)})]}),"failed"===e.status&&e.reason&&(0,n.jsxs)("p",{className:"mt-2 text-destructive",children:["못 한 이유 \xb7 ",e.reason]})]},"".concat(e.seat,":").concat(e.title)))})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("h3",{className:"font-semibold",children:"결과"}),0===J.results.length&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"아직 결과가 없습니다."}),(0,n.jsx)("ul",{className:"space-y-2",children:J.results.map(e=>(0,n.jsx)(i,{client:c,id:J.id,result:e},e.url))})]}),(0,n.jsx)(l.a,{client:c,approvals:J.approvals,onDecided:()=>L(e=>e+1),onPendingChange:P},J.id)]})]})]})}},5997:(e,t,r)=>{"use strict";r.d(t,{Zr:()=>l,f6:()=>s,oD:()=>a});let n="elanous.daemon.sessionId";function s(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"s-".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2,10))}function a(){let e=function(){let e=new URLSearchParams(window.location.search).get("session");return e?(localStorage.setItem(n,e),e):localStorage.getItem(n)}();if(e)return e;let t=s();return localStorage.setItem(n,t),t}function l(){let e=s();return localStorage.setItem(n,e),e}},12958:(e,t,r)=>{"use strict";r.d(t,{a:()=>o});var n=r(55539),s=r(46124),a=r(74780);let l=e=>JSON.stringify([e.graphId,e.runId]);function o(e){let{client:t,approvals:r,onDecided:o,onPendingChange:c}=e,i=(0,s.useMemo)(()=>(0,a.ll)({client:t}),[t]),[u,d]=(0,s.useState)([]),[m,p]=(0,s.useState)({}),[f,x]=(0,s.useState)(null),[h,b]=(0,s.useState)(""),g=(0,s.useRef)(0),y=r.map(l).join("|");function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m;d(e),c(r.filter(r=>!t[l(r)]&&e.some(e=>l(e)===l(r))).length)}async function j(e,t){let n=l(e);if(f||m[n]||!r.some(e=>l(e)===n)||!u.some(e=>l(e)===n))return;let s=g.current;x(n),b("");try{if(await i.decide(e.graphId,e.runId,t),g.current!==s)return;let r={...m,[n]:t};p(r),v(u,r),o();let a=await i.list();g.current===s&&v(a.items,r)}catch(e){g.current===s&&b((0,a.LP)(e,"decide"))}finally{g.current===s&&x(null)}}return((0,s.useEffect)(()=>{let e=++g.current;return(d([]),b(""),y)?(i.list().then(t=>{g.current===e&&v(t.items)}).catch(t=>{g.current===e&&b((0,a.LP)(t,"list"))}),()=>{g.current+=1}):(c(0),()=>{g.current+=1})},[i,y]),0===r.length)?null:(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("h3",{className:"font-semibold",children:"게시 승인"}),h&&(0,n.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:h}),(0,n.jsx)("ul",{className:"space-y-2",children:r.map(e=>{let t=l(e),r=u.some(e=>l(e)===t);return(0,n.jsxs)("li",{className:"rounded-lg border border-border bg-background px-4 py-3 text-sm",children:[(0,n.jsx)("p",{children:e.message}),m[t]?(0,n.jsx)("p",{className:"mt-2 text-muted-foreground",children:"approved"===m[t]?"승인됨":"보류됨"}):r?(0,n.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,n.jsx)("button",{type:"button",disabled:null!==f,onClick:()=>void j(e,"approved"),className:"rounded-lg bg-primary px-3 py-1 text-primary-foreground disabled:opacity-50",children:"승인"}),(0,n.jsx)("button",{type:"button",disabled:null!==f,onClick:()=>void j(e,"rejected"),className:"rounded-lg border border-border px-3 py-1 disabled:opacity-50",children:"보류"})]}):(0,n.jsx)("p",{className:"mt-2 text-muted-foreground",children:"대기 중인 승인이 아닙니다."})]},t)})})]})}},15151:(e,t,r)=>{"use strict";r.d(t,{C:()=>i,DaemonProvider:()=>u,Q:()=>d});var n=r(55539),s=r(46124),a=r(8101),l=r(5997),o=r(18060),c=r(72215);let i=(0,s.createContext)(null);function u(e){let{children:t}=e,r={baseUrl:"",token:"",provider:""},[u,d]=(0,s.useState)(r),[m,p]=(0,s.useState)(""),[f]=(0,s.useState)(()=>new o.ki(r));(0,s.useEffect)(()=>{let e=(0,a.Fp)();d(e),f.updateConfig(e),p((0,l.oD)()),(0,c.cY)("webterm.provider.daemon.init",{baseUrl:e.baseUrl,hasToken:!!e.token})},[f]),(0,s.useEffect)(()=>{let e=e=>{if("elanous.daemon.token"===e.key||"elanous.nexus.baseUrl"===e.key){let t=(0,a.Fp)();f.updateConfig(t),d(t),(0,c.cY)("webterm.provider.daemon.config-cross-tab",{key:e.key,hasToken:!!t.token});return}"elanous.daemon.sessionId"===e.key&&e.newValue&&p(t=>t===e.newValue?t:((0,c.cY)("webterm.provider.daemon.session-cross-tab",{previous:t||"(empty)",next:e.newValue}),e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[f]);let x=e=>{d(t=>{let r={...t,...e};return(0,a.Qc)(e),f.updateConfig(r),(0,c.cY)("webterm.provider.daemon.config-update",{keys:Object.keys(e)}),r})},h=e=>{p(e),localStorage.setItem("elanous.daemon.sessionId",e),(0,c.cY)("webterm.provider.daemon.session-set",{sessionId:e})},b=(0,s.useMemo)(()=>({config:u,setConfig:x,client:f,sessionId:m,setSessionId:h}),[u,f,m]);return(0,n.jsx)(i.Provider,{value:b,children:t})}function d(){let e=(0,s.useContext)(i);if(!e)throw Error("useDaemon must be used inside <DaemonProvider>");return e}},23612:(e,t,r)=>{Promise.resolve().then(r.bind(r,4977))},74780:(e,t,r)=>{"use strict";function n(e){return{slides:e.slides.map(e=>{let{image:t,caption:r,include:n}=e;return{image:t,caption:r,include:n}}),caption:{hook:e.caption.hook,body:e.caption.body},hashtags:[...e.hashtags],cover:{text:e.cover.text,sub:e.cover.sub},location:e.location}}r.d(t,{$Y:()=>l,LP:()=>c,Mz:()=>n,ll:()=>u,rH:()=>o});class s extends Error{constructor(e,t){super(t),this.status=e,this.name="GraphApprovalsApiError"}}let a={list:"목록을 보려면",decide:"승인하려면",save:"초안을 저장하려면"},l="/app/settings/#bearer-token";function o(e){return e instanceof s&&(401===e.status||403===e.status)}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"decide";return e instanceof s?401===e.status||403===e.status?"".concat(a[t]," 이 기기를 데몬에 연결해야 합니다 — 설정 › 데몬 연결 › 연결 토큰 칸에 토큰을 넣어 주세요."):404===e.status?"이 실행을 찾지 못했습니다. 목록을 다시 확인해 주세요.":409===e.status?"이미 결정된 실행입니다. 목록을 다시 확인해 주세요.":400===e.status?"결정 내용을 확인한 뒤 다시 시도해 주세요.":"승인 요청을 처리하지 못했습니다. 잠시 뒤 다시 시도해 주세요.":e instanceof TypeError?"서버에 연결하지 못했습니다. 연결 상태를 확인해 주세요.":"승인 요청을 처리하지 못했습니다. 잠시 뒤 다시 시도해 주세요."}let i="/v1/graph-approvals";function u(e){var t,r;let n=(null!=(t=e.baseUrl)?t:"").replace(/\/+$/,""),a=null!=(r=e.fetchImpl)?r:fetch;async function l(t,r){let l={...r,headers:{"content-type":"application/json",...e.authHeader?{authorization:e.authHeader}:{}}},o=e.client?await e.client.fetchResponse(t,l):await a("".concat(n).concat(t),l),c=await o.json().catch(()=>null);if(!o.ok){let e=c&&"object"==typeof c&&"error"in c&&"string"==typeof c.error?c.error:"request-failed";throw new s(o.status,e)}return c}return{list:()=>l(i),decide:(e,t,r)=>l("".concat(i,"/").concat(encodeURIComponent(e),"/").concat(encodeURIComponent(t)),{method:"POST",body:JSON.stringify({decision:r})}),saveFeedDraft:(e,t,r)=>l("".concat(i,"/").concat(encodeURIComponent(e),"/").concat(encodeURIComponent(t),"/feed-draft"),{method:"PUT",body:JSON.stringify(r)}),feedMedia:async(t,r,l)=>{let o="".concat(i,"/").concat(encodeURIComponent(t),"/").concat(encodeURIComponent(r),"/media?path=").concat(encodeURIComponent(l)),c={headers:e.authHeader?{authorization:e.authHeader}:{}},u=e.client?await e.client.fetchResponse(o,c):await a("".concat(n).concat(o),c);if(!u.ok)throw new s(u.status,"media-failed");return u.blob()}}}}},e=>{e.O(0,[8060,2463,2196,7358],()=>e(e.s=23612)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[141],{3233:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(55539),l=r(46124),a=r(15151);let n=/^[a-z0-9][a-z0-9._-]{0,63}$/;function o(e){var t,r,o;let{event:i,refreshKey:c=0}=e,{client:u}=(0,a.Q)(),[d,m]=(0,l.useState)(null),[f,p]=(0,l.useState)(null),x=(null==d?void 0:d.event)===i&&d.refreshKey===c?d:null,h=(null==f?void 0:f.event)===i&&f.refreshKey===c?f.message:"";return((0,l.useEffect)(()=>{let e;if(!n.test(i))return;let t=!0,r="";m(null),p(null);let s=e=>{t&&m(t=>(null==t?void 0:t.event)===i&&t.refreshKey===c?{...t,...e}:t)};async function l(e){try{let l=await u.fetchResponse(e);if(!l.ok)throw Error("HTTP ".concat(l.status));let a=await l.blob();if(!t)return;r=URL.createObjectURL(a),s({videoUrl:r})}catch(e){s({error:"영상을 열지 못했습니다: ".concat(String(e))})}}async function a(){try{let r=await u.fieldReelStatus(i);if(!t)return;s({reel:{status:r.state,url:r.url},reelError:"failed"===r.state?r.error:void 0,error:void 0}),"done"===r.state&&r.url?await l(r.url):"done"!==r.state&&"failed"!==r.state&&(e=setTimeout(a,5e3))}catch(r){s({error:"영상 상태를 읽지 못했습니다: ".concat(String(r))}),t&&(e=setTimeout(a,5e3))}}return u.fetchJson("/v1/field/uploads?event=".concat(encodeURIComponent(i))).then(e=>{t&&(m({...e,event:i,refreshKey:c}),e.reel&&("done"===e.reel.status&&e.reel.url?l(e.reel.url):a()))}).catch(e=>{t&&p({event:i,refreshKey:c,message:"폴더 상태를 읽지 못했습니다: ".concat(String(e))})}),()=>{t=!1,e&&clearTimeout(e),r&&URL.revokeObjectURL(r)}},[u,i,c]),n.test(i))?(0,s.jsxs)("section",{"aria-label":"행사 폴더 상태",className:"space-y-3 rounded-xl border border-border bg-card p-5",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:i}),h&&(0,s.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:h}),!x&&!h&&(0,s.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"폴더 상태를 읽는 중…"}),x&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"text-sm",children:["폴더에 ",x.count,"개 \xb7 영상 ",(null==(t=x.reel)?void 0:t.status)==="done"?"완료":(null==(r=x.reel)?void 0:r.status)==="failed"?"만들지 못함":x.reel?"만드는 중":"없음"]}),(null==(o=x.reel)?void 0:o.status)==="failed"&&x.reelError&&(0,s.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:x.reelError}),x.error&&(0,s.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:x.error}),x.videoUrl&&(0,s.jsx)("video",{controls:!0,playsInline:!0,src:x.videoUrl,className:"mx-auto aspect-[9/16] max-h-[70vh] w-full max-w-xs rounded-lg bg-black","aria-label":"현장 세로 영상"})]})]}):null}let i=/^[a-z0-9][a-z0-9._-]{0,63}$/;function c(){let{client:e}=(0,a.Q)(),[t,r]=(0,l.useState)(""),n=(0,l.useRef)(!1),[c,u]=(0,l.useState)([]),[d,m]=(0,l.useState)(null),f=(0,l.useRef)(null),[p,x]=(0,l.useState)(""),[h,b]=(0,l.useState)(!1),[v,g]=(0,l.useState)(0),[y,j]=(0,l.useState)(0),[w,N]=(0,l.useState)("");(0,l.useEffect)(()=>{let t=!0;return e.fieldDefaultEvent().then(e=>{let{defaultEvent:s}=e;t&&i.test(s)&&!n.current&&r(s)}).catch(e=>{t&&N("행사 폴더를 불러오지 못했습니다: ".concat(String(e)))}),()=>{t=!1}},[e]);let k=i.test(t),S=t&&k?"":"영문 소문자\xb7숫자로 시작하고 영문 소문자\xb7숫자\xb7점\xb7밑줄\xb7하이픈만 사용해 주세요 (최대 64자).";async function U(r){if(r.preventDefault(),!h){if(!k)return void N(S);if(!c.length)return void N("사진\xb7영상을 먼저 골라 주세요.");b(!0),g(0),N("");try{await e.uploadField(t,c,p,g),g(100),j(e=>e+1),u([]),m(null),f.current&&(f.current.value=""),x("")}catch(e){N("올리지 못했습니다: ".concat(e instanceof Error?e.message:String(e)))}finally{b(!1)}}}return(0,s.jsxs)("main",{className:"mx-auto w-full max-w-xl space-y-6 px-5 py-10 sm:py-16",children:[(0,s.jsxs)("header",{className:"space-y-2",children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:"현장 올리기"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"사진\xb7영상을 행사 폴더에 모으면 세로 영상이 만들어집니다."})]}),(0,s.jsxs)("form",{onSubmit:U,noValidate:!0,className:"space-y-5 rounded-xl border border-border bg-card p-5 sm:p-8",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{htmlFor:"field-event",className:"block text-sm font-medium",children:"행사 폴더"}),(0,s.jsx)("input",{id:"field-event",name:"event",value:t,onChange:e=>{n.current=!0,r(e.target.value)},"aria-invalid":!k,"aria-describedby":k?void 0:"field-slug-error",autoCapitalize:"none",autoCorrect:"off",className:"w-full rounded-md border border-input bg-background px-3 py-2 font-mono text-sm"}),!k&&(0,s.jsx)("p",{id:"field-slug-error",className:"text-sm text-destructive",children:S})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{htmlFor:"field-files",className:"block text-sm font-medium",children:"사진\xb7영상 고르기"}),(0,s.jsx)("input",{ref:f,id:"field-files",name:"files",type:"file",multiple:!0,accept:"image/*,video/*",onChange:function(e){var t;let r=function(e){let t=[],r=0,s=0,l=0,a=0;for(let n of e){if(n.size>0x6400000){r+=1;continue}if(t.length>=20){l+=1;continue}if(a+n.size>262144e3){s+=1;continue}t.push(n),a+=n.size}let n=[r?"".concat(r,"개는 한 개가 100MB 를 넘습니다"):"",l?"".concat(l,"개는 한 번에 ").concat(20,"개를 넘습니다"):"",s?"".concat(s,"개는 합계 250MB 를 넘습니다"):""].filter(Boolean),o=r+l+s;return{kept:t,note:o?"".concat(o,"개는 빠집니다 — ").concat(n.join(" \xb7 ")):null}}(Array.from(null!=(t=e.target.files)?t:[]));u(r.kept),m(r.note),N("")},className:"block w-full rounded-md border border-input bg-background px-3 py-2 text-sm file:mr-3 file:rounded-md file:border-0 file:bg-primary file:px-3 file:py-1 file:text-primary-foreground"}),c.length>0&&(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:[c.length,"개 골랐습니다"]}),d&&(0,s.jsx)("p",{role:"status",className:"text-sm text-orange-600 dark:text-orange-400",children:d})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{htmlFor:"field-caption",className:"block text-sm font-medium",children:"한 줄 설명(첫 장 자막 \xb7 선택)"}),(0,s.jsx)("input",{id:"field-caption",name:"caption",value:p,onChange:e=>x(e.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm"})]}),w&&(0,s.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:w}),(0,s.jsx)("button",{type:"submit",disabled:h||!k||!c.length,className:"w-full rounded-md bg-primary px-4 py-2.5 text-sm font-medium text-primary-foreground disabled:cursor-not-allowed disabled:opacity-50",children:h?"올리는 중…":"올리기"}),h&&(0,s.jsxs)("div",{role:"status",className:"space-y-1 text-sm","aria-live":"polite",children:[(0,s.jsxs)("label",{htmlFor:"field-progress",children:["올리기 ",v,"%"]}),(0,s.jsx)("progress",{id:"field-progress",value:v,max:100,className:"w-full"})]})]}),k&&(0,s.jsx)(o,{event:t,refreshKey:y})]})}},5997:(e,t,r)=>{"use strict";r.d(t,{Zr:()=>n,f6:()=>l,oD:()=>a});let s="elanous.daemon.sessionId";function l(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"s-".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2,10))}function a(){let e=function(){let e=new URLSearchParams(window.location.search).get("session");return e?(localStorage.setItem(s,e),e):localStorage.getItem(s)}();if(e)return e;let t=l();return localStorage.setItem(s,t),t}function n(){let e=l();return localStorage.setItem(s,e),e}},15151:(e,t,r)=>{"use strict";r.d(t,{C:()=>c,DaemonProvider:()=>u,Q:()=>d});var s=r(55539),l=r(46124),a=r(8101),n=r(5997),o=r(18060),i=r(72215);let c=(0,l.createContext)(null);function u(e){let{children:t}=e,r={baseUrl:"",token:"",provider:""},[u,d]=(0,l.useState)(r),[m,f]=(0,l.useState)(""),[p]=(0,l.useState)(()=>new o.ki(r));(0,l.useEffect)(()=>{let e=(0,a.Fp)();d(e),p.updateConfig(e),f((0,n.oD)()),(0,i.cY)("webterm.provider.daemon.init",{baseUrl:e.baseUrl,hasToken:!!e.token})},[p]),(0,l.useEffect)(()=>{let e=e=>{if("elanous.daemon.token"===e.key||"elanous.nexus.baseUrl"===e.key){let t=(0,a.Fp)();p.updateConfig(t),d(t),(0,i.cY)("webterm.provider.daemon.config-cross-tab",{key:e.key,hasToken:!!t.token});return}"elanous.daemon.sessionId"===e.key&&e.newValue&&f(t=>t===e.newValue?t:((0,i.cY)("webterm.provider.daemon.session-cross-tab",{previous:t||"(empty)",next:e.newValue}),e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[p]);let x=e=>{d(t=>{let r={...t,...e};return(0,a.Qc)(e),p.updateConfig(r),(0,i.cY)("webterm.provider.daemon.config-update",{keys:Object.keys(e)}),r})},h=e=>{f(e),localStorage.setItem("elanous.daemon.sessionId",e),(0,i.cY)("webterm.provider.daemon.session-set",{sessionId:e})},b=(0,l.useMemo)(()=>({config:u,setConfig:x,client:p,sessionId:m,setSessionId:h}),[u,p,m]);return(0,s.jsx)(c.Provider,{value:b,children:t})}function d(){let e=(0,l.useContext)(c);if(!e)throw Error("useDaemon must be used inside <DaemonProvider>");return e}},88632:(e,t,r)=>{Promise.resolve().then(r.bind(r,3233))}},e=>{e.O(0,[8060,2463,2196,7358],()=>e(e.s=88632)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[141],{3233:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(55539),l=r(46124),a=r(15151);let n=/^[a-z0-9][a-z0-9._-]{0,63}$/;function o(e){var t,r,o;let{event:i,refreshKey:c=0}=e,{client:u}=(0,a.Q)(),[d,m]=(0,l.useState)(null),[f,p]=(0,l.useState)(null),x=(null==d?void 0:d.event)===i&&d.refreshKey===c?d:null,h=(null==f?void 0:f.event)===i&&f.refreshKey===c?f.message:"";return((0,l.useEffect)(()=>{let e;if(!n.test(i))return;let t=!0,r="";m(null),p(null);let s=e=>{t&&m(t=>(null==t?void 0:t.event)===i&&t.refreshKey===c?{...t,...e}:t)};async function l(e){try{let l=await u.fetchResponse(e);if(!l.ok)throw Error("HTTP ".concat(l.status));let a=await l.blob();if(!t)return;r=URL.createObjectURL(a),s({videoUrl:r})}catch(e){s({error:"영상을 열지 못했습니다: ".concat(String(e))})}}async function a(){try{let r=await u.fieldReelStatus(i);if(!t)return;s({reel:{status:r.state,url:r.url},reelError:"failed"===r.state?r.error:void 0,error:void 0}),"done"===r.state&&r.url?await l(r.url):"done"!==r.state&&"failed"!==r.state&&(e=setTimeout(a,5e3))}catch(r){s({error:"영상 상태를 읽지 못했습니다: ".concat(String(r))}),t&&(e=setTimeout(a,5e3))}}return u.fetchJson("/v1/field/uploads?event=".concat(encodeURIComponent(i))).then(e=>{t&&(m({...e,event:i,refreshKey:c}),e.reel&&("done"===e.reel.status&&e.reel.url?l(e.reel.url):a()))}).catch(e=>{t&&p({event:i,refreshKey:c,message:"폴더 상태를 읽지 못했습니다: ".concat(String(e))})}),()=>{t=!1,e&&clearTimeout(e),r&&URL.revokeObjectURL(r)}},[u,i,c]),n.test(i))?(0,s.jsxs)("section",{"aria-label":"행사 폴더 상태",className:"space-y-3 rounded-xl border border-border bg-card p-5",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:i}),h&&(0,s.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:h}),!x&&!h&&(0,s.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"폴더 상태를 읽는 중…"}),x&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"text-sm",children:["폴더에 ",x.count,"개 \xb7 영상 ",(null==(t=x.reel)?void 0:t.status)==="done"?"완료":(null==(r=x.reel)?void 0:r.status)==="failed"?"만들지 못함":x.reel?"만드는 중":"없음"]}),(null==(o=x.reel)?void 0:o.status)==="failed"&&x.reelError&&(0,s.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:x.reelError}),x.error&&(0,s.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:x.error}),x.videoUrl&&(0,s.jsx)("video",{controls:!0,playsInline:!0,src:x.videoUrl,className:"mx-auto aspect-[9/16] max-h-[70vh] w-full max-w-xs rounded-lg bg-black","aria-label":"현장 세로 영상"})]})]}):null}let i=/^[a-z0-9][a-z0-9._-]{0,63}$/;function c(){let{client:e}=(0,a.Q)(),[t,r]=(0,l.useState)(""),n=(0,l.useRef)(!1),[c,u]=(0,l.useState)([]),[d,m]=(0,l.useState)(null),f=(0,l.useRef)(null),[p,x]=(0,l.useState)(""),[h,b]=(0,l.useState)(!1),[v,g]=(0,l.useState)(0),[y,j]=(0,l.useState)(0),[w,N]=(0,l.useState)("");(0,l.useEffect)(()=>{let t=!0;return e.fieldDefaultEvent().then(e=>{let{defaultEvent:s}=e;t&&i.test(s)&&!n.current&&r(s)}).catch(e=>{t&&N("행사 폴더를 불러오지 못했습니다: ".concat(String(e)))}),()=>{t=!1}},[e]);let k=i.test(t),S=t&&k?"":"영문 소문자\xb7숫자로 시작하고 영문 소문자\xb7숫자\xb7점\xb7밑줄\xb7하이픈만 사용해 주세요 (최대 64자).";async function U(r){if(r.preventDefault(),!h){if(!k)return void N(S);if(!c.length)return void N("사진\xb7영상을 먼저 골라 주세요.");b(!0),g(0),N("");try{await e.uploadField(t,c,p,g),g(100),j(e=>e+1),u([]),m(null),f.current&&(f.current.value=""),x("")}catch(e){N("올리지 못했습니다: ".concat(e instanceof Error?e.message:String(e)))}finally{b(!1)}}}return(0,s.jsxs)("main",{className:"mx-auto w-full max-w-xl space-y-6 px-5 py-10 sm:py-16",children:[(0,s.jsxs)("header",{className:"space-y-2",children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:"현장 올리기"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"사진\xb7영상을 행사 폴더에 모으면 세로 영상이 만들어집니다."})]}),(0,s.jsxs)("form",{onSubmit:U,noValidate:!0,className:"space-y-5 rounded-xl border border-border bg-card p-5 sm:p-8",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{htmlFor:"field-event",className:"block text-sm font-medium",children:"행사 폴더"}),(0,s.jsx)("input",{id:"field-event",name:"event",value:t,onChange:e=>{n.current=!0,r(e.target.value)},"aria-invalid":!k,"aria-describedby":k?void 0:"field-slug-error",autoCapitalize:"none",autoCorrect:"off",className:"w-full rounded-md border border-input bg-background px-3 py-2 font-mono text-sm"}),!k&&(0,s.jsx)("p",{id:"field-slug-error",className:"text-sm text-destructive",children:S})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{htmlFor:"field-files",className:"block text-sm font-medium",children:"사진\xb7영상 고르기"}),(0,s.jsx)("input",{ref:f,id:"field-files",name:"files",type:"file",multiple:!0,accept:"image/*,video/*",onChange:function(e){var t;let r=function(e){let t=[],r=0,s=0,l=0,a=0;for(let n of e){if(n.size>0x6400000){r+=1;continue}if(t.length>=20){l+=1;continue}if(a+n.size>262144e3){s+=1;continue}t.push(n),a+=n.size}let n=[r?"".concat(r,"개는 한 개가 100MB 를 넘습니다"):"",l?"".concat(l,"개는 한 번에 ").concat(20,"개를 넘습니다"):"",s?"".concat(s,"개는 합계 250MB 를 넘습니다"):""].filter(Boolean),o=r+l+s;return{kept:t,note:o?"".concat(o,"개는 빠집니다 — ").concat(n.join(" \xb7 ")):null}}(Array.from(null!=(t=e.target.files)?t:[]));u(r.kept),m(r.note),N("")},className:"block w-full rounded-md border border-input bg-background px-3 py-2 text-sm file:mr-3 file:rounded-md file:border-0 file:bg-primary file:px-3 file:py-1 file:text-primary-foreground"}),c.length>0&&(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:[c.length,"개 골랐습니다"]}),d&&(0,s.jsx)("p",{role:"status",className:"text-sm text-orange-600 dark:text-orange-400",children:d})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{htmlFor:"field-caption",className:"block text-sm font-medium",children:"한 줄 설명(첫 장 자막 \xb7 선택)"}),(0,s.jsx)("input",{id:"field-caption",name:"caption",value:p,onChange:e=>x(e.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm"})]}),w&&(0,s.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:w}),(0,s.jsx)("button",{type:"submit",disabled:h||!k||!c.length,className:"w-full rounded-md bg-primary px-4 py-2.5 text-sm font-medium text-primary-foreground disabled:cursor-not-allowed disabled:opacity-50",children:h?"올리는 중…":"올리기"}),h&&(0,s.jsxs)("div",{role:"status",className:"space-y-1 text-sm","aria-live":"polite",children:[(0,s.jsxs)("label",{htmlFor:"field-progress",children:["올리기 ",v,"%"]}),(0,s.jsx)("progress",{id:"field-progress",value:v,max:100,className:"w-full"})]})]}),k&&(0,s.jsx)(o,{event:t,refreshKey:y})]})}},5997:(e,t,r)=>{"use strict";r.d(t,{Zr:()=>n,f6:()=>l,oD:()=>a});let s="elanous.daemon.sessionId";function l(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"s-".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2,10))}function a(){let e=function(){let e=new URLSearchParams(window.location.search).get("session");return e?(localStorage.setItem(s,e),e):localStorage.getItem(s)}();if(e)return e;let t=l();return localStorage.setItem(s,t),t}function n(){let e=l();return localStorage.setItem(s,e),e}},15151:(e,t,r)=>{"use strict";r.d(t,{C:()=>c,DaemonProvider:()=>u,Q:()=>d});var s=r(55539),l=r(46124),a=r(8101),n=r(5997),o=r(18060),i=r(72215);let c=(0,l.createContext)(null);function u(e){let{children:t}=e,r={baseUrl:"",token:"",provider:""},[u,d]=(0,l.useState)(r),[m,f]=(0,l.useState)(""),[p]=(0,l.useState)(()=>new o.ki(r));(0,l.useEffect)(()=>{let e=(0,a.Fp)();d(e),p.updateConfig(e),f((0,n.oD)()),(0,i.cY)("webterm.provider.daemon.init",{baseUrl:e.baseUrl,hasToken:!!e.token})},[p]),(0,l.useEffect)(()=>{let e=e=>{if("elanous.daemon.token"===e.key||"elanous.nexus.baseUrl"===e.key){let t=(0,a.Fp)();p.updateConfig(t),d(t),(0,i.cY)("webterm.provider.daemon.config-cross-tab",{key:e.key,hasToken:!!t.token});return}"elanous.daemon.sessionId"===e.key&&e.newValue&&f(t=>t===e.newValue?t:((0,i.cY)("webterm.provider.daemon.session-cross-tab",{previous:t||"(empty)",next:e.newValue}),e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[p]);let x=e=>{d(t=>{let r={...t,...e};return(0,a.Qc)(e),p.updateConfig(r),(0,i.cY)("webterm.provider.daemon.config-update",{keys:Object.keys(e)}),r})},h=e=>{f(e),localStorage.setItem("elanous.daemon.sessionId",e),(0,i.cY)("webterm.provider.daemon.session-set",{sessionId:e})},b=(0,l.useMemo)(()=>({config:u,setConfig:x,client:p,sessionId:m,setSessionId:h}),[u,p,m]);return(0,s.jsx)(c.Provider,{value:b,children:t})}function d(){let e=(0,l.useContext)(c);if(!e)throw Error("useDaemon must be used inside <DaemonProvider>");return e}},22361:(e,t,r)=>{Promise.resolve().then(r.bind(r,3233))}},e=>{e.O(0,[8060,2463,2196,7358],()=>e(e.s=22361)),_N_E=e.O()}]);