parasor 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (633) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +208 -0
  3. package/THIRD-PARTY-NOTICES.md +138 -0
  4. package/bin/parasor.mjs +3 -0
  5. package/node_modules/@parasor/shared/dist/client.d.ts +8 -0
  6. package/node_modules/@parasor/shared/dist/client.d.ts.map +1 -0
  7. package/node_modules/@parasor/shared/dist/client.js +2 -0
  8. package/node_modules/@parasor/shared/dist/client.js.map +1 -0
  9. package/node_modules/@parasor/shared/dist/drops.d.ts +24 -0
  10. package/node_modules/@parasor/shared/dist/drops.d.ts.map +1 -0
  11. package/node_modules/@parasor/shared/dist/drops.js +2 -0
  12. package/node_modules/@parasor/shared/dist/drops.js.map +1 -0
  13. package/node_modules/@parasor/shared/dist/file-uploads.d.ts +56 -0
  14. package/node_modules/@parasor/shared/dist/file-uploads.d.ts.map +1 -0
  15. package/node_modules/@parasor/shared/dist/file-uploads.js +13 -0
  16. package/node_modules/@parasor/shared/dist/file-uploads.js.map +1 -0
  17. package/node_modules/@parasor/shared/dist/ide-commands.d.ts +8 -0
  18. package/node_modules/@parasor/shared/dist/ide-commands.d.ts.map +1 -0
  19. package/node_modules/@parasor/shared/dist/ide-commands.js +59 -0
  20. package/node_modules/@parasor/shared/dist/ide-commands.js.map +1 -0
  21. package/node_modules/@parasor/shared/dist/pane-commands.d.ts +7 -0
  22. package/node_modules/@parasor/shared/dist/pane-commands.d.ts.map +1 -0
  23. package/node_modules/@parasor/shared/dist/pane-commands.js +47 -0
  24. package/node_modules/@parasor/shared/dist/pane-commands.js.map +1 -0
  25. package/node_modules/@parasor/shared/dist/pane-model.d.ts +63 -0
  26. package/node_modules/@parasor/shared/dist/pane-model.d.ts.map +1 -0
  27. package/node_modules/@parasor/shared/dist/pane-model.js +89 -0
  28. package/node_modules/@parasor/shared/dist/pane-model.js.map +1 -0
  29. package/node_modules/@parasor/shared/dist/panes.d.ts +33 -0
  30. package/node_modules/@parasor/shared/dist/panes.d.ts.map +1 -0
  31. package/node_modules/@parasor/shared/dist/panes.js +2 -0
  32. package/node_modules/@parasor/shared/dist/panes.js.map +1 -0
  33. package/node_modules/@parasor/shared/dist/runtime.d.ts +180 -0
  34. package/node_modules/@parasor/shared/dist/runtime.d.ts.map +1 -0
  35. package/node_modules/@parasor/shared/dist/runtime.js +2 -0
  36. package/node_modules/@parasor/shared/dist/runtime.js.map +1 -0
  37. package/node_modules/@parasor/shared/dist/state.d.ts +192 -0
  38. package/node_modules/@parasor/shared/dist/state.d.ts.map +1 -0
  39. package/node_modules/@parasor/shared/dist/state.js +10 -0
  40. package/node_modules/@parasor/shared/dist/state.js.map +1 -0
  41. package/node_modules/@parasor/shared/dist/terminal.d.ts +191 -0
  42. package/node_modules/@parasor/shared/dist/terminal.d.ts.map +1 -0
  43. package/node_modules/@parasor/shared/dist/terminal.js +174 -0
  44. package/node_modules/@parasor/shared/dist/terminal.js.map +1 -0
  45. package/node_modules/@parasor/shared/dist/types.d.ts +13 -0
  46. package/node_modules/@parasor/shared/dist/types.d.ts.map +1 -0
  47. package/node_modules/@parasor/shared/dist/types.js +13 -0
  48. package/node_modules/@parasor/shared/dist/types.js.map +1 -0
  49. package/node_modules/@parasor/shared/dist/worktree-local-files.d.ts +14 -0
  50. package/node_modules/@parasor/shared/dist/worktree-local-files.d.ts.map +1 -0
  51. package/node_modules/@parasor/shared/dist/worktree-local-files.js +41 -0
  52. package/node_modules/@parasor/shared/dist/worktree-local-files.js.map +1 -0
  53. package/node_modules/@parasor/shared/dist/ws-events.d.ts +152 -0
  54. package/node_modules/@parasor/shared/dist/ws-events.d.ts.map +1 -0
  55. package/node_modules/@parasor/shared/dist/ws-events.js +2 -0
  56. package/node_modules/@parasor/shared/dist/ws-events.js.map +1 -0
  57. package/node_modules/@parasor/shared/package.json +13 -0
  58. package/package.json +61 -0
  59. package/server/agent-detector/agent-state-store.d.ts +23 -0
  60. package/server/agent-detector/agent-state-store.d.ts.map +1 -0
  61. package/server/agent-detector/agent-state-store.js +110 -0
  62. package/server/agent-detector/agent-state-store.js.map +1 -0
  63. package/server/agent-detector/detector.d.ts +80 -0
  64. package/server/agent-detector/detector.d.ts.map +1 -0
  65. package/server/agent-detector/detector.js +219 -0
  66. package/server/agent-detector/detector.js.map +1 -0
  67. package/server/agent-detector/event-map.d.ts +25 -0
  68. package/server/agent-detector/event-map.d.ts.map +1 -0
  69. package/server/agent-detector/event-map.js +136 -0
  70. package/server/agent-detector/event-map.js.map +1 -0
  71. package/server/agent-detector/manual-agent-tracker.d.ts +19 -0
  72. package/server/agent-detector/manual-agent-tracker.d.ts.map +1 -0
  73. package/server/agent-detector/manual-agent-tracker.js +123 -0
  74. package/server/agent-detector/manual-agent-tracker.js.map +1 -0
  75. package/server/agent-detector/output-eligibility.d.ts +3 -0
  76. package/server/agent-detector/output-eligibility.d.ts.map +1 -0
  77. package/server/agent-detector/output-eligibility.js +39 -0
  78. package/server/agent-detector/output-eligibility.js.map +1 -0
  79. package/server/application/files/errors.d.ts +28 -0
  80. package/server/application/files/errors.d.ts.map +1 -0
  81. package/server/application/files/errors.js +55 -0
  82. package/server/application/files/errors.js.map +1 -0
  83. package/server/application/files/local-filesystem.d.ts +36 -0
  84. package/server/application/files/local-filesystem.d.ts.map +1 -0
  85. package/server/application/files/local-filesystem.js +171 -0
  86. package/server/application/files/local-filesystem.js.map +1 -0
  87. package/server/application/files/project-file-queries.d.ts +16 -0
  88. package/server/application/files/project-file-queries.d.ts.map +1 -0
  89. package/server/application/files/project-file-queries.js +126 -0
  90. package/server/application/files/project-file-queries.js.map +1 -0
  91. package/server/application/integrations/errors.d.ts +16 -0
  92. package/server/application/integrations/errors.d.ts.map +1 -0
  93. package/server/application/integrations/errors.js +31 -0
  94. package/server/application/integrations/errors.js.map +1 -0
  95. package/server/application/integrations/hook-notify.d.ts +32 -0
  96. package/server/application/integrations/hook-notify.d.ts.map +1 -0
  97. package/server/application/integrations/hook-notify.js +118 -0
  98. package/server/application/integrations/hook-notify.js.map +1 -0
  99. package/server/application/integrations/open-url.d.ts +11 -0
  100. package/server/application/integrations/open-url.d.ts.map +1 -0
  101. package/server/application/integrations/open-url.js +23 -0
  102. package/server/application/integrations/open-url.js.map +1 -0
  103. package/server/application/ports.d.ts +11 -0
  104. package/server/application/ports.d.ts.map +1 -0
  105. package/server/application/ports.js +2 -0
  106. package/server/application/ports.js.map +1 -0
  107. package/server/application/workspace/errors.d.ts +21 -0
  108. package/server/application/workspace/errors.d.ts.map +1 -0
  109. package/server/application/workspace/errors.js +21 -0
  110. package/server/application/workspace/errors.js.map +1 -0
  111. package/server/application/workspace/pane-commands.d.ts +47 -0
  112. package/server/application/workspace/pane-commands.d.ts.map +1 -0
  113. package/server/application/workspace/pane-commands.js +193 -0
  114. package/server/application/workspace/pane-commands.js.map +1 -0
  115. package/server/application/workspace/project-commands.d.ts +34 -0
  116. package/server/application/workspace/project-commands.d.ts.map +1 -0
  117. package/server/application/workspace/project-commands.js +81 -0
  118. package/server/application/workspace/project-commands.js.map +1 -0
  119. package/server/application/workspace/project-queries.d.ts +21 -0
  120. package/server/application/workspace/project-queries.d.ts.map +1 -0
  121. package/server/application/workspace/project-queries.js +216 -0
  122. package/server/application/workspace/project-queries.js.map +1 -0
  123. package/server/application/workspace/session-commands.d.ts +24 -0
  124. package/server/application/workspace/session-commands.d.ts.map +1 -0
  125. package/server/application/workspace/session-commands.js +123 -0
  126. package/server/application/workspace/session-commands.js.map +1 -0
  127. package/server/application/workspace/session-queries.d.ts +14 -0
  128. package/server/application/workspace/session-queries.d.ts.map +1 -0
  129. package/server/application/workspace/session-queries.js +47 -0
  130. package/server/application/workspace/session-queries.js.map +1 -0
  131. package/server/application/workspace/worktree-commands.d.ts +98 -0
  132. package/server/application/workspace/worktree-commands.d.ts.map +1 -0
  133. package/server/application/workspace/worktree-commands.js +323 -0
  134. package/server/application/workspace/worktree-commands.js.map +1 -0
  135. package/server/application/workspace/worktree-local-files.d.ts +11 -0
  136. package/server/application/workspace/worktree-local-files.d.ts.map +1 -0
  137. package/server/application/workspace/worktree-local-files.js +223 -0
  138. package/server/application/workspace/worktree-local-files.js.map +1 -0
  139. package/server/application/workspace/worktree-reconcile.d.ts +21 -0
  140. package/server/application/workspace/worktree-reconcile.d.ts.map +1 -0
  141. package/server/application/workspace/worktree-reconcile.js +49 -0
  142. package/server/application/workspace/worktree-reconcile.js.map +1 -0
  143. package/server/auth/origin.d.ts +17 -0
  144. package/server/auth/origin.d.ts.map +1 -0
  145. package/server/auth/origin.js +93 -0
  146. package/server/auth/origin.js.map +1 -0
  147. package/server/auth/pairing-token.d.ts +28 -0
  148. package/server/auth/pairing-token.d.ts.map +1 -0
  149. package/server/auth/pairing-token.js +46 -0
  150. package/server/auth/pairing-token.js.map +1 -0
  151. package/server/auth/token-exchange.d.ts +11 -0
  152. package/server/auth/token-exchange.d.ts.map +1 -0
  153. package/server/auth/token-exchange.js +27 -0
  154. package/server/auth/token-exchange.js.map +1 -0
  155. package/server/auth/token.d.ts +18 -0
  156. package/server/auth/token.d.ts.map +1 -0
  157. package/server/auth/token.js +115 -0
  158. package/server/auth/token.js.map +1 -0
  159. package/server/bootstrap/create-app-server.d.ts +49 -0
  160. package/server/bootstrap/create-app-server.d.ts.map +1 -0
  161. package/server/bootstrap/create-app-server.js +154 -0
  162. package/server/bootstrap/create-app-server.js.map +1 -0
  163. package/server/bootstrap/project-runtime.d.ts +29 -0
  164. package/server/bootstrap/project-runtime.d.ts.map +1 -0
  165. package/server/bootstrap/project-runtime.js +253 -0
  166. package/server/bootstrap/project-runtime.js.map +1 -0
  167. package/server/bootstrap/pty-env.d.ts +3 -0
  168. package/server/bootstrap/pty-env.d.ts.map +1 -0
  169. package/server/bootstrap/pty-env.js +15 -0
  170. package/server/bootstrap/pty-env.js.map +1 -0
  171. package/server/bootstrap/reconcile-state.d.ts +16 -0
  172. package/server/bootstrap/reconcile-state.d.ts.map +1 -0
  173. package/server/bootstrap/reconcile-state.js +73 -0
  174. package/server/bootstrap/reconcile-state.js.map +1 -0
  175. package/server/bootstrap/runtime-loops.d.ts +51 -0
  176. package/server/bootstrap/runtime-loops.d.ts.map +1 -0
  177. package/server/bootstrap/runtime-loops.js +189 -0
  178. package/server/bootstrap/runtime-loops.js.map +1 -0
  179. package/server/bootstrap/runtime-port.d.ts +4 -0
  180. package/server/bootstrap/runtime-port.d.ts.map +1 -0
  181. package/server/bootstrap/runtime-port.js +52 -0
  182. package/server/bootstrap/runtime-port.js.map +1 -0
  183. package/server/bootstrap/safety-gate.d.ts +22 -0
  184. package/server/bootstrap/safety-gate.d.ts.map +1 -0
  185. package/server/bootstrap/safety-gate.js +43 -0
  186. package/server/bootstrap/safety-gate.js.map +1 -0
  187. package/server/bootstrap/shutdown-marker.d.ts +35 -0
  188. package/server/bootstrap/shutdown-marker.d.ts.map +1 -0
  189. package/server/bootstrap/shutdown-marker.js +100 -0
  190. package/server/bootstrap/shutdown-marker.js.map +1 -0
  191. package/server/bootstrap/shutdown-runtime.d.ts +62 -0
  192. package/server/bootstrap/shutdown-runtime.d.ts.map +1 -0
  193. package/server/bootstrap/shutdown-runtime.js +66 -0
  194. package/server/bootstrap/shutdown-runtime.js.map +1 -0
  195. package/server/bootstrap/startup-banner.d.ts +34 -0
  196. package/server/bootstrap/startup-banner.d.ts.map +1 -0
  197. package/server/bootstrap/startup-banner.js +114 -0
  198. package/server/bootstrap/startup-banner.js.map +1 -0
  199. package/server/bootstrap/wire-runtime.d.ts +42 -0
  200. package/server/bootstrap/wire-runtime.d.ts.map +1 -0
  201. package/server/bootstrap/wire-runtime.js +205 -0
  202. package/server/bootstrap/wire-runtime.js.map +1 -0
  203. package/server/cli/help.d.ts +3 -0
  204. package/server/cli/help.d.ts.map +1 -0
  205. package/server/cli/help.js +39 -0
  206. package/server/cli/help.js.map +1 -0
  207. package/server/cli/hook-client.d.ts +12 -0
  208. package/server/cli/hook-client.d.ts.map +1 -0
  209. package/server/cli/hook-client.js +81 -0
  210. package/server/cli/hook-client.js.map +1 -0
  211. package/server/cli/hook.d.ts +3 -0
  212. package/server/cli/hook.d.ts.map +1 -0
  213. package/server/cli/hook.js +152 -0
  214. package/server/cli/hook.js.map +1 -0
  215. package/server/cli/main.d.ts +2 -0
  216. package/server/cli/main.d.ts.map +1 -0
  217. package/server/cli/main.js +133 -0
  218. package/server/cli/main.js.map +1 -0
  219. package/server/cli/notify.d.ts +19 -0
  220. package/server/cli/notify.d.ts.map +1 -0
  221. package/server/cli/notify.js +77 -0
  222. package/server/cli/notify.js.map +1 -0
  223. package/server/cli/open.d.ts +2 -0
  224. package/server/cli/open.d.ts.map +1 -0
  225. package/server/cli/open.js +47 -0
  226. package/server/cli/open.js.map +1 -0
  227. package/server/cli/probe-daemon-version.d.ts +46 -0
  228. package/server/cli/probe-daemon-version.d.ts.map +1 -0
  229. package/server/cli/probe-daemon-version.js +167 -0
  230. package/server/cli/probe-daemon-version.js.map +1 -0
  231. package/server/cli/pty-host.d.ts +36 -0
  232. package/server/cli/pty-host.d.ts.map +1 -0
  233. package/server/cli/pty-host.js +390 -0
  234. package/server/cli/pty-host.js.map +1 -0
  235. package/server/cli/qr.d.ts +2 -0
  236. package/server/cli/qr.d.ts.map +1 -0
  237. package/server/cli/qr.js +70 -0
  238. package/server/cli/qr.js.map +1 -0
  239. package/server/cli/restart-confirm.d.ts +33 -0
  240. package/server/cli/restart-confirm.d.ts.map +1 -0
  241. package/server/cli/restart-confirm.js +107 -0
  242. package/server/cli/restart-confirm.js.map +1 -0
  243. package/server/cli/restart.d.ts +17 -0
  244. package/server/cli/restart.d.ts.map +1 -0
  245. package/server/cli/restart.js +145 -0
  246. package/server/cli/restart.js.map +1 -0
  247. package/server/cli/service-darwin.d.ts +70 -0
  248. package/server/cli/service-darwin.d.ts.map +1 -0
  249. package/server/cli/service-darwin.js +562 -0
  250. package/server/cli/service-darwin.js.map +1 -0
  251. package/server/cli/service-linux.d.ts +81 -0
  252. package/server/cli/service-linux.d.ts.map +1 -0
  253. package/server/cli/service-linux.js +412 -0
  254. package/server/cli/service-linux.js.map +1 -0
  255. package/server/cli/service.d.ts +33 -0
  256. package/server/cli/service.d.ts.map +1 -0
  257. package/server/cli/service.js +133 -0
  258. package/server/cli/service.js.map +1 -0
  259. package/server/cli/shim-installer.d.ts +35 -0
  260. package/server/cli/shim-installer.d.ts.map +1 -0
  261. package/server/cli/shim-installer.js +662 -0
  262. package/server/cli/shim-installer.js.map +1 -0
  263. package/server/cli/shim-open.d.ts +2 -0
  264. package/server/cli/shim-open.d.ts.map +1 -0
  265. package/server/cli/shim-open.js +128 -0
  266. package/server/cli/shim-open.js.map +1 -0
  267. package/server/cli/shutdown-deps.d.ts +41 -0
  268. package/server/cli/shutdown-deps.d.ts.map +1 -0
  269. package/server/cli/shutdown-deps.js +158 -0
  270. package/server/cli/shutdown-deps.js.map +1 -0
  271. package/server/cli/stop.d.ts +11 -0
  272. package/server/cli/stop.d.ts.map +1 -0
  273. package/server/cli/stop.js +123 -0
  274. package/server/cli/stop.js.map +1 -0
  275. package/server/cli/unknown-command.d.ts +8 -0
  276. package/server/cli/unknown-command.d.ts.map +1 -0
  277. package/server/cli/unknown-command.js +14 -0
  278. package/server/cli/unknown-command.js.map +1 -0
  279. package/server/debug/agent-status-recorder.d.ts +57 -0
  280. package/server/debug/agent-status-recorder.d.ts.map +1 -0
  281. package/server/debug/agent-status-recorder.js +209 -0
  282. package/server/debug/agent-status-recorder.js.map +1 -0
  283. package/server/debug/terminal-trace-recorder.d.ts +41 -0
  284. package/server/debug/terminal-trace-recorder.d.ts.map +1 -0
  285. package/server/debug/terminal-trace-recorder.js +112 -0
  286. package/server/debug/terminal-trace-recorder.js.map +1 -0
  287. package/server/fonts/catalog.d.ts +35 -0
  288. package/server/fonts/catalog.d.ts.map +1 -0
  289. package/server/fonts/catalog.js +76 -0
  290. package/server/fonts/catalog.js.map +1 -0
  291. package/server/fonts/installer.d.ts +45 -0
  292. package/server/fonts/installer.d.ts.map +1 -0
  293. package/server/fonts/installer.js +201 -0
  294. package/server/fonts/installer.js.map +1 -0
  295. package/server/fonts/routes.d.ts +4 -0
  296. package/server/fonts/routes.d.ts.map +1 -0
  297. package/server/fonts/routes.js +91 -0
  298. package/server/fonts/routes.js.map +1 -0
  299. package/server/fs/drops.d.ts +50 -0
  300. package/server/fs/drops.d.ts.map +1 -0
  301. package/server/fs/drops.js +137 -0
  302. package/server/fs/drops.js.map +1 -0
  303. package/server/fs/file-uploads.d.ts +57 -0
  304. package/server/fs/file-uploads.d.ts.map +1 -0
  305. package/server/fs/file-uploads.js +214 -0
  306. package/server/fs/file-uploads.js.map +1 -0
  307. package/server/fs/file-watcher.d.ts +22 -0
  308. package/server/fs/file-watcher.d.ts.map +1 -0
  309. package/server/fs/file-watcher.js +105 -0
  310. package/server/fs/file-watcher.js.map +1 -0
  311. package/server/fs/git-watcher.d.ts +76 -0
  312. package/server/fs/git-watcher.d.ts.map +1 -0
  313. package/server/fs/git-watcher.js +356 -0
  314. package/server/fs/git-watcher.js.map +1 -0
  315. package/server/fs/media.d.ts +35 -0
  316. package/server/fs/media.d.ts.map +1 -0
  317. package/server/fs/media.js +271 -0
  318. package/server/fs/media.js.map +1 -0
  319. package/server/fs/service.d.ts +97 -0
  320. package/server/fs/service.d.ts.map +1 -0
  321. package/server/fs/service.js +306 -0
  322. package/server/fs/service.js.map +1 -0
  323. package/server/fs/upload-staging.d.ts +76 -0
  324. package/server/fs/upload-staging.d.ts.map +1 -0
  325. package/server/fs/upload-staging.js +283 -0
  326. package/server/fs/upload-staging.js.map +1 -0
  327. package/server/fs/watcher-lifecycle.d.ts +24 -0
  328. package/server/fs/watcher-lifecycle.d.ts.map +1 -0
  329. package/server/fs/watcher-lifecycle.js +105 -0
  330. package/server/fs/watcher-lifecycle.js.map +1 -0
  331. package/server/index.d.ts +17 -0
  332. package/server/index.d.ts.map +1 -0
  333. package/server/index.js +510 -0
  334. package/server/index.js.map +1 -0
  335. package/server/ipc/socket-server.d.ts +28 -0
  336. package/server/ipc/socket-server.d.ts.map +1 -0
  337. package/server/ipc/socket-server.js +206 -0
  338. package/server/ipc/socket-server.js.map +1 -0
  339. package/server/lib/git-exec.d.ts +38 -0
  340. package/server/lib/git-exec.d.ts.map +1 -0
  341. package/server/lib/git-exec.js +96 -0
  342. package/server/lib/git-exec.js.map +1 -0
  343. package/server/lib/open-in-ide.d.ts +22 -0
  344. package/server/lib/open-in-ide.d.ts.map +1 -0
  345. package/server/lib/open-in-ide.js +90 -0
  346. package/server/lib/open-in-ide.js.map +1 -0
  347. package/server/lib/open-in-os.d.ts +20 -0
  348. package/server/lib/open-in-os.d.ts.map +1 -0
  349. package/server/lib/open-in-os.js +51 -0
  350. package/server/lib/open-in-os.js.map +1 -0
  351. package/server/lib/path.d.ts +2 -0
  352. package/server/lib/path.d.ts.map +1 -0
  353. package/server/lib/path.js +10 -0
  354. package/server/lib/path.js.map +1 -0
  355. package/server/lib/promise-mutex.d.ts +7 -0
  356. package/server/lib/promise-mutex.d.ts.map +1 -0
  357. package/server/lib/promise-mutex.js +26 -0
  358. package/server/lib/promise-mutex.js.map +1 -0
  359. package/server/lib/sd-notify.d.ts +8 -0
  360. package/server/lib/sd-notify.d.ts.map +1 -0
  361. package/server/lib/sd-notify.js +27 -0
  362. package/server/lib/sd-notify.js.map +1 -0
  363. package/server/net/local-machine.d.ts +7 -0
  364. package/server/net/local-machine.d.ts.map +1 -0
  365. package/server/net/local-machine.js +79 -0
  366. package/server/net/local-machine.js.map +1 -0
  367. package/server/net/reachable-host.d.ts +12 -0
  368. package/server/net/reachable-host.d.ts.map +1 -0
  369. package/server/net/reachable-host.js +25 -0
  370. package/server/net/reachable-host.js.map +1 -0
  371. package/server/network/endpoints.d.ts +14 -0
  372. package/server/network/endpoints.d.ts.map +1 -0
  373. package/server/network/endpoints.js +104 -0
  374. package/server/network/endpoints.js.map +1 -0
  375. package/server/network/qr.d.ts +16 -0
  376. package/server/network/qr.d.ts.map +1 -0
  377. package/server/network/qr.js +89 -0
  378. package/server/network/qr.js.map +1 -0
  379. package/server/port-forwarder/forwarder.d.ts +47 -0
  380. package/server/port-forwarder/forwarder.d.ts.map +1 -0
  381. package/server/port-forwarder/forwarder.js +159 -0
  382. package/server/port-forwarder/forwarder.js.map +1 -0
  383. package/server/port-scanner/scanner.d.ts +24 -0
  384. package/server/port-scanner/scanner.d.ts.map +1 -0
  385. package/server/port-scanner/scanner.js +193 -0
  386. package/server/port-scanner/scanner.js.map +1 -0
  387. package/server/pty/connection-lifecycle.d.ts +50 -0
  388. package/server/pty/connection-lifecycle.d.ts.map +1 -0
  389. package/server/pty/connection-lifecycle.js +113 -0
  390. package/server/pty/connection-lifecycle.js.map +1 -0
  391. package/server/pty/daemon-connect.d.ts +52 -0
  392. package/server/pty/daemon-connect.d.ts.map +1 -0
  393. package/server/pty/daemon-connect.js +62 -0
  394. package/server/pty/daemon-connect.js.map +1 -0
  395. package/server/pty/handshake-timeout-race.d.ts +22 -0
  396. package/server/pty/handshake-timeout-race.d.ts.map +1 -0
  397. package/server/pty/handshake-timeout-race.js +23 -0
  398. package/server/pty/handshake-timeout-race.js.map +1 -0
  399. package/server/pty/headless-replay-snapshot.d.ts +28 -0
  400. package/server/pty/headless-replay-snapshot.d.ts.map +1 -0
  401. package/server/pty/headless-replay-snapshot.js +285 -0
  402. package/server/pty/headless-replay-snapshot.js.map +1 -0
  403. package/server/pty/headless-terminal-state-cache.d.ts +31 -0
  404. package/server/pty/headless-terminal-state-cache.d.ts.map +1 -0
  405. package/server/pty/headless-terminal-state-cache.js +119 -0
  406. package/server/pty/headless-terminal-state-cache.js.map +1 -0
  407. package/server/pty/hello-ack-validator.d.ts +15 -0
  408. package/server/pty/hello-ack-validator.d.ts.map +1 -0
  409. package/server/pty/hello-ack-validator.js +30 -0
  410. package/server/pty/hello-ack-validator.js.map +1 -0
  411. package/server/pty/host-daemon/bootstrap.d.ts +100 -0
  412. package/server/pty/host-daemon/bootstrap.d.ts.map +1 -0
  413. package/server/pty/host-daemon/bootstrap.js +611 -0
  414. package/server/pty/host-daemon/bootstrap.js.map +1 -0
  415. package/server/pty/host-daemon/daemon.d.ts +111 -0
  416. package/server/pty/host-daemon/daemon.d.ts.map +1 -0
  417. package/server/pty/host-daemon/daemon.js +648 -0
  418. package/server/pty/host-daemon/daemon.js.map +1 -0
  419. package/server/pty/host-daemon/entry.d.ts +3 -0
  420. package/server/pty/host-daemon/entry.d.ts.map +1 -0
  421. package/server/pty/host-daemon/entry.js +72 -0
  422. package/server/pty/host-daemon/entry.js.map +1 -0
  423. package/server/pty/host-daemon/lockfile.d.ts +12 -0
  424. package/server/pty/host-daemon/lockfile.d.ts.map +1 -0
  425. package/server/pty/host-daemon/lockfile.js +120 -0
  426. package/server/pty/host-daemon/lockfile.js.map +1 -0
  427. package/server/pty/host-daemon/mode-marker.d.ts +77 -0
  428. package/server/pty/host-daemon/mode-marker.d.ts.map +1 -0
  429. package/server/pty/host-daemon/mode-marker.js +228 -0
  430. package/server/pty/host-daemon/mode-marker.js.map +1 -0
  431. package/server/pty/host-daemon/orphan-cleanup.d.ts +42 -0
  432. package/server/pty/host-daemon/orphan-cleanup.d.ts.map +1 -0
  433. package/server/pty/host-daemon/orphan-cleanup.js +84 -0
  434. package/server/pty/host-daemon/orphan-cleanup.js.map +1 -0
  435. package/server/pty/host-daemon/paths.d.ts +10 -0
  436. package/server/pty/host-daemon/paths.d.ts.map +1 -0
  437. package/server/pty/host-daemon/paths.js +56 -0
  438. package/server/pty/host-daemon/paths.js.map +1 -0
  439. package/server/pty/host-daemon/server-connection.d.ts +44 -0
  440. package/server/pty/host-daemon/server-connection.d.ts.map +1 -0
  441. package/server/pty/host-daemon/server-connection.js +100 -0
  442. package/server/pty/host-daemon/server-connection.js.map +1 -0
  443. package/server/pty/host-daemon/service-detection.d.ts +24 -0
  444. package/server/pty/host-daemon/service-detection.d.ts.map +1 -0
  445. package/server/pty/host-daemon/service-detection.js +16 -0
  446. package/server/pty/host-daemon/service-detection.js.map +1 -0
  447. package/server/pty/host-daemon/socket-ready.d.ts +22 -0
  448. package/server/pty/host-daemon/socket-ready.d.ts.map +1 -0
  449. package/server/pty/host-daemon/socket-ready.js +33 -0
  450. package/server/pty/host-daemon/socket-ready.js.map +1 -0
  451. package/server/pty/host-daemon/spawn-daemon.d.ts +45 -0
  452. package/server/pty/host-daemon/spawn-daemon.d.ts.map +1 -0
  453. package/server/pty/host-daemon/spawn-daemon.js +155 -0
  454. package/server/pty/host-daemon/spawn-daemon.js.map +1 -0
  455. package/server/pty/host-daemon/terminate-daemon.d.ts +16 -0
  456. package/server/pty/host-daemon/terminate-daemon.d.ts.map +1 -0
  457. package/server/pty/host-daemon/terminate-daemon.js +128 -0
  458. package/server/pty/host-daemon/terminate-daemon.js.map +1 -0
  459. package/server/pty/host-protocol/frames.d.ts +110 -0
  460. package/server/pty/host-protocol/frames.d.ts.map +1 -0
  461. package/server/pty/host-protocol/frames.js +255 -0
  462. package/server/pty/host-protocol/frames.js.map +1 -0
  463. package/server/pty/host-protocol/messages.d.ts +140 -0
  464. package/server/pty/host-protocol/messages.d.ts.map +1 -0
  465. package/server/pty/host-protocol/messages.js +117 -0
  466. package/server/pty/host-protocol/messages.js.map +1 -0
  467. package/server/pty/host.d.ts +273 -0
  468. package/server/pty/host.d.ts.map +1 -0
  469. package/server/pty/host.js +184 -0
  470. package/server/pty/host.js.map +1 -0
  471. package/server/pty/in-process-host.d.ts +224 -0
  472. package/server/pty/in-process-host.d.ts.map +1 -0
  473. package/server/pty/in-process-host.js +1183 -0
  474. package/server/pty/in-process-host.js.map +1 -0
  475. package/server/pty/osc7-lifecycle.d.ts +8 -0
  476. package/server/pty/osc7-lifecycle.d.ts.map +1 -0
  477. package/server/pty/osc7-lifecycle.js +22 -0
  478. package/server/pty/osc7-lifecycle.js.map +1 -0
  479. package/server/pty/osc7-parser.d.ts +23 -0
  480. package/server/pty/osc7-parser.d.ts.map +1 -0
  481. package/server/pty/osc7-parser.js +91 -0
  482. package/server/pty/osc7-parser.js.map +1 -0
  483. package/server/pty/remote-host.d.ts +188 -0
  484. package/server/pty/remote-host.d.ts.map +1 -0
  485. package/server/pty/remote-host.js +810 -0
  486. package/server/pty/remote-host.js.map +1 -0
  487. package/server/pty/request-correlator.d.ts +59 -0
  488. package/server/pty/request-correlator.d.ts.map +1 -0
  489. package/server/pty/request-correlator.js +75 -0
  490. package/server/pty/request-correlator.js.map +1 -0
  491. package/server/pty/scrollback-log.d.ts +130 -0
  492. package/server/pty/scrollback-log.d.ts.map +1 -0
  493. package/server/pty/scrollback-log.js +344 -0
  494. package/server/pty/scrollback-log.js.map +1 -0
  495. package/server/pty/scrollback-sanitize.d.ts +2 -0
  496. package/server/pty/scrollback-sanitize.d.ts.map +1 -0
  497. package/server/pty/scrollback-sanitize.js +54 -0
  498. package/server/pty/scrollback-sanitize.js.map +1 -0
  499. package/server/pty/session-mirror.d.ts +67 -0
  500. package/server/pty/session-mirror.d.ts.map +1 -0
  501. package/server/pty/session-mirror.js +112 -0
  502. package/server/pty/session-mirror.js.map +1 -0
  503. package/server/pty/session-policy.d.ts +85 -0
  504. package/server/pty/session-policy.d.ts.map +1 -0
  505. package/server/pty/session-policy.js +186 -0
  506. package/server/pty/session-policy.js.map +1 -0
  507. package/server/pty/version-mismatch-recovery.d.ts +71 -0
  508. package/server/pty/version-mismatch-recovery.d.ts.map +1 -0
  509. package/server/pty/version-mismatch-recovery.js +63 -0
  510. package/server/pty/version-mismatch-recovery.js.map +1 -0
  511. package/server/routes/debug-agent-status.d.ts +5 -0
  512. package/server/routes/debug-agent-status.d.ts.map +1 -0
  513. package/server/routes/debug-agent-status.js +22 -0
  514. package/server/routes/debug-agent-status.js.map +1 -0
  515. package/server/routes/debug-diagnostics.d.ts +8 -0
  516. package/server/routes/debug-diagnostics.d.ts.map +1 -0
  517. package/server/routes/debug-diagnostics.js +34 -0
  518. package/server/routes/debug-diagnostics.js.map +1 -0
  519. package/server/routes/debug-terminal-trace.d.ts +16 -0
  520. package/server/routes/debug-terminal-trace.d.ts.map +1 -0
  521. package/server/routes/debug-terminal-trace.js +545 -0
  522. package/server/routes/debug-terminal-trace.js.map +1 -0
  523. package/server/routes/drops.d.ts +13 -0
  524. package/server/routes/drops.d.ts.map +1 -0
  525. package/server/routes/drops.js +126 -0
  526. package/server/routes/drops.js.map +1 -0
  527. package/server/routes/file-uploads.d.ts +9 -0
  528. package/server/routes/file-uploads.d.ts.map +1 -0
  529. package/server/routes/file-uploads.js +119 -0
  530. package/server/routes/file-uploads.js.map +1 -0
  531. package/server/routes/files.d.ts +9 -0
  532. package/server/routes/files.d.ts.map +1 -0
  533. package/server/routes/files.js +441 -0
  534. package/server/routes/files.js.map +1 -0
  535. package/server/routes/filesystem.d.ts +6 -0
  536. package/server/routes/filesystem.d.ts.map +1 -0
  537. package/server/routes/filesystem.js +76 -0
  538. package/server/routes/filesystem.js.map +1 -0
  539. package/server/routes/git.d.ts +38 -0
  540. package/server/routes/git.d.ts.map +1 -0
  541. package/server/routes/git.js +585 -0
  542. package/server/routes/git.js.map +1 -0
  543. package/server/routes/healthz.d.ts +8 -0
  544. package/server/routes/healthz.d.ts.map +1 -0
  545. package/server/routes/healthz.js +24 -0
  546. package/server/routes/healthz.js.map +1 -0
  547. package/server/routes/hook.d.ts +14 -0
  548. package/server/routes/hook.d.ts.map +1 -0
  549. package/server/routes/hook.js +86 -0
  550. package/server/routes/hook.js.map +1 -0
  551. package/server/routes/ide-commands.d.ts +9 -0
  552. package/server/routes/ide-commands.d.ts.map +1 -0
  553. package/server/routes/ide-commands.js +23 -0
  554. package/server/routes/ide-commands.js.map +1 -0
  555. package/server/routes/lib/resolve-worktree.d.ts +30 -0
  556. package/server/routes/lib/resolve-worktree.d.ts.map +1 -0
  557. package/server/routes/lib/resolve-worktree.js +35 -0
  558. package/server/routes/lib/resolve-worktree.js.map +1 -0
  559. package/server/routes/open.d.ts +4 -0
  560. package/server/routes/open.d.ts.map +1 -0
  561. package/server/routes/open.js +21 -0
  562. package/server/routes/open.js.map +1 -0
  563. package/server/routes/pane-commands.d.ts +9 -0
  564. package/server/routes/pane-commands.d.ts.map +1 -0
  565. package/server/routes/pane-commands.js +23 -0
  566. package/server/routes/pane-commands.js.map +1 -0
  567. package/server/routes/projects.d.ts +15 -0
  568. package/server/routes/projects.d.ts.map +1 -0
  569. package/server/routes/projects.js +363 -0
  570. package/server/routes/projects.js.map +1 -0
  571. package/server/routes/server-notices.d.ts +4 -0
  572. package/server/routes/server-notices.d.ts.map +1 -0
  573. package/server/routes/server-notices.js +29 -0
  574. package/server/routes/server-notices.js.map +1 -0
  575. package/server/routes/service-config.d.ts +11 -0
  576. package/server/routes/service-config.d.ts.map +1 -0
  577. package/server/routes/service-config.js +64 -0
  578. package/server/routes/service-config.js.map +1 -0
  579. package/server/routes/sessions.d.ts +7 -0
  580. package/server/routes/sessions.d.ts.map +1 -0
  581. package/server/routes/sessions.js +218 -0
  582. package/server/routes/sessions.js.map +1 -0
  583. package/server/service/caffeinate.d.ts +33 -0
  584. package/server/service/caffeinate.d.ts.map +1 -0
  585. package/server/service/caffeinate.js +72 -0
  586. package/server/service/caffeinate.js.map +1 -0
  587. package/server/state/app-state.d.ts +167 -0
  588. package/server/state/app-state.d.ts.map +1 -0
  589. package/server/state/app-state.js +335 -0
  590. package/server/state/app-state.js.map +1 -0
  591. package/server/state/project-manager.d.ts +30 -0
  592. package/server/state/project-manager.d.ts.map +1 -0
  593. package/server/state/project-manager.js +128 -0
  594. package/server/state/project-manager.js.map +1 -0
  595. package/server/state/server-notices.d.ts +12 -0
  596. package/server/state/server-notices.d.ts.map +1 -0
  597. package/server/state/server-notices.js +32 -0
  598. package/server/state/server-notices.js.map +1 -0
  599. package/server/state/worktree-cache.d.ts +25 -0
  600. package/server/state/worktree-cache.d.ts.map +1 -0
  601. package/server/state/worktree-cache.js +53 -0
  602. package/server/state/worktree-cache.js.map +1 -0
  603. package/server/ws/events.d.ts +45 -0
  604. package/server/ws/events.d.ts.map +1 -0
  605. package/server/ws/events.js +134 -0
  606. package/server/ws/events.js.map +1 -0
  607. package/server/ws/keepalive.d.ts +27 -0
  608. package/server/ws/keepalive.d.ts.map +1 -0
  609. package/server/ws/keepalive.js +63 -0
  610. package/server/ws/keepalive.js.map +1 -0
  611. package/server/ws/terminal-attach.d.ts +13 -0
  612. package/server/ws/terminal-attach.d.ts.map +1 -0
  613. package/server/ws/terminal-attach.js +233 -0
  614. package/server/ws/terminal-attach.js.map +1 -0
  615. package/server/ws/terminal-flow.d.ts +17 -0
  616. package/server/ws/terminal-flow.d.ts.map +1 -0
  617. package/server/ws/terminal-flow.js +64 -0
  618. package/server/ws/terminal-flow.js.map +1 -0
  619. package/server/ws/terminal.d.ts +69 -0
  620. package/server/ws/terminal.d.ts.map +1 -0
  621. package/server/ws/terminal.js +311 -0
  622. package/server/ws/terminal.js.map +1 -0
  623. package/web/assets/EditorPane-CzzT3iYY.js +123 -0
  624. package/web/assets/SymbolsNerdFontMono-Regular-CwEZqMeU.woff2 +0 -0
  625. package/web/assets/TerminalPane-CjbYzePr.js +68 -0
  626. package/web/assets/TerminalPane-DkTCHfhq.css +1 -0
  627. package/web/assets/file-icons-JBi09j0r.js +6 -0
  628. package/web/assets/index-CTTkRpnn.css +2 -0
  629. package/web/assets/index-CmhewzMp.js +34 -0
  630. package/web/assets/session-resume-7f-tB-ZU.js +2 -0
  631. package/web/assets/terminal-trace-PuuFRybC.js +2803 -0
  632. package/web/assets/useVirtualKeyboard-DgJb9u9d.js +1 -0
  633. package/web/index.html +52 -0
@@ -0,0 +1,34 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TerminalPane-DkTCHfhq.css"])))=>i.map(i=>d[i]);
2
+ import{A as e,B as t,C as n,D as r,E as i,F as a,G as o,H as s,I as c,K as l,L as u,M as d,N as f,O as p,P as m,R as h,S as g,T as _,U as v,W as y,b,c as x,j as S,k as C,l as w,o as T,r as E,w as D,x as O,y as k,z as ee}from"./terminal-trace-PuuFRybC.js";import{a as A,c as j,d as te,f as ne,i as M,l as N,n as re,r as ie,t as ae,u as P}from"./file-icons-JBi09j0r.js";import{_ as F,a as I,c as L,f as R,g as oe,h as se,i as ce,m as le,n as ue,p as de,s as fe,t as pe,u as me,y as he}from"./session-resume-7f-tB-ZU.js";var z=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ge=o(((e,t)=>{t.exports=z()})),_e=o((e=>{var t=ge(),n=y(),r=v();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),w=Symbol.for(`react.suspense`),T=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),ee=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=ee&&e[ee]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function te(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case b:return`Profiler`;case _:return`StrictMode`;case w:return`Suspense`;case T:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?te(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return te(e(t))}catch{}}return null}var ne=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ie=[],ae=-1;function P(e){return{current:e}}function F(e){0>ae||(e.current=ie[ae],ie[ae]=null,ae--)}function I(e,t){ae++,ie[ae]=e.current,e.current=t}var L=P(null),R=P(null),oe=P(null),se=P(null);function ce(e,t){switch(I(oe,t),I(R,e),I(L,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}F(L),I(L,e)}function le(){F(L),F(R),F(oe)}function ue(e){e.memoizedState!==null&&I(se,e);var t=L.current,n=Hd(t,e.type);t!==n&&(I(R,e),I(L,n))}function de(e){R.current===e&&(F(L),F(R)),se.current===e&&(F(se),Qf._currentValue=re)}var fe,pe;function me(e){if(fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||``,pe=-1<e.stack.indexOf(`
3
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
+ `+fe+e+pe}var he=!1;function z(e,t){if(!e||he)return``;he=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
+ `),l=s.split(`
6
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
7
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{he=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?me(n):``}function _e(e,t){switch(e.tag){case 26:case 27:case 5:return me(e.type);case 16:return me(`Lazy`);case 13:return e.child!==t&&t!==null?me(`Suspense Fallback`):me(`Suspense`);case 19:return me(`SuspenseList`);case 0:case 15:return z(e.type,!1);case 11:return z(e.type.render,!1);case 1:return z(e.type,!0);case 31:return me(`Activity`);default:return``}}function ve(e){try{var t=``,n=null;do t+=_e(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
+ Error generating stack: `+e.message+`
9
+ `+e.stack}}var ye=Object.prototype.hasOwnProperty,be=t.unstable_scheduleCallback,xe=t.unstable_cancelCallback,Se=t.unstable_shouldYield,Ce=t.unstable_requestPaint,we=t.unstable_now,Te=t.unstable_getCurrentPriorityLevel,Ee=t.unstable_ImmediatePriority,De=t.unstable_UserBlockingPriority,Oe=t.unstable_NormalPriority,ke=t.unstable_LowPriority,Ae=t.unstable_IdlePriority,je=t.log,Me=t.unstable_setDisableYieldValue,Ne=null,Pe=null;function Fe(e){if(typeof je==`function`&&Me(e),Pe&&typeof Pe.setStrictMode==`function`)try{Pe.setStrictMode(Ne,e)}catch{}}var Ie=Math.clz32?Math.clz32:V,Le=Math.log,B=Math.LN2;function V(e){return e>>>=0,e===0?32:31-(Le(e)/B|0)|0}var Re=256,ze=262144,Be=4194304;function Ve(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function He(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ve(n))):i=Ve(o):i=Ve(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ve(n))):i=Ve(o)):i=Ve(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ue(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function We(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ge(){var e=Be;return Be<<=1,!(Be&62914560)&&(Be=4194304),e}function Ke(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Je(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ie(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ye(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ye(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ie(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Xe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ie(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ze(e,t){var n=t&-t;return n=n&42?1:Qe(n),(n&(e.suspendedLanes|t))===0?n:0}function Qe(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function $e(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function et(){var e=N.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function tt(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var nt=Math.random().toString(36).slice(2),rt=`__reactFiber$`+nt,it=`__reactProps$`+nt,at=`__reactContainer$`+nt,ot=`__reactEvents$`+nt,st=`__reactListeners$`+nt,ct=`__reactHandles$`+nt,lt=`__reactResources$`+nt,ut=`__reactMarker$`+nt;function dt(e){delete e[rt],delete e[it],delete e[ot],delete e[st],delete e[ct]}function ft(e){var t=e[rt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[at]||n[rt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[rt])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function pt(e){if(e=e[rt]||e[at]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function mt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function ht(e){var t=e[lt];return t||=e[lt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function gt(e){e[ut]=!0}var _t=new Set,vt={};function yt(e,t){bt(e,t),bt(e+`Capture`,t)}function bt(e,t){for(vt[e]=t,e=0;e<t.length;e++)_t.add(t[e])}var xt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),St={},Ct={};function wt(e){return ye.call(Ct,e)?!0:ye.call(St,e)?!1:xt.test(e)?Ct[e]=!0:(St[e]=!0,!1)}function Tt(e,t,n){if(wt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Et(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Dt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Ot(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function kt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function At(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function jt(e){if(!e._valueTracker){var t=kt(e)?`checked`:`value`;e._valueTracker=At(e,t,``+e[t])}}function Mt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=kt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Nt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Pt=/[\n"\\]/g;function Ft(e){return e.replace(Pt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function It(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Ot(t)):e.value!==``+Ot(t)&&(e.value=``+Ot(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Rt(e,o,Ot(n)):Rt(e,o,Ot(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Ot(s):e.removeAttribute(`name`)}function Lt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){jt(e);return}n=n==null?``:``+Ot(n),t=t==null?n:``+Ot(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),jt(e)}function Rt(e,t,n){t===`number`&&Nt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function zt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Ot(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Bt(e,t,n){if(t!=null&&(t=``+Ot(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Ot(n)}function Vt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ne(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Ot(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),jt(e)}function Ht(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ut=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Wt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Ut.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Gt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Wt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Wt(e,o,t[o])}function Kt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var qt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Jt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Yt(e){return Jt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Xt(){}var Zt=null;function Qt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $t=null,en=null;function tn(e){var t=pt(e);if(t&&(e=t.stateNode)){var n=e[it]||null;a:switch(e=t.stateNode,t.type){case`input`:if(It(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Ft(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[it]||null;if(!a)throw Error(i(90));It(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Mt(r)}break a;case`textarea`:Bt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&zt(e,!!n.multiple,t,!1)}}}var nn=!1;function rn(e,t,n){if(nn)return e(t,n);nn=!0;try{return e(t)}finally{if(nn=!1,($t!==null||en!==null)&&(yu(),$t&&(t=$t,e=en,en=$t=null,tn(t),e)))for(t=0;t<e.length;t++)tn(e[t])}}function an(e,t){var n=e.stateNode;if(n===null)return null;var r=n[it]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var on=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),sn=!1;if(on)try{var cn={};Object.defineProperty(cn,`passive`,{get:function(){sn=!0}}),window.addEventListener(`test`,cn,cn),window.removeEventListener(`test`,cn,cn)}catch{sn=!1}var ln=null,un=null,dn=null;function fn(){if(dn)return dn;var e,t=un,n=t.length,r,i=`value`in ln?ln.value:ln.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return dn=i.slice(e,1<r?1-r:void 0)}function pn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function mn(){return!0}function hn(){return!1}function gn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?mn:hn,this.isPropagationStopped=hn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=mn)},persist:function(){},isPersistent:mn}),t}var _n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vn=gn(_n),yn=f({},_n,{view:0,detail:0}),bn=gn(yn),xn,Sn,Cn,wn=f({},yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Cn&&(Cn&&e.type===`mousemove`?(xn=e.screenX-Cn.screenX,Sn=e.screenY-Cn.screenY):Sn=xn=0,Cn=e),xn)},movementY:function(e){return`movementY`in e?e.movementY:Sn}}),Tn=gn(wn),En=gn(f({},wn,{dataTransfer:0})),Dn=gn(f({},yn,{relatedTarget:0})),On=gn(f({},_n,{animationName:0,elapsedTime:0,pseudoElement:0})),kn=gn(f({},_n,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),An=gn(f({},_n,{data:0})),jn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Mn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Nn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Pn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nn[e])?!!t[e]:!1}function Fn(){return Pn}var In=gn(f({},yn,{key:function(e){if(e.key){var t=jn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=pn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Mn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fn,charCode:function(e){return e.type===`keypress`?pn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?pn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Ln=gn(f({},wn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Rn=gn(f({},yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fn})),zn=gn(f({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0})),Bn=gn(f({},wn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Vn=gn(f({},_n,{newState:0,oldState:0})),Hn=[9,13,27,32],Un=on&&`CompositionEvent`in window,Wn=null;on&&`documentMode`in document&&(Wn=document.documentMode);var Gn=on&&`TextEvent`in window&&!Wn,Kn=on&&(!Un||Wn&&8<Wn&&11>=Wn),qn=` `,Jn=!1;function Yn(e,t){switch(e){case`keyup`:return Hn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Xn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Zn=!1;function Qn(e,t){switch(e){case`compositionend`:return Xn(t);case`keypress`:return t.which===32?(Jn=!0,qn):null;case`textInput`:return e=t.data,e===qn&&Jn?null:e;default:return null}}function $n(e,t){if(Zn)return e===`compositionend`||!Un&&Yn(e,t)?(e=fn(),dn=un=ln=null,Zn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Kn&&t.locale!==`ko`?null:t.data;default:return null}}var er={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!er[e.type]:t===`textarea`}function nr(e,t,n,r){$t?en?en.push(r):en=[r]:$t=r,t=Td(t,`onChange`),0<t.length&&(n=new vn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var rr=null,ir=null;function ar(e){vd(e,0)}function or(e){if(Mt(mt(e)))return e}function sr(e,t){if(e===`change`)return t}var cr=!1;if(on){var lr;if(on){var ur=`oninput`in document;if(!ur){var dr=document.createElement(`div`);dr.setAttribute(`oninput`,`return;`),ur=typeof dr.oninput==`function`}lr=ur}else lr=!1;cr=lr&&(!document.documentMode||9<document.documentMode)}function fr(){rr&&(rr.detachEvent(`onpropertychange`,pr),ir=rr=null)}function pr(e){if(e.propertyName===`value`&&or(ir)){var t=[];nr(t,ir,e,Qt(e)),rn(ar,t)}}function mr(e,t,n){e===`focusin`?(fr(),rr=t,ir=n,rr.attachEvent(`onpropertychange`,pr)):e===`focusout`&&fr()}function hr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return or(ir)}function gr(e,t){if(e===`click`)return or(t)}function _r(e,t){if(e===`input`||e===`change`)return or(t)}function vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var yr=typeof Object.is==`function`?Object.is:vr;function br(e,t){if(yr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ye.call(t,i)||!yr(e[i],t[i]))return!1}return!0}function xr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sr(e,t){var n=xr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=xr(n)}}function Cr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Nt(e.document)}return t}function Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Er=on&&`documentMode`in document&&11>=document.documentMode,Dr=null,Or=null,kr=null,Ar=!1;function jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ar||Dr==null||Dr!==Nt(r)||(r=Dr,`selectionStart`in r&&Tr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),kr&&br(kr,r)||(kr=r,r=Td(Or,`onSelect`),0<r.length&&(t=new vn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Dr)))}function Mr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Nr={animationend:Mr(`Animation`,`AnimationEnd`),animationiteration:Mr(`Animation`,`AnimationIteration`),animationstart:Mr(`Animation`,`AnimationStart`),transitionrun:Mr(`Transition`,`TransitionRun`),transitionstart:Mr(`Transition`,`TransitionStart`),transitioncancel:Mr(`Transition`,`TransitionCancel`),transitionend:Mr(`Transition`,`TransitionEnd`)},Pr={},Fr={};on&&(Fr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Nr.animationend.animation,delete Nr.animationiteration.animation,delete Nr.animationstart.animation),`TransitionEvent`in window||delete Nr.transitionend.transition);function Ir(e){if(Pr[e])return Pr[e];if(!Nr[e])return e;var t=Nr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Fr)return Pr[e]=t[n];return e}var Lr=Ir(`animationend`),Rr=Ir(`animationiteration`),H=Ir(`animationstart`),zr=Ir(`transitionrun`),Br=Ir(`transitionstart`),Vr=Ir(`transitioncancel`),Hr=Ir(`transitionend`),Ur=new Map,Wr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Wr.push(`scrollEnd`);function Gr(e,t){Ur.set(e,t),yt(t,[e])}var Kr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},qr=[],Jr=0,Yr=0;function Xr(){for(var e=Jr,t=Yr=Jr=0;t<e;){var n=qr[t];qr[t++]=null;var r=qr[t];qr[t++]=null;var i=qr[t];qr[t++]=null;var a=qr[t];if(qr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ei(n,i,a)}}function Zr(e,t,n,r){qr[Jr++]=e,qr[Jr++]=t,qr[Jr++]=n,qr[Jr++]=r,Yr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Qr(e,t,n,r){return Zr(e,t,n,r),ti(e)}function $r(e,t){return Zr(e,null,null,t),ti(e)}function ei(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ie(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ti(e){if(50<uu)throw uu=0,du=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ni={};function ri(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ii(e,t,n,r){return new ri(e,t,n,r)}function ai(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oi(e,t){var n=e.alternate;return n===null?(n=ii(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function si(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ci(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ai(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,L.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case O:return e=ii(31,n,t,a),e.elementType=O,e.lanes=o,e;case g:return li(n.children,a,o,t);case _:s=8,a|=24;break;case b:return e=ii(12,n,t,a|2),e.elementType=b,e.lanes=o,e;case w:return e=ii(13,n,t,a),e.elementType=w,e.lanes=o,e;case T:return e=ii(19,n,t,a),e.elementType=T,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case S:s=10;break a;case x:s=9;break a;case C:s=11;break a;case E:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ii(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function li(e,t,n,r){return e=ii(7,e,r,t),e.lanes=n,e}function ui(e,t,n){return e=ii(6,e,null,t),e.lanes=n,e}function di(e){var t=ii(18,null,null,0);return t.stateNode=e,t}function fi(e,t,n){return t=ii(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var pi=new WeakMap;function mi(e,t){if(typeof e==`object`&&e){var n=pi.get(e);return n===void 0?(t={value:e,source:t,stack:ve(t)},pi.set(e,t),t):n}return{value:e,source:t,stack:ve(t)}}var hi=[],gi=0,_i=null,vi=0,yi=[],bi=0,xi=null,Si=1,Ci=``;function wi(e,t){hi[gi++]=vi,hi[gi++]=_i,_i=e,vi=t}function Ti(e,t,n){yi[bi++]=Si,yi[bi++]=Ci,yi[bi++]=xi,xi=e;var r=Si;e=Ci;var i=32-Ie(r)-1;r&=~(1<<i),n+=1;var a=32-Ie(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Si=1<<32-Ie(t)+i|n<<i|r,Ci=a+e}else Si=1<<a|n<<i|r,Ci=e}function Ei(e){e.return!==null&&(wi(e,1),Ti(e,1,0))}function Di(e){for(;e===_i;)_i=hi[--gi],hi[gi]=null,vi=hi[--gi],hi[gi]=null;for(;e===xi;)xi=yi[--bi],yi[bi]=null,Ci=yi[--bi],yi[bi]=null,Si=yi[--bi],yi[bi]=null}function Oi(e,t){yi[bi++]=Si,yi[bi++]=Ci,yi[bi++]=xi,Si=t.id,Ci=t.overflow,xi=e}var ki=null,U=null,W=!1,Ai=null,ji=!1,Mi=Error(i(519));function Ni(e){throw zi(mi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Mi}function Pi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[rt]=e,t[it]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<gd.length;n++)$(gd[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),Lt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),Vt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||jd(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=Xt),t=!0):t=!1,t||Ni(e,!0)}function Fi(e){for(ki=e.return;ki;)switch(ki.tag){case 5:case 31:case 13:ji=!1;return;case 27:case 3:ji=!0;return;default:ki=ki.return}}function Ii(e){if(e!==ki)return!1;if(!W)return Fi(e),W=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&U&&Ni(e),Fi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));U=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));U=uf(e)}else t===27?(t=U,Zd(e.type)?(e=lf,lf=null,U=e):U=t):U=ki?cf(e.stateNode.nextSibling):null;return!0}function Li(){U=ki=null,W=!1}function Ri(){var e=Ai;return e!==null&&(Xl===null?Xl=e:Xl.push.apply(Xl,e),Ai=null),e}function zi(e){Ai===null?Ai=[e]:Ai.push(e)}var Bi=P(null),Vi=null,Hi=null;function Ui(e,t,n){I(Bi,t._currentValue),t._currentValue=n}function Wi(e){e._currentValue=Bi.current,F(Bi)}function Gi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ki(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Gi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Gi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function qi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;yr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===se.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Ki(t,e,n,r),t.flags|=262144}function Ji(e){for(e=e.firstContext;e!==null;){if(!yr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Yi(e){Vi=e,Hi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Xi(e){return Qi(Vi,e)}function Zi(e,t){return Vi===null&&Yi(e),Qi(e,t)}function Qi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Hi===null){if(e===null)throw Error(i(308));Hi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Hi=Hi.next=t;return n}var $i=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ea=t.unstable_scheduleCallback,ta=t.unstable_NormalPriority,na={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ra(){return{controller:new $i,data:new Map,refCount:0}}function ia(e){e.refCount--,e.refCount===0&&ea(ta,function(){e.controller.abort()})}var aa=null,oa=0,sa=0,ca=null;function la(e,t){if(aa===null){var n=aa=[];oa=0,sa=ud(),ca={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return oa++,t.then(ua,ua),t}function ua(){if(--oa===0&&aa!==null){ca!==null&&(ca.status=`fulfilled`);var e=aa;aa=null,sa=0,ca=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function da(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var fa=M.S;M.S=function(e,t){$l=we(),typeof t==`object`&&t&&typeof t.then==`function`&&la(e,t),fa!==null&&fa(e,t)};var pa=P(null);function ma(){var e=pa.current;return e===null?J.pooledCache:e}function ha(e,t){t===null?I(pa,pa.current):I(pa,t.pool)}function ga(){var e=ma();return e===null?null:{parent:na._currentValue,pool:e}}var _a=Error(i(460)),va=Error(i(474)),ya=Error(i(542)),ba={then:function(){}};function xa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Sa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Xt,Xt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ea(e),e;default:if(typeof t.status==`string`)t.then(Xt,Xt);else{if(e=J,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ea(e),e}throw wa=t,_a}}function Ca(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(wa=e,_a):e}}var wa=null;function Ta(){if(wa===null)throw Error(i(459));var e=wa;return wa=null,e}function Ea(e){if(e===_a||e===ya)throw Error(i(483))}var Da=null,Oa=0;function ka(e){var t=Oa;return Oa+=1,Da===null&&(Da=[]),Sa(Da,e,t)}function Aa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ja(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ma(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=oi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ui(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===D&&Ca(i)===t.type)?(t=a(t,n.props),Aa(t,n),t.return=e,t):(t=ci(n.type,n.key,n.props,null,e.mode,r),Aa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=fi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=li(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ui(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=ci(t.type,t.key,t.props,null,e.mode,n),Aa(n,t),n.return=e,n;case h:return t=fi(t,e.mode,n),t.return=e,t;case D:return t=Ca(t),f(e,t,n)}if(ne(t)||A(t))return t=li(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ka(t),n);if(t.$$typeof===S)return f(e,Zi(e,t),n);ja(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case D:return n=Ca(n),p(e,t,n,r)}if(ne(n)||A(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ka(n),r);if(n.$$typeof===S)return p(e,t,Zi(e,n),r);ja(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=Ca(r),_(e,t,n,r,i)}if(ne(r)||A(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,ka(r),i);if(r.$$typeof===S)return _(e,t,n,Zi(t,r),i);ja(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),W&&wi(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return W&&wi(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),W&&wi(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),W&&wi(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return W&&wi(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),W&&wi(a,h),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&Ca(l)===r.type){n(e,r.sibling),c=a(r,o.props),Aa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===g?(c=li(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ci(o.type,o.key,o.props,null,e.mode,c),Aa(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=fi(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=Ca(o),b(e,r,o,c)}if(ne(o))return v(e,r,o,c);if(A(o)){if(l=A(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,ka(o),c);if(o.$$typeof===S)return b(e,r,Zi(e,o),c);ja(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=ui(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Oa=0;var i=b(e,t,n,r);return Da=null,i}catch(t){if(t===_a||t===ya)throw t;var a=ii(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Na=Ma(!0),Pa=Ma(!1),Fa=!1;function Ia(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function La(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ra(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function za(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,q&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ti(e),ei(e,null,n),t}return Zr(e,r,t,n),ti(e)}function Ba(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xe(e,n)}}function Va(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ha=!1;function Ua(){if(Ha){var e=ca;if(e!==null)throw e}}function Wa(e,t,n,r){Ha=!1;var i=e.updateQueue;Fa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(X&p)===p:(r&p)===p){p!==0&&p===sa&&(Ha=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Fa=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Wl|=o,e.lanes=o,e.memoizedState=d}}function Ga(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ka(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ga(n[e],t)}var qa=P(null),Ja=P(0);function Ya(e,t){e=Hl,I(Ja,e),I(qa,t),Hl=e|t.baseLanes}function Xa(){I(Ja,Hl),I(qa,qa.current)}function Za(){Hl=Ja.current,F(qa),F(Ja)}var Qa=P(null),$a=null;function eo(e){var t=e.alternate;I(ao,ao.current&1),I(Qa,e),$a===null&&(t===null||qa.current!==null||t.memoizedState!==null)&&($a=e)}function to(e){I(ao,ao.current),I(Qa,e),$a===null&&($a=e)}function no(e){e.tag===22?(I(ao,ao.current),I(Qa,e),$a===null&&($a=e)):ro(e)}function ro(){I(ao,ao.current),I(Qa,Qa.current)}function io(e){F(Qa),$a===e&&($a=null),F(ao)}var ao=P(0);function oo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var so=0,G=null,K=null,co=null,lo=!1,uo=!1,fo=!1,po=0,mo=0,ho=null,go=0;function _o(){throw Error(i(321))}function vo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!yr(e[n],t[n]))return!1;return!0}function yo(e,t,n,r,i,a){return so=a,G=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?Is:Ls,fo=!1,a=n(r,i),fo=!1,uo&&(a=xo(t,n,r,i)),bo(e),a}function bo(e){M.H=Fs;var t=K!==null&&K.next!==null;if(so=0,co=K=G=null,lo=!1,mo=0,ho=null,t)throw Error(i(300));e===null||ec||(e=e.dependencies,e!==null&&Ji(e)&&(ec=!0))}function xo(e,t,n,r){G=e;var a=0;do{if(uo&&(ho=null),mo=0,uo=!1,25<=a)throw Error(i(301));if(a+=1,co=K=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}M.H=Rs,o=t(n,r)}while(uo);return o}function So(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?ko(t):t,e=e.useState()[0],(K===null?null:K.memoizedState)!==e&&(G.flags|=1024),t}function Co(){var e=po!==0;return po=0,e}function wo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function To(e){if(lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}lo=!1}so=0,co=K=G=null,uo=!1,mo=po=0,ho=null}function Eo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return co===null?G.memoizedState=co=e:co=co.next=e,co}function Do(){if(K===null){var e=G.alternate;e=e===null?null:e.memoizedState}else e=K.next;var t=co===null?G.memoizedState:co.next;if(t!==null)co=t,K=e;else{if(e===null)throw G.alternate===null?Error(i(467)):Error(i(310));K=e,e={memoizedState:K.memoizedState,baseState:K.baseState,baseQueue:K.baseQueue,queue:K.queue,next:null},co===null?G.memoizedState=co=e:co=co.next=e}return co}function Oo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ko(e){var t=mo;return mo+=1,ho===null&&(ho=[]),e=Sa(ho,e,t),t=G,(co===null?t.memoizedState:co.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?Is:Ls),e}function Ao(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ko(e);if(e.$$typeof===S)return Xi(e)}throw Error(i(438,String(e)))}function jo(e){var t=null,n=G.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=G.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Oo(),G.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=k;return t.index++,n}function Mo(e,t){return typeof t==`function`?t(e):t}function No(e){return Po(Do(),K,e)}function Po(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(so&f)===f:(X&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===sa&&(d=!0);else if((so&p)===p){u=u.next,p===sa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,G.lanes|=p,Wl|=p;f=u.action,fo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,G.lanes|=f,Wl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!yr(o,e.memoizedState)&&(ec=!0,d&&(n=ca,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Fo(e){var t=Do(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);yr(o,t.memoizedState)||(ec=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Io(e,t,n){var r=G,a=Do(),o=W;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!yr((K||a).memoizedState,n);if(s&&(a.memoizedState=n,ec=!0),a=a.queue,ss(zo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||co!==null&&co.memoizedState.tag&1){if(r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,a,n,t),null),J===null)throw Error(i(349));o||so&127||Lo(r,t,n)}return n}function Lo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=G.updateQueue,t===null?(t=Oo(),G.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ro(e,t,n,r){t.value=n,t.getSnapshot=r,Bo(t)&&Vo(e)}function zo(e,t,n){return n(function(){Bo(t)&&Vo(e)})}function Bo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yr(e,n)}catch{return!0}}function Vo(e){var t=$r(e,2);t!==null&&mu(t,e,2)}function Ho(e){var t=Eo();if(typeof e==`function`){var n=e;if(e=n(),fo){Fe(!0);try{n()}finally{Fe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:e},t}function Uo(e,t,n,r){return e.baseState=n,Po(e,K,typeof r==`function`?r:Mo)}function Wo(e,t,n,r,a){if(Ms(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};M.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Go(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Go(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=M.T,o={};M.T=o;try{var s=n(i,r),c=M.S;c!==null&&c(o,s),Ko(e,t,s)}catch(n){Jo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),Ko(e,t,a)}catch(n){Jo(e,t,n)}}function Ko(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){qo(e,t,n)},function(n){return Jo(e,t,n)}):qo(e,t,n)}function qo(e,t,n){t.status=`fulfilled`,t.value=n,Yo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Go(e,n)))}function Jo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Yo(t),t=t.next;while(t!==r)}e.action=null}function Yo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xo(e,t){return t}function Zo(e,t){if(W){var n=J.formState;if(n!==null){a:{var r=G;if(W){if(U){b:{for(var i=U,a=ji;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){U=cf(i.nextSibling),r=i.data===`F!`;break a}}Ni(r)}r=!1}r&&(t=n[0])}}return n=Eo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:t},n.queue=r,n=ks.bind(null,G,r),r.dispatch=n,r=Ho(!1),a=js.bind(null,G,!1,r.queue),r=Eo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Wo.bind(null,G,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Qo(e){return $o(Do(),K,e)}function $o(e,t,n){if(t=Po(e,t,Xo)[0],e=No(Mo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ko(t)}catch(e){throw e===_a?ya:e}else r=t;t=Do();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(G.flags|=2048,ns(9,{destroy:void 0},es.bind(null,i,n),null)),[r,a,e]}function es(e,t){e.action=t}function ts(e){var t=Do(),n=K;if(n!==null)return $o(t,n,e);Do(),t=t.memoizedState,n=Do();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=G.updateQueue,t===null&&(t=Oo(),G.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function rs(){return Do().memoizedState}function is(e,t,n,r){var i=Eo();G.flags|=e,i.memoizedState=ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function as(e,t,n,r){var i=Do();r=r===void 0?null:r;var a=i.memoizedState.inst;K!==null&&r!==null&&vo(r,K.memoizedState.deps)?i.memoizedState=ns(t,a,n,r):(G.flags|=e,i.memoizedState=ns(1|t,a,n,r))}function os(e,t){is(8390656,8,e,t)}function ss(e,t){as(2048,8,e,t)}function cs(e){G.flags|=4;var t=G.updateQueue;if(t===null)t=Oo(),G.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ls(e){var t=Do().memoizedState;return cs({ref:t,nextImpl:e}),function(){if(q&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function us(e,t){return as(4,2,e,t)}function ds(e,t){return as(4,4,e,t)}function fs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ps(e,t,n){n=n==null?null:n.concat([e]),as(4,4,fs.bind(null,t,e),n)}function ms(){}function hs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&vo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function gs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&vo(t,r[1]))return r[0];if(r=e(),fo){Fe(!0);try{e()}finally{Fe(!1)}}return n.memoizedState=[r,t],r}function _s(e,t,n){return n===void 0||so&1073741824&&!(X&261930)?e.memoizedState=t:(e.memoizedState=n,e=pu(),G.lanes|=e,Wl|=e,n)}function vs(e,t,n,r){return yr(n,t)?n:qa.current===null?!(so&42)||so&1073741824&&!(X&261930)?(ec=!0,e.memoizedState=n):(e=pu(),G.lanes|=e,Wl|=e,t):(e=_s(e,n,r),yr(e,t)||(ec=!0),e)}function ys(e,t,n,r,i){var a=N.p;N.p=a!==0&&8>a?a:8;var o=M.T,s={};M.T=s,js(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?As(e,t,da(c,r),fu(e)):As(e,t,r,fu(e))}catch(n){As(e,t,{then:function(){},status:`rejected`,reason:n},fu())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function bs(){}function xs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ss(e).queue;ys(e,a,t,re,n===null?bs:function(){return Cs(e),n(r)})}function Ss(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Cs(e){var t=Ss(e);t.next===null&&(t=e.alternate.memoizedState),As(e,t.next.queue,{},fu())}function ws(){return Xi(Qf)}function Ts(){return Do().memoizedState}function Es(){return Do().memoizedState}function Ds(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fu();e=Ra(n);var r=za(t,e,n);r!==null&&(mu(r,t,n),Ba(r,t,n)),t={cache:ra()},e.payload=t;return}t=t.return}}function Os(e,t,n){var r=fu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ms(e)?Ns(t,n):(n=Qr(e,t,n,r),n!==null&&(mu(n,e,r),Ps(n,t,r)))}function ks(e,t,n){As(e,t,n,fu())}function As(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ms(e))Ns(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,yr(s,o))return Zr(e,t,i,0),J===null&&Xr(),!1}catch{}if(n=Qr(e,t,i,r),n!==null)return mu(n,e,r),Ps(n,t,r),!0}return!1}function js(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ms(e)){if(t)throw Error(i(479))}else t=Qr(e,n,r,2),t!==null&&mu(t,e,2)}function Ms(e){var t=e.alternate;return e===G||t!==null&&t===G}function Ns(e,t){uo=lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ps(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xe(e,n)}}var Fs={readContext:Xi,use:Ao,useCallback:_o,useContext:_o,useEffect:_o,useImperativeHandle:_o,useLayoutEffect:_o,useInsertionEffect:_o,useMemo:_o,useReducer:_o,useRef:_o,useState:_o,useDebugValue:_o,useDeferredValue:_o,useTransition:_o,useSyncExternalStore:_o,useId:_o,useHostTransitionStatus:_o,useFormState:_o,useActionState:_o,useOptimistic:_o,useMemoCache:_o,useCacheRefresh:_o};Fs.useEffectEvent=_o;var Is={readContext:Xi,use:Ao,useCallback:function(e,t){return Eo().memoizedState=[e,t===void 0?null:t],e},useContext:Xi,useEffect:os,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),is(4194308,4,fs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return is(4194308,4,e,t)},useInsertionEffect:function(e,t){is(4,2,e,t)},useMemo:function(e,t){var n=Eo();t=t===void 0?null:t;var r=e();if(fo){Fe(!0);try{e()}finally{Fe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Eo();if(n!==void 0){var i=n(t);if(fo){Fe(!0);try{n(t)}finally{Fe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Os.bind(null,G,e),[r.memoizedState,e]},useRef:function(e){var t=Eo();return e={current:e},t.memoizedState=e},useState:function(e){e=Ho(e);var t=e.queue,n=ks.bind(null,G,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ms,useDeferredValue:function(e,t){return _s(Eo(),e,t)},useTransition:function(){var e=Ho(!1);return e=ys.bind(null,G,e.queue,!0,!1),Eo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=G,a=Eo();if(W){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),J===null)throw Error(i(349));X&127||Lo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,os(zo.bind(null,r,o,e),[e]),r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,o,n,t),null),n},useId:function(){var e=Eo(),t=J.identifierPrefix;if(W){var n=Ci,r=Si;n=(r&~(1<<32-Ie(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=po++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=go++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ws,useFormState:Zo,useActionState:Zo,useOptimistic:function(e){var t=Eo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=js.bind(null,G,!0,n),n.dispatch=t,[e,t]},useMemoCache:jo,useCacheRefresh:function(){return Eo().memoizedState=Ds.bind(null,G)},useEffectEvent:function(e){var t=Eo(),n={impl:e};return t.memoizedState=n,function(){if(q&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ls={readContext:Xi,use:Ao,useCallback:hs,useContext:Xi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:No,useRef:rs,useState:function(){return No(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){return vs(Do(),K.memoizedState,e,t)},useTransition:function(){var e=No(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){return Uo(Do(),K,e,t)},useMemoCache:jo,useCacheRefresh:Es};Ls.useEffectEvent=ls;var Rs={readContext:Xi,use:Ao,useCallback:hs,useContext:Xi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:Fo,useRef:rs,useState:function(){return Fo(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){var n=Do();return K===null?_s(n,e,t):vs(n,K.memoizedState,e,t)},useTransition:function(){var e=Fo(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){var n=Do();return K===null?(n.baseState=e,[e,n.queue.dispatch]):Uo(n,K,e,t)},useMemoCache:jo,useCacheRefresh:Es};Rs.useEffectEvent=ls;function zs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Bs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=fu(),i=Ra(r);i.payload=t,n!=null&&(i.callback=n),t=za(e,i,r),t!==null&&(mu(t,e,r),Ba(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=fu(),i=Ra(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=za(e,i,r),t!==null&&(mu(t,e,r),Ba(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fu(),r=Ra(n);r.tag=2,t!=null&&(r.callback=t),t=za(e,r,n),t!==null&&(mu(t,e,n),Ba(t,e,n))}};function Vs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!br(n,r)||!br(i,a):!0}function Hs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Bs.enqueueReplaceState(t,t.state,null)}function Us(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ws(e){Kr(e)}function Gs(e){console.error(e)}function Ks(e){Kr(e)}function qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Js(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ys(e,t,n){return n=Ra(n),n.tag=3,n.payload={element:null},n.callback=function(){qs(e,t)},n}function Xs(e){return e=Ra(e),e.tag=3,e}function Zs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Js(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Js(t,n,r),typeof i!=`function`&&(nu===null?nu=new Set([this]):nu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Qs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&qi(t,n,a,!0),n=Qa.current,n!==null){switch(n.tag){case 31:case 13:return $a===null?Eu():n.alternate===null&&Ul===0&&(Ul=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ba?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Wu(e,r,a)),!1;case 22:return n.flags|=65536,r===ba?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Wu(e,r,a)),!1}throw Error(i(435,n.tag))}return Wu(e,r,a),Eu(),!1}if(W)return t=Qa.current,t===null?(r!==Mi&&(t=Error(i(423),{cause:r}),zi(mi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=mi(r,n),a=Ys(e.stateNode,r,a),Va(e,a),Ul!==4&&(Ul=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Mi&&(e=Error(i(422),{cause:r}),zi(mi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=mi(o,n),Yl===null?Yl=[o]:Yl.push(o),Ul!==4&&(Ul=2),t===null)return!0;r=mi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ys(n.stateNode,r,e),Va(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(nu===null||!nu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Xs(a),Zs(a,e,n,r),Va(n,a),!1}n=n.return}while(n!==null);return!1}var $s=Error(i(461)),ec=!1;function tc(e,t,n,r){t.child=e===null?Pa(t,null,n,r):Na(t,e.child,n,r)}function nc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Yi(t),r=yo(e,t,n,o,a,i),s=Co(),e!==null&&!ec?(wo(e,t,i),Ec(e,t,i)):(W&&s&&Ei(t),t.flags|=1,tc(e,t,r,i),t.child)}function rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ai(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ic(e,t,a,r,i)):(e=ci(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Dc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?br:n,n(o,r)&&e.ref===t.ref)return Ec(e,t,i)}return t.flags|=1,e=oi(a,r),e.ref=t.ref,e.return=t,t.child=e}function ic(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(br(a,r)&&e.ref===t.ref)if(ec=!1,t.pendingProps=r=a,Dc(e,i))e.flags&131072&&(ec=!0);else return t.lanes=e.lanes,Ec(e,t,i)}return fc(e,t,n,r,i)}function ac(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return sc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ha(t,a===null?null:a.cachePool),a===null?Xa():Ya(t,a),no(t);else return r=t.lanes=536870912,sc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ha(t,null),Xa(),ro(t)):(ha(t,a.cachePool),Ya(t,a),ro(t),t.memoizedState=null);return tc(e,t,i,n),t.child}function oc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function sc(e,t,n,r,i){var a=ma();return a=a===null?null:{parent:na._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ha(t,null),Xa(),no(t),e!==null&&qi(e,t,r,!0),t.childLanes=i,null}function cc(e,t){return t=xc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lc(e,t,n){return Na(t,e.child,null,n),e=cc(t,t.pendingProps),e.flags|=2,io(t),t.memoizedState=null,e}function uc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(W){if(r.mode===`hidden`)return e=cc(t,r),t.lanes=536870912,oc(null,e);if(to(t),(e=U)?(e=rf(e,ji),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xi===null?null:{id:Si,overflow:Ci},retryLane:536870912,hydrationErrors:null},n=di(e),n.return=t,t.child=n,ki=t,U=null)):e=null,e===null)throw Ni(t);return t.lanes=536870912,null}return cc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(to(t),a)if(t.flags&256)t.flags&=-257,t=lc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(ec||qi(e,t,n,!1),a=(n&e.childLanes)!==0,ec||a){if(r=J,r!==null&&(s=Ze(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,$r(e,s),mu(r,e,s),$s;Eu(),t=lc(e,t,n)}else e=o.treeContext,U=cf(s.nextSibling),ki=t,W=!0,Ai=null,ji=!1,e!==null&&Oi(t,e),t=cc(t,r),t.flags|=4096;return t}return e=oi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function dc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function fc(e,t,n,r,i){return Yi(t),n=yo(e,t,n,r,void 0,i),r=Co(),e!==null&&!ec?(wo(e,t,i),Ec(e,t,i)):(W&&r&&Ei(t),t.flags|=1,tc(e,t,n,i),t.child)}function pc(e,t,n,r,i,a){return Yi(t),t.updateQueue=null,n=xo(t,r,n,i),bo(e),r=Co(),e!==null&&!ec?(wo(e,t,a),Ec(e,t,a)):(W&&r&&Ei(t),t.flags|=1,tc(e,t,n,a),t.child)}function mc(e,t,n,r,i){if(Yi(t),t.stateNode===null){var a=ni,o=n.contextType;typeof o==`object`&&o&&(a=Xi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Bs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ia(t),o=n.contextType,a.context=typeof o==`object`&&o?Xi(o):ni,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(zs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Bs.enqueueReplaceState(a,a.state,null),Wa(t,r,a,i),Ua(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Us(n,s);a.props=c;var l=a.context,u=n.contextType;o=ni,typeof u==`object`&&u&&(o=Xi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Hs(t,a,r,o),Fa=!1;var f=t.memoizedState;a.state=f,Wa(t,r,a,i),Ua(),l=t.memoizedState,s||f!==l||Fa?(typeof d==`function`&&(zs(t,n,d,r),l=t.memoizedState),(c=Fa||Vs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,La(e,t),o=t.memoizedProps,u=Us(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ni,typeof l==`object`&&l&&(c=Xi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Hs(t,a,r,c),Fa=!1,f=t.memoizedState,a.state=f,Wa(t,r,a,i),Ua();var p=t.memoizedState;o!==d||f!==p||Fa||e!==null&&e.dependencies!==null&&Ji(e.dependencies)?(typeof s==`function`&&(zs(t,n,s,r),p=t.memoizedState),(u=Fa||Vs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ji(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,dc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Na(t,e.child,null,i),t.child=Na(t,null,n,i)):tc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ec(e,t,i),e}function hc(e,t,n,r){return Li(),t.flags|=256,tc(e,t,n,r),t.child}var gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _c(e){return{baseLanes:e,cachePool:ga()}}function vc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ql),e}function yc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(ao.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(W){if(a?eo(t):ro(t),(e=U)?(e=rf(e,ji),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xi===null?null:{id:Si,overflow:Ci},retryLane:536870912,hydrationErrors:null},n=di(e),n.return=t,t.child=n,ki=t,U=null)):e=null,e===null)throw Ni(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(ro(t),a=t.mode,c=xc({mode:`hidden`,children:c},a),r=li(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,s,n),t.memoizedState=gc,oc(null,r)):(eo(t),bc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(eo(t),t.flags&=-257,t=Sc(e,t,n)):t.memoizedState===null?(ro(t),c=r.fallback,a=t.mode,r=xc({mode:`visible`,children:r.children},a),c=li(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Na(t,e.child,null,n),r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,s,n),t.memoizedState=gc,t=oc(null,r)):(ro(t),t.child=e.child,t.flags|=128,t=null);else if(eo(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,zi({value:r,source:null,stack:null}),t=Sc(e,t,n)}else if(ec||qi(e,t,n,!1),s=(n&e.childLanes)!==0,ec||s){if(s=J,s!==null&&(r=Ze(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,$r(e,r),mu(s,e,r),$s;af(c)||Eu(),t=Sc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,U=cf(c.nextSibling),ki=t,W=!0,Ai=null,ji=!1,e!==null&&Oi(t,e),t=bc(t,r.children),t.flags|=4096);return t}return a?(ro(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=oi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=li(c,a,n,null),c.flags|=2):c=oi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,oc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=_c(n):(a=c.cachePool,a===null?a=ga():(l=na._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=vc(e,s,n),t.memoizedState=gc,oc(e.child,r)):(eo(t),n=e.child,e=n.sibling,n=oi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function bc(e,t){return t=xc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function xc(e,t){return e=ii(22,e,null,t),e.lanes=0,e}function Sc(e,t,n){return Na(t,e.child,null,n),e=bc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Gi(e.return,t,n)}function wc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Tc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=ao.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,I(ao,o),tc(e,t,r,n),r=W?vi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cc(e,n,t);else if(e.tag===19)Cc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&oo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),wc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&oo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}wc(t,!0,n,null,a,r);break;case`together`:wc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ec(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(qi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=oi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=oi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Dc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Ji(e))):!0}function Oc(e,t,n){switch(t.tag){case 3:ce(t,t.stateNode.containerInfo),Ui(t,na,e.memoizedState.cache),Li();break;case 27:case 5:ue(t);break;case 4:ce(t,t.stateNode.containerInfo);break;case 10:Ui(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,to(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(eo(t),e=Ec(e,t,n),e===null?null:e.sibling):yc(e,t,n):(eo(t),t.flags|=128,null);eo(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Tc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),I(ao,ao.current),r)break;return null;case 22:return t.lanes=0,ac(e,t,n,t.pendingProps);case 24:Ui(t,na,e.memoizedState.cache)}return Ec(e,t,n)}function kc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ec=!0;else{if(!Dc(e,n)&&!(t.flags&128))return ec=!1,Oc(e,t,n);ec=!!(e.flags&131072)}else ec=!1,W&&t.flags&1048576&&Ti(t,vi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ca(t.elementType),t.type=e,typeof e==`function`)ai(e)?(r=Us(e,r),t.tag=1,t=mc(null,t,e,r,n)):(t.tag=0,t=fc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===C){t.tag=11,t=nc(null,t,e,r,n);break a}else if(a===E){t.tag=14,t=rc(null,t,e,r,n);break a}}throw t=te(e)||e,Error(i(306,t,``))}}return t;case 0:return fc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Us(r,t.pendingProps),mc(e,t,r,a,n);case 3:a:{if(ce(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,La(e,t),Wa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ui(t,na,r),r!==o.cache&&Ki(t,[na],n,!0),Ua(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=hc(e,t,r,n);break a}else if(r!==a){a=mi(Error(i(424)),t),zi(a),t=hc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(U=cf(e.firstChild),ki=t,W=!0,Ai=null,ji=!0,n=Pa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Li(),r===a){t=Ec(e,t,n);break a}tc(e,t,r,n)}t=t.child}return t;case 26:return dc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:W||(n=t.type,e=t.pendingProps,r=Bd(oe.current).createElement(n),r[rt]=t,r[it]=e,Pd(r,n,e),gt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ue(t),e===null&&W&&(r=t.stateNode=ff(t.type,t.pendingProps,oe.current),ki=t,ji=!0,a=U,Zd(t.type)?(lf=a,U=cf(r.firstChild)):U=a),tc(e,t,t.pendingProps.children,n),dc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&W&&((a=r=U)&&(r=tf(r,t.type,t.pendingProps,ji),r===null?a=!1:(t.stateNode=r,ki=t,U=cf(r.firstChild),ji=!1,a=!0)),a||Ni(t)),ue(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=yo(e,t,So,null,null,n),Qf._currentValue=a),dc(e,t),tc(e,t,r,n),t.child;case 6:return e===null&&W&&((e=n=U)&&(n=nf(n,t.pendingProps,ji),n===null?e=!1:(t.stateNode=n,ki=t,U=null,e=!0)),e||Ni(t)),null;case 13:return yc(e,t,n);case 4:return ce(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Na(t,null,r,n):tc(e,t,r,n),t.child;case 11:return nc(e,t,t.type,t.pendingProps,n);case 7:return tc(e,t,t.pendingProps,n),t.child;case 8:return tc(e,t,t.pendingProps.children,n),t.child;case 12:return tc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ui(t,t.type,r.value),tc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Yi(t),a=Xi(a),r=r(a),t.flags|=1,tc(e,t,r,n),t.child;case 14:return rc(e,t,t.type,t.pendingProps,n);case 15:return ic(e,t,t.type,t.pendingProps,n);case 19:return Tc(e,t,n);case 31:return uc(e,t,n);case 22:return ac(e,t,n,t.pendingProps);case 24:return Yi(t),r=Xi(na),e===null?(a=ma(),a===null&&(a=J,o=ra(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ia(t),Ui(t,na,a)):((e.lanes&n)!==0&&(La(e,t),Wa(t,null,null,n),Ua()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ui(t,na,r),r!==a.cache&&Ki(t,[na],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ui(t,na,r))),tc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ac(e){e.flags|=4}function jc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Cu())e.flags|=8192;else throw wa=ba,va}else e.flags&=-16777217}function Mc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(Cu())e.flags|=8192;else throw wa=ba,va}function Nc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ge(),e.lanes|=t,Jl|=t)}function Pc(e,t){if(!W)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Fc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ic(e,t,n){var r=t.pendingProps;switch(Di(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fc(t),null;case 1:return Fc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Wi(na),le(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ii(t)?Ac(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ri())),Fc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ac(t),o===null?(Fc(t),jc(t,a,null,r,n)):(Fc(t),Mc(t,o))):o?o===e.memoizedState?(Fc(t),t.flags&=-16777217):(Ac(t),Fc(t),Mc(t,o)):(e=e.memoizedProps,e!==r&&Ac(t),Fc(t),jc(t,a,e,r,n)),null;case 27:if(de(t),n=oe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Fc(t),null}e=L.current,Ii(t)?Pi(t,e):(e=ff(a,r,n),t.stateNode=e,Ac(t))}return Fc(t),null;case 5:if(de(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Fc(t),null}if(o=L.current,Ii(t))Pi(t,o);else{var s=Bd(oe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[rt]=t,o[it]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Ac(t)}}return Fc(t),jc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=oe.current,Ii(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ki,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[rt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Ni(t,!0)}else e=Bd(e).createTextNode(r),e[rt]=t,t.stateNode=e}return Fc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ii(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[rt]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),e=!1}else n=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(io(t),t):(io(t),null);if(t.flags&128)throw Error(i(558))}return Fc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ii(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[rt]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),a=!1}else a=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(io(t),t):(io(t),null)}return io(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Nc(t,t.updateQueue),Fc(t),null);case 4:return le(),e===null&&xd(t.stateNode.containerInfo),Fc(t),null;case 10:return Wi(t.type),Fc(t),null;case 19:if(F(ao),r=t.memoizedState,r===null)return Fc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Pc(r,!1);else{if(Ul!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=oo(e),o!==null){for(t.flags|=128,Pc(r,!1),e=o.updateQueue,t.updateQueue=e,Nc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)si(n,e),n=n.sibling;return I(ao,ao.current&1|2),W&&wi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&we()>eu&&(t.flags|=128,a=!0,Pc(r,!1),t.lanes=4194304)}else{if(!a)if(e=oo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Nc(t,e),Pc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!W)return Fc(t),null}else 2*we()-r.renderingStartTime>eu&&n!==536870912&&(t.flags|=128,a=!0,Pc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Fc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=we(),e.sibling=null,n=ao.current,I(ao,a?n&1|2:n&1),W&&wi(t,r.treeForkCount),e);case 22:case 23:return io(t),Za(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Fc(t),t.subtreeFlags&6&&(t.flags|=8192)):Fc(t),n=t.updateQueue,n!==null&&Nc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&F(pa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Wi(na),Fc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Lc(e,t){switch(Di(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wi(na),le(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return de(t),null;case 31:if(t.memoizedState!==null){if(io(t),t.alternate===null)throw Error(i(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(io(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return F(ao),null;case 4:return le(),null;case 10:return Wi(t.type),null;case 22:case 23:return io(t),Za(),e!==null&&F(pa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Wi(na),null;case 25:return null;default:return null}}function Rc(e,t){switch(Di(t),t.tag){case 3:Wi(na),le();break;case 26:case 27:case 5:de(t);break;case 4:le();break;case 31:t.memoizedState!==null&&io(t);break;case 13:io(t);break;case 19:F(ao);break;case 10:Wi(t.type);break;case 22:case 23:io(t),Za(),e!==null&&F(pa);break;case 24:Wi(na)}}function zc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Q(t,t.return,e)}}function Bc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Q(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Q(t,t.return,e)}}function Vc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ka(t,n)}catch(t){Q(e,e.return,t)}}}function Hc(e,t,n){n.props=Us(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Q(e,t,n)}}function Uc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Q(e,t,n)}}function Wc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Q(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Q(e,t,n)}else n.current=null}function Gc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Q(e,e.return,t)}}function Kc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[it]=t}catch(t){Q(e,e.return,t)}}function qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Jc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||qc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Xt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[rt]=e,t[it]=n}catch(t){Q(e,e.return,t)}}var Qc=!1,$c=!1,el=!1,tl=typeof WeakSet==`function`?WeakSet:Set,nl=null;function rl(e,t){if(e=e.containerInfo,Rd=sp,e=wr(e),Tr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,nl=t;nl!==null;)if(t=nl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,nl=e;else for(;nl!==null;){switch(t=nl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Us(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Q(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,nl=e;break}nl=t.return}}function il(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:yl(e,n),r&4&&zc(5,n);break;case 1:if(yl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Q(n,n.return,e)}else{var i=Us(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Q(n,n.return,e)}}r&64&&Vc(n),r&512&&Uc(n,n.return);break;case 3:if(yl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ka(e,t)}catch(e){Q(n,n.return,e)}}break;case 27:t===null&&r&4&&Zc(n);case 26:case 5:yl(e,n),t===null&&r&4&&Gc(n),r&512&&Uc(n,n.return);break;case 12:yl(e,n);break;case 31:yl(e,n),r&4&&ul(e,n);break;case 13:yl(e,n),r&4&&dl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qu.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Qc,!r){t=t!==null&&t.memoizedState!==null||$c,i=Qc;var a=$c;Qc=r,($c=t)&&!a?xl(e,n,(n.subtreeFlags&8772)!=0):yl(e,n),Qc=i,$c=a}break;case 30:break;default:yl(e,n)}}function al(e){var t=e.alternate;t!==null&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&dt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ol=null,sl=!1;function cl(e,t,n){for(n=n.child;n!==null;)ll(e,t,n),n=n.sibling}function ll(e,t,n){if(Pe&&typeof Pe.onCommitFiberUnmount==`function`)try{Pe.onCommitFiberUnmount(Ne,n)}catch{}switch(n.tag){case 26:$c||Wc(n,t),cl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$c||Wc(n,t);var r=ol,i=sl;Zd(n.type)&&(ol=n.stateNode,sl=!1),cl(e,t,n),pf(n.stateNode),ol=r,sl=i;break;case 5:$c||Wc(n,t);case 6:if(r=ol,i=sl,ol=null,cl(e,t,n),ol=r,sl=i,ol!==null)if(sl)try{(ol.nodeType===9?ol.body:ol.nodeName===`HTML`?ol.ownerDocument.body:ol).removeChild(n.stateNode)}catch(e){Q(n,t,e)}else try{ol.removeChild(n.stateNode)}catch(e){Q(n,t,e)}break;case 18:ol!==null&&(sl?(e=ol,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(ol,n.stateNode));break;case 4:r=ol,i=sl,ol=n.stateNode.containerInfo,sl=!0,cl(e,t,n),ol=r,sl=i;break;case 0:case 11:case 14:case 15:Bc(2,n,t),$c||Bc(4,n,t),cl(e,t,n);break;case 1:$c||(Wc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Hc(n,t,r)),cl(e,t,n);break;case 21:cl(e,t,n);break;case 22:$c=(r=$c)||n.memoizedState!==null,cl(e,t,n),$c=r;break;default:cl(e,t,n)}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Q(t,t.return,e)}}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Q(t,t.return,e)}}function fl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new tl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new tl),t;default:throw Error(i(435,e.tag))}}function pl(e,t){var n=fl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function ml(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){ol=c.stateNode,sl=!1;break a}break;case 5:ol=c.stateNode,sl=!1;break a;case 3:case 4:ol=c.stateNode.containerInfo,sl=!0;break a}c=c.return}if(ol===null)throw Error(i(160));ll(o,s,a),ol=null,sl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)gl(t,e),t=t.sibling}var hl=null;function gl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ml(t,e),_l(e),r&4&&(Bc(3,e,e.return),zc(3,e),Bc(5,e,e.return));break;case 1:ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),r&64&&Qc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=hl;if(ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ut]||o[rt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[rt]=e,gt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[rt]=e,gt(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Kc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),n!==null&&r&4&&Kc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),e.flags&32){a=e.stateNode;try{Ht(a,``)}catch(t){Q(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Kc(e,a,n===null?a:n.memoizedProps)),r&1024&&(el=!0);break;case 6:if(ml(t,e),_l(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Q(e,e.return,t)}}break;case 3:if(Bf=null,a=hl,hl=gf(t.containerInfo),ml(t,e),hl=a,_l(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Q(e,e.return,t)}el&&(el=!1,vl(e));break;case 4:r=hl,hl=gf(e.stateNode.containerInfo),ml(t,e),_l(e),hl=r;break;case 12:ml(t,e),_l(e);break;case 31:ml(t,e),_l(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 13:ml(t,e),_l(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ql=we()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Qc,d=$c;if(Qc=u||a,$c=d||l,ml(t,e),$c=d,Qc=u,_l(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Qc||$c||bl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Q(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Q(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Q(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,pl(e,n))));break;case 19:ml(t,e),_l(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 30:break;case 21:break;default:ml(t,e),_l(e)}}function _l(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(qc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Xc(e,Jc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Ht(o,``),n.flags&=-33),Xc(e,Jc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Yc(e,Jc(e),s);break;default:throw Error(i(161))}}catch(t){Q(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;vl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function yl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)il(e,t.alternate,t),t=t.sibling}function bl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Bc(4,t,t.return),bl(t);break;case 1:Wc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Hc(t,t.return,n),bl(t);break;case 27:pf(t.stateNode);case 26:case 5:Wc(t,t.return),bl(t);break;case 22:t.memoizedState===null&&bl(t);break;case 30:bl(t);break;default:bl(t)}e=e.sibling}}function xl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:xl(i,a,n),zc(4,a);break;case 1:if(xl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Q(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ga(c[i],s)}catch(e){Q(r,r.return,e)}}n&&o&64&&Vc(a),Uc(a,a.return);break;case 27:Zc(a);case 26:case 5:xl(i,a,n),n&&r===null&&o&4&&Gc(a),Uc(a,a.return);break;case 12:xl(i,a,n);break;case 31:xl(i,a,n),n&&o&4&&ul(i,a);break;case 13:xl(i,a,n),n&&o&4&&dl(i,a);break;case 22:a.memoizedState===null&&xl(i,a,n),Uc(a,a.return);break;case 30:break;default:xl(i,a,n)}t=t.sibling}}function Sl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ia(n))}function Cl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ia(e))}function wl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Tl(e,t,n,r),t=t.sibling}function Tl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:wl(e,t,n,r),i&2048&&zc(9,t);break;case 1:wl(e,t,n,r);break;case 3:wl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ia(e)));break;case 12:if(i&2048){wl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Q(t,t.return,e)}}else wl(e,t,n,r);break;case 31:wl(e,t,n,r);break;case 13:wl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?wl(e,t,n,r):(a._visibility|=2,El(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?wl(e,t,n,r):Dl(e,t),i&2048&&Sl(o,t);break;case 24:wl(e,t,n,r),i&2048&&Cl(t.alternate,t);break;default:wl(e,t,n,r)}}function El(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:El(a,o,s,c,i),zc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,El(a,o,s,c,i)):u._visibility&2?El(a,o,s,c,i):Dl(a,o),i&&l&2048&&Sl(o.alternate,o);break;case 24:El(a,o,s,c,i),i&&l&2048&&Cl(o.alternate,o);break;default:El(a,o,s,c,i)}t=t.sibling}}function Dl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Dl(n,r),i&2048&&Sl(r.alternate,r);break;case 24:Dl(n,r),i&2048&&Cl(r.alternate,r);break;default:Dl(n,r)}t=t.sibling}}var Ol=8192;function kl(e,t,n){if(e.subtreeFlags&Ol)for(e=e.child;e!==null;)Al(e,t,n),e=e.sibling}function Al(e,t,n){switch(e.tag){case 26:kl(e,t,n),e.flags&Ol&&e.memoizedState!==null&&Gf(n,hl,e.memoizedState,e.memoizedProps);break;case 5:kl(e,t,n);break;case 3:case 4:var r=hl;hl=gf(e.stateNode.containerInfo),kl(e,t,n),hl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ol,Ol=16777216,kl(e,t,n),Ol=r):kl(e,t,n));break;default:kl(e,t,n)}}function jl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ml(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Fl(r,e)}jl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Nl(e),e=e.sibling}function Nl(e){switch(e.tag){case 0:case 11:case 15:Ml(e),e.flags&2048&&Bc(9,e,e.return);break;case 3:Ml(e);break;case 12:Ml(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Pl(e)):Ml(e);break;default:Ml(e)}}function Pl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Fl(r,e)}jl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Bc(8,t,t.return),Pl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Pl(t));break;default:Pl(t)}e=e.sibling}}function Fl(e,t){for(;nl!==null;){var n=nl;switch(n.tag){case 0:case 11:case 15:Bc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ia(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,nl=r;else a:for(n=e;nl!==null;){r=nl;var i=r.sibling,a=r.return;if(al(r),r===n){nl=null;break a}if(i!==null){i.return=a,nl=i;break a}nl=a}}}var Il={getCacheForType:function(e){var t=Xi(na),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Xi(na).controller.signal}},Ll=typeof WeakMap==`function`?WeakMap:Map,q=0,J=null,Y=null,X=0,Z=0,Rl=null,zl=!1,Bl=!1,Vl=!1,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=null,Xl=null,Zl=!1,Ql=0,$l=0,eu=1/0,tu=null,nu=null,ru=0,iu=null,au=null,ou=0,su=0,cu=null,lu=null,uu=0,du=null;function fu(){return q&2&&X!==0?X&-X:M.T===null?et():ud()}function pu(){if(ql===0)if(!(X&536870912)||W){var e=ze;ze<<=1,!(ze&3932160)&&(ze=262144),ql=e}else ql=536870912;return e=Qa.current,e!==null&&(e.flags|=32),ql}function mu(e,t,n){(e===J&&(Z===2||Z===9)||e.cancelPendingCommit!==null)&&(xu(e,0),vu(e,X,ql,!1)),qe(e,n),(!(q&2)||e!==J)&&(e===J&&(!(q&2)&&(Gl|=n),Ul===4&&vu(e,X,ql,!1)),nd(e))}function hu(e,t,n){if(q&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ue(e,t),a=r?ku(e,t):Du(e,t,!0),o=r;do{if(a===0){Bl&&!r&&vu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!_u(n)){a=Du(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Yl;var l=c.current.memoizedState.isDehydrated;if(l&&(xu(c,s).flags|=256),s=Du(c,s,!1),s!==2){if(Vl&&!l){c.errorRecoveryDisabledLanes|=o,Gl|=o,a=4;break a}o=Xl,Xl=a,o!==null&&(Xl===null?Xl=o:Xl.push.apply(Xl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){xu(e,0),vu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:vu(r,t,ql,!zl);break a;case 2:Xl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Ql+300-we(),10<a)){if(vu(r,t,ql,!zl),He(r,0,!0)!==0)break a;ou=t,r.timeoutHandle=Kd(gu.bind(null,r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,o,`Throttled`,-0,0),a);break a}gu(r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,o,null,-0,0)}}break}while(1);nd(e)}function gu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xt},Al(t,a,d);var m=(a&62914560)===a?Ql-we():(a&4194048)===a?$l-we():0;if(m=qf(d,m),m!==null){ou=a,e.cancelPendingCommit=m(Iu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),vu(e,a,o,!l);return}}Iu(e,t,a,n,r,i,o,s,c)}function _u(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!yr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function vu(e,t,n,r){t&=~Kl,t&=~Gl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ie(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ye(e,n,t)}function yu(){return q&6?!0:(rd(0,!1),!1)}function bu(){if(Y!==null){if(Z===0)var e=Y.return;else e=Y,Hi=Vi=null,To(e),Da=null,Oa=0,e=Y;for(;e!==null;)Rc(e.alternate,e),e=e.return;Y=null}}function xu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ou=0,bu(),J=e,Y=n=oi(e.current,null),X=t,Z=0,Rl=null,zl=!1,Bl=Ue(e,t),Vl=!1,Jl=ql=Kl=Gl=Wl=Ul=0,Xl=Yl=null,Zl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ie(r),a=1<<i;t|=e[i],r&=~a}return Hl=t,Xr(),n}function Su(e,t){G=null,M.H=Fs,t===_a||t===ya?(t=Ta(),Z=3):t===va?(t=Ta(),Z=4):Z=t===$s?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Rl=t,Y===null&&(Ul=1,qs(e,mi(t,e.current)))}function Cu(){var e=Qa.current;return e===null?!0:(X&4194048)===X?$a===null:(X&62914560)===X||X&536870912?e===$a:!1}function wu(){var e=M.H;return M.H=Fs,e===null?Fs:e}function Tu(){var e=M.A;return M.A=Il,e}function Eu(){Ul=4,zl||(X&4194048)!==X&&Qa.current!==null||(Bl=!0),!(Wl&134217727)&&!(Gl&134217727)||J===null||vu(J,X,ql,!1)}function Du(e,t,n){var r=q;q|=2;var i=wu(),a=Tu();(J!==e||X!==t)&&(tu=null,xu(e,t)),t=!1;var o=Ul;a:do try{if(Z!==0&&Y!==null){var s=Y,c=Rl;switch(Z){case 8:bu(),o=6;break a;case 3:case 2:case 9:case 6:Qa.current===null&&(t=!0);var l=Z;if(Z=0,Rl=null,Nu(e,s,c,l),n&&Bl){o=0;break a}break;default:l=Z,Z=0,Rl=null,Nu(e,s,c,l)}}Ou(),o=Ul;break}catch(t){Su(e,t)}while(1);return t&&e.shellSuspendCounter++,Hi=Vi=null,q=r,M.H=i,M.A=a,Y===null&&(J=null,X=0,Xr()),o}function Ou(){for(;Y!==null;)ju(Y)}function ku(e,t){var n=q;q|=2;var r=wu(),a=Tu();J!==e||X!==t?(tu=null,eu=we()+500,xu(e,t)):Bl=Ue(e,t);a:do try{if(Z!==0&&Y!==null){t=Y;var o=Rl;b:switch(Z){case 1:Z=0,Rl=null,Nu(e,t,o,1);break;case 2:case 9:if(xa(o)){Z=0,Rl=null,Mu(t);break}t=function(){Z!==2&&Z!==9||J!==e||(Z=7),nd(e)},o.then(t,t);break a;case 3:Z=7;break a;case 4:Z=5;break a;case 7:xa(o)?(Z=0,Rl=null,Mu(t)):(Z=0,Rl=null,Nu(e,t,o,7));break;case 5:var s=null;switch(Y.tag){case 26:s=Y.memoizedState;case 5:case 27:var c=Y;if(s?Wf(s):c.stateNode.complete){Z=0,Rl=null;var l=c.sibling;if(l!==null)Y=l;else{var u=c.return;u===null?Y=null:(Y=u,Pu(u))}break b}}Z=0,Rl=null,Nu(e,t,o,5);break;case 6:Z=0,Rl=null,Nu(e,t,o,6);break;case 8:bu(),Ul=6;break a;default:throw Error(i(462))}}Au();break}catch(t){Su(e,t)}while(1);return Hi=Vi=null,M.H=r,M.A=a,q=n,Y===null?(J=null,X=0,Xr(),Ul):0}function Au(){for(;Y!==null&&!Se();)ju(Y)}function ju(e){var t=kc(e.alternate,e,Hl);e.memoizedProps=e.pendingProps,t===null?Pu(e):Y=t}function Mu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=pc(n,t,t.pendingProps,t.type,void 0,X);break;case 11:t=pc(n,t,t.pendingProps,t.type.render,t.ref,X);break;case 5:To(t);default:Rc(n,t),t=Y=si(t,Hl),t=kc(n,t,Hl)}e.memoizedProps=e.pendingProps,t===null?Pu(e):Y=t}function Nu(e,t,n,r){Hi=Vi=null,To(t),Da=null,Oa=0;var i=t.return;try{if(Qs(e,i,t,n,X)){Ul=1,qs(e,mi(n,e.current)),Y=null;return}}catch(t){if(i!==null)throw Y=i,t;Ul=1,qs(e,mi(n,e.current)),Y=null;return}t.flags&32768?(W||r===1?e=!0:Bl||X&536870912?e=!1:(zl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Qa.current,r!==null&&r.tag===13&&(r.flags|=16384))),Fu(t,e)):Pu(t)}function Pu(e){var t=e;do{if(t.flags&32768){Fu(t,zl);return}e=t.return;var n=Ic(t.alternate,t,Hl);if(n!==null){Y=n;return}if(t=t.sibling,t!==null){Y=t;return}Y=t=e}while(t!==null);Ul===0&&(Ul=5)}function Fu(e,t){do{var n=Lc(e.alternate,e);if(n!==null){n.flags&=32767,Y=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Y=e;return}Y=e=n}while(e!==null);Ul=6,Y=null}function Iu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Vu();while(ru!==0);if(q&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Yr,Je(e,n,o,s,c,l),e===J&&(Y=J=null,X=0),au=t,iu=e,ou=n,su=o,cu=a,lu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Yu(Oe,function(){return Hu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=M.T,M.T=null,a=N.p,N.p=2,s=q,q|=4;try{rl(e,t,n)}finally{q=s,N.p=a,M.T=r}}ru=1,Lu(),Ru(),zu()}}function Lu(){if(ru===1){ru=0;var e=iu,t=au,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=q;q|=4;try{gl(t,e);var a=zd,o=wr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Cr(s.ownerDocument.documentElement,s)){if(c!==null&&Tr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Sr(s,h),v=Sr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{q=i,N.p=r,M.T=n}}e.current=t,ru=2}}function Ru(){if(ru===2){ru=0;var e=iu,t=au,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=q;q|=4;try{il(e,t.alternate,t)}finally{q=i,N.p=r,M.T=n}}ru=3}}function zu(){if(ru===4||ru===3){ru=0,Ce();var e=iu,t=au,n=ou,r=lu;t.subtreeFlags&10256||t.flags&10256?ru=5:(ru=0,au=iu=null,Bu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(nu=null),$e(n),t=t.stateNode,Pe&&typeof Pe.onCommitFiberRoot==`function`)try{Pe.onCommitFiberRoot(Ne,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=M.T,i=N.p,N.p=2,M.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{M.T=t,N.p=i}}ou&3&&Vu(),nd(e),i=e.pendingLanes,n&261930&&i&42?e===du?uu++:(uu=0,du=e):uu=0,rd(0,!1)}}function Bu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ia(t)))}function Vu(){return Lu(),Ru(),zu(),Hu()}function Hu(){if(ru!==5)return!1;var e=iu,t=su;su=0;var n=$e(ou),r=M.T,a=N.p;try{N.p=32>n?32:n,M.T=null,n=cu,cu=null;var o=iu,s=ou;if(ru=0,au=iu=null,ou=0,q&6)throw Error(i(331));var c=q;if(q|=4,Nl(o.current),Tl(o,o.current,s,n),q=c,rd(0,!1),Pe&&typeof Pe.onPostCommitFiberRoot==`function`)try{Pe.onPostCommitFiberRoot(Ne,o)}catch{}return!0}finally{N.p=a,M.T=r,Bu(e,t)}}function Uu(e,t,n){t=mi(n,t),t=Ys(e.stateNode,t,2),e=za(e,t,2),e!==null&&(qe(e,2),nd(e))}function Q(e,t,n){if(e.tag===3)Uu(e,e,n);else for(;t!==null;){if(t.tag===3){Uu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(nu===null||!nu.has(r))){e=mi(n,e),n=Xs(2),r=za(t,n,2),r!==null&&(Zs(n,r,t,e),qe(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ll;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Vl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,J===e&&(X&n)===n&&(Ul===4||Ul===3&&(X&62914560)===X&&300>we()-Ql?!(q&2)&&xu(e,0):Kl|=n,Jl===X&&(Jl=0)),nd(e)}function Ku(e,t){t===0&&(t=Ge()),e=$r(e,t),e!==null&&(qe(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ku(e,n)}function Yu(e,t){return be(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ie(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=X,a=He(r,r===J?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ue(r,a)||(n=!0,cd(r,a));r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Gd()&&(e=td);for(var t=we(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}ru!==0&&ru!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ie(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=We(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=J,n=X,n=He(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Z===2||Z===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&xe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ue(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&xe(r),$e(n)){case 2:case 8:n=De;break;case 32:n=Oe;break;case 268435456:n=Ae;break;default:n=Oe}return r=sd.bind(null,e),n=be(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&xe(r),e.callbackPriority=2,e.callbackNode=null,2}function sd(e,t){if(ru!==0&&ru!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Vu()&&e.callbackNode!==n)return null;var r=X;return r=He(e,e===J?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(hu(e,r,t),od(e,we()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Vu())return null;hu(e,t,!0)}function ld(){Yd(function(){q&6?be(Ee,id):ad()})}function ud(){if(td===0){var e=sa;e===0&&(e=Re,Re<<=1,!(Re&261888)&&(Re=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Yt(``+e)}function fd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function pd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=dd((i[it]||null).action),o=r.submitter;o&&(t=(t=o[it]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new vn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(td!==0){var e=o?fd(i,o):new FormData(i);xs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?fd(i,o):new FormData(i),xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var md=0;md<Wr.length;md++){var hd=Wr[md];Gr(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}Gr(Lr,`onAnimationEnd`),Gr(Rr,`onAnimationIteration`),Gr(H,`onAnimationStart`),Gr(`dblclick`,`onDoubleClick`),Gr(`focusin`,`onFocus`),Gr(`focusout`,`onBlur`),Gr(zr,`onTransitionRun`),Gr(Br,`onTransitionStart`),Gr(Vr,`onTransitionCancel`),Gr(Hr,`onTransitionEnd`),bt(`onMouseEnter`,[`mouseout`,`mouseover`]),bt(`onMouseLeave`,[`mouseout`,`mouseover`]),bt(`onPointerEnter`,[`pointerout`,`pointerover`]),bt(`onPointerLeave`,[`pointerout`,`pointerover`]),yt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),yt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),yt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),yt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),yt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),yt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var gd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),_d=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(gd));function vd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Kr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Kr(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[ot];n===void 0&&(n=t[ot]=new Set);var r=e+`__bubble`;n.has(r)||(Sd(t,e,2,!1),n.add(r))}function yd(e,t,n){var r=0;t&&(r|=4),Sd(n,e,r,t)}var bd=`_reactListening`+Math.random().toString(36).slice(2);function xd(e){if(!e[bd]){e[bd]=!0,_t.forEach(function(t){t!==`selectionchange`&&(_d.has(t)||yd(t,!1,e),yd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bd]||(t[bd]=!0,yd(`selectionchange`,!1,t))}}function Sd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!sn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Cd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ft(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}rn(function(){var r=a,i=Qt(n),s=[];a:{var c=Ur.get(e);if(c!==void 0){var l=vn,u=e;switch(e){case`keypress`:if(pn(n)===0)break a;case`keydown`:case`keyup`:l=In;break;case`focusin`:u=`focus`,l=Dn;break;case`focusout`:u=`blur`,l=Dn;break;case`beforeblur`:case`afterblur`:l=Dn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Tn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=En;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Rn;break;case Lr:case Rr:case H:l=On;break;case Hr:l=zn;break;case`scroll`:case`scrollend`:l=bn;break;case`wheel`:l=Bn;break;case`copy`:case`cut`:case`paste`:l=kn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Ln;break;case`toggle`:case`beforetoggle`:l=Vn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=an(m,p),g!=null&&d.push(wd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Zt&&(u=n.relatedTarget||n.fromElement)&&(ft(u)||u[at]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ft(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Tn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Ln,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:mt(l),h=u==null?c:mt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ft(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ed,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Dd(s,c,l,d,!1),u!==null&&f!==null&&Dd(s,f,u,d,!0)}}a:{if(c=r?mt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=sr;else if(tr(c))if(cr)v=_r;else{v=hr;var y=mr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Kt(r.elementType)&&(v=sr):v=gr;if(v&&=v(e,r)){nr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Rt(c,`number`,c.value)}switch(y=r?mt(r):window,e){case`focusin`:(tr(y)||y.contentEditable===`true`)&&(Dr=y,Or=r,kr=null);break;case`focusout`:kr=Or=Dr=null;break;case`mousedown`:Ar=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ar=!1,jr(s,n,i);break;case`selectionchange`:if(Er)break;case`keydown`:case`keyup`:jr(s,n,i)}var b;if(Un)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Zn?Yn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Kn&&n.locale!==`ko`&&(Zn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Zn&&(b=fn()):(ln=i,un=`value`in ln?ln.value:ln.textContent,Zn=!0)),y=Td(r,x),0<y.length&&(x=new An(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Xn(n),b!==null&&(x.data=b)))),(b=Gn?Qn(e,n):$n(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new An(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),pd(s,e,r,n,i)}vd(s,t)})}function wd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Td(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=an(e,n),i!=null&&r.unshift(wd(e,i,a)),i=an(e,t),i!=null&&r.push(wd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ed(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=an(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=an(n,a),l!=null&&o.push(wd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Od=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Ad(e){return(typeof e==`string`?e:``+e).replace(Od,`
10
+ `).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Ht(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Ht(e,``+r);break;case`className`:Et(e,`class`,r);break;case`tabIndex`:Et(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Et(e,n,r);break;case`style`:Gt(e,r,o);break;case`data`:if(t!==`object`){Et(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Md(e,t,`name`,a.name,a,null),Md(e,t,`formEncType`,a.formEncType,a,null),Md(e,t,`formMethod`,a.formMethod,a,null),Md(e,t,`formTarget`,a.formTarget,a,null)):(Md(e,t,`encType`,a.encType,a,null),Md(e,t,`method`,a.method,a,null),Md(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Yt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),Tt(e,`popover`,r);break;case`xlinkActuate`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Tt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=qt.get(n)||n,Tt(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Gt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Ht(e,r):(typeof r==`number`||typeof r==`bigint`)&&Ht(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!vt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[it]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Tt(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Md(e,t,o,s,n,null)}}a&&Md(e,t,`srcSet`,n.srcSet,n,null),r&&Md(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Md(e,t,r,d,n,null)}}Lt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in $(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Md(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&zt(e,!!r,n,!0):zt(e,!!r,t,!1);return;case`textarea`:for(s in $(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Md(e,t,s,c,n,null)}Vt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Md(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<gd.length;r++)$(gd[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Md(e,t,u,r,n,null)}return;default:if(Kt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Md(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Md(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Md(e,t,p,m,r,f)}}It(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Md(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Md(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?zt(e,!!n,n?[]:``,!1):zt(e,!!n,t,!0)):zt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Md(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Md(e,t,s,a,r,o)}Bt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Md(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Md(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Md(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Md(e,t,u,p,r,m)}return;default:if(Kt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Md(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Md(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ut]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),dt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[ut])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);dt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=N.d;N.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=yu();return e||t}function yf(e){var t=pt(e);t!==null&&t.tag===5&&t.type===`form`?Cs(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Ft(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),gt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ft(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ft(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ft(n.imageSizes)+`"]`)):i+=`[href="`+Ft(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),gt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ft(r)+`"][href="`+Ft(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),gt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=ht(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);gt(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=ht(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=f({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),gt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=ht(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),gt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=oe.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=ht(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=ht(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=ht(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+Ft(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),gt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Ft(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ft(n.href)+`"]`);if(r)return t.instance=r,gt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),gt(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,gt(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),gt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,gt(a),a):(r=n,(a=mf.get(o))&&(r=f({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),gt(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ut]||a[rt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,gt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),gt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:S,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ke(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ke(0),this.hiddenUpdates=Ke(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ii(3,null,null,t),e.current=a,a.stateNode=e,t=ra(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ia(a),e}function tp(e){return e?(e=ni,e):ni}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ra(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=za(e,r,t),n!==null&&(mu(n,e,t),Ba(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=$r(e,67108864);t!==null&&mu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=fu();t=Qe(t);var n=$r(e,t);n!==null&&mu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,up(e,t,n,r)}finally{N.p=a,M.T=i}}function lp(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,up(e,t,n,r)}finally{N.p=a,M.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Cd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=pt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ve(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ie(o);s.entanglements[1]|=c,o&=~c}nd(a),!(q&6)&&(eu=we()+500,rd(0,!1))}}break;case 31:case 13:s=$r(a,2),s!==null&&mu(s,a,2),yu(),ip(a,2)}if(a=dp(r),a===null&&Cd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Cd(e,t,r,null,n)}}function dp(e){return e=Qt(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=ft(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Te()){case Ee:return 2;case De:return 8;case Oe:case ke:return 32;case Ae:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=pt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=ft(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,tt(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,tt(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Zt=r,n.target.dispatchEvent(r),Zt=null}else return t=pt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=pt(n);a!==null&&(e.splice(t,3),t-=3,xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[it]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[it]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,fu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),yu(),t[at]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=et();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.4`)throw Error(i(527,Lp,`19.2.4`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Ne=zp.inject(Rp),Pe=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ws,s=Gs,c=Ks;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[at]=t.current,xd(e),new Fp(t)}})),ve=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=_e()})),ye=100,be=128,xe=200,Se=4e3;function Ce(e){if(!Array.isArray(e))return[];let t=[],n=new Set;for(let r of e){if(!we(r))continue;let e=r.id,i=r.label,a=r.initialInput;if(typeof e!=`string`||typeof i!=`string`||typeof a!=`string`||e.length>be||a.length>Se)continue;let o=i.trim(),s=a.trim();if(!(!e||e.startsWith(`builtin:`)||n.has(e)||!o||o.length>xe||!s)&&(n.add(e),t.push({id:e,label:o,initialInput:s}),t.length>=ye))break}return t}function we(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Te(e){return`files:${e}`}function Ee(e){return`git:${e}`}function De(e){return`terminal:${e}`}var Oe=[35,65];function ke(e){return{id:Te(e),kind:`files`,worktreePath:e,state:{kind:`files`,selectedFilePath:null}}}function Ae(e){return{id:Ee(e),kind:`git`,worktreePath:e,state:{kind:`git`,selectedCommitSha:null}}}function je(e,t,n){return{id:e,kind:`terminal`,worktreePath:t,state:{kind:`terminal`,sessionId:n}}}function Me(e,t,n){return{id:e,kind:`browser`,worktreePath:t,state:{kind:`browser`,url:n}}}function Ne(e){let t=e.filter(e=>e.kind===`files`),n=e.filter(e=>e.kind===`terminal`),r=e.filter(e=>e.kind===`browser`),i=e.filter(e=>e.kind===`git`);return[...t,...n,...r,...i]}function Pe(e,t){let n=t.some(e=>e.kind===`files`),r=t.some(e=>e.kind===`git`);if(n&&r)return t;let i=[...t];return n||i.unshift(ke(e)),r||i.push(Ae(e)),i}var Fe=10*1024*1024,Ie=100*1024*1024,Le=ve(),B=l(y(),1),V=s();function Re(e){switch(e){case`Added`:return`text-success`;case`Modified`:return`text-[var(--theme-git-modified)]`;case`Removed`:return`text-danger`;case`Renamed`:return`text-accent`}}function ze(e,t){if(e===`/dev/null`)return null;let n=e,r=n.indexOf(` `);return r>=0&&(n=n.slice(0,r)),n.length>=2&&n.startsWith(`"`)&&n.endsWith(`"`)&&(n=n.slice(1,-1)),n.startsWith(t)&&(n=n.slice(t.length)),n}function Be(e){if(!e)return[];let t=[],n=null,r=null,i=0,a=0;for(let o of e.split(`
11
+ `)){if(o.startsWith(`diff --git `)){n={status:`Modified`,path:``,hunks:[],added:0,removed:0},t.push(n),r=null;continue}if(n){if(o.startsWith(`new file mode`))n.status=`Added`;else if(o.startsWith(`deleted file mode`))n.status=`Removed`;else if(o.startsWith(`rename from `))n.status=`Renamed`,n.oldPath=o.slice(12);else if(o.startsWith(`rename to `))n.path=o.slice(10);else if(!r&&o.startsWith(`--- `)){let e=ze(o.slice(4),`a/`);e&&!n.path&&(n.path=e)}else if(!r&&o.startsWith(`+++ `)){let e=ze(o.slice(4),`b/`);e&&(n.path=e)}else if(o.startsWith(`@@ `)){let e=o.match(/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);e&&(i=parseInt(e[1],10),a=parseInt(e[2],10),r={oldStart:i,newStart:a,lines:[]},n.hunks.push(r))}else if(r&&!o.startsWith(`\\`)&&!(o.startsWith(`+++`)||o.startsWith(`---`)))if(o.startsWith(`+`))r.lines.push({type:`add`,newNum:a,text:o.slice(1)}),a+=1,n.added+=1;else if(o.startsWith(`-`))r.lines.push({type:`del`,oldNum:i,text:o.slice(1)}),i+=1,n.removed+=1;else{let e=o.startsWith(` `)?o.slice(1):o;r.lines.push({type:`ctx`,oldNum:i,newNum:a,text:e}),i+=1,a+=1}}}return t}function Ve({file:e}){return(0,V.jsxs)(`div`,{className:`border-b border-border last:border-b-0`,children:[(0,V.jsxs)(`div`,{className:`px-3 pt-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-baseline gap-2 text-sm`,children:[(0,V.jsx)(`span`,{className:Re(e.status),children:e.status}),(0,V.jsx)(`span`,{className:`cm-mono min-w-0 break-all text-text-primary`,children:e.oldPath?`${e.oldPath} -> ${e.path}`:e.path})]}),(0,V.jsxs)(`div`,{className:`mt-1 text-xs text-text-secondary`,children:[`Added `,(0,V.jsx)(`span`,{className:`font-semibold text-success`,children:e.added}),` `,e.added===1?`line`:`lines`,`, removed`,` `,(0,V.jsx)(`span`,{className:`font-semibold text-danger`,children:e.removed}),` `,e.removed===1?`line`:`lines`]})]}),(0,V.jsx)(`div`,{className:`mt-2`,children:(0,V.jsx)(He,{hunks:e.hunks})})]})}function He({hunks:e}){return(0,V.jsx)(`div`,{className:`cm-mono text-xs leading-[1.55]`,children:e.map((e,t)=>(0,V.jsxs)(B.Fragment,{children:[t>0&&(0,V.jsx)(`div`,{className:`h-px bg-border/60`}),e.lines.map(e=>(0,V.jsx)(Ue,{line:e},`${e.type}:${e.oldNum??``}:${e.newNum??``}:${e.text}`))]},`${e.oldStart}:${e.newStart}`))})}function Ue({line:e}){let t=e.type===`add`?`bg-diff-added-bg`:e.type===`del`?`bg-diff-deleted-bg`:``,n=e.type===`add`?`text-success`:e.type===`del`?`text-danger`:`text-text-secondary/40`,r=e.type===`add`?`+`:e.type===`del`?`−`:` `,i=e.type===`add`?e.newNum:e.oldNum;return(0,V.jsxs)(`div`,{className:`flex ${t}`,children:[(0,V.jsx)(`span`,{className:`w-12 shrink-0 select-none px-2 text-right text-text-secondary/50`,children:i??``}),(0,V.jsx)(`span`,{className:`w-4 shrink-0 select-none text-center ${n}`,children:r}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-words pr-3`,children:e.text})]})}function We({open:e}){return(0,V.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`currentColor`,"aria-hidden":!0,className:`transition-transform ${e?`rotate-90`:``}`,children:(0,V.jsx)(`path`,{d:`M5.7 4.3a1 1 0 0 1 1.4 0l3 3a1 1 0 0 1 0 1.4l-3 3a1 1 0 0 1-1.4-1.4L8 8 5.7 5.7a1 1 0 0 1 0-1.4Z`})})}function Ge(e){return e===`?`?`text-text-secondary/70`:e===`D`?`text-danger`:e===`A`?`text-success`:`text-text-primary/85`}function Ke({files:e,selected:t,toggle:n,toggleAll:r,message:i,setMessage:a,layout:o,diffsByPath:s}){let[c,l]=(0,B.useState)(()=>new Set),u=e=>l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),d=e.length>0&&t.size===e.length,f=t.size>0&&!d,p=(0,B.useRef)(null),m=(0,B.useRef)(null);return(0,B.useEffect)(()=>{p.current&&(p.current.indeterminate=f)},[f]),(0,B.useEffect)(()=>{o!==`inline`&&m.current?.focus()},[o]),(0,V.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,V.jsxs)(`div`,{className:`cm-scroll overflow-auto border-b border-border ${o===`inline`?`min-h-0 flex-1`:`flex-none`}`,style:o===`inline`?void 0:{maxHeight:o===`sheet`?180:220},children:[(0,V.jsxs)(`label`,{className:`flex h-7 cursor-pointer items-center gap-2.5 border-b border-border bg-bg-tertiary px-3 text-xs font-medium tracking-[0.04em] text-text-secondary uppercase`,children:[(0,V.jsx)(`input`,{ref:p,type:`checkbox`,className:`h-3.5 w-3.5 accent-accent`,checked:d,onChange:e=>r(e.target.checked)}),(0,V.jsxs)(`span`,{className:`cm-mono`,children:[`Selected · `,t.size,` of `,e.length]})]}),e.map(e=>{let r=t.has(e.path),i=s?.get(e.path),a=c.has(e.path);return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`flex h-7 items-center gap-2.5 pl-3 pr-1 text-sm cm-mono ${r?`text-text-primary`:`text-text-secondary`}`,children:[(0,V.jsxs)(`label`,{className:`flex min-w-0 flex-1 cursor-pointer items-center gap-2.5`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:r,onChange:()=>n(e.path),className:`h-3.5 w-3.5 accent-accent`}),(0,V.jsx)(`span`,{className:`cm-scroll-x min-w-0 flex-1`,title:e.path,children:e.path}),(0,V.jsx)(`span`,{className:`text-xs ${Ge(e.status)}`,children:e.status})]}),i?(0,V.jsx)(`button`,{type:`button`,onClick:()=>u(e.path),"aria-label":a?`Collapse diff`:`Expand diff`,"aria-expanded":a,className:`flex h-tap-sm w-tap-sm shrink-0 items-center justify-center rounded-control text-text-secondary hover:bg-row-hover-bg hover:text-text-primary`,children:(0,V.jsx)(We,{open:a})}):(0,V.jsx)(`span`,{className:`h-tap-sm w-tap-sm shrink-0`,"aria-hidden":!0})]}),a&&i&&(0,V.jsx)(`div`,{className:`border-y border-border/60 bg-bg-secondary/40 py-1`,children:(0,V.jsx)(He,{hunks:i.hunks})})]},e.path)}),e.length===0&&(0,V.jsx)(`div`,{className:`px-3 py-3 text-sm text-text-secondary`,children:`No changes to commit.`})]}),(0,V.jsxs)(`div`,{className:`flex flex-col gap-2 p-3 ${o===`inline`?`flex-none`:`min-h-0 flex-1`}`,children:[(0,V.jsx)(`span`,{className:`cm-mono text-xs tracking-[0.04em] text-text-secondary uppercase`,children:`Message`}),(0,V.jsx)(`textarea`,{ref:m,value:i,onChange:e=>a(e.target.value),placeholder:`Subject line
12
+
13
+ Details…`,className:`cm-mono flex-1 resize-none rounded-control border border-border bg-bg-primary px-2.5 py-2 text-sm leading-snug text-text-primary outline-none focus:border-accent/60`,style:{minHeight:o===`sheet`?110:o===`modal`?150:96}})]})]})}function qe({open:e,busy:t=!1,error:n,branchName:r,files:i,isMobile:a,onClose:o,onCommit:s}){let[l,u]=(0,B.useState)(``),[f,p]=(0,B.useState)(new Set),h=(0,B.useRef)(()=>void 0);(0,B.useEffect)(()=>{e&&(u(``),p(new Set(i.map(e=>e.path))))},[e,i]),(0,B.useEffect)(()=>{if(!e)return;function t(e){(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),h.current())}return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e]);let g=l.trim(),_=!t&&g.length>0&&f.size>0,v=Math.max(0,(l.split(`
14
+ `,1)[0]?.length??0)-72);function y(){_&&s({message:g,paths:Array.from(f)})}h.current=y;function b(e){p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function x(e){p(e?new Set(i.map(e=>e.path)):new Set)}let C=(0,B.useMemo)(()=>r?`Commit · ${r}`:`Commit`,[r]);return e?a?(0,V.jsx)(m,{open:e,presentation:`sheet`,onClose:o,ariaLabel:C,children:(0,V.jsxs)(`div`,{className:`flex h-[calc(80vh-1.5rem)] min-h-0 flex-col`,children:[(0,V.jsxs)(`div`,{className:`flex h-8 flex-none items-center gap-2 border-b border-border px-3`,children:[(0,V.jsx)(`span`,{className:`cm-mono flex-1 truncate text-sm font-semibold`,children:C}),(0,V.jsx)(c,{onClick:o})]}),(0,V.jsx)(Ke,{files:i,selected:f,toggle:b,toggleAll:x,message:l,setMessage:u,layout:`sheet`}),n&&(0,V.jsx)(`div`,{className:`border-t border-danger/40 bg-danger/10 px-3 py-2 text-xs text-danger`,children:n}),(0,V.jsxs)(`div`,{className:`flex flex-none flex-col gap-2 border-t border-border px-3 py-2.5`,children:[v>0&&(0,V.jsxs)(`span`,{className:`cm-mono text-xs text-danger`,children:[`subject +`,v,` over`]}),(0,V.jsx)(d,{layout:`stack`,children:(0,V.jsx)(S,{variant:`primary`,onClick:y,disabled:!_,children:t?`Committing…`:`Commit`})})]})]})}):(0,V.jsxs)(m,{open:e,ariaLabel:C,onClose:o,closeOnBackdrop:!t,closeOnEscape:!t,panelClassName:`flex max-h-[80vh] flex-col`,children:[(0,V.jsxs)(`div`,{className:`flex h-8 flex-none items-center gap-2 border-b border-border px-3`,children:[(0,V.jsx)(`span`,{className:`cm-mono flex-1 truncate text-sm font-semibold`,children:C}),(0,V.jsx)(c,{onClick:o})]}),(0,V.jsx)(Ke,{files:i,selected:f,toggle:b,toggleAll:x,message:l,setMessage:u,layout:`modal`}),(0,V.jsxs)(`div`,{className:`border-t border-border px-3 py-2.5`,children:[n&&(0,V.jsx)(`div`,{role:`alert`,className:`mb-2 rounded-control border border-danger/40 bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,children:n}),(0,V.jsxs)(d,{children:[v>0&&(0,V.jsxs)(`span`,{className:`cm-mono mr-auto text-xs text-danger`,children:[`subject +`,v,` over`]}),(0,V.jsx)(S,{onClick:o,disabled:t,children:`Cancel`}),(0,V.jsx)(S,{variant:`primary`,onClick:y,disabled:!_,children:t?`Committing…`:f.size>0?`Commit ${f.size}`:`Commit`})]})]})]}):null}function Je({sessionId:e,hydrated:t,connected:r,onClose:i}){return(0,V.jsx)(`div`,{className:`flex h-full w-full items-center justify-center bg-bg-primary p-6`,children:(0,V.jsx)(n,{tone:t?`warn`:`info`,tag:t?`SESSION MISSING`:`SESSION`,title:t?`Session not found`:`Opening session`,body:(0,V.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,V.jsx)(`span`,{className:`cm-mono text-xs text-text-primary`,children:e}),(0,V.jsx)(`span`,{children:t?`This session is no longer present in the server state. It may have ended when the server or PTY host restarted.`:r?`Waiting for the server snapshot. If this session was owned by a previous server or PTY host, it may no longer exist.`:`Waiting for the server connection. If this session was owned by a previous server or PTY host, it may no longer exist.`})]}),secondary:{label:`Close`,onClick:i}})})}function Ye(){return typeof crypto<`u`&&`randomUUID`in crypto?`cmd:${crypto.randomUUID()}`:`cmd:${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function Xe({open:e,project:t,worktree:n,commands:r,isMobile:i=!1,loadLocalFiles:a,onClose:o,onCommandsChange:s,onRunCommand:c,onCreateWorktreeSession:l}){let[u,f]=(0,B.useState)(0),[p,h]=(0,B.useState)(`launcher`),g=(0,B.useRef)(!1),_=(0,B.useMemo)(()=>r.filter(e=>!e.builtin).map(({id:e,label:t,initialInput:n})=>({id:e,label:t,initialInput:n})),[r]),v=(0,B.useCallback)(e=>{if(g.current)return;let t=r[e];t&&(g.current=!0,c(n.path,t),o())},[r,o,c,n.path]);if((0,B.useEffect)(()=>{if(!e){g.current=!1;return}h(`launcher`),f(0)},[e]),(0,B.useEffect)(()=>{if(!e||p!==`launcher`)return;function t(e){if(e.key===`ArrowDown`){e.preventDefault(),f(e=>Math.min(e+1,r.length-1));return}if(e.key===`ArrowUp`){e.preventDefault(),f(e=>Math.max(e-1,0));return}e.key===`Enter`&&(e.preventDefault(),v(u))}return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[r.length,p,e,v,u]),!e)return null;let y=p===`launcher`?(0,V.jsx)(Qe,{commands:r,projectName:t.name,selectedIndex:u,worktreeName:n.name,onEdit:()=>h(`editor`),onNewWorktree:l?()=>h(`worktree`):void 0,onRun:e=>v(e),onSelect:f}):p===`worktree`?(0,V.jsx)($e,{commands:r,loadLocalFiles:a,projectId:t.id,projectName:t.name,projectPath:t.path,selectedIndex:u,onBack:()=>h(`launcher`),onCreated:o,onCreate:l,onSelectCommand:f}):(0,V.jsx)(tt,{commands:_,onBack:()=>h(`launcher`),onChange:s});return(0,V.jsxs)(m,{open:e,ariaLabel:`New session in ${n.name}`,onClose:o,closeOnEscape:p===`launcher`,presentation:i?`sheet`:`modal`,widthClassName:`max-w-surface-md`,panelClassName:`flex flex-col ${i?`h-[calc(80vh-1.5rem)] min-h-0`:`max-h-[82vh]`}`,children:[(0,V.jsx)(Ze,{mode:p,title:n.name,onBack:()=>h(`launcher`),onClose:o}),(0,V.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 pt-3 pb-4`,children:y}),i?(0,V.jsx)(`div`,{className:`flex shrink-0 items-center border-t border-border px-3 py-2.5`,children:(0,V.jsx)(d,{layout:`stack`,children:(0,V.jsx)(S,{onClick:o,children:`Cancel`})})}):p===`launcher`&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border px-4 py-2.5`,children:[(0,V.jsxs)(`div`,{className:`cm-mono flex min-w-0 flex-1 flex-wrap items-center gap-2 text-xs text-text-secondary`,children:[(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,V.jsx)(C,{children:`↑↓`}),(0,V.jsx)(`span`,{children:`navigate`})]}),(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,V.jsx)(C,{children:`↵`}),(0,V.jsx)(`span`,{children:`run`})]}),(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,V.jsx)(C,{children:`Esc`}),(0,V.jsx)(`span`,{children:`cancel`})]})]}),(0,V.jsx)(S,{onClick:o,children:`Cancel`})]})]})}function Ze({mode:e,title:t,onBack:n,onClose:r}){return(0,V.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center gap-2 border-b border-border px-3`,children:[e!==`launcher`&&(0,V.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Back`,className:`inline-flex h-7 w-7 items-center justify-center rounded-control text-text-secondary hover:bg-row-hover-bg hover:text-text-primary focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent`,children:(0,V.jsx)(h.back,{})}),(0,V.jsx)(`span`,{className:`inline-flex text-accent`,"aria-hidden":!0,children:e===`editor`?(0,V.jsx)(h.settings,{}):(0,V.jsx)(h.terminal,{})}),(0,V.jsx)(`span`,{className:`text-sm text-text-secondary`,children:e===`editor`?`Commands`:e===`worktree`?`New session`:`New session in`}),(0,V.jsx)(`span`,{className:`cm-mono flex-1 truncate text-sm font-semibold text-text-primary`,children:t}),(0,V.jsx)(c,{onClick:r})]})}function Qe({commands:e,projectName:t,selectedIndex:n,worktreeName:r,onEdit:i,onNewWorktree:a,onRun:o,onSelect:s}){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`cm-mono mb-2.5 flex items-center gap-1.5 text-xs text-text-secondary`,children:[(0,V.jsx)(`span`,{children:t}),(0,V.jsx)(`span`,{className:`opacity-50`,children:`/`}),(0,V.jsx)(`span`,{children:r})]}),(0,V.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.map((e,t)=>(0,V.jsx)(et,{command:e,selected:n===t,onClick:()=>{s(t),o(t)},onFocus:()=>s(t)},e.id))}),(0,V.jsxs)(`button`,{type:`button`,onClick:i,className:`mt-3 flex h-9 w-full items-center justify-center gap-2 rounded-control border border-border text-sm text-text-secondary hover:bg-row-hover-bg hover:text-text-primary`,children:[(0,V.jsx)(h.settings,{}),(0,V.jsx)(`span`,{children:`Edit commands`})]}),a&&(0,V.jsxs)(`button`,{type:`button`,onClick:a,className:`mt-2 flex h-9 w-full items-center justify-center gap-2 rounded-control border border-border text-sm text-text-secondary hover:bg-row-hover-bg hover:text-text-primary`,children:[(0,V.jsx)(h.worktreeInactive,{}),(0,V.jsx)(`span`,{children:`New worktree session`})]})]})}function $e({commands:e,loadLocalFiles:t,projectId:n,projectName:r,projectPath:i,selectedIndex:o,onBack:s,onCreated:c,onCreate:l,onSelectCommand:u}){let[d,f]=(0,B.useState)(``),[p,m]=(0,B.useState)(``),[h,g]=(0,B.useState)(!1),[_,v]=(0,B.useState)(null),[y,b]=(0,B.useState)([]),[x,S]=(0,B.useState)(!1),[C,w]=(0,B.useState)(null),[T,E]=(0,B.useState)(()=>new Set),[D,O]=(0,B.useState)(!1),k=e[o]??e[0];(0,B.useEffect)(()=>{if(!t)return;let e=!1;return S(!0),w(null),t(n).then(t=>{if(e)return;b(t.candidates);let n=new Set(t.candidates.map(e=>e.path)),r=t.rememberedPaths.filter(e=>n.has(e));E(new Set(r)),O(r.length>0)}).catch(t=>{e||w(t instanceof Error?t.message:`Failed to load local files`)}).finally(()=>{e||S(!1)}),()=>{e=!0}},[t,n]);let ee=(0,B.useMemo)(()=>{let e=i.replace(/\/+$/,``);return d?`${e}.worktrees/${d}`:`${e}.worktrees/...`},[d,i]),A=d.trim().length>0&&!h&&!!k;async function j(){if(!(!A||!k||!l)){g(!0),v(null);try{await l({branch:d.trim(),base:p.trim(),copyLocalFiles:[...T],rememberLocalFiles:D,command:k}),c()}catch(e){v(e instanceof Error?e.message:`Failed to create session`)}finally{g(!1)}}}function te(e,t){E(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})}return(0,V.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),j()},children:[(0,V.jsxs)(`div`,{className:`cm-mono flex items-center gap-1.5 text-xs text-text-secondary`,children:[(0,V.jsx)(`span`,{children:r}),(0,V.jsx)(`span`,{className:`opacity-50`,children:`/`}),(0,V.jsx)(`span`,{children:`new worktree`})]}),(0,V.jsxs)(`label`,{className:`block`,children:[(0,V.jsx)(`span`,{className:`mb-1 block text-xs font-medium text-text-secondary`,children:`Branch name`}),(0,V.jsx)(`input`,{type:`text`,value:d,onChange:e=>f(e.currentTarget.value),placeholder:`feature/foo`,className:`cm-mono w-full rounded-control border border-border bg-bg-primary px-2.5 py-1.5 text-sm text-text-primary placeholder:text-text-secondary/50 focus:border-accent/60 focus:outline-none`})]}),(0,V.jsxs)(`label`,{className:`block`,children:[(0,V.jsxs)(`span`,{className:`mb-1 block text-xs font-medium text-text-secondary`,children:[`Base`,` `,(0,V.jsx)(`span`,{className:`font-normal text-text-secondary/60`,children:`(optional)`})]}),(0,V.jsx)(`input`,{type:`text`,value:p,onChange:e=>m(e.currentTarget.value),placeholder:`HEAD`,className:`cm-mono w-full rounded-control border border-border bg-bg-primary px-2.5 py-1.5 text-sm text-text-primary placeholder:text-text-secondary/50 focus:border-accent/60 focus:outline-none`})]}),(0,V.jsxs)(`label`,{className:`block`,children:[(0,V.jsx)(`span`,{className:`mb-1 block text-xs font-medium text-text-secondary`,children:`Command`}),(0,V.jsx)(`select`,{value:k?.id??``,onChange:t=>{let n=e.findIndex(e=>e.id===t.currentTarget.value);n>=0&&u(n)},className:`w-full rounded-control border border-border bg-bg-primary px-2.5 py-1.5 text-sm text-text-primary focus:border-accent/60 focus:outline-none`,children:e.map(e=>(0,V.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`mb-1 block text-xs font-medium text-text-secondary`,children:`Path`}),(0,V.jsx)(`div`,{className:`cm-mono truncate rounded-control border border-border/60 bg-bg-primary/60 px-2.5 py-1.5 text-xs text-text-secondary`,title:ee,children:ee})]}),(0,V.jsxs)(`div`,{className:`rounded-control border border-border/70 bg-bg-primary/40 p-2.5`,children:[(0,V.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,V.jsx)(`span`,{className:`text-xs font-medium text-text-secondary`,children:`Local files`}),y.length>0&&(0,V.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-text-secondary`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:D,onChange:e=>O(e.currentTarget.checked),className:`h-3.5 w-3.5 accent-accent`}),`Remember`]})]}),x?(0,V.jsx)(`div`,{className:`text-xs text-text-secondary`,children:`Loading local files...`}):C?(0,V.jsx)(`div`,{className:`text-xs text-danger`,children:C}):y.length===0?(0,V.jsx)(`div`,{className:`text-xs text-text-secondary`,children:`No ignored local files found.`}):(0,V.jsx)(`div`,{className:`max-h-28 space-y-1 overflow-y-auto pr-1`,children:y.map(e=>(0,V.jsxs)(`label`,{className:`flex min-h-7 items-center gap-2 rounded-control px-1 text-xs text-text-primary hover:bg-bg-secondary`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:T.has(e.path),onChange:t=>te(e.path,t.currentTarget.checked),className:`h-3.5 w-3.5 shrink-0 accent-accent`}),(0,V.jsx)(`span`,{className:`cm-mono min-w-0 flex-1 truncate`,children:e.path}),(0,V.jsx)(`span`,{className:`shrink-0 text-text-secondary/70`,children:rt(e.size)})]},e.path))})]}),_&&(0,V.jsx)(`div`,{className:`rounded-control border border-danger/40 bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,children:_}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,V.jsx)(a,{kind:`normal`,size:`sm`,type:`button`,onClick:s,children:`Back`}),(0,V.jsx)(`div`,{className:`flex-1`}),(0,V.jsx)(a,{kind:`submit`,size:`sm`,type:`submit`,disabled:!A,children:h?`Creating...`:`Create session`})]})]})}function et({command:e,selected:t,onClick:n,onFocus:r}){let i=e.initialInput||`empty shell`;return(0,V.jsxs)(`button`,{type:`button`,onClick:n,onFocus:r,"aria-pressed":t,className:`
15
+ flex min-h-14 items-center gap-3 rounded-control border px-3 py-2 text-left
16
+ ${t?`border-accent/65 bg-accent/10 shadow-[0_0_0_2px_rgb(var(--color-accent)/0.22)]`:`border-border bg-bg-primary hover:bg-row-hover-bg`}
17
+ `,children:[(0,V.jsx)(`span`,{className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-control bg-text-secondary/10 text-text-primary`,children:(0,V.jsx)(h.terminal,{})}),(0,V.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`span`,{className:`block truncate text-sm font-semibold text-text-primary`,children:e.label}),(0,V.jsx)(`span`,{className:`cm-mono block truncate text-xs text-text-secondary`,children:i})]}),!e.builtin&&(0,V.jsx)(`span`,{className:`cm-mono shrink-0 rounded-tag bg-accent/10 px-1.5 py-[1px] text-xs text-accent`,children:`run`})]})}function tt({commands:e,onBack:t,onChange:n}){let[r,i]=(0,B.useState)(null);return r?(0,V.jsx)(nt,{command:r,onCancel:()=>i(null),onSave:t=>{n(e.some(e=>e.id===t.id)?e.map(e=>e.id===t.id?t:e):[...e,t]),i(null)}}):(0,V.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(a,{kind:`normal`,size:`sm`,onClick:t,children:`Done`}),(0,V.jsx)(`div`,{className:`flex-1`}),(0,V.jsx)(a,{kind:`submit`,size:`sm`,onClick:()=>i({id:Ye(),label:``,initialInput:``}),children:(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,V.jsx)(h.add,{}),(0,V.jsx)(`span`,{children:`Add`})]})})]}),(0,V.jsx)(`div`,{className:`rounded-control border border-border bg-bg-primary px-3 py-2`,children:(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`span`,{className:`inline-flex h-8 w-8 items-center justify-center rounded-control bg-text-secondary/10`,children:(0,V.jsx)(h.terminal,{})}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`div`,{className:`text-sm font-semibold text-text-primary`,children:`Terminal`}),(0,V.jsx)(`div`,{className:`cm-mono truncate text-xs text-text-secondary`,children:`built-in · empty shell`})]})]})}),e.length===0?(0,V.jsx)(`div`,{className:`rounded-control border border-dashed border-border px-3 py-6 text-center text-sm text-text-secondary`,children:`No custom commands`}):e.map(t=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2 rounded-control border border-border bg-bg-primary px-3 py-2`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`div`,{className:`truncate text-sm font-semibold text-text-primary`,children:t.label}),(0,V.jsx)(`div`,{className:`cm-mono truncate text-xs text-text-secondary`,children:t.initialInput})]}),(0,V.jsx)(a,{kind:`normal`,size:`sm`,onClick:()=>i(t),children:`Edit`}),(0,V.jsx)(a,{kind:`destroy`,size:`sm`,onClick:()=>n(e.filter(e=>e.id!==t.id)),children:`Delete`})]},t.id))]})}function nt({command:e,onCancel:t,onSave:n}){let[r,i]=(0,B.useState)(e.label),[o,s]=(0,B.useState)(e.initialInput),c=r.trim(),l=o.trim(),u=c.length>0&&l.length>0;return(0,V.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:t=>{t.preventDefault(),u&&n({id:e.id,label:c,initialInput:l})},children:[(0,V.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm text-text-secondary`,children:[(0,V.jsx)(`span`,{children:`Name`}),(0,V.jsx)(`input`,{className:`h-9 rounded-control border border-border bg-bg-primary px-2 text-sm text-text-primary outline-none focus:border-accent`,value:r,onChange:e=>i(e.currentTarget.value)})]}),(0,V.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm text-text-secondary`,children:[(0,V.jsx)(`span`,{children:`Command`}),(0,V.jsx)(`input`,{className:`cm-mono h-9 rounded-control border border-border bg-bg-primary px-2 text-sm text-text-primary outline-none focus:border-accent`,value:o,onChange:e=>s(e.currentTarget.value)})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(a,{kind:`normal`,size:`sm`,type:`button`,onClick:t,children:`Cancel`}),(0,V.jsx)(`div`,{className:`flex-1`}),(0,V.jsx)(a,{kind:`submit`,size:`sm`,type:`submit`,disabled:!u,children:`Save`})]})]})}function rt(e){return e<1024?`${e} B`:`${Math.ceil(e/1024)} KB`}function it(e){return e.replace(/\/$/,``).split(`/`).pop()??e}var at=`parasor:projectLastFolder`;function ot(){try{return localStorage.getItem(at)??``}catch{return``}}function st(e){try{localStorage.setItem(at,e)}catch{}}function ct({open:e,onClose:t,onCreate:n,isMobile:r=!1}){let i=(0,B.useMemo)(()=>{let e=[{value:`quick`,label:`Quick Pick`},{value:`browse`,label:`Browse`},{value:`path`,label:`Path`}];return r?e.filter(e=>e.value!==`browse`):e},[r]),[o,s]=(0,B.useState)(`quick`),[c,l]=(0,B.useState)(``),[u,p]=(0,B.useState)(``),[h,g]=(0,B.useState)(``),[_,v]=(0,B.useState)(null),[y,b]=(0,B.useState)([]),[x,C]=(0,B.useState)(!1),[w,T]=(0,B.useState)(!1),[E,k]=(0,B.useState)(``),[ee,A]=(0,B.useState)(!1),[j,te]=(0,B.useState)(null),ne=(0,B.useRef)(null),[M,N]=(0,B.useState)(``),[re,ie]=(0,B.useState)(!1),[ae,P]=(0,B.useState)(``),[F,I]=(0,B.useState)(null),L=(0,B.useRef)(null),R=(0,B.useCallback)(async()=>{ie(!0);try{let e=await O(`/api/fs/pick-folder`,{method:`POST`});if(!e.ok)return;let t=await e.json();t.path&&N(t.path)}catch{}finally{ie(!1)}},[]),oe=(0,B.useCallback)(async e=>{C(!0);try{let t=await O(e?`/api/fs/browse?path=${encodeURIComponent(e)}`:`/api/fs/browse`);if(!t.ok)return;let n=await t.json();b(n.entries??[]),p(n.path),g(n.path),v(n.parent),st(n.path)}catch{}finally{C(!1)}},[]);(0,B.useEffect)(()=>{e&&o===`quick`&&u===``&&oe(ot()||void 0)},[e,o,u,oe]),(0,B.useEffect)(()=>{e&&(s(`quick`),l(``),P(``),I(null),N(``),p(``),g(``),v(null),T(!1),k(``),A(!1),te(null))},[e]);let se=e=>{g(e),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{oe(e.trim()||void 0)},300)},ce=(0,B.useCallback)(e=>{if(!e.trim()){I(null);return}L.current&&clearTimeout(L.current),L.current=setTimeout(async()=>{try{I((await O(`/api/fs/browse?path=${encodeURIComponent(e.trim())}`)).ok)}catch{I(!1)}},300)},[]),le=e=>{P(e),ce(e)},ue=e=>c.trim()||it(e),de=e=>{e&&(n(e,ue(e)||void 0),t())},fe=async()=>{let e=E.trim();if(!(!e||!u||ee)){A(!0),te(null);try{let t=await O(`/api/fs/mkdir`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({parent:u,name:e})});if(!t.ok){te((await t.json().catch(()=>({}))).error??`Failed to create folder`);return}de((await t.json()).path)}catch{te(`Failed to create folder`)}finally{A(!1)}}},pe=()=>{T(!1),k(``),te(null)};(0,B.useEffect)(()=>{w&&requestAnimationFrame(()=>ne.current?.focus())},[w]);let me=E.trim(),he=!ee&&me.length>0&&!me.includes(`/`)&&me!==`.`&&me!==`..`,z=o===`quick`?(0,V.jsx)(S,{variant:`primary`,disabled:!u||w,onClick:()=>de(u),children:u?`Add "${it(u)}"`:`Add this folder`}):o===`browse`?(0,V.jsx)(S,{variant:`primary`,disabled:!M,onClick:()=>de(M),children:M?`Add "${it(M)}"`:`Add this folder`}):(0,V.jsx)(S,{variant:`primary`,disabled:!F,onClick:()=>de(ae.trim()),children:ae.trim()?`Add "${it(ae.trim())}"`:`Add this folder`});return(0,V.jsxs)(m,{open:e,ariaLabel:`New Project`,onClose:t,presentation:r?`sheet`:`modal`,widthClassName:`max-w-md`,panelClassName:`flex max-h-[80vh] flex-col`,children:[(0,V.jsx)(f,{title:`New Project`,onClose:t}),(0,V.jsx)(D,{value:o,options:i,onChange:s}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3 overflow-y-auto p-4`,children:[o===`quick`&&(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{htmlFor:`project-quick-folder`,className:`mb-1 block text-xs text-text-secondary`,children:`Folder`}),(0,V.jsx)(`input`,{id:`project-quick-folder`,type:`text`,value:h,onChange:e=>se(e.target.value),placeholder:`~/projects`,className:`w-full rounded-control border border-border bg-bg-primary px-3 py-1.5 text-xs text-text-primary outline-none font-mono focus:ring-1 focus:ring-accent`})]}),x?(0,V.jsx)(`p`,{className:`text-xs text-text-secondary`,children:`Loading…`}):(0,V.jsxs)(`div`,{className:`rounded-control border border-border overflow-hidden max-h-64 overflow-y-auto`,children:[_&&(0,V.jsxs)(`button`,{type:`button`,className:`w-full px-3 py-2 text-left text-xs text-text-secondary hover:bg-bg-primary/50`,onClick:()=>oe(_),children:[(0,V.jsx)(`span`,{className:`mr-2`,children:`↑`}),`..`]}),y.map(e=>(0,V.jsxs)(`button`,{type:`button`,className:`w-full px-3 py-2 text-left text-xs flex items-center gap-2 text-text-primary hover:bg-bg-primary/50`,onClick:()=>oe(e.path),children:[(0,V.jsx)(`span`,{className:`text-text-secondary`,children:`📁`}),(0,V.jsx)(`span`,{className:`flex-1 truncate`,children:e.name}),(0,V.jsx)(`span`,{className:`text-text-secondary`,children:`›`})]},e.path)),y.length===0&&!_&&(0,V.jsx)(`p`,{className:`px-3 py-2 text-xs text-text-secondary`,children:`No subdirectories found`}),y.length===0&&_&&(0,V.jsx)(`p`,{className:`px-3 py-2 text-xs text-text-secondary`,children:`Empty -- use the button below to add this folder`})]}),w?(0,V.jsxs)(`div`,{className:`rounded-control border border-border bg-bg-primary p-3 space-y-2`,children:[(0,V.jsx)(`label`,{htmlFor:`project-new-folder-name`,className:`block text-xs text-text-secondary`,children:`New folder name`}),(0,V.jsx)(`input`,{ref:ne,id:`project-new-folder-name`,type:`text`,value:E,onChange:e=>k(e.target.value),onKeyDown:e=>{e.key===`Enter`&&he&&(e.preventDefault(),fe())},placeholder:`my-new-app`,disabled:ee,className:`w-full rounded-control border border-border bg-bg-secondary px-3 py-1.5 text-xs text-text-primary outline-none font-mono focus:ring-1 focus:ring-accent`}),(0,V.jsx)(`p`,{className:`truncate text-xs text-text-secondary font-mono`,children:u?`${u.replace(/\/$/,``)}/${me||`…`}`:`Pick a parent folder first`}),j&&(0,V.jsx)(`p`,{className:`text-xs text-danger`,children:j}),(0,V.jsxs)(`div`,{className:`flex justify-end gap-2 pt-1`,children:[(0,V.jsx)(a,{kind:`normal`,onClick:pe,children:`Cancel`}),(0,V.jsx)(a,{kind:`submit`,disabled:!he||!u,onClick:()=>void fe(),children:ee?`Creating…`:`Create`})]})]}):(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{T(!0),te(null)},disabled:!u||x,className:`w-full rounded-control border border-dashed border-border bg-bg-primary px-3 py-2 text-xs text-text-secondary hover:text-text-primary hover:bg-bg-primary/70 disabled:opacity-40 flex items-center justify-center gap-2`,children:[(0,V.jsx)(`span`,{children:`+`}),(0,V.jsx)(`span`,{children:`Create new folder here`})]})]}),o===`browse`&&(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`p`,{className:`text-xs text-text-secondary`,children:`OS のフォルダ選択ダイアログでプロジェクトディレクトリを選択します。`}),(0,V.jsx)(`button`,{type:`button`,onClick:R,disabled:re,className:`w-full rounded-control border border-border bg-bg-primary px-4 py-3 text-sm text-text-primary hover:bg-bg-primary/50 disabled:opacity-40`,children:re?`Waiting for dialog...`:`Open Folder Picker`}),M&&(0,V.jsx)(`div`,{className:`rounded-control bg-bg-primary px-3 py-2 text-xs font-mono text-text-primary break-all`,children:M})]}),o===`path`&&(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`input`,{type:`text`,placeholder:`/absolute/path/to/project`,value:ae,onChange:e=>le(e.target.value),className:`w-full rounded-control border px-3 py-1.5 text-sm bg-bg-primary text-text-primary outline-none font-mono ${F===!0?`border-success`:F===!1?`border-danger`:`border-border`}`}),F===!0&&(0,V.jsx)(`p`,{className:`text-xs text-success`,children:`Valid directory`}),F===!1&&(0,V.jsx)(`p`,{className:`text-xs text-danger`,children:`Directory not found`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{htmlFor:`project-name`,className:`mb-1 block text-xs text-text-secondary`,children:`Project name (optional)`}),(0,V.jsx)(`input`,{id:`project-name`,type:`text`,placeholder:o===`quick`&&u?it(u):o===`browse`&&M?it(M):o===`path`&&ae?it(ae):`auto-detected`,value:c,onChange:e=>l(e.target.value),className:`w-full rounded-control border border-border bg-bg-primary px-3 py-1.5 text-sm text-text-primary outline-none`})]})]}),(0,V.jsx)(`div`,{className:`min-w-0 border-t border-border px-4 py-3`,children:(0,V.jsx)(d,{layout:r?`stack`:`end`,children:r?(0,V.jsxs)(V.Fragment,{children:[z,(0,V.jsx)(S,{onClick:t,children:`Cancel`})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(S,{onClick:t,children:`Cancel`}),z]})})})]})}function lt({open:e,branch:t,worktreePath:n,dirtyCount:r,orphan:i=!1,busy:a=!1,error:o,onClose:s,onSubmit:c}){let[l,u]=(0,B.useState)(!1);(0,B.useEffect)(()=>{e&&u(!1)},[e]);let p=!i&&r>0,h=!a&&(!p||l),g=i?{text:`The on-disk directory is gone. Run`,command:`git worktree prune`,rest:`to drop the stale registration. The branch is preserved.`}:{text:`Run`,command:`git worktree remove`,rest:`on this checkout. The branch is preserved; only the working directory is unlinked.`},_=a?i?`Pruning…`:`Removing…`:i?`Prune`:p?`Force remove`:`Remove`;function v(){h&&c({force:i||p})}return(0,V.jsxs)(m,{open:e,ariaLabel:`Remove worktree ${t}`,onClose:s,children:[(0,V.jsx)(f,{title:`Remove worktree`,subject:t,onClose:s}),(0,V.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),v()},className:`space-y-3 px-4 pt-3 pb-4`,children:[(0,V.jsxs)(`p`,{className:`text-sm text-text-primary`,children:[g.text,` `,(0,V.jsx)(`span`,{className:`cm-mono`,children:g.command}),` `,g.rest]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`mb-1 block text-xs font-medium text-text-secondary`,children:`Path`}),(0,V.jsx)(`div`,{className:`cm-mono truncate rounded-control border border-border/60 bg-bg-primary/60 px-2.5 py-1.5 text-xs text-text-secondary`,title:n,children:n})]}),p&&(0,V.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 rounded-control border border-warning/40 bg-warning/10 px-2.5 py-2 text-xs text-text-primary`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:l,onChange:e=>u(e.target.checked),className:`mt-0.5`}),(0,V.jsxs)(`span`,{children:[(0,V.jsxs)(`strong`,{className:`font-semibold text-warning`,children:[r,` uncommitted file`,r===1?``:`s`]}),` `,`will be lost. I understand and want to force remove.`]})]}),o&&(0,V.jsx)(`div`,{className:`rounded-control border border-danger/40 bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,children:o}),(0,V.jsxs)(d,{children:[(0,V.jsx)(S,{onClick:s,children:`Cancel`}),(0,V.jsx)(S,{type:`submit`,variant:`danger`,disabled:!h,children:_})]})]})]})}function ut({open:e,currentBranch:t,busy:n=!1,error:r,onClose:i,onSubmit:a}){let[o,s]=(0,B.useState)(``),c=(0,B.useRef)(null);(0,B.useEffect)(()=>{if(!e)return;s(t);let n=requestAnimationFrame(()=>c.current?.focus());return()=>cancelAnimationFrame(n)},[e,t]);let l=o.trim(),u=l.length>0&&l!==t&&!n;function p(){u&&a(l)}return(0,V.jsxs)(m,{open:e,ariaLabel:`Rename branch ${t}`,onClose:i,children:[(0,V.jsx)(f,{title:`Rename branch`,subject:t,onClose:i}),(0,V.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),p()},className:`space-y-3 px-4 pt-3 pb-4`,children:[(0,V.jsxs)(`label`,{className:`block`,children:[(0,V.jsx)(`span`,{className:`mb-1 block text-xs font-medium text-text-secondary`,children:`New branch name`}),(0,V.jsx)(`input`,{ref:c,type:`text`,value:o,onChange:e=>s(e.target.value),placeholder:`feature/foo`,className:`cm-mono w-full rounded-control border border-border bg-bg-primary px-2.5 py-1.5 text-sm text-text-primary placeholder:text-text-secondary/50 focus:border-accent/60 focus:outline-none`}),(0,V.jsxs)(`span`,{className:`mt-1 block text-xs text-text-secondary/80`,children:[`Runs `,(0,V.jsx)(`span`,{className:`cm-mono`,children:`git branch -m`}),`; the worktree directory keeps its original path.`]})]}),r&&(0,V.jsx)(`div`,{className:`rounded-control border border-danger/40 bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,children:r}),(0,V.jsxs)(d,{children:[(0,V.jsx)(S,{onClick:i,children:`Cancel`}),(0,V.jsx)(S,{type:`submit`,variant:`primary`,disabled:!u,children:n?`Renaming…`:`Rename`})]})]})]})}var dt=64*1024;function ft(e){return`parasor:client-browsers:${e}`}function pt(e){let t=e.trim().toLowerCase();return t===`about:blank`?!0:t.startsWith(`http://`)||t.startsWith(`https://`)}function mt(e){if(!e||e.length>dt)return{};let t;try{t=JSON.parse(e)}catch{return{}}if(!ht(t))return{};let n={};for(let[e,r]of Object.entries(t)){if(typeof e!=`string`||!Array.isArray(r))continue;let t=[];for(let e of r){if(!ht(e))continue;let n=e.id,r=e.url;typeof n!=`string`||typeof r!=`string`||pt(r)&&t.push({id:n,url:r})}n[e]=t}return n}function ht(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function gt(e){if(typeof window>`u`)return{};let t={};for(let n of e){let e=null;try{e=window.localStorage.getItem(ft(n.id))}catch{e=null}let r=mt(e),i={};for(let[e,t]of Object.entries(r))i[e]=t.map(e=>({id:e.id,kind:`browser`,url:e.url}));t[n.id]=i}return t}var _t=64*1024;function vt(e){if(!e||e.length>_t)return{};let t;try{t=JSON.parse(e)}catch{return{}}if(!yt(t))return{};let n={};for(let[e,r]of Object.entries(t))typeof e==`string`&&Array.isArray(r)&&r.every(e=>typeof e==`string`)&&(n[e]=r);return n}function yt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function bt(e){return typeof window>`u`?e:e.map(e=>{let t=vt(window.localStorage.getItem(`paneOrder:${e.id}`));if(Object.keys(t).length===0)return e;let n=e.worktrees.map(e=>{let n=t[e.path];if(!n||n.length===0)return e;let r=new Map(e.children.map(e=>[e.id,e])),i=[...n.map(e=>r.get(e)).filter(e=>!!e),...e.children.filter(e=>!n.includes(e.id))];return{...e,children:i}});return{...e,worktrees:n}})}var xt=`terminal:`;function St({focusedPaneId:e,agentStates:t}){let[n,r]=(0,B.useState)({});return(0,B.useEffect)(()=>{if(!e?.startsWith(xt))return;let n=e.slice(9),i=t[n];!i||i.lifecycle!==`waiting`||r(e=>e[n]===i.detectedAt?e:{...e,[n]:i.detectedAt})},[e,t]),(0,B.useEffect)(()=>{r(e=>{let n={},r=!1;for(let[i,a]of Object.entries(e))i in t?n[i]=a:r=!0;return r?n:e})},[t]),n}function Ct(e,t){if(!e||e.lifecycle!==`waiting`)return!1;let n=t[e.sessionId];return n!==void 0&&n>=e.detectedAt}function wt(e,t=`terminal`){return e?e.title?.trim()||(e.command?.type===`claude`?`claude`:e.command?.type===`custom`?e.command.command:e.shell.split(`/`).pop()??`shell`):t}function Tt(e){return[...e].sort((e,t)=>{let n=e.order??1/0,r=t.order??1/0;return n===r?t.lastAccessedAt-e.lastAccessedAt:n-r})}function Et(e){let t=e.replace(/\/+$/,``);return t.startsWith(`/private/`)&&(t=t.slice(8)),t}function Dt(e,t){let n=e?.[t]??[],r=new Map;for(let e of n)r.set(Et(e.path),e);let i=[...r.keys()].sort((e,t)=>t.length-e.length);return{lookup(e){let t=Et(e),n=r.get(t);if(n)return n;for(let e of i)if(t===e||t.startsWith(`${e}/`))return r.get(e)}}}function Ot({projects:e,activeProjectId:t,activeWorktrees:n,sessions:r,agentStates:i,reviewPendingSessions:a,worktreesByProject:o,gitStates:s,attentionDismissed:c,inactiveChildPanesByProject:l}){let u=c??{};return Tt(e).map(e=>{let c=e.id===t,d=Dt(o,e.id),f=s?.[e.id]?.[e.path]?.isRepo===!1,p=c?kt({project:e,worktrees:n,sessions:r,agentStates:i,reviewPendingSessions:a,counters:d,isNotRepo:f,attentionDismissed:u}):jt({project:e,sessions:r,agentStates:i,reviewPendingSessions:a,counters:d,projectWorktrees:o?.[e.id]??[],childPanes:l?.[e.id]??{},isNotRepo:f,attentionDismissed:u});return{id:e.id,name:e.name,path:e.path,pinned:!!e.pinned,readOnly:!!e.readOnly,...f?{isRepo:!1}:{},worktrees:p}})}function kt({project:e,worktrees:t,sessions:n,agentStates:r,reviewPendingSessions:i,counters:a,isNotRepo:o,attentionDismissed:s}){return t.length===0?At(e,a,o):t.map(t=>{let c=Nt({panes:t.panes,sessions:n,agentStates:r,reviewPendingSessions:i,attentionDismissed:s}),l=a.lookup(t.path),u=t.path===e.path;return{id:`wt:${t.path}`,name:u?o?`root`:`main`:Rt(t.path),path:t.path,active:u,dirty:l?.dirtyCount??0,ahead:l?.ahead??0,behind:l?.behind??0,children:c,hasWorkingChild:c.some(e=>e.status===`working`),hasAlertChild:c.some(e=>e.status===`attention`),...l?.origin?{origin:l.origin}:{},...l?.orphan?{orphan:!0}:{}}})}function At(e,t,n){let r=t.lookup(e.path);return[{id:`wt:${e.path}`,name:n?`root`:`main`,path:e.path,active:!0,dirty:r?.dirtyCount??0,ahead:r?.ahead??0,behind:r?.behind??0,children:[],hasWorkingChild:!1,hasAlertChild:!1}]}function jt({project:e,sessions:t,agentStates:n,reviewPendingSessions:r,counters:i,projectWorktrees:a,childPanes:o,isNotRepo:s,attentionDismissed:c}){let l=t.filter(t=>t.projectId===e.id),u=new Map;u.set(e.path,[]);for(let e of a)u.has(e.path)||u.set(e.path,[]);for(let t of l){let n=Mt(t.cwd,e.path,a)??t.cwd,r=u.get(n)??[];r.push(t),u.set(n,r)}return[...u.keys()].sort((t,n)=>t===e.path?-1:n===e.path?1:t.localeCompare(n)).map(t=>{let a=u.get(t)??[],l=new Map,d=[];for(let e of a){let t=n[e.id],i=Ct(t,c)?void 0:t?.lifecycle,a=r.has(e.id),o=Ft(e),s=l.get(o)??0;l.set(o,s+1),d.push({id:De(e.id),kind:`terminal`,label:s===0?o:`${o} (${s+1})`,hint:e.state===`ended`?`ended`:void 0,status:Lt(i,a),pinned:e.pinned===!0,agentType:e.command?.type===`claude`?`claude`:void 0})}for(let e of o[t]??[]){let t=It(e.url),n=l.get(t)??0;l.set(t,n+1),d.push({id:e.id,kind:`browser`,label:n===0?t:`${t} (${n+1})`,hint:e.url,status:`idle`,pinned:!1})}let f=i.lookup(t),p=t===e.path;return{id:`wt:${t}`,name:p?s?`root`:`main`:Rt(t),path:t,active:p,dirty:f?.dirtyCount??0,ahead:f?.ahead??0,behind:f?.behind??0,children:d,hasWorkingChild:d.some(e=>e.status===`working`),hasAlertChild:d.some(e=>e.status===`attention`),...f?.origin?{origin:f.origin}:{},...f?.orphan?{orphan:!0}:{}}})}function Mt(e,t,n){let r=Et(e),i=Et(t);return n.map(e=>e.path).filter(e=>{let t=Et(e);return t===i?r===t:r===t||r.startsWith(`${t}/`)}).sort((e,t)=>Et(t).length-Et(e).length)[0]??null}function Nt({panes:e,sessions:t,agentStates:n,reviewPendingSessions:r,attentionDismissed:i}){let a=new Map,o=[];for(let s of e){if(s.state.kind!==`terminal`&&s.state.kind!==`browser`)continue;let e=Pt(s,t,n,r,i);if(!e)continue;let c=a.get(e.label)??0;a.set(e.label,c+1),o.push(c===0?e:{...e,label:`${e.label} (${c+1})`})}return o}function Pt(e,t,n,r,i){let{state:a}=e;if(a.kind===`terminal`){let o=t.find(e=>e.id===a.sessionId),s=o?n[o.id]:void 0,c=Ct(s,i)?void 0:s?.lifecycle,l=o?r.has(o.id):!1;return{id:e.id,kind:`terminal`,label:o?Ft(o):`terminal`,hint:o?.state===`ended`?`ended`:void 0,status:Lt(c,l),pinned:o?.pinned===!0,agentType:o?.command?.type===`claude`?`claude`:void 0}}return a.kind===`browser`?{id:e.id,kind:`browser`,label:It(a.url),hint:a.url,status:`idle`,pinned:!1,auto:a.auto===!0}:null}function Ft(e){return wt(e)}function It(e){try{let t=new URL(e),n=t.hostname||`browser`,r=t.port;return r?`${n}:${r}`:n}catch{return`Browser`}}function Lt(e,t){return t?`review`:e===`waiting`?`attention`:e===`running`?`working`:`idle`}function Rt(e){let t=e.replace(/\/+$/,``).split(`/`).pop();return t&&t.length>0?t:e}function zt(e=window.innerWidth){if(!Number.isFinite(e))return 480;let t=e-360;return Math.max(220,Math.min(480,t))}function Bt(e,t=window.innerWidth){if(!Number.isFinite(e))return 256;let n=zt(t);return Math.round(Math.min(n,Math.max(220,e)))}function Vt(e){return Number.isFinite(e)?Math.round(Math.min(480,Math.max(220,e))):256}var Ht={0:`px-3`,1:`pr-3 pl-9`},Ut=`bg-row-selected-bg before:absolute before:inset-y-0 before:left-0 before:w-[3px] before:bg-accent before:content-['']`;function Wt({selected:e,depth:t=0,hint:n,onClick:r,className:i,rootProps:a,children:o}){let s=r!==void 0,{className:c,onKeyDown:l,...u}=a??{};function d(e){l?.(e),!(!s||e.defaultPrevented)&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r?.())}return(0,V.jsx)(`div`,{role:s?`button`:void 0,tabIndex:s?0:void 0,"aria-current":e?`page`:void 0,title:n,onClick:r,onKeyDown:d,...u,className:`
18
+ relative flex h-bar min-w-0 ${s?`cursor-pointer`:`cursor-default`} items-center gap-2 ${Ht[t]} text-text-primary
19
+ ${e?Ut:s?`hover:bg-row-hover-bg`:``}
20
+ ${c??``}
21
+ ${i??``}
22
+ `,children:o})}var Gt={default:`text-text-secondary hover:text-text-primary`,accent:`text-accent`,accentHover:`text-text-secondary hover:text-accent`,accentPrimaryHover:`text-accent hover:text-text-primary`,dangerPrimaryHover:`text-danger hover:text-text-primary`};function Kt({children:e,tone:t=`default`,type:n=`button`,...r}){return(0,V.jsx)(`button`,{type:n,className:`relative flex h-icon-base w-icon-base shrink-0 items-center justify-center rounded-control before:absolute before:-inset-1.5 before:content-[''] ${Gt[t]}`,...r,children:e})}var qt={accent:`text-accent`,secondary:`text-text-secondary`,primary:`text-text-primary`,warning:`text-warning`,danger:`text-danger`,success:`text-success`};function Jt({tone:e=`secondary`,className:t,children:n}){return(0,V.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center ${qt[e]} ${t??``}`,children:n})}var Yt={normal:`font-normal`,medium:`font-medium`,semibold:`font-semibold`};function Xt({selected:e,weight:t,className:n,title:r,children:i}){return(0,V.jsx)(`span`,{title:r,className:`min-w-0 flex-1 truncate text-sm leading-tight ${Yt[t??(e?`semibold`:`normal`)]} ${n??``}`,children:i})}var Zt={working:`status: working`,attention:`status: needs input`,review:`status: review`},Qt={working:`text-[var(--theme-git-modified)]`,attention:`text-danger`,review:`text-success`,idle:``,none:``};function $t({child:e}){return(0,V.jsx)(`span`,{"aria-hidden":!0,className:`flex h-4 w-4 shrink-0 items-center justify-center`,children:(0,V.jsx)(u,{state:e.status})})}function en({child:e,selected:t,onClick:n,onTogglePin:r}){let i=Zt[e.status],a=e.kind===`terminal`&&r!==void 0;return(0,V.jsxs)(Wt,{depth:1,selected:t,hint:e.hint,onClick:n,children:[(0,V.jsx)($t,{child:e}),(0,V.jsx)(Xt,{selected:t,className:Qt[e.status],children:e.label}),i&&(0,V.jsxs)(`span`,{className:`sr-only`,children:[`, `,i]}),a?(0,V.jsx)(Kt,{"aria-label":e.pinned?`Remove from Monitor`:`Pin to Monitor`,"aria-pressed":e.pinned,title:e.pinned?`Remove from Monitor`:`Pin to Monitor`,tone:e.pinned?`accent`:`default`,onClick:e=>{e.stopPropagation(),r()},children:(0,V.jsx)(h.pin,{})}):e.pinned?(0,V.jsx)(`span`,{role:`img`,"aria-label":`pinned to Monitor`,title:`Pinned to Monitor`,className:`flex shrink-0 text-accent`,children:(0,V.jsx)(h.pin,{})}):null]})}function tn({selected:e,pinnedCount:t,onClick:n}){return(0,V.jsxs)(Wt,{selected:e,onClick:n,children:[(0,V.jsx)(Jt,{tone:e?`accent`:`secondary`,children:(0,V.jsx)(h.monitor,{})}),(0,V.jsx)(Xt,{weight:`semibold`,children:`Monitor`}),(0,V.jsx)(`span`,{className:`shrink-0 text-xs text-text-secondary`,children:t})]})}var nn=v();function rn(){var e=[...arguments];return(0,B.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var an=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function on(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function sn(e){return`nodeType`in e}function cn(e){return e?on(e)?e:sn(e)?e.ownerDocument?.defaultView??window:window:window}function ln(e){let{Document:t}=cn(e);return e instanceof t}function un(e){return on(e)?!1:e instanceof cn(e).HTMLElement}function dn(e){return e instanceof cn(e).SVGElement}function fn(e){return e?on(e)?e.document:sn(e)?ln(e)?e:un(e)||dn(e)?e.ownerDocument:document:document:document}var pn=an?B.useLayoutEffect:B.useEffect;function mn(e){let t=(0,B.useRef)(e);return pn(()=>{t.current=e}),(0,B.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function hn(){let e=(0,B.useRef)(null);return[(0,B.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,B.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function gn(e,t){t===void 0&&(t=[e]);let n=(0,B.useRef)(e);return pn(()=>{n.current!==e&&(n.current=e)},t),n}function _n(e,t){let n=(0,B.useRef)();return(0,B.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function vn(e){let t=mn(e),n=(0,B.useRef)(null);return[n,(0,B.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function yn(e){let t=(0,B.useRef)();return(0,B.useEffect)(()=>{t.current=e},[e]),t.current}var bn={};function xn(e,t){return(0,B.useMemo)(()=>{if(t)return t;let n=bn[e]==null?0:bn[e]+1;return bn[e]=n,e+`-`+n},[e,t])}function Sn(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var Cn=Sn(1),wn=Sn(-1);function Tn(e){return`clientX`in e&&`clientY`in e}function En(e){if(!e)return!1;let{KeyboardEvent:t}=cn(e.target);return t&&e instanceof t}function Dn(e){if(!e)return!1;let{TouchEvent:t}=cn(e.target);return t&&e instanceof t}function On(e){if(Dn(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Tn(e)?{x:e.clientX,y:e.clientY}:null}var kn=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[kn.Translate.toString(e),kn.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),An=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function jn(e){return e.matches(An)?e:e.querySelector(An)}var Mn={display:`none`};function Nn(e){let{id:t,value:n}=e;return B.createElement(`div`,{id:t,style:Mn},n)}function Pn(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return B.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function Fn(){let[e,t]=(0,B.useState)(``);return{announce:(0,B.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var In=(0,B.createContext)(null);function Ln(e){let t=(0,B.useContext)(In);(0,B.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function Rn(){let[e]=(0,B.useState)(()=>new Set),t=(0,B.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,B.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var zn={draggable:`
23
+ To pick up a draggable item, press the space bar.
24
+ While dragging, use the arrow keys to move the item.
25
+ Press space again to drop the item in its new position, or press escape to cancel.
26
+ `},Bn={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function Vn(e){let{announcements:t=Bn,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=zn}=e,{announce:a,announcement:o}=Fn(),s=xn(`DndLiveRegion`),[c,l]=(0,B.useState)(!1);if((0,B.useEffect)(()=>{l(!0)},[]),Ln((0,B.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=B.createElement(B.Fragment,null,B.createElement(Nn,{id:r,value:i.draggable}),B.createElement(Pn,{id:s,announcement:o}));return n?(0,nn.createPortal)(u,n):u}var Hn;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(Hn||={});function Un(){}function Wn(e,t){return(0,B.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function Gn(){var e=[...arguments];return(0,B.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var Kn=Object.freeze({x:0,y:0});function qn(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function Jn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Yn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Xn(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Zn(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function Qn(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var $n=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=Qn(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=qn(Qn(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(Jn)},er=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=Xn(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=Xn(r),o=i.reduce((e,t,r)=>e+qn(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(Jn)};function tr(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var nr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=tr(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(Yn)};function rr(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function ir(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Kn}function ar(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var or=ar(1);function sr(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function cr(e,t,n){let r=sr(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var lr={ignoreTransform:!1};function ur(e,t){t===void 0&&(t=lr);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=cn(e).getComputedStyle(e);t&&(n=cr(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function dr(e){return ur(e,{ignoreTransform:!0})}function fr(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function pr(e,t){return t===void 0&&(t=cn(e).getComputedStyle(e)),t.position===`fixed`}function mr(e,t){t===void 0&&(t=cn(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`?n.test(r):!1})}function hr(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(ln(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!un(i)||dn(i)||n.includes(i))return n;let a=cn(e).getComputedStyle(i);return i!==e&&mr(i,a)&&n.push(i),pr(i,a)?n:r(i.parentNode)}return e?r(e):n}function gr(e){let[t]=hr(e,1);return t??null}function _r(e){return!an||!e?null:on(e)?e:sn(e)?ln(e)||e===fn(e).scrollingElement?window:un(e)?e:null:null}function vr(e){return on(e)?e.scrollX:e.scrollLeft}function yr(e){return on(e)?e.scrollY:e.scrollTop}function br(e){return{x:vr(e),y:yr(e)}}var xr;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(xr||={});function Sr(e){return!an||!e?!1:e===document.scrollingElement}function Cr(e){let t={x:0,y:0},n=Sr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var wr={x:.2,y:.2};function Tr(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=wr);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=Cr(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=xr.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=xr.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=xr.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=xr.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function Er(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Dr(e){return e.reduce((e,t)=>Cn(e,br(t)),Kn)}function Or(e){return e.reduce((e,t)=>e+vr(t),0)}function kr(e){return e.reduce((e,t)=>e+yr(t),0)}function Ar(e,t){if(t===void 0&&(t=ur),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);gr(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var jr=[[`x`,[`left`,`right`],Or],[`y`,[`top`,`bottom`],kr]],Mr=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=hr(t),r=Dr(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of jr)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,`rect`,{enumerable:!1})}},Nr=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function Pr(e){let{EventTarget:t}=cn(e);return e instanceof t?e:fn(e)}function Fr(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t?r>t.y:!1}var Ir;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(Ir||={});function Lr(e){e.preventDefault()}function Rr(e){e.stopPropagation()}var H;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(H||={});var zr={start:[H.Space,H.Enter],cancel:[H.Esc],end:[H.Space,H.Enter,H.Tab]},Br=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case H.Right:return{...n,x:n.x+25};case H.Left:return{...n,x:n.x-25};case H.Down:return{...n,y:n.y+25};case H.Up:return{...n,y:n.y-25}}},Vr=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new Nr(fn(t)),this.windowListeners=new Nr(cn(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ir.Resize,this.handleCancel),this.windowListeners.add(Ir.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ir.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Ar(n),t(Kn)}handleKeyDown(e){if(En(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=zr,coordinateGetter:a=Br,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:Kn;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=wn(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=Cr(n),p=Er(n),m={x:Math.min(i===H.Right?p.right-p.width/2:p.right,Math.max(i===H.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===H.Down?p.bottom-p.height/2:p.bottom,Math.max(i===H.Down?p.top:p.top+p.height/2,u.y))},h=i===H.Right&&!s||i===H.Left&&!c,g=i===H.Down&&!l||i===H.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===H.Right&&e<=d.x||i===H.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===H.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===H.Down&&e<=d.y||i===H.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===H.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,Cn(wn(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};Vr.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=zr,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function Hr(e){return!!(e&&`distance`in e)}function Ur(e){return!!(e&&`delay`in e)}var Wr=class{constructor(e,t,n){n===void 0&&(n=Pr(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=fn(i),this.documentListeners=new Nr(this.document),this.listeners=new Nr(n),this.windowListeners=new Nr(cn(i)),this.initialCoordinates=On(r)??Kn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Ir.Resize,this.handleCancel),this.windowListeners.add(Ir.DragStart,Lr),this.windowListeners.add(Ir.VisibilityChange,this.handleCancel),this.windowListeners.add(Ir.ContextMenu,Lr),this.documentListeners.add(Ir.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ur(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(Hr(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Ir.Click,Rr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ir.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=On(e)??Kn,s=wn(n,o);if(!t&&a){if(Hr(a)){if(a.tolerance!=null&&Fr(s,a.tolerance))return this.handleCancel();if(Fr(s,a.distance))return this.handleStart()}if(Ur(a)&&Fr(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===H.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},Gr={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},Kr=class extends Wr{constructor(e){let{event:t}=e,n=fn(t.target);super(e,Gr,n)}};Kr.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var qr={move:{name:`mousemove`},end:{name:`mouseup`}},Jr;(function(e){e[e.RightClick=2]=`RightClick`})(Jr||={});var Yr=class extends Wr{constructor(e){super(e,qr,fn(e.event.target))}};Yr.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Jr.RightClick?!1:(r?.({event:n}),!0)}}];var Xr={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},Zr=class extends Wr{constructor(e){super(e,Xr)}static setup(){return window.addEventListener(Xr.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Xr.move.name,e)};function e(){}}};Zr.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var Qr;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(Qr||={});var $r;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})($r||={});function ei(e){let{acceleration:t,activator:n=Qr.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=$r.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=ni({delta:d,disabled:!a}),[m,h]=hn(),g=(0,B.useRef)({x:0,y:0}),_=(0,B.useRef)({x:0,y:0}),v=(0,B.useMemo)(()=>{switch(n){case Qr.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Qr.DraggableRect:return i}},[n,i,c]),y=(0,B.useRef)(null),b=(0,B.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,B.useMemo)(()=>s===$r.TreeOrder?[...l].reverse():l,[s,l]);(0,B.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=u[l.indexOf(e)];if(!n)continue;let{direction:i,speed:a}=Tr(e,n,v,t,f);for(let e of[`x`,`y`])p[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0){h(),y.current=e,m(b,o),g.current=a,_.current=i;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var ti={x:{[xr.Backward]:!1,[xr.Forward]:!1},y:{[xr.Backward]:!1,[xr.Forward]:!1}};function ni(e){let{delta:t,disabled:n}=e,r=yn(t);return _n(e=>{if(n||!r||!e)return ti;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[xr.Backward]:e.x[xr.Backward]||i.x===-1,[xr.Forward]:e.x[xr.Forward]||i.x===1},y:{[xr.Backward]:e.y[xr.Backward]||i.y===-1,[xr.Forward]:e.y[xr.Forward]||i.y===1}}},[n,t,r])}function ri(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return _n(e=>t==null?null:r??e??null,[r,t])}function ii(e,t){return(0,B.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var ai;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(ai||={});var oi;(function(e){e.Optimized=`optimized`})(oi||={});var si=new Map;function ci(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,B.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,B.useRef)(e),d=g(),f=gn(d),p=(0,B.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,B.useRef)(null),h=_n(t=>{if(d&&!n)return si;if(!t||t===si||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new Mr(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,B.useEffect)(()=>{u.current=e},[e]),(0,B.useEffect)(()=>{d||p()},[n,d]),(0,B.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,B.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case ai.Always:return!1;case ai.BeforeDragging:return n;default:return!n}}}function li(e,t){return _n(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function ui(e,t){return li(e,t)}function di(e){let{callback:t,disabled:n}=e,r=mn(t),i=(0,B.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,B.useEffect)(()=>()=>i?.disconnect(),[i]),i}function fi(e){let{callback:t,disabled:n}=e,r=mn(t),i=(0,B.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,B.useEffect)(()=>()=>i?.disconnect(),[i]),i}function pi(e){return new Mr(ur(e),e)}function mi(e,t,n){t===void 0&&(t=pi);let[r,i]=(0,B.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=di({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=fi({callback:a});return pn(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function hi(e){return ir(e,li(e))}var gi=[];function _i(e){let t=(0,B.useRef)(e),n=_n(n=>e?n&&n!==gi&&e&&t.current&&e.parentNode===t.current.parentNode?n:hr(e):gi,[e]);return(0,B.useEffect)(()=>{t.current=e},[e]),n}function vi(e){let[t,n]=(0,B.useState)(null),r=(0,B.useRef)(e),i=(0,B.useCallback)(e=>{let t=_r(e.target);t&&n(e=>e?(e.set(t,br(t)),new Map(e)):null)},[]);return(0,B.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=_r(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,br(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{_r(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,B.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Cn(e,t),Kn):Dr(e):Kn,[e,t])}function yi(e,t){t===void 0&&(t=[]);let n=(0,B.useRef)(null);return(0,B.useEffect)(()=>{n.current=null},t),(0,B.useEffect)(()=>{let t=e!==Kn;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?wn(e,n.current):Kn}function bi(e){(0,B.useEffect)(()=>{if(!an)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function xi(e,t){return(0,B.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function Si(e){return(0,B.useMemo)(()=>e?fr(e):null,[e])}var Ci=[];function wi(e,t){t===void 0&&(t=ur);let[n]=e,r=Si(n?cn(n):null),[i,a]=(0,B.useState)(Ci);function o(){a(()=>e.length?e.map(e=>Sr(e)?r:new Mr(t(e),e)):Ci)}let s=fi({callback:o});return pn(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function Ti(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return un(t)?t:e}function Ei(e){let{measure:t}=e,[n,r]=(0,B.useState)(null),i=fi({callback:(0,B.useCallback)(e=>{for(let{target:n}of e)if(un(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=vn((0,B.useCallback)(e=>{let n=Ti(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,B.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var Di=[{sensor:Kr,options:{}},{sensor:Vr,options:{}}],Oi={current:{}},ki={draggable:{measure:dr},droppable:{measure:dr,strategy:ai.WhileDragging,frequency:oi.Optimized},dragOverlay:{measure:ur}},U=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},W={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new U,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Un},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ki,measureDroppableContainers:Un,windowRect:null,measuringScheduled:!1},Ai={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:Un,draggableNodes:new Map,over:null,measureDroppableContainers:Un},ji=(0,B.createContext)(Ai),Mi=(0,B.createContext)(W);function Ni(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new U}}}function Pi(e,t){switch(t.type){case Hn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Hn.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Hn.DragEnd:case Hn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Hn.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new U(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Hn.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new U(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case Hn.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new U(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Fi(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,B.useContext)(ji),a=yn(r),o=yn(n?.id);return(0,B.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!En(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=jn(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function Ii(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function Li(e){return(0,B.useMemo)(()=>({draggable:{...ki.draggable,...e?.draggable},droppable:{...ki.droppable,...e?.droppable},dragOverlay:{...ki.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Ri(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,B.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;pn(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=ir(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=gr(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var zi=(0,B.createContext)({...Kn,scaleX:1,scaleY:1}),Bi;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(Bi||={});var Vi=(0,B.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=Di,collisionDetection:o=nr,measuring:s,modifiers:c,...l}=e,[u,d]=(0,B.useReducer)(Pi,void 0,Ni),[f,p]=Rn(),[m,h]=(0,B.useState)(Bi.Uninitialized),g=m===Bi.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,B.useRef)({initial:null,translated:null}),C=(0,B.useMemo)(()=>_==null?null:{id:_,data:x?.data??Oi,rect:S},[_,x]),w=(0,B.useRef)(null),[T,E]=(0,B.useState)(null),[D,O]=(0,B.useState)(null),k=gn(l,Object.values(l)),ee=xn(`DndDescribedBy`,t),A=(0,B.useMemo)(()=>b.getEnabled(),[b]),j=Li(s),{droppableRects:te,measureDroppableContainers:ne,measuringScheduled:M}=ci(A,{dragging:g,dependencies:[y.x,y.y],config:j.droppable}),N=ri(v,_),re=(0,B.useMemo)(()=>D?On(D):null,[D]),ie=ke(),ae=ui(N,j.draggable.measure);Ri({activeNode:_==null?null:v.get(_),config:ie.layoutShiftCompensation,initialRect:ae,measure:j.draggable.measure});let P=mi(N,j.draggable.measure,ae),F=mi(N?N.parentElement:null),I=(0,B.useRef)({activatorEvent:null,active:null,activeNode:N,collisionRect:null,collisions:null,droppableRects:te,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),L=b.getNodeFor(I.current.over?.id),R=Ei({measure:j.dragOverlay.measure}),oe=R.nodeRef.current??N,se=g?R.rect??P:null,ce=!!(R.nodeRef.current&&R.rect),le=hi(ce?null:P),ue=Si(oe?cn(oe):null),de=_i(g?L??N:null),fe=wi(de),pe=Ii(c,{transform:{x:y.x-le.x,y:y.y-le.y,scaleX:1,scaleY:1},activatorEvent:D,active:C,activeNodeRect:P,containerNodeRect:F,draggingNodeRect:se,over:I.current.over,overlayNodeRect:R.rect,scrollableAncestors:de,scrollableAncestorRects:fe,windowRect:ue}),me=re?Cn(re,y):null,he=vi(de),z=yi(he),ge=yi(he,[P]),_e=Cn(pe,z),ve=se?or(se,pe):null,ye=C&&ve?o({active:C,collisionRect:ve,droppableRects:te,droppableContainers:A,pointerCoordinates:me}):null,be=Zn(ye,`id`),[xe,Se]=(0,B.useState)(null),Ce=rr(ce?pe:Cn(pe,ge),xe?.rect??null,P),we=(0,B.useRef)(null),Te=(0,B.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent;we.current=new n({active:w.current,activeNode:i,event:a,options:r,context:I,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=k.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=k.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=k.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,nn.unstable_batchedUpdates)(()=>{r?.(i),h(Bi.Initializing),d({type:Hn.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(we.current),O(a)})},onMove(e){d({type:Hn.DragMove,coordinates:e})},onEnd:o(Hn.DragEnd),onCancel:o(Hn.DragCancel)});function o(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=I.current,o=null;if(t&&i){let{cancelDrop:s}=k.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===Hn.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=Hn.DragCancel)}w.current=null,(0,nn.unstable_batchedUpdates)(()=>{d({type:e}),h(Bi.Uninitialized),Se(null),E(null),O(null),we.current=null;let t=e===Hn.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=k.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),Ee=ii(a,(0,B.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},w.current=r,Te(n,t))},[v,Te]));bi(a),pn(()=>{P&&m===Bi.Initializing&&h(Bi.Initialized)},[P,m]),(0,B.useEffect)(()=>{let{onDragMove:e}=k.current,{active:t,activatorEvent:n,collisions:r,over:i}=I.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:_e.x,y:_e.y},over:i};(0,nn.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[_e.x,_e.y]),(0,B.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=I.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=k.current,o=r.get(be),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,nn.unstable_batchedUpdates)(()=>{Se(s),a?.(c),f({type:`onDragOver`,event:c})})},[be]),pn(()=>{I.current={activatorEvent:D,active:C,activeNode:N,collisionRect:ve,collisions:ye,droppableRects:te,draggableNodes:v,draggingNode:oe,draggingNodeRect:se,droppableContainers:b,over:xe,scrollableAncestors:de,scrollAdjustedTranslate:_e},S.current={initial:se,translated:ve}},[C,N,ye,ve,v,oe,se,te,b,xe,de,_e]),ei({...ie,delta:y,draggingRect:ve,pointerCoordinates:me,scrollableAncestors:de,scrollableAncestorRects:fe});let De=(0,B.useMemo)(()=>({active:C,activeNode:N,activeNodeRect:P,activatorEvent:D,collisions:ye,containerNodeRect:F,dragOverlay:R,draggableNodes:v,droppableContainers:b,droppableRects:te,over:xe,measureDroppableContainers:ne,scrollableAncestors:de,scrollableAncestorRects:fe,measuringConfiguration:j,measuringScheduled:M,windowRect:ue}),[C,N,P,D,ye,F,R,v,b,te,xe,ne,de,fe,j,M,ue]),Oe=(0,B.useMemo)(()=>({activatorEvent:D,activators:Ee,active:C,activeNodeRect:P,ariaDescribedById:{draggable:ee},dispatch:d,draggableNodes:v,over:xe,measureDroppableContainers:ne}),[D,Ee,C,P,d,ee,v,xe,ne]);return B.createElement(In.Provider,{value:p},B.createElement(ji.Provider,{value:Oe},B.createElement(Mi.Provider,{value:De},B.createElement(zi.Provider,{value:Ce},i)),B.createElement(Fi,{disabled:n?.restoreFocus===!1})),B.createElement(Vn,{...n,hiddenTextDescribedById:ee}));function ke(){let e=T?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),Hi=(0,B.createContext)(null),Ui=`button`,Wi=`Draggable`;function Gi(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=xn(Wi),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,B.useContext)(ji),{role:p=Ui,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,B.useContext)(g?zi:Hi),[v,y]=vn(),[b,x]=vn(),S=xi(o,t),C=gn(n);return pn(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,B.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===Ui?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function Ki(){return(0,B.useContext)(Mi)}var qi=`Droppable`,Ji={timeout:25};function Yi(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=xn(qi),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,B.useContext)(ji),u=(0,B.useRef)({disabled:n}),d=(0,B.useRef)(!1),f=(0,B.useRef)(null),p=(0,B.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...Ji,...i},_=gn(h??r),v=fi({callback:(0,B.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=vn((0,B.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=gn(t);return(0,B.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,B.useEffect)(()=>(s({type:Hn.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:Hn.UnregisterDroppable,key:a,id:r})),[r]),(0,B.useEffect)(()=>{n!==u.current.disabled&&(s({type:Hn.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function Xi(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Zi(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function Qi(e){return e!==null&&e>=0}function $i(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ea(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var ta=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=Xi(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},na={scaleX:1,scaleY:1},ra=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...na}:null}let s=ia(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...na}:r<t&&r>=a?{x:0,y:o.height+s,...na}:{x:0,y:0,...na}};function ia(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}var aa=`Sortable`,oa=B.createContext({activeIndex:-1,containerId:aa,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:ta,disabled:{draggable:!1,droppable:!1}});function sa(e){let{children:t,id:n,items:r,strategy:i=ta,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=Ki(),d=xn(aa,n),f=s.rect!==null,p=(0,B.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,B.useRef)(p),v=!$i(p,_.current),y=g!==-1&&h===-1||v,b=ea(a);pn(()=>{v&&m&&u(p)},[v,p,m,u]),(0,B.useEffect)(()=>{_.current=p},[p]);let x=(0,B.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:Zi(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return B.createElement(oa.Provider,{value:x},t)}var ca=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return Xi(n,r,i).indexOf(t)},la=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},ua={duration:200,easing:`ease`},da=`transform`,fa=kn.Transition.toString({property:da,duration:0,easing:`linear`}),pa={roleDescription:`sortable`};function ma(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,B.useState)(null),s=(0,B.useRef)(n);return pn(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=ur(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,B.useEffect)(()=>{a&&o(null)},[a]),a}function ha(e){let{animateLayoutChanges:t=la,attributes:n,disabled:r,data:i,getNewIndex:a=ca,id:o,strategy:s,resizeObserverConfig:c,transition:l=ua}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,B.useContext)(oa),y=ga(r,p),b=u.indexOf(o),x=(0,B.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,B.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:w,isOver:T,setNodeRef:E}=Yi({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:D,activatorEvent:O,activeNodeRect:k,attributes:ee,setNodeRef:A,listeners:j,isDragging:te,over:ne,setActivatorNodeRef:M,transform:N}=Gi({id:o,data:x,attributes:{...pa,...n},disabled:y.draggable}),re=rn(E,A),ie=!!D,ae=ie&&!m&&Qi(f)&&Qi(g),P=!_&&te,F=ae?(P&&ae?N:null)??(s??v)({rects:h,activeNodeRect:k,activeIndex:f,overIndex:g,index:b}):null,I=Qi(f)&&Qi(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,L=D?.id,R=(0,B.useRef)({activeId:L,items:u,newIndex:I,containerId:d}),oe=u!==R.current.items,se=t({active:D,containerId:d,isDragging:te,isSorting:ie,id:o,index:b,items:u,newIndex:R.current.newIndex,previousItems:R.current.items,previousContainerId:R.current.containerId,transition:l,wasDragging:R.current.activeId!=null}),ce=ma({disabled:!se,index:b,node:w,rect:C});return(0,B.useEffect)(()=>{ie&&R.current.newIndex!==I&&(R.current.newIndex=I),d!==R.current.containerId&&(R.current.containerId=d),u!==R.current.items&&(R.current.items=u)},[ie,I,d,u]),(0,B.useEffect)(()=>{if(L===R.current.activeId)return;if(L!=null&&R.current.activeId==null){R.current.activeId=L;return}let e=setTimeout(()=>{R.current.activeId=L},50);return()=>clearTimeout(e)},[L]),{active:D,activeIndex:f,attributes:ee,data:x,rect:C,index:b,newIndex:I,items:u,isOver:T,isSorting:ie,isDragging:te,listeners:j,node:w,overIndex:g,over:ne,setNodeRef:re,setActivatorNodeRef:M,setDroppableNodeRef:E,setDraggableNodeRef:A,transform:ce??F,transition:le()};function le(){if(ce||oe&&R.current.newIndex===b)return fa;if(!(P&&!En(O)||!l)&&(ie||se))return kn.Transition.toString({...l,property:da})}}function ga(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function _a(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var va=[H.Down,H.Right,H.Up,H.Left],ya=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(va.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case H.Down:r.top<a.top&&t.push(n);break;case H.Up:r.top>a.top&&t.push(n);break;case H.Left:r.left>a.left&&t.push(n);break;case H.Right:r.left<a.left&&t.push(n);break}});let c=er({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=Zn(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=hr(c).some((e,t)=>s[t]!==e),i=ba(e,t),a=xa(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:wn(u,l)}}}};function ba(e,t){return!_a(e)||!_a(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function xa(e,t){return!_a(e)||!_a(t)||!ba(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function Sa({project:e,worktree:t,selection:n,onSelectChild:r,onToggleChildPin:i,onReorderPanes:a}){return t.children.length===0?null:a?(0,V.jsx)(Ca,{project:e,worktree:t,selection:n,onSelectChild:r,onToggleChildPin:i,onReorderPanes:a}):(0,V.jsx)(`div`,{children:t.children.map(a=>(0,V.jsx)(en,{child:a,selected:n.selectedWorktreeId===t.id&&n.selectedChildId===a.id,onTogglePin:a.kind===`terminal`&&i?()=>i(a.id):void 0,onClick:()=>r?.(e.id,t.id,a.id)},a.id))})}function Ca({project:e,worktree:t,selection:n,onSelectChild:r,onToggleChildPin:i,onReorderPanes:a}){let o=(0,B.useMemo)(()=>t.children.map(e=>e.id),[t.children]),[s,c]=(0,B.useState)(o);(0,B.useEffect)(()=>{c(e=>{let t=new Set(o),n=new Set(e);return t.size===n.size&&[...t].every(e=>n.has(e))?e:o})},[o]);let l=new Map(t.children.map(e=>[e.id,e])),u=s.map(e=>l.get(e)).filter(e=>!!e),d=Gn(Wn(Yr,{activationConstraint:{distance:8}}),Wn(Zr,{activationConstraint:{delay:250,tolerance:6}}),Wn(Vr,{coordinateGetter:ya}));function f(n){let{active:r,over:i}=n;if(!i||r.id===i.id)return;let o=s.indexOf(String(r.id)),l=s.indexOf(String(i.id));if(o===-1||l===-1)return;let u=Xi(s,o,l);c(u),a(e.id,t.path,u)}return(0,V.jsx)(Vi,{sensors:d,collisionDetection:$n,onDragEnd:f,children:(0,V.jsx)(sa,{items:s,strategy:ra,children:(0,V.jsx)(`div`,{children:u.map(a=>(0,V.jsx)(wa,{child:a,selected:n.selectedWorktreeId===t.id&&n.selectedChildId===a.id,onTogglePin:a.kind===`terminal`&&i?()=>i(a.id):void 0,onClick:()=>r?.(e.id,t.id,a.id)},a.id))})})})}function wa({child:e,selected:t,onClick:n,onTogglePin:r}){let{attributes:i,listeners:a,setNodeRef:o,transform:s,transition:c,isDragging:l}=ha({id:e.id}),u={transform:kn.Transform.toString(s),transition:c,opacity:l?.6:1,zIndex:l?5:void 0,WebkitTouchCallout:`none`},d=Ea(a);return(0,V.jsx)(`div`,{ref:o,style:u,...i,...d,className:`select-none`,children:(0,V.jsx)(en,{child:e,selected:t,onTogglePin:r,onClick:n})})}var Ta=new Set([`onPointerDown`,`onMouseDown`,`onTouchStart`]);function Ea(e){if(!e)return e;let t={};for(let[n,r]of Object.entries(e))Ta.has(n)?t[n]=e=>{r(e),e.stopPropagation()}:t[n]=r;return t}function Da({label:e,onOpenContainer:t}){return t?(0,V.jsx)(Kt,{"aria-label":`New session in ${e}`,tone:`accentHover`,onClick:e=>{e.stopPropagation(),t()},children:(0,V.jsx)(h.add,{})}):null}var Oa=`parasor:sidebar:worktree-open`;function ka(e){return`${Oa}:${e}`}function Aa(e,t){try{let n=window.localStorage.getItem(ka(e));if(!n)return!0;let r=JSON.parse(n);if(!r||typeof r!=`object`||Array.isArray(r))return!0;let i=r[t];return typeof i==`boolean`?i:!0}catch{return!0}}function ja(e,t,n){try{let r=ka(e),i=window.localStorage.getItem(r),a=i?JSON.parse(i):null,o=a&&typeof a==`object`&&!Array.isArray(a)?{...a}:{};o[t]=n,window.localStorage.setItem(r,JSON.stringify(o))}catch{}}function Ma(e,t,n){let[r,i]=(0,B.useState)(()=>Aa(e,t));return(0,B.useEffect)(()=>{i(Aa(e,t))},[e,t]),{open:n?!0:r,toggle:()=>{n||i(n=>{let r=!n;return ja(e,t,r),r})}}}function Na({project:e,worktree:t,selection:n,displayName:r,forceOpen:i=!1,isProjectRoot:a=!1,dragHandleProps:o,onSelectWorktree:s,onSelectChild:c,onOpenContainer:l,onToggleChildPin:u,onReorderPanes:d}){let{open:f,toggle:p}=Ma(e.id,t.path,i),m=n.selectedWorktreeId===t.id&&n.selectedChildId===null,g=e.isRepo===!1,_=r??t.name,v=t.dirty>0?`${t.dirty} uncommitted change${t.dirty===1?``:`s`}`:void 0,y=t.dirty>0?`bg-[var(--theme-git-modified)]`:``;return(0,V.jsxs)(`div`,{className:`border-t border-border`,children:[(0,V.jsxs)(Wt,{selected:m,rootProps:o,className:`group select-none`,children:[(0,V.jsx)(Kt,{onClick:p,onKeyDown:e=>{(e.key===` `||e.key===`Enter`)&&e.stopPropagation()},"aria-expanded":f,"aria-label":`${f?`Collapse`:`Expand`} ${_}`,children:(0,V.jsx)(`span`,{"aria-hidden":!0,className:`transition-transform duration-[120ms] ${f?`rotate-90`:`rotate-0`}`,children:(0,V.jsx)(h.disclosure,{})})}),!a&&(0,V.jsx)(Jt,{tone:m?`accent`:`secondary`,className:`relative`,children:g?(0,V.jsx)(h.folder,{}):t.active?(0,V.jsx)(h.worktreeActive,{}):(0,V.jsx)(h.worktreeInactive,{})}),(0,V.jsxs)(`button`,{type:`button`,className:`flex min-w-0 flex-1 items-center gap-1 text-left`,"aria-label":v?`${_}, ${v}`:void 0,onClick:()=>s?.(e.id,t.id),children:[(0,V.jsx)(Xt,{title:v,selected:m,weight:m?`semibold`:`medium`,className:a?`text-text-primary`:`text-text-secondary`,children:_}),a&&e.readOnly&&(0,V.jsx)(`span`,{title:`read-only`,className:`shrink-0 text-text-secondary`,children:(0,V.jsx)(h.readOnlyProject,{})}),t.origin===`agent`&&(0,V.jsx)(`span`,{role:`img`,"aria-label":`Agent worktree`,title:`Created by an agent (Agent Team isolated checkout)`,className:`shrink-0 rounded-tag border border-accent/40 bg-accent/10 px-1 text-[10px] font-medium leading-tight text-accent`,children:`agent`}),t.orphan&&(0,V.jsx)(`span`,{role:`img`,"aria-label":`Orphan worktree`,title:`Path is missing on disk -- use force remove to prune`,className:`shrink-0 rounded-tag border border-danger/40 bg-danger/10 px-1 text-[10px] font-medium leading-tight text-danger`,children:`orphan`})]}),y&&(0,V.jsx)(`span`,{"aria-hidden":!0,title:v,className:`h-1.5 w-1.5 shrink-0 rounded-tag ${y}`}),(0,V.jsx)(Da,{label:_,onOpenContainer:l?()=>l(e.id,t.id):void 0})]}),f&&(0,V.jsx)(Sa,{project:e,worktree:t,selection:n,onSelectChild:c,onToggleChildPin:u,onReorderPanes:d})]})}function Pa({project:e,selection:t,onSelectWorktree:n,onSelectChild:r,onOpenContainer:i,onToggleChildPin:a,onReorderPanes:o,dragHandleProps:s,forceOpen:c=!1}){return(0,V.jsx)(V.Fragment,{children:(e.worktrees.length>0?e.worktrees:[{id:`wt:${e.path}`,name:e.isRepo===!1?`root`:`main`,path:e.path,active:!0,dirty:0,ahead:0,behind:0,children:[],hasWorkingChild:!1,hasAlertChild:!1}]).map((l,u)=>{let d=l.path===e.path;return(0,V.jsx)(Na,{project:e,worktree:l,selection:t,displayName:d?e.name:l.name,forceOpen:c,isProjectRoot:d,dragHandleProps:d&&u===0?s:void 0,onSelectWorktree:n,onSelectChild:r,onOpenContainer:i,onToggleChildPin:a,onReorderPanes:o},l.id)})})}function Fa(e,t){let n=[];for(let[r,i]of Object.entries(e??{}))for(let e of i??[])n.push({key:`${r}:${e.port}`,port:e.port,projectId:r,projectName:t?.[r]??`project`,reachable:e.reachable??e.bindsAll,url:`http://localhost:${e.port}`});return n.sort((e,t)=>e.projectName===t.projectName?e.port-t.port:e.projectName.localeCompare(t.projectName))}function Ia(e,t){let n=(0,B.useRef)(!1),[r,i]=(0,B.useState)(!1),[a,o]=(0,B.useState)(()=>new Set),s=(0,B.useMemo)(()=>Fa(e,t),[e,t]),c=(0,B.useMemo)(()=>new Set(s.map(e=>e.key)),[s]);return(0,B.useEffect)(()=>{if(!n.current){n.current=!0,o(new Set(c));return}o(e=>{let t=new Set;for(let n of e)c.has(n)&&t.add(n);if(r)for(let e of c)t.add(e);return t})},[c,r]),{currentPortKeys:c,entries:s,hasUnread:s.some(e=>!a.has(e.key)),markCurrentSeen:()=>o(new Set(c)),open:r,setOpen:i}}function La({connected:e,portsByProjectId:t,projectNames:n,onOpenUrl:r}){let i=(0,B.useRef)(null),{entries:a,hasUnread:o,markCurrentSeen:s,open:c,setOpen:l}=Ia(t,n);return(0,B.useEffect)(()=>{if(!c)return;let e=e=>{let t=i.current;t&&e.target instanceof Node&&t.contains(e.target)||l(!1)},t=e=>{e.key===`Escape`&&l(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[c,l]),(0,V.jsxs)(`span`,{ref:i,className:`flex items-center gap-2`,children:[(0,V.jsxs)(Kt,{"aria-label":o?`Network ports, new ports`:`Network ports`,"aria-expanded":c,title:e?`Network ports`:`Offline`,tone:e?`accentPrimaryHover`:`dangerPrimaryHover`,onClick:()=>{l(e=>!e),s()},children:[(0,V.jsx)(h.connection,{}),o&&(0,V.jsx)(`span`,{"aria-hidden":!0,className:`absolute top-1 right-1 h-2 w-2 rounded-tag bg-accent shadow-[0_0_0_2px_var(--color-bg-secondary)]`})]}),c&&(0,V.jsxs)(`div`,{className:`fixed bottom-11 left-3 z-50 w-[min(20rem,calc(100vw-1.5rem))] rounded-window border border-border bg-bg-secondary p-2 text-left shadow-lg`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between px-1 pb-1.5`,children:[(0,V.jsx)(`span`,{className:`text-xs font-semibold text-text-primary`,children:`Detected ports`}),(0,V.jsx)(`span`,{className:`cm-mono text-xs text-text-secondary`,children:a.length})]}),a.length===0?(0,V.jsx)(`div`,{className:`px-1 py-2 text-xs text-text-secondary`,children:`No detected ports`}):(0,V.jsx)(`div`,{className:`max-h-64 overflow-y-auto`,children:a.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2 rounded-control px-1.5 py-1.5 hover:bg-row-hover-bg`,children:[(0,V.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 shrink-0 rounded-tag ${e.reachable?`bg-accent`:`bg-warning`}`}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`div`,{className:`cm-mono text-xs text-text-primary`,children:e.port}),(0,V.jsxs)(`div`,{className:`truncate text-xs text-text-secondary`,children:[e.projectName,!e.reachable&&` - localhost only`]})]}),(0,V.jsx)(`button`,{type:`button`,disabled:!e.reachable||!r,onClick:()=>{r?.(e.url,{projectId:e.projectId}),l(!1)},className:`flex h-7 shrink-0 items-center rounded-control px-2 text-xs text-accent hover:bg-row-hover-bg disabled:text-text-secondary disabled:opacity-50`,children:`Open`})]},e.key))})]})]})}function Ra({connected:e,portsByProjectId:t,projectNames:n,onOpenUrl:i,onOpenSettings:a,onNewProject:o,searchOpen:s=!1,onToggleSearch:c}){return(0,V.jsx)(r,{tone:`sidebar`,horizontalPaddingClassName:Ht[0],status:(0,V.jsx)(La,{connected:e,portsByProjectId:t,projectNames:n,onOpenUrl:i}),actions:(0,V.jsxs)(`span`,{className:`flex items-center gap-3`,children:[o&&(0,V.jsx)(Kt,{title:`New project`,"aria-label":`New project`,onClick:o,tone:`accentHover`,children:(0,V.jsx)(h.add,{})}),(0,V.jsx)(Kt,{title:`Filter sidebar`,"aria-label":s?`Close sidebar filter`:`Filter sidebar`,"aria-pressed":s,onClick:c,tone:s?`accent`:`default`,children:(0,V.jsx)(h.search,{})}),(0,V.jsx)(Kt,{title:`Settings`,"aria-label":`Open settings`,onClick:a,children:(0,V.jsx)(h.settings,{})})]})})}function za({query:e,onClose:t,onQueryChange:n}){let r=(0,B.useRef)(null),i=(0,B.useRef)(!1);return(0,B.useEffect)(()=>{i.current=!1;let e=requestAnimationFrame(()=>r.current?.focus());return()=>cancelAnimationFrame(e)},[]),(0,V.jsxs)(`div`,{className:`flex h-bar shrink-0 items-center gap-2 border-t border-border bg-bg-secondary ${Ht[0]}`,children:[(0,V.jsx)(`span`,{className:`shrink-0 text-text-secondary`,children:(0,V.jsx)(h.search,{})}),(0,V.jsx)(`input`,{ref:r,value:e,onChange:e=>n?.(e.target.value),onCompositionStart:()=>{i.current=!0},onCompositionEnd:()=>{i.current=!1},onBlur:()=>{i.current=!1},onKeyDown:e=>{e.key===`Escape`&&!e.nativeEvent.isComposing&&!i.current&&(e.preventDefault(),t?.())},maxLength:256,placeholder:`Filter sidebar…`,"aria-label":`Filter sidebar`,className:`flex-1 bg-transparent text-sm text-text-primary placeholder:text-text-secondary focus:outline-none`}),t&&(0,V.jsx)(Kt,{onClick:t,"aria-label":`Close sidebar filter`,children:(0,V.jsx)(h.close,{})})]})}function Ba({projects:e,selection:t,resetSignal:n,pendingReorderCount:r=0,onReorderProjects:i,onSelectWorktree:a,onSelectChild:o,onOpenContainer:s,onToggleChildPin:c,onReorderPanes:l}){let u=(0,B.useMemo)(()=>e.map(e=>e.id),[e]),[d,f]=(0,B.useState)(u),p=(0,B.useRef)(r);p.current=r,(0,B.useEffect)(()=>{f(e=>{let t=new Set(u),n=new Set(e);return t.size===n.size&&[...t].every(e=>n.has(e))&&(p.current>0||e.join(`
27
+ `)===u.join(`
28
+ `))?e:u})},[u,n]);let m=new Map(e.map(e=>[e.id,e])),h=d.map(e=>m.get(e)).filter(e=>!!e),g=Gn(Wn(Yr,{activationConstraint:{distance:8}}),Wn(Zr,{activationConstraint:{delay:250,tolerance:6}}),Wn(Vr,{coordinateGetter:ya}));function _(e){let{active:t,over:n}=e;if(!n||t.id===n.id)return;let r=d.indexOf(String(t.id)),a=d.indexOf(String(n.id));if(r===-1||a===-1)return;let o=Xi(d,r,a);f(o),i(o)}return(0,V.jsx)(Vi,{sensors:g,collisionDetection:$n,onDragEnd:_,children:(0,V.jsx)(sa,{items:d,strategy:ra,children:h.map(e=>(0,V.jsx)(Va,{project:e,selection:t,onSelectWorktree:a,onSelectChild:o,onOpenContainer:s,onToggleChildPin:c,onReorderPanes:l},e.id))})})}function Va({project:e,selection:t,onSelectWorktree:n,onSelectChild:r,onOpenContainer:i,onToggleChildPin:a,onReorderPanes:o}){let{attributes:s,listeners:c,setNodeRef:l,transform:u,transition:d,isDragging:f}=ha({id:e.id});return(0,V.jsx)(`div`,{ref:l,style:{transform:kn.Transform.toString(u),transition:d,opacity:f?.6:1,zIndex:f?5:void 0},children:(0,V.jsx)(Pa,{project:e,selection:t,onSelectWorktree:n,onSelectChild:r,onOpenContainer:i,onToggleChildPin:a,onReorderPanes:o,dragHandleProps:{...s,...c,"aria-label":`Reorder ${e.name}`,style:{WebkitTouchCallout:`none`}}})})}function Ha(e,t){let n=t.toLowerCase(),r=[];for(let t of e){let e=t.name.toLowerCase().includes(n),i=[];for(let r of t.worktrees){let t=r.name.toLowerCase().includes(n);if(e||t){i.push(r);continue}let a=r.children.filter(e=>e.label.toLowerCase().includes(n)||(e.hint?.toLowerCase().includes(n)??!1));a.length>0&&i.push({...r,children:a})}(e||i.length>0)&&r.push({...t,worktrees:i})}return r}function Ua({resizable:e,width:t,onWidthChange:n}){let r=(0,B.useRef)(null),i=(0,B.useRef)(!1),a=e?Bt(t):Number.isFinite(t)?Math.round(t):288,o=zt(),s=e&&!!n,c=(0,B.useCallback)(e=>{let t=r.current?.getBoundingClientRect();t&&n?.(Bt(e-t.left))},[n]),l=(0,B.useCallback)(e=>{n&&(e.preventDefault(),e.currentTarget.setPointerCapture?.(e.pointerId),i.current=!0,c(e.clientX))},[n,c]),u=(0,B.useCallback)(e=>{if(i.current){if(e.buttons===0){i.current=!1;return}c(e.clientX)}},[c]),d=(0,B.useCallback)(e=>{i.current=!1;try{e.currentTarget.releasePointerCapture?.(e.pointerId)}catch{}},[]);return{asideRef:r,effectiveMaxWidth:o,effectiveWidth:a,showResizeHandle:s,resizeHandleProps:{onKeyDown:(0,B.useCallback)(e=>{if(n&&!(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`&&e.key!==`Home`&&e.key!==`End`)){if(e.preventDefault(),e.key===`Home`){n(220);return}if(e.key===`End`){n(zt());return}n(Bt(a+(e.key===`ArrowLeft`?-1:1)*(e.shiftKey?48:16)))}},[a,n]),onPointerCancel:d,onPointerDown:l,onPointerMove:u,onPointerUp:d}}}function Wa({projects:e,selection:t,connected:n,portsByProjectId:r,projectNames:i,onOpenUrl:a,width:o=288,fill:s=!1,resizable:c=!1,onWidthChange:l,onSelectMonitor:u,onSelectWorktree:d,onSelectChild:f,onOpenContainer:p,onToggleChildPin:m,onNewProject:g,onOpenSettings:_,searchOpen:v=!1,searchQuery:y=``,onToggleSearch:b,onCloseSearch:x,onSearchQueryChange:S,pinnedMonitorCount:C=0,onReorderProjects:w,onReorderPanes:T,reorderResetSignal:E,pendingProjectReorderCount:D}){let O=(0,B.useDeferredValue)(y).trim(),k=v&&O.length>0,ee=(0,B.useMemo)(()=>k?Ha(e,O):e,[k,e,O]),{asideRef:A,effectiveMaxWidth:j,effectiveWidth:te,resizeHandleProps:ne,showResizeHandle:M}=Ua({onWidthChange:l,resizable:c,width:o});return(0,V.jsxs)(`aside`,{ref:A,"aria-label":`Workspace navigation`,className:`relative flex h-full min-h-0 shrink-0 flex-col bg-bg-secondary text-text-primary ${s?`w-full`:`border-r border-border`}`,style:s?void 0:{width:te},children:[(0,V.jsxs)(`div`,{className:`cm-scroll min-h-0 flex-1 overflow-y-auto pb-2.5`,children:[(0,V.jsx)(tn,{selected:t.monitor,pinnedCount:C,onClick:u}),k?ee.length===0?(0,V.jsxs)(`div`,{className:`${Ht[0]} py-6 text-center text-xs text-text-secondary`,children:[`No matches for`,` `,(0,V.jsxs)(`span`,{className:`text-text-primary`,children:[`"`,O,`"`]})]}):(0,V.jsx)(`div`,{children:ee.map(e=>(0,V.jsx)(Pa,{project:e,selection:t,forceOpen:!0,onSelectWorktree:d,onSelectChild:f,onOpenContainer:p,onToggleChildPin:m},e.id))}):(0,V.jsx)(Ba,{projects:ee,selection:t,resetSignal:E,pendingReorderCount:D,onReorderProjects:w??(()=>{}),onSelectWorktree:d,onSelectChild:f,onOpenContainer:p,onToggleChildPin:m,onReorderPanes:T}),g&&(0,V.jsx)(`div`,{className:`${Ht[0]} mt-2`,children:(0,V.jsxs)(`button`,{type:`button`,onClick:g,className:`flex h-bar w-full items-center justify-center gap-2 rounded-control border border-dashed border-border text-sm text-text-secondary hover:border-accent/60 hover:text-text-primary`,children:[(0,V.jsx)(h.add,{}),(0,V.jsx)(`span`,{children:`New Project`})]})})]}),v&&(0,V.jsx)(za,{query:y,onClose:x,onQueryChange:S}),(0,V.jsx)(Ra,{connected:n,portsByProjectId:r,projectNames:i,onOpenUrl:a,onOpenSettings:_,onNewProject:g,searchOpen:v,onToggleSearch:b}),M&&(0,V.jsx)(`hr`,{"aria-label":`Resize sidebar`,"aria-orientation":`vertical`,"aria-valuemin":220,"aria-valuemax":j,"aria-valuenow":te,tabIndex:0,...ne,className:`cm-sidebar-resizer absolute top-0 right-0 bottom-0 z-[3] w-px cursor-col-resize touch-none bg-border before:absolute before:inset-y-0 before:-inset-x-3 before:content-[''] focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent`})]})}var Ga=null,Ka=new Set,qa=0,Ja=null;function Ya(){for(let e of Ka)e()}function Xa(e){return Ka.add(e),()=>{Ka.delete(e)}}function Za(){return Ga}function Qa(e,t=1800){qa+=1,Ga={message:e,seq:qa},Ja&&clearTimeout(Ja),Ja=setTimeout(()=>{Ga=null,Ja=null,Ya()},t),Ya()}function $a(){return(0,B.useSyncExternalStore)(Xa,Za,()=>null)}function eo(){let e=$a();return e?(0,V.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`cm-mono pointer-events-none fixed bottom-[max(env(safe-area-inset-bottom,0px),16px)] left-1/2 z-[60] -translate-x-1/2 rounded-window border border-border bg-bg-secondary px-3 py-1.5 text-sm text-text-primary shadow-[0_8px_24px_rgba(0,0,0,0.35)]`,children:e.message},e.seq):null}var to=5e3;function no({connected:e}){let[t,n]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{if(e){n(!1);return}let t=setTimeout(()=>n(!0),to);return()=>clearTimeout(t)},[e]),t?(0,V.jsx)(ro,{}):null}function ro({onReload:e=()=>window.location.reload()}){let t=(0,B.useRef)(null),n=(0,B.useRef)(null);return(0,B.useEffect)(()=>{let e=document.activeElement;n.current=e instanceof HTMLElement&&e!==document.body&&e!==document.documentElement?e:null,t.current?.focus();let r=e=>{let n=t.current;if(n&&e.target instanceof Node&&n.contains(e.target)){if(e.key===`Tab`){e.preventDefault();return}if((e.key===`Enter`||e.key===` `)&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey)return}e.stopPropagation(),e.preventDefault()};return document.addEventListener(`keydown`,r,!0),document.addEventListener(`keyup`,r,!0),()=>{document.removeEventListener(`keydown`,r,!0),document.removeEventListener(`keyup`,r,!0);let e=n.current;n.current=null,e&&document.contains(e)&&typeof e.focus==`function`&&e.focus()}},[]),(0,V.jsxs)(m,{open:!0,ariaLabelledBy:`offline-title`,dialogRole:`alertdialog`,onClose:()=>void 0,closeOnBackdrop:!1,closeOnEscape:!1,backdropClassName:`bg-black/50 p-6 backdrop-blur-sm`,widthClassName:`w-surface-sm max-w-full`,panelClassName:`flex flex-col overflow-hidden`,panelTabIndex:-1,onPanelContextMenu:e=>e.preventDefault(),children:[(0,V.jsx)(`div`,{"aria-hidden":!0,className:`h-1 shrink-0 bg-danger`}),(0,V.jsxs)(`div`,{className:`flex flex-col gap-2 px-4 py-3.5`,children:[(0,V.jsx)(`span`,{className:`cm-mono self-start text-xs font-bold uppercase tracking-[0.08em] text-danger`,children:`OFFLINE`}),(0,V.jsx)(`h2`,{id:`offline-title`,className:`text-sm font-semibold text-text-primary`,children:`Connection lost`}),(0,V.jsx)(`p`,{className:`text-sm leading-[1.55] text-text-secondary`,children:`Trying to reconnect…`}),(0,V.jsx)(d,{children:(0,V.jsx)(S,{ref:t,variant:`primary`,onClick:e,children:`Reload`})})]})]})}function io(){let[e,t]=(0,B.useState)([]);(0,B.useEffect)(()=>{let e=!1;return(async()=>{try{let n=await O(`/api/notices`);if(!n.ok)return;let r=await n.json();e||t(r.notices??[])}catch{}})(),()=>{e=!0}},[]);let n=(0,B.useCallback)(async e=>{t(t=>t.filter(t=>t.kind!==e));try{await O(`/api/notices/${e}`,{method:`DELETE`})}catch{}},[]);return e.length===0?null:(0,V.jsx)(`div`,{className:`flex flex-col`,children:e.map(e=>(0,V.jsx)(ao,{notice:e,onDismiss:()=>void n(e.kind)},e.kind))})}function ao({notice:e,onDismiss:t}){let n=oo(e);return(0,V.jsxs)(`div`,{role:`status`,className:`flex items-center gap-3 border-b border-border bg-warning/10 px-4 py-2 text-sm text-text-primary`,children:[(0,V.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 shrink-0 rounded-full bg-warning`}),(0,V.jsx)(`p`,{className:`flex-1 leading-snug`,children:n}),(0,V.jsx)(a,{kind:`dismiss`,size:`sm`,onClick:t,children:`Dismiss`})]})}function oo(e){switch(e.kind){case`daemon-auto-restarted`:return`セッションがリセットされました -- parasor が新しいバージョンに更新されたため、走行中だったターミナルセッションは終了しています。`}}var so={toasts:[]},G=new Set,K=new Map,co=0;function lo(){for(let e of G)e()}function uo(e){return G.add(e),()=>{G.delete(e)}}function fo(){return so}function po(e){let t=K.get(e);t&&(clearTimeout(t),K.delete(e))}function mo(e,t){po(e),K.set(e,setTimeout(()=>{go(e)},t))}function ho(e){let t=e.id??`sync-${++co}`,n={id:t,tone:e.tone,title:e.title,...e.sub!==void 0&&{sub:e.sub},...e.mono!==void 0&&{mono:e.mono},...e.actions!==void 0&&{actions:e.actions}},r=so.toasts.findIndex(e=>e.id===t);return so={toasts:r===-1?[...so.toasts,n]:so.toasts.map((e,t)=>t===r?n:e)},e.durationMs===void 0?po(t):mo(t,e.durationMs),lo(),t}function go(e){po(e),so.toasts.some(t=>t.id===e)&&(so={toasts:so.toasts.filter(t=>t.id!==e)},lo())}function _o(){return(0,B.useSyncExternalStore)(uo,fo,()=>so).toasts}var vo={info:`bg-accent`,working:`bg-warning`,ok:`bg-success`,err:`bg-danger`};function yo(){let e=_o();return e.length===0?null:(0,V.jsx)(`section`,{"aria-label":`sync status`,className:`pointer-events-none fixed right-[max(env(safe-area-inset-right,0px),16px)] bottom-[max(env(safe-area-inset-bottom,0px),16px)] z-[55] flex w-[min(var(--spacing-surface-sm),calc(100vw-32px))] flex-col gap-2`,children:e.map(e=>(0,V.jsx)(bo,{toast:e},e.id))})}function bo({toast:e}){return(0,V.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`pointer-events-auto flex items-start gap-2.5 rounded-window border border-border bg-bg-secondary px-3 py-2.5 shadow-[0_8px_24px_rgba(0,0,0,0.35)]`,children:[(0,V.jsx)(`span`,{"aria-hidden":!0,className:`mt-[5px] h-2 w-2 flex-none rounded-tag ${vo[e.tone]} ${e.tone===`working`?`animate-pulse`:``}`}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`div`,{className:`text-sm font-semibold tracking-[-0.005em] text-text-primary`,children:e.title}),e.sub&&(0,V.jsx)(`div`,{className:`mt-0.5 text-xs text-text-secondary ${e.mono?`cm-mono`:``}`,children:e.sub}),e.actions&&e.actions.length>0&&(0,V.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:e.actions.map(e=>(0,V.jsx)(a,{kind:e.kind===`primary`?`submit`:`normal`,size:`xs`,onClick:e.onSelect,children:e.label},`${e.kind??`ghost`}:${e.label}`))})]}),(0,V.jsx)(`button`,{type:`button`,"aria-label":`Dismiss`,onClick:()=>go(e.id),className:`-m-1 p-1 text-text-secondary hover:text-text-primary`,children:(0,V.jsx)(h.close,{})})]})}function xo({pinned:e,onToggle:t}){return(0,V.jsx)(_,{label:e?`Unpin from Monitor`:`Pin to Monitor`,title:e?`Pinned to Monitor -- click to unpin`:`Pin to Monitor`,size:`md`,tone:e?`accent`:`normal`,pressed:e,onClick:t,children:(0,V.jsx)(h.pin,{})})}function So(e,t,n){let r=new Map;for(let t of e)r.set(t.id,t);let i=t.filter(e=>e.pinned===!0);return i.sort((e,t)=>{let n=r.get(e.projectId)?.name??``,i=r.get(t.projectId)?.name??``;return n===i?e.createdAt-t.createdAt:n.localeCompare(i)}),i.map(e=>{let t=r.get(e.projectId),i=t?n?.[t.id]?.[t.path]?.isRepo!==!1:!0,a=Co(e.cwd,t?.path,i);return{session:e,project:t,worktreeName:a,label:t?`${t.name} / ${a}`:a,crumb:e.cwd}})}function Co(e,t,n){if(t&&e===t)return n?`main`:`root`;let r=e.replace(/\/+$/,``).split(`/`).pop();return r&&r.length>0?r:e}var wo=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),To=function(e){return`/`+e},Eo={},Do=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=To(t,n),t in Eo)return;Eo[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:wo,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Oo=(0,B.lazy)(()=>Do(async()=>{let{TerminalPane:e}=await import(`./TerminalPane-CjbYzePr.js`);return{TerminalPane:e}},__vite__mapDeps([0])).then(({TerminalPane:e})=>({default:e}))),ko=320,Ao=1200,jo=420,Mo=`parasor:monitor-col-widths`;function No(e){return Number.isNaN(e)?jo:Math.min(Ao,Math.max(ko,Math.round(e)))}function Po(){try{let e=localStorage.getItem(Mo);if(!e)return{};let t=JSON.parse(e);if(!t||typeof t!=`object`||Array.isArray(t))return{};let n={};for(let[e,r]of Object.entries(t))typeof r==`number`&&(n[e]=No(r));return n}catch{return{}}}function Fo(e){try{localStorage.setItem(Mo,JSON.stringify(e))}catch{}}function Io({projects:e,sessions:t,agentStates:n,reviewPendingSessions:r,gitStates:i,attentionDismissed:a,isMobile:o,onToggleDrawer:s,onRestartSession:c,onOpenUrl:l,onTogglePin:u}){let d=(0,B.useMemo)(()=>So(e,t,i),[e,t,i]),f=(0,B.useMemo)(()=>{let e=a??{},t=new Map;for(let i of d){let a=n[i.session.id],o=Ct(a,e)?void 0:a?.lifecycle;t.set(i.session.id,qo(o,r.has(i.session.id)))}return t},[d,n,r,a]),p=(0,B.useMemo)(()=>{let e=0,t=0;for(let n of f.values())n===`attention`?e+=1:n===`working`&&(t+=1);return{attention:e,working:t}},[f]),[m,h]=(0,B.useState)(null),g=(0,B.useMemo)(()=>{if(!m)return 0;let e=d.findIndex(e=>e.session.id===m);return e<0?0:e},[d,m]);return(0,V.jsxs)(`section`,{className:`flex h-full min-h-0 w-full flex-col bg-bg-primary`,children:[(0,V.jsx)(Lo,{attention:p.attention,working:p.working,isMobile:o,onToggleDrawer:s,entries:d,focusedIndex:g,onGoToIndex:e=>{let t=d[Math.max(0,Math.min(d.length-1,e))];t&&h(t.session.id)}}),d.length===0?(0,V.jsx)(Ko,{}):o?(0,V.jsx)(Go,{entries:d,statuses:f,focusedIndex:g,onFocusSession:h,onRestartSession:c,onOpenUrl:l,onTogglePin:u}):(0,V.jsx)(zo,{entries:d,statuses:f,focusedSessionId:m??d[g]?.session.id??null,focusedIndex:g,onFocusSession:h,onRestartSession:c,onOpenUrl:l,onTogglePin:u})]})}function Lo({attention:e,working:t,isMobile:n,onToggleDrawer:r,entries:i,focusedIndex:a,onGoToIndex:o}){let s=i.length;return(0,V.jsxs)(`header`,{className:`flex h-bar shrink-0 items-center gap-2.5 border-b border-border bg-pane-header-bg px-3`,children:[n&&r&&(0,V.jsx)(_,{onClick:r,label:`Go to sessions`,size:`md`,children:(0,V.jsx)(h.menu,{})}),(0,V.jsx)(`span`,{className:`text-sm font-semibold tracking-[-0.005em] text-text-primary`,children:`Monitor`}),(0,V.jsxs)(`div`,{className:`cm-mono flex items-center gap-2 text-sm text-text-secondary`,children:[e>0&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,V.jsx)(u,{state:`attention`}),(0,V.jsx)(`span`,{children:e})]}),t>0&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,V.jsx)(u,{state:`working`}),(0,V.jsx)(`span`,{children:t})]})]}),(0,V.jsx)(`span`,{className:`flex-1`}),s>0&&(0,V.jsx)(Ro,{entries:i,focusedIndex:a,onGoToIndex:o})]})}function Ro({entries:e,focusedIndex:t,onGoToIndex:n}){let r=e.length,i=t<=0,a=t>=r-1;return(0,V.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,V.jsx)(_,{onClick:()=>n(t-1),disabled:i,label:`Previous pinned terminal`,children:(0,V.jsx)(h.back,{})}),(0,V.jsx)(`div`,{className:`flex items-center gap-[5px]`,children:e.map((e,r)=>(0,V.jsx)(`button`,{type:`button`,onClick:()=>n(r),"aria-label":`Go to pinned terminal ${r+1}`,"aria-current":r===t?`true`:void 0,className:`h-[5px] cursor-pointer rounded-control transition-all ${r===t?`w-3.5 bg-accent`:`w-[5px] bg-text-secondary/35 hover:bg-text-secondary/60`}`},e.session.id))}),(0,V.jsx)(_,{onClick:()=>n(t+1),disabled:a,label:`Next pinned terminal`,children:(0,V.jsx)(`span`,{className:`rotate-180 inline-flex`,children:(0,V.jsx)(h.back,{})})})]})}function zo({entries:e,statuses:t,focusedSessionId:n,focusedIndex:r,onFocusSession:i,onRestartSession:a,onOpenUrl:o,onTogglePin:s}){let c=Math.max(0,e.length-3),l=(0,B.useRef)([]);(0,B.useEffect)(()=>{let e=l.current[r];e&&e.scrollIntoView({behavior:`smooth`,inline:`nearest`,block:`nearest`})},[r,n]);let[u,d]=(0,B.useState)(Po);(0,B.useEffect)(()=>{let e=setTimeout(()=>Fo(u),200);return()=>clearTimeout(e)},[u]);let f=(0,B.useCallback)((e,t)=>{d(n=>{let r=No(t);return n[e]===r?n:{...n,[e]:r}})},[]);return(0,V.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,V.jsx)(`div`,{className:`cm-scroll absolute inset-0 flex flex-row items-stretch justify-start overflow-x-auto overflow-y-hidden`,children:e.map((e,r)=>{let c=u[e.session.id]??jo;return(0,V.jsx)(Bo,{ref:e=>{l.current[r]=e},entry:e,status:t.get(e.session.id)??`idle`,focused:n===e.session.id,width:c,onFocus:()=>i(e.session.id),onResize:t=>f(e.session.id,t),onRestartSession:a,onOpenUrl:o,onTogglePin:s},e.session.id)})}),c>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute top-0 right-0 bottom-0 w-14`,style:{background:`linear-gradient(to right, transparent, var(--color-bg-primary))`}}),(0,V.jsxs)(`div`,{"aria-hidden":!0,className:`cm-mono pointer-events-none absolute top-2 right-2 rounded-tag border border-border bg-bg-tertiary px-2 py-px text-xs text-text-secondary`,children:[`->`,` `,c,` more`]})]})]})}function Bo({ref:e,entry:t,status:n,focused:r,width:i,onFocus:a,onResize:o,onRestartSession:s,onOpenUrl:c,onTogglePin:l}){let u=`Resize column for ${wt(t.session)}`;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{ref:e,className:`relative flex h-full shrink-0 flex-col overflow-hidden border-r border-border bg-bg-primary`,style:{width:`${i}px`},onPointerDownCapture:a,onFocusCapture:a,children:[(0,V.jsx)(Uo,{entry:t,status:n,onTogglePin:l}),(0,V.jsx)(`div`,{className:`min-h-0 flex-1 touch-pan-y`,children:(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(`div`,{className:`h-full bg-bg-terminal`}),children:(0,V.jsx)(Oo,{paneId:`monitor:${t.session.id}`,sessionId:t.session.id,session:t.session,onRestartSession:s,onOpenUrl:c})})}),r&&(0,V.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0 border-2 border-accent`})]}),(0,V.jsx)(Vo,{width:i,onResize:o,ariaLabel:u})]})}function Vo({width:e,onResize:t,ariaLabel:n}){let r=(0,B.useRef)(!1),i=(0,B.useRef)(0),a=(0,B.useRef)(e),o=(0,B.useCallback)(e=>{if(r.current=!1,e)try{e.target.releasePointerCapture(e.pointerId)}catch{}},[]);return(0,V.jsx)(`hr`,{"aria-label":n,"aria-orientation":`vertical`,"aria-valuenow":e,"aria-valuemin":ko,"aria-valuemax":Ao,tabIndex:0,onPointerDown:(0,B.useCallback)(t=>{t.preventDefault(),t.target.setPointerCapture(t.pointerId),r.current=!0,i.current=t.clientX,a.current=e},[e]),onPointerMove:(0,B.useCallback)(e=>{if(r.current){if(e.buttons===0){o(e);return}t(a.current+(e.clientX-i.current))}},[t,o]),onPointerUp:o,onPointerCancel:o,onKeyDown:(0,B.useCallback)(n=>{n.key!==`ArrowLeft`&&n.key!==`ArrowRight`||(n.preventDefault(),t(e+(n.key===`ArrowLeft`?-1:1)*(n.shiftKey?50:10)))},[t,e]),style:{touchAction:`none`},className:`cm-split-resizer relative z-[2] w-px shrink-0 cursor-col-resize bg-border before:absolute before:inset-y-0 before:-inset-x-3 before:content-[''] focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent`})}function Ho({entry:e,status:t,onFocus:n,onRestartSession:r,onOpenUrl:i,onTogglePin:a}){return(0,V.jsxs)(`div`,{className:`relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-bg-primary`,onPointerDownCapture:n,onFocusCapture:n,children:[(0,V.jsx)(Uo,{entry:e,status:t,onTogglePin:a}),(0,V.jsx)(`div`,{className:`min-h-0 flex-1 touch-pan-y`,children:(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(`div`,{className:`h-full bg-bg-terminal`}),children:(0,V.jsx)(Oo,{paneId:`monitor:${e.session.id}`,sessionId:e.session.id,session:e.session,onRestartSession:r,onOpenUrl:i})})})]})}function Uo({entry:e,status:t,onTogglePin:n}){return(0,V.jsxs)(`div`,{className:`flex h-bar shrink-0 items-center gap-2 border-b border-border bg-pane-header-bg px-3`,children:[(0,V.jsx)(Wo,{entry:e}),t!==`idle`&&(0,V.jsx)(u,{state:t}),(0,V.jsx)(xo,{pinned:!0,onToggle:()=>void n(e.session.id)})]})}function Wo({entry:e}){let t=e.project?.name??``,n=e.worktreeName,r=wt(e.session);return(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1.5`,children:[(0,V.jsx)(`span`,{className:`cm-mono min-w-0 flex-shrink truncate text-sm text-text-secondary/85`,title:t,children:t}),(0,V.jsx)(`span`,{"aria-hidden":!0,className:`text-text-secondary/40`,children:`/`}),(0,V.jsx)(`span`,{className:`cm-mono min-w-0 flex-shrink truncate text-sm text-text-secondary/85`,title:n,children:n}),(0,V.jsx)(`span`,{"aria-hidden":!0,className:`text-text-secondary/40`,children:`/`}),(0,V.jsx)(`span`,{className:`cm-mono min-w-0 flex-shrink truncate text-sm font-semibold text-text-primary`,title:r,children:r})]})}function Go({entries:e,statuses:t,focusedIndex:n,onFocusSession:r,onRestartSession:i,onOpenUrl:a,onTogglePin:o}){let s=e[n];return s?(0,V.jsx)(`div`,{className:`flex min-h-0 flex-1`,children:(0,V.jsx)(Ho,{entry:s,status:t.get(s.session.id)??`idle`,onFocus:()=>r(s.session.id),onRestartSession:i,onOpenUrl:a,onTogglePin:o})}):null}function Ko(){return(0,V.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center bg-bg-primary p-8 text-center`,children:(0,V.jsxs)(`div`,{className:`max-w-md`,children:[(0,V.jsx)(`div`,{className:`mb-2 text-sm font-semibold text-text-primary`,children:`No pinned terminals yet`}),(0,V.jsxs)(`p`,{className:`cm-mono text-sm leading-relaxed text-text-secondary`,children:[`Tap the`,` `,(0,V.jsx)(`span`,{className:`inline-flex translate-y-[2px] items-center text-accent`,children:(0,V.jsx)(h.pin,{})}),` `,`icon in a terminal header to surface it here. Monitor gives you a live tail of every pinned session across projects at once.`]})]})})}function qo(e,t){return t?`review`:e===`waiting`?`attention`:e===`running`?`working`:`idle`}async function Jo(e){let t=await O(`/api/service-config`,{method:`PATCH`,headers:{"Content-Type":`application/json`},credentials:`same-origin`,body:JSON.stringify(e)});if(!t.ok)throw Error(`Failed to update service config: ${t.status}`)}function Yo(e){let t=Object.keys(e)[0]??`service config`;Jo(e).catch(e=>{console.warn(`Failed to update ${t}:`,e)})}var Xo=`parasor:shell-ratio:workspace`,Zo=24,Qo=240,$o=520,es=45;function ts(e,t){if(!Number.isFinite(e))return Zo;let n=12,r=es;return t&&t>0&&(n=Math.max(n,Qo/t*100),r=Math.min(r,$o/t*100)),Math.min(r,Math.max(n,e))}function ns(){try{let e=localStorage.getItem(Xo);if(!e)return Zo;let t=JSON.parse(e);return typeof t==`number`?ts(t):Zo}catch{return Zo}}function rs(e){try{localStorage.setItem(Xo,JSON.stringify(e))}catch{}}function is({navigation:e,main:t}){let[n,r]=(0,B.useState)(ns),i=(0,B.useRef)(null),a=(0,B.useRef)(!1);(0,B.useEffect)(()=>{rs(n)},[n]);let o=(0,B.useCallback)(e=>{let t=i.current?.getBoundingClientRect().width;r(ts(e,t))},[]),s=(0,B.useMemo)(()=>({width:`${n}%`,minWidth:`${Qo}px`,maxWidth:`${$o}px`}),[n]),c=(0,B.useCallback)(e=>{e.preventDefault(),e.currentTarget.setPointerCapture?.(e.pointerId),a.current=!0},[]),l=(0,B.useCallback)(e=>{if(!a.current)return;if(e.buttons===0){a.current=!1;return}let t=i.current?.getBoundingClientRect();t&&o((e.clientX-t.left)/t.width*100)},[o]),u=(0,B.useCallback)(e=>{a.current=!1;try{e.currentTarget.releasePointerCapture?.(e.pointerId)}catch{}},[]),d=(0,B.useCallback)(e=>{if(!(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`&&e.key!==`Home`&&e.key!==`End`)){if(e.preventDefault(),e.key===`Home`){o(0);return}if(e.key===`End`){o(100);return}o(n+(e.key===`ArrowLeft`?-1:1)*(e.shiftKey?5:1))}},[n,o]);return(0,V.jsxs)(`div`,{ref:i,className:`flex h-full min-w-0 flex-1 flex-row overflow-hidden`,children:[(0,V.jsx)(`div`,{className:`min-w-0 overflow-hidden bg-bg-secondary`,style:s,children:e}),(0,V.jsx)(`hr`,{"aria-label":`Resize navigation pane`,"aria-orientation":`vertical`,"aria-valuenow":Math.round(n),"aria-valuemin":0,"aria-valuemax":100,tabIndex:0,onPointerDown:c,onPointerMove:l,onPointerUp:u,onPointerCancel:u,onKeyDown:d,className:`cm-split-resizer relative z-[2] w-px shrink-0 cursor-col-resize bg-border before:absolute before:inset-y-0 before:-inset-x-3 before:content-[''] focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent`}),(0,V.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-1 overflow-hidden`,children:t})]})}function as({paneTitle:t,paneKind:n,onCancel:r,onConfirm:i}){let a=n===`terminal`?`The shell session will terminate.`:`The browser tab state will be lost.`;return(0,V.jsxs)(e,{ariaLabel:`Close ${t}`,confirmLabel:`Close`,confirmVariant:`danger`,onCancel:r,onConfirm:i,children:[`Close `,(0,V.jsx)(`strong`,{children:t}),`? `,a]})}async function os(e){let t=await O(`/api/pane-commands`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({commands:e})});if(!t.ok)throw Error(`Failed to save commands`);return await t.json()}async function ss(e){let t=await O(`/api/ide-commands`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({commands:e})});if(!t.ok)throw Error(`Failed to save IDE commands`);return await t.json()}function cs({projectName:t,onCancel:n,onConfirm:r}){return(0,V.jsxs)(e,{ariaLabel:`Close project ${t}`,confirmLabel:`Close`,confirmVariant:`primary`,onCancel:n,onConfirm:r,children:[`Close `,(0,V.jsx)(`strong`,{children:t}),`? All sessions in this project will terminate and its layout will be cleared. The directory itself will not be deleted.`]})}async function ls(e){let t=await O(`/api/sessions`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({projectId:e.projectId,...e.command&&{command:e.command},...e.title&&{title:e.title},...e.cwd&&{cwd:e.cwd},...e.bootstrapInput&&{bootstrapInput:e.bootstrapInput}})});return t.ok?await t.json():null}async function us(e){await O(`/api/sessions/${e}/restart`,{method:`POST`})}async function ds(e,t){await O(`/api/sessions/${e}/title`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:t})})}async function fs(e,t){await O(`/api/sessions/${e}/pin`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pinned:t})})}async function ps(e){await O(`/api/sessions/${e}`,{method:`DELETE`})}var ms=4e3;function hs({activeProjectId:e,playAttentionSound:t,playCompletionSound:n,priorLifecycle:r,projectId:i,state:a}){return!i||i===e||a.confidence!==`high`?null:a.lifecycle===`waiting`?!t||r===`waiting`?null:`attention`:a.lifecycle===`completed`?!n||r===`completed`?null:`completion`:null}function gs({activeProjectId:e,agentStates:t,snapshotApplied:n,playAttentionSound:r,playCompletionSound:i,sessions:a}){let o=(0,B.useRef)(!1),s=(0,B.useRef)({}),c=(0,B.useRef)(new Map),l=(0,B.useRef)(null);(0,B.useEffect)(()=>{if(!r&&!i||typeof window>`u`)return;let e=()=>{let e=_s(l);e&&e.state===`suspended`&&e.resume().catch(()=>{})};return window.addEventListener(`pointerdown`,e,{passive:!0}),window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,e)}},[r,i]),(0,B.useEffect)(()=>{let u={};for(let[e,n]of Object.entries(t))u[e]=n.lifecycle;if(!n){s.current=u;return}if(!o.current){o.current=!0,s.current=u;return}let d=new Map(a.map(e=>[e.id,e])),f=Date.now();for(let[n,a]of Object.entries(t)){let t=hs({activeProjectId:e,playAttentionSound:r,playCompletionSound:i,priorLifecycle:s.current[n],projectId:d.get(n)?.projectId??null,state:a});if(!t)continue;let o=`${n}:${t}`;if(f-(c.current.get(o)??0)<ms)continue;let u=_s(l);!u||u.state!==`running`||(vs(u,t),c.current.set(o,f))}s.current=u},[e,t,n,r,i,a])}function _s(e){if(e.current)return e.current;if(typeof window>`u`)return null;let t=window,n=t.AudioContext??t.webkitAudioContext;return n?(e.current=new n,e.current):null}function vs(e,t){let n=e.currentTime+.01;if(t===`attention`){ys(e,n,880,.08,.035),ys(e,n+.14,988,.12,.04);return}ys(e,n,659,.1,.03),ys(e,n+.12,880,.16,.035)}function ys(e,t,n,r,i){let a=e.createOscillator(),o=e.createGain();a.type=`sine`,a.frequency.setValueAtTime(n,t),o.gain.setValueAtTime(1e-4,t),o.gain.exponentialRampToValueAtTime(i,t+.02),o.gain.exponentialRampToValueAtTime(1e-4,t+r),a.connect(o),o.connect(e.destination),a.start(t),a.stop(t+r+.02)}function bs(e){try{return mt(window.localStorage.getItem(ft(e)))}catch{return{}}}function xs(e,t){try{window.localStorage.setItem(ft(e),JSON.stringify(t))}catch{}}function Ss(){return typeof crypto<`u`&&`randomUUID`in crypto?`browser:${crypto.randomUUID()}`:`browser:${Math.random().toString(36).slice(2,10)}-${Date.now()}`}function Cs(e){let[t,n]=(0,B.useState)(()=>e?bs(e):{}),r=(0,B.useRef)(e);(0,B.useEffect)(()=>{r.current!==e&&(r.current=e,n(e?bs(e):{}))},[e]),(0,B.useEffect)(()=>{e&&xs(e,t)},[e,t]);let i=(0,B.useCallback)((t,r)=>{if(!e||!pt(r))return null;let i=Ss();return n(e=>{let n=e[t]??[];return{...e,[t]:[...n,{id:i,url:r}]}}),i},[e]),a=(0,B.useCallback)(e=>{n(t=>{let n={},r=!1;for(let[i,a]of Object.entries(t)){let t=a.filter(t=>t.id!==e);t.length!==a.length&&(r=!0),t.length>0&&(n[i]=t)}return r?n:t})},[]),o=(0,B.useCallback)((e,t)=>{pt(t)&&n(n=>{let r=!1,i={};for(let[a,o]of Object.entries(n))i[a]=o.map(n=>n.id!==e||n.url===t?n:(r=!0,{...n,url:t}));return r?i:n})},[]);return{panesByWorktree:(0,B.useMemo)(()=>t,[t]),addBrowser:i,closeBrowser:a,updateBrowserUrl:o}}function ws({onConfirm:e}){let[t,n]=(0,B.useState)(null);return{target:t,request:(0,B.useCallback)((e,t,r)=>{n({paneId:e,paneKind:t,title:r})},[]),cancel:(0,B.useCallback)(()=>{n(null)},[]),confirm:(0,B.useCallback)(async()=>{let r=t;r&&(n(null),await e(r))},[t,e])}}function Ts(e,t,n){return e===t?n?`main`:`root`:e.replace(/\/+$/,``).split(`/`).pop()??e}function Es({projects:e,gitStates:t}){let[n,r]=(0,B.useState)(null),i=(0,B.useCallback)((e,t)=>{r({projectId:e,worktreeId:t,worktreePath:t.startsWith(`wt:`)?t.slice(3):t})},[]),a=(0,B.useCallback)(()=>{r(null)},[]);return{target:n,context:(0,B.useMemo)(()=>{if(!n)return null;let r=e.find(e=>e.id===n.projectId);if(!r)return null;let i=t[r.id]?.[r.path]?.isRepo!==!1,a=Ts(n.worktreePath,r.path,i);return{project:{id:r.id,name:r.name,path:r.path},worktree:{id:n.worktreeId,name:a,path:n.worktreePath}}},[n,e,t]),open:i,close:a}}function Ds(e=5e3){let[t,n]=(0,B.useState)(null);return(0,B.useEffect)(()=>{if(!t)return;let r=window.setTimeout(()=>n(null),e);return()=>window.clearTimeout(r)},[t,e]),[t,n]}function Os(e){let[t,n]=(0,B.useState)(null),r=(0,B.useRef)(e);return(0,B.useEffect)(()=>{r.current!==e&&(r.current=e,n(null))},[e]),[t,n]}var ks=class extends Error{constructor(e,t){super(e),this.status=t,this.name=`GitOperationError`}};async function As(e,t){await js(e,`POST`,t)}async function js(e,t,n){let r=await O(e,{method:t,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)});if(!r.ok)throw new ks((await r.json().catch(()=>({}))).error??`Request failed (${r.status})`,r.status)}async function Ms(e,t){let n=`worktreePath=${encodeURIComponent(e.worktreePath)}`,r=`/api/projects/${encodeURIComponent(e.projectId)}/diff`,i=await O(e.sha?`${r}?sha=${encodeURIComponent(e.sha)}&${n}`:`${r}?${n}`,{signal:t});return i.ok?(await i.json()).diff:null}function Ns(e){return As(`/api/projects/${encodeURIComponent(e.projectId)}/git/commit`,{worktreePath:e.worktreePath,message:e.message,paths:e.paths})}function Ps(e){return As(`/api/projects/${encodeURIComponent(e.projectId)}/git/push`,{worktreePath:e.worktreePath,...e.setUpstream===!0&&{setUpstream:!0}})}function Fs(e){return As(`/api/projects/${encodeURIComponent(e.projectId)}/git/pull`,{worktreePath:e.worktreePath,...e.rebase===!0&&{rebase:!0}})}function Is(e){return As(`/api/projects/${encodeURIComponent(e.projectId)}/git/fetch`,{worktreePath:e.worktreePath})}function Ls(e){return As(`/api/projects/${encodeURIComponent(e.projectId)}/git/switch`,{worktreePath:e.worktreePath,branch:e.branch})}function Rs(e){return As(`/api/projects/${encodeURIComponent(e.projectId)}/git/branch`,{worktreePath:e.worktreePath,branch:e.branch,startPoint:e.startPoint})}async function zs(e){let t=new URLSearchParams({worktreePath:e.worktreePath});e.limit!==void 0&&t.set(`limit`,String(e.limit)),e.skip!==void 0&&e.skip>0&&t.set(`skip`,String(e.skip)),e.includeRemotes&&t.set(`includeRemotes`,`1`);let n=await O(`/api/projects/${encodeURIComponent(e.projectId)}/git/log?${t.toString()}`,{signal:e.signal});if(!n.ok)throw new ks((await n.json().catch(()=>({}))).error??`Request failed (${n.status})`,n.status);return await n.json()}function Bs(e){return As(`/api/projects/${encodeURIComponent(e)}/git/init`,{})}function Vs(e){return As(`/api/projects/${encodeURIComponent(e.projectId)}/worktrees/open-os`,{worktreePath:e.worktreePath})}async function Hs(){let e=await O(`/api/projects/local-ide-capability`);if(!e.ok)throw new ks((await e.json().catch(()=>({}))).error??`Request failed (${e.status})`,e.status);return{canOpenLocalIde:(await e.json()).canOpenLocalIde===!0}}function Us(e){return As(`/api/projects/${encodeURIComponent(e.projectId)}/worktrees/open-ide`,{worktreePath:e.worktreePath,editor:e.editor})}function Ws(e){return js(`/api/projects/${encodeURIComponent(e.projectId)}/worktrees`,`PATCH`,{worktreePath:e.worktreePath,newBranch:e.newBranch})}function Gs(e){return js(`/api/projects/${encodeURIComponent(e.projectId)}/worktrees`,`DELETE`,{worktreePath:e.worktreePath,...e.force===!0&&{force:!0}})}function Ks({activeProjectId:e,focusedWorktreePath:t,focusedWorktreeName:n,gitState:r}){let[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)(!1),[c,l]=(0,B.useState)(null),u=r?.ahead??0,d=r?.behind??0,f=r?.branch??n??null,p=(0,B.useRef)(null),m=(0,B.useCallback)(()=>{o||(a(null),l(null))},[o]),h=(0,B.useCallback)(async function(e,t,n,r){s(!0),l(null);try{return await Ns({projectId:e,worktreePath:t,message:r.message,paths:r.paths}),ho({tone:`ok`,title:`Commit created`,sub:`${n??`branch`} · ${r.paths.length} file${r.paths.length===1?``:`s`}`,mono:!0,durationMs:4e3}),!0}catch(e){return l(e instanceof ks||e instanceof Error?e.message:`Commit failed`),!1}finally{s(!1)}},[]),g=(0,B.useCallback)(async e=>{i&&await h(i.projectId,i.worktreePath,i.branchName,e)&&a(null)},[i,h]),_=(0,B.useCallback)(async n=>{!e||!t||await h(e,t,f,n)},[e,t,f,h]),v=(0,B.useCallback)(()=>{l(null)},[]),y=(0,B.useCallback)(n=>{if(!e||!t)return;let r=f??`branch`,i=`git-push:${t}`;ho({id:i,tone:`working`,title:`Pushing ${r}`,sub:u>0?`origin · ${u} commit${u===1?``:`s`}`:`origin`,mono:!0}),Ps({projectId:e,worktreePath:t,...n?.setUpstream===!0&&{setUpstream:!0}}).then(()=>{ho({id:i,tone:`ok`,title:`Push complete`,sub:`${r} · pushed to origin`,mono:!0,durationMs:4e3})}).catch(e=>{let t=e instanceof ks||e instanceof Error?e.message:`Push failed`,n=/non-fast-forward|rejected/i.test(t);ho({id:i,tone:`err`,title:n?`Push rejected -- non-fast-forward`:`Push failed`,sub:t,actions:n?[{label:`Pull --rebase`,kind:`primary`,onSelect:()=>{go(i),p.current?.({rebase:!0})}},{label:`Dismiss`,onSelect:()=>go(i)}]:[{label:`Dismiss`,onSelect:()=>go(i)}]})})},[e,t,f,u]),b=(0,B.useCallback)(n=>{if(!e||!t)return;let r=f??`branch`,i=`git-pull:${t}`;ho({id:i,tone:`working`,title:`Pulling ${r}`,sub:d>0?`origin · ${d} commit${d===1?``:`s`}`:`origin`,mono:!0}),Fs({projectId:e,worktreePath:t,...n?.rebase===!0&&{rebase:!0}}).then(()=>{ho({id:i,tone:`ok`,title:`Up to date`,sub:`${r} · pulled from origin`,mono:!0,durationMs:4e3})}).catch(e=>{ho({id:i,tone:`err`,title:`Pull failed`,sub:e instanceof ks||e instanceof Error?e.message:`Pull failed`,actions:[{label:`Dismiss`,onSelect:()=>go(i)}]})})},[e,t,f,d]);return p.current=b,{commitDialog:i,commitBusy:o,commitError:c,closeCommitDialog:m,submitCommit:g,submitInlineCommit:_,clearCommitError:v,fetch:(0,B.useCallback)(()=>{if(!e||!t)return;let n=`git-fetch:${t}`;ho({id:n,tone:`working`,title:`Fetching origin`,sub:f??void 0,mono:!0}),Is({projectId:e,worktreePath:t}).then(()=>{ho({id:n,tone:`ok`,title:`Fetched origin`,mono:!0,durationMs:3e3})}).catch(e=>{ho({id:n,tone:`err`,title:`Fetch failed`,sub:e instanceof ks||e instanceof Error?e.message:`Fetch failed`,actions:[{label:`Dismiss`,onSelect:()=>go(n)}]})})},[e,t,f]),pull:b,push:y}}var qs=`parasor:pane-commands`,Js=64*1024,Ys={id:`builtin:terminal`,label:`Terminal`,initialInput:``,builtin:!0};function Xs(e){return[Ys,...e.map(e=>({...e,builtin:!1}))]}function Zs(e){if(!e||e.length>Js)return[];let t;try{t=JSON.parse(e)}catch{return[]}return Ce(t)}function Qs(e){return Zs(e.getItem(qs))}function $s({hydrated:e,paneCommandsCount:t,onMigrate:n}){let r=(0,B.useRef)(!1);(0,B.useEffect)(()=>{if(r.current||!e||t>0)return;r.current=!0;let i=[];try{i=Qs(window.localStorage)}catch{return}i.length>0&&n(i)},[e,t,n])}function ec(){let[e,t]=(0,B.useState)(null);(0,B.useEffect)(()=>{let e=!1;return Hs().then(n=>{e||t(n.canOpenLocalIde)}).catch(()=>{e||t(null)}),()=>{e=!0}},[]);let n=typeof window<`u`&&oe(window.location.hostname);return{capability:e,canOpenLocalIde:e??n}}function tc(){let e=Promise.resolve();return t=>{let n=e.catch(()=>void 0).then(()=>t());return e=n,n}}function nc({onError:e}){let[t,n]=(0,B.useState)(0),[r,i]=(0,B.useState)(0),a=(0,B.useRef)(tc());return{reorderResetSignal:t,pendingProjectReorderCount:r,reorder:(0,B.useCallback)(async t=>{i(e=>e+1);try{await a.current(async()=>{let r=!1;try{(await O(`/api/projects/order`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({ids:t})})).ok||(r=!0)}catch(e){if(e instanceof b)return;r=!0}r&&(n(e=>e+1),e(`Failed to reorder projects -- reverted to previous order.`))})}finally{i(e=>Math.max(0,e-1))}},[e])}}function rc({activeProjectId:e,agentStates:t,sessions:n}){let[r,i]=(0,B.useState)(()=>new Set),a=(0,B.useRef)({});return(0,B.useEffect)(()=>{let o=a.current,s={},c=new Set,l=new Set,u=!1,d=new Set(n.map(e=>e.id));for(let[r,i]of Object.entries(t)){s[r]=i.lifecycle;let t=o[r];if(t===i.lifecycle)continue;let a=n.find(e=>e.id===r)?.projectId;i.lifecycle===`completed`&&t!==`completed`&&a&&a!==e?(c.add(r),u=!0):(i.lifecycle===`running`||i.lifecycle===`waiting`)&&(l.add(r),u=!0)}a.current=s,(u||r.size>0)&&i(e=>{let t=new Set(e);for(let n of e)d.has(n)||t.delete(n);for(let e of l)t.delete(e);for(let e of c)t.add(e);return t})},[e,t,r.size,n]),(0,B.useEffect)(()=>{e&&i(t=>{if(t.size===0)return t;let r=new Set(t),i=!1;for(let a of t)n.find(e=>e.id===a)?.projectId===e&&(r.delete(a),i=!0);return i?r:t})},[e,n]),r}function ic({isMobile:e,onMobileOpenShortcut:t}){let[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)(``);return(0,B.useEffect)(()=>{function n(n){!(n.metaKey||n.ctrlKey)||n.key.toLowerCase()!==`k`||n.altKey||n.shiftKey||(n.preventDefault(),r(n=>n?(a(``),!1):(e&&t?.(),!0)))}return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),{open:n,query:i,setQuery:a,toggle:(0,B.useCallback)(()=>{r(e=>e?(a(``),!1):!0)},[]),close:(0,B.useCallback)(()=>{r(!1),a(``)},[])}}function ac({projectId:e,projectPath:t,worktrees:n,sessions:r,focusedPaneId:i,clientBrowserPanes:a}){return(0,B.useMemo)(()=>{if(!e||!t)return{worktrees:[],allPanes:[],paneById:new Map,focusedPane:null,effectiveFocusedPaneId:null};let o=r.filter(t=>t.projectId===e),s=oc(n,t,o),c=s.map(e=>({path:e,panes:[]}));for(let e of o){let n=sc(e.cwd,s,t),r=c.find(e=>e.path===n);r&&r.panes.push(je(De(e.id),n,e.id))}if(a)for(let e of c){let t=a[e.path];if(t)for(let n of t)e.panes.push(Me(n.id,e.path,n.url))}for(let e of c)e.panes=Ne(Pe(e.path,e.panes));let l=c.flatMap(e=>e.panes),u=new Map(l.map(e=>[e.id,e])),d=u.get(Te(t))??l[0]??null,f=(i?u.get(i)??null:null)??d;return{worktrees:c,allPanes:l,paneById:u,focusedPane:f,effectiveFocusedPaneId:f?.id??null}},[e,t,n,r,i,a])}function oc(e,t,n){let r=e.length>0?[...e]:[{path:t,head:``,branch:null,ahead:0,behind:0,dirtyCount:0}];r.sort((e,n)=>e.path===t?-1:+(n.path===t));let i=r.map(e=>e.path);for(let e of n)cc(e.cwd,i)||i.includes(e.cwd)||i.push(e.cwd);return i}function sc(e,t,n){return cc(e,t)||(t.includes(e)||!e.startsWith(`${n}/`)?e:n)}function cc(e,t){return t.filter(t=>e===t||e.startsWith(`${t}/`)).sort((e,t)=>t.length-e.length)[0]??null}var lc=`parasor:preferences`;function uc(){try{let e=localStorage.getItem(lc);return e?JSON.parse(e):{}}catch{return{}}}function dc(e){try{localStorage.setItem(lc,JSON.stringify(e))}catch{}}function fc(){let e=(0,B.useMemo)(uc,[]),[t,n]=(0,B.useState)(()=>Vt(e.sidebarWidth??256)),[r,i]=(0,B.useState)(e.focusedProjectId??null),[a,o]=(0,B.useState)(e.focusedPaneId??null),s=(0,B.useCallback)(e=>{n(t=>Bt(typeof e==`function`?e(t):e))},[]);return(0,B.useEffect)(()=>{dc({sidebarWidth:t,focusedProjectId:r,focusedPaneId:a})},[t,r,a]),{activeProjectId:r,focusedPaneId:a,setActiveProjectId:i,setFocusedPaneId:o,setSidebarWidth:s,sidebarWidth:t}}function pc({activeProjectId:e,projects:t,setActiveProjectId:n,seedProject:r}){let i=(0,B.useCallback)(async(e,t)=>{let i=await O(`/api/projects`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e,name:t})});if(i.ok){let e=await i.json();r?.(e),n(e.id)}},[r,n]),a=(0,B.useCallback)(async(e,t)=>{await O(`/api/projects/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:t})})},[]);return{createProject:i,deleteProject:(0,B.useCallback)(async r=>{await O(`/api/projects/${r}?force=true`,{method:`DELETE`}),e===r&&n(t.find(e=>e.id!==r)?.id??null)},[e,t,n]),pinProject:(0,B.useCallback)(async e=>{let n=t.find(t=>t.id===e);n&&await O(`/api/projects/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pinned:!n.pinned})})},[t]),renameProject:a,toggleProjectReadOnly:(0,B.useCallback)(async e=>{let n=t.find(t=>t.id===e);n&&await O(`/api/projects/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({readOnly:!n.readOnly})})},[t])}}function mc(e){let t=gc(e.pathname);if(t===`/`||t===``)return{kind:`root`};if(t===`/monitor`)return{kind:`monitor`};let n=_c(t,`/sessions/`);if(n!==null)return{kind:`session`,sessionId:n};let r=_c(t,`/panes/`);if(r!==null)return{kind:`pane`,paneId:r,projectId:new URLSearchParams(e.search).get(`project`)??void 0};if(t===`/worktree`){let t=new URLSearchParams(e.search),n=t.get(`project`),r=t.get(`path`),i=t.get(`tab`)===`git`?`git`:`files`;if(n&&r)return{kind:`worktree`,projectId:n,worktreePath:r,tab:i}}return{kind:`root`}}function hc(e){switch(e.kind){case`root`:return`/`;case`monitor`:return`/monitor`;case`session`:return`/sessions/${encodeURIComponent(e.sessionId)}`;case`pane`:{let t=e.projectId?`?project=${encodeURIComponent(e.projectId)}`:``;return`/panes/${encodeURIComponent(e.paneId)}${t}`}case`worktree`:return`/worktree?${new URLSearchParams({project:e.projectId,path:e.worktreePath,tab:e.tab}).toString()}`}}function gc(e){return e.length>1&&e.endsWith(`/`)?e.replace(/\/+$/,``):e}function _c(e,t){if(!e.startsWith(t))return null;let n=e.slice(t.length);if(!n||n.includes(`/`))return null;try{return decodeURIComponent(n)}catch{return null}}function vc(){let[e,t]=(0,B.useState)(()=>mc(window.location));return(0,B.useEffect)(()=>{let e=()=>t(mc(window.location));return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),{navigate:(0,B.useCallback)((e,n)=>{let r=hc(e);r!==`${window.location.pathname}${window.location.search}`&&(n?.replace?window.history.replaceState(null,``,r):window.history.pushState(null,``,r)),t(e)},[]),route:e}}function yc({activeProjectId:e,connected:t,projects:n,setActiveProjectId:r}){(0,B.useEffect)(()=>{!e&&n.length>0?r(n[0].id):t&&e&&!n.some(t=>t.id===e)&&r(n[0]?.id??null)},[e,t,n,r])}var bc=`parasor:layout`;function xc(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return!!(t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.isContentEditable)}function Sc(e){return[...e].sort((e,t)=>e.pinned&&!t.pinned?-1:!e.pinned&&t.pinned?1:t.lastAccessedAt-e.lastAccessedAt)}function Cc({activeProjectId:e,projects:t,setActiveProjectId:n}){let[r,i]=(0,B.useState)(!1),a=ne(`(max-width: 767px)`),o=(0,B.useCallback)(()=>{i(!0)},[]),s=(0,B.useCallback)(()=>{i(!1)},[]);return(0,B.useEffect)(()=>{localStorage.removeItem(bc)},[]),(0,B.useEffect)(()=>{let e=e=>{if((e.metaKey||e.ctrlKey)&&e.key===`,`){e.preventDefault(),i(e=>!e);return}if((e.metaKey||e.ctrlKey)&&!e.altKey&&!e.shiftKey&&/^[1-9]$/.test(e.key)&&!xc(e.target)){let r=Sc(t)[Number(e.key)-1];r&&(e.preventDefault(),n(r.id))}};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t,n]),{closeSettings:s,isMobile:a,openSettings:o,settingsOpen:r}}function wc(){let[e,t]=(0,B.useState)(null),[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)(null),[c,l]=(0,B.useState)(!1),[u,d]=(0,B.useState)(null);return{renameDialog:e,renameBusy:n,renameError:i,openRenameDialog:(0,B.useCallback)(e=>{a(null),t(e)},[]),closeRenameDialog:(0,B.useCallback)(()=>{n||(t(null),a(null))},[n]),submitRename:(0,B.useCallback)(async n=>{let i=e;if(i){r(!0),a(null);try{await Ws({projectId:i.projectId,worktreePath:i.worktreePath,newBranch:n}),ho({tone:`ok`,title:`Branch renamed`,sub:`${i.currentBranch} -> ${n}`,mono:!0,durationMs:3e3}),t(null)}catch(e){a(e instanceof ks||e instanceof Error?e.message:`Rename failed`)}finally{r(!1)}}},[e]),removeDialog:o,removeBusy:c,removeError:u,openRemoveDialog:(0,B.useCallback)(e=>{d(null),s(e)},[]),closeRemoveDialog:(0,B.useCallback)(()=>{c||(s(null),d(null))},[c]),submitRemove:(0,B.useCallback)(async({force:e})=>{let t=o;if(t){l(!0),d(null);try{await Gs({projectId:t.projectId,worktreePath:t.worktreePath,...e===!0&&{force:!0}}),ho({tone:`ok`,title:`Worktree removed`,sub:t.branch,mono:!0,durationMs:3e3}),s(null)}catch(e){d(e instanceof ks||e instanceof Error?e.message:`Remove failed`)}finally{l(!1)}}},[o]),copyWorktreePath:(0,B.useCallback)(e=>{Tc(e).then(e=>{Qa(e?`Copied path`:`Copy failed`)}).catch(()=>{Qa(`Copy failed`)})},[]),openWorktreeInFinder:(0,B.useCallback)(({projectId:e,worktreePath:t})=>{let n=`open-os:${t}`;ho({id:n,tone:`working`,title:`Opening in file manager`,sub:t,mono:!0}),Vs({projectId:e,worktreePath:t}).then(()=>{go(n)}).catch(e=>{ho({id:n,tone:`err`,title:`Could not open in file manager`,sub:e instanceof ks||e instanceof Error?e.message:`Open failed`,actions:[{label:`Dismiss`,onSelect:()=>go(n)}]})})},[]),openWorktreeInIde:(0,B.useCallback)(({projectId:e,worktreePath:t,editor:n})=>{let r=n===`cursor`?`Cursor`:`VS Code`,i=`open-ide:${n}:${t}`;ho({id:i,tone:`working`,title:`Opening in ${r}`,sub:t,mono:!0}),Us({projectId:e,worktreePath:t,editor:n}).then(()=>{go(i)}).catch(e=>{let t=e instanceof ks||e instanceof Error?e.message:`Open failed`;ho({id:i,tone:`err`,title:`Could not open in ${r}`,sub:t,actions:[{label:`Dismiss`,onSelect:()=>go(i)}]})})},[])}}async function Tc(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0;let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}var Ec=16,Dc=24,Oc=40;function kc(e){(0,B.useEffect)(()=>{if(!e)return;let t=null,n=!1;function r(e){if(e.touches.length!==1){t=null,n=!1;return}let r=e.touches[0];if(r.clientX>Ec){t=null,n=!1;return}t={x:r.clientX,y:r.clientY},n=!0}function i(e){if(!n||!t)return;if(e.touches.length!==1){n=!1,t=null;return}let r=e.touches[0];Math.abs(r.clientY-t.y)>Oc&&(n=!1,t=null)}function a(r){if(!n||!t){n=!1,t=null;return}let i=r.changedTouches[0],a=i?i.clientX-t.x:0,o=i?Math.abs(i.clientY-t.y):0;n=!1,t=null,a>=Dc&&o<=Oc&&e?.()}function o(){n=!1,t=null}return window.addEventListener(`touchstart`,r,{passive:!0}),window.addEventListener(`touchmove`,i,{passive:!0}),window.addEventListener(`touchend`,a,{passive:!0}),window.addEventListener(`touchcancel`,o,{passive:!0}),()=>{window.removeEventListener(`touchstart`,r),window.removeEventListener(`touchmove`,i),window.removeEventListener(`touchend`,a),window.removeEventListener(`touchcancel`,o)}},[e])}var Ac=`about:blank`;function jc(e){return e===Ac?``:e}function Mc({url:e,onUrlChange:t,paneId:n,headerActions:r}){let[i,a]=(0,B.useState)(jc(e)),[o,s]=(0,B.useState)(e),c=(0,B.useRef)(null);(0,B.useEffect)(()=>{s(e),a(jc(e))},[e]),le(n,(0,B.useCallback)(()=>{c.current?.contentWindow?.focus()},[]),!de());function l(e){let n=e.trim();if(n===``){a(jc(o));return}n===Ac?n=Ac:/^https?:\/\//i.test(n)||(n=`https://${n}`),s(n),a(jc(n)),t?.(n)}function u(e){e.preventDefault(),l(i)}return(0,V.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,V.jsxs)(`form`,{onSubmit:u,"aria-label":`Browser address bar`,className:`flex items-center gap-2 border-b border-border bg-bg-primary px-2 py-1`,children:[(0,V.jsx)(`button`,{type:`button`,onClick:()=>c.current?.contentWindow?.history.back(),"aria-label":`Browser back`,className:`text-text-secondary hover:text-text-primary text-sm px-1`,title:`Back`,children:`←`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>c.current?.contentWindow?.history.forward(),"aria-label":`Browser forward`,className:`text-text-secondary hover:text-text-primary text-sm px-1`,title:`Forward`,children:`->`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>c.current?.contentWindow?.location.reload(),"aria-label":`Browser reload`,className:`text-text-secondary hover:text-text-primary text-sm px-1`,title:`Reload`,children:`↻`}),(0,V.jsx)(`input`,{type:`text`,"aria-label":`URL`,value:i,onChange:e=>a(e.target.value),className:`flex-1 rounded-control bg-bg-primary px-2 py-1 text-xs text-text-primary outline-none focus:ring-1 focus:ring-accent`,placeholder:`URL`}),r]}),(0,V.jsx)(`iframe`,{ref:c,src:o,className:`flex-1 border-none bg-white`,sandbox:`allow-same-origin allow-scripts allow-forms allow-popups`,title:`Browser`})]})}function Nc({onClick:e}){return(0,V.jsx)(_,{label:`Close pane`,title:`Close pane`,size:`md`,tone:`danger`,onClick:e,children:(0,V.jsx)(h.close,{})})}function Pc({state:e,onUrlChange:t,paneId:n,onClose:r}){return(0,V.jsx)(`div`,{className:`flex h-full min-h-0 w-full flex-col`,children:(0,V.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,V.jsx)(Mc,{url:e.url,onUrlChange:t,paneId:n,headerActions:r?(0,V.jsx)(Nc,{onClick:r}):null})})})}var Fc=class extends Error{constructor(){super(`upload aborted`),this.name=`FileUploadAbortedError`}},Ic=class extends Error{limit;constructor(e){super(`upload exceeds size limit`),this.name=`FileUploadTooLargeError`,this.limit=e}},Lc=class extends Error{reason;constructor(e){super(`invalid filename: ${e}`),this.name=`FileUploadInvalidFilenameError`,this.reason=e}},Rc=class extends Error{reason;constructor(e){super(`invalid target: ${e}`),this.name=`FileUploadInvalidTargetError`,this.reason=e}},zc=class extends Error{constructor(){super(`project is read-only`),this.name=`FileUploadReadOnlyError`}},Bc=class extends Error{constructor(e){super(e),this.name=`FileUploadIoError`}},Vc=class extends Error{conflicts;constructor(e){super(`conflict: ${e.join(`, `)}`),this.name=`FileUploadConflictError`,this.conflicts=[...e]}};async function Hc(e){let{projectId:t,targetPath:n,files:r,disposition:i,signal:a,onSlow:o,slowMs:s=300}=e;if(r.length===0)return[];let c=new FormData;for(let e of r)c.append(`files`,e,e.name);let l=new URLSearchParams;n&&l.set(`path`,n),i&&l.set(`disposition`,i);let u=l.toString(),d=`/api/projects/${encodeURIComponent(t)}/files/upload`+(u?`?${u}`:``),f=null;o&&(f=setTimeout(o,s));let p;try{let e={method:`POST`,body:c};a&&(e.signal=a),p=await O(d,e)}catch(e){throw f!==null&&clearTimeout(f),e instanceof DOMException&&e.name===`AbortError`?new Fc:e}finally{f!==null&&clearTimeout(f)}if(p.ok)return(await p.json()).files;let m=await p.json().catch(()=>({}));if(m&&`error`in m){if(m.error===`conflict`)throw new Vc(Array.isArray(m.conflicts)?m.conflicts:[]);if(m.error===`too-large`)throw new Ic(typeof m.limit==`number`?m.limit:0);if(m.error===`invalid-filename`)throw new Lc(m.reason??`control-char`);if(m.error===`invalid-target`)throw new Rc(m.reason??`missing`);if(m.error===`read-only`)throw new zc;if(m.error===`io-error`)throw new Bc(`io error`)}throw new Bc(`upload failed: HTTP ${p.status}`)}var Uc=800;function Wc(e){let{projectId:t,resolveTargetForRow:n,onAutoExpand:r,expandedPaths:i,onUploaded:a}=e,o=(0,B.useRef)(0),[s,c]=(0,B.useState)(!1),[l,u]=(0,B.useState)(null),[d,f]=(0,B.useState)(!1),[p,m]=(0,B.useState)(null),[h,g]=(0,B.useState)(null),_=(0,B.useRef)(null),v=(0,B.useRef)(null),y=(0,B.useCallback)(()=>{_.current&&=(clearTimeout(_.current),null),v.current=null},[]);(0,B.useEffect)(()=>()=>y(),[y]);let b=(0,B.useMemo)(()=>s?n(l===null?null:{path:l,isDirectory:x.current}):null,[l,s,n]),x=(0,B.useRef)(!1),S=(0,B.useCallback)(async(e,n)=>{f(!0),g(null);try{return await Hc({projectId:t,targetPath:e.targetPath,files:e.files,...n?{disposition:n}:{}})}catch(t){return t instanceof Vc?(m({...e,conflicts:t.conflicts}),null):t instanceof zc?(g({kind:`read-only`}),null):t instanceof Ic?(g({kind:`too-large`,limit:t.limit}),null):t instanceof Lc?(g({kind:`invalid-filename`,reason:t.reason}),null):t instanceof Rc?(g({kind:`invalid-target`,reason:t.reason}),null):t instanceof Bc?(g({kind:`io`}),null):(console.error(`[file-uploads] unexpected error`,t),g({kind:`io`}),null)}finally{f(!1)}},[t]),C=(0,B.useCallback)((e,t)=>{g({kind:`success`,count:e,targetLabel:t}),a()},[a]),w=e=>{R(e.dataTransfer)&&(e.preventDefault(),o.current+=1,s||c(!0))},T=e=>{R(e.dataTransfer)&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`))},E=e=>{R(e.dataTransfer)&&(e.preventDefault(),o.current=Math.max(0,o.current-1),o.current===0&&(c(!1),u(null),x.current=!1,y()))},D=e=>{if(!R(e.dataTransfer))return;e.preventDefault();let t=e.dataTransfer;o.current=0,c(!1),y();let r=[];if(t)for(let e=0;e<t.files.length;e++){let n=t.files.item(e);n&&r.push(n)}if(r.length===0){u(null),x.current=!1;return}let i=n(l?{path:l,isDirectory:x.current}:null);u(null),x.current=!1,(async()=>{let e=await S({files:r,targetPath:i},void 0);e&&C(e.filter(e=>e.status!==`skipped`).length,i||`.`)})()},O=(0,B.useCallback)(e=>({onDragEnter:t=>{R(t.dataTransfer)&&(t.preventDefault(),t.stopPropagation(),u(e.path),x.current=e.isDirectory,e.isDirectory&&!e.isExpanded?v.current!==e.path&&(y(),v.current=e.path,_.current=setTimeout(()=>{v.current===e.path&&(r(e.path),_.current=null,v.current=null)},Uc)):y())},onDragLeave:t=>{R(t.dataTransfer)&&(t.preventDefault(),t.stopPropagation(),v.current===e.path&&y())}}),[r,y]),k=(0,B.useCallback)(()=>g(null),[]),ee=(0,B.useCallback)(()=>{m(null)},[]),A=(0,B.useCallback)((e,t)=>{let n=p;m(null),n&&(async()=>{let t=await S({files:n.files,targetPath:n.targetPath},e);t&&C(t.filter(e=>e.status!==`skipped`).length,n.targetPath||`.`)})()},[p,S,C]);return{rootHandlers:{onDragEnter:w,onDragOver:T,onDragLeave:E,onDrop:D},getRowHandlers:O,hoveredRowPath:l,targetPath:b,isDragging:s,uploading:d,conflict:p,message:h,dismissMessage:k,resolveConflict:A,cancelConflict:ee}}var Gc={M:`text-yellow-400`,A:`text-green-400`,D:`text-red-400`,R:`text-blue-400`,"?":`text-neutral-400`},Kc={D:4,M:3,A:2,R:1,"?":0};function qc(e){return Gc[e]??`text-neutral-400`}function Jc(e,t){let n=e===`.`?``:`${e}/`,r=null,i=-1;for(let[e,a]of Object.entries(t))if(e.startsWith(n)){let e=Kc[a]??0;if(e>i&&(r=a,i=e),i>=4)break}return r}function Yc(e,t){if(t===`directory`)return{base:e,ext:``};let n=e.lastIndexOf(`.`);return n<=0?{base:e,ext:``}:{base:e.slice(0,n),ext:e.slice(n)}}function Xc(e,t,n){return`${e}${n===1?` copy`:` copy ${n}`}${t}`}function Zc(e,t,n){let r=new Set(n),{base:i,ext:a}=Yc(e,t);for(let e=1;e<1e3;e+=1){let t=Xc(i,a,e);if(!r.has(t))return t}return Xc(i,a,Date.now())}async function Qc(e){try{await navigator.clipboard.writeText(e)}catch{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),document.body.removeChild(t)}}function $c({entry:e,projectPath:n,x:r,y:i,onClose:a,onDuplicate:o}){let s=`ontouchstart`in window,c=!s,l=!!n&&I(),u=[{id:`copy-path`,label:`Copy Path`,onSelect:()=>Qc(e.path)},{id:`copy-at-path`,label:`Copy as @path`,onSelect:()=>Qc(`@${e.path}`)}];if(l&&n){let t=`${n.replace(/\/+$/,``)}/${e.path}`;u.push({id:`insert-path`,label:`Insert path into terminal`,onSelect:()=>fe(L(t))})}return o&&u.push({id:`duplicate`,label:`Duplicate`,onSelect:()=>o(e)}),c&&u.push({id:`reveal-finder`,label:`Reveal in Finder`,separatorBefore:!0,onSelect:()=>Qc(e.path)}),s?(0,V.jsx)(ee,{open:!0,onDismiss:a,ariaLabel:`Actions for ${e.name}`,title:e.path,items:u}):(0,V.jsx)(t,{open:!0,anchorPoint:{x:r,y:i},items:u,onClose:a})}function el({open:e,conflicts:t,totalCount:n,targetLabel:r,onResolve:i,onCancel:a}){let[o,s]=(0,B.useState)(!0),c=(0,B.useRef)(null);(0,B.useEffect)(()=>{if(e){s(!0);let e=requestAnimationFrame(()=>c.current?.focus());return()=>cancelAnimationFrame(e)}},[e]);let l=t.length,u=Math.max(0,n-l);return(0,V.jsxs)(m,{open:e,ariaLabel:`Resolve upload conflict`,onClose:a,children:[(0,V.jsx)(f,{title:`Files already exist`,onClose:a}),(0,V.jsxs)(`div`,{className:`px-4 py-3 text-sm text-text-primary`,children:[(0,V.jsxs)(`p`,{className:`mb-2 text-text-secondary`,children:[(0,V.jsx)(`span`,{className:`font-medium text-text-primary`,children:l}),` `,`of `,(0,V.jsx)(`span`,{className:`font-medium`,children:n}),` `,n===1?`file already exists`:`files already exist`,` `,`in`,` `,(0,V.jsx)(`code`,{className:`rounded-control bg-bg-primary px-1 text-xs`,children:r||`.`}),`.`]}),(0,V.jsx)(`ul`,{className:`mb-3 max-h-32 overflow-y-auto rounded-control border border-border bg-bg-primary px-2 py-1 text-xs text-text-secondary`,children:t.map(e=>(0,V.jsx)(`li`,{className:`truncate`,children:e},e))}),u>0?(0,V.jsxs)(`p`,{className:`mb-2 text-xs text-text-secondary`,children:[u,` other file`,u===1?``:`s`,` will follow your chosen action.`]}):null,(0,V.jsxs)(`label`,{className:`mt-1 flex items-center gap-2 text-xs text-text-secondary`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>s(e.target.checked),className:`accent-accent`}),`Apply to all files in this drop`]})]}),(0,V.jsx)(`div`,{className:`border-t border-border px-4 py-3`,children:(0,V.jsxs)(d,{children:[(0,V.jsx)(S,{onClick:a,children:`Cancel`}),(0,V.jsx)(S,{onClick:()=>i(`skip`,o),children:`Skip`}),(0,V.jsx)(S,{ref:c,variant:`primary`,onClick:()=>i(`keep-both`,o),children:`Keep both`}),(0,V.jsx)(S,{variant:`danger`,onClick:()=>i(`replace`,o),children:`Replace`})]})})]})}function tl(){return(0,V.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`currentColor`,"aria-hidden":!0,children:(0,V.jsx)(`path`,{d:`M5.7 4.3a1 1 0 0 1 1.4 0l3 3a1 1 0 0 1 0 1.4l-3 3a1 1 0 0 1-1.4-1.4L8 8 5.7 5.7a1 1 0 0 1 0-1.4Z`})})}function nl(){return(0,V.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`currentColor`,"aria-hidden":!0,children:(0,V.jsx)(`path`,{d:`M3.3 5.7a1 1 0 0 1 1.4 0L8 9l3.3-3.3a1 1 0 1 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 0-1.4Z`})})}function rl({projectId:e,projectPath:t,worktreePath:n,expandedPaths:r,onToggleExpand:i,onSelectFile:a,selectedFilePath:o,fileChangeSeq:s,manualRefreshSeq:c,gitFileStatuses:l,onRootCountChange:u}){let d=(0,B.useMemo)(()=>new Set(r),[r]),[f,p]=(0,B.useState)(new Map),[m,h]=(0,B.useState)(new Set),g=(0,B.useRef)(f);g.current=f;let _=(0,B.useCallback)(async(t,r)=>{if(!(!r&&g.current.has(t))){h(e=>new Set(e).add(t));try{let r=await M({projectId:e,path:t,worktreePath:n});if(!r)return;p(e=>new Map(e).set(t,r))}catch{}finally{h(e=>{let n=new Set(e);return n.delete(t),n})}}},[e,n]),v=(0,B.useCallback)(async t=>{try{return await M({projectId:e,path:t,worktreePath:n})}catch{return null}},[e,n]),y=(0,B.useRef)(`${e}|${n??``}`);(0,B.useEffect)(()=>{let t=`${e}|${n??``}`,r=y.current!==t;r&&(y.current=t,p(new Map),g.current=new Map),_(`.`,r)},[e,n,_]),(0,B.useEffect)(()=>{for(let e of r)g.current.has(e)||_(e)},[r,_]),(0,B.useEffect)(()=>{if(s===void 0||s===0)return;let e=setTimeout(()=>{let e=[...g.current.keys()];for(let t of e)_(t,!0)},300);return()=>clearTimeout(e)},[s,_]),(0,B.useEffect)(()=>{if(!c)return;let e=[...g.current.keys()];for(let t of e)_(t,!0)},[c,_]);let b=f.get(`.`);(0,B.useEffect)(()=>{u&&u(b?.length??0)},[b,u]);let x=e=>{if(e.type!==`directory`){a?.(e.path);return}let t=d.has(e.path);i(e.path,!t),!t&&!f.has(e.path)&&_(e.path)},S=(0,B.useCallback)(async t=>{let r=t.path.lastIndexOf(`/`),i=r===-1?`.`:t.path.slice(0,r),a=g.current.get(i)??await v(i);if(!a){window.alert(`Failed to duplicate: cannot read parent directory.`);return}let o=Zc(t.name,t.type,a.map(e=>e.name)),s=i===`.`?o:`${i}/${o}`,c=await ie({projectId:e,srcPath:t.path,destPath:s,...n?{worktreePath:n}:{}});if(!c.ok){let e=await c.text().catch(()=>``);window.alert(`Failed to duplicate${e?`: ${e}`:``}`);return}let l=[...g.current.keys()];l.includes(i)||l.push(i);for(let e of l)_(e,!0)},[e,n,_,v]),[C,w]=(0,B.useState)(null),T=(0,B.useRef)(null),E=(0,B.useRef)(null),D=()=>{T.current&&=(clearTimeout(T.current),null),E.current=null},O=(e,t)=>{e.preventDefault(),e.stopPropagation(),w({x:e.clientX,y:e.clientY,entry:t})},k=(e,t)=>{if(t.touches.length>1){D();return}let n=t.touches[0];E.current={x:n.clientX,y:n.clientY},T.current=setTimeout(()=>{w({x:n.clientX,y:n.clientY,entry:e}),E.current=null},500)},ee=e=>{if(e.touches.length>1){D();return}let t=E.current;if(!t||!T.current)return;let n=e.touches[0];n&&Math.hypot(n.clientX-t.x,n.clientY-t.y)>10&&D()},A=()=>{D()},j=(e,n)=>{if(!t){n.preventDefault();return}let r=`${t.replace(/\/+$/,``)}/${e.path}`;n.dataTransfer.effectAllowed=`copy`,n.dataTransfer.setData(me,JSON.stringify([r])),n.dataTransfer.setData(`text/plain`,r)},[te,ne]=(0,B.useState)(0),N=Wc({projectId:e,expandedPaths:d,resolveTargetForRow:e=>{if(!e)return`.`;if(e.isDirectory)return e.path;let t=e.path.lastIndexOf(`/`);return t>0?e.path.slice(0,t):`.`},onAutoExpand:e=>{d.has(e)||i(e,!0)},onUploaded:()=>ne(e=>e+1)});(0,B.useEffect)(()=>{if(te===0)return;let e=[...g.current.keys()];for(let t of e)_(t,!0)},[te,_]),(0,B.useEffect)(()=>{if(!N.message)return;let e=setTimeout(()=>N.dismissMessage(),4e3);return()=>clearTimeout(e)},[N.message,N.dismissMessage]);let P=(e,n)=>{let r=f.get(e);return r?r.map(e=>{let r=d.has(e.path),i=e.type===`directory`,a=!i&&o===e.path,s=i?re(e.name,r):ae(e.name),c=N.hoveredRowPath===e.path,u=N.getRowHandlers({path:e.path,isDirectory:i,isExpanded:r});return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`button`,{type:`button`,draggable:!!t,"aria-current":a?`page`:void 0,className:`
29
+ flex w-full items-center gap-2 py-1 text-left text-sm leading-tight hover:bg-bg-primary/50 active:bg-row-active-bg h-6 max-md:h-6.5
30
+ ${e.isGitignored?`opacity-40`:``}
31
+ ${a?`bg-row-selected-bg text-row-active-fg`:e.isHidden?`text-text-secondary`:`text-text-primary`}
32
+ ${c?`ring-1 ring-accent ring-inset bg-accent/10`:``}
33
+ `,style:{paddingLeft:n*16+8},onClick:()=>x(e),onContextMenu:t=>O(t,e),onDragStart:t=>j(e,t),onDragEnter:u.onDragEnter,onDragLeave:u.onDragLeave,onTouchStart:t=>k(e,t),onTouchMove:ee,onTouchEnd:A,onTouchCancel:A,children:[i?(0,V.jsx)(`span`,{className:`flex w-4 shrink-0 items-center justify-center text-text-secondary`,children:r?(0,V.jsx)(nl,{}):(0,V.jsx)(tl,{})}):(0,V.jsx)(`span`,{className:`w-4 shrink-0`}),(0,V.jsx)(s,{className:`h-icon-base w-icon-base shrink-0`}),(0,V.jsx)(`span`,{className:`truncate`,children:e.name}),l&&(()=>{if(i){let t=Jc(e.path,l);if(t)return(0,V.jsx)(`span`,{className:`ml-auto shrink-0 pr-2 text-xs ${qc(t)}`,children:`●`})}else{let t=l[e.path];if(t)return(0,V.jsx)(`span`,{className:`ml-auto shrink-0 pr-2 text-xs font-semibold ${qc(t)}`,children:t===`?`?`U`:t})}return null})()]}),i&&r&&P(e.path,n+1)]},e.path)}):m.has(e)?(0,V.jsx)(`div`,{className:`py-0.5 text-sm text-text-secondary`,style:{paddingLeft:n*16+8},children:`Loading…`}):null},F=N.targetPath??`.`;return(0,V.jsxs)(`div`,{className:`relative h-full overflow-y-auto bg-bg-primary text-text-primary ${N.isDragging?`ring-1 ring-accent ring-inset`:``}`,onDragEnter:N.rootHandlers.onDragEnter,onDragOver:N.rootHandlers.onDragOver,onDragLeave:N.rootHandlers.onDragLeave,onDrop:N.rootHandlers.onDrop,children:[(0,V.jsx)(`div`,{className:`py-1`,children:P(`.`,0)}),N.isDragging&&(0,V.jsxs)(`div`,{"aria-hidden":!0,className:`pointer-events-none sticky bottom-2 ml-2 mr-2 rounded-control border border-border bg-bg-secondary/95 px-3 py-1.5 text-xs text-text-secondary shadow-md`,children:[`Drop into`,` `,(0,V.jsx)(`code`,{className:`rounded-control bg-bg-primary px-1 text-text-primary`,children:F})]}),N.uploading&&(0,V.jsx)(`div`,{"aria-live":`polite`,className:`pointer-events-none sticky bottom-2 ml-2 mr-2 rounded-control border border-border bg-bg-secondary px-3 py-1.5 text-xs text-text-secondary shadow-md`,children:`Uploading…`}),N.message&&(0,V.jsxs)(`div`,{role:`status`,className:`sticky bottom-2 ml-2 mr-2 flex items-center justify-between gap-2 rounded-control border px-3 py-1.5 text-xs shadow-md ${N.message.kind===`success`?`border-accent bg-bg-secondary text-text-primary`:`border-red-500/40 bg-red-500/10 text-red-200`}`,children:[(0,V.jsxs)(`span`,{className:`truncate`,children:[N.message.kind===`success`&&`Uploaded ${N.message.count} file${N.message.count===1?``:`s`} to ${N.message.targetLabel}.`,N.message.kind===`read-only`&&`This project is read-only. Toggle write access in Settings to upload.`,N.message.kind===`too-large`&&`One of the files exceeds the ${Math.round(N.message.limit/(1024*1024))} MB upload limit.`,N.message.kind===`invalid-filename`&&`Filename rejected (${N.message.reason}).`,N.message.kind===`invalid-target`&&`Target folder rejected (${N.message.reason}).`,N.message.kind===`io`&&`Upload failed. Check the server logs and try again.`]}),(0,V.jsx)(`button`,{type:`button`,onClick:N.dismissMessage,className:`ml-2 shrink-0 text-xs text-text-secondary hover:text-text-primary`,"aria-label":`Dismiss`,children:`×`})]}),C&&(0,V.jsx)($c,{entry:C.entry,projectPath:t,x:C.x,y:C.y,onClose:()=>w(null),onDuplicate:e=>{S(e)}}),(0,V.jsx)(el,{open:N.conflict!==null,conflicts:N.conflict?.conflicts??[],totalCount:N.conflict?.files.length??0,targetLabel:N.conflict?.targetPath??`.`,onResolve:(e,t)=>N.resolveConflict(e,t),onCancel:N.cancelConflict})]})}var il=new Set([`.git`,`.DS_Store`,`Thumbs.db`]);function al(e){return e?e===`.`||e===`..`?`Name cannot be '.' or '..'.`:e.includes(`/`)||e.includes(`\\`)?`Name cannot contain '/' or '\\'.`:/[\x00-\x1f\x7f]/.test(e)?`Name contains control characters.`:il.has(e)?`'${e}' is reserved and won't appear in the tree.`:null:`Name cannot be empty.`}function ol({paneId:e,projectId:t,worktreePath:n,initialExpanded:i,fileChangeSeq:a,onExpandedPathsChange:o,onSelectFile:s,selectedFilePath:c,gitFileStatuses:l}){let u=P(t),[d,f]=(0,B.useState)(i),[m,g]=(0,B.useState)(0),[v,y]=(0,B.useState)(0),b=(0,B.useCallback)((t,n)=>{f(r=>{let i=n?[...r,t]:r.filter(e=>e!==t);return o?.(e,i),i})},[e,o]),x=(0,B.useCallback)(()=>{g(e=>e+1)},[]),S=(0,B.useCallback)(async e=>{let r=e===`file`?`New file name`:`New folder name`,i=window.prompt(r)?.trim();if(!i)return;let a=al(i);if(a){window.alert(a);return}let o=e===`file`?await j({projectId:t,path:i,content:``,...n?{worktreePath:n}:{}}):await A({projectId:t,path:i,...n?{worktreePath:n}:{}});if(!o.ok){let t=await o.text().catch(()=>``);window.alert(`Failed to create ${e}${t?`: ${t}`:``}`);return}x()},[t,n,x]);return(0,V.jsxs)(`div`,{className:`flex h-full flex-col bg-bg-primary text-text-primary`,children:[(0,V.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,V.jsx)(rl,{projectId:t,projectPath:n??u?.path,worktreePath:n,expandedPaths:d,onToggleExpand:b,onSelectFile:s,selectedFilePath:c,fileChangeSeq:a,manualRefreshSeq:m,gitFileStatuses:l,onRootCountChange:y})}),(0,V.jsx)(r,{status:`${v} ${v===1?`file`:`files`}`,actions:(0,V.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,V.jsx)(p,{align:`end`,placement:`top`,items:[{id:`new-file`,label:`New file`,onSelect:()=>{S(`file`)}},{id:`new-folder`,label:`New folder`,onSelect:()=>{S(`folder`)}}],renderTrigger:({toggle:e,triggerRef:t,menuId:n,open:r})=>(0,V.jsx)(_,{ref:t,onClick:e,"aria-haspopup":`menu`,"aria-expanded":r,"aria-controls":n,label:`New file or folder`,children:(0,V.jsx)(h.add,{})})}),(0,V.jsx)(_,{onClick:x,label:`Refresh`,children:(0,V.jsx)(h.refresh,{})})]})})]})}var sl=15,cl=85;function ll(e){return`parasor:pane-ratio:${e}`}function ul(e){return Number.isNaN(e)?sl:Math.min(cl,Math.max(sl,e))}function dl(e,t){try{let n=localStorage.getItem(ll(e));if(!n)return t;let r=JSON.parse(n);if(!Array.isArray(r)||r.length!==2)return t;let[i,a]=r;if(typeof i!=`number`||typeof a!=`number`)return t;let o=ul(i/(i+a)*100);return[o,100-o]}catch{return t}}function fl(e,t){try{localStorage.setItem(ll(e),JSON.stringify(t))}catch{}}function pl({storageKey:e,defaultRatio:t,primary:n,secondary:r,isMobile:i,secondaryActive:a=!1}){let[o,s]=(0,B.useState)(()=>dl(e,t)),c=(0,B.useRef)(null),l=(0,B.useRef)(!1);(0,B.useEffect)(()=>{fl(e,o)},[e,o]);let u=(0,B.useCallback)(e=>{e.preventDefault(),e.target.setPointerCapture(e.pointerId),l.current=!0},[]),d=(0,B.useCallback)(e=>{if(!l.current)return;let t=c.current?.getBoundingClientRect();if(!t)return;let n=ul((e.clientX-t.left)/t.width*100);s([n,100-n])},[]),f=(0,B.useCallback)(e=>{l.current=!1;try{e.target.releasePointerCapture(e.pointerId)}catch{}},[]),p=(0,B.useCallback)(e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;e.preventDefault();let t=e.key===`ArrowLeft`?-1:1,n=e.shiftKey?5:1;s(([e])=>{let r=ul(e+t*n);return[r,100-r]})},[]);return i?(0,V.jsx)(`div`,{className:`flex h-full w-full flex-col overflow-hidden`,children:(0,V.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:a?r:n})}):(0,V.jsxs)(`div`,{ref:c,className:`cm-worktree-split flex h-full w-full flex-row overflow-hidden`,children:[(0,V.jsx)(`div`,{className:`cm-split-left min-w-0 overflow-hidden bg-bg-secondary`,style:{width:`${o[0]}%`},children:n}),(0,V.jsx)(`hr`,{"aria-orientation":`vertical`,"aria-valuenow":Math.round(o[0]),"aria-valuemin":sl,"aria-valuemax":cl,tabIndex:0,onPointerDown:u,onPointerMove:d,onPointerUp:f,onPointerCancel:f,onKeyDown:p,className:`cm-split-resizer relative z-[2] w-px shrink-0 cursor-col-resize bg-border before:absolute before:inset-y-0 before:-inset-x-3 before:content-[''] focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent`}),(0,V.jsx)(`div`,{className:`cm-split-right min-w-0 flex-1 overflow-hidden`,style:{width:`${o[1]}%`},children:r})]})}var ml=`parasor:files-pane-selection:`,hl=new Map,gl=new Set;function _l(e){try{return localStorage.getItem(`${ml}${e}`)}catch{return null}}function vl(e){return hl.has(e)||hl.set(e,_l(e)),hl.get(e)??null}function yl(e,t){hl.set(e,t);try{t===null?localStorage.removeItem(`${ml}${e}`):localStorage.setItem(`${ml}${e}`,t)}catch{}for(let e of gl)e()}function bl(e,t){yl(e,t)}function xl(e){return gl.add(e),()=>{gl.delete(e)}}function Sl(e){return[(0,B.useSyncExternalStore)(xl,()=>e===null?null:vl(e),()=>null),(0,B.useCallback)(t=>{e!==null&&yl(e,t)},[e])]}var Cl=[{value:`files`,label:`Files`,glyph:(0,V.jsx)(h.files,{})},{value:`git`,label:`Git`,glyph:(0,V.jsx)(h.git,{})}];function wl({activeTab:e,onChangeTab:t}){return(0,V.jsx)(`div`,{role:`tablist`,"aria-label":`Worktree view`,className:`flex h-full`,children:Cl.map(n=>{let r=n.value===e;return(0,V.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":r,onClick:()=>t(n.value),className:`inline-flex flex-1 items-center justify-center gap-2 text-sm transition-colors ${r?`bg-bg-primary font-semibold text-text-primary`:`bg-transparent font-medium text-text-secondary hover:bg-row-hover-bg hover:text-text-primary`}`,children:[(0,V.jsx)(`span`,{"aria-hidden":!0,className:r?`text-accent`:void 0,children:n.glyph}),(0,V.jsx)(`span`,{children:n.label})]},n.value)})})}var Tl=(0,B.lazy)(()=>Do(async()=>{let{EditorPane:e}=await import(`./EditorPane-CzzT3iYY.js`);return{EditorPane:e}},[]).then(({EditorPane:e})=>({default:e})));function El({paneId:e,projectId:t,worktreePath:n,fileChangeSeq:r,gitFileStatuses:i,isMobile:a,onChangeTab:o}){let[s,c]=Sl(e),l=(0,B.useCallback)(e=>{c(e)},[c]);return(0,V.jsx)(pl,{storageKey:`worktree`,defaultRatio:Oe,isMobile:a,secondaryActive:s!==null,primary:(0,V.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,V.jsx)(`div`,{className:`hidden h-bar shrink-0 border-b border-border bg-tab-strip-bg md:block`,children:(0,V.jsx)(wl,{activeTab:`files`,onChangeTab:o})}),(0,V.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,V.jsx)(ol,{paneId:e,projectId:t,worktreePath:n,initialExpanded:[],fileChangeSeq:r,onSelectFile:l,selectedFilePath:s,gitFileStatuses:i})})]}),secondary:s?(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(Dl,{}),children:(0,V.jsx)(Tl,{paneId:`${e}:editor`,projectId:t,worktreePath:n,filePath:s,fileChangeSeq:r})}):(0,V.jsx)(Ol,{})})}function Dl(){return(0,V.jsxs)(`div`,{className:`flex h-full flex-col bg-bg-primary text-text-primary`,children:[(0,V.jsx)(i,{icon:(0,V.jsx)(h.doc,{}),title:`Editor`}),(0,V.jsx)(`div`,{className:`min-h-0 flex-1`})]})}function Ol(){return(0,V.jsxs)(`div`,{className:`flex h-full flex-col bg-bg-primary text-text-primary`,children:[(0,V.jsx)(i,{icon:(0,V.jsx)(h.doc,{}),title:`Editor`}),(0,V.jsx)(`div`,{className:`min-h-0 flex-1 p-3 text-sm text-text-secondary`,children:`Select a file to view or edit.`})]})}function kl(e){return e?new Date(e*1e3).toLocaleString(void 0,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hour12:!1}):``}function Al({projectId:e,worktreePath:t,fileChangeSeq:n,commit:r}){let[a,o]=(0,B.useState)(``),[s,c]=(0,B.useState)(!0),l=!!r,u=r?.sha??null,d=(0,B.useRef)(null),f=(0,B.useCallback)(async()=>{d.current?.abort();let n=new AbortController;d.current=n,c(!0);try{let r=await Ms({projectId:e,worktreePath:t,...u?{sha:u}:{}},n.signal);if(n.signal.aborted)return;r!==null&&o(r)}catch{}finally{n.signal.aborted||c(!1)}},[e,t,u]),p=(0,B.useRef)(null);(0,B.useEffect)(()=>(p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{f()},300),()=>{p.current&&clearTimeout(p.current),d.current?.abort()}),[f,n]);let m=(0,B.useMemo)(()=>Be(a),[a]);return(0,V.jsxs)(`div`,{className:`flex h-full flex-col bg-bg-primary text-text-primary`,children:[(0,V.jsx)(i,{icon:(0,V.jsx)(h.diff,{}),title:l?`Commit`:`Diff`}),(0,V.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[r&&(0,V.jsx)(jl,{commit:r}),s?(0,V.jsx)(`div`,{className:`cm-mono p-3 text-sm text-text-secondary`,children:`Loading...`}):m.length===0?(0,V.jsx)(`div`,{className:`cm-mono p-3 text-sm text-text-secondary`,children:`No changes`}):m.map(e=>(0,V.jsx)(Ve,{file:e},`${e.status}:${e.oldPath??``}:${e.path}`))]})]})}function jl({commit:e}){let t=e.sha.slice(0,7),n=kl(e.time);return(0,V.jsxs)(`div`,{className:`border-b border-border px-3 py-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-baseline gap-2 text-sm`,children:[(0,V.jsx)(`span`,{className:`cm-mono shrink-0 text-text-secondary/70`,title:e.sha,children:t}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 break-words font-semibold text-text-primary`,children:e.subject})]}),(0,V.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-baseline gap-x-2 gap-y-1 text-xs text-text-secondary`,children:[(0,V.jsx)(`span`,{title:e.author,children:e.author}),(0,V.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,V.jsx)(`span`,{className:`cm-mono`,children:n})]})]})}var Ml=5,Nl=16,Pl=6,Fl=4,Il=2,Ll=22,q=26,J=200,Y=`gitGraph:includeRemotes:`;function X(e){return Pl+Math.min(Math.max(e,0),Ml-1)*Nl+Pl}function Z(e){return Pl+Math.min(Math.max(e,0),Ml-1)*Nl}function Rl(e){return`var(--theme-graph-branch-${e%5+1})`}var zl=`var(--theme-graph-ref-base)`,Bl=zl;function Vl(e){return e.refs.some(e=>e.type===`head`)}function Hl(e){let t=new Map(e.map(e=>[e.sha,e])),n=e.find(Vl),r=new Set,i=n;for(;i&&!r.has(i.sha);){r.add(i.sha);let e=i.parents[0];i=e?t.get(e):void 0}return r}var Ul={dot:!1,input:new Set,output:new Set};function Wl(e){let t=Hl(e),n=new Map,r=null,i=e=>{let t=n.get(e);return t||(t={dot:!1,input:new Set,output:new Set},n.set(e,t)),t},a=e=>{let t=r;if(!t)return-1;let n=e.inputSwimlanes[t.index];return n&&Jl(n,t.snapshot)?t.index:e.inputSwimlanes.findIndex(e=>e!==null&&Jl(e,t.snapshot))},o=e=>{let n=e.parents[0];if(!n||!t.has(n))return-1;let r=e.outputSwimlanes[e.lane];return r&&r.colorId===e.colorId&&r.expectingSha===n?e.lane:e.outputSwimlanes.findIndex(t=>t!==null&&t.colorId===e.colorId&&t.expectingSha===n)};for(let n of e){let e=i(n.sha),s=a(n);if(s!==-1&&e.input.add(s),t.has(n.sha)){e.dot=!0;let t=o(n);if(t!==-1){e.output.add(t);let i=n.outputSwimlanes[t];r=i?{snapshot:i,index:t}:null}else r=null;continue}if(s===-1)continue;let c=n.inputSwimlanes[s],l=c?n.outputSwimlanes.findIndex((e,t)=>t===s&&e!==null&&Jl(e,c)):-1,u=l!==-1&&c?l:c?n.outputSwimlanes.findIndex(e=>e!==null&&Jl(e,c)):-1;if(u!==-1){e.output.add(u);let t=n.outputSwimlanes[u];r=t?{snapshot:t,index:u}:null}}return n}function Gl(e,t){return t.dot?zl:Rl(e.colorId)}function Kl(e,t,n,r){if(e===n)return`M${e} ${t}V${r}`;let i=(t+r)/2;return`M${e} ${t}C${e} ${i} ${n} ${i} ${n} ${r}`}function ql(e,t,n,r){if(e===t&&t===n)return`M${e} 0V${r}`;let i=r/2,a=`M${e} 0`;if(e===t)a+=`V${i}`;else{let n=i/2;a+=`C${e} ${n} ${t} ${n} ${t} ${i}`}if(t===n)a+=`V${r}`;else{let e=(i+r)/2;a+=`C${t} ${e} ${n} ${e} ${n} ${r}`}return a}function Jl(e,t){return e.colorId===t.colorId&&e.expectingSha===t.expectingSha}function Yl(e,t,n){let{inputSwimlanes:r,outputSwimlanes:i,lane:a,sha:o}=e,s=Z(a),c=t/2,l=[],u=new Set,d=(e,t)=>{if(t!==void 0&&t>=0&&t<i.length&&!u.has(t)&&i[t]!==null&&Jl(i[t],e))return u.add(t),t;for(let t=0;t<i.length;t++){if(u.has(t))continue;let n=i[t];if(n!==null&&Jl(n,e))return u.add(t),t}return-1},f=r.findIndex(e=>e!==null&&e.expectingSha===o),p=-1;if(f!==-1){let t=i[f]??null,n=e.parents[0]??null;t!==null&&t.colorId===e.colorId&&t.expectingSha===n&&(p=f,u.add(f))}return r.forEach((e,r)=>{if(!e)return;let i=r>=Ml,u=Z(r);if(e.expectingSha===o){if(r===f&&p!==-1){let a=Z(p),o=i&&p>=Ml;l.push({d:ql(u,s,a,t),color:n.input.has(r)||n.output.has(p)?zl:Rl(e.colorId),dimmed:o})}else{let t=i&&a>=Ml;l.push({d:Kl(u,0,s,c),color:n.input.has(r)?zl:Rl(e.colorId),dimmed:t})}return}let m=d(e,r);if(m===-1)return;let h=Z(m),g=i&&m>=Ml;l.push({d:Kl(u,0,h,t),color:n.input.has(r)||n.output.has(m)?zl:Rl(e.colorId),dimmed:g})}),i.forEach((e,r)=>{if(!e||u.has(r))return;let i=Z(r),o=r>=Ml&&a>=Ml;l.push({d:Kl(s,c,i,t),color:n.output.has(r)?zl:Rl(e.colorId),dimmed:o})}),l}function Xl(e){if(typeof window>`u`)return!0;try{let t=window.localStorage.getItem(Y+e);return t===null?!0:t===`1`}catch{return!0}}function Zl(e,t){if(!(typeof window>`u`))try{window.localStorage.setItem(Y+e,t?`1`:`0`)}catch{}}function Ql(e){let t=e.lane;return e.inputSwimlanes.length-1>t&&(t=e.inputSwimlanes.length-1),e.outputSwimlanes.length-1>t&&(t=e.outputSwimlanes.length-1),t}function $l(e){return[...e].sort((e,t)=>e.label.length-t.label.length)}function eu({projectId:e,worktreePath:t,refreshSeq:n,selection:i,onSelect:a,actions:o,ahead:s,behind:c,isMobile:l,currentBranch:u}){let d=l?q:Ll,[f,p]=(0,B.useState)(null),[m,g]=(0,B.useState)(!1),[v,y]=(0,B.useState)(null),[b,x]=(0,B.useState)(()=>Xl(t)),[S,C]=(0,B.useState)(!1),[w,T]=(0,B.useState)(!1),[E,D]=(0,B.useState)(!1),[O,k]=(0,B.useState)(null),ee=(0,B.useRef)(null),A=(0,B.useRef)(null),j=(0,B.useRef)(0),te=(0,B.useRef)(null),ne=(0,B.useRef)(null),M=(0,B.useRef)(!1),N=(0,B.useCallback)(async()=>{te.current?.abort(),ne.current?.abort();let n=new AbortController;te.current=n;let r=++j.current;y(null),C(!1);try{let i=await zs({projectId:e,worktreePath:t,limit:J,includeRemotes:b,signal:n.signal});if(r!==j.current)return;p(i.commits),g(i.hasUncommitted),i.commits.length<J&&C(!0)}catch(e){if(n.signal.aborted||r!==j.current)return;y(e instanceof ks||e instanceof Error?e.message:String(e)),p([]),C(!0)}},[e,t,b]),re=(0,B.useCallback)(async()=>{if(M.current||w||S||!f||f.length===0)return;M.current=!0,ne.current?.abort();let n=new AbortController;ne.current=n;let r=j.current,i=f.length;T(!0);try{let a=await zs({projectId:e,worktreePath:t,limit:J,skip:i,includeRemotes:b,signal:n.signal});if(r!==j.current)return;p(e=>{if(!e)return a.commits;let t=new Set(e.map(e=>e.sha)),n=a.commits.filter(e=>!t.has(e.sha));return[...e,...n]}),a.commits.length<J&&C(!0)}catch(e){if(n.signal.aborted||r!==j.current)return;y(e instanceof ks||e instanceof Error?e.message:String(e)),C(!0)}finally{M.current=!1,T(!1)}},[e,t,b,f,w,S]);(0,B.useEffect)(()=>{x(Xl(t))},[t]),(0,B.useEffect)(()=>{N()},[N,n]),(0,B.useEffect)(()=>()=>{te.current?.abort(),ne.current?.abort()},[]),(0,B.useEffect)(()=>{if(!ee.current||!A.current||S)return;let e=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&re()},{root:A.current,rootMargin:`200px 0px`});return e.observe(ee.current),()=>e.disconnect()},[re,S,f?.length??0]);let ie=(0,B.useCallback)(()=>{x(e=>{let n=!e;return Zl(t,n),n})},[t]);(0,B.useEffect)(()=>{k(null)},[e,t]);let ae=(0,B.useCallback)(async n=>{if(cu(n)&&!(n.type===`local`&&n.label===u)&&!(m&&!window.confirm(`Switch branches with uncommitted changes? Git may refuse if files would be overwritten.`))){D(!0),k(null);try{if(n.type===`local`)await Ls({projectId:e,worktreePath:t,branch:n.label});else if(n.type===`remote`){let r=au(n.label);try{await Rs({projectId:e,worktreePath:t,branch:r,startPoint:n.label})}catch(n){if(!tu(n,r))throw n;await Ls({projectId:e,worktreePath:t,branch:r})}}await N()}catch(e){let t=e instanceof ks||e instanceof Error?e.message:`Branch operation failed`;k(`${n.label}: ${t}`)}finally{D(!1)}}},[u,m,e,N,t]),P=(0,B.useMemo)(()=>f===null?`loading…`:v?`error`:`${f.length} commit${f.length===1?``:`s`}${S?``:`…`}${b?` · all branches`:` · HEAD`}`,[f,v,S,b]),F=(0,B.useMemo)(()=>Wl(f??[]),[f]),I=(0,B.useMemo)(()=>ou(f??[]),[f]);return(0,V.jsxs)(`div`,{className:`flex h-full flex-col bg-bg-primary text-text-primary`,children:[(0,V.jsxs)(`div`,{ref:A,className:`cm-scroll cm-mono min-h-0 flex-1 overflow-auto py-1 text-sm`,children:[v&&(0,V.jsx)(`div`,{className:`px-3 py-2 text-xs text-danger`,children:v}),O&&(0,V.jsx)(uu,{error:O,onDismiss:()=>k(null)}),m&&(0,V.jsx)(ru,{selected:i?.kind===`working-tree`,onSelect:()=>a({kind:`working-tree`}),rowHeight:d,headLane:f?.[0]?.lane??null}),(f??[]).map((e,t)=>(0,V.jsx)(iu,{commit:e,selected:i?.kind===`commit`&&i.commit.sha===e.sha,onSelect:()=>a({kind:`commit`,commit:e}),rowHeight:d,topConnectFromAbove:m&&t===0,currentMark:F.get(e.sha)??Ul,currentBranch:u,localBranches:I,branchBusy:E,onBranchRefSelect:ae},e.sha)),f?.length===0&&!v&&(0,V.jsx)(`div`,{className:`px-3 py-3 text-xs text-text-secondary`,children:`No commits yet.`}),!S&&f&&f.length>0&&(0,V.jsx)(`div`,{ref:ee,className:`px-3 py-2 text-center text-xs text-text-secondary/60`,"aria-live":`polite`,"data-testid":`git-graph-sentinel`,children:w?`loading more…`:``})]}),(0,V.jsx)(r,{status:P,actions:(0,V.jsxs)(V.Fragment,{children:[o?.onPull&&(0,V.jsx)(nu,{onClick:o.onPull,label:`Pull`,direction:`behind`,count:c,glyph:(0,V.jsx)(h.pull,{})}),o?.onPush&&(0,V.jsx)(nu,{onClick:o.onPush,label:`Push`,direction:`ahead`,count:s,glyph:(0,V.jsx)(h.push,{})}),(0,V.jsx)(_,{onClick:ie,label:b?`Hide remote branches`:`Show remote branches`,pressed:b,"data-testid":`git-graph-toggle-remotes`,tone:b?`active`:`normal`,children:b?(0,V.jsx)(h.eye,{}):(0,V.jsx)(h.eyeOff,{})}),(0,V.jsx)(_,{onClick:()=>void N(),label:`Refresh`,children:(0,V.jsx)(h.refresh,{})})]})})]})}function tu(e,t){if(!(e instanceof ks)||e.status!==409)return!1;let n=e.message.toLowerCase();return n.includes(`already exists`)&&n.includes(t.toLowerCase())}function nu({onClick:e,label:t,direction:n,glyph:r,count:i}){let a=typeof i==`number`&&i>0,o=a?i>99?`99+`:String(i):null;return(0,V.jsxs)(_,{onClick:e,label:a?`${t} (${i} ${i===1?`commit`:`commits`} ${n})`:t,className:`relative`,children:[r,o!==null&&(0,V.jsx)(`span`,{"aria-hidden":!0,className:`absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-tag bg-accent px-1 text-[11px] leading-none font-bold text-white drop-shadow-sm`,children:o})]})}function ru({selected:e,onSelect:t,rowHeight:n,headLane:r}){let i=r??0,a=Z(i),o=X(i),s=n/2,c=Bl;return(0,V.jsxs)(`button`,{type:`button`,onClick:t,className:`flex w-full items-center gap-0 px-3 text-left ${e?`bg-row-selected-bg`:`hover:bg-row-hover-bg`}`,style:{height:n,lineHeight:`${n}px`},"data-testid":`git-graph-working-tree-row`,children:[(0,V.jsxs)(`svg`,{"aria-hidden":!0,width:o,height:n,className:`flex-none`,style:{overflow:`visible`},shapeRendering:`geometricPrecision`,children:[c!==null&&(0,V.jsx)(`path`,{d:`M${a} ${s}V${n}`,stroke:c,strokeWidth:Il,strokeLinecap:`round`,fill:`none`}),(0,V.jsx)(`circle`,{cx:a,cy:s,r:Fl,fill:`var(--color-bg-primary)`,stroke:Bl,strokeWidth:1.5,strokeDasharray:`1.4 1`})]}),(0,V.jsx)(`span`,{className:`ml-2 min-w-0 flex-1 truncate text-text-primary`,style:{fontWeight:e?600:500},children:`Working tree (uncommitted)`})]})}function iu({commit:e,selected:t,onSelect:n,rowHeight:r,topConnectFromAbove:i=!1,currentMark:a,currentBranch:o,localBranches:s,branchBusy:c,onBranchRefSelect:l}){let u=Yl(e,r,a),d=Z(e.lane),f=Gl(e,a),p=e.lane>=Ml,m=Vl(e),h=$l(e.refs),g=i?{d:`M${d} 0V${r/2}`,color:f}:null,_=X(Ql(e));return(0,V.jsxs)(`div`,{className:`flex w-full items-center gap-2 px-3 ${t?`bg-row-selected-bg`:`hover:bg-row-hover-bg`}`,style:{height:r,lineHeight:`${r}px`},"data-testid":`git-graph-commit-row`,"data-lane":e.lane,"data-color-id":e.colorId,"data-head":m?`1`:void 0,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:n,className:`flex min-w-0 flex-1 items-center gap-2 text-left`,children:[(0,V.jsxs)(`svg`,{"aria-hidden":!0,width:_,height:r,className:`flex-none`,style:{overflow:`visible`},shapeRendering:`geometricPrecision`,children:[g!==null&&(0,V.jsx)(`path`,{d:g.d,stroke:g.color,strokeWidth:Il,strokeLinecap:`round`,fill:`none`},`${e.sha}-top-from-above`),u.map(t=>(0,V.jsx)(`path`,{d:t.d,stroke:t.color,strokeWidth:Il,strokeLinecap:`round`,fill:`none`,opacity:t.dimmed?.35:1},`${e.sha}:${t.d}:${t.color}:${t.dimmed?`dim`:`full`}`)),m?(0,V.jsx)(`circle`,{cx:d,cy:r/2,r:Fl,fill:`var(--color-bg-primary)`,stroke:f,strokeWidth:2,opacity:p?.55:1}):(0,V.jsx)(`circle`,{cx:d,cy:r/2,r:Fl,fill:f,stroke:`none`,opacity:p?.55:1})]}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,style:{fontWeight:t?600:400},children:e.subject})]}),h.length>0&&(0,V.jsx)(`span`,{className:`flex-none flex flex-row items-center gap-1 overflow-hidden`,style:{maxWidth:`60%`},children:h.map(t=>(0,V.jsx)(fu,{ref:t,laneColor:f,current:su(t,o,s),localBranches:s,busy:c,onSelect:l},`${e.sha}:${t.type}:${t.label}`))})]})}function au(e){let t=e.split(`/`).filter(Boolean);return t.length>1?t.slice(1).join(`/`):e}function ou(e){let t=new Set;for(let n of e)for(let e of n.refs)e.type===`local`&&t.add(e.label);return t}function su(e,t,n){if(!t)return!1;if(e.type===`local`)return e.label===t;if(e.type!==`remote`)return!1;let r=au(e.label);return n.has(r)&&r===t}function cu(e){return e.type===`local`||e.type===`remote`&&!lu(e)}function lu(e){return e.type===`remote`&&e.label.endsWith(`/HEAD`)}function uu({error:e,onDismiss:t}){return(0,V.jsx)(`div`,{className:`mx-2 mb-1 rounded-control border border-danger/40 bg-bg-secondary px-2 py-1.5 text-xs text-text-primary`,children:(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,V.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-danger`,children:e}),(0,V.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Dismiss branch error`,className:`shrink-0 rounded-control px-2 py-1 text-text-secondary hover:bg-row-hover-bg hover:text-text-primary`,children:`Dismiss`})]})})}function du(e,t){if(e.type===`head`)return{color:`var(--color-bg-primary)`,background:t,border:`none`};let n=e.type===`remote`?`dashed`:e.type===`tag`?`dotted`:`solid`;return{color:t,background:`color-mix(in oklab, ${t} 14%, transparent)`,border:`1px ${n} color-mix(in oklab, ${t} 45%, transparent)`}}function fu({ref:e,laneColor:n,current:r=!1,localBranches:i,busy:a=!1,onSelect:o}){let s=`cm-mono inline-block rounded-tag px-[5px] align-[1px] text-xs whitespace-nowrap`;return cu(e)&&o?(0,V.jsx)(t,{items:pu(e,r,i,a,o),align:`start`,portal:!0,renderTrigger:({open:t,toggle:i,triggerRef:a,menuId:o})=>(0,V.jsx)(`button`,{ref:a,type:`button`,"data-ref-type":e.type,"data-current-branch":r?`1`:void 0,className:`${s} cursor-pointer hover:brightness-125`,style:du(e,n),"aria-haspopup":`menu`,"aria-expanded":t,"aria-controls":o,"aria-label":`Branch actions for ${e.label}`,onClick:e=>{e.stopPropagation(),i()},children:e.label})}):(0,V.jsx)(`span`,{"data-ref-type":e.type,className:s,style:du(e,n),children:e.label})}function pu(e,t,n,r,i){if(e.type===`local`)return[{id:`switch`,label:t?`Current branch`:`Switch`,disabled:t||r,onSelect:()=>{i(e)}}];if(e.type===`remote`){let a=au(e.label);return n.has(a)?[{id:`switch`,label:t?`Current branch`:`Switch`,disabled:t||r,onSelect:()=>{i({label:a,type:`local`})}}]:[{id:`create-switch`,label:`Create & switch`,disabled:r,onSelect:()=>{i(e)}}]}return[]}function mu({projectId:e,projectPath:t}){let[n,r]=(0,B.useState)(!1),[i,o]=(0,B.useState)(null);async function s(){r(!0),o(null);try{await Bs(e),ho({tone:`ok`,title:`Initialized git repository`,sub:t??void 0,mono:!0,durationMs:4e3})}catch(e){o(e instanceof ks||e instanceof Error?e.message:`git init failed`)}finally{r(!1)}}return(0,V.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 bg-bg-primary p-8 text-center`,children:[(0,V.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,V.jsx)(`span`,{className:`cm-mono text-sm font-semibold tracking-[-0.005em] text-text-primary`,children:`No git repository`}),(0,V.jsx)(`span`,{className:`text-sm text-text-secondary`,children:`This project is not a git repository yet.`}),t&&(0,V.jsx)(`span`,{className:`cm-mono mt-0.5 truncate text-xs text-text-secondary/70`,children:t})]}),(0,V.jsx)(a,{kind:`submit`,size:`sm`,onClick:()=>void s(),disabled:n,children:n?`Initializing…`:`Initialize git repository`}),i&&(0,V.jsx)(`span`,{className:`text-xs text-danger`,role:`alert`,children:i})]})}function hu({projectId:e,worktreePath:t,fileChangeSeq:n,files:o,busy:s,error:c,onClearError:l,onSubmit:u}){let[d,f]=(0,B.useState)(``),[p,m]=(0,B.useState)(()=>new Set(o.map(e=>e.path))),[g,_]=(0,B.useState)(``),v=(0,B.useRef)(null);(0,B.useEffect)(()=>{if(o.length===0){_(``);return}v.current?.abort();let n=new AbortController;return v.current=n,Ms({projectId:e,worktreePath:t},n.signal).then(e=>{e===null||n.signal.aborted||_(e)}).catch(()=>{}),()=>{n.abort()}},[e,t,n,o.length]);let y=(0,B.useMemo)(()=>{let e=new Map;for(let t of Be(g))e.set(t.path,t);return e},[g]);(0,B.useEffect)(()=>{let e=new Set(o.map(e=>e.path));m(t=>{let n=new Set;for(let r of t)e.has(r)&&n.add(r);for(let e of o)t.has(e.path)||n.add(e.path);return n})},[o]);let b=d.trim(),x=!s&&b.length>0&&p.size>0,S=Math.max(0,(d.split(`
34
+ `,1)[0]?.length??0)-72);function C(e){m(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function w(e){m(e?new Set(o.map(e=>e.path)):new Set)}function T(){x&&(u({message:b,paths:Array.from(p)}),f(``))}return(0,V.jsxs)(`div`,{className:`flex h-full flex-col bg-bg-primary text-text-primary`,children:[(0,V.jsx)(i,{icon:(0,V.jsx)(h.diff,{}),iconTone:`warning`,title:`Working tree`}),o.length===0?(0,V.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-4 text-center text-sm text-text-secondary`,children:`No uncommitted changes.`}):(0,V.jsx)(Ke,{files:o,selected:p,toggle:C,toggleAll:w,message:d,setMessage:f,layout:`inline`,diffsByPath:y}),c&&(0,V.jsxs)(`div`,{className:`flex items-start gap-2 bg-danger/10 px-3 py-2 text-xs text-danger`,children:[(0,V.jsx)(`span`,{className:`flex-1`,children:c}),(0,V.jsx)(`button`,{type:`button`,onClick:l,"aria-label":`Dismiss`,className:`text-danger/80 hover:text-danger`,children:(0,V.jsx)(h.close,{})})]}),(0,V.jsx)(r,{status:(0,V.jsxs)(V.Fragment,{children:[p.size,`/`,o.length,` selected`,S>0&&(0,V.jsxs)(`span`,{className:`ml-3 text-danger`,children:[`subject +`,S,` over`]})]}),actions:(0,V.jsx)(a,{kind:`submit`,onClick:T,disabled:!x,className:`shrink-0`,children:s?`Committing…`:`Commit`})})]})}function gu(e,t){return[e,t?.branch??``,t?.ahead??``,t?.behind??``,t?.dirtyCount??``,t?.isRepo===!1?`non-repo`:`repo`].join(`:`)}function _u({projectId:e,worktreePath:t,fileChangeSeq:n,isMobile:r,gitState:i,projectPath:a,selection:o,onSelectionChange:s,commitBusy:c,commitError:l,onClearCommitError:u,onSubmitInlineCommit:d,onChangeTab:f,gitActions:p}){let m=(0,B.useMemo)(()=>{let e=i?.fileStatuses;return e?Object.entries(e).map(([e,t])=>({path:e,status:t})).sort((e,t)=>e.path.localeCompare(t.path)):[]},[i?.fileStatuses]);if(i?.isRepo===!1)return(0,V.jsx)(mu,{projectId:e,projectPath:a});let h=o?.kind===`working-tree`,g=gu(n,i);return(0,V.jsx)(pl,{storageKey:`worktree`,defaultRatio:Oe,isMobile:r,secondaryActive:o!==null,primary:(0,V.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,V.jsx)(`div`,{className:`hidden h-bar shrink-0 border-b border-border bg-tab-strip-bg md:block`,children:(0,V.jsx)(wl,{activeTab:`git`,onChangeTab:f})}),(0,V.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,V.jsx)(eu,{projectId:e,worktreePath:t,refreshSeq:g,selection:o,onSelect:s,isMobile:r,currentBranch:i?.branch,ahead:i?.ahead,behind:i?.behind,...p&&{actions:p}})})]}),secondary:h?(0,V.jsx)(hu,{projectId:e,worktreePath:t,fileChangeSeq:n,files:m,busy:c,error:l,onClearError:u,onSubmit:e=>void d(e)}):(0,V.jsx)(Al,{projectId:e,worktreePath:t,fileChangeSeq:n,commit:o?.kind===`commit`?o.commit:null})})}var vu=350,yu=5;function bu(e,t){let[n,r]=(0,B.useState)(!1),i=(0,B.useRef)(!1),a=(0,B.useRef)(null),o=(0,B.useRef)(null),s=(0,B.useCallback)(()=>{o.current&&=(clearTimeout(o.current),null),a.current=null,i.current=!1,r(!1)},[]);return(0,B.useEffect)(()=>()=>s(),[s]),{onTouchStart:(0,B.useCallback)(t=>{if(!e)return;let n=t.touches[0];if(n){if(o.current&&=(clearTimeout(o.current),null),t.touches.length>1){a.current=null,i.current=!1,r(!1);return}a.current={x:n.clientX,y:n.clientY},i.current=!1,r(!1),o.current=setTimeout(()=>{i.current=!0,r(!0)},vu)}},[e]),onTouchMove:(0,B.useCallback)(e=>{let t=a.current;if(!t)return;let n=e.touches[0];if(!n)return;let r=n.clientX-t.x,i=n.clientY-t.y;Math.hypot(r,i)>yu&&s()},[s]),onTouchEnd:(0,B.useCallback)(n=>{if(!i.current||!e){s();return}n.preventDefault(),s(),xu(e,t)},[s,e,t]),onTouchCancel:(0,B.useCallback)(()=>{s()},[s]),armed:n}}async function xu(e,t){try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(e);else{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),document.body.removeChild(t)}Qa(t?`Copied ${t}`:`Copied`)}catch{Qa(`Copy failed`)}}function Su({crumbs:e,onBack:t,onToggleDrawer:n,view:r,onChangeView:i,dirty:a,pin:o,onClose:s,moreMenuItems:c}){let l=(a??0)>0,u=new Map;return(0,V.jsxs)(`div`,{className:`relative shrink-0 border-b border-border bg-bg-secondary`,role:`toolbar`,"aria-label":`Workspace`,children:[(0,V.jsxs)(`div`,{className:`flex h-bar items-center gap-2 px-2 md:px-3`,children:[t?(0,V.jsx)(_,{onClick:t,label:`Back`,size:`md`,tone:`active`,className:`md:hidden`,children:(0,V.jsx)(h.back,{})}):(0,V.jsx)(_,{onClick:n,label:`Go to sessions`,size:`md`,tone:`active`,className:`md:hidden`,children:(0,V.jsx)(h.menu,{})}),(0,V.jsx)(`div`,{className:`-ml-2 flex min-w-0 flex-1 items-center gap-1 text-sm font-semibold tracking-[-0.005em] md:ml-0 md:gap-1.5 md:px-1`,children:e.map((t,n)=>{let r=n===e.length-1,i=u.get(t.label)??0;return u.set(t.label,i+1),(0,V.jsx)(Cu,{crumb:t,showSep:n>0,isLast:r,trailing:r&&o?(0,V.jsx)(xo,{pinned:o.pinned,onToggle:o.onToggle}):void 0},`${t.label}:${i}`)})}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[l&&(0,V.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1.5 px-1 text-sm font-medium text-[var(--theme-git-modified)]`,title:`${a} uncommitted changes`,children:[(0,V.jsx)(`span`,{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-tag bg-[var(--theme-git-modified)]`}),a,`Δ`]}),s&&(0,V.jsx)(Nc,{onClick:s}),c&&c.length>0&&(0,V.jsx)(p,{align:`end`,items:c,renderTrigger:({toggle:e,triggerRef:t,menuId:n,open:r})=>(0,V.jsx)(_,{ref:t,onClick:e,"aria-haspopup":`menu`,"aria-expanded":r,"aria-controls":n,label:`Workspace menu`,size:`md`,children:(0,V.jsx)(h.more,{})})})]})]}),r!==void 0&&i?(0,V.jsx)(`div`,{className:`h-bar border-t border-border bg-tab-strip-bg md:hidden`,children:(0,V.jsx)(wl,{activeTab:r,onChangeTab:i})}):null]})}function Cu({crumb:e,showSep:t,isLast:n,trailing:r}){let i=bu(e.label,`name`);return(0,V.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,style:{flex:n?`1 1 auto`:`0 1 auto`},children:[t&&(0,V.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-text-secondary/50`,children:`·`}),e.glyph&&(0,V.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 ${e.dim?`text-text-secondary/70`:`text-accent`}`,children:e.glyph}),(0,V.jsx)(`span`,{title:e.label,onTouchStart:i.onTouchStart,onTouchMove:i.onTouchMove,onTouchEnd:i.onTouchEnd,onTouchCancel:i.onTouchCancel,className:`min-w-0 truncate transition-opacity ${e.dim?`font-medium text-text-secondary/70`:`text-text-primary`} ${i.armed?`opacity-60`:`opacity-100`}`,style:{maxWidth:e.maxWidth},children:e.label}),r]})}function wu({value:e,onSave:t}){let[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)(e),[o,s]=(0,B.useState)(null),c=(0,B.useRef)(null),l=(0,B.useRef)(!1);(0,B.useEffect)(()=>{n||a(e)},[n,e]),(0,B.useEffect)(()=>{if(!n||c.current&&document.activeElement===c.current)return;let e=requestAnimationFrame(()=>{c.current?.focus(),c.current?.select()});return()=>cancelAnimationFrame(e)},[n]);let u=(0,B.useCallback)(()=>{(0,nn.flushSync)(()=>r(!0)),c.current?.focus(),c.current?.select()},[]),d=async()=>{let n=i.trim();if(r(!1),s(null),n!==e.trim())try{await t(n)}catch(t){s(t instanceof Error?t.message:`Rename failed`),a(e)}};return n?(0,V.jsx)(`input`,{ref:c,value:i,"aria-label":`Terminal title`,title:o??void 0,onChange:e=>a(e.currentTarget.value),onBlur:()=>{if(l.current){l.current=!1;return}d()},onKeyDown:t=>{t.key===`Enter`?(t.preventDefault(),d()):t.key===`Escape`&&(t.preventDefault(),l.current=!0,a(e),r(!1),s(null))},className:`h-7 min-w-0 flex-shrink rounded-control border border-accent bg-bg-primary px-1.5 text-sm font-semibold text-text-primary outline-none`}):(0,V.jsx)(`button`,{type:`button`,"aria-label":`Rename terminal`,title:o??e,onClick:u,className:`min-w-0 flex-shrink truncate rounded-control px-1 text-left text-sm font-semibold text-text-primary hover:bg-row-hover-bg focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent ${o?`text-danger`:``}`,children:e})}var Tu=(0,B.lazy)(()=>Do(async()=>{let{TerminalPane:e}=await import(`./TerminalPane-CjbYzePr.js`);return{TerminalPane:e}},__vite__mapDeps([0])).then(({TerminalPane:e})=>({default:e})));function Eu({paneId:e,state:t,worktreePath:n,session:r,pin:a,onClose:o,onRestartSession:s,onRenameSession:c,onOpenUrl:l,onOpenFilePath:u,onClosePane:d}){let f=wt(r,`shell`),p=r!==void 0&&r.state!==`ended`;return(0,V.jsxs)(`div`,{className:`flex h-full min-h-0 w-full flex-col`,children:[(0,V.jsx)(i,{icon:(0,V.jsx)(h.terminal,{}),title:f,titleAttr:f,titleElement:r?(0,V.jsx)(wu,{value:f,onSave:e=>c(r.id,e)}):void 0,actions:(0,V.jsxs)(V.Fragment,{children:[p&&(0,V.jsx)(Ou,{sessionId:r.id,paneId:e}),a&&(0,V.jsx)(xo,{pinned:a.pinned,onToggle:a.onToggle}),o&&(0,V.jsx)(Nc,{onClick:o})]})}),(0,V.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(`div`,{className:`h-full bg-bg-terminal`}),children:(0,V.jsx)(Tu,{paneId:e,sessionId:t.sessionId,session:r,onRestartSession:s,onOpenUrl:l,worktreePath:n,onOpenFilePath:u,onClosePane:d})})})]})}function Du(e){switch(e){case`busy`:return`Capturing terminal diagnostics`;case`ok`:return`Captured terminal diagnostics`;case`error`:return`Failed to capture terminal diagnostics`;case`idle`:return`Capture terminal diagnostics`}}function Ou({sessionId:e,paneId:t}){let[n,r]=(0,B.useState)(`idle`),i=Du(n);return(0,V.jsx)(_,{label:i,title:i,tone:n===`ok`?`accent`:n===`error`?`danger`:`normal`,disabled:n===`busy`,onMouseDown:e=>e.preventDefault(),onTouchStart:e=>e.preventDefault(),onClick:()=>{r(`busy`),window.parasorTerminalTrace?.captureTerminalInput(`manual-terminal-button`,{sessionId:e,paneId:t}).then(()=>r(`ok`)).catch(()=>r(`error`))},children:(0,V.jsx)(h.doc,{})})}function ku({children:e}){return(0,V.jsx)(`div`,{className:`flex h-full min-h-0 w-full flex-col`,children:(0,V.jsx)(`div`,{className:`min-h-0 flex-1`,children:e})})}function Au({activeProjectId:e,hydrated:t,onNewProject:n}){return t?(0,V.jsxs)(`div`,{className:`relative flex h-full items-center justify-center px-10`,children:[(0,V.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0 opacity-30`,style:{backgroundImage:`linear-gradient(var(--color-border) 1px, transparent 1px), linear-gradient(90deg, var(--color-border) 1px, transparent 1px)`,backgroundSize:`42px 42px`,maskImage:`radial-gradient(ellipse 60% 60% at 50% 45%, #000, transparent)`,WebkitMaskImage:`radial-gradient(ellipse 60% 60% at 50% 45%, #000, transparent)`}}),(0,V.jsxs)(`div`,{className:`relative max-w-surface-md text-center`,children:[(0,V.jsx)(`p`,{className:`mb-3.5 text-[32px] font-normal leading-none tracking-normal text-text-primary`,children:`parasor`}),e?(0,V.jsxs)(`p`,{className:`mx-auto max-w-[440px] text-base leading-[1.6] text-text-secondary`,children:[`Pick a worktree from the sidebar, or filter it with`,` `,(0,V.jsxs)(`span`,{className:`inline-flex shrink-0 gap-[3px] align-middle`,children:[(0,V.jsx)(C,{children:`⌘`}),(0,V.jsx)(C,{children:`K`})]}),`.`]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`mb-7 text-base leading-[1.6] text-text-secondary`,children:`No project yet. Add one to get started.`}),(0,V.jsx)(a,{kind:`submit`,size:`sm`,onClick:n,children:`New Project…`})]})]})]}):(0,V.jsx)(`div`,{className:`h-full w-full`})}function ju(e){let t=e.replace(/\/+$/,``).split(`/`);return t[t.length-1]??e}function Mu(e){return`files:${e}`}function Nu({activeProjectId:e,activeProjectName:t,activeProjectPath:n,activeProjectIsRepo:r,allPanes:i=[],focusedPane:a,focusedWorktreeDirName:o,fileChangeSeq:s,gitState:c,hydrated:l,isMobile:u,gitMenuActions:d,gitGraphSelection:f,onGitGraphSelectionChange:p,gitBranchName:m,commitBusy:h,commitError:g,onClearCommitError:_,onSubmitInlineCommit:v,sessions:y,onToggleDrawer:b,onClosePane:x,onRequestClosePane:S,onNewProject:C,onOpenUrl:w,onBrowserUrlChange:T,onRestartSession:E,onRenameSession:D,onSelectWorktreeTab:O,onToggleSessionPin:k,onOpenWorktreeInFinder:ee,onOpenWorktreeInIde:A,ideCommands:j=[],canOpenLocalIde:te=!1,onCopyWorktreePath:ne,onRenameWorktree:M,onRemoveWorktree:N,onDeleteProject:re}){let ie=c?.fileStatuses,ae=c?.dirtyCount??0,P=c?{ahead:c.ahead,behind:c.behind,dirty:c.dirtyCount}:void 0,F=a?.state.kind===`files`?a:null,I=a?.state.kind===`git`?a:null,L=F??I,R=F!==null,oe=I!==null,se=L!==null,[ce,le]=Sl(F?.id??null),ue=R&&ce!==null,de=oe&&f!==null,fe=ue?ju(ce):de?Lu(f):a?Ru(a,y):null,pe=zu(t,o,!!a&&!!n&&a.worktreePath===n,r,m),me=L&&!ue&&!de?L.state.kind:void 0,he=L&&!ue&&!de?e=>O(L.worktreePath,e):void 0,z=ue?()=>le(null):de?()=>p(null):null,ge=a?.state.kind===`terminal`||a?.state.kind===`browser`?a.state.kind:null,_e=a&&ge?()=>S(a.id,ge,fe??`pane`):void 0,ve=a?.state.kind===`terminal`?a.state:null,ye=ve?y.find(e=>e.id===ve.sessionId):void 0,be=ye?{pinned:ye.pinned===!0,onToggle:()=>void k(ye.id)}:null,xe=a?.state.kind===`terminal`||a?.state.kind===`browser`,Se=xe?null:be,Ce=xe?void 0:_e,we=i.length>0?i:a?[a]:[],Te=(e,t)=>{bl(Mu(e),t),O(e,`files`)};kc(u?z:null);let Ee=(0,B.useMemo)(()=>{if(!a||!e)return[];let t=a.worktreePath,n=o??`main`,i=[];if(ee&&i.push({id:`open-finder`,label:`Open in Finder`,onSelect:()=>ee(e,t)}),A){let n=!te,r=n?`Available when parasor is opened from localhost on the server machine`:void 0;i.push({id:`open-cursor`,label:`Open in Cursor`,disabled:n,title:r,onSelect:()=>A(e,t,`cursor`)},{id:`open-vscode`,label:`Open in VS Code`,disabled:n,title:r,onSelect:()=>A(e,t,`vscode`)});for(let a of j)i.push({id:`open-custom-ide:${a.id}`,label:`Open in ${a.label}`,disabled:n,title:r,onSelect:()=>A(e,t,a.id)})}return ne&&i.push({id:`copy-path`,label:`Copy path`,onSelect:()=>ne(t)}),r&&M&&i.push({id:`rename`,label:`Rename branch…`,onSelect:()=>M(e,t,n)}),r&&N&&i.push({id:`remove`,label:`Remove worktree…`,onSelect:()=>N(e,t,n)}),re&&i.push({id:`close-project`,label:`Close project…`,onSelect:()=>re(e)}),i},[a,e,r,o,ee,A,j,te,ne,M,N,re]);return(0,V.jsxs)(`main`,{className:`flex-1 min-w-0 bg-bg-terminal flex flex-col touch-pan-y`,children:[a&&(0,V.jsx)(Su,{crumbs:pe,onBack:z,onToggleDrawer:b,view:me,onChangeView:he,dirty:se?ae:void 0,pin:Se,onClose:Ce,moreMenuItems:Ee}),(0,V.jsx)(`div`,{className:`relative flex-1 overflow-hidden`,children:a&&e?(0,V.jsxs)(V.Fragment,{children:[a.state.kind!==`terminal`&&(0,V.jsx)(`div`,{className:`absolute inset-0 min-h-0 min-w-0`,children:(0,V.jsx)(Iu,{activeProjectId:e,activeProjectPath:n,focusedPane:a,focusedWorktreeDirName:o,fileChangeSeq:s,gitState:c,gitFileStatuses:ie,gitBranchName:m,counters:P,gitMenuActions:d,gitGraphSelection:f,onGitGraphSelectionChange:p,commitBusy:h,commitError:g,onClearCommitError:_,onSubmitInlineCommit:v,isMobile:u,sessions:y,terminalPin:be,terminalOnClose:_e,browserOnClose:_e,onClosePane:x,onOpenUrl:w,onBrowserUrlChange:T,onRestartSession:E,onRenameSession:D,onSelectWorktreeTab:O})}),(0,V.jsx)(Pu,{panes:we,focusedPaneId:a.id,sessions:y,pin:be,onClose:_e,onClosePane:x,onOpenUrl:w,onOpenFilePath:Te,onRestartSession:E,onRenameSession:D})]}):(0,V.jsx)(Au,{activeProjectId:e,hydrated:l,onNewProject:C})})]})}function Pu({panes:e,focusedPaneId:t,sessions:n,pin:r,onClose:i,onClosePane:a,onOpenUrl:o,onOpenFilePath:s,onRestartSession:c,onRenameSession:l}){return(0,V.jsx)(V.Fragment,{children:e.filter(e=>e.state.kind===`terminal`&&e.id===t).map(e=>{if(e.state.kind!==`terminal`)return null;let t=e.state;return(0,V.jsx)(Fu,{pane:e,state:t,session:n.find(e=>e.id===t.sessionId),pin:r,onClose:i,onClosePane:a,onOpenUrl:o,onOpenFilePath:s,onRestartSession:c,onRenameSession:l},e.id)})})}function Fu({pane:e,state:t,session:n,pin:r,onClose:i,onClosePane:a,onOpenUrl:o,onOpenFilePath:s,onRestartSession:c,onRenameSession:l}){let u=(0,B.useRef)(null);return(0,B.useEffect)(()=>{T(`terminal-layer-visibility`,{sessionId:t.sessionId,paneId:e.id,visible:!0});let n=window.requestAnimationFrame(()=>{let n=u.current?.getBoundingClientRect();T(`terminal-layer-layout`,{sessionId:t.sessionId,paneId:e.id,visible:!0,width:n?.width??0,height:n?.height??0})});return()=>window.cancelAnimationFrame(n)},[e.id,t.sessionId]),(0,V.jsx)(`div`,{ref:u,className:`pointer-events-auto absolute inset-0 min-h-0 min-w-0`,children:(0,V.jsx)(Eu,{paneId:e.id,state:t,worktreePath:e.worktreePath,session:n,pin:r,onClose:i,onClosePane:a,onOpenUrl:o,onOpenFilePath:t=>s(e.worktreePath,t),onRestartSession:c,onRenameSession:l})})}function Iu({activeProjectId:e,activeProjectPath:t,focusedPane:n,focusedWorktreeDirName:r,fileChangeSeq:i,gitState:a,gitFileStatuses:o,counters:s,gitMenuActions:c,gitGraphSelection:l,onGitGraphSelectionChange:u,commitBusy:d,commitError:f,onClearCommitError:p,onSubmitInlineCommit:m,isMobile:h,sessions:g,terminalPin:_,terminalOnClose:v,browserOnClose:y,onClosePane:b,onOpenUrl:x,onBrowserUrlChange:S,onRestartSession:C,onRenameSession:w,onSelectWorktreeTab:T}){let{state:E}=n;switch(E.kind){case`files`:return(0,V.jsx)(ku,{activeTab:`files`,worktreeName:r,worktreePath:n.worktreePath,counters:s,children:(0,V.jsx)(El,{paneId:n.id,projectId:e,worktreePath:n.worktreePath,fileChangeSeq:i,gitFileStatuses:o,isMobile:h,onChangeTab:e=>T(n.worktreePath,e)})});case`terminal`:{let e=g.find(e=>e.id===E.sessionId);return(0,V.jsx)(Eu,{paneId:n.id,state:E,worktreePath:n.worktreePath,session:e,pin:_,onClose:v,onClosePane:b,onOpenUrl:x,onOpenFilePath:e=>{bl(Mu(n.worktreePath),e),T(n.worktreePath,`files`)},onRestartSession:C,onRenameSession:w})}case`browser`:return(0,V.jsx)(Pc,{state:E,paneId:n.id,onClose:y,onUrlChange:S?e=>S(n.id,e):void 0});case`git`:return(0,V.jsx)(ku,{activeTab:`git`,worktreeName:r,worktreePath:n.worktreePath,counters:s,children:(0,V.jsx)(_u,{projectId:e,worktreePath:n.worktreePath,fileChangeSeq:i,isMobile:h,gitState:a,projectPath:t,selection:l,onSelectionChange:u,commitBusy:d,commitError:f,onClearCommitError:p,onSubmitInlineCommit:m,onChangeTab:e=>T(n.worktreePath,e),...c&&{gitActions:c}})})}}function Lu(e){return e.kind===`working-tree`?`Working tree`:e.commit.sha.slice(0,7)}function Ru(e,t){let{state:n}=e;if(n.kind===`terminal`)return wt(t.find(e=>e.id===n.sessionId));if(n.kind===`browser`)try{return new URL(n.url).host||n.url}catch{return n.url}return null}function zu(e,t,n,r,i){let a=[];if(e&&a.push({label:e,maxWidth:96}),t){let e=r?n?(0,V.jsx)(h.worktreeActive,{}):(0,V.jsx)(h.worktreeInactive,{}):(0,V.jsx)(h.folder,{});a.push({label:t,dim:!0,maxWidth:96,glyph:e})}return i&&a.push({label:i,dim:!0,glyph:(0,V.jsx)(h.branch,{})}),a.length===0&&a.push({label:`parasor`}),a}async function Bu(e,t){let n=await O(`/api/projects/${e}/worktrees`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({branch:t.branch,...t.base.length>0&&{base:t.base},...t.copyLocalFiles.length>0&&{copyLocalFiles:t.copyLocalFiles},...t.rememberLocalFiles&&{rememberLocalFiles:!0}})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`Request failed (${n.status})`)}let r=await n.json().catch(()=>({})),i=r.path;if(!i)throw Error(`Worktree response missing path`);return{path:i,localFileCopies:r.localFileCopies}}async function Vu(e){let t=await O(`/api/projects/${encodeURIComponent(e)}/worktree-local-files`);if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`Request failed (${t.status})`)}return await t.json()}function Hu(e,t){return O(`/api/projects/${e}/worktrees`,{signal:t})}var Uu=200,Q=`parasor:store-cache`,Wu=6,Gu={projects:[],projectStates:{},sessions:[],agentStates:{},notifications:[],ports:{},gitStates:{},serviceConfig:{preventIdleSleep:!1,portDetection:`all-interfaces`,dropSizeMaxBytes:Fe,dropSizeHardMaxBytes:Ie},paneCommands:[],ideCommands:[],hostPlatform:null,fileChangeSeq:0,worktrees:{},pendingOpenUrl:null,connected:!1,hydrated:!1,snapshotApplied:!1};function Ku(e,t){switch(t.type){case`session-created`:return{...e,sessions:[...e.sessions,t.session]};case`session-closed`:{let n={...e.agentStates};return delete n[t.sessionId],{...e,sessions:e.sessions.filter(e=>e.id!==t.sessionId),agentStates:n}}case`session-restarted`:{let n=e.sessions.find(e=>e.id===t.session.id);return n&&t.generation<n.generation?e:{...e,sessions:e.sessions.map(e=>e.id===t.session.id?t.session:e)}}case`session-ended`:{let n=e.sessions.find(e=>e.id===t.sessionId);return n&&t.generation<n.generation?e:{...e,sessions:e.sessions.map(e=>e.id===t.sessionId?{...e,state:`ended`,pid:null,endedAt:Date.now(),endReason:t.endReason}:e)}}case`agent-state`:return{...e,agentStates:{...e.agentStates,[t.state.sessionId]:t.state}};case`notification`:{let n=[t.notification,...e.notifications];return n.length>Uu&&(n.length=Uu),{...e,notifications:n}}case`project-created`:{let n=e.projects.some(e=>e.id===t.project.id)?e.projects.map(e=>e.id===t.project.id?t.project:e):[...e.projects,t.project],r=t.project.id in e.projectStates?e.projectStates:{...e.projectStates,[t.project.id]:{projectId:t.project.id,layout:null,worktrees:[],openFiles:[],lastFocusedPaneId:null,focusedPaneId:null,lastAccessedAt:t.project.createdAt}};return{...e,projects:n,projectStates:r}}case`project-updated`:return{...e,projects:e.projects.map(e=>e.id===t.project.id?t.project:e)};case`project-deleted`:{let n=new Set(e.sessions.filter(e=>e.projectId===t.projectId).map(e=>e.id)),r={...e.agentStates};for(let e of n)delete r[e];let{[t.projectId]:i,...a}=e.projectStates,{[t.projectId]:o,...s}=e.worktrees,{[t.projectId]:c,...l}=e.gitStates;return{...e,projects:e.projects.filter(e=>e.id!==t.projectId),sessions:e.sessions.filter(e=>e.projectId!==t.projectId),projectStates:a,agentStates:r,gitStates:l,worktrees:s}}case`layout-updated`:{let n=e.projectStates[t.projectId];return n?{...e,projectStates:{...e.projectStates,[t.projectId]:{...n,layout:t.layout}}}:e}case`ports-updated`:return{...e,ports:{...e.ports,[t.projectId]:t.ports}};case`git-state`:{let n={...e.gitStates[t.projectId]??{},[t.worktreePath]:t.state};return{...e,gitStates:{...e.gitStates,[t.projectId]:n}}}case`session-cwd-changed`:return{...e,sessions:e.sessions.map(e=>e.id===t.sessionId?{...e,cwd:t.cwd}:e)};case`session-title-changed`:return{...e,sessions:e.sessions.map(e=>{if(e.id!==t.sessionId)return e;if(t.titleManual===!0)return{...e,title:t.title,titleManual:!0};let{titleManual:n,...r}=e;return{...r,title:t.title}})};case`session-pin-changed`:return{...e,sessions:e.sessions.map(e=>{if(e.id!==t.sessionId)return e;if(t.pinned)return{...e,pinned:!0};let{pinned:n,...r}=e;return r})};case`file-change`:case`gitignore-updated`:return{...e,fileChangeSeq:e.fileChangeSeq+1};case`browser-url-changed`:return{...e,pendingOpenUrl:t.url};case`service-config-changed`:return{...e,serviceConfig:t.config};case`pane-commands-changed`:return{...e,paneCommands:t.commands};case`ide-commands-changed`:return{...e,ideCommands:t.commands};case`worktree-created`:{if(!e.projects.some(e=>e.id===t.projectId))return e;let n=e.worktrees[t.projectId]??[],r=n.findIndex(e=>e.path===t.worktree.path),i=r===-1?[...n,t.worktree]:n.map((e,n)=>n===r?{...e,...t.worktree}:e);return{...e,worktrees:{...e.worktrees,[t.projectId]:i}}}case`worktree-renamed`:{let n=e.worktrees[t.projectId];if(!n)return e;let r=n.map(e=>e.path===t.worktreePath?{...e,branch:t.newBranch}:e);return{...e,worktrees:{...e.worktrees,[t.projectId]:r}}}case`worktree-removed`:{let n=e.worktrees[t.projectId];if(!n)return e;let r=n.filter(e=>e.path!==t.worktreePath),i={...e.worktrees,[t.projectId]:r},a=e.gitStates[t.projectId],o=e.gitStates;if(a&&t.worktreePath in a){let{[t.worktreePath]:n,...r}=a;o={...e.gitStates,[t.projectId]:r}}return{...e,worktrees:i,gitStates:o}}default:return e}}function qu(e){return{projects:e.state.projects,projectStates:e.state.projectStates,sessions:e.state.sessions,agentStates:e.agentStates,notifications:[...e.notifications].reverse(),ports:e.ports,gitStates:e.gitStates,serviceConfig:e.state.serviceConfig,paneCommands:e.state.paneCommands??[],ideCommands:e.state.ideCommands??[],hostPlatform:e.hostPlatform,fileChangeSeq:0,worktrees:e.worktrees??{},pendingOpenUrl:null,connected:!0,hydrated:!0,snapshotApplied:!0}}function Ju(){try{let e=localStorage.getItem(Q);if(!e)return null;let t=JSON.parse(e);return t.version!==Wu||!Array.isArray(t.projects)||typeof t.projectStates!=`object`?null:{...Gu,projects:t.projects,projectStates:t.projectStates,sessions:Array.isArray(t.sessions)?t.sessions:[],agentStates:t.agentStates&&typeof t.agentStates==`object`?t.agentStates:{},gitStates:t.gitStates&&typeof t.gitStates==`object`?t.gitStates:{},paneCommands:Array.isArray(t.paneCommands)?t.paneCommands:[],ideCommands:Array.isArray(t.ideCommands)?t.ideCommands:[],hydrated:!0}}catch{return null}}function Yu(e){try{let t={version:Wu,projects:e.projects,projectStates:e.projectStates,sessions:e.sessions,agentStates:e.agentStates,gitStates:e.gitStates,paneCommands:e.paneCommands,ideCommands:e.ideCommands};localStorage.setItem(Q,JSON.stringify(t))}catch{}}var Xu=1e3,Zu=500,Qu=1e4,$u=2e4,ed=1e4;async function td(e){return typeof e==`string`?e:e instanceof Blob?e.text():e instanceof ArrayBuffer||ArrayBuffer.isView(e)?new TextDecoder().decode(e):null}function nd(){let[e,t]=(0,B.useState)(()=>Ju()??Gu),[n,r]=(0,B.useState)(!1),i=(0,B.useRef)({state:`awaiting-snapshot`,buffer:[]}),a=(0,B.useRef)(null),o=(0,B.useRef)(0),s=(0,B.useRef)(null),c=(0,B.useRef)(null),l=(0,B.useRef)(!0);(0,B.useEffect)(()=>{l.current=!0;let e=e=>{s.current&&clearTimeout(s.current);let n=a.current;a.current=null,i.current={state:`awaiting-snapshot`,buffer:[]},r(!1),t(e=>({...e,connected:!1})),n?.close(),s.current=setTimeout(()=>{l.current&&u()},e)},n=t=>{if(t){e(0);return}o.current+=1,e(ce(o.current))},u=async()=>{let e=performance.now(),s=performance.now(),c=await g(),u=performance.now()-s;if(T(`event-socket-auth-complete`,{attempt:o.current,durationMs:u,status:c?`ok`:`unauthenticated`}),c&&u>=1e3&&E(`event-socket-auth-slow`,{type:`event-socket-auth-complete`,attempt:o.current,durationMs:u,status:`ok`}),!c||!l.current)return;let d=location.protocol===`https:`?`wss:`:`ws:`,f=new WebSocket(`${d}//${location.host}/ws/events`);a.current=f,i.current={state:`awaiting-snapshot`,buffer:[]};let p=null,m=null,h=null,_=!1,v=0,y=0,b=()=>{m!==null&&(clearTimeout(m),m=null)},x=()=>{h!==null&&(clearTimeout(h),h=null)},S=()=>{if(f.readyState===WebSocket.OPEN&&m===null){try{f.send(JSON.stringify({type:`ping`,ts:Date.now()}))}catch{return}m=setTimeout(()=>{m=null;try{f.close()}catch{}},ed)}},C=()=>{document.visibilityState===`visible`&&S()},w=()=>S(),D=()=>S(),O=e=>{e.persisted&&S()},k=()=>{p!==null&&(clearInterval(p),p=null),b(),x(),document.removeEventListener(`visibilitychange`,C),window.removeEventListener(`focus`,w),window.removeEventListener(`online`,D),window.removeEventListener(`pageshow`,O)};f.addEventListener(`open`,()=>{if(!l.current||a.current!==f)return;y=performance.now();let t=y-e;T(`event-socket-open`,{attempt:o.current,durationMs:t}),t>=5e3&&E(`event-socket-open-slow`,{type:`event-socket-open`,attempt:o.current,durationMs:t}),o.current=0,r(!0),h=setTimeout(()=>{h=null,E(`event-socket-snapshot-timeout`,{type:`event-socket-snapshot-timeout`,attempt:o.current,timeoutMs:Qu,durationMs:performance.now()-e});try{f.close()}catch{}},Qu),p=setInterval(S,$u),document.addEventListener(`visibilitychange`,C),window.addEventListener(`focus`,w),window.addEventListener(`online`,D),window.addEventListener(`pageshow`,O)});let ee=e=>{if(!l.current||a.current!==f)return;let r;try{r=JSON.parse(e)}catch{return}if(`type`in r&&r.type===`pong`){b();return}if(`type`in r&&r.type===`app-state-snapshot`){x();let e=r,n=y>0?performance.now()-y:void 0;T(`event-socket-snapshot`,{attempt:o.current,...n===void 0?{}:{durationMs:n},status:`ok`}),n!==void 0&&n>=5e3&&E(`event-socket-snapshot-slow`,{type:`event-socket-snapshot`,attempt:o.current,durationMs:n,status:`ok`});let a=i.current.state===`awaiting-snapshot`?i.current.buffer:[],s=qu(e.payload),c=e.payload.seq,l=c;for(let e of a)e.seq<=c||(s=Ku(s,e.message),l=e.seq);_=!0,v=Date.now(),i.current={state:`live`,lastAppliedSeq:l},t(s);return}let s=r,c=i.current;if(c.state===`awaiting-snapshot`){if(c.buffer.length>=Xu){n(!1);return}i.current={state:`awaiting-snapshot`,buffer:[...c.buffer,s]};return}if(!(s.seq<=c.lastAppliedSeq)){if(s.seq>c.lastAppliedSeq+1){n(!1);return}i.current={state:`live`,lastAppliedSeq:s.seq},t(e=>Ku(e,s.message))}};f.addEventListener(`message`,e=>{if(typeof e.data==`string`){ee(e.data);return}td(e.data).then(e=>{e!==null&&ee(e)})}),f.addEventListener(`close`,()=>{k(),!(!l.current||a.current!==f)&&(r(!1),t(e=>({...e,connected:!1})),n(_&&Date.now()-v>=3e3))}),f.addEventListener(`error`,()=>{})};return u(),()=>{l.current=!1,s.current&&clearTimeout(s.current),c.current&&clearTimeout(c.current),a.current?.close(),a.current=null}},[]);let u=(0,B.useMemo)(()=>({...Gu,projects:e.projects,projectStates:e.projectStates,sessions:e.sessions,agentStates:e.agentStates,gitStates:e.gitStates,paneCommands:e.paneCommands,ideCommands:e.ideCommands,hydrated:e.hydrated}),[e.projects,e.projectStates,e.sessions,e.agentStates,e.gitStates,e.paneCommands,e.ideCommands,e.hydrated]);(0,B.useEffect)(()=>{u.hydrated&&(c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{Yu(u)},Zu))},[u]);let d=(0,B.useCallback)(e=>{t(t=>({...t,notifications:t.notifications.map(t=>t.id===e?{...t,read:!0}:t)}))},[]),f=(0,B.useCallback)(()=>{t(e=>({...e,pendingOpenUrl:null}))},[]),p=(0,B.useCallback)(e=>{t(t=>Ku(t,{type:`project-created`,project:e}))},[]),m=(0,B.useCallback)(e=>{t(t=>({...t,paneCommands:e}))},[]),h=(0,B.useCallback)(e=>{t(t=>({...t,ideCommands:e}))},[]),_=(0,B.useMemo)(()=>e.notifications.filter(e=>!e.read).length,[e.notifications]);return{...e,eventSocketConnected:n,unreadCount:_,markRead:d,clearPendingUrl:f,seedProject:p,seedPaneCommands:m,seedIdeCommands:h}}function rd(){(0,B.useEffect)(()=>{let e=e=>{if(e.defaultPrevented)return;e.preventDefault();let t=e.dataTransfer;t&&(t.dropEffect=`none`)};return window.addEventListener(`dragover`,e),window.addEventListener(`drop`,e),()=>{window.removeEventListener(`dragover`,e),window.removeEventListener(`drop`,e)}},[])}function id(e,t,n){let r;try{r=new URL(e)}catch{return null}if(r.protocol!==`http:`&&r.protocol!==`https:`)return null;let i;if(oe(r.hostname)){let e=r.port?Number(r.port):r.protocol===`https:`?443:80;Number.isInteger(e)&&(i=n(e,t?.projectId))}return F(e,{fallbackToPageHostWithoutReachablePort:de(),reachablePort:i})}function ad(e,t,n,r){let i=vt(e),a=new Set(t);a.add(n);let o={};for(let[e,t]of Object.entries(i))a.has(e)&&(o[e]=t);return o[n]=r,o}function od(e){return typeof e==`number`&&Number.isInteger(e)&&e>0&&e<65536}function sd(e){let t=new Map,n=new Map,r=new Set;for(let[i,a]of Object.entries(e)){let e=new Map;for(let t of a??[])od(t.port)&&(od(t.reachablePort)?e.set(t.port,t.reachablePort):t.bindsAll&&e.set(t.port,t.port));if(e.size!==0){t.set(i,e);for(let[t,i]of e){let e=n.get(t);e===void 0?n.set(t,i):e!==i&&r.add(t)}}}return{ambiguousDevPorts:r,byProjectId:t,fallbackByDevPort:n}}function cd(e,t,n){if(n.projectId){let r=e.byProjectId.get(n.projectId)?.get(t);if(r!==void 0)return r}if(n.activeProjectId){let r=e.byProjectId.get(n.activeProjectId)?.get(t);if(r!==void 0)return r}if(!e.ambiguousDevPorts.has(t))return e.fallbackByDevPort.get(t)}function ld(e,t){if(t.length===0)return e;let n=new Set(e.map(e=>e.id)),r=t.filter(e=>!n.has(e.id));return r.length>0?[...e,...r]:e}function ud(e){if(!e||e.length===0)return null;let t=e.filter(e=>e.status===`copied`).length,n=e.filter(e=>e.status===`skipped`).length,r=e.filter(e=>e.status===`failed`).length,i=[];return t>0&&i.push(`Copied ${t}`),n>0&&i.push(`skipped ${n}`),r>0&&i.push(`failed ${r}`),`${i.join(`, `)} local ${e.length===1?`file`:`files`}`}function dd(){let e=(0,B.useRef)(performance.now()),t=(0,B.useRef)(!1);rd();let{playAttentionSound:n,playCompletionSound:r}=w(),{activeProjectId:i,focusedPaneId:a,setActiveProjectId:o,setFocusedPaneId:s}=fc(),{navigate:c,route:l}=vc(),[u,d]=(0,B.useState)(!1),[f,p]=(0,B.useState)(null),[m,h]=(0,B.useState)(!1),[g,_]=(0,B.useState)(0),[v,y]=Ds(),[b,x]=(0,B.useState)([]),S=nd(),C=(0,B.useMemo)(()=>Xs(S.paneCommands),[S.paneCommands]),D=(0,B.useMemo)(()=>ld(S.sessions,b),[S.sessions,b]);(0,B.useEffect)(()=>{if(b.length===0)return;let e=new Set(S.sessions.map(e=>e.id));x(t=>{let n=t.filter(t=>!e.has(t.id));return n.length===t.length?t:n})},[b.length,S.sessions]);let O=(0,B.useMemo)(()=>i?S.worktrees[i]??[]:[],[i,S.worktrees]),k=(0,B.useMemo)(()=>{let e={};for(let[t,n]of Object.entries(S.worktrees)){let r=S.gitStates[t]??{};e[t]=n.map(e=>{let t=r[e.path];return t?{...e,ahead:t.ahead,behind:t.behind,dirtyCount:t.dirtyCount}:e})}return e},[S.worktrees,S.gitStates]),ee=rc({activeProjectId:i,agentStates:S.agentStates,sessions:D}),A=St({focusedPaneId:a,agentStates:S.agentStates});gs({activeProjectId:i,agentStates:S.agentStates,snapshotApplied:S.snapshotApplied,playAttentionSound:n,playCompletionSound:r,sessions:D});let j=(0,B.useMemo)(()=>i?S.projects.find(e=>e.id===i)??null:null,[i,S.projects]),ne=j?.name??null,M=j?.path??null;yc({activeProjectId:i,connected:S.connected,projects:S.projects,setActiveProjectId:o});let re=(0,B.useMemo)(()=>f?S.projects.find(e=>e.id===f)??null:null,[f,S.projects]),ie=(0,B.useMemo)(()=>D.filter(e=>e.pinned===!0).length,[D]),ae=(0,B.useMemo)(()=>D.filter(e=>e.projectId===i),[D,i]),P=Cs(i),F=ac({projectId:i,projectPath:M,worktrees:O,sessions:D,focusedPaneId:a,clientBrowserPanes:P.panesByWorktree});(0,B.useEffect)(()=>{if(t.current)return;t.current=!0;let n=performance.now()-e.current,r=l.kind===`pane`?l.paneId:l.kind===`session`?De(l.sessionId):F.effectiveFocusedPaneId;T(`app-route-ready`,{routeKind:l.kind,paneId:r,sessionId:l.kind===`session`?l.sessionId:void 0,durationMs:n,status:S.hydrated?`hydrated`:`cached`}),n>=5e3&&E(`app-route-ready-slow`,{type:`app-route-ready`,routeKind:l.kind,paneId:r,sessionId:l.kind===`session`?l.sessionId:void 0,durationMs:n,status:S.hydrated?`hydrated`:`cached`})},[F.effectiveFocusedPaneId,l,S.hydrated]),(0,B.useEffect)(()=>{F.effectiveFocusedPaneId!==null&&F.effectiveFocusedPaneId!==a&&s(F.effectiveFocusedPaneId)},[F.effectiveFocusedPaneId,a,s]),(0,B.useEffect)(()=>{if(l.kind===`root`){m&&h(!1);return}if(l.kind===`monitor`){m||h(!0);return}if(l.kind===`session`){let e=D.find(e=>e.id===l.sessionId);if(!e)return;let t=De(e.id);m&&h(!1),i!==e.projectId&&o(e.projectId),a!==t&&(s(t),se(t));return}if(l.kind===`pane`){if(m&&h(!1),S.hydrated&&l.projectId&&!S.projects.some(e=>e.id===l.projectId)){c({kind:`root`},{replace:!0});return}l.projectId&&i!==l.projectId&&o(l.projectId),a!==l.paneId&&(s(l.paneId),se(l.paneId));return}if(l.kind===`worktree`){if(S.hydrated&&!S.projects.some(e=>e.id===l.projectId)){m&&h(!1),c({kind:`root`},{replace:!0});return}let e=l.tab===`git`?Ee(l.worktreePath):Te(l.worktreePath);m&&h(!1),i!==l.projectId&&o(l.projectId),a!==e&&(s(e),se(e))}},[i,a,m,l,o,s,D,S.hydrated,S.projects,c]);let I=F.focusedPane?.worktreePath??null,L=(0,B.useMemo)(()=>!i||!I?null:S.gitStates[i]?.[I]??null,[i,I,S.gitStates]),R=(0,B.useMemo)(()=>!i||!I?null:S.worktrees[i]?.find(e=>e.path===I)??null,[i,I,S.worktrees]),oe=(0,B.useMemo)(()=>{let e=F.focusedPane;return!e||!j?null:(L?.branch??R?.branch??null)||(e.worktreePath===j.path?`main`:e.worktreePath.replace(/\/+$/,``).split(`/`).pop()??e.worktreePath)},[F.focusedPane,j,L,R]),ce=(0,B.useMemo)(()=>j?S.gitStates[j.id]?.[j.path]?.isRepo!==!1:!0,[j,S.gitStates]),le=(0,B.useMemo)(()=>{let e=F.focusedPane;return!e||!j?null:Ts(e.worktreePath,j.path,ce)},[F.focusedPane,j,ce]),de=L?.branch??null,fe=F.focusedPane?.state.kind===`git`,me=Ks({activeProjectId:i,focusedWorktreePath:I,focusedWorktreeName:oe,gitState:L}),z=wc(),{canOpenLocalIde:ge}=ec(),_e=(0,B.useCallback)((e,t)=>{z.openWorktreeInFinder({projectId:e,worktreePath:t})},[z]),ve=(0,B.useCallback)((e,t,n)=>{z.openWorktreeInIde({projectId:e,worktreePath:t,editor:n})},[z]),ye=(0,B.useCallback)(e=>{z.copyWorktreePath(e)},[z]),be=(0,B.useCallback)((e,t,n)=>{let r=S.gitStates[e]?.[t]?.branch,i=r&&r.length>0?r:n;z.openRenameDialog({projectId:e,worktreePath:t,currentBranch:i})},[z,S.gitStates]),xe=(0,B.useCallback)((e,t,n)=>{let r=S.gitStates[e]?.[t],i=r?.branch&&r.branch.length>0?r.branch:n,a=r?.dirtyCount??0,o=S.worktrees[e]?.find(e=>e.path===t);z.openRemoveDialog({projectId:e,worktreePath:t,branch:i,dirtyCount:a,...o?.orphan===!0&&{orphan:!0}})},[z,S.gitStates,S.worktrees]),[Se,Ce]=Os(I),{createProject:we,deleteProject:Oe}=pc({activeProjectId:i,projects:S.projects,setActiveProjectId:o,seedProject:S.seedProject}),ke=(0,B.useCallback)(async(e,t,n,r,a)=>{let l=await ls({projectId:e,command:t,title:n,cwd:r,bootstrapInput:a});if(!l)return;x(e=>e.some(e=>e.id===l.id)?e:[...e,l]),e!==i&&o(e);let u=`terminal:${l.id}`;s(u),se(u),c({kind:`session`,sessionId:l.id})},[i,c,o,s]),Ae=(0,B.useCallback)((e,t,n)=>{let r=n.initialInput.trim(),i=r?`${r}\r`:void 0;ke(e,void 0,n.builtin?void 0:n.label,t,i)},[ke]),je=(0,B.useCallback)(async(e,t)=>{let n=await Bu(e,{branch:t.branch,base:t.base,copyLocalFiles:t.copyLocalFiles,rememberLocalFiles:t.rememberLocalFiles}),r=n.path,i=ud(n.localFileCopies);i&&y(i);let a=t.command.initialInput.trim(),o=a?`${a}\r`:void 0;await ke(e,void 0,t.command.builtin?void 0:t.command.label,r,o)},[ke,y]),Me=(0,B.useCallback)(e=>{let t=S.paneCommands;S.seedPaneCommands(e),os(e).then(e=>{Array.isArray(e.commands)&&S.seedPaneCommands(e.commands);try{window.localStorage.removeItem(qs)}catch{}}).catch(()=>{S.seedPaneCommands(t),y(`Failed to save terminal commands`)})},[S,y]),Ne=(0,B.useCallback)(e=>{let t=S.ideCommands;S.seedIdeCommands(e),ss(e).then(e=>{Array.isArray(e.commands)&&S.seedIdeCommands(e.commands)}).catch(()=>{S.seedIdeCommands(t),y(`Failed to save IDE commands`)})},[S,y]);$s({hydrated:S.hydrated,paneCommandsCount:S.paneCommands.length,onMigrate:Me});let Pe=(0,B.useCallback)(async e=>{await us(e)},[]),Fe=(0,B.useCallback)(async(e,t)=>{await ds(e,t)},[]),Ie=(0,B.useCallback)(async e=>{let t=D.find(t=>t.id===e);t&&await fs(e,t.pinned!==!0)},[D]),Le=(0,B.useCallback)(async e=>{let t=F.paneById.get(e);if(t){if(t.state.kind===`terminal`){await ps(t.state.sessionId);return}if(t.state.kind===`browser`){P.closeBrowser(e);return}}},[P,F.paneById]),Re=(0,B.useCallback)(e=>{let t=S.projects.find(t=>t.id===e.projectId);t&&(i!==e.projectId&&o(e.projectId),s(Te(t.path))),c({kind:`root`}),ps(e.id)},[i,c,o,s,S.projects]),ze=(0,B.useMemo)(()=>sd(S.ports),[S.ports]),Be=(0,B.useCallback)((e,t)=>cd(ze,e,{activeProjectId:i,projectId:t}),[i,ze]),Ve=(0,B.useCallback)((e,t)=>{let n=id(e,t,Be);n!==null&&ue(n)},[Be]);(0,B.useEffect)(()=>{S.pendingOpenUrl&&(Ve(S.pendingOpenUrl),S.clearPendingUrl())},[S.pendingOpenUrl,S.clearPendingUrl,Ve]);let{closeSettings:He,isMobile:Ue,openSettings:We,settingsOpen:Ge}=Cc({activeProjectId:i,projects:S.projects,setActiveProjectId:o});(0,B.useEffect)(()=>{T(`mobile-surface-route`,{routeKind:l.kind,surface:Ue?l.kind===`root`?`navigation`:`workspace`:`split`,paneId:F.focusedPane?.id??null})},[Ue,F.focusedPane?.id,l.kind]);let Ke=(0,B.useCallback)(async e=>{let t=l.kind===`pane`&&l.projectId===e||l.kind===`worktree`&&l.projectId===e||l.kind===`session`&&D.some(t=>t.id===l.sessionId&&t.projectId===e);await Oe(e),t&&c({kind:`root`},{replace:!0}),p(null)},[Oe,c,l,D]),Ye=ws({onConfirm:(0,B.useCallback)(async e=>{(Ue||l.kind===`session`&&e.paneId===De(l.sessionId)||l.kind===`pane`&&e.paneId===l.paneId)&&c({kind:`root`}),await Le(e.paneId)},[Le,Ue,c,l])}),Ze=(0,B.useCallback)(()=>{d(!0)},[]),{reorderResetSignal:Qe,pendingProjectReorderCount:$e,reorder:et}=nc({onError:y}),tt=(0,B.useCallback)((e,t,n)=>{let r=`paneOrder:${e}`,i=vt.current.find(t=>t.id===e)?.worktrees.map(e=>e.path)??[],a=ad(window.localStorage.getItem(r),i,t,n);try{window.localStorage.setItem(r,JSON.stringify(a))}catch{}_(e=>e+1)},[]),nt=(0,B.useCallback)(e=>Vu(e),[]),rt=(0,B.useCallback)(()=>{We()},[We]),it=(0,B.useCallback)(e=>{Yo({preventIdleSleep:e})},[]),at=(0,B.useCallback)(e=>{Yo({portDetection:e})},[]),ot=(0,B.useCallback)(e=>{Yo({dropSizeMaxBytes:e})},[]),st=(0,B.useMemo)(()=>Object.fromEntries(S.projects.map(e=>[e.id,e.name])),[S.projects]);(0,B.useEffect)(()=>{if(!S.connected||!i)return;let e=new AbortController;return Hu(i,e.signal).catch(e=>{e instanceof DOMException&&e.name===`AbortError`||console.warn(`Worktree refresh failed:`,e)}),()=>e.abort()},[i,S.connected]);let{open:dt,query:ft,setQuery:pt,toggle:mt,close:ht}=ic({isMobile:Ue,onMobileOpenShortcut:(0,B.useCallback)(()=>c({kind:`root`}),[c])}),_t=(0,B.useMemo)(()=>bt(Ot({projects:S.projects,activeProjectId:i,activeWorktrees:F.worktrees,sessions:D,agentStates:S.agentStates,reviewPendingSessions:ee,worktreesByProject:k,gitStates:S.gitStates,attentionDismissed:A,inactiveChildPanesByProject:gt(S.projects)})),[S.projects,i,F.worktrees,D,S.agentStates,ee,k,S.gitStates,A,g]),vt=(0,B.useRef)(_t);vt.current=_t;let yt=(0,B.useCallback)(()=>{h(!0),ht(),c({kind:`monitor`})},[ht,c]),xt=(0,B.useCallback)((e,t)=>{h(!1),e!==i&&o(e);let n=t.startsWith(`wt:`)?t.slice(3):t,r=Te(n);s(r),se(r),ht(),c({kind:`worktree`,projectId:e,worktreePath:n,tab:`files`})},[i,ht,c,o,s]),Ct=(0,B.useCallback)((e,t,n)=>{h(!1),e!==i&&o(e),s(n),se(n),ht(),n.startsWith(`terminal:`)?c({kind:`session`,sessionId:n.slice(9)}):c({kind:`pane`,paneId:n,projectId:e})},[i,ht,c,o,s]),wt=Es({projects:S.projects,gitStates:S.gitStates}),Tt=(0,B.useCallback)((e,t)=>{wt.open(e,t),Ue&&ht()},[wt.open,ht,Ue]),Et=(0,B.useCallback)(e=>{e.startsWith(`terminal:`)&&Ie(e.slice(9))},[Ie]),Dt=(0,B.useMemo)(()=>({projects:_t,selection:{monitor:m,selectedWorktreeId:!m&&F.focusedPane?`wt:${F.focusedPane.worktreePath}`:null,selectedChildId:!m&&F.focusedPane&&(F.focusedPane.state.kind===`terminal`||F.focusedPane.state.kind===`browser`)?F.focusedPane.id:null},connected:S.connected,portsByProjectId:S.ports,projectNames:st,onOpenUrl:Ve,pinnedMonitorCount:ie,onSelectMonitor:yt,onSelectWorktree:xt,onSelectChild:Ct,onOpenContainer:Tt,onToggleChildPin:Et,onNewProject:Ze,onOpenSettings:rt,searchOpen:dt,searchQuery:ft,onToggleSearch:mt,onCloseSearch:ht,onSearchQueryChange:pt,onReorderProjects:et,onReorderPanes:tt,reorderResetSignal:Qe,pendingProjectReorderCount:$e}),[_t,m,F.focusedPane,S.connected,S.ports,st,Ve,ie,yt,xt,Ct,Tt,Et,Ze,rt,dt,ft,mt,ht,pt,et,tt,Qe,$e]),kt=wt.target,At=wt.context,jt=(0,V.jsx)(Wa,{...Dt,fill:!0}),Mt=l.kind===`session`?D.find(e=>e.id===l.sessionId)??null:null,Nt=l.kind===`session`&&!Mt?l.sessionId:null,Pt=Mt?.state===`ended`&&!pe(Mt.command,Mt.endReason)?Mt:null,Ft=Nt?(0,V.jsx)(Je,{sessionId:Nt,hydrated:S.hydrated,connected:S.eventSocketConnected,onClose:()=>c({kind:`root`})}):Pt?(0,V.jsx)(he,{sessionTitle:Pt.title.trim()||Pt.id,command:Pt.command,endReason:Pt.endReason,onRestart:()=>void Pe(Pt.id),onClose:()=>Re(Pt)}):m?(0,V.jsx)(Io,{projects:S.projects,sessions:D,agentStates:S.agentStates,reviewPendingSessions:ee,gitStates:S.gitStates,attentionDismissed:A,isMobile:Ue,onToggleDrawer:()=>c({kind:`root`}),onRestartSession:Pe,onOpenUrl:Ve,onTogglePin:Ie}):(0,V.jsx)(Nu,{activeProjectId:i,activeProjectName:ne,activeProjectPath:M,activeProjectIsRepo:ce,allPanes:F.allPanes,focusedPane:F.focusedPane,focusedWorktreeDirName:le,fileChangeSeq:S.fileChangeSeq,gitState:L,hydrated:S.hydrated,isMobile:Ue,gitMenuActions:fe?{onPull:()=>me.pull(),onPush:()=>me.push()}:void 0,gitGraphSelection:Se,onGitGraphSelectionChange:Ce,gitBranchName:de,commitBusy:me.commitBusy,commitError:me.commitError,onClearCommitError:me.clearCommitError,onSubmitInlineCommit:me.submitInlineCommit,sessions:ae,onToggleDrawer:()=>c({kind:`root`}),onClosePane:Le,onRequestClosePane:Ye.request,onNewProject:Ze,onOpenUrl:Ve,onBrowserUrlChange:P.updateBrowserUrl,onRestartSession:Pe,onRenameSession:Fe,onSelectWorktreeTab:(e,t)=>{s(t===`git`?Ee(e):Te(e)),i&&c({kind:`worktree`,projectId:i,worktreePath:e,tab:t})},onToggleSessionPin:Ie,onOpenWorktreeInFinder:_e,onOpenWorktreeInIde:ve,ideCommands:S.ideCommands,canOpenLocalIde:ge,onCopyWorktreePath:ye,onRenameWorktree:be,onRemoveWorktree:xe,onDeleteProject:e=>p(e)});return(0,V.jsx)(N,{projects:S.projects,children:(0,V.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,V.jsx)(no,{connected:S.eventSocketConnected}),(0,V.jsx)(io,{}),(0,V.jsx)(`div`,{className:`flex flex-1 overflow-hidden`,children:Ue?l.kind===`root`?jt:Ft:(0,V.jsx)(is,{navigation:jt,main:Ft})}),(0,V.jsx)(ct,{open:u,onClose:()=>d(!1),onCreate:(e,t)=>(h(!1),we(e,t)),isMobile:Ue}),(0,V.jsx)(te,{open:Ge,onClose:He,server:{serviceConfig:S.serviceConfig,hostPlatform:S.hostPlatform,onPreventIdleSleepChange:it,onPortDetectionChange:at,onDropSizeMaxBytesChange:ot,ideCommands:S.ideCommands,onIdeCommandsChange:Ne}}),v&&(0,V.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`pointer-events-none fixed bottom-4 left-1/2 z-50 -translate-x-1/2 rounded-window border border-warning/60 bg-bg-secondary px-3 py-2 text-sm text-text-primary shadow-lg`,children:v}),re&&(0,V.jsx)(cs,{projectName:re.name,onCancel:()=>p(null),onConfirm:()=>void Ke(re.id)}),Ye.target&&(0,V.jsx)(as,{paneTitle:Ye.target.title,paneKind:Ye.target.paneKind,onCancel:Ye.cancel,onConfirm:()=>void Ye.confirm()}),kt&&At&&(0,V.jsx)(Xe,{open:!0,project:At.project,worktree:At.worktree,commands:C,isMobile:Ue,loadLocalFiles:nt,onClose:wt.close,onCommandsChange:Me,onCreateWorktreeSession:e=>je(kt.projectId,e),onRunCommand:(e,t)=>Ae(kt.projectId,e,t)}),z.renameDialog&&(0,V.jsx)(ut,{open:!0,currentBranch:z.renameDialog.currentBranch,busy:z.renameBusy,error:z.renameError,onClose:z.closeRenameDialog,onSubmit:z.submitRename}),z.removeDialog&&(0,V.jsx)(lt,{open:!0,branch:z.removeDialog.branch,worktreePath:z.removeDialog.worktreePath,dirtyCount:z.removeDialog.dirtyCount,orphan:z.removeDialog.orphan===!0,busy:z.removeBusy,error:z.removeError,onClose:z.closeRemoveDialog,onSubmit:z.submitRemove}),(0,V.jsx)(qe,{open:me.commitDialog!==null,busy:me.commitBusy,error:me.commitError,branchName:me.commitDialog?.branchName??null,files:me.commitDialog?.files??[],isMobile:Ue,onClose:me.closeCommitDialog,onCommit:me.submitCommit}),(0,V.jsx)(yo,{}),(0,V.jsx)(eo,{})]})})}function fd({children:e}){let[t,n]=(0,B.useState)(`loading`);return(0,B.useEffect)(()=>{let e=!1;(async()=>{let t=performance.now(),r=await g({dispatchOn401:!1}),i=performance.now()-t;T(`auth-gate-preflight-complete`,{durationMs:i,status:r?`ok`:`unauthenticated`}),r&&i>=1e3&&E(`auth-gate-preflight-slow`,{type:`auth-gate-preflight-complete`,durationMs:i,status:`ok`}),!e&&n(r?`authed`:`unauthenticated`)})();let t=()=>n(`expired`);return window.addEventListener(k,t),()=>{e=!0,window.removeEventListener(k,t)}},[]),t===`loading`?null:t===`unauthenticated`?(0,V.jsx)(pd,{}):t===`expired`?(0,V.jsx)(md,{}):(0,V.jsx)(V.Fragment,{children:e})}function pd(){return(0,V.jsxs)(`div`,{role:`alert`,"aria-live":`assertive`,className:`flex h-full flex-col items-center justify-center gap-4 bg-[--theme-background] p-6 text-center text-[--theme-foreground]`,children:[(0,V.jsx)(`h1`,{className:`text-base font-semibold`,children:`Authentication required`}),(0,V.jsxs)(`p`,{className:`max-w-md text-sm opacity-80`,children:[`Open the URL printed by`,` `,(0,V.jsx)(`code`,{className:`rounded-control bg-black/20 px-1 py-0.5`,children:`parasor qr`}),`, or scan the QR code on the host. If you copied the URL from a terminal that wrapped the line, the token may have been truncated -- scanning the QR avoids that.`]})]})}function md(){return(0,V.jsxs)(`div`,{role:`alert`,"aria-live":`assertive`,className:`flex h-full flex-col items-center justify-center gap-4 bg-[--theme-background] p-6 text-center text-[--theme-foreground]`,children:[(0,V.jsx)(`h1`,{className:`text-base font-semibold`,children:`Session expired`}),(0,V.jsxs)(`p`,{className:`max-w-md text-sm opacity-80`,children:[`Run`,` `,(0,V.jsx)(`code`,{className:`rounded-control bg-black/20 px-1 py-0.5`,children:`parasor qr`}),` `,`on the host and open the refreshed URL to sign back in.`]})]})}var hd=e=>e.preventDefault();document.addEventListener(`gesturestart`,hd),document.addEventListener(`gesturechange`,hd),document.addEventListener(`gestureend`,hd);var gd=class extends B.Component{state={error:null,info:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.setState({error:e,info:t}),console.error(`[parasor ErrorBoundary]`,e,t),E(`react-error-boundary`,{type:`react-error-boundary`,status:e.name})}render(){return this.state.error?(0,V.jsxs)(`div`,{style:{position:`fixed`,inset:0,background:`#000`,color:`#fff`,padding:16,fontFamily:`ui-monospace, SFMono-Regular, Menlo, monospace`,fontSize:12,overflow:`auto`,zIndex:2147483647},children:[(0,V.jsx)(`div`,{style:{color:`#ff5555`,fontSize:14,marginBottom:8},children:`⚠ React error caught`}),(0,V.jsxs)(`div`,{style:{color:`#ffaa00`,marginBottom:8},children:[this.state.error.name,`: `,this.state.error.message]}),(0,V.jsx)(`pre`,{style:{whiteSpace:`pre-wrap`,color:`#aaa`,fontSize:10},children:this.state.error.stack}),this.state.info&&(0,V.jsx)(`pre`,{style:{whiteSpace:`pre-wrap`,color:`#666`,fontSize:10,marginTop:8},children:this.state.info.componentStack}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>this.setState({error:null,info:null}),style:{marginTop:12,padding:`6px 12px`,background:`#2f81f7`,color:`#fff`,border:0,borderRadius:4,fontSize:12},children:`Try again`})]}):this.props.children}},_d=document.getElementById(`root`);if(!_d)throw Error(`Missing #root element`);(0,Le.createRoot)(_d).render((0,V.jsx)(gd,{children:(0,V.jsx)(x,{children:(0,V.jsx)(fd,{children:(0,V.jsx)(dd,{})})})}));