@jlongo78/agent-spaces 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (451) hide show
  1. package/.next/standalone/.claude/settings.local.json +11 -0
  2. package/.next/standalone/.next/BUILD_ID +1 -1
  3. package/.next/standalone/.next/build-manifest.json +2 -2
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/required-server-files.json +19 -19
  6. package/.next/standalone/.next/server/app/(desktop)/admin/analytics/page_client-reference-manifest.js +1 -1
  7. package/.next/standalone/.next/server/app/(desktop)/admin/users/page_client-reference-manifest.js +1 -1
  8. package/.next/standalone/.next/server/app/(desktop)/analytics/page_client-reference-manifest.js +1 -1
  9. package/.next/standalone/.next/server/app/(desktop)/network/page_client-reference-manifest.js +1 -1
  10. package/.next/standalone/.next/server/app/(desktop)/page.js +2 -2
  11. package/.next/standalone/.next/server/app/(desktop)/page.js.nft.json +1 -1
  12. package/.next/standalone/.next/server/app/(desktop)/page_client-reference-manifest.js +1 -1
  13. package/.next/standalone/.next/server/app/(desktop)/projects/page_client-reference-manifest.js +1 -1
  14. package/.next/standalone/.next/server/app/(desktop)/sessions/[id]/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/(desktop)/sessions/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/.next/server/app/(desktop)/settings/page_client-reference-manifest.js +1 -1
  17. package/.next/standalone/.next/server/app/(desktop)/terminal/page_client-reference-manifest.js +1 -1
  18. package/.next/standalone/.next/server/app/(desktop)/terminal/pane/[id]/page_client-reference-manifest.js +1 -1
  19. package/.next/standalone/.next/server/app/(desktop)/terminal/remote/[nodeId]/[workspaceId]/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/(desktop)/workspaces/page_client-reference-manifest.js +1 -1
  21. package/.next/standalone/.next/server/app/_global-error.html +2 -2
  22. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  23. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  24. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  25. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  26. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  27. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  28. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  29. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  30. package/.next/standalone/.next/server/app/_not-found.rsc +3 -3
  31. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  32. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  33. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  34. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  35. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  36. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  37. package/.next/standalone/.next/server/app/admin/analytics.html +1 -1
  38. package/.next/standalone/.next/server/app/admin/analytics.rsc +5 -5
  39. package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap/admin/analytics/__PAGE__.segment.rsc +2 -2
  40. package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap/admin/analytics.segment.rsc +1 -1
  41. package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap/admin.segment.rsc +1 -1
  42. package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
  43. package/.next/standalone/.next/server/app/admin/analytics.segments/_full.segment.rsc +5 -5
  44. package/.next/standalone/.next/server/app/admin/analytics.segments/_head.segment.rsc +1 -1
  45. package/.next/standalone/.next/server/app/admin/analytics.segments/_index.segment.rsc +3 -3
  46. package/.next/standalone/.next/server/app/admin/analytics.segments/_tree.segment.rsc +2 -2
  47. package/.next/standalone/.next/server/app/admin/users.html +1 -1
  48. package/.next/standalone/.next/server/app/admin/users.rsc +5 -5
  49. package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap/admin/users/__PAGE__.segment.rsc +2 -2
  50. package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap/admin/users.segment.rsc +1 -1
  51. package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap/admin.segment.rsc +1 -1
  52. package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
  53. package/.next/standalone/.next/server/app/admin/users.segments/_full.segment.rsc +5 -5
  54. package/.next/standalone/.next/server/app/admin/users.segments/_head.segment.rsc +1 -1
  55. package/.next/standalone/.next/server/app/admin/users.segments/_index.segment.rsc +3 -3
  56. package/.next/standalone/.next/server/app/admin/users.segments/_tree.segment.rsc +2 -2
  57. package/.next/standalone/.next/server/app/analytics.html +1 -1
  58. package/.next/standalone/.next/server/app/analytics.rsc +5 -5
  59. package/.next/standalone/.next/server/app/analytics.segments/!KGRlc2t0b3Ap/analytics/__PAGE__.segment.rsc +2 -2
  60. package/.next/standalone/.next/server/app/analytics.segments/!KGRlc2t0b3Ap/analytics.segment.rsc +1 -1
  61. package/.next/standalone/.next/server/app/analytics.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
  62. package/.next/standalone/.next/server/app/analytics.segments/_full.segment.rsc +5 -5
  63. package/.next/standalone/.next/server/app/analytics.segments/_head.segment.rsc +1 -1
  64. package/.next/standalone/.next/server/app/analytics.segments/_index.segment.rsc +3 -3
  65. package/.next/standalone/.next/server/app/analytics.segments/_tree.segment.rsc +2 -2
  66. package/.next/standalone/.next/server/app/api/admin/analytics/route.js +1 -1
  67. package/.next/standalone/.next/server/app/api/admin/analytics/route.js.nft.json +1 -1
  68. package/.next/standalone/.next/server/app/api/admin/users/[id]/route.js +1 -1
  69. package/.next/standalone/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
  70. package/.next/standalone/.next/server/app/api/admin/users/route.js +1 -1
  71. package/.next/standalone/.next/server/app/api/admin/users/route.js.nft.json +1 -1
  72. package/.next/standalone/.next/server/app/api/analytics/overview/route.js +2 -2
  73. package/.next/standalone/.next/server/app/api/analytics/overview/route.js.nft.json +1 -1
  74. package/.next/standalone/.next/server/app/api/auth/login/route.js +1 -1
  75. package/.next/standalone/.next/server/app/api/auth/login/route.js.nft.json +1 -1
  76. package/.next/standalone/.next/server/app/api/auth/logout/route.js +1 -1
  77. package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  78. package/.next/standalone/.next/server/app/api/auth/me/route.js +1 -1
  79. package/.next/standalone/.next/server/app/api/auth/me/route.js.nft.json +1 -1
  80. package/.next/standalone/.next/server/app/api/auth/totp/setup/route.js +1 -1
  81. package/.next/standalone/.next/server/app/api/auth/totp/setup/route.js.nft.json +1 -1
  82. package/.next/standalone/.next/server/app/api/auth/totp/status/route.js +1 -1
  83. package/.next/standalone/.next/server/app/api/auth/totp/status/route.js.nft.json +1 -1
  84. package/.next/standalone/.next/server/app/api/auth/totp/verify/route.js +1 -1
  85. package/.next/standalone/.next/server/app/api/auth/totp/verify/route.js.nft.json +1 -1
  86. package/.next/standalone/.next/server/app/api/bulk/route.js +2 -2
  87. package/.next/standalone/.next/server/app/api/bulk/route.js.nft.json +1 -1
  88. package/.next/standalone/.next/server/app/api/chat/route.js +1 -1
  89. package/.next/standalone/.next/server/app/api/chat/route.js.nft.json +1 -1
  90. package/.next/standalone/.next/server/app/api/config/route.js +1 -1
  91. package/.next/standalone/.next/server/app/api/config/route.js.nft.json +1 -1
  92. package/.next/standalone/.next/server/app/api/events/route.js +2 -2
  93. package/.next/standalone/.next/server/app/api/events/route.js.nft.json +1 -1
  94. package/.next/standalone/.next/server/app/api/folders/route.js +1 -1
  95. package/.next/standalone/.next/server/app/api/folders/route.js.nft.json +1 -1
  96. package/.next/standalone/.next/server/app/api/network/discovered/route.js +1 -1
  97. package/.next/standalone/.next/server/app/api/network/discovered/route.js.nft.json +1 -1
  98. package/.next/standalone/.next/server/app/api/network/handshake/route.js +1 -1
  99. package/.next/standalone/.next/server/app/api/network/handshake/route.js.nft.json +1 -1
  100. package/.next/standalone/.next/server/app/api/network/health/route.js +1 -1
  101. package/.next/standalone/.next/server/app/api/network/health/route.js.nft.json +1 -1
  102. package/.next/standalone/.next/server/app/api/network/identity/route.js +1 -1
  103. package/.next/standalone/.next/server/app/api/network/identity/route.js.nft.json +1 -1
  104. package/.next/standalone/.next/server/app/api/network/keys/[id]/route.js +1 -1
  105. package/.next/standalone/.next/server/app/api/network/keys/[id]/route.js.nft.json +1 -1
  106. package/.next/standalone/.next/server/app/api/network/keys/route.js +1 -1
  107. package/.next/standalone/.next/server/app/api/network/keys/route.js.nft.json +1 -1
  108. package/.next/standalone/.next/server/app/api/network/nodes/[id]/route.js +1 -1
  109. package/.next/standalone/.next/server/app/api/network/nodes/[id]/route.js.nft.json +1 -1
  110. package/.next/standalone/.next/server/app/api/network/nodes/check/route.js +1 -1
  111. package/.next/standalone/.next/server/app/api/network/nodes/check/route.js.nft.json +1 -1
  112. package/.next/standalone/.next/server/app/api/network/nodes/route.js +1 -1
  113. package/.next/standalone/.next/server/app/api/network/nodes/route.js.nft.json +1 -1
  114. package/.next/standalone/.next/server/app/api/network/projects/route.js +1 -1
  115. package/.next/standalone/.next/server/app/api/network/projects/route.js.nft.json +1 -1
  116. package/.next/standalone/.next/server/app/api/network/proxy/[nodeId]/[...path]/route.js +1 -1
  117. package/.next/standalone/.next/server/app/api/network/proxy/[nodeId]/[...path]/route.js.nft.json +1 -1
  118. package/.next/standalone/.next/server/app/api/network/search/route.js +1 -1
  119. package/.next/standalone/.next/server/app/api/network/search/route.js.nft.json +1 -1
  120. package/.next/standalone/.next/server/app/api/network/sessions/[id]/messages/route.js +1 -1
  121. package/.next/standalone/.next/server/app/api/network/sessions/[id]/messages/route.js.nft.json +1 -1
  122. package/.next/standalone/.next/server/app/api/network/sessions/[id]/route.js +1 -1
  123. package/.next/standalone/.next/server/app/api/network/sessions/[id]/route.js.nft.json +1 -1
  124. package/.next/standalone/.next/server/app/api/network/sessions/route.js +1 -1
  125. package/.next/standalone/.next/server/app/api/network/sessions/route.js.nft.json +1 -1
  126. package/.next/standalone/.next/server/app/api/network/terminal/token/route.js +1 -1
  127. package/.next/standalone/.next/server/app/api/network/terminal/token/route.js.nft.json +1 -1
  128. package/.next/standalone/.next/server/app/api/network/workspaces/[id]/route.js +1 -1
  129. package/.next/standalone/.next/server/app/api/network/workspaces/[id]/route.js.nft.json +1 -1
  130. package/.next/standalone/.next/server/app/api/network/workspaces/route.js +1 -1
  131. package/.next/standalone/.next/server/app/api/network/workspaces/route.js.nft.json +1 -1
  132. package/.next/standalone/.next/server/app/api/panes/[id]/route.js +2 -2
  133. package/.next/standalone/.next/server/app/api/panes/[id]/route.js.nft.json +1 -1
  134. package/.next/standalone/.next/server/app/api/panes/route.js +2 -2
  135. package/.next/standalone/.next/server/app/api/panes/route.js.nft.json +1 -1
  136. package/.next/standalone/.next/server/app/api/projects/route.js +2 -2
  137. package/.next/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
  138. package/.next/standalone/.next/server/app/api/search/route.js +2 -2
  139. package/.next/standalone/.next/server/app/api/search/route.js.nft.json +1 -1
  140. package/.next/standalone/.next/server/app/api/sessions/[id]/chat/route.js +2 -2
  141. package/.next/standalone/.next/server/app/api/sessions/[id]/chat/route.js.nft.json +1 -1
  142. package/.next/standalone/.next/server/app/api/sessions/[id]/messages/route.js +2 -2
  143. package/.next/standalone/.next/server/app/api/sessions/[id]/messages/route.js.nft.json +1 -1
  144. package/.next/standalone/.next/server/app/api/sessions/[id]/route.js +2 -2
  145. package/.next/standalone/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
  146. package/.next/standalone/.next/server/app/api/sessions/route.js +2 -2
  147. package/.next/standalone/.next/server/app/api/sessions/route.js.nft.json +1 -1
  148. package/.next/standalone/.next/server/app/api/sync/route.js +3 -3
  149. package/.next/standalone/.next/server/app/api/sync/route.js.nft.json +1 -1
  150. package/.next/standalone/.next/server/app/api/tags/route.js +2 -2
  151. package/.next/standalone/.next/server/app/api/tags/route.js.nft.json +1 -1
  152. package/.next/standalone/.next/server/app/api/tier/route.js +1 -1
  153. package/.next/standalone/.next/server/app/api/tier/route.js.nft.json +1 -1
  154. package/.next/standalone/.next/server/app/api/workspaces/[id]/context/[key]/route.js +2 -2
  155. package/.next/standalone/.next/server/app/api/workspaces/[id]/context/[key]/route.js.nft.json +1 -1
  156. package/.next/standalone/.next/server/app/api/workspaces/[id]/context/route.js +2 -2
  157. package/.next/standalone/.next/server/app/api/workspaces/[id]/context/route.js.nft.json +1 -1
  158. package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/[msgId]/route.js +2 -2
  159. package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/[msgId]/route.js.nft.json +1 -1
  160. package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/route.js +2 -2
  161. package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/route.js.nft.json +1 -1
  162. package/.next/standalone/.next/server/app/api/workspaces/[id]/route.js +2 -2
  163. package/.next/standalone/.next/server/app/api/workspaces/[id]/route.js.nft.json +1 -1
  164. package/.next/standalone/.next/server/app/api/workspaces/[id]/sessions/route.js +2 -2
  165. package/.next/standalone/.next/server/app/api/workspaces/[id]/sessions/route.js.nft.json +1 -1
  166. package/.next/standalone/.next/server/app/api/workspaces/route.js +2 -2
  167. package/.next/standalone/.next/server/app/api/workspaces/route.js.nft.json +1 -1
  168. package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  169. package/.next/standalone/.next/server/app/login.html +1 -1
  170. package/.next/standalone/.next/server/app/login.rsc +4 -4
  171. package/.next/standalone/.next/server/app/login.segments/_full.segment.rsc +4 -4
  172. package/.next/standalone/.next/server/app/login.segments/_head.segment.rsc +1 -1
  173. package/.next/standalone/.next/server/app/login.segments/_index.segment.rsc +3 -3
  174. package/.next/standalone/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  175. package/.next/standalone/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  176. package/.next/standalone/.next/server/app/login.segments/login.segment.rsc +1 -1
  177. package/.next/standalone/.next/server/app/m/page_client-reference-manifest.js +1 -1
  178. package/.next/standalone/.next/server/app/m/projects/page_client-reference-manifest.js +1 -1
  179. package/.next/standalone/.next/server/app/m/projects.html +1 -1
  180. package/.next/standalone/.next/server/app/m/projects.rsc +5 -5
  181. package/.next/standalone/.next/server/app/m/projects.segments/_full.segment.rsc +5 -5
  182. package/.next/standalone/.next/server/app/m/projects.segments/_head.segment.rsc +1 -1
  183. package/.next/standalone/.next/server/app/m/projects.segments/_index.segment.rsc +3 -3
  184. package/.next/standalone/.next/server/app/m/projects.segments/_tree.segment.rsc +2 -2
  185. package/.next/standalone/.next/server/app/m/projects.segments/m/projects/__PAGE__.segment.rsc +2 -2
  186. package/.next/standalone/.next/server/app/m/projects.segments/m/projects.segment.rsc +1 -1
  187. package/.next/standalone/.next/server/app/m/projects.segments/m.segment.rsc +2 -2
  188. package/.next/standalone/.next/server/app/m/sessions/[id]/page_client-reference-manifest.js +1 -1
  189. package/.next/standalone/.next/server/app/m/sessions/page_client-reference-manifest.js +1 -1
  190. package/.next/standalone/.next/server/app/m/sessions.html +1 -1
  191. package/.next/standalone/.next/server/app/m/sessions.rsc +5 -5
  192. package/.next/standalone/.next/server/app/m/sessions.segments/_full.segment.rsc +5 -5
  193. package/.next/standalone/.next/server/app/m/sessions.segments/_head.segment.rsc +1 -1
  194. package/.next/standalone/.next/server/app/m/sessions.segments/_index.segment.rsc +3 -3
  195. package/.next/standalone/.next/server/app/m/sessions.segments/_tree.segment.rsc +2 -2
  196. package/.next/standalone/.next/server/app/m/sessions.segments/m/sessions/__PAGE__.segment.rsc +2 -2
  197. package/.next/standalone/.next/server/app/m/sessions.segments/m/sessions.segment.rsc +1 -1
  198. package/.next/standalone/.next/server/app/m/sessions.segments/m.segment.rsc +2 -2
  199. package/.next/standalone/.next/server/app/m/settings/page_client-reference-manifest.js +1 -1
  200. package/.next/standalone/.next/server/app/m/settings.html +1 -1
  201. package/.next/standalone/.next/server/app/m/settings.rsc +5 -5
  202. package/.next/standalone/.next/server/app/m/settings.segments/_full.segment.rsc +5 -5
  203. package/.next/standalone/.next/server/app/m/settings.segments/_head.segment.rsc +1 -1
  204. package/.next/standalone/.next/server/app/m/settings.segments/_index.segment.rsc +3 -3
  205. package/.next/standalone/.next/server/app/m/settings.segments/_tree.segment.rsc +2 -2
  206. package/.next/standalone/.next/server/app/m/settings.segments/m/settings/__PAGE__.segment.rsc +2 -2
  207. package/.next/standalone/.next/server/app/m/settings.segments/m/settings.segment.rsc +1 -1
  208. package/.next/standalone/.next/server/app/m/settings.segments/m.segment.rsc +2 -2
  209. package/.next/standalone/.next/server/app/m/terminal/page_client-reference-manifest.js +1 -1
  210. package/.next/standalone/.next/server/app/m/terminal.html +1 -1
  211. package/.next/standalone/.next/server/app/m/terminal.rsc +5 -5
  212. package/.next/standalone/.next/server/app/m/terminal.segments/_full.segment.rsc +5 -5
  213. package/.next/standalone/.next/server/app/m/terminal.segments/_head.segment.rsc +1 -1
  214. package/.next/standalone/.next/server/app/m/terminal.segments/_index.segment.rsc +3 -3
  215. package/.next/standalone/.next/server/app/m/terminal.segments/_tree.segment.rsc +2 -2
  216. package/.next/standalone/.next/server/app/m/terminal.segments/m/terminal/__PAGE__.segment.rsc +2 -2
  217. package/.next/standalone/.next/server/app/m/terminal.segments/m/terminal.segment.rsc +1 -1
  218. package/.next/standalone/.next/server/app/m/terminal.segments/m.segment.rsc +2 -2
  219. package/.next/standalone/.next/server/app/m.html +1 -1
  220. package/.next/standalone/.next/server/app/m.rsc +5 -5
  221. package/.next/standalone/.next/server/app/m.segments/_full.segment.rsc +5 -5
  222. package/.next/standalone/.next/server/app/m.segments/_head.segment.rsc +1 -1
  223. package/.next/standalone/.next/server/app/m.segments/_index.segment.rsc +3 -3
  224. package/.next/standalone/.next/server/app/m.segments/_tree.segment.rsc +2 -2
  225. package/.next/standalone/.next/server/app/m.segments/m/__PAGE__.segment.rsc +2 -2
  226. package/.next/standalone/.next/server/app/m.segments/m.segment.rsc +2 -2
  227. package/.next/standalone/.next/server/app/network.html +1 -1
  228. package/.next/standalone/.next/server/app/network.rsc +5 -5
  229. package/.next/standalone/.next/server/app/network.segments/!KGRlc2t0b3Ap/network/__PAGE__.segment.rsc +2 -2
  230. package/.next/standalone/.next/server/app/network.segments/!KGRlc2t0b3Ap/network.segment.rsc +1 -1
  231. package/.next/standalone/.next/server/app/network.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
  232. package/.next/standalone/.next/server/app/network.segments/_full.segment.rsc +5 -5
  233. package/.next/standalone/.next/server/app/network.segments/_head.segment.rsc +1 -1
  234. package/.next/standalone/.next/server/app/network.segments/_index.segment.rsc +3 -3
  235. package/.next/standalone/.next/server/app/network.segments/_tree.segment.rsc +2 -2
  236. package/.next/standalone/.next/server/app/projects.html +1 -1
  237. package/.next/standalone/.next/server/app/projects.rsc +5 -5
  238. package/.next/standalone/.next/server/app/projects.segments/!KGRlc2t0b3Ap/projects/__PAGE__.segment.rsc +2 -2
  239. package/.next/standalone/.next/server/app/projects.segments/!KGRlc2t0b3Ap/projects.segment.rsc +1 -1
  240. package/.next/standalone/.next/server/app/projects.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
  241. package/.next/standalone/.next/server/app/projects.segments/_full.segment.rsc +5 -5
  242. package/.next/standalone/.next/server/app/projects.segments/_head.segment.rsc +1 -1
  243. package/.next/standalone/.next/server/app/projects.segments/_index.segment.rsc +3 -3
  244. package/.next/standalone/.next/server/app/projects.segments/_tree.segment.rsc +2 -2
  245. package/.next/standalone/.next/server/app/sessions.html +1 -1
  246. package/.next/standalone/.next/server/app/sessions.rsc +5 -5
  247. package/.next/standalone/.next/server/app/sessions.segments/!KGRlc2t0b3Ap/sessions/__PAGE__.segment.rsc +2 -2
  248. package/.next/standalone/.next/server/app/sessions.segments/!KGRlc2t0b3Ap/sessions.segment.rsc +1 -1
  249. package/.next/standalone/.next/server/app/sessions.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
  250. package/.next/standalone/.next/server/app/sessions.segments/_full.segment.rsc +5 -5
  251. package/.next/standalone/.next/server/app/sessions.segments/_head.segment.rsc +1 -1
  252. package/.next/standalone/.next/server/app/sessions.segments/_index.segment.rsc +3 -3
  253. package/.next/standalone/.next/server/app/sessions.segments/_tree.segment.rsc +2 -2
  254. package/.next/standalone/.next/server/app/settings.html +1 -1
  255. package/.next/standalone/.next/server/app/settings.rsc +5 -5
  256. package/.next/standalone/.next/server/app/settings.segments/!KGRlc2t0b3Ap/settings/__PAGE__.segment.rsc +2 -2
  257. package/.next/standalone/.next/server/app/settings.segments/!KGRlc2t0b3Ap/settings.segment.rsc +1 -1
  258. package/.next/standalone/.next/server/app/settings.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
  259. package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +5 -5
  260. package/.next/standalone/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  261. package/.next/standalone/.next/server/app/settings.segments/_index.segment.rsc +3 -3
  262. package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  263. package/.next/standalone/.next/server/app/terminal.html +1 -1
  264. package/.next/standalone/.next/server/app/terminal.rsc +5 -5
  265. package/.next/standalone/.next/server/app/terminal.segments/!KGRlc2t0b3Ap/terminal/__PAGE__.segment.rsc +2 -2
  266. package/.next/standalone/.next/server/app/terminal.segments/!KGRlc2t0b3Ap/terminal.segment.rsc +1 -1
  267. package/.next/standalone/.next/server/app/terminal.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
  268. package/.next/standalone/.next/server/app/terminal.segments/_full.segment.rsc +5 -5
  269. package/.next/standalone/.next/server/app/terminal.segments/_head.segment.rsc +1 -1
  270. package/.next/standalone/.next/server/app/terminal.segments/_index.segment.rsc +3 -3
  271. package/.next/standalone/.next/server/app/terminal.segments/_tree.segment.rsc +2 -2
  272. package/.next/standalone/.next/server/app/workspaces.html +1 -1
  273. package/.next/standalone/.next/server/app/workspaces.rsc +5 -5
  274. package/.next/standalone/.next/server/app/workspaces.segments/!KGRlc2t0b3Ap/workspaces/__PAGE__.segment.rsc +2 -2
  275. package/.next/standalone/.next/server/app/workspaces.segments/!KGRlc2t0b3Ap/workspaces.segment.rsc +1 -1
  276. package/.next/standalone/.next/server/app/workspaces.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
  277. package/.next/standalone/.next/server/app/workspaces.segments/_full.segment.rsc +5 -5
  278. package/.next/standalone/.next/server/app/workspaces.segments/_head.segment.rsc +1 -1
  279. package/.next/standalone/.next/server/app/workspaces.segments/_index.segment.rsc +3 -3
  280. package/.next/standalone/.next/server/app/workspaces.segments/_tree.segment.rsc +2 -2
  281. package/.next/standalone/.next/server/chunks/[root-of-the-server]__086be15a._.js +3 -0
  282. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0955695e._.js +3 -0
  283. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fac388d._.js +3 -0
  284. package/.next/standalone/.next/server/chunks/[root-of-the-server]__18a58c5f._.js +3 -0
  285. package/.next/standalone/.next/server/chunks/[root-of-the-server]__190b05d8._.js +3 -0
  286. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1a211143._.js +3 -0
  287. package/.next/standalone/.next/server/chunks/[root-of-the-server]__20353b76._.js +3 -0
  288. package/.next/standalone/.next/server/chunks/[root-of-the-server]__2861e096._.js +3 -0
  289. package/.next/standalone/.next/server/chunks/[root-of-the-server]__2a7a798c._.js +3 -0
  290. package/.next/standalone/.next/server/chunks/[root-of-the-server]__2b6758fc._.js +3 -0
  291. package/.next/standalone/.next/server/chunks/[root-of-the-server]__2e9d1d5a._.js +3 -0
  292. package/.next/standalone/.next/server/chunks/[root-of-the-server]__31f028ec._.js +3 -0
  293. package/.next/standalone/.next/server/chunks/[root-of-the-server]__34c34116._.js +3 -0
  294. package/.next/standalone/.next/server/chunks/[root-of-the-server]__3aa57139._.js +3 -0
  295. package/.next/standalone/.next/server/chunks/[root-of-the-server]__3ce30e4e._.js +3 -0
  296. package/.next/standalone/.next/server/chunks/[root-of-the-server]__41ae8be6._.js +3 -0
  297. package/.next/standalone/.next/server/chunks/[root-of-the-server]__41e589ee._.js +3 -0
  298. package/.next/standalone/.next/server/chunks/[root-of-the-server]__43112c34._.js +3 -0
  299. package/.next/standalone/.next/server/chunks/[root-of-the-server]__464db440._.js +3 -0
  300. package/.next/standalone/.next/server/chunks/[root-of-the-server]__466c7e18._.js +3 -0
  301. package/.next/standalone/.next/server/chunks/[root-of-the-server]__47a63195._.js +3 -0
  302. package/.next/standalone/.next/server/chunks/[root-of-the-server]__4ad64489._.js +3 -0
  303. package/.next/standalone/.next/server/chunks/[root-of-the-server]__5bbc73ff._.js +3 -0
  304. package/.next/standalone/.next/server/chunks/[root-of-the-server]__60689e2b._.js +3 -0
  305. package/.next/standalone/.next/server/chunks/[root-of-the-server]__67c4abf3._.js +3 -0
  306. package/.next/standalone/.next/server/chunks/[root-of-the-server]__6b94cc47._.js +3 -0
  307. package/.next/standalone/.next/server/chunks/[root-of-the-server]__6c6cfe82._.js +3 -0
  308. package/.next/standalone/.next/server/chunks/[root-of-the-server]__776b2fd5._.js +3 -0
  309. package/.next/standalone/.next/server/chunks/[root-of-the-server]__7901e2ab._.js +3 -0
  310. package/.next/standalone/.next/server/chunks/[root-of-the-server]__83b9bcf3._.js +11 -0
  311. package/.next/standalone/.next/server/chunks/[root-of-the-server]__89124c96._.js +243 -0
  312. package/.next/standalone/.next/server/chunks/[root-of-the-server]__8c2eee30._.js +3 -0
  313. package/.next/standalone/.next/server/chunks/[root-of-the-server]__8ffcf827._.js +3 -0
  314. package/.next/standalone/.next/server/chunks/[root-of-the-server]__95b7f18e._.js +3 -0
  315. package/.next/standalone/.next/server/chunks/[root-of-the-server]__9e343d64._.js +3 -0
  316. package/.next/standalone/.next/server/chunks/[root-of-the-server]__a2ee9884._.js +13 -0
  317. package/.next/standalone/.next/server/chunks/[root-of-the-server]__a651ede9._.js +3 -0
  318. package/.next/standalone/.next/server/chunks/[root-of-the-server]__a6ce192e._.js +3 -0
  319. package/.next/standalone/.next/server/chunks/[root-of-the-server]__b4b692df._.js +3 -0
  320. package/.next/standalone/.next/server/chunks/[root-of-the-server]__b4edb4d6._.js +3 -0
  321. package/.next/standalone/.next/server/chunks/[root-of-the-server]__b71497ab._.js +243 -0
  322. package/.next/standalone/.next/server/chunks/[root-of-the-server]__bc97ddc7._.js +3 -0
  323. package/.next/standalone/.next/server/chunks/[root-of-the-server]__bef2ed87._.js +3 -0
  324. package/.next/standalone/.next/server/chunks/[root-of-the-server]__c525457e._.js +19 -0
  325. package/.next/standalone/.next/server/chunks/[root-of-the-server]__c546cf71._.js +3 -0
  326. package/.next/standalone/.next/server/chunks/[root-of-the-server]__ccc27199._.js +3 -0
  327. package/.next/standalone/.next/server/chunks/[root-of-the-server]__ce5edd98._.js +3 -0
  328. package/.next/standalone/.next/server/chunks/[root-of-the-server]__d877df12._.js +3 -0
  329. package/.next/standalone/.next/server/chunks/[root-of-the-server]__dd2e81be._.js +11 -0
  330. package/.next/standalone/.next/server/chunks/[root-of-the-server]__de96c005._.js +3 -0
  331. package/.next/standalone/.next/server/chunks/[root-of-the-server]__df6bc9e9._.js +3 -0
  332. package/.next/standalone/.next/server/chunks/[root-of-the-server]__e2b78951._.js +3 -0
  333. package/.next/standalone/.next/server/chunks/[root-of-the-server]__e742ef33._.js +3 -0
  334. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__63c35e0f._.js +1 -1
  335. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__66aca5d4._.js +3 -0
  336. package/.next/standalone/.next/server/chunks/ssr/_1f12caba._.js +1 -1
  337. package/.next/standalone/.next/server/chunks/ssr/_3b54193d._.js +1 -1
  338. package/.next/standalone/.next/server/chunks/ssr/_43e7e611._.js +1 -1
  339. package/.next/standalone/.next/server/chunks/ssr/_5ac43c5d._.js +1 -1
  340. package/.next/standalone/.next/server/chunks/ssr/_cd50a174._.js +1 -1
  341. package/.next/standalone/.next/server/chunks/ssr/src_app_(desktop)_terminal_page_tsx_de5e8d85._.js +1 -1
  342. package/.next/standalone/.next/server/edge/chunks/[root-of-the-server]__32a0045c._.js +1 -1
  343. package/.next/standalone/.next/server/edge/chunks/_d73df637._.js +3 -0
  344. package/.next/standalone/.next/server/edge/chunks/turbopack-node_modules_next_dist_esm_build_templates_edge-wrapper_a4434a38.js +6 -0
  345. package/.next/standalone/.next/server/middleware-manifest.json +7 -7
  346. package/.next/standalone/.next/server/pages/404.html +1 -1
  347. package/.next/standalone/.next/server/pages/500.html +2 -2
  348. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  349. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  350. package/.next/standalone/.next/static/chunks/{31f45c67350373f2.js → 10c6424526b53431.js} +2 -2
  351. package/.next/standalone/.next/static/chunks/{8cc07e8d950d6962.js → 27649ec994a696fb.js} +1 -1
  352. package/.next/standalone/.next/static/chunks/{3c4ee171d96760e8.js → 302ce212c690bec4.js} +2 -2
  353. package/.next/standalone/.next/static/chunks/51dacec57c9714c0.js +1 -0
  354. package/.next/standalone/.next/static/chunks/{f2b58d718b34646d.js → 53782d1e41fd7f82.js} +1 -1
  355. package/.next/standalone/.next/static/chunks/{f789a1d0736e1154.js → 58d78765e5140dcb.js} +1 -1
  356. package/.next/standalone/.next/static/chunks/{7c1e6d7f1d3b4173.js → cb442c50eecb758d.js} +2 -2
  357. package/.next/standalone/.next/static/chunks/ff5fac1bd7b518dd.css +3 -0
  358. package/.next/standalone/node_modules/@img/sharp-win32-x64/lib/sharp-win32-x64.node +0 -0
  359. package/.next/standalone/node_modules/@img/{sharp-linux-x64 → sharp-win32-x64}/package.json +39 -46
  360. package/.next/standalone/package.json +89 -91
  361. package/.next/standalone/server.js +1 -1
  362. package/.next/standalone/tsconfig.json +34 -34
  363. package/LICENSE +661 -661
  364. package/README.md +131 -131
  365. package/bin/fix-standalone-externals.js +79 -79
  366. package/bin/lib/auto-setup.js +101 -101
  367. package/bin/mdns-service.js +171 -171
  368. package/bin/postinstall.js +35 -35
  369. package/bin/setup-admin.js +189 -189
  370. package/bin/spaces-dev.js +208 -173
  371. package/bin/spaces-install.js +426 -0
  372. package/bin/spaces-setup.js +242 -242
  373. package/bin/spaces.js +465 -317
  374. package/bin/terminal-server.js +1117 -1051
  375. package/package.json +89 -91
  376. package/.next/standalone/.next/server/chunks/[root-of-the-server]__025cd038._.js +0 -3
  377. package/.next/standalone/.next/server/chunks/[root-of-the-server]__042ba2bc._.js +0 -3
  378. package/.next/standalone/.next/server/chunks/[root-of-the-server]__07cc153d._.js +0 -3
  379. package/.next/standalone/.next/server/chunks/[root-of-the-server]__08e411dd._.js +0 -3
  380. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0add852f._.js +0 -3
  381. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0c113ed0._.js +0 -3
  382. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0cf032ab._.js +0 -3
  383. package/.next/standalone/.next/server/chunks/[root-of-the-server]__11293532._.js +0 -13
  384. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1194f2c1._.js +0 -3
  385. package/.next/standalone/.next/server/chunks/[root-of-the-server]__19c2d094._.js +0 -3
  386. package/.next/standalone/.next/server/chunks/[root-of-the-server]__19c3ad21._.js +0 -3
  387. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1ebc634e._.js +0 -3
  388. package/.next/standalone/.next/server/chunks/[root-of-the-server]__24197539._.js +0 -3
  389. package/.next/standalone/.next/server/chunks/[root-of-the-server]__2891c969._.js +0 -11
  390. package/.next/standalone/.next/server/chunks/[root-of-the-server]__2c6e6625._.js +0 -3
  391. package/.next/standalone/.next/server/chunks/[root-of-the-server]__2fe2b40e._.js +0 -3
  392. package/.next/standalone/.next/server/chunks/[root-of-the-server]__318f12c6._.js +0 -3
  393. package/.next/standalone/.next/server/chunks/[root-of-the-server]__32df12e4._.js +0 -3
  394. package/.next/standalone/.next/server/chunks/[root-of-the-server]__34e7cb21._.js +0 -3
  395. package/.next/standalone/.next/server/chunks/[root-of-the-server]__49c92d87._.js +0 -3
  396. package/.next/standalone/.next/server/chunks/[root-of-the-server]__52bde30c._.js +0 -3
  397. package/.next/standalone/.next/server/chunks/[root-of-the-server]__53090a81._.js +0 -3
  398. package/.next/standalone/.next/server/chunks/[root-of-the-server]__57193cf5._.js +0 -3
  399. package/.next/standalone/.next/server/chunks/[root-of-the-server]__5c33078d._.js +0 -3
  400. package/.next/standalone/.next/server/chunks/[root-of-the-server]__5f8c694a._.js +0 -3
  401. package/.next/standalone/.next/server/chunks/[root-of-the-server]__630b9a6a._.js +0 -3
  402. package/.next/standalone/.next/server/chunks/[root-of-the-server]__727d05f1._.js +0 -3
  403. package/.next/standalone/.next/server/chunks/[root-of-the-server]__75a774f0._.js +0 -233
  404. package/.next/standalone/.next/server/chunks/[root-of-the-server]__7f0bc701._.js +0 -233
  405. package/.next/standalone/.next/server/chunks/[root-of-the-server]__8915603e._.js +0 -3
  406. package/.next/standalone/.next/server/chunks/[root-of-the-server]__8afe4d5e._.js +0 -3
  407. package/.next/standalone/.next/server/chunks/[root-of-the-server]__9d15de27._.js +0 -3
  408. package/.next/standalone/.next/server/chunks/[root-of-the-server]__a1fbc199._.js +0 -3
  409. package/.next/standalone/.next/server/chunks/[root-of-the-server]__a1fe6070._.js +0 -3
  410. package/.next/standalone/.next/server/chunks/[root-of-the-server]__a3f604d6._.js +0 -3
  411. package/.next/standalone/.next/server/chunks/[root-of-the-server]__a5504205._.js +0 -3
  412. package/.next/standalone/.next/server/chunks/[root-of-the-server]__abf53d11._.js +0 -3
  413. package/.next/standalone/.next/server/chunks/[root-of-the-server]__b78eeead._.js +0 -11
  414. package/.next/standalone/.next/server/chunks/[root-of-the-server]__c1b8f8f6._.js +0 -3
  415. package/.next/standalone/.next/server/chunks/[root-of-the-server]__c3c74ca4._.js +0 -3
  416. package/.next/standalone/.next/server/chunks/[root-of-the-server]__c79824d9._.js +0 -3
  417. package/.next/standalone/.next/server/chunks/[root-of-the-server]__c9db5d8a._.js +0 -3
  418. package/.next/standalone/.next/server/chunks/[root-of-the-server]__cbd9cb15._.js +0 -3
  419. package/.next/standalone/.next/server/chunks/[root-of-the-server]__ccb4e920._.js +0 -3
  420. package/.next/standalone/.next/server/chunks/[root-of-the-server]__d15515e3._.js +0 -3
  421. package/.next/standalone/.next/server/chunks/[root-of-the-server]__d490583e._.js +0 -3
  422. package/.next/standalone/.next/server/chunks/[root-of-the-server]__d9c106a9._.js +0 -3
  423. package/.next/standalone/.next/server/chunks/[root-of-the-server]__de2c3bf8._.js +0 -3
  424. package/.next/standalone/.next/server/chunks/[root-of-the-server]__dfbf7bdd._.js +0 -19
  425. package/.next/standalone/.next/server/chunks/[root-of-the-server]__e1e26f47._.js +0 -3
  426. package/.next/standalone/.next/server/chunks/[root-of-the-server]__ee9346bf._.js +0 -3
  427. package/.next/standalone/.next/server/chunks/[root-of-the-server]__fea012d6._.js +0 -3
  428. package/.next/standalone/.next/server/chunks/[root-of-the-server]__ff1b0769._.js +0 -3
  429. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__eac7aeff._.js +0 -3
  430. package/.next/standalone/.next/server/edge/chunks/node_modules_next_dist_esm_build_templates_edge-wrapper_78fa9d6a.js +0 -3
  431. package/.next/standalone/.next/server/edge/chunks/turbopack-node_modules_next_dist_esm_build_templates_edge-wrapper_a5230bba.js +0 -6
  432. package/.next/standalone/.next/static/chunks/780381483091d8fb.js +0 -1
  433. package/.next/standalone/.next/static/chunks/806334ea0f6ca92a.css +0 -3
  434. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/README.md +0 -46
  435. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/glib-2.0/include/glibconfig.h +0 -221
  436. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/index.js +0 -1
  437. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  438. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/package.json +0 -42
  439. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/README.md +0 -46
  440. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/glib-2.0/include/glibconfig.h +0 -221
  441. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +0 -1
  442. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  443. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +0 -42
  444. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +0 -30
  445. package/.next/standalone/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
  446. package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
  447. package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/package.json +0 -46
  448. /package/.next/standalone/.next/static/{k4gRsS979E-cbl1AWcHhx → U-EFIvMEHFIoGaoj6xBXK}/_buildManifest.js +0 -0
  449. /package/.next/standalone/.next/static/{k4gRsS979E-cbl1AWcHhx → U-EFIvMEHFIoGaoj6xBXK}/_clientMiddlewareManifest.json +0 -0
  450. /package/.next/standalone/.next/static/{k4gRsS979E-cbl1AWcHhx → U-EFIvMEHFIoGaoj6xBXK}/_ssgManifest.js +0 -0
  451. /package/.next/standalone/node_modules/@img/{sharp-libvips-linux-x64 → sharp-win32-x64}/versions.json +0 -0
@@ -1,6 +1,6 @@
1
1
  module.exports=[63681,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={RequestCookies:function(){return f.RequestCookies},ResponseCookies:function(){return f.ResponseCookies},stringifyCookie:function(){return f.stringifyCookie}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(36226)},51409,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ReflectAdapter",{enumerable:!0,get:function(){return d}});class d{static get(a,b,c){let d=Reflect.get(a,b,c);return"function"==typeof d?d.bind(a):d}static set(a,b,c,d){return Reflect.set(a,b,c,d)}static has(a,b){return Reflect.has(a,b)}static deleteProperty(a,b){return Reflect.deleteProperty(a,b)}}},4712,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={ActionDidNotRevalidate:function(){return f},ActionDidRevalidateDynamicOnly:function(){return h},ActionDidRevalidateStaticAndDynamic:function(){return g}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=0,g=1,h=2},14896,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={MutableRequestCookiesAdapter:function(){return o},ReadonlyRequestCookiesError:function(){return j},RequestCookiesAdapter:function(){return k},appendMutableCookies:function(){return n},areCookiesMutableInCurrentPhase:function(){return q},createCookiesWithMutableAccessCheck:function(){return p},getModifiedCookieValues:function(){return m},responseCookiesToRequestCookies:function(){return s}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(63681),g=a.r(51409),h=a.r(56704),i=a.r(4712);class j extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options")}static callable(){throw new j}}class k{static seal(a){return new Proxy(a,{get(a,b,c){switch(b){case"clear":case"delete":case"set":return j.callable;default:return g.ReflectAdapter.get(a,b,c)}}})}}let l=Symbol.for("next.mutated.cookies");function m(a){let b=a[l];return b&&Array.isArray(b)&&0!==b.length?b:[]}function n(a,b){let c=m(b);if(0===c.length)return!1;let d=new f.ResponseCookies(a),e=d.getAll();for(let a of c)d.set(a);for(let a of e)d.set(a);return!0}class o{static wrap(a,b){let c=new f.ResponseCookies(new Headers);for(let b of a.getAll())c.set(b);let d=[],e=new Set,j=()=>{let a=h.workAsyncStorage.getStore();if(a&&(a.pathWasRevalidated=i.ActionDidRevalidateStaticAndDynamic),d=c.getAll().filter(a=>e.has(a.name)),b){let a=[];for(let b of d){let c=new f.ResponseCookies(new Headers);c.set(b),a.push(c.toString())}b(a)}},k=new Proxy(c,{get(a,b,c){switch(b){case l:return d;case"delete":return function(...b){e.add("string"==typeof b[0]?b[0]:b[0].name);try{return a.delete(...b),k}finally{j()}};case"set":return function(...b){e.add("string"==typeof b[0]?b[0]:b[0].name);try{return a.set(...b),k}finally{j()}};default:return g.ReflectAdapter.get(a,b,c)}}});return k}}function p(a){let b=new Proxy(a.mutableCookies,{get(c,d,e){switch(d){case"delete":return function(...d){return r(a,"cookies().delete"),c.delete(...d),b};case"set":return function(...d){return r(a,"cookies().set"),c.set(...d),b};default:return g.ReflectAdapter.get(c,d,e)}}});return b}function q(a){return"action"===a.phase}function r(a,b){if(!q(a))throw new j}function s(a){let b=new f.RequestCookies(new Headers);for(let c of a.getAll())b.set(c);return b}},96556,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={DynamicServerError:function(){return g},isDynamicServerError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="DYNAMIC_SERVER_USAGE";class g extends Error{constructor(a){super(`Dynamic server usage: ${a}`),this.description=a,this.digest=f}}function h(a){return"object"==typeof a&&null!==a&&"digest"in a&&"string"==typeof a.digest&&a.digest===f}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},60312,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={StaticGenBailoutError:function(){return g},isStaticGenBailoutError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="NEXT_STATIC_GEN_BAILOUT";class g extends Error{constructor(...a){super(...a),this.code=f}}function h(a){return"object"==typeof a&&null!==a&&"code"in a&&a.code===f}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},13091,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={isHangingPromiseRejectionError:function(){return f},makeDevtoolsIOAwarePromise:function(){return l},makeHangingPromise:function(){return j}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});function f(a){return"object"==typeof a&&null!==a&&"digest"in a&&a.digest===g}let g="HANGING_PROMISE_REJECTION";class h extends Error{constructor(a,b){super(`During prerendering, ${b} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${b} to a different context by using \`setTimeout\`, \`after\`, or similar functions you may observe this error and you should handle it in that context. This occurred at route "${a}".`),this.route=a,this.expression=b,this.digest=g}}let i=new WeakMap;function j(a,b,c){if(a.aborted)return Promise.reject(new h(b,c));{let d=new Promise((d,e)=>{let f=e.bind(null,new h(b,c)),g=i.get(a);if(g)g.push(f);else{let b=[f];i.set(a,b),a.addEventListener("abort",()=>{for(let a=0;a<b.length;a++)b[a]()},{once:!0})}});return d.catch(k),d}}function k(){}function l(a,b,c){return b.stagedRendering?b.stagedRendering.delayUntilStage(c,void 0,a):new Promise(b=>{setTimeout(()=>{b(a)},0)})}},17491,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={METADATA_BOUNDARY_NAME:function(){return f},OUTLET_BOUNDARY_NAME:function(){return h},ROOT_LAYOUT_BOUNDARY_NAME:function(){return i},VIEWPORT_BOUNDARY_NAME:function(){return g}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="__next_metadata_boundary__",g="__next_viewport_boundary__",h="__next_outlet_boundary__",i="__next_root_layout_boundary__"},61933,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={atLeastOneTask:function(){return h},scheduleImmediate:function(){return g},scheduleOnNextTick:function(){return f},waitAtLeastOneReactRenderTask:function(){return i}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a=>{Promise.resolve().then(()=>{process.nextTick(a)})},g=a=>{setImmediate(a)};function h(){return new Promise(a=>g(a))}function i(){return new Promise(a=>setImmediate(a))}},49640,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={BailoutToCSRError:function(){return g},isBailoutToCSRError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="BAILOUT_TO_CLIENT_SIDE_RENDERING";class g extends Error{constructor(a){super(`Bail out to client-side rendering: ${a}`),this.reason=a,this.digest=f}}function h(a){return"object"==typeof a&&null!==a&&"digest"in a&&a.digest===f}},60384,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d,e,f={Postpone:function(){return B},PreludeState:function(){return $},abortAndThrowOnSynchronousRequestDataAccess:function(){return A},abortOnSynchronousPlatformIOAccess:function(){return z},accessedDynamicData:function(){return J},annotateDynamicAccess:function(){return O},consumeDynamicAccess:function(){return K},createDynamicTrackingState:function(){return s},createDynamicValidationState:function(){return t},createHangingInputAbortSignal:function(){return N},createRenderInBrowserAbortSignal:function(){return M},delayUntilRuntimeStage:function(){return ac},formatDynamicAPIAccesses:function(){return L},getFirstDynamicReason:function(){return u},getStaticShellDisallowedDynamicReasons:function(){return ab},isDynamicPostpone:function(){return E},isPrerenderInterruptedError:function(){return I},logDisallowedDynamicError:function(){return _},markCurrentScopeAsDynamic:function(){return v},postponeWithTracking:function(){return C},throwIfDisallowedDynamic:function(){return aa},throwToInterruptStaticGeneration:function(){return w},trackAllowedDynamicAccess:function(){return W},trackDynamicDataInDynamicRender:function(){return x},trackDynamicHoleInRuntimeShell:function(){return X},trackDynamicHoleInStaticShell:function(){return Y},useDynamicRouteParams:function(){return P},useDynamicSearchParams:function(){return Q}};for(var g in f)Object.defineProperty(c,g,{enumerable:!0,get:f[g]});let h=(d=a.r(717))&&d.__esModule?d:{default:d},i=a.r(96556),j=a.r(60312),k=a.r(32319),l=a.r(56704),m=a.r(13091),n=a.r(17491),o=a.r(61933),p=a.r(49640),q=a.r(50640),r="function"==typeof h.default.unstable_postpone;function s(a){return{isDebugDynamicAccesses:a,dynamicAccesses:[],syncDynamicErrorWithStack:null}}function t(){return{hasSuspenseAboveBody:!1,hasDynamicMetadata:!1,dynamicMetadata:null,hasDynamicViewport:!1,hasAllowedDynamic:!1,dynamicErrors:[]}}function u(a){var b;return null==(b=a.dynamicAccesses[0])?void 0:b.expression}function v(a,b,c){if(b)switch(b.type){case"cache":case"unstable-cache":case"private-cache":return}if(!a.forceDynamic&&!a.forceStatic){if(a.dynamicShouldError)throw Object.defineProperty(new j.StaticGenBailoutError(`Route ${a.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${c}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E553",enumerable:!1,configurable:!0});if(b)switch(b.type){case"prerender-ppr":return C(a.route,c,b.dynamicTracking);case"prerender-legacy":b.revalidate=0;let d=Object.defineProperty(new i.DynamicServerError(`Route ${a.route} couldn't be rendered statically because it used ${c}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E550",enumerable:!1,configurable:!0});throw a.dynamicUsageDescription=c,a.dynamicUsageStack=d.stack,d}}}function w(a,b,c){let d=Object.defineProperty(new i.DynamicServerError(`Route ${b.route} couldn't be rendered statically because it used \`${a}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E558",enumerable:!1,configurable:!0});throw c.revalidate=0,b.dynamicUsageDescription=a,b.dynamicUsageStack=d.stack,d}function x(a){switch(a.type){case"cache":case"unstable-cache":case"private-cache":return}}function y(a,b,c){let d=H(`Route ${a} needs to bail out of prerendering at this point because it used ${b}.`);c.controller.abort(d);let e=c.dynamicTracking;e&&e.dynamicAccesses.push({stack:e.isDebugDynamicAccesses?Error().stack:void 0,expression:b})}function z(a,b,c,d){let e=d.dynamicTracking;y(a,b,d),e&&null===e.syncDynamicErrorWithStack&&(e.syncDynamicErrorWithStack=c)}function A(a,b,c,d){if(!1===d.controller.signal.aborted){y(a,b,d);let e=d.dynamicTracking;e&&null===e.syncDynamicErrorWithStack&&(e.syncDynamicErrorWithStack=c)}throw H(`Route ${a} needs to bail out of prerendering at this point because it used ${b}.`)}function B({reason:a,route:b}){let c=k.workUnitAsyncStorage.getStore();C(b,a,c&&"prerender-ppr"===c.type?c.dynamicTracking:null)}function C(a,b,c){(function(){if(!r)throw Object.defineProperty(Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E224",enumerable:!1,configurable:!0})})(),c&&c.dynamicAccesses.push({stack:c.isDebugDynamicAccesses?Error().stack:void 0,expression:b}),h.default.unstable_postpone(D(a,b))}function D(a,b){return`Route ${a} needs to bail out of prerendering at this point because it used ${b}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`}function E(a){return"object"==typeof a&&null!==a&&"string"==typeof a.message&&F(a.message)}function F(a){return a.includes("needs to bail out of prerendering at this point because it used")&&a.includes("Learn more: https://nextjs.org/docs/messages/ppr-caught-error")}if(!1===F(D("%%%","^^^")))throw Object.defineProperty(Error("Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E296",enumerable:!1,configurable:!0});let G="NEXT_PRERENDER_INTERRUPTED";function H(a){let b=Object.defineProperty(Error(a),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return b.digest=G,b}function I(a){return"object"==typeof a&&null!==a&&a.digest===G&&"name"in a&&"message"in a&&a instanceof Error}function J(a){return a.length>0}function K(a,b){return a.dynamicAccesses.push(...b.dynamicAccesses),a.dynamicAccesses}function L(a){return a.filter(a=>"string"==typeof a.stack&&a.stack.length>0).map(({expression:a,stack:b})=>(b=b.split("\n").slice(4).filter(a=>!(a.includes("node_modules/next/")||a.includes(" (<anonymous>)")||a.includes(" (node:"))).join("\n"),`Dynamic API Usage Debug - ${a}:
2
2
  ${b}`))}function M(){let a=new AbortController;return a.abort(Object.defineProperty(new p.BailoutToCSRError("Render in Browser"),"__NEXT_ERROR_CODE",{value:"E721",enumerable:!1,configurable:!0})),a.signal}function N(a){switch(a.type){case"prerender":case"prerender-runtime":let b=new AbortController;if(a.cacheSignal)a.cacheSignal.inputReady().then(()=>{b.abort()});else{let c=(0,k.getRuntimeStagePromise)(a);c?c.then(()=>(0,o.scheduleOnNextTick)(()=>b.abort())):(0,o.scheduleOnNextTick)(()=>b.abort())}return b.signal;case"prerender-client":case"prerender-ppr":case"prerender-legacy":case"request":case"cache":case"private-cache":case"unstable-cache":return}}function O(a,b){let c=b.dynamicTracking;c&&c.dynamicAccesses.push({stack:c.isDebugDynamicAccesses?Error().stack:void 0,expression:a})}function P(a){let b=l.workAsyncStorage.getStore(),c=k.workUnitAsyncStorage.getStore();if(b&&c)switch(c.type){case"prerender-client":case"prerender":{let d=c.fallbackRouteParams;d&&d.size>0&&h.default.use((0,m.makeHangingPromise)(c.renderSignal,b.route,a));break}case"prerender-ppr":{let d=c.fallbackRouteParams;if(d&&d.size>0)return C(b.route,a,c.dynamicTracking);break}case"prerender-runtime":throw Object.defineProperty(new q.InvariantError(`\`${a}\` was called during a runtime prerender. Next.js should be preventing ${a} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E771",enumerable:!1,configurable:!0});case"cache":case"private-cache":throw Object.defineProperty(new q.InvariantError(`\`${a}\` was called inside a cache scope. Next.js should be preventing ${a} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E745",enumerable:!1,configurable:!0})}}function Q(a){let b=l.workAsyncStorage.getStore(),c=k.workUnitAsyncStorage.getStore();if(b)switch(!c&&(0,k.throwForMissingRequestStore)(a),c.type){case"prerender-client":h.default.use((0,m.makeHangingPromise)(c.renderSignal,b.route,a));break;case"prerender-legacy":case"prerender-ppr":if(b.forceStatic)return;throw Object.defineProperty(new p.BailoutToCSRError(a),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});case"prerender":case"prerender-runtime":throw Object.defineProperty(new q.InvariantError(`\`${a}\` was called from a Server Component. Next.js should be preventing ${a} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E795",enumerable:!1,configurable:!0});case"cache":case"unstable-cache":case"private-cache":throw Object.defineProperty(new q.InvariantError(`\`${a}\` was called inside a cache scope. Next.js should be preventing ${a} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E745",enumerable:!1,configurable:!0});case"request":return}}let R=/\n\s+at Suspense \(<anonymous>\)/,S=RegExp(`\\n\\s+at Suspense \\(<anonymous>\\)(?:(?!\\n\\s+at (?:body|div|main|section|article|aside|header|footer|nav|form|p|span|h1|h2|h3|h4|h5|h6) \\(<anonymous>\\))[\\s\\S])*?\\n\\s+at ${n.ROOT_LAYOUT_BOUNDARY_NAME} \\([^\\n]*\\)`),T=RegExp(`\\n\\s+at ${n.METADATA_BOUNDARY_NAME}[\\n\\s]`),U=RegExp(`\\n\\s+at ${n.VIEWPORT_BOUNDARY_NAME}[\\n\\s]`),V=RegExp(`\\n\\s+at ${n.OUTLET_BOUNDARY_NAME}[\\n\\s]`);function W(a,b,c,d){if(!V.test(b)){if(T.test(b)){c.hasDynamicMetadata=!0;return}if(U.test(b)){c.hasDynamicViewport=!0;return}if(S.test(b)){c.hasAllowedDynamic=!0,c.hasSuspenseAboveBody=!0;return}else if(R.test(b)){c.hasAllowedDynamic=!0;return}else{if(d.syncDynamicErrorWithStack)return void c.dynamicErrors.push(d.syncDynamicErrorWithStack);let e=Z(`Route "${a.route}": Uncached data was accessed outside of <Suspense>. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route`,b);return void c.dynamicErrors.push(e)}}}function X(a,b,c,d){if(!V.test(b)){if(T.test(b)){c.dynamicMetadata=Z(`Route "${a.route}": Uncached data or \`connection()\` was accessed inside \`generateMetadata\`. Except for this instance, the page would have been entirely prerenderable which may have been the intended behavior. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`,b);return}if(U.test(b)){let d=Z(`Route "${a.route}": Uncached data or \`connection()\` was accessed inside \`generateViewport\`. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`,b);c.dynamicErrors.push(d);return}if(S.test(b)){c.hasAllowedDynamic=!0,c.hasSuspenseAboveBody=!0;return}else if(R.test(b)){c.hasAllowedDynamic=!0;return}else{if(d.syncDynamicErrorWithStack)return void c.dynamicErrors.push(d.syncDynamicErrorWithStack);let e=Z(`Route "${a.route}": Uncached data or \`connection()\` was accessed outside of \`<Suspense>\`. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route`,b);return void c.dynamicErrors.push(e)}}}function Y(a,b,c,d){if(!V.test(b)){if(T.test(b)){c.dynamicMetadata=Z(`Route "${a.route}": Runtime data such as \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` was accessed inside \`generateMetadata\` or you have file-based metadata such as icons that depend on dynamic params segments. Except for this instance, the page would have been entirely prerenderable which may have been the intended behavior. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`,b);return}if(U.test(b)){let d=Z(`Route "${a.route}": Runtime data such as \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` was accessed inside \`generateViewport\`. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`,b);c.dynamicErrors.push(d);return}if(S.test(b)){c.hasAllowedDynamic=!0,c.hasSuspenseAboveBody=!0;return}else if(R.test(b)){c.hasAllowedDynamic=!0;return}else{if(d.syncDynamicErrorWithStack)return void c.dynamicErrors.push(d.syncDynamicErrorWithStack);let e=Z(`Route "${a.route}": Runtime data such as \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` was accessed outside of \`<Suspense>\`. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route`,b);return void c.dynamicErrors.push(e)}}}function Z(a,b){let c=Object.defineProperty(Error(a),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return c.stack=c.name+": "+a+b,c}var $=((e={})[e.Full=0]="Full",e[e.Empty=1]="Empty",e[e.Errored=2]="Errored",e);function _(a,b){console.error(b),a.dev||(a.hasReadableErrorStacks?console.error(`To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "${a.route}" in your browser to investigate the error.`):console.error(`To get a more detailed stack trace and pinpoint the issue, try one of the following:
3
3
  - Start the app in development mode by running \`next dev\`, then open "${a.route}" in your browser to investigate the error.
4
- - Rerun the production build with \`next build --debug-prerender\` to generate better stack traces.`))}function aa(a,b,c,d){if(d.syncDynamicErrorWithStack)throw _(a,d.syncDynamicErrorWithStack),new j.StaticGenBailoutError;if(0!==b){if(c.hasSuspenseAboveBody)return;let d=c.dynamicErrors;if(d.length>0){for(let b=0;b<d.length;b++)_(a,d[b]);throw new j.StaticGenBailoutError}if(c.hasDynamicViewport)throw console.error(`Route "${a.route}" has a \`generateViewport\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) without explicitly allowing fully dynamic rendering. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`),new j.StaticGenBailoutError;if(1===b)throw console.error(`Route "${a.route}" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.`),new j.StaticGenBailoutError}else if(!1===c.hasAllowedDynamic&&c.hasDynamicMetadata)throw console.error(`Route "${a.route}" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`),new j.StaticGenBailoutError}function ab(a,b,c){if(c.hasSuspenseAboveBody)return[];if(0!==b){let d=c.dynamicErrors;if(d.length>0)return d;if(1===b)return[Object.defineProperty(new q.InvariantError(`Route "${a.route}" did not produce a static shell and Next.js was unable to determine a reason.`),"__NEXT_ERROR_CODE",{value:"E936",enumerable:!1,configurable:!0})]}else if(!1===c.hasAllowedDynamic&&0===c.dynamicErrors.length&&c.dynamicMetadata)return[c.dynamicMetadata];return[]}function ac(a,b){return a.runtimeStagePromise?a.runtimeStagePromise.then(()=>b):b}},8018,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"createDedupedByCallsiteServerErrorLoggerDev",{enumerable:!0,get:function(){return i}});let d=function(a,b){if(a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=e(void 0);if(c&&c.has(a))return c.get(a);var d={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(d,g,h):d[g]=a[g]}return d.default=a,c&&c.set(a,d),d}(a.r(717));function e(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(e=function(a){return a?c:b})(a)}let f={current:null},g="function"==typeof d.cache?d.cache:a=>a,h=console.warn;function i(a){return function(...b){h(a(...b))}}g(a=>{try{h(f.current)}finally{f.current=null}})},86309,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={isRequestAPICallableInsideAfter:function(){return j},throwForSearchParamsAccessInUseCache:function(){return i},throwWithStaticGenerationBailoutErrorWithDynamicError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(60312),g=a.r(24725);function h(a,b){throw Object.defineProperty(new f.StaticGenBailoutError(`Route ${a} with \`dynamic = "error"\` couldn't be rendered statically because it used ${b}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E543",enumerable:!1,configurable:!0})}function i(a,b){let c=Object.defineProperty(Error(`Route ${a.route} used \`searchParams\` inside "use cache". Accessing dynamic request data inside a cache scope is not supported. If you need some search params inside a cached function await \`searchParams\` outside of the cached function and pass only the required search params as arguments to the cached function. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E842",enumerable:!1,configurable:!0});throw Error.captureStackTrace(c,b),a.invalidDynamicUsageError??=c,c}function j(){let a=g.afterTaskAsyncStorage.getStore();return(null==a?void 0:a.rootTaskSpawnPhase)==="action"}},28340,(a,b,c)=>{"use strict";function d(){let a,b,c=new Promise((c,d)=>{a=c,b=d});return{resolve:a,reject:b,promise:c}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"createPromiseWithResolvers",{enumerable:!0,get:function(){return d}})},31382,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d,e={RenderStage:function(){return i},StagedRenderingController:function(){return j}};for(var f in e)Object.defineProperty(c,f,{enumerable:!0,get:e[f]});let g=a.r(50640),h=a.r(28340);var i=((d={})[d.Before=1]="Before",d[d.Static=2]="Static",d[d.Runtime=3]="Runtime",d[d.Dynamic=4]="Dynamic",d[d.Abandoned=5]="Abandoned",d);class j{constructor(a=null,b){this.abortSignal=a,this.hasRuntimePrefetch=b,this.currentStage=1,this.staticInterruptReason=null,this.runtimeInterruptReason=null,this.staticStageEndTime=1/0,this.runtimeStageEndTime=1/0,this.runtimeStageListeners=[],this.dynamicStageListeners=[],this.runtimeStagePromise=(0,h.createPromiseWithResolvers)(),this.dynamicStagePromise=(0,h.createPromiseWithResolvers)(),this.mayAbandon=!1,a&&(a.addEventListener("abort",()=>{let{reason:b}=a;this.currentStage<3&&(this.runtimeStagePromise.promise.catch(k),this.runtimeStagePromise.reject(b)),(this.currentStage<4||5===this.currentStage)&&(this.dynamicStagePromise.promise.catch(k),this.dynamicStagePromise.reject(b))},{once:!0}),this.mayAbandon=!0)}onStage(a,b){if(this.currentStage>=a)b();else if(3===a)this.runtimeStageListeners.push(b);else if(4===a)this.dynamicStageListeners.push(b);else throw Object.defineProperty(new g.InvariantError(`Invalid render stage: ${a}`),"__NEXT_ERROR_CODE",{value:"E881",enumerable:!1,configurable:!0})}canSyncInterrupt(){if(1===this.currentStage)return!1;let a=this.hasRuntimePrefetch?4:3;return this.currentStage<a}syncInterruptCurrentStageWithReason(a){if(1!==this.currentStage){if(this.mayAbandon)return this.abandonRenderImpl();switch(this.currentStage){case 2:this.staticInterruptReason=a,this.advanceStage(4);return;case 3:this.hasRuntimePrefetch&&(this.runtimeInterruptReason=a,this.advanceStage(4));return}}}getStaticInterruptReason(){return this.staticInterruptReason}getRuntimeInterruptReason(){return this.runtimeInterruptReason}getStaticStageEndTime(){return this.staticStageEndTime}getRuntimeStageEndTime(){return this.runtimeStageEndTime}abandonRender(){if(!this.mayAbandon)throw Object.defineProperty(new g.InvariantError("`abandonRender` called on a stage controller that cannot be abandoned."),"__NEXT_ERROR_CODE",{value:"E938",enumerable:!1,configurable:!0});this.abandonRenderImpl()}abandonRenderImpl(){let{currentStage:a}=this;switch(a){case 2:this.currentStage=5,this.resolveRuntimeStage();return;case 3:this.currentStage=5;return}}advanceStage(a){if(a<=this.currentStage)return;let b=this.currentStage;if(this.currentStage=a,b<3&&a>=3&&(this.staticStageEndTime=performance.now()+performance.timeOrigin,this.resolveRuntimeStage()),b<4&&a>=4){this.runtimeStageEndTime=performance.now()+performance.timeOrigin,this.resolveDynamicStage();return}}resolveRuntimeStage(){let a=this.runtimeStageListeners;for(let b=0;b<a.length;b++)a[b]();a.length=0,this.runtimeStagePromise.resolve()}resolveDynamicStage(){let a=this.dynamicStageListeners;for(let b=0;b<a.length;b++)a[b]();a.length=0,this.dynamicStagePromise.resolve()}getStagePromise(a){switch(a){case 3:return this.runtimeStagePromise.promise;case 4:return this.dynamicStagePromise.promise;default:throw Object.defineProperty(new g.InvariantError(`Invalid render stage: ${a}`),"__NEXT_ERROR_CODE",{value:"E881",enumerable:!1,configurable:!0})}}waitForStage(a){return this.getStagePromise(a)}delayUntilStage(a,b,c){var d,e,f;let g,h=(d=this.getStagePromise(a),e=b,f=c,g=new Promise((a,b)=>{d.then(a.bind(null,f),b)}),void 0!==e&&(g.displayName=e),g);return this.abortSignal&&h.catch(k),h}}function k(){}},81740,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"cookies",{enumerable:!0,get:function(){return n}});let d=a.r(14896),e=a.r(63681),f=a.r(56704),g=a.r(32319),h=a.r(60384),i=a.r(60312),j=a.r(13091),k=a.r(8018),l=a.r(86309),m=a.r(50640);function n(){let a="cookies",b=f.workAsyncStorage.getStore(),c=g.workUnitAsyncStorage.getStore();if(b){if(c&&"after"===c.phase&&!(0,l.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside \`after()\`. This is not supported. If you need this data inside an \`after()\` callback, use \`cookies()\` outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E843",enumerable:!1,configurable:!0});if(b.forceStatic)return p(d.RequestCookiesAdapter.seal(new e.RequestCookies(new Headers({}))));if(b.dynamicShouldError)throw Object.defineProperty(new i.StaticGenBailoutError(`Route ${b.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E849",enumerable:!1,configurable:!0});if(c)switch(c.type){case"cache":let f=Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`cookies()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E831",enumerable:!1,configurable:!0});throw Error.captureStackTrace(f,n),b.invalidDynamicUsageError??=f,f;case"unstable-cache":throw Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside a function cached with \`unstable_cache()\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`cookies()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E846",enumerable:!1,configurable:!0});case"prerender":var k=b,q=c;let g=o.get(q);if(g)return g;let r=(0,j.makeHangingPromise)(q.renderSignal,k.route,"`cookies()`");return o.set(q,r),r;case"prerender-client":let s="`cookies`";throw Object.defineProperty(new m.InvariantError(`${s} must not be used within a Client Component. Next.js should be preventing ${s} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E832",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,h.postponeWithTracking)(b.route,a,c.dynamicTracking);case"prerender-legacy":return(0,h.throwToInterruptStaticGeneration)(a,b,c);case"prerender-runtime":return(0,h.delayUntilRuntimeStage)(c,p(c.cookies));case"private-cache":return p(c.cookies);case"request":return(0,h.trackDynamicDataInDynamicRender)(c),p((0,d.areCookiesMutableInCurrentPhase)(c)?c.userspaceMutableCookies:c.cookies)}}(0,g.throwForMissingRequestStore)(a)}a.r(31382);let o=new WeakMap;function p(a){let b=o.get(a);if(b)return b;let c=Promise.resolve(a);return o.set(a,c),c}(0,k.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`cookies()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E830",enumerable:!1,configurable:!0})})},29927,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={HeadersAdapter:function(){return h},ReadonlyHeadersError:function(){return g}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(51409);class g extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new g}}class h extends Headers{constructor(a){super(),this.headers=new Proxy(a,{get(b,c,d){if("symbol"==typeof c)return f.ReflectAdapter.get(b,c,d);let e=c.toLowerCase(),g=Object.keys(a).find(a=>a.toLowerCase()===e);if(void 0!==g)return f.ReflectAdapter.get(b,g,d)},set(b,c,d,e){if("symbol"==typeof c)return f.ReflectAdapter.set(b,c,d,e);let g=c.toLowerCase(),h=Object.keys(a).find(a=>a.toLowerCase()===g);return f.ReflectAdapter.set(b,h??c,d,e)},has(b,c){if("symbol"==typeof c)return f.ReflectAdapter.has(b,c);let d=c.toLowerCase(),e=Object.keys(a).find(a=>a.toLowerCase()===d);return void 0!==e&&f.ReflectAdapter.has(b,e)},deleteProperty(b,c){if("symbol"==typeof c)return f.ReflectAdapter.deleteProperty(b,c);let d=c.toLowerCase(),e=Object.keys(a).find(a=>a.toLowerCase()===d);return void 0===e||f.ReflectAdapter.deleteProperty(b,e)}})}static seal(a){return new Proxy(a,{get(a,b,c){switch(b){case"append":case"delete":case"set":return g.callable;default:return f.ReflectAdapter.get(a,b,c)}}})}merge(a){return Array.isArray(a)?a.join(", "):a}static from(a){return a instanceof Headers?a:new h(a)}append(a,b){let c=this.headers[a];"string"==typeof c?this.headers[a]=[c,b]:Array.isArray(c)?c.push(b):this.headers[a]=b}delete(a){delete this.headers[a]}get(a){let b=this.headers[a];return void 0!==b?this.merge(b):null}has(a){return void 0!==this.headers[a]}set(a,b){this.headers[a]=b}forEach(a,b){for(let[c,d]of this.entries())a.call(b,d,c,this)}*entries(){for(let a of Object.keys(this.headers)){let b=a.toLowerCase(),c=this.get(b);yield[b,c]}}*keys(){for(let a of Object.keys(this.headers)){let b=a.toLowerCase();yield b}}*values(){for(let a of Object.keys(this.headers)){let b=this.get(a);yield b}}[Symbol.iterator](){return this.entries()}}},35754,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"headers",{enumerable:!0,get:function(){return m}});let d=a.r(29927),e=a.r(56704),f=a.r(32319),g=a.r(60384),h=a.r(60312),i=a.r(13091),j=a.r(8018),k=a.r(86309),l=a.r(50640);function m(){let a="headers",b=e.workAsyncStorage.getStore(),c=f.workUnitAsyncStorage.getStore();if(b){if(c&&"after"===c.phase&&!(0,k.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside \`after()\`. This is not supported. If you need this data inside an \`after()\` callback, use \`headers()\` outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E839",enumerable:!1,configurable:!0});if(b.forceStatic)return o(d.HeadersAdapter.seal(new Headers({})));if(c)switch(c.type){case"cache":{let a=Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`headers()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E833",enumerable:!1,configurable:!0});throw Error.captureStackTrace(a,m),b.invalidDynamicUsageError??=a,a}case"unstable-cache":throw Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside a function cached with \`unstable_cache()\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`headers()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E838",enumerable:!1,configurable:!0})}if(b.dynamicShouldError)throw Object.defineProperty(new h.StaticGenBailoutError(`Route ${b.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E828",enumerable:!1,configurable:!0});if(c)switch(c.type){case"prerender":var j=b,p=c;let e=n.get(p);if(e)return e;let f=(0,i.makeHangingPromise)(p.renderSignal,j.route,"`headers()`");return n.set(p,f),f;case"prerender-client":let q="`headers`";throw Object.defineProperty(new l.InvariantError(`${q} must not be used within a client component. Next.js should be preventing ${q} from being included in client components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E693",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,g.postponeWithTracking)(b.route,a,c.dynamicTracking);case"prerender-legacy":return(0,g.throwToInterruptStaticGeneration)(a,b,c);case"prerender-runtime":return(0,g.delayUntilRuntimeStage)(c,o(c.headers));case"private-cache":return o(c.headers);case"request":return(0,g.trackDynamicDataInDynamicRender)(c),o(c.headers)}}(0,f.throwForMissingRequestStore)(a)}a.r(31382);let n=new WeakMap;function o(a){let b=n.get(a);if(b)return b;let c=Promise.resolve(a);return n.set(a,c),c}(0,j.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`headers()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E836",enumerable:!1,configurable:!0})})},51125,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"draftMode",{enumerable:!0,get:function(){return k}});let d=a.r(32319),e=a.r(56704),f=a.r(60384),g=a.r(8018),h=a.r(60312),i=a.r(96556),j=a.r(50640);function k(){let a=e.workAsyncStorage.getStore(),b=d.workUnitAsyncStorage.getStore();switch((!a||!b)&&(0,d.throwForMissingRequestStore)("draftMode"),b.type){case"prerender-runtime":return(0,f.delayUntilRuntimeStage)(b,l(b.draftMode,a));case"request":return l(b.draftMode,a);case"cache":case"private-cache":case"unstable-cache":let c=(0,d.getDraftModeProviderForCacheScope)(a,b);if(c)return l(c,a);case"prerender":case"prerender-client":case"prerender-ppr":case"prerender-legacy":return l(null,a);default:return b}}function l(a,b){let c=n.get(a??m);return c||Promise.resolve(new o(a))}a.r(51409);let m={},n=new WeakMap;class o{constructor(a){this._provider=a}get isEnabled(){return null!==this._provider&&this._provider.isEnabled}enable(){p("draftMode().enable()",this.enable),null!==this._provider&&this._provider.enable()}disable(){p("draftMode().disable()",this.disable),null!==this._provider&&this._provider.disable()}}function p(a,b){let c=e.workAsyncStorage.getStore(),g=d.workUnitAsyncStorage.getStore();if(c){if((null==g?void 0:g.phase)==="after")throw Object.defineProperty(Error(`Route ${c.route} used "${a}" inside \`after()\`. The enabled status of \`draftMode()\` can be read inside \`after()\` but you cannot enable or disable \`draftMode()\`. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E845",enumerable:!1,configurable:!0});if(c.dynamicShouldError)throw Object.defineProperty(new h.StaticGenBailoutError(`Route ${c.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${a}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E553",enumerable:!1,configurable:!0});if(g)switch(g.type){case"cache":case"private-cache":{let d=Object.defineProperty(Error(`Route ${c.route} used "${a}" inside "use cache". The enabled status of \`draftMode()\` can be read in caches but you must not enable or disable \`draftMode()\` inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E829",enumerable:!1,configurable:!0});throw Error.captureStackTrace(d,b),c.invalidDynamicUsageError??=d,d}case"unstable-cache":throw Object.defineProperty(Error(`Route ${c.route} used "${a}" inside a function cached with \`unstable_cache()\`. The enabled status of \`draftMode()\` can be read in caches but you must not enable or disable \`draftMode()\` inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E844",enumerable:!1,configurable:!0});case"prerender":case"prerender-runtime":{let b=Object.defineProperty(Error(`Route ${c.route} used ${a} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`),"__NEXT_ERROR_CODE",{value:"E126",enumerable:!1,configurable:!0});return(0,f.abortAndThrowOnSynchronousRequestDataAccess)(c.route,a,b,g)}case"prerender-client":let d="`draftMode`";throw Object.defineProperty(new j.InvariantError(`${d} must not be used within a Client Component. Next.js should be preventing ${d} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E832",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,f.postponeWithTracking)(c.route,a,g.dynamicTracking);case"prerender-legacy":g.revalidate=0;let e=Object.defineProperty(new i.DynamicServerError(`Route ${c.route} couldn't be rendered statically because it used \`${a}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E558",enumerable:!1,configurable:!0});throw c.dynamicUsageDescription=a,c.dynamicUsageStack=e.stack,e;case"request":(0,f.trackDynamicDataInDynamicRender)(g)}}}(0,g.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`draftMode()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E835",enumerable:!1,configurable:!0})})},5246,(a,b,c)=>{b.exports.cookies=a.r(81740).cookies,b.exports.headers=a.r(35754).headers,b.exports.draftMode=a.r(51125).draftMode},20916,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ReadonlyURLSearchParams",{enumerable:!0,get:function(){return e}});class d extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams")}}class e extends URLSearchParams{append(){throw new d}delete(){throw new d}set(){throw new d}sort(){throw new d}}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},21170,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"RedirectStatusCode",{enumerable:!0,get:function(){return e}});var d,e=((d={})[d.SeeOther=303]="SeeOther",d[d.TemporaryRedirect=307]="TemporaryRedirect",d[d.PermanentRedirect=308]="PermanentRedirect",d);("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},28859,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d,e={REDIRECT_ERROR_CODE:function(){return h},RedirectType:function(){return i},isRedirectError:function(){return j}};for(var f in e)Object.defineProperty(c,f,{enumerable:!0,get:e[f]});let g=a.r(21170),h="NEXT_REDIRECT";var i=((d={}).push="push",d.replace="replace",d);function j(a){if("object"!=typeof a||null===a||!("digest"in a)||"string"!=typeof a.digest)return!1;let b=a.digest.split(";"),[c,d]=b,e=b.slice(2,-2).join(";"),f=Number(b.at(-2));return c===h&&("replace"===d||"push"===d)&&"string"==typeof e&&!isNaN(f)&&f in g.RedirectStatusCode}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},44868,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={getRedirectError:function(){return i},getRedirectStatusCodeFromError:function(){return n},getRedirectTypeFromError:function(){return m},getURLFromRedirectError:function(){return l},permanentRedirect:function(){return k},redirect:function(){return j}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(21170),g=a.r(28859),h=a.r(20635).actionAsyncStorage;function i(a,b,c=f.RedirectStatusCode.TemporaryRedirect){let d=Object.defineProperty(Error(g.REDIRECT_ERROR_CODE),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return d.digest=`${g.REDIRECT_ERROR_CODE};${b};${a};${c};`,d}function j(a,b){throw i(a,b??=h?.getStore()?.isAction?g.RedirectType.push:g.RedirectType.replace,f.RedirectStatusCode.TemporaryRedirect)}function k(a,b=g.RedirectType.replace){throw i(a,b,f.RedirectStatusCode.PermanentRedirect)}function l(a){return(0,g.isRedirectError)(a)?a.digest.split(";").slice(2,-2).join(";"):null}function m(a){if(!(0,g.isRedirectError)(a))throw Object.defineProperty(Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return a.digest.split(";",2)[1]}function n(a){if(!(0,g.isRedirectError)(a))throw Object.defineProperty(Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return Number(a.digest.split(";").at(-2))}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},89798,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={HTTPAccessErrorStatus:function(){return f},HTTP_ERROR_FALLBACK_ERROR_CODE:function(){return h},getAccessFallbackErrorTypeByStatus:function(){return k},getAccessFallbackHTTPStatus:function(){return j},isHTTPAccessFallbackError:function(){return i}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f={NOT_FOUND:404,FORBIDDEN:403,UNAUTHORIZED:401},g=new Set(Object.values(f)),h="NEXT_HTTP_ERROR_FALLBACK";function i(a){if("object"!=typeof a||null===a||!("digest"in a)||"string"!=typeof a.digest)return!1;let[b,c]=a.digest.split(";");return b===h&&g.has(Number(c))}function j(a){return Number(a.digest.split(";")[1])}function k(a){switch(a){case 401:return"unauthorized";case 403:return"forbidden";case 404:return"not-found";default:return}}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},16155,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"notFound",{enumerable:!0,get:function(){return f}});let d=a.r(89798),e=`${d.HTTP_ERROR_FALLBACK_ERROR_CODE};404`;function f(){let a=Object.defineProperty(Error(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});throw a.digest=e,a}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},34557,(a,b,c)=>{"use strict";function d(){throw Object.defineProperty(Error("`forbidden()` is experimental and only allowed to be enabled when `experimental.authInterrupts` is enabled."),"__NEXT_ERROR_CODE",{value:"E488",enumerable:!1,configurable:!0})}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"forbidden",{enumerable:!0,get:function(){return d}}),a.r(89798).HTTP_ERROR_FALLBACK_ERROR_CODE,("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},93845,(a,b,c)=>{"use strict";function d(){throw Object.defineProperty(Error("`unauthorized()` is experimental and only allowed to be used when `experimental.authInterrupts` is enabled."),"__NEXT_ERROR_CODE",{value:"E411",enumerable:!1,configurable:!0})}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"unauthorized",{enumerable:!0,get:function(){return d}}),a.r(89798).HTTP_ERROR_FALLBACK_ERROR_CODE,("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},73808,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"isPostpone",{enumerable:!0,get:function(){return e}});let d=Symbol.for("react.postpone");function e(a){return"object"==typeof a&&null!==a&&a.$$typeof===d}},1567,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"isNextRouterError",{enumerable:!0,get:function(){return f}});let d=a.r(89798),e=a.r(28859);function f(a){return(0,e.isRedirectError)(a)||(0,d.isHTTPAccessFallbackError)(a)}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},94783,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"unstable_rethrow",{enumerable:!0,get:function(){return function a(b){if((0,g.isNextRouterError)(b)||(0,f.isBailoutToCSRError)(b)||(0,i.isDynamicServerError)(b)||(0,h.isDynamicPostpone)(b)||(0,e.isPostpone)(b)||(0,d.isHangingPromiseRejectionError)(b)||(0,h.isPrerenderInterruptedError)(b))throw b;b instanceof Error&&"cause"in b&&a(b.cause)}}});let d=a.r(13091),e=a.r(73808),f=a.r(49640),g=a.r(1567),h=a.r(60384),i=a.r(96556);("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},60968,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"unstable_rethrow",{enumerable:!0,get:function(){return d}});let d=a.r(94783).unstable_rethrow;("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},73727,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={ReadonlyURLSearchParams:function(){return f.ReadonlyURLSearchParams},RedirectType:function(){return h.RedirectType},forbidden:function(){return j.forbidden},notFound:function(){return i.notFound},permanentRedirect:function(){return g.permanentRedirect},redirect:function(){return g.redirect},unauthorized:function(){return k.unauthorized},unstable_isUnrecognizedActionError:function(){return m},unstable_rethrow:function(){return l.unstable_rethrow}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(20916),g=a.r(44868),h=a.r(28859),i=a.r(16155),j=a.r(34557),k=a.r(93845),l=a.r(60968);function m(){throw Object.defineProperty(Error("`unstable_isUnrecognizedActionError` can only be used on the client."),"__NEXT_ERROR_CODE",{value:"E776",enumerable:!1,configurable:!0})}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},73042,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/src/app/(desktop)/dashboard-client.tsx <module evaluation> from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/src/app/(desktop)/dashboard-client.tsx <module evaluation>","default")},92309,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/src/app/(desktop)/dashboard-client.tsx from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/src/app/(desktop)/dashboard-client.tsx","default")},3067,a=>{"use strict";a.i(73042);var b=a.i(92309);a.n(b)},95339,a=>{"use strict";var b=a.i(7997),c=a.i(5246),d=a.i(73727),e=a.i(3067);let f="community"!==(process.env.SPACES_TIER||process.env.NEXT_PUBLIC_TIER||("server"===process.env.NEXT_PUBLIC_EDITION?"federation":"community"));async function g(){return f&&((await (0,c.cookies)()).get("spaces-session")||(0,d.redirect)("/login")),(0,b.jsx)(e.default,{})}a.s(["default",()=>g,"dynamic",0,"force-dynamic"],95339)}];
4
+ - Rerun the production build with \`next build --debug-prerender\` to generate better stack traces.`))}function aa(a,b,c,d){if(d.syncDynamicErrorWithStack)throw _(a,d.syncDynamicErrorWithStack),new j.StaticGenBailoutError;if(0!==b){if(c.hasSuspenseAboveBody)return;let d=c.dynamicErrors;if(d.length>0){for(let b=0;b<d.length;b++)_(a,d[b]);throw new j.StaticGenBailoutError}if(c.hasDynamicViewport)throw console.error(`Route "${a.route}" has a \`generateViewport\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) without explicitly allowing fully dynamic rendering. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`),new j.StaticGenBailoutError;if(1===b)throw console.error(`Route "${a.route}" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.`),new j.StaticGenBailoutError}else if(!1===c.hasAllowedDynamic&&c.hasDynamicMetadata)throw console.error(`Route "${a.route}" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`),new j.StaticGenBailoutError}function ab(a,b,c){if(c.hasSuspenseAboveBody)return[];if(0!==b){let d=c.dynamicErrors;if(d.length>0)return d;if(1===b)return[Object.defineProperty(new q.InvariantError(`Route "${a.route}" did not produce a static shell and Next.js was unable to determine a reason.`),"__NEXT_ERROR_CODE",{value:"E936",enumerable:!1,configurable:!0})]}else if(!1===c.hasAllowedDynamic&&0===c.dynamicErrors.length&&c.dynamicMetadata)return[c.dynamicMetadata];return[]}function ac(a,b){return a.runtimeStagePromise?a.runtimeStagePromise.then(()=>b):b}},8018,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"createDedupedByCallsiteServerErrorLoggerDev",{enumerable:!0,get:function(){return i}});let d=function(a,b){if(a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=e(void 0);if(c&&c.has(a))return c.get(a);var d={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(d,g,h):d[g]=a[g]}return d.default=a,c&&c.set(a,d),d}(a.r(717));function e(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(e=function(a){return a?c:b})(a)}let f={current:null},g="function"==typeof d.cache?d.cache:a=>a,h=console.warn;function i(a){return function(...b){h(a(...b))}}g(a=>{try{h(f.current)}finally{f.current=null}})},86309,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={isRequestAPICallableInsideAfter:function(){return j},throwForSearchParamsAccessInUseCache:function(){return i},throwWithStaticGenerationBailoutErrorWithDynamicError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(60312),g=a.r(24725);function h(a,b){throw Object.defineProperty(new f.StaticGenBailoutError(`Route ${a} with \`dynamic = "error"\` couldn't be rendered statically because it used ${b}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E543",enumerable:!1,configurable:!0})}function i(a,b){let c=Object.defineProperty(Error(`Route ${a.route} used \`searchParams\` inside "use cache". Accessing dynamic request data inside a cache scope is not supported. If you need some search params inside a cached function await \`searchParams\` outside of the cached function and pass only the required search params as arguments to the cached function. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E842",enumerable:!1,configurable:!0});throw Error.captureStackTrace(c,b),a.invalidDynamicUsageError??=c,c}function j(){let a=g.afterTaskAsyncStorage.getStore();return(null==a?void 0:a.rootTaskSpawnPhase)==="action"}},28340,(a,b,c)=>{"use strict";function d(){let a,b,c=new Promise((c,d)=>{a=c,b=d});return{resolve:a,reject:b,promise:c}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"createPromiseWithResolvers",{enumerable:!0,get:function(){return d}})},31382,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d,e={RenderStage:function(){return i},StagedRenderingController:function(){return j}};for(var f in e)Object.defineProperty(c,f,{enumerable:!0,get:e[f]});let g=a.r(50640),h=a.r(28340);var i=((d={})[d.Before=1]="Before",d[d.Static=2]="Static",d[d.Runtime=3]="Runtime",d[d.Dynamic=4]="Dynamic",d[d.Abandoned=5]="Abandoned",d);class j{constructor(a=null,b){this.abortSignal=a,this.hasRuntimePrefetch=b,this.currentStage=1,this.staticInterruptReason=null,this.runtimeInterruptReason=null,this.staticStageEndTime=1/0,this.runtimeStageEndTime=1/0,this.runtimeStageListeners=[],this.dynamicStageListeners=[],this.runtimeStagePromise=(0,h.createPromiseWithResolvers)(),this.dynamicStagePromise=(0,h.createPromiseWithResolvers)(),this.mayAbandon=!1,a&&(a.addEventListener("abort",()=>{let{reason:b}=a;this.currentStage<3&&(this.runtimeStagePromise.promise.catch(k),this.runtimeStagePromise.reject(b)),(this.currentStage<4||5===this.currentStage)&&(this.dynamicStagePromise.promise.catch(k),this.dynamicStagePromise.reject(b))},{once:!0}),this.mayAbandon=!0)}onStage(a,b){if(this.currentStage>=a)b();else if(3===a)this.runtimeStageListeners.push(b);else if(4===a)this.dynamicStageListeners.push(b);else throw Object.defineProperty(new g.InvariantError(`Invalid render stage: ${a}`),"__NEXT_ERROR_CODE",{value:"E881",enumerable:!1,configurable:!0})}canSyncInterrupt(){if(1===this.currentStage)return!1;let a=this.hasRuntimePrefetch?4:3;return this.currentStage<a}syncInterruptCurrentStageWithReason(a){if(1!==this.currentStage){if(this.mayAbandon)return this.abandonRenderImpl();switch(this.currentStage){case 2:this.staticInterruptReason=a,this.advanceStage(4);return;case 3:this.hasRuntimePrefetch&&(this.runtimeInterruptReason=a,this.advanceStage(4));return}}}getStaticInterruptReason(){return this.staticInterruptReason}getRuntimeInterruptReason(){return this.runtimeInterruptReason}getStaticStageEndTime(){return this.staticStageEndTime}getRuntimeStageEndTime(){return this.runtimeStageEndTime}abandonRender(){if(!this.mayAbandon)throw Object.defineProperty(new g.InvariantError("`abandonRender` called on a stage controller that cannot be abandoned."),"__NEXT_ERROR_CODE",{value:"E938",enumerable:!1,configurable:!0});this.abandonRenderImpl()}abandonRenderImpl(){let{currentStage:a}=this;switch(a){case 2:this.currentStage=5,this.resolveRuntimeStage();return;case 3:this.currentStage=5;return}}advanceStage(a){if(a<=this.currentStage)return;let b=this.currentStage;if(this.currentStage=a,b<3&&a>=3&&(this.staticStageEndTime=performance.now()+performance.timeOrigin,this.resolveRuntimeStage()),b<4&&a>=4){this.runtimeStageEndTime=performance.now()+performance.timeOrigin,this.resolveDynamicStage();return}}resolveRuntimeStage(){let a=this.runtimeStageListeners;for(let b=0;b<a.length;b++)a[b]();a.length=0,this.runtimeStagePromise.resolve()}resolveDynamicStage(){let a=this.dynamicStageListeners;for(let b=0;b<a.length;b++)a[b]();a.length=0,this.dynamicStagePromise.resolve()}getStagePromise(a){switch(a){case 3:return this.runtimeStagePromise.promise;case 4:return this.dynamicStagePromise.promise;default:throw Object.defineProperty(new g.InvariantError(`Invalid render stage: ${a}`),"__NEXT_ERROR_CODE",{value:"E881",enumerable:!1,configurable:!0})}}waitForStage(a){return this.getStagePromise(a)}delayUntilStage(a,b,c){var d,e,f;let g,h=(d=this.getStagePromise(a),e=b,f=c,g=new Promise((a,b)=>{d.then(a.bind(null,f),b)}),void 0!==e&&(g.displayName=e),g);return this.abortSignal&&h.catch(k),h}}function k(){}},81740,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"cookies",{enumerable:!0,get:function(){return n}});let d=a.r(14896),e=a.r(63681),f=a.r(56704),g=a.r(32319),h=a.r(60384),i=a.r(60312),j=a.r(13091),k=a.r(8018),l=a.r(86309),m=a.r(50640);function n(){let a="cookies",b=f.workAsyncStorage.getStore(),c=g.workUnitAsyncStorage.getStore();if(b){if(c&&"after"===c.phase&&!(0,l.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside \`after()\`. This is not supported. If you need this data inside an \`after()\` callback, use \`cookies()\` outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E843",enumerable:!1,configurable:!0});if(b.forceStatic)return p(d.RequestCookiesAdapter.seal(new e.RequestCookies(new Headers({}))));if(b.dynamicShouldError)throw Object.defineProperty(new i.StaticGenBailoutError(`Route ${b.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E849",enumerable:!1,configurable:!0});if(c)switch(c.type){case"cache":let f=Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`cookies()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E831",enumerable:!1,configurable:!0});throw Error.captureStackTrace(f,n),b.invalidDynamicUsageError??=f,f;case"unstable-cache":throw Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside a function cached with \`unstable_cache()\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`cookies()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E846",enumerable:!1,configurable:!0});case"prerender":var k=b,q=c;let g=o.get(q);if(g)return g;let r=(0,j.makeHangingPromise)(q.renderSignal,k.route,"`cookies()`");return o.set(q,r),r;case"prerender-client":let s="`cookies`";throw Object.defineProperty(new m.InvariantError(`${s} must not be used within a Client Component. Next.js should be preventing ${s} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E832",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,h.postponeWithTracking)(b.route,a,c.dynamicTracking);case"prerender-legacy":return(0,h.throwToInterruptStaticGeneration)(a,b,c);case"prerender-runtime":return(0,h.delayUntilRuntimeStage)(c,p(c.cookies));case"private-cache":return p(c.cookies);case"request":return(0,h.trackDynamicDataInDynamicRender)(c),p((0,d.areCookiesMutableInCurrentPhase)(c)?c.userspaceMutableCookies:c.cookies)}}(0,g.throwForMissingRequestStore)(a)}a.r(31382);let o=new WeakMap;function p(a){let b=o.get(a);if(b)return b;let c=Promise.resolve(a);return o.set(a,c),c}(0,k.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`cookies()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E830",enumerable:!1,configurable:!0})})},29927,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={HeadersAdapter:function(){return h},ReadonlyHeadersError:function(){return g}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(51409);class g extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new g}}class h extends Headers{constructor(a){super(),this.headers=new Proxy(a,{get(b,c,d){if("symbol"==typeof c)return f.ReflectAdapter.get(b,c,d);let e=c.toLowerCase(),g=Object.keys(a).find(a=>a.toLowerCase()===e);if(void 0!==g)return f.ReflectAdapter.get(b,g,d)},set(b,c,d,e){if("symbol"==typeof c)return f.ReflectAdapter.set(b,c,d,e);let g=c.toLowerCase(),h=Object.keys(a).find(a=>a.toLowerCase()===g);return f.ReflectAdapter.set(b,h??c,d,e)},has(b,c){if("symbol"==typeof c)return f.ReflectAdapter.has(b,c);let d=c.toLowerCase(),e=Object.keys(a).find(a=>a.toLowerCase()===d);return void 0!==e&&f.ReflectAdapter.has(b,e)},deleteProperty(b,c){if("symbol"==typeof c)return f.ReflectAdapter.deleteProperty(b,c);let d=c.toLowerCase(),e=Object.keys(a).find(a=>a.toLowerCase()===d);return void 0===e||f.ReflectAdapter.deleteProperty(b,e)}})}static seal(a){return new Proxy(a,{get(a,b,c){switch(b){case"append":case"delete":case"set":return g.callable;default:return f.ReflectAdapter.get(a,b,c)}}})}merge(a){return Array.isArray(a)?a.join(", "):a}static from(a){return a instanceof Headers?a:new h(a)}append(a,b){let c=this.headers[a];"string"==typeof c?this.headers[a]=[c,b]:Array.isArray(c)?c.push(b):this.headers[a]=b}delete(a){delete this.headers[a]}get(a){let b=this.headers[a];return void 0!==b?this.merge(b):null}has(a){return void 0!==this.headers[a]}set(a,b){this.headers[a]=b}forEach(a,b){for(let[c,d]of this.entries())a.call(b,d,c,this)}*entries(){for(let a of Object.keys(this.headers)){let b=a.toLowerCase(),c=this.get(b);yield[b,c]}}*keys(){for(let a of Object.keys(this.headers)){let b=a.toLowerCase();yield b}}*values(){for(let a of Object.keys(this.headers)){let b=this.get(a);yield b}}[Symbol.iterator](){return this.entries()}}},35754,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"headers",{enumerable:!0,get:function(){return m}});let d=a.r(29927),e=a.r(56704),f=a.r(32319),g=a.r(60384),h=a.r(60312),i=a.r(13091),j=a.r(8018),k=a.r(86309),l=a.r(50640);function m(){let a="headers",b=e.workAsyncStorage.getStore(),c=f.workUnitAsyncStorage.getStore();if(b){if(c&&"after"===c.phase&&!(0,k.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside \`after()\`. This is not supported. If you need this data inside an \`after()\` callback, use \`headers()\` outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E839",enumerable:!1,configurable:!0});if(b.forceStatic)return o(d.HeadersAdapter.seal(new Headers({})));if(c)switch(c.type){case"cache":{let a=Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`headers()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E833",enumerable:!1,configurable:!0});throw Error.captureStackTrace(a,m),b.invalidDynamicUsageError??=a,a}case"unstable-cache":throw Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside a function cached with \`unstable_cache()\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`headers()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E838",enumerable:!1,configurable:!0})}if(b.dynamicShouldError)throw Object.defineProperty(new h.StaticGenBailoutError(`Route ${b.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E828",enumerable:!1,configurable:!0});if(c)switch(c.type){case"prerender":var j=b,p=c;let e=n.get(p);if(e)return e;let f=(0,i.makeHangingPromise)(p.renderSignal,j.route,"`headers()`");return n.set(p,f),f;case"prerender-client":let q="`headers`";throw Object.defineProperty(new l.InvariantError(`${q} must not be used within a client component. Next.js should be preventing ${q} from being included in client components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E693",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,g.postponeWithTracking)(b.route,a,c.dynamicTracking);case"prerender-legacy":return(0,g.throwToInterruptStaticGeneration)(a,b,c);case"prerender-runtime":return(0,g.delayUntilRuntimeStage)(c,o(c.headers));case"private-cache":return o(c.headers);case"request":return(0,g.trackDynamicDataInDynamicRender)(c),o(c.headers)}}(0,f.throwForMissingRequestStore)(a)}a.r(31382);let n=new WeakMap;function o(a){let b=n.get(a);if(b)return b;let c=Promise.resolve(a);return n.set(a,c),c}(0,j.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`headers()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E836",enumerable:!1,configurable:!0})})},51125,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"draftMode",{enumerable:!0,get:function(){return k}});let d=a.r(32319),e=a.r(56704),f=a.r(60384),g=a.r(8018),h=a.r(60312),i=a.r(96556),j=a.r(50640);function k(){let a=e.workAsyncStorage.getStore(),b=d.workUnitAsyncStorage.getStore();switch((!a||!b)&&(0,d.throwForMissingRequestStore)("draftMode"),b.type){case"prerender-runtime":return(0,f.delayUntilRuntimeStage)(b,l(b.draftMode,a));case"request":return l(b.draftMode,a);case"cache":case"private-cache":case"unstable-cache":let c=(0,d.getDraftModeProviderForCacheScope)(a,b);if(c)return l(c,a);case"prerender":case"prerender-client":case"prerender-ppr":case"prerender-legacy":return l(null,a);default:return b}}function l(a,b){let c=n.get(a??m);return c||Promise.resolve(new o(a))}a.r(51409);let m={},n=new WeakMap;class o{constructor(a){this._provider=a}get isEnabled(){return null!==this._provider&&this._provider.isEnabled}enable(){p("draftMode().enable()",this.enable),null!==this._provider&&this._provider.enable()}disable(){p("draftMode().disable()",this.disable),null!==this._provider&&this._provider.disable()}}function p(a,b){let c=e.workAsyncStorage.getStore(),g=d.workUnitAsyncStorage.getStore();if(c){if((null==g?void 0:g.phase)==="after")throw Object.defineProperty(Error(`Route ${c.route} used "${a}" inside \`after()\`. The enabled status of \`draftMode()\` can be read inside \`after()\` but you cannot enable or disable \`draftMode()\`. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E845",enumerable:!1,configurable:!0});if(c.dynamicShouldError)throw Object.defineProperty(new h.StaticGenBailoutError(`Route ${c.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${a}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E553",enumerable:!1,configurable:!0});if(g)switch(g.type){case"cache":case"private-cache":{let d=Object.defineProperty(Error(`Route ${c.route} used "${a}" inside "use cache". The enabled status of \`draftMode()\` can be read in caches but you must not enable or disable \`draftMode()\` inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E829",enumerable:!1,configurable:!0});throw Error.captureStackTrace(d,b),c.invalidDynamicUsageError??=d,d}case"unstable-cache":throw Object.defineProperty(Error(`Route ${c.route} used "${a}" inside a function cached with \`unstable_cache()\`. The enabled status of \`draftMode()\` can be read in caches but you must not enable or disable \`draftMode()\` inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E844",enumerable:!1,configurable:!0});case"prerender":case"prerender-runtime":{let b=Object.defineProperty(Error(`Route ${c.route} used ${a} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`),"__NEXT_ERROR_CODE",{value:"E126",enumerable:!1,configurable:!0});return(0,f.abortAndThrowOnSynchronousRequestDataAccess)(c.route,a,b,g)}case"prerender-client":let d="`draftMode`";throw Object.defineProperty(new j.InvariantError(`${d} must not be used within a Client Component. Next.js should be preventing ${d} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E832",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,f.postponeWithTracking)(c.route,a,g.dynamicTracking);case"prerender-legacy":g.revalidate=0;let e=Object.defineProperty(new i.DynamicServerError(`Route ${c.route} couldn't be rendered statically because it used \`${a}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E558",enumerable:!1,configurable:!0});throw c.dynamicUsageDescription=a,c.dynamicUsageStack=e.stack,e;case"request":(0,f.trackDynamicDataInDynamicRender)(g)}}}(0,g.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`draftMode()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E835",enumerable:!1,configurable:!0})})},5246,(a,b,c)=>{b.exports.cookies=a.r(81740).cookies,b.exports.headers=a.r(35754).headers,b.exports.draftMode=a.r(51125).draftMode},20916,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ReadonlyURLSearchParams",{enumerable:!0,get:function(){return e}});class d extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams")}}class e extends URLSearchParams{append(){throw new d}delete(){throw new d}set(){throw new d}sort(){throw new d}}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},21170,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"RedirectStatusCode",{enumerable:!0,get:function(){return e}});var d,e=((d={})[d.SeeOther=303]="SeeOther",d[d.TemporaryRedirect=307]="TemporaryRedirect",d[d.PermanentRedirect=308]="PermanentRedirect",d);("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},28859,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d,e={REDIRECT_ERROR_CODE:function(){return h},RedirectType:function(){return i},isRedirectError:function(){return j}};for(var f in e)Object.defineProperty(c,f,{enumerable:!0,get:e[f]});let g=a.r(21170),h="NEXT_REDIRECT";var i=((d={}).push="push",d.replace="replace",d);function j(a){if("object"!=typeof a||null===a||!("digest"in a)||"string"!=typeof a.digest)return!1;let b=a.digest.split(";"),[c,d]=b,e=b.slice(2,-2).join(";"),f=Number(b.at(-2));return c===h&&("replace"===d||"push"===d)&&"string"==typeof e&&!isNaN(f)&&f in g.RedirectStatusCode}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},44868,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={getRedirectError:function(){return i},getRedirectStatusCodeFromError:function(){return n},getRedirectTypeFromError:function(){return m},getURLFromRedirectError:function(){return l},permanentRedirect:function(){return k},redirect:function(){return j}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(21170),g=a.r(28859),h=a.r(20635).actionAsyncStorage;function i(a,b,c=f.RedirectStatusCode.TemporaryRedirect){let d=Object.defineProperty(Error(g.REDIRECT_ERROR_CODE),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return d.digest=`${g.REDIRECT_ERROR_CODE};${b};${a};${c};`,d}function j(a,b){throw i(a,b??=h?.getStore()?.isAction?g.RedirectType.push:g.RedirectType.replace,f.RedirectStatusCode.TemporaryRedirect)}function k(a,b=g.RedirectType.replace){throw i(a,b,f.RedirectStatusCode.PermanentRedirect)}function l(a){return(0,g.isRedirectError)(a)?a.digest.split(";").slice(2,-2).join(";"):null}function m(a){if(!(0,g.isRedirectError)(a))throw Object.defineProperty(Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return a.digest.split(";",2)[1]}function n(a){if(!(0,g.isRedirectError)(a))throw Object.defineProperty(Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return Number(a.digest.split(";").at(-2))}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},89798,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={HTTPAccessErrorStatus:function(){return f},HTTP_ERROR_FALLBACK_ERROR_CODE:function(){return h},getAccessFallbackErrorTypeByStatus:function(){return k},getAccessFallbackHTTPStatus:function(){return j},isHTTPAccessFallbackError:function(){return i}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f={NOT_FOUND:404,FORBIDDEN:403,UNAUTHORIZED:401},g=new Set(Object.values(f)),h="NEXT_HTTP_ERROR_FALLBACK";function i(a){if("object"!=typeof a||null===a||!("digest"in a)||"string"!=typeof a.digest)return!1;let[b,c]=a.digest.split(";");return b===h&&g.has(Number(c))}function j(a){return Number(a.digest.split(";")[1])}function k(a){switch(a){case 401:return"unauthorized";case 403:return"forbidden";case 404:return"not-found";default:return}}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},16155,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"notFound",{enumerable:!0,get:function(){return f}});let d=a.r(89798),e=`${d.HTTP_ERROR_FALLBACK_ERROR_CODE};404`;function f(){let a=Object.defineProperty(Error(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});throw a.digest=e,a}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},34557,(a,b,c)=>{"use strict";function d(){throw Object.defineProperty(Error("`forbidden()` is experimental and only allowed to be enabled when `experimental.authInterrupts` is enabled."),"__NEXT_ERROR_CODE",{value:"E488",enumerable:!1,configurable:!0})}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"forbidden",{enumerable:!0,get:function(){return d}}),a.r(89798).HTTP_ERROR_FALLBACK_ERROR_CODE,("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},93845,(a,b,c)=>{"use strict";function d(){throw Object.defineProperty(Error("`unauthorized()` is experimental and only allowed to be used when `experimental.authInterrupts` is enabled."),"__NEXT_ERROR_CODE",{value:"E411",enumerable:!1,configurable:!0})}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"unauthorized",{enumerable:!0,get:function(){return d}}),a.r(89798).HTTP_ERROR_FALLBACK_ERROR_CODE,("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},73808,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"isPostpone",{enumerable:!0,get:function(){return e}});let d=Symbol.for("react.postpone");function e(a){return"object"==typeof a&&null!==a&&a.$$typeof===d}},1567,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"isNextRouterError",{enumerable:!0,get:function(){return f}});let d=a.r(89798),e=a.r(28859);function f(a){return(0,e.isRedirectError)(a)||(0,d.isHTTPAccessFallbackError)(a)}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},94783,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"unstable_rethrow",{enumerable:!0,get:function(){return function a(b){if((0,g.isNextRouterError)(b)||(0,f.isBailoutToCSRError)(b)||(0,i.isDynamicServerError)(b)||(0,h.isDynamicPostpone)(b)||(0,e.isPostpone)(b)||(0,d.isHangingPromiseRejectionError)(b)||(0,h.isPrerenderInterruptedError)(b))throw b;b instanceof Error&&"cause"in b&&a(b.cause)}}});let d=a.r(13091),e=a.r(73808),f=a.r(49640),g=a.r(1567),h=a.r(60384),i=a.r(96556);("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},60968,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"unstable_rethrow",{enumerable:!0,get:function(){return d}});let d=a.r(94783).unstable_rethrow;("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},73727,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={ReadonlyURLSearchParams:function(){return f.ReadonlyURLSearchParams},RedirectType:function(){return h.RedirectType},forbidden:function(){return j.forbidden},notFound:function(){return i.notFound},permanentRedirect:function(){return g.permanentRedirect},redirect:function(){return g.redirect},unauthorized:function(){return k.unauthorized},unstable_isUnrecognizedActionError:function(){return m},unstable_rethrow:function(){return l.unstable_rethrow}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(20916),g=a.r(44868),h=a.r(28859),i=a.r(16155),j=a.r(34557),k=a.r(93845),l=a.r(60968);function m(){throw Object.defineProperty(Error("`unstable_isUnrecognizedActionError` can only be used on the client."),"__NEXT_ERROR_CODE",{value:"E776",enumerable:!1,configurable:!0})}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},73042,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/src/app/(desktop)/dashboard-client.tsx <module evaluation> from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/src/app/(desktop)/dashboard-client.tsx <module evaluation>","default")},92309,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/src/app/(desktop)/dashboard-client.tsx from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/src/app/(desktop)/dashboard-client.tsx","default")},3067,a=>{"use strict";a.i(73042);var b=a.i(92309);a.n(b)},95339,a=>{"use strict";var b=a.i(7997),c=a.i(5246),d=a.i(73727),e=a.i(3067);let f=process.env.SPACES_TIER||process.env.NEXT_PUBLIC_TIER||("server"===process.env.NEXT_PUBLIC_EDITION?"federation":"community"),g="team"===f||"federation"===f;async function h(){return g&&((await (0,c.cookies)()).get("spaces-session")||(0,d.redirect)("/login")),(0,b.jsx)(e.default,{})}a.s(["default",()=>h,"dynamic",0,"force-dynamic"],95339)}];
5
5
 
6
6
  //# sourceMappingURL=_5ac43c5d._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[96221,a=>{"use strict";let b=(0,a.i(70106).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);a.s(["Loader2",()=>b],96221)},59603,a=>{"use strict";var b=a.i(33217),c=a.i(70025),d=a.i(37927),e=a.i(19032);function f(a={}){return(0,b.useQuery)({queryKey:["sessions",a],queryFn:async()=>{let b=new URLSearchParams;return a.projectId&&b.set("projectId",a.projectId),void 0!==a.starred&&b.set("starred",String(a.starred)),a.search&&b.set("search",a.search),a.agentType&&b.set("agentType",a.agentType),a.sortBy&&b.set("sortBy",a.sortBy),a.sortDir&&b.set("sortDir",a.sortDir),void 0!==a.offset&&b.set("offset",String(a.offset)),void 0!==a.limit&&b.set("limit",String(a.limit)),"all"===a.nodeFilter&&b.set("nodes","all"),(await fetch((0,e.api)(`/api/sessions?${b}`))).json()}})}function g(a){return(0,b.useQuery)({queryKey:["session",a],queryFn:async()=>{let b=await fetch((0,e.api)(`/api/sessions/${a}`));if(!b.ok)throw Error("Session not found");return b.json()},enabled:!!a})}function h(a,c=0,d=50,f){return(0,b.useQuery)({queryKey:["messages",a,c,d,f],queryFn:async()=>{let b=f?(0,e.api)(`/api/network/proxy/${f}/sessions/${a}/messages?offset=${c}&limit=${d}`):(0,e.api)(`/api/sessions/${a}/messages?offset=${c}&limit=${d}`);return(await fetch(b)).json()},enabled:!!a})}function i(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async a=>(await fetch((0,e.api)(`/api/sessions/${a}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"star"})})).json(),onSuccess:()=>{a.invalidateQueries({queryKey:["sessions"]}),a.invalidateQueries({queryKey:["session"]})}})}function j(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async({sessionId:a,notes:b})=>(await fetch((0,e.api)(`/api/sessions/${a}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"notes",notes:b})})).json(),onSuccess:()=>{a.invalidateQueries({queryKey:["session"]})}})}function k(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async({sessionId:a,tagName:b})=>(await fetch((0,e.api)(`/api/sessions/${a}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"tag",tagName:b})})).json(),onSuccess:()=>{a.invalidateQueries({queryKey:["sessions"]}),a.invalidateQueries({queryKey:["session"]}),a.invalidateQueries({queryKey:["tags"]})}})}function l(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async({sessionId:a,tagName:b})=>(await fetch((0,e.api)(`/api/sessions/${a}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"removeTag",tagName:b})})).json(),onSuccess:()=>{a.invalidateQueries({queryKey:["sessions"]}),a.invalidateQueries({queryKey:["session"]}),a.invalidateQueries({queryKey:["tags"]})}})}function m(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async({sessionId:a,name:b})=>(await fetch((0,e.api)(`/api/sessions/${a}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"rename",name:b})})).json(),onSuccess:()=>{a.invalidateQueries({queryKey:["sessions"]}),a.invalidateQueries({queryKey:["session"]})}})}function n(){return(0,b.useQuery)({queryKey:["tags"],queryFn:async()=>(await fetch((0,e.api)("/api/tags"))).json()})}function o(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async a=>(await fetch((0,e.api)("/api/tags"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"delete",tagId:a})})).json(),onSuccess:()=>{a.invalidateQueries({queryKey:["tags"]}),a.invalidateQueries({queryKey:["sessions"]}),a.invalidateQueries({queryKey:["session"]})}})}function p(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async({tagId:a,color:b})=>(await fetch((0,e.api)("/api/tags"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"updateColor",tagId:a,color:b})})).json(),onSuccess:()=>{a.invalidateQueries({queryKey:["tags"]}),a.invalidateQueries({queryKey:["sessions"]}),a.invalidateQueries({queryKey:["session"]})}})}function q(){return(0,b.useQuery)({queryKey:["workspaces"],queryFn:async()=>(await fetch((0,e.api)("/api/workspaces"))).json()})}function r(){return(0,b.useQuery)({queryKey:["workspaces","remote"],queryFn:async()=>(await fetch((0,e.api)("/api/workspaces?nodes=all"))).json()})}function s(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async({workspaceId:a,sessionId:b,nodeId:c,title:d,cwd:f,agentType:g})=>{let h=await fetch((0,e.api)(`/api/workspaces/${a}/sessions`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:b,nodeId:c,title:d,cwd:f,agentType:g})});if(!h.ok)throw Error("Failed to add session to workspace");return h.json()},onSuccess:()=>{a.invalidateQueries({queryKey:["workspaces"]}),a.invalidateQueries({queryKey:["workspace-sessions"]}),a.invalidateQueries({queryKey:["sessions"]}),a.invalidateQueries({queryKey:["session"]})}})}function t(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async({workspaceId:a,sessionId:b})=>{let c=await fetch((0,e.api)(`/api/workspaces/${a}/sessions`),{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:b})});if(!c.ok)throw Error("Failed to remove session from workspace");return c.json()},onSuccess:()=>{a.invalidateQueries({queryKey:["workspaces"]}),a.invalidateQueries({queryKey:["workspace-sessions"]}),a.invalidateQueries({queryKey:["sessions"]}),a.invalidateQueries({queryKey:["session"]})}})}function u(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async a=>(await fetch((0,e.api)("/api/bulk"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).json(),onSuccess:()=>{a.invalidateQueries({queryKey:["sessions"]}),a.invalidateQueries({queryKey:["workspaces"]}),a.invalidateQueries({queryKey:["tags"]})}})}function v(){return(0,b.useQuery)({queryKey:["projects"],queryFn:async()=>(await fetch((0,e.api)("/api/projects"))).json()})}function w(){return(0,b.useQuery)({queryKey:["analytics"],queryFn:async()=>(await fetch((0,e.api)("/api/analytics/overview"))).json()})}function x(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async()=>(await fetch((0,e.api)("/api/sync"),{method:"POST"})).json(),onSuccess:()=>{a.invalidateQueries()}})}a.s(["useAddSessionToWorkspace",()=>s,"useAddTag",()=>k,"useAnalytics",()=>w,"useBulkAction",()=>u,"useDeleteTag",()=>o,"useMessages",()=>h,"useProjects",()=>v,"useRemoteWorkspaces",()=>r,"useRemoveSessionFromWorkspace",()=>t,"useRemoveTag",()=>l,"useRenameSession",()=>m,"useSession",()=>g,"useSessions",()=>f,"useSync",()=>x,"useTags",()=>n,"useToggleStar",()=>i,"useUpdateNotes",()=>j,"useUpdateTagColor",()=>p,"useWorkspaces",()=>q])},210,a=>{"use strict";let b=(0,a.i(70106).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);a.s(["ArrowLeft",()=>b],210)},17299,a=>{"use strict";var b=a.i(87924),c=a.i(50944),d=a.i(210),e=a.i(68114);function f({title:a,showBack:f,backHref:g,right:h,className:i}){let j=(0,c.useRouter)();return(0,b.jsxs)("header",{className:(0,e.cn)("sticky top-0 z-40 bg-zinc-950/95 backdrop-blur-sm border-b border-zinc-800","flex items-center gap-3 px-4 h-14 flex-shrink-0",i),children:[f&&(0,b.jsx)("button",{onClick:()=>{g?j.push(g):j.back()},className:"p-1 -ml-1 text-zinc-400 hover:text-white",children:(0,b.jsx)(d.ArrowLeft,{className:"w-5 h-5"})}),(0,b.jsx)("h1",{className:"text-base font-semibold truncate flex-1",children:a}),h&&(0,b.jsx)("div",{className:"flex items-center gap-2 flex-shrink-0",children:h})]})}a.s(["MobileHeader",()=>f])},39761,a=>{"use strict";let b=(0,a.i(70106).default)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);a.s(["BarChart3",()=>b],39761)},20005,a=>{"use strict";let b=(0,a.i(70106).default)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);a.s(["LogOut",()=>b],20005)},33508,a=>{"use strict";let b=(0,a.i(70106).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);a.s(["X",()=>b],33508)},15618,a=>{"use strict";let b=(0,a.i(70106).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);a.s(["Plus",()=>b],15618)},69520,a=>{"use strict";let b=(0,a.i(70106).default)("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"}]]);a.s(["RefreshCw",()=>b],69520)},3314,a=>{"use strict";let b=(0,a.i(70106).default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);a.s(["Shield",()=>b],3314)},67453,63572,a=>{"use strict";var b=a.i(70106);let c=(0,b.default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);a.s(["CheckCircle2",()=>c],67453);let d=(0,b.default)("folder-code",[["path",{d:"M10 10.5 8 13l2 2.5",key:"m4t9c1"}],["path",{d:"m14 10.5 2 2.5-2 2.5",key:"14w2eb"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2z",key:"1u1bxd"}]]);a.s(["FolderCode",()=>d],63572)},61552,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(59603),e=a.i(50944),f=a.i(17299),g=a.i(69520),h=a.i(96101),i=a.i(96221),j=a.i(3314),k=a.i(67453),l=a.i(39761),m=a.i(21161),n=a.i(20005),o=a.i(15618),p=a.i(33508),q=a.i(63572),r=a.i(19032),s=a.i(58037),t=a.i(97498);function u(){let{hasAuth:a}=(0,t.useTier)(),u=(0,e.useRouter)(),v=(0,d.useSync)(),[w,x]=(0,c.useState)(""),[y,z]=(0,c.useState)([]),[A,B]=(0,c.useState)(""),[C,D]=(0,c.useState)(!1),[E,F]=(0,c.useState)(!0);(0,c.useEffect)(()=>{fetch((0,r.api)("/api/config")).then(a=>a.json()).then(a=>{D(a.telemetryOptOut),z(a.devDirectories||[]),F(!1)}).catch(()=>F(!1))},[]);let G=async a=>{z(a),await fetch((0,r.api)("/api/config"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({devDirectories:a})})},H=()=>{let a=A.trim();!a||y.includes(a)||(a.startsWith("/")||/^[A-Za-z]:[\\/]/.test(a))&&(G([...y,a]),B(""))},I=async()=>{let a=await v.mutateAsync();x(`Synced ${a.projects} projects, ${a.sessions} sessions`)},J=async()=>{let a=!C;D(a),(0,s.setOptOut)(a),await fetch((0,r.api)("/api/config"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({telemetryOptOut:a})})},K=async()=>{await fetch((0,r.api)("/api/auth/logout"),{method:"POST"}),u.push("/login")};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f.MobileHeader,{title:"Settings"}),(0,b.jsxs)("div",{className:"px-4 py-4 space-y-4",children:[a&&(0,b.jsxs)("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-4",children:[(0,b.jsxs)("h3",{className:"text-sm font-semibold flex items-center gap-2 mb-2",children:[(0,b.jsx)(j.Shield,{className:"w-4 h-4"}),"Terminal Security"]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(k.CheckCircle2,{className:"w-4 h-4 text-green-500"}),(0,b.jsx)("span",{className:"text-xs text-green-500",children:"2FA Enabled"})]}),(0,b.jsx)("p",{className:"text-[11px] text-zinc-500 mt-1.5",children:"2FA is managed through the login flow."})]}),(0,b.jsxs)("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-4",children:[(0,b.jsxs)("h3",{className:"text-sm font-semibold flex items-center gap-2 mb-2",children:[(0,b.jsx)(h.FolderOpen,{className:"w-4 h-4"}),"Data Source"]}),(0,b.jsxs)("div",{className:"space-y-2 text-xs",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-zinc-500",children:"Agent Data:"}),(0,b.jsx)("span",{className:"font-mono ml-2",children:"~/.claude/ ~/.codex/ ~/.gemini/"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-zinc-500",children:"Database:"}),(0,b.jsx)("span",{className:"font-mono ml-2",children:"~/.spaces/spaces.db"})]})]})]}),(0,b.jsxs)("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-4",children:[(0,b.jsxs)("h3",{className:"text-sm font-semibold flex items-center gap-2 mb-2",children:[(0,b.jsx)(q.FolderCode,{className:"w-4 h-4"}),"Dev Directories"]}),(0,b.jsx)("p",{className:"text-[11px] text-zinc-500 mb-3",children:"Restrict pane creation to these project roots."}),y.length>0&&(0,b.jsx)("div",{className:"space-y-1.5 mb-3",children:y.map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-2 px-2.5 py-1.5 bg-zinc-800 rounded-md",children:[(0,b.jsx)(h.FolderOpen,{className:"w-3 h-3 text-amber-500/70 flex-shrink-0"}),(0,b.jsx)("span",{className:"font-mono text-[11px] flex-1 truncate",children:a}),(0,b.jsx)("button",{onClick:()=>{G(y.filter(b=>b!==a))},className:"text-zinc-500 hover:text-red-400",children:(0,b.jsx)(p.X,{className:"w-3 h-3"})})]},a))}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{type:"text",placeholder:"u">typeof navigator&&navigator.platform?.startsWith("Win")?"C:\\Users\\you\\projects":"/home/user/projects",value:A,onChange:a=>B(a.target.value),onKeyDown:a=>"Enter"===a.key&&H(),className:"flex-1 px-2.5 py-1.5 text-xs bg-zinc-800 border border-zinc-700 rounded-md focus:outline-none focus:border-indigo-500 font-mono"}),(0,b.jsxs)("button",{onClick:H,disabled:!A.trim()||!(A.trim().startsWith("/")||/^[A-Za-z]:[\\/]/.test(A.trim())),className:"flex items-center gap-1 px-2.5 py-1.5 text-xs bg-indigo-600 text-white rounded-md disabled:opacity-50",children:[(0,b.jsx)(o.Plus,{className:"w-3 h-3"}),"Add"]})]})]}),(0,b.jsxs)("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-4",children:[(0,b.jsxs)("h3",{className:"text-sm font-semibold flex items-center gap-2 mb-2",children:[(0,b.jsx)(g.RefreshCw,{className:"w-4 h-4"}),"Data Sync"]}),(0,b.jsx)("p",{className:"text-[11px] text-zinc-500 mb-3",children:"Re-scan all agent sessions."}),(0,b.jsxs)("button",{onClick:I,disabled:v.isPending,className:"flex items-center gap-2 px-3 py-2 text-xs bg-indigo-600 text-white rounded-lg disabled:opacity-50",children:[v.isPending?(0,b.jsx)(i.Loader2,{className:"w-3.5 h-3.5 animate-spin"}):(0,b.jsx)(g.RefreshCw,{className:"w-3.5 h-3.5"}),"Re-sync Now"]}),w&&(0,b.jsx)("p",{className:"text-[11px] text-green-500 mt-2",children:w})]}),(0,b.jsxs)("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-4",children:[(0,b.jsxs)("h3",{className:"text-sm font-semibold flex items-center gap-2 mb-2",children:[(0,b.jsx)(l.BarChart3,{className:"w-4 h-4"}),"Telemetry"]}),E?(0,b.jsx)(i.Loader2,{className:"w-4 h-4 animate-spin text-zinc-500"}):(0,b.jsxs)("label",{className:"flex items-center gap-3 cursor-pointer",children:[(0,b.jsx)("input",{type:"checkbox",checked:!C,onChange:J,className:"w-4 h-4 rounded border-zinc-700 text-indigo-500 focus:ring-indigo-500"}),(0,b.jsx)("span",{className:"text-xs",children:"Send anonymous usage data"})]})]}),(0,b.jsxs)("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-4",children:[(0,b.jsxs)("h3",{className:"text-sm font-semibold flex items-center gap-2 mb-2",children:[(0,b.jsx)(m.Settings,{className:"w-4 h-4"}),"About"]}),(0,b.jsxs)("div",{className:"text-xs space-y-1 text-zinc-400",children:[(0,b.jsx)("p",{children:"Version: 0.1.0"}),(0,b.jsx)("p",{children:"Data access: Read-only"})]})]}),a&&(0,b.jsxs)("button",{onClick:K,className:"flex items-center gap-2 w-full px-4 py-3 text-sm text-red-400 bg-zinc-900 border border-zinc-800 rounded-lg",children:[(0,b.jsx)(n.LogOut,{className:"w-4 h-4"}),"Sign out"]})]})]})}a.s(["default",()=>u])}];
1
+ module.exports=[96221,a=>{"use strict";let b=(0,a.i(70106).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);a.s(["Loader2",()=>b],96221)},59603,a=>{"use strict";var b=a.i(33217),c=a.i(70025),d=a.i(37927),e=a.i(19032);function f(a={}){return(0,b.useQuery)({queryKey:["sessions",a],queryFn:async()=>{let b=new URLSearchParams;return a.projectId&&b.set("projectId",a.projectId),void 0!==a.starred&&b.set("starred",String(a.starred)),a.search&&b.set("search",a.search),a.agentType&&b.set("agentType",a.agentType),a.sortBy&&b.set("sortBy",a.sortBy),a.sortDir&&b.set("sortDir",a.sortDir),void 0!==a.offset&&b.set("offset",String(a.offset)),void 0!==a.limit&&b.set("limit",String(a.limit)),"all"===a.nodeFilter&&b.set("nodes","all"),(await fetch((0,e.api)(`/api/sessions?${b}`))).json()}})}function g(a){return(0,b.useQuery)({queryKey:["session",a],queryFn:async()=>{let b=await fetch((0,e.api)(`/api/sessions/${a}`));if(!b.ok)throw Error("Session not found");return b.json()},enabled:!!a})}function h(a,c=0,d=50,f){return(0,b.useQuery)({queryKey:["messages",a,c,d,f],queryFn:async()=>{let b=f?(0,e.api)(`/api/network/proxy/${f}/sessions/${a}/messages?offset=${c}&limit=${d}`):(0,e.api)(`/api/sessions/${a}/messages?offset=${c}&limit=${d}`);return(await fetch(b)).json()},enabled:!!a})}function i(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async a=>(await fetch((0,e.api)(`/api/sessions/${a}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"star"})})).json(),onSuccess:()=>{a.invalidateQueries({queryKey:["sessions"]}),a.invalidateQueries({queryKey:["session"]})}})}function j(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async({sessionId:a,notes:b})=>(await fetch((0,e.api)(`/api/sessions/${a}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"notes",notes:b})})).json(),onSuccess:()=>{a.invalidateQueries({queryKey:["session"]})}})}function k(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async({sessionId:a,tagName:b})=>(await fetch((0,e.api)(`/api/sessions/${a}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"tag",tagName:b})})).json(),onSuccess:()=>{a.invalidateQueries({queryKey:["sessions"]}),a.invalidateQueries({queryKey:["session"]}),a.invalidateQueries({queryKey:["tags"]})}})}function l(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async({sessionId:a,tagName:b})=>(await fetch((0,e.api)(`/api/sessions/${a}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"removeTag",tagName:b})})).json(),onSuccess:()=>{a.invalidateQueries({queryKey:["sessions"]}),a.invalidateQueries({queryKey:["session"]}),a.invalidateQueries({queryKey:["tags"]})}})}function m(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async({sessionId:a,name:b})=>(await fetch((0,e.api)(`/api/sessions/${a}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"rename",name:b})})).json(),onSuccess:()=>{a.invalidateQueries({queryKey:["sessions"]}),a.invalidateQueries({queryKey:["session"]})}})}function n(){return(0,b.useQuery)({queryKey:["tags"],queryFn:async()=>(await fetch((0,e.api)("/api/tags"))).json()})}function o(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async a=>(await fetch((0,e.api)("/api/tags"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"delete",tagId:a})})).json(),onSuccess:()=>{a.invalidateQueries({queryKey:["tags"]}),a.invalidateQueries({queryKey:["sessions"]}),a.invalidateQueries({queryKey:["session"]})}})}function p(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async({tagId:a,color:b})=>(await fetch((0,e.api)("/api/tags"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"updateColor",tagId:a,color:b})})).json(),onSuccess:()=>{a.invalidateQueries({queryKey:["tags"]}),a.invalidateQueries({queryKey:["sessions"]}),a.invalidateQueries({queryKey:["session"]})}})}function q(){return(0,b.useQuery)({queryKey:["workspaces"],queryFn:async()=>(await fetch((0,e.api)("/api/workspaces"))).json()})}function r(){return(0,b.useQuery)({queryKey:["workspaces","remote"],queryFn:async()=>(await fetch((0,e.api)("/api/workspaces?nodes=all"))).json()})}function s(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async({workspaceId:a,sessionId:b,nodeId:c,title:d,cwd:f,agentType:g})=>{let h=await fetch((0,e.api)(`/api/workspaces/${a}/sessions`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:b,nodeId:c,title:d,cwd:f,agentType:g})});if(!h.ok)throw Error("Failed to add session to workspace");return h.json()},onSuccess:()=>{a.invalidateQueries({queryKey:["workspaces"]}),a.invalidateQueries({queryKey:["workspace-sessions"]}),a.invalidateQueries({queryKey:["sessions"]}),a.invalidateQueries({queryKey:["session"]})}})}function t(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async({workspaceId:a,sessionId:b})=>{let c=await fetch((0,e.api)(`/api/workspaces/${a}/sessions`),{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:b})});if(!c.ok)throw Error("Failed to remove session from workspace");return c.json()},onSuccess:()=>{a.invalidateQueries({queryKey:["workspaces"]}),a.invalidateQueries({queryKey:["workspace-sessions"]}),a.invalidateQueries({queryKey:["sessions"]}),a.invalidateQueries({queryKey:["session"]})}})}function u(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async a=>(await fetch((0,e.api)("/api/bulk"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).json(),onSuccess:()=>{a.invalidateQueries({queryKey:["sessions"]}),a.invalidateQueries({queryKey:["workspaces"]}),a.invalidateQueries({queryKey:["tags"]})}})}function v(){return(0,b.useQuery)({queryKey:["projects"],queryFn:async()=>(await fetch((0,e.api)("/api/projects"))).json()})}function w(){return(0,b.useQuery)({queryKey:["analytics"],queryFn:async()=>(await fetch((0,e.api)("/api/analytics/overview"))).json()})}function x(){let a=(0,d.useQueryClient)();return(0,c.useMutation)({mutationFn:async()=>(await fetch((0,e.api)("/api/sync"),{method:"POST"})).json(),onSuccess:()=>{a.invalidateQueries()}})}a.s(["useAddSessionToWorkspace",()=>s,"useAddTag",()=>k,"useAnalytics",()=>w,"useBulkAction",()=>u,"useDeleteTag",()=>o,"useMessages",()=>h,"useProjects",()=>v,"useRemoteWorkspaces",()=>r,"useRemoveSessionFromWorkspace",()=>t,"useRemoveTag",()=>l,"useRenameSession",()=>m,"useSession",()=>g,"useSessions",()=>f,"useSync",()=>x,"useTags",()=>n,"useToggleStar",()=>i,"useUpdateNotes",()=>j,"useUpdateTagColor",()=>p,"useWorkspaces",()=>q])},210,a=>{"use strict";let b=(0,a.i(70106).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);a.s(["ArrowLeft",()=>b],210)},17299,a=>{"use strict";var b=a.i(87924),c=a.i(50944),d=a.i(210),e=a.i(68114);function f({title:a,showBack:f,backHref:g,right:h,className:i}){let j=(0,c.useRouter)();return(0,b.jsxs)("header",{className:(0,e.cn)("sticky top-0 z-40 bg-zinc-950/95 backdrop-blur-sm border-b border-zinc-800","flex items-center gap-3 px-4 h-14 flex-shrink-0",i),children:[f&&(0,b.jsx)("button",{onClick:()=>{g?j.push(g):j.back()},className:"p-1 -ml-1 text-zinc-400 hover:text-white",children:(0,b.jsx)(d.ArrowLeft,{className:"w-5 h-5"})}),(0,b.jsx)("h1",{className:"text-base font-semibold truncate flex-1",children:a}),h&&(0,b.jsx)("div",{className:"flex items-center gap-2 flex-shrink-0",children:h})]})}a.s(["MobileHeader",()=>f])},39761,a=>{"use strict";let b=(0,a.i(70106).default)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);a.s(["BarChart3",()=>b],39761)},20005,a=>{"use strict";let b=(0,a.i(70106).default)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);a.s(["LogOut",()=>b],20005)},33508,a=>{"use strict";let b=(0,a.i(70106).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);a.s(["X",()=>b],33508)},15618,a=>{"use strict";let b=(0,a.i(70106).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);a.s(["Plus",()=>b],15618)},69520,a=>{"use strict";let b=(0,a.i(70106).default)("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"}]]);a.s(["RefreshCw",()=>b],69520)},3314,a=>{"use strict";let b=(0,a.i(70106).default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);a.s(["Shield",()=>b],3314)},67453,63572,a=>{"use strict";var b=a.i(70106);let c=(0,b.default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);a.s(["CheckCircle2",()=>c],67453);let d=(0,b.default)("folder-code",[["path",{d:"M10 10.5 8 13l2 2.5",key:"m4t9c1"}],["path",{d:"m14 10.5 2 2.5-2 2.5",key:"14w2eb"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2z",key:"1u1bxd"}]]);a.s(["FolderCode",()=>d],63572)},61552,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(59603),e=a.i(50944),f=a.i(17299),g=a.i(69520),h=a.i(96101),i=a.i(96221),j=a.i(3314),k=a.i(67453),l=a.i(39761),m=a.i(21161),n=a.i(20005),o=a.i(15618),p=a.i(33508),q=a.i(63572),r=a.i(19032),s=a.i(58037),t=a.i(97498);function u(){let{hasAuth:a,tier:u,version:v}=(0,t.useTier)(),w=(0,e.useRouter)(),x=(0,d.useSync)(),[y,z]=(0,c.useState)(""),[A,B]=(0,c.useState)([]),[C,D]=(0,c.useState)(""),[E,F]=(0,c.useState)(!1),[G,H]=(0,c.useState)(!0);(0,c.useEffect)(()=>{fetch((0,r.api)("/api/config")).then(a=>a.json()).then(a=>{F(a.telemetryOptOut),B(a.devDirectories||[]),H(!1)}).catch(()=>H(!1))},[]);let I=async a=>{B(a),await fetch((0,r.api)("/api/config"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({devDirectories:a})})},J=()=>{let a=C.trim();!a||A.includes(a)||(a.startsWith("/")||/^[A-Za-z]:[\\/]/.test(a))&&(I([...A,a]),D(""))},K=async()=>{let a=await x.mutateAsync();z(`Synced ${a.projects} projects, ${a.sessions} sessions`)},L=async()=>{let a=!E;F(a),(0,s.setOptOut)(a),await fetch((0,r.api)("/api/config"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({telemetryOptOut:a})})},M=async()=>{await fetch((0,r.api)("/api/auth/logout"),{method:"POST"}),w.push("/login")};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f.MobileHeader,{title:"Settings"}),(0,b.jsxs)("div",{className:"px-4 py-4 space-y-4",children:[a&&(0,b.jsxs)("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-4",children:[(0,b.jsxs)("h3",{className:"text-sm font-semibold flex items-center gap-2 mb-2",children:[(0,b.jsx)(j.Shield,{className:"w-4 h-4"}),"Terminal Security"]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(k.CheckCircle2,{className:"w-4 h-4 text-green-500"}),(0,b.jsx)("span",{className:"text-xs text-green-500",children:"2FA Enabled"})]}),(0,b.jsx)("p",{className:"text-[11px] text-zinc-500 mt-1.5",children:"2FA is managed through the login flow."})]}),(0,b.jsxs)("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-4",children:[(0,b.jsxs)("h3",{className:"text-sm font-semibold flex items-center gap-2 mb-2",children:[(0,b.jsx)(h.FolderOpen,{className:"w-4 h-4"}),"Data Source"]}),(0,b.jsxs)("div",{className:"space-y-2 text-xs",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-zinc-500",children:"Agent Data:"}),(0,b.jsx)("span",{className:"font-mono ml-2",children:"~/.claude/ ~/.codex/ ~/.gemini/"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-zinc-500",children:"Database:"}),(0,b.jsx)("span",{className:"font-mono ml-2",children:"~/.spaces/spaces.db"})]})]})]}),(0,b.jsxs)("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-4",children:[(0,b.jsxs)("h3",{className:"text-sm font-semibold flex items-center gap-2 mb-2",children:[(0,b.jsx)(q.FolderCode,{className:"w-4 h-4"}),"Dev Directories"]}),(0,b.jsx)("p",{className:"text-[11px] text-zinc-500 mb-3",children:"Restrict pane creation to these project roots."}),A.length>0&&(0,b.jsx)("div",{className:"space-y-1.5 mb-3",children:A.map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-2 px-2.5 py-1.5 bg-zinc-800 rounded-md",children:[(0,b.jsx)(h.FolderOpen,{className:"w-3 h-3 text-amber-500/70 flex-shrink-0"}),(0,b.jsx)("span",{className:"font-mono text-[11px] flex-1 truncate",children:a}),(0,b.jsx)("button",{onClick:()=>{I(A.filter(b=>b!==a))},className:"text-zinc-500 hover:text-red-400",children:(0,b.jsx)(p.X,{className:"w-3 h-3"})})]},a))}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{type:"text",placeholder:"u">typeof navigator&&navigator.platform?.startsWith("Win")?"C:\\Users\\you\\projects":"/home/user/projects",value:C,onChange:a=>D(a.target.value),onKeyDown:a=>"Enter"===a.key&&J(),className:"flex-1 px-2.5 py-1.5 text-xs bg-zinc-800 border border-zinc-700 rounded-md focus:outline-none focus:border-indigo-500 font-mono"}),(0,b.jsxs)("button",{onClick:J,disabled:!C.trim()||!(C.trim().startsWith("/")||/^[A-Za-z]:[\\/]/.test(C.trim())),className:"flex items-center gap-1 px-2.5 py-1.5 text-xs bg-indigo-600 text-white rounded-md disabled:opacity-50",children:[(0,b.jsx)(o.Plus,{className:"w-3 h-3"}),"Add"]})]})]}),(0,b.jsxs)("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-4",children:[(0,b.jsxs)("h3",{className:"text-sm font-semibold flex items-center gap-2 mb-2",children:[(0,b.jsx)(g.RefreshCw,{className:"w-4 h-4"}),"Data Sync"]}),(0,b.jsx)("p",{className:"text-[11px] text-zinc-500 mb-3",children:"Re-scan all agent sessions."}),(0,b.jsxs)("button",{onClick:K,disabled:x.isPending,className:"flex items-center gap-2 px-3 py-2 text-xs bg-indigo-600 text-white rounded-lg disabled:opacity-50",children:[x.isPending?(0,b.jsx)(i.Loader2,{className:"w-3.5 h-3.5 animate-spin"}):(0,b.jsx)(g.RefreshCw,{className:"w-3.5 h-3.5"}),"Re-sync Now"]}),y&&(0,b.jsx)("p",{className:"text-[11px] text-green-500 mt-2",children:y})]}),(0,b.jsxs)("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-4",children:[(0,b.jsxs)("h3",{className:"text-sm font-semibold flex items-center gap-2 mb-2",children:[(0,b.jsx)(l.BarChart3,{className:"w-4 h-4"}),"Telemetry"]}),G?(0,b.jsx)(i.Loader2,{className:"w-4 h-4 animate-spin text-zinc-500"}):(0,b.jsxs)("label",{className:"flex items-center gap-3 cursor-pointer",children:[(0,b.jsx)("input",{type:"checkbox",checked:!E,onChange:L,className:"w-4 h-4 rounded border-zinc-700 text-indigo-500 focus:ring-indigo-500"}),(0,b.jsx)("span",{className:"text-xs",children:"Send anonymous usage data"})]})]}),(0,b.jsxs)("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-4",children:[(0,b.jsxs)("h3",{className:"text-sm font-semibold flex items-center gap-2 mb-2",children:[(0,b.jsx)(m.Settings,{className:"w-4 h-4"}),"About"]}),(0,b.jsxs)("div",{className:"text-xs space-y-1 text-zinc-400",children:[(0,b.jsxs)("p",{children:["Version: ",v||"..."]}),(0,b.jsxs)("p",{children:["Tier: ",(0,b.jsx)("span",{className:"capitalize",children:u})]}),(0,b.jsx)("p",{children:"Data access: Read-only"})]})]}),a&&(0,b.jsxs)("button",{onClick:M,className:"flex items-center gap-2 w-full px-4 py-3 text-sm text-red-400 bg-zinc-900 border border-zinc-800 rounded-lg",children:[(0,b.jsx)(n.LogOut,{className:"w-4 h-4"}),"Sign out"]})]})]})}a.s(["default",()=>u])}];
2
2
 
3
3
  //# sourceMappingURL=_cd50a174._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[66490,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(15618),e=a.i(96221),f=a.i(80386),g=a.i(87532),h=a.i(63588),i=a.i(96101),j=a.i(41710),k=a.i(5784),l=a.i(50522),m=a.i(70106);let n=(0,m.default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var o=a.i(81560),p=a.i(99464),q=a.i(33441),r=a.i(33508),s=a.i(5151),t=a.i(81010);let u=(0,m.default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),v=(0,m.default)("arrow-left-to-line",[["path",{d:"M3 19V5",key:"rwsyhb"}],["path",{d:"m13 6-6 6 6 6",key:"1yhaz7"}],["path",{d:"M7 12h14",key:"uoisry"}]]);var w=a.i(44494),x=a.i(92e3),y=a.i(60246),z=a.i(50944),A=a.i(55402),B=a.i(63002);let C=(0,m.default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);var D=a.i(67552),E=a.i(21161),F=a.i(19032);function G({value:a,onChange:d}){let[f,g]=(0,c.useState)(!1),[h,j]=(0,c.useState)([]),[k,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(null),[r,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)("list"),v=(0,c.useRef)(null);(0,c.useEffect)(()=>{fetch((0,F.api)("/api/config")).then(a=>a.json()).then(a=>{j(a.devDirectories||[]),m(!0)}).catch(()=>m(!0))},[]),(0,c.useEffect)(()=>{f&&"browse"===t&&n&&(s(!0),fetch((0,F.api)(`/api/folders?path=${encodeURIComponent(n)}`)).then(a=>a.json()).then(a=>{q(a),s(!1)}).catch(()=>s(!1)))},[f,t,n]),(0,c.useEffect)(()=>{let a=a=>{v.current&&!v.current.contains(a.target)&&g(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[]);let w=()=>{f?g(!1):(1===h.length?(u("browse"),o(h[0])):u("list"),g(!0))},x=a=>{d(a),g(!1)},y=a=>{o(a)},z=h.find(a=>p?.current===a||p?.current?.startsWith(a+"/")),A=z?.split("/").pop()||"",B=z&&p?.current?p.current.slice(z.length):"",G=B?B.split("/").filter(Boolean):[];return(0,b.jsxs)("div",{ref:v,className:"relative",children:[(0,b.jsxs)("div",{className:"flex items-center gap-0",children:[(0,b.jsx)("input",{type:"text",placeholder:"Working directory",value:a,onChange:a=>d(a.target.value),onFocus:()=>{f||w()},className:"flex-1 px-3 py-2 text-sm bg-zinc-800 border border-zinc-700 rounded-l-md focus:outline-none focus:border-indigo-500 text-white font-mono"}),(0,b.jsx)("button",{type:"button",onClick:w,className:"px-3 py-2 text-sm bg-zinc-700 border border-zinc-700 border-l-0 rounded-r-md hover:bg-zinc-600 text-zinc-300 hover:text-white transition-colors",title:"Browse folders",children:(0,b.jsx)(i.FolderOpen,{className:"w-4 h-4"})})]}),f&&(0,b.jsxs)("div",{className:"absolute z-50 top-full left-0 right-0 mt-1 bg-zinc-800 border border-zinc-700 rounded-md shadow-xl overflow-hidden",children:[k?0===h.length&&"list"===t?(0,b.jsxs)("div",{className:"py-6 px-4 text-center",children:[(0,b.jsx)(E.Settings,{className:"w-5 h-5 text-zinc-500 mx-auto mb-2"}),(0,b.jsx)("p",{className:"text-xs text-zinc-400 mb-1",children:"No development directories configured"}),(0,b.jsx)("p",{className:"text-[11px] text-zinc-500",children:"Add them in Settings to browse project folders here."})]}):"list"===t?(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"px-3 py-1.5 border-b border-zinc-700/50 text-[11px] text-zinc-500 font-medium",children:"Development Directories"}),(0,b.jsx)("div",{className:"max-h-[250px] overflow-y-auto",children:h.map(a=>(0,b.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-xs hover:bg-zinc-700 transition-colors group",onClick:()=>{u("browse"),o(a)},onDoubleClick:()=>x(a),title:"Click to browse, double-click to select",children:[(0,b.jsx)(C,{className:"w-3.5 h-3.5 text-amber-500/70"}),(0,b.jsx)("span",{className:"font-mono text-white truncate flex-1 text-left",children:a}),(0,b.jsx)(l.ChevronRight,{className:"w-3 h-3 text-zinc-600 group-hover:text-zinc-400"})]},a))})]}):(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center gap-0.5 px-2 py-1.5 border-b border-zinc-700/50 overflow-x-auto text-[11px] flex-nowrap",children:[h.length>1&&(0,b.jsx)("button",{onClick:()=>{u("list"),q(null)},className:"text-zinc-400 hover:text-white flex-shrink-0 p-0.5 mr-0.5",title:"Back to dev directories",children:(0,b.jsx)(D.ChevronUp,{className:"w-3 h-3"})}),(0,b.jsx)("button",{onClick:()=>z&&y(z),className:"text-zinc-400 hover:text-white flex-shrink-0",children:A}),G.map((a,c)=>{let d=z+"/"+G.slice(0,c+1).join("/");return(0,b.jsxs)("span",{className:"flex items-center gap-0.5 flex-shrink-0",children:[(0,b.jsx)(l.ChevronRight,{className:"w-2.5 h-2.5 text-zinc-600"}),(0,b.jsx)("button",{onClick:()=>y(d),className:"text-zinc-400 hover:text-white hover:underline",children:a})]},c)})]}),(0,b.jsx)("div",{className:"max-h-[250px] overflow-y-auto",children:r||!p?(0,b.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,b.jsx)(e.Loader2,{className:"w-4 h-4 animate-spin text-zinc-400"})}):p.error?(0,b.jsx)("div",{className:"py-4 px-3 text-xs text-red-400 text-center",children:p.error}):(0,b.jsxs)(b.Fragment,{children:[p?.parent&&(0,b.jsxs)("button",{onClick:()=>y(p.parent),className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-zinc-400 hover:text-white hover:bg-zinc-700/50 transition-colors border-b border-zinc-700/30",children:[(0,b.jsx)(D.ChevronUp,{className:"w-3.5 h-3.5"}),(0,b.jsx)("span",{children:".."})]}),(0,b.jsxs)("button",{onClick:()=>x(p.current),className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-indigo-400 hover:bg-indigo-500/10 transition-colors border-b border-zinc-700/30 font-medium",children:[(0,b.jsx)(i.FolderOpen,{className:"w-3.5 h-3.5"}),(0,b.jsx)("span",{children:"Select this folder"}),(0,b.jsx)("span",{className:"ml-auto text-[10px] text-zinc-500 font-mono truncate max-w-[200px]",children:p.current.split("/").pop()})]}),p?.folders.length===0?(0,b.jsx)("div",{className:"py-3 px-3 text-[11px] text-zinc-500 text-center",children:"No subfolders"}):p?.folders.map(a=>(0,b.jsxs)("button",{onClick:()=>y(a.path),onDoubleClick:()=>x(a.path),className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-white hover:bg-zinc-700 transition-colors",title:"Click to open, double-click to select",children:[(0,b.jsx)(C,{className:"w-3.5 h-3.5 text-amber-500/70"}),(0,b.jsx)("span",{className:"truncate",children:a.name})]},a.path))]})})]}):(0,b.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,b.jsx)(e.Loader2,{className:"w-4 h-4 animate-spin text-zinc-400"})}),(0,b.jsx)("div",{className:"border-t border-zinc-700/50 px-2 py-1 flex justify-end",children:(0,b.jsx)("button",{onClick:()=>g(!1),className:"text-[11px] text-zinc-500 hover:text-white px-2 py-0.5",children:"Close"})})]})]})}var H=a.i(1279),I=a.i(97498);function J({value:a,onChange:c}){let{hasNetwork:d}=(0,I.useTier)(),{data:e}=(0,H.useNodes)(d);return Array.isArray(e)&&0!==e.length?(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-[11px] text-zinc-400 mb-1.5 block",children:"Node"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(w.Globe,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-zinc-500"}),(0,b.jsxs)("select",{value:a,onChange:a=>c(a.target.value),className:"w-full pl-8 pr-3 py-2 text-sm bg-zinc-800 border border-zinc-700 rounded-md focus:outline-none focus:border-indigo-500 text-white appearance-none",children:[(0,b.jsx)("option",{value:"",children:"Local (this machine)"}),e.map(a=>(0,b.jsx)("option",{value:a.id,disabled:"offline"===a.status,children:"offline"===a.status?`${a.name} (offline)`:a.name},a.id))]})]})]}):null}var K=a.i(79082),L=a.i(5699),M=a.i(59603),N=a.i(92759);let O=(0,m.default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var P=a.i(33217),Q=a.i(70025),R=a.i(37927);function S({workspaceId:a,panes:d,collapsed:e,onToggle:f}){let g,i,j,k,[m,n]=(0,c.useState)("messages"),[p,q]=(0,c.useState)(""),r=(0,c.useRef)(null),{data:s=[]}=(0,P.useQuery)({queryKey:["workspace-messages",a,void 0],queryFn:async()=>{let b=new URLSearchParams;return(await fetch((0,F.api)(`/api/workspaces/${a}/messages?${b}`))).json()},enabled:!!a,refetchInterval:3e3}),{data:t=[]}=(0,P.useQuery)({queryKey:["workspace-context",a],queryFn:async()=>(await fetch((0,F.api)(`/api/workspaces/${a}/context`))).json(),enabled:!!a}),u=(g=(0,R.useQueryClient)(),(0,Q.useMutation)({mutationFn:async b=>(await fetch((0,F.api)(`/api/workspaces/${a}/messages`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...b,senderName:b.senderName||"User",type:b.type||"message"})})).json(),onSuccess:()=>{g.invalidateQueries({queryKey:["workspace-messages",a]})}})),v=(i=(0,R.useQueryClient)(),(0,Q.useMutation)({mutationFn:async({messageId:b,status:c})=>(await fetch((0,F.api)(`/api/workspaces/${a}/messages/${b}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:c})})).json(),onSuccess:()=>{i.invalidateQueries({queryKey:["workspace-messages",a]})}})),w=(j=(0,R.useQueryClient)(),(0,Q.useMutation)({mutationFn:async()=>{await fetch((0,F.api)(`/api/workspaces/${a}/messages`),{method:"DELETE"})},onSuccess:()=>{j.invalidateQueries({queryKey:["workspace-messages",a]})}})),x=(k=(0,R.useQueryClient)(),(0,Q.useMutation)({mutationFn:async()=>{await fetch((0,F.api)(`/api/workspaces/${a}/context`),{method:"DELETE"})},onSuccess:()=>{k.invalidateQueries({queryKey:["workspace-context",a]})}})),y=s.filter(a=>"pending_approval"===a.status).length;(0,c.useEffect)(()=>{r.current&&(r.current.scrollTop=r.current.scrollHeight)},[s]);let z=()=>{p.trim()&&a&&(u.mutate({content:p.trim()}),q(""))};return e?(0,b.jsxs)("button",{onClick:f,className:"flex-shrink-0 w-10 border-l border-zinc-800 bg-zinc-900 flex flex-col items-center pt-3 gap-2",children:[(0,b.jsx)(O,{className:"w-4 h-4 text-zinc-400"}),(0,b.jsx)(h.MessageSquare,{className:"w-4 h-4 text-zinc-400"}),y>0&&(0,b.jsx)("span",{className:"bg-amber-500 text-black text-xs font-bold rounded-full w-5 h-5 flex items-center justify-center",children:y})]}):(0,b.jsxs)("div",{className:"flex-shrink-0 w-80 border-l border-zinc-800 bg-zinc-900 flex flex-col",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-zinc-800",children:[(0,b.jsxs)("div",{className:"flex gap-1",children:[(0,b.jsxs)("button",{onClick:()=>n("messages"),className:`px-2 py-1 text-xs rounded ${"messages"===m?"bg-zinc-700 text-white":"text-zinc-400 hover:text-zinc-300"}`,children:["Messages",y>0&&(0,b.jsx)("span",{className:"ml-1 bg-amber-500 text-black text-xs font-bold rounded-full px-1.5",children:y})]}),(0,b.jsx)("button",{onClick:()=>n("context"),className:`px-2 py-1 text-xs rounded ${"context"===m?"bg-zinc-700 text-white":"text-zinc-400 hover:text-zinc-300"}`,children:"Context"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsx)("button",{onClick:()=>"messages"===m?w.mutate():x.mutate(),className:"text-zinc-500 hover:text-red-400",title:"messages"===m?"Clear all messages":"Clear all context",children:(0,b.jsx)(o.Trash2,{className:"w-3.5 h-3.5"})}),(0,b.jsx)("button",{onClick:f,className:"text-zinc-400 hover:text-zinc-300",children:(0,b.jsx)(l.ChevronRight,{className:"w-4 h-4"})})]})]}),"messages"===m&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{ref:r,className:"flex-1 overflow-y-auto p-2 space-y-2",children:[[...s].reverse().map(a=>(0,b.jsx)(T,{message:a,panes:d,onApprove:()=>v.mutate({messageId:a.id,status:"approved"}),onReject:()=>v.mutate({messageId:a.id,status:"rejected"})},a.id)),0===s.length&&(0,b.jsx)("p",{className:"text-zinc-500 text-xs text-center py-8",children:"No messages yet. Agents will appear here."})]}),(0,b.jsx)("div",{className:"border-t border-zinc-800 p-2",children:(0,b.jsxs)("div",{className:"flex gap-1",children:[(0,b.jsx)("input",{value:p,onChange:a=>q(a.target.value),onKeyDown:a=>"Enter"===a.key&&!a.shiftKey&&z(),placeholder:"Message workspace...",className:"flex-1 bg-zinc-800 border border-zinc-700 rounded px-2 py-1 text-sm text-zinc-200 placeholder-zinc-500 focus:outline-none focus:border-zinc-600"}),(0,b.jsx)("button",{onClick:z,disabled:!p.trim(),className:"px-2 py-1 bg-indigo-600 hover:bg-indigo-500 disabled:bg-zinc-700 disabled:text-zinc-500 rounded text-sm",children:(0,b.jsx)(N.Send,{className:"w-3.5 h-3.5"})})]})})]}),"context"===m&&(0,b.jsx)(U,{workspaceId:a,context:t})]})}function T({message:a,panes:c,onApprove:d,onReject:e}){let f=c.find(b=>b.id===a.paneId),g="pending_approval"===a.status,h="rejected"===a.status;return(0,b.jsxs)("div",{className:`rounded p-2 text-xs ${g?"bg-amber-950/50 border border-amber-800/50":h?"bg-zinc-800/50 opacity-50":"bg-zinc-800/50"}`,children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,b.jsxs)("span",{className:"font-medium text-zinc-300",children:[f&&(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full mr-1",style:{backgroundColor:f.color||"#6366f1"}}),a.senderName]}),(0,b.jsx)("span",{className:"text-zinc-500",children:new Date(a.created).toLocaleTimeString()})]}),(0,b.jsx)("p",{className:"text-zinc-300 whitespace-pre-wrap",children:a.content}),g&&(0,b.jsxs)("div",{className:"flex gap-1 mt-2",children:[(0,b.jsxs)("button",{onClick:d,className:"flex items-center gap-1 px-2 py-0.5 bg-green-700 hover:bg-green-600 rounded text-white text-xs",children:[(0,b.jsx)(q.Check,{className:"w-3 h-3"})," Approve"]}),(0,b.jsxs)("button",{onClick:e,className:"flex items-center gap-1 px-2 py-0.5 bg-zinc-700 hover:bg-zinc-600 rounded text-zinc-300 text-xs",children:[(0,b.jsx)(r.X,{className:"w-3 h-3"})," Reject"]})]}),"rejected"===a.status&&(0,b.jsx)("span",{className:"text-red-400 text-xs mt-1 block",children:"Rejected"})]})}function U({workspaceId:a,context:d}){let e,f,[g,h]=(0,c.useState)(""),[i,j]=(0,c.useState)(""),k=(e=(0,R.useQueryClient)(),(0,Q.useMutation)({mutationFn:async({key:b,value:c})=>(await fetch((0,F.api)(`/api/workspaces/${a}/context/${encodeURIComponent(b)}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:c})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["workspace-context",a]})}})),l=(f=(0,R.useQueryClient)(),(0,Q.useMutation)({mutationFn:async b=>{await fetch((0,F.api)(`/api/workspaces/${a}/context/${encodeURIComponent(b)}`),{method:"DELETE"})},onSuccess:()=>{f.invalidateQueries({queryKey:["workspace-context",a]})}})),m=()=>{g.trim()&&i.trim()&&(k.mutate({key:g.trim(),value:i.trim()}),h(""),j(""))};return(0,b.jsxs)("div",{className:"flex-1 overflow-y-auto p-2 space-y-2",children:[d.map(a=>(0,b.jsxs)("div",{className:"bg-zinc-800/50 rounded p-2 text-xs",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,b.jsx)("span",{className:"font-mono font-medium text-indigo-300",children:a.key}),(0,b.jsx)("button",{onClick:()=>l.mutate(a.key),className:"text-zinc-500 hover:text-red-400",children:(0,b.jsx)(r.X,{className:"w-3 h-3"})})]}),(0,b.jsx)("p",{className:"text-zinc-300 whitespace-pre-wrap font-mono text-xs",children:a.value}),(0,b.jsxs)("span",{className:"text-zinc-500 text-xs",children:["by ",a.updatedBy]})]},a.key)),(0,b.jsxs)("div",{className:"border-t border-zinc-800 pt-2 space-y-1",children:[(0,b.jsx)("input",{value:g,onChange:a=>h(a.target.value),placeholder:"Key",className:"w-full bg-zinc-800 border border-zinc-700 rounded px-2 py-1 text-xs text-zinc-200 placeholder-zinc-500 focus:outline-none"}),(0,b.jsx)("input",{value:i,onChange:a=>j(a.target.value),placeholder:"Value",onKeyDown:a=>"Enter"===a.key&&m(),className:"w-full bg-zinc-800 border border-zinc-700 rounded px-2 py-1 text-xs text-zinc-200 placeholder-zinc-500 focus:outline-none"}),(0,b.jsx)("button",{onClick:m,disabled:!g.trim()||!i.trim(),className:"w-full px-2 py-1 bg-indigo-600 hover:bg-indigo-500 disabled:bg-zinc-700 disabled:text-zinc-500 rounded text-xs",children:"Add Entry"})]})]})}var V=a.i(58037);function W(){return(0,b.jsx)(K.TotpGate,{children:a=>(0,b.jsx)(X,{terminalToken:a})})}function X({terminalToken:a}){let m=(0,z.useRouter)(),{basePath:C,hasNetwork:D,hasCollaboration:E}=(0,I.useTier)(),[H,K]=(0,c.useState)([]),[N,O]=(0,c.useState)(!0),[P,Q]=(0,c.useState)(!0),[T,U]=(0,c.useState)(!1),[W,X]=(0,c.useState)(null),[Y,Z]=(0,c.useState)(new Set),[$,_]=(0,c.useState)(!1),[aa,ab]=(0,c.useState)(!0);!function(){let a=(0,R.useQueryClient)(),{hasCollaboration:b}=(0,I.useTier)();(0,c.useEffect)(()=>{if(!b)return;let c=new EventSource((0,F.api)("/api/events")),d=()=>{a.invalidateQueries({queryKey:["workspace-messages"]})},e=()=>{a.invalidateQueries({queryKey:["workspace-context"]})};return c.addEventListener("workspace:message",d),c.addEventListener("workspace:request",d),c.addEventListener("workspace:context_updated",e),()=>{c.removeEventListener("workspace:message",d),c.removeEventListener("workspace:request",d),c.removeEventListener("workspace:context_updated",e),c.close()}},[a,b])}();let[ac,ad]=(0,c.useState)([]),[ae,af]=(0,c.useState)(null),[ag,ah]=(0,c.useState)(!1),[ai,aj]=(0,c.useState)(!1),[ak,al]=(0,c.useState)(""),[am,an]=(0,c.useState)("#6366f1"),[ao,ap]=(0,c.useState)(null),[aq,ar]=(0,c.useState)(""),[as,at]=(0,c.useState)(""),[au,av]=(0,c.useState)(""),[aw,ax]=(0,c.useState)("#6366f1"),[ay,az]=(0,c.useState)(""),[aA,aB]=(0,c.useState)("shell"),[aC,aD]=(0,c.useState)("new"),[aE,aF]=(0,c.useState)(""),[aG,aH]=(0,c.useState)(""),aI=(0,M.useRemoteWorkspaces)(),[aJ,aK]=(0,c.useState)(new Set),aL=(0,c.useCallback)(a=>{aK(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),[aM,aN]=(0,c.useState)(""),[aO,aP]=(0,c.useState)([]),[aQ,aR]=(0,c.useState)(!1),[aS,aT]=(0,c.useState)(!1),[aU,aV]=(0,c.useState)(null),[aW,aX]=(0,c.useState)(!0),aY=(0,c.useRef)(null),aZ=(0,c.useRef)(null),a$=(0,c.useRef)(null),a_=(0,c.useCallback)(async()=>{let a=await fetch((0,F.api)("/api/workspaces")),b=await a.json();ad(b);let c=b.find(a=>a.isActive);return af(c||null),Q(!1),c||null},[]),a0=(0,c.useCallback)(async()=>{let a=await fetch((0,F.api)("/api/panes")),b=await a.json();K(b);let c=new Set;for(let a of b)a.isPopout&&c.add(a.id);Z(c),O(!1)},[]);(0,c.useEffect)(()=>{a_().then(a=>{a&&_(!0)})},[a_]),(0,c.useEffect)(()=>{$&&a0()},[$,a0]),(0,c.useEffect)(()=>{let a=new BroadcastChannel("spaces-panes");return a$.current=a,a.onmessage=a=>{let b=a.data;"popout-opened"===b.type?Z(a=>new Set(a).add(b.paneId)):"popout-closed"===b.type?(Z(a=>{let c=new Set(a);return c.delete(b.paneId),c}),a0()):"pane-updated"===b.type&&K(a=>a.map(a=>a.id===b.paneId?{...a,...b.data}:a))},()=>a.close()},[a0]);let[a1,a2]=(0,c.useState)(0);(0,c.useEffect)(()=>{if(!N)for(let a of H)a.isPopout&&a7(a)},[N,a1]),(0,c.useEffect)(()=>{if("claude"!==aA||"resume"!==aC)return;aR(!0);let a=setTimeout(()=>{let a=new URLSearchParams({sortBy:"modified",sortDir:"DESC",limit:"200"});aM&&a.set("search",aM),aW&&au&&a.set("projectPath",au),a.set("agentType",aA),fetch((0,F.api)(`/api/sessions?${a}`)).then(a=>a.json()).then(a=>{aP(a.sessions||[]),aR(!1)}).catch(()=>aR(!1))},300*!!aM);return()=>clearTimeout(a)},[aA,aC,aM,aW,au]),(0,c.useEffect)(()=>{function a(a){aY.current&&!aY.current.contains(a.target)&&aT(!1),aZ.current&&!aZ.current.contains(a.target)&&ah(!1)}return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[]);let a3=(0,c.useCallback)(async()=>{let a,b=L.AGENT_TYPES[aA],c=au||aU?.projectPath||"/";"shell"!==aA&&(a="resume"===aC&&b?.supportsResume?aU?.sessionId||ay:"new");let d=as||(aU?aU.customName||aU.firstPrompt?.slice(0,50)||b?.name||"Agent":"")||("shell"===aA?"Terminal":b?.name||"Agent"),e=ae?.collaboration&&"shell"!==aA,f=await fetch((0,F.api)("/api/panes"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:d,color:aw,cwd:c,claudeSessionId:a,agentType:aA,customCommand:"custom"===aA?aE:void 0,nodeId:aG||void 0,isCollaborating:e||void 0})}),g=await f.json();K(a=>[...a,g]),(0,V.track)("pane_created",{agentType:aA}),U(!1),at(""),av(""),ax("#6366f1"),az(""),aB("shell"),aD("new"),aF(""),aH(""),aV(null),aN("")},[as,au,aw,ay,aA,aC,aE,aG,aU]),a4=(0,c.useCallback)(async a=>{let b=H.find(b=>b.id===a);await fetch((0,F.api)(`/api/panes/${a}`),{method:"DELETE"}),K(b=>b.filter(b=>b.id!==a)),b&&(0,V.track)("pane_closed",{agentType:b.agentType}),W===a&&X(null),Z(b=>{let c=new Set(b);return c.delete(a),c})},[W,H]),a5=(0,c.useCallback)(async(a,b)=>{await fetch((0,F.api)(`/api/panes/${a}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),K(c=>c.map(c=>c.id===a?{...c,...b}:c))},[]),a6=(0,c.useCallback)(a=>{X(b=>b===a?null:a)},[]),a7=(0,c.useCallback)(a=>{let b=a.winWidth||900,c=a.winHeight||600,d=a.winX??Math.round(screen.width/2-b/2),e=a.winY??Math.round(screen.height/2-c/2),f=`left=${d},top=${e},width=${b},height=${c},menubar=no,toolbar=no,location=no,status=no`;window.open((0,F.api)(`/terminal/pane/${a.id}`),`spaces-pane-${a.id}`,f),Z(b=>new Set(b).add(a.id)),fetch((0,F.api)(`/api/panes/${a.id}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isPopout:!0,winX:d,winY:e,winWidth:b,winHeight:c})})},[]),a8=(0,c.useCallback)(a=>{let b=H.find(b=>b.id===a);b&&a7(b)},[H,a7]),a9=(0,c.useCallback)(async a=>{a$.current?.postMessage({type:"close-popouts"}),await fetch((0,F.api)(`/api/panes/${a}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isPopout:!1})}),Z(b=>{let c=new Set(b);return c.delete(a),c})},[]),ba=(0,c.useCallback)(()=>{Y.size>0&&(a$.current?.postMessage({type:"close-popouts"}),Z(new Set))},[Y]),bb=(0,c.useCallback)(async a=>{ba(),await fetch((0,F.api)("/api/workspaces"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"switch",workspaceId:a})}),X(null),await a_(),await a0(),ah(!1),$?(0,V.track)("workspace_switched"):(0,V.track)("workspace_entered"),_(!0),a2(a=>a+1)},[a_,a0,ba,$]),bc=(0,c.useCallback)(async()=>{ak.trim()&&ae&&(await fetch((0,F.api)("/api/workspaces"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"duplicate",sourceId:ae.id,name:ak.trim(),color:am})}),al(""),an("#6366f1"),aj(!1),await a_())},[ak,am,ae,a_]),bd=(0,c.useCallback)(async()=>{let a=await fetch((0,F.api)("/api/workspaces"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"New Space",color:"#6366f1"})}),b=await a.json();(0,V.track)("workspace_created"),await bb(b.id)},[bb]),be=(0,c.useCallback)(async a=>{ba(),await fetch((0,F.api)(`/api/workspaces/${a}`),{method:"DELETE"}),(0,V.track)("workspace_deleted"),await a_(),await a0(),ah(!1)},[a_,a0,ba]),bf=(0,c.useCallback)(()=>{ba(),K([]),_(!1)},[ba]),bg=(0,c.useCallback)(async(a,b)=>{await fetch((0,F.api)(`/api/workspaces/${a}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b})}),ap(null),await a_()},[a_]),bh=H.filter(a=>!Y.has(a.id));return $?N?(0,b.jsx)("div",{className:"flex items-center justify-center h-screen bg-zinc-950",children:(0,b.jsx)(e.Loader2,{className:"w-6 h-6 animate-spin text-indigo-500"})}):(0,b.jsxs)("div",{className:"h-screen flex flex-col bg-zinc-950 text-zinc-100",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 border-b border-zinc-800 flex-shrink-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("button",{onClick:bf,className:"p-1.5 -ml-1 text-zinc-500 hover:text-white hover:bg-zinc-800 rounded-md transition-colors",title:"Close space and go home",children:(0,b.jsx)(t.Home,{className:"w-4 h-4"})}),(0,b.jsx)("div",{className:"w-px h-4 bg-zinc-800"}),(0,b.jsx)("h1",{className:"text-sm font-semibold",children:"Spaces"}),(0,b.jsxs)("div",{ref:aZ,className:"relative",children:[(0,b.jsxs)("button",{onClick:()=>ah(!ag),className:"flex items-center gap-1.5 px-2.5 py-1 text-xs bg-zinc-800 border border-zinc-700 rounded-md hover:border-zinc-600 transition-colors",children:[ae&&(0,b.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:ae.color}}),(0,b.jsx)("span",{className:"max-w-[150px] truncate",children:ae?.name||"No space"}),(0,b.jsx)(k.ChevronDown,{className:"w-3 h-3 text-zinc-500"})]}),ag&&(0,b.jsxs)("div",{className:"absolute z-50 top-full left-0 mt-1 w-72 bg-zinc-800 border border-zinc-700 rounded-md shadow-xl overflow-hidden",children:[(0,b.jsx)("div",{className:"p-2 border-b border-zinc-700/50 text-[10px] text-zinc-500 uppercase tracking-wider font-medium",children:"Switch Space"}),(0,b.jsx)("div",{className:"max-h-[300px] overflow-y-auto",children:ac.map(a=>(0,b.jsx)("div",{className:"flex items-center gap-2 hover:bg-zinc-700/50 transition-colors group",children:ao===a.id?(0,b.jsxs)("div",{className:"flex items-center gap-1 flex-1 px-3 py-2",children:[(0,b.jsx)("input",{autoFocus:!0,value:aq,onChange:a=>ar(a.target.value),onKeyDown:b=>{"Enter"===b.key&&bg(a.id,aq),"Escape"===b.key&&ap(null)},className:"flex-1 bg-transparent border border-zinc-600 rounded px-1.5 py-0.5 text-xs focus:outline-none focus:border-indigo-400"}),(0,b.jsx)("button",{onClick:()=>bg(a.id,aq),className:"text-green-400 hover:text-green-300",children:(0,b.jsx)(q.Check,{className:"w-3 h-3"})})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("button",{onClick:()=>bb(a.id),className:"flex items-center gap-2 flex-1 px-3 py-2 text-left",children:[(0,b.jsx)("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:a.color}}),(0,b.jsx)("span",{className:"text-xs text-white truncate flex-1",children:a.name}),(0,b.jsxs)("span",{className:"text-[10px] text-zinc-500",children:[a.paneCount||0," panes"]}),a.isActive&&(0,b.jsx)("span",{className:"text-[10px] text-indigo-400",children:"active"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5 pr-2 opacity-0 group-hover:opacity-100",children:[(0,b.jsx)("button",{onClick:b=>{b.stopPropagation(),ap(a.id),ar(a.name)},className:"p-1 text-zinc-500 hover:text-white rounded",title:"Rename",children:(0,b.jsx)(p.Pencil,{className:"w-2.5 h-2.5"})}),!a.isActive&&ac.length>1&&(0,b.jsx)("button",{onClick:b=>{b.stopPropagation(),confirm(`Delete space "${a.name}" and all its panes?`)&&be(a.id)},className:"p-1 text-zinc-500 hover:text-red-400 rounded",title:"Delete",children:(0,b.jsx)(o.Trash2,{className:"w-2.5 h-2.5"})})]})]})},a.id))}),(0,b.jsxs)("div",{className:"border-t border-zinc-700/50 p-1.5 flex gap-1",children:[(0,b.jsxs)("button",{onClick:bd,className:"flex items-center gap-1.5 px-2.5 py-1.5 text-[11px] text-zinc-400 hover:text-white hover:bg-zinc-700 rounded transition-colors flex-1",children:[(0,b.jsx)(d.Plus,{className:"w-3 h-3"})," New Empty"]}),(0,b.jsxs)("button",{onClick:()=>{aj(!0),ah(!1)},className:"flex items-center gap-1.5 px-2.5 py-1.5 text-[11px] text-zinc-400 hover:text-white hover:bg-zinc-700 rounded transition-colors flex-1",children:[(0,b.jsx)(s.Copy,{className:"w-3 h-3"})," Duplicate Current"]})]})]})]}),(0,b.jsxs)("span",{className:"text-[11px] text-zinc-500",children:[bh.length," pane",1!==bh.length?"s":"",Y.size>0&&` + ${Y.size} popped out`]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[E&&ae&&(0,b.jsxs)("button",{onClick:async()=>{let a=!ae.collaboration;await fetch((0,F.api)(`/api/workspaces/${ae.id}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({collaboration:a})}),af(b=>b?{...b,collaboration:a}:b),ad(b=>b.map(b=>b.id===ae.id?{...b,collaboration:a}:b))},className:`flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-md border transition-colors ${ae.collaboration?"border-indigo-500/50 bg-indigo-600/20 text-indigo-400":"border-zinc-700 text-zinc-500 hover:text-zinc-300 hover:border-zinc-600"}`,title:ae.collaboration?"Collaboration enabled — click to disable":"Enable collaboration for this workspace",children:[(0,b.jsx)(y.Users,{className:"w-3.5 h-3.5"}),"Collab"]}),(0,b.jsxs)("button",{onClick:bf,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs border border-zinc-700 text-zinc-400 rounded-md hover:text-white hover:border-zinc-600 transition-colors",title:"Close space and return home",children:[(0,b.jsx)(u,{className:"w-3.5 h-3.5"}),"Close"]}),(0,b.jsxs)("button",{onClick:()=>U(!0),className:"flex items-center gap-1.5 px-3 py-1.5 text-xs bg-indigo-600 text-white rounded-md hover:bg-indigo-500 transition-colors",children:[(0,b.jsx)(d.Plus,{className:"w-3.5 h-3.5"}),"Add Pane"]})]})]}),ai&&(0,b.jsx)("div",{className:"border-b border-zinc-800 bg-zinc-900 px-4 py-3",children:(0,b.jsxs)("div",{className:"max-w-md flex items-center gap-2",children:[(0,b.jsx)(n,{className:"w-4 h-4 text-indigo-400 flex-shrink-0"}),(0,b.jsx)("input",{autoFocus:!0,type:"text",placeholder:"New space name...",value:ak,onChange:a=>al(a.target.value),onKeyDown:a=>"Enter"===a.key&&bc(),className:"flex-1 px-3 py-1.5 text-sm bg-zinc-800 border border-zinc-700 rounded-md focus:outline-none focus:border-indigo-500 text-white"}),(0,b.jsx)(B.ColorPicker,{value:am,onChange:an}),(0,b.jsx)("button",{onClick:bc,disabled:!ak.trim(),className:"px-3 py-1.5 text-xs bg-indigo-600 text-white rounded-md hover:bg-indigo-500 disabled:opacity-50",children:"Save"}),(0,b.jsx)("button",{onClick:()=>aj(!1),className:"p-1.5 text-zinc-400 hover:text-white",children:(0,b.jsx)(r.X,{className:"w-4 h-4"})})]})}),T&&(0,b.jsx)("div",{className:"border-b border-zinc-800 bg-zinc-900 px-4 py-4",children:(0,b.jsxs)("div",{className:"max-w-lg space-y-3",children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:"Add Pane"}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-[11px] text-zinc-400 mb-1.5 block",children:"Agent"}),(0,b.jsx)("div",{className:"grid grid-cols-3 gap-1.5",children:L.AGENT_LIST.map(a=>(0,b.jsxs)("button",{onClick:()=>{aB(a.id),aD("new"),aV(null),az("")},className:`flex items-center gap-2 px-3 py-2 rounded-md border text-left transition-colors ${aA===a.id?"border-indigo-500 bg-indigo-600/20 text-white":"border-zinc-700 text-zinc-400 hover:text-white hover:border-zinc-600"}`,children:[(0,b.jsx)("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:a.color}}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("div",{className:"text-xs font-medium truncate",children:a.name}),(0,b.jsx)("div",{className:"text-[10px] text-zinc-500 truncate",children:a.description})]})]},a.id))})]}),L.AGENT_TYPES[aA]?.supportsResume&&(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)("button",{onClick:()=>{aD("new"),aV(null),az("")},className:`px-3 py-1.5 text-xs rounded-md border transition-colors ${"new"===aC?"bg-indigo-600 border-indigo-500 text-white":"border-zinc-700 text-zinc-400 hover:text-white hover:border-zinc-600"}`,children:"New Session"}),(0,b.jsx)("button",{onClick:()=>aD("resume"),className:`px-3 py-1.5 text-xs rounded-md border transition-colors ${"resume"===aC?"bg-indigo-600 border-indigo-500 text-white":"border-zinc-700 text-zinc-400 hover:text-white hover:border-zinc-600"}`,children:"Resume Session"})]}),"custom"===aA&&(0,b.jsx)("input",{type:"text",placeholder:"Command to run (e.g. python agent.py)",value:aE,onChange:a=>aF(a.target.value),className:"w-full px-3 py-2 text-sm bg-zinc-800 border border-zinc-700 rounded-md focus:outline-none focus:border-indigo-500 text-white font-mono"}),(0,b.jsx)(J,{value:aG,onChange:aH}),(0,b.jsx)("input",{type:"text",placeholder:"Title (optional)",value:as,onChange:a=>at(a.target.value),className:"w-full px-3 py-2 text-sm bg-zinc-800 border border-zinc-700 rounded-md focus:outline-none focus:border-indigo-500 text-white"}),aG?(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-[11px] text-zinc-400 mb-1.5 block",children:"Working directory (on remote node)"}),(0,b.jsx)("input",{type:"text",placeholder:"e.g. /home/user/project or ~ for home",value:au,onChange:a=>av(a.target.value),className:"w-full px-3 py-2 text-sm bg-zinc-800 border border-zinc-700 rounded-md focus:outline-none focus:border-indigo-500 text-white font-mono"})]}):(0,b.jsx)(G,{value:au,onChange:av}),"claude"===aA&&"resume"===aC&&(0,b.jsxs)("div",{ref:aY,className:"relative",children:[aU?(0,b.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 text-sm bg-zinc-800 border border-zinc-700 rounded-md",children:[(0,b.jsx)(h.MessageSquare,{className:"w-3.5 h-3.5 text-indigo-400 flex-shrink-0"}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:"text-white truncate",children:aU.customName||aU.firstPrompt?.slice(0,60)||"Untitled"}),(0,b.jsxs)("div",{className:"text-[10px] text-zinc-500 flex items-center gap-2",children:[(0,b.jsx)("span",{children:aU.projectName}),(0,b.jsxs)("span",{children:[aU.messageCount," msgs"]}),(0,b.jsxs)("span",{className:"font-mono",children:[aU.sessionId.slice(0,8),"..."]})]})]}),(0,b.jsx)("button",{onClick:()=>{aV(null),aT(!0)},className:"text-zinc-400 hover:text-white text-xs",children:"Change"})]}):(0,b.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 text-sm bg-zinc-800 border border-zinc-700 rounded-md cursor-text",onClick:()=>aT(!0),children:[(0,b.jsx)(g.Search,{className:"w-3.5 h-3.5 text-zinc-500"}),(0,b.jsx)("input",{type:"text",placeholder:"Search sessions by name, prompt, or project...",value:aM,onChange:a=>{aN(a.target.value),aT(!0)},onFocus:()=>aT(!0),className:"flex-1 bg-transparent focus:outline-none text-white placeholder:text-zinc-500"}),au&&(0,b.jsx)("button",{onClick:a=>{a.stopPropagation(),aX(!aW)},className:`flex-shrink-0 px-1.5 py-0.5 text-[10px] rounded border transition-colors ${aW?"border-indigo-500/50 bg-indigo-600/20 text-indigo-400":"border-zinc-600 text-zinc-500 hover:text-zinc-400"}`,title:aW?"Showing sessions for this directory — click to show all":"Showing all sessions — click to filter by directory",children:aW?au.split("/").pop():"All"}),(0,b.jsx)(k.ChevronDown,{className:"w-3.5 h-3.5 text-zinc-500"})]}),aS&&!aU&&(0,b.jsx)("div",{className:"absolute z-50 top-full left-0 right-0 mt-1 max-h-[300px] overflow-y-auto bg-zinc-800 border border-zinc-700 rounded-md shadow-xl",children:aQ?(0,b.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,b.jsx)(e.Loader2,{className:"w-4 h-4 animate-spin text-zinc-400"}),(0,b.jsx)("span",{className:"text-xs text-zinc-400 ml-2",children:"Loading sessions..."})]}):0===aO.length?(0,b.jsx)("div",{className:"py-4 px-3 text-xs text-zinc-500 text-center",children:aM?"No sessions match your search":"No sessions found"}):aO.map(a=>(0,b.jsx)("button",{onClick:()=>{aV(a),az(a.sessionId),!au&&a.projectPath&&av(a.projectPath),as||at(a.customName||""),aT(!1)},className:"w-full text-left px-3 py-2.5 hover:bg-zinc-700 border-b border-zinc-700/50 last:border-0 transition-colors",children:(0,b.jsxs)("div",{className:"flex items-start gap-2",children:[(0,b.jsx)(h.MessageSquare,{className:"w-3.5 h-3.5 text-indigo-400 mt-0.5 flex-shrink-0"}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:"text-xs text-white truncate",children:a.customName||a.firstPrompt?.slice(0,70)||"Untitled session"}),(0,b.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,b.jsxs)("span",{className:"text-[10px] text-indigo-400/70 flex items-center gap-0.5",children:[(0,b.jsx)(i.FolderOpen,{className:"w-2.5 h-2.5"}),a.projectName]}),(0,b.jsxs)("span",{className:"text-[10px] text-zinc-500",children:[a.messageCount," msgs"]}),(0,b.jsxs)("span",{className:"text-[10px] text-zinc-500 flex items-center gap-0.5",children:[(0,b.jsx)(j.Clock,{className:"w-2.5 h-2.5"}),new Date(a.modified).toLocaleDateString()]}),a.starred&&(0,b.jsx)("span",{className:"text-[10px]",children:"★"})]}),a.tags?.length>0&&(0,b.jsx)("div",{className:"flex gap-1 mt-1",children:a.tags.map(a=>(0,b.jsx)("span",{className:"text-[9px] px-1.5 py-0.5 bg-zinc-700 rounded text-zinc-400",children:a},a))})]})]})},a.sessionId))})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-[11px] text-zinc-400 mb-1.5 block",children:"Color"}),(0,b.jsx)(B.ColorPicker,{value:aw,onChange:ax})]}),(0,b.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,b.jsx)("button",{onClick:a3,disabled:"custom"===aA&&!aE.trim(),className:"px-4 py-2 text-sm bg-indigo-600 text-white rounded-md hover:bg-indigo-500 disabled:opacity-50 disabled:cursor-not-allowed",children:"Create"}),(0,b.jsx)("button",{onClick:()=>U(!1),className:"px-4 py-2 text-sm border border-zinc-700 text-zinc-400 rounded-md hover:text-white hover:border-zinc-600",children:"Cancel"})]})]})}),Y.size>0&&(0,b.jsxs)("div",{className:"flex items-center gap-2 px-4 py-1.5 border-b border-zinc-800 bg-zinc-900/50",children:[(0,b.jsx)("span",{className:"text-[10px] text-zinc-500",children:"Popped out:"}),H.filter(a=>Y.has(a.id)).map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,b.jsxs)("button",{onClick:()=>a7(a),className:"flex items-center gap-1 px-2 py-0.5 text-[10px] bg-zinc-800 border border-zinc-700 rounded-l text-zinc-400 hover:text-white hover:border-zinc-600",title:"Focus popout window",children:[(0,b.jsx)("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:a.color}}),a.title]}),(0,b.jsx)("button",{onClick:()=>a9(a.id),className:"px-1 py-0.5 text-[10px] bg-zinc-800 border border-zinc-700 border-l-0 rounded-r text-zinc-500 hover:text-white hover:border-zinc-600",title:"Pop back into grid",children:(0,b.jsx)(v,{className:"w-2.5 h-2.5"})})]},a.id))]}),(0,b.jsxs)("div",{className:"flex-1 flex overflow-hidden min-h-0",children:[0===bh.length&&0===Y.size?(0,b.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,b.jsxs)("div",{className:"text-center space-y-3",children:[(0,b.jsx)("img",{src:`${C}/spaces_icon.png`,alt:"Spaces",className:"w-16 h-16 mx-auto opacity-30"}),(0,b.jsx)("p",{className:"text-zinc-500",children:"No panes yet."}),(0,b.jsx)("p",{className:"text-zinc-600 text-xs",children:"Add a pane to start a shell, Claude, Codex, Gemini, or any agent."}),(0,b.jsxs)("button",{onClick:()=>U(!0),className:"px-4 py-2 text-sm bg-indigo-600 text-white rounded-md hover:bg-indigo-500 inline-flex items-center gap-2",children:[(0,b.jsx)(d.Plus,{className:"w-4 h-4"}),"Add your first pane"]})]})}):0===bh.length?(0,b.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,b.jsxs)("div",{className:"text-center space-y-2",children:[(0,b.jsx)("p",{className:"text-zinc-500 text-sm",children:"All panes are popped out to separate windows."}),(0,b.jsxs)("button",{onClick:()=>U(!0),className:"px-3 py-1.5 text-xs text-zinc-400 hover:text-white border border-zinc-700 rounded-md hover:border-zinc-600 inline-flex items-center gap-1.5",children:[(0,b.jsx)(d.Plus,{className:"w-3.5 h-3.5"}),"Add another pane"]})]})}):(0,b.jsx)("div",{className:"flex-1 p-2 gap-2 overflow-auto h-full",style:{display:"grid",gridTemplateColumns:1===bh.length?"1fr":bh.length<=2||bh.length<=4?"repeat(2, 1fr)":"repeat(3, 1fr)",gridAutoRows:bh.length<=2?"1fr":"minmax(300px, 1fr)"},children:bh.map(c=>W&&W!==c.id?null:(0,b.jsx)(A.TerminalPane,{pane:c,onClose:a4,onUpdate:a5,isMaximized:W===c.id,onToggleMaximize:a6,onPopout:a8,terminalToken:a,workspaceCollaboration:ae?.collaboration},c.id))}),ae?.collaboration&&(0,b.jsx)(S,{workspaceId:ae?.id??null,panes:bh.map(a=>({id:a.id,title:a.title,agentType:a.agentType,color:a.color})),collapsed:aa,onToggle:()=>ab(!aa)})]})]}):(0,b.jsxs)("div",{className:"h-screen flex flex-col bg-zinc-950 text-zinc-100",children:[(0,b.jsx)("div",{className:"absolute top-4 left-4",children:(0,b.jsxs)("button",{onClick:()=>m.push("/"),className:"flex items-center gap-2 px-3 py-1.5 text-xs text-zinc-500 hover:text-white hover:bg-zinc-800 rounded-md transition-colors",children:[(0,b.jsx)(t.Home,{className:"w-3.5 h-3.5"}),"Home"]})}),(0,b.jsx)("div",{className:"flex-1 flex items-center justify-center p-8",children:(0,b.jsxs)("div",{className:"w-full max-w-2xl",children:[(0,b.jsxs)("div",{className:"text-center mb-10",children:[(0,b.jsx)("img",{src:`${C}/spaces_icon.png`,alt:"Spaces",className:"w-16 h-16 mx-auto mb-4"}),(0,b.jsx)("h1",{className:"text-2xl font-bold mb-2",children:"Spaces"}),(0,b.jsx)("p",{className:"text-zinc-400 text-sm",children:"Choose a workspace to open, or create a new one."})]}),P?(0,b.jsx)("div",{className:"flex justify-center py-12",children:(0,b.jsx)(e.Loader2,{className:"w-6 h-6 animate-spin text-indigo-500"})}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"grid grid-cols-2 gap-3 mb-6",children:ac.map(a=>(0,b.jsxs)("button",{onClick:()=>bb(a.id),className:"flex items-center gap-3 p-4 bg-zinc-900 border border-zinc-800 rounded-lg hover:border-zinc-600 hover:bg-zinc-800/50 transition-colors text-left group",children:[(0,b.jsx)("span",{className:"w-3.5 h-3.5 rounded-full flex-shrink-0",style:{backgroundColor:a.color}}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:"text-sm font-medium text-white truncate",children:a.name}),(0,b.jsxs)("div",{className:"text-xs text-zinc-500 mt-0.5",children:[a.paneCount||0," pane",1!==(a.paneCount||0)?"s":"",a.isActive&&(0,b.jsx)("span",{className:"text-indigo-400 ml-2",children:"last active"})]})]}),(0,b.jsx)(f.Terminal,{className:"w-4 h-4 text-zinc-600 group-hover:text-zinc-400 transition-colors"})]},a.id))}),(0,b.jsx)("div",{className:"flex justify-center",children:(0,b.jsxs)("button",{onClick:bd,className:"flex items-center gap-2 px-4 py-2.5 text-sm border border-zinc-700 text-zinc-400 rounded-lg hover:text-white hover:border-zinc-500 transition-colors",children:[(0,b.jsx)(d.Plus,{className:"w-4 h-4"}),"New Workspace"]})}),D&&aI.isLoading&&(0,b.jsxs)("div",{className:"flex items-center justify-center gap-2 py-4 mt-6 border-t border-zinc-800",children:[(0,b.jsx)(e.Loader2,{className:"w-4 h-4 animate-spin text-zinc-500"}),(0,b.jsx)("span",{className:"text-xs text-zinc-500",children:"Loading network spaces..."})]}),D&&aI.data?.remote&&aI.data.remote.length>0&&(0,b.jsxs)("div",{className:"mt-6 border-t border-zinc-800 pt-6",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,b.jsx)(w.Globe,{className:"w-4 h-4 text-zinc-500"}),(0,b.jsx)("h2",{className:"text-sm font-medium text-zinc-400",children:"Network Spaces"})]}),aI.data.remote.map(a=>(0,b.jsxs)("div",{className:"mb-3",children:[(0,b.jsxs)("button",{onClick:()=>aL(a.nodeId),className:"flex items-center gap-2 w-full px-2 py-1.5 text-left text-xs text-zinc-400 hover:text-white rounded-md hover:bg-zinc-800/50 transition-colors",children:[aJ.has(a.nodeId)?(0,b.jsx)(l.ChevronRight,{className:"w-3.5 h-3.5 text-zinc-600"}):(0,b.jsx)(k.ChevronDown,{className:"w-3.5 h-3.5 text-zinc-600"}),(0,b.jsx)(w.Globe,{className:"w-3 h-3 text-zinc-600"}),(0,b.jsx)("span",{className:"font-medium",children:a.nodeName}),(0,b.jsxs)("span",{className:"text-zinc-600",children:[a.workspaces.length," space",1!==a.workspaces.length?"s":""]})]}),!aJ.has(a.nodeId)&&(0,b.jsx)("div",{className:"grid grid-cols-2 gap-2 mt-2 ml-5",children:a.workspaces.map(c=>(0,b.jsxs)("button",{onClick:()=>{m.push(`/terminal/remote/${a.nodeId}/${c.id}`)},className:"flex items-center gap-3 p-3 bg-zinc-900/50 border border-zinc-800/50 rounded-lg hover:border-zinc-600 hover:bg-zinc-800/30 transition-colors text-left group",children:[(0,b.jsx)("span",{className:"w-3 h-3 rounded-full flex-shrink-0 ring-1 ring-zinc-700",style:{backgroundColor:c.color}}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:"text-xs font-medium text-zinc-300 truncate",children:c.name}),(0,b.jsxs)("div",{className:"text-[10px] text-zinc-600 mt-0.5",children:[c.paneCount||0," pane",1!==(c.paneCount||0)?"s":""]})]}),(0,b.jsx)(w.Globe,{className:"w-3 h-3 text-zinc-700 group-hover:text-zinc-500 transition-colors"})]},`${a.nodeId}-${c.id}`))})]},a.nodeId)),aI.data.errors&&aI.data.errors.length>0&&(0,b.jsx)("div",{className:"mt-3 space-y-1",children:aI.data.errors.map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 text-[10px] text-zinc-600",children:[(0,b.jsx)(x.AlertCircle,{className:"w-3 h-3 text-red-500/50"}),(0,b.jsxs)("span",{children:[a.nodeName,": ",a.error]})]},a.nodeId))})]})]})]})})]})}a.s(["default",()=>W],66490)}];
1
+ module.exports=[66490,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(15618),e=a.i(96221),f=a.i(80386),g=a.i(87532),h=a.i(63588),i=a.i(96101),j=a.i(41710),k=a.i(5784),l=a.i(50522),m=a.i(70106);let n=(0,m.default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var o=a.i(81560),p=a.i(99464),q=a.i(33441),r=a.i(33508),s=a.i(5151),t=a.i(81010);let u=(0,m.default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),v=(0,m.default)("arrow-left-to-line",[["path",{d:"M3 19V5",key:"rwsyhb"}],["path",{d:"m13 6-6 6 6 6",key:"1yhaz7"}],["path",{d:"M7 12h14",key:"uoisry"}]]);var w=a.i(44494),x=a.i(92e3),y=a.i(60246),z=a.i(50944),A=a.i(55402),B=a.i(63002);let C=(0,m.default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);var D=a.i(67552),E=a.i(21161),F=a.i(19032);function G({value:a,onChange:d}){let[f,g]=(0,c.useState)(!1),[h,j]=(0,c.useState)([]),[k,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(null),[r,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)("list"),v=(0,c.useRef)(null);(0,c.useEffect)(()=>{fetch((0,F.api)("/api/config")).then(a=>a.json()).then(a=>{j(a.devDirectories||[]),m(!0)}).catch(()=>m(!0))},[]),(0,c.useEffect)(()=>{f&&"browse"===t&&n&&(s(!0),fetch((0,F.api)(`/api/folders?path=${encodeURIComponent(n)}`)).then(a=>a.json()).then(a=>{q(a),s(!1)}).catch(()=>s(!1)))},[f,t,n]),(0,c.useEffect)(()=>{let a=a=>{v.current&&!v.current.contains(a.target)&&g(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[]);let w=()=>{f?g(!1):(1===h.length?(u("browse"),o(h[0])):u("list"),g(!0))},x=a=>{d(a),g(!1)},y=a=>{o(a)},z=h.find(a=>p?.current===a||p?.current?.startsWith(a+"/")),A=z?.split("/").pop()||"",B=z&&p?.current?p.current.slice(z.length):"",G=B?B.split("/").filter(Boolean):[];return(0,b.jsxs)("div",{ref:v,className:"relative",children:[(0,b.jsxs)("div",{className:"flex items-center gap-0",children:[(0,b.jsx)("input",{type:"text",placeholder:"Working directory",value:a,onChange:a=>d(a.target.value),onFocus:()=>{f||w()},className:"flex-1 px-3 py-2 text-sm bg-zinc-800 border border-zinc-700 rounded-l-md focus:outline-none focus:border-indigo-500 text-white font-mono"}),(0,b.jsx)("button",{type:"button",onClick:w,className:"px-3 py-2 text-sm bg-zinc-700 border border-zinc-700 border-l-0 rounded-r-md hover:bg-zinc-600 text-zinc-300 hover:text-white transition-colors",title:"Browse folders",children:(0,b.jsx)(i.FolderOpen,{className:"w-4 h-4"})})]}),f&&(0,b.jsxs)("div",{className:"absolute z-50 top-full left-0 right-0 mt-1 bg-zinc-800 border border-zinc-700 rounded-md shadow-xl overflow-hidden",children:[k?0===h.length&&"list"===t?(0,b.jsxs)("div",{className:"py-6 px-4 text-center",children:[(0,b.jsx)(E.Settings,{className:"w-5 h-5 text-zinc-500 mx-auto mb-2"}),(0,b.jsx)("p",{className:"text-xs text-zinc-400 mb-1",children:"No development directories configured"}),(0,b.jsx)("p",{className:"text-[11px] text-zinc-500",children:"Add them in Settings to browse project folders here."})]}):"list"===t?(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"px-3 py-1.5 border-b border-zinc-700/50 text-[11px] text-zinc-500 font-medium",children:"Development Directories"}),(0,b.jsx)("div",{className:"max-h-[250px] overflow-y-auto",children:h.map(a=>(0,b.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-xs hover:bg-zinc-700 transition-colors group",onClick:()=>{u("browse"),o(a)},onDoubleClick:()=>x(a),title:"Click to browse, double-click to select",children:[(0,b.jsx)(C,{className:"w-3.5 h-3.5 text-amber-500/70"}),(0,b.jsx)("span",{className:"font-mono text-white truncate flex-1 text-left",children:a}),(0,b.jsx)(l.ChevronRight,{className:"w-3 h-3 text-zinc-600 group-hover:text-zinc-400"})]},a))})]}):(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center gap-0.5 px-2 py-1.5 border-b border-zinc-700/50 overflow-x-auto text-[11px] flex-nowrap",children:[h.length>1&&(0,b.jsx)("button",{onClick:()=>{u("list"),q(null)},className:"text-zinc-400 hover:text-white flex-shrink-0 p-0.5 mr-0.5",title:"Back to dev directories",children:(0,b.jsx)(D.ChevronUp,{className:"w-3 h-3"})}),(0,b.jsx)("button",{onClick:()=>z&&y(z),className:"text-zinc-400 hover:text-white flex-shrink-0",children:A}),G.map((a,c)=>{let d=z+"/"+G.slice(0,c+1).join("/");return(0,b.jsxs)("span",{className:"flex items-center gap-0.5 flex-shrink-0",children:[(0,b.jsx)(l.ChevronRight,{className:"w-2.5 h-2.5 text-zinc-600"}),(0,b.jsx)("button",{onClick:()=>y(d),className:"text-zinc-400 hover:text-white hover:underline",children:a})]},c)})]}),(0,b.jsx)("div",{className:"max-h-[250px] overflow-y-auto",children:r||!p?(0,b.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,b.jsx)(e.Loader2,{className:"w-4 h-4 animate-spin text-zinc-400"})}):p.error?(0,b.jsx)("div",{className:"py-4 px-3 text-xs text-red-400 text-center",children:p.error}):(0,b.jsxs)(b.Fragment,{children:[p?.parent&&(0,b.jsxs)("button",{onClick:()=>y(p.parent),className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-zinc-400 hover:text-white hover:bg-zinc-700/50 transition-colors border-b border-zinc-700/30",children:[(0,b.jsx)(D.ChevronUp,{className:"w-3.5 h-3.5"}),(0,b.jsx)("span",{children:".."})]}),(0,b.jsxs)("button",{onClick:()=>x(p.current),className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-indigo-400 hover:bg-indigo-500/10 transition-colors border-b border-zinc-700/30 font-medium",children:[(0,b.jsx)(i.FolderOpen,{className:"w-3.5 h-3.5"}),(0,b.jsx)("span",{children:"Select this folder"}),(0,b.jsx)("span",{className:"ml-auto text-[10px] text-zinc-500 font-mono truncate max-w-[200px]",children:p.current.split("/").pop()})]}),p?.folders.length===0?(0,b.jsx)("div",{className:"py-3 px-3 text-[11px] text-zinc-500 text-center",children:"No subfolders"}):p?.folders.map(a=>(0,b.jsxs)("button",{onClick:()=>y(a.path),onDoubleClick:()=>x(a.path),className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-white hover:bg-zinc-700 transition-colors",title:"Click to open, double-click to select",children:[(0,b.jsx)(C,{className:"w-3.5 h-3.5 text-amber-500/70"}),(0,b.jsx)("span",{className:"truncate",children:a.name})]},a.path))]})})]}):(0,b.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,b.jsx)(e.Loader2,{className:"w-4 h-4 animate-spin text-zinc-400"})}),(0,b.jsx)("div",{className:"border-t border-zinc-700/50 px-2 py-1 flex justify-end",children:(0,b.jsx)("button",{onClick:()=>g(!1),className:"text-[11px] text-zinc-500 hover:text-white px-2 py-0.5",children:"Close"})})]})]})}var H=a.i(1279),I=a.i(97498);function J({value:a,onChange:c}){let{hasNetwork:d}=(0,I.useTier)(),{data:e}=(0,H.useNodes)(d);return Array.isArray(e)&&0!==e.length?(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-[11px] text-zinc-400 mb-1.5 block",children:"Node"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(w.Globe,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-zinc-500"}),(0,b.jsxs)("select",{value:a,onChange:a=>c(a.target.value),className:"w-full pl-8 pr-3 py-2 text-sm bg-zinc-800 border border-zinc-700 rounded-md focus:outline-none focus:border-indigo-500 text-white appearance-none",children:[(0,b.jsx)("option",{value:"",children:"Local (this machine)"}),e.map(a=>(0,b.jsx)("option",{value:a.id,disabled:"offline"===a.status,children:"offline"===a.status?`${a.name} (offline)`:a.name},a.id))]})]})]}):null}var K=a.i(79082),L=a.i(5699),M=a.i(59603),N=a.i(92759);let O=(0,m.default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var P=a.i(33217),Q=a.i(70025),R=a.i(37927);function S({workspaceId:a,panes:d,collapsed:e,onToggle:f}){let g,i,j,k,[m,n]=(0,c.useState)("messages"),[p,q]=(0,c.useState)(""),r=(0,c.useRef)(null),{data:s=[]}=(0,P.useQuery)({queryKey:["workspace-messages",a,void 0],queryFn:async()=>{let b=new URLSearchParams;return(await fetch((0,F.api)(`/api/workspaces/${a}/messages?${b}`))).json()},enabled:!!a,refetchInterval:3e3}),{data:t=[]}=(0,P.useQuery)({queryKey:["workspace-context",a],queryFn:async()=>(await fetch((0,F.api)(`/api/workspaces/${a}/context`))).json(),enabled:!!a}),u=(g=(0,R.useQueryClient)(),(0,Q.useMutation)({mutationFn:async b=>(await fetch((0,F.api)(`/api/workspaces/${a}/messages`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...b,senderName:b.senderName||"User",type:b.type||"message"})})).json(),onSuccess:()=>{g.invalidateQueries({queryKey:["workspace-messages",a]})}})),v=(i=(0,R.useQueryClient)(),(0,Q.useMutation)({mutationFn:async({messageId:b,status:c})=>(await fetch((0,F.api)(`/api/workspaces/${a}/messages/${b}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:c})})).json(),onSuccess:()=>{i.invalidateQueries({queryKey:["workspace-messages",a]})}})),w=(j=(0,R.useQueryClient)(),(0,Q.useMutation)({mutationFn:async()=>{await fetch((0,F.api)(`/api/workspaces/${a}/messages`),{method:"DELETE"})},onSuccess:()=>{j.invalidateQueries({queryKey:["workspace-messages",a]})}})),x=(k=(0,R.useQueryClient)(),(0,Q.useMutation)({mutationFn:async()=>{await fetch((0,F.api)(`/api/workspaces/${a}/context`),{method:"DELETE"})},onSuccess:()=>{k.invalidateQueries({queryKey:["workspace-context",a]})}})),y=s.filter(a=>"pending_approval"===a.status).length;(0,c.useEffect)(()=>{r.current&&(r.current.scrollTop=r.current.scrollHeight)},[s]);let z=()=>{p.trim()&&a&&(u.mutate({content:p.trim()}),q(""))};return e?(0,b.jsxs)("button",{onClick:f,className:"flex-shrink-0 w-10 border-l border-zinc-800 bg-zinc-900 flex flex-col items-center pt-3 gap-2",children:[(0,b.jsx)(O,{className:"w-4 h-4 text-zinc-400"}),(0,b.jsx)(h.MessageSquare,{className:"w-4 h-4 text-zinc-400"}),y>0&&(0,b.jsx)("span",{className:"bg-amber-500 text-black text-xs font-bold rounded-full w-5 h-5 flex items-center justify-center",children:y})]}):(0,b.jsxs)("div",{className:"flex-shrink-0 w-80 border-l border-zinc-800 bg-zinc-900 flex flex-col",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-zinc-800",children:[(0,b.jsxs)("div",{className:"flex gap-1",children:[(0,b.jsxs)("button",{onClick:()=>n("messages"),className:`px-2 py-1 text-xs rounded ${"messages"===m?"bg-zinc-700 text-white":"text-zinc-400 hover:text-zinc-300"}`,children:["Messages",y>0&&(0,b.jsx)("span",{className:"ml-1 bg-amber-500 text-black text-xs font-bold rounded-full px-1.5",children:y})]}),(0,b.jsx)("button",{onClick:()=>n("context"),className:`px-2 py-1 text-xs rounded ${"context"===m?"bg-zinc-700 text-white":"text-zinc-400 hover:text-zinc-300"}`,children:"Context"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsx)("button",{onClick:()=>"messages"===m?w.mutate():x.mutate(),className:"text-zinc-500 hover:text-red-400",title:"messages"===m?"Clear all messages":"Clear all context",children:(0,b.jsx)(o.Trash2,{className:"w-3.5 h-3.5"})}),(0,b.jsx)("button",{onClick:f,className:"text-zinc-400 hover:text-zinc-300",children:(0,b.jsx)(l.ChevronRight,{className:"w-4 h-4"})})]})]}),"messages"===m&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{ref:r,className:"flex-1 overflow-y-auto p-2 space-y-2",children:[[...s].reverse().map(a=>(0,b.jsx)(T,{message:a,panes:d,onApprove:()=>v.mutate({messageId:a.id,status:"approved"}),onReject:()=>v.mutate({messageId:a.id,status:"rejected"})},a.id)),0===s.length&&(0,b.jsx)("p",{className:"text-zinc-500 text-xs text-center py-8",children:"No messages yet. Agents will appear here."})]}),(0,b.jsx)("div",{className:"border-t border-zinc-800 p-2",children:(0,b.jsxs)("div",{className:"flex gap-1",children:[(0,b.jsx)("input",{value:p,onChange:a=>q(a.target.value),onKeyDown:a=>"Enter"===a.key&&!a.shiftKey&&z(),placeholder:"Message workspace...",className:"flex-1 bg-zinc-800 border border-zinc-700 rounded px-2 py-1 text-sm text-zinc-200 placeholder-zinc-500 focus:outline-none focus:border-zinc-600"}),(0,b.jsx)("button",{onClick:z,disabled:!p.trim(),className:"px-2 py-1 bg-indigo-600 hover:bg-indigo-500 disabled:bg-zinc-700 disabled:text-zinc-500 rounded text-sm",children:(0,b.jsx)(N.Send,{className:"w-3.5 h-3.5"})})]})})]}),"context"===m&&(0,b.jsx)(U,{workspaceId:a,context:t})]})}function T({message:a,panes:c,onApprove:d,onReject:e}){let f=c.find(b=>b.id===a.paneId),g="pending_approval"===a.status,h="rejected"===a.status;return(0,b.jsxs)("div",{className:`rounded p-2 text-xs ${g?"bg-amber-950/50 border border-amber-800/50":h?"bg-zinc-800/50 opacity-50":"bg-zinc-800/50"}`,children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,b.jsxs)("span",{className:"font-medium text-zinc-300",children:[f&&(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full mr-1",style:{backgroundColor:f.color||"#6366f1"}}),a.senderName]}),(0,b.jsx)("span",{className:"text-zinc-500",children:new Date(a.created).toLocaleTimeString()})]}),(0,b.jsx)("p",{className:"text-zinc-300 whitespace-pre-wrap",children:a.content}),g&&(0,b.jsxs)("div",{className:"flex gap-1 mt-2",children:[(0,b.jsxs)("button",{onClick:d,className:"flex items-center gap-1 px-2 py-0.5 bg-green-700 hover:bg-green-600 rounded text-white text-xs",children:[(0,b.jsx)(q.Check,{className:"w-3 h-3"})," Approve"]}),(0,b.jsxs)("button",{onClick:e,className:"flex items-center gap-1 px-2 py-0.5 bg-zinc-700 hover:bg-zinc-600 rounded text-zinc-300 text-xs",children:[(0,b.jsx)(r.X,{className:"w-3 h-3"})," Reject"]})]}),"rejected"===a.status&&(0,b.jsx)("span",{className:"text-red-400 text-xs mt-1 block",children:"Rejected"})]})}function U({workspaceId:a,context:d}){let e,f,[g,h]=(0,c.useState)(""),[i,j]=(0,c.useState)(""),k=(e=(0,R.useQueryClient)(),(0,Q.useMutation)({mutationFn:async({key:b,value:c})=>(await fetch((0,F.api)(`/api/workspaces/${a}/context/${encodeURIComponent(b)}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:c})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["workspace-context",a]})}})),l=(f=(0,R.useQueryClient)(),(0,Q.useMutation)({mutationFn:async b=>{await fetch((0,F.api)(`/api/workspaces/${a}/context/${encodeURIComponent(b)}`),{method:"DELETE"})},onSuccess:()=>{f.invalidateQueries({queryKey:["workspace-context",a]})}})),m=()=>{g.trim()&&i.trim()&&(k.mutate({key:g.trim(),value:i.trim()}),h(""),j(""))};return(0,b.jsxs)("div",{className:"flex-1 overflow-y-auto p-2 space-y-2",children:[d.map(a=>(0,b.jsxs)("div",{className:"bg-zinc-800/50 rounded p-2 text-xs",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,b.jsx)("span",{className:"font-mono font-medium text-indigo-300",children:a.key}),(0,b.jsx)("button",{onClick:()=>l.mutate(a.key),className:"text-zinc-500 hover:text-red-400",children:(0,b.jsx)(r.X,{className:"w-3 h-3"})})]}),(0,b.jsx)("p",{className:"text-zinc-300 whitespace-pre-wrap font-mono text-xs",children:a.value}),(0,b.jsxs)("span",{className:"text-zinc-500 text-xs",children:["by ",a.updatedBy]})]},a.key)),(0,b.jsxs)("div",{className:"border-t border-zinc-800 pt-2 space-y-1",children:[(0,b.jsx)("input",{value:g,onChange:a=>h(a.target.value),placeholder:"Key",className:"w-full bg-zinc-800 border border-zinc-700 rounded px-2 py-1 text-xs text-zinc-200 placeholder-zinc-500 focus:outline-none"}),(0,b.jsx)("input",{value:i,onChange:a=>j(a.target.value),placeholder:"Value",onKeyDown:a=>"Enter"===a.key&&m(),className:"w-full bg-zinc-800 border border-zinc-700 rounded px-2 py-1 text-xs text-zinc-200 placeholder-zinc-500 focus:outline-none"}),(0,b.jsx)("button",{onClick:m,disabled:!g.trim()||!i.trim(),className:"w-full px-2 py-1 bg-indigo-600 hover:bg-indigo-500 disabled:bg-zinc-700 disabled:text-zinc-500 rounded text-xs",children:"Add Entry"})]})]})}var V=a.i(58037);function W(){return(0,b.jsx)(K.TotpGate,{children:a=>(0,b.jsx)(X,{terminalToken:a})})}function X({terminalToken:a}){let m=(0,z.useRouter)(),{basePath:C,hasNetwork:D,hasCollaboration:E}=(0,I.useTier)(),[H,K]=(0,c.useState)([]),[N,O]=(0,c.useState)(!0),[P,Q]=(0,c.useState)(!0),[T,U]=(0,c.useState)(!1),[W,X]=(0,c.useState)(null),[Y,Z]=(0,c.useState)(new Set),[$,_]=(0,c.useState)(!1),[aa,ab]=(0,c.useState)(!0);!function(){let a=(0,R.useQueryClient)(),{hasCollaboration:b}=(0,I.useTier)();(0,c.useEffect)(()=>{if(!b)return;let c=new EventSource((0,F.api)("/api/events")),d=()=>{a.invalidateQueries({queryKey:["workspace-messages"]})},e=()=>{a.invalidateQueries({queryKey:["workspace-context"]})};return c.addEventListener("workspace:message",d),c.addEventListener("workspace:request",d),c.addEventListener("workspace:context_updated",e),()=>{c.removeEventListener("workspace:message",d),c.removeEventListener("workspace:request",d),c.removeEventListener("workspace:context_updated",e),c.close()}},[a,b])}();let[ac,ad]=(0,c.useState)([]),[ae,af]=(0,c.useState)(null),[ag,ah]=(0,c.useState)(!1),[ai,aj]=(0,c.useState)(!1),[ak,al]=(0,c.useState)(""),[am,an]=(0,c.useState)("#6366f1"),[ao,ap]=(0,c.useState)(null),[aq,ar]=(0,c.useState)(""),[as,at]=(0,c.useState)(""),[au,av]=(0,c.useState)(""),[aw,ax]=(0,c.useState)("#6366f1"),[ay,az]=(0,c.useState)(""),[aA,aB]=(0,c.useState)("shell"),[aC,aD]=(0,c.useState)("new"),[aE,aF]=(0,c.useState)(""),[aG,aH]=(0,c.useState)(""),aI=(0,M.useRemoteWorkspaces)(),[aJ,aK]=(0,c.useState)(new Set),aL=(0,c.useCallback)(a=>{aK(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),[aM,aN]=(0,c.useState)(""),[aO,aP]=(0,c.useState)([]),[aQ,aR]=(0,c.useState)(!1),[aS,aT]=(0,c.useState)(!1),[aU,aV]=(0,c.useState)(null),[aW,aX]=(0,c.useState)(!0),aY=(0,c.useRef)(null),aZ=(0,c.useRef)(null),a$=(0,c.useRef)(null),a_=(0,c.useCallback)(async()=>{let a=await fetch((0,F.api)("/api/workspaces")),b=await a.json();ad(b);let c=b.find(a=>a.isActive);return af(c||null),Q(!1),c||null},[]),a0=(0,c.useCallback)(async()=>{let a=await fetch((0,F.api)("/api/panes")),b=await a.json();K(b);let c=new Set;for(let a of b)a.isPopout&&c.add(a.id);Z(c),O(!1)},[]);(0,c.useEffect)(()=>{a_()},[a_]),(0,c.useEffect)(()=>{$&&a0()},[$,a0]),(0,c.useEffect)(()=>{let a=new BroadcastChannel("spaces-panes");return a$.current=a,a.onmessage=a=>{let b=a.data;"popout-opened"===b.type?Z(a=>new Set(a).add(b.paneId)):"popout-closed"===b.type?(Z(a=>{let c=new Set(a);return c.delete(b.paneId),c}),K(a=>a.map(a=>a.id===b.paneId?{...a,isPopout:!1}:a))):"pane-updated"===b.type&&K(a=>a.map(a=>a.id===b.paneId?{...a,...b.data}:a))},()=>a.close()},[a0]);let[a1,a2]=(0,c.useState)(0);(0,c.useEffect)(()=>{if(!N)for(let a of H)a.isPopout&&a7(a)},[N,a1]),(0,c.useEffect)(()=>{if("claude"!==aA||"resume"!==aC)return;aR(!0);let a=setTimeout(()=>{let a=new URLSearchParams({sortBy:"modified",sortDir:"DESC",limit:"200"});aM&&a.set("search",aM),aW&&au&&a.set("projectPath",au),a.set("agentType",aA),fetch((0,F.api)(`/api/sessions?${a}`)).then(a=>a.json()).then(a=>{aP(a.sessions||[]),aR(!1)}).catch(()=>aR(!1))},300*!!aM);return()=>clearTimeout(a)},[aA,aC,aM,aW,au]),(0,c.useEffect)(()=>{function a(a){aY.current&&!aY.current.contains(a.target)&&aT(!1),aZ.current&&!aZ.current.contains(a.target)&&ah(!1)}return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[]);let a3=(0,c.useCallback)(async()=>{let a,b=L.AGENT_TYPES[aA],c=au||aU?.projectPath||"/";"shell"!==aA&&(a="resume"===aC&&b?.supportsResume?aU?.sessionId||ay:"new");let d=as||(aU?aU.customName||aU.firstPrompt?.slice(0,50)||b?.name||"Agent":"")||("shell"===aA?"Terminal":b?.name||"Agent"),e=ae?.collaboration&&"shell"!==aA,f=await fetch((0,F.api)("/api/panes"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:d,color:aw,cwd:c,claudeSessionId:a,agentType:aA,customCommand:"custom"===aA?aE:void 0,nodeId:aG||void 0,isCollaborating:e||void 0})}),g=await f.json();K(a=>[...a,g]),(0,V.track)("pane_created",{agentType:aA}),U(!1),at(""),av(""),ax("#6366f1"),az(""),aB("shell"),aD("new"),aF(""),aH(""),aV(null),aN("")},[as,au,aw,ay,aA,aC,aE,aG,aU]),a4=(0,c.useCallback)(async a=>{let b=H.find(b=>b.id===a);await fetch((0,F.api)(`/api/panes/${a}`),{method:"DELETE"}),K(b=>b.filter(b=>b.id!==a)),b&&(0,V.track)("pane_closed",{agentType:b.agentType}),W===a&&X(null),Z(b=>{let c=new Set(b);return c.delete(a),c})},[W,H]),a5=(0,c.useCallback)(async(a,b)=>{await fetch((0,F.api)(`/api/panes/${a}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),K(c=>c.map(c=>c.id===a?{...c,...b}:c))},[]),a6=(0,c.useCallback)(a=>{X(b=>b===a?null:a)},[]),a7=(0,c.useCallback)(a=>{let b=a.winWidth||900,c=a.winHeight||600,d=a.winX??Math.round(screen.width/2-b/2),e=a.winY??Math.round(screen.height/2-c/2),f=`left=${d},top=${e},width=${b},height=${c},menubar=no,toolbar=no,location=no,status=no`;window.open((0,F.api)(`/terminal/pane/${a.id}`),`spaces-pane-${a.id}`,f),Z(b=>new Set(b).add(a.id)),fetch((0,F.api)(`/api/panes/${a.id}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isPopout:!0,winX:d,winY:e,winWidth:b,winHeight:c})})},[]),a8=(0,c.useCallback)(a=>{let b=H.find(b=>b.id===a);b&&a7(b)},[H,a7]),a9=(0,c.useCallback)(async a=>{a$.current?.postMessage({type:"close-popouts"}),await fetch((0,F.api)(`/api/panes/${a}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isPopout:!1})}),Z(b=>{let c=new Set(b);return c.delete(a),c})},[]),ba=(0,c.useCallback)(()=>{Y.size>0&&(a$.current?.postMessage({type:"close-popouts"}),Z(new Set))},[Y]),bb=(0,c.useCallback)(async a=>{ba(),await fetch((0,F.api)("/api/workspaces"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"switch",workspaceId:a})}),X(null),await a_(),await a0(),ah(!1),$?(0,V.track)("workspace_switched"):(0,V.track)("workspace_entered"),_(!0),a2(a=>a+1)},[a_,a0,ba,$]),bc=(0,c.useCallback)(async()=>{ak.trim()&&ae&&(await fetch((0,F.api)("/api/workspaces"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"duplicate",sourceId:ae.id,name:ak.trim(),color:am})}),al(""),an("#6366f1"),aj(!1),await a_())},[ak,am,ae,a_]),bd=(0,c.useCallback)(async()=>{let a=await fetch((0,F.api)("/api/workspaces"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"New Space",color:"#6366f1"})}),b=await a.json();(0,V.track)("workspace_created"),await bb(b.id)},[bb]),be=(0,c.useCallback)(async a=>{ba(),await fetch((0,F.api)(`/api/workspaces/${a}`),{method:"DELETE"}),(0,V.track)("workspace_deleted"),await a_(),await a0(),ah(!1)},[a_,a0,ba]),bf=(0,c.useCallback)(()=>{ba(),K([]),_(!1)},[ba]),bg=(0,c.useCallback)(async(a,b)=>{await fetch((0,F.api)(`/api/workspaces/${a}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b})}),ap(null),await a_()},[a_]),bh=H.filter(a=>!Y.has(a.id));return $?N?(0,b.jsx)("div",{className:"flex items-center justify-center h-screen bg-zinc-950",children:(0,b.jsx)(e.Loader2,{className:"w-6 h-6 animate-spin text-indigo-500"})}):(0,b.jsxs)("div",{className:"h-screen flex flex-col bg-zinc-950 text-zinc-100",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 border-b border-zinc-800 flex-shrink-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("button",{onClick:bf,className:"p-1.5 -ml-1 text-zinc-500 hover:text-white hover:bg-zinc-800 rounded-md transition-colors",title:"Close space and go home",children:(0,b.jsx)(t.Home,{className:"w-4 h-4"})}),(0,b.jsx)("div",{className:"w-px h-4 bg-zinc-800"}),(0,b.jsx)("h1",{className:"text-sm font-semibold",children:"Spaces"}),(0,b.jsxs)("div",{ref:aZ,className:"relative",children:[(0,b.jsxs)("button",{onClick:()=>ah(!ag),className:"flex items-center gap-1.5 px-2.5 py-1 text-xs bg-zinc-800 border border-zinc-700 rounded-md hover:border-zinc-600 transition-colors",children:[ae&&(0,b.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:ae.color}}),(0,b.jsx)("span",{className:"max-w-[150px] truncate",children:ae?.name||"No space"}),(0,b.jsx)(k.ChevronDown,{className:"w-3 h-3 text-zinc-500"})]}),ag&&(0,b.jsxs)("div",{className:"absolute z-50 top-full left-0 mt-1 w-72 bg-zinc-800 border border-zinc-700 rounded-md shadow-xl overflow-hidden",children:[(0,b.jsx)("div",{className:"p-2 border-b border-zinc-700/50 text-[10px] text-zinc-500 uppercase tracking-wider font-medium",children:"Switch Space"}),(0,b.jsx)("div",{className:"max-h-[300px] overflow-y-auto",children:ac.map(a=>(0,b.jsx)("div",{className:"flex items-center gap-2 hover:bg-zinc-700/50 transition-colors group",children:ao===a.id?(0,b.jsxs)("div",{className:"flex items-center gap-1 flex-1 px-3 py-2",children:[(0,b.jsx)("input",{autoFocus:!0,value:aq,onChange:a=>ar(a.target.value),onKeyDown:b=>{"Enter"===b.key&&bg(a.id,aq),"Escape"===b.key&&ap(null)},className:"flex-1 bg-transparent border border-zinc-600 rounded px-1.5 py-0.5 text-xs focus:outline-none focus:border-indigo-400"}),(0,b.jsx)("button",{onClick:()=>bg(a.id,aq),className:"text-green-400 hover:text-green-300",children:(0,b.jsx)(q.Check,{className:"w-3 h-3"})})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("button",{onClick:()=>bb(a.id),className:"flex items-center gap-2 flex-1 px-3 py-2 text-left",children:[(0,b.jsx)("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:a.color}}),(0,b.jsx)("span",{className:"text-xs text-white truncate flex-1",children:a.name}),(0,b.jsxs)("span",{className:"text-[10px] text-zinc-500",children:[a.paneCount||0," panes"]}),a.isActive&&(0,b.jsx)("span",{className:"text-[10px] text-indigo-400",children:"active"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5 pr-2 opacity-0 group-hover:opacity-100",children:[(0,b.jsx)("button",{onClick:b=>{b.stopPropagation(),ap(a.id),ar(a.name)},className:"p-1 text-zinc-500 hover:text-white rounded",title:"Rename",children:(0,b.jsx)(p.Pencil,{className:"w-2.5 h-2.5"})}),!a.isActive&&ac.length>1&&(0,b.jsx)("button",{onClick:b=>{b.stopPropagation(),confirm(`Delete space "${a.name}" and all its panes?`)&&be(a.id)},className:"p-1 text-zinc-500 hover:text-red-400 rounded",title:"Delete",children:(0,b.jsx)(o.Trash2,{className:"w-2.5 h-2.5"})})]})]})},a.id))}),(0,b.jsxs)("div",{className:"border-t border-zinc-700/50 p-1.5 flex gap-1",children:[(0,b.jsxs)("button",{onClick:bd,className:"flex items-center gap-1.5 px-2.5 py-1.5 text-[11px] text-zinc-400 hover:text-white hover:bg-zinc-700 rounded transition-colors flex-1",children:[(0,b.jsx)(d.Plus,{className:"w-3 h-3"})," New Empty"]}),(0,b.jsxs)("button",{onClick:()=>{aj(!0),ah(!1)},className:"flex items-center gap-1.5 px-2.5 py-1.5 text-[11px] text-zinc-400 hover:text-white hover:bg-zinc-700 rounded transition-colors flex-1",children:[(0,b.jsx)(s.Copy,{className:"w-3 h-3"})," Duplicate Current"]})]})]})]}),(0,b.jsxs)("span",{className:"text-[11px] text-zinc-500",children:[bh.length," pane",1!==bh.length?"s":"",Y.size>0&&` + ${Y.size} popped out`]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[E&&ae&&(0,b.jsxs)("button",{onClick:async()=>{let a=!ae.collaboration;await fetch((0,F.api)(`/api/workspaces/${ae.id}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({collaboration:a})}),af(b=>b?{...b,collaboration:a}:b),ad(b=>b.map(b=>b.id===ae.id?{...b,collaboration:a}:b))},className:`flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-md border transition-colors ${ae.collaboration?"border-indigo-500/50 bg-indigo-600/20 text-indigo-400":"border-zinc-700 text-zinc-500 hover:text-zinc-300 hover:border-zinc-600"}`,title:ae.collaboration?"Collaboration enabled — click to disable":"Enable collaboration for this workspace",children:[(0,b.jsx)(y.Users,{className:"w-3.5 h-3.5"}),"Collab"]}),(0,b.jsxs)("button",{onClick:bf,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs border border-zinc-700 text-zinc-400 rounded-md hover:text-white hover:border-zinc-600 transition-colors",title:"Close space and return home",children:[(0,b.jsx)(u,{className:"w-3.5 h-3.5"}),"Close"]}),(0,b.jsxs)("button",{onClick:()=>U(!0),className:"flex items-center gap-1.5 px-3 py-1.5 text-xs bg-indigo-600 text-white rounded-md hover:bg-indigo-500 transition-colors",children:[(0,b.jsx)(d.Plus,{className:"w-3.5 h-3.5"}),"Add Pane"]})]})]}),ai&&(0,b.jsx)("div",{className:"border-b border-zinc-800 bg-zinc-900 px-4 py-3",children:(0,b.jsxs)("div",{className:"max-w-md flex items-center gap-2",children:[(0,b.jsx)(n,{className:"w-4 h-4 text-indigo-400 flex-shrink-0"}),(0,b.jsx)("input",{autoFocus:!0,type:"text",placeholder:"New space name...",value:ak,onChange:a=>al(a.target.value),onKeyDown:a=>"Enter"===a.key&&bc(),className:"flex-1 px-3 py-1.5 text-sm bg-zinc-800 border border-zinc-700 rounded-md focus:outline-none focus:border-indigo-500 text-white"}),(0,b.jsx)(B.ColorPicker,{value:am,onChange:an}),(0,b.jsx)("button",{onClick:bc,disabled:!ak.trim(),className:"px-3 py-1.5 text-xs bg-indigo-600 text-white rounded-md hover:bg-indigo-500 disabled:opacity-50",children:"Save"}),(0,b.jsx)("button",{onClick:()=>aj(!1),className:"p-1.5 text-zinc-400 hover:text-white",children:(0,b.jsx)(r.X,{className:"w-4 h-4"})})]})}),T&&(0,b.jsx)("div",{className:"border-b border-zinc-800 bg-zinc-900 px-4 py-4",children:(0,b.jsxs)("div",{className:"max-w-lg space-y-3",children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:"Add Pane"}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-[11px] text-zinc-400 mb-1.5 block",children:"Agent"}),(0,b.jsx)("div",{className:"grid grid-cols-3 gap-1.5",children:L.AGENT_LIST.map(a=>(0,b.jsxs)("button",{onClick:()=>{aB(a.id),aD("new"),aV(null),az("")},className:`flex items-center gap-2 px-3 py-2 rounded-md border text-left transition-colors ${aA===a.id?"border-indigo-500 bg-indigo-600/20 text-white":"border-zinc-700 text-zinc-400 hover:text-white hover:border-zinc-600"}`,children:[(0,b.jsx)("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:a.color}}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("div",{className:"text-xs font-medium truncate",children:a.name}),(0,b.jsx)("div",{className:"text-[10px] text-zinc-500 truncate",children:a.description})]})]},a.id))})]}),L.AGENT_TYPES[aA]?.supportsResume&&(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)("button",{onClick:()=>{aD("new"),aV(null),az("")},className:`px-3 py-1.5 text-xs rounded-md border transition-colors ${"new"===aC?"bg-indigo-600 border-indigo-500 text-white":"border-zinc-700 text-zinc-400 hover:text-white hover:border-zinc-600"}`,children:"New Session"}),(0,b.jsx)("button",{onClick:()=>aD("resume"),className:`px-3 py-1.5 text-xs rounded-md border transition-colors ${"resume"===aC?"bg-indigo-600 border-indigo-500 text-white":"border-zinc-700 text-zinc-400 hover:text-white hover:border-zinc-600"}`,children:"Resume Session"})]}),"custom"===aA&&(0,b.jsx)("input",{type:"text",placeholder:"Command to run (e.g. python agent.py)",value:aE,onChange:a=>aF(a.target.value),className:"w-full px-3 py-2 text-sm bg-zinc-800 border border-zinc-700 rounded-md focus:outline-none focus:border-indigo-500 text-white font-mono"}),(0,b.jsx)(J,{value:aG,onChange:aH}),(0,b.jsx)("input",{type:"text",placeholder:"Title (optional)",value:as,onChange:a=>at(a.target.value),className:"w-full px-3 py-2 text-sm bg-zinc-800 border border-zinc-700 rounded-md focus:outline-none focus:border-indigo-500 text-white"}),aG?(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-[11px] text-zinc-400 mb-1.5 block",children:"Working directory (on remote node)"}),(0,b.jsx)("input",{type:"text",placeholder:"e.g. /home/user/project or ~ for home",value:au,onChange:a=>av(a.target.value),className:"w-full px-3 py-2 text-sm bg-zinc-800 border border-zinc-700 rounded-md focus:outline-none focus:border-indigo-500 text-white font-mono"})]}):(0,b.jsx)(G,{value:au,onChange:av}),"claude"===aA&&"resume"===aC&&(0,b.jsxs)("div",{ref:aY,className:"relative",children:[aU?(0,b.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 text-sm bg-zinc-800 border border-zinc-700 rounded-md",children:[(0,b.jsx)(h.MessageSquare,{className:"w-3.5 h-3.5 text-indigo-400 flex-shrink-0"}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:"text-white truncate",children:aU.customName||aU.firstPrompt?.slice(0,60)||"Untitled"}),(0,b.jsxs)("div",{className:"text-[10px] text-zinc-500 flex items-center gap-2",children:[(0,b.jsx)("span",{children:aU.projectName}),(0,b.jsxs)("span",{children:[aU.messageCount," msgs"]}),(0,b.jsxs)("span",{className:"font-mono",children:[aU.sessionId.slice(0,8),"..."]})]})]}),(0,b.jsx)("button",{onClick:()=>{aV(null),aT(!0)},className:"text-zinc-400 hover:text-white text-xs",children:"Change"})]}):(0,b.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 text-sm bg-zinc-800 border border-zinc-700 rounded-md cursor-text",onClick:()=>aT(!0),children:[(0,b.jsx)(g.Search,{className:"w-3.5 h-3.5 text-zinc-500"}),(0,b.jsx)("input",{type:"text",placeholder:"Search sessions by name, prompt, or project...",value:aM,onChange:a=>{aN(a.target.value),aT(!0)},onFocus:()=>aT(!0),className:"flex-1 bg-transparent focus:outline-none text-white placeholder:text-zinc-500"}),au&&(0,b.jsx)("button",{onClick:a=>{a.stopPropagation(),aX(!aW)},className:`flex-shrink-0 px-1.5 py-0.5 text-[10px] rounded border transition-colors ${aW?"border-indigo-500/50 bg-indigo-600/20 text-indigo-400":"border-zinc-600 text-zinc-500 hover:text-zinc-400"}`,title:aW?"Showing sessions for this directory — click to show all":"Showing all sessions — click to filter by directory",children:aW?au.split("/").pop():"All"}),(0,b.jsx)(k.ChevronDown,{className:"w-3.5 h-3.5 text-zinc-500"})]}),aS&&!aU&&(0,b.jsx)("div",{className:"absolute z-50 top-full left-0 right-0 mt-1 max-h-[300px] overflow-y-auto bg-zinc-800 border border-zinc-700 rounded-md shadow-xl",children:aQ?(0,b.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,b.jsx)(e.Loader2,{className:"w-4 h-4 animate-spin text-zinc-400"}),(0,b.jsx)("span",{className:"text-xs text-zinc-400 ml-2",children:"Loading sessions..."})]}):0===aO.length?(0,b.jsx)("div",{className:"py-4 px-3 text-xs text-zinc-500 text-center",children:aM?"No sessions match your search":"No sessions found"}):aO.map(a=>(0,b.jsx)("button",{onClick:()=>{aV(a),az(a.sessionId),!au&&a.projectPath&&av(a.projectPath),as||at(a.customName||""),aT(!1)},className:"w-full text-left px-3 py-2.5 hover:bg-zinc-700 border-b border-zinc-700/50 last:border-0 transition-colors",children:(0,b.jsxs)("div",{className:"flex items-start gap-2",children:[(0,b.jsx)(h.MessageSquare,{className:"w-3.5 h-3.5 text-indigo-400 mt-0.5 flex-shrink-0"}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:"text-xs text-white truncate",children:a.customName||a.firstPrompt?.slice(0,70)||"Untitled session"}),(0,b.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,b.jsxs)("span",{className:"text-[10px] text-indigo-400/70 flex items-center gap-0.5",children:[(0,b.jsx)(i.FolderOpen,{className:"w-2.5 h-2.5"}),a.projectName]}),(0,b.jsxs)("span",{className:"text-[10px] text-zinc-500",children:[a.messageCount," msgs"]}),(0,b.jsxs)("span",{className:"text-[10px] text-zinc-500 flex items-center gap-0.5",children:[(0,b.jsx)(j.Clock,{className:"w-2.5 h-2.5"}),new Date(a.modified).toLocaleDateString()]}),a.starred&&(0,b.jsx)("span",{className:"text-[10px]",children:"★"})]}),a.tags?.length>0&&(0,b.jsx)("div",{className:"flex gap-1 mt-1",children:a.tags.map(a=>(0,b.jsx)("span",{className:"text-[9px] px-1.5 py-0.5 bg-zinc-700 rounded text-zinc-400",children:a},a))})]})]})},a.sessionId))})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-[11px] text-zinc-400 mb-1.5 block",children:"Color"}),(0,b.jsx)(B.ColorPicker,{value:aw,onChange:ax})]}),(0,b.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,b.jsx)("button",{onClick:a3,disabled:"custom"===aA&&!aE.trim(),className:"px-4 py-2 text-sm bg-indigo-600 text-white rounded-md hover:bg-indigo-500 disabled:opacity-50 disabled:cursor-not-allowed",children:"Create"}),(0,b.jsx)("button",{onClick:()=>U(!1),className:"px-4 py-2 text-sm border border-zinc-700 text-zinc-400 rounded-md hover:text-white hover:border-zinc-600",children:"Cancel"})]})]})}),Y.size>0&&(0,b.jsxs)("div",{className:"flex items-center gap-2 px-4 py-1.5 border-b border-zinc-800 bg-zinc-900/50",children:[(0,b.jsx)("span",{className:"text-[10px] text-zinc-500",children:"Popped out:"}),H.filter(a=>Y.has(a.id)).map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,b.jsxs)("button",{onClick:()=>a7(a),className:"flex items-center gap-1 px-2 py-0.5 text-[10px] bg-zinc-800 border border-zinc-700 rounded-l text-zinc-400 hover:text-white hover:border-zinc-600",title:"Focus popout window",children:[(0,b.jsx)("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:a.color}}),a.title]}),(0,b.jsx)("button",{onClick:()=>a9(a.id),className:"px-1 py-0.5 text-[10px] bg-zinc-800 border border-zinc-700 border-l-0 rounded-r text-zinc-500 hover:text-white hover:border-zinc-600",title:"Pop back into grid",children:(0,b.jsx)(v,{className:"w-2.5 h-2.5"})})]},a.id))]}),(0,b.jsxs)("div",{className:"flex-1 flex overflow-hidden min-h-0",children:[0===bh.length&&0===Y.size?(0,b.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,b.jsxs)("div",{className:"text-center space-y-3",children:[(0,b.jsx)("img",{src:`${C}/spaces_icon.png`,alt:"Spaces",className:"w-16 h-16 mx-auto opacity-30"}),(0,b.jsx)("p",{className:"text-zinc-500",children:"No panes yet."}),(0,b.jsx)("p",{className:"text-zinc-600 text-xs",children:"Add a pane to start a shell, Claude, Codex, Gemini, or any agent."}),(0,b.jsxs)("button",{onClick:()=>U(!0),className:"px-4 py-2 text-sm bg-indigo-600 text-white rounded-md hover:bg-indigo-500 inline-flex items-center gap-2",children:[(0,b.jsx)(d.Plus,{className:"w-4 h-4"}),"Add your first pane"]})]})}):0===bh.length?(0,b.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,b.jsxs)("div",{className:"text-center space-y-2",children:[(0,b.jsx)("p",{className:"text-zinc-500 text-sm",children:"All panes are popped out to separate windows."}),(0,b.jsxs)("button",{onClick:()=>U(!0),className:"px-3 py-1.5 text-xs text-zinc-400 hover:text-white border border-zinc-700 rounded-md hover:border-zinc-600 inline-flex items-center gap-1.5",children:[(0,b.jsx)(d.Plus,{className:"w-3.5 h-3.5"}),"Add another pane"]})]})}):(0,b.jsx)("div",{className:"flex-1 p-2 gap-2 overflow-auto h-full",style:{display:"grid",gridTemplateColumns:1===bh.length?"1fr":bh.length<=2||bh.length<=4?"repeat(2, 1fr)":"repeat(3, 1fr)",gridAutoRows:bh.length<=2?"1fr":"minmax(300px, 1fr)"},children:bh.map(c=>W&&W!==c.id?null:(0,b.jsx)(A.TerminalPane,{pane:c,onClose:a4,onUpdate:a5,isMaximized:W===c.id,onToggleMaximize:a6,onPopout:a8,terminalToken:a,workspaceCollaboration:ae?.collaboration},c.id))}),ae?.collaboration&&(0,b.jsx)(S,{workspaceId:ae?.id??null,panes:bh.map(a=>({id:a.id,title:a.title,agentType:a.agentType,color:a.color})),collapsed:aa,onToggle:()=>ab(!aa)})]})]}):(0,b.jsxs)("div",{className:"h-screen flex flex-col bg-zinc-950 text-zinc-100",children:[(0,b.jsx)("div",{className:"absolute top-4 left-4",children:(0,b.jsxs)("button",{onClick:()=>m.push("/"),className:"flex items-center gap-2 px-3 py-1.5 text-xs text-zinc-500 hover:text-white hover:bg-zinc-800 rounded-md transition-colors",children:[(0,b.jsx)(t.Home,{className:"w-3.5 h-3.5"}),"Home"]})}),(0,b.jsx)("div",{className:"flex-1 flex items-center justify-center p-8",children:(0,b.jsxs)("div",{className:"w-full max-w-2xl",children:[(0,b.jsxs)("div",{className:"text-center mb-10",children:[(0,b.jsx)("img",{src:`${C}/spaces_icon.png`,alt:"Spaces",className:"w-16 h-16 mx-auto mb-4"}),(0,b.jsx)("h1",{className:"text-2xl font-bold mb-2",children:"Spaces"}),(0,b.jsx)("p",{className:"text-zinc-400 text-sm",children:"Choose a workspace to open, or create a new one."})]}),P?(0,b.jsx)("div",{className:"flex justify-center py-12",children:(0,b.jsx)(e.Loader2,{className:"w-6 h-6 animate-spin text-indigo-500"})}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"grid grid-cols-2 gap-3 mb-6",children:ac.map(a=>(0,b.jsxs)("button",{onClick:()=>bb(a.id),className:"flex items-center gap-3 p-4 bg-zinc-900 border border-zinc-800 rounded-lg hover:border-zinc-600 hover:bg-zinc-800/50 transition-colors text-left group",children:[(0,b.jsx)("span",{className:"w-3.5 h-3.5 rounded-full flex-shrink-0",style:{backgroundColor:a.color}}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:"text-sm font-medium text-white truncate",children:a.name}),(0,b.jsxs)("div",{className:"text-xs text-zinc-500 mt-0.5",children:[a.paneCount||0," pane",1!==(a.paneCount||0)?"s":"",a.isActive&&(0,b.jsx)("span",{className:"text-indigo-400 ml-2",children:"last active"})]})]}),(0,b.jsx)(f.Terminal,{className:"w-4 h-4 text-zinc-600 group-hover:text-zinc-400 transition-colors"})]},a.id))}),(0,b.jsx)("div",{className:"flex justify-center",children:(0,b.jsxs)("button",{onClick:bd,className:"flex items-center gap-2 px-4 py-2.5 text-sm border border-zinc-700 text-zinc-400 rounded-lg hover:text-white hover:border-zinc-500 transition-colors",children:[(0,b.jsx)(d.Plus,{className:"w-4 h-4"}),"New Workspace"]})}),D&&aI.isLoading&&(0,b.jsxs)("div",{className:"flex items-center justify-center gap-2 py-4 mt-6 border-t border-zinc-800",children:[(0,b.jsx)(e.Loader2,{className:"w-4 h-4 animate-spin text-zinc-500"}),(0,b.jsx)("span",{className:"text-xs text-zinc-500",children:"Loading network spaces..."})]}),D&&aI.data?.remote&&aI.data.remote.length>0&&(0,b.jsxs)("div",{className:"mt-6 border-t border-zinc-800 pt-6",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,b.jsx)(w.Globe,{className:"w-4 h-4 text-zinc-500"}),(0,b.jsx)("h2",{className:"text-sm font-medium text-zinc-400",children:"Network Spaces"})]}),aI.data.remote.map(a=>(0,b.jsxs)("div",{className:"mb-3",children:[(0,b.jsxs)("button",{onClick:()=>aL(a.nodeId),className:"flex items-center gap-2 w-full px-2 py-1.5 text-left text-xs text-zinc-400 hover:text-white rounded-md hover:bg-zinc-800/50 transition-colors",children:[aJ.has(a.nodeId)?(0,b.jsx)(l.ChevronRight,{className:"w-3.5 h-3.5 text-zinc-600"}):(0,b.jsx)(k.ChevronDown,{className:"w-3.5 h-3.5 text-zinc-600"}),(0,b.jsx)(w.Globe,{className:"w-3 h-3 text-zinc-600"}),(0,b.jsx)("span",{className:"font-medium",children:a.nodeName}),(0,b.jsxs)("span",{className:"text-zinc-600",children:[a.workspaces.length," space",1!==a.workspaces.length?"s":""]})]}),!aJ.has(a.nodeId)&&(0,b.jsx)("div",{className:"grid grid-cols-2 gap-2 mt-2 ml-5",children:a.workspaces.map(c=>(0,b.jsxs)("button",{onClick:()=>{m.push(`/terminal/remote/${a.nodeId}/${c.id}`)},className:"flex items-center gap-3 p-3 bg-zinc-900/50 border border-zinc-800/50 rounded-lg hover:border-zinc-600 hover:bg-zinc-800/30 transition-colors text-left group",children:[(0,b.jsx)("span",{className:"w-3 h-3 rounded-full flex-shrink-0 ring-1 ring-zinc-700",style:{backgroundColor:c.color}}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:"text-xs font-medium text-zinc-300 truncate",children:c.name}),(0,b.jsxs)("div",{className:"text-[10px] text-zinc-600 mt-0.5",children:[c.paneCount||0," pane",1!==(c.paneCount||0)?"s":""]})]}),(0,b.jsx)(w.Globe,{className:"w-3 h-3 text-zinc-700 group-hover:text-zinc-500 transition-colors"})]},`${a.nodeId}-${c.id}`))})]},a.nodeId)),aI.data.errors&&aI.data.errors.length>0&&(0,b.jsx)("div",{className:"mt-3 space-y-1",children:aI.data.errors.map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 text-[10px] text-zinc-600",children:[(0,b.jsx)(x.AlertCircle,{className:"w-3 h-3 text-red-500/50"}),(0,b.jsxs)("span",{children:[a.nodeName,": ",a.error]})]},a.nodeId))})]})]})]})})]})}a.s(["default",()=>W],66490)}];
2
2
 
3
3
  //# sourceMappingURL=src_app_%28desktop%29_terminal_page_tsx_de5e8d85._.js.map