clinkx 0.3.0 → 1.0.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 (555) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/LICENSE +10 -0
  3. package/README.md +82 -26
  4. package/clinkx-workflows/dist/allowed-roots.d.ts +1 -0
  5. package/clinkx-workflows/dist/allowed-roots.js +5 -0
  6. package/clinkx-workflows/dist/allowed-roots.js.map +1 -0
  7. package/clinkx-workflows/dist/artifacts.d.ts +20 -1
  8. package/clinkx-workflows/dist/artifacts.js +38 -9
  9. package/clinkx-workflows/dist/artifacts.js.map +1 -1
  10. package/clinkx-workflows/dist/backend.d.ts +4 -0
  11. package/clinkx-workflows/dist/citation-check.d.ts +40 -0
  12. package/clinkx-workflows/dist/citation-check.js +348 -0
  13. package/clinkx-workflows/dist/citation-check.js.map +1 -0
  14. package/clinkx-workflows/dist/clink-client.d.ts +2 -1
  15. package/clinkx-workflows/dist/clink-client.js +17 -4
  16. package/clinkx-workflows/dist/clink-client.js.map +1 -1
  17. package/clinkx-workflows/dist/config.d.ts +145 -16
  18. package/clinkx-workflows/dist/config.js +384 -26
  19. package/clinkx-workflows/dist/config.js.map +1 -1
  20. package/clinkx-workflows/dist/contained-file.d.ts +172 -0
  21. package/clinkx-workflows/dist/contained-file.js +483 -0
  22. package/clinkx-workflows/dist/contained-file.js.map +1 -0
  23. package/clinkx-workflows/dist/context-builder-lifecycle-contract.d.ts +416 -0
  24. package/clinkx-workflows/dist/context-builder-lifecycle-contract.js +328 -0
  25. package/clinkx-workflows/dist/context-builder-lifecycle-contract.js.map +1 -0
  26. package/clinkx-workflows/dist/context-builder-lifecycle-router.d.ts +24 -0
  27. package/clinkx-workflows/dist/context-builder-lifecycle-router.js +39 -0
  28. package/clinkx-workflows/dist/context-builder-lifecycle-router.js.map +1 -0
  29. package/clinkx-workflows/dist/context-cache-key.d.ts +53 -0
  30. package/clinkx-workflows/dist/context-cache-key.js +91 -0
  31. package/clinkx-workflows/dist/context-cache-key.js.map +1 -0
  32. package/clinkx-workflows/dist/context-mode-resolver.d.ts +27 -0
  33. package/clinkx-workflows/dist/context-mode-resolver.js +126 -0
  34. package/clinkx-workflows/dist/context-mode-resolver.js.map +1 -0
  35. package/clinkx-workflows/dist/context-preflight.d.ts +184 -0
  36. package/clinkx-workflows/dist/context-preflight.js +91 -0
  37. package/clinkx-workflows/dist/context-preflight.js.map +1 -0
  38. package/clinkx-workflows/dist/council-expander.d.ts +1 -1
  39. package/clinkx-workflows/dist/council-expander.js +2 -1
  40. package/clinkx-workflows/dist/council-expander.js.map +1 -1
  41. package/clinkx-workflows/dist/dashboard/activity-contract.d.ts +165 -0
  42. package/clinkx-workflows/dist/dashboard/activity-contract.js +105 -0
  43. package/clinkx-workflows/dist/dashboard/activity-contract.js.map +1 -0
  44. package/clinkx-workflows/dist/dashboard/activity-lease.d.ts +25 -0
  45. package/clinkx-workflows/dist/dashboard/activity-lease.js +34 -0
  46. package/clinkx-workflows/dist/dashboard/activity-lease.js.map +1 -0
  47. package/clinkx-workflows/dist/dashboard/activity-reader.d.ts +86 -0
  48. package/clinkx-workflows/dist/dashboard/activity-reader.js +480 -0
  49. package/clinkx-workflows/dist/dashboard/activity-reader.js.map +1 -0
  50. package/clinkx-workflows/dist/dashboard/api-routes.d.ts +36 -0
  51. package/clinkx-workflows/dist/dashboard/api-routes.js +1047 -0
  52. package/clinkx-workflows/dist/dashboard/api-routes.js.map +1 -0
  53. package/clinkx-workflows/dist/dashboard/artifact-index.d.ts +37 -0
  54. package/clinkx-workflows/dist/dashboard/artifact-index.js +145 -0
  55. package/clinkx-workflows/dist/dashboard/artifact-index.js.map +1 -0
  56. package/clinkx-workflows/dist/dashboard/auth/challenge-store.d.ts +31 -0
  57. package/clinkx-workflows/dist/dashboard/auth/challenge-store.js +65 -0
  58. package/clinkx-workflows/dist/dashboard/auth/challenge-store.js.map +1 -0
  59. package/clinkx-workflows/dist/dashboard/auth/controller.d.ts +26 -0
  60. package/clinkx-workflows/dist/dashboard/auth/controller.js +596 -0
  61. package/clinkx-workflows/dist/dashboard/auth/controller.js.map +1 -0
  62. package/clinkx-workflows/dist/dashboard/auth/credential-store.d.ts +60 -0
  63. package/clinkx-workflows/dist/dashboard/auth/credential-store.js +776 -0
  64. package/clinkx-workflows/dist/dashboard/auth/credential-store.js.map +1 -0
  65. package/clinkx-workflows/dist/dashboard/auth/enrollment-gate.d.ts +9 -0
  66. package/clinkx-workflows/dist/dashboard/auth/enrollment-gate.js +44 -0
  67. package/clinkx-workflows/dist/dashboard/auth/enrollment-gate.js.map +1 -0
  68. package/clinkx-workflows/dist/dashboard/auth/session-store.d.ts +17 -0
  69. package/clinkx-workflows/dist/dashboard/auth/session-store.js +77 -0
  70. package/clinkx-workflows/dist/dashboard/auth/session-store.js.map +1 -0
  71. package/clinkx-workflows/dist/dashboard/auth/webauthn-service.d.ts +25 -0
  72. package/clinkx-workflows/dist/dashboard/auth/webauthn-service.js +71 -0
  73. package/clinkx-workflows/dist/dashboard/auth/webauthn-service.js.map +1 -0
  74. package/clinkx-workflows/dist/dashboard/context-run-liveness.d.ts +37 -0
  75. package/clinkx-workflows/dist/dashboard/context-run-liveness.js +49 -0
  76. package/clinkx-workflows/dist/dashboard/context-run-liveness.js.map +1 -0
  77. package/clinkx-workflows/dist/dashboard/context-run-reader.d.ts +222 -0
  78. package/clinkx-workflows/dist/dashboard/context-run-reader.js +1178 -0
  79. package/clinkx-workflows/dist/dashboard/context-run-reader.js.map +1 -0
  80. package/clinkx-workflows/dist/dashboard/contracts.d.ts +8936 -0
  81. package/clinkx-workflows/dist/dashboard/contracts.js +1157 -0
  82. package/clinkx-workflows/dist/dashboard/contracts.js.map +1 -0
  83. package/clinkx-workflows/dist/dashboard/generation.d.ts +14 -0
  84. package/clinkx-workflows/dist/dashboard/generation.js +41 -0
  85. package/clinkx-workflows/dist/dashboard/generation.js.map +1 -0
  86. package/clinkx-workflows/dist/dashboard/index.d.ts +28 -0
  87. package/clinkx-workflows/dist/dashboard/index.js +16 -0
  88. package/clinkx-workflows/dist/dashboard/index.js.map +1 -0
  89. package/clinkx-workflows/dist/dashboard/lazy-content.d.ts +101 -0
  90. package/clinkx-workflows/dist/dashboard/lazy-content.js +748 -0
  91. package/clinkx-workflows/dist/dashboard/lazy-content.js.map +1 -0
  92. package/clinkx-workflows/dist/dashboard/progress-report-contract.d.ts +303 -0
  93. package/clinkx-workflows/dist/dashboard/progress-report-contract.js +221 -0
  94. package/clinkx-workflows/dist/dashboard/progress-report-contract.js.map +1 -0
  95. package/clinkx-workflows/dist/dashboard/progress-report-reader.d.ts +50 -0
  96. package/clinkx-workflows/dist/dashboard/progress-report-reader.js +581 -0
  97. package/clinkx-workflows/dist/dashboard/progress-report-reader.js.map +1 -0
  98. package/clinkx-workflows/dist/dashboard/progress-report-status-overlay.d.ts +89 -0
  99. package/clinkx-workflows/dist/dashboard/progress-report-status-overlay.js +71 -0
  100. package/clinkx-workflows/dist/dashboard/progress-report-status-overlay.js.map +1 -0
  101. package/clinkx-workflows/dist/dashboard/progress-report-status-store.d.ts +28 -0
  102. package/clinkx-workflows/dist/dashboard/progress-report-status-store.js +110 -0
  103. package/clinkx-workflows/dist/dashboard/progress-report-status-store.js.map +1 -0
  104. package/clinkx-workflows/dist/dashboard/read-model.d.ts +86 -0
  105. package/clinkx-workflows/dist/dashboard/read-model.js +440 -0
  106. package/clinkx-workflows/dist/dashboard/read-model.js.map +1 -0
  107. package/clinkx-workflows/dist/dashboard/request-admission.d.ts +31 -0
  108. package/clinkx-workflows/dist/dashboard/request-admission.js +126 -0
  109. package/clinkx-workflows/dist/dashboard/request-admission.js.map +1 -0
  110. package/clinkx-workflows/dist/dashboard/scanner.d.ts +75 -0
  111. package/clinkx-workflows/dist/dashboard/scanner.js +1110 -0
  112. package/clinkx-workflows/dist/dashboard/scanner.js.map +1 -0
  113. package/clinkx-workflows/dist/dashboard/server-factory.d.ts +50 -0
  114. package/clinkx-workflows/dist/dashboard/server-factory.js +431 -0
  115. package/clinkx-workflows/dist/dashboard/server-factory.js.map +1 -0
  116. package/clinkx-workflows/dist/dashboard/session-log-contract.d.ts +2611 -0
  117. package/clinkx-workflows/dist/dashboard/session-log-contract.js +480 -0
  118. package/clinkx-workflows/dist/dashboard/session-log-contract.js.map +1 -0
  119. package/clinkx-workflows/dist/dashboard/session-log-identity.d.ts +21 -0
  120. package/clinkx-workflows/dist/dashboard/session-log-identity.js +101 -0
  121. package/clinkx-workflows/dist/dashboard/session-log-identity.js.map +1 -0
  122. package/clinkx-workflows/dist/dashboard/session-log-journal.d.ts +43 -0
  123. package/clinkx-workflows/dist/dashboard/session-log-journal.js +522 -0
  124. package/clinkx-workflows/dist/dashboard/session-log-journal.js.map +1 -0
  125. package/clinkx-workflows/dist/dashboard/session-log-reader.d.ts +61 -0
  126. package/clinkx-workflows/dist/dashboard/session-log-reader.js +378 -0
  127. package/clinkx-workflows/dist/dashboard/session-log-reader.js.map +1 -0
  128. package/clinkx-workflows/dist/dashboard/session-log-redaction.d.ts +6 -0
  129. package/clinkx-workflows/dist/dashboard/session-log-redaction.js +367 -0
  130. package/clinkx-workflows/dist/dashboard/session-log-redaction.js.map +1 -0
  131. package/clinkx-workflows/dist/dashboard/session-log-retention.d.ts +23 -0
  132. package/clinkx-workflows/dist/dashboard/session-log-retention.js +212 -0
  133. package/clinkx-workflows/dist/dashboard/session-log-retention.js.map +1 -0
  134. package/clinkx-workflows/dist/dashboard/static-responses.d.ts +10 -0
  135. package/clinkx-workflows/dist/dashboard/static-responses.js +94 -0
  136. package/clinkx-workflows/dist/dashboard/static-responses.js.map +1 -0
  137. package/clinkx-workflows/dist/dashboard/worker-lock-observer.d.ts +28 -0
  138. package/clinkx-workflows/dist/dashboard/worker-lock-observer.js +241 -0
  139. package/clinkx-workflows/dist/dashboard/worker-lock-observer.js.map +1 -0
  140. package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
  141. package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
  142. package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
  143. package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
  144. package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2 +0 -0
  145. package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-400-normal-CYLoc0-x.woff +0 -0
  146. package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-500-normal-6ng42L7E.woff2 +0 -0
  147. package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-500-normal-BgVn5rGT.woff +0 -0
  148. package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-600-normal-Cu4Hd6ag.woff +0 -0
  149. package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2 +0 -0
  150. package/clinkx-workflows/dist/dashboard-ui/assets/index-DOkMXTfB.js +25 -0
  151. package/clinkx-workflows/dist/dashboard-ui/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
  152. package/clinkx-workflows/dist/dashboard-ui/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
  153. package/clinkx-workflows/dist/dashboard-ui/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
  154. package/clinkx-workflows/dist/dashboard-ui/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
  155. package/clinkx-workflows/dist/dashboard-ui/assets/style-ChJsn0KD.css +1 -0
  156. package/clinkx-workflows/dist/dashboard-ui/contracts/council-plan-review-input-v1.json +158 -0
  157. package/clinkx-workflows/dist/dashboard-ui/index.html +15 -0
  158. package/clinkx-workflows/dist/dashboard-ui/licenses/IBM-Plex-Mono-OFL.txt +93 -0
  159. package/clinkx-workflows/dist/dashboard-ui/licenses/IBM-Plex-Sans-OFL.txt +93 -0
  160. package/clinkx-workflows/dist/dashboard-ui/licenses/JetBrains-Mono-OFL.txt +93 -0
  161. package/clinkx-workflows/dist/dashboard-ui/licenses/NOTICE.md +32 -0
  162. package/clinkx-workflows/dist/dashboard-ui/theme-init.js +8 -0
  163. package/clinkx-workflows/dist/definition-normalizer.d.ts +19 -0
  164. package/clinkx-workflows/dist/definition-normalizer.js.map +1 -1
  165. package/clinkx-workflows/dist/delegate-validate.d.ts +78 -0
  166. package/clinkx-workflows/dist/delegate-validate.js +97 -0
  167. package/clinkx-workflows/dist/delegate-validate.js.map +1 -0
  168. package/clinkx-workflows/dist/engine.d.ts +141 -0
  169. package/clinkx-workflows/dist/engine.js +882 -28
  170. package/clinkx-workflows/dist/engine.js.map +1 -1
  171. package/clinkx-workflows/dist/errors.d.ts +2 -0
  172. package/clinkx-workflows/dist/errors.js.map +1 -1
  173. package/clinkx-workflows/dist/fingerprint.d.ts +1 -1
  174. package/clinkx-workflows/dist/fingerprint.js +1 -1
  175. package/clinkx-workflows/dist/index.d.ts +19 -0
  176. package/clinkx-workflows/dist/index.js +15 -0
  177. package/clinkx-workflows/dist/index.js.map +1 -1
  178. package/clinkx-workflows/dist/loader.d.ts +9 -3
  179. package/clinkx-workflows/dist/loader.js +92 -21
  180. package/clinkx-workflows/dist/loader.js.map +1 -1
  181. package/clinkx-workflows/dist/plan-review/admission.d.ts +160 -0
  182. package/clinkx-workflows/dist/plan-review/admission.js +290 -0
  183. package/clinkx-workflows/dist/plan-review/admission.js.map +1 -0
  184. package/clinkx-workflows/dist/plan-review/context-policy.d.ts +55 -0
  185. package/clinkx-workflows/dist/plan-review/context-policy.js +146 -0
  186. package/clinkx-workflows/dist/plan-review/context-policy.js.map +1 -0
  187. package/clinkx-workflows/dist/plan-review/contract.d.ts +763 -0
  188. package/clinkx-workflows/dist/plan-review/contract.js +289 -0
  189. package/clinkx-workflows/dist/plan-review/contract.js.map +1 -0
  190. package/clinkx-workflows/dist/plan-review/digest.d.ts +68 -0
  191. package/clinkx-workflows/dist/plan-review/digest.js +241 -0
  192. package/clinkx-workflows/dist/plan-review/digest.js.map +1 -0
  193. package/clinkx-workflows/dist/plan-review/discovery.d.ts +45 -0
  194. package/clinkx-workflows/dist/plan-review/discovery.js +36 -0
  195. package/clinkx-workflows/dist/plan-review/discovery.js.map +1 -0
  196. package/clinkx-workflows/dist/plan-review/execution-contract.d.ts +298 -0
  197. package/clinkx-workflows/dist/plan-review/execution-contract.js +194 -0
  198. package/clinkx-workflows/dist/plan-review/execution-contract.js.map +1 -0
  199. package/clinkx-workflows/dist/plan-review/expander.d.ts +48 -0
  200. package/clinkx-workflows/dist/plan-review/expander.js +243 -0
  201. package/clinkx-workflows/dist/plan-review/expander.js.map +1 -0
  202. package/clinkx-workflows/dist/plan-review/projector.d.ts +126 -0
  203. package/clinkx-workflows/dist/plan-review/projector.js +437 -0
  204. package/clinkx-workflows/dist/plan-review/projector.js.map +1 -0
  205. package/clinkx-workflows/dist/plan-review/publication.d.ts +95 -0
  206. package/clinkx-workflows/dist/plan-review/publication.js +182 -0
  207. package/clinkx-workflows/dist/plan-review/publication.js.map +1 -0
  208. package/clinkx-workflows/dist/plan-review/ranking-reducer.d.ts +34 -0
  209. package/clinkx-workflows/dist/plan-review/ranking-reducer.js +139 -0
  210. package/clinkx-workflows/dist/plan-review/ranking-reducer.js.map +1 -0
  211. package/clinkx-workflows/dist/plan-review/resume.d.ts +38 -0
  212. package/clinkx-workflows/dist/plan-review/resume.js +122 -0
  213. package/clinkx-workflows/dist/plan-review/resume.js.map +1 -0
  214. package/clinkx-workflows/dist/plan-review/rubric.d.ts +7 -0
  215. package/clinkx-workflows/dist/plan-review/rubric.js +24 -0
  216. package/clinkx-workflows/dist/plan-review/rubric.js.map +1 -0
  217. package/clinkx-workflows/dist/plan-review/run-state.d.ts +398 -0
  218. package/clinkx-workflows/dist/plan-review/run-state.js +183 -0
  219. package/clinkx-workflows/dist/plan-review/run-state.js.map +1 -0
  220. package/clinkx-workflows/dist/plan-review/runtime-policy.d.ts +74 -0
  221. package/clinkx-workflows/dist/plan-review/runtime-policy.js +186 -0
  222. package/clinkx-workflows/dist/plan-review/runtime-policy.js.map +1 -0
  223. package/clinkx-workflows/dist/plan-review/snapshot.d.ts +81 -0
  224. package/clinkx-workflows/dist/plan-review/snapshot.js +170 -0
  225. package/clinkx-workflows/dist/plan-review/snapshot.js.map +1 -0
  226. package/clinkx-workflows/dist/plan-review/stage-error.d.ts +19 -0
  227. package/clinkx-workflows/dist/plan-review/stage-error.js +20 -0
  228. package/clinkx-workflows/dist/plan-review/stage-error.js.map +1 -0
  229. package/clinkx-workflows/dist/post-processors/index.d.ts +20 -0
  230. package/clinkx-workflows/dist/post-processors/index.js +21 -0
  231. package/clinkx-workflows/dist/post-processors/index.js.map +1 -0
  232. package/clinkx-workflows/dist/prompt-budget.d.ts +7 -0
  233. package/clinkx-workflows/dist/prompt-budget.js +7 -1
  234. package/clinkx-workflows/dist/prompt-budget.js.map +1 -1
  235. package/clinkx-workflows/dist/reducers/index.js +2 -0
  236. package/clinkx-workflows/dist/reducers/index.js.map +1 -1
  237. package/clinkx-workflows/dist/run-lock-heartbeat.d.ts +2 -0
  238. package/clinkx-workflows/dist/run-lock-heartbeat.js +3 -0
  239. package/clinkx-workflows/dist/run-lock-heartbeat.js.map +1 -0
  240. package/clinkx-workflows/dist/run-summary/cards/council-plan-review.d.ts +34 -0
  241. package/clinkx-workflows/dist/run-summary/cards/council-plan-review.js +74 -0
  242. package/clinkx-workflows/dist/run-summary/cards/council-plan-review.js.map +1 -0
  243. package/clinkx-workflows/dist/run-summary/cards/index.js +5 -0
  244. package/clinkx-workflows/dist/run-summary/cards/index.js.map +1 -1
  245. package/clinkx-workflows/dist/run-summary.d.ts +13 -0
  246. package/clinkx-workflows/dist/run-summary.js +29 -1
  247. package/clinkx-workflows/dist/run-summary.js.map +1 -1
  248. package/clinkx-workflows/dist/schema.d.ts +76 -21
  249. package/clinkx-workflows/dist/schema.js +10 -1
  250. package/clinkx-workflows/dist/schema.js.map +1 -1
  251. package/clinkx-workflows/dist/seed-terms.d.ts +30 -0
  252. package/clinkx-workflows/dist/seed-terms.js +176 -0
  253. package/clinkx-workflows/dist/seed-terms.js.map +1 -0
  254. package/clinkx-workflows/dist/server.d.ts +5 -2
  255. package/clinkx-workflows/dist/server.js +82 -52
  256. package/clinkx-workflows/dist/server.js.map +1 -1
  257. package/clinkx-workflows/dist/shutdown.d.ts +18 -20
  258. package/clinkx-workflows/dist/shutdown.js +43 -61
  259. package/clinkx-workflows/dist/shutdown.js.map +1 -1
  260. package/clinkx-workflows/dist/state-schema.d.ts +38 -0
  261. package/clinkx-workflows/dist/state.d.ts +170 -3
  262. package/clinkx-workflows/dist/state.js +1275 -28
  263. package/clinkx-workflows/dist/state.js.map +1 -1
  264. package/clinkx-workflows/dist/transport.d.ts +15 -0
  265. package/clinkx-workflows/dist/transport.js +19 -10
  266. package/clinkx-workflows/dist/transport.js.map +1 -1
  267. package/clinkx-workflows/dist/types.d.ts +14 -2
  268. package/clinkx-workflows/dist/validators/council.d.ts +318 -85
  269. package/clinkx-workflows/dist/validators/council.js +52 -13
  270. package/clinkx-workflows/dist/validators/council.js.map +1 -1
  271. package/clinkx-workflows/dist/validators/index.d.ts +1 -0
  272. package/clinkx-workflows/dist/validators/index.js +3 -0
  273. package/clinkx-workflows/dist/validators/index.js.map +1 -1
  274. package/clinkx-workflows/dist/validators/plan-review.d.ts +398 -0
  275. package/clinkx-workflows/dist/validators/plan-review.js +316 -0
  276. package/clinkx-workflows/dist/validators/plan-review.js.map +1 -0
  277. package/clinkx-workflows/dist/workflow-receipt.js +188 -4
  278. package/clinkx-workflows/dist/workflow-receipt.js.map +1 -1
  279. package/clinkx-workflows/dist/workflow-tools.d.ts +48 -3
  280. package/clinkx-workflows/dist/workflow-tools.js +1402 -59
  281. package/clinkx-workflows/dist/workflow-tools.js.map +1 -1
  282. package/clinkx-workflows/dist/workspace-signature.d.ts +16 -0
  283. package/clinkx-workflows/dist/workspace-signature.js +388 -0
  284. package/clinkx-workflows/dist/workspace-signature.js.map +1 -0
  285. package/clinkx-workflows/templates/council/answer-specialist.txt +2 -1
  286. package/clinkx-workflows/templates/council/code-review-chairman.txt +13 -0
  287. package/clinkx-workflows/templates/council/code-review-cross-reviewer.txt +4 -1
  288. package/clinkx-workflows/templates/council/code-review-reviewer.txt +19 -3
  289. package/clinkx-workflows/templates/council/debug-debugger.txt +2 -1
  290. package/clinkx-workflows/templates/council/discover-analyst.txt +2 -1
  291. package/clinkx-workflows/templates/council/member.txt +2 -1
  292. package/clinkx-workflows/templates/council/plan-review-chairman.txt +68 -0
  293. package/clinkx-workflows/templates/council/plan-review-cross-reviewer.txt +51 -0
  294. package/clinkx-workflows/templates/council/plan-review-reviewer.txt +60 -0
  295. package/clinkx-workflows/templates/plan-review/chairman.txt +48 -0
  296. package/clinkx-workflows/templates/plan-review/cross-review.txt +52 -0
  297. package/clinkx-workflows/templates/plan-review/ranking.txt +16 -0
  298. package/clinkx-workflows/templates/plan-review/reviewer.txt +57 -0
  299. package/clinkx-workflows/workflows/council-answer.yaml +97 -8
  300. package/clinkx-workflows/workflows/council-code-review.yaml +103 -8
  301. package/clinkx-workflows/workflows/council-debug.yaml +97 -8
  302. package/clinkx-workflows/workflows/council-default.yaml +97 -8
  303. package/clinkx-workflows/workflows/council-discover.yaml +97 -8
  304. package/clinkx-workflows/workflows/council-plan-review.yaml +250 -0
  305. package/clinkx-workflows/workflows/plan-review-receipts.yaml +230 -0
  306. package/conf/adapters/agy.json +49 -0
  307. package/conf/adapters/claude.json +5 -0
  308. package/conf/adapters/codex-app-server.json +44 -0
  309. package/conf/adapters/codex.json +7 -2
  310. package/conf/adapters/glm.json +5 -0
  311. package/conf/adapters/grok.json +60 -0
  312. package/conf/adapters/hapi/agy.json +52 -0
  313. package/conf/adapters/hapi/claude.json +5 -0
  314. package/conf/adapters/hapi/codex.json +7 -2
  315. package/conf/adapters/hapi/glm.json +5 -0
  316. package/dist/activity-journal.d.ts +42 -0
  317. package/dist/activity-journal.js +381 -0
  318. package/dist/activity-journal.js.map +1 -0
  319. package/dist/allowed-roots.d.ts +41 -0
  320. package/dist/allowed-roots.js +125 -3
  321. package/dist/allowed-roots.js.map +1 -1
  322. package/dist/codex/activity-session-log.d.ts +14 -0
  323. package/dist/codex/activity-session-log.js +206 -0
  324. package/dist/codex/activity-session-log.js.map +1 -0
  325. package/dist/codex/agent-tools.d.ts +23 -0
  326. package/dist/codex/agent-tools.js +1270 -0
  327. package/dist/codex/agent-tools.js.map +1 -0
  328. package/dist/codex/app-server-client.d.ts +76 -0
  329. package/dist/codex/app-server-client.js +582 -0
  330. package/dist/codex/app-server-client.js.map +1 -0
  331. package/dist/codex/app-server-registry.d.ts +389 -0
  332. package/dist/codex/app-server-registry.js +1407 -0
  333. package/dist/codex/app-server-registry.js.map +1 -0
  334. package/dist/codex/client-types.d.ts +109 -0
  335. package/dist/codex/client-types.js +2 -0
  336. package/dist/codex/client-types.js.map +1 -0
  337. package/dist/codex/protocol.d.ts +5375 -0
  338. package/dist/codex/protocol.js +614 -0
  339. package/dist/codex/protocol.js.map +1 -0
  340. package/dist/codex/session.d.ts +263 -0
  341. package/dist/codex/session.js +466 -0
  342. package/dist/codex/session.js.map +1 -0
  343. package/dist/config.d.ts +185 -19
  344. package/dist/config.js +82 -16
  345. package/dist/config.js.map +1 -1
  346. package/dist/context-builder/anchors.d.ts +1 -0
  347. package/dist/context-builder/anchors.js +3 -0
  348. package/dist/context-builder/anchors.js.map +1 -1
  349. package/dist/context-builder/bundle.d.ts +35 -2
  350. package/dist/context-builder/bundle.js +342 -2417
  351. package/dist/context-builder/bundle.js.map +1 -1
  352. package/dist/context-builder/codemap.d.ts +5 -0
  353. package/dist/context-builder/codemap.js +387 -13
  354. package/dist/context-builder/codemap.js.map +1 -1
  355. package/dist/context-builder/config.d.ts +1 -0
  356. package/dist/context-builder/config.js +12 -0
  357. package/dist/context-builder/config.js.map +1 -1
  358. package/dist/context-builder/context-run-catalog.d.ts +17 -0
  359. package/dist/context-builder/context-run-catalog.js +99 -0
  360. package/dist/context-builder/context-run-catalog.js.map +1 -0
  361. package/dist/context-builder/delegate-packet.d.ts +37 -0
  362. package/dist/context-builder/delegate-packet.js +359 -67
  363. package/dist/context-builder/delegate-packet.js.map +1 -1
  364. package/dist/context-builder/delegate-validation.d.ts +10 -1
  365. package/dist/context-builder/delegate-validation.js +153 -41
  366. package/dist/context-builder/delegate-validation.js.map +1 -1
  367. package/dist/context-builder/delegate.d.ts +2 -0
  368. package/dist/context-builder/delegate.js +1 -0
  369. package/dist/context-builder/delegate.js.map +1 -1
  370. package/dist/context-builder/diagnostics.d.ts +11 -2
  371. package/dist/context-builder/diagnostics.js +39 -6
  372. package/dist/context-builder/diagnostics.js.map +1 -1
  373. package/dist/context-builder/discovery.d.ts +29 -1
  374. package/dist/context-builder/discovery.js +475 -175
  375. package/dist/context-builder/discovery.js.map +1 -1
  376. package/dist/context-builder/globs.js +10 -10
  377. package/dist/context-builder/globs.js.map +1 -1
  378. package/dist/context-builder/handler.d.ts +26 -2
  379. package/dist/context-builder/handler.js +1158 -2416
  380. package/dist/context-builder/handler.js.map +1 -1
  381. package/dist/context-builder/lifecycle-contract.d.ts +424 -0
  382. package/dist/context-builder/lifecycle-contract.js +523 -0
  383. package/dist/context-builder/lifecycle-contract.js.map +1 -0
  384. package/dist/context-builder/lifecycle-journal.d.ts +62 -0
  385. package/dist/context-builder/lifecycle-journal.js +88 -0
  386. package/dist/context-builder/lifecycle-journal.js.map +1 -0
  387. package/dist/context-builder/lifecycle-observer.d.ts +102 -0
  388. package/dist/context-builder/lifecycle-observer.js +258 -0
  389. package/dist/context-builder/lifecycle-observer.js.map +1 -0
  390. package/dist/context-builder/lifecycle-reconcile.d.ts +32 -0
  391. package/dist/context-builder/lifecycle-reconcile.js +191 -0
  392. package/dist/context-builder/lifecycle-reconcile.js.map +1 -0
  393. package/dist/context-builder/lifecycle-recovery.d.ts +2 -0
  394. package/dist/context-builder/lifecycle-recovery.js +14 -0
  395. package/dist/context-builder/lifecycle-recovery.js.map +1 -0
  396. package/dist/context-builder/path-signals.js +9 -5
  397. package/dist/context-builder/path-signals.js.map +1 -1
  398. package/dist/context-builder/progress.d.ts +3 -1
  399. package/dist/context-builder/progress.js +23 -0
  400. package/dist/context-builder/progress.js.map +1 -1
  401. package/dist/context-builder/receipt.d.ts +6 -4
  402. package/dist/context-builder/receipt.js +12 -1
  403. package/dist/context-builder/receipt.js.map +1 -1
  404. package/dist/context-builder/refine-handler.d.ts +14 -0
  405. package/dist/context-builder/refine-handler.js +790 -0
  406. package/dist/context-builder/refine-handler.js.map +1 -0
  407. package/dist/context-builder/review-coverage.d.ts +84 -0
  408. package/dist/context-builder/review-coverage.js +437 -0
  409. package/dist/context-builder/review-coverage.js.map +1 -0
  410. package/dist/context-builder/schema.d.ts +239 -1
  411. package/dist/context-builder/schema.js +112 -6
  412. package/dist/context-builder/schema.js.map +1 -1
  413. package/dist/context-builder/secrets.d.ts +28 -0
  414. package/dist/context-builder/secrets.js +1473 -44
  415. package/dist/context-builder/secrets.js.map +1 -1
  416. package/dist/context-builder/selection.d.ts +7 -3
  417. package/dist/context-builder/selection.js +200 -738
  418. package/dist/context-builder/selection.js.map +1 -1
  419. package/dist/context-builder/session-log-identity.d.ts +1 -0
  420. package/dist/context-builder/session-log-identity.js +66 -0
  421. package/dist/context-builder/session-log-identity.js.map +1 -0
  422. package/dist/context-builder/slice-range-math.d.ts +16 -0
  423. package/dist/context-builder/slice-range-math.js +137 -0
  424. package/dist/context-builder/slice-range-math.js.map +1 -0
  425. package/dist/context-builder/status.d.ts +22 -1
  426. package/dist/context-builder/status.js +59 -4
  427. package/dist/context-builder/status.js.map +1 -1
  428. package/dist/context-builder/storage.d.ts +35 -2
  429. package/dist/context-builder/storage.js +271 -14
  430. package/dist/context-builder/storage.js.map +1 -1
  431. package/dist/context-builder/token-estimate.d.ts +13 -2
  432. package/dist/context-builder/token-estimate.js +77 -4
  433. package/dist/context-builder/token-estimate.js.map +1 -1
  434. package/dist/context-builder/versions.d.ts +29 -0
  435. package/dist/context-builder/versions.js +30 -0
  436. package/dist/context-builder/versions.js.map +1 -0
  437. package/dist/context-builder/workflow-runner.d.ts +69 -0
  438. package/dist/context-builder/workflow-runner.js +1051 -0
  439. package/dist/context-builder/workflow-runner.js.map +1 -0
  440. package/dist/context-builder/write-watchdog.d.ts +14 -0
  441. package/dist/context-builder/write-watchdog.js +38 -0
  442. package/dist/context-builder/write-watchdog.js.map +1 -0
  443. package/dist/dashboard-adapter-catalog.d.ts +9 -0
  444. package/dist/dashboard-adapter-catalog.js +46 -0
  445. package/dist/dashboard-adapter-catalog.js.map +1 -0
  446. package/dist/dashboard-cli.d.ts +79 -0
  447. package/dist/dashboard-cli.js +585 -0
  448. package/dist/dashboard-cli.js.map +1 -0
  449. package/dist/dashboard-companion/client.d.ts +36 -0
  450. package/dist/dashboard-companion/client.js +210 -0
  451. package/dist/dashboard-companion/client.js.map +1 -0
  452. package/dist/dashboard-companion/config.d.ts +8 -0
  453. package/dist/dashboard-companion/config.js +52 -0
  454. package/dist/dashboard-companion/config.js.map +1 -0
  455. package/dist/dashboard-companion/http-proxy.d.ts +10 -0
  456. package/dist/dashboard-companion/http-proxy.js +234 -0
  457. package/dist/dashboard-companion/http-proxy.js.map +1 -0
  458. package/dist/dashboard-companion/protocol.d.ts +80 -0
  459. package/dist/dashboard-companion/protocol.js +455 -0
  460. package/dist/dashboard-companion/protocol.js.map +1 -0
  461. package/dist/dashboard-companion/standalone-assets.d.ts +12 -0
  462. package/dist/dashboard-companion/standalone-assets.js +72 -0
  463. package/dist/dashboard-companion/standalone-assets.js.map +1 -0
  464. package/dist/dashboard-companion/standalone-entry.d.ts +1 -0
  465. package/dist/dashboard-companion/standalone-entry.js +17 -0
  466. package/dist/dashboard-companion/standalone-entry.js.map +1 -0
  467. package/dist/dashboard-gateway/config.d.ts +9 -0
  468. package/dist/dashboard-gateway/config.js +44 -0
  469. package/dist/dashboard-gateway/config.js.map +1 -0
  470. package/dist/dashboard-gateway/index.d.ts +11 -0
  471. package/dist/dashboard-gateway/index.js +755 -0
  472. package/dist/dashboard-gateway/index.js.map +1 -0
  473. package/dist/dashboard-gateway/main.d.ts +1 -0
  474. package/dist/dashboard-gateway/main.js +25 -0
  475. package/dist/dashboard-gateway/main.js.map +1 -0
  476. package/dist/dashboard-pairing-token.d.ts +1 -0
  477. package/dist/dashboard-pairing-token.js +5 -0
  478. package/dist/dashboard-pairing-token.js.map +1 -0
  479. package/dist/elaris/client.d.ts +73 -0
  480. package/dist/elaris/client.js +825 -0
  481. package/dist/elaris/client.js.map +1 -0
  482. package/dist/elaris/config.d.ts +18 -0
  483. package/dist/elaris/config.js +75 -0
  484. package/dist/elaris/config.js.map +1 -0
  485. package/dist/elaris/errors.d.ts +41 -0
  486. package/dist/elaris/errors.js +205 -0
  487. package/dist/elaris/errors.js.map +1 -0
  488. package/dist/elaris/github-repo.d.ts +18 -0
  489. package/dist/elaris/github-repo.js +89 -0
  490. package/dist/elaris/github-repo.js.map +1 -0
  491. package/dist/elaris/index.d.ts +10 -0
  492. package/dist/elaris/index.js +11 -0
  493. package/dist/elaris/index.js.map +1 -0
  494. package/dist/elaris/redact.d.ts +89 -0
  495. package/dist/elaris/redact.js +423 -0
  496. package/dist/elaris/redact.js.map +1 -0
  497. package/dist/elaris/run-id.d.ts +5 -0
  498. package/dist/elaris/run-id.js +20 -0
  499. package/dist/elaris/run-id.js.map +1 -0
  500. package/dist/elaris/status.d.ts +45 -0
  501. package/dist/elaris/status.js +122 -0
  502. package/dist/elaris/status.js.map +1 -0
  503. package/dist/elaris/tool-schemas.d.ts +314 -0
  504. package/dist/elaris/tool-schemas.js +208 -0
  505. package/dist/elaris/tool-schemas.js.map +1 -0
  506. package/dist/elaris/tools.d.ts +73 -0
  507. package/dist/elaris/tools.js +1065 -0
  508. package/dist/elaris/tools.js.map +1 -0
  509. package/dist/elaris/types.d.ts +1541 -0
  510. package/dist/elaris/types.js +252 -0
  511. package/dist/elaris/types.js.map +1 -0
  512. package/dist/errors.d.ts +16 -0
  513. package/dist/errors.js +19 -0
  514. package/dist/errors.js.map +1 -1
  515. package/dist/handler.d.ts +4 -0
  516. package/dist/handler.js +10 -1
  517. package/dist/handler.js.map +1 -1
  518. package/dist/index.d.ts +2 -1
  519. package/dist/index.js +13 -3
  520. package/dist/index.js.map +1 -1
  521. package/dist/local-clink-backend.d.ts +3 -0
  522. package/dist/local-clink-backend.js +4 -0
  523. package/dist/local-clink-backend.js.map +1 -1
  524. package/dist/package-info.d.ts +2 -0
  525. package/dist/package-info.js +18 -0
  526. package/dist/package-info.js.map +1 -0
  527. package/dist/parsers/codex-jsonl.js +48 -3
  528. package/dist/parsers/codex-jsonl.js.map +1 -1
  529. package/dist/parsers/extract.d.ts +10 -1
  530. package/dist/parsers/extract.js +11 -3
  531. package/dist/parsers/extract.js.map +1 -1
  532. package/dist/pipeline.d.ts +4 -0
  533. package/dist/pipeline.js +129 -8
  534. package/dist/pipeline.js.map +1 -1
  535. package/dist/run-dir.d.ts +24 -0
  536. package/dist/run-dir.js +201 -2
  537. package/dist/run-dir.js.map +1 -1
  538. package/dist/runner.d.ts +13 -0
  539. package/dist/runner.js +184 -15
  540. package/dist/runner.js.map +1 -1
  541. package/dist/safety.d.ts +4 -4
  542. package/dist/safety.js +4 -4
  543. package/dist/schema.d.ts +7 -7
  544. package/dist/server.d.ts +1 -0
  545. package/dist/server.js +359 -17
  546. package/dist/server.js.map +1 -1
  547. package/dist/session-log-stream.d.ts +18 -0
  548. package/dist/session-log-stream.js +319 -0
  549. package/dist/session-log-stream.js.map +1 -0
  550. package/package.json +46 -5
  551. package/conf/adapters/gemini.json +0 -44
  552. package/conf/adapters/hapi/gemini.json +0 -47
  553. package/dist/parsers/gemini-json.d.ts +0 -2
  554. package/dist/parsers/gemini-json.js +0 -72
  555. package/dist/parsers/gemini-json.js.map +0 -1
@@ -0,0 +1,25 @@
1
+ var md={exports:{}},Di={};var rg;function ex(){if(rg)return Di;rg=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(r,u,f){var p=null;if(f!==void 0&&(p=""+f),u.key!==void 0&&(p=""+u.key),"key"in u){f={};for(var m in u)m!=="key"&&(f[m]=u[m])}else f=u;return u=f.ref,{$$typeof:n,type:r,key:p,ref:u!==void 0?u:null,props:f}}return Di.Fragment=a,Di.jsx=i,Di.jsxs=i,Di}var og;function tx(){return og||(og=1,md.exports=ex()),md.exports}var o=tx(),gd={exports:{}},Se={};var cg;function nx(){if(cg)return Se;cg=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),p=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),T=Symbol.iterator;function N(S){return S===null||typeof S!="object"?null:(S=T&&S[T]||S["@@iterator"],typeof S=="function"?S:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,L={};function q(S,U,K){this.props=S,this.context=U,this.refs=L,this.updater=K||C}q.prototype.isReactComponent={},q.prototype.setState=function(S,U){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,U,"setState")},q.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function O(){}O.prototype=q.prototype;function Y(S,U,K){this.props=S,this.context=U,this.refs=L,this.updater=K||C}var A=Y.prototype=new O;A.constructor=Y,R(A,q.prototype),A.isPureReactComponent=!0;var $=Array.isArray;function ae(){}var te={H:null,A:null,T:null,S:null},he=Object.prototype.hasOwnProperty;function re(S,U,K){var J=K.ref;return{$$typeof:n,type:S,key:U,ref:J!==void 0?J:null,props:K}}function ye(S,U){return re(S.type,U,S.props)}function me(S){return typeof S=="object"&&S!==null&&S.$$typeof===n}function G(S){var U={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(K){return U[K]})}var ge=/\/+/g;function _e(S,U){return typeof S=="object"&&S!==null&&S.key!=null?G(""+S.key):U.toString(36)}function W(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(ae,ae):(S.status="pending",S.then(function(U){S.status==="pending"&&(S.status="fulfilled",S.value=U)},function(U){S.status==="pending"&&(S.status="rejected",S.reason=U)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function z(S,U,K,J,ue){var Q=typeof S;(Q==="undefined"||Q==="boolean")&&(S=null);var ve=!1;if(S===null)ve=!0;else switch(Q){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(S.$$typeof){case n:case a:ve=!0;break;case y:return ve=S._init,z(ve(S._payload),U,K,J,ue)}}if(ve)return ue=ue(S),ve=J===""?"."+_e(S,0):J,$(ue)?(K="",ve!=null&&(K=ve.replace(ge,"$&/")+"/"),z(ue,U,K,"",function(bn){return bn})):ue!=null&&(me(ue)&&(ue=ye(ue,K+(ue.key==null||S&&S.key===ue.key?"":(""+ue.key).replace(ge,"$&/")+"/")+ve)),U.push(ue)),1;ve=0;var Qe=J===""?".":J+":";if($(S))for(var Ge=0;Ge<S.length;Ge++)J=S[Ge],Q=Qe+_e(J,Ge),ve+=z(J,U,K,Q,ue);else if(Ge=N(S),typeof Ge=="function")for(S=Ge.call(S),Ge=0;!(J=S.next()).done;)J=J.value,Q=Qe+_e(J,Ge++),ve+=z(J,U,K,Q,ue);else if(Q==="object"){if(typeof S.then=="function")return z(W(S),U,K,J,ue);throw U=String(S),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ve}function X(S,U,K){if(S==null)return S;var J=[],ue=0;return z(S,J,"","",function(Q){return U.call(K,Q,ue++)}),J}function F(S){if(S._status===-1){var U=S._result;U=U(),U.then(function(K){(S._status===0||S._status===-1)&&(S._status=1,S._result=K)},function(K){(S._status===0||S._status===-1)&&(S._status=2,S._result=K)}),S._status===-1&&(S._status=0,S._result=U)}if(S._status===1)return S._result.default;throw S._result}var ee=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},fe={map:X,forEach:function(S,U,K){X(S,function(){U.apply(this,arguments)},K)},count:function(S){var U=0;return X(S,function(){U++}),U},toArray:function(S){return X(S,function(U){return U})||[]},only:function(S){if(!me(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return Se.Activity=b,Se.Children=fe,Se.Component=q,Se.Fragment=i,Se.Profiler=u,Se.PureComponent=Y,Se.StrictMode=r,Se.Suspense=g,Se.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=te,Se.__COMPILER_RUNTIME={__proto__:null,c:function(S){return te.H.useMemoCache(S)}},Se.cache=function(S){return function(){return S.apply(null,arguments)}},Se.cacheSignal=function(){return null},Se.cloneElement=function(S,U,K){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var J=R({},S.props),ue=S.key;if(U!=null)for(Q in U.key!==void 0&&(ue=""+U.key),U)!he.call(U,Q)||Q==="key"||Q==="__self"||Q==="__source"||Q==="ref"&&U.ref===void 0||(J[Q]=U[Q]);var Q=arguments.length-2;if(Q===1)J.children=K;else if(1<Q){for(var ve=Array(Q),Qe=0;Qe<Q;Qe++)ve[Qe]=arguments[Qe+2];J.children=ve}return re(S.type,ue,J)},Se.createContext=function(S){return S={$$typeof:p,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:f,_context:S},S},Se.createElement=function(S,U,K){var J,ue={},Q=null;if(U!=null)for(J in U.key!==void 0&&(Q=""+U.key),U)he.call(U,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(ue[J]=U[J]);var ve=arguments.length-2;if(ve===1)ue.children=K;else if(1<ve){for(var Qe=Array(ve),Ge=0;Ge<ve;Ge++)Qe[Ge]=arguments[Ge+2];ue.children=Qe}if(S&&S.defaultProps)for(J in ve=S.defaultProps,ve)ue[J]===void 0&&(ue[J]=ve[J]);return re(S,Q,ue)},Se.createRef=function(){return{current:null}},Se.forwardRef=function(S){return{$$typeof:m,render:S}},Se.isValidElement=me,Se.lazy=function(S){return{$$typeof:y,_payload:{_status:-1,_result:S},_init:F}},Se.memo=function(S,U){return{$$typeof:v,type:S,compare:U===void 0?null:U}},Se.startTransition=function(S){var U=te.T,K={};te.T=K;try{var J=S(),ue=te.S;ue!==null&&ue(K,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(ae,ee)}catch(Q){ee(Q)}finally{U!==null&&K.types!==null&&(U.types=K.types),te.T=U}},Se.unstable_useCacheRefresh=function(){return te.H.useCacheRefresh()},Se.use=function(S){return te.H.use(S)},Se.useActionState=function(S,U,K){return te.H.useActionState(S,U,K)},Se.useCallback=function(S,U){return te.H.useCallback(S,U)},Se.useContext=function(S){return te.H.useContext(S)},Se.useDebugValue=function(){},Se.useDeferredValue=function(S,U){return te.H.useDeferredValue(S,U)},Se.useEffect=function(S,U){return te.H.useEffect(S,U)},Se.useEffectEvent=function(S){return te.H.useEffectEvent(S)},Se.useId=function(){return te.H.useId()},Se.useImperativeHandle=function(S,U,K){return te.H.useImperativeHandle(S,U,K)},Se.useInsertionEffect=function(S,U){return te.H.useInsertionEffect(S,U)},Se.useLayoutEffect=function(S,U){return te.H.useLayoutEffect(S,U)},Se.useMemo=function(S,U){return te.H.useMemo(S,U)},Se.useOptimistic=function(S,U){return te.H.useOptimistic(S,U)},Se.useReducer=function(S,U,K){return te.H.useReducer(S,U,K)},Se.useRef=function(S){return te.H.useRef(S)},Se.useState=function(S){return te.H.useState(S)},Se.useSyncExternalStore=function(S,U,K){return te.H.useSyncExternalStore(S,U,K)},Se.useTransition=function(){return te.H.useTransition()},Se.version="19.2.7",Se}var ug;function ef(){return ug||(ug=1,gd.exports=nx()),gd.exports}var j=ef(),vd={exports:{}},Ii={},_d={exports:{}},yd={};var dg;function ax(){return dg||(dg=1,(function(n){function a(z,X){var F=z.length;z.push(X);e:for(;0<F;){var ee=F-1>>>1,fe=z[ee];if(0<u(fe,X))z[ee]=X,z[F]=fe,F=ee;else break e}}function i(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var X=z[0],F=z.pop();if(F!==X){z[0]=F;e:for(var ee=0,fe=z.length,S=fe>>>1;ee<S;){var U=2*(ee+1)-1,K=z[U],J=U+1,ue=z[J];if(0>u(K,F))J<fe&&0>u(ue,K)?(z[ee]=ue,z[J]=F,ee=J):(z[ee]=K,z[U]=F,ee=U);else if(J<fe&&0>u(ue,F))z[ee]=ue,z[J]=F,ee=J;else break e}}return X}function u(z,X){var F=z.sortIndex-X.sortIndex;return F!==0?F:z.id-X.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var p=Date,m=p.now();n.unstable_now=function(){return p.now()-m}}var g=[],v=[],y=1,b=null,T=3,N=!1,C=!1,R=!1,L=!1,q=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,Y=typeof setImmediate<"u"?setImmediate:null;function A(z){for(var X=i(v);X!==null;){if(X.callback===null)r(v);else if(X.startTime<=z)r(v),X.sortIndex=X.expirationTime,a(g,X);else break;X=i(v)}}function $(z){if(R=!1,A(z),!C)if(i(g)!==null)C=!0,ae||(ae=!0,G());else{var X=i(v);X!==null&&W($,X.startTime-z)}}var ae=!1,te=-1,he=5,re=-1;function ye(){return L?!0:!(n.unstable_now()-re<he)}function me(){if(L=!1,ae){var z=n.unstable_now();re=z;var X=!0;try{e:{C=!1,R&&(R=!1,O(te),te=-1),N=!0;var F=T;try{t:{for(A(z),b=i(g);b!==null&&!(b.expirationTime>z&&ye());){var ee=b.callback;if(typeof ee=="function"){b.callback=null,T=b.priorityLevel;var fe=ee(b.expirationTime<=z);if(z=n.unstable_now(),typeof fe=="function"){b.callback=fe,A(z),X=!0;break t}b===i(g)&&r(g),A(z)}else r(g);b=i(g)}if(b!==null)X=!0;else{var S=i(v);S!==null&&W($,S.startTime-z),X=!1}}break e}finally{b=null,T=F,N=!1}X=void 0}}finally{X?G():ae=!1}}}var G;if(typeof Y=="function")G=function(){Y(me)};else if(typeof MessageChannel<"u"){var ge=new MessageChannel,_e=ge.port2;ge.port1.onmessage=me,G=function(){_e.postMessage(null)}}else G=function(){q(me,0)};function W(z,X){te=q(function(){z(n.unstable_now())},X)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(z){z.callback=null},n.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):he=0<z?Math.floor(1e3/z):5},n.unstable_getCurrentPriorityLevel=function(){return T},n.unstable_next=function(z){switch(T){case 1:case 2:case 3:var X=3;break;default:X=T}var F=T;T=X;try{return z()}finally{T=F}},n.unstable_requestPaint=function(){L=!0},n.unstable_runWithPriority=function(z,X){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var F=T;T=z;try{return X()}finally{T=F}},n.unstable_scheduleCallback=function(z,X,F){var ee=n.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?ee+F:ee):F=ee,z){case 1:var fe=-1;break;case 2:fe=250;break;case 5:fe=1073741823;break;case 4:fe=1e4;break;default:fe=5e3}return fe=F+fe,z={id:y++,callback:X,priorityLevel:z,startTime:F,expirationTime:fe,sortIndex:-1},F>ee?(z.sortIndex=F,a(v,z),i(g)===null&&z===i(v)&&(R?(O(te),te=-1):R=!0,W($,F-ee))):(z.sortIndex=fe,a(g,z),C||N||(C=!0,ae||(ae=!0,G()))),z},n.unstable_shouldYield=ye,n.unstable_wrapCallback=function(z){var X=T;return function(){var F=T;T=X;try{return z.apply(this,arguments)}finally{T=F}}}})(yd)),yd}var fg;function sx(){return fg||(fg=1,_d.exports=ax()),_d.exports}var bd={exports:{}},Tt={};var hg;function lx(){if(hg)return Tt;hg=1;var n=ef();function a(g){var v="https://react.dev/errors/"+g;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)v+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var r={d:{f:i,r:function(){throw Error(a(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},u=Symbol.for("react.portal");function f(g,v,y){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:b==null?null:""+b,children:g,containerInfo:v,implementation:y}}var p=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,v){if(g==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return Tt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Tt.createPortal=function(g,v){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(a(299));return f(g,v,null,y)},Tt.flushSync=function(g){var v=p.T,y=r.p;try{if(p.T=null,r.p=2,g)return g()}finally{p.T=v,r.p=y,r.d.f()}},Tt.preconnect=function(g,v){typeof g=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,r.d.C(g,v))},Tt.prefetchDNS=function(g){typeof g=="string"&&r.d.D(g)},Tt.preinit=function(g,v){if(typeof g=="string"&&v&&typeof v.as=="string"){var y=v.as,b=m(y,v.crossOrigin),T=typeof v.integrity=="string"?v.integrity:void 0,N=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;y==="style"?r.d.S(g,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:b,integrity:T,fetchPriority:N}):y==="script"&&r.d.X(g,{crossOrigin:b,integrity:T,fetchPriority:N,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},Tt.preinitModule=function(g,v){if(typeof g=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var y=m(v.as,v.crossOrigin);r.d.M(g,{crossOrigin:y,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&r.d.M(g)},Tt.preload=function(g,v){if(typeof g=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var y=v.as,b=m(y,v.crossOrigin);r.d.L(g,y,{crossOrigin:b,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},Tt.preloadModule=function(g,v){if(typeof g=="string")if(v){var y=m(v.as,v.crossOrigin);r.d.m(g,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:y,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else r.d.m(g)},Tt.requestFormReset=function(g){r.d.r(g)},Tt.unstable_batchedUpdates=function(g,v){return g(v)},Tt.useFormState=function(g,v,y){return p.H.useFormState(g,v,y)},Tt.useFormStatus=function(){return p.H.useHostTransitionStatus()},Tt.version="19.2.7",Tt}var pg;function Rv(){if(pg)return bd.exports;pg=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),bd.exports=lx(),bd.exports}var mg;function ix(){if(mg)return Ii;mg=1;var n=sx(),a=ef(),i=Rv();function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}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 u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function p(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 m(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 g(e){if(f(e)!==e)throw Error(r(188))}function v(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(r(188));return t!==e?null:e}for(var s=e,l=t;;){var c=s.return;if(c===null)break;var d=c.alternate;if(d===null){if(l=c.return,l!==null){s=l;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===s)return g(c),e;if(d===l)return g(c),t;d=d.sibling}throw Error(r(188))}if(s.return!==l.return)s=c,l=d;else{for(var h=!1,_=c.child;_;){if(_===s){h=!0,s=c,l=d;break}if(_===l){h=!0,l=c,s=d;break}_=_.sibling}if(!h){for(_=d.child;_;){if(_===s){h=!0,s=d,l=c;break}if(_===l){h=!0,l=d,s=c;break}_=_.sibling}if(!h)throw Error(r(189))}}if(s.alternate!==l)throw Error(r(190))}if(s.tag!==3)throw Error(r(188));return s.stateNode.current===s?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,T=Symbol.for("react.element"),N=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),he=Symbol.for("react.lazy"),re=Symbol.for("react.activity"),ye=Symbol.for("react.memo_cache_sentinel"),me=Symbol.iterator;function G(e){return e===null||typeof e!="object"?null:(e=me&&e[me]||e["@@iterator"],typeof e=="function"?e:null)}var ge=Symbol.for("react.client.reference");function _e(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ge?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case R:return"Fragment";case q:return"Profiler";case L:return"StrictMode";case $:return"Suspense";case ae:return"SuspenseList";case re:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case Y:return e.displayName||"Context";case O:return(e._context.displayName||"Context")+".Consumer";case A:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case te:return t=e.displayName||null,t!==null?t:_e(e.type)||"Memo";case he:t=e._payload,e=e._init;try{return _e(e(t))}catch{}}return null}var W=Array.isArray,z=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},ee=[],fe=-1;function S(e){return{current:e}}function U(e){0>fe||(e.current=ee[fe],ee[fe]=null,fe--)}function K(e,t){fe++,ee[fe]=e.current,e.current=t}var J=S(null),ue=S(null),Q=S(null),ve=S(null);function Qe(e,t){switch(K(Q,t),K(ue,e),K(J,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Cm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Cm(t),e=Om(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(J),K(J,e)}function Ge(){U(J),U(ue),U(Q)}function bn(e){e.memoizedState!==null&&K(ve,e);var t=J.current,s=Om(t,e.type);t!==s&&(K(ue,e),K(J,s))}function On(e){ue.current===e&&(U(J),U(ue)),ve.current===e&&(U(ve),ki._currentValue=F)}var it,tt;function St(e){if(it===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);it=t&&t[1]||"",tt=-1<s.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+it+e+tt}var gt=!1;function kn(e,t){if(!e||gt)return"";gt=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var V=function(){throw Error()};if(Object.defineProperty(V.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(V,[])}catch(I){var D=I}Reflect.construct(e,[],V)}else{try{V.call()}catch(I){D=I}e.call(V.prototype)}}else{try{throw Error()}catch(I){D=I}(V=e())&&typeof V.catch=="function"&&V.catch(function(){})}}catch(I){if(I&&D&&typeof I.stack=="string")return[I.stack,D.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=l.DetermineComponentFrameRoot(),h=d[0],_=d[1];if(h&&_){var x=h.split(`
4
+ `),M=_.split(`
5
+ `);for(c=l=0;l<x.length&&!x[l].includes("DetermineComponentFrameRoot");)l++;for(;c<M.length&&!M[c].includes("DetermineComponentFrameRoot");)c++;if(l===x.length||c===M.length)for(l=x.length-1,c=M.length-1;1<=l&&0<=c&&x[l]!==M[c];)c--;for(;1<=l&&0<=c;l--,c--)if(x[l]!==M[c]){if(l!==1||c!==1)do if(l--,c--,0>c||x[l]!==M[c]){var H=`
6
+ `+x[l].replace(" at new "," at ");return e.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",e.displayName)),H}while(1<=l&&0<=c);break}}}finally{gt=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?St(s):""}function ac(e,t){switch(e.tag){case 26:case 27:case 5:return St(e.type);case 16:return St("Lazy");case 13:return e.child!==t&&t!==null?St("Suspense Fallback"):St("Suspense");case 19:return St("SuspenseList");case 0:case 15:return kn(e.type,!1);case 11:return kn(e.type.render,!1);case 1:return kn(e.type,!0);case 31:return St("Activity");default:return""}}function Zn(e){try{var t="",s=null;do t+=ac(e,s),s=e,e=e.return;while(e);return t}catch(l){return`
7
+ Error generating stack: `+l.message+`
8
+ `+l.stack}}var Hs=Object.prototype.hasOwnProperty,ls=n.unstable_scheduleCallback,ke=n.unstable_cancelCallback,Ie=n.unstable_shouldYield,ct=n.unstable_requestPaint,Be=n.unstable_now,tr=n.unstable_getCurrentPriorityLevel,is=n.unstable_ImmediatePriority,ql=n.unstable_UserBlockingPriority,xn=n.unstable_NormalPriority,ya=n.unstable_LowPriority,$l=n.unstable_IdlePriority,sc=n.log,lc=n.unstable_setDisableYieldValue,rs=null,Mt=null;function Ut(e){if(typeof sc=="function"&&lc(e),Mt&&typeof Mt.setStrictMode=="function")try{Mt.setStrictMode(rs,e)}catch{}}var We=Math.clz32?Math.clz32:qt,Sn=Math.log,os=Math.LN2;function qt(e){return e>>>=0,e===0?32:31-(Sn(e)/os|0)|0}var Mn=256,jn=262144,ut=4194304;function zn(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 cs(e,t,s){var l=e.pendingLanes;if(l===0)return 0;var c=0,d=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var _=l&134217727;return _!==0?(l=_&~d,l!==0?c=zn(l):(h&=_,h!==0?c=zn(h):s||(s=_&~e,s!==0&&(c=zn(s))))):(_=l&~d,_!==0?c=zn(_):h!==0?c=zn(h):s||(s=l&~e,s!==0&&(c=zn(s)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,s=t&-t,d>=s||d===32&&(s&4194048)!==0)?t:c}function us(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Gs(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 nr(){var e=ut;return ut<<=1,(ut&62914560)===0&&(ut=4194304),e}function Hl(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function ds(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ic(e,t,s,l,c,d){var h=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var _=e.entanglements,x=e.expirationTimes,M=e.hiddenUpdates;for(s=h&~s;0<s;){var H=31-We(s),V=1<<H;_[H]=0,x[H]=-1;var D=M[H];if(D!==null)for(M[H]=null,H=0;H<D.length;H++){var I=D[H];I!==null&&(I.lane&=-536870913)}s&=~V}l!==0&&Gl(e,l,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(h&~t))}function Gl(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-We(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|s&261930}function Bl(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var l=31-We(s),c=1<<l;c&t|e[l]&t&&(e[l]|=t),s&=~c}}function ar(e,t){var s=t&-t;return s=(s&42)!==0?1:Vl(s),(s&(e.suspendedLanes|t))!==0?0:s}function Vl(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 Bs(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Zl(){var e=X.p;return e!==0?e:(e=window.event,e===void 0?32:eg(e.type))}function Yl(e,t){var s=X.p;try{return X.p=e,t()}finally{X.p=s}}var wn=Math.random().toString(36).slice(2),vt="__reactFiber$"+wn,jt="__reactProps$"+wn,ba="__reactContainer$"+wn,se="__reactEvents$"+wn,je="__reactListeners$"+wn,rn="__reactHandles$"+wn,sr="__reactResources$"+wn,Xl="__reactMarker$"+wn;function rc(e){delete e[vt],delete e[jt],delete e[se],delete e[je],delete e[rn]}function Vs(e){var t=e[vt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[ba]||s[vt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=Um(e);e!==null;){if(s=e[vt])return s;e=Um(e)}return t}e=s,s=e.parentNode}return null}function Zs(e){if(e=e[vt]||e[ba]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Kl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function Ys(e){var t=e[sr];return t||(t=e[sr]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function yt(e){e[Xl]=!0}var _f=new Set,yf={};function fs(e,t){Xs(e,t),Xs(e+"Capture",t)}function Xs(e,t){for(yf[e]=t,e=0;e<t.length;e++)_f.add(t[e])}var Z_=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]*$"),bf={},xf={};function Y_(e){return Hs.call(xf,e)?!0:Hs.call(bf,e)?!1:Z_.test(e)?xf[e]=!0:(bf[e]=!0,!1)}function lr(e,t,s){if(Y_(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function ir(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function Yn(e,t,s,l){if(l===null)e.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+l)}}function on(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Sf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function X_(e,t,s){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var c=l.get,d=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(h){s=""+h,d.call(this,h)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(h){s=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function oc(e){if(!e._valueTracker){var t=Sf(e)?"checked":"value";e._valueTracker=X_(e,t,""+e[t])}}function jf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),l="";return e&&(l=Sf(e)?e.checked?"true":"false":e.value),e=l,e!==s?(t.setValue(e),!0):!1}function rr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var K_=/[\n"\\]/g;function cn(e){return e.replace(K_,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function cc(e,t,s,l,c,d,h,_){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+on(t)):e.value!==""+on(t)&&(e.value=""+on(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?uc(e,h,on(t)):s!=null?uc(e,h,on(s)):l!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.name=""+on(_):e.removeAttribute("name")}function wf(e,t,s,l,c,d,h,_){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||s!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){oc(e);return}s=s!=null?""+on(s):"",t=t!=null?""+on(t):s,_||t===e.value||(e.value=t),e.defaultValue=t}l=l??c,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=_?e.checked:!!l,e.defaultChecked=!!l,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),oc(e)}function uc(e,t,s){t==="number"&&rr(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Ks(e,t,s,l){if(e=e.options,t){t={};for(var c=0;c<s.length;c++)t["$"+s[c]]=!0;for(s=0;s<e.length;s++)c=t.hasOwnProperty("$"+e[s].value),e[s].selected!==c&&(e[s].selected=c),c&&l&&(e[s].defaultSelected=!0)}else{for(s=""+on(s),t=null,c=0;c<e.length;c++){if(e[c].value===s){e[c].selected=!0,l&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Nf(e,t,s){if(t!=null&&(t=""+on(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+on(s):""}function Af(e,t,s,l){if(t==null){if(l!=null){if(s!=null)throw Error(r(92));if(W(l)){if(1<l.length)throw Error(r(93));l=l[0]}s=l}s==null&&(s=""),t=s}s=on(t),e.defaultValue=s,l=e.textContent,l===s&&l!==""&&l!==null&&(e.value=l),oc(e)}function Qs(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var Q_=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 Rf(e,t,s){var l=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,s):typeof s!="number"||s===0||Q_.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Ef(e,t,s){if(t!=null&&typeof t!="object")throw Error(r(62));if(e=e.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var c in t)l=t[c],t.hasOwnProperty(c)&&s[c]!==l&&Rf(e,c,l)}else for(var d in t)t.hasOwnProperty(d)&&Rf(e,d,t[d])}function dc(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 J_=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"]]),F_=/^[\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 or(e){return F_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Xn(){}var fc=null;function hc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Js=null,Fs=null;function Tf(e){var t=Zs(e);if(t&&(e=t.stateNode)){var s=e[jt]||null;e:switch(e=t.stateNode,t.type){case"input":if(cc(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+cn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var l=s[t];if(l!==e&&l.form===e.form){var c=l[jt]||null;if(!c)throw Error(r(90));cc(l,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<s.length;t++)l=s[t],l.form===e.form&&jf(l)}break e;case"textarea":Nf(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&Ks(e,!!s.multiple,t,!1)}}}var pc=!1;function Cf(e,t,s){if(pc)return e(t,s);pc=!0;try{var l=e(t);return l}finally{if(pc=!1,(Js!==null||Fs!==null)&&(Qr(),Js&&(t=Js,e=Fs,Fs=Js=null,Tf(t),e)))for(t=0;t<e.length;t++)Tf(e[t])}}function Ql(e,t){var s=e.stateNode;if(s===null)return null;var l=s[jt]||null;if(l===null)return null;s=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(r(231,t,typeof s));return s}var Kn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mc=!1;if(Kn)try{var Jl={};Object.defineProperty(Jl,"passive",{get:function(){mc=!0}}),window.addEventListener("test",Jl,Jl),window.removeEventListener("test",Jl,Jl)}catch{mc=!1}var xa=null,gc=null,cr=null;function Of(){if(cr)return cr;var e,t=gc,s=t.length,l,c="value"in xa?xa.value:xa.textContent,d=c.length;for(e=0;e<s&&t[e]===c[e];e++);var h=s-e;for(l=1;l<=h&&t[s-l]===c[d-l];l++);return cr=c.slice(e,1<l?1-l:void 0)}function ur(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 dr(){return!0}function kf(){return!1}function $t(e){function t(s,l,c,d,h){this._reactName=s,this._targetInst=c,this.type=l,this.nativeEvent=d,this.target=h,this.currentTarget=null;for(var _ in e)e.hasOwnProperty(_)&&(s=e[_],this[_]=s?s(d):d[_]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?dr:kf,this.isPropagationStopped=kf,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=dr)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=dr)},persist:function(){},isPersistent:dr}),t}var hs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fr=$t(hs),Fl=b({},hs,{view:0,detail:0}),W_=$t(Fl),vc,_c,Wl,hr=b({},Fl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bc,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!==Wl&&(Wl&&e.type==="mousemove"?(vc=e.screenX-Wl.screenX,_c=e.screenY-Wl.screenY):_c=vc=0,Wl=e),vc)},movementY:function(e){return"movementY"in e?e.movementY:_c}}),Mf=$t(hr),P_=b({},hr,{dataTransfer:0}),ey=$t(P_),ty=b({},Fl,{relatedTarget:0}),yc=$t(ty),ny=b({},hs,{animationName:0,elapsedTime:0,pseudoElement:0}),ay=$t(ny),sy=b({},hs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ly=$t(sy),iy=b({},hs,{data:0}),zf=$t(iy),ry={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oy={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"},cy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function uy(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=cy[e])?!!t[e]:!1}function bc(){return uy}var dy=b({},Fl,{key:function(e){if(e.key){var t=ry[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ur(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?oy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bc,charCode:function(e){return e.type==="keypress"?ur(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ur(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),fy=$t(dy),hy=b({},hr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lf=$t(hy),py=b({},Fl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bc}),my=$t(py),gy=b({},hs,{propertyName:0,elapsedTime:0,pseudoElement:0}),vy=$t(gy),_y=b({},hr,{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}),yy=$t(_y),by=b({},hs,{newState:0,oldState:0}),xy=$t(by),Sy=[9,13,27,32],xc=Kn&&"CompositionEvent"in window,Pl=null;Kn&&"documentMode"in document&&(Pl=document.documentMode);var jy=Kn&&"TextEvent"in window&&!Pl,Df=Kn&&(!xc||Pl&&8<Pl&&11>=Pl),If=" ",Uf=!1;function qf(e,t){switch(e){case"keyup":return Sy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $f(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ws=!1;function wy(e,t){switch(e){case"compositionend":return $f(t);case"keypress":return t.which!==32?null:(Uf=!0,If);case"textInput":return e=t.data,e===If&&Uf?null:e;default:return null}}function Ny(e,t){if(Ws)return e==="compositionend"||!xc&&qf(e,t)?(e=Of(),cr=gc=xa=null,Ws=!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 Df&&t.locale!=="ko"?null:t.data;default:return null}}var Ay={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 Hf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ay[e.type]:t==="textarea"}function Gf(e,t,s,l){Js?Fs?Fs.push(l):Fs=[l]:Js=l,t=no(t,"onChange"),0<t.length&&(s=new fr("onChange","change",null,s,l),e.push({event:s,listeners:t}))}var ei=null,ti=null;function Ry(e){wm(e,0)}function pr(e){var t=Kl(e);if(jf(t))return e}function Bf(e,t){if(e==="change")return t}var Vf=!1;if(Kn){var Sc;if(Kn){var jc="oninput"in document;if(!jc){var Zf=document.createElement("div");Zf.setAttribute("oninput","return;"),jc=typeof Zf.oninput=="function"}Sc=jc}else Sc=!1;Vf=Sc&&(!document.documentMode||9<document.documentMode)}function Yf(){ei&&(ei.detachEvent("onpropertychange",Xf),ti=ei=null)}function Xf(e){if(e.propertyName==="value"&&pr(ti)){var t=[];Gf(t,ti,e,hc(e)),Cf(Ry,t)}}function Ey(e,t,s){e==="focusin"?(Yf(),ei=t,ti=s,ei.attachEvent("onpropertychange",Xf)):e==="focusout"&&Yf()}function Ty(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return pr(ti)}function Cy(e,t){if(e==="click")return pr(t)}function Oy(e,t){if(e==="input"||e==="change")return pr(t)}function ky(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Kt=typeof Object.is=="function"?Object.is:ky;function ni(e,t){if(Kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var c=s[l];if(!Hs.call(t,c)||!Kt(e[c],t[c]))return!1}return!0}function Kf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Qf(e,t){var s=Kf(e);e=0;for(var l;s;){if(s.nodeType===3){if(l=e+s.textContent.length,e<=t&&l>=t)return{node:s,offset:t-e};e=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Kf(s)}}function Jf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ff(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=rr(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=rr(e.document)}return t}function wc(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 My=Kn&&"documentMode"in document&&11>=document.documentMode,Ps=null,Nc=null,ai=null,Ac=!1;function Wf(e,t,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Ac||Ps==null||Ps!==rr(l)||(l=Ps,"selectionStart"in l&&wc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),ai&&ni(ai,l)||(ai=l,l=no(Nc,"onSelect"),0<l.length&&(t=new fr("onSelect","select",null,t,s),e.push({event:t,listeners:l}),t.target=Ps)))}function ps(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var el={animationend:ps("Animation","AnimationEnd"),animationiteration:ps("Animation","AnimationIteration"),animationstart:ps("Animation","AnimationStart"),transitionrun:ps("Transition","TransitionRun"),transitionstart:ps("Transition","TransitionStart"),transitioncancel:ps("Transition","TransitionCancel"),transitionend:ps("Transition","TransitionEnd")},Rc={},Pf={};Kn&&(Pf=document.createElement("div").style,"AnimationEvent"in window||(delete el.animationend.animation,delete el.animationiteration.animation,delete el.animationstart.animation),"TransitionEvent"in window||delete el.transitionend.transition);function ms(e){if(Rc[e])return Rc[e];if(!el[e])return e;var t=el[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Pf)return Rc[e]=t[s];return e}var eh=ms("animationend"),th=ms("animationiteration"),nh=ms("animationstart"),zy=ms("transitionrun"),Ly=ms("transitionstart"),Dy=ms("transitioncancel"),ah=ms("transitionend"),sh=new Map,Ec="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(" ");Ec.push("scrollEnd");function Nn(e,t){sh.set(e,t),fs(t,[e])}var mr=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!==null&&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)},un=[],tl=0,Tc=0;function gr(){for(var e=tl,t=Tc=tl=0;t<e;){var s=un[t];un[t++]=null;var l=un[t];un[t++]=null;var c=un[t];un[t++]=null;var d=un[t];if(un[t++]=null,l!==null&&c!==null){var h=l.pending;h===null?c.next=c:(c.next=h.next,h.next=c),l.pending=c}d!==0&&lh(s,c,d)}}function vr(e,t,s,l){un[tl++]=e,un[tl++]=t,un[tl++]=s,un[tl++]=l,Tc|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Cc(e,t,s,l){return vr(e,t,s,l),_r(e)}function gs(e,t){return vr(e,null,null,t),_r(e)}function lh(e,t,s){e.lanes|=s;var l=e.alternate;l!==null&&(l.lanes|=s);for(var c=!1,d=e.return;d!==null;)d.childLanes|=s,l=d.alternate,l!==null&&(l.childLanes|=s),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&t!==null&&(c=31-We(s),e=d.hiddenUpdates,l=e[c],l===null?e[c]=[t]:l.push(t),t.lane=s|536870912),d):null}function _r(e){if(50<Ni)throw Ni=0,qu=null,Error(r(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var nl={};function Iy(e,t,s,l){this.tag=e,this.key=s,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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qt(e,t,s,l){return new Iy(e,t,s,l)}function Oc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Qn(e,t){var s=e.alternate;return s===null?(s=Qt(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function ih(e,t){e.flags&=65011714;var s=e.alternate;return s===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=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function yr(e,t,s,l,c,d){var h=0;if(l=e,typeof e=="function")Oc(e)&&(h=1);else if(typeof e=="string")h=Gb(e,s,J.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case re:return e=Qt(31,s,t,c),e.elementType=re,e.lanes=d,e;case R:return vs(s.children,c,d,t);case L:h=8,c|=24;break;case q:return e=Qt(12,s,t,c|2),e.elementType=q,e.lanes=d,e;case $:return e=Qt(13,s,t,c),e.elementType=$,e.lanes=d,e;case ae:return e=Qt(19,s,t,c),e.elementType=ae,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Y:h=10;break e;case O:h=9;break e;case A:h=11;break e;case te:h=14;break e;case he:h=16,l=null;break e}h=29,s=Error(r(130,e===null?"null":typeof e,"")),l=null}return t=Qt(h,s,t,c),t.elementType=e,t.type=l,t.lanes=d,t}function vs(e,t,s,l){return e=Qt(7,e,l,t),e.lanes=s,e}function kc(e,t,s){return e=Qt(6,e,null,t),e.lanes=s,e}function rh(e){var t=Qt(18,null,null,0);return t.stateNode=e,t}function Mc(e,t,s){return t=Qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var oh=new WeakMap;function dn(e,t){if(typeof e=="object"&&e!==null){var s=oh.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Zn(t)},oh.set(e,t),t)}return{value:e,source:t,stack:Zn(t)}}var al=[],sl=0,br=null,si=0,fn=[],hn=0,Sa=null,Ln=1,Dn="";function Jn(e,t){al[sl++]=si,al[sl++]=br,br=e,si=t}function ch(e,t,s){fn[hn++]=Ln,fn[hn++]=Dn,fn[hn++]=Sa,Sa=e;var l=Ln;e=Dn;var c=32-We(l)-1;l&=~(1<<c),s+=1;var d=32-We(t)+c;if(30<d){var h=c-c%5;d=(l&(1<<h)-1).toString(32),l>>=h,c-=h,Ln=1<<32-We(t)+c|s<<c|l,Dn=d+e}else Ln=1<<d|s<<c|l,Dn=e}function zc(e){e.return!==null&&(Jn(e,1),ch(e,1,0))}function Lc(e){for(;e===br;)br=al[--sl],al[sl]=null,si=al[--sl],al[sl]=null;for(;e===Sa;)Sa=fn[--hn],fn[hn]=null,Dn=fn[--hn],fn[hn]=null,Ln=fn[--hn],fn[hn]=null}function uh(e,t){fn[hn++]=Ln,fn[hn++]=Dn,fn[hn++]=Sa,Ln=t.id,Dn=t.overflow,Sa=e}var wt=null,Je=null,Oe=!1,ja=null,pn=!1,Dc=Error(r(519));function wa(e){var t=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw li(dn(t,e)),Dc}function dh(e){var t=e.stateNode,s=e.type,l=e.memoizedProps;switch(t[vt]=e,t[jt]=l,s){case"dialog":Ee("cancel",t),Ee("close",t);break;case"iframe":case"object":case"embed":Ee("load",t);break;case"video":case"audio":for(s=0;s<Ri.length;s++)Ee(Ri[s],t);break;case"source":Ee("error",t);break;case"img":case"image":case"link":Ee("error",t),Ee("load",t);break;case"details":Ee("toggle",t);break;case"input":Ee("invalid",t),wf(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ee("invalid",t);break;case"textarea":Ee("invalid",t),Af(t,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||l.suppressHydrationWarning===!0||Em(t.textContent,s)?(l.popover!=null&&(Ee("beforetoggle",t),Ee("toggle",t)),l.onScroll!=null&&Ee("scroll",t),l.onScrollEnd!=null&&Ee("scrollend",t),l.onClick!=null&&(t.onclick=Xn),t=!0):t=!1,t||wa(e,!0)}function fh(e){for(wt=e.return;wt;)switch(wt.tag){case 5:case 31:case 13:pn=!1;return;case 27:case 3:pn=!0;return;default:wt=wt.return}}function ll(e){if(e!==wt)return!1;if(!Oe)return fh(e),Oe=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||ed(e.type,e.memoizedProps)),s=!s),s&&Je&&wa(e),fh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));Je=Im(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));Je=Im(e)}else t===27?(t=Je,Ua(e.type)?(e=ld,ld=null,Je=e):Je=t):Je=wt?gn(e.stateNode.nextSibling):null;return!0}function _s(){Je=wt=null,Oe=!1}function Ic(){var e=ja;return e!==null&&(Vt===null?Vt=e:Vt.push.apply(Vt,e),ja=null),e}function li(e){ja===null?ja=[e]:ja.push(e)}var Uc=S(null),ys=null,Fn=null;function Na(e,t,s){K(Uc,t._currentValue),t._currentValue=s}function Wn(e){e._currentValue=Uc.current,U(Uc)}function qc(e,t,s){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===s)break;e=e.return}}function $c(e,t,s,l){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var h=c.child;d=d.firstContext;e:for(;d!==null;){var _=d;d=c;for(var x=0;x<t.length;x++)if(_.context===t[x]){d.lanes|=s,_=d.alternate,_!==null&&(_.lanes|=s),qc(d.return,s,e),l||(h=null);break e}d=_.next}}else if(c.tag===18){if(h=c.return,h===null)throw Error(r(341));h.lanes|=s,d=h.alternate,d!==null&&(d.lanes|=s),qc(h,s,e),h=null}else h=c.child;if(h!==null)h.return=c;else for(h=c;h!==null;){if(h===e){h=null;break}if(c=h.sibling,c!==null){c.return=h.return,h=c;break}h=h.return}c=h}}function il(e,t,s,l){e=null;for(var c=t,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var h=c.alternate;if(h===null)throw Error(r(387));if(h=h.memoizedProps,h!==null){var _=c.type;Kt(c.pendingProps.value,h.value)||(e!==null?e.push(_):e=[_])}}else if(c===ve.current){if(h=c.alternate,h===null)throw Error(r(387));h.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(ki):e=[ki])}c=c.return}e!==null&&$c(t,e,s,l),t.flags|=262144}function xr(e){for(e=e.firstContext;e!==null;){if(!Kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function bs(e){ys=e,Fn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Nt(e){return hh(ys,e)}function Sr(e,t){return ys===null&&bs(e),hh(e,t)}function hh(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},Fn===null){if(e===null)throw Error(r(308));Fn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Fn=Fn.next=t;return s}var Uy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},qy=n.unstable_scheduleCallback,$y=n.unstable_NormalPriority,dt={$$typeof:Y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hc(){return{controller:new Uy,data:new Map,refCount:0}}function ii(e){e.refCount--,e.refCount===0&&qy($y,function(){e.controller.abort()})}var ri=null,Gc=0,rl=0,ol=null;function Hy(e,t){if(ri===null){var s=ri=[];Gc=0,rl=Zu(),ol={status:"pending",value:void 0,then:function(l){s.push(l)}}}return Gc++,t.then(ph,ph),t}function ph(){if(--Gc===0&&ri!==null){ol!==null&&(ol.status="fulfilled");var e=ri;ri=null,rl=0,ol=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Gy(e,t){var s=[],l={status:"pending",value:null,reason:null,then:function(c){s.push(c)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var c=0;c<s.length;c++)(0,s[c])(t)},function(c){for(l.status="rejected",l.reason=c,c=0;c<s.length;c++)(0,s[c])(void 0)}),l}var mh=z.S;z.S=function(e,t){Wp=Be(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Hy(e,t),mh!==null&&mh(e,t)};var xs=S(null);function Bc(){var e=xs.current;return e!==null?e:Ke.pooledCache}function jr(e,t){t===null?K(xs,xs.current):K(xs,t.pool)}function gh(){var e=Bc();return e===null?null:{parent:dt._currentValue,pool:e}}var cl=Error(r(460)),Vc=Error(r(474)),wr=Error(r(542)),Nr={then:function(){}};function vh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function _h(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(Xn,Xn),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,bh(e),e;default:if(typeof t.status=="string")t.then(Xn,Xn);else{if(e=Ke,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=l}},function(l){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,bh(e),e}throw js=t,cl}}function Ss(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(js=s,cl):s}}var js=null;function yh(){if(js===null)throw Error(r(459));var e=js;return js=null,e}function bh(e){if(e===cl||e===wr)throw Error(r(483))}var ul=null,oi=0;function Ar(e){var t=oi;return oi+=1,ul===null&&(ul=[]),_h(ul,e,t)}function ci(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Rr(e,t){throw t.$$typeof===T?Error(r(525)):(e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function xh(e){function t(E,w){if(e){var k=E.deletions;k===null?(E.deletions=[w],E.flags|=16):k.push(w)}}function s(E,w){if(!e)return null;for(;w!==null;)t(E,w),w=w.sibling;return null}function l(E){for(var w=new Map;E!==null;)E.key!==null?w.set(E.key,E):w.set(E.index,E),E=E.sibling;return w}function c(E,w){return E=Qn(E,w),E.index=0,E.sibling=null,E}function d(E,w,k){return E.index=k,e?(k=E.alternate,k!==null?(k=k.index,k<w?(E.flags|=67108866,w):k):(E.flags|=67108866,w)):(E.flags|=1048576,w)}function h(E){return e&&E.alternate===null&&(E.flags|=67108866),E}function _(E,w,k,B){return w===null||w.tag!==6?(w=kc(k,E.mode,B),w.return=E,w):(w=c(w,k),w.return=E,w)}function x(E,w,k,B){var de=k.type;return de===R?H(E,w,k.props.children,B,k.key):w!==null&&(w.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===he&&Ss(de)===w.type)?(w=c(w,k.props),ci(w,k),w.return=E,w):(w=yr(k.type,k.key,k.props,null,E.mode,B),ci(w,k),w.return=E,w)}function M(E,w,k,B){return w===null||w.tag!==4||w.stateNode.containerInfo!==k.containerInfo||w.stateNode.implementation!==k.implementation?(w=Mc(k,E.mode,B),w.return=E,w):(w=c(w,k.children||[]),w.return=E,w)}function H(E,w,k,B,de){return w===null||w.tag!==7?(w=vs(k,E.mode,B,de),w.return=E,w):(w=c(w,k),w.return=E,w)}function V(E,w,k){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=kc(""+w,E.mode,k),w.return=E,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case N:return k=yr(w.type,w.key,w.props,null,E.mode,k),ci(k,w),k.return=E,k;case C:return w=Mc(w,E.mode,k),w.return=E,w;case he:return w=Ss(w),V(E,w,k)}if(W(w)||G(w))return w=vs(w,E.mode,k,null),w.return=E,w;if(typeof w.then=="function")return V(E,Ar(w),k);if(w.$$typeof===Y)return V(E,Sr(E,w),k);Rr(E,w)}return null}function D(E,w,k,B){var de=w!==null?w.key:null;if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return de!==null?null:_(E,w,""+k,B);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case N:return k.key===de?x(E,w,k,B):null;case C:return k.key===de?M(E,w,k,B):null;case he:return k=Ss(k),D(E,w,k,B)}if(W(k)||G(k))return de!==null?null:H(E,w,k,B,null);if(typeof k.then=="function")return D(E,w,Ar(k),B);if(k.$$typeof===Y)return D(E,w,Sr(E,k),B);Rr(E,k)}return null}function I(E,w,k,B,de){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return E=E.get(k)||null,_(w,E,""+B,de);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case N:return E=E.get(B.key===null?k:B.key)||null,x(w,E,B,de);case C:return E=E.get(B.key===null?k:B.key)||null,M(w,E,B,de);case he:return B=Ss(B),I(E,w,k,B,de)}if(W(B)||G(B))return E=E.get(k)||null,H(w,E,B,de,null);if(typeof B.then=="function")return I(E,w,k,Ar(B),de);if(B.$$typeof===Y)return I(E,w,k,Sr(w,B),de);Rr(w,B)}return null}function le(E,w,k,B){for(var de=null,Le=null,oe=w,Ne=w=0,Ce=null;oe!==null&&Ne<k.length;Ne++){oe.index>Ne?(Ce=oe,oe=null):Ce=oe.sibling;var De=D(E,oe,k[Ne],B);if(De===null){oe===null&&(oe=Ce);break}e&&oe&&De.alternate===null&&t(E,oe),w=d(De,w,Ne),Le===null?de=De:Le.sibling=De,Le=De,oe=Ce}if(Ne===k.length)return s(E,oe),Oe&&Jn(E,Ne),de;if(oe===null){for(;Ne<k.length;Ne++)oe=V(E,k[Ne],B),oe!==null&&(w=d(oe,w,Ne),Le===null?de=oe:Le.sibling=oe,Le=oe);return Oe&&Jn(E,Ne),de}for(oe=l(oe);Ne<k.length;Ne++)Ce=I(oe,E,Ne,k[Ne],B),Ce!==null&&(e&&Ce.alternate!==null&&oe.delete(Ce.key===null?Ne:Ce.key),w=d(Ce,w,Ne),Le===null?de=Ce:Le.sibling=Ce,Le=Ce);return e&&oe.forEach(function(Ba){return t(E,Ba)}),Oe&&Jn(E,Ne),de}function pe(E,w,k,B){if(k==null)throw Error(r(151));for(var de=null,Le=null,oe=w,Ne=w=0,Ce=null,De=k.next();oe!==null&&!De.done;Ne++,De=k.next()){oe.index>Ne?(Ce=oe,oe=null):Ce=oe.sibling;var Ba=D(E,oe,De.value,B);if(Ba===null){oe===null&&(oe=Ce);break}e&&oe&&Ba.alternate===null&&t(E,oe),w=d(Ba,w,Ne),Le===null?de=Ba:Le.sibling=Ba,Le=Ba,oe=Ce}if(De.done)return s(E,oe),Oe&&Jn(E,Ne),de;if(oe===null){for(;!De.done;Ne++,De=k.next())De=V(E,De.value,B),De!==null&&(w=d(De,w,Ne),Le===null?de=De:Le.sibling=De,Le=De);return Oe&&Jn(E,Ne),de}for(oe=l(oe);!De.done;Ne++,De=k.next())De=I(oe,E,Ne,De.value,B),De!==null&&(e&&De.alternate!==null&&oe.delete(De.key===null?Ne:De.key),w=d(De,w,Ne),Le===null?de=De:Le.sibling=De,Le=De);return e&&oe.forEach(function(Pb){return t(E,Pb)}),Oe&&Jn(E,Ne),de}function Ye(E,w,k,B){if(typeof k=="object"&&k!==null&&k.type===R&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case N:e:{for(var de=k.key;w!==null;){if(w.key===de){if(de=k.type,de===R){if(w.tag===7){s(E,w.sibling),B=c(w,k.props.children),B.return=E,E=B;break e}}else if(w.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===he&&Ss(de)===w.type){s(E,w.sibling),B=c(w,k.props),ci(B,k),B.return=E,E=B;break e}s(E,w);break}else t(E,w);w=w.sibling}k.type===R?(B=vs(k.props.children,E.mode,B,k.key),B.return=E,E=B):(B=yr(k.type,k.key,k.props,null,E.mode,B),ci(B,k),B.return=E,E=B)}return h(E);case C:e:{for(de=k.key;w!==null;){if(w.key===de)if(w.tag===4&&w.stateNode.containerInfo===k.containerInfo&&w.stateNode.implementation===k.implementation){s(E,w.sibling),B=c(w,k.children||[]),B.return=E,E=B;break e}else{s(E,w);break}else t(E,w);w=w.sibling}B=Mc(k,E.mode,B),B.return=E,E=B}return h(E);case he:return k=Ss(k),Ye(E,w,k,B)}if(W(k))return le(E,w,k,B);if(G(k)){if(de=G(k),typeof de!="function")throw Error(r(150));return k=de.call(k),pe(E,w,k,B)}if(typeof k.then=="function")return Ye(E,w,Ar(k),B);if(k.$$typeof===Y)return Ye(E,w,Sr(E,k),B);Rr(E,k)}return typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint"?(k=""+k,w!==null&&w.tag===6?(s(E,w.sibling),B=c(w,k),B.return=E,E=B):(s(E,w),B=kc(k,E.mode,B),B.return=E,E=B),h(E)):s(E,w)}return function(E,w,k,B){try{oi=0;var de=Ye(E,w,k,B);return ul=null,de}catch(oe){if(oe===cl||oe===wr)throw oe;var Le=Qt(29,oe,null,E.mode);return Le.lanes=B,Le.return=E,Le}}}var ws=xh(!0),Sh=xh(!1),Aa=!1;function Zc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Yc(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 Ea(e,t,s){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ue&2)!==0){var c=l.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),l.pending=t,t=_r(e),lh(e,null,s),t}return vr(e,l,t,s),_r(e)}function ui(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,Bl(e,s)}}function Xc(e,t){var s=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var c=null,d=null;if(s=s.firstBaseUpdate,s!==null){do{var h={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};d===null?c=d=h:d=d.next=h,s=s.next}while(s!==null);d===null?c=d=t:d=d.next=t}else c=d=t;s={baseState:l.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:l.shared,callbacks:l.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var Kc=!1;function di(){if(Kc){var e=ol;if(e!==null)throw e}}function fi(e,t,s,l){Kc=!1;var c=e.updateQueue;Aa=!1;var d=c.firstBaseUpdate,h=c.lastBaseUpdate,_=c.shared.pending;if(_!==null){c.shared.pending=null;var x=_,M=x.next;x.next=null,h===null?d=M:h.next=M,h=x;var H=e.alternate;H!==null&&(H=H.updateQueue,_=H.lastBaseUpdate,_!==h&&(_===null?H.firstBaseUpdate=M:_.next=M,H.lastBaseUpdate=x))}if(d!==null){var V=c.baseState;h=0,H=M=x=null,_=d;do{var D=_.lane&-536870913,I=D!==_.lane;if(I?(Te&D)===D:(l&D)===D){D!==0&&D===rl&&(Kc=!0),H!==null&&(H=H.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var le=e,pe=_;D=t;var Ye=s;switch(pe.tag){case 1:if(le=pe.payload,typeof le=="function"){V=le.call(Ye,V,D);break e}V=le;break e;case 3:le.flags=le.flags&-65537|128;case 0:if(le=pe.payload,D=typeof le=="function"?le.call(Ye,V,D):le,D==null)break e;V=b({},V,D);break e;case 2:Aa=!0}}D=_.callback,D!==null&&(e.flags|=64,I&&(e.flags|=8192),I=c.callbacks,I===null?c.callbacks=[D]:I.push(D))}else I={lane:D,tag:_.tag,payload:_.payload,callback:_.callback,next:null},H===null?(M=H=I,x=V):H=H.next=I,h|=D;if(_=_.next,_===null){if(_=c.shared.pending,_===null)break;I=_,_=I.next,I.next=null,c.lastBaseUpdate=I,c.shared.pending=null}}while(!0);H===null&&(x=V),c.baseState=x,c.firstBaseUpdate=M,c.lastBaseUpdate=H,d===null&&(c.shared.lanes=0),Ma|=h,e.lanes=h,e.memoizedState=V}}function jh(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function wh(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)jh(s[e],t)}var dl=S(null),Er=S(0);function Nh(e,t){e=ra,K(Er,e),K(dl,t),ra=e|t.baseLanes}function Qc(){K(Er,ra),K(dl,dl.current)}function Jc(){ra=Er.current,U(dl),U(Er)}var Jt=S(null),mn=null;function Ta(e){var t=e.alternate;K(rt,rt.current&1),K(Jt,e),mn===null&&(t===null||dl.current!==null||t.memoizedState!==null)&&(mn=e)}function Fc(e){K(rt,rt.current),K(Jt,e),mn===null&&(mn=e)}function Ah(e){e.tag===22?(K(rt,rt.current),K(Jt,e),mn===null&&(mn=e)):Ca()}function Ca(){K(rt,rt.current),K(Jt,Jt.current)}function Ft(e){U(Jt),mn===e&&(mn=null),U(rt)}var rt=S(0);function Tr(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||ad(s)||sd(s)))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)!==0)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 Pn=0,we=null,Ve=null,ft=null,Cr=!1,fl=!1,Ns=!1,Or=0,hi=0,hl=null,By=0;function st(){throw Error(r(321))}function Wc(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!Kt(e[s],t[s]))return!1;return!0}function Pc(e,t,s,l,c,d){return Pn=d,we=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,z.H=e===null||e.memoizedState===null?cp:pu,Ns=!1,d=s(l,c),Ns=!1,fl&&(d=Eh(t,s,l,c)),Rh(e),d}function Rh(e){z.H=gi;var t=Ve!==null&&Ve.next!==null;if(Pn=0,ft=Ve=we=null,Cr=!1,hi=0,hl=null,t)throw Error(r(300));e===null||ht||(e=e.dependencies,e!==null&&xr(e)&&(ht=!0))}function Eh(e,t,s,l){we=e;var c=0;do{if(fl&&(hl=null),hi=0,fl=!1,25<=c)throw Error(r(301));if(c+=1,ft=Ve=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}z.H=up,d=t(s,l)}while(fl);return d}function Vy(){var e=z.H,t=e.useState()[0];return t=typeof t.then=="function"?pi(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(we.flags|=1024),t}function eu(){var e=Or!==0;return Or=0,e}function tu(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function nu(e){if(Cr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Cr=!1}Pn=0,ft=Ve=we=null,fl=!1,hi=Or=0,hl=null}function zt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ft===null?we.memoizedState=ft=e:ft=ft.next=e,ft}function ot(){if(Ve===null){var e=we.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=ft===null?we.memoizedState:ft.next;if(t!==null)ft=t,Ve=e;else{if(e===null)throw we.alternate===null?Error(r(467)):Error(r(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},ft===null?we.memoizedState=ft=e:ft=ft.next=e}return ft}function kr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function pi(e){var t=hi;return hi+=1,hl===null&&(hl=[]),e=_h(hl,e,t),t=we,(ft===null?t.memoizedState:ft.next)===null&&(t=t.alternate,z.H=t===null||t.memoizedState===null?cp:pu),e}function Mr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return pi(e);if(e.$$typeof===Y)return Nt(e)}throw Error(r(438,String(e)))}function au(e){var t=null,s=we.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var l=we.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=kr(),we.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),l=0;l<e;l++)s[l]=ye;return t.index++,s}function ea(e,t){return typeof t=="function"?t(e):t}function zr(e){var t=ot();return su(t,Ve,e)}function su(e,t,s){var l=e.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=s;var c=e.baseQueue,d=l.pending;if(d!==null){if(c!==null){var h=c.next;c.next=d.next,d.next=h}t.baseQueue=c=d,l.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var _=h=null,x=null,M=t,H=!1;do{var V=M.lane&-536870913;if(V!==M.lane?(Te&V)===V:(Pn&V)===V){var D=M.revertLane;if(D===0)x!==null&&(x=x.next={lane:0,revertLane:0,gesture:null,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null}),V===rl&&(H=!0);else if((Pn&D)===D){M=M.next,D===rl&&(H=!0);continue}else V={lane:0,revertLane:M.revertLane,gesture:null,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null},x===null?(_=x=V,h=d):x=x.next=V,we.lanes|=D,Ma|=D;V=M.action,Ns&&s(d,V),d=M.hasEagerState?M.eagerState:s(d,V)}else D={lane:V,revertLane:M.revertLane,gesture:M.gesture,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null},x===null?(_=x=D,h=d):x=x.next=D,we.lanes|=V,Ma|=V;M=M.next}while(M!==null&&M!==t);if(x===null?h=d:x.next=_,!Kt(d,e.memoizedState)&&(ht=!0,H&&(s=ol,s!==null)))throw s;e.memoizedState=d,e.baseState=h,e.baseQueue=x,l.lastRenderedState=d}return c===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function lu(e){var t=ot(),s=t.queue;if(s===null)throw Error(r(311));s.lastRenderedReducer=e;var l=s.dispatch,c=s.pending,d=t.memoizedState;if(c!==null){s.pending=null;var h=c=c.next;do d=e(d,h.action),h=h.next;while(h!==c);Kt(d,t.memoizedState)||(ht=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),s.lastRenderedState=d}return[d,l]}function Th(e,t,s){var l=we,c=ot(),d=Oe;if(d){if(s===void 0)throw Error(r(407));s=s()}else s=t();var h=!Kt((Ve||c).memoizedState,s);if(h&&(c.memoizedState=s,ht=!0),c=c.queue,ou(kh.bind(null,l,c,e),[e]),c.getSnapshot!==t||h||ft!==null&&ft.memoizedState.tag&1){if(l.flags|=2048,pl(9,{destroy:void 0},Oh.bind(null,l,c,s,t),null),Ke===null)throw Error(r(349));d||(Pn&127)!==0||Ch(l,t,s)}return s}function Ch(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=we.updateQueue,t===null?(t=kr(),we.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function Oh(e,t,s,l){t.value=s,t.getSnapshot=l,Mh(t)&&zh(e)}function kh(e,t,s){return s(function(){Mh(t)&&zh(e)})}function Mh(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!Kt(e,s)}catch{return!0}}function zh(e){var t=gs(e,2);t!==null&&Zt(t,e,2)}function iu(e){var t=zt();if(typeof e=="function"){var s=e;if(e=s(),Ns){Ut(!0);try{s()}finally{Ut(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:e},t}function Lh(e,t,s,l){return e.baseState=s,su(e,Ve,typeof l=="function"?l:ea)}function Zy(e,t,s,l,c){if(Ir(e))throw Error(r(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(h){d.listeners.push(h)}};z.T!==null?s(!0):d.isTransition=!1,l(d),s=t.pending,s===null?(d.next=t.pending=d,Dh(t,d)):(d.next=s.next,t.pending=s.next=d)}}function Dh(e,t){var s=t.action,l=t.payload,c=e.state;if(t.isTransition){var d=z.T,h={};z.T=h;try{var _=s(c,l),x=z.S;x!==null&&x(h,_),Ih(e,t,_)}catch(M){ru(e,t,M)}finally{d!==null&&h.types!==null&&(d.types=h.types),z.T=d}}else try{d=s(c,l),Ih(e,t,d)}catch(M){ru(e,t,M)}}function Ih(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){Uh(e,t,l)},function(l){return ru(e,t,l)}):Uh(e,t,s)}function Uh(e,t,s){t.status="fulfilled",t.value=s,qh(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,Dh(e,s)))}function ru(e,t,s){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=s,qh(t),t=t.next;while(t!==l)}e.action=null}function qh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function $h(e,t){return t}function Hh(e,t){if(Oe){var s=Ke.formState;if(s!==null){e:{var l=we;if(Oe){if(Je){t:{for(var c=Je,d=pn;c.nodeType!==8;){if(!d){c=null;break t}if(c=gn(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){Je=gn(c.nextSibling),l=c.data==="F!";break e}}wa(l)}l=!1}l&&(t=s[0])}}return s=zt(),s.memoizedState=s.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$h,lastRenderedState:t},s.queue=l,s=ip.bind(null,we,l),l.dispatch=s,l=iu(!1),d=hu.bind(null,we,!1,l.queue),l=zt(),c={state:t,dispatch:null,action:e,pending:null},l.queue=c,s=Zy.bind(null,we,c,d,s),c.dispatch=s,l.memoizedState=e,[t,s,!1]}function Gh(e){var t=ot();return Bh(t,Ve,e)}function Bh(e,t,s){if(t=su(e,t,$h)[0],e=zr(ea)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=pi(t)}catch(h){throw h===cl?wr:h}else l=t;t=ot();var c=t.queue,d=c.dispatch;return s!==t.memoizedState&&(we.flags|=2048,pl(9,{destroy:void 0},Yy.bind(null,c,s),null)),[l,d,e]}function Yy(e,t){e.action=t}function Vh(e){var t=ot(),s=Ve;if(s!==null)return Bh(t,s,e);ot(),t=t.memoizedState,s=ot();var l=s.queue.dispatch;return s.memoizedState=e,[t,l,!1]}function pl(e,t,s,l){return e={tag:e,create:s,deps:l,inst:t,next:null},t=we.updateQueue,t===null&&(t=kr(),we.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(l=s.next,s.next=e,e.next=l,t.lastEffect=e),e}function Zh(){return ot().memoizedState}function Lr(e,t,s,l){var c=zt();we.flags|=e,c.memoizedState=pl(1|t,{destroy:void 0},s,l===void 0?null:l)}function Dr(e,t,s,l){var c=ot();l=l===void 0?null:l;var d=c.memoizedState.inst;Ve!==null&&l!==null&&Wc(l,Ve.memoizedState.deps)?c.memoizedState=pl(t,d,s,l):(we.flags|=e,c.memoizedState=pl(1|t,d,s,l))}function Yh(e,t){Lr(8390656,8,e,t)}function ou(e,t){Dr(2048,8,e,t)}function Xy(e){we.flags|=4;var t=we.updateQueue;if(t===null)t=kr(),we.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Xh(e){var t=ot().memoizedState;return Xy({ref:t,nextImpl:e}),function(){if((Ue&2)!==0)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function Kh(e,t){return Dr(4,2,e,t)}function Qh(e,t){return Dr(4,4,e,t)}function Jh(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Fh(e,t,s){s=s!=null?s.concat([e]):null,Dr(4,4,Jh.bind(null,t,e),s)}function cu(){}function Wh(e,t){var s=ot();t=t===void 0?null:t;var l=s.memoizedState;return t!==null&&Wc(t,l[1])?l[0]:(s.memoizedState=[e,t],e)}function Ph(e,t){var s=ot();t=t===void 0?null:t;var l=s.memoizedState;if(t!==null&&Wc(t,l[1]))return l[0];if(l=e(),Ns){Ut(!0);try{e()}finally{Ut(!1)}}return s.memoizedState=[l,t],l}function uu(e,t,s){return s===void 0||(Pn&1073741824)!==0&&(Te&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=em(),we.lanes|=e,Ma|=e,s)}function ep(e,t,s,l){return Kt(s,t)?s:dl.current!==null?(e=uu(e,s,l),Kt(e,t)||(ht=!0),e):(Pn&42)===0||(Pn&1073741824)!==0&&(Te&261930)===0?(ht=!0,e.memoizedState=s):(e=em(),we.lanes|=e,Ma|=e,t)}function tp(e,t,s,l,c){var d=X.p;X.p=d!==0&&8>d?d:8;var h=z.T,_={};z.T=_,hu(e,!1,t,s);try{var x=c(),M=z.S;if(M!==null&&M(_,x),x!==null&&typeof x=="object"&&typeof x.then=="function"){var H=Gy(x,l);mi(e,t,H,en(e))}else mi(e,t,l,en(e))}catch(V){mi(e,t,{then:function(){},status:"rejected",reason:V},en())}finally{X.p=d,h!==null&&_.types!==null&&(h.types=_.types),z.T=h}}function Ky(){}function du(e,t,s,l){if(e.tag!==5)throw Error(r(476));var c=np(e).queue;tp(e,c,t,F,s===null?Ky:function(){return ap(e),s(l)})}function np(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:F},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ap(e){var t=np(e);t.next===null&&(t=e.alternate.memoizedState),mi(e,t.next.queue,{},en())}function fu(){return Nt(ki)}function sp(){return ot().memoizedState}function lp(){return ot().memoizedState}function Qy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=en();e=Ra(s);var l=Ea(t,e,s);l!==null&&(Zt(l,t,s),ui(l,t,s)),t={cache:Hc()},e.payload=t;return}t=t.return}}function Jy(e,t,s){var l=en();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Ir(e)?rp(t,s):(s=Cc(e,t,s,l),s!==null&&(Zt(s,e,l),op(s,t,l)))}function ip(e,t,s){var l=en();mi(e,t,s,l)}function mi(e,t,s,l){var c={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Ir(e))rp(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var h=t.lastRenderedState,_=d(h,s);if(c.hasEagerState=!0,c.eagerState=_,Kt(_,h))return vr(e,t,c,0),Ke===null&&gr(),!1}catch{}if(s=Cc(e,t,c,l),s!==null)return Zt(s,e,l),op(s,t,l),!0}return!1}function hu(e,t,s,l){if(l={lane:2,revertLane:Zu(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ir(e)){if(t)throw Error(r(479))}else t=Cc(e,s,l,2),t!==null&&Zt(t,e,2)}function Ir(e){var t=e.alternate;return e===we||t!==null&&t===we}function rp(e,t){fl=Cr=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function op(e,t,s){if((s&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,Bl(e,s)}}var gi={readContext:Nt,use:Mr,useCallback:st,useContext:st,useEffect:st,useImperativeHandle:st,useLayoutEffect:st,useInsertionEffect:st,useMemo:st,useReducer:st,useRef:st,useState:st,useDebugValue:st,useDeferredValue:st,useTransition:st,useSyncExternalStore:st,useId:st,useHostTransitionStatus:st,useFormState:st,useActionState:st,useOptimistic:st,useMemoCache:st,useCacheRefresh:st};gi.useEffectEvent=st;var cp={readContext:Nt,use:Mr,useCallback:function(e,t){return zt().memoizedState=[e,t===void 0?null:t],e},useContext:Nt,useEffect:Yh,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,Lr(4194308,4,Jh.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Lr(4194308,4,e,t)},useInsertionEffect:function(e,t){Lr(4,2,e,t)},useMemo:function(e,t){var s=zt();t=t===void 0?null:t;var l=e();if(Ns){Ut(!0);try{e()}finally{Ut(!1)}}return s.memoizedState=[l,t],l},useReducer:function(e,t,s){var l=zt();if(s!==void 0){var c=s(t);if(Ns){Ut(!0);try{s(t)}finally{Ut(!1)}}}else c=t;return l.memoizedState=l.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},l.queue=e,e=e.dispatch=Jy.bind(null,we,e),[l.memoizedState,e]},useRef:function(e){var t=zt();return e={current:e},t.memoizedState=e},useState:function(e){e=iu(e);var t=e.queue,s=ip.bind(null,we,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:cu,useDeferredValue:function(e,t){var s=zt();return uu(s,e,t)},useTransition:function(){var e=iu(!1);return e=tp.bind(null,we,e.queue,!0,!1),zt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var l=we,c=zt();if(Oe){if(s===void 0)throw Error(r(407));s=s()}else{if(s=t(),Ke===null)throw Error(r(349));(Te&127)!==0||Ch(l,t,s)}c.memoizedState=s;var d={value:s,getSnapshot:t};return c.queue=d,Yh(kh.bind(null,l,d,e),[e]),l.flags|=2048,pl(9,{destroy:void 0},Oh.bind(null,l,d,s,t),null),s},useId:function(){var e=zt(),t=Ke.identifierPrefix;if(Oe){var s=Dn,l=Ln;s=(l&~(1<<32-We(l)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Or++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=By++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:fu,useFormState:Hh,useActionState:Hh,useOptimistic:function(e){var t=zt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=hu.bind(null,we,!0,s),s.dispatch=t,[e,t]},useMemoCache:au,useCacheRefresh:function(){return zt().memoizedState=Qy.bind(null,we)},useEffectEvent:function(e){var t=zt(),s={impl:e};return t.memoizedState=s,function(){if((Ue&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}},pu={readContext:Nt,use:Mr,useCallback:Wh,useContext:Nt,useEffect:ou,useImperativeHandle:Fh,useInsertionEffect:Kh,useLayoutEffect:Qh,useMemo:Ph,useReducer:zr,useRef:Zh,useState:function(){return zr(ea)},useDebugValue:cu,useDeferredValue:function(e,t){var s=ot();return ep(s,Ve.memoizedState,e,t)},useTransition:function(){var e=zr(ea)[0],t=ot().memoizedState;return[typeof e=="boolean"?e:pi(e),t]},useSyncExternalStore:Th,useId:sp,useHostTransitionStatus:fu,useFormState:Gh,useActionState:Gh,useOptimistic:function(e,t){var s=ot();return Lh(s,Ve,e,t)},useMemoCache:au,useCacheRefresh:lp};pu.useEffectEvent=Xh;var up={readContext:Nt,use:Mr,useCallback:Wh,useContext:Nt,useEffect:ou,useImperativeHandle:Fh,useInsertionEffect:Kh,useLayoutEffect:Qh,useMemo:Ph,useReducer:lu,useRef:Zh,useState:function(){return lu(ea)},useDebugValue:cu,useDeferredValue:function(e,t){var s=ot();return Ve===null?uu(s,e,t):ep(s,Ve.memoizedState,e,t)},useTransition:function(){var e=lu(ea)[0],t=ot().memoizedState;return[typeof e=="boolean"?e:pi(e),t]},useSyncExternalStore:Th,useId:sp,useHostTransitionStatus:fu,useFormState:Vh,useActionState:Vh,useOptimistic:function(e,t){var s=ot();return Ve!==null?Lh(s,Ve,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:au,useCacheRefresh:lp};up.useEffectEvent=Xh;function mu(e,t,s,l){t=e.memoizedState,s=s(l,t),s=s==null?t:b({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var gu={enqueueSetState:function(e,t,s){e=e._reactInternals;var l=en(),c=Ra(l);c.payload=t,s!=null&&(c.callback=s),t=Ea(e,c,l),t!==null&&(Zt(t,e,l),ui(t,e,l))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var l=en(),c=Ra(l);c.tag=1,c.payload=t,s!=null&&(c.callback=s),t=Ea(e,c,l),t!==null&&(Zt(t,e,l),ui(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=en(),l=Ra(s);l.tag=2,t!=null&&(l.callback=t),t=Ea(e,l,s),t!==null&&(Zt(t,e,s),ui(t,e,s))}};function dp(e,t,s,l,c,d,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,d,h):t.prototype&&t.prototype.isPureReactComponent?!ni(s,l)||!ni(c,d):!0}function fp(e,t,s,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,l),t.state!==e&&gu.enqueueReplaceState(t,t.state,null)}function As(e,t){var s=t;if("ref"in t){s={};for(var l in t)l!=="ref"&&(s[l]=t[l])}if(e=e.defaultProps){s===t&&(s=b({},s));for(var c in e)s[c]===void 0&&(s[c]=e[c])}return s}function hp(e){mr(e)}function pp(e){console.error(e)}function mp(e){mr(e)}function Ur(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function gp(e,t,s){try{var l=e.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function vu(e,t,s){return s=Ra(s),s.tag=3,s.payload={element:null},s.callback=function(){Ur(e,t)},s}function vp(e){return e=Ra(e),e.tag=3,e}function _p(e,t,s,l){var c=s.type.getDerivedStateFromError;if(typeof c=="function"){var d=l.value;e.payload=function(){return c(d)},e.callback=function(){gp(t,s,l)}}var h=s.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){gp(t,s,l),typeof c!="function"&&(za===null?za=new Set([this]):za.add(this));var _=l.stack;this.componentDidCatch(l.value,{componentStack:_!==null?_:""})})}function Fy(e,t,s,l,c){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=s.alternate,t!==null&&il(t,s,c,!0),s=Jt.current,s!==null){switch(s.tag){case 31:case 13:return mn===null?Jr():s.alternate===null&&lt===0&&(lt=3),s.flags&=-257,s.flags|=65536,s.lanes=c,l===Nr?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([l]):t.add(l),Gu(e,l,c)),!1;case 22:return s.flags|=65536,l===Nr?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([l]):s.add(l)),Gu(e,l,c)),!1}throw Error(r(435,s.tag))}return Gu(e,l,c),Jr(),!1}if(Oe)return t=Jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,l!==Dc&&(e=Error(r(422),{cause:l}),li(dn(e,s)))):(l!==Dc&&(t=Error(r(423),{cause:l}),li(dn(t,s))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,l=dn(l,s),c=vu(e.stateNode,l,c),Xc(e,c),lt!==4&&(lt=2)),!1;var d=Error(r(520),{cause:l});if(d=dn(d,s),wi===null?wi=[d]:wi.push(d),lt!==4&&(lt=2),t===null)return!0;l=dn(l,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=c&-c,s.lanes|=e,e=vu(s.stateNode,l,e),Xc(s,e),!1;case 1:if(t=s.type,d=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(za===null||!za.has(d))))return s.flags|=65536,c&=-c,s.lanes|=c,c=vp(c),_p(c,e,s,l),Xc(s,c),!1}s=s.return}while(s!==null);return!1}var _u=Error(r(461)),ht=!1;function At(e,t,s,l){t.child=e===null?Sh(t,null,s,l):ws(t,e.child,s,l)}function yp(e,t,s,l,c){s=s.render;var d=t.ref;if("ref"in l){var h={};for(var _ in l)_!=="ref"&&(h[_]=l[_])}else h=l;return bs(t),l=Pc(e,t,s,h,d,c),_=eu(),e!==null&&!ht?(tu(e,t,c),ta(e,t,c)):(Oe&&_&&zc(t),t.flags|=1,At(e,t,l,c),t.child)}function bp(e,t,s,l,c){if(e===null){var d=s.type;return typeof d=="function"&&!Oc(d)&&d.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=d,xp(e,t,d,l,c)):(e=yr(s.type,null,l,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!Au(e,c)){var h=d.memoizedProps;if(s=s.compare,s=s!==null?s:ni,s(h,l)&&e.ref===t.ref)return ta(e,t,c)}return t.flags|=1,e=Qn(d,l),e.ref=t.ref,e.return=t,t.child=e}function xp(e,t,s,l,c){if(e!==null){var d=e.memoizedProps;if(ni(d,l)&&e.ref===t.ref)if(ht=!1,t.pendingProps=l=d,Au(e,c))(e.flags&131072)!==0&&(ht=!0);else return t.lanes=e.lanes,ta(e,t,c)}return yu(e,t,s,l,c)}function Sp(e,t,s,l){var c=l.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|s:s,e!==null){for(l=t.child=e.child,c=0;l!==null;)c=c|l.lanes|l.childLanes,l=l.sibling;l=c&~d}else l=0,t.child=null;return jp(e,t,d,s,l)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&jr(t,d!==null?d.cachePool:null),d!==null?Nh(t,d):Qc(),Ah(t);else return l=t.lanes=536870912,jp(e,t,d!==null?d.baseLanes|s:s,s,l)}else d!==null?(jr(t,d.cachePool),Nh(t,d),Ca(),t.memoizedState=null):(e!==null&&jr(t,null),Qc(),Ca());return At(e,t,c,s),t.child}function vi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function jp(e,t,s,l,c){var d=Bc();return d=d===null?null:{parent:dt._currentValue,pool:d},t.memoizedState={baseLanes:s,cachePool:d},e!==null&&jr(t,null),Qc(),Ah(t),e!==null&&il(e,t,l,!0),t.childLanes=c,null}function qr(e,t){return t=Hr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function wp(e,t,s){return ws(t,e.child,null,s),e=qr(t,t.pendingProps),e.flags|=2,Ft(t),t.memoizedState=null,e}function Wy(e,t,s){var l=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Oe){if(l.mode==="hidden")return e=qr(t,l),t.lanes=536870912,vi(null,e);if(Fc(t),(e=Je)?(e=Dm(e,pn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Sa!==null?{id:Ln,overflow:Dn}:null,retryLane:536870912,hydrationErrors:null},s=rh(e),s.return=t,t.child=s,wt=t,Je=null)):e=null,e===null)throw wa(t);return t.lanes=536870912,null}return qr(t,l)}var d=e.memoizedState;if(d!==null){var h=d.dehydrated;if(Fc(t),c)if(t.flags&256)t.flags&=-257,t=wp(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(r(558));else if(ht||il(e,t,s,!1),c=(s&e.childLanes)!==0,ht||c){if(l=Ke,l!==null&&(h=ar(l,s),h!==0&&h!==d.retryLane))throw d.retryLane=h,gs(e,h),Zt(l,e,h),_u;Jr(),t=wp(e,t,s)}else e=d.treeContext,Je=gn(h.nextSibling),wt=t,Oe=!0,ja=null,pn=!1,e!==null&&uh(t,e),t=qr(t,l),t.flags|=4096;return t}return e=Qn(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function $r(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(r(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function yu(e,t,s,l,c){return bs(t),s=Pc(e,t,s,l,void 0,c),l=eu(),e!==null&&!ht?(tu(e,t,c),ta(e,t,c)):(Oe&&l&&zc(t),t.flags|=1,At(e,t,s,c),t.child)}function Np(e,t,s,l,c,d){return bs(t),t.updateQueue=null,s=Eh(t,l,s,c),Rh(e),l=eu(),e!==null&&!ht?(tu(e,t,d),ta(e,t,d)):(Oe&&l&&zc(t),t.flags|=1,At(e,t,s,d),t.child)}function Ap(e,t,s,l,c){if(bs(t),t.stateNode===null){var d=nl,h=s.contextType;typeof h=="object"&&h!==null&&(d=Nt(h)),d=new s(l,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=gu,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=l,d.state=t.memoizedState,d.refs={},Zc(t),h=s.contextType,d.context=typeof h=="object"&&h!==null?Nt(h):nl,d.state=t.memoizedState,h=s.getDerivedStateFromProps,typeof h=="function"&&(mu(t,s,h,l),d.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(h=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),h!==d.state&&gu.enqueueReplaceState(d,d.state,null),fi(t,l,d,c),di(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){d=t.stateNode;var _=t.memoizedProps,x=As(s,_);d.props=x;var M=d.context,H=s.contextType;h=nl,typeof H=="object"&&H!==null&&(h=Nt(H));var V=s.getDerivedStateFromProps;H=typeof V=="function"||typeof d.getSnapshotBeforeUpdate=="function",_=t.pendingProps!==_,H||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(_||M!==h)&&fp(t,d,l,h),Aa=!1;var D=t.memoizedState;d.state=D,fi(t,l,d,c),di(),M=t.memoizedState,_||D!==M||Aa?(typeof V=="function"&&(mu(t,s,V,l),M=t.memoizedState),(x=Aa||dp(t,s,x,l,D,M,h))?(H||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=M),d.props=l,d.state=M,d.context=h,l=x):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{d=t.stateNode,Yc(e,t),h=t.memoizedProps,H=As(s,h),d.props=H,V=t.pendingProps,D=d.context,M=s.contextType,x=nl,typeof M=="object"&&M!==null&&(x=Nt(M)),_=s.getDerivedStateFromProps,(M=typeof _=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(h!==V||D!==x)&&fp(t,d,l,x),Aa=!1,D=t.memoizedState,d.state=D,fi(t,l,d,c),di();var I=t.memoizedState;h!==V||D!==I||Aa||e!==null&&e.dependencies!==null&&xr(e.dependencies)?(typeof _=="function"&&(mu(t,s,_,l),I=t.memoizedState),(H=Aa||dp(t,s,H,l,D,I,x)||e!==null&&e.dependencies!==null&&xr(e.dependencies))?(M||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(l,I,x),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(l,I,x)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||h===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=I),d.props=l,d.state=I,d.context=x,l=H):(typeof d.componentDidUpdate!="function"||h===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),l=!1)}return d=l,$r(e,t),l=(t.flags&128)!==0,d||l?(d=t.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&l?(t.child=ws(t,e.child,null,c),t.child=ws(t,null,s,c)):At(e,t,s,c),t.memoizedState=d.state,e=t.child):e=ta(e,t,c),e}function Rp(e,t,s,l){return _s(),t.flags|=256,At(e,t,s,l),t.child}var bu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xu(e){return{baseLanes:e,cachePool:gh()}}function Su(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=Pt),e}function Ep(e,t,s){var l=t.pendingProps,c=!1,d=(t.flags&128)!==0,h;if((h=d)||(h=e!==null&&e.memoizedState===null?!1:(rt.current&2)!==0),h&&(c=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(Oe){if(c?Ta(t):Ca(),(e=Je)?(e=Dm(e,pn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Sa!==null?{id:Ln,overflow:Dn}:null,retryLane:536870912,hydrationErrors:null},s=rh(e),s.return=t,t.child=s,wt=t,Je=null)):e=null,e===null)throw wa(t);return sd(e)?t.lanes=32:t.lanes=536870912,null}var _=l.children;return l=l.fallback,c?(Ca(),c=t.mode,_=Hr({mode:"hidden",children:_},c),l=vs(l,c,s,null),_.return=t,l.return=t,_.sibling=l,t.child=_,l=t.child,l.memoizedState=xu(s),l.childLanes=Su(e,h,s),t.memoizedState=bu,vi(null,l)):(Ta(t),ju(t,_))}var x=e.memoizedState;if(x!==null&&(_=x.dehydrated,_!==null)){if(d)t.flags&256?(Ta(t),t.flags&=-257,t=wu(e,t,s)):t.memoizedState!==null?(Ca(),t.child=e.child,t.flags|=128,t=null):(Ca(),_=l.fallback,c=t.mode,l=Hr({mode:"visible",children:l.children},c),_=vs(_,c,s,null),_.flags|=2,l.return=t,_.return=t,l.sibling=_,t.child=l,ws(t,e.child,null,s),l=t.child,l.memoizedState=xu(s),l.childLanes=Su(e,h,s),t.memoizedState=bu,t=vi(null,l));else if(Ta(t),sd(_)){if(h=_.nextSibling&&_.nextSibling.dataset,h)var M=h.dgst;h=M,l=Error(r(419)),l.stack="",l.digest=h,li({value:l,source:null,stack:null}),t=wu(e,t,s)}else if(ht||il(e,t,s,!1),h=(s&e.childLanes)!==0,ht||h){if(h=Ke,h!==null&&(l=ar(h,s),l!==0&&l!==x.retryLane))throw x.retryLane=l,gs(e,l),Zt(h,e,l),_u;ad(_)||Jr(),t=wu(e,t,s)}else ad(_)?(t.flags|=192,t.child=e.child,t=null):(e=x.treeContext,Je=gn(_.nextSibling),wt=t,Oe=!0,ja=null,pn=!1,e!==null&&uh(t,e),t=ju(t,l.children),t.flags|=4096);return t}return c?(Ca(),_=l.fallback,c=t.mode,x=e.child,M=x.sibling,l=Qn(x,{mode:"hidden",children:l.children}),l.subtreeFlags=x.subtreeFlags&65011712,M!==null?_=Qn(M,_):(_=vs(_,c,s,null),_.flags|=2),_.return=t,l.return=t,l.sibling=_,t.child=l,vi(null,l),l=t.child,_=e.child.memoizedState,_===null?_=xu(s):(c=_.cachePool,c!==null?(x=dt._currentValue,c=c.parent!==x?{parent:x,pool:x}:c):c=gh(),_={baseLanes:_.baseLanes|s,cachePool:c}),l.memoizedState=_,l.childLanes=Su(e,h,s),t.memoizedState=bu,vi(e.child,l)):(Ta(t),s=e.child,e=s.sibling,s=Qn(s,{mode:"visible",children:l.children}),s.return=t,s.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=s,t.memoizedState=null,s)}function ju(e,t){return t=Hr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Hr(e,t){return e=Qt(22,e,null,t),e.lanes=0,e}function wu(e,t,s){return ws(t,e.child,null,s),e=ju(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Tp(e,t,s){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),qc(e.return,t,s)}function Nu(e,t,s,l,c,d){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:c,treeForkCount:d}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=l,h.tail=s,h.tailMode=c,h.treeForkCount=d)}function Cp(e,t,s){var l=t.pendingProps,c=l.revealOrder,d=l.tail;l=l.children;var h=rt.current,_=(h&2)!==0;if(_?(h=h&1|2,t.flags|=128):h&=1,K(rt,h),At(e,t,l,s),l=Oe?si:0,!_&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Tp(e,s,t);else if(e.tag===19)Tp(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(s=t.child,c=null;s!==null;)e=s.alternate,e!==null&&Tr(e)===null&&(c=s),s=s.sibling;s=c,s===null?(c=t.child,t.child=null):(c=s.sibling,s.sibling=null),Nu(t,!1,c,s,d,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Tr(e)===null){t.child=c;break}e=c.sibling,c.sibling=s,s=c,c=e}Nu(t,!0,s,null,d,l);break;case"together":Nu(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function ta(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Ma|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(il(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,s=Qn(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=Qn(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Au(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&xr(e)))}function Py(e,t,s){switch(t.tag){case 3:Qe(t,t.stateNode.containerInfo),Na(t,dt,e.memoizedState.cache),_s();break;case 27:case 5:bn(t);break;case 4:Qe(t,t.stateNode.containerInfo);break;case 10:Na(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Fc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Ta(t),t.flags|=128,null):(s&t.child.childLanes)!==0?Ep(e,t,s):(Ta(t),e=ta(e,t,s),e!==null?e.sibling:null);Ta(t);break;case 19:var c=(e.flags&128)!==0;if(l=(s&t.childLanes)!==0,l||(il(e,t,s,!1),l=(s&t.childLanes)!==0),c){if(l)return Cp(e,t,s);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),K(rt,rt.current),l)break;return null;case 22:return t.lanes=0,Sp(e,t,s,t.pendingProps);case 24:Na(t,dt,e.memoizedState.cache)}return ta(e,t,s)}function Op(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)ht=!0;else{if(!Au(e,s)&&(t.flags&128)===0)return ht=!1,Py(e,t,s);ht=(e.flags&131072)!==0}else ht=!1,Oe&&(t.flags&1048576)!==0&&ch(t,si,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Ss(t.elementType),t.type=e,typeof e=="function")Oc(e)?(l=As(e,l),t.tag=1,t=Ap(null,t,e,l,s)):(t.tag=0,t=yu(null,t,e,l,s));else{if(e!=null){var c=e.$$typeof;if(c===A){t.tag=11,t=yp(null,t,e,l,s);break e}else if(c===te){t.tag=14,t=bp(null,t,e,l,s);break e}}throw t=_e(e)||e,Error(r(306,t,""))}}return t;case 0:return yu(e,t,t.type,t.pendingProps,s);case 1:return l=t.type,c=As(l,t.pendingProps),Ap(e,t,l,c,s);case 3:e:{if(Qe(t,t.stateNode.containerInfo),e===null)throw Error(r(387));l=t.pendingProps;var d=t.memoizedState;c=d.element,Yc(e,t),fi(t,l,null,s);var h=t.memoizedState;if(l=h.cache,Na(t,dt,l),l!==d.cache&&$c(t,[dt],s,!0),di(),l=h.element,d.isDehydrated)if(d={element:l,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=Rp(e,t,l,s);break e}else if(l!==c){c=dn(Error(r(424)),t),li(c),t=Rp(e,t,l,s);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Je=gn(e.firstChild),wt=t,Oe=!0,ja=null,pn=!0,s=Sh(t,null,l,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(_s(),l===c){t=ta(e,t,s);break e}At(e,t,l,s)}t=t.child}return t;case 26:return $r(e,t),e===null?(s=Gm(t.type,null,t.pendingProps,null))?t.memoizedState=s:Oe||(s=t.type,e=t.pendingProps,l=ao(Q.current).createElement(s),l[vt]=t,l[jt]=e,Rt(l,s,e),yt(l),t.stateNode=l):t.memoizedState=Gm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return bn(t),e===null&&Oe&&(l=t.stateNode=qm(t.type,t.pendingProps,Q.current),wt=t,pn=!0,c=Je,Ua(t.type)?(ld=c,Je=gn(l.firstChild)):Je=c),At(e,t,t.pendingProps.children,s),$r(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Oe&&((c=l=Je)&&(l=Tb(l,t.type,t.pendingProps,pn),l!==null?(t.stateNode=l,wt=t,Je=gn(l.firstChild),pn=!1,c=!0):c=!1),c||wa(t)),bn(t),c=t.type,d=t.pendingProps,h=e!==null?e.memoizedProps:null,l=d.children,ed(c,d)?l=null:h!==null&&ed(c,h)&&(t.flags|=32),t.memoizedState!==null&&(c=Pc(e,t,Vy,null,null,s),ki._currentValue=c),$r(e,t),At(e,t,l,s),t.child;case 6:return e===null&&Oe&&((e=s=Je)&&(s=Cb(s,t.pendingProps,pn),s!==null?(t.stateNode=s,wt=t,Je=null,e=!0):e=!1),e||wa(t)),null;case 13:return Ep(e,t,s);case 4:return Qe(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=ws(t,null,l,s):At(e,t,l,s),t.child;case 11:return yp(e,t,t.type,t.pendingProps,s);case 7:return At(e,t,t.pendingProps,s),t.child;case 8:return At(e,t,t.pendingProps.children,s),t.child;case 12:return At(e,t,t.pendingProps.children,s),t.child;case 10:return l=t.pendingProps,Na(t,t.type,l.value),At(e,t,l.children,s),t.child;case 9:return c=t.type._context,l=t.pendingProps.children,bs(t),c=Nt(c),l=l(c),t.flags|=1,At(e,t,l,s),t.child;case 14:return bp(e,t,t.type,t.pendingProps,s);case 15:return xp(e,t,t.type,t.pendingProps,s);case 19:return Cp(e,t,s);case 31:return Wy(e,t,s);case 22:return Sp(e,t,s,t.pendingProps);case 24:return bs(t),l=Nt(dt),e===null?(c=Bc(),c===null&&(c=Ke,d=Hc(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=s),c=d),t.memoizedState={parent:l,cache:c},Zc(t),Na(t,dt,c)):((e.lanes&s)!==0&&(Yc(e,t),fi(t,null,null,s),di()),c=e.memoizedState,d=t.memoizedState,c.parent!==l?(c={parent:l,cache:l},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),Na(t,dt,l)):(l=d.cache,Na(t,dt,l),l!==c.cache&&$c(t,[dt],s,!0))),At(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function na(e){e.flags|=4}function Ru(e,t,s,l,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(sm())e.flags|=8192;else throw js=Nr,Vc}else e.flags&=-16777217}function kp(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Xm(t))if(sm())e.flags|=8192;else throw js=Nr,Vc}function Gr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?nr():536870912,e.lanes|=t,_l|=t)}function _i(e,t){if(!Oe)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Fe(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,l=0;if(t)for(var c=e.child;c!==null;)s|=c.lanes|c.childLanes,l|=c.subtreeFlags&65011712,l|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)s|=c.lanes|c.childLanes,l|=c.subtreeFlags,l|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=l,e.childLanes=s,t}function eb(e,t,s){var l=t.pendingProps;switch(Lc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fe(t),null;case 1:return Fe(t),null;case 3:return s=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Wn(dt),Ge(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ll(t)?na(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ic())),Fe(t),null;case 26:var c=t.type,d=t.memoizedState;return e===null?(na(t),d!==null?(Fe(t),kp(t,d)):(Fe(t),Ru(t,c,null,l,s))):d?d!==e.memoizedState?(na(t),Fe(t),kp(t,d)):(Fe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&na(t),Fe(t),Ru(t,c,e,l,s)),null;case 27:if(On(t),s=Q.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&na(t);else{if(!l){if(t.stateNode===null)throw Error(r(166));return Fe(t),null}e=J.current,ll(t)?dh(t):(e=qm(c,l,s),t.stateNode=e,na(t))}return Fe(t),null;case 5:if(On(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&na(t);else{if(!l){if(t.stateNode===null)throw Error(r(166));return Fe(t),null}if(d=J.current,ll(t))dh(t);else{var h=ao(Q.current);switch(d){case 1:d=h.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:d=h.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":d=h.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":d=h.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":d=h.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof l.is=="string"?h.createElement("select",{is:l.is}):h.createElement("select"),l.multiple?d.multiple=!0:l.size&&(d.size=l.size);break;default:d=typeof l.is=="string"?h.createElement(c,{is:l.is}):h.createElement(c)}}d[vt]=t,d[jt]=l;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)d.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=d;e:switch(Rt(d,c,l),c){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&na(t)}}return Fe(t),Ru(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&na(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(r(166));if(e=Q.current,ll(t)){if(e=t.stateNode,s=t.memoizedProps,l=null,c=wt,c!==null)switch(c.tag){case 27:case 5:l=c.memoizedProps}e[vt]=t,e=!!(e.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||Em(e.nodeValue,s)),e||wa(t,!0)}else e=ao(e).createTextNode(l),e[vt]=t,t.stateNode=e}return Fe(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(l=ll(t),s!==null){if(e===null){if(!l)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[vt]=t}else _s(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),e=!1}else s=Ic(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(Ft(t),t):(Ft(t),null);if((t.flags&128)!==0)throw Error(r(558))}return Fe(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=ll(t),l!==null&&l.dehydrated!==null){if(e===null){if(!c)throw Error(r(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));c[vt]=t}else _s(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),c=!1}else c=Ic(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Ft(t),t):(Ft(t),null)}return Ft(t),(t.flags&128)!==0?(t.lanes=s,t):(s=l!==null,e=e!==null&&e.memoizedState!==null,s&&(l=t.child,c=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(c=l.alternate.memoizedState.cachePool.pool),d=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(d=l.memoizedState.cachePool.pool),d!==c&&(l.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),Gr(t,t.updateQueue),Fe(t),null);case 4:return Ge(),e===null&&Qu(t.stateNode.containerInfo),Fe(t),null;case 10:return Wn(t.type),Fe(t),null;case 19:if(U(rt),l=t.memoizedState,l===null)return Fe(t),null;if(c=(t.flags&128)!==0,d=l.rendering,d===null)if(c)_i(l,!1);else{if(lt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=Tr(e),d!==null){for(t.flags|=128,_i(l,!1),e=d.updateQueue,t.updateQueue=e,Gr(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)ih(s,e),s=s.sibling;return K(rt,rt.current&1|2),Oe&&Jn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Be()>Xr&&(t.flags|=128,c=!0,_i(l,!1),t.lanes=4194304)}else{if(!c)if(e=Tr(d),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Gr(t,e),_i(l,!0),l.tail===null&&l.tailMode==="hidden"&&!d.alternate&&!Oe)return Fe(t),null}else 2*Be()-l.renderingStartTime>Xr&&s!==536870912&&(t.flags|=128,c=!0,_i(l,!1),t.lanes=4194304);l.isBackwards?(d.sibling=t.child,t.child=d):(e=l.last,e!==null?e.sibling=d:t.child=d,l.last=d)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Be(),e.sibling=null,s=rt.current,K(rt,c?s&1|2:s&1),Oe&&Jn(t,l.treeForkCount),e):(Fe(t),null);case 22:case 23:return Ft(t),Jc(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(s&536870912)!==0&&(t.flags&128)===0&&(Fe(t),t.subtreeFlags&6&&(t.flags|=8192)):Fe(t),s=t.updateQueue,s!==null&&Gr(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==s&&(t.flags|=2048),e!==null&&U(xs),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Wn(dt),Fe(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function tb(e,t){switch(Lc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wn(dt),Ge(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return On(t),null;case 31:if(t.memoizedState!==null){if(Ft(t),t.alternate===null)throw Error(r(340));_s()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ft(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));_s()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(rt),null;case 4:return Ge(),null;case 10:return Wn(t.type),null;case 22:case 23:return Ft(t),Jc(),e!==null&&U(xs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Wn(dt),null;case 25:return null;default:return null}}function Mp(e,t){switch(Lc(t),t.tag){case 3:Wn(dt),Ge();break;case 26:case 27:case 5:On(t);break;case 4:Ge();break;case 31:t.memoizedState!==null&&Ft(t);break;case 13:Ft(t);break;case 19:U(rt);break;case 10:Wn(t.type);break;case 22:case 23:Ft(t),Jc(),e!==null&&U(xs);break;case 24:Wn(dt)}}function yi(e,t){try{var s=t.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var c=l.next;s=c;do{if((s.tag&e)===e){l=void 0;var d=s.create,h=s.inst;l=d(),h.destroy=l}s=s.next}while(s!==c)}}catch(_){He(t,t.return,_)}}function Oa(e,t,s){try{var l=t.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var d=c.next;l=d;do{if((l.tag&e)===e){var h=l.inst,_=h.destroy;if(_!==void 0){h.destroy=void 0,c=t;var x=s,M=_;try{M()}catch(H){He(c,x,H)}}}l=l.next}while(l!==d)}}catch(H){He(t,t.return,H)}}function zp(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{wh(t,s)}catch(l){He(e,e.return,l)}}}function Lp(e,t,s){s.props=As(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(l){He(e,t,l)}}function bi(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof s=="function"?e.refCleanup=s(l):s.current=l}}catch(c){He(e,t,c)}}function In(e,t){var s=e.ref,l=e.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(c){He(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(c){He(e,t,c)}else s.current=null}function Dp(e){var t=e.type,s=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(c){He(e,e.return,c)}}function Eu(e,t,s){try{var l=e.stateNode;jb(l,e.type,s,t),l[jt]=t}catch(c){He(e,e.return,c)}}function Ip(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ua(e.type)||e.tag===4}function Tu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ip(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&&Ua(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Cu(e,t,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=Xn));else if(l!==4&&(l===27&&Ua(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(Cu(e,t,s),e=e.sibling;e!==null;)Cu(e,t,s),e=e.sibling}function Br(e,t,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(l!==4&&(l===27&&Ua(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(Br(e,t,s),e=e.sibling;e!==null;)Br(e,t,s),e=e.sibling}function Up(e){var t=e.stateNode,s=e.memoizedProps;try{for(var l=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Rt(t,l,s),t[vt]=e,t[jt]=s}catch(d){He(e,e.return,d)}}var aa=!1,pt=!1,Ou=!1,qp=typeof WeakSet=="function"?WeakSet:Set,bt=null;function nb(e,t){if(e=e.containerInfo,Wu=uo,e=Ff(e),wc(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var c=l.anchorOffset,d=l.focusNode;l=l.focusOffset;try{s.nodeType,d.nodeType}catch{s=null;break e}var h=0,_=-1,x=-1,M=0,H=0,V=e,D=null;t:for(;;){for(var I;V!==s||c!==0&&V.nodeType!==3||(_=h+c),V!==d||l!==0&&V.nodeType!==3||(x=h+l),V.nodeType===3&&(h+=V.nodeValue.length),(I=V.firstChild)!==null;)D=V,V=I;for(;;){if(V===e)break t;if(D===s&&++M===c&&(_=h),D===d&&++H===l&&(x=h),(I=V.nextSibling)!==null)break;V=D,D=V.parentNode}V=I}s=_===-1||x===-1?null:{start:_,end:x}}else s=null}s=s||{start:0,end:0}}else s=null;for(Pu={focusedElem:e,selectionRange:s},uo=!1,bt=t;bt!==null;)if(t=bt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,bt=e;else for(;bt!==null;){switch(t=bt,d=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)c=e[s],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,s=t,c=d.memoizedProps,d=d.memoizedState,l=s.stateNode;try{var le=As(s.type,c);e=l.getSnapshotBeforeUpdate(le,d),l.__reactInternalSnapshotBeforeUpdate=e}catch(pe){He(s,s.return,pe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)nd(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":nd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(r(163))}if(e=t.sibling,e!==null){e.return=t.return,bt=e;break}bt=t.return}}function $p(e,t,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:la(e,s),l&4&&yi(5,s);break;case 1:if(la(e,s),l&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(h){He(s,s.return,h)}else{var c=As(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){He(s,s.return,h)}}l&64&&zp(s),l&512&&bi(s,s.return);break;case 3:if(la(e,s),l&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{wh(e,t)}catch(h){He(s,s.return,h)}}break;case 27:t===null&&l&4&&Up(s);case 26:case 5:la(e,s),t===null&&l&4&&Dp(s),l&512&&bi(s,s.return);break;case 12:la(e,s);break;case 31:la(e,s),l&4&&Bp(e,s);break;case 13:la(e,s),l&4&&Vp(e,s),l&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=db.bind(null,s),Ob(e,s))));break;case 22:if(l=s.memoizedState!==null||aa,!l){t=t!==null&&t.memoizedState!==null||pt,c=aa;var d=pt;aa=l,(pt=t)&&!d?ia(e,s,(s.subtreeFlags&8772)!==0):la(e,s),aa=c,pt=d}break;case 30:break;default:la(e,s)}}function Hp(e){var t=e.alternate;t!==null&&(e.alternate=null,Hp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&rc(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 Pe=null,Ht=!1;function sa(e,t,s){for(s=s.child;s!==null;)Gp(e,t,s),s=s.sibling}function Gp(e,t,s){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(rs,s)}catch{}switch(s.tag){case 26:pt||In(s,t),sa(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:pt||In(s,t);var l=Pe,c=Ht;Ua(s.type)&&(Pe=s.stateNode,Ht=!1),sa(e,t,s),Ti(s.stateNode),Pe=l,Ht=c;break;case 5:pt||In(s,t);case 6:if(l=Pe,c=Ht,Pe=null,sa(e,t,s),Pe=l,Ht=c,Pe!==null)if(Ht)try{(Pe.nodeType===9?Pe.body:Pe.nodeName==="HTML"?Pe.ownerDocument.body:Pe).removeChild(s.stateNode)}catch(d){He(s,t,d)}else try{Pe.removeChild(s.stateNode)}catch(d){He(s,t,d)}break;case 18:Pe!==null&&(Ht?(e=Pe,zm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Al(e)):zm(Pe,s.stateNode));break;case 4:l=Pe,c=Ht,Pe=s.stateNode.containerInfo,Ht=!0,sa(e,t,s),Pe=l,Ht=c;break;case 0:case 11:case 14:case 15:Oa(2,s,t),pt||Oa(4,s,t),sa(e,t,s);break;case 1:pt||(In(s,t),l=s.stateNode,typeof l.componentWillUnmount=="function"&&Lp(s,t,l)),sa(e,t,s);break;case 21:sa(e,t,s);break;case 22:pt=(l=pt)||s.memoizedState!==null,sa(e,t,s),pt=l;break;default:sa(e,t,s)}}function Bp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Al(e)}catch(s){He(t,t.return,s)}}}function Vp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Al(e)}catch(s){He(t,t.return,s)}}function ab(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new qp),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new qp),t;default:throw Error(r(435,e.tag))}}function Vr(e,t){var s=ab(e);t.forEach(function(l){if(!s.has(l)){s.add(l);var c=fb.bind(null,e,l);l.then(c,c)}})}function Gt(e,t){var s=t.deletions;if(s!==null)for(var l=0;l<s.length;l++){var c=s[l],d=e,h=t,_=h;e:for(;_!==null;){switch(_.tag){case 27:if(Ua(_.type)){Pe=_.stateNode,Ht=!1;break e}break;case 5:Pe=_.stateNode,Ht=!1;break e;case 3:case 4:Pe=_.stateNode.containerInfo,Ht=!0;break e}_=_.return}if(Pe===null)throw Error(r(160));Gp(d,h,c),Pe=null,Ht=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Zp(t,e),t=t.sibling}var An=null;function Zp(e,t){var s=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Gt(t,e),Bt(e),l&4&&(Oa(3,e,e.return),yi(3,e),Oa(5,e,e.return));break;case 1:Gt(t,e),Bt(e),l&512&&(pt||s===null||In(s,s.return)),l&64&&aa&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?l:s.concat(l))));break;case 26:var c=An;if(Gt(t,e),Bt(e),l&512&&(pt||s===null||In(s,s.return)),l&4){var d=s!==null?s.memoizedState:null;if(l=e.memoizedState,s===null)if(l===null)if(e.stateNode===null){e:{l=e.type,s=e.memoizedProps,c=c.ownerDocument||c;t:switch(l){case"title":d=c.getElementsByTagName("title")[0],(!d||d[Xl]||d[vt]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(l),c.head.insertBefore(d,c.querySelector("head > title"))),Rt(d,l,s),d[vt]=e,yt(d),l=d;break e;case"link":var h=Zm("link","href",c).get(l+(s.href||""));if(h){for(var _=0;_<h.length;_++)if(d=h[_],d.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&d.getAttribute("rel")===(s.rel==null?null:s.rel)&&d.getAttribute("title")===(s.title==null?null:s.title)&&d.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){h.splice(_,1);break t}}d=c.createElement(l),Rt(d,l,s),c.head.appendChild(d);break;case"meta":if(h=Zm("meta","content",c).get(l+(s.content||""))){for(_=0;_<h.length;_++)if(d=h[_],d.getAttribute("content")===(s.content==null?null:""+s.content)&&d.getAttribute("name")===(s.name==null?null:s.name)&&d.getAttribute("property")===(s.property==null?null:s.property)&&d.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&d.getAttribute("charset")===(s.charSet==null?null:s.charSet)){h.splice(_,1);break t}}d=c.createElement(l),Rt(d,l,s),c.head.appendChild(d);break;default:throw Error(r(468,l))}d[vt]=e,yt(d),l=d}e.stateNode=l}else Ym(c,e.type,e.stateNode);else e.stateNode=Vm(c,l,e.memoizedProps);else d!==l?(d===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):d.count--,l===null?Ym(c,e.type,e.stateNode):Vm(c,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Eu(e,e.memoizedProps,s.memoizedProps)}break;case 27:Gt(t,e),Bt(e),l&512&&(pt||s===null||In(s,s.return)),s!==null&&l&4&&Eu(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Gt(t,e),Bt(e),l&512&&(pt||s===null||In(s,s.return)),e.flags&32){c=e.stateNode;try{Qs(c,"")}catch(le){He(e,e.return,le)}}l&4&&e.stateNode!=null&&(c=e.memoizedProps,Eu(e,c,s!==null?s.memoizedProps:c)),l&1024&&(Ou=!0);break;case 6:if(Gt(t,e),Bt(e),l&4){if(e.stateNode===null)throw Error(r(162));l=e.memoizedProps,s=e.stateNode;try{s.nodeValue=l}catch(le){He(e,e.return,le)}}break;case 3:if(io=null,c=An,An=so(t.containerInfo),Gt(t,e),An=c,Bt(e),l&4&&s!==null&&s.memoizedState.isDehydrated)try{Al(t.containerInfo)}catch(le){He(e,e.return,le)}Ou&&(Ou=!1,Yp(e));break;case 4:l=An,An=so(e.stateNode.containerInfo),Gt(t,e),Bt(e),An=l;break;case 12:Gt(t,e),Bt(e);break;case 31:Gt(t,e),Bt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Vr(e,l)));break;case 13:Gt(t,e),Bt(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Yr=Be()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Vr(e,l)));break;case 22:c=e.memoizedState!==null;var x=s!==null&&s.memoizedState!==null,M=aa,H=pt;if(aa=M||c,pt=H||x,Gt(t,e),pt=H,aa=M,Bt(e),l&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(s===null||x||aa||pt||Rs(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){x=s=t;try{if(d=x.stateNode,c)h=d.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{_=x.stateNode;var V=x.memoizedProps.style,D=V!=null&&V.hasOwnProperty("display")?V.display:null;_.style.display=D==null||typeof D=="boolean"?"":(""+D).trim()}}catch(le){He(x,x.return,le)}}}else if(t.tag===6){if(s===null){x=t;try{x.stateNode.nodeValue=c?"":x.memoizedProps}catch(le){He(x,x.return,le)}}}else if(t.tag===18){if(s===null){x=t;try{var I=x.stateNode;c?Lm(I,!0):Lm(x.stateNode,!1)}catch(le){He(x,x.return,le)}}}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 e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(s=l.retryQueue,s!==null&&(l.retryQueue=null,Vr(e,s))));break;case 19:Gt(t,e),Bt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Vr(e,l)));break;case 30:break;case 21:break;default:Gt(t,e),Bt(e)}}function Bt(e){var t=e.flags;if(t&2){try{for(var s,l=e.return;l!==null;){if(Ip(l)){s=l;break}l=l.return}if(s==null)throw Error(r(160));switch(s.tag){case 27:var c=s.stateNode,d=Tu(e);Br(e,d,c);break;case 5:var h=s.stateNode;s.flags&32&&(Qs(h,""),s.flags&=-33);var _=Tu(e);Br(e,_,h);break;case 3:case 4:var x=s.stateNode.containerInfo,M=Tu(e);Cu(e,M,x);break;default:throw Error(r(161))}}catch(H){He(e,e.return,H)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Yp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Yp(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function la(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)$p(e,t.alternate,t),t=t.sibling}function Rs(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Oa(4,t,t.return),Rs(t);break;case 1:In(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&Lp(t,t.return,s),Rs(t);break;case 27:Ti(t.stateNode);case 26:case 5:In(t,t.return),Rs(t);break;case 22:t.memoizedState===null&&Rs(t);break;case 30:Rs(t);break;default:Rs(t)}e=e.sibling}}function ia(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,c=e,d=t,h=d.flags;switch(d.tag){case 0:case 11:case 15:ia(c,d,s),yi(4,d);break;case 1:if(ia(c,d,s),l=d,c=l.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(M){He(l,l.return,M)}if(l=d,c=l.updateQueue,c!==null){var _=l.stateNode;try{var x=c.shared.hiddenCallbacks;if(x!==null)for(c.shared.hiddenCallbacks=null,c=0;c<x.length;c++)jh(x[c],_)}catch(M){He(l,l.return,M)}}s&&h&64&&zp(d),bi(d,d.return);break;case 27:Up(d);case 26:case 5:ia(c,d,s),s&&l===null&&h&4&&Dp(d),bi(d,d.return);break;case 12:ia(c,d,s);break;case 31:ia(c,d,s),s&&h&4&&Bp(c,d);break;case 13:ia(c,d,s),s&&h&4&&Vp(c,d);break;case 22:d.memoizedState===null&&ia(c,d,s),bi(d,d.return);break;case 30:break;default:ia(c,d,s)}t=t.sibling}}function ku(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&ii(s))}function Mu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ii(e))}function Rn(e,t,s,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Xp(e,t,s,l),t=t.sibling}function Xp(e,t,s,l){var c=t.flags;switch(t.tag){case 0:case 11:case 15:Rn(e,t,s,l),c&2048&&yi(9,t);break;case 1:Rn(e,t,s,l);break;case 3:Rn(e,t,s,l),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ii(e)));break;case 12:if(c&2048){Rn(e,t,s,l),e=t.stateNode;try{var d=t.memoizedProps,h=d.id,_=d.onPostCommit;typeof _=="function"&&_(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(x){He(t,t.return,x)}}else Rn(e,t,s,l);break;case 31:Rn(e,t,s,l);break;case 13:Rn(e,t,s,l);break;case 23:break;case 22:d=t.stateNode,h=t.alternate,t.memoizedState!==null?d._visibility&2?Rn(e,t,s,l):xi(e,t):d._visibility&2?Rn(e,t,s,l):(d._visibility|=2,ml(e,t,s,l,(t.subtreeFlags&10256)!==0||!1)),c&2048&&ku(h,t);break;case 24:Rn(e,t,s,l),c&2048&&Mu(t.alternate,t);break;default:Rn(e,t,s,l)}}function ml(e,t,s,l,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,h=t,_=s,x=l,M=h.flags;switch(h.tag){case 0:case 11:case 15:ml(d,h,_,x,c),yi(8,h);break;case 23:break;case 22:var H=h.stateNode;h.memoizedState!==null?H._visibility&2?ml(d,h,_,x,c):xi(d,h):(H._visibility|=2,ml(d,h,_,x,c)),c&&M&2048&&ku(h.alternate,h);break;case 24:ml(d,h,_,x,c),c&&M&2048&&Mu(h.alternate,h);break;default:ml(d,h,_,x,c)}t=t.sibling}}function xi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,l=t,c=l.flags;switch(l.tag){case 22:xi(s,l),c&2048&&ku(l.alternate,l);break;case 24:xi(s,l),c&2048&&Mu(l.alternate,l);break;default:xi(s,l)}t=t.sibling}}var Si=8192;function gl(e,t,s){if(e.subtreeFlags&Si)for(e=e.child;e!==null;)Kp(e,t,s),e=e.sibling}function Kp(e,t,s){switch(e.tag){case 26:gl(e,t,s),e.flags&Si&&e.memoizedState!==null&&Bb(s,An,e.memoizedState,e.memoizedProps);break;case 5:gl(e,t,s);break;case 3:case 4:var l=An;An=so(e.stateNode.containerInfo),gl(e,t,s),An=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Si,Si=16777216,gl(e,t,s),Si=l):gl(e,t,s));break;default:gl(e,t,s)}}function Qp(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 ji(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];bt=l,Fp(l,e)}Qp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Jp(e),e=e.sibling}function Jp(e){switch(e.tag){case 0:case 11:case 15:ji(e),e.flags&2048&&Oa(9,e,e.return);break;case 3:ji(e);break;case 12:ji(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Zr(e)):ji(e);break;default:ji(e)}}function Zr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];bt=l,Fp(l,e)}Qp(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Oa(8,t,t.return),Zr(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,Zr(t));break;default:Zr(t)}e=e.sibling}}function Fp(e,t){for(;bt!==null;){var s=bt;switch(s.tag){case 0:case 11:case 15:Oa(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:ii(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,bt=l;else e:for(s=e;bt!==null;){l=bt;var c=l.sibling,d=l.return;if(Hp(l),l===s){bt=null;break e}if(c!==null){c.return=d,bt=c;break e}bt=d}}}var sb={getCacheForType:function(e){var t=Nt(dt),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Nt(dt).controller.signal}},lb=typeof WeakMap=="function"?WeakMap:Map,Ue=0,Ke=null,Re=null,Te=0,$e=0,Wt=null,ka=!1,vl=!1,zu=!1,ra=0,lt=0,Ma=0,Es=0,Lu=0,Pt=0,_l=0,wi=null,Vt=null,Du=!1,Yr=0,Wp=0,Xr=1/0,Kr=null,za=null,_t=0,La=null,yl=null,oa=0,Iu=0,Uu=null,Pp=null,Ni=0,qu=null;function en(){return(Ue&2)!==0&&Te!==0?Te&-Te:z.T!==null?Zu():Zl()}function em(){if(Pt===0)if((Te&536870912)===0||Oe){var e=jn;jn<<=1,(jn&3932160)===0&&(jn=262144),Pt=e}else Pt=536870912;return e=Jt.current,e!==null&&(e.flags|=32),Pt}function Zt(e,t,s){(e===Ke&&($e===2||$e===9)||e.cancelPendingCommit!==null)&&(bl(e,0),Da(e,Te,Pt,!1)),ds(e,s),((Ue&2)===0||e!==Ke)&&(e===Ke&&((Ue&2)===0&&(Es|=s),lt===4&&Da(e,Te,Pt,!1)),Un(e))}function tm(e,t,s){if((Ue&6)!==0)throw Error(r(327));var l=!s&&(t&127)===0&&(t&e.expiredLanes)===0||us(e,t),c=l?ob(e,t):Hu(e,t,!0),d=l;do{if(c===0){vl&&!l&&Da(e,t,0,!1);break}else{if(s=e.current.alternate,d&&!ib(s)){c=Hu(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var _=e;c=wi;var x=_.current.memoizedState.isDehydrated;if(x&&(bl(_,h).flags|=256),h=Hu(_,h,!1),h!==2){if(zu&&!x){_.errorRecoveryDisabledLanes|=d,Es|=d,c=4;break e}d=Vt,Vt=c,d!==null&&(Vt===null?Vt=d:Vt.push.apply(Vt,d))}c=h}if(d=!1,c!==2)continue}}if(c===1){bl(e,0),Da(e,t,0,!0);break}e:{switch(l=e,d=c,d){case 0:case 1:throw Error(r(345));case 4:if((t&4194048)!==t)break;case 6:Da(l,t,Pt,!ka);break e;case 2:Vt=null;break;case 3:case 5:break;default:throw Error(r(329))}if((t&62914560)===t&&(c=Yr+300-Be(),10<c)){if(Da(l,t,Pt,!ka),cs(l,0,!0)!==0)break e;oa=t,l.timeoutHandle=km(nm.bind(null,l,s,Vt,Kr,Du,t,Pt,Es,_l,ka,d,"Throttled",-0,0),c);break e}nm(l,s,Vt,Kr,Du,t,Pt,Es,_l,ka,d,null,-0,0)}}break}while(!0);Un(e)}function nm(e,t,s,l,c,d,h,_,x,M,H,V,D,I){if(e.timeoutHandle=-1,V=t.subtreeFlags,V&8192||(V&16785408)===16785408){V={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xn},Kp(t,d,V);var le=(d&62914560)===d?Yr-Be():(d&4194048)===d?Wp-Be():0;if(le=Vb(V,le),le!==null){oa=d,e.cancelPendingCommit=le(um.bind(null,e,t,d,s,l,c,h,_,x,H,V,null,D,I)),Da(e,d,h,!M);return}}um(e,t,d,s,l,c,h,_,x)}function ib(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var c=s[l],d=c.getSnapshot;c=c.value;try{if(!Kt(d(),c))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;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 Da(e,t,s,l){t&=~Lu,t&=~Es,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var c=t;0<c;){var d=31-We(c),h=1<<d;l[d]=-1,c&=~h}s!==0&&Gl(e,s,t)}function Qr(){return(Ue&6)===0?(Ai(0),!1):!0}function $u(){if(Re!==null){if($e===0)var e=Re.return;else e=Re,Fn=ys=null,nu(e),ul=null,oi=0,e=Re;for(;e!==null;)Mp(e.alternate,e),e=e.return;Re=null}}function bl(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,Ab(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),oa=0,$u(),Ke=e,Re=s=Qn(e.current,null),Te=t,$e=0,Wt=null,ka=!1,vl=us(e,t),zu=!1,_l=Pt=Lu=Es=Ma=lt=0,Vt=wi=null,Du=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var c=31-We(l),d=1<<c;t|=e[c],l&=~d}return ra=t,gr(),s}function am(e,t){we=null,z.H=gi,t===cl||t===wr?(t=yh(),$e=3):t===Vc?(t=yh(),$e=4):$e=t===_u?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Wt=t,Re===null&&(lt=1,Ur(e,dn(t,e.current)))}function sm(){var e=Jt.current;return e===null?!0:(Te&4194048)===Te?mn===null:(Te&62914560)===Te||(Te&536870912)!==0?e===mn:!1}function lm(){var e=z.H;return z.H=gi,e===null?gi:e}function im(){var e=z.A;return z.A=sb,e}function Jr(){lt=4,ka||(Te&4194048)!==Te&&Jt.current!==null||(vl=!0),(Ma&134217727)===0&&(Es&134217727)===0||Ke===null||Da(Ke,Te,Pt,!1)}function Hu(e,t,s){var l=Ue;Ue|=2;var c=lm(),d=im();(Ke!==e||Te!==t)&&(Kr=null,bl(e,t)),t=!1;var h=lt;e:do try{if($e!==0&&Re!==null){var _=Re,x=Wt;switch($e){case 8:$u(),h=6;break e;case 3:case 2:case 9:case 6:Jt.current===null&&(t=!0);var M=$e;if($e=0,Wt=null,xl(e,_,x,M),s&&vl){h=0;break e}break;default:M=$e,$e=0,Wt=null,xl(e,_,x,M)}}rb(),h=lt;break}catch(H){am(e,H)}while(!0);return t&&e.shellSuspendCounter++,Fn=ys=null,Ue=l,z.H=c,z.A=d,Re===null&&(Ke=null,Te=0,gr()),h}function rb(){for(;Re!==null;)rm(Re)}function ob(e,t){var s=Ue;Ue|=2;var l=lm(),c=im();Ke!==e||Te!==t?(Kr=null,Xr=Be()+500,bl(e,t)):vl=us(e,t);e:do try{if($e!==0&&Re!==null){t=Re;var d=Wt;t:switch($e){case 1:$e=0,Wt=null,xl(e,t,d,1);break;case 2:case 9:if(vh(d)){$e=0,Wt=null,om(t);break}t=function(){$e!==2&&$e!==9||Ke!==e||($e=7),Un(e)},d.then(t,t);break e;case 3:$e=7;break e;case 4:$e=5;break e;case 7:vh(d)?($e=0,Wt=null,om(t)):($e=0,Wt=null,xl(e,t,d,7));break;case 5:var h=null;switch(Re.tag){case 26:h=Re.memoizedState;case 5:case 27:var _=Re;if(h?Xm(h):_.stateNode.complete){$e=0,Wt=null;var x=_.sibling;if(x!==null)Re=x;else{var M=_.return;M!==null?(Re=M,Fr(M)):Re=null}break t}}$e=0,Wt=null,xl(e,t,d,5);break;case 6:$e=0,Wt=null,xl(e,t,d,6);break;case 8:$u(),lt=6;break e;default:throw Error(r(462))}}cb();break}catch(H){am(e,H)}while(!0);return Fn=ys=null,z.H=l,z.A=c,Ue=s,Re!==null?0:(Ke=null,Te=0,gr(),lt)}function cb(){for(;Re!==null&&!Ie();)rm(Re)}function rm(e){var t=Op(e.alternate,e,ra);e.memoizedProps=e.pendingProps,t===null?Fr(e):Re=t}function om(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=Np(s,t,t.pendingProps,t.type,void 0,Te);break;case 11:t=Np(s,t,t.pendingProps,t.type.render,t.ref,Te);break;case 5:nu(t);default:Mp(s,t),t=Re=ih(t,ra),t=Op(s,t,ra)}e.memoizedProps=e.pendingProps,t===null?Fr(e):Re=t}function xl(e,t,s,l){Fn=ys=null,nu(t),ul=null,oi=0;var c=t.return;try{if(Fy(e,c,t,s,Te)){lt=1,Ur(e,dn(s,e.current)),Re=null;return}}catch(d){if(c!==null)throw Re=c,d;lt=1,Ur(e,dn(s,e.current)),Re=null;return}t.flags&32768?(Oe||l===1?e=!0:vl||(Te&536870912)!==0?e=!1:(ka=e=!0,(l===2||l===9||l===3||l===6)&&(l=Jt.current,l!==null&&l.tag===13&&(l.flags|=16384))),cm(t,e)):Fr(t)}function Fr(e){var t=e;do{if((t.flags&32768)!==0){cm(t,ka);return}e=t.return;var s=eb(t.alternate,t,ra);if(s!==null){Re=s;return}if(t=t.sibling,t!==null){Re=t;return}Re=t=e}while(t!==null);lt===0&&(lt=5)}function cm(e,t){do{var s=tb(e.alternate,e);if(s!==null){s.flags&=32767,Re=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Re=e;return}Re=e=s}while(e!==null);lt=6,Re=null}function um(e,t,s,l,c,d,h,_,x){e.cancelPendingCommit=null;do Wr();while(_t!==0);if((Ue&6)!==0)throw Error(r(327));if(t!==null){if(t===e.current)throw Error(r(177));if(d=t.lanes|t.childLanes,d|=Tc,ic(e,s,d,h,_,x),e===Ke&&(Re=Ke=null,Te=0),yl=t,La=e,oa=s,Iu=d,Uu=c,Pp=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,hb(xn,function(){return mm(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=z.T,z.T=null,c=X.p,X.p=2,h=Ue,Ue|=4;try{nb(e,t,s)}finally{Ue=h,X.p=c,z.T=l}}_t=1,dm(),fm(),hm()}}function dm(){if(_t===1){_t=0;var e=La,t=yl,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=z.T,z.T=null;var l=X.p;X.p=2;var c=Ue;Ue|=4;try{Zp(t,e);var d=Pu,h=Ff(e.containerInfo),_=d.focusedElem,x=d.selectionRange;if(h!==_&&_&&_.ownerDocument&&Jf(_.ownerDocument.documentElement,_)){if(x!==null&&wc(_)){var M=x.start,H=x.end;if(H===void 0&&(H=M),"selectionStart"in _)_.selectionStart=M,_.selectionEnd=Math.min(H,_.value.length);else{var V=_.ownerDocument||document,D=V&&V.defaultView||window;if(D.getSelection){var I=D.getSelection(),le=_.textContent.length,pe=Math.min(x.start,le),Ye=x.end===void 0?pe:Math.min(x.end,le);!I.extend&&pe>Ye&&(h=Ye,Ye=pe,pe=h);var E=Qf(_,pe),w=Qf(_,Ye);if(E&&w&&(I.rangeCount!==1||I.anchorNode!==E.node||I.anchorOffset!==E.offset||I.focusNode!==w.node||I.focusOffset!==w.offset)){var k=V.createRange();k.setStart(E.node,E.offset),I.removeAllRanges(),pe>Ye?(I.addRange(k),I.extend(w.node,w.offset)):(k.setEnd(w.node,w.offset),I.addRange(k))}}}}for(V=[],I=_;I=I.parentNode;)I.nodeType===1&&V.push({element:I,left:I.scrollLeft,top:I.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<V.length;_++){var B=V[_];B.element.scrollLeft=B.left,B.element.scrollTop=B.top}}uo=!!Wu,Pu=Wu=null}finally{Ue=c,X.p=l,z.T=s}}e.current=t,_t=2}}function fm(){if(_t===2){_t=0;var e=La,t=yl,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=z.T,z.T=null;var l=X.p;X.p=2;var c=Ue;Ue|=4;try{$p(e,t.alternate,t)}finally{Ue=c,X.p=l,z.T=s}}_t=3}}function hm(){if(_t===4||_t===3){_t=0,ct();var e=La,t=yl,s=oa,l=Pp;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?_t=5:(_t=0,yl=La=null,pm(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(za=null),Bs(s),t=t.stateNode,Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot(rs,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=z.T,c=X.p,X.p=2,z.T=null;try{for(var d=e.onRecoverableError,h=0;h<l.length;h++){var _=l[h];d(_.value,{componentStack:_.stack})}}finally{z.T=t,X.p=c}}(oa&3)!==0&&Wr(),Un(e),c=e.pendingLanes,(s&261930)!==0&&(c&42)!==0?e===qu?Ni++:(Ni=0,qu=e):Ni=0,Ai(0)}}function pm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ii(t)))}function Wr(){return dm(),fm(),hm(),mm()}function mm(){if(_t!==5)return!1;var e=La,t=Iu;Iu=0;var s=Bs(oa),l=z.T,c=X.p;try{X.p=32>s?32:s,z.T=null,s=Uu,Uu=null;var d=La,h=oa;if(_t=0,yl=La=null,oa=0,(Ue&6)!==0)throw Error(r(331));var _=Ue;if(Ue|=4,Jp(d.current),Xp(d,d.current,h,s),Ue=_,Ai(0,!1),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(rs,d)}catch{}return!0}finally{X.p=c,z.T=l,pm(e,t)}}function gm(e,t,s){t=dn(s,t),t=vu(e.stateNode,t,2),e=Ea(e,t,2),e!==null&&(ds(e,2),Un(e))}function He(e,t,s){if(e.tag===3)gm(e,e,s);else for(;t!==null;){if(t.tag===3){gm(t,e,s);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(za===null||!za.has(l))){e=dn(s,e),s=vp(2),l=Ea(t,s,2),l!==null&&(_p(s,l,t,e),ds(l,2),Un(l));break}}t=t.return}}function Gu(e,t,s){var l=e.pingCache;if(l===null){l=e.pingCache=new lb;var c=new Set;l.set(t,c)}else c=l.get(t),c===void 0&&(c=new Set,l.set(t,c));c.has(s)||(zu=!0,c.add(s),e=ub.bind(null,e,t,s),t.then(e,e))}function ub(e,t,s){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Ke===e&&(Te&s)===s&&(lt===4||lt===3&&(Te&62914560)===Te&&300>Be()-Yr?(Ue&2)===0&&bl(e,0):Lu|=s,_l===Te&&(_l=0)),Un(e)}function vm(e,t){t===0&&(t=nr()),e=gs(e,t),e!==null&&(ds(e,t),Un(e))}function db(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),vm(e,s)}function fb(e,t){var s=0;switch(e.tag){case 31:case 13:var l=e.stateNode,c=e.memoizedState;c!==null&&(s=c.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(t),vm(e,s)}function hb(e,t){return ls(e,t)}var Pr=null,Sl=null,Bu=!1,eo=!1,Vu=!1,Ia=0;function Un(e){e!==Sl&&e.next===null&&(Sl===null?Pr=Sl=e:Sl=Sl.next=e),eo=!0,Bu||(Bu=!0,mb())}function Ai(e,t){if(!Vu&&eo){Vu=!0;do for(var s=!1,l=Pr;l!==null;){if(e!==0){var c=l.pendingLanes;if(c===0)var d=0;else{var h=l.suspendedLanes,_=l.pingedLanes;d=(1<<31-We(42|e)+1)-1,d&=c&~(h&~_),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(s=!0,xm(l,d))}else d=Te,d=cs(l,l===Ke?d:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(d&3)===0||us(l,d)||(s=!0,xm(l,d));l=l.next}while(s);Vu=!1}}function pb(){_m()}function _m(){eo=Bu=!1;var e=0;Ia!==0&&Nb()&&(e=Ia);for(var t=Be(),s=null,l=Pr;l!==null;){var c=l.next,d=ym(l,t);d===0?(l.next=null,s===null?Pr=c:s.next=c,c===null&&(Sl=s)):(s=l,(e!==0||(d&3)!==0)&&(eo=!0)),l=c}_t!==0&&_t!==5||Ai(e),Ia!==0&&(Ia=0)}function ym(e,t){for(var s=e.suspendedLanes,l=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var h=31-We(d),_=1<<h,x=c[h];x===-1?((_&s)===0||(_&l)!==0)&&(c[h]=Gs(_,t)):x<=t&&(e.expiredLanes|=_),d&=~_}if(t=Ke,s=Te,s=cs(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,s===0||e===t&&($e===2||$e===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&ke(l),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||us(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(l!==null&&ke(l),Bs(s)){case 2:case 8:s=ql;break;case 32:s=xn;break;case 268435456:s=$l;break;default:s=xn}return l=bm.bind(null,e),s=ls(s,l),e.callbackPriority=t,e.callbackNode=s,t}return l!==null&&l!==null&&ke(l),e.callbackPriority=2,e.callbackNode=null,2}function bm(e,t){if(_t!==0&&_t!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(Wr()&&e.callbackNode!==s)return null;var l=Te;return l=cs(e,e===Ke?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(tm(e,l,t),ym(e,Be()),e.callbackNode!=null&&e.callbackNode===s?bm.bind(null,e):null)}function xm(e,t){if(Wr())return null;tm(e,t,!0)}function mb(){Rb(function(){(Ue&6)!==0?ls(is,pb):_m()})}function Zu(){if(Ia===0){var e=rl;e===0&&(e=Mn,Mn<<=1,(Mn&261888)===0&&(Mn=256)),Ia=e}return Ia}function Sm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:or(""+e)}function jm(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function gb(e,t,s,l,c){if(t==="submit"&&s&&s.stateNode===c){var d=Sm((c[jt]||null).action),h=l.submitter;h&&(t=(t=h[jt]||null)?Sm(t.formAction):h.getAttribute("formAction"),t!==null&&(d=t,h=null));var _=new fr("action","action",null,l,c);e.push({event:_,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ia!==0){var x=h?jm(c,h):new FormData(c);du(s,{pending:!0,data:x,method:c.method,action:d},null,x)}}else typeof d=="function"&&(_.preventDefault(),x=h?jm(c,h):new FormData(c),du(s,{pending:!0,data:x,method:c.method,action:d},d,x))},currentTarget:c}]})}}for(var Yu=0;Yu<Ec.length;Yu++){var Xu=Ec[Yu],vb=Xu.toLowerCase(),_b=Xu[0].toUpperCase()+Xu.slice(1);Nn(vb,"on"+_b)}Nn(eh,"onAnimationEnd"),Nn(th,"onAnimationIteration"),Nn(nh,"onAnimationStart"),Nn("dblclick","onDoubleClick"),Nn("focusin","onFocus"),Nn("focusout","onBlur"),Nn(zy,"onTransitionRun"),Nn(Ly,"onTransitionStart"),Nn(Dy,"onTransitionCancel"),Nn(ah,"onTransitionEnd"),Xs("onMouseEnter",["mouseout","mouseover"]),Xs("onMouseLeave",["mouseout","mouseover"]),Xs("onPointerEnter",["pointerout","pointerover"]),Xs("onPointerLeave",["pointerout","pointerover"]),fs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fs("onBeforeInput",["compositionend","keypress","textInput","paste"]),fs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ri="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(" "),yb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ri));function wm(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var l=e[s],c=l.event;l=l.listeners;e:{var d=void 0;if(t)for(var h=l.length-1;0<=h;h--){var _=l[h],x=_.instance,M=_.currentTarget;if(_=_.listener,x!==d&&c.isPropagationStopped())break e;d=_,c.currentTarget=M;try{d(c)}catch(H){mr(H)}c.currentTarget=null,d=x}else for(h=0;h<l.length;h++){if(_=l[h],x=_.instance,M=_.currentTarget,_=_.listener,x!==d&&c.isPropagationStopped())break e;d=_,c.currentTarget=M;try{d(c)}catch(H){mr(H)}c.currentTarget=null,d=x}}}}function Ee(e,t){var s=t[se];s===void 0&&(s=t[se]=new Set);var l=e+"__bubble";s.has(l)||(Nm(t,e,2,!1),s.add(l))}function Ku(e,t,s){var l=0;t&&(l|=4),Nm(s,e,l,t)}var to="_reactListening"+Math.random().toString(36).slice(2);function Qu(e){if(!e[to]){e[to]=!0,_f.forEach(function(s){s!=="selectionchange"&&(yb.has(s)||Ku(s,!1,e),Ku(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[to]||(t[to]=!0,Ku("selectionchange",!1,t))}}function Nm(e,t,s,l){switch(eg(t)){case 2:var c=Xb;break;case 8:c=Kb;break;default:c=ud}s=c.bind(null,t,s,e),c=void 0,!mc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),l?c!==void 0?e.addEventListener(t,s,{capture:!0,passive:c}):e.addEventListener(t,s,!0):c!==void 0?e.addEventListener(t,s,{passive:c}):e.addEventListener(t,s,!1)}function Ju(e,t,s,l,c){var d=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var h=l.tag;if(h===3||h===4){var _=l.stateNode.containerInfo;if(_===c)break;if(h===4)for(h=l.return;h!==null;){var x=h.tag;if((x===3||x===4)&&h.stateNode.containerInfo===c)return;h=h.return}for(;_!==null;){if(h=Vs(_),h===null)return;if(x=h.tag,x===5||x===6||x===26||x===27){l=d=h;continue e}_=_.parentNode}}l=l.return}Cf(function(){var M=d,H=hc(s),V=[];e:{var D=sh.get(e);if(D!==void 0){var I=fr,le=e;switch(e){case"keypress":if(ur(s)===0)break e;case"keydown":case"keyup":I=fy;break;case"focusin":le="focus",I=yc;break;case"focusout":le="blur",I=yc;break;case"beforeblur":case"afterblur":I=yc;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":I=Mf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":I=ey;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":I=my;break;case eh:case th:case nh:I=ay;break;case ah:I=vy;break;case"scroll":case"scrollend":I=W_;break;case"wheel":I=yy;break;case"copy":case"cut":case"paste":I=ly;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":I=Lf;break;case"toggle":case"beforetoggle":I=xy}var pe=(t&4)!==0,Ye=!pe&&(e==="scroll"||e==="scrollend"),E=pe?D!==null?D+"Capture":null:D;pe=[];for(var w=M,k;w!==null;){var B=w;if(k=B.stateNode,B=B.tag,B!==5&&B!==26&&B!==27||k===null||E===null||(B=Ql(w,E),B!=null&&pe.push(Ei(w,B,k))),Ye)break;w=w.return}0<pe.length&&(D=new I(D,le,null,s,H),V.push({event:D,listeners:pe}))}}if((t&7)===0){e:{if(D=e==="mouseover"||e==="pointerover",I=e==="mouseout"||e==="pointerout",D&&s!==fc&&(le=s.relatedTarget||s.fromElement)&&(Vs(le)||le[ba]))break e;if((I||D)&&(D=H.window===H?H:(D=H.ownerDocument)?D.defaultView||D.parentWindow:window,I?(le=s.relatedTarget||s.toElement,I=M,le=le?Vs(le):null,le!==null&&(Ye=f(le),pe=le.tag,le!==Ye||pe!==5&&pe!==27&&pe!==6)&&(le=null)):(I=null,le=M),I!==le)){if(pe=Mf,B="onMouseLeave",E="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(pe=Lf,B="onPointerLeave",E="onPointerEnter",w="pointer"),Ye=I==null?D:Kl(I),k=le==null?D:Kl(le),D=new pe(B,w+"leave",I,s,H),D.target=Ye,D.relatedTarget=k,B=null,Vs(H)===M&&(pe=new pe(E,w+"enter",le,s,H),pe.target=k,pe.relatedTarget=Ye,B=pe),Ye=B,I&&le)t:{for(pe=bb,E=I,w=le,k=0,B=E;B;B=pe(B))k++;B=0;for(var de=w;de;de=pe(de))B++;for(;0<k-B;)E=pe(E),k--;for(;0<B-k;)w=pe(w),B--;for(;k--;){if(E===w||w!==null&&E===w.alternate){pe=E;break t}E=pe(E),w=pe(w)}pe=null}else pe=null;I!==null&&Am(V,D,I,pe,!1),le!==null&&Ye!==null&&Am(V,Ye,le,pe,!0)}}e:{if(D=M?Kl(M):window,I=D.nodeName&&D.nodeName.toLowerCase(),I==="select"||I==="input"&&D.type==="file")var Le=Bf;else if(Hf(D))if(Vf)Le=Oy;else{Le=Ty;var oe=Ey}else I=D.nodeName,!I||I.toLowerCase()!=="input"||D.type!=="checkbox"&&D.type!=="radio"?M&&dc(M.elementType)&&(Le=Bf):Le=Cy;if(Le&&(Le=Le(e,M))){Gf(V,Le,s,H);break e}oe&&oe(e,D,M),e==="focusout"&&M&&D.type==="number"&&M.memoizedProps.value!=null&&uc(D,"number",D.value)}switch(oe=M?Kl(M):window,e){case"focusin":(Hf(oe)||oe.contentEditable==="true")&&(Ps=oe,Nc=M,ai=null);break;case"focusout":ai=Nc=Ps=null;break;case"mousedown":Ac=!0;break;case"contextmenu":case"mouseup":case"dragend":Ac=!1,Wf(V,s,H);break;case"selectionchange":if(My)break;case"keydown":case"keyup":Wf(V,s,H)}var Ne;if(xc)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else Ws?qf(e,s)&&(Ce="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Ce="onCompositionStart");Ce&&(Df&&s.locale!=="ko"&&(Ws||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&Ws&&(Ne=Of()):(xa=H,gc="value"in xa?xa.value:xa.textContent,Ws=!0)),oe=no(M,Ce),0<oe.length&&(Ce=new zf(Ce,e,null,s,H),V.push({event:Ce,listeners:oe}),Ne?Ce.data=Ne:(Ne=$f(s),Ne!==null&&(Ce.data=Ne)))),(Ne=jy?wy(e,s):Ny(e,s))&&(Ce=no(M,"onBeforeInput"),0<Ce.length&&(oe=new zf("onBeforeInput","beforeinput",null,s,H),V.push({event:oe,listeners:Ce}),oe.data=Ne)),gb(V,e,M,s,H)}wm(V,t)})}function Ei(e,t,s){return{instance:e,listener:t,currentTarget:s}}function no(e,t){for(var s=t+"Capture",l=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=Ql(e,s),c!=null&&l.unshift(Ei(e,c,d)),c=Ql(e,t),c!=null&&l.push(Ei(e,c,d))),e.tag===3)return l;e=e.return}return[]}function bb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Am(e,t,s,l,c){for(var d=t._reactName,h=[];s!==null&&s!==l;){var _=s,x=_.alternate,M=_.stateNode;if(_=_.tag,x!==null&&x===l)break;_!==5&&_!==26&&_!==27||M===null||(x=M,c?(M=Ql(s,d),M!=null&&h.unshift(Ei(s,M,x))):c||(M=Ql(s,d),M!=null&&h.push(Ei(s,M,x)))),s=s.return}h.length!==0&&e.push({event:t,listeners:h})}var xb=/\r\n?/g,Sb=/\u0000|\uFFFD/g;function Rm(e){return(typeof e=="string"?e:""+e).replace(xb,`
9
+ `).replace(Sb,"")}function Em(e,t){return t=Rm(t),Rm(e)===t}function Ze(e,t,s,l,c,d){switch(s){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Qs(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Qs(e,""+l);break;case"className":ir(e,"class",l);break;case"tabIndex":ir(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ir(e,s,l);break;case"style":Ef(e,l,d);break;case"data":if(t!=="object"){ir(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=or(""+l),e.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(s,"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 d=="function"&&(s==="formAction"?(t!=="input"&&Ze(e,t,"name",c.name,c,null),Ze(e,t,"formEncType",c.formEncType,c,null),Ze(e,t,"formMethod",c.formMethod,c,null),Ze(e,t,"formTarget",c.formTarget,c,null)):(Ze(e,t,"encType",c.encType,c,null),Ze(e,t,"method",c.method,c,null),Ze(e,t,"target",c.target,c,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=or(""+l),e.setAttribute(s,l);break;case"onClick":l!=null&&(e.onclick=Xn);break;case"onScroll":l!=null&&Ee("scroll",e);break;case"onScrollEnd":l!=null&&Ee("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(s=l.__html,s!=null){if(c.children!=null)throw Error(r(60));e.innerHTML=s}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}s=or(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""+l):e.removeAttribute(s);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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":l===!0?e.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,l):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(s,l):e.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(s):e.setAttribute(s,l);break;case"popover":Ee("beforetoggle",e),Ee("toggle",e),lr(e,"popover",l);break;case"xlinkActuate":Yn(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Yn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Yn(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Yn(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Yn(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Yn(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Yn(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Yn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Yn(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":lr(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=J_.get(s)||s,lr(e,s,l))}}function Fu(e,t,s,l,c,d){switch(s){case"style":Ef(e,l,d);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(s=l.__html,s!=null){if(c.children!=null)throw Error(r(60));e.innerHTML=s}}break;case"children":typeof l=="string"?Qs(e,l):(typeof l=="number"||typeof l=="bigint")&&Qs(e,""+l);break;case"onScroll":l!=null&&Ee("scroll",e);break;case"onScrollEnd":l!=null&&Ee("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Xn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yf.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(c=s.endsWith("Capture"),t=s.slice(2,c?s.length-7:void 0),d=e[jt]||null,d=d!=null?d[s]:null,typeof d=="function"&&e.removeEventListener(t,d,c),typeof l=="function")){typeof d!="function"&&d!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,l,c);break e}s in e?e[s]=l:l===!0?e.setAttribute(s,""):lr(e,s,l)}}}function Rt(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ee("error",e),Ee("load",e);var l=!1,c=!1,d;for(d in s)if(s.hasOwnProperty(d)){var h=s[d];if(h!=null)switch(d){case"src":l=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:Ze(e,t,d,h,s,null)}}c&&Ze(e,t,"srcSet",s.srcSet,s,null),l&&Ze(e,t,"src",s.src,s,null);return;case"input":Ee("invalid",e);var _=d=h=c=null,x=null,M=null;for(l in s)if(s.hasOwnProperty(l)){var H=s[l];if(H!=null)switch(l){case"name":c=H;break;case"type":h=H;break;case"checked":x=H;break;case"defaultChecked":M=H;break;case"value":d=H;break;case"defaultValue":_=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(r(137,t));break;default:Ze(e,t,l,H,s,null)}}wf(e,d,_,x,M,h,c,!1);return;case"select":Ee("invalid",e),l=h=d=null;for(c in s)if(s.hasOwnProperty(c)&&(_=s[c],_!=null))switch(c){case"value":d=_;break;case"defaultValue":h=_;break;case"multiple":l=_;default:Ze(e,t,c,_,s,null)}t=d,s=h,e.multiple=!!l,t!=null?Ks(e,!!l,t,!1):s!=null&&Ks(e,!!l,s,!0);return;case"textarea":Ee("invalid",e),d=c=l=null;for(h in s)if(s.hasOwnProperty(h)&&(_=s[h],_!=null))switch(h){case"value":l=_;break;case"defaultValue":c=_;break;case"children":d=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:Ze(e,t,h,_,s,null)}Af(e,l,c,d);return;case"option":for(x in s)s.hasOwnProperty(x)&&(l=s[x],l!=null)&&(x==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":Ze(e,t,x,l,s,null));return;case"dialog":Ee("beforetoggle",e),Ee("toggle",e),Ee("cancel",e),Ee("close",e);break;case"iframe":case"object":Ee("load",e);break;case"video":case"audio":for(l=0;l<Ri.length;l++)Ee(Ri[l],e);break;case"image":Ee("error",e),Ee("load",e);break;case"details":Ee("toggle",e);break;case"embed":case"source":case"link":Ee("error",e),Ee("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(M in s)if(s.hasOwnProperty(M)&&(l=s[M],l!=null))switch(M){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:Ze(e,t,M,l,s,null)}return;default:if(dc(t)){for(H in s)s.hasOwnProperty(H)&&(l=s[H],l!==void 0&&Fu(e,t,H,l,s,void 0));return}}for(_ in s)s.hasOwnProperty(_)&&(l=s[_],l!=null&&Ze(e,t,_,l,s,null))}function jb(e,t,s,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,h=null,_=null,x=null,M=null,H=null;for(I in s){var V=s[I];if(s.hasOwnProperty(I)&&V!=null)switch(I){case"checked":break;case"value":break;case"defaultValue":x=V;default:l.hasOwnProperty(I)||Ze(e,t,I,null,l,V)}}for(var D in l){var I=l[D];if(V=s[D],l.hasOwnProperty(D)&&(I!=null||V!=null))switch(D){case"type":d=I;break;case"name":c=I;break;case"checked":M=I;break;case"defaultChecked":H=I;break;case"value":h=I;break;case"defaultValue":_=I;break;case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(r(137,t));break;default:I!==V&&Ze(e,t,D,I,l,V)}}cc(e,h,_,x,M,H,d,c);return;case"select":I=h=_=D=null;for(d in s)if(x=s[d],s.hasOwnProperty(d)&&x!=null)switch(d){case"value":break;case"multiple":I=x;default:l.hasOwnProperty(d)||Ze(e,t,d,null,l,x)}for(c in l)if(d=l[c],x=s[c],l.hasOwnProperty(c)&&(d!=null||x!=null))switch(c){case"value":D=d;break;case"defaultValue":_=d;break;case"multiple":h=d;default:d!==x&&Ze(e,t,c,d,l,x)}t=_,s=h,l=I,D!=null?Ks(e,!!s,D,!1):!!l!=!!s&&(t!=null?Ks(e,!!s,t,!0):Ks(e,!!s,s?[]:"",!1));return;case"textarea":I=D=null;for(_ in s)if(c=s[_],s.hasOwnProperty(_)&&c!=null&&!l.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:Ze(e,t,_,null,l,c)}for(h in l)if(c=l[h],d=s[h],l.hasOwnProperty(h)&&(c!=null||d!=null))switch(h){case"value":D=c;break;case"defaultValue":I=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(r(91));break;default:c!==d&&Ze(e,t,h,c,l,d)}Nf(e,D,I);return;case"option":for(var le in s)D=s[le],s.hasOwnProperty(le)&&D!=null&&!l.hasOwnProperty(le)&&(le==="selected"?e.selected=!1:Ze(e,t,le,null,l,D));for(x in l)D=l[x],I=s[x],l.hasOwnProperty(x)&&D!==I&&(D!=null||I!=null)&&(x==="selected"?e.selected=D&&typeof D!="function"&&typeof D!="symbol":Ze(e,t,x,D,l,I));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 pe in s)D=s[pe],s.hasOwnProperty(pe)&&D!=null&&!l.hasOwnProperty(pe)&&Ze(e,t,pe,null,l,D);for(M in l)if(D=l[M],I=s[M],l.hasOwnProperty(M)&&D!==I&&(D!=null||I!=null))switch(M){case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(r(137,t));break;default:Ze(e,t,M,D,l,I)}return;default:if(dc(t)){for(var Ye in s)D=s[Ye],s.hasOwnProperty(Ye)&&D!==void 0&&!l.hasOwnProperty(Ye)&&Fu(e,t,Ye,void 0,l,D);for(H in l)D=l[H],I=s[H],!l.hasOwnProperty(H)||D===I||D===void 0&&I===void 0||Fu(e,t,H,D,l,I);return}}for(var E in s)D=s[E],s.hasOwnProperty(E)&&D!=null&&!l.hasOwnProperty(E)&&Ze(e,t,E,null,l,D);for(V in l)D=l[V],I=s[V],!l.hasOwnProperty(V)||D===I||D==null&&I==null||Ze(e,t,V,D,l,I)}function Tm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function wb(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var c=s[l],d=c.transferSize,h=c.initiatorType,_=c.duration;if(d&&_&&Tm(h)){for(h=0,_=c.responseEnd,l+=1;l<s.length;l++){var x=s[l],M=x.startTime;if(M>_)break;var H=x.transferSize,V=x.initiatorType;H&&Tm(V)&&(x=x.responseEnd,h+=H*(x<_?1:(_-M)/(x-M)))}if(--l,t+=8*(d+h)/(c.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 Wu=null,Pu=null;function ao(e){return e.nodeType===9?e:e.ownerDocument}function Cm(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 Om(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 ed(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 td=null;function Nb(){var e=window.event;return e&&e.type==="popstate"?e===td?!1:(td=e,!0):(td=null,!1)}var km=typeof setTimeout=="function"?setTimeout:void 0,Ab=typeof clearTimeout=="function"?clearTimeout:void 0,Mm=typeof Promise=="function"?Promise:void 0,Rb=typeof queueMicrotask=="function"?queueMicrotask:typeof Mm<"u"?function(e){return Mm.resolve(null).then(e).catch(Eb)}:km;function Eb(e){setTimeout(function(){throw e})}function Ua(e){return e==="head"}function zm(e,t){var s=t,l=0;do{var c=s.nextSibling;if(e.removeChild(s),c&&c.nodeType===8)if(s=c.data,s==="/$"||s==="/&"){if(l===0){e.removeChild(c),Al(t);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")Ti(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Ti(s);for(var d=s.firstChild;d;){var h=d.nextSibling,_=d.nodeName;d[Xl]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&d.rel.toLowerCase()==="stylesheet"||s.removeChild(d),d=h}}else s==="body"&&Ti(e.ownerDocument.body);s=c}while(s);Al(t)}function Lm(e,t){var s=e;e=0;do{var l=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=l}while(s)}function nd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":nd(s),rc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function Tb(e,t,s,l){for(;e.nodeType===1;){var c=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Xl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=gn(e.nextSibling),e===null)break}return null}function Cb(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=gn(e.nextSibling),e===null))return null;return e}function Dm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=gn(e.nextSibling),e===null))return null;return e}function ad(e){return e.data==="$?"||e.data==="$~"}function sd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Ob(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var l=function(){t(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function gn(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 ld=null;function Im(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return gn(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function Um(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function qm(e,t,s){switch(t=ao(s),e){case"html":if(e=t.documentElement,!e)throw Error(r(452));return e;case"head":if(e=t.head,!e)throw Error(r(453));return e;case"body":if(e=t.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function Ti(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);rc(e)}var vn=new Map,$m=new Set;function so(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ca=X.d;X.d={f:kb,r:Mb,D:zb,C:Lb,L:Db,m:Ib,X:qb,S:Ub,M:$b};function kb(){var e=ca.f(),t=Qr();return e||t}function Mb(e){var t=Zs(e);t!==null&&t.tag===5&&t.type==="form"?ap(t):ca.r(e)}var jl=typeof document>"u"?null:document;function Hm(e,t,s){var l=jl;if(l&&typeof t=="string"&&t){var c=cn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof s=="string"&&(c+='[crossorigin="'+s+'"]'),$m.has(c)||($m.add(c),e={rel:e,crossOrigin:s,href:t},l.querySelector(c)===null&&(t=l.createElement("link"),Rt(t,"link",e),yt(t),l.head.appendChild(t)))}}function zb(e){ca.D(e),Hm("dns-prefetch",e,null)}function Lb(e,t){ca.C(e,t),Hm("preconnect",e,t)}function Db(e,t,s){ca.L(e,t,s);var l=jl;if(l&&e&&t){var c='link[rel="preload"][as="'+cn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(c+='[imagesrcset="'+cn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(c+='[imagesizes="'+cn(s.imageSizes)+'"]')):c+='[href="'+cn(e)+'"]';var d=c;switch(t){case"style":d=wl(e);break;case"script":d=Nl(e)}vn.has(d)||(e=b({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),vn.set(d,e),l.querySelector(c)!==null||t==="style"&&l.querySelector(Ci(d))||t==="script"&&l.querySelector(Oi(d))||(t=l.createElement("link"),Rt(t,"link",e),yt(t),l.head.appendChild(t)))}}function Ib(e,t){ca.m(e,t);var s=jl;if(s&&e){var l=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+cn(l)+'"][href="'+cn(e)+'"]',d=c;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Nl(e)}if(!vn.has(d)&&(e=b({rel:"modulepreload",href:e},t),vn.set(d,e),s.querySelector(c)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Oi(d)))return}l=s.createElement("link"),Rt(l,"link",e),yt(l),s.head.appendChild(l)}}}function Ub(e,t,s){ca.S(e,t,s);var l=jl;if(l&&e){var c=Ys(l).hoistableStyles,d=wl(e);t=t||"default";var h=c.get(d);if(!h){var _={loading:0,preload:null};if(h=l.querySelector(Ci(d)))_.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},s),(s=vn.get(d))&&id(e,s);var x=h=l.createElement("link");yt(x),Rt(x,"link",e),x._p=new Promise(function(M,H){x.onload=M,x.onerror=H}),x.addEventListener("load",function(){_.loading|=1}),x.addEventListener("error",function(){_.loading|=2}),_.loading|=4,lo(h,t,l)}h={type:"stylesheet",instance:h,count:1,state:_},c.set(d,h)}}}function qb(e,t){ca.X(e,t);var s=jl;if(s&&e){var l=Ys(s).hoistableScripts,c=Nl(e),d=l.get(c);d||(d=s.querySelector(Oi(c)),d||(e=b({src:e,async:!0},t),(t=vn.get(c))&&rd(e,t),d=s.createElement("script"),yt(d),Rt(d,"link",e),s.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},l.set(c,d))}}function $b(e,t){ca.M(e,t);var s=jl;if(s&&e){var l=Ys(s).hoistableScripts,c=Nl(e),d=l.get(c);d||(d=s.querySelector(Oi(c)),d||(e=b({src:e,async:!0,type:"module"},t),(t=vn.get(c))&&rd(e,t),d=s.createElement("script"),yt(d),Rt(d,"link",e),s.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},l.set(c,d))}}function Gm(e,t,s,l){var c=(c=Q.current)?so(c):null;if(!c)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=wl(s.href),s=Ys(c).hoistableStyles,l=s.get(t),l||(l={type:"style",instance:null,count:0,state:null},s.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=wl(s.href);var d=Ys(c).hoistableStyles,h=d.get(e);if(h||(c=c.ownerDocument||c,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,h),(d=c.querySelector(Ci(e)))&&!d._p&&(h.instance=d,h.state.loading=5),vn.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},vn.set(e,s),d||Hb(c,e,s,h.state))),t&&l===null)throw Error(r(528,""));return h}if(t&&l!==null)throw Error(r(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Nl(s),s=Ys(c).hoistableScripts,l=s.get(t),l||(l={type:"script",instance:null,count:0,state:null},s.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function wl(e){return'href="'+cn(e)+'"'}function Ci(e){return'link[rel="stylesheet"]['+e+"]"}function Bm(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function Hb(e,t,s,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Rt(t,"link",s),yt(t),e.head.appendChild(t))}function Nl(e){return'[src="'+cn(e)+'"]'}function Oi(e){return"script[async]"+e}function Vm(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+cn(s.href)+'"]');if(l)return t.instance=l,yt(l),l;var c=b({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),yt(l),Rt(l,"style",c),lo(l,s.precedence,e),t.instance=l;case"stylesheet":c=wl(s.href);var d=e.querySelector(Ci(c));if(d)return t.state.loading|=4,t.instance=d,yt(d),d;l=Bm(s),(c=vn.get(c))&&id(l,c),d=(e.ownerDocument||e).createElement("link"),yt(d);var h=d;return h._p=new Promise(function(_,x){h.onload=_,h.onerror=x}),Rt(d,"link",l),t.state.loading|=4,lo(d,s.precedence,e),t.instance=d;case"script":return d=Nl(s.src),(c=e.querySelector(Oi(d)))?(t.instance=c,yt(c),c):(l=s,(c=vn.get(d))&&(l=b({},s),rd(l,c)),e=e.ownerDocument||e,c=e.createElement("script"),yt(c),Rt(c,"link",l),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,lo(l,s.precedence,e));return t.instance}function lo(e,t,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=l.length?l[l.length-1]:null,d=c,h=0;h<l.length;h++){var _=l[h];if(_.dataset.precedence===t)d=_;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function id(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function rd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var io=null;function Zm(e,t,s){if(io===null){var l=new Map,c=io=new Map;c.set(s,l)}else c=io,l=c.get(s),l||(l=new Map,c.set(s,l));if(l.has(e))return l;for(l.set(e,null),s=s.getElementsByTagName(e),c=0;c<s.length;c++){var d=s[c];if(!(d[Xl]||d[vt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var h=d.getAttribute(t)||"";h=e+h;var _=l.get(h);_?_.push(d):l.set(h,[d])}}return l}function Ym(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function Gb(e,t,s){if(s===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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 Xm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Bb(e,t,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var c=wl(l.href),d=t.querySelector(Ci(c));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ro.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=d,yt(d);return}d=t.ownerDocument||t,l=Bm(l),(c=vn.get(c))&&id(l,c),d=d.createElement("link"),yt(d);var h=d;h._p=new Promise(function(_,x){h.onload=_,h.onerror=x}),Rt(d,"link",l),s.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=ro.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var od=0;function Vb(e,t){return e.stylesheets&&e.count===0&&co(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var l=setTimeout(function(){if(e.stylesheets&&co(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&od===0&&(od=62500*wb());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&co(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>od?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(c)}}:null}function ro(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)co(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var oo=null;function co(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,oo=new Map,t.forEach(Zb,e),oo=null,ro.call(e))}function Zb(e,t){if(!(t.state.loading&4)){var s=oo.get(e);if(s)var l=s.get(null);else{s=new Map,oo.set(e,s);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var h=c[d];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(s.set(h.dataset.precedence,h),l=h)}l&&s.set(null,l)}c=t.instance,h=c.getAttribute("data-precedence"),d=s.get(h)||l,d===l&&s.set(null,c),s.set(h,c),this.count++,l=ro.bind(this),c.addEventListener("load",l),c.addEventListener("error",l),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var ki={$$typeof:Y,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function Yb(e,t,s,l,c,d,h,_,x){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=Hl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hl(0),this.hiddenUpdates=Hl(null),this.identifierPrefix=l,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=x,this.incompleteTransitions=new Map}function Km(e,t,s,l,c,d,h,_,x,M,H,V){return e=new Yb(e,t,s,h,x,M,H,V,_),t=1,d===!0&&(t|=24),d=Qt(3,null,null,t),e.current=d,d.stateNode=e,t=Hc(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:l,isDehydrated:s,cache:t},Zc(d),e}function Qm(e){return e?(e=nl,e):nl}function Jm(e,t,s,l,c,d){c=Qm(c),l.context===null?l.context=c:l.pendingContext=c,l=Ra(t),l.payload={element:s},d=d===void 0?null:d,d!==null&&(l.callback=d),s=Ea(e,l,t),s!==null&&(Zt(s,e,t),ui(s,e,t))}function Fm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function cd(e,t){Fm(e,t),(e=e.alternate)&&Fm(e,t)}function Wm(e){if(e.tag===13||e.tag===31){var t=gs(e,67108864);t!==null&&Zt(t,e,67108864),cd(e,67108864)}}function Pm(e){if(e.tag===13||e.tag===31){var t=en();t=Vl(t);var s=gs(e,t);s!==null&&Zt(s,e,t),cd(e,t)}}var uo=!0;function Xb(e,t,s,l){var c=z.T;z.T=null;var d=X.p;try{X.p=2,ud(e,t,s,l)}finally{X.p=d,z.T=c}}function Kb(e,t,s,l){var c=z.T;z.T=null;var d=X.p;try{X.p=8,ud(e,t,s,l)}finally{X.p=d,z.T=c}}function ud(e,t,s,l){if(uo){var c=dd(l);if(c===null)Ju(e,t,l,fo,s),tg(e,l);else if(Jb(c,e,t,s,l))l.stopPropagation();else if(tg(e,l),t&4&&-1<Qb.indexOf(e)){for(;c!==null;){var d=Zs(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var h=zn(d.pendingLanes);if(h!==0){var _=d;for(_.pendingLanes|=2,_.entangledLanes|=2;h;){var x=1<<31-We(h);_.entanglements[1]|=x,h&=~x}Un(d),(Ue&6)===0&&(Xr=Be()+500,Ai(0))}}break;case 31:case 13:_=gs(d,2),_!==null&&Zt(_,d,2),Qr(),cd(d,2)}if(d=dd(l),d===null&&Ju(e,t,l,fo,s),d===c)break;c=d}c!==null&&l.stopPropagation()}else Ju(e,t,l,null,s)}}function dd(e){return e=hc(e),fd(e)}var fo=null;function fd(e){if(fo=null,e=Vs(e),e!==null){var t=f(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=p(t),e!==null)return e;e=null}else if(s===31){if(e=m(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fo=e,null}function eg(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(tr()){case is:return 2;case ql:return 8;case xn:case ya:return 32;case $l:return 268435456;default:return 32}default:return 32}}var hd=!1,qa=null,$a=null,Ha=null,Mi=new Map,zi=new Map,Ga=[],Qb="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 tg(e,t){switch(e){case"focusin":case"focusout":qa=null;break;case"dragenter":case"dragleave":$a=null;break;case"mouseover":case"mouseout":Ha=null;break;case"pointerover":case"pointerout":Mi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":zi.delete(t.pointerId)}}function Li(e,t,s,l,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:s,eventSystemFlags:l,nativeEvent:d,targetContainers:[c]},t!==null&&(t=Zs(t),t!==null&&Wm(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Jb(e,t,s,l,c){switch(t){case"focusin":return qa=Li(qa,e,t,s,l,c),!0;case"dragenter":return $a=Li($a,e,t,s,l,c),!0;case"mouseover":return Ha=Li(Ha,e,t,s,l,c),!0;case"pointerover":var d=c.pointerId;return Mi.set(d,Li(Mi.get(d)||null,e,t,s,l,c)),!0;case"gotpointercapture":return d=c.pointerId,zi.set(d,Li(zi.get(d)||null,e,t,s,l,c)),!0}return!1}function ng(e){var t=Vs(e.target);if(t!==null){var s=f(t);if(s!==null){if(t=s.tag,t===13){if(t=p(s),t!==null){e.blockedOn=t,Yl(e.priority,function(){Pm(s)});return}}else if(t===31){if(t=m(s),t!==null){e.blockedOn=t,Yl(e.priority,function(){Pm(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ho(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=dd(e.nativeEvent);if(s===null){s=e.nativeEvent;var l=new s.constructor(s.type,s);fc=l,s.target.dispatchEvent(l),fc=null}else return t=Zs(s),t!==null&&Wm(t),e.blockedOn=s,!1;t.shift()}return!0}function ag(e,t,s){ho(e)&&s.delete(t)}function Fb(){hd=!1,qa!==null&&ho(qa)&&(qa=null),$a!==null&&ho($a)&&($a=null),Ha!==null&&ho(Ha)&&(Ha=null),Mi.forEach(ag),zi.forEach(ag)}function po(e,t){e.blockedOn===t&&(e.blockedOn=null,hd||(hd=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Fb)))}var mo=null;function sg(e){mo!==e&&(mo=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){mo===e&&(mo=null);for(var t=0;t<e.length;t+=3){var s=e[t],l=e[t+1],c=e[t+2];if(typeof l!="function"){if(fd(l||s)===null)continue;break}var d=Zs(s);d!==null&&(e.splice(t,3),t-=3,du(d,{pending:!0,data:c,method:s.method,action:l},l,c))}}))}function Al(e){function t(x){return po(x,e)}qa!==null&&po(qa,e),$a!==null&&po($a,e),Ha!==null&&po(Ha,e),Mi.forEach(t),zi.forEach(t);for(var s=0;s<Ga.length;s++){var l=Ga[s];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ga.length&&(s=Ga[0],s.blockedOn===null);)ng(s),s.blockedOn===null&&Ga.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var c=s[l],d=s[l+1],h=c[jt]||null;if(typeof d=="function")h||sg(s);else if(h){var _=null;if(d&&d.hasAttribute("formAction")){if(c=d,h=d[jt]||null)_=h.formAction;else if(fd(c)!==null)continue}else _=h.action;typeof _=="function"?s[l+1]=_:(s.splice(l,3),l-=3),sg(s)}}}function lg(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(h){return c=h})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),l||setTimeout(s,20)}function s(){if(!l&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function pd(e){this._internalRoot=e}go.prototype.render=pd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));var s=t.current,l=en();Jm(s,l,e,t,null,null)},go.prototype.unmount=pd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Jm(e.current,2,null,e,null,null),Qr(),t[ba]=null}};function go(e){this._internalRoot=e}go.prototype.unstable_scheduleHydration=function(e){if(e){var t=Zl();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Ga.length&&t!==0&&t<Ga[s].priority;s++);Ga.splice(s,0,e),s===0&&ng(e)}};var ig=a.version;if(ig!=="19.2.7")throw Error(r(527,ig,"19.2.7"));X.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=v(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var Wb={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vo.isDisabled&&vo.supportsFiber)try{rs=vo.inject(Wb),Mt=vo}catch{}}return Ii.createRoot=function(e,t){if(!u(e))throw Error(r(299));var s=!1,l="",c=hp,d=pp,h=mp;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=Km(e,1,!1,null,null,s,l,null,c,d,h,lg),e[ba]=t.current,Qu(e),new pd(t)},Ii.hydrateRoot=function(e,t,s){if(!u(e))throw Error(r(299));var l=!1,c="",d=hp,h=pp,_=mp,x=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onUncaughtError!==void 0&&(d=s.onUncaughtError),s.onCaughtError!==void 0&&(h=s.onCaughtError),s.onRecoverableError!==void 0&&(_=s.onRecoverableError),s.formState!==void 0&&(x=s.formState)),t=Km(e,1,!0,t,s??null,l,c,x,d,h,_,lg),t.context=Qm(null),s=t.current,l=en(),l=Vl(l),c=Ra(l),c.callback=null,Ea(s,c,l),s=l,t.current.lanes=s,ds(t,s),Un(t),e[ba]=t.current,Qu(e),new go(t)},Ii.version="19.2.7",Ii}var gg;function rx(){if(gg)return vd.exports;gg=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),vd.exports=ix(),vd.exports}var ox=rx();function cx({error:n,onAddPasskey:a,onSignOut:i,pending:r}){const[u,f]=j.useState(!1),[p,m]=j.useState(!1),g=j.useId(),v=j.useRef(null),y=j.useRef(null),b=j.useRef(null),T=j.useRef(null);j.useEffect(()=>{if(u){m(!1);return}m(!0);const q=window.setTimeout(()=>m(!1),160);return()=>window.clearTimeout(q)},[u]),j.useEffect(()=>{if(!u)return;b.current?.focus();const q=O=>{O.target instanceof Node&&!v.current?.contains(O.target)&&f(!1)};return document.addEventListener("pointerdown",q),()=>document.removeEventListener("pointerdown",q)},[u]),j.useEffect(()=>{n!==null&&f(!0)},[n]);const N=()=>{f(!1),y.current?.focus()},C=q=>{f(!1),q()},R=q=>{if(q.key==="Escape"){q.preventDefault(),N();return}if(q.key==="Tab"){f(!1);return}if(q.key==="Home"||q.key==="End"){q.preventDefault(),(q.key==="Home"?b:T).current?.focus();return}if(q.key==="ArrowDown"||q.key==="ArrowUp"){q.preventDefault();const O=[b.current,T.current].filter(ae=>ae!==null&&!ae.disabled);if(O.length===0)return;const Y=O.indexOf(document.activeElement),A=q.key==="ArrowDown"?1:-1,$=Y===-1?0:(Y+A+O.length)%O.length;O[$]?.focus()}},L=r!==null;return o.jsxs("div",{className:"account-menu",ref:v,children:[o.jsxs("button",{"aria-busy":L,"aria-controls":u?g:void 0,"aria-expanded":u,"aria-haspopup":"menu","aria-label":"Account menu",className:"account-menu__trigger",disabled:L,onClick:()=>f(q=>!q),ref:y,title:"Account",type:"button",children:[o.jsx("span",{"aria-hidden":"true",className:"account-menu__mark",children:o.jsx("span",{className:"account-menu__mark-dot"})}),o.jsx("span",{className:"account-menu__trigger-label",children:"account"}),o.jsx("span",{"aria-hidden":"true",className:"account-menu__chevron",children:u?"⌃":"⌄"})]}),u||p?o.jsxs("div",{"aria-hidden":p&&!u?"true":void 0,className:"account-menu__panel","data-closing":p&&!u?"true":void 0,inert:p&&!u?!0:void 0,children:[o.jsxs("div",{className:"account-menu__heading",children:[o.jsx("span",{children:"Account"}),o.jsxs("span",{className:"account-menu__status",children:[o.jsx("span",{"aria-hidden":"true",className:"account-menu__status-dot"}),"passkey authenticated"]})]}),o.jsxs("div",{"aria-label":"Account",id:g,onKeyDown:R,role:"menu",children:[o.jsxs("button",{className:"account-menu__item",disabled:L,onClick:()=>C(a),ref:b,role:"menuitem",type:"button",children:[o.jsx("span",{className:"account-menu__item-label",children:r==="register"?"Adding passkey…":"Add passkey"}),o.jsx("span",{className:"account-menu__item-detail",children:"Register a backup authenticator"})]}),o.jsxs("button",{className:"account-menu__item account-menu__item--sign-out",disabled:L,onClick:()=>C(i),ref:T,role:"menuitem",type:"button",children:[o.jsx("span",{className:"account-menu__item-label",children:r==="logout"?"Signing out…":"Sign out"}),o.jsx("span",{className:"account-menu__item-detail",children:"End this dashboard session"})]})]}),n===null?null:o.jsx("p",{className:"account-menu__error",role:"alert",children:n})]}):null]})}const ux="clinkx-theme";function Ev(n=document.documentElement){return n.getAttribute("data-theme")==="dark"?"dark":"light"}function Tv(n,a){try{(a??window.localStorage).setItem(ux,n)}catch{}}function Cv(n,a=document.documentElement){if(n==="dark"){a.setAttribute("data-theme","dark");return}a.removeAttribute("data-theme")}function Ov(n){return n==="dark"?"light":"dark"}const dx={dark:"switch to light theme",light:"switch to dark theme"};function fx(){const[n,a]=j.useState(Ev),i=dx[n],r=()=>{const u=Ov(n);a(u),Tv(u),Cv(u)};return o.jsx("button",{"aria-label":i,className:"app-shell__theme-toggle",onClick:r,title:i,type:"button",children:o.jsx("span",{"aria-hidden":"true",children:n==="dark"?"◑":"◐"})})}const vg=[{destination:"runs",desktopLabel:"runs",mobileLabel:"runs"},{destination:"activities",desktopLabel:"single calls",mobileLabel:"calls"},{destination:"context_runs",desktopLabel:"context runs",mobileLabel:"context"},{destination:"progress_reports",desktopLabel:"progress",mobileLabel:"progress"},{destination:"workflows",desktopLabel:"workflows",mobileLabel:"workflows"},{destination:"adapters",desktopLabel:"adapters",mobileLabel:"adapters"},{destination:"artifacts",desktopLabel:"artifacts",mobileLabel:"artifacts"}];function hx(n){return n===void 0?"—":String(n)}function _g({active:n}){return o.jsx("span",{"aria-hidden":"true",className:"app-shell__nav-mark",children:n?"●":"○"})}const px={initial_loading:"loading",current:"live",paused:"paused",stale:"stale",offline:"offline",auth_expired:"auth expired",connection_changed:"connection changed",error:"error"};function mx({accountActions:n,activeDestination:a,children:i,environment:r,navigationCounts:u,observationAvailable:f=!0,onNavigate:p,onPause:m,onResume:g,pageTitle:v,pollingPhase:y,reportedRunningCalls:b}){const T=y==="paused",N=f?px[y]:"static",C=f?y:"static";return o.jsxs("div",{className:"app-shell",children:[o.jsxs("header",{className:"app-shell__bar",children:[o.jsxs("span",{"aria-hidden":"true",className:"app-shell__mobile-identity",children:[o.jsx("span",{className:"app-shell__identity-mark",children:o.jsx("span",{className:"app-shell__identity-dot"})}),o.jsx("span",{className:"app-shell__identity-name",children:"ClinkX"})]}),o.jsxs("div",{className:"app-shell__brand-line",children:[o.jsx("span",{className:"app-shell__brand-meta",children:"field station"}),o.jsx("span",{"aria-hidden":"true",className:"app-shell__brand-sep",children:"/"}),o.jsx("span",{className:"app-shell__brand-meta",children:"clinkx-workflows"}),o.jsx("span",{"aria-hidden":"true",className:"app-shell__brand-sep",children:"/"}),o.jsx("span",{className:"app-shell__page-title",children:v})]}),o.jsxs("span",{className:"app-shell__mobile-title",children:["/ ",v]}),o.jsxs("span",{className:`app-shell__live-tag app-shell__live-tag--${C}`,"data-phase":C,children:[o.jsx("span",{"aria-hidden":"true",className:"app-shell__live-dot"}),N]}),o.jsxs("div",{className:"app-shell__instrument-controls",children:[o.jsxs("button",{"aria-label":f?T?"resume live updates":"freeze live updates — incoming events keep buffering":"observation unavailable on this destination",className:`app-shell__pause ${T?"app-shell__pause--active":""}`,disabled:!f,onClick:T?g:m,title:f?T?"resume live updates":"freeze live updates — incoming events keep buffering":"observation unavailable on this destination",type:"button",children:[T?"▶":"❚❚"," ",o.jsx("span",{className:"app-shell__pause-word",children:T?"resume":"freeze"})]}),o.jsx("span",{className:"app-shell__theme-control",children:o.jsx(fx,{})})]}),n===void 0?o.jsx("button",{className:"app-shell__run-action",onClick:()=>p("workflows"),type:"button",children:"run workflow"}):o.jsx(cx,{...n})]}),o.jsxs("div",{className:"app-shell__workspace",children:[o.jsxs("aside",{className:"app-shell__sidebar","aria-label":"Dashboard context",children:[o.jsxs("div",{className:"app-shell__identity","aria-hidden":"true",children:[o.jsx("span",{className:"app-shell__identity-mark",children:o.jsx("span",{className:"app-shell__identity-dot"})}),o.jsx("span",{className:"app-shell__identity-name",children:"ClinkX"})]}),o.jsx("nav",{className:"app-shell__desktop-nav","aria-label":"Primary",children:vg.map(R=>{const L=R.destination===a;return o.jsxs("button",{"aria-current":L?"page":void 0,className:"app-shell__nav-button",onClick:()=>p(R.destination),type:"button",children:[o.jsx(_g,{active:L}),o.jsx("span",{className:"app-shell__nav-label",children:R.desktopLabel}),o.jsx("span",{className:"app-shell__nav-count",children:hx(u[R.destination])})]},R.destination)})}),o.jsxs("section",{className:"app-shell__instrument","aria-labelledby":"calls-label",children:[o.jsx("h2",{id:"calls-label",className:"app-shell__section-label",children:"Reported running workflow calls"}),o.jsx("p",{className:"app-shell__instrument-value",children:b.count===null?"not loaded":`${b.count} reported`}),o.jsxs("p",{className:"app-shell__instrument-note",children:[b.refreshedLabel??"refresh pending"," · not a worker-health signal"]})]}),o.jsxs("section",{className:"app-shell__environment","aria-labelledby":"env-label",children:[o.jsx("h2",{id:"env-label",className:"app-shell__section-label",children:"Env"}),o.jsxs("dl",{className:"app-shell__environment-list",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"WORKSPACE_ROOT"}),o.jsx("dd",{children:r?.workspaceRoot??"not reported"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"STATE_DIR"}),o.jsx("dd",{children:r?.stateDir??"not reported"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"RUNS_ROOT"}),o.jsx("dd",{children:r?.runsRoot??"not reported"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"ACTIVITIES_ROOT"}),o.jsx("dd",{children:r?.activitiesRoot??"not reported"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"WORKFLOWS_PATH"}),o.jsx("dd",{children:r?.workflowsPath??"not reported"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"TEMPLATES_PATH"}),o.jsx("dd",{children:r?.templatesPath??"not reported"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"CHILD_CONFIG"}),o.jsx("dd",{children:r?.childConfig??"not reported"})]})]})]}),o.jsxs("footer",{className:"app-shell__footer",children:[o.jsx("span",{"aria-hidden":"true",className:"app-shell__footer-dot"}),o.jsxs("span",{children:["field station · ",N," · read-only"]})]})]}),o.jsxs("main",{className:"app-shell__main","aria-labelledby":"dashboard-page-title",id:"main-content",tabIndex:0,children:[i,o.jsx("span",{"aria-hidden":"true",className:"app-shell__version-stamp",children:"clinkx-workflows · dashboard · observer · state_version 1"})]})]}),o.jsx("nav",{className:"app-shell__mobile-tabs","aria-label":"Mobile",children:vg.map(R=>{const L=R.destination===a;return o.jsxs("button",{"aria-current":L?"page":void 0,className:"app-shell__mobile-tab",onClick:()=>p(R.destination),type:"button",children:[o.jsx(_g,{active:L}),o.jsx("span",{children:R.mobileLabel})]},R.destination)})})]})}function Tn(n,a){const i=Date.parse(n);if(!Number.isFinite(i))return"not reported";const r=Math.max(0,a-i),u=Math.floor(r/1e3);if(u<60)return`${String(u)}s ago`;const f=Math.floor(u/60);if(f<60)return`${String(f)}m ago`;const p=Math.floor(f/60);return p<24?`${String(p)}h ago`:`${String(Math.floor(p/24))}d ago`}function Ro(n){const a=Math.max(0,n),i=Math.floor(a/1e3);if(i<60)return`${String(i)}s`;const r=Math.floor(i/60);return r<60?`${String(r)}m`:`${String(Math.floor(r/60))}h`}function Xo(n){return n.status!=="pending"&&n.status!=="running"?"terminal":n.orphaned||n.workerLockObservation==="orphaned"?"orphaned":n.workerLockObservation==="live"?"live":n.workerLockObservation==="heartbeat_live"?"heartbeat_live":"unknown"}function Ji(n){return n==="live"||n==="heartbeat_live"}const gx=new Set(["succeeded","running","failed"]);function vx(n){return gx.has(n.state)?!0:n.callSucceeded!==void 0&&n.callSucceeded>0}function yg(n){const a=n.callTotal;if(a===void 0)return`· ${n.state}`;const i=n.callSucceeded??0,r=n.callFailed??0;if((n.state==="pending"||n.state==="cancelled")&&i===0)return`· ${String(a)}`;const u=r>0?` ×${String(r)}`:"";return`· ${String(i)}/${String(a)}${u}`}function bg(n){return n.availability==="available"&&(n.row.status==="pending"||n.row.status==="running")?0:1}function _x(n){return n.map((a,i)=>{const r=a.availability==="available"?a.row.status==="pending"||a.row.status==="running"?a.row.startedAt??a.row.stateUpdatedAt:a.row.completedAt??a.row.stateUpdatedAt:a.row.chronologyAt,u=r===void 0?Number.NEGATIVE_INFINITY:Date.parse(r);return{card:a,index:i,timestamp:Number.isFinite(u)?u:Number.NEGATIVE_INFINITY}}).sort((a,i)=>{const r=bg(a.card)-bg(i.card);if(r!==0)return r;const u=i.timestamp-a.timestamp;return u===0?a.index-i.index:u}).map(({card:a})=>a)}function yx(n,a){return a==="orphaned"?"orphaned":a==="unknown"?"worker unknown":n.status}function bx(n,a){if(n.startedAt!==void 0&&n.completedAt!==void 0){const i=Math.max(0,Date.parse(n.completedAt)-Date.parse(n.startedAt));return`duration ${Ro(i)}`}if(n.startedAt!==void 0){const i=Date.parse(n.stateUpdatedAt),r=Xo(n),u=Ji(r)||r==="unknown"||!Number.isFinite(i)?a:i;return`started ${Tn(n.startedAt,u)}`}return n.completedAt!==void 0?`completed ${Tn(n.completedAt,a)}`:"timing not reported"}function kv(n){const a=n.resumable===!0&&n.workflowName!=="plan-review-receipts"&&(n.status==="failed"||n.status==="cancelled");return n.orphaned===!0?{tool:"resume_workflow",label:"resume + cancel handoff",text:`resume_workflow run_id=${n.runId}
10
+ cancel_workflow run_id=${n.runId}`}:n.status==="pending"||n.status==="running"?{tool:"cancel_workflow",label:"cancel handoff",text:`cancel_workflow run_id=${n.runId}`}:a?{tool:"resume_workflow",label:"resume handoff",text:`resume_workflow run_id=${n.runId}`}:null}function xg(n,a){if(n.availability==="unavailable")return{availability:"unavailable",row:n,statusLabel:n.reason.replaceAll("_"," ")};const i=Xo(n),r=[...i==="heartbeat_live"?["heartbeat"]:[],...n.async?["async"]:[],...n.debugKeepArtifacts?["debug kept"]:[]];return{availability:"available",row:n,workflowLabel:`${n.workflowName} · v${n.workflowVersion}`,statusLabel:yx(n,i),workerObservation:i,showLiveMotion:Ji(i),statusTags:n.status==="failed"&&n.stageCounts.succeeded>0?["partially_succeeded"]:n.status==="succeeded"&&(n.callCounts.failed>0||n.stageCounts.failed>0)?["degraded"]:[],timingLabel:bx(n,a),updatedAgeLabel:Tn(n.stateUpdatedAt,a),reportedRunningCallsLabel:`${String(n.reportedRunningCalls)} reported running calls — not a worker-health signal`,flags:r,actionHandoff:kv(n)}}const xx={initial_loading:"Loading runs…",current:"Current",paused:"Paused — timestamps frozen",stale:"Stale data — retrying",offline:"Offline — retained data shown",auth_expired:"Authentication expired",connection_changed:"Connection changed — rebootstrap required",error:"Run data request failed"};function Mv(n){const i=[...n.live,...n.history].reduce((r,u)=>r+(u.availability==="available"?u.reportedRunningCalls:0),0);return{phaseLabel:xx[n.phase],lastRefreshLabel:n.lastRefreshAtMs===null?"last refresh not loaded":`last refresh ${Tn(new Date(n.lastRefreshAtMs).toISOString(),n.displayNowMs)}${n.phase==="paused"?" · frozen":""}`,liveCountLabel:`${String(n.live.length)} reported live runs loaded`,historyCountLabel:`${String(n.history.length)} history runs loaded · page ${String(n.historyPage+1)}`,reportedRunningCallsLabel:`${String(i)} reported running calls · not a worker-health signal`,live:n.live.map(r=>xg(r,n.displayNowMs)),history:n.history.map(r=>xg(r,n.displayNowMs))}}const Sx=new Set(["succeeded","failed","cancelled"]);function fa(n){if(n===void 0)return null;const a=Date.parse(n);return Number.isFinite(a)?a:null}function Gn(n){const a=Math.max(0,n);if(a<1e3)return`${Math.round(a)}ms`;if(a<1e4)return`${(a/1e3).toFixed(1)}s`;if(a<6e4)return`${Math.round(a/1e3)}s`;const i=Math.round(a/1e3),r=Math.floor(i/3600),u=Math.floor(i%3600/60),f=i%60;return r>0?`${r}h ${String(u).padStart(2,"0")}m`:`${u}m ${String(f).padStart(2,"0")}s`}function tf(n){return n.length===0?"not reported":n.join(", ")}function jx(n,a){const i=fa(n.startedAt);if(i===null)return n.status==="pending"?"not started":"not reported";const r=Sx.has(n.status)?fa(n.completedAt)??fa(n.stateUpdatedAt):a;return r===null?"not reported":Gn(r-i)}function nf(n,a){if("durationMs"in n&&n.durationMs!==void 0)return Gn(n.durationMs);const i=fa(n.startedAt);if(i===null)return n.state==="pending"?"not started":"not reported";const r=fa(n.completedAt);return r!==null?Gn(r-i):n.state==="running"?Gn(a-i):"not reported"}function zv(n,a){return n.length>0?`Uses data from ${n.join(" + ")}`:a===0?"Entry stage":"No upstream data dependency"}function Sg(n,a,i){const r=fa(a.startedAt);if(r===null)return null;const u=fa(a.completedAt),f="durationMs"in a&&a.durationMs!==void 0?r+Math.max(0,a.durationMs):null,p=u??f??(a.state==="running"?i:null);return p===null||p<r?null:{id:n,state:a.state,startMs:r,endMs:p}}function wx(n){const a=Math.max(0,Math.round(n/1e3)),i=Math.floor(a/3600),r=Math.floor(a%3600/60),u=a%60;return i>0?`+${i}:${String(r).padStart(2,"0")}:${String(u).padStart(2,"0")}`:`+${r}:${String(u).padStart(2,"0")}`}function Nx(n){const a=Math.max(1e3,n/3),r=[1e3,5e3,1e4,15e3,3e4,6e4,12e4,24e4,3e5,6e5,9e5,18e5,36e5,72e5,108e5,216e5,432e5,864e5,1728e5,2592e5,6048e5].reduce((g,v)=>Math.abs(v-a)<Math.abs(g-a)?v:g);if(Math.floor(n/r)+1<=6)return r;const u=n/5,f=10**Math.floor(Math.log10(u)),p=u/f;return(p<=1?1:p<=2?2:p<=5?5:10)*f}function Ax(n,a,i){const r=new Map(a.availability==="available"?a.stages.map(R=>[R.stageId,R.dependsOn]):[]),u=n.stages.map((R,L)=>{const q=r.get(R.stageId)??[];return{stageId:R.stageId,dependsOn:q,dependencyLabel:a.availability==="available"?zv(q,L):null,stageBar:Sg(R.stageId,R,i),callBars:R.calls.flatMap(O=>{const Y=Sg(O.callId,O,i);if(Y===null)return[];const A=O.snapshotIdentity?.adapter??"adapter not reported",$=O.snapshotIdentity?.role??"role not reported";return[{bar:Y,stageId:R.stageId,callId:O.callId,adapterLabel:A,roleLabel:$,tooltipLabel:`member ${O.callId} · CLI ${A} · role ${$} · ${O.state} · ${nf(O,i)}`}]}),callCountLabel:R.state==="pending"||R.state==="cancelled"?`· ${R.calls.length}`:`${R.calls.filter(O=>O.state==="succeeded"||O.state==="failed").length}/${R.calls.length}`}}),f=u.flatMap(R=>[...R.stageBar===null?[]:[R.stageBar],...R.callBars.map(L=>L.bar)]);if(f.length===0)return null;const p=fa(n.startedAt)??Math.min(...f.map(R=>R.startMs)),m=Math.max(...f.map(R=>R.endMs)),g=Math.max(0,m-p),v=Math.max(1,g*1.05),y=R=>({id:R.id,state:R.state,startPercent:(R.startMs-p)/v*100,widthPercent:(R.endMs-R.startMs)/v*100}),b=n.stages.reduce((R,L)=>R+L.calls.length,0),T=Ji(Xo(n))?Math.min(100,Math.max(0,(i-p)/v*100)):null,N=Nx(g),C=Array.from({length:Math.floor(g/N)+1},(R,L)=>{const q=L*N;return{label:wx(q),positionPercent:q/v*100}});return{spanLabel:`span ${Gn(g)} · ${n.stages.length} stages · ${b} calls`,ticks:C,fanInPositions:u.map(R=>R.stageBar).filter(R=>R!==null).map(R=>(R.endMs-p)/v*100),livePositionPercent:T,stages:u.map(R=>({stageId:R.stageId,callCountLabel:R.callCountLabel,dependsOn:R.dependsOn,dependencyLabel:R.dependencyLabel,stageBar:R.stageBar===null?null:y(R.stageBar),callBars:R.callBars.map(L=>({...y(L.bar),stageId:L.stageId,callId:L.callId,adapterLabel:L.adapterLabel,roleLabel:L.roleLabel,tooltipLabel:L.tooltipLabel}))}))}}function Rx(n,a){const i=[n.hasWorkflowInput?"workflow input persisted":null,n.hasOutput?"output persisted":null,n.hasRawError?"raw error persisted":null,n.hasArtifactReference?"artifact referenced":null].filter(r=>r!==null);return{callId:n.callId,statusLabel:n.state,adapterLabel:n.snapshotIdentity?.adapter??null,roleLabel:n.snapshotIdentity?.role??null,retryLabel:n.retryCount===0?null:n.attemptsConsumed===void 0?`${n.retryCount} ${n.retryCount===1?"retry":"retries"}`:`attempt ${n.attemptsConsumed}`,timingLabel:nf(n,a),failureLabel:n.failureClass===void 0?null:`${n.failureClass} failure`,contentLabels:i}}function jg(n,a){const i=Object.keys(a);return[{label:n,value:String(i.reduce((r,u)=>r+a[u],0))},...i.filter(r=>a[r]>0).map(r=>({label:`${n} ${r}`,value:String(a[r])}))]}function Ex(n){return n.kind==="generic"?{kind:n.kind,title:"Persisted state counts",facts:[...jg("stages",n.stageCounts),...jg("calls",n.callCounts)]}:{kind:n.kind,title:"Plan-review transport facts",facts:[{label:"execution",value:n.executionStatus},{label:"seats",value:String(n.seatCount)},{label:"completed",value:String(n.completedSeats)},...n.failedSeats===0?[]:[{label:"failed",value:String(n.failedSeats)}],...n.missingSeats===0?[]:[{label:"missing",value:String(n.missingSeats)}],{label:"chairman",value:n.chairmanStatus},{label:"context",value:n.contextStatus},{label:"contract digest",value:n.executionContractDigestPrefix}]}}function Tx(n){return n.availability==="available"?`${n.kind.replace("_"," ")} result available`:`result unavailable · ${n.reason.replaceAll("_"," ")}`}function Cx(n){return typeof n!="object"||n===null||!("availability"in n)?{availability:"unavailable",reason:"invalid"}:n.availability==="available"&&"kind"in n&&["text","json","plan_review"].includes(String(n.kind))||n.availability==="unavailable"&&"reason"in n&&["run_pending","run_running","run_failed","run_cancelled","not_persisted","missing","invalid","too_large"].includes(String(n.reason))?n:{availability:"unavailable",reason:"invalid"}}function Ox(n){return typeof n=="object"&&n!==null&&"availability"in n&&n.availability==="available"&&"stages"in n&&Array.isArray(n.stages)||typeof n=="object"&&n!==null&&"availability"in n&&n.availability==="unavailable"&&"reason"in n&&typeof n.reason=="string"?n:{availability:"unavailable",reason:"invalid"}}function kx(n){const a=n.card;return typeof a=="object"&&a!==null&&"kind"in a&&(a.kind==="generic"||a.kind==="council-plan-review")?a:{kind:"generic",stageCounts:n.stageCounts,callCounts:n.callCounts}}function Mx(n,a){const i=Xo(n),r=Ji(i)||i==="unknown"?a:fa(n.stateUpdatedAt)??a,u=Ox(n.snapshotEnrichment),f=u.availability==="available"?new Map(u.stages.map(g=>[g.stageId,g])):new Map,p=u.availability==="available",m=Cx(n.result);return{runId:n.runId,workflowLabel:`${n.workflowName} · v${n.workflowVersion}`,statusLabel:i==="orphaned"?"orphaned":i==="unknown"?"worker unknown":n.status,statusState:i==="unknown"?"worker-unknown":i==="orphaned"?"orphaned":n.status,workerEvidenceLabel:i==="live"?"pid probe":i==="heartbeat_live"?"heartbeat":null,workerEvidenceDescription:i==="live"?"worker liveness from a local process probe":i==="heartbeat_live"?"worker liveness from a lock heartbeat refreshed within its declared freshness window, not a local process probe":null,elapsedLabel:jx(n,r),startedLabel:n.startedAt??"not reported",updatedLabel:n.stateUpdatedAt,modeLabels:[n.async?"async":"sync",...n.debugKeepArtifacts?["debug artifacts kept"]:[]],snapshotAvailable:p,snapshotLabel:p?"Graph derived from verified workflow snapshot":`Workflow snapshot unavailable · ${u.reason.replaceAll("_"," ")}`,timeline:Ax(n,u,r),stages:n.stages.map((g,v)=>{const y=f.get(g.stageId),b=y?.dependsOn??[];return{stageId:g.stageId,label:y?.label??g.stageId,statusLabel:g.state,timingLabel:nf(g,r),dependsOn:b,sequenceLabel:`Stage ${String(v+1)} of ${String(n.stages.length)}`,dependencyLabel:p?zv(b,v):null,calls:g.calls.map(T=>Rx(T,r))}}),decisiveFailureLabel:n.decisiveFailure===void 0?null:[n.decisiveFailure.stageId,n.decisiveFailure.callId,`${n.decisiveFailure.failureClass} failure`].filter(g=>g!==void 0).join(" · "),result:m,resultLabel:Tx(m),card:Ex(kx(n))}}const zx=1400;function Lx(n){const a=document.createElement("textarea");a.className="copy-fallback-input",a.value=n,a.setAttribute("readonly",""),document.body.append(a),a.select();try{return document.execCommand("copy")}catch{return!1}finally{a.remove()}}async function Dx(n){try{if(navigator.clipboard)return await navigator.clipboard.writeText(n),!0}catch{}return Lx(n)}function Ls({label:n,text:a}){const[i,r]=j.useState("idle");j.useEffect(()=>{if(i!=="copied")return;const f=setTimeout(()=>r("idle"),zx);return()=>{clearTimeout(f)}},[i]);const u=i==="copied"?"copied ✓":i==="failed"?"copy failed; select the text":"[ copy ]";return o.jsxs("span",{className:"copy-control",children:[o.jsx("button",{"aria-label":n,className:"copy-control__button","data-copy-state":i,onClick:()=>{Dx(a).then(f=>r(f?"copied":"failed"))},type:"button",children:u}),i==="idle"?null:o.jsx("span",{"aria-live":"polite",className:"copy-control__status",role:"status",children:i==="copied"?"Copied":"Copy failed; select the text"})]})}function ks({children:n}){return o.jsx("pre",{className:"selectable-content",tabIndex:0,children:n})}var Ix=Rv();const Ux=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");function wg(n){return[...n.querySelectorAll(Ux)].filter(a=>{const i=window.getComputedStyle(a);return a.getAttribute("aria-hidden")!=="true"&&!a.hidden&&i.display!=="none"&&i.visibility!=="hidden"})}function af({applicationRootId:n,children:a,labelledBy:i,onClose:r,open:u,panelClassName:f}){const p=j.useRef(null),m=j.useRef(null),[g,v]=j.useState(u);if(j.useEffect(()=>{if(u){v(!0);return}if(!g)return;const N=window.setTimeout(()=>v(!1),200);return()=>window.clearTimeout(N)},[u,g]),j.useEffect(()=>{if(!u||!g)return;m.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const N=document.getElementById(n),C=N?.hasAttribute("inert")??!1,R=N?.getAttribute("aria-hidden")??null;N?.setAttribute("inert",""),N?.setAttribute("aria-hidden","true");const L=p.current;return((L?wg(L)[0]:void 0)??L)?.focus(),()=>{N&&(C||N.removeAttribute("inert"),R===null?N.removeAttribute("aria-hidden"):N.setAttribute("aria-hidden",R)),m.current?.focus(),m.current=null}},[n,u,g]),!g)return null;const y=N=>{if(N.key==="Escape"){N.preventDefault(),r();return}if(N.key!=="Tab"||!p.current)return;const C=wg(p.current);if(C.length===0){N.preventDefault(),p.current.focus();return}const R=C[0],L=C[C.length-1];(!N.shiftKey&&document.activeElement===L||N.shiftKey&&document.activeElement===R||!p.current.contains(document.activeElement))&&(N.preventDefault(),(N.shiftKey?L:R)?.focus())},b=N=>{N.target===N.currentTarget&&r()},T=!u;return Ix.createPortal(o.jsx("div",{"aria-hidden":T?"true":void 0,className:"accessible-dialog__backdrop","data-closing":T?"true":void 0,inert:T?!0:void 0,onMouseDown:b,children:o.jsx("div",{"aria-hidden":T?"true":void 0,"aria-labelledby":i,"aria-modal":"true",className:f===void 0?"accessible-dialog":`accessible-dialog ${f}`,"data-closing":T?"true":void 0,inert:T?!0:void 0,onKeyDown:y,ref:p,role:"dialog",tabIndex:-1,children:a})}),document.body)}const Lv={standalone:"standalone",refine:"refine",workflow_preflight:"workflow preflight",historical:"historical"};function qx(n,a){if(n.startedAt!==null&&n.completedAt!==null){const i=Math.max(0,Date.parse(n.completedAt)-Date.parse(n.startedAt));return`duration ${Ro(i)}`}return n.startedAt!==null?`started ${Tn(n.startedAt,a)}`:n.completedAt!==null?`completed ${Tn(n.completedAt,a)}`:n.durationMs!==null?`duration ${Ro(n.durationMs)}`:"timing not reported"}function Yt(n){return n.replaceAll("_"," ")}function Eo(n){return n===null?"":` · score ${n.toFixed(1)}`}function $x(n){const{coverage:a}=n;if(a.status==="not_evaluated")return"coverage not evaluated";const i=a.policy===null?"":` · ${a.policy}`;return`coverage ${a.status} ${String(a.selected)}/${String(a.required)}${i}`}function Hx(n){const a=n.cache.write==="not_attempted"?"":` · write ${Yt(n.cache.write)}`;return`cache ${Yt(n.cache.lookup)}${a}`}function Gx(n){return`curator ${Yt(n.curator.status)}${Eo(n.curator.score)} · finalizer ${Yt(n.finalizer.status)}${Eo(n.finalizer.score)}`}function Bx(n){return n.fallback.status==="not_applicable"||n.fallback.status==="not_used"?null:`fallback ${Yt(n.fallback.status)}`}const Vx=["all","orphaned","pending","running","succeeded","partial","failed","cancelled","unsupported"];function Dv(n){return n.lifecycle===null?"unsupported":n.orphaned||n.liveness==="orphaned"?"orphaned":n.lifecycle.status}function Ng(n,a){return a==="all"||Dv(n)===a}function sf(n,a="workflow_preflight",i="workflow preflight",r=Date.now()){return{contextRunId:i,operationKindLabel:Lv[a],statusLabel:n.status,statusState:n.status,phaseLabel:Yt(n.phase),coverageLabel:$x(n),coverageState:n.coverage.status,cacheLabel:Hx(n),isCacheHit:n.cache.lookup==="hit",delegateLabel:Gx(n),fallbackLabel:Bx(n),updatedAt:n.updatedAt??"not reported",timingLabel:qx(n,r),updatedAgeLabel:n.updatedAt===null?"not reported":Tn(n.updatedAt,r),legacyUnsupported:!1,compatibilityLabel:"current",artifactRunId:n.artifactRunId}}function lf(n,a){const i=Dv(n);return n.lifecycle===null?{contextRunId:n.id,operationKindLabel:Lv[n.operationKind],statusLabel:"unsupported",statusState:i,phaseLabel:"lifecycle unavailable",coverageLabel:"coverage unavailable",coverageState:"not_available",cacheLabel:"cache unavailable",isCacheHit:!1,delegateLabel:"lifecycle unavailable",fallbackLabel:null,updatedAt:"not reported",timingLabel:"timing not reported",updatedAgeLabel:"not reported",legacyUnsupported:!0,compatibilityLabel:Yt(n.compatibility),artifactRunId:null}:{...sf(n.lifecycle,n.operationKind,n.id,a),statusLabel:i,statusState:i,compatibilityLabel:Yt(n.compatibility)}}function Zx(n,a=Date.now()){const i=lf(n,a),r=[{label:"route identity",value:n.id},{label:"identity domain",value:Yt(n.source)},{label:"operation",value:i.operationKindLabel},{label:"compatibility",value:i.compatibilityLabel}],u=n.lifecycle;return u===null?{...i,identityFacts:r,lifecycleFacts:[],delegateFacts:[],cacheFacts:[],coverageFacts:[],countFacts:[],reasonCodes:[],legacyNotice:"This historical manifest has a forward-incompatible artifact set. No lifecycle was synthesized and no raw manifest content is exposed.",canViewArtifacts:!1}:(r.push({label:"artifact run id",value:u.artifactRunId??"none persisted"}),{...i,identityFacts:r,lifecycleFacts:[{label:"status",value:i.statusLabel},...i.statusState==="orphaned"?[{label:"persisted status",value:u.status}]:[],{label:"liveness",value:n.liveness},{label:"phase",value:i.phaseLabel},{label:"created",value:u.createdAt??"not reported"},{label:"updated",value:u.updatedAt??"not reported"},{label:"started",value:u.startedAt??"not started"},{label:"completed",value:u.completedAt??"not completed"},{label:"duration",value:u.durationMs===null?"not reported":`${String(u.durationMs)} ms`}],delegateFacts:[{label:"curator",value:`${Yt(u.curator.status)}${Eo(u.curator.score)}`},{label:"finalizer",value:`${Yt(u.finalizer.status)}${Eo(u.finalizer.score)}`}],cacheFacts:[{label:"lookup",value:Yt(u.cache.lookup)},{label:"write",value:Yt(u.cache.write)}],coverageFacts:[{label:"policy",value:u.coverage.policy??"none"},{label:"coverage",value:u.coverage.status},{label:"required",value:String(u.coverage.required)},{label:"selected",value:String(u.coverage.selected)},{label:"missing",value:String(u.coverage.missing)}],countFacts:[{label:"files seen",value:String(u.counts.filesSeen)},{label:"files considered",value:String(u.counts.filesConsidered)},{label:"files selected",value:String(u.counts.filesSelected)},{label:"files omitted",value:String(u.counts.filesOmitted)},{label:"search results",value:String(u.counts.searchResults)},{label:"bytes read",value:String(u.counts.bytesRead)},{label:"bytes written",value:String(u.counts.bytesWritten)}],reasonCodes:u.reasonCodes.map(Yt),legacyNotice:null,canViewArtifacts:u.artifactRunId!==null})}const Yx=new Set(["resolving","cache_lookup","validating","scanning","searching","selecting"]),Xx=new Set(["writing","materializing","committing"]),_o=new Set(["not_configured","disabled","succeeded","failed","cancelled","skipped"]),Ag=new Set(["running","succeeded","failed","cancelled"]);function Zi(n){return n.status==="pending"?"pending":n.status==="running"?"running":n.status==="cancelled"?"cancelled":n.status==="failed"?"failed":"succeeded"}function Kx(n){return Yx.has(n.phase)?Zi(n):n.phase!=="terminal"||Ag.has(n.curator.status)||Ag.has(n.finalizer.status)||Qx(n)?"succeeded":Zi(n)}function Qx(n){return n.counts.filesSelected>0||n.counts.filesOmitted>0||n.coverage.status!=="not_evaluated"||n.reasonCodes.includes("empty_selection")||n.cache.lookup==="hit"||n.cache.write==="written"||Iv(n)}function Iv(n){return n.counts.bytesWritten>0||n.artifactRunId!==null}function Jx(n){return n.phase==="complete"?"succeeded":n.phase==="terminal"?Iv(n)?Zi(n):"skipped":Xx.has(n.phase)?Zi(n):"pending"}function Rg(n,a){return n.phase!=="terminal"?a:a==="pending"?"skipped":a==="running"?Zi(n):a}function xd(n){return n.replaceAll("_"," ")}function Fx(n){return[{id:"discover",state:Kx(n),score:null},{id:"curator",state:Rg(n,n.curator.status),score:n.curator.score},{id:"finalizer",state:Rg(n,n.finalizer.status),score:n.finalizer.score},{id:"materialize",state:Jx(n),score:null}]}function Sd(n){return n?.replaceAll("_"," ")??"not recorded"}function Hd({configuration:n}){return o.jsxs("dl",{className:"context-preflight__configuration","aria-label":"Preflight configuration",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"profile"}),o.jsx("dd",{children:Sd(n.profile)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"effective mode"}),o.jsx("dd",{children:Sd(n.effectiveMode)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"on delegate failure"}),o.jsx("dd",{children:n.failurePolicy==="fail"?"fail closed":Sd(n.failurePolicy)})]})]})}function Wx(n){if(n.coverage.status==="not_evaluated")return"not evaluated for this profile";const a=n.coverage.missing===0?"":` · ${String(n.coverage.missing)} missing`;return`${n.coverage.status} · ${String(n.coverage.selected)}/${String(n.coverage.required)} obligations${a}`}function Px(n){return n.cache.lookup==="hit"?`${String(n.counts.filesSelected)} files restored`:`${String(n.counts.filesSelected)} selected of ${String(n.counts.filesConsidered)} considered · ${String(n.counts.filesOmitted)} omitted`}function e0(n){if(n.durationMs!==null)return n.durationMs;const a=Date.parse(n.createdAt??n.startedAt??""),i=!["pending","running"].includes(n.status),r=Date.parse((i?n.completedAt:null)??n.updatedAt??"");return!Number.isFinite(a)||!Number.isFinite(r)?null:Math.max(0,r-a)}const Eg=new Set(["cache_disabled","cache_miss"]);function t0({preflight:n}){if(n===null||n.availability==="absent")return o.jsxs("section",{className:"run-detail__snapshot-unavailable","aria-labelledby":"run-preflight-title",role:"status",children:[o.jsx("h3",{id:"run-preflight-title",children:"Context preflight"}),o.jsx("p",{children:"This run reported no context-builder preflight."})]});if(n.availability==="legacy_without_telemetry")return o.jsxs("section",{className:"context-preflight","aria-labelledby":"run-preflight-title",children:[o.jsxs("header",{className:"context-preflight__header",children:[o.jsx("h3",{id:"run-preflight-title",children:"Context preflight"}),o.jsx("span",{className:"run-detail__status","data-state":n.status,children:n.status})]}),o.jsx(Hd,{configuration:n}),o.jsx("p",{className:"context-preflight__telemetry-unavailable",role:"status",children:"Preflight completed, but this legacy run has no lifecycle telemetry."}),o.jsx("p",{className:"context-preflight__note",children:"Safe preflight lifecycle only · no curated content or artifact browsing."})]});if(n.availability!=="current"){const i={bypassed:{label:"bypassed",state:"disabled",message:`Context preflight was bypassed by effective mode ${n.effectiveMode}.`},awaiting_telemetry:{label:"awaiting telemetry",state:"running",message:"Context preflight is awaiting lifecycle telemetry."},telemetry_unavailable:{label:"telemetry unavailable",state:"partial",message:"This run is terminal, but context preflight lifecycle telemetry is unavailable."}}[n.availability];return o.jsxs("section",{className:"context-preflight","aria-labelledby":"run-preflight-title",children:[o.jsxs("header",{className:"context-preflight__header",children:[o.jsx("h3",{id:"run-preflight-title",children:"Context preflight"}),o.jsx("span",{className:"run-detail__status","data-state":i.state,children:i.label})]}),o.jsx(Hd,{configuration:n}),o.jsx("p",{className:"context-preflight__telemetry-unavailable",role:"status",children:i.message}),o.jsx("p",{className:"context-preflight__note",children:"Safe preflight lifecycle only · no curated content or artifact browsing."})]})}const a=sf(n);return o.jsxs("section",{className:"context-preflight","aria-labelledby":"run-preflight-title",children:[o.jsxs("header",{className:"context-preflight__header",children:[o.jsx("h3",{id:"run-preflight-title",children:"Context preflight"}),o.jsx("span",{className:"run-detail__status","data-state":a.statusState,children:a.statusLabel})]}),o.jsx(Uv,{preflight:n,view:a}),o.jsx("p",{className:"context-preflight__note",children:"Safe preflight lifecycle only · no curated content or artifact browsing."})]})}function Uv({preflight:n,view:a}){const i=Fx(n),r=i.filter(p=>_o.has(p.state)).length,u=e0(n),f=i.map(p=>`${p.id}: ${xd(p.state)}${p.score===null?"":`, score ${p.score.toFixed(1)} out of 10`}`).join("; ");return o.jsxs(o.Fragment,{children:[o.jsx(Hd,{configuration:n}),o.jsxs("div",{"aria-label":"Context preflight progress","aria-valuemax":i.length,"aria-valuemin":0,"aria-valuenow":r,"aria-valuetext":`${String(r)} of ${String(i.length)} milestones resolved · ${a.statusLabel}`,"aria-describedby":"context-preflight-milestone-summary",className:"context-preflight__stage-track",role:"progressbar",children:[o.jsx("span",{className:"visually-hidden",id:"context-preflight-milestone-summary",children:f}),o.jsx("div",{className:"context-preflight__stage-list","aria-hidden":"true",children:i.map((p,m)=>{const g=i[m+1],v=g!==void 0&&_o.has(p.state)&&_o.has(g.state),y=g?.state==="running"&&_o.has(p.state);return o.jsxs("div",{className:["context-preflight__stage",v?"context-preflight__stage--resolved-connector":"",y?"context-preflight__stage--live-connector":""].filter(Boolean).join(" "),children:[o.jsx("span",{className:`context-preflight__stage-dot context-preflight__stage-dot--${p.state}`,children:p.state==="failed"?"×":null}),o.jsxs("span",{className:"context-preflight__stage-label",children:[o.jsx("span",{children:p.id}),o.jsxs("span",{children:[xd(p.state),p.score===null?"":` · ${p.score.toFixed(1)}/10`]})]})]},p.id)})})]}),o.jsxs("dl",{className:"context-preflight__facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"selection"}),o.jsx("dd",{children:Px(n)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"coverage"}),o.jsx("dd",{children:Wx(n)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"cache"}),o.jsx("dd",{children:a.cacheLabel})]}),u===null?null:o.jsxs("div",{children:[o.jsx("dt",{children:"wall time"}),o.jsx("dd",{children:Gn(u)})]}),["complete","terminal"].includes(n.phase)?null:o.jsxs("div",{children:[o.jsx("dt",{children:"current phase"}),o.jsx("dd",{children:a.phaseLabel})]}),a.artifactRunId===null?null:o.jsxs("div",{children:[o.jsx("dt",{children:"artifact run"}),o.jsx("dd",{className:"op-mono overflow-safe",children:a.artifactRunId})]}),a.fallbackLabel===null?null:o.jsxs("div",{children:[o.jsx("dt",{children:"fallback"}),o.jsx("dd",{children:a.fallbackLabel})]}),n.reasonCodes.filter(p=>!Eg.has(p)).length===0?null:o.jsxs("div",{className:"context-preflight__fact--wide",children:[o.jsx("dt",{children:"reasons"}),o.jsx("dd",{children:n.reasonCodes.filter(p=>!Eg.has(p)).map(xd).join(" · ")})]})]})]})}function n0(n){return sf(n)}function Ko({activeTabId:n,ariaLabel:a,onChange:i,tabs:r}){const u=j.useId(),f=j.useRef(new Map),p=Math.max(0,r.findIndex(y=>y.id===n)),m=r[p],g=y=>{const b=r[y];b&&(i(b.id),f.current.get(b.id)?.focus())},v=(y,b)=>{if(r.length===0)return;let T=null;y.key==="ArrowRight"?T=(b+1)%r.length:y.key==="ArrowLeft"?T=(b-1+r.length)%r.length:y.key==="Home"?T=0:y.key==="End"&&(T=r.length-1),T!==null&&(y.preventDefault(),g(T))};return o.jsxs("div",{className:"tab-list",children:[o.jsx("div",{"aria-label":a,className:"tab-list__tabs",role:"tablist",children:r.map((y,b)=>{const T=y.id===m?.id;return o.jsx("button",{"aria-controls":`${u}-${y.id}-panel`,"aria-selected":T,className:"tab-list__tab",id:`${u}-${y.id}-tab`,onClick:()=>i(y.id),onKeyDown:N=>v(N,b),ref:N=>{N?f.current.set(y.id,N):f.current.delete(y.id)},role:"tab",tabIndex:T?0:-1,type:"button",children:y.label},y.id)})}),m?o.jsx("div",{"aria-labelledby":`${u}-${m.id}-tab`,className:"tab-list__panel",id:`${u}-${m.id}-panel`,role:"tabpanel",tabIndex:0,children:m.panel}):null]})}const To="X-ClinkX-Agent-Instance-Id",Co="X-ClinkX-Local-Origin-Proof",a0="dashboard-connection-v1",qv="clinkx-dashboard-connection-v1:",s0="clinkx-dashboard-local-origin-proof-v1:",Gd="clinkx-dashboard-auth-expired",jd=["v","apiOrigin","agentInstanceId","token"],Qo=/^[A-Za-z0-9_-]{43}$/,$v=/^[A-Za-z0-9_-]{43}$/,Yi=/^[A-Za-z0-9_-]{22}$/;let xt=null,It=null,Cn=0,pa=!1,Xa="bearer";const Hv=new WeakMap;class qe extends Error{constructor(){super("connection_changed"),this.name="ConnectionChangedError"}}function Hn(){return{mode:"local",apiOrigin:window.location.origin,uiOrigin:window.location.origin,agentInstanceId:null}}const l0=new Set(["127.0.0.1","localhost","[::1]"]);function Fi(n){if(n==null&&typeof window>"u")return!1;try{const a=new URL(n??window.location.origin);return a.protocol==="http:"&&l0.has(a.hostname)}catch{return!1}}function Oo(){return`${s0}${encodeURIComponent(window.location.origin)}`}function rf(){if(!Fi())return null;try{const n=window.sessionStorage.getItem(Oo());if(n===null)return null;if($v.test(n))return n;window.sessionStorage.removeItem(Oo())}catch{}return null}function i0(n){if(!Fi()||!$v.test(n))throw new Error("invalid local dashboard origin proof");window.sessionStorage.setItem(Oo(),n)}function Bn(){try{window.sessionStorage.removeItem(Oo())}catch{}}function Gv(n){return`${qv}${encodeURIComponent(n)}`}function of(n){try{const a=new URL(n);return a.protocol==="https:"&&a.username===""&&a.password===""&&a.pathname==="/"&&a.search===""&&a.hash===""&&a.origin===n}catch{return!1}}function r0(n){if(typeof n!="object"||n===null||Array.isArray(n))return!1;const a=n;return Object.keys(a).sort().join("\0")!==["agentInstanceId","apiOrigin","mode","uiOrigin"].sort().join("\0")||a.uiOrigin!==window.location.origin?!1:a.mode==="local"?a.apiOrigin===window.location.origin&&(a.agentInstanceId===null||typeof a.agentInstanceId=="string"&&Yi.test(a.agentInstanceId)):a.mode==="remote"&&typeof a.apiOrigin=="string"&&of(a.apiOrigin)&&typeof a.agentInstanceId=="string"&&Yi.test(a.agentInstanceId)}function o0(n,a){try{const i=JSON.parse(n);if(typeof i!="object"||i===null||Array.isArray(i))return null;const r=i;if(Object.keys(r).sort().join("\0")!==["bearer","connection","schemaVersion"].sort().join("\0")||r.schemaVersion!=="dashboard-browser-authority-v1"||!r0(r.connection)||typeof r.bearer!="object"||r.bearer===null||Array.isArray(r.bearer))return null;const u=r.bearer;return Object.keys(u).join("\0")!=="token"||typeof u.token!="string"||!Qo.test(u.token)||Gv(r.connection.apiOrigin)!==a?null:i}catch{return null}}function Bv(){const n=[];try{for(let a=0;a<window.sessionStorage.length;a+=1){const i=window.sessionStorage.key(a);i?.startsWith(qv)&&n.push(i)}}catch{return[]}return n}function ts(){try{for(const n of Bv())window.sessionStorage.removeItem(n)}catch{}}function Vv(){if(xt===null||It===null)return;const n={schemaVersion:"dashboard-browser-authority-v1",connection:xt,bearer:It};try{ts(),window.sessionStorage.setItem(Gv(xt.apiOrigin),JSON.stringify(n))}catch{}}function c0(){const n=[];try{for(const i of Bv()){const r=window.sessionStorage.getItem(i),u=r===null?null:o0(r,i);u===null?window.sessionStorage.removeItem(i):n.push(u)}}catch{return!1}if(n.length!==1)return n.length>1&&ts(),!1;const a=n[0];return a===void 0?!1:(xt=a.connection,It=a.bearer,Cn+=1,pa=!1,!0)}function Bd(n,a){ts(),xt=n,It={token:a},Cn+=1,pa=!1,Vv()}function u0(){window.history.replaceState(window.history.state,"",window.location.pathname+window.location.search)}function d0(n){const a=n.split("&");if(a.length!==jd.length)return null;const i=[];for(let g=0;g<jd.length;g+=1){const v=a[g],y=jd[g];if(v===void 0||y===void 0)return null;const b=v.indexOf("=");if(b<=0||v.indexOf("=",b+1)!==-1||v.slice(0,b)!==y)return null;i.push(v.slice(b+1))}const[r,u,f,p]=i;if(r!=="1"||u===void 0||f===void 0||p===void 0||!Yi.test(f)||!Qo.test(p))return null;let m;try{m=decodeURIComponent(u)}catch{return null}return encodeURIComponent(m)!==u||!of(m)?null:{apiOrigin:m,agentInstanceId:f,token:p}}function f0(n){if(!n.startsWith("token="))return null;const a=n.slice(6);return Qo.test(a)?a:null}function Cs(){return{...xt??Hn(),authenticated:It!==null,revision:Cn,rebootstrapRequired:pa}}function Zv(){const n=window.location.hash;if(n!==""){const a=n.startsWith("#")?n.slice(1):n;u0();const i=d0(a);if(i!==null)return of(window.location.origin)?(Bd({mode:"remote",apiOrigin:i.apiOrigin,uiOrigin:window.location.origin,agentInstanceId:i.agentInstanceId},i.token),Cs()):(ts(),xt=Hn(),It=null,Cn+=1,pa=!0,Cs());const r=f0(a);return r!==null?(Bd(Hn(),r),Cs()):(ts(),xt=Hn(),It=null,Cn+=1,pa=!0,Cs())}return(xt===null||It===null)&&c0(),xt===null&&(xt=Hn()),Cs()}function h0(){return xt===null&&(xt=Hn()),Cs()}function p0(n){const a=n.trim();return Qo.test(a)?(Bd(Hn(),a),!0):!1}function m0(){return It!==null}function Vd(){It!==null&&(It=null,Cn+=1,ts())}function cf(n){Xa=n,n==="passkey"?(It=null,ts(),xt=Hn(),pa=!1,Cn+=1):Bn()}function Bi(){throw Bn(),It=null,Cn+=1,pa=!0,ts(),new qe}function Yv(n){if(pa||n.revision!==Cn)throw new qe}function Xv(n,a){Yv(a);const i=n.headers.get(To);if(a.agentInstanceId===null){a.requireAgentInstanceHeader&&(i===null||!Yi.test(i))&&Bi();return}i!==a.agentInstanceId&&Bi()}function Ja(n){const a=Hv.get(n);a!==void 0&&Xv(n,a)}async function nn(n){Ja(n);const a=await n.json();return Ja(n),a}async function uf(n){Ja(n);const a=await n.text();return Ja(n),a}const g0=/^\/api\/progress-reports\/[A-Za-z0-9][A-Za-z0-9_-]{0,63}\/status-override$/;function v0(n,a){let i;try{i=new URL(n,a)}catch{throw new Error("apiFetch only permits normalized /api/* paths")}if(!n.startsWith("/api/")||i.origin!==a||i.hash!==""||i.pathname+i.search!==n||!i.pathname.startsWith("/api/"))throw new Error("apiFetch only permits normalized /api/* paths");return i}async function Kv(n,a){if(xt===null&&Zv(),pa)throw new qe;const i=xt??Hn(),r=v0(n,i.apiOrigin),u={revision:Cn,agentInstanceId:Xa==="passkey"?null:i.agentInstanceId,requireAgentInstanceHeader:Xa==="bearer"&&n==="/api/connection"},f=new Headers(a.headers);Xa==="passkey"||It===null?f.delete("Authorization"):f.set("Authorization",`Bearer ${It.token}`),Xa==="bearer"&&i.mode==="remote"&&i.agentInstanceId!==null?f.set(To,i.agentInstanceId):f.delete(To);const p=Xa==="passkey"?rf():null;p===null?f.delete(Co):f.set(Co,p);let m;try{m=await fetch(r.href,{...a,method:a.method,headers:f,credentials:Xa==="passkey"?"same-origin":"omit",redirect:"error",referrerPolicy:"no-referrer"})}catch(g){throw Yv(u),g}return Hv.set(m,u),Xv(m,u),m.status===401&&(Xa==="passkey"?(Bn(),window.dispatchEvent(new CustomEvent(Gd))):Vd()),m}async function _a(n,a){const i=(a?.method??"GET").toUpperCase();if(i!=="GET"&&i!=="HEAD")throw new Error("apiFetch only permits GET and HEAD requests");return Kv(n,{...a,method:i})}async function _0(n,a){if(!g0.test(n))throw new Error("apiMutate only permits the progress-report status-override path");return Kv(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}function y0(n){if(typeof n!="object"||n===null||Array.isArray(n))return null;const a=n;return Object.keys(a).sort().join("\0")!==["agentInstanceId","schemaVersion"].sort().join("\0")?null:a.schemaVersion===a0&&typeof a.agentInstanceId=="string"&&Yi.test(a.agentInstanceId)?a:null}async function Qv(){const n=await _a("/api/connection");if(n.status===401)throw new Error("dashboard authorization expired");if(!n.ok)return Bi();const a=y0(await nn(n)),i=n.headers.get(To);if(a===null||i!==a.agentInstanceId)return Bi();const r=xt??Hn();return r.agentInstanceId!==null&&r.agentInstanceId!==a.agentInstanceId?Bi():(r.agentInstanceId===null&&(xt={...r,agentInstanceId:a.agentInstanceId},Cn+=1,Vv()),Cs())}const b0=new Set(["unauthorized","not_found","run_generation_changed","run_state_changed","agent_instance_changed","content_too_large_for_dashboard"]),x0={input:"prompt",output:"output",error:"error",artifact:"artifact"};class En extends Error{constructor(a,i,r){super(a),this.kind=a,this.status=i,this.code=r,this.name="InspectorApiError"}}function S0(n){return n??new AbortController().signal}async function j0(n){try{const a=await nn(n);return typeof a.error?.code=="string"&&b0.has(a.error.code)?a.error.code:void 0}catch(a){if(a instanceof qe)throw new En("connection_changed",409,"agent_instance_changed");return}}function w0(n=_a){return{async readPane(a,i){const r=S0(i),u=encodeURIComponent(a.runId),f=encodeURIComponent(a.stageId),p=encodeURIComponent(a.callId),m=encodeURIComponent(a.runGeneration),g=`/api/runs/${u}/stages/${f}/calls/${p}/${x0[a.kind]}?generation=${m}`;let v;try{v=await n(g,{signal:r})}catch(b){throw b instanceof qe?new En("connection_changed",409,"agent_instance_changed"):r.aborted||b instanceof DOMException&&b.name==="AbortError"?new En("aborted"):new En("offline")}if(v.status===401)throw new En("auth_expired",401,"unauthorized");if(!v.ok){const b=await j0(v);throw b==="agent_instance_changed"?new En("connection_changed",v.status,b):new En("request_error",v.status,b)}let y;try{y=await uf(v)}catch(b){throw b instanceof qe?new En("connection_changed",409,"agent_instance_changed"):b}return{content:y,etag:v.headers.get("ETag"),mediaType:v.headers.get("Content-Type")??"text/plain; charset=utf-8"}}}}const N0={input:"workflow input (pre-dispatch)",output:"final persisted output",error:"raw persisted error",artifact:"validated artifact"};function A0(n){return[["input",n.hasWorkflowInput],["output",n.hasOutput],["error",n.hasRawError],["artifact",n.hasArtifactReference]].filter(a=>a[1]).map(([a])=>({kind:a,label:N0[a]}))}function R0(n){return(n.state==="failed"||n.state==="cancelled")&&n.hasRawError&&!n.hasWorkflowInput&&!n.hasOutput&&!n.hasArtifactReference?`This ${n.state} call has only a raw persisted error; no workflow input, final output, or validated artifact is available.`:null}function E0(n){switch(n){case"content_too_large_for_dashboard":return"Content exceeds the dashboard cap.";case"not_found":return"Persisted content is missing or was pruned.";case"run_state_changed":case"obsolete_etag":return"Persisted state changed while this pane was loading. Retry this pane.";case"auth_expired":return"Dashboard authorization expired.";case"connection_changed":return"Dashboard connection changed; rebootstrap is required.";case"offline":return"Dashboard is offline. Retry this pane when the server is reachable.";case"request_error":return"Persisted content could not be loaded. Retry this pane."}}const T0={maxDepth:12,maxNodes:1e3};function C0(n,a){let i=Math.max(1,a.maxNodes),r=!1;const u=(f,p)=>{if(i<=0)return r=!0,"[node limit]";if(i-=1,f===null||typeof f!="object")return f;if(p>=Math.max(1,a.maxDepth))return r=!0,"[depth limit]";if(Array.isArray(f)){const g=[];for(let v=0;v<f.length;v+=1){if(i<=0){r=!0,g.push("[node limit]");break}g.push(u(f[v],p+1))}return g}const m={};for(const g in f)if(Object.prototype.hasOwnProperty.call(f,g)){if(i<=0){r=!0,m["[truncated]"]="[node limit]";break}m[g]=u(f[g],p+1)}return m};return{value:u(n,0),truncated:r}}function O0(n,a=T0){let i;try{i=JSON.parse(n)}catch{return{kind:"text",rendered:n,truncated:!1}}const r=C0(i,a);return{kind:"json",rendered:JSON.stringify(r.value,null,2),truncated:r.truncated}}function k0(n,a){return n.runId===a.runId&&n.runGeneration===a.runGeneration&&n.stateRevision===a.stateRevision}function kl(){let n=0,a=null;return{begin(i){a?.controller.abort();const r=new AbortController,u={...i,requestId:++n};return a={identity:u,controller:r},{identity:u,signal:r.signal}},isActive(i){return a!==null&&a.identity.requestId===i.requestId&&!a.controller.signal.aborted},accepts(i,r){return a!==null&&a.identity.requestId===i.requestId&&!a.controller.signal.aborted&&k0(i,r)},acceptsDetail(i,r){return a!==null&&a.identity.requestId===i.requestId&&!a.controller.signal.aborted&&i.runId===r.runId&&i.runGeneration===r.runGeneration},acceptsEtag(i,r){return a!==null&&a.identity.requestId===i.requestId&&!a.controller.signal.aborted&&r===`"${i.stateRevision}"`},cancel(){a?.controller.abort(),a=null}}}var ze;(function(n){n.assertEqual=u=>{};function a(u){}n.assertIs=a;function i(u){throw new Error}n.assertNever=i,n.arrayToEnum=u=>{const f={};for(const p of u)f[p]=p;return f},n.getValidEnumValues=u=>{const f=n.objectKeys(u).filter(m=>typeof u[u[m]]!="number"),p={};for(const m of f)p[m]=u[m];return n.objectValues(p)},n.objectValues=u=>n.objectKeys(u).map(function(f){return u[f]}),n.objectKeys=typeof Object.keys=="function"?u=>Object.keys(u):u=>{const f=[];for(const p in u)Object.prototype.hasOwnProperty.call(u,p)&&f.push(p);return f},n.find=(u,f)=>{for(const p of u)if(f(p))return p},n.isInteger=typeof Number.isInteger=="function"?u=>Number.isInteger(u):u=>typeof u=="number"&&Number.isFinite(u)&&Math.floor(u)===u;function r(u,f=" | "){return u.map(p=>typeof p=="string"?`'${p}'`:p).join(f)}n.joinValues=r,n.jsonStringifyReplacer=(u,f)=>typeof f=="bigint"?f.toString():f})(ze||(ze={}));var Tg;(function(n){n.mergeShapes=(a,i)=>({...a,...i})})(Tg||(Tg={}));const ie=ze.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Qa=n=>{switch(typeof n){case"undefined":return ie.undefined;case"string":return ie.string;case"number":return Number.isNaN(n)?ie.nan:ie.number;case"boolean":return ie.boolean;case"function":return ie.function;case"bigint":return ie.bigint;case"symbol":return ie.symbol;case"object":return Array.isArray(n)?ie.array:n===null?ie.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?ie.promise:typeof Map<"u"&&n instanceof Map?ie.map:typeof Set<"u"&&n instanceof Set?ie.set:typeof Date<"u"&&n instanceof Date?ie.date:ie.object;default:return ie.unknown}},Z=ze.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ma extends Error{get errors(){return this.issues}constructor(a){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=a}format(a){const i=a||function(f){return f.message},r={_errors:[]},u=f=>{for(const p of f.issues)if(p.code==="invalid_union")p.unionErrors.map(u);else if(p.code==="invalid_return_type")u(p.returnTypeError);else if(p.code==="invalid_arguments")u(p.argumentsError);else if(p.path.length===0)r._errors.push(i(p));else{let m=r,g=0;for(;g<p.path.length;){const v=p.path[g];g===p.path.length-1?(m[v]=m[v]||{_errors:[]},m[v]._errors.push(i(p))):m[v]=m[v]||{_errors:[]},m=m[v],g++}}};return u(this),r}static assert(a){if(!(a instanceof ma))throw new Error(`Not a ZodError: ${a}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ze.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(a=i=>i.message){const i={},r=[];for(const u of this.issues)if(u.path.length>0){const f=u.path[0];i[f]=i[f]||[],i[f].push(a(u))}else r.push(a(u));return{formErrors:r,fieldErrors:i}}get formErrors(){return this.flatten()}}ma.create=n=>new ma(n);const Zd=(n,a)=>{let i;switch(n.code){case Z.invalid_type:n.received===ie.undefined?i="Required":i=`Expected ${n.expected}, received ${n.received}`;break;case Z.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(n.expected,ze.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:i=`Unrecognized key(s) in object: ${ze.joinValues(n.keys,", ")}`;break;case Z.invalid_union:i="Invalid input";break;case Z.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${ze.joinValues(n.options)}`;break;case Z.invalid_enum_value:i=`Invalid enum value. Expected ${ze.joinValues(n.options)}, received '${n.received}'`;break;case Z.invalid_arguments:i="Invalid function arguments";break;case Z.invalid_return_type:i="Invalid function return type";break;case Z.invalid_date:i="Invalid date";break;case Z.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(i=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(i=`${i} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?i=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?i=`Invalid input: must end with "${n.validation.endsWith}"`:ze.assertNever(n.validation):n.validation!=="regex"?i=`Invalid ${n.validation}`:i="Invalid";break;case Z.too_small:n.type==="array"?i=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?i=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?i=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?i=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?i=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:i="Invalid input";break;case Z.too_big:n.type==="array"?i=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?i=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?i=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?i=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?i=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:i="Invalid input";break;case Z.custom:i="Invalid input";break;case Z.invalid_intersection_types:i="Intersection results could not be merged";break;case Z.not_multiple_of:i=`Number must be a multiple of ${n.multipleOf}`;break;case Z.not_finite:i="Number must be finite";break;default:i=a.defaultError,ze.assertNever(n)}return{message:i}};let M0=Zd;function z0(){return M0}const L0=n=>{const{data:a,path:i,errorMaps:r,issueData:u}=n,f=[...i,...u.path||[]],p={...u,path:f};if(u.message!==void 0)return{...u,path:f,message:u.message};let m="";const g=r.filter(v=>!!v).slice().reverse();for(const v of g)m=v(p,{data:a,defaultError:m}).message;return{...u,path:f,message:m}};function ne(n,a){const i=z0(),r=L0({issueData:a,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,i,i===Zd?void 0:Zd].filter(u=>!!u)});n.common.issues.push(r)}class an{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(a,i){const r=[];for(const u of i){if(u.status==="aborted")return be;u.status==="dirty"&&a.dirty(),r.push(u.value)}return{status:a.value,value:r}}static async mergeObjectAsync(a,i){const r=[];for(const u of i){const f=await u.key,p=await u.value;r.push({key:f,value:p})}return an.mergeObjectSync(a,r)}static mergeObjectSync(a,i){const r={};for(const u of i){const{key:f,value:p}=u;if(f.status==="aborted"||p.status==="aborted")return be;f.status==="dirty"&&a.dirty(),p.status==="dirty"&&a.dirty(),f.value!=="__proto__"&&(typeof p.value<"u"||u.alwaysSet)&&(r[f.value]=p.value)}return{status:a.value,value:r}}}const be=Object.freeze({status:"aborted"}),Hi=n=>({status:"dirty",value:n}),yn=n=>({status:"valid",value:n}),Cg=n=>n.status==="aborted",Og=n=>n.status==="dirty",zl=n=>n.status==="valid",ko=n=>typeof Promise<"u"&&n instanceof Promise;var ce;(function(n){n.errToObj=a=>typeof a=="string"?{message:a}:a||{},n.toString=a=>typeof a=="string"?a:a?.message})(ce||(ce={}));class ns{constructor(a,i,r,u){this._cachedPath=[],this.parent=a,this.data=i,this._path=r,this._key=u}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const kg=(n,a)=>{if(zl(a))return{success:!0,data:a.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const i=new ma(n.common.issues);return this._error=i,this._error}}};function Ae(n){if(!n)return{};const{errorMap:a,invalid_type_error:i,required_error:r,description:u}=n;if(a&&(i||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return a?{errorMap:a,description:u}:{errorMap:(p,m)=>{const{message:g}=n;return p.code==="invalid_enum_value"?{message:g??m.defaultError}:typeof m.data>"u"?{message:g??r??m.defaultError}:p.code!=="invalid_type"?{message:m.defaultError}:{message:g??i??m.defaultError}},description:u}}class Me{get description(){return this._def.description}_getType(a){return Qa(a.data)}_getOrReturnCtx(a,i){return i||{common:a.parent.common,data:a.data,parsedType:Qa(a.data),schemaErrorMap:this._def.errorMap,path:a.path,parent:a.parent}}_processInputParams(a){return{status:new an,ctx:{common:a.parent.common,data:a.data,parsedType:Qa(a.data),schemaErrorMap:this._def.errorMap,path:a.path,parent:a.parent}}}_parseSync(a){const i=this._parse(a);if(ko(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(a){const i=this._parse(a);return Promise.resolve(i)}parse(a,i){const r=this.safeParse(a,i);if(r.success)return r.data;throw r.error}safeParse(a,i){const r={common:{issues:[],async:i?.async??!1,contextualErrorMap:i?.errorMap},path:i?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:a,parsedType:Qa(a)},u=this._parseSync({data:a,path:r.path,parent:r});return kg(r,u)}"~validate"(a){const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:a,parsedType:Qa(a)};if(!this["~standard"].async)try{const r=this._parseSync({data:a,path:[],parent:i});return zl(r)?{value:r.value}:{issues:i.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:a,path:[],parent:i}).then(r=>zl(r)?{value:r.value}:{issues:i.common.issues})}async parseAsync(a,i){const r=await this.safeParseAsync(a,i);if(r.success)return r.data;throw r.error}async safeParseAsync(a,i){const r={common:{issues:[],contextualErrorMap:i?.errorMap,async:!0},path:i?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:a,parsedType:Qa(a)},u=this._parse({data:a,path:r.path,parent:r}),f=await(ko(u)?u:Promise.resolve(u));return kg(r,f)}refine(a,i){const r=u=>typeof i=="string"||typeof i>"u"?{message:i}:typeof i=="function"?i(u):i;return this._refinement((u,f)=>{const p=a(u),m=()=>f.addIssue({code:Z.custom,...r(u)});return typeof Promise<"u"&&p instanceof Promise?p.then(g=>g?!0:(m(),!1)):p?!0:(m(),!1)})}refinement(a,i){return this._refinement((r,u)=>a(r)?!0:(u.addIssue(typeof i=="function"?i(r,u):i),!1))}_refinement(a){return new Us({schema:this,typeName:xe.ZodEffects,effect:{type:"refinement",refinement:a}})}superRefine(a){return this._refinement(a)}constructor(a){this.spa=this.safeParseAsync,this._def=a,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:i=>this["~validate"](i)}}optional(){return ha.create(this,this._def)}nullable(){return qs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Vn.create(this)}promise(){return Io.create(this,this._def)}or(a){return zo.create([this,a],this._def)}and(a){return Lo.create(this,a,this._def)}transform(a){return new Us({...Ae(this._def),schema:this,typeName:xe.ZodEffects,effect:{type:"transform",transform:a}})}default(a){const i=typeof a=="function"?a:()=>a;return new Uo({...Ae(this._def),innerType:this,defaultValue:i,typeName:xe.ZodDefault})}brand(){return new Pv({typeName:xe.ZodBranded,type:this,...Ae(this._def)})}catch(a){const i=typeof a=="function"?a:()=>a;return new qo({...Ae(this._def),innerType:this,catchValue:i,typeName:xe.ZodCatch})}describe(a){const i=this.constructor;return new i({...this._def,description:a})}pipe(a){return ff.create(this,a)}readonly(){return $o.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const D0=/^c[^\s-]{8,}$/i,I0=/^[0-9a-z]+$/,U0=/^[0-9A-HJKMNP-TV-Z]{26}$/i,q0=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,$0=/^[a-z0-9_-]{21}$/i,H0=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,G0=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,B0=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,V0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let wd;const Z0=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Y0=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,X0=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,K0=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Q0=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,J0=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Jv="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",F0=new RegExp(`^${Jv}$`);function Fv(n){let a="[0-5]\\d";n.precision?a=`${a}\\.\\d{${n.precision}}`:n.precision==null&&(a=`${a}(\\.\\d+)?`);const i=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${a})${i}`}function W0(n){return new RegExp(`^${Fv(n)}$`)}function P0(n){let a=`${Jv}T${Fv(n)}`;const i=[];return i.push(n.local?"Z?":"Z"),n.offset&&i.push("([+-]\\d{2}:?\\d{2})"),a=`${a}(${i.join("|")})`,new RegExp(`^${a}$`)}function eS(n,a){return!!((a==="v4"||!a)&&Z0.test(n)||(a==="v6"||!a)&&X0.test(n))}function tS(n,a){if(!H0.test(n))return!1;try{const[i]=n.split(".");if(!i)return!1;const r=i.replace(/-/g,"+").replace(/_/g,"/").padEnd(i.length+(4-i.length%4)%4,"="),u=JSON.parse(atob(r));return!(typeof u!="object"||u===null||"typ"in u&&u?.typ!=="JWT"||!u.alg||a&&u.alg!==a)}catch{return!1}}function nS(n,a){return!!((a==="v4"||!a)&&Y0.test(n)||(a==="v6"||!a)&&K0.test(n))}class Fa extends Me{_parse(a){if(this._def.coerce&&(a.data=String(a.data)),this._getType(a)!==ie.string){const f=this._getOrReturnCtx(a);return ne(f,{code:Z.invalid_type,expected:ie.string,received:f.parsedType}),be}const r=new an;let u;for(const f of this._def.checks)if(f.kind==="min")a.data.length<f.value&&(u=this._getOrReturnCtx(a,u),ne(u,{code:Z.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),r.dirty());else if(f.kind==="max")a.data.length>f.value&&(u=this._getOrReturnCtx(a,u),ne(u,{code:Z.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),r.dirty());else if(f.kind==="length"){const p=a.data.length>f.value,m=a.data.length<f.value;(p||m)&&(u=this._getOrReturnCtx(a,u),p?ne(u,{code:Z.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}):m&&ne(u,{code:Z.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}),r.dirty())}else if(f.kind==="email")B0.test(a.data)||(u=this._getOrReturnCtx(a,u),ne(u,{validation:"email",code:Z.invalid_string,message:f.message}),r.dirty());else if(f.kind==="emoji")wd||(wd=new RegExp(V0,"u")),wd.test(a.data)||(u=this._getOrReturnCtx(a,u),ne(u,{validation:"emoji",code:Z.invalid_string,message:f.message}),r.dirty());else if(f.kind==="uuid")q0.test(a.data)||(u=this._getOrReturnCtx(a,u),ne(u,{validation:"uuid",code:Z.invalid_string,message:f.message}),r.dirty());else if(f.kind==="nanoid")$0.test(a.data)||(u=this._getOrReturnCtx(a,u),ne(u,{validation:"nanoid",code:Z.invalid_string,message:f.message}),r.dirty());else if(f.kind==="cuid")D0.test(a.data)||(u=this._getOrReturnCtx(a,u),ne(u,{validation:"cuid",code:Z.invalid_string,message:f.message}),r.dirty());else if(f.kind==="cuid2")I0.test(a.data)||(u=this._getOrReturnCtx(a,u),ne(u,{validation:"cuid2",code:Z.invalid_string,message:f.message}),r.dirty());else if(f.kind==="ulid")U0.test(a.data)||(u=this._getOrReturnCtx(a,u),ne(u,{validation:"ulid",code:Z.invalid_string,message:f.message}),r.dirty());else if(f.kind==="url")try{new URL(a.data)}catch{u=this._getOrReturnCtx(a,u),ne(u,{validation:"url",code:Z.invalid_string,message:f.message}),r.dirty()}else f.kind==="regex"?(f.regex.lastIndex=0,f.regex.test(a.data)||(u=this._getOrReturnCtx(a,u),ne(u,{validation:"regex",code:Z.invalid_string,message:f.message}),r.dirty())):f.kind==="trim"?a.data=a.data.trim():f.kind==="includes"?a.data.includes(f.value,f.position)||(u=this._getOrReturnCtx(a,u),ne(u,{code:Z.invalid_string,validation:{includes:f.value,position:f.position},message:f.message}),r.dirty()):f.kind==="toLowerCase"?a.data=a.data.toLowerCase():f.kind==="toUpperCase"?a.data=a.data.toUpperCase():f.kind==="startsWith"?a.data.startsWith(f.value)||(u=this._getOrReturnCtx(a,u),ne(u,{code:Z.invalid_string,validation:{startsWith:f.value},message:f.message}),r.dirty()):f.kind==="endsWith"?a.data.endsWith(f.value)||(u=this._getOrReturnCtx(a,u),ne(u,{code:Z.invalid_string,validation:{endsWith:f.value},message:f.message}),r.dirty()):f.kind==="datetime"?P0(f).test(a.data)||(u=this._getOrReturnCtx(a,u),ne(u,{code:Z.invalid_string,validation:"datetime",message:f.message}),r.dirty()):f.kind==="date"?F0.test(a.data)||(u=this._getOrReturnCtx(a,u),ne(u,{code:Z.invalid_string,validation:"date",message:f.message}),r.dirty()):f.kind==="time"?W0(f).test(a.data)||(u=this._getOrReturnCtx(a,u),ne(u,{code:Z.invalid_string,validation:"time",message:f.message}),r.dirty()):f.kind==="duration"?G0.test(a.data)||(u=this._getOrReturnCtx(a,u),ne(u,{validation:"duration",code:Z.invalid_string,message:f.message}),r.dirty()):f.kind==="ip"?eS(a.data,f.version)||(u=this._getOrReturnCtx(a,u),ne(u,{validation:"ip",code:Z.invalid_string,message:f.message}),r.dirty()):f.kind==="jwt"?tS(a.data,f.alg)||(u=this._getOrReturnCtx(a,u),ne(u,{validation:"jwt",code:Z.invalid_string,message:f.message}),r.dirty()):f.kind==="cidr"?nS(a.data,f.version)||(u=this._getOrReturnCtx(a,u),ne(u,{validation:"cidr",code:Z.invalid_string,message:f.message}),r.dirty()):f.kind==="base64"?Q0.test(a.data)||(u=this._getOrReturnCtx(a,u),ne(u,{validation:"base64",code:Z.invalid_string,message:f.message}),r.dirty()):f.kind==="base64url"?J0.test(a.data)||(u=this._getOrReturnCtx(a,u),ne(u,{validation:"base64url",code:Z.invalid_string,message:f.message}),r.dirty()):ze.assertNever(f);return{status:r.value,value:a.data}}_regex(a,i,r){return this.refinement(u=>a.test(u),{validation:i,code:Z.invalid_string,...ce.errToObj(r)})}_addCheck(a){return new Fa({...this._def,checks:[...this._def.checks,a]})}email(a){return this._addCheck({kind:"email",...ce.errToObj(a)})}url(a){return this._addCheck({kind:"url",...ce.errToObj(a)})}emoji(a){return this._addCheck({kind:"emoji",...ce.errToObj(a)})}uuid(a){return this._addCheck({kind:"uuid",...ce.errToObj(a)})}nanoid(a){return this._addCheck({kind:"nanoid",...ce.errToObj(a)})}cuid(a){return this._addCheck({kind:"cuid",...ce.errToObj(a)})}cuid2(a){return this._addCheck({kind:"cuid2",...ce.errToObj(a)})}ulid(a){return this._addCheck({kind:"ulid",...ce.errToObj(a)})}base64(a){return this._addCheck({kind:"base64",...ce.errToObj(a)})}base64url(a){return this._addCheck({kind:"base64url",...ce.errToObj(a)})}jwt(a){return this._addCheck({kind:"jwt",...ce.errToObj(a)})}ip(a){return this._addCheck({kind:"ip",...ce.errToObj(a)})}cidr(a){return this._addCheck({kind:"cidr",...ce.errToObj(a)})}datetime(a){return typeof a=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:a}):this._addCheck({kind:"datetime",precision:typeof a?.precision>"u"?null:a?.precision,offset:a?.offset??!1,local:a?.local??!1,...ce.errToObj(a?.message)})}date(a){return this._addCheck({kind:"date",message:a})}time(a){return typeof a=="string"?this._addCheck({kind:"time",precision:null,message:a}):this._addCheck({kind:"time",precision:typeof a?.precision>"u"?null:a?.precision,...ce.errToObj(a?.message)})}duration(a){return this._addCheck({kind:"duration",...ce.errToObj(a)})}regex(a,i){return this._addCheck({kind:"regex",regex:a,...ce.errToObj(i)})}includes(a,i){return this._addCheck({kind:"includes",value:a,position:i?.position,...ce.errToObj(i?.message)})}startsWith(a,i){return this._addCheck({kind:"startsWith",value:a,...ce.errToObj(i)})}endsWith(a,i){return this._addCheck({kind:"endsWith",value:a,...ce.errToObj(i)})}min(a,i){return this._addCheck({kind:"min",value:a,...ce.errToObj(i)})}max(a,i){return this._addCheck({kind:"max",value:a,...ce.errToObj(i)})}length(a,i){return this._addCheck({kind:"length",value:a,...ce.errToObj(i)})}nonempty(a){return this.min(1,ce.errToObj(a))}trim(){return new Fa({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Fa({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Fa({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(a=>a.kind==="datetime")}get isDate(){return!!this._def.checks.find(a=>a.kind==="date")}get isTime(){return!!this._def.checks.find(a=>a.kind==="time")}get isDuration(){return!!this._def.checks.find(a=>a.kind==="duration")}get isEmail(){return!!this._def.checks.find(a=>a.kind==="email")}get isURL(){return!!this._def.checks.find(a=>a.kind==="url")}get isEmoji(){return!!this._def.checks.find(a=>a.kind==="emoji")}get isUUID(){return!!this._def.checks.find(a=>a.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(a=>a.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(a=>a.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(a=>a.kind==="cuid2")}get isULID(){return!!this._def.checks.find(a=>a.kind==="ulid")}get isIP(){return!!this._def.checks.find(a=>a.kind==="ip")}get isCIDR(){return!!this._def.checks.find(a=>a.kind==="cidr")}get isBase64(){return!!this._def.checks.find(a=>a.kind==="base64")}get isBase64url(){return!!this._def.checks.find(a=>a.kind==="base64url")}get minLength(){let a=null;for(const i of this._def.checks)i.kind==="min"&&(a===null||i.value>a)&&(a=i.value);return a}get maxLength(){let a=null;for(const i of this._def.checks)i.kind==="max"&&(a===null||i.value<a)&&(a=i.value);return a}}Fa.create=n=>new Fa({checks:[],typeName:xe.ZodString,coerce:n?.coerce??!1,...Ae(n)});function aS(n,a){const i=(n.toString().split(".")[1]||"").length,r=(a.toString().split(".")[1]||"").length,u=i>r?i:r,f=Number.parseInt(n.toFixed(u).replace(".","")),p=Number.parseInt(a.toFixed(u).replace(".",""));return f%p/10**u}class Ll extends Me{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(a){if(this._def.coerce&&(a.data=Number(a.data)),this._getType(a)!==ie.number){const f=this._getOrReturnCtx(a);return ne(f,{code:Z.invalid_type,expected:ie.number,received:f.parsedType}),be}let r;const u=new an;for(const f of this._def.checks)f.kind==="int"?ze.isInteger(a.data)||(r=this._getOrReturnCtx(a,r),ne(r,{code:Z.invalid_type,expected:"integer",received:"float",message:f.message}),u.dirty()):f.kind==="min"?(f.inclusive?a.data<f.value:a.data<=f.value)&&(r=this._getOrReturnCtx(a,r),ne(r,{code:Z.too_small,minimum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),u.dirty()):f.kind==="max"?(f.inclusive?a.data>f.value:a.data>=f.value)&&(r=this._getOrReturnCtx(a,r),ne(r,{code:Z.too_big,maximum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),u.dirty()):f.kind==="multipleOf"?aS(a.data,f.value)!==0&&(r=this._getOrReturnCtx(a,r),ne(r,{code:Z.not_multiple_of,multipleOf:f.value,message:f.message}),u.dirty()):f.kind==="finite"?Number.isFinite(a.data)||(r=this._getOrReturnCtx(a,r),ne(r,{code:Z.not_finite,message:f.message}),u.dirty()):ze.assertNever(f);return{status:u.value,value:a.data}}gte(a,i){return this.setLimit("min",a,!0,ce.toString(i))}gt(a,i){return this.setLimit("min",a,!1,ce.toString(i))}lte(a,i){return this.setLimit("max",a,!0,ce.toString(i))}lt(a,i){return this.setLimit("max",a,!1,ce.toString(i))}setLimit(a,i,r,u){return new Ll({...this._def,checks:[...this._def.checks,{kind:a,value:i,inclusive:r,message:ce.toString(u)}]})}_addCheck(a){return new Ll({...this._def,checks:[...this._def.checks,a]})}int(a){return this._addCheck({kind:"int",message:ce.toString(a)})}positive(a){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ce.toString(a)})}negative(a){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ce.toString(a)})}nonpositive(a){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ce.toString(a)})}nonnegative(a){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ce.toString(a)})}multipleOf(a,i){return this._addCheck({kind:"multipleOf",value:a,message:ce.toString(i)})}finite(a){return this._addCheck({kind:"finite",message:ce.toString(a)})}safe(a){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ce.toString(a)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ce.toString(a)})}get minValue(){let a=null;for(const i of this._def.checks)i.kind==="min"&&(a===null||i.value>a)&&(a=i.value);return a}get maxValue(){let a=null;for(const i of this._def.checks)i.kind==="max"&&(a===null||i.value<a)&&(a=i.value);return a}get isInt(){return!!this._def.checks.find(a=>a.kind==="int"||a.kind==="multipleOf"&&ze.isInteger(a.value))}get isFinite(){let a=null,i=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(i===null||r.value>i)&&(i=r.value):r.kind==="max"&&(a===null||r.value<a)&&(a=r.value)}return Number.isFinite(i)&&Number.isFinite(a)}}Ll.create=n=>new Ll({checks:[],typeName:xe.ZodNumber,coerce:n?.coerce||!1,...Ae(n)});class Xi extends Me{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(a){if(this._def.coerce)try{a.data=BigInt(a.data)}catch{return this._getInvalidInput(a)}if(this._getType(a)!==ie.bigint)return this._getInvalidInput(a);let r;const u=new an;for(const f of this._def.checks)f.kind==="min"?(f.inclusive?a.data<f.value:a.data<=f.value)&&(r=this._getOrReturnCtx(a,r),ne(r,{code:Z.too_small,type:"bigint",minimum:f.value,inclusive:f.inclusive,message:f.message}),u.dirty()):f.kind==="max"?(f.inclusive?a.data>f.value:a.data>=f.value)&&(r=this._getOrReturnCtx(a,r),ne(r,{code:Z.too_big,type:"bigint",maximum:f.value,inclusive:f.inclusive,message:f.message}),u.dirty()):f.kind==="multipleOf"?a.data%f.value!==BigInt(0)&&(r=this._getOrReturnCtx(a,r),ne(r,{code:Z.not_multiple_of,multipleOf:f.value,message:f.message}),u.dirty()):ze.assertNever(f);return{status:u.value,value:a.data}}_getInvalidInput(a){const i=this._getOrReturnCtx(a);return ne(i,{code:Z.invalid_type,expected:ie.bigint,received:i.parsedType}),be}gte(a,i){return this.setLimit("min",a,!0,ce.toString(i))}gt(a,i){return this.setLimit("min",a,!1,ce.toString(i))}lte(a,i){return this.setLimit("max",a,!0,ce.toString(i))}lt(a,i){return this.setLimit("max",a,!1,ce.toString(i))}setLimit(a,i,r,u){return new Xi({...this._def,checks:[...this._def.checks,{kind:a,value:i,inclusive:r,message:ce.toString(u)}]})}_addCheck(a){return new Xi({...this._def,checks:[...this._def.checks,a]})}positive(a){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ce.toString(a)})}negative(a){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ce.toString(a)})}nonpositive(a){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ce.toString(a)})}nonnegative(a){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ce.toString(a)})}multipleOf(a,i){return this._addCheck({kind:"multipleOf",value:a,message:ce.toString(i)})}get minValue(){let a=null;for(const i of this._def.checks)i.kind==="min"&&(a===null||i.value>a)&&(a=i.value);return a}get maxValue(){let a=null;for(const i of this._def.checks)i.kind==="max"&&(a===null||i.value<a)&&(a=i.value);return a}}Xi.create=n=>new Xi({checks:[],typeName:xe.ZodBigInt,coerce:n?.coerce??!1,...Ae(n)});class Yd extends Me{_parse(a){if(this._def.coerce&&(a.data=!!a.data),this._getType(a)!==ie.boolean){const r=this._getOrReturnCtx(a);return ne(r,{code:Z.invalid_type,expected:ie.boolean,received:r.parsedType}),be}return yn(a.data)}}Yd.create=n=>new Yd({typeName:xe.ZodBoolean,coerce:n?.coerce||!1,...Ae(n)});class Mo extends Me{_parse(a){if(this._def.coerce&&(a.data=new Date(a.data)),this._getType(a)!==ie.date){const f=this._getOrReturnCtx(a);return ne(f,{code:Z.invalid_type,expected:ie.date,received:f.parsedType}),be}if(Number.isNaN(a.data.getTime())){const f=this._getOrReturnCtx(a);return ne(f,{code:Z.invalid_date}),be}const r=new an;let u;for(const f of this._def.checks)f.kind==="min"?a.data.getTime()<f.value&&(u=this._getOrReturnCtx(a,u),ne(u,{code:Z.too_small,message:f.message,inclusive:!0,exact:!1,minimum:f.value,type:"date"}),r.dirty()):f.kind==="max"?a.data.getTime()>f.value&&(u=this._getOrReturnCtx(a,u),ne(u,{code:Z.too_big,message:f.message,inclusive:!0,exact:!1,maximum:f.value,type:"date"}),r.dirty()):ze.assertNever(f);return{status:r.value,value:new Date(a.data.getTime())}}_addCheck(a){return new Mo({...this._def,checks:[...this._def.checks,a]})}min(a,i){return this._addCheck({kind:"min",value:a.getTime(),message:ce.toString(i)})}max(a,i){return this._addCheck({kind:"max",value:a.getTime(),message:ce.toString(i)})}get minDate(){let a=null;for(const i of this._def.checks)i.kind==="min"&&(a===null||i.value>a)&&(a=i.value);return a!=null?new Date(a):null}get maxDate(){let a=null;for(const i of this._def.checks)i.kind==="max"&&(a===null||i.value<a)&&(a=i.value);return a!=null?new Date(a):null}}Mo.create=n=>new Mo({checks:[],coerce:n?.coerce||!1,typeName:xe.ZodDate,...Ae(n)});class Mg extends Me{_parse(a){if(this._getType(a)!==ie.symbol){const r=this._getOrReturnCtx(a);return ne(r,{code:Z.invalid_type,expected:ie.symbol,received:r.parsedType}),be}return yn(a.data)}}Mg.create=n=>new Mg({typeName:xe.ZodSymbol,...Ae(n)});class Xd extends Me{_parse(a){if(this._getType(a)!==ie.undefined){const r=this._getOrReturnCtx(a);return ne(r,{code:Z.invalid_type,expected:ie.undefined,received:r.parsedType}),be}return yn(a.data)}}Xd.create=n=>new Xd({typeName:xe.ZodUndefined,...Ae(n)});class Kd extends Me{_parse(a){if(this._getType(a)!==ie.null){const r=this._getOrReturnCtx(a);return ne(r,{code:Z.invalid_type,expected:ie.null,received:r.parsedType}),be}return yn(a.data)}}Kd.create=n=>new Kd({typeName:xe.ZodNull,...Ae(n)});class zg extends Me{constructor(){super(...arguments),this._any=!0}_parse(a){return yn(a.data)}}zg.create=n=>new zg({typeName:xe.ZodAny,...Ae(n)});class Lg extends Me{constructor(){super(...arguments),this._unknown=!0}_parse(a){return yn(a.data)}}Lg.create=n=>new Lg({typeName:xe.ZodUnknown,...Ae(n)});class as extends Me{_parse(a){const i=this._getOrReturnCtx(a);return ne(i,{code:Z.invalid_type,expected:ie.never,received:i.parsedType}),be}}as.create=n=>new as({typeName:xe.ZodNever,...Ae(n)});class Dg extends Me{_parse(a){if(this._getType(a)!==ie.undefined){const r=this._getOrReturnCtx(a);return ne(r,{code:Z.invalid_type,expected:ie.void,received:r.parsedType}),be}return yn(a.data)}}Dg.create=n=>new Dg({typeName:xe.ZodVoid,...Ae(n)});class Vn extends Me{_parse(a){const{ctx:i,status:r}=this._processInputParams(a),u=this._def;if(i.parsedType!==ie.array)return ne(i,{code:Z.invalid_type,expected:ie.array,received:i.parsedType}),be;if(u.exactLength!==null){const p=i.data.length>u.exactLength.value,m=i.data.length<u.exactLength.value;(p||m)&&(ne(i,{code:p?Z.too_big:Z.too_small,minimum:m?u.exactLength.value:void 0,maximum:p?u.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:u.exactLength.message}),r.dirty())}if(u.minLength!==null&&i.data.length<u.minLength.value&&(ne(i,{code:Z.too_small,minimum:u.minLength.value,type:"array",inclusive:!0,exact:!1,message:u.minLength.message}),r.dirty()),u.maxLength!==null&&i.data.length>u.maxLength.value&&(ne(i,{code:Z.too_big,maximum:u.maxLength.value,type:"array",inclusive:!0,exact:!1,message:u.maxLength.message}),r.dirty()),i.common.async)return Promise.all([...i.data].map((p,m)=>u.type._parseAsync(new ns(i,p,i.path,m)))).then(p=>an.mergeArray(r,p));const f=[...i.data].map((p,m)=>u.type._parseSync(new ns(i,p,i.path,m)));return an.mergeArray(r,f)}get element(){return this._def.type}min(a,i){return new Vn({...this._def,minLength:{value:a,message:ce.toString(i)}})}max(a,i){return new Vn({...this._def,maxLength:{value:a,message:ce.toString(i)}})}length(a,i){return new Vn({...this._def,exactLength:{value:a,message:ce.toString(i)}})}nonempty(a){return this.min(1,a)}}Vn.create=(n,a)=>new Vn({type:n,minLength:null,maxLength:null,exactLength:null,typeName:xe.ZodArray,...Ae(a)});function Ol(n){if(n instanceof mt){const a={};for(const i in n.shape){const r=n.shape[i];a[i]=ha.create(Ol(r))}return new mt({...n._def,shape:()=>a})}else return n instanceof Vn?new Vn({...n._def,type:Ol(n.element)}):n instanceof ha?ha.create(Ol(n.unwrap())):n instanceof qs?qs.create(Ol(n.unwrap())):n instanceof Ds?Ds.create(n.items.map(a=>Ol(a))):n}class mt extends Me{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const a=this._def.shape(),i=ze.objectKeys(a);return this._cached={shape:a,keys:i},this._cached}_parse(a){if(this._getType(a)!==ie.object){const v=this._getOrReturnCtx(a);return ne(v,{code:Z.invalid_type,expected:ie.object,received:v.parsedType}),be}const{status:r,ctx:u}=this._processInputParams(a),{shape:f,keys:p}=this._getCached(),m=[];if(!(this._def.catchall instanceof as&&this._def.unknownKeys==="strip"))for(const v in u.data)p.includes(v)||m.push(v);const g=[];for(const v of p){const y=f[v],b=u.data[v];g.push({key:{status:"valid",value:v},value:y._parse(new ns(u,b,u.path,v)),alwaysSet:v in u.data})}if(this._def.catchall instanceof as){const v=this._def.unknownKeys;if(v==="passthrough")for(const y of m)g.push({key:{status:"valid",value:y},value:{status:"valid",value:u.data[y]}});else if(v==="strict")m.length>0&&(ne(u,{code:Z.unrecognized_keys,keys:m}),r.dirty());else if(v!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const v=this._def.catchall;for(const y of m){const b=u.data[y];g.push({key:{status:"valid",value:y},value:v._parse(new ns(u,b,u.path,y)),alwaysSet:y in u.data})}}return u.common.async?Promise.resolve().then(async()=>{const v=[];for(const y of g){const b=await y.key,T=await y.value;v.push({key:b,value:T,alwaysSet:y.alwaysSet})}return v}).then(v=>an.mergeObjectSync(r,v)):an.mergeObjectSync(r,g)}get shape(){return this._def.shape()}strict(a){return ce.errToObj,new mt({...this._def,unknownKeys:"strict",...a!==void 0?{errorMap:(i,r)=>{const u=this._def.errorMap?.(i,r).message??r.defaultError;return i.code==="unrecognized_keys"?{message:ce.errToObj(a).message??u}:{message:u}}}:{}})}strip(){return new mt({...this._def,unknownKeys:"strip"})}passthrough(){return new mt({...this._def,unknownKeys:"passthrough"})}extend(a){return new mt({...this._def,shape:()=>({...this._def.shape(),...a})})}merge(a){return new mt({unknownKeys:a._def.unknownKeys,catchall:a._def.catchall,shape:()=>({...this._def.shape(),...a._def.shape()}),typeName:xe.ZodObject})}setKey(a,i){return this.augment({[a]:i})}catchall(a){return new mt({...this._def,catchall:a})}pick(a){const i={};for(const r of ze.objectKeys(a))a[r]&&this.shape[r]&&(i[r]=this.shape[r]);return new mt({...this._def,shape:()=>i})}omit(a){const i={};for(const r of ze.objectKeys(this.shape))a[r]||(i[r]=this.shape[r]);return new mt({...this._def,shape:()=>i})}deepPartial(){return Ol(this)}partial(a){const i={};for(const r of ze.objectKeys(this.shape)){const u=this.shape[r];a&&!a[r]?i[r]=u:i[r]=u.optional()}return new mt({...this._def,shape:()=>i})}required(a){const i={};for(const r of ze.objectKeys(this.shape))if(a&&!a[r])i[r]=this.shape[r];else{let f=this.shape[r];for(;f instanceof ha;)f=f._def.innerType;i[r]=f}return new mt({...this._def,shape:()=>i})}keyof(){return Wv(ze.objectKeys(this.shape))}}mt.create=(n,a)=>new mt({shape:()=>n,unknownKeys:"strip",catchall:as.create(),typeName:xe.ZodObject,...Ae(a)});mt.strictCreate=(n,a)=>new mt({shape:()=>n,unknownKeys:"strict",catchall:as.create(),typeName:xe.ZodObject,...Ae(a)});mt.lazycreate=(n,a)=>new mt({shape:n,unknownKeys:"strip",catchall:as.create(),typeName:xe.ZodObject,...Ae(a)});class zo extends Me{_parse(a){const{ctx:i}=this._processInputParams(a),r=this._def.options;function u(f){for(const m of f)if(m.result.status==="valid")return m.result;for(const m of f)if(m.result.status==="dirty")return i.common.issues.push(...m.ctx.common.issues),m.result;const p=f.map(m=>new ma(m.ctx.common.issues));return ne(i,{code:Z.invalid_union,unionErrors:p}),be}if(i.common.async)return Promise.all(r.map(async f=>{const p={...i,common:{...i.common,issues:[]},parent:null};return{result:await f._parseAsync({data:i.data,path:i.path,parent:p}),ctx:p}})).then(u);{let f;const p=[];for(const g of r){const v={...i,common:{...i.common,issues:[]},parent:null},y=g._parseSync({data:i.data,path:i.path,parent:v});if(y.status==="valid")return y;y.status==="dirty"&&!f&&(f={result:y,ctx:v}),v.common.issues.length&&p.push(v.common.issues)}if(f)return i.common.issues.push(...f.ctx.common.issues),f.result;const m=p.map(g=>new ma(g));return ne(i,{code:Z.invalid_union,unionErrors:m}),be}}get options(){return this._def.options}}zo.create=(n,a)=>new zo({options:n,typeName:xe.ZodUnion,...Ae(a)});const ua=n=>n instanceof Jd?ua(n.schema):n instanceof Us?ua(n.innerType()):n instanceof Do?[n.value]:n instanceof Is?n.options:n instanceof Fd?ze.objectValues(n.enum):n instanceof Uo?ua(n._def.innerType):n instanceof Xd?[void 0]:n instanceof Kd?[null]:n instanceof ha?[void 0,...ua(n.unwrap())]:n instanceof qs?[null,...ua(n.unwrap())]:n instanceof Pv||n instanceof $o?ua(n.unwrap()):n instanceof qo?ua(n._def.innerType):[];class df extends Me{_parse(a){const{ctx:i}=this._processInputParams(a);if(i.parsedType!==ie.object)return ne(i,{code:Z.invalid_type,expected:ie.object,received:i.parsedType}),be;const r=this.discriminator,u=i.data[r],f=this.optionsMap.get(u);return f?i.common.async?f._parseAsync({data:i.data,path:i.path,parent:i}):f._parseSync({data:i.data,path:i.path,parent:i}):(ne(i,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(a,i,r){const u=new Map;for(const f of i){const p=ua(f.shape[a]);if(!p.length)throw new Error(`A discriminator value for key \`${a}\` could not be extracted from all schema options`);for(const m of p){if(u.has(m))throw new Error(`Discriminator property ${String(a)} has duplicate value ${String(m)}`);u.set(m,f)}}return new df({typeName:xe.ZodDiscriminatedUnion,discriminator:a,options:i,optionsMap:u,...Ae(r)})}}function Qd(n,a){const i=Qa(n),r=Qa(a);if(n===a)return{valid:!0,data:n};if(i===ie.object&&r===ie.object){const u=ze.objectKeys(a),f=ze.objectKeys(n).filter(m=>u.indexOf(m)!==-1),p={...n,...a};for(const m of f){const g=Qd(n[m],a[m]);if(!g.valid)return{valid:!1};p[m]=g.data}return{valid:!0,data:p}}else if(i===ie.array&&r===ie.array){if(n.length!==a.length)return{valid:!1};const u=[];for(let f=0;f<n.length;f++){const p=n[f],m=a[f],g=Qd(p,m);if(!g.valid)return{valid:!1};u.push(g.data)}return{valid:!0,data:u}}else return i===ie.date&&r===ie.date&&+n==+a?{valid:!0,data:n}:{valid:!1}}class Lo extends Me{_parse(a){const{status:i,ctx:r}=this._processInputParams(a),u=(f,p)=>{if(Cg(f)||Cg(p))return be;const m=Qd(f.value,p.value);return m.valid?((Og(f)||Og(p))&&i.dirty(),{status:i.value,value:m.data}):(ne(r,{code:Z.invalid_intersection_types}),be)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([f,p])=>u(f,p)):u(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Lo.create=(n,a,i)=>new Lo({left:n,right:a,typeName:xe.ZodIntersection,...Ae(i)});class Ds extends Me{_parse(a){const{status:i,ctx:r}=this._processInputParams(a);if(r.parsedType!==ie.array)return ne(r,{code:Z.invalid_type,expected:ie.array,received:r.parsedType}),be;if(r.data.length<this._def.items.length)return ne(r,{code:Z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&r.data.length>this._def.items.length&&(ne(r,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());const f=[...r.data].map((p,m)=>{const g=this._def.items[m]||this._def.rest;return g?g._parse(new ns(r,p,r.path,m)):null}).filter(p=>!!p);return r.common.async?Promise.all(f).then(p=>an.mergeArray(i,p)):an.mergeArray(i,f)}get items(){return this._def.items}rest(a){return new Ds({...this._def,rest:a})}}Ds.create=(n,a)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ds({items:n,typeName:xe.ZodTuple,rest:null,...Ae(a)})};class Ig extends Me{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(a){const{status:i,ctx:r}=this._processInputParams(a);if(r.parsedType!==ie.map)return ne(r,{code:Z.invalid_type,expected:ie.map,received:r.parsedType}),be;const u=this._def.keyType,f=this._def.valueType,p=[...r.data.entries()].map(([m,g],v)=>({key:u._parse(new ns(r,m,r.path,[v,"key"])),value:f._parse(new ns(r,g,r.path,[v,"value"]))}));if(r.common.async){const m=new Map;return Promise.resolve().then(async()=>{for(const g of p){const v=await g.key,y=await g.value;if(v.status==="aborted"||y.status==="aborted")return be;(v.status==="dirty"||y.status==="dirty")&&i.dirty(),m.set(v.value,y.value)}return{status:i.value,value:m}})}else{const m=new Map;for(const g of p){const v=g.key,y=g.value;if(v.status==="aborted"||y.status==="aborted")return be;(v.status==="dirty"||y.status==="dirty")&&i.dirty(),m.set(v.value,y.value)}return{status:i.value,value:m}}}}Ig.create=(n,a,i)=>new Ig({valueType:a,keyType:n,typeName:xe.ZodMap,...Ae(i)});class Ki extends Me{_parse(a){const{status:i,ctx:r}=this._processInputParams(a);if(r.parsedType!==ie.set)return ne(r,{code:Z.invalid_type,expected:ie.set,received:r.parsedType}),be;const u=this._def;u.minSize!==null&&r.data.size<u.minSize.value&&(ne(r,{code:Z.too_small,minimum:u.minSize.value,type:"set",inclusive:!0,exact:!1,message:u.minSize.message}),i.dirty()),u.maxSize!==null&&r.data.size>u.maxSize.value&&(ne(r,{code:Z.too_big,maximum:u.maxSize.value,type:"set",inclusive:!0,exact:!1,message:u.maxSize.message}),i.dirty());const f=this._def.valueType;function p(g){const v=new Set;for(const y of g){if(y.status==="aborted")return be;y.status==="dirty"&&i.dirty(),v.add(y.value)}return{status:i.value,value:v}}const m=[...r.data.values()].map((g,v)=>f._parse(new ns(r,g,r.path,v)));return r.common.async?Promise.all(m).then(g=>p(g)):p(m)}min(a,i){return new Ki({...this._def,minSize:{value:a,message:ce.toString(i)}})}max(a,i){return new Ki({...this._def,maxSize:{value:a,message:ce.toString(i)}})}size(a,i){return this.min(a,i).max(a,i)}nonempty(a){return this.min(1,a)}}Ki.create=(n,a)=>new Ki({valueType:n,minSize:null,maxSize:null,typeName:xe.ZodSet,...Ae(a)});class Jd extends Me{get schema(){return this._def.getter()}_parse(a){const{ctx:i}=this._processInputParams(a);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}Jd.create=(n,a)=>new Jd({getter:n,typeName:xe.ZodLazy,...Ae(a)});class Do extends Me{_parse(a){if(a.data!==this._def.value){const i=this._getOrReturnCtx(a);return ne(i,{received:i.data,code:Z.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:a.data}}get value(){return this._def.value}}Do.create=(n,a)=>new Do({value:n,typeName:xe.ZodLiteral,...Ae(a)});function Wv(n,a){return new Is({values:n,typeName:xe.ZodEnum,...Ae(a)})}class Is extends Me{_parse(a){if(typeof a.data!="string"){const i=this._getOrReturnCtx(a),r=this._def.values;return ne(i,{expected:ze.joinValues(r),received:i.parsedType,code:Z.invalid_type}),be}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(a.data)){const i=this._getOrReturnCtx(a),r=this._def.values;return ne(i,{received:i.data,code:Z.invalid_enum_value,options:r}),be}return yn(a.data)}get options(){return this._def.values}get enum(){const a={};for(const i of this._def.values)a[i]=i;return a}get Values(){const a={};for(const i of this._def.values)a[i]=i;return a}get Enum(){const a={};for(const i of this._def.values)a[i]=i;return a}extract(a,i=this._def){return Is.create(a,{...this._def,...i})}exclude(a,i=this._def){return Is.create(this.options.filter(r=>!a.includes(r)),{...this._def,...i})}}Is.create=Wv;class Fd extends Me{_parse(a){const i=ze.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(a);if(r.parsedType!==ie.string&&r.parsedType!==ie.number){const u=ze.objectValues(i);return ne(r,{expected:ze.joinValues(u),received:r.parsedType,code:Z.invalid_type}),be}if(this._cache||(this._cache=new Set(ze.getValidEnumValues(this._def.values))),!this._cache.has(a.data)){const u=ze.objectValues(i);return ne(r,{received:r.data,code:Z.invalid_enum_value,options:u}),be}return yn(a.data)}get enum(){return this._def.values}}Fd.create=(n,a)=>new Fd({values:n,typeName:xe.ZodNativeEnum,...Ae(a)});class Io extends Me{unwrap(){return this._def.type}_parse(a){const{ctx:i}=this._processInputParams(a);if(i.parsedType!==ie.promise&&i.common.async===!1)return ne(i,{code:Z.invalid_type,expected:ie.promise,received:i.parsedType}),be;const r=i.parsedType===ie.promise?i.data:Promise.resolve(i.data);return yn(r.then(u=>this._def.type.parseAsync(u,{path:i.path,errorMap:i.common.contextualErrorMap})))}}Io.create=(n,a)=>new Io({type:n,typeName:xe.ZodPromise,...Ae(a)});class Us extends Me{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(a){const{status:i,ctx:r}=this._processInputParams(a),u=this._def.effect||null,f={addIssue:p=>{ne(r,p),p.fatal?i.abort():i.dirty()},get path(){return r.path}};if(f.addIssue=f.addIssue.bind(f),u.type==="preprocess"){const p=u.transform(r.data,f);if(r.common.async)return Promise.resolve(p).then(async m=>{if(i.value==="aborted")return be;const g=await this._def.schema._parseAsync({data:m,path:r.path,parent:r});return g.status==="aborted"?be:g.status==="dirty"||i.value==="dirty"?Hi(g.value):g});{if(i.value==="aborted")return be;const m=this._def.schema._parseSync({data:p,path:r.path,parent:r});return m.status==="aborted"?be:m.status==="dirty"||i.value==="dirty"?Hi(m.value):m}}if(u.type==="refinement"){const p=m=>{const g=u.refinement(m,f);if(r.common.async)return Promise.resolve(g);if(g instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return m};if(r.common.async===!1){const m=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return m.status==="aborted"?be:(m.status==="dirty"&&i.dirty(),p(m.value),{status:i.value,value:m.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(m=>m.status==="aborted"?be:(m.status==="dirty"&&i.dirty(),p(m.value).then(()=>({status:i.value,value:m.value}))))}if(u.type==="transform")if(r.common.async===!1){const p=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!zl(p))return be;const m=u.transform(p.value,f);if(m instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:m}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(p=>zl(p)?Promise.resolve(u.transform(p.value,f)).then(m=>({status:i.value,value:m})):be);ze.assertNever(u)}}Us.create=(n,a,i)=>new Us({schema:n,typeName:xe.ZodEffects,effect:a,...Ae(i)});Us.createWithPreprocess=(n,a,i)=>new Us({schema:a,effect:{type:"preprocess",transform:n},typeName:xe.ZodEffects,...Ae(i)});class ha extends Me{_parse(a){return this._getType(a)===ie.undefined?yn(void 0):this._def.innerType._parse(a)}unwrap(){return this._def.innerType}}ha.create=(n,a)=>new ha({innerType:n,typeName:xe.ZodOptional,...Ae(a)});class qs extends Me{_parse(a){return this._getType(a)===ie.null?yn(null):this._def.innerType._parse(a)}unwrap(){return this._def.innerType}}qs.create=(n,a)=>new qs({innerType:n,typeName:xe.ZodNullable,...Ae(a)});class Uo extends Me{_parse(a){const{ctx:i}=this._processInputParams(a);let r=i.data;return i.parsedType===ie.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}Uo.create=(n,a)=>new Uo({innerType:n,typeName:xe.ZodDefault,defaultValue:typeof a.default=="function"?a.default:()=>a.default,...Ae(a)});class qo extends Me{_parse(a){const{ctx:i}=this._processInputParams(a),r={...i,common:{...i.common,issues:[]}},u=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ko(u)?u.then(f=>({status:"valid",value:f.status==="valid"?f.value:this._def.catchValue({get error(){return new ma(r.common.issues)},input:r.data})})):{status:"valid",value:u.status==="valid"?u.value:this._def.catchValue({get error(){return new ma(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}qo.create=(n,a)=>new qo({innerType:n,typeName:xe.ZodCatch,catchValue:typeof a.catch=="function"?a.catch:()=>a.catch,...Ae(a)});class Ug extends Me{_parse(a){if(this._getType(a)!==ie.nan){const r=this._getOrReturnCtx(a);return ne(r,{code:Z.invalid_type,expected:ie.nan,received:r.parsedType}),be}return{status:"valid",value:a.data}}}Ug.create=n=>new Ug({typeName:xe.ZodNaN,...Ae(n)});class Pv extends Me{_parse(a){const{ctx:i}=this._processInputParams(a),r=i.data;return this._def.type._parse({data:r,path:i.path,parent:i})}unwrap(){return this._def.type}}class ff extends Me{_parse(a){const{status:i,ctx:r}=this._processInputParams(a);if(r.common.async)return(async()=>{const f=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return f.status==="aborted"?be:f.status==="dirty"?(i.dirty(),Hi(f.value)):this._def.out._parseAsync({data:f.value,path:r.path,parent:r})})();{const u=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?be:u.status==="dirty"?(i.dirty(),{status:"dirty",value:u.value}):this._def.out._parseSync({data:u.value,path:r.path,parent:r})}}static create(a,i){return new ff({in:a,out:i,typeName:xe.ZodPipeline})}}class $o extends Me{_parse(a){const i=this._def.innerType._parse(a),r=u=>(zl(u)&&(u.value=Object.freeze(u.value)),u);return ko(i)?i.then(u=>r(u)):r(i)}unwrap(){return this._def.innerType}}$o.create=(n,a)=>new $o({innerType:n,typeName:xe.ZodReadonly,...Ae(a)});var xe;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(xe||(xe={}));const ga=Fa.create,Wi=Ll.create,e_=Yd.create;as.create;const hf=Vn.create,nt=mt.create,sS=zo.create,t_=df.create;Lo.create;Ds.create;const et=Do.create,Dt=Is.create;Io.create;ha.create;qs.create;const Lt=ga().min(1).max(128).regex(/^[A-Za-z0-9_-]+$/),pf=ga().min(16).max(128).regex(/^[A-Za-z0-9_-]+$/),n_=Wi().int().min(1).max(1e6),lS=Wi().int().min(0).max(Number.MAX_SAFE_INTEGER-1),Nd=Wi().int().min(0).max(Number.MAX_SAFE_INTEGER),yo=Wi().int().min(0).max(Number.MAX_SAFE_INTEGER),a_=nt({laneId:ga().min(1).max(160).regex(/^[A-Za-z0-9_:-]+$/)}).strict(),iS=nt({family:et("workflow"),runId:ga().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/),runGeneration:pf,stageId:Lt.optional(),callId:Lt.optional(),attempt:n_.optional()}).strict().superRefine((n,a)=>{n.callId!==void 0&&n.stageId===void 0&&a.addIssue({code:Z.custom,message:"call requires stage"}),n.attempt!==void 0&&n.callId===void 0&&a.addIssue({code:Z.custom,message:"attempt requires call"})}),rS=nt({family:et("activity"),activityId:Lt,activityGeneration:pf,sessionId:Lt.optional(),threadId:Lt.optional(),turnId:Lt.optional()}).strict().superRefine((n,a)=>{n.sessionId!==void 0&&n.sessionId!==n.activityId&&a.addIssue({code:Z.custom,message:"session mismatch"}),n.threadId!==void 0&&n.sessionId===void 0&&a.addIssue({code:Z.custom,message:"thread requires session"}),n.turnId!==void 0&&n.threadId===void 0&&a.addIssue({code:Z.custom,message:"turn requires thread"})}),oS=nt({family:et("context"),contextRunId:ga().max(40).refine(n=>{if(!/^ctxop_\d{8}T\d{6}Z_[0-9a-f]{12}$/.test(n))return!1;const a=n.slice(6,22),i=[a.slice(0,4),"-",a.slice(4,6),"-",a.slice(6,8),"T",a.slice(9,11),":",a.slice(11,13),":",a.slice(13,15),".000Z"].join(""),r=new Date(i);return!Number.isNaN(r.getTime())&&r.toISOString()===i}),contextGeneration:pf,executor:Dt(["curator","finalizer"]).optional(),executionId:Lt.optional(),attempt:n_.optional()}).strict().superRefine((n,a)=>{n.executionId!==void 0&&n.executor===void 0&&a.addIssue({code:Z.custom,message:"execution requires executor"}),n.attempt!==void 0&&n.executionId===void 0&&a.addIssue({code:Z.custom,message:"attempt requires execution"})}),s_=sS([iS,rS,oS]),Rl=ga().max(4096),cS=t_("kind",[nt({kind:et("user"),content:ga().max(32768)}).strict(),nt({kind:et("assistant"),content:ga().max(32768)}).strict(),nt({kind:et("tool_call"),toolName:Lt,callId:Lt,summary:Rl}).strict(),nt({kind:et("tool_result"),toolName:Lt,callId:Lt,outcome:Dt(["succeeded","failed","cancelled"]),summary:Rl}).strict(),nt({kind:et("approval_request"),approvalId:Lt,action:Rl,risk:Dt(["low","medium","high"])}).strict(),nt({kind:et("approval_resolution"),approvalId:Lt,decision:Dt(["approved","denied","cancelled"])}).strict(),nt({kind:et("error"),code:Lt,message:Rl,retryable:e_()}).strict(),nt({kind:et("lifecycle"),state:Dt(["pending","queued","resolving","running","parsing","awaiting_approval","succeeded","partial","failed","cancelled","interrupted","timeout","completed"])}).strict(),nt({kind:et("usage"),completeness:Dt(["complete","partial","unknown"]),inputTokens:yo.nullable(),outputTokens:yo.nullable(),cachedInputTokens:yo.nullable(),reasoningTokens:yo.nullable()}).strict(),nt({kind:et("reasoning"),summary:Rl}).strict(),nt({kind:et("unknown"),originalKind:Lt,summary:Rl,forwardCaptured:et(!0)}).strict()]).superRefine((n,a)=>{if(n.kind!=="usage")return;const i=[n.inputTokens,n.outputTokens,n.cachedInputTokens,n.reasoningTokens],r=i.filter(u=>u!==null).length;n.completeness==="unknown"&&r!==0?a.addIssue({code:Z.custom,message:"unknown usage has counters"}):n.completeness==="complete"&&(n.inputTokens===null||n.outputTokens===null)?a.addIssue({code:Z.custom,message:"complete usage lacks totals"}):n.completeness==="partial"&&(r===0||r===i.length)&&a.addIssue({code:Z.custom,message:"partial usage is not partial"})}),uS=Dt(["unknown_event_type","provider_payload_omitted","malformed_field_omitted","unsupported_field_omitted","content_truncated","corrupt_capture"]);function dS(n){if(n.family==="workflow"&&n.attempt!==void 0)return`attempt:${String(n.attempt)}`;if(n.family==="activity"&&n.turnId!==void 0)return`turn:${n.turnId}`;if(n.family==="context"&&n.executionId!==void 0&&n.attempt!==void 0)return`execution:${n.executionId}:${String(n.attempt)}`}const l_=nt({schemaVersion:et("session-log-v1"),sequence:lS,timestamp:ga().max(64).datetime({offset:!0}),producerFamily:Dt(["workflow","activity","context"]),owner:s_,lane:a_,authority:et("observability_only"),redaction:nt({ran:et(!0),status:Dt(["no_matches","redacted"]),count:Wi().int().min(0).max(1e4)}).strict(),truncation:Dt(["none","head","tail","middle"]),completeness:Dt(["complete","partial","unknown"]),parseWarnings:hf(uS).max(8).refine(n=>new Set(n).size===n.length),event:cS}).strict().superRefine((n,a)=>{n.producerFamily!==n.owner.family&&a.addIssue({code:Z.custom,message:"producer mismatch"}),dS(n.owner)!==n.lane.laneId&&a.addIssue({code:Z.custom,message:"lane mismatch"}),(n.redaction.status==="no_matches"&&n.redaction.count!==0||n.redaction.status==="redacted"&&n.redaction.count===0)&&a.addIssue({code:Z.custom,message:"redaction mismatch"});const i=n.parseWarnings.includes("content_truncated"),r=n.parseWarnings.some(u=>["malformed_field_omitted","unsupported_field_omitted","content_truncated","corrupt_capture"].includes(u));n.truncation==="none"&&i&&a.addIssue({code:Z.custom,message:"unexpected truncation warning"}),n.truncation!=="none"&&!i&&a.addIssue({code:Z.custom,message:"missing truncation warning"}),n.truncation!=="none"&&n.completeness!=="partial"&&a.addIssue({code:Z.custom,message:"truncation completeness mismatch"}),n.completeness==="complete"&&r&&a.addIssue({code:Z.custom,message:"complete event claims loss"})}),fS=Dt(["retention_gap","truncated","incomplete_capture","parse_warning","corrupt_capture"]),hS=t_("availability",[nt({availability:et("available")}).strict(),nt({availability:et("degraded"),reasons:hf(fS).min(1).max(5).refine(n=>new Set(n).size===n.length)}).strict(),nt({availability:et("not_retained"),reason:Dt(["retention_disabled","retention_expired","producer_did_not_retain"])}).strict(),nt({availability:et("not_executed"),reason:Dt(["not_requested","disabled","skipped","cancelled_before_start"])}).strict(),nt({availability:et("pruned"),reason:Dt(["retention_limit","age_limit","size_limit","event_limit","operator_request"])}).strict()]),pS=nt({schemaVersion:et("session-log-v1"),owner:s_,lane:a_,availability:hS,requestedSequence:Nd,floorSequence:Nd,nextSequence:Nd,truncated:e_(),events:hf(l_).max(500)}).strict().superRefine((n,a)=>{n.truncated!==n.requestedSequence<n.floorSequence&&a.addIssue({code:Z.custom,message:"truncation mismatch"});const i=JSON.stringify(n.owner),r=Math.max(n.requestedSequence,n.floorSequence),u=new Set;n.truncated&&u.add("retention_gap");let f;for(const m of n.events){if(JSON.stringify(m.owner)!==i||m.lane.laneId!==n.lane.laneId||m.sequence<r||f!==void 0&&m.sequence<=f){a.addIssue({code:Z.custom,message:"event page mismatch"});break}f=m.sequence,m.truncation!=="none"&&u.add("truncated"),m.completeness!=="complete"&&u.add("incomplete_capture"),m.parseWarnings.some(g=>g==="malformed_field_omitted"||g==="unsupported_field_omitted")&&u.add("parse_warning"),m.parseWarnings.includes("corrupt_capture")&&u.add("corrupt_capture")}const p=f===void 0?r:f+1;if(n.nextSequence!==p&&a.addIssue({code:Z.custom,message:"cursor mismatch"}),n.availability.availability==="available")u.size!==0&&a.addIssue({code:Z.custom,message:"available page claims loss"});else if(n.availability.availability==="degraded"){const m=new Set(n.availability.reasons);(m.size!==u.size||[...u].some(g=>!m.has(g)))&&a.addIssue({code:Z.custom,message:"degraded loss mismatch"})}else(n.events.length!==0||u.size!==0)&&a.addIssue({code:Z.custom,message:"unavailable page claims data or loss"})});function mS(n){return l_.parse(n)}function gS(n){return pS.parse(n)}const i_=new Set(["run_generation_changed","activity_generation_changed","context_generation_changed"]),vS=new Set([...i_,"agent_instance_changed","session_logs_unavailable","not_found"]);class Xe extends Error{kind;status;code;constructor(a,i,r){super(a),this.name="SessionLogApiError",this.kind=a,this.status=i,this.code=r}}function qg(n){return n??new AbortController().signal}function $g(n){return n.family==="workflow"?{path:["/api/runs/",encodeURIComponent(n.runId),"/stages/",encodeURIComponent(n.stageId),"/calls/",encodeURIComponent(n.callId),"/session-logs"].join(""),generation:n.runGeneration}:n.family==="activity"?{path:`/api/activities/${encodeURIComponent(n.activityId)}/session-logs`,generation:n.activityGeneration}:"runId"in n&&"runGeneration"in n?{path:`/api/runs/${encodeURIComponent(n.runId)}/context-preflight/session-logs`,generation:n.runGeneration}:{path:`/api/context-runs/${encodeURIComponent(n.contextRunId)}/session-logs`,generation:n.contextGeneration}}function Ms(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)?n:void 0}function _S(n){const a=Ms(n),r=Ms(a?.error)?.code;return typeof r=="string"&&vS.has(r)?r:void 0}function Ho(n,a){const i=Object.keys(n).sort(),r=[...a].sort();return i.length===r.length&&i.every((u,f)=>u===r[f])}function r_(n,a){return n.family!==a.family?!1:n.family==="workflow"&&a.family==="workflow"?n.runId===a.runId&&n.stageId===a.stageId&&n.callId===a.callId&&n.attempt!==void 0:n.family==="activity"&&a.family==="activity"?n.activityId===a.activityId&&n.turnId!==void 0:n.family==="context"&&a.family==="context"?n.contextRunId===a.contextRunId&&n.executor!==void 0&&n.executionId!==void 0&&n.attempt!==void 0:!1}function yS(n,a){const i=Ms(n),r=Ms(i?.lane);if(i===void 0||!Ho(i,["owner","lane","nextSequence"])||r===void 0||!Ho(r,["laneId"])||!Number.isSafeInteger(i.nextSequence)||i.nextSequence<0)throw new Xe("request_error",502);try{const u=mS({schemaVersion:"session-log-v1",sequence:0,timestamp:"2000-01-01T00:00:00.000Z",producerFamily:Ms(i.owner)?.family,owner:i.owner,lane:i.lane,authority:"observability_only",redaction:{ran:!0,status:"no_matches",count:0},truncation:"none",completeness:"complete",parseWarnings:[],event:{kind:"lifecycle",state:"pending"}});if(!r_(u.owner,a))throw new Xe("request_error",502);return Object.freeze({owner:u.owner,lane:u.lane,nextSequence:i.nextSequence})}catch(u){throw u instanceof Xe?u:new Xe("request_error",502)}}function bS(n,a){const i=Ms(n),r=Ms(i?.availability),u=i?.lanes,f=r?.availability==="available",p=r?.availability==="not_retained"&&r.reason==="producer_did_not_retain";if(i===void 0||!Ho(i,["schemaVersion","availability","lanes"])||i?.schemaVersion!=="session-log-index-v1"||!f&&!p||r===void 0||!Ho(r,f?["availability"]:["availability","reason"])||!Array.isArray(u)||u.length>2e3||f!==u.length>0)throw new Xe("request_error",502);const m=u.map(v=>yS(v,a));if(new Set(m.map(({owner:v})=>v.family==="workflow"?v.runGeneration:v.family==="activity"?v.activityGeneration:v.contextGeneration)).size>1)throw new Xe("request_error",502);return Object.freeze({schemaVersion:"session-log-index-v1",availability:Object.freeze(f?{availability:"available"}:{availability:"not_retained",reason:"producer_did_not_retain"}),lanes:Object.freeze(m)})}function xS(n,a,i){try{const r=gS(n);if(r.events.length>500||JSON.stringify(r.lane)!==JSON.stringify(i.lane)||JSON.stringify(r.owner)!==JSON.stringify(i.owner)||!r_(r.owner,a))throw new Xe("request_error",502);return r}catch(r){throw r instanceof Xe?r:new Xe("request_error",502)}}async function Hg(n,a,i){let r;try{r=await n(a,{signal:i})}catch(u){throw u instanceof qe?new Xe("connection_changed",409,"agent_instance_changed"):i.aborted||u instanceof DOMException&&u.name==="AbortError"?new Xe("aborted"):new Xe("offline")}if(r.status===401)throw new Xe("auth_expired",401);if(!r.ok){let u;try{u=_S(await nn(r))}catch(f){if(f instanceof qe)throw new Xe("connection_changed",409,"agent_instance_changed")}throw u!==void 0&&i_.has(u)?new Xe("generation_changed",r.status,u):u==="agent_instance_changed"?new Xe("connection_changed",r.status,u):u==="session_logs_unavailable"?new Xe("unavailable",r.status,u):u==="not_found"?new Xe("missing",r.status,u):new Xe("request_error",r.status,u)}try{return await nn(r)}catch(u){throw u instanceof qe?new Xe("connection_changed",409,"agent_instance_changed"):new Xe("request_error",r.status)}}function o_(n=_a){return Object.freeze({async listLanes(a,i){const r=$g(a),u=new URLSearchParams({generation:r.generation});return bS(await Hg(n,`${r.path}?${u.toString()}`,qg(i)),a)},async readPage(a,i,r,u){const f=$g(a),p=new URLSearchParams({generation:f.generation,sequence:String(r.sequence),limit:String(r.limit)});return xS(await Hg(n,`${f.path}/${encodeURIComponent(i.lane.laneId)}?${p.toString()}`,qg(u)),a,i)}})}const SS=500,Gg=200;class Va extends Error{constructor(){super("session_log_protocol_error"),this.name="SessionLogProtocolError"}}function bo(n,a){return n<a?-1:n>a?1:0}function jS(n,a){if(n.owner.family==="workflow"&&a.owner.family==="workflow")return(n.owner.attempt??0)-(a.owner.attempt??0);if(n.owner.family==="activity"&&a.owner.family==="activity")return bo(n.owner.turnId??n.lane.laneId,a.owner.turnId??a.lane.laneId);if(n.owner.family==="context"&&a.owner.family==="context"){const i=bo(n.owner.executor??"",a.owner.executor??"");if(i!==0)return i;const r=bo(n.owner.executionId??n.lane.laneId,a.owner.executionId??a.lane.laneId);return r===0?(n.owner.attempt??0)-(a.owner.attempt??0):r}return bo(n.lane.laneId,a.lane.laneId)}function c_(n,a){return n.family!==a.family?!1:n.family==="workflow"&&a.family==="workflow"?n.runId===a.runId&&n.stageId===a.stageId&&n.callId===a.callId:n.family==="activity"&&a.family==="activity"?n.activityId===a.activityId:n.family==="context"&&a.family==="context"&&n.contextRunId===a.contextRunId}function Bg(n,a){const i=n.owner,r=i.family==="workflow"&&i.attempt!==void 0?`attempt:${String(i.attempt)}`:i.family==="activity"&&i.turnId!==void 0?`turn:${i.turnId}`:i.family==="context"&&i.executionId!==void 0&&i.attempt!==void 0?`execution:${i.executionId}:${String(i.attempt)}`:void 0;return c_(i,a)&&r===n.lane.laneId&&Number.isSafeInteger(n.nextSequence)&&n.nextSequence>=0}function Ad(n,a){return JSON.stringify(n)===JSON.stringify(a)}function wS(n){const a=new Set;for(const i of n)if(i.availability.availability==="degraded")for(const r of i.availability.reasons)a.add(r);else if(i.availability.availability!=="available")return i.availability;return a.size===0?{availability:"available"}:{availability:"degraded",reasons:[...a]}}function NS(n){return Object.freeze({async discover(a,i=null,r){const u=await n.listLanes(a,r),f=new Set(u.lanes.map(({lane:v})=>v.laneId)),p=new Set(u.lanes.map(({owner:v})=>v.family==="workflow"?v.runGeneration:v.family==="activity"?v.activityGeneration:v.contextGeneration));if(u.schemaVersion!=="session-log-index-v1"||u.lanes.some(v=>!Bg(v,a))||f.size!==u.lanes.length||p.size>1||u.availability.availability==="available"!=u.lanes.length>0)throw new Va;const m=Object.freeze([...u.lanes].sort(jS)),g=m.find(({lane:v})=>v.laneId===i)??m[0]??null;return Object.freeze({index:u,lanes:m,selectedLane:g})},async loadLane(a,i,r){const u=r??new AbortController().signal;if(!Bg(i,a))throw new Va;if(i.nextSequence===0)return Object.freeze({schemaVersion:"session-log-v1",owner:i.owner,lane:i.lane,availability:{availability:"available"},requestedSequence:0,floorSequence:0,nextSequence:0,truncated:!1,events:Object.freeze([])});const f=[],p=new Map;let m=0;for(let v=0;v<Gg;v+=1){const y=await n.readPage(a,i,{sequence:m,limit:SS},u);if(y.requestedSequence!==m||!Ad(y.lane,i.lane)||!Ad(y.owner,i.owner)||!c_(y.owner,a))throw new Va;if(!(y.availability.availability==="available"||y.availability.availability==="degraded")){if(y.events.length!==0||y.nextSequence!==m)throw new Va;return y}if(y.nextSequence<=m)throw new Va;f.push(y);for(const T of y.events){const N=p.get(T.sequence);if(N!==void 0&&!Ad(N,T))throw new Va;N===void 0&&p.set(T.sequence,T)}if(m=y.nextSequence,m>=i.nextSequence)break}if(f.length===Gg&&m<i.nextSequence)throw new Va;const g=f[0];if(g===void 0)throw new Va;return Object.freeze({schemaVersion:"session-log-v1",owner:g.owner,lane:g.lane,availability:wS(f),requestedSequence:0,floorSequence:g.floorSequence,nextSequence:m,truncated:f.some(v=>v.truncated),events:Object.freeze([...p.values()].sort((v,y)=>v.sequence-y.sequence))})}})}const AS={available:"Available",degraded:"Degraded",not_retained:"Not retained",not_executed:"Not executed",pruned:"Pruned"},RS={not_retained:"This session log was not retained.",not_executed:"No session execution occurred for this lane.",pruned:"This session log was pruned."};function u_(n){const a=n.availability.availability==="available"?[]:n.availability.availability==="degraded"?n.availability.reasons.map(Vg):[Vg(n.availability.reason)];return{events:[...n.events].sort((i,r)=>i.sequence-r.sequence),availabilityLabel:AS[n.availability.availability],availabilityState:n.availability.availability,reasons:a,gapMessage:n.truncated&&n.floorSequence>n.requestedSequence?`Sequences ${String(n.requestedSequence)}–${String(n.floorSequence-1)} are no longer retained.`:null,cursorLabel:`Requested sequence ${String(n.requestedSequence)} · floor ${String(n.floorSequence)} · next cursor ${String(n.nextSequence)}`,unavailableMessage:n.availability.availability==="available"||n.availability.availability==="degraded"?null:RS[n.availability.availability]}}function Vg(n){return n.replaceAll("_"," ")}const Pi={user:"User",assistant:"Assistant",tool_call:"Tool call",tool_result:"Tool result",approval_request:"Approval requested",approval_resolution:"Approval resolved",error:"Error",lifecycle:"Lifecycle",usage:"Usage",reasoning:"Reasoning summary",unknown:"Unknown event"};function Dl(n){switch(n.kind){case"user":case"assistant":return n.content;case"lifecycle":return n.state;case"tool_call":return`${n.toolName} · ${n.callId}
11
+ ${n.summary}`;case"tool_result":return`${n.toolName} · ${n.callId} · ${n.outcome}
12
+ ${n.summary}`;case"approval_request":return`${n.action}
13
+ Risk: ${n.risk} · Approval: ${n.approvalId}`;case"approval_resolution":return`${n.decision}
14
+ Approval: ${n.approvalId}`;case"error":return`${n.code} · ${n.retryable?"retryable":"not retryable"}
15
+ ${n.message}`;case"usage":return[`Completeness: ${n.completeness}`,`Input tokens: ${n.inputTokens??"unknown"}`,`Output tokens: ${n.outputTokens??"unknown"}`,`Cached input tokens: ${n.cachedInputTokens??"unknown"}`,`Reasoning tokens: ${n.reasoningTokens??"unknown"}`].join(`
16
+ `);case"reasoning":return n.summary;case"unknown":return`${n.originalKind}
17
+ ${n.summary}`}}function Zg(n){return n.kind==="__sys"}function Yg(n){return n.kind==="tool_card"}function ES(n){if(n.result===null)return"pending";const a=n.result.event;return a.kind==="tool_result"?a.outcome:"pending"}function TS(n,a){if(n.event.kind!==a.event.kind)return!1;switch(n.event.kind){case"lifecycle":return a.event.kind!=="lifecycle"?!1:n.event.state===a.event.state;case"usage":return a.event.kind!=="usage"?!1:n.event.completeness===a.event.completeness&&n.event.inputTokens===a.event.inputTokens&&n.event.outputTokens===a.event.outputTokens&&n.event.cachedInputTokens===a.event.cachedInputTokens&&n.event.reasoningTokens===a.event.reasoningTokens;case"reasoning":return a.event.kind!=="reasoning"?!1:n.event.summary===a.event.summary;case"unknown":return a.event.kind!=="unknown"?!1:n.event.originalKind===a.event.originalKind&&n.event.summary===a.event.summary&&n.event.forwardCaptured===a.event.forwardCaptured;default:return!1}}function CS(n){const a=new Map;for(const f of n)a.set(f.toolName,(a.get(f.toolName)??0)+1);const i=[...a.entries()].sort((f,p)=>p[1]!==f[1]?p[1]-f[1]:f[0].localeCompare(p[0])),r=n.length,u=i.map(([f,p])=>`${String(p)} ${f}`);return`${String(r)} tool${r===1?"":"s"} · ${u.join(", ")}`}function OS(n){const a=[],i=new Map;for(const r of n)switch(r.event.kind){case"user":a.push({kind:"message",role:"user",event:r});break;case"assistant":a.push({kind:"message",role:"assistant",event:r});break;case"tool_call":{const u={kind:"tool_card",callId:r.event.callId,toolName:r.event.toolName,call:r,result:null,fidelityEvents:[r]};i.set(r.event.callId,u),a.push(u);break}case"tool_result":{const u=i.get(r.event.callId);if(u!==void 0){const f={...u,result:r,fidelityEvents:[...u.fidelityEvents,r]};i.set(r.event.callId,f);const p=a.lastIndexOf(u);p>=0&&(a[p]=f)}else{const f={kind:"tool_card",callId:r.event.callId,toolName:r.event.toolName,call:r,result:r,fidelityEvents:[r]};i.set(r.event.callId,f),a.push(f)}break}case"approval_request":case"approval_resolution":a.push({kind:"approval",event:r});break;case"error":a.push({kind:"error",event:r});break;case"reasoning":a.push({kind:"reasoning",event:r});break;case"lifecycle":case"usage":case"unknown":a.push({kind:"__sys",event:r});break;default:a.push({kind:"__sys",event:r});break}return{stream:a}}function kS(n){const a=[];let i=0;for(;i<n.length;){const r=n[i];if(r!==void 0&&Yg(r)){const u=[];let f=i;for(;f<n.length;){const m=n[f];if(m===void 0||!Yg(m))break;u.push(m),f+=1}let p=0;for(;p<u.length;){const m=[];for(;p<u.length;){const g=u[p];if(g===void 0||ES(g)!=="succeeded")break;m.push(g),p+=1}if(m.length>=3)a.push({kind:"tool_group",cards:m,summary:CS(m)});else for(const g of m)a.push(g);if(p<u.length){const g=u[p];g!==void 0&&(a.push(g),p+=1)}}i=f}else r!==void 0&&a.push(r),i+=1}return a}function MS(n){const a=[];let i=0;for(;i<n.length;){const r=n[i];if(r!==void 0&&Zg(r)){const u=[r.event];let f=i+1;for(;f<n.length;){const v=n[f];if(v===void 0||!Zg(v)||!TS(r.event,v.event))break;u.push(v.event),f+=1}const p=r.event.event.kind,m=Pi[p]??p,g=u.length>1?[u[0].sequence,u[u.length-1].sequence]:null;a.push({kind:"system_note",events:u,eventKind:p,label:m,sequenceRange:g}),i=f}else if(r!==void 0&&r.kind==="reasoning"){const u=r.event;let f=i+1;for(;f<n.length;){const p=n[f];if(p===void 0||p.kind!=="reasoning")break;const m=u.event.kind==="reasoning"?u.event.summary:"",g=p.event.event.kind==="reasoning"?p.event.event.summary:"";if(m!==g)break;f+=1}a.push({kind:"reasoning",event:u}),i=f}else r!==void 0&&a.push(r),i+=1}return a}function zS(n){const a=u_(n).events,{stream:i}=OS(a),r=kS(i);return{items:MS(r)}}const Ka=500;function LS(n,a){return n.length<=a?n:n.slice(n.length-a)}function DS(n){switch(n.owner.family){case"workflow":return n.owner.runGeneration;case"activity":return n.owner.activityGeneration;case"context":return n.owner.contextGeneration}}function d_(n){return[n.truncation==="none"?null:`${n.truncation[0]?.toUpperCase()}${n.truncation.slice(1)} truncated`,n.completeness==="complete"?null:`${n.completeness[0]?.toUpperCase()}${n.completeness.slice(1)}`,n.redaction.status==="redacted"?`Redacted ${String(n.redaction.count)}`:null,...n.parseWarnings.map(a=>a.replaceAll("_"," "))].filter(a=>a!==null)}function mf({events:n}){const a=[],i=new Set;for(const r of n)for(const u of d_(r))i.has(u)||(i.add(u),a.push(u));return a.length===0?null:o.jsx("ul",{"aria-label":"Event fidelity",className:"session-log-viewer__fidelity",children:a.map(r=>o.jsx("li",{children:r},r))})}function IS({entry:n,view:a}){const i=Dl(n.event),r=n.event.kind==="user"||n.event.kind==="assistant",u=Pi[n.event.kind],f=n.event.kind==="user"?"You":n.event.kind==="assistant"?"Assistant":u;return o.jsxs("li",{className:`session-log-viewer__event session-log-viewer__event--${r?"message":"system"}`,"data-event-kind":n.event.kind,"data-message-role":r?n.event.kind:void 0,"data-presentation":r?"message":"system","data-sequence":n.sequence,"data-testid":a==="timeline"?"session-log-event":"session-log-conversation-event",children:[o.jsxs("header",{className:"session-log-viewer__event-header",children:[o.jsxs("span",{className:"session-log-viewer__sequence",children:["#",n.sequence]}),o.jsx("strong",{className:"session-log-viewer__speaker",children:f}),o.jsx(mf,{events:[n]}),o.jsx("time",{"aria-label":"Event timestamp",dateTime:n.timestamp,title:n.timestamp,children:n.timestamp.slice(11,19)})]}),i.length===0?null:o.jsxs("div",{className:"session-log-viewer__event-body",children:[o.jsx(Ls,{label:`Copy ${u}`,text:i}),o.jsx(p_,{text:i})]})]})}function US({entries:n,view:a}){return o.jsx("ol",{"aria-label":a==="timeline"?"Session log timeline":"Session log conversation",className:`session-log-viewer__events session-log-viewer__events--${a}`,children:n.map(i=>o.jsx(IS,{entry:i,view:a},i.sequence))})}function f_(n){return n.result===null?"pending":n.result.event.kind==="tool_result"?n.result.event.outcome:"pending"}function qS(n){if(n.result===null)return"running";const a=n.result.event.kind==="tool_result"?n.result.event.outcome:"succeeded";return a==="succeeded"?"ok":a}function $S(n){return n.length<=150&&n.split(`
18
+ `).length<=3}function h_({card:n,status:a}){const i=Dl(n.call.event),r=i.includes(`
19
+ `)?i.slice(i.indexOf(`
20
+ `)+1):i,u=r.trim().length===0?n.toolName:r,f=n.result===null?null:Dl(n.result.event),p=f===null?null:f.includes(`
21
+ `)?f.slice(f.indexOf(`
22
+ `)+1):f,m=p!==null&&p.trim().length>0,g=p===null?!1:$S(p),[v,y]=j.useState(m&&g),b=m&&!g,T=p===null?0:p.split(`
23
+ `).length,N=n.result??n.call;return o.jsxs("div",{className:"session-log-viewer__tool-card-row",children:[o.jsx("span",{"aria-hidden":"true",className:"session-log-viewer__tool-card-dot","data-status":a}),o.jsx("span",{className:"session-log-viewer__tool-card-head",title:u,children:u}),o.jsx(HS,{events:n.fidelityEvents}),o.jsx("span",{className:"session-log-viewer__tool-card-meta",children:`#${String(n.call.sequence)} · ${qS(n)} · ${N.timestamp.slice(11,19)}`}),b?o.jsx("button",{"aria-expanded":v,className:"session-log-viewer__tool-card-output-toggle",onClick:()=>y(C=>!C),type:"button",children:v?"hide output":`output · ${String(T)} lines`}):null,m&&v?o.jsx("pre",{className:"session-log-viewer__content session-log-viewer__tool-card-output",children:p}):null]})}function HS({events:n}){const a=[],i=new Set;for(const r of n)for(const u of d_(r))i.has(u)||(i.add(u),a.push(u));return a.length===0?null:o.jsx("ul",{"aria-label":"Event fidelity",className:"session-log-viewer__tool-card-fidelity",children:a.map(r=>o.jsx("li",{children:r},r))})}function p_({text:n}){const i=`message-content-${j.useId()}`,r=j.useRef(null),[u,f]=j.useState(!1),[p,m]=j.useState(!1);return j.useLayoutEffect(()=>{const g=r.current;if(g===null)return;const v=()=>{const b=g.scrollHeight,T=ZS(g);f(b>T+VS)};v();const y=typeof ResizeObserver>"u"?null:new ResizeObserver(v);return y!==null&&y.observe(g),()=>y?.disconnect()},[n]),o.jsxs("div",{className:"session-log-viewer__message-content","data-collapsed":(!p&&u).toString(),children:[o.jsx("pre",{className:"session-log-viewer__content",id:i,ref:r,children:n}),u?o.jsx("button",{"aria-controls":i,"aria-expanded":p,className:"session-log-viewer__message-toggle",onClick:()=>m(g=>!g),type:"button",children:p?"collapse":`show all · ${GS(n.length)}`}):null]})}function GS(n){return n<1024?`${String(n)} B`:`${(n/1024).toFixed(1)} KiB`}const BS=7.5,VS=4;function ZS(n){const a=Number.parseFloat(getComputedStyle(n).fontSize);return BS*(Number.isFinite(a)?a:16)}function YS({item:n}){const a=n.event,i=Dl(a.event),r=Pi[a.event.kind],u=n.role==="user"?"You":"Assistant";return o.jsxs("li",{className:"session-log-viewer__event session-log-viewer__event--message","data-event-kind":a.event.kind,"data-message-role":n.role,"data-sequence":a.sequence,"data-testid":"session-log-conversation-event",children:[o.jsxs("header",{className:"session-log-viewer__event-header",children:[o.jsxs("span",{className:"session-log-viewer__sequence",children:["#",a.sequence]}),o.jsx("strong",{className:"session-log-viewer__speaker",children:u}),o.jsx("time",{"aria-label":"Event timestamp",dateTime:a.timestamp,title:a.timestamp,children:a.timestamp.slice(11,19)}),o.jsx(mf,{events:[a]}),i.length===0?null:o.jsx("span",{className:"session-log-viewer__message-copy",children:o.jsx(Ls,{label:`Copy ${r}`,text:i})})]}),i.length===0?null:o.jsx(p_,{text:i})]})}function XS({card:n}){const a=f_(n);return o.jsx("li",{className:"session-log-viewer__tool-card","data-event-kind":"tool_call","data-sequence":n.call.sequence,"data-status":a,"data-testid":"session-log-conversation-tool",children:o.jsx(h_,{card:n,status:a})})}function KS({group:n}){const[a,i]=j.useState(!1),r=n.cards[0],u=n.cards[n.cards.length-1],f=r!==void 0&&u!==void 0?`#${String(r.call.sequence)}–#${String(u.call.sequence)}`:"",m=`tool-group-${j.useId()}`;return o.jsxs("li",{className:"session-log-viewer__tool-group","data-testid":"session-log-conversation-group",children:[o.jsxs("div",{className:"session-log-viewer__tool-group-row",children:[o.jsx("span",{"aria-hidden":"true",className:"session-log-viewer__tool-group-dot"}),o.jsx("span",{className:"session-log-viewer__tool-group-head",children:n.summary}),o.jsx("span",{className:"session-log-viewer__tool-group-meta",children:f}),o.jsx("button",{"aria-controls":m,"aria-expanded":a,className:"session-log-viewer__tool-group-toggle",onClick:()=>i(g=>!g),type:"button",children:a?"collapse":"expand"})]}),a?o.jsx("ul",{className:"session-log-viewer__tool-group-children",id:m,children:n.cards.map(g=>{const v=f_(g);return o.jsx("li",{className:"session-log-viewer__tool-card session-log-viewer__tool-card--grouped","data-event-kind":"tool_call","data-key":g.callId,"data-sequence":g.call.sequence,"data-status":v,"data-testid":"session-log-conversation-tool",children:o.jsx(h_,{card:g,status:v})},g.callId)})}):null]})}function QS({note:n}){const a=n.events[0],i=n.events[n.events.length-1],r=n.sequenceRange===null?null:n.sequenceRange[1]-n.sequenceRange[0]+1,u=n.sequenceRange===null?`#${String(a?.sequence??0)}`:`#${String(n.sequenceRange[0])}–#${String(n.sequenceRange[1])}`,f=JS(n),p=i===void 0?"":i.timestamp.slice(11,19),m=r===null?` · ${p}`:` · ×${String(r)}`;return o.jsxs("li",{className:"session-log-viewer__system-rail","data-event-kind":n.eventKind,"data-testid":"session-log-conversation-system",...n.sequenceRange?{"data-sequence-range":`${n.sequenceRange[0]}-${n.sequenceRange[1]}`}:{},children:[o.jsx("span",{className:"session-log-viewer__system-rail-dot","aria-hidden":"true"}),o.jsx("span",{className:"session-log-viewer__system-rail-seq",children:`${u} · `}),o.jsx("span",{className:"session-log-viewer__system-rail-label",children:n.label}),f.length===0?null:o.jsx("span",{className:"session-log-viewer__system-rail-detail",children:` · ${f}${m}`})]})}function JS(n){const a=n.events[0];if(a===void 0)return"";switch(a.event.kind){case"lifecycle":return a.event.state;case"usage":return`Input tokens: ${a.event.inputTokens??"unknown"}`;case"unknown":return`${a.event.originalKind} — unrecognized provider event omitted`;default:return""}}function FS({item:n}){const a=n.event,i=Dl(a.event),r=Pi[a.event.kind];return o.jsxs("li",{className:"session-log-viewer__event session-log-viewer__event--reasoning","data-event-kind":a.event.kind,"data-sequence":a.sequence,"data-testid":"session-log-conversation-reasoning",children:[o.jsxs("header",{className:"session-log-viewer__event-header",children:[o.jsxs("span",{className:"session-log-viewer__sequence",children:["#",a.sequence]}),o.jsx("strong",{className:"session-log-viewer__speaker",children:r}),o.jsx("time",{"aria-label":"Event timestamp",dateTime:a.timestamp,title:a.timestamp,children:a.timestamp.slice(11,19)})]}),i.length===0?null:o.jsx("pre",{className:"session-log-viewer__content",children:i})]})}function Xg({event:n,testId:a,eventKindAttr:i,decision:r}){const u=Dl(n.event),f=Pi[n.event.kind];return o.jsxs("li",{className:"session-log-viewer__event session-log-viewer__event--system","data-event-kind":i,"data-decision":r??void 0,"data-sequence":n.sequence,"data-testid":a,children:[o.jsxs("header",{className:"session-log-viewer__event-header",children:[o.jsxs("span",{className:"session-log-viewer__sequence",children:["#",n.sequence]}),o.jsx("strong",{className:"session-log-viewer__speaker",children:f}),o.jsx("time",{"aria-label":"Event timestamp",dateTime:n.timestamp,title:n.timestamp,children:n.timestamp.slice(11,19)})]}),u.length===0?null:o.jsxs("div",{className:"session-log-viewer__event-body",children:[o.jsx(Ls,{label:`Copy ${f}`,text:u}),o.jsx("pre",{className:"session-log-viewer__content",children:u})]}),o.jsx(mf,{events:[n]})]})}function WS(n){switch(n.kind){case"message":return`message-${n.event.sequence}`;case"reasoning":return`reasoning-${n.event.sequence}`;case"tool_card":return`tool-${n.callId}`;case"tool_group":return`group-${n.cards[0]?.callId??"0"}-group`;case"system_note":return`system-${n.eventKind}-${n.events[0]?.sequence??0}`;case"error":return`error-${n.event.sequence}`;case"approval":return`approval-${n.event.sequence}`}}function PS({item:n}){switch(n.kind){case"message":return o.jsx(YS,{item:n});case"reasoning":return o.jsx(FS,{item:n});case"tool_card":return o.jsx(XS,{card:n});case"tool_group":return o.jsx(KS,{group:n});case"system_note":return o.jsx(QS,{note:n});case"error":return o.jsx(Xg,{decision:null,event:n.event,eventKindAttr:"error",testId:"session-log-conversation-error"});case"approval":{const a=n.event.event.kind==="approval_resolution"?n.event.event.decision:null;return o.jsx(Xg,{decision:a,event:n.event,eventKindAttr:n.event.event.kind,testId:"session-log-conversation-approval"})}}}function ej({hiddenEarlierCount:n,items:a,onShowEarlier:i}){return o.jsxs(o.Fragment,{children:[n===0?null:o.jsx("button",{className:"session-log-viewer__more session-log-viewer__earlier",onClick:i,type:"button",children:`show earlier ${String(Math.min(Ka,n))} events`}),o.jsx("div",{"aria-label":"Session log conversation",className:"session-log-viewer__conversation-scroll","data-testid":"session-log-conversation-scroller",role:"region",tabIndex:0,children:o.jsx("ol",{className:"session-log-viewer__events session-log-viewer__events--conversation",children:a.map(r=>o.jsx(PS,{item:r},WS(r)))})})]})}function tj({page:n}){const i=`${j.useId()}-session-log-title`,[r,u]=j.useState("conversation"),[f,p]=j.useState(Ka),[m,g]=j.useState(Ka),v=`${n.owner.family}\0${DS(n)}\0${n.lane.laneId}`;j.useEffect(()=>{p(Ka),g(Ka)},[v]);const y=u_(n),b=LS(y.events,f),T=y.events.slice(0,m),N=y.events.length-b.length,C=y.events.length-T.length,R=zS({...n,events:b}),L=r==="timeline"?T:b,q=r==="timeline"?"Session timeline":"Session conversation",O=y.events.length>0,Y=y.availabilityState==="available"&&y.gapMessage===null,A=y.unavailableMessage===null&&O;return o.jsxs("section",{className:"session-log-viewer","aria-labelledby":i,children:[o.jsxs("header",{className:"session-log-viewer__heading",children:[o.jsx("h2",{id:i,className:"session-log-viewer__heading-specimen",children:q}),o.jsx("p",{className:"session-log-viewer__heading-caption",children:"observability only · redacted per-turn transcript"})]}),o.jsx("section",{"aria-label":"Session log availability",className:Y?"session-log-viewer__availability session-log-viewer__availability--compact":"session-log-viewer__availability","data-availability":y.availabilityState,"data-compact":Y.toString(),role:"status",children:Y?o.jsxs(o.Fragment,{children:[o.jsx("span",{"aria-hidden":"true",className:"session-log-viewer__availability-dot"}),o.jsx("span",{className:"session-log-viewer__availability-word",children:"available"}),o.jsx("span",{className:"session-log-viewer__cursor",children:y.cursorLabel}),A?o.jsx("p",{className:"session-log-viewer__guarantee",children:"redaction-checked at capture · exceptions flagged inline"}):null]}):o.jsxs(o.Fragment,{children:[o.jsx("strong",{children:y.availabilityLabel}),y.reasons.length===0?null:o.jsx("ul",{className:"session-log-viewer__badges","aria-label":"Availability reasons",children:y.reasons.map($=>o.jsx("li",{children:$},$))}),y.gapMessage===null?null:o.jsx("p",{className:"session-log-viewer__gap",children:y.gapMessage}),y.unavailableMessage===null?null:o.jsx("p",{className:"session-log-viewer__unavailable",children:y.unavailableMessage}),o.jsx("p",{className:"session-log-viewer__cursor",children:y.cursorLabel}),A?o.jsx("p",{className:"session-log-viewer__guarantee",children:"redaction-checked at capture · exceptions flagged inline"}):null]})}),y.unavailableMessage!==null?null:O?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"session-log-viewer__window-row",children:o.jsx("p",{className:"session-log-viewer__window",role:"status",children:r==="conversation"&&N>0?`Showing latest ${String(L.length)} of ${String(y.events.length)} events.`:`Showing ${String(L.length)} of ${String(y.events.length)} events.`})}),o.jsx(Ko,{activeTabId:r,ariaLabel:"Session log views",onChange:u,tabs:[{id:"conversation",label:"conversation",panel:o.jsx(ej,{hiddenEarlierCount:N,items:R.items,onShowEarlier:()=>p($=>Math.min($+Ka,y.events.length))})},{id:"timeline",label:"timeline",panel:o.jsx("div",{className:"session-log-viewer__timeline-scroll",children:o.jsx(US,{entries:T,view:"timeline"})})}]}),r!=="timeline"||C===0?null:o.jsx("button",{className:"session-log-viewer__more",onClick:()=>g($=>Math.min($+Ka,y.events.length)),type:"button",children:`show next ${String(Math.min(Ka,C))} events`})]}):o.jsx("p",{className:"session-log-viewer__empty",children:"No session events were captured for this lane."})]})}const nj=o_();function aj(n){return n.family==="workflow"?[n.family,n.runId,n.runGeneration,n.stageId,n.callId].join("\0"):n.family==="activity"?[n.family,n.activityId,n.activityGeneration].join("\0"):"runId"in n?[n.family,n.runId,n.runGeneration,n.contextRunId].join("\0"):[n.family,n.contextRunId,n.contextGeneration].join("\0")}function sj(n){const a=n.owner;return a.family==="workflow"?`Workflow attempt ${String(a.attempt)}`:a.family==="activity"?`Activity turn ${a.turnId??n.lane.laneId}`:[`Context ${a.executor==="finalizer"?"finalizer":"curator"}`,`execution ${a.executionId??n.lane.laneId}`,`attempt ${String(a.attempt)}`].join(" · ")}function lj(n){switch(n){case"loading_index":return"Discovering session log lanes…";case"loading_page":return"Loading session log events…";case"not_retained":return"This session log was not retained.";case"missing":return"This session log lane is no longer retained.";case"unavailable":return"Session log storage is temporarily unavailable.";case"obsolete":return"The selected generation changed; obsolete events were discarded.";case"error":return"The session log could not be loaded.";case"ready":return null}}function Jo({api:n=nj,onGenerationChanged:a,scope:i}){const r=aj(i),u=j.useMemo(()=>i,[r]),f=j.useMemo(()=>NS(n),[n]),p=j.useRef(a),[m,g]=j.useState("loading_index"),[v,y]=j.useState([]),[b,T]=j.useState(null),[N,C]=j.useState(null);j.useEffect(()=>{p.current=a},[a]),j.useEffect(()=>{const L=new AbortController;return g("loading_index"),y([]),T(null),C(null),f.discover(u,null,L.signal).then(q=>{if(!L.signal.aborted){if(q.index.availability.availability==="not_retained"){g("not_retained");return}y(q.lanes),T(q.selectedLane?.lane.laneId??null)}}).catch(q=>{L.signal.aborted||(q instanceof Xe&&q.kind==="generation_changed"?(g("obsolete"),p.current?.()):q instanceof Xe&&q.kind==="unavailable"?g("unavailable"):q instanceof Xe&&q.kind==="aborted"||g("error"))}),()=>L.abort()},[f,r,u]),j.useEffect(()=>{if(b===null)return;const L=v.find(({lane:O})=>O.laneId===b);if(L===void 0)return;const q=new AbortController;return g("loading_page"),C(null),f.loadLane(u,L,q.signal).then(O=>{q.signal.aborted||(C(O),g("ready"))}).catch(O=>{q.signal.aborted||(O instanceof Xe&&O.kind==="generation_changed"?(g("obsolete"),p.current?.()):O instanceof Xe&&O.kind==="missing"?g("missing"):O instanceof Xe&&O.kind==="unavailable"?g("unavailable"):O instanceof Xe&&O.kind==="aborted"||g("error"))}),()=>q.abort()},[f,v,b,u]);const R=lj(m);return o.jsxs("section",{"aria-busy":m==="loading_index"||m==="loading_page","aria-label":"Session log panel",className:"session-log-panel",children:[v.length<=1?null:o.jsxs("div",{"aria-label":"Session log lane",className:"session-log-panel__lane-chips",role:"group",children:[o.jsx("span",{className:"session-log-panel__lane-chips-label",children:"Session log lane"}),v.map(L=>{const q=L.lane.laneId,O=b===q;return o.jsx("button",{"aria-pressed":O,className:"session-log-panel__lane-chip",onClick:()=>T(q),type:"button",children:sj(L)},q)})]}),R===null?null:o.jsx("p",{role:m==="error"?"alert":"status",children:R}),m==="ready"&&N!==null?o.jsx(tj,{page:N}):null]})}const ij=w0(),xo={};function rj(){return{input:kl(),output:kl(),error:kl(),artifact:kl()}}function oj(n){return n instanceof En?n.code==="run_state_changed"?"run_state_changed":n.code==="content_too_large_for_dashboard"?"content_too_large_for_dashboard":n.code==="not_found"?"not_found":n.kind==="auth_expired"?"auth_expired":n.kind==="connection_changed"?"connection_changed":n.kind==="offline"?"offline":"request_error":"request_error"}function cj({content:n,kind:a,label:i}){const[r,u]=j.useState("rendered"),f=j.useMemo(()=>O0(n.content),[n.content]),p={input:"Prompt",output:"Output",error:"Error",artifact:"Artifact"};return o.jsxs("section",{className:"persisted-call-inspector__loaded-pane",children:[o.jsxs("header",{className:"persisted-call-inspector__content-heading",children:[o.jsx("h3",{children:p[a]}),o.jsxs("p",{children:[i," · ",n.mediaType]})]}),o.jsx(Ko,{activeTabId:r,ariaLabel:`${i} representation`,onChange:u,tabs:[{id:"rendered",label:"rendered",panel:o.jsxs("div",{className:"persisted-call-inspector__representation","data-representation":"rendered","data-value-kind":f.kind,children:[o.jsxs("div",{className:"persisted-call-inspector__representation-header",children:[o.jsx("p",{className:"persisted-call-inspector__format",children:f.kind==="json"?"bounded json":"escaped text"}),o.jsx(Ls,{label:`Copy ${i}`,text:n.content})]}),o.jsx(ks,{children:f.rendered}),f.truncated?o.jsx("p",{className:"persisted-call-inspector__notice",role:"status",children:"Rendered JSON reached the viewer depth or node limit. Raw persisted content remains available."}):null]})},{id:"raw",label:"raw",panel:o.jsxs("div",{className:"persisted-call-inspector__representation","data-representation":"raw",children:[o.jsx("div",{className:"persisted-call-inspector__representation-header",children:o.jsx(Ls,{label:`Copy ${i}`,text:n.content})}),o.jsx(ks,{children:n.content})]})}]}),o.jsx("p",{className:"persisted-call-inspector__pane-foot",children:"bounded persisted content · byte-capped · loaded per pane on demand"})]})}function uj({kind:n,label:a,onRetry:i,state:r}){return r===void 0||r.status==="loading"?o.jsxs("p",{role:"status",children:["Loading ",a,"…"]}):r.status==="error"?o.jsxs("div",{className:"persisted-call-inspector__pane-state",children:[o.jsx("p",{role:"alert",children:E0(r.failure)}),o.jsxs("button",{onClick:i,type:"button",children:["Retry ",a]})]}):o.jsx(cj,{content:r.content,kind:n,label:a})}function dj({api:n=ij,applicationRootId:a,call:i,callNavigation:r,onClose:u,onObsoleteSelection:f,open:p,selection:m,sessionLogApi:g}){const v=i,y=A0(v),T=`${[m.runId,m.runGeneration,i.stageId,i.callId].join("\0")}\0${p?"open":"closed"}`,N=y[0]?.kind??(g===void 0?null:"conversation"),[C,R]=j.useState({identity:T,pane:N}),L=C.identity===T?C.pane:N,q=L==="conversation"?g===void 0?N:L:L!==null&&y.some(({kind:ee})=>ee===L)?L:N,O=j.useCallback(ee=>{R({identity:T,pane:ee})},[T]),Y=`${m.runId}\0${m.runGeneration}\0${m.stateRevision}`,[A,$]=j.useState({identity:Y,states:xo}),ae=A.identity===Y?A.states:xo,te=j.useCallback(ee=>{$(fe=>({identity:Y,states:ee(fe.identity===Y?fe.states:xo)}))},[Y]),he=j.useRef(rj()),re="persisted-call-inspector-title",ye=j.useCallback(()=>{for(const ee of Object.values(he.current))ee.cancel()},[]);j.useEffect(()=>{ye(),te(()=>xo)},[ye,m.stateRevision,te]),j.useEffect(()=>ye,[ye]),j.useEffect(()=>{if(!p||r===void 0)return;const ee=fe=>{const S=fe.target;S instanceof HTMLElement&&(S.isContentEditable||S.closest("pre,textarea,input,[contenteditable]")!==null)||(fe.key==="ArrowLeft"?(fe.preventDefault(),r.onStepCall(-1)):fe.key==="ArrowRight"&&(fe.preventDefault(),r.onStepCall(1)))};return document.addEventListener("keydown",ee),()=>document.removeEventListener("keydown",ee)},[r,p]);const me=j.useCallback(ee=>{const fe=he.current[ee],S=fe.begin(m);te(U=>({...U,[ee]:{status:"loading"}})),n.readPane({...m,stageId:i.stageId,callId:i.callId,kind:ee},S.signal).then(U=>{if(fe.accepts(S.identity,m)){if(!fe.acceptsEtag(S.identity,U.etag)){te(K=>({...K,[ee]:{status:"error",failure:"obsolete_etag"}}));return}te(K=>({...K,[ee]:{status:"loaded",content:U}}))}}).catch(U=>{if(fe.accepts(S.identity,m)){if(U instanceof En&&U.code==="run_generation_changed"){f(),u();return}U instanceof En&&U.kind==="aborted"||te(K=>({...K,[ee]:{status:"error",failure:oj(U)}}))}})},[n,i.callId,i.stageId,u,f,m,te]);j.useEffect(()=>{!p||q===null||q==="conversation"||ae[q]!==void 0||me(q)},[q,me,p,ae]);const G=R0(v),ge=r!==void 0&&r.total>1&&r.position>=1&&r.position<=r.total,_e=ge&&r.position>1,W=ge&&r.position<r.total,z=j.useCallback(ee=>{r!==void 0&&(ee===-1&&!_e||ee===1&&!W||r.onStepCall(ee))},[r,W,_e]),X=j.useCallback(()=>{f(),u()},[u,f]),F=[...y.map(ee=>({id:ee.kind,label:ee.label,panel:o.jsx(uj,{kind:ee.kind,label:ee.label,onRetry:()=>me(ee.kind),state:ae[ee.kind]})})),...g===void 0?[]:[{id:"conversation",label:"conversation",panel:o.jsxs(o.Fragment,{children:[o.jsx(Jo,{api:g,onGenerationChanged:X,scope:{family:"workflow",runId:m.runId,runGeneration:m.runGeneration,stageId:i.stageId,callId:i.callId}}),o.jsx("p",{className:"persisted-call-inspector__pane-foot",children:"redacted per-attempt session transcript · secret patterns scrubbed at capture · observability only, never replayed"})]})}]];return o.jsxs(af,{applicationRootId:a,labelledBy:re,onClose:u,open:p,panelClassName:"accessible-dialog--sheet",children:[o.jsx("button",{"aria-label":"close inspector",className:"persisted-call-inspector__grab-handle",onClick:u,type:"button",children:o.jsx("span",{"aria-hidden":"true"})}),o.jsxs("header",{className:"persisted-call-inspector__header",children:[o.jsxs("div",{className:"persisted-call-inspector__heading",children:[o.jsx("h2",{className:"visually-hidden",id:re,children:"Call inspector"}),o.jsxs("div",{className:"persisted-call-inspector__title-line",children:[o.jsx("strong",{children:i.callId}),i.snapshotIdentity===void 0?null:o.jsxs("span",{className:"persisted-call-inspector__identity-badge",children:[i.snapshotIdentity.adapter," · ",i.snapshotIdentity.role]}),o.jsx("span",{className:"persisted-call-inspector__status","data-state":i.state,children:i.state}),ge?o.jsxs("span",{className:"persisted-call-inspector__call-nav",children:[o.jsx("button",{"aria-label":"previous call",className:"persisted-call-inspector__call-nav-btn",disabled:!_e,onClick:()=>z(-1),title:"previous call (←)",type:"button",children:"‹"}),o.jsxs("span",{className:"persisted-call-inspector__call-nav-label",children:[String(r.position)," / ",String(r.total)]}),o.jsx("button",{"aria-label":"next call",className:"persisted-call-inspector__call-nav-btn",disabled:!W,onClick:()=>z(1),title:"next call (→)",type:"button",children:"›"})]}):null]}),o.jsxs("div",{className:"persisted-call-inspector__meta-line",children:[o.jsxs("p",{className:"persisted-call-inspector__identity",children:["run ",m.runId," · stage ",i.stageId,i.durationMs===void 0?"":` · duration ${Gn(i.durationMs)}`]}),o.jsx("span",{className:"persisted-call-inspector__close-hint",children:"esc to close"})]})]}),o.jsx("button",{"aria-label":"Close inspector",className:"persisted-call-inspector__close",onClick:u,type:"button",children:"×"})]}),o.jsxs("div",{className:"persisted-call-inspector__body",children:[o.jsxs("p",{className:"persisted-call-inspector__scope-note",children:["persisted call content is separate from the redacted per-attempt session log",i.hasWorkflowInput?" · workflow input is not the fully composed provider prompt":""]}),G?o.jsx("p",{className:"persisted-call-inspector__notice",role:"status",children:G}):null,F.length===0||q===null?o.jsx("p",{className:"persisted-call-inspector__empty",children:"No persisted call content is available."}):o.jsx(Ko,{activeTabId:q,ariaLabel:"Persisted call content",onChange:ee=>O(ee),tabs:F})]})]})}function So({detail:n,detailAriaLabel:a="Run detail",listAriaLabel:i="Workflow runs",mobileView:r,runList:u}){return o.jsxs("div",{className:"dashboard-layout","data-mobile-view":r,children:[o.jsx("section",{className:"dashboard-layout__run-list overflow-safe","aria-label":i,children:u}),o.jsx("section",{className:"dashboard-layout__detail overflow-safe","aria-label":a,children:n})]})}function fj({children:n,label:a}){return o.jsx("div",{className:"mobile-chart-scroll","aria-label":a,role:"region",tabIndex:0,children:o.jsx("div",{className:"mobile-chart-scroll__canvas",children:n})})}function tn({children:n}){return o.jsx("span",{className:"overflow-safe",children:n})}const m_=new Set(["unauthorized","invalid_request","method_not_allowed","host_rejected","origin_rejected","agent_instance_changed","not_found","dashboard_busy","run_directory_limit_exceeded","scan_byte_budget_exceeded","projection_cache_budget_exceeded","live_run_limit_exceeded","artifact_catalog_limit_exceeded","run_generation_changed","run_state_changed","activity_generation_changed","activity_state_changed","content_too_large_for_dashboard","progress_report_malformed","progress_report_overrides_unavailable","internal_error"]);class P extends Error{kind;status;code;constructor(a,i,r){super(a),this.name="DashboardApiError",this.kind=a,this.status=i,this.code=r}}function Za(n){return n??new AbortController().signal}async function El(n,a,i){let r;try{r=await n(a,{signal:i})}catch(u){throw u instanceof qe?new P("connection_changed",409,"agent_instance_changed"):i.aborted||u instanceof DOMException&&u.name==="AbortError"?new P("aborted"):new P("offline")}if(r.status===401)throw new P("auth_expired",401,"unauthorized");if(!r.ok){let u;try{const f=await nn(r);typeof f.error?.code=="string"&&m_.has(f.error.code)&&(u=f.error.code)}catch(f){if(f instanceof qe)throw new P("connection_changed",409,"agent_instance_changed")}throw u==="agent_instance_changed"?new P("connection_changed",r.status,u):new P("request_error",r.status,u)}try{return await nn(r)}catch(u){throw u instanceof qe?new P("connection_changed",409,"agent_instance_changed"):new P("request_error",r.status)}}async function Kg(n,a,i){let r;try{r=await n(a,{signal:i})}catch(u){throw u instanceof qe?new P("connection_changed",409,"agent_instance_changed"):i.aborted||u instanceof DOMException&&u.name==="AbortError"?new P("aborted"):new P("offline")}if(r.status===401)throw new P("auth_expired",401,"unauthorized");if(!r.ok){let u;try{const f=await nn(r);typeof f.error?.code=="string"&&m_.has(f.error.code)&&(u=f.error.code)}catch(f){if(f instanceof qe)throw new P("connection_changed",409,"agent_instance_changed")}throw u==="agent_instance_changed"?new P("connection_changed",r.status,u):new P("request_error",r.status,u)}try{return{content:await uf(r),mediaType:r.headers.get("content-type")?.toLowerCase().startsWith("application/json")?"application/json":"text/plain",etag:r.headers.get("etag")}}catch(u){throw u instanceof qe?new P("connection_changed",409,"agent_instance_changed"):new P("request_error",r.status)}}function g_(n=_a){return{async getRunDetailCurrent(a,i){return await El(n,`/api/runs/${encodeURIComponent(a)}`,Za(i))},async getActivityDetailCurrent(a,i){return await El(n,`/api/activities/${encodeURIComponent(a)}`,Za(i))},async listActivities(a={}){const i=new URLSearchParams({limit:"100"});return a.before!==void 0&&i.set("before",a.before),await El(n,`/api/activities?${i.toString()}`,Za(a.signal))},async getActivityDetail(a,i){const r=encodeURIComponent(a.activityId),u=await El(n,`/api/activities/${r}`,Za(i));if(u.activityGeneration!==a.activityGeneration)throw new P("request_error",409,"activity_generation_changed");if(u.stateRevision!==a.stateRevision)throw new P("request_error",409,"activity_state_changed");return u},async getActivityResult(a,i){const r=encodeURIComponent(a.activityId),u=encodeURIComponent(a.activityGeneration);return await Kg(n,`/api/activities/${r}/result?generation=${u}`,Za(i))},async listRuns(a={}){const i=new URLSearchParams({limit:"100"});return a.before!==void 0&&i.set("before",a.before),await El(n,`/api/runs?${i.toString()}`,Za(a.signal))},async getRunDetail(a,i){const r=encodeURIComponent(a.runId),u=await El(n,`/api/runs/${r}`,Za(i));if(u.runGeneration!==a.runGeneration)throw new P("request_error",409,"run_generation_changed");if(u.stateRevision!==a.stateRevision)throw new P("request_error",409,"run_state_changed");return u},async getRunResult(a,i){const r=encodeURIComponent(a.runId),u=encodeURIComponent(a.runGeneration);return await Kg(n,`/api/runs/${r}/result?generation=${u}`,Za(i))}}}const hj=32,pj=1e4;function mj(n,a,i){const r=[{value:n,depth:0}];let u=0;for(;r.length>0;){const f=r.pop();if(u+=1,u>i)return"nodes";if(f.depth>a)return"depth";if(f.value!==null&&typeof f.value=="object")for(const p in f.value)Object.prototype.hasOwnProperty.call(f.value,p)&&r.push({value:f.value[p],depth:f.depth+1})}return null}function Wd({value:n}){if(Array.isArray(n))return o.jsx("ol",{className:"bounded-json__collection",children:n.map((a,i)=>o.jsxs("li",{children:[o.jsx("span",{className:"bounded-json__key",children:i}),o.jsx(Wd,{value:a})]},i))});if(n!==null&&typeof n=="object"){const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(o.jsxs("div",{className:"bounded-json__entry",children:[o.jsx("dt",{className:"bounded-json__key",children:i}),o.jsx("dd",{children:o.jsx(Wd,{value:n[i]})})]},i));return o.jsx("dl",{className:"bounded-json__collection",children:a})}return o.jsx("span",{className:`bounded-json__value bounded-json__value--${n===null?"null":typeof n}`,children:typeof n=="string"?n:JSON.stringify(n)})}function Fo({content:n,maxDepth:a=hj,maxNodes:i=pj,mediaType:r}){const[u,f]=j.useState("rendered"),p=j.useMemo(()=>{if(r==="text/plain")return null;try{const m=JSON.parse(n);return{kind:"valid",value:m,exceeded:mj(m,a,i)}}catch{return{kind:"invalid"}}},[n,a,i,r]);return r==="text/plain"?o.jsx(ks,{children:n}):p===null||p.kind==="invalid"?o.jsx(ks,{children:n}):o.jsx(Ko,{activeTabId:u,ariaLabel:"Result representation",onChange:f,tabs:[{id:"rendered",label:"rendered",panel:p.exceeded!==null?o.jsxs("p",{className:"bounded-json__limit",role:"status",children:["JSON exceeds the ",p.exceeded==="depth"?`${a}-level`:`${i}-node`," rendering limit. Use the inert raw-text tab."]}):o.jsx("div",{className:"bounded-json",children:o.jsx(Wd,{value:p.value})})},{id:"raw",label:"raw",panel:o.jsx(ks,{children:n})}]})}async function gj(n){const a=await globalThis.crypto.subtle.digest("SHA-256",new TextEncoder().encode(n));return[...new Uint8Array(a)].map(i=>i.toString(16).padStart(2,"0")).join("")}async function vj(n){const a=JSON.parse(n);if(a===null||typeof a!="object"||!("schema_version"in a)||a.schema_version!=="council-plan-review-result-v1")throw new Error("validated plan-review result schema is unavailable");return{bytes:new TextEncoder().encode(n).byteLength,schemaVersion:a.schema_version,sha256:await gj(n)}}function _j(n){switch(n.reason){case"run_pending":return"Result is not available while the run is pending.";case"run_running":return"Result is not available while the run is running.";case"run_failed":return"This failed run has no successful result.";case"run_cancelled":return"This cancelled run has no successful result.";case"not_persisted":return"No result was persisted for this run.";case"missing":return"The persisted result is missing or was pruned.";case"invalid":return"The persisted result failed server validation.";case"too_large":return"The persisted result exceeds the dashboard content cap."}}function yj(n){return n instanceof P?n.code==="run_state_changed"?"The run state changed during the result read. Retry to use the current revision.":n.code==="content_too_large_for_dashboard"?"The persisted result exceeds the dashboard content cap.":n.code==="not_found"||n.status===404?"The persisted result is missing or was pruned. Run metadata remains available.":n.kind==="auth_expired"?"Dashboard authorization expired.":n.kind==="connection_changed"?"Dashboard connection changed; rebootstrap is required.":n.kind==="offline"?"The dashboard server is offline.":"The result could not be loaded. Retry the local read.":"The result could not be rendered. Retry the local read."}function bj(n){const a=new TextEncoder().encode(n).byteLength;return a<1024?`${String(a)} B`:`${(a/1024).toFixed(1)} KiB`}function xj({api:n=g_(),availability:a,onRunGenerationChanged:i,selection:r}){const u=j.useRef(kl()),[f,p]=j.useState({kind:"idle"}),m=`${r.runId}\0${r.runGeneration}\0${r.stateRevision}`,g=f.kind!=="idle"&&f.identity!==m?{kind:"idle"}:f;if(j.useEffect(()=>(u.current.cancel(),p({kind:"idle"}),()=>u.current.cancel()),[r.runId,r.runGeneration,r.stateRevision]),a.availability==="unavailable")return o.jsxs("section",{"aria-labelledby":"run-result-heading",className:"run-result-panel",children:[o.jsxs("div",{className:"run-result-panel__header",children:[o.jsx("h2",{"aria-label":"Run result",id:"run-result-heading",children:"Result"}),o.jsx("span",{className:"run-result-panel__metadata",children:"result_available: false"})]}),o.jsx("p",{className:"run-result-panel__local-state",children:_j(a)})]});const v=()=>{const y=u.current.begin(r);p({kind:"loading",identity:m}),n.getRunResult(r,y.signal).then(async b=>{if(!u.current.isActive(y.identity))return;if(!u.current.acceptsEtag(y.identity,b.etag)){p({kind:"error",identity:m,message:"The result response belongs to an obsolete state revision. Retry the local read."});return}const T=a.kind==="plan_review"?await vj(b.content):void 0;u.current.acceptsEtag(y.identity,b.etag)&&p({kind:"available",identity:m,raw:b,...T===void 0?{}:{publication:T}})}).catch(b=>{if(u.current.isActive(y.identity)&&!(b instanceof P&&b.kind==="aborted")){if(b instanceof P&&b.code==="run_generation_changed"){i();return}p({kind:"error",identity:m,message:yj(b)})}})};return o.jsxs("section",{"aria-labelledby":"run-result-heading",className:"run-result-panel",children:[o.jsxs("div",{className:"run-result-panel__header",children:[o.jsx("h2",{"aria-label":"Run result",id:"run-result-heading",children:"Result"}),o.jsxs("span",{className:"run-result-panel__metadata",children:["result_available: true · result_bytes: ",g.kind==="available"?bj(g.raw.content):"load to verify"]}),g.kind==="available"?null:o.jsx("button",{"aria-label":g.kind==="error"?"Retry result":"Load result",disabled:g.kind==="loading",onClick:v,type:"button",children:g.kind==="loading"?"[ loading result… ]":g.kind==="error"?"[ retry result ]":"[ load result ]"})]}),g.kind==="loading"?o.jsx("p",{role:"status",children:"Loading persisted result…"}):null,g.kind==="error"?o.jsx("p",{className:"run-result-panel__local-state",role:"status",children:g.message}):null,g.kind==="available"?o.jsxs(o.Fragment,{children:[g.publication?o.jsxs("dl",{"aria-label":"Plan-review publication facts",className:"publication-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Publication marker"}),o.jsx("dd",{children:"committed and server-validated"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Validated size"}),o.jsxs("dd",{children:[g.publication.bytes," bytes"]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Validated SHA-256"}),o.jsx("dd",{className:"publication-facts__digest",children:g.publication.sha256})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Result schema"}),o.jsx("dd",{children:g.publication.schemaVersion})]})]}):null,o.jsx(Fo,{content:g.raw.content,mediaType:g.raw.mediaType})]}):null]})}function Sj({phase:n,onPause:a,onResume:i,onRetry:r}){const u=n==="stale"||n==="offline"||n==="error";return o.jsxs("div",{className:"run-detail__controls","aria-label":"Run detail status controls",children:[n==="paused"?o.jsx("button",{className:"run-detail__button",type:"button",onClick:i,children:"[ resume polling ]"}):o.jsx("button",{className:"run-detail__button",type:"button",onClick:a,children:"[ pause polling ]"}),u?o.jsx("button",{className:"run-detail__button",type:"button",onClick:r,children:"[ retry now ]"}):null,o.jsx("span",{className:"run-detail__controls-caption",children:"read-only · actions dispatched via MCP"})]})}function jj({stage:n,onDescribeCall:a,onInspectCall:i}){const r=wj(n),u=Math.max(0,n.callBars.length*9-3),f=Math.round((r-u)/2);return o.jsx("div",{className:"run-detail__timeline-track",children:o.jsx("svg",{className:"run-detail__timeline-svg",height:r,children:n.callBars.map((p,m)=>{const g=f+m*9,v=()=>i({stageId:p.stageId,callId:p.callId});return o.jsxs("g",{"aria-label":`Open persisted log for ${p.tooltipLabel}`,className:"run-detail__timeline-call",onBlur:()=>a(null),onClick:v,onFocus:()=>a(p.tooltipLabel),onKeyDown:y=>{y.key!=="Enter"&&y.key!==" "||(y.preventDefault(),v())},onMouseEnter:()=>a(p.tooltipLabel),onMouseLeave:()=>a(null),role:"button",tabIndex:0,children:[o.jsx("title",{children:p.tooltipLabel}),o.jsx("rect",{className:"run-detail__timeline-bar-hit",height:"9",rx:"4.5",width:`${String(p.widthPercent)}%`,x:`${String(p.startPercent)}%`,y:g-1.5}),o.jsx("rect",{className:`run-detail__timeline-bar run-detail__timeline-bar--call run-detail__timeline-bar--${p.state}`,"data-bar-id":p.id,height:"6",rx:"3",width:`${String(p.widthPercent)}%`,x:`${String(p.startPercent)}%`,y:g})]},p.id)})})})}function wj(n){return Math.max(30,n.callBars.length*9-3)}function Nj({source:n}){const a=kv(n);return a===null?null:o.jsxs("section",{className:"run-detail__handoff","data-testid":"run-action-handoff","aria-label":"MCP tool handoff",children:[o.jsxs("div",{className:"run-detail__handoff-header",children:[o.jsx("span",{className:"run-detail__handoff-label",children:"MCP tool handoff"}),o.jsx("span",{className:"run-detail__handoff-spacer"}),o.jsx(Ls,{label:`Copy ${a.tool} handoff for ${n.runId}`,text:a.text})]}),o.jsx(ks,{children:a.text})]})}function Aj({applicationRootId:n,inspectorApi:a,resultApi:i,sessionLogApi:r,state:u,contextPreflight:f,routeCall:p,onInspectorRouteChange:m,onBack:g,onPause:v,onResume:y,onRetry:b,onRunGenerationChanged:T}){const N=u.detail,[C,R]=j.useState(null),[L,q]=j.useState(null),[O,Y]=j.useState(!1),A=u.selected===null?null:`${u.selected.runId}\0${u.selected.runGeneration}`,$=p!==void 0,ae=p===void 0?" unmanaged":p===null?" none":`${p.stageId} ${p.callId}`;j.useEffect(()=>{q(null),R(p==null?null:{stageId:p.stageId,callId:p.callId})},[A,ae]);const te=W=>{const z=C===null?"open":"switch";R(W),$&&m?.(W,z)},he=()=>{R(null),$&&m?.(null,"close")},re=j.useMemo(()=>C===null||N===null||N.availability!=="available"?null:N.stages.find(W=>W.stageId===C.stageId)?.calls.find(W=>W.callId===C.callId)??null,[N,C]),ye=j.useMemo(()=>N===null||N.availability!=="available"?[]:N.stages.flatMap(W=>W.calls.filter(z=>z.hasWorkflowInput||z.hasOutput||z.hasRawError||z.hasArtifactReference).map(z=>({stageId:W.stageId,callId:z.callId}))),[N]),me=j.useMemo(()=>{if(C===null||ye.length<=1)return;const W=ye.findIndex(z=>z.stageId===C.stageId&&z.callId===C.callId);if(!(W<0))return{total:ye.length,position:W+1,onStepCall:z=>{const F=ye.findIndex(fe=>fe.stageId===C.stageId&&fe.callId===C.callId)+z,ee=ye[F];ee!==void 0&&te(ee)}}},[ye,C]);if(u.selected===null)return o.jsxs("section",{className:"app-shell__view run-detail run-detail--empty",children:[o.jsx("h2",{className:"app-shell__title",children:"Run detail"}),o.jsx("p",{className:"app-shell__note",children:"Select a retained run to inspect persisted state."})]});if(N===null)return o.jsxs("section",{className:"app-shell__view run-detail","aria-busy":"true",children:[o.jsx("button",{className:"run-detail__back",type:"button",onClick:g,children:"‹ back to run list"}),o.jsx("h2",{className:"app-shell__title",children:"Run detail"}),o.jsx("p",{className:"app-shell__note",children:"Loading selected run state…"})]});if(N.availability==="unavailable")return o.jsxs("section",{className:"app-shell__view run-detail",children:[o.jsx("button",{className:"run-detail__back",type:"button",onClick:g,children:"‹ back to run list"}),o.jsx("h2",{className:"app-shell__title",children:"Run detail unavailable"}),o.jsx("p",{className:"run-detail__run-id op-mono overflow-safe",children:N.runId}),o.jsxs("p",{className:"app-shell__note",children:["Diagnostic metadata only · ",N.reason.replaceAll("_"," ")]})]});const G=Mx(N,u.displayNowMs),ge=f!=null&&f.availability==="current"?f:void 0,_e=ge===void 0?null:(()=>{const W=n0(ge),X=ge.contextRunId!==void 0;return o.jsxs("article",{className:"run-detail__stage run-detail__stage--preflight","aria-label":"Stage context preflight",children:[o.jsxs("header",{className:"run-detail__stage-header",children:[o.jsx("span",{className:"run-detail__stage-number",children:"01"}),o.jsxs("div",{className:"run-detail__stage-identity",children:[o.jsx("h4",{className:"overflow-safe",children:"context"}),o.jsx("p",{className:"run-detail__stage-description overflow-safe",children:"context preflight"})]}),o.jsx("span",{className:"run-detail__timing",children:W.timingLabel}),o.jsx("span",{className:"run-detail__status","data-state":W.statusState,children:W.statusLabel})]}),o.jsxs("div",{className:"run-detail__preflight-body",children:[o.jsx(Uv,{preflight:ge,view:W}),X?o.jsx("button",{"aria-label":"Inspect context preflight curator/finalizer session log",className:"run-detail__inspect run-detail__preflight-log",onClick:()=>Y(!0),title:"curator · finalizer session log",type:"button",children:"[ log ]"}):null]})]})})();return o.jsxs("section",{className:"app-shell__view run-detail",children:[o.jsxs("div",{className:"run-detail__mobile-nav",children:[o.jsx("button",{"aria-label":"back to run list",className:"run-detail__back",type:"button",onClick:g,children:"‹ runs"}),o.jsxs("span",{className:"op-caption op-mono overflow-safe",children:["run ",G.runId]})]}),o.jsxs("header",{className:"run-detail__header",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"run-detail__identity-line",children:[o.jsxs("span",{className:"op-caption op-mono overflow-safe",children:["run ",G.runId]}),o.jsx("span",{className:"run-detail__status","data-state":G.statusState,children:G.statusLabel}),G.workerEvidenceLabel===null?null:o.jsx("span",{className:"run-detail__mode",title:G.workerEvidenceDescription??void 0,children:G.workerEvidenceLabel}),G.modeLabels.map(W=>o.jsx("span",{className:"run-detail__mode",children:W},W))]}),o.jsxs("div",{className:"run-detail__workflow-heading",children:[o.jsx("h2",{className:"run-detail__title overflow-safe",children:N.workflowName}),o.jsxs("span",{className:"op-caption op-mono",children:["v",N.workflowVersion]})]})]}),o.jsx("div",{className:"run-detail__header-status",children:o.jsx(Sj,{phase:u.phase,onPause:v,onResume:y,onRetry:b})})]}),o.jsxs("dl",{className:"run-detail__metadata","aria-label":"Run metadata",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"started_at"}),o.jsx("dd",{children:o.jsx(tn,{children:G.startedLabel})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"elapsed"}),o.jsx("dd",{children:G.elapsedLabel})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"last persisted update"}),o.jsx("dd",{children:o.jsx(tn,{children:G.updatedLabel})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"resumable"}),o.jsx("dd",{children:N.resumable===!0?"yes":"no"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"project folder"}),o.jsx("dd",{children:o.jsx(tn,{children:tf(N.projectFolders)})})]})]}),o.jsxs("dl",{className:"run-detail__opaque-identity","aria-label":"Dashboard run identity",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"generation"}),o.jsx("dd",{children:o.jsx(tn,{children:N.runGeneration})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"state revision"}),o.jsx("dd",{children:o.jsx(tn,{children:N.stateRevision})})]})]}),o.jsx(Nj,{source:N}),f==null||f.availability==="current"?null:o.jsx(t0,{preflight:f}),G.decisiveFailureLabel===null?null:o.jsxs("section",{className:"run-detail__failure","aria-labelledby":"decisive-failure-title",children:[o.jsx("h3",{id:"decisive-failure-title",children:"Decisive failure"}),o.jsx("p",{className:"op-mono overflow-safe",children:G.decisiveFailureLabel})]}),o.jsxs("section",{className:"run-detail__summary-strip","aria-labelledby":"run-card-title",children:[o.jsxs("h3",{id:"run-card-title",children:[o.jsx("span",{"aria-hidden":"true",children:"Run summary"}),o.jsx("span",{className:"visually-hidden",children:G.card.title})]}),o.jsx("dl",{className:"run-detail__card-facts",children:G.card.facts.map(W=>o.jsxs("div",{children:[o.jsx("dt",{children:W.label}),o.jsx("dd",{children:W.value})]},W.label))})]}),G.snapshotAvailable?o.jsxs("section",{className:"run-detail__chart",children:[o.jsxs("div",{className:"run-detail__chart-heading",children:[o.jsx("h3",{className:"op-specimen",children:"Stage chart"}),o.jsx("span",{className:"op-caption op-mono",children:G.timeline?.spanLabel??"persisted timing not reported"})]}),G.timeline===null?o.jsx("div",{className:"run-detail__timeline-unavailable",role:"status",children:"Verified stage dependencies are available, but no persisted stage or call interval has both a start and a truthful end."}):o.jsx(fj,{label:"Verified workflow stage timeline",children:o.jsxs("div",{className:"run-detail__timeline",children:[o.jsx("span",{className:"run-detail__timeline-label-spacer"}),o.jsx("svg",{"aria-hidden":"true",className:"run-detail__timeline-ticks",children:G.timeline.ticks.map(W=>o.jsx("text",{textAnchor:"middle",x:`${String(W.positionPercent)}%`,y:"12",children:W.label},`${W.label}:${String(W.positionPercent)}`))}),G.timeline.stages.map(W=>o.jsxs(j.Fragment,{children:[o.jsxs("span",{className:"mobile-chart-scroll__sticky-label",children:[o.jsx("span",{className:"run-detail__timeline-stage-id overflow-safe",title:W.stageId,children:W.stageId}),o.jsx("span",{className:"run-detail__timeline-count",children:W.callCountLabel})]}),o.jsx(jj,{onDescribeCall:q,onInspectCall:te,stage:W})]},W.stageId)),o.jsxs("svg",{"aria-hidden":"true",className:"run-detail__timeline-overlay",preserveAspectRatio:"none",children:[G.timeline.fanInPositions.map((W,z)=>o.jsx("line",{className:"run-detail__timeline-fan-in",x1:`${String(W)}%`,x2:`${String(W)}%`,y1:"0",y2:"100%"},`${String(W)}:${String(z)}`)),G.timeline.livePositionPercent===null?null:o.jsxs(o.Fragment,{children:[o.jsx("line",{className:"run-detail__timeline-now",x1:`${String(G.timeline.livePositionPercent)}%`,x2:`${String(G.timeline.livePositionPercent)}%`,y1:"0",y2:"100%"}),o.jsx("circle",{className:"run-detail__timeline-now-dot",cx:`${String(G.timeline.livePositionPercent)}%`,cy:"3",r:"3"})]})]}),L===null?null:o.jsx("div",{className:"run-detail__timeline-tooltip",role:"tooltip",children:L}),o.jsxs("div",{className:"run-detail__timeline-legend",children:[o.jsxs("span",{children:[o.jsx("i",{className:"run-detail__legend-swatch run-detail__legend-swatch--done"}),"done"]}),o.jsxs("span",{children:[o.jsx("i",{className:"run-detail__legend-swatch run-detail__legend-swatch--running"}),"running"]}),o.jsxs("span",{children:[o.jsx("i",{className:"run-detail__legend-swatch run-detail__legend-swatch--planned"}),"planned"]}),o.jsxs("span",{children:[o.jsx("i",{className:"run-detail__legend-swatch run-detail__legend-swatch--failed"}),"failed"]}),o.jsx("span",{className:"run-detail__timeline-legend-note",children:"dotted verticals · stage fan-in"})]})]})}),o.jsx("p",{className:"run-detail__section-note",children:G.snapshotLabel})]}):o.jsxs("section",{className:"run-detail__snapshot-unavailable",role:"status",children:[o.jsx("h3",{children:"Stage graph unavailable"}),o.jsx("p",{children:G.snapshotLabel}),o.jsx("p",{children:"Persisted stage and call state remains available below."})]}),o.jsxs("section",{className:"run-detail__stages","aria-labelledby":"stage-rows-title",children:[o.jsx("h3",{className:"visually-hidden",id:"stage-rows-title",children:"Persisted stages"}),_e,G.stages.map((W,z)=>{const X=N.stages.find(F=>F.stageId===W.stageId);return o.jsxs("article",{className:"run-detail__stage","aria-label":`Stage ${W.stageId}`,children:[o.jsxs("header",{className:"run-detail__stage-header",children:[o.jsx("span",{className:"run-detail__stage-number",children:String(_e===null?z+1:z+2).padStart(2,"0")}),o.jsxs("div",{className:"run-detail__stage-identity",children:[o.jsx("h4",{className:"overflow-safe",children:W.stageId}),W.label===W.stageId?null:o.jsx("p",{className:"run-detail__stage-description overflow-safe",children:W.label})]}),o.jsx("span",{className:"run-detail__timing",children:W.timingLabel}),o.jsx("span",{className:"run-detail__status","data-state":X?.state,children:W.statusLabel})]}),o.jsx("div",{className:"run-detail__calls",children:W.calls.length===0?o.jsx("p",{className:"run-detail__section-note",children:"No persisted calls."}):W.calls.map(F=>o.jsxs("article",{className:"run-detail__call","aria-label":`Call ${F.callId}: ${F.statusLabel}`,children:[o.jsx("span",{"aria-hidden":"true",className:"run-detail__call-state","data-state":X?.calls.find(ee=>ee.callId===F.callId)?.state,children:F.statusLabel==="failed"?"×":null}),o.jsx("h5",{className:"op-mono overflow-safe",children:F.callId}),F.adapterLabel===null?o.jsx("span",{className:"run-detail__call-adapter",children:"not reported"}):o.jsx("span",{className:"run-detail__call-adapter",children:F.adapterLabel}),o.jsxs("span",{className:"run-detail__call-role overflow-safe",children:[F.roleLabel??"role not reported",W.dependsOn.length===0?null:` · ⇠ ${W.dependsOn.join(" · ")}`]}),F.retryLabel===null?null:o.jsx("span",{className:"run-detail__call-retry",children:F.retryLabel}),o.jsx("span",{className:"run-detail__call-timing",children:F.timingLabel}),F.contentLabels.length===0?o.jsx("span",{"aria-label":"No persisted call content",className:"run-detail__log-unavailable",children:"—"}):o.jsx("button",{"aria-label":`Inspect persisted content for ${F.callId}`,className:"run-detail__inspect",onClick:()=>te({stageId:W.stageId,callId:F.callId}),title:F.contentLabels.join(" · "),type:"button",children:"[ log ]"}),F.failureLabel===null?null:o.jsx("p",{className:"run-detail__call-failure",children:F.failureLabel})]},F.callId))})]},W.stageId)})]}),o.jsx(xj,{...i===void 0?{}:{api:i},availability:G.result,onRunGenerationChanged:T,selection:u.selected}),$&&p!==void 0&&p!==null&&re===null?o.jsxs("p",{className:"run-detail__section-note",role:"status",children:["The requested call ",p.callId," in stage ",p.stageId," is not present in this run’s persisted state."]}):null,re===null?null:o.jsx(dj,{...a===void 0?{}:{api:a},applicationRootId:n,call:re,...me===void 0?{}:{callNavigation:me},onClose:he,onObsoleteSelection:T,open:!0,selection:u.selected,...r===void 0?{}:{sessionLogApi:r}}),ge===void 0||ge.contextRunId===void 0||r===void 0?null:o.jsx(Rj,{applicationRootId:n,contextRunId:ge.contextRunId,onClose:()=>Y(!1),onRunGenerationChanged:T,open:O,runGeneration:N.runGeneration,runId:N.runId,sessionLogApi:r})]})}function Rj({applicationRootId:n,contextRunId:a,onClose:i,onRunGenerationChanged:r,open:u,runGeneration:f,runId:p,sessionLogApi:m}){const g=j.useMemo(()=>({family:"context",runId:p,runGeneration:f,contextRunId:a}),[p,f,a]);return o.jsxs(af,{applicationRootId:n,labelledBy:"preflight-log-title",onClose:i,open:u,panelClassName:"accessible-dialog--sheet run-detail__preflight-log-dialog",children:[o.jsxs("header",{className:"run-detail__preflight-log-header",children:[o.jsx("h3",{id:"preflight-log-title",className:"overflow-safe",children:"Context preflight log"}),o.jsx("button",{className:"run-detail__button",type:"button",onClick:i,children:"[ close ]"})]}),o.jsx("p",{className:"run-detail__section-note",children:"Curator · finalizer session log for this run’s context preflight."}),o.jsx(Jo,{api:m,onGenerationChanged:r,scope:g})]})}const Ej=["all","orphaned","running","succeeded","failed","cancelled"];function gf(n){return n.status!=="running"?"terminal":n.orphaned===!0||n.leaseObservation==="orphaned"?"orphaned":n.leaseObservation==="live"?"live":"unknown"}function v_(n){return gf(n)==="orphaned"?"orphaned":n.status}function Tj(n){return v_(n)}function Qg(n,a){return a==="all"?!0:Tj(n)===a}function Cj(n,a){const i=Date.parse(n.startedAt);if(n.completedAt!==void 0){const r=Date.parse(n.completedAt);if(Number.isFinite(i)&&Number.isFinite(r)){const u=Math.max(0,r-i);return`duration ${Ro(u)}`}if(Number.isFinite(r))return`completed ${Tn(n.completedAt,a)}`}if(Number.isFinite(i)){const r=Date.parse(n.stateUpdatedAt),f=gf(n)!=="orphaned"||!Number.isFinite(r)?a:r;return`started ${Tn(n.startedAt,f)}`}return"timing not reported"}function Oj(n,a){const i=Date.parse(n.startedAt);if(!Number.isFinite(i))return"not reported";const r=gf(n);if(r==="orphaned"){const u=Date.parse(n.stateUpdatedAt);return Number.isFinite(u)?Gn(u-i):"not reported"}if(r==="terminal"){const u=Date.parse(n.completedAt??n.stateUpdatedAt);return Number.isFinite(u)?Gn(u-i):"not reported"}return Gn(a-i)}function __(n,a){const i=v_(n);return{timingLabel:Cj(n,a),updatedAgeLabel:Tn(n.stateUpdatedAt,a),resultRetentionLabel:n.hasResult?"bounded result retained":"metadata only",statusLabel:i,cardModifier:i}}function kj(n,a){const i=__(n,a);return{statusLabel:i.statusLabel,statusState:i.cardModifier,observedSpanLabel:Oj(n,a)}}function Mj({api:n,detail:a,detailPhase:i,nowMs:r,onBack:u,onGenerationChanged:f,selection:p,sessionLogApi:m}){const[g,v]=j.useState(null),[y,b]=j.useState("idle"),T=j.useRef(null);if(j.useEffect(()=>()=>T.current?.abort(),[]),a===null&&p!==null){const R=i==="error";return o.jsxs("section",{"aria-busy":R?void 0:"true",className:"app-shell__view run-detail run-detail--empty",children:[o.jsxs("div",{className:"run-detail__mobile-nav",children:[o.jsx("button",{"aria-label":"back to single-call list",autoFocus:!0,className:"run-detail__back",onClick:u,type:"button",children:"‹ calls"}),o.jsxs("span",{className:"op-caption op-mono overflow-safe",children:["activity ",p.activityId]})]}),o.jsx("h2",{className:"app-shell__title",children:R?"Single-call detail unavailable":"Single-call detail"}),o.jsx("p",{className:"app-shell__note",role:R?"alert":"status",children:R?"The selected activity detail could not be loaded. Return to the list and retry the call feed.":"Loading selected single-call state…"})]})}if(a===null)return o.jsxs("section",{className:"app-shell__view run-detail run-detail--empty",children:[o.jsx("h2",{className:"app-shell__title",children:"Single-call detail"}),o.jsx("p",{className:"app-shell__note",children:"Select a retained direct call or agent session to inspect its persisted lifecycle and content boundary."})]});const N=()=>{if(!a.hasResult||y==="loading")return;T.current?.abort();const R=new AbortController;T.current=R,b("loading"),n.getActivityResult(a,R.signal).then(L=>{if(!R.signal.aborted){if(L.etag!==`"${a.stateRevision}"`){v(null),b("error");return}v(L),b("loaded")}}).catch(()=>{R.signal.aborted||b("error")})},C=kj(a,r);return o.jsxs("section",{className:"app-shell__view run-detail activity-detail",children:[o.jsxs("div",{className:"run-detail__mobile-nav",children:[o.jsx("button",{"aria-label":"back to single-call list",autoFocus:!0,className:"run-detail__back",onClick:u,type:"button",children:"‹ calls"}),o.jsxs("span",{className:"op-caption op-mono overflow-safe",children:["activity ",a.activityId]})]}),o.jsx("header",{className:"run-detail__header",children:o.jsxs("div",{children:[o.jsxs("div",{className:"run-detail__identity-line",children:[o.jsxs("span",{className:"op-caption op-mono overflow-safe",children:["activity ",a.activityId]}),o.jsx("span",{className:"run-detail__status","data-state":C.statusState,children:C.statusLabel}),o.jsx("span",{className:"run-detail__mode",children:a.phase})]}),o.jsxs("div",{className:"run-detail__workflow-heading",children:[o.jsx("h2",{className:"run-detail__title overflow-safe",children:a.kind}),o.jsxs("span",{className:"op-caption op-mono overflow-safe",children:[a.adapter," / ",a.role]})]})]})}),o.jsxs("dl",{className:"run-detail__metadata","aria-label":"Single-call metadata",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"started"}),o.jsx("dd",{children:o.jsx(tn,{children:a.startedAt})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"observed span"}),o.jsx("dd",{children:C.observedSpanLabel})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"last persisted update"}),o.jsx("dd",{children:o.jsx(tn,{children:a.stateUpdatedAt})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"completed"}),o.jsx("dd",{children:o.jsx(tn,{children:a.completedAt??"not reported"})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"outcome"}),o.jsx("dd",{children:a.outcome?.kind??"not reported"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"project folder"}),o.jsx("dd",{children:o.jsx(tn,{children:tf(a.projectFolders)})})]})]}),o.jsxs("dl",{className:"run-detail__opaque-identity","aria-label":"Dashboard activity identity",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"generation"}),o.jsx("dd",{children:o.jsx(tn,{children:a.activityGeneration})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"state revision"}),o.jsx("dd",{children:o.jsx(tn,{children:a.stateRevision})})]})]}),o.jsx("p",{className:"activity-detail__notice",children:"Observation only. A reported running record is not proof that its producer process is still alive."}),m===void 0?null:o.jsx("section",{className:"run-detail__card activity-detail__content",children:o.jsx(Jo,{api:m,...f===void 0?{}:{onGenerationChanged:f},scope:{family:"activity",activityId:a.activityId,activityGeneration:a.activityGeneration}})}),o.jsxs("section",{className:"run-detail__card activity-detail__content","aria-labelledby":"activity-content-title",children:[o.jsxs("div",{className:"run-detail__section-heading",children:[o.jsx("h3",{id:"activity-content-title",children:"Persisted content"}),a.hasResult?o.jsx("button",{className:"run-detail__inspect",disabled:y==="loading",onClick:N,type:"button",children:y==="loaded"?"Reload retained result":"Load retained result"}):o.jsx("span",{children:"metadata only"})]}),a.hasResult?y==="loading"?o.jsx("p",{role:"status",children:"Loading retained result…"}):y==="error"?o.jsxs("div",{role:"alert",children:[o.jsx("p",{children:"The retained result is unavailable for this exact revision."}),o.jsx("button",{className:"run-detail__button",onClick:N,type:"button",children:"[ retry result ]"})]}):g===null?o.jsx("p",{children:"Bounded result bytes are retained and loaded separately from lifecycle metadata."}):o.jsxs("div",{className:"activity-detail__result",children:[a.resultTruncated?o.jsx("p",{className:"run-detail__section-note",role:"status",children:"Retained output was truncated at the configured persistence limit."}):null,o.jsx(Fo,{content:g.content,mediaType:g.mediaType})]}):o.jsx("p",{children:a.kind==="clink_agent_run"?"A final agent-session result was not retained for this activity.":"Result retention was not enabled when this direct call ran."})]})]})}function y_(n){return n.findIndex(a=>a.disabled!==!0)}function Jg(n,a){const i=n.findIndex(r=>r.id===a&&r.disabled!==!0);return i>=0?i:y_(n)}function Fg(n,a,i){if(n.length===0)return-1;for(let r=1;r<=n.length;r+=1){const u=(a+i*r+n.length)%n.length;if(n[u]?.disabled!==!0)return u}return a}function er({ariaLabel:n,items:a,onMovePastBoundary:i,onSelect:r,rootRef:u,selectedId:f}){const[p,m]=j.useState(()=>Jg(a,f)),g=j.useRef(new Map),v=a.map(N=>`${N.id}:${N.disabled===!0?"disabled":"enabled"}`).join("\0"),y=Jg(a,f);j.useEffect(()=>{m(y)},[v,y,f]);const b=N=>{N<0||(m(N),g.current.get(N)?.focus())},T=(N,C)=>{let R=null;if(N.key==="ArrowDown"){if(i!==void 0&&!a.slice(C+1).some(L=>L.disabled!==!0)){N.preventDefault(),i(1);return}R=Fg(a,C,1)}else if(N.key==="ArrowUp"){if(i!==void 0&&!a.slice(0,C).some(L=>L.disabled!==!0)){N.preventDefault(),i(-1);return}R=Fg(a,C,-1)}else if(N.key==="Home")R=y_(a);else if(N.key==="End")R=[...a].map((L,q)=>({item:L,itemIndex:q})).reverse().find(({item:L})=>L.disabled!==!0)?.itemIndex??-1;else if(N.key==="Enter"||N.key===" "){N.preventDefault();const L=a[C];L&&L.disabled!==!0&&r(L.id);return}R!==null&&(N.preventDefault(),b(R))};return o.jsx("div",{className:"roving-listbox","aria-label":n,ref:u,role:"listbox",children:a.map((N,C)=>o.jsx("div",{"aria-disabled":N.disabled===!0?"true":void 0,"aria-label":N.label,"aria-selected":N.id===f,className:"roving-listbox__option","data-item-id":N.id,onClick:()=>{N.disabled!==!0&&(m(C),g.current.get(C)?.focus(),r(N.id))},onFocus:()=>m(C),onKeyDown:R=>T(R,C),ref:R=>{R?g.current.set(C,R):g.current.delete(C)},role:"option",tabIndex:C===p&&N.disabled!==!0?0:-1,children:N.content},N.id))})}function Wo({groupLabel:n,chips:a,selected:i,onSelect:r}){return o.jsxs("div",{"aria-label":n,className:"run-list__filters",role:"group",children:[o.jsx("span",{className:"run-list__filter-label",children:"status"}),a.map(u=>o.jsxs("button",{"aria-pressed":i===u.id,onClick:()=>{i!==u.id&&r(u.id)},type:"button",children:[o.jsx("span",{children:u.label}),o.jsx("span",{className:"run-list__filter-count",children:String(u.count)})]},u.id))]})}function zj({activity:n,view:a}){return o.jsxs("div",{className:`run-card run-card--${a.cardModifier}`,children:[o.jsxs("span",{className:"run-card__header",children:[o.jsx("span",{className:"run-card__identity",children:o.jsxs("span",{className:"run-card__id",children:["activity ",n.activityId]})}),o.jsx("span",{className:"run-card__status",children:a.statusLabel})]}),o.jsxs("span",{className:"run-card__workflow",children:[n.kind," · ",n.adapter," / ",n.role," · ",n.phase]}),o.jsxs("span",{className:"run-card__footer",children:[o.jsx("span",{className:"run-card__timing",children:a.timingLabel}),o.jsxs("span",{className:"run-card__footnote",children:[a.resultRetentionLabel," · updated ",a.updatedAgeLabel]}),o.jsx("span",{className:"run-card__detail-hint",children:"detail ›"})]})]})}function Lj({activities:n,announcement:a,hasSnapshot:i,onRetry:r,onSelect:u,phase:f,selected:p,nowMs:m}){const[g,v]=j.useState("all"),y=n.filter(C=>Qg(C,g)),b=g==="all"?String(n.length):`${String(y.length)}/${String(n.length)}`,T=new Map(n.map(C=>[C.activityId,C])),N=["stale","offline","error"].includes(f);return o.jsxs("section",{className:"run-list","aria-label":"Single-call monitor",children:[a===null?null:o.jsx("p",{className:"run-list__announcement","data-selection-loss-announcement":!0,role:"status",tabIndex:-1,children:a}),["stale","offline","auth_expired","connection_changed","error"].includes(f)?o.jsxs("div",{className:"run-list__recovery",role:"status",children:[o.jsxs("span",{children:["Single-call feed ",f.replace("_"," "),"."]}),N?o.jsx("button",{onClick:r,type:"button",children:"[ retry calls ]"}):null]}):null,o.jsx(Wo,{groupLabel:"Filter single calls by status",selected:g,onSelect:v,chips:Ej.map(C=>({id:C,label:C,count:n.filter(R=>Qg(R,C)).length}))}),o.jsxs("section",{"aria-labelledby":"activity-list-title",className:"run-list__lane",children:[o.jsxs("div",{className:"run-list__lane-heading",children:[o.jsx("h2",{id:"activity-list-title",children:"Single calls"}),o.jsxs("p",{children:["[ activity ",b," ]"]})]}),n.length===0&&f==="initial_loading"?o.jsxs("div",{className:"run-list__placeholders",children:[o.jsx("p",{className:"run-list__placeholder-copy",role:"status",children:"Loading retained single calls…"}),o.jsx("div",{className:"run-list__placeholder","aria-hidden":"true"}),o.jsx("div",{className:"run-list__placeholder","aria-hidden":"true"}),o.jsx("div",{className:"run-list__placeholder","aria-hidden":"true"})]}):n.length===0&&!i?o.jsx("p",{className:"run-list__empty",children:"No authoritative single-call snapshot is available."}):n.length===0?o.jsx("p",{className:"run-list__empty",children:"No retained direct or agent-session activity is available."}):y.length===0?o.jsxs("p",{className:"run-list__empty",children:["No loaded activities match ",g,"."]}):o.jsx(er,{ariaLabel:"Single calls",items:y.map(C=>{const R=__(C,m);return{id:C.activityId,label:`${C.activityId} ${C.kind} ${R.statusLabel}`,content:o.jsx(zj,{activity:C,view:R})}}),onSelect:C=>{const R=T.get(C);R!==void 0&&u(R)},selectedId:p?.activityId??null})]}),o.jsxs("p",{"aria-hidden":"true",className:"run-list__keyboard-hint",children:[o.jsx("kbd",{children:"↑"}),o.jsx("kbd",{children:"↓"}),o.jsx("span",{children:"select call"}),o.jsx("span",{children:"·"}),o.jsx("kbd",{children:"enter"}),o.jsx("span",{children:"open detail"})]})]})}const Dj=["standalone","refine","workflow_preflight","historical"],Ij=["pending","running","succeeded","partial","failed","cancelled"],Uj=["live","orphaned","unknown"],qj=["resolving","cache_lookup","validating","scanning","searching","selecting","curating","finalizing","writing","materializing","committing","complete","terminal"],$j=["not_configured","disabled","pending","running","succeeded","failed","cancelled","skipped"],Hj=["not_applicable","not_used","used","failed"],Gj=["not_checked","miss","hit"],Bj=["not_attempted","skipped","written"],Vj=["satisfied","degraded","not_evaluated"],Zj=["cache_disabled","cache_miss","cache_stale","delegate_disabled","delegate_failed","delegate_fallback","delegate_invalid","delegate_timeout","coverage_degraded","empty_selection","operation_cancelled","internal_failure","legacy_supported","legacy_unsupported","generation_replaced"];class Ct extends Error{kind;status;constructor(a,i){super(`context run artifact fetch failed: ${a}`),this.name="ContextRunArtifactApiError",this.kind=a,this.status=i}}const Yj=["current","legacy_synthesized","legacy_unsupported"],Xj=["journal","historical_manifest"],b_=/^[A-Za-z0-9_-]{1,64}$/,Kj=/^[A-Za-z0-9_-]{16,128}$/,Qj=16;class Jj extends Error{constructor(a){super(a),this.name="ContextRunParseError"}}function at(n){throw new Jj(n)}function Wa(n,a){return(typeof n!="object"||n===null||Array.isArray(n))&&at(`${a} must be an object`),n}function Pa(n,a,i){const r=new Set(a),u=Object.keys(n).find(f=>!r.has(f));u!==void 0&&at(`${i}.${u} is unexpected`)}function _n(n,a,i){return(typeof n!="string"||!a.includes(n))&&at(`${i} is not a recognized value`),n}function qn(n,a){return(typeof n!="number"||!Number.isSafeInteger(n)||n<0||n>25e7)&&at(`${a} must be a bounded non-negative integer`),n}function Gi(n,a){return n===null?null:((typeof n!="string"||Number.isNaN(Date.parse(n)))&&at(`${a} must be null or an ISO timestamp`),n)}function Wg(n,a){const i=Wa(n,a);Pa(i,["status","score"],a);const r=i.score;return r!==null&&(typeof r!="number"||!Number.isFinite(r)||r<0||r>10)&&at(`${a}.score must be null or a score from 0 through 10`),Object.freeze({status:_n(i.status,$j,`${a}.status`),score:r})}function Fj(n){const a=Wa(n,"lifecycle.counts");return Pa(a,["filesSeen","filesConsidered","filesSelected","filesOmitted","searchResults","bytesRead","bytesWritten"],"lifecycle.counts"),Object.freeze({filesSeen:qn(a.filesSeen,"lifecycle.counts.filesSeen"),filesConsidered:qn(a.filesConsidered,"lifecycle.counts.filesConsidered"),filesSelected:qn(a.filesSelected,"lifecycle.counts.filesSelected"),filesOmitted:qn(a.filesOmitted,"lifecycle.counts.filesOmitted"),searchResults:qn(a.searchResults,"lifecycle.counts.searchResults"),bytesRead:qn(a.bytesRead,"lifecycle.counts.bytesRead"),bytesWritten:qn(a.bytesWritten,"lifecycle.counts.bytesWritten")})}function Wj(n){const a=Wa(n,"lifecycle.coverage");Pa(a,["policy","status","required","selected","missing"],"lifecycle.coverage"),a.policy!==null&&a.policy!=="review_deep_v1"&&at("lifecycle.coverage.policy is invalid");const i={policy:a.policy,status:_n(a.status,Vj,"lifecycle.coverage.status"),required:qn(a.required,"lifecycle.coverage.required"),selected:qn(a.selected,"lifecycle.coverage.selected"),missing:qn(a.missing,"lifecycle.coverage.missing")};return i.missing>i.required&&at("lifecycle.coverage.missing exceeds required"),Object.freeze(i)}function Pj(n){(!Array.isArray(n)||n.length>Qj)&&at("lifecycle.reasonCodes must be a bounded array");const a=n.map((i,r)=>_n(i,Zj,`lifecycle.reasonCodes[${String(r)}]`));return new Set(a).size!==a.length&&at("lifecycle.reasonCodes must be unique"),Object.freeze(a)}const ew=20;function tw(n){(!Array.isArray(n)||n.length>ew)&&at("contextRun.projectFolders must be a bounded array");const a=n.map((i,r)=>((typeof i!="string"||i.length===0)&&at(`contextRun.projectFolders[${String(r)}] must be a non-empty string`),i));return Object.freeze(a)}function nw(n){const a=Wa(n,"lifecycle");Pa(a,["status","phase","createdAt","updatedAt","startedAt","completedAt","durationMs","curator","finalizer","cache","fallback","counts","coverage","reasonCodes","artifactRunId"],"lifecycle");const i=Wa(a.cache,"lifecycle.cache");Pa(i,["lookup","write"],"lifecycle.cache");const r=Wa(a.fallback,"lifecycle.fallback");Pa(r,["status"],"lifecycle.fallback");const u=a.artifactRunId;u!==null&&(typeof u!="string"||!b_.test(u))&&at("lifecycle.artifactRunId is malformed");const f=a.durationMs;return f!==null&&(typeof f!="number"||!Number.isSafeInteger(f)||f<0)&&at("lifecycle.durationMs must be null or a non-negative integer"),Object.freeze({status:_n(a.status,Ij,"lifecycle.status"),phase:_n(a.phase,qj,"lifecycle.phase"),createdAt:Gi(a.createdAt,"lifecycle.createdAt"),updatedAt:Gi(a.updatedAt,"lifecycle.updatedAt"),startedAt:Gi(a.startedAt,"lifecycle.startedAt"),completedAt:Gi(a.completedAt,"lifecycle.completedAt"),durationMs:f,curator:Wg(a.curator,"lifecycle.curator"),finalizer:Wg(a.finalizer,"lifecycle.finalizer"),cache:Object.freeze({lookup:_n(i.lookup,Gj,"lifecycle.cache.lookup"),write:_n(i.write,Bj,"lifecycle.cache.write")}),fallback:Object.freeze({status:_n(r.status,Hj,"lifecycle.fallback.status")}),counts:Fj(a.counts),coverage:Wj(a.coverage),reasonCodes:Pj(a.reasonCodes),artifactRunId:u})}function x_(n){const a=Wa(n,"contextRun");Pa(a,["id","contextGeneration","source","compatibility","operationKind","lifecycle","projectFolders","orphaned","liveness"],"contextRun");const i=a.id;(typeof i!="string"||!b_.test(i)||i.startsWith("wfctx")||i.startsWith("wfpre"))&&at("contextRun.id is malformed");const r=a.contextGeneration;(typeof r!="string"||!Kj.test(r))&&at("contextRun.contextGeneration is malformed");const u=_n(a.compatibility,Yj,"contextRun.compatibility"),f=a.lifecycle===null?null:nw(a.lifecycle);u==="legacy_unsupported"!=(f===null)&&at("only legacy_unsupported context runs omit lifecycle");const p=a.orphaned===void 0?!1:a.orphaned;typeof p!="boolean"&&at("contextRun.orphaned must be a boolean");const m=a.liveness===void 0?p?"orphaned":"unknown":_n(a.liveness,Uj,"contextRun.liveness");p!==(m==="orphaned")&&at("contextRun.orphaned must agree with liveness");const g=f?.status;return!(g==="pending"||g==="running")&&(p||m!=="unknown")&&at("terminal or unsupported context runs cannot carry live or orphaned liveness"),Object.freeze({id:i,contextGeneration:r,source:_n(a.source,Xj,"contextRun.source"),compatibility:u,operationKind:_n(a.operationKind,Dj,"contextRun.operationKind"),lifecycle:f,projectFolders:tw(a.projectFolders),orphaned:p,liveness:m})}function aw(n){const a=Wa(n,"response");Pa(a,["contextRuns","serverNow","truncated"],"response"),Array.isArray(a.contextRuns)||at("response.contextRuns must be an array"),typeof a.truncated!="boolean"&&at("response.truncated must be a boolean");const i=Gi(a.serverNow,"response.serverNow");return i===null&&at("response.serverNow must not be null"),Object.freeze({contextRuns:Object.freeze(a.contextRuns.map(x_)),serverNow:i,truncated:a.truncated})}function Rd(n){return n??new AbortController().signal}async function Pg(n,a,i){let r;try{r=await n(a,{signal:i})}catch(u){throw u instanceof qe?new P("connection_changed",409,"agent_instance_changed"):i.aborted||u instanceof DOMException&&u.name==="AbortError"?new P("aborted"):new P("offline")}if(r.status===401)throw new P("auth_expired",401,"unauthorized");if(!r.ok)throw new P("request_error",r.status);try{return await nn(r)}catch(u){throw u instanceof qe?new P("connection_changed",409,"agent_instance_changed"):new P("request_error",r.status)}}async function sw(n,a,i){let r;try{r=await n(a,{signal:i})}catch(p){throw p instanceof qe?new Ct("connection_changed",409):i.aborted||p instanceof DOMException&&p.name==="AbortError"?new Ct("aborted"):new Ct("offline")}if(r.status===401)throw new Ct("auth_expired",401);if(r.status===404)throw new Ct("missing",404);if(r.status===409)throw new Ct("generation_changed",409);if(r.status===413)throw new Ct("content_too_large",413);if(r.status===503)throw new Ct("unavailable",503);if(!r.ok)throw new Ct("request_error",r.status);const u=lw(r.headers.get("content-type"));let f;try{f=await r.text()}catch(p){throw p instanceof qe?new Ct("connection_changed",409):new Ct("request_error",r.status)}return{content:f,mediaType:u}}function lw(n){if(n===null)return"text/plain";const a=n.toLowerCase();return a.startsWith("application/json")?"application/json":a.startsWith("application/x-ndjson")?"application/x-ndjson":a.startsWith("text/markdown")?"text/markdown":"text/plain"}function S_(n=_a){return{async listContextRuns(a={}){const i=await Pg(n,"/api/context-runs?limit=100",Rd(a.signal));return aw(i)},async getContextRunDetail(a,i){const r=await Pg(n,`/api/context-runs/${encodeURIComponent(a)}`,Rd(i)),u=x_(r);if(u.id!==a)throw new P("request_error",502,"internal_error");return u},async getArtifact(a,i){const r=`/api/context-runs/${encodeURIComponent(a.contextRunId)}/artifacts/${encodeURIComponent(a.artifactKey)}?generation=${encodeURIComponent(a.contextGeneration)}`;return await sw(n,r,Rd(i))}}}const iw=S_(),rw=["bundle_md","summary_json","selected_context_jsonl","tree_json","search_jsonl","slices_jsonl","codemap_jsonl","manifest_json"],ow={bundle_md:"bundle.md (context packet)",summary_json:"summary.json",selected_context_jsonl:"selected-context.jsonl",tree_json:"tree.json",search_jsonl:"search.jsonl",slices_jsonl:"slices.jsonl",codemap_jsonl:"codemap.jsonl",manifest_json:"manifest.json (receipt)"};function cw(n,a){return[n.contextRunId,n.contextGeneration,a].join("\0")}function uw(n){switch(n){case"loading":return"Loading artifact…";case"ready":return null;case"missing":return"This artifact was not retained for this run.";case"content_too_large":return"This artifact exceeds the dashboard size limit and cannot be shown.";case"unavailable":return"Artifact storage is temporarily unavailable.";case"obsolete":return"The selected generation changed; the artifact view was discarded.";case"error":return"The artifact could not be loaded."}}function dw({api:n=iw,onGenerationChanged:a,scope:i,defaultArtifactKey:r="bundle_md"}){const[u,f]=j.useState(r),p=cw(i,u),m=j.useMemo(()=>({...i,artifactKey:u}),[p]),g=j.useRef(a),[v,y]=j.useState("loading"),[b,T]=j.useState(null);j.useEffect(()=>{g.current=a},[a]);const N=`${i.contextRunId}\0${i.contextGeneration}`;j.useEffect(()=>{f(r)},[N,r]),j.useEffect(()=>{const L=new AbortController;return y("loading"),T(null),n.getArtifact(m,L.signal).then(q=>{L.signal.aborted||(T(q),y("ready"))}).catch(q=>{L.signal.aborted||(q instanceof Ct&&q.kind==="generation_changed"?(y("obsolete"),g.current?.()):q instanceof Ct&&q.kind==="missing"?y("missing"):q instanceof Ct&&q.kind==="content_too_large"?y("content_too_large"):q instanceof Ct&&q.kind==="unavailable"?y("unavailable"):q instanceof Ct&&q.kind==="aborted"||y("error"))}),()=>L.abort()},[n,p,m]);const C=uw(v),R=v==="ready"&&b!==null&&b.mediaType==="text/markdown";return o.jsxs("section",{"aria-busy":v==="loading","aria-label":"Run artifacts panel",className:"context-run-artifacts-panel","data-phase":v,children:[o.jsxs("label",{className:"context-run-artifacts-panel__picker",children:[o.jsx("span",{children:"Artifact"}),o.jsx("select",{onChange:L=>f(L.currentTarget.value),value:u,children:rw.map(L=>o.jsx("option",{value:L,children:ow[L]},L))})]}),C===null?null:o.jsx("p",{role:v==="error"?"alert":"status",children:C}),R?o.jsx("p",{className:"context-run-artifacts-panel__note",children:"Shown as plain text; markdown is not rendered."}):null,v==="ready"&&b!==null?o.jsx("div",{className:"context-run-artifacts-panel__body",children:o.jsx(Fo,{content:b.content,mediaType:fw(b.mediaType)})}):null]})}function fw(n){return n==="application/json"?"application/json":"text/plain"}function Tl({label:n,facts:a}){return o.jsx("dl",{className:"run-detail__metadata","aria-label":n,children:a.map(i=>o.jsxs("div",{children:[o.jsx("dt",{children:i.label}),o.jsx("dd",{children:o.jsx(tn,{children:i.value})})]},i.label))})}function hw(n){const a=n.lifecycle;return a===null?null:a.cache.lookup==="hit"?"This cache hit reused an earlier context bundle, so no curator or finalizer session conversation exists.":a.curator.status==="not_configured"&&a.finalizer.status==="not_configured"?"Curator and finalizer were not configured, so no delegate session conversation exists.":null}function pw({detail:n,detailPhase:a,onBack:i,onGenerationChanged:r,selectedId:u,sessionLogApi:f,contextRunsApi:p}){if(u===null)return o.jsxs("section",{className:"app-shell__view run-detail run-detail--empty",children:[o.jsx("h2",{className:"app-shell__title",children:"Context run detail"}),o.jsx("p",{className:"app-shell__note",children:"Select a context-builder run to inspect its lifecycle metadata."})]});if(n===null)return o.jsxs("section",{className:"app-shell__view run-detail","aria-busy":a==="loading",children:[o.jsx("button",{className:"run-detail__back",type:"button",onClick:i,children:"‹ back to context runs"}),o.jsx("h2",{className:"app-shell__title",children:"Context run detail"}),o.jsx("p",{className:"app-shell__note",children:a==="loading"?"Loading context run lifecycle…":a==="not_found"?"The selected context run is no longer retained.":"Context run lifecycle is unavailable."})]});const m=Zx(n),g=hw(n);return o.jsxs("section",{className:"app-shell__view run-detail",children:[o.jsxs("div",{className:"run-detail__mobile-nav",children:[o.jsx("button",{"aria-label":"back to context runs",className:"run-detail__back",type:"button",onClick:i,children:"‹ context runs"}),o.jsx("span",{className:"op-caption op-mono overflow-safe",children:m.contextRunId})]}),o.jsx("header",{className:"run-detail__header",children:o.jsxs("div",{children:[o.jsxs("div",{className:"run-detail__identity-line",children:[o.jsx("span",{className:"op-caption op-mono overflow-safe",children:m.contextRunId}),o.jsx("span",{className:"run-detail__status","data-state":m.statusState,children:m.statusLabel}),o.jsx("span",{className:"run-detail__mode",children:m.operationKindLabel}),m.isCacheHit?o.jsx("span",{className:"run-detail__mode",children:"cache hit"}):null]}),o.jsxs("div",{className:"run-detail__workflow-heading",children:[o.jsxs("h2",{className:"run-detail__title overflow-safe",children:["Context builder · ",m.operationKindLabel]}),o.jsx("span",{className:"op-caption op-mono",children:m.phaseLabel})]})]})}),m.legacyNotice===null?null:o.jsxs("section",{className:"run-detail__failure","aria-labelledby":"context-legacy-title",children:[o.jsx("h3",{id:"context-legacy-title",children:"Legacy artifact set unsupported"}),o.jsx("p",{className:"overflow-safe",children:m.legacyNotice})]}),m.isCacheHit?o.jsxs("section",{className:"run-detail__snapshot-unavailable",role:"status",children:[o.jsx("h3",{children:"Cache-hit materialization"}),o.jsx("p",{children:"This run was served from the workflow context cache. Selection was materialized from a prior curated bundle; curator and finalizer did not re-execute for this operation."})]}):null,o.jsx("dl",{className:"run-detail__metadata","aria-label":"Context run project folder",children:o.jsxs("div",{children:[o.jsx("dt",{children:"project folder"}),o.jsx("dd",{children:o.jsx(tn,{children:tf(n.projectFolders)})})]})}),o.jsxs("section",{"aria-labelledby":"context-identity-title",children:[o.jsx("h3",{className:"visually-hidden",id:"context-identity-title",children:"Identity"}),o.jsx(Tl,{label:"Context run identity",facts:m.identityFacts})]}),o.jsxs("section",{"aria-labelledby":"context-lifecycle-title",children:[o.jsx("h3",{className:"run-detail__section-note",id:"context-lifecycle-title",children:"Lifecycle"}),o.jsx(Tl,{label:"Context run lifecycle",facts:m.lifecycleFacts})]}),o.jsxs("section",{"aria-labelledby":"context-delegate-title",children:[o.jsx("h3",{className:"run-detail__section-note",id:"context-delegate-title",children:"Delegate"}),o.jsx(Tl,{label:"Context run delegate",facts:m.delegateFacts})]}),o.jsxs("section",{"aria-labelledby":"context-cache-title",children:[o.jsx("h3",{className:"run-detail__section-note",id:"context-cache-title",children:"Cache"}),o.jsx(Tl,{label:"Context run cache",facts:m.cacheFacts})]}),o.jsxs("section",{"aria-labelledby":"context-coverage-title",children:[o.jsx("h3",{className:"run-detail__section-note",id:"context-coverage-title",children:"Coverage"}),o.jsx(Tl,{label:"Context run coverage",facts:m.coverageFacts})]}),o.jsxs("section",{"aria-labelledby":"context-counts-title",children:[o.jsx("h3",{className:"run-detail__section-note",id:"context-counts-title",children:"Aggregate counts"}),o.jsx(Tl,{label:"Context run counts",facts:m.countFacts})]}),m.fallbackLabel===null?null:o.jsx("p",{className:"run-detail__section-note",children:m.fallbackLabel}),m.reasonCodes.length===0?null:o.jsxs("section",{"aria-labelledby":"context-reasons-title",children:[o.jsx("h3",{className:"run-detail__section-note",id:"context-reasons-title",children:"Reason codes"}),o.jsx("ul",{className:"run-detail__modes",children:m.reasonCodes.map(v=>o.jsx("li",{className:"run-detail__mode",children:v},v))})]}),m.canViewArtifacts&&p!==void 0?o.jsxs("section",{children:[o.jsx("h3",{className:"run-detail__section-note",children:"Run artifacts"}),o.jsx("section",{className:"run-detail__card",children:o.jsx(dw,{api:p,...r===void 0?{}:{onGenerationChanged:r},scope:{contextRunId:n.id,contextGeneration:n.contextGeneration}})})]}):null,f===void 0?null:o.jsx("section",{className:"run-detail__card",children:g===null?o.jsx(Jo,{api:f,...r===void 0?{}:{onGenerationChanged:r},scope:{family:"context",contextRunId:n.id,contextGeneration:n.contextGeneration}}):o.jsx("section",{"aria-label":"Session log panel",className:"session-log-panel",children:o.jsxs("section",{"aria-label":"Session log availability",className:"session-log-viewer__availability","data-availability":"not_executed",role:"status",children:[o.jsx("strong",{children:"Not executed"}),o.jsx("p",{children:g})]})})})]})}function mw({item:n,nowMs:a}){const i=lf(n,a);return o.jsxs("div",{className:`run-card run-card--${i.statusState}`,children:[o.jsxs("span",{className:"run-card__header",children:[o.jsx("span",{className:"run-card__identity",children:o.jsx("span",{className:"run-card__id",children:i.contextRunId})}),o.jsx("span",{className:"run-card__status",children:i.statusLabel})]}),o.jsxs("span",{className:"run-card__workflow",children:[i.operationKindLabel," · ",i.delegateLabel]}),o.jsxs("span",{className:"run-card__footer",children:[o.jsx("span",{className:"run-card__timing",children:i.timingLabel}),o.jsxs("span",{className:"run-card__footnote",children:[i.isCacheHit?"cache hit · materialized":i.cacheLabel," · updated ",i.updatedAgeLabel]}),o.jsx("span",{className:"run-card__footnote",children:i.coverageLabel}),i.legacyUnsupported?o.jsx("span",{className:"run-card__footnote",children:"legacy unsupported"}):null,o.jsx("span",{className:"run-card__detail-hint",children:"detail ›"})]})]})}function gw({announcement:n,contextRuns:a,hasSnapshot:i,nowMs:r,onRetry:u,onSelect:f,phase:p,selectedId:m}){const[g,v]=j.useState("all"),y=a.filter(T=>Ng(T,g)),b=["stale","offline","error"].includes(p);return o.jsxs("section",{className:"run-list","aria-label":"Context run monitor",children:[n===null?null:o.jsx("p",{className:"run-list__announcement","data-selection-loss-announcement":!0,role:"status",tabIndex:-1,children:n}),["stale","offline","auth_expired","connection_changed","error"].includes(p)?o.jsxs("div",{className:"run-list__recovery",role:"status",children:[o.jsxs("span",{children:["Context run feed ",p.replace("_"," "),"."]}),b?o.jsx("button",{onClick:u,type:"button",children:"[ retry context runs ]"}):null]}):null,o.jsx(Wo,{chips:Vx.map(T=>({id:T,label:T,count:a.filter(N=>Ng(N,T)).length})),groupLabel:"Filter context runs by status",onSelect:v,selected:g}),o.jsxs("section",{"aria-labelledby":"context-run-list-title",className:"run-list__lane",children:[o.jsxs("div",{className:"run-list__lane-heading",children:[o.jsx("h2",{id:"context-run-list-title",children:"Context runs"}),o.jsx("p",{children:g==="all"?`[ context ${String(a.length)} ]`:`[ context ${String(y.length)}/${String(a.length)} ]`})]}),a.length===0&&p==="initial_loading"?o.jsxs("div",{className:"run-list__placeholders",children:[o.jsx("p",{className:"run-list__placeholder-copy",role:"status",children:"Loading context-builder runs…"}),o.jsx("div",{className:"run-list__placeholder","aria-hidden":"true"}),o.jsx("div",{className:"run-list__placeholder","aria-hidden":"true"}),o.jsx("div",{className:"run-list__placeholder","aria-hidden":"true"})]}):a.length===0&&!i?o.jsx("p",{className:"run-list__empty",children:"No authoritative context-run snapshot is available."}):a.length===0?o.jsx("p",{className:"run-list__empty",children:"No retained context-builder run is available."}):y.length===0?o.jsxs("p",{className:"run-list__empty",children:["No loaded context runs match ",g,"."]}):o.jsx(er,{ariaLabel:"Context runs",items:y.map(T=>{const N=lf(T,r);return{id:N.contextRunId,label:`${N.contextRunId} ${N.operationKindLabel} ${N.statusLabel}`,content:o.jsx(mw,{item:T,nowMs:r})}}),onSelect:f,selectedId:m})]}),o.jsxs("p",{"aria-hidden":"true",className:"run-list__keyboard-hint",children:[o.jsx("kbd",{children:"↑"}),o.jsx("kbd",{children:"↓"}),o.jsx("span",{children:"select run"}),o.jsx("span",{children:"·"}),o.jsx("kbd",{children:"enter"}),o.jsx("span",{children:"open detail"})]})]})}const vw=["all","running","paused","blocked","done","failed"];function ev(n,a){return a==="all"?!0:n.status===a}function _w({item:n,nowMs:a}){const i=Tn(n.updatedAt,a),r=n.taskCounts===void 0?null:`${String(n.taskCounts.done)}/${String(n.taskCounts.total)} tasks`;return o.jsxs("div",{className:`run-card run-card--${n.status}`,children:[o.jsxs("span",{className:"run-card__header",children:[o.jsx("span",{className:"run-card__identity",children:o.jsx("span",{className:"run-card__id",children:n.title})}),o.jsx("span",{className:"run-card__status","data-state":n.status,children:n.status})]}),n.publishedStatus===void 0?null:o.jsxs("span",{className:"run-card__published-status",children:["agent published: ",n.publishedStatus]}),o.jsxs("span",{className:"run-card__workflow",children:[n.projectFolder," · ",String(n.agentCount)," agent",n.agentCount===1?"":"s"]}),o.jsxs("span",{className:"run-card__footer",children:[o.jsxs("span",{className:"run-card__timing",children:["updated ",i]}),o.jsx("span",{className:"run-card__footnote",children:r===null?"no task counts":r}),o.jsx("span",{className:"run-card__footnote",children:null}),o.jsx("span",{className:"run-card__detail-hint",children:"detail ›"})]})]})}function yw({announcement:n,progressReports:a,hasSnapshot:i,nowMs:r,onRetry:u,onSelect:f,phase:p,progressReportsRoot:m,selectedId:g,truncated:v}){const[y,b]=j.useState("all"),T=a.filter(L=>ev(L,y)),N=L=>a.filter(q=>ev(q,L)).length,C=y==="all"?String(a.length):`${String(T.length)}/${String(a.length)}`,R=["stale","offline","error"].includes(p);return o.jsxs("section",{className:"run-list","aria-label":"Progress report monitor",children:[n===null?null:o.jsx("p",{className:"run-list__announcement","data-selection-loss-announcement":!0,role:"status",tabIndex:-1,children:n}),["stale","offline","auth_expired","connection_changed","error"].includes(p)?o.jsxs("div",{className:"run-list__recovery",role:"status",children:[o.jsxs("span",{children:["Progress report feed ",p.replace("_"," "),"."]}),R?o.jsx("button",{onClick:u,type:"button",children:"[ retry progress reports ]"}):null]}):null,o.jsx(Wo,{chips:vw.map(L=>({id:L,label:L,count:N(L)})),groupLabel:"Filter progress reports by status",onSelect:b,selected:y}),o.jsxs("section",{"aria-labelledby":"progress-report-list-title",className:"run-list__lane",children:[o.jsxs("div",{className:"run-list__lane-heading",children:[o.jsx("h2",{id:"progress-report-list-title",tabIndex:-1,children:"Progress reports"}),o.jsxs("p",{children:["[ reports ",C," ]"]})]}),v?o.jsx("p",{className:"run-list__announcement",role:"status",children:"Partial results: additional progress reports may exist."}):null,a.length===0&&p==="initial_loading"?o.jsxs("div",{className:"run-list__placeholders",children:[o.jsx("p",{className:"run-list__placeholder-copy",role:"status",children:"Loading agent progress reports…"}),o.jsx("div",{className:"run-list__placeholder","aria-hidden":"true"}),o.jsx("div",{className:"run-list__placeholder","aria-hidden":"true"}),o.jsx("div",{className:"run-list__placeholder","aria-hidden":"true"})]}):a.length===0?o.jsxs("div",{className:"run-list__empty",children:[o.jsxs("p",{children:[i?"No agent progress reports are available":"No agent progress report snapshot is available yet",m===void 0?".":` under ${m}.`]}),o.jsxs("p",{children:["Reports are emitted only when"," ",o.jsx("code",{children:"CLINKX_WORKFLOWS_PROGRESS_REPORT_MODE"})," is enabled; an unset variable is the commonest cause of an empty list."]})]}):T.length===0?o.jsxs("p",{className:"run-list__empty",children:["No loaded progress reports match ",y,"."]}):o.jsx(er,{ariaLabel:"Progress reports",items:T.map(L=>({id:L.id,label:`${L.title} ${L.status}`,content:o.jsx(_w,{item:L,nowMs:r})})),onSelect:f,selectedId:g})]}),o.jsxs("p",{"aria-hidden":"true",className:"run-list__keyboard-hint",children:[o.jsx("kbd",{children:"↑"}),o.jsx("kbd",{children:"↓"}),o.jsx("span",{children:"select report"}),o.jsx("span",{children:"·"}),o.jsx("kbd",{children:"enter"}),o.jsx("span",{children:"open detail"})]})]})}const $s=["running","paused","blocked","done","failed"],bw=["working","idle","blocked","done"],xw=["pending","active","done","blocked","failed"],Sw=["info","success","warn","error"],jw=["added","modified","deleted"],j_=/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/,ww=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(?:Z|([+-])(\d{2}):(\d{2}))$/;class Nw extends Error{constructor(a){super(a),this.name="ProgressReportParseError"}}function Xt(n){throw new Nw(n)}function sn(n,a){return(typeof n!="object"||n===null||Array.isArray(n))&&Xt(`${a} must be an object`),n}function ln(n,a,i){const r=new Set(a),u=Object.keys(n).find(f=>!r.has(f));u!==void 0&&Xt(`${i}.${u} is unexpected`)}function vf(n,a){return(typeof n!="string"||n.length===0)&&Xt(`${a} must be a non-empty string`),n}function va(n,a,i){return(typeof n!="string"||!a.includes(n))&&Xt(`${i} is not a recognized value`),n}function es(n,a){return(typeof n!="number"||!Number.isSafeInteger(n)||n<0)&&Xt(`${a} must be a non-negative integer`),n}function Il(n,a){return(typeof n!="string"||!w_(n))&&Xt(`${a} must be an ISO timestamp`),n}function w_(n){const a=ww.exec(n);if(a===null)return!1;const i=Number(a[1]),r=Number(a[2]),u=Number(a[3]),f=Number(a[4]),p=Number(a[5]),m=Number(a[6]),g=a[8]===void 0?0:Number(a[8]),v=a[9]===void 0?0:Number(a[9]),b=[31,i%4===0&&(i%100!==0||i%400===0)?29:28,31,30,31,30,31,31,30,31,30,31];return i>=1&&i<=9999&&r>=1&&r<=12&&u>=1&&u<=(b[r-1]??0)&&f<=23&&p<=59&&m<=59&&g<=23&&v<=59&&Number.isFinite(Date.parse(n))}function N_(n,a){const i=vf(n,a);return j_.test(i)||Xt(`${a} is malformed`),i}function Po(n,a){return(typeof n!="string"||!w_(n))&&Xt(`${a} must be an ISO timestamp`),n}const Aw=50,Rw=200,Ew=200,Tw=500,Cw=50,Ow=100,kw=100,Mw=256,zw=300,Lw=500,Dw=500,Iw=200,Uw=16;function qw(n,a){let i=0;const r=n[Symbol.iterator]();for(;!r.next().done;)if(i+=1,i>a)return!1;return!0}function $w(n){return n.startsWith("/")}function ec(n,a,i,r){const u=vf(n,a);return qw(u,i)||Xt(`${a} exceeds ${i} Unicode code points (${r} bound)`),u}function ss(n,a){return ec(n,a,Mw,"id")}function Ul(n,a){return ec(n,a,zw,"message")}function Go(n,a){return ec(n,a,Lw,"title")}function A_(n,a){const i=ec(n,a,Dw,"path");return $w(i)||Xt(`${a} must be an absolute path`),i}function da(n,a,i){return(!Array.isArray(n)||n.length>a)&&Xt(`${i} must be a bounded array`),n}function Hw(n){const a=sn(n,"taskCounts");return ln(a,["total","done"],"taskCounts"),Object.freeze({total:es(a.total,"taskCounts.total"),done:es(a.done,"taskCounts.done")})}function Gw(n){const a=sn(n,"progressReport");return ln(a,["id","title","status","projectFolder","startedAt","updatedAt","agentCount","taskCounts","publishedStatus"],"progressReport"),Object.freeze({id:N_(a.id,"progressReport.id"),title:Go(a.title,"progressReport.title"),status:va(a.status,$s,"progressReport.status"),projectFolder:A_(a.projectFolder,"progressReport.projectFolder"),startedAt:Il(a.startedAt,"progressReport.startedAt"),updatedAt:Il(a.updatedAt,"progressReport.updatedAt"),agentCount:es(a.agentCount,"progressReport.agentCount"),...a.taskCounts===void 0?{}:{taskCounts:Hw(a.taskCounts)},...a.publishedStatus===void 0?{}:{publishedStatus:va(a.publishedStatus,$s,"progressReport.publishedStatus")}})}function Bw(n){const a=sn(n,"response");ln(a,["progressReports","serverNow","truncated"],"response");const i=da(a.progressReports,Iw,"response.progressReports");typeof a.truncated!="boolean"&&Xt("response.truncated must be a boolean");const r=Il(a.serverNow,"response.serverNow");return Object.freeze({progressReports:Object.freeze(i.map(Gw)),serverNow:r,truncated:a.truncated})}function Vw(n,a){const i=`session.agents[${String(a)}]`,r=sn(n,i);return ln(r,["name","role","status","activity","updatedAt"],i),Object.freeze({name:ss(r.name,`${i}.name`),role:ss(r.role,`${i}.role`),status:va(r.status,bw,`${i}.status`),activity:Ul(r.activity,`${i}.activity`),updatedAt:Po(r.updatedAt,`${i}.updatedAt`)})}function Zw(n,a){const i=`session.tasks[${String(a)}]`,r=sn(n,i);ln(r,["id","title","status","agent","note"],i);const u={id:ss(r.id,`${i}.id`),title:Go(r.title,`${i}.title`),status:va(r.status,xw,`${i}.status`)};return r.agent!==void 0&&(u.agent=ss(r.agent,`${i}.agent`)),r.note!==void 0&&(u.note=Ul(r.note,`${i}.note`)),Object.freeze(u)}function Yw(n,a){const i=`session.log[${String(a)}]`,r=sn(n,i);return ln(r,["t","agent","kind","msg"],i),Object.freeze({t:Po(r.t,`${i}.t`),agent:ss(r.agent,`${i}.agent`),kind:va(r.kind,Sw,`${i}.kind`),msg:Ul(r.msg,`${i}.msg`)})}function Xw(n,a){const i=`session.files[${String(a)}]`,r=sn(n,i);return ln(r,["path","change","adds","dels"],i),Object.freeze({path:ss(r.path,`${i}.path`),change:va(r.change,jw,`${i}.change`),adds:es(r.adds,`${i}.adds`),dels:es(r.dels,`${i}.dels`)})}function Kw(n){const a=sn(n,"session.tests");ln(a,["passed","failed","skipped","failing","lastRun"],"session.tests");const i=da(a.failing,kw,"session.tests.failing");return Object.freeze({passed:es(a.passed,"session.tests.passed"),failed:es(a.failed,"session.tests.failed"),skipped:es(a.skipped,"session.tests.skipped"),failing:Object.freeze(i.map((r,u)=>Ul(r,`session.tests.failing[${String(u)}]`))),lastRun:Po(a.lastRun,"session.tests.lastRun")})}function Qw(n,a){const i=`session.blockers[${String(a)}]`,r=sn(n,i);return ln(r,["msg","raisedBy","needsHuman"],i),typeof r.needsHuman!="boolean"&&Xt(`${i}.needsHuman must be a boolean`),Object.freeze({msg:Ul(r.msg,`${i}.msg`),raisedBy:ss(r.raisedBy,`${i}.raisedBy`),needsHuman:r.needsHuman})}function Jw(n,a){const i=`session.decisions[${String(a)}]`,r=sn(n,i);return ln(r,["t","by","msg"],i),Object.freeze({t:Po(r.t,`${i}.t`),by:ss(r.by,`${i}.by`),msg:Ul(r.msg,`${i}.msg`)})}function Fw(n){const a=sn(n,"progressReport");ln(a,["schemaVersion","session","agents","tasks","log","files","tests","blockers","decisions"],"progressReport"),a.schemaVersion!=="progress-report-v1"&&Xt("progressReport.schemaVersion must be progress-report-v1");const i=sn(a.session,"session.session");ln(i,["id","title","goal","status","startedAt","updatedAt","projectFolder"],"session.session");const r=Object.freeze({id:N_(i.id,"session.session.id"),title:Go(i.title,"session.session.title"),goal:Go(i.goal,"session.session.goal"),status:va(i.status,$s,"session.session.status"),startedAt:Il(i.startedAt,"session.session.startedAt"),updatedAt:Il(i.updatedAt,"session.session.updatedAt"),projectFolder:A_(i.projectFolder,"session.session.projectFolder")});return Object.freeze({session:r,...a.agents===void 0?{}:{agents:Object.freeze(da(a.agents,Aw,"session.agents").map(Vw))},...a.tasks===void 0?{}:{tasks:Object.freeze(da(a.tasks,Rw,"session.tasks").map(Zw))},...a.log===void 0?{}:{log:Object.freeze(da(a.log,Ew,"session.log").map(Yw))},...a.files===void 0?{}:{files:Object.freeze(da(a.files,Tw,"session.files").map(Xw))},...a.tests===void 0?{}:{tests:Kw(a.tests)},...a.blockers===void 0?{}:{blockers:Object.freeze(da(a.blockers,Cw,"session.blockers").map(Qw))},...a.decisions===void 0?{}:{decisions:Object.freeze(da(a.decisions,Ow,"session.decisions").map(Jw))}})}function R_(n){const a=sn(n,"response");ln(a,["progressReport","serverNow","omittedSections","publishedSessionStatus"],"response");const r=da(a.omittedSections,Uw,"response.omittedSections").map((u,f)=>vf(u,`response.omittedSections[${String(f)}]`));return Object.freeze({progressReport:Fw(a.progressReport),serverNow:Il(a.serverNow,"response.serverNow"),omittedSections:Object.freeze(r),...a.publishedSessionStatus===void 0?{}:{publishedSessionStatus:va(a.publishedSessionStatus,$s,"response.publishedSessionStatus")}})}function Ww(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&Object.prototype.hasOwnProperty.call(n,"progressReport")?Object.freeze({kind:"detail",...R_(n)}):Object.freeze({kind:"ack"})}function Pw(n){return n.action==="set"?{action:"set",status:va(n.status,$s,"status")}:{action:"revert"}}function tv(n){if(n instanceof P){if(n.code==="progress_report_malformed")return"malformed";if(n.code==="content_too_large_for_dashboard")return"oversized";if(n.status===404)return"removed";if(n.status===413)return"oversized"}}function nv(n){return n??new AbortController().signal}const av=16*1024,eN=new Set(["invalid_request","method_not_allowed","agent_instance_changed","not_found","dashboard_busy","scan_byte_budget_exceeded","content_too_large_for_dashboard","progress_report_malformed","progress_report_overrides_unavailable","internal_error"]);async function tN(n){Ja(n);const a=Number(n.headers.get("content-length"));if(Number.isFinite(a)&&a>av){await n.body?.cancel(),Ja(n);return}if(n.body===null)return;const i=n.body.getReader(),r=new TextDecoder;let u=0,f="";try{for(;;){const p=await i.read();if(p.done)break;if(u+=p.value.byteLength,u>av){await i.cancel(),Ja(n);return}f+=r.decode(p.value,{stream:!0})}f+=r.decode()}finally{i.releaseLock()}Ja(n);try{const m=JSON.parse(f).error?.code;return typeof m=="string"&&eN.has(m)?m:void 0}catch{return}}async function E_(n,a){let i;try{i=await n()}catch(r){throw r instanceof qe?new P("connection_changed",409,"agent_instance_changed"):a?.aborted===!0||r instanceof DOMException&&r.name==="AbortError"?new P("aborted"):new P("offline")}if(i.status===401)throw new P("auth_expired",401,"unauthorized");if(!i.ok){let r;try{r=await tN(i)}catch(u){if(u instanceof qe)throw new P("connection_changed",409,"agent_instance_changed")}throw r==="agent_instance_changed"?new P("connection_changed",i.status,r):new P("request_error",i.status,r)}if(i.status===204){await i.body?.cancel();return}try{return await nn(i)}catch(r){throw r instanceof qe?new P("connection_changed",409,"agent_instance_changed"):new P("request_error",i.status)}}async function sv(n,a,i){return E_(()=>n(a,{signal:i}),i)}function nN(n=_a,a=_0){return{async listProgressReports(i={}){const r=await sv(n,"/api/progress-reports",nv(i.signal));return Bw(r)},async getProgressReportDetail(i,r){const u=await sv(n,`/api/progress-reports/${encodeURIComponent(i)}/data`,nv(r)),f=R_(u);if(f.progressReport.session.id!==i)throw new P("request_error",502,"internal_error");return f},async setStatusOverride(i,r){if(!j_.test(i))throw new P("request_error",400,"invalid_request");const u=await E_(()=>a(`/api/progress-reports/${i}/status-override`,Pw(r))),f=Ww(u);if(f.kind==="detail"&&f.progressReport.session.id!==i)throw new P("request_error",502,"internal_error");return f}}}function zs(n){const a=Date.parse(n);return Number.isNaN(a)?null:a}function jo(n,a){const i=zs(n);if(i===null)return"—";const r=Math.max(0,Math.floor((a-i)/1e3));return r<60?`${String(r)}s ago`:r<3600?`${String(Math.floor(r/60))}m ago`:r<86400?`${String(Math.floor(r/3600))}h ${String(Math.floor(r%3600/60))}m ago`:`${String(Math.floor(r/86400))}d ago`}function aN(n,a){const i=Math.min(.03,.9/Math.max(1,a));return Number((.25+n*i).toFixed(2))*1e3}function sN(n){const a=zs(n);return a===null?"—":new Date(a).toISOString().slice(11,16)}function Ed(n){const a=zs(n);if(a===null)return"";const i=new Date(a);return`${["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"][i.getUTCMonth()]??""} ${String(i.getUTCDate())}`.trim()}function lN(n,a){const i=zs(n);if(i===null)return"—";const r=Math.max(0,Math.floor((a-i)/1e3));return r<60?`${String(r)}s`:r<3600?`${String(Math.floor(r/60))}m`:`${String(Math.floor(r/3600))}h ${String(Math.floor(r%3600/60))}m`}function iN(n,a,i){const r=n.tasks??[],u=n.agents??[],f=r.filter(A=>A.status==="done").length,p=r.filter(A=>A.status==="active").length,m=r.filter(A=>A.status==="blocked"||A.status==="failed").length,g=A=>(i.agentFilter===null||A.agent===i.agentFilter)&&(i.statusFilter===null||A.status===i.statusFilter),v=r.filter(g),y=(n.log??[]).filter(A=>(i.agentFilter===null||A.agent===i.agentFilter)&&(!i.issuesOnly||A.kind==="warn"||A.kind==="error")),b=y.slice(-25).reverse(),T=new Set(b.map(A=>Ed(A.t)).filter(Boolean)),N=[...n.files??[]].sort((A,$)=>$.adds+$.dels-(A.adds+A.dels)),C=(i.filesExpanded?N:N.slice(0,8)).map(A=>({...A,displayPath:A.path.replaceAll("/","/​")})),R=(n.files??[]).reduce((A,$)=>({adds:A.adds+$.adds,dels:A.dels+$.dels}),{adds:0,dels:0}),L=i.agentFilter!==null||i.statusFilter!==null,q=[`${String(v.length)} of ${String(r.length)} shown`,i.agentFilter,i.statusFilter==="pending"?"queued":i.statusFilter].filter(A=>A!==null),Y=n.session.status==="done"||n.session.status==="failed"?zs(n.session.updatedAt)??a:a;return{agents:u.map(A=>({...A,updatedLabel:jo(A.updatedAt,a)})),decisions:(n.decisions??[]).map(A=>({...A,relativeLabel:jo(A.t,a)})),elapsedLabel:lN(n.session.startedAt,Y),files:C,filesToggleLabel:N.length>8?i.filesExpanded?"[ show fewer ]":"[ show all ]":null,fileTotals:R,logs:b.map((A,$)=>{const ae=Ed(A.t),te=$===0?null:Ed(b[$-1]?.t??"");return{...A,clockLabel:zs(A.t)===null?"—":new Date(zs(A.t)??0).toISOString().slice(11,19),dayLabel:ae,showDay:T.size>1&&ae.length>0&&ae!==te}}),logTotal:y.length,notice:(n.blockers??[]).find(A=>A.needsHuman)??null,progress:{active:p,activeWidthPercent:r.length===0?0:p/r.length*100,blocked:m,done:f,donePercent:r.length===0?0:Math.round(f/r.length*100),doneWidthPercent:r.length===0?0:f/r.length*100,total:r.length},startedClock:`${sN(n.session.startedAt)} utc`,taskFilterLabel:L?q.join(" · "):null,tasks:v,testsLastRunLabel:n.tests===void 0?null:jo(n.tests.lastRun,a),updatedLabel:jo(n.session.updatedAt,a),workingAgentCount:u.filter(A=>A.status==="working").length}}const T_={active:{glyph:"◐",label:"active"},blocked:{glyph:"⊘",label:"blocked"},done:{glyph:"●",label:"done"},failed:{glyph:"✕",label:"failed"},pending:{glyph:"○",label:"queued"}},rN=["done","active","pending","blocked","failed"],oN={blocked:"⊘",done:"●",idle:"○",working:"◐"},cN={error:"✕",info:"·",success:"✓",warn:"!"},lv={auth_expired:{label:"auth expired",terminal:!0},connection_changed:{label:"connection changed",terminal:!0},current:{label:"live · 3s",terminal:!1},error:{label:"error · retrying",terminal:!1},initial_loading:{label:"connecting · 3s",terminal:!1},offline:{label:"offline · retrying",terminal:!1},paused:{label:"paused · resume",terminal:!1},stale:{label:"stale · retrying",terminal:!1}};function Td(n){return`${n.t}|${n.agent}|${n.msg}`}function Vi({children:n}){return o.jsxs("span",{className:"progress-report-page__axis",children:["[ ",n," ]"]})}function Os({children:n,label:a}){return o.jsxs("section",{className:"progress-report-page__card",children:[o.jsx("h3",{className:"progress-report-page__card-label",children:a}),o.jsx("div",{className:"progress-report-page__card-body",children:n})]})}function uN(){const[n,a]=j.useState(Ev),i=Ov(n),r=()=>{a(i),Tv(i),Cv(i)};return o.jsxs("button",{"aria-pressed":n==="dark",className:"progress-report-page__text-control",onClick:r,title:`switch to ${i} theme · saved in this browser`,type:"button",children:["[ ",i," mode ]"]})}function dN(n){switch(n){case"removed":return"This progress report is no longer available. It may have been rotated or removed.";case"malformed":return"This progress report could not be parsed. The document may be corrupted or from an incompatible version.";case"oversized":return"This progress report is too large to display in the dashboard."}}function Cd({backRef:n,busy:a=!1,children:i,onBack:r}){return o.jsx("main",{"aria-busy":a,className:"progress-report-page progress-report-page--state",children:o.jsxs("div",{className:"progress-report-page__state-wrap",children:[o.jsx("button",{"aria-label":"back to progress reports",className:"progress-report-page__tag progress-report-page__back-tag",onClick:r,ref:n,type:"button",children:"progress reports"}),o.jsx(Os,{label:"PROGRESS REPORT",children:i})]})})}function fN({onLocate:n,presentation:a,setStatusFilter:i,tasks:r}){const u=j.useRef(new WeakSet),f=j.useRef(new Set),p=j.useRef(null);p.current===null&&typeof window.matchMedia=="function"&&(p.current=window.matchMedia("(prefers-reduced-motion: reduce)"));const m=r.slice(0,60),g=m.length<=14;return j.useEffect(()=>{const v=()=>{f.current.forEach(T=>T.cancel()),f.current.clear()},y=p.current,b=()=>{y?.matches===!0&&v()};return y?.addEventListener("change",b),()=>{y?.removeEventListener("change",b),v()}},[]),o.jsxs("div",{className:"progress-report-page__timeline",children:[o.jsxs("div",{className:"progress-report-page__timeline-meta",children:[o.jsx("span",{children:"task completion · one node per task"}),o.jsx("div",{className:"progress-report-page__legend",children:rN.map(v=>{const y=T_[v],b=a.statusFilter===v;return o.jsxs("button",{"aria-pressed":b,className:"progress-report-page__legend-button","data-state":v,onClick:()=>i(v),title:b?`showing ${y.label} only — click to clear`:`filter tasks: ${y.label}`,type:"button",children:[o.jsx("span",{className:"progress-report-page__legend-dot",children:v==="failed"?"✕":""}),y.label]},v)})})]}),o.jsxs("div",{"aria-label":"Task completion timeline",className:"progress-report-page__timeline-chart",role:"group",children:[o.jsx("span",{"aria-hidden":"true",className:"progress-report-page__timeline-line"}),o.jsx("div",{className:"progress-report-page__timeline-nodes","data-single":m.length===1||void 0,children:m.map((v,y)=>{const b=aN(y,m.length),T=(a.agentFilter!==null||a.statusFilter!==null)&&!((a.agentFilter===null||v.agent===a.agentFilter)&&(a.statusFilter===null||v.status===a.statusFilter));return o.jsx("span",{className:"progress-report-page__node-slot",children:o.jsxs("button",{"aria-label":`${v.id} — ${v.title} · ${v.status}${v.note===void 0?"":` · ${v.note}`} · locate task`,className:"progress-report-page__node","data-dimmed":T||void 0,"data-entrance-delay":`${(b/1e3).toFixed(2)}s`,"data-state":v.status,onClick:()=>n(v),ref:N=>{if(N===null||u.current.has(N)||(u.current.add(N),p.current?.matches===!0||typeof N.animate!="function"))return;const R=N.animate([{opacity:0},{opacity:1}],{delay:b,duration:350,easing:"ease-out",fill:"backwards"});f.current.add(R);const L=()=>{f.current.delete(R)};R.finished.then(L,L)},title:`${v.id} — ${v.title} · ${v.status}${v.note===void 0?"":` · ${v.note}`}`,type:"button",children:[o.jsx("span",{className:"progress-report-page__node-dot",children:v.status==="failed"?"✕":""}),g?o.jsx("span",{className:"progress-report-page__node-label",children:v.id}):null]})},`${v.id}-${String(y)}`)})})]}),o.jsxs("div",{className:"progress-report-page__timeline-axis",children:[o.jsx(Vi,{children:m[0]?.id??"T1"}),o.jsx(Vi,{children:m.at(-1)?.id??`T${String(r.length)}`})]})]})}function hN({agent:n,pressed:a,toggle:i}){return o.jsxs("button",{"aria-pressed":a,className:"progress-report-page__agent-row","data-selected":a||void 0,"data-state":n.status,onClick:i,title:a?"filtering by this agent — click to clear":"filter tasks and log to this agent",type:"button",children:[o.jsx("span",{className:"progress-report-page__glyph",children:oN[n.status]}),o.jsxs("span",{className:"progress-report-page__agent-name",children:[n.name," ",o.jsxs("span",{children:["· ",n.role]})]}),o.jsx("span",{className:"progress-report-page__agent-activity",children:n.activity}),o.jsx("span",{className:"progress-report-page__state-word",children:n.status}),o.jsx("span",{className:"progress-report-page__relative",children:n.updatedLabel})]})}function pN({flash:n,highlighted:a,task:i}){const r=T_[i.status];return o.jsxs("div",{className:"progress-report-page__task-row","data-flash":n??void 0,"data-highlighted":a||void 0,"data-state":i.status,"data-task-id":i.id,children:[o.jsx("span",{className:"progress-report-page__glyph",children:r.glyph}),o.jsx("span",{className:"progress-report-page__task-id",title:i.id,children:i.id}),o.jsxs("span",{className:"progress-report-page__task-copy",children:[o.jsx("span",{children:i.title}),i.note===void 0?null:o.jsx("span",{children:i.note})]}),o.jsx("span",{className:"progress-report-page__task-agent",children:i.agent??""}),o.jsx("span",{className:"progress-report-page__state-word",children:i.status})]})}function mN({entry:n,flash:a}){return o.jsxs(o.Fragment,{children:[n.showDay?o.jsxs("div",{className:"progress-report-page__day-separator",children:[o.jsx("span",{children:n.dayLabel}),o.jsx("span",{})]}):null,o.jsxs("div",{className:"progress-report-page__log-row","data-flash":a??void 0,"data-kind":n.kind,title:n.t,children:[o.jsx("span",{children:n.clockLabel}),o.jsx("span",{children:n.agent}),o.jsxs("span",{className:"progress-report-page__log-message",children:[o.jsx("span",{children:cN[n.kind]}),o.jsx("span",{children:n.msg})]})]})]})}function gN({blockers:n}){const a=n.findIndex(i=>i.needsHuman);return o.jsx(Os,{label:"BLOCKERS",children:o.jsx("div",{className:"progress-report-page__blockers",children:n.map((i,r)=>o.jsxs("div",{children:[i.needsHuman?o.jsx("span",{className:"progress-report-page__human-stamp","data-primary":r===a||void 0,children:"NEEDS HUMAN"}):null,o.jsx("span",{children:i.msg}),o.jsxs("span",{children:["raised by ",i.raisedBy]})]},`${i.raisedBy}-${String(r)}`))})})}function vN({onSet:n,status:a}){const[i,r]=j.useState(!1),u=j.useId(),f=j.useRef(null),p=j.useRef(null),m=j.useRef(new Map);j.useEffect(()=>{if(!i)return;m.current.get(a)?.focus();const b=T=>{T.target instanceof Node&&!f.current?.contains(T.target)&&r(!1)};return document.addEventListener("pointerdown",b),()=>document.removeEventListener("pointerdown",b)},[i,a]);const g=()=>{r(!1),p.current?.focus()},v=b=>{r(!1),p.current?.focus(),b!==a&&n(b)},y=b=>{if(b.key==="Escape"){b.preventDefault(),g();return}if(b.key==="Tab"){r(!1);return}if(b.key==="Home"||b.key==="End"||b.key==="ArrowDown"||b.key==="ArrowUp"){b.preventDefault();const T=$s.map(R=>m.current.get(R)).filter(R=>R!==void 0);if(T.length===0)return;const N=T.indexOf(document.activeElement),C=b.key==="Home"?0:b.key==="End"?T.length-1:N===-1?0:(N+(b.key==="ArrowDown"?1:-1)+T.length)%T.length;T[C]?.focus()}};return o.jsxs("div",{className:"progress-report-page__status-menu",ref:f,children:[o.jsxs("button",{"aria-controls":i?u:void 0,"aria-expanded":i,"aria-haspopup":"listbox","aria-label":"session status",className:"progress-report-page__tag progress-report-page__status-trigger","data-state":a,onClick:()=>r(b=>!b),ref:p,type:"button",children:[o.jsx("span",{children:a}),o.jsx("span",{"aria-hidden":"true",className:"progress-report-page__status-chevron",children:i?"⌃":"⌄"})]}),i?o.jsx("div",{"aria-label":"session status",className:"progress-report-page__status-panel",id:u,onKeyDown:y,role:"listbox",children:$s.map(b=>o.jsxs("button",{"aria-selected":b===a,className:"progress-report-page__status-option","data-state":b,onClick:()=>v(b),ref:T=>{T===null?m.current.delete(b):m.current.set(b,T)},role:"option",type:"button",children:[o.jsx("span",{children:b}),b===a?o.jsx("span",{"aria-hidden":"true",className:"progress-report-page__status-current",children:"current"}):null]},b))}):null]})}function _N({expanded:n,files:a,label:i,onToggle:r,totals:u,totalCount:f}){return o.jsx(Os,{label:"FILES CHANGED",children:o.jsxs("div",{className:"progress-report-page__files",children:[a.map((p,m)=>o.jsxs("span",{className:"progress-report-page__file-row","data-change":p.change,children:[o.jsx("span",{children:p.change[0]?.toUpperCase()}),o.jsx("span",{"aria-label":p.path,children:p.displayPath}),o.jsx("span",{children:p.adds===0?"":`+${String(p.adds)}`}),o.jsx("span",{children:p.dels===0?"":`−${String(p.dels)}`})]},`${p.path}-${String(m)}`)),o.jsxs("div",{className:"progress-report-page__file-summary",children:[o.jsxs("span",{children:[i===null||n?`${String(f)} ${f===1?"file":"files"}`:`top 8 of ${String(f)} by churn`,i===null?null:o.jsxs(o.Fragment,{children:[" · ",o.jsx("button",{className:"progress-report-page__text-control",onClick:r,type:"button",children:i})]})]}),o.jsxs("span",{children:[o.jsxs("strong",{children:["+",String(u.adds)]})," · −",String(u.dels)]})]})]})})}function iv({detail:n,detailPhase:a,nowMs:i,onBack:r,onPause:u=()=>{},onResume:f=()=>{},onRetry:p,onSetStatusOverride:m,omittedSections:g,pollingPhase:v="current",publishedSessionStatus:y,selectedId:b,unreadableReason:T}){const N=j.useRef(null),C=j.useRef(null),R=j.useRef(null),L=j.useRef(null),q=j.useRef(0),O=j.useRef(null),[Y,A]=j.useState(()=>window.innerWidth<=880),[$,ae]=j.useState({agentFilter:null,filesExpanded:!1,issuesOnly:!1,statusFilter:null}),[te,he]=j.useState(null),[re,ye]=j.useState(null),me=T!==null?"unreadable":n===null?"empty":"detail";if(j.useEffect(()=>{const Q=()=>A(window.innerWidth<=880);return window.addEventListener("resize",Q),()=>window.removeEventListener("resize",Q)},[]),j.useEffect(()=>{if(b===null||!Y){C.current=null;return}const Q=`${b}:${me}`;C.current!==Q&&(C.current=Q,N.current?.focus())},[me,Y,b]),j.useEffect(()=>()=>{R.current!==null&&window.clearTimeout(R.current),O.current!==null&&window.clearTimeout(O.current)},[]),j.useEffect(()=>{if(n===null){L.current=null,ye(null),O.current!==null&&window.clearTimeout(O.current);return}const Q=L.current;if(L.current=n,Q===null||Q.session.id!==n.session.id){ye(null),O.current!==null&&window.clearTimeout(O.current);return}q.current+=1;const ve=new Map((Q.tasks??[]).map(tt=>[tt.id,tt.status])),Qe=new Set((n.tasks??[]).filter(tt=>ve.get(tt.id)!==tt.status).map(tt=>tt.id)),Ge=new Set((Q.log??[]).map(Td)),bn=new Set((n.log??[]).map(Td).filter(tt=>!Ge.has(tt))),On=Q.session.updatedAt!==n.session.updatedAt;if(!On&&Qe.size===0&&bn.size===0){ye(null),O.current!==null&&window.clearTimeout(O.current);return}const it=q.current%2===1?"a":"b";ye({generation:it,logKeys:bn,taskIds:Qe,wrote:On}),O.current!==null&&window.clearTimeout(O.current),O.current=window.setTimeout(()=>ye(null),2600)},[n]),b===null)return o.jsx(Cd,{backRef:N,onBack:r,children:o.jsx("p",{children:"Select an agent progress report to inspect its narrative."})});if(T!==null)return o.jsxs(Cd,{backRef:N,onBack:r,children:[o.jsx("h1",{children:"Progress report unavailable"}),o.jsx("p",{children:dN(T)}),o.jsx("button",{className:"progress-report-page__action",onClick:p,type:"button",children:"retry progress report"})]});if(n===null){const Q=a==="error";return o.jsxs(Cd,{backRef:N,busy:a==="loading",onBack:r,children:[o.jsx("h1",{children:"Progress report"}),o.jsx("p",{children:a==="loading"?"Loading progress report…":a==="not_found"?"The selected progress report is no longer available.":Q?"The progress report could not be loaded.":"Progress report is unavailable."}),Q?o.jsx("button",{className:"progress-report-page__action",onClick:p,type:"button",children:"retry progress report"}):null]})}const G=iN(n,i,$),ge=a==="stale",_e=v==="paused",W=lv[v],z=ge||!["current","initial_loading","paused"].includes(v),X=ge&&v==="current"?lv.stale.label:W.label,F=n.tasks??[],ee=Q=>{ae(ve=>({...ve,statusFilter:ve.statusFilter===Q?null:Q}))},fe=()=>{ae(Q=>({...Q,agentFilter:null,statusFilter:null}))},S=Q=>{G.tasks.some(Qe=>Qe===Q)||fe(),he(Q.id),R.current!==null&&window.clearTimeout(R.current),R.current=window.setTimeout(()=>he(null),2200),window.setTimeout(()=>{document.querySelector(`[data-task-id="${CSS.escape(Q.id)}"]`)?.scrollIntoView({behavior:"smooth",block:"center"})},60)},U=n.blockers??[],K=U.filter(Q=>Q.needsHuman).length,J=n.tests,ue=n.files??[];return o.jsxs("main",{className:"progress-report-page",children:[o.jsxs("span",{"aria-hidden":"true",className:"progress-report-page__stamp",children:[n.session.id," · started ",G.startedClock," · operate terminal"]}),o.jsxs("div",{className:"progress-report-page__wrap",children:[o.jsxs("div",{className:"progress-report-page__stack",children:[o.jsxs("header",{className:"progress-report-page__header",children:[o.jsxs("div",{className:"progress-report-page__meta-row",children:[o.jsxs("div",{className:"progress-report-page__tags",children:[o.jsx("button",{"aria-label":"back to progress reports",className:"progress-report-page__tag progress-report-page__back-tag",onClick:r,ref:N,title:"back to progress reports",type:"button",children:n.session.id}),m===void 0?o.jsx("span",{className:"progress-report-page__tag","data-state":n.session.status,children:n.session.status}):o.jsx(vN,{onSet:Q=>{m({action:"set",status:Q})},status:n.session.status}),o.jsx("button",{className:"progress-report-page__text-control",onClick:()=>{m?.({action:"revert"})},type:"button",children:"[ revert ]"}),ge?o.jsx("span",{className:"progress-report-page__tag","data-variant":"outline",children:"stale"}):null]}),o.jsxs("span",{className:"progress-report-page__header-controls",children:[o.jsxs("span",{className:"progress-report-page__updated","data-flash":re?.wrote?re.generation:void 0,"data-stale":ge||void 0,title:`last write ${n.session.updatedAt}`,children:[ge?"last write":"updated"," ",G.updatedLabel]}),o.jsx(uN,{})]})]}),y===void 0?null:o.jsxs("span",{className:"progress-report-page__published-status",children:["agent published: ",y]}),o.jsx("h1",{children:n.session.title}),o.jsx("p",{children:n.session.goal}),o.jsxs("span",{className:"progress-report-page__session-line",children:["started ",G.startedClock," · elapsed ",G.elapsedLabel," · ",String(G.agents.length)," agents · ",String(G.progress.total)," tasks"]}),G.notice===null?null:o.jsxs("div",{className:"progress-report-page__notice",children:[o.jsx("span",{className:"progress-report-page__tag","data-variant":"outline",children:"needs human"}),o.jsx("span",{children:G.notice.msg.length>140?`${G.notice.msg.slice(0,139).trimEnd()}…`:G.notice.msg}),o.jsxs("span",{children:["raised by ",G.notice.raisedBy,K>1?` · +${String(K-1)} more`:""]}),o.jsxs("button",{className:"progress-report-page__text-control",onClick:()=>document.querySelector("[data-progress-blockers]")?.scrollIntoView({behavior:"smooth"}),type:"button",children:["[ view ",U.filter(Q=>Q.needsHuman).length>1?"blockers":"blocker"," ]"]})]})]}),ge?o.jsxs("section",{className:"progress-report-page__truth-state",role:"status",children:[o.jsx("strong",{children:"Showing a stale snapshot."})," ",_e?"The last verified report remains visible; polling is paused.":W.terminal?`The last verified report remains visible; polling stopped because ${W.label}.`:"The live read failed; the last verified report remains visible while polling retries."]}):null,F.length===0?null:o.jsxs("section",{className:"progress-report-page__hero",children:[o.jsx(fN,{onLocate:S,presentation:$,setStatusFilter:ee,tasks:F}),o.jsx("div",{className:"progress-report-page__progress-card",children:o.jsxs(Os,{label:"COMPLETE",children:[o.jsxs("div",{className:"progress-report-page__progress-value",children:[String(G.progress.donePercent),"%"]}),o.jsxs("svg",{"aria-hidden":"true",className:"progress-report-page__bar",preserveAspectRatio:"none",viewBox:"0 0 100 4",children:[o.jsx("rect",{className:"progress-report-page__bar-track",height:"4",width:"100"}),o.jsx("rect",{className:"progress-report-page__bar-done",height:"4",width:G.progress.doneWidthPercent}),o.jsx("rect",{className:"progress-report-page__bar-active",height:"4",width:G.progress.activeWidthPercent,x:G.progress.doneWidthPercent})]}),o.jsxs("span",{className:"progress-report-page__caption",children:[String(G.progress.done)," of ",String(G.progress.total)," tasks done · ",String(G.progress.active)," active · ",String(G.progress.blocked)," blocked"]})]})})]}),G.agents.length===0?null:o.jsxs("section",{className:"progress-report-page__agents","aria-labelledby":"progress-agents-title",children:[o.jsxs("div",{className:"progress-report-page__section-heading",children:[o.jsx(Vi,{children:o.jsx("span",{id:"progress-agents-title",children:"Agents"})}),o.jsxs("span",{children:[String(G.workingAgentCount)," working"]})]}),G.agents.map((Q,ve)=>o.jsx(hN,{agent:Q,pressed:$.agentFilter===Q.name,toggle:()=>ae(Qe=>({...Qe,agentFilter:Qe.agentFilter===Q.name?null:Q.name}))},`${Q.name}-${String(ve)}`))]}),o.jsxs("section",{className:"progress-report-page__main",children:[o.jsx("div",{className:"progress-report-page__blocker-slot","data-progress-blockers":!0,children:U.length===0?null:o.jsx(gN,{blockers:U})}),o.jsxs("div",{className:"progress-report-page__left",children:[F.length===0?null:o.jsxs("section",{"aria-labelledby":"progress-tasks-title",children:[o.jsxs("div",{className:"progress-report-page__section-heading",children:[o.jsx(Vi,{children:o.jsx("span",{id:"progress-tasks-title",children:"Tasks"})}),G.taskFilterLabel===null?o.jsxs("span",{children:[String(G.progress.done)," done · ",String(G.progress.active)," active · ",String(G.progress.blocked)," blocked"]}):o.jsxs("span",{children:[G.taskFilterLabel," · ",o.jsx("button",{className:"progress-report-page__text-control",onClick:fe,type:"button",children:"[ clear ]"})]})]}),G.tasks.map((Q,ve)=>o.jsx(pN,{flash:re?.taskIds.has(Q.id)===!0?re.generation:null,highlighted:te===Q.id,task:Q},`${Q.id}-${String(ve)}`)),G.tasks.length===0?o.jsxs("div",{className:"progress-report-page__empty-filter",children:["no tasks match the current filter · ",o.jsx("button",{className:"progress-report-page__text-control",onClick:fe,type:"button",children:"[ clear ]"})]}):null]}),(n.log??[]).length===0?null:o.jsxs("section",{"aria-labelledby":"progress-log-title",children:[o.jsxs("div",{className:"progress-report-page__section-heading",children:[o.jsx(Vi,{children:o.jsx("span",{id:"progress-log-title",children:"Activity log"})}),o.jsxs("span",{children:["newest first · showing ",G.logs.length<G.logTotal?`${String(G.logs.length)} of ${String(G.logTotal)}`:String(G.logTotal),$.agentFilter===null?"":` · ${$.agentFilter}`,(n.log??[]).some(Q=>Q.kind==="warn"||Q.kind==="error")?o.jsxs(o.Fragment,{children:[" · ",o.jsx("button",{"aria-pressed":$.issuesOnly,className:"progress-report-page__text-control",onClick:()=>ae(Q=>({...Q,issuesOnly:!Q.issuesOnly})),type:"button",children:$.issuesOnly?"[ show all ]":"[ issues only ]"})]}):null]})]}),G.logs.map((Q,ve)=>o.jsx(mN,{entry:Q,flash:re?.logKeys.has(Td(Q))===!0?re.generation:null},`${Q.t}-${String(ve)}`)),G.logs.length===0?o.jsx("div",{className:"progress-report-page__empty-filter",children:"no entries match the current filter"}):null]})]}),o.jsxs("aside",{className:"progress-report-page__rail",children:[J===void 0?null:o.jsxs(Os,{label:"TESTS",children:[o.jsxs("div",{className:"progress-report-page__test-counts",children:[o.jsxs("span",{children:[o.jsx("strong",{children:String(J.passed)}),o.jsx("small",{children:"passed"})]}),o.jsxs("span",{children:[o.jsx("strong",{"data-failed":J.failed>0||void 0,children:String(J.failed)}),o.jsx("small",{children:"failed"})]}),o.jsxs("span",{children:[o.jsx("strong",{children:String(J.skipped)}),o.jsx("small",{children:"skipped"})]})]}),J.passed+J.failed+J.skipped===0?null:o.jsxs("svg",{"aria-hidden":"true",className:"progress-report-page__bar",preserveAspectRatio:"none",viewBox:"0 0 100 4",children:[o.jsx("rect",{className:"progress-report-page__bar-track",height:"4",width:"100"}),o.jsx("rect",{className:"progress-report-page__bar-pass",height:"4",width:J.passed/(J.passed+J.failed+J.skipped)*100}),o.jsx("rect",{className:"progress-report-page__bar-fail",height:"4",width:J.failed/(J.passed+J.failed+J.skipped)*100,x:J.passed/(J.passed+J.failed+J.skipped)*100})]}),J.failing.length===0?null:o.jsx("div",{className:"progress-report-page__failing",children:J.failing.map((Q,ve)=>o.jsxs("span",{children:[o.jsx("span",{"aria-hidden":"true",children:"✕ "}),o.jsx("span",{children:Q})]},`${Q}-${String(ve)}`))}),o.jsx("span",{className:"progress-report-page__caption",children:J.passed+J.failed+J.skipped===0?"no results recorded yet":`${String(J.passed)} of ${String(J.passed+J.failed)} passing · last run ${G.testsLastRunLabel??"—"}`})]}),ue.length===0?null:o.jsx(_N,{expanded:$.filesExpanded,files:G.files,label:G.filesToggleLabel,onToggle:()=>ae(Q=>({...Q,filesExpanded:!Q.filesExpanded})),totalCount:ue.length,totals:G.fileTotals}),G.decisions.length===0?null:o.jsx(Os,{label:"DECISIONS",children:o.jsx("div",{className:"progress-report-page__decisions",children:G.decisions.map((Q,ve)=>o.jsxs("div",{children:[o.jsx("span",{children:Q.msg}),o.jsxs("span",{children:[Q.by," · ",Q.relativeLabel]})]},`${Q.by}-${String(ve)}`))})}),g.length===0?null:o.jsx(Os,{label:"PARTIALLY OMITTED",children:o.jsxs("p",{className:"progress-report-page__omitted",children:["The server omitted these sections: ",g.join(", "),"."]})})]})]})]}),o.jsxs("footer",{className:"progress-report-page__footer",children:[o.jsx("span",{}),o.jsxs("div",{children:[o.jsx("span",{children:"native projection · poll every 3s · times utc"}),o.jsx("span",{children:"[ authenticated · strict csp ]"})]})]})]}),o.jsxs("button",{"aria-pressed":_e,className:"progress-report-page__live-chip","data-degraded":z||void 0,"data-paused":_e||void 0,disabled:W.terminal,onClick:_e?f:u,title:W.terminal?`${W.label} — reconnect from the dashboard`:_e?"polling paused — click to resume":"click to pause polling",type:"button",children:[o.jsx("span",{}),X]})]})}const yN=["all","orphaned","pending","running","succeeded","failed","cancelled"];function Od(n){return n==="succeeded"||n==="failed"||n==="cancelled"}function bN(n){return n.length>=3?2:1}function kd(n,a){return a==="all"?!0:n.availability==="unavailable"?!1:a==="orphaned"?n.workerObservation==="orphaned":a==="pending"||a==="running"?Ji(n.workerObservation)&&n.row.status===a:n.row.status===a}function xN(n){return n.workerObservation==="unknown"?"worker-unknown":n.workerObservation==="orphaned"?"orphaned":n.row.status}function SN({card:n}){return n.availability==="unavailable"?o.jsxs("div",{className:"run-card run-card--unavailable",children:[o.jsx("span",{className:"run-card__id",children:n.row.runId}),o.jsx("span",{className:"run-card__status",children:n.statusLabel}),o.jsx("span",{className:"run-card__diagnostic",children:"diagnostic only"})]}):o.jsxs("div",{className:`run-card run-card--${xN(n)}`,children:[o.jsxs("span",{className:"run-card__header",children:[o.jsxs("span",{className:"run-card__identity",children:[o.jsxs("span",{className:"run-card__id",children:["run ",n.row.runId]}),n.flags.map(a=>o.jsx("span",{className:"run-card__flag",children:a},a))]}),o.jsx("span",{className:"run-card__status",children:n.statusLabel})]}),o.jsxs("span",{className:"run-card__workflow",children:[o.jsx("span",{className:"run-card__workflow-name",children:n.row.workflowName}),o.jsxs("span",{className:"run-card__workflow-version",children:["v",n.row.workflowVersion]}),n.statusTags.map(a=>o.jsx("span",{className:"run-card__tag",children:a},a))]}),n.row.stageMarkers.length===0?o.jsx("span",{className:"run-card__stage-empty",children:"stage state not reported"}):o.jsxs("span",{"aria-label":"stage states",className:"run-card__stage-track",children:[o.jsx("span",{className:"run-card__stage-list",children:n.row.stageMarkers.map((a,i,r)=>o.jsx("span",{"aria-hidden":"true",className:["run-card__stage-node",Od(a.state)&&Od(r[i+1]?.state)?"run-card__stage-node--complete-connector":"",n.showLiveMotion&&n.row.status==="running"&&Od(a.state)&&r[i+1]?.state==="running"?"run-card__stage-node--live-connector":""].filter(Boolean).join(" "),children:o.jsx("span",{"aria-hidden":"true",className:`run-card__stage-dot run-card__stage-dot--${a.state}`,children:a.state==="failed"?"×":null})},a.stageId))}),o.jsx("span",{"aria-hidden":"true",className:"run-card__stage-labels","data-stages":String(n.row.stageMarkers.length),"data-rows":String(bN(n.row.stageMarkers)),children:n.row.stageMarkers.map((a,i)=>o.jsxs("span",{"aria-label":`${a.stageId}: ${a.state} ${yg(a)}`,className:["run-card__stage-label",vx(a)?"run-card__stage-label--active":""].filter(Boolean).join(" "),"data-row":String(i),children:[o.jsx("span",{className:"run-card__stage-label-id",children:a.stageId}),o.jsx("span",{className:"run-card__stage-label-count",children:yg(a)})]},a.stageId))}),n.row.additionalStageCount>0?o.jsxs("span",{className:"run-card__stage-overflow",children:["+",String(n.row.additionalStageCount)," retained stages"]}):null]}),o.jsxs("span",{className:"run-card__footer",children:[o.jsx("span",{className:"run-card__timing",children:n.timingLabel}),o.jsxs("span",{className:"run-card__footnote",children:["updated ",n.updatedAgeLabel," · ",n.reportedRunningCallsLabel]}),o.jsx("span",{className:"run-card__detail-hint",children:"detail ›"})]})]})}function jN(n,a){return n.selected?.runId===a.runId&&n.selected.runGeneration===a.runGeneration}function Md(n){return`${n.runId}:${n.runGeneration}`}function zd({cards:n,label:a,onMovePastBoundary:i,onSelect:r,rootRef:u,state:f}){const p=new Map(n.map(g=>[Md(g.row),g])),m=n.find(g=>jN(f,g.row));return o.jsx(er,{ariaLabel:a,items:n.map(g=>({id:Md(g.row),label:`${g.row.runId} ${g.statusLabel}${g.availability==="unavailable"?" diagnostic only":""}`,content:o.jsx(SN,{card:g})})),...i===void 0?{}:{onMovePastBoundary:i},onSelect:g=>{const v=p.get(g);v!==void 0&&r(v.row)},...u===void 0?{}:{rootRef:u},selectedId:m===void 0?null:Md(m.row)})}function rv(n,a){const i=n?.querySelectorAll('[role="option"]:not([aria-disabled="true"])');i?.length&&i.item(a==="first"?0:i.length-1).focus()}function wN({label:n}){return o.jsxs("div",{className:"run-list__placeholders",children:[o.jsx("p",{className:"run-list__placeholder-copy",role:"status",children:n}),o.jsx("div",{className:"run-list__placeholder","aria-hidden":"true"}),o.jsx("div",{className:"run-list__placeholder","aria-hidden":"true"}),o.jsx("div",{className:"run-list__placeholder","aria-hidden":"true"})]})}function NN(n){const[a,i]=j.useState("all"),r=Mv(n.state),u=r.live.filter(C=>kd(C,a)),f=r.history.filter(C=>kd(C,a)),p=[...r.live,...r.history],m=_x(p),g=C=>p.filter(R=>kd(R,C)).length,v=a==="all"?String(r.live.length):`${String(u.length)}/${String(r.live.length)}`,y=a==="all"?String(r.history.length):`${String(f.length)}/${String(r.history.length)}`,b=["stale","offline","error"].includes(n.state.phase),T=j.useRef(null),N=j.useRef(null);return o.jsxs("section",{className:"run-list","aria-label":"Run monitor lanes",children:[o.jsxs("div",{className:b?"run-list__recovery":"visually-hidden",role:"status",children:[o.jsxs("span",{children:[r.phaseLabel," · ",r.lastRefreshLabel]}),b?o.jsx("button",{onClick:n.onRetry,type:"button",children:"[ retry now ]"}):null]}),n.state.announcement===null?null:o.jsx("p",{className:"run-list__announcement","data-selection-loss-announcement":!0,role:"status",tabIndex:-1,children:n.state.announcement}),o.jsx(Wo,{groupLabel:"Filter runs by status",selected:a,onSelect:i,chips:yN.map(C=>({id:C,label:C,count:g(C)}))}),a==="all"?o.jsxs("section",{"aria-labelledby":"run-list-all-title",className:"run-list__lane",children:[o.jsxs("div",{className:"run-list__lane-heading",children:[o.jsx("h2",{id:"run-list-all-title",children:"Workflow runs"}),o.jsxs("p",{children:["[ all ",String(m.length)," · page ",String(n.state.historyPage+1)," ]"]})]}),m.length===0?n.state.phase==="initial_loading"?o.jsx(wN,{label:r.phaseLabel}):o.jsx("p",{className:"run-list__empty",children:"No runs are loaded."}):o.jsx(zd,{cards:m,label:"All loaded runs",onSelect:n.onSelect,state:n.state}),o.jsxs("nav",{"aria-label":"History pages",className:"run-list__pagination",children:[o.jsx("button",{disabled:!n.state.canGoNewer,onClick:n.onNewer,type:"button",children:"[ newer ]"}),o.jsx("button",{disabled:!n.state.canGoOlder,onClick:n.onOlder,type:"button",children:"[ older ]"})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("section",{"aria-labelledby":"run-list-live-title",className:"run-list__lane",children:[o.jsxs("div",{className:"run-list__lane-heading",children:[o.jsx("h2",{id:"run-list-live-title",children:"Workflow runs"}),o.jsxs("p",{children:["[ live ",v," ]"]})]}),u.length===0?o.jsx("p",{className:"run-list__empty",children:r.live.length===0?"No runs are currently reported pending or running.":`No loaded live runs match ${a}.`}):o.jsx(zd,{cards:u,label:"Live runs",...f.length===0?{}:{onMovePastBoundary:C=>{C===1&&rv(N.current,"first")}},onSelect:n.onSelect,rootRef:T,state:n.state})]}),o.jsxs("section",{"aria-labelledby":"run-list-history-title",className:"run-list__lane",children:[o.jsxs("div",{className:"run-list__lane-heading",children:[o.jsx("h2",{id:"run-list-history-title",children:"Settled"}),o.jsxs("p",{children:["[ history ",y," · page ",String(n.state.historyPage+1)," ]"]})]}),f.length===0?o.jsx("p",{className:"run-list__empty",children:r.history.length===0?"No history runs are loaded on this page.":`No loaded history runs match ${a}.`}):o.jsx(zd,{cards:f,label:"History runs",...u.length===0?{}:{onMovePastBoundary:C=>{C===-1&&rv(T.current,"last")}},onSelect:n.onSelect,rootRef:N,state:n.state}),o.jsxs("nav",{"aria-label":"History pages",className:"run-list__pagination",children:[o.jsx("button",{disabled:!n.state.canGoNewer,onClick:n.onNewer,type:"button",children:"[ newer ]"}),o.jsx("button",{disabled:!n.state.canGoOlder,onClick:n.onOlder,type:"button",children:"[ older ]"})]})]})]}),o.jsxs("p",{"aria-hidden":"true",className:"run-list__keyboard-hint",children:[o.jsx("kbd",{children:"↑"}),o.jsx("kbd",{children:"↓"}),o.jsx("span",{children:"select run"}),o.jsx("span",{children:"·"}),o.jsx("kbd",{children:"enter"}),o.jsx("span",{children:"open detail"})]})]})}class Ot extends Error{constructor(a,i,r){super(a),this.kind=a,this.status=i,this.code=r,this.name="ArtifactApiError"}}function ov(n){return n??new AbortController().signal}function AN(n,a){return a.aborted||n instanceof DOMException&&n.name==="AbortError"}async function RN(n){try{const a=await nn(n);return typeof a.error?.code=="string"?a.error.code:void 0}catch(a){if(a instanceof qe)throw new Ot("connection_changed",409,"agent_instance_changed");return}}async function cv(n,a,i){let r;try{r=await n(a,{signal:i})}catch(u){throw u instanceof qe?new Ot("connection_changed",409,"agent_instance_changed"):AN(u,i)?new Ot("aborted"):new Ot("offline")}if(r.status===401)throw new Ot("auth_expired",401,"unauthorized");if(!r.ok){const u=await RN(r);throw u==="agent_instance_changed"?new Ot("connection_changed",r.status,u):new Ot("request_error",r.status,u)}return r}function EN(n=_a){return{async listArtifacts(a={}){const i=ov(a.signal),r=new URLSearchParams({limit:"100"});a.before!==void 0&&r.set("before",a.before);const u=await cv(n,`/api/artifacts?${r.toString()}`,i);try{return await nn(u)}catch(f){throw f instanceof qe?new Ot("connection_changed",409,"agent_instance_changed"):new Ot("request_error",u.status)}},async inspectArtifact(a,i){const r=ov(i),u=encodeURIComponent(a.runId),f=encodeURIComponent(a.stageId),p=encodeURIComponent(a.callId),m=encodeURIComponent(a.runGeneration),g=await cv(n,`/api/runs/${u}/stages/${f}/calls/${p}/artifact?generation=${m}`,r);if(g.headers.get("ETag")!==`"${a.stateRevision}"`)throw new Ot("stale_revision",g.status);let v;try{v=await uf(g)}catch(T){throw T instanceof qe?new Ot("connection_changed",409,"agent_instance_changed"):T}let y;try{y=JSON.parse(v)}catch{throw new Ot("malformed_json",g.status)}const b=g.headers.get("X-ClinkX-Validator-Schema-Id");if(b===null||b.length===0)throw new Ot("request_error",g.status);return{byteSize:new TextEncoder().encode(v).byteLength,content:v,parsed:y,validatorId:b}}}}function TN({announcement:n}){const a=j.useRef(n?.key??null),[i,r]=j.useState(n?.message??"");return j.useEffect(()=>{if(!n){a.current=null,r("");return}n.key!==a.current&&(a.current=n.key,r(n.message))},[n]),o.jsx("div",{"aria-atomic":"true","aria-live":"polite",className:"visually-hidden",role:"status",children:i})}function Ui(n){return[n.runId,n.runGeneration,n.stateRevision,n.stageId,n.callId].join("\0")}function uv(n,a){return n!==void 0&&n.runId===a.runId&&n.runGeneration===a.runGeneration&&n.stateRevision===a.stateRevision}function CN({groupEnd:n,groupStart:a,reference:i}){return o.jsxs("article",{className:["artifact-card",a?"artifact-card--group-start":"",n?"artifact-card--group-end":""].filter(Boolean).join(" "),children:[a?o.jsxs("header",{className:"artifact-card__group-header",children:[o.jsxs("h3",{className:"artifact-card__identity",children:["run ",i.runId]}),o.jsxs("span",{children:["generation ",i.runGeneration," · revision ",i.stateRevision]})]}):null,o.jsxs("div",{className:"artifact-card__reference-row",children:[o.jsxs("span",{children:[i.stageId," / ",i.callId,".json"]}),o.jsxs("span",{className:"artifact-card__reference-meta",children:[i.kind.toUpperCase()," · ",i.validation," · [ inspect ]"]})]})]})}function ON(n){return n instanceof Ot?n.kind==="auth_expired"?"Authentication expired; artifact references were not loaded.":n.kind==="connection_changed"?"Dashboard connection changed; rebootstrap is required.":n.kind==="offline"?"Offline; artifact references could not be refreshed.":n.code==="artifact_catalog_limit_exceeded"?"The retained artifact reference catalog exceeded its server bound; no partial page was returned.":"Artifact references could not be loaded.":"Artifact references could not be loaded."}function kN(n){return n instanceof Ot?n.kind==="auth_expired"?"Authentication expired; artifact bytes were not loaded.":n.kind==="connection_changed"?"Dashboard connection changed; rebootstrap is required.":n.kind==="offline"?"Offline; artifact bytes were not loaded.":n.kind==="malformed_json"?"The inspected artifact was malformed JSON; no content was displayed.":n.kind==="stale_revision"||n.code==="run_state_changed"?"The run revision changed after this reference was loaded; refetch the artifact catalog.":n.status===404||n.code==="not_found"||n.code==="run_generation_changed"?"This retained reference was pruned or its run ID was recycled; refetch the artifact catalog.":n.code==="content_too_large_for_dashboard"?"The artifact exceeds the dashboard inspection cap; no content was displayed.":"Artifact inspection failed; no content was displayed.":"Artifact inspection failed."}function MN({api:n,applicationRootId:a="root",onLoadedCount:i,runsRoot:r}){const[u,f]=j.useState([void 0]),[p,m]=j.useState(0),[g,v]=j.useState(null),[y,b]=j.useState("loading"),[T,N]=j.useState(null),[C,R]=j.useState({phase:"idle"}),[L,q]=j.useState(null),O=j.useRef(null),Y=j.useRef(null),A=j.useRef(0),$=j.useCallback(async(me,G)=>{O.current?.controller.abort();const ge=new AbortController,_e=++A.current;O.current={id:_e,controller:ge},b("loading"),N(null);let W=me,z=G;try{for(;;){const X=z[W],F=await n.listArtifacts({...X===void 0?{}:{before:X},signal:ge.signal});if(O.current?.id!==_e||ge.signal.aborted)return;if(F.artifacts.length>0||W===0){f(z),m(W),v(F),b("current"),i?.(F.artifacts.length),R(ee=>ee.phase==="idle"||F.artifacts.some(fe=>Ui(fe)===Ui(ee.reference))?ee:{phase:"idle"});return}W-=1,z=z.slice(0,W+1),q({key:`artifact-page-pruned-${String(_e)}-${String(W)}`,message:"That artifact page was pruned; returned to the nearest newer page."})}}catch(X){if(O.current?.id!==_e||ge.signal.aborted)return;b("error"),N(ON(X))}},[n,i]);j.useEffect(()=>($(0,[void 0]),()=>{O.current?.controller.abort(),Y.current?.abort()}),[$]);const ae=me=>{Y.current?.abort();const G=new AbortController;Y.current=G,R({phase:"loading",reference:me}),n.inspectArtifact(me,G.signal).then(ge=>{G.signal.aborted||Y.current!==G||R({phase:"current",reference:me,inspection:ge})}).catch(ge=>{G.signal.aborted||Y.current!==G||ge instanceof Ot&&ge.kind==="aborted"||R({phase:"error",reference:me,message:kN(ge)})})},te=()=>{if(g?.nextBefore===void 0)return;const me=[...u.slice(0,p+1),g.nextBefore];$(p+1,me)},he=()=>{p!==0&&$(p-1,u)},re=()=>{Y.current?.abort(),R({phase:"idle"})},ye=g?.artifacts??[];return o.jsxs("section",{"aria-labelledby":"artifact-catalog-title",className:"artifact-catalog",children:[o.jsxs("header",{className:"artifact-catalog__header",children:[o.jsx("h2",{className:"artifact-catalog__title",id:"artifact-catalog-title",children:"Run artifacts"}),o.jsxs("p",{children:[r===void 0?`[ retained references · ${String(ye.length)} ]`:`[ RUNS_ROOT = ${r} ]`,r===void 0?null:o.jsxs("span",{className:"visually-hidden",children:["[ retained references · ",String(ye.length)," ]"]})]}),y==="error"?o.jsx("button",{onClick:()=>{$(p,u)},type:"button",children:"retry artifacts"}):null]}),o.jsx(TN,{announcement:L}),y==="loading"&&g===null?o.jsx("p",{children:"Loading artifact references…"}):null,y==="error"?o.jsx("p",{role:"alert",children:T}):null,y!=="error"&&ye.length===0?o.jsx("p",{children:"No retained artifact references are loaded on this page."}):null,ye.length>0?o.jsx(er,{ariaLabel:"Retained artifact references",items:ye.map((me,G)=>({id:Ui(me),label:`${me.runId} ${me.stageId} ${me.callId} JSON validation deferred until inspect`,content:o.jsx(CN,{groupEnd:!uv(ye[G+1],me),groupStart:!uv(ye[G-1],me),reference:me})})),onSelect:me=>{const G=ye.find(ge=>Ui(ge)===me);G!==void 0&&ae(G)},selectedId:C.phase==="idle"?null:Ui(C.reference)}):null,o.jsxs("nav",{"aria-label":"Artifact pages",className:"artifact-catalog__pagination",children:[o.jsx("button",{"aria-label":"newer artifacts",disabled:p===0||y==="loading",onClick:he,type:"button",children:"[ newer ]"}),o.jsx("button",{"aria-label":"older artifacts",disabled:g?.nextBefore===void 0||y==="loading",onClick:te,type:"button",children:"[ older ]"})]}),o.jsx(af,{applicationRootId:a,labelledBy:"artifact-inspection-title",onClose:re,open:C.phase!=="idle",children:C.phase==="idle"?null:o.jsxs("section",{className:"artifact-inspection","aria-labelledby":"artifact-inspection-title",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h3",{id:"artifact-inspection-title",children:"Selected artifact reference"}),o.jsxs("p",{children:[C.reference.runId," · ",C.reference.stageId," / ",C.reference.callId]})]}),o.jsx("button",{"aria-label":"close inspection",className:"artifact-inspection__close",onClick:re,type:"button",children:"×"})]}),C.phase==="loading"?o.jsx("p",{role:"status",children:"Validating artifact on the server…"}):null,C.phase==="error"?o.jsxs("div",{children:[o.jsx("p",{role:"alert",children:C.message}),o.jsx("button",{onClick:()=>ae(C.reference),type:"button",children:"retry inspection"})]}):null,C.phase==="current"?o.jsxs("div",{className:"artifact-inspection__validated",children:[o.jsx("p",{role:"status",children:"Server validation succeeded."}),o.jsxs("dl",{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Validator schema ID"}),o.jsx("dd",{children:C.inspection.validatorId})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Validated byte size"}),o.jsxs("dd",{children:[C.inspection.byteSize," bytes"]})]})]}),o.jsx(Fo,{content:C.inspection.content,mediaType:"application/json"})]}):null]})})]})}const C_="/contracts/council-plan-review-input-v1.json";function zN(n){switch(n){case"number":return 0;case"boolean":return!1;case"string[]":return[];case"string":return"<required:string>"}}function LN(){return{schema_version:"council-plan-review-input-v1",contract_href:C_}}function DN(n){const a=Object.fromEntries(n.variables.filter(i=>i.required).sort((i,r)=>i.name.localeCompare(r.name)).map(i=>[i.name,zN(i.type)]));return JSON.stringify({tool:"run_workflow",arguments:{workflow:n.name,run_id:"<unique_run_id>",variables:a,...n.name==="plan-review-receipts"?{plan_review:LN()}:{}}},null,2)}function IN(n){const a={name:n.name,version:n.version,description:n.description,stageCount:n.stageCount,callCount:n.callCount,variables:n.variables.map(({name:i,type:r,required:u})=>({name:i,type:r,required:u}))};return{...a,copyHandoff:DN(a),...a.name==="plan-review-receipts"?{contractHref:C_}:{}}}function UN(n){return{name:n.name,command:n.command,parser:n.parser,promptMode:n.promptMode,timeoutSeconds:n.timeoutSeconds,...n.idleTimeoutSeconds===void 0?{}:{idleTimeoutSeconds:n.idleTimeoutSeconds},...n.idleTimeoutStartupSeconds===void 0?{}:{idleTimeoutStartupSeconds:n.idleTimeoutStartupSeconds},roleNames:[...n.roleNames],environmentKeys:[...n.environmentKeys],supportsImages:n.supportsImages,resultContract:{enabled:n.resultContract.enabled,filename:n.resultContract.filename},backend:n.backend,...n.workflowEligible===void 0?{}:{workflowEligible:n.workflowEligible},...n.usableVia===void 0?{}:{usableVia:[...n.usableVia]}}}const qN=["plan-review-receipts","council-default","council-answer","council-code-review","council-debug","council-discover","council-plan-review"],$N=["codex","claude","agy","codex-app-server","glm"],HN=Object.freeze({});function O_(n,a,i){const r=i.indexOf(n),u=i.indexOf(a);return r===-1&&u===-1?n.localeCompare(a):r===-1?1:u===-1?-1:r-u}function GN({workflow:n}){return n.variables.length===0?o.jsx("p",{className:"catalog-card__empty",children:"No declared variables"}):o.jsxs("table",{className:"catalog-card__variables",children:[o.jsx("caption",{children:"Declared variables"}),o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:"Name"}),o.jsx("th",{scope:"col",children:"Type"}),o.jsx("th",{scope:"col",children:"Input"})]})}),o.jsx("tbody",{children:n.variables.map(a=>o.jsxs("tr",{children:[o.jsx("th",{scope:"row",children:a.name}),o.jsx("td",{children:a.type}),o.jsx("td",{children:a.required?"required":"optional"})]},a.name))})]})}function BN({runCounts:n=HN,sourcePath:a,workflows:i}){const r=i.map(IN).sort((u,f)=>O_(u.name,f.name,qN));return o.jsxs("section",{"aria-label":"Workflow catalog",className:"catalog-view",children:[o.jsxs("header",{className:"catalog-view__header",children:[o.jsx("h2",{className:"catalog-view__title",children:"Shipped workflows"}),o.jsx("p",{children:a===void 0?`[ ${String(r.length)} loaded descriptors ]`:`[ CLINKX_WORKFLOWS_PATH = ${a} ]`})]}),o.jsx("div",{className:"catalog-view__grid",children:r.map(u=>o.jsxs("article",{className:"catalog-card catalog-card--workflow",children:[o.jsxs("header",{className:"catalog-card__header catalog-card__header--workflow",children:[o.jsxs("div",{className:"catalog-card__identity",children:[o.jsx("h3",{children:u.name}),o.jsxs("span",{children:["v",u.version]}),u.name==="plan-review-receipts"?o.jsx("span",{className:"catalog-card__read-only",children:"review-only · prompt-enforced"}):null]}),o.jsx("span",{"aria-hidden":"true",className:"catalog-card__spacer"}),o.jsx("span",{className:"catalog-card__usage",children:n[u.name]===void 0||n[u.name]===0?"[ idle ]":`[ ${String(n[u.name])} ${n[u.name]===1?"run":"runs"} on sheet ]`})]}),o.jsx("p",{className:"catalog-card__description",children:u.description}),o.jsxs("div",{className:"catalog-card__summary",children:[o.jsxs("span",{children:[u.stageCount," ",u.stageCount===1?"stage":"stages"]}),o.jsxs("span",{className:"catalog-card__metric",children:[u.callCount," ",u.callCount===1?"call":"calls"]})]}),o.jsxs("div",{className:"catalog-card__utilities",children:[u.contractHref===void 0?null:o.jsx("a",{href:u.contractHref,children:"Plan-review input contract"}),o.jsxs("details",{className:"catalog-card__disclosure catalog-card__variable-disclosure",children:[o.jsxs("summary",{children:["Declared variables · ",u.variables.length]}),o.jsx(GN,{workflow:u})]}),o.jsxs("details",{className:"catalog-card__disclosure catalog-card__handoff",children:[o.jsx("summary",{children:"Run handoff"}),o.jsxs("div",{className:"catalog-card__handoff-body",children:[o.jsx(Ls,{label:`Copy ${u.name} run handoff`,text:u.copyHandoff}),o.jsx(ks,{children:u.copyHandoff})]})]})]})]},`${u.name}:${u.version}`))})]})}function VN({adapter:n}){const a=n.resultContract.enabled?n.resultContract.filename:"none",i=n.usableVia?.join(" · ")||"not reported";return o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"catalog-card__adapter-command",children:["$ ",n.command]}),o.jsxs("div",{className:"catalog-card__adapter-facts",children:[o.jsxs("span",{children:["prompt_mode ",n.promptMode]}),o.jsxs("span",{children:["timeout ",n.timeoutSeconds,"s"]}),n.idleTimeoutSeconds===void 0?null:o.jsxs("span",{children:["idle ",n.idleTimeoutSeconds,"s"]}),n.idleTimeoutStartupSeconds===void 0?null:o.jsxs("span",{children:["startup ",n.idleTimeoutStartupSeconds,"s"]}),o.jsxs("span",{children:["result_contract ",a]}),o.jsxs("span",{children:["roles ",n.roleNames.length]})]}),o.jsxs("p",{className:"catalog-card__adapter-line",children:["roles: ",n.roleNames.join(" · ")||"none declared"]}),o.jsxs("p",{className:"catalog-card__adapter-line catalog-card__adapter-line--last",children:["environment keys: ",n.environmentKeys.join(" · ")||"none declared",o.jsxs("span",{className:"visually-hidden",children:[" · usable via ",i]})]})]})}function ZN({adapters:n}){const a=n.map(UN).sort((i,r)=>O_(i.name,r.name,$N));return o.jsxs("section",{"aria-label":"Adapter catalog",className:"catalog-view",children:[o.jsxs("header",{className:"catalog-view__header",children:[o.jsx("h2",{className:"catalog-view__title",children:"CLI adapters"}),o.jsxs("p",{children:["[ configured adapters · ",a.length," ]"]})]}),o.jsx("p",{className:"catalog-view__notice",children:"Reachability names the supported tool path, not live producer availability. App-server tools require CLINKX_APP_SERVER_ENABLED on the MCP server process."}),o.jsx("div",{className:"catalog-view__grid",children:a.map(i=>o.jsxs("article",{className:"catalog-card",children:[o.jsxs("header",{className:"catalog-card__header",children:[o.jsx("h3",{children:i.name}),o.jsx("span",{className:"catalog-card__badge",children:i.parser}),i.supportsImages?o.jsx("span",{className:"catalog-card__badge",children:"images"}):null,o.jsx("span",{"aria-hidden":"true",className:"catalog-card__spacer"}),o.jsxs("span",{className:"catalog-card__adapter-capability",title:`usable via ${i.usableVia?.join(", ")??"not reported"}`,children:[i.backend," · workflow ",i.workflowEligible===void 0?"not reported":i.workflowEligible?"eligible":"ineligible",o.jsxs("span",{className:"visually-hidden",children:[" ","· workflow eligible ",i.workflowEligible===void 0?"not reported":i.workflowEligible?"yes":"no"]})]})]}),o.jsx(VN,{adapter:i})]},i.name))})]})}const YN=n=>(document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n)}),dv=()=>document.visibilityState==="visible";function k_(){return j.useSyncExternalStore(YN,dv,dv)}function tc(n,a,i,r){const u=k_(),p=a||i&&!r&&u;j.useEffect(()=>{if(!p)return;let m=!1;return n.start().finally(()=>{!m&&!a&&n.stop()}),()=>{m=!0,n.stop()}},[a,n,p])}function XN(n,a=!0,i=!1){const r=j.useSyncExternalStore(n.subscribe,n.getState,n.getState);return tc(n,a,i,r.lastRefreshAtMs!==null),r}function KN(n,a=!0,i=!1){const r=j.useSyncExternalStore(n.subscribe,n.getState,n.getState);return tc(n,a,i,r.lastRefreshAtMs!==null),r}function QN(n,a=!0,i=!1){const r=j.useSyncExternalStore(n.subscribe,n.getState,n.getState);return tc(n,a,i,r.lastRefreshAtMs!==null),r}function JN(n,a=!0,i=!1){const r=j.useSyncExternalStore(n.subscribe,n.getState,n.getState);return tc(n,a,i,r.lastRefreshAtMs!==null),r}const FN=/%(?:2f|5c|00)/i,WN=/%[0-9a-f]{2}/i,Bo=/^[A-Za-z0-9_-]{1,64}$/,Ml=/^[A-Za-z0-9_-]{1,128}$/,PN=/^ctxop_\d{8}T\d{6}Z_[0-9a-f]{12}$/,e1=/^[A-Za-z0-9_-]{1,64}$/,t1=/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/;function n1(n){if(n==="/")return Object.freeze({kind:"runs"});if(!n.startsWith("/")||n.includes("?")||n.includes("#")||n.endsWith("/"))return;const a=a1(n);if(a!==void 0){if(a.length===1)switch(a[0]){case"runs":case"activities":case"workflows":case"adapters":case"artifacts":return Object.freeze({kind:a[0]});case"context-runs":return Object.freeze({kind:"context_runs"});case"progress-reports":return Object.freeze({kind:"progress_reports"});default:return}if(a.length===2){const[i,r]=a;return i==="runs"&&r!==void 0&&Bo.test(r)?Object.freeze({kind:"run_detail",runId:r}):i==="activities"&&r!==void 0&&Ml.test(r)?Object.freeze({kind:"activity_detail",activityId:r}):i==="context-runs"&&r!==void 0&&M_(r)?Object.freeze({kind:"context_run_detail",contextRunId:r}):i==="progress-reports"&&r!==void 0&&z_(r)?Object.freeze({kind:"progress_report_detail",progressReportId:r}):void 0}if(a.length===6&&a[0]==="runs"&&Bo.test(a[1]??"")&&a[2]==="stages"&&Ml.test(a[3]??"")&&a[4]==="calls"&&Ml.test(a[5]??""))return Object.freeze({kind:"run_call",runId:a[1],stageId:a[3],callId:a[5]})}}function Vo(n){switch(n.kind){case"runs":return"/runs";case"run_detail":return`/runs/${Ts(n.runId,Bo,"runId")}`;case"run_call":return["/runs",Ts(n.runId,Bo,"runId"),"stages",Ts(n.stageId,Ml,"stageId"),"calls",Ts(n.callId,Ml,"callId")].join("/");case"activities":return"/activities";case"activity_detail":return`/activities/${Ts(n.activityId,Ml,"activityId")}`;case"context_runs":return"/context-runs";case"context_run_detail":return`/context-runs/${Ts(n.contextRunId,{test:M_},"contextRunId")}`;case"progress_reports":return"/progress-reports";case"progress_report_detail":return`/progress-reports/${Ts(n.progressReportId,{test:z_},"progressReportId")}`;case"workflows":return"/workflows";case"adapters":return"/adapters";case"artifacts":return"/artifacts"}}function a1(n){const a=[];for(const i of n.slice(1).split("/")){if(i.length===0||i.includes("\\")||i.includes("\0")||FN.test(i))return;let r;try{r=decodeURIComponent(i)}catch{return}if(r==="."||r===".."||r.includes("/")||r.includes("\\")||r.includes("\0")||WN.test(r))return;a.push(r)}return Object.freeze(a)}function Ts(n,a,i){if(!a.test(n))throw new TypeError(`invalid dashboard browser route ${i}`);return encodeURIComponent(n)}function M_(n){if(!e1.test(n)||n.startsWith("wfctx")||n.startsWith("wfpre"))return!1;if(!PN.test(n))return!0;const a=n.slice(6,22),i=[a.slice(0,4),"-",a.slice(4,6),"-",a.slice(6,8),"T",a.slice(9,11),":",a.slice(11,13),":",a.slice(13,15),".000Z"].join(""),r=new Date(i);return!Number.isNaN(r.getTime())&&r.toISOString()===i}function z_(n){return t1.test(n)}function s1(n){switch(n.kind){case"runs":case"run_detail":case"run_call":return"runs";case"activities":case"activity_detail":return"activities";case"context_runs":case"context_run_detail":return"context_runs";case"progress_reports":case"progress_report_detail":return"progress_reports";case"workflows":return"workflows";case"adapters":return"adapters";case"artifacts":return"artifacts"}}function l1(n){switch(n){case"runs":return{kind:"runs"};case"activities":return{kind:"activities"};case"context_runs":return{kind:"context_runs"};case"progress_reports":return{kind:"progress_reports"};case"workflows":return{kind:"workflows"};case"adapters":return{kind:"adapters"};case"artifacts":return{kind:"artifacts"}}}function i1(n){return Vo(l1(n))}function r1(n){switch(n.kind){case"run_detail":return{kind:"run",runId:n.runId};case"run_call":return{kind:"run_call",runId:n.runId,stageId:n.stageId,callId:n.callId};case"activity_detail":return{kind:"activity",activityId:n.activityId};case"context_run_detail":return{kind:"context_run",contextRunId:n.contextRunId};case"progress_report_detail":return{kind:"progress_report",progressReportId:n.progressReportId};default:return null}}function qi(n){const a=n1(n);return a===void 0?{kind:"not_found",rawPath:n}:{kind:"resolved",route:a,destination:s1(a),canonicalPath:Vo(a),selection:r1(a)}}function fv(n){return{kind:"run_detail",runId:n}}function hv(n,a,i){return{kind:"run_call",runId:n,stageId:a,callId:i}}function o1(n){return{kind:"activity_detail",activityId:n}}function c1(n){return{kind:"context_run_detail",contextRunId:n}}function u1(n){return{kind:"progress_report_detail",progressReportId:n}}function wo(){return window.location.pathname}function pv(n){return{clinkxRoute:n}}function d1(){const[n,a]=j.useState(()=>qi(wo())),i=j.useRef(n);i.current=n,j.useEffect(()=>{const m=wo(),g=qi(m);g.kind==="resolved"&&g.canonicalPath!==m&&window.history.replaceState(pv(g.canonicalPath),"",g.canonicalPath),a(g)},[]),j.useEffect(()=>{const m=()=>{a(qi(wo()))};return window.addEventListener("popstate",m),()=>window.removeEventListener("popstate",m)},[]);const r=j.useCallback((m,g)=>{if(m===wo()){a(qi(m));return}const v=pv(m);g==="push"?window.history.pushState(v,"",m):window.history.replaceState(v,"",m),a(qi(m))},[]),u=j.useCallback(m=>{r(i1(m),"push")},[r]),f=j.useCallback(m=>{r(Vo(m),"push")},[r]),p=j.useCallback(m=>{r(Vo(m),"replace")},[r]);return{resolution:n,navigateToDestination:u,pushRoute:f,replaceRoute:p}}function mv(n){return n??new AbortController().signal}async function gv(n,a,i){let r;try{r=await n(a,{signal:i})}catch(u){throw u instanceof qe?new P("connection_changed",409,"agent_instance_changed"):i.aborted||u instanceof DOMException&&u.name==="AbortError"?new P("aborted"):new P("offline")}if(r.status===401)throw new P("auth_expired",401,"unauthorized");if(!r.ok)throw new P("request_error",r.status);try{return await nn(r)}catch(u){throw u instanceof qe?new P("connection_changed",409,"agent_instance_changed"):new P("request_error",r.status)}}function f1(n=_a){return{async listWorkflows(a){return await gv(n,"/api/workflows",mv(a))},async listAdapters(a){return await gv(n,"/api/adapters",mv(a))}}}const h1=2e3;function p1(n){return{phase:"initial_loading",live:[],history:[],nextBefore:void 0,historyPage:0,canGoNewer:!1,canGoOlder:!1,selected:null,detail:null,lastRefreshAtMs:null,displayNowMs:n,serverOffsetMs:0,announcement:null}}function vv(n,a){const i=n instanceof P?n.kind:"request_error";return i==="auth_expired"?"auth_expired":i==="connection_changed"?"connection_changed":i==="offline"?"offline":a?"stale":"error"}function m1(n){let a=p1(Date.now()),i=null,r=null,u=!1,f=!1,p=0,m=[void 0];const g=new Set,v=kl(),y=Y=>{a=Y;for(const A of g)A()},b=()=>{i!==null&&clearTimeout(i),i=null},T=()=>{b(),!(u||a.phase==="paused"||a.phase==="auth_expired"||a.phase==="connection_changed"||a.phase==="error"||document.visibilityState!=="visible")&&(i=setTimeout(()=>{R()},h1))},N=Y=>({runId:Y.runId,runGeneration:Y.runGeneration,stateRevision:Y.stateRevision}),C=async Y=>{const A=v.begin(Y),$=await n.getRunDetail(Y,A.signal);return v.acceptsDetail(A.identity,$)?$:null},R=async(Y=m)=>{if(u||a.phase==="paused"||document.visibilityState!=="visible")return!1;b(),r?.abort(),v.cancel();const A=++p,$=new AbortController;r=$;const ae=Date.now(),te=[...Y];try{let he=te[te.length-1],re=await n.listRuns(he===void 0?{signal:$.signal}:{before:he,signal:$.signal}),ye=!1;for(;re.history.length===0&&te.length>1;)te.pop(),ye=!0,he=te[te.length-1],re=await n.listRuns(he===void 0?{signal:$.signal}:{before:he,signal:$.signal});if(u||$.signal.aborted||A!==p)return!1;const me=Date.now(),G=Date.parse(re.serverNow),ge=ae+(me-ae)/2,_e=Number.isFinite(G)?G-ge:a.serverOffsetMs,W=me+_e,z=[...re.live,...re.history];let X=a.selected,F=a.detail,ee=ye?"The previous page was pruned. Showing the nearest newer history page.":null;const fe=a.selected!==null&&a.live.some(S=>S.runId===a.selected?.runId&&S.runGeneration===a.selected.runGeneration);if(X!==null){const S=z.find(K=>K.runId===X?.runId&&K.runGeneration===X.runGeneration),U=z.find(K=>K.runId===X?.runId);if(S!==void 0?X=N(S):U!==void 0&&(X=null,F=null,ee="Run generation changed. Select the replacement deliberately to inspect it."),X!==null)try{const K=await C(X);if(K===null||u||$.signal.aborted||A!==p)return!1;F=K,X=N(K);const J=re.live.some(ue=>ue.runId===K.runId&&ue.runGeneration===K.runGeneration);fe&&!J&&K.availability==="available"&&K.status!=="pending"&&K.status!=="running"&&(ee="Selected run moved to history.")}catch(K){if(K instanceof P&&K.code==="run_generation_changed")X=null,F=null,ee="Run generation changed. Select the replacement deliberately to inspect it.";else if(K instanceof P&&K.status===404)X=null,F=null,ee="The selected run is no longer available.";else throw K}}return m=te,y({...a,phase:"current",live:re.live,history:re.history,nextBefore:re.nextBefore,canGoOlder:re.nextBefore!==void 0,historyPage:te.length-1,canGoNewer:te.length>1,selected:X,detail:F,lastRefreshAtMs:W,displayNowMs:W,serverOffsetMs:_e,announcement:ee}),!0}catch(he){return u||$.signal.aborted||A!==p||y({...a,phase:vv(he,a.lastRefreshAtMs!==null)}),!1}finally{!u&&A===p&&T()}},L=()=>{document.visibilityState==="visible"?R():(b(),r?.abort(),v.cancel())},q=()=>{document.visibilityState==="visible"&&R()},O=()=>{f&&(f=!1,p+=1,b(),r?.abort(),r=null,v.cancel(),document.removeEventListener("visibilitychange",L),window.removeEventListener("focus",q))};return{async start(){f||u||(f=!0,document.addEventListener("visibilitychange",L),window.addEventListener("focus",q),await R())},stop:O,dispose(){u||(O(),u=!0,g.clear())},getState(){return a},subscribe(Y){return g.add(Y),()=>g.delete(Y)},pause(){u||a.phase==="paused"||(b(),r?.abort(),v.cancel(),y({...a,phase:"paused"}))},async resume(){u||a.phase!=="paused"||(y({...a,phase:a.lastRefreshAtMs===null?"initial_loading":"current"}),await R())},async retry(){await R()},runGenerationChanged(){u||a.selected===null||(v.cancel(),y({...a,phase:"current",selected:null,detail:null,announcement:"Run generation changed. Select the replacement deliberately to inspect it."}))},async select(Y){if(u)return;const A=N(Y);y({...a,selected:A,detail:null,announcement:null});try{const $=await C(A);$!==null&&!u&&y({...a,selected:N($),detail:$})}catch($){if($ instanceof P&&$.kind==="aborted")return;if($ instanceof P&&$.code==="run_generation_changed"){y({...a,phase:"current",selected:null,detail:null,announcement:"Run generation changed. Select the replacement deliberately to inspect it."});return}if($ instanceof P&&$.status===404){y({...a,phase:"current",selected:null,detail:null,announcement:"The selected run is no longer available."});return}y({...a,phase:vv($,a.lastRefreshAtMs!==null)})}},async older(){u||a.nextBefore===void 0||await R([...m,a.nextBefore])},async newer(){u||m.length<=1||await R(m.slice(0,-1))}}}function g1(n){return n??new AbortController().signal}function _v(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function Ya(n){if(typeof n!="string"||n.length===0)throw new P("request_error",200);return n}function v1(n){if(!_v(n)||!_v(n.childConfig))throw new P("request_error",200);const a=n.childConfig,i=a.source==="ambient"&&a.configured===!1?{source:"ambient",configured:!1}:a.source==="explicit"&&a.configured===!0?{source:"explicit",configured:!0,path:Ya(a.path)}:(()=>{throw new P("request_error",200)})();return{stateDir:Ya(n.stateDir),...n.activitiesRoot===void 0?{}:{activitiesRoot:Ya(n.activitiesRoot)},...n.progressReportsRoot===void 0?{}:{progressReportsRoot:Ya(n.progressReportsRoot)},runsRoot:Ya(n.runsRoot),workspaceRoot:Ya(n.workspaceRoot),workflowsPath:Ya(n.workflowsPath),templatesPath:Ya(n.templatesPath),childConfig:i}}function _1(n=_a){return{async getEnvironment(a){const i=g1(a);let r;try{r=await n("/api/env",{signal:i})}catch(u){throw u instanceof qe?new P("connection_changed",409,"agent_instance_changed"):i.aborted||u instanceof DOMException&&u.name==="AbortError"?new P("aborted"):new P("offline")}if(r.status===401)throw new P("auth_expired",401,"unauthorized");if(!r.ok)throw new P("request_error",r.status);try{return v1(await nn(r))}catch(u){throw u instanceof P?u:u instanceof qe?new P("connection_changed",409,"agent_instance_changed"):new P("request_error",r.status)}}}}const y1=2e3,b1=Object.freeze({phase:"current",detailPhase:"idle",activities:Object.freeze([]),selected:null,detail:null,lastRefreshAtMs:null,announcement:null,displayNowMs:0,serverOffsetMs:0});function x1(){return Object.freeze({async start(){},stop(){},dispose(){},getState:()=>b1,subscribe:()=>()=>{},pause(){},async resume(){},async retry(){},async select(){},clearSelection(){}})}function No(n){return{activityId:n.activityId,activityGeneration:n.activityGeneration,stateRevision:n.stateRevision}}function yv(n,a){const i=n instanceof P?n.kind:"request_error";return i==="auth_expired"?"auth_expired":i==="connection_changed"?"connection_changed":i==="offline"?"offline":a?"stale":"error"}function S1(n){let a={phase:"initial_loading",detailPhase:"idle",activities:[],selected:null,detail:null,lastRefreshAtMs:null,announcement:null,displayNowMs:0,serverOffsetMs:0},i=!1,r=!1,u=0,f=null,p=null;const m=new Set,g=R=>{a=R;for(const L of m)L()},v=()=>{f!==null&&clearTimeout(f),f=null},y=()=>{v(),!(r||a.phase==="paused"||a.phase==="auth_expired"||a.phase==="connection_changed"||a.phase==="error"||document.visibilityState!=="visible")&&(f=setTimeout(()=>{b()},y1))},b=async()=>{if(r||a.phase==="paused"||document.visibilityState!=="visible")return!1;v(),p?.abort();const R=++u,L=new AbortController;p=L;const q=Date.now();try{const O=await n.listActivities({signal:L.signal});if(r||L.signal.aborted||R!==u)return!1;const Y=Date.now();let A=a.selected,$=a.detail,ae=a.detailPhase,te=null;if(A!==null){const G=O.activities.find(_e=>_e.activityId===A?.activityId&&_e.activityGeneration===A.activityGeneration),ge=O.activities.find(_e=>_e.activityId===A?.activityId);if(G===void 0&&ge!==void 0)A=null,$=null,ae="idle",te="Activity generation changed. Select the replacement deliberately.";else{G!==void 0&&(A=No(G));try{$=await n.getActivityDetail(A,L.signal),A=No($),ae="loaded"}catch(_e){if(_e instanceof P&&(_e.code==="activity_generation_changed"||_e.code==="activity_state_changed"||_e.status===404))A=null,$=null,ae="idle",te="The selected activity changed or is no longer retained.";else throw _e}}}const he=Date.parse(O.serverNow),re=q+(Y-q)/2,ye=Number.isFinite(he)?he-re:a.serverOffsetMs,me=Y+ye;return g({phase:"current",detailPhase:ae,activities:O.activities,selected:A,detail:$,lastRefreshAtMs:me,displayNowMs:me,serverOffsetMs:ye,announcement:te}),!0}catch(O){return r||L.signal.aborted||R!==u||g({...a,phase:yv(O,a.lastRefreshAtMs!==null)}),!1}finally{!r&&R===u&&y()}},T=()=>{document.visibilityState==="visible"?b():(v(),p?.abort())},N=()=>{document.visibilityState==="visible"&&b()},C=()=>{i&&(i=!1,u+=1,v(),p?.abort(),p=null,document.removeEventListener("visibilitychange",T),window.removeEventListener("focus",N))};return{async start(){i||r||(i=!0,document.addEventListener("visibilitychange",T),window.addEventListener("focus",N),await b())},stop:C,dispose(){r||(C(),r=!0,m.clear())},getState(){return a},subscribe(R){return m.add(R),()=>m.delete(R)},pause(){r||a.phase==="paused"||(v(),p?.abort(),g({...a,phase:"paused"}))},async resume(){r||a.phase!=="paused"||(g({...a,phase:a.lastRefreshAtMs===null?"initial_loading":"current"}),await b())},async retry(){await b()},async select(R){if(r)return;p?.abort();const L=new AbortController;p=L;const q=No(R);g({...a,selected:q,detail:null,detailPhase:"loading",announcement:null});try{const O=await n.getActivityDetail(q,L.signal);!r&&!L.signal.aborted&&g({...a,selected:No(O),detail:O,detailPhase:"loaded"})}catch(O){if(O instanceof P&&O.kind==="aborted")return;if(O instanceof P&&(O.code==="activity_generation_changed"||O.code==="activity_state_changed"||O.status===404)){g({...a,selected:null,detail:null,detailPhase:"idle",announcement:"The selected activity changed or is no longer retained."});return}g({...a,phase:yv(O,a.lastRefreshAtMs!==null),detailPhase:"error"})}},clearSelection(){p?.abort(),g({...a,selected:null,detail:null,detailPhase:"idle",announcement:null})}}}const j1=3e3,w1=Object.freeze({phase:"current",detailPhase:"idle",contextRuns:Object.freeze([]),selectedId:null,detail:null,lastRefreshAtMs:null,displayNowMs:0,serverOffsetMs:0,announcement:null});function N1(){return Object.freeze({async start(){},stop(){},dispose(){},getState:()=>w1,subscribe:()=>()=>{},pause(){},async resume(){},async retry(){},async select(){},clearSelection(){}})}function bv(n,a){const i=n instanceof P?n.kind:"request_error";return i==="auth_expired"?"auth_expired":i==="connection_changed"?"connection_changed":i==="offline"?"offline":a?"stale":"error"}function xv(n,a){if(a!==null)return n.find(i=>i.id===a)}function A1(n){let a={phase:"initial_loading",detailPhase:"idle",contextRuns:[],selectedId:null,detail:null,lastRefreshAtMs:null,displayNowMs:0,serverOffsetMs:0,announcement:null},i=!1,r=!1,u=0,f=null,p=null,m=null,g=0;const v=new Set,y=q=>{a=q;for(const O of v)O()},b=()=>{f!==null&&clearTimeout(f),f=null},T=()=>{b(),!(r||a.phase==="paused"||a.phase==="auth_expired"||a.phase==="connection_changed"||a.phase==="error"||document.visibilityState!=="visible")&&(f=setTimeout(()=>{N()},j1))},N=async()=>{if(r||a.phase==="paused"||document.visibilityState!=="visible")return!1;b(),p?.abort();const q=++u,O=new AbortController;p=O;try{const Y=Date.now(),A=await n.listContextRuns({signal:O.signal});if(r||O.signal.aborted||q!==u)return!1;const $=Date.now(),ae=Date.parse(A.serverNow),te=Y+($-Y)/2,he=Number.isFinite(ae)?ae-te:a.serverOffsetMs,re=$+he;let ye=null,me=a.detail,G=a.detailPhase,ge=a.selectedId;if(ge!==null){const _e=xv(A.contextRuns,ge);_e!==void 0&&G!=="not_found"&&(me=_e,G="loaded")}return y({phase:"current",detailPhase:G,contextRuns:A.contextRuns,selectedId:ge,detail:me,lastRefreshAtMs:re,displayNowMs:re,serverOffsetMs:he,announcement:ye}),!0}catch(Y){return r||O.signal.aborted||q!==u||y({...a,phase:bv(Y,a.lastRefreshAtMs!==null)}),!1}finally{!r&&q===u&&T()}},C=()=>{document.visibilityState==="visible"?N():(b(),p?.abort())},R=()=>{document.visibilityState==="visible"&&N()},L=()=>{i&&(i=!1,u+=1,b(),p?.abort(),p=null,g+=1,m?.abort(),m=null,document.removeEventListener("visibilitychange",C),window.removeEventListener("focus",R))};return{async start(){i||r||(i=!0,document.addEventListener("visibilitychange",C),window.addEventListener("focus",R),await N())},stop:L,dispose(){r||(L(),r=!0,v.clear())},getState(){return a},subscribe(q){return v.add(q),()=>v.delete(q)},pause(){r||a.phase==="paused"||(b(),p?.abort(),y({...a,phase:"paused"}))},async resume(){r||a.phase!=="paused"||(y({...a,phase:a.lastRefreshAtMs===null?"initial_loading":"current"}),await N())},async retry(){await N()},async select(q){if(r)return;const O=xv(a.contextRuns,q);y({...a,selectedId:q,detail:O??null,detailPhase:O===void 0?"loading":"loaded",announcement:null});const Y=++g;m?.abort();const A=new AbortController;m=A;try{const $=await n.getContextRunDetail(q,A.signal);!r&&!A.signal.aborted&&Y===g&&y({...a,selectedId:$.id,detail:$,detailPhase:"loaded"})}catch($){if(A.signal.aborted||Y!==g||$ instanceof P&&$.kind==="aborted")return;if($ instanceof P&&($.code==="not_found"||$.status===404)){y({...a,selectedId:q,detail:null,detailPhase:"not_found",announcement:"The selected context run is no longer retained."});return}y({...a,phase:bv($,a.lastRefreshAtMs!==null),detailPhase:O===void 0?"error":"loaded"})}},clearSelection(){g+=1,m?.abort(),y({...a,selectedId:null,detail:null,detailPhase:"idle",announcement:null})}}}const R1=3e3,E1=Object.freeze({phase:"current",progressReports:Object.freeze([]),truncated:!1,selectedId:null,detail:null,detailPhase:"idle",omittedSections:Object.freeze([]),publishedSessionStatus:null,unreadableReason:null,lastRefreshAtMs:null,displayNowMs:0,serverOffsetMs:0,announcement:null});function T1(){return Object.freeze({async start(){},stop(){},dispose(){},getState:()=>E1,subscribe:()=>()=>{},pause(){},async resume(){},async retry(){},async select(){},clearSelection(){},async setStatusOverride(){}})}function Ao(n,a){const i=n instanceof P?n.kind:"request_error";return i==="auth_expired"?"auth_expired":i==="connection_changed"?"connection_changed":i==="offline"?"offline":a?"stale":"error"}function Ld(n,a,i,r){const u=Date.parse(n),f=a+(i-a)/2,p=Number.isFinite(u)?u-f:r;return{serverOffsetMs:p,alignedNowMs:i+p}}function C1(n){let a={phase:"initial_loading",progressReports:[],truncated:!1,selectedId:null,detail:null,detailPhase:"idle",omittedSections:[],publishedSessionStatus:null,unreadableReason:null,lastRefreshAtMs:null,displayNowMs:0,serverOffsetMs:0,announcement:null},i=!1,r=!1,u=0,f=null,p=null;const m=new Set,g=O=>{a=O;for(const Y of m)Y()},v=()=>{f!==null&&clearTimeout(f),f=null},y=()=>{v(),!(r||a.phase==="paused"||a.phase==="auth_expired"||a.phase==="connection_changed"||a.phase==="error"||document.visibilityState!=="visible")&&(f=setTimeout(()=>{N()},R1))},b=async()=>{if(r||a.phase==="paused"||document.visibilityState!=="visible")return!1;v(),p?.abort();const O=++u,Y=new AbortController;p=Y;try{const A=Date.now(),$=await n.listProgressReports({signal:Y.signal});if(r||Y.signal.aborted||O!==u)return!1;const ae=Date.now(),{serverOffsetMs:te,alignedNowMs:he}=Ld($.serverNow,A,ae,a.serverOffsetMs);return g({phase:"current",progressReports:$.progressReports,truncated:$.truncated,selectedId:a.selectedId,detail:a.detail,detailPhase:a.detailPhase,omittedSections:a.omittedSections,publishedSessionStatus:a.publishedSessionStatus,unreadableReason:a.unreadableReason,lastRefreshAtMs:he,displayNowMs:he,serverOffsetMs:te,announcement:null}),!0}catch(A){return r||Y.signal.aborted||O!==u||g({...a,phase:Ao(A,a.lastRefreshAtMs!==null)}),!1}finally{!r&&O===u&&y()}},T=async()=>{if(r||a.phase==="paused"||document.visibilityState!=="visible"||a.selectedId===null)return!1;v(),p?.abort();const O=++u,Y=new AbortController;p=Y;const A=a.selectedId;try{const $=Date.now(),ae=await n.getProgressReportDetail(A,Y.signal);if(r||Y.signal.aborted||O!==u)return!1;const te=Date.now(),{serverOffsetMs:he,alignedNowMs:re}=Ld(ae.serverNow,$,te,a.serverOffsetMs);return g({phase:"current",progressReports:a.progressReports,truncated:a.truncated,selectedId:ae.progressReport.session.id,detail:ae.progressReport,detailPhase:"loaded",omittedSections:ae.omittedSections,publishedSessionStatus:ae.publishedSessionStatus??null,unreadableReason:null,lastRefreshAtMs:re,displayNowMs:re,serverOffsetMs:he,announcement:null}),!0}catch($){if(r||Y.signal.aborted||O!==u)return!1;const ae=tv($);return ae!==void 0?(g({...a,selectedId:A,detail:null,detailPhase:"not_found",unreadableReason:ae,announcement:Sv(ae)}),!1):(g({...a,phase:Ao($,a.lastRefreshAtMs!==null),detailPhase:a.detail===null?"error":"stale"}),!1)}finally{!r&&O===u&&a.unreadableReason===null&&y()}},N=async()=>a.unreadableReason!==null?!1:a.selectedId===null?b():T(),C=()=>{document.visibilityState==="visible"?N():(v(),p?.abort())},R=()=>{document.visibilityState==="visible"&&N()},L=()=>{i&&(i=!1,u+=1,v(),p?.abort(),p=null,document.removeEventListener("visibilitychange",C),window.removeEventListener("focus",R))};return{async start(){i||r||(i=!0,(a.phase==="error"||a.phase==="offline")&&g({...a,phase:"initial_loading"}),document.addEventListener("visibilitychange",C),window.addEventListener("focus",R),await N())},stop:L,dispose(){r||(L(),r=!0,m.clear())},getState(){return a},subscribe(O){return m.add(O),()=>m.delete(O)},pause(){r||a.phase==="paused"||(v(),p?.abort(),g({...a,phase:"paused"}))},async resume(){r||a.phase!=="paused"||(g({...a,phase:a.lastRefreshAtMs===null?"initial_loading":"current"}),await N())},async retry(){a.unreadableReason!==null&&g({...a,detailPhase:a.selectedId===null?"idle":"loading",unreadableReason:null,announcement:null}),await N()},async select(O){if(r)return;v(),p?.abort(),u+=1;const Y=++u,A=new AbortController;p=A,g({...a,selectedId:O,detail:null,detailPhase:"loading",omittedSections:[],publishedSessionStatus:null,unreadableReason:null,announcement:null});try{const $=Date.now(),ae=await n.getProgressReportDetail(O,A.signal);if(!r&&!A.signal.aborted&&Y===u){const te=Date.now(),{serverOffsetMs:he,alignedNowMs:re}=Ld(ae.serverNow,$,te,a.serverOffsetMs);g({phase:"current",progressReports:a.progressReports,truncated:a.truncated,selectedId:ae.progressReport.session.id,detail:ae.progressReport,detailPhase:"loaded",omittedSections:ae.omittedSections,publishedSessionStatus:ae.publishedSessionStatus??null,unreadableReason:null,lastRefreshAtMs:re,displayNowMs:re,serverOffsetMs:he,announcement:null})}}catch($){if(A.signal.aborted||Y!==u||$ instanceof P&&$.kind==="aborted")return;const ae=tv($);if(ae!==void 0){g({...a,selectedId:O,detail:null,detailPhase:"not_found",unreadableReason:ae,announcement:Sv(ae)});return}g({...a,phase:Ao($,a.lastRefreshAtMs!==null),detailPhase:"error"})}finally{!r&&Y===u&&a.unreadableReason===null&&y()}},clearSelection(){u+=1,v(),p?.abort(),g({...a,selectedId:null,detail:null,detailPhase:"idle",omittedSections:[],publishedSessionStatus:null,unreadableReason:null,announcement:null}),!r&&document.visibilityState==="visible"&&b()},async setStatusOverride(O,Y){if(!r){v(),p?.abort(),u+=1;try{const A=await n.setStatusOverride(O,Y);if(r)return;A.kind==="detail"&&q(O,A),await N()}catch(A){if(r)return;g({...a,phase:Ao(A,a.lastRefreshAtMs!==null)}),a.unreadableReason===null&&y()}}}};function q(O,Y){if(Y.progressReport.session.id!==O)return;const A=Y.publishedSessionStatus;g({...a,progressReports:a.progressReports.map($=>$.id===O?O1($,Y.progressReport.session.status,A):$),...a.selectedId===O?{detail:Y.progressReport,detailPhase:"loaded",omittedSections:Y.omittedSections,publishedSessionStatus:A??null,unreadableReason:null}:{}})}}function O1(n,a,i){return Object.freeze({id:n.id,title:n.title,status:a,projectFolder:n.projectFolder,startedAt:n.startedAt,updatedAt:n.updatedAt,agentCount:n.agentCount,...n.taskCounts===void 0?{}:{taskCounts:n.taskCounts},...i===void 0?{}:{publishedStatus:i}})}function Sv(n){switch(n){case"removed":return"The selected progress report is no longer available.";case"malformed":return"The selected progress report could not be parsed.";case"oversized":return"The selected progress report is too large to display in the dashboard."}}const k1=3e3,Cl={runs:"Run monitor",activities:"Single calls",context_runs:"Context runs",progress_reports:"Progress reports",workflows:"Workflows",adapters:"Adapters",artifacts:"Artifacts"};function jv(n,a){const[i,r]=j.useState(0),[u,f]=j.useState({phase:"loading",rows:[]}),p=j.useRef(!1);return j.useEffect(()=>{if(!a||p.current)return;const m=new AbortController;return f(g=>({phase:"loading",rows:g.rows})),n(m.signal).then(g=>{m.signal.aborted||(p.current=!0,f({phase:"current",rows:g.rows}))}).catch(g=>{if(m.signal.aborted)return;p.current=!0;const v=g instanceof P&&(g.kind==="auth_expired"||g.kind==="connection_changed"||g.kind==="offline")?g.kind:"error";f(y=>({phase:v,rows:y.rows}))}),()=>m.abort()},[a,i,n]),{state:u,retry:()=>{p.current=!1,r(m=>m+1)}}}function wv({kind:n,phase:a,retry:i}){if(a==="current")return null;if(a==="loading")return o.jsxs("p",{role:"status",children:["Loading ",n," catalog…"]});const r=a==="auth_expired"?`Authentication expired; the ${n} catalog was not loaded.`:a==="connection_changed"?`Connection changed; rebootstrap before loading the ${n} catalog.`:a==="offline"?`Offline; the ${n} catalog could not be loaded.`:`The ${n} catalog request failed.`;return o.jsxs("div",{children:[o.jsx("p",{role:"alert",children:r}),a==="auth_expired"||a==="connection_changed"?null:o.jsxs("button",{onClick:i,type:"button",children:["retry ",n," catalog"]})]})}function L_({accountActions:n,applicationRootId:a="root",activityApi:i,activityController:r,artifactApi:u,catalogApi:f,contextRunsApi:p,contextRunsController:m,progressReportsApi:g,progressReportsController:v,controller:y,environmentApi:b,inspectorApi:T,resultApi:N,routeHydrationApi:C,sessionLogApi:R}){const L=d1(),q=L.resolution,O=q.kind==="not_found",Y=q.kind==="resolved"?q:null,A=Y?.destination??"runs",$=Y?.selection??null,[ae,te]=j.useState(!1),[he,re]=j.useState(!1),[ye]=j.useState(()=>g_()),[me]=j.useState(()=>m1(ye)),[G]=j.useState(()=>S1(ye)),[ge]=j.useState(()=>x1()),[_e]=j.useState(()=>p??S_()),[W]=j.useState(()=>A1(_e)),[z]=j.useState(()=>N1()),[X]=j.useState(()=>g??nN()),[F]=j.useState(()=>C1(X)),[ee]=j.useState(()=>T1()),[fe]=j.useState(()=>f1()),[S]=j.useState(()=>EN()),[U]=j.useState(()=>_1()),[K]=j.useState(()=>o_()),J=b??U,[ue,Q]=j.useState(null),[ve,Qe]=j.useState(0),[Ge,bn]=j.useState(!1),On=k_(),it=y??me,tt=r??(y===void 0?G:ge),St=m??(y===void 0?W:z),gt=v??(y===void 0?F:ee),kn=C??(y===void 0?ye:void 0),ac=i??ye,Zn=R??(y===void 0&&r===void 0&&m===void 0&&v===void 0?K:void 0),Hs=ue!==null,ls=se=>Hs&&(se.lastRefreshAtMs!==null||se.phase==="error"||se.phase==="offline"||se.phase==="stale"),ke=JN(gt,A==="progress_reports",Hs),Ie=XN(it,A==="runs",ls(ke)),ct=KN(tt,A==="activities",ls(Ie)),Be=QN(St,A==="context_runs",ls(ct)),tr=j.useRef(Ie.phase);j.useEffect(()=>{const se=new AbortController;return bn(!1),J.getEnvironment(se.signal).then(je=>{se.signal.aborted||Q({stateDir:je.stateDir,...je.activitiesRoot===void 0?{}:{activitiesRoot:je.activitiesRoot},...je.progressReportsRoot===void 0?{}:{progressReportsRoot:je.progressReportsRoot},runsRoot:je.runsRoot,workspaceRoot:je.workspaceRoot,workflowsPath:je.workflowsPath,templatesPath:je.templatesPath,childConfig:je.childConfig.source==="explicit"?`explicit · ${je.childConfig.path}`:"ambient · not configured"})}).catch(()=>{se.signal.aborted||bn(!0)}),()=>se.abort()},[J,ve]),j.useEffect(()=>{if(!Ge||!On)return;const se=window.setTimeout(()=>{Qe(je=>je+1)},k1);return()=>window.clearTimeout(se)},[On,Ge]),j.useEffect(()=>{const se=tr.current;tr.current=Ie.phase,Ie.phase==="current"&&se!=="current"&&Ge&&Qe(je=>je+1)},[Ie.phase,Ge]);const is=f??fe,ql=y===void 0||f!==void 0,xn=jv(j.useCallback(async se=>({rows:(await is.listWorkflows(se)).workflows}),[is]),A==="workflows"||ql),ya=jv(j.useCallback(async se=>({rows:(await is.listAdapters(se)).adapters}),[is]),A==="adapters"||ql),[$l,sc]=j.useState(null),lc=Mv(Ie),rs=[...Ie.live,...Ie.history].reduce((se,je)=>(je.availability!=="available"||(se[je.workflowName]=(se[je.workflowName]??0)+1),se),{}),Mt=[...Ie.live,...Ie.history].reduce((se,je)=>se+(je.availability==="available"?je.reportedRunningCalls:0),0),Ut=Ie.selected,We=ct.selected,Sn=$?.kind==="run"||$?.kind==="run_call"?$.runId:null,os=j.useRef(null);j.useEffect(()=>{if(A!=="runs")return;if(Sn===null){os.current=null;return}if(os.current===Sn||(os.current=Sn,Ie.selected?.runId===Sn))return;const se=[...Ie.live,...Ie.history].find(je=>je.availability==="available"&&je.runId===Sn);if(se!==void 0){it.select(se);return}kn!==void 0&&kn.getRunDetailCurrent(Sn).then(je=>{os.current===Sn&&je.availability==="available"&&it.select(je)}).catch(()=>{})},[A,kn,it,Ie.live,Ie.history,Ie.selected,Sn]);const qt=$?.kind==="activity"?$.activityId:null,Mn=j.useRef(null);j.useEffect(()=>{if(A!=="activities")return;if(qt===null){Mn.current=null,re(!1);return}if(Mn.current===qt||(Mn.current=qt,re(!0),ct.selected?.activityId===qt))return;const se=ct.activities.find(je=>je.activityId===qt);if(se!==void 0){tt.select(se);return}kn!==void 0&&kn.getActivityDetailCurrent(qt).then(je=>{Mn.current===qt&&tt.select(je)}).catch(()=>{})},[tt,A,kn,ct.activities,ct.selected,qt]);const jn=$?.kind==="context_run"?$.contextRunId:null;j.useEffect(()=>{if(A==="context_runs"){if(jn===null){re(!1),Be.selectedId!==null&&St.clearSelection();return}re(!0),Be.selectedId!==jn&&St.select(jn)}},[St,A,Be.selectedId,jn]);const ut=$?.kind==="progress_report"?$.progressReportId:null,zn=j.useRef(ut);j.useEffect(()=>{if(A==="progress_reports"){if(ut===null){re(!1),ke.selectedId!==null&&gt.clearSelection();return}re(!0),ke.selectedId!==ut&&gt.select(ut)}},[gt,A,ke.selectedId,ut]),j.useEffect(()=>{const se=zn.current;zn.current=ut,!(A!=="progress_reports"||se===null||ut!==null)&&window.setTimeout(()=>{const je=document.querySelector(`.dashboard-layout__run-list [role="option"][data-item-id="${CSS.escape(se)}"]`),rn=document.querySelector(".dashboard-layout__run-list #progress-report-list-title"),sr=document.querySelector('.dashboard-layout__run-list [role="option"]');(je??rn??sr)?.focus()},0)},[A,ut]);const cs=Sn??Ie.selected?.runId??null,us=$?.kind==="run_call"?{stageId:$.stageId,callId:$.callId}:null,Gs=j.useRef(!1);j.useEffect(()=>{$?.kind!=="run_call"&&(Gs.current=!1)},[$]);const nr=j.useCallback((se,je)=>{const rn=cs;rn!==null&&(je==="open"&&se!==null?(Gs.current=!0,L.pushRoute(hv(rn,se.stageId,se.callId))):je==="switch"&&se!==null?L.replaceRoute(hv(rn,se.stageId,se.callId)):Gs.current?(Gs.current=!1,window.history.back()):L.replaceRoute(fv(rn)))},[L,cs]),Hl=j.useCallback(()=>{it.runGenerationChanged()},[it]),ds=j.useCallback(()=>{tt.clearSelection()},[tt]),ic=j.useCallback(()=>{St.clearSelection(),L.replaceRoute({kind:"context_runs"})},[St,L.replaceRoute]),Gl=j.useRef(Ut);j.useEffect(()=>{const se=Gl.current;Gl.current=Ut,!(A!=="runs"||!he||se===null||Ut!==null)&&(re(!1),window.setTimeout(()=>{const je=document.querySelector(".dashboard-layout__run-list [data-selection-loss-announcement]"),rn=document.querySelector('.dashboard-layout__run-list [role="option"]');(je??rn)?.focus()},0))},[A,he,Ut]);const Bl=j.useRef(We);j.useEffect(()=>{const se=Bl.current;Bl.current=We,!(A!=="activities"||!he||se===null||We!==null)&&(re(!1),window.setTimeout(()=>{const je=document.querySelector(".dashboard-layout__run-list [data-selection-loss-announcement]"),rn=document.querySelector('.dashboard-layout__run-list [role="option"]');(je??rn)?.focus()},0))},[A,he,We]);const ar=A==="activities"?ct.phase:A==="context_runs"?Be.phase:A==="progress_reports"?ke.phase:Ie.phase,Vl=A==="runs"||A==="activities"||A==="context_runs"||A==="progress_reports",Bs=()=>{A==="runs"&&it.pause(),A==="activities"&&tt.pause(),A==="context_runs"&&St.pause(),A==="progress_reports"&&gt.pause()},Zl=()=>{A==="runs"&&it.resume(),A==="activities"&&tt.resume(),A==="context_runs"&&St.resume(),A==="progress_reports"&&gt.resume()},Yl=se=>{se==="artifacts"&&te(!0),re(!1),L.navigateToDestination(se)},wn=()=>{re(!1),window.setTimeout(()=>{document.querySelector('.dashboard-layout__run-list [role="option"][aria-selected="true"]')?.focus()},0)},vt=()=>{L.pushRoute({kind:"activities"}),wn()},jt=()=>{L.pushRoute({kind:"progress_reports"})},ba={...Ie.lastRefreshAtMs===null?{}:{runs:Ie.live.length+Ie.history.length},...ct.lastRefreshAtMs===null?{}:{activities:ct.activities.length},...Be.lastRefreshAtMs===null?{}:{context_runs:Be.contextRuns.length},...ke.lastRefreshAtMs===null?{}:{progress_reports:ke.progressReports.length},...xn.state.phase==="current"?{workflows:xn.state.rows.length}:{},...ya.state.phase==="current"?{adapters:ya.state.rows.length}:{},...$l===null?{}:{artifacts:$l}};return!O&&A==="progress_reports"&&ut!==null?o.jsx(iv,{detail:ke.detail,detailPhase:ke.detailPhase,nowMs:ke.displayNowMs,onBack:jt,onPause:gt.pause,onResume:()=>{gt.resume()},onRetry:()=>{gt.retry()},onSetStatusOverride:se=>{gt.setStatusOverride(ut,se)},omittedSections:ke.omittedSections,pollingPhase:ke.phase,...ke.publishedSessionStatus===null?{}:{publishedSessionStatus:ke.publishedSessionStatus},selectedId:ut,unreadableReason:ke.unreadableReason}):o.jsxs(mx,{...n===void 0?{}:{accountActions:n},activeDestination:A,environment:ue,navigationCounts:ba,observationAvailable:O?!1:Vl,onNavigate:Yl,onPause:Bs,onResume:Zl,pageTitle:O?"Not found":Cl[A],pollingPhase:ar,reportedRunningCalls:{count:Ie.lastRefreshAtMs===null?null:Mt,refreshedLabel:Ie.lastRefreshAtMs===null?null:lc.lastRefreshLabel},children:[O?o.jsxs("section",{className:"app-shell__view","aria-labelledby":"dashboard-page-title",children:[o.jsx("h1",{id:"dashboard-page-title",className:"app-shell__title",children:"Page not found"}),o.jsxs("p",{className:"app-shell__note",role:"status",children:["No dashboard view matches ",o.jsx("code",{children:q.rawPath}),"."]}),o.jsx("button",{type:"button",onClick:()=>Yl("runs"),children:"Go to run monitor"})]}):null,!O&&A==="runs"?o.jsx(So,{detail:o.jsx(Aj,{applicationRootId:a,...T===void 0?{}:{inspectorApi:T},onBack:wn,onInspectorRouteChange:nr,onPause:Bs,onResume:Zl,onRetry:()=>{it.retry()},onRunGenerationChanged:Hl,...Ie.detail?.availability!=="available"?{}:{contextPreflight:Ie.detail.contextPreflight??null},...N===void 0?{}:{resultApi:N},routeCall:us,...Zn===void 0?{}:{sessionLogApi:Zn},state:Ie}),mobileView:Ut!==null&&he?"detail":"list",runList:o.jsxs("section",{className:"app-shell__view","aria-live":"off",children:[o.jsx("h1",{id:"dashboard-page-title",className:"visually-hidden",children:Cl[A]}),o.jsx(NN,{onNewer:()=>{it.newer()},onOlder:()=>{it.older()},onPause:it.pause,onResume:()=>{it.resume()},onRetry:()=>{it.retry()},onSelect:se=>{re(!0),os.current=se.runId,L.pushRoute(fv(se.runId)),it.select(se)},state:Ie})]})}):null,!O&&A==="activities"?o.jsx(So,{detailAriaLabel:"Single-call detail",listAriaLabel:"Single-call list",detail:o.jsx(Mj,{api:ac,detail:qt===null?null:ct.detail,detailPhase:qt===null?"idle":ct.detailPhase,nowMs:ct.displayNowMs,onBack:vt,onGenerationChanged:ds,selection:qt===null?null:We,...Zn===void 0?{}:{sessionLogApi:Zn}},qt===null||We===null?"activity:none":[We.activityId,We.activityGeneration,We.stateRevision].join(":")),mobileView:We!==null&&he?"detail":"list",runList:o.jsxs("section",{className:"app-shell__view","aria-live":"off",children:[o.jsx("h1",{id:"dashboard-page-title",className:"visually-hidden",children:Cl[A]}),o.jsx(Lj,{activities:ct.activities,announcement:ct.announcement,hasSnapshot:ct.lastRefreshAtMs!==null,onRetry:()=>{tt.retry()},onSelect:se=>{re(!0),Mn.current=se.activityId,L.pushRoute(o1(se.activityId)),tt.select(se)},phase:ct.phase,selected:ct.selected,nowMs:ct.displayNowMs})]})}):null,!O&&A==="context_runs"?o.jsx(So,{detailAriaLabel:"Context run detail",listAriaLabel:"Context run list",detail:o.jsx(pw,{detail:Be.detail,detailPhase:Be.detailPhase,onBack:()=>{L.pushRoute({kind:"context_runs"})},onGenerationChanged:ic,selectedId:jn,contextRunsApi:_e,...Zn===void 0?{}:{sessionLogApi:Zn}}),mobileView:jn!==null?"detail":"list",runList:o.jsxs("section",{className:"app-shell__view","aria-live":"off",children:[o.jsx("h1",{id:"dashboard-page-title",className:"visually-hidden",children:Cl[A]}),o.jsx(gw,{announcement:Be.announcement,contextRuns:Be.contextRuns,hasSnapshot:Be.lastRefreshAtMs!==null,nowMs:Be.displayNowMs,onRetry:()=>{St.retry()},onSelect:se=>{L.pushRoute(c1(se))},phase:Be.phase,selectedId:Be.selectedId})]})}):null,!O&&A==="progress_reports"?o.jsx(So,{detailAriaLabel:"Progress report detail",listAriaLabel:"Progress report list",detail:o.jsx(iv,{detail:ke.detail,detailPhase:ke.detailPhase,nowMs:ke.displayNowMs,onBack:jt,onPause:gt.pause,onResume:()=>{gt.resume()},onRetry:()=>{gt.retry()},onSetStatusOverride:se=>{ut!==null&&gt.setStatusOverride(ut,se)},omittedSections:ke.omittedSections,pollingPhase:ke.phase,...ke.publishedSessionStatus===null?{}:{publishedSessionStatus:ke.publishedSessionStatus},selectedId:ut,unreadableReason:ke.unreadableReason}),mobileView:ut!==null?"detail":"list",runList:o.jsxs("section",{className:"app-shell__view","aria-live":"off",children:[o.jsx("h1",{id:"dashboard-page-title",className:"visually-hidden",children:Cl[A]}),o.jsx(yw,{announcement:ke.announcement,progressReports:ke.progressReports,hasSnapshot:ke.lastRefreshAtMs!==null,nowMs:ke.displayNowMs,onRetry:()=>{gt.retry()},onSelect:se=>{L.pushRoute(u1(se))},phase:ke.phase,...ue?.progressReportsRoot===void 0?{}:{progressReportsRoot:ue.progressReportsRoot},selectedId:ke.selectedId,truncated:ke.truncated})]})}):null,!O&&A==="workflows"?o.jsxs("section",{className:"app-shell__view app-shell__view--catalog","aria-live":"off",children:[o.jsx("h1",{id:"dashboard-page-title",className:"visually-hidden",children:Cl[A]}),o.jsx(wv,{kind:"workflow",phase:xn.state.phase,retry:xn.retry}),xn.state.phase==="current"?o.jsx(BN,{...ue?.workflowsPath===void 0?{}:{sourcePath:ue.workflowsPath},runCounts:rs,workflows:xn.state.rows}):null]}):null,!O&&A==="adapters"?o.jsxs("section",{className:"app-shell__view app-shell__view--catalog","aria-live":"off",children:[o.jsx("h1",{id:"dashboard-page-title",className:"visually-hidden",children:"Adapters"}),o.jsx(wv,{kind:"adapter",phase:ya.state.phase,retry:ya.retry}),ya.state.phase==="current"?o.jsx(ZN,{adapters:ya.state.rows}):null]}):null,!O&&(ae||Ie.lastRefreshAtMs!==null&&(y===void 0||u!==void 0))?o.jsxs("section",{"aria-live":"off",className:"app-shell__view app-shell__view--catalog",hidden:A!=="artifacts",children:[o.jsx("h1",{className:"visually-hidden",id:A==="artifacts"?"dashboard-page-title":void 0,children:"Artifacts"}),o.jsx(MN,{api:u??S,applicationRootId:a,onLoadedCount:sc,...ue?.runsRoot===void 0?{}:{runsRoot:ue.runsRoot}})]}):null]})}function $n(n){const a=new Uint8Array(n);let i="";for(const u of a)i+=String.fromCharCode(u);return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Zo(n){const a=n.replace(/-/g,"+").replace(/_/g,"/"),i=(4-a.length%4)%4,r=a.padEnd(a.length+i,"="),u=atob(r),f=new ArrayBuffer(u.length),p=new Uint8Array(f);for(let m=0;m<u.length;m++)p[m]=u.charCodeAt(m);return f}function nc(){return M1.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential=="function")}const M1={stubThis:n=>n};function D_(n){const{id:a}=n;return{...n,id:Zo(a),transports:n.transports}}function I_(n){return n==="localhost"||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(n)}class Et extends Error{constructor({message:a,code:i,cause:r,name:u}){super(a,{cause:r}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=u??r.name,this.code=i}}function z1({error:n,options:a}){const{publicKey:i}=a;if(!i)throw Error("options was missing required publicKey property");if(n.name==="AbortError"){if(a.signal instanceof AbortSignal)return new Et({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:n})}else if(n.name==="ConstraintError"){if(i.authenticatorSelection?.requireResidentKey===!0)return new Et({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:n});if(a.mediation==="conditional"&&i.authenticatorSelection?.userVerification==="required")return new Et({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:n});if(i.authenticatorSelection?.userVerification==="required")return new Et({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:n})}else{if(n.name==="InvalidStateError")return new Et({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:n});if(n.name==="NotAllowedError")return new Et({message:n.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n});if(n.name==="NotSupportedError")return i.pubKeyCredParams.filter(u=>u.type==="public-key").length===0?new Et({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:n}):new Et({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:n});if(n.name==="SecurityError"){const r=globalThis.location.hostname;if(I_(r)){if(i.rp.id!==r)return new Et({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:n})}else return new Et({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:n})}else if(n.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new Et({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:n})}else if(n.name==="UnknownError")return new Et({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:n})}return n}class L1{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){const i=new Error("Cancelling existing WebAuthn API call for new one");i.name="AbortError",this.controller.abort(i)}const a=new AbortController;return this.controller=a,a.signal}cancelCeremony(){if(this.controller){const a=new Error("Manually cancelling existing WebAuthn API call");a.name="AbortError",this.controller.abort(a),this.controller=void 0}}}const U_=new L1,D1=["cross-platform","platform"];function q_(n){if(n&&!(D1.indexOf(n)<0))return n}async function I1(n){!n.optionsJSON&&n.challenge&&(console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),n={optionsJSON:n});const{optionsJSON:a,useAutoRegister:i=!1}=n;if(!nc())throw new Error("WebAuthn is not supported in this browser");const r={...a,challenge:Zo(a.challenge),user:{...a.user,id:Zo(a.user.id)},excludeCredentials:a.excludeCredentials?.map(D_)},u={};i&&(u.mediation="conditional"),u.publicKey=r,u.signal=U_.createNewAbortSignal();let f;try{f=await navigator.credentials.create(u)}catch(C){throw z1({error:C,options:u})}if(!f)throw new Error("Registration was not completed");const{id:p,rawId:m,response:g,type:v}=f;let y;typeof g.getTransports=="function"&&(y=g.getTransports());let b;if(typeof g.getPublicKeyAlgorithm=="function")try{b=g.getPublicKeyAlgorithm()}catch(C){Dd("getPublicKeyAlgorithm()",C)}let T;if(typeof g.getPublicKey=="function")try{const C=g.getPublicKey();C!==null&&(T=$n(C))}catch(C){Dd("getPublicKey()",C)}let N;if(typeof g.getAuthenticatorData=="function")try{N=$n(g.getAuthenticatorData())}catch(C){Dd("getAuthenticatorData()",C)}return{id:p,rawId:$n(m),response:{attestationObject:$n(g.attestationObject),clientDataJSON:$n(g.clientDataJSON),transports:y,publicKeyAlgorithm:b,publicKey:T,authenticatorData:N},type:v,clientExtensionResults:f.getClientExtensionResults(),authenticatorAttachment:q_(f.authenticatorAttachment)}}function Dd(n,a){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${n}. You should report this error to them.
24
+ `,a)}function U1(){if(!nc())return Id.stubThis(new Promise(a=>a(!1)));const n=globalThis.PublicKeyCredential;return n?.isConditionalMediationAvailable===void 0?Id.stubThis(new Promise(a=>a(!1))):Id.stubThis(n.isConditionalMediationAvailable())}const Id={stubThis:n=>n};function q1({error:n,options:a}){const{publicKey:i}=a;if(!i)throw Error("options was missing required publicKey property");if(n.name==="AbortError"){if(a.signal instanceof AbortSignal)return new Et({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:n})}else{if(n.name==="NotAllowedError")return new Et({message:n.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n});if(n.name==="SecurityError"){const r=globalThis.location.hostname;if(I_(r)){if(i.rpId!==r)return new Et({message:`The RP ID "${i.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:n})}else return new Et({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:n})}else if(n.name==="UnknownError")return new Et({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:n})}return n}async function $1(n){!n.optionsJSON&&n.challenge&&(console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),n={optionsJSON:n});const{optionsJSON:a,useBrowserAutofill:i=!1,verifyBrowserAutofillInput:r=!0}=n;if(!nc())throw new Error("WebAuthn is not supported in this browser");let u;a.allowCredentials?.length!==0&&(u=a.allowCredentials?.map(D_));const f={...a,challenge:Zo(a.challenge),allowCredentials:u},p={};if(i){if(!await U1())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&r)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');p.mediation="conditional",f.allowCredentials=[]}p.publicKey=f,p.signal=U_.createNewAbortSignal();let m;try{m=await navigator.credentials.get(p)}catch(N){throw q1({error:N,options:p})}if(!m)throw new Error("Authentication was not completed");const{id:g,rawId:v,response:y,type:b}=m;let T;return y.userHandle&&(T=$n(y.userHandle)),{id:g,rawId:$n(v),response:{authenticatorData:$n(y.authenticatorData),clientDataJSON:$n(y.clientDataJSON),signature:$n(y.signature),userHandle:T},type:b,clientExtensionResults:m.getClientExtensionResults(),authenticatorAttachment:q_(m.authenticatorAttachment)}}class kt extends Error{status;code;constructor(a,i){super(i),this.name="DashboardAuthApiError",this.status=a,this.code=i}}const H1=`{"error":{"code":"not_found"}}
25
+ `,G1="no-store",B1="application/json; charset=utf-8",V1=/^[A-Za-z0-9_-]{43}$/,$_=new WeakSet;function Z1(){const n=new kt(404,"not_found");return $_.add(n),n}async function Y1(n,a){try{return(await n.status()).mode}catch(i){if(a&&i instanceof kt&&$_.has(i))return"bearer";throw i}}function Qi(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function H_(n,a){if(!n.ok){const i=Qi(a)&&Qi(a.error)&&typeof a.error.code=="string"?a.error.code:"request_failed";throw new kt(n.status,i)}return a}async function G_(n){let a;try{a=await n.json()}catch{throw new kt(n.status,"invalid_response")}return H_(n,a)}async function X1(n){if(n.status!==404)return G_(n);let a;try{a=await n.text()}catch{throw new kt(n.status,"invalid_response")}if(a===H1&&n.headers.get("cache-control")===G1&&n.headers.get("content-type")===B1)throw Z1();let i;try{i=JSON.parse(a)}catch{throw new kt(n.status,"invalid_response")}return H_(n,i)}async function $i(n,a,i){const r=rf(),u=await fetch(n,{method:"POST",credentials:"same-origin",redirect:"error",referrerPolicy:"no-referrer",headers:{"Content-Type":"application/json",...i==null?{}:{"X-Enrollment-Code":i},...r==null?{}:{[Co]:r}},body:JSON.stringify(a)});try{return await G_(u)}catch(f){throw f instanceof kt&&f.status===401&&Bn(),f}}function K1(n){if(!Qi(n))throw new kt(200,"invalid_response");if(Object.keys(n).sort().join("\0")!==["authenticated","enrolled","mode"].sort().join("\0")||typeof n.enrolled!="boolean"||typeof n.authenticated!="boolean"||n.mode!=="passkey"&&n.mode!=="bearer")throw new kt(200,"invalid_response");return n}function Nv(n){if(!Qi(n)||typeof n.challenge!="string")throw new kt(200,"invalid_response");return n}function Q1(n){if(!Qi(n))throw Bn(),new kt(200,"invalid_response");const a=Object.keys(n).sort().join("\0");if(Fi()){if(a!==["originProof","verified"].sort().join("\0")||n.verified!==!0||typeof n.originProof!="string"||!V1.test(n.originProof))throw Bn(),new kt(200,"invalid_response");try{i0(n.originProof)}catch{throw Bn(),new kt(200,"invalid_response")}return}if(a!=="verified"||n.verified!==!0)throw new kt(200,"invalid_response")}function B_(){return{async status(n){try{const a=rf(),i=await fetch("/api/auth/status",{method:"GET",credentials:"same-origin",redirect:"error",referrerPolicy:"no-referrer",...a==null?{}:{headers:{[Co]:a}},...n==null?{}:{signal:n}}),r=K1(await X1(i));return r.authenticated||Bn(),r}catch(a){throw Fi()&&a instanceof kt&&Bn(),a}},async registrationOptions(n){return Nv(await $i("/api/auth/register/options",{},n))},async verifyRegistration(n,a,i){await $i("/api/auth/register/verify",{response:n,...i==null?{}:{label:i}},a)},async authenticationOptions(){return Nv(await $i("/api/auth/login/options",{}))},async verifyAuthentication(n){Q1(await $i("/api/auth/login/verify",{response:n}))},async logout(){try{await $i("/api/auth/logout",{})}finally{Bn()}}}}const J1=/^[A-Za-z0-9_-]{32}$/,F1={supports:nc,register:async n=>I1({optionsJSON:n}),authenticate:async n=>$1({optionsJSON:n})};function Ud(n){if(n instanceof kt){if(n.status===401)return"Authorization was rejected.";if(n.code==="not_enrolled")return"Register a passkey before signing in.";if(n.code==="state_conflict")return"Enrollment changed. Refresh the status and try again."}return n instanceof DOMException&&n.name==="NotAllowedError"?"The passkey request was cancelled or timed out.":"The passkey request could not be completed."}function W1({api:n,webauthn:a,authenticatedContent:i}){const r=j.useMemo(()=>n??B_(),[n]),u=a??F1,[f,p]=j.useState(null),[m,g]=j.useState(""),v=j.useRef(""),y=j.useRef(!0),[b,T]=j.useState(null),[N,C]=j.useState(null);j.useEffect(()=>{y.current=!0,cf("passkey");const O=new AbortController;r.status(O.signal).then(A=>{O.signal.aborted||p(A)},A=>{O.signal.aborted||C(Ud(A))});const Y=()=>{p(A=>A==null?A:{...A,authenticated:!1}),C("Your dashboard session expired. Sign in again.")};return window.addEventListener(Gd,Y),()=>{y.current=!1,O.abort(),window.removeEventListener(Gd,Y),v.current="",g("")}},[r]);const R=O=>{if(b!=null)return;const Y=O?void 0:v.current.trim();if(!O&&!J1.test(Y??"")){C("Enter the 32-character enrollment code from the launch output.");return}C(null),T("register"),r.registrationOptions(Y).then(A=>u.register(A)).then(A=>r.verifyRegistration(A,O?void 0:v.current.trim()||void 0)).then(async()=>{if(v.current="",!y.current)return;g("");const A=await r.status();y.current&&p(A)}).catch(A=>{v.current="",y.current&&(g(""),C(Ud(A)))}).finally(()=>{y.current&&T(null)})},L=()=>{b==null&&(C(null),T("login"),(async()=>{const O=await r.authenticationOptions();if(!y.current)return;const Y=await u.authenticate(O);if(!y.current||(await r.verifyAuthentication(Y),!y.current))return;const A=await r.status();y.current&&p(A)})().catch(O=>{y.current&&C(Ud(O))}).finally(()=>{y.current&&T(null)}))},q=()=>{b==null&&(C(null),T("logout"),r.logout().then(async()=>{if(y.current){p(O=>O==null?O:{...O,authenticated:!1});try{const O=await r.status();y.current&&p(O)}catch{y.current&&C("Signed out locally, but authentication status could not be refreshed.")}}}).catch(()=>{y.current&&(p(O=>O==null?O:{...O,authenticated:!1}),C("Sign-out could not be confirmed. You were signed out locally."))}).finally(()=>{y.current&&T(null)}))};if(f===null)return o.jsx("main",{className:"auth-gate",children:o.jsxs("section",{className:"auth-gate__card","aria-live":"polite",children:[o.jsx("h1",{children:"ClinkX field station"}),o.jsx("p",{children:N??"Checking passkey status…"})]})});if(!u.supports())return o.jsx("main",{className:"auth-gate",children:o.jsxs("section",{className:"auth-gate__card",children:[o.jsx("h1",{children:"Passkeys unavailable"}),o.jsx("p",{children:"This browser does not support WebAuthn. Open the dashboard in a supported browser."})]})});if(f.authenticated){const O={error:N,onAddPasskey:()=>R(!0),onSignOut:q,pending:b==="register"||b==="logout"?b:null};return o.jsx("div",{className:"auth-gate__authenticated",children:i?.(O)??o.jsx(L_,{accountActions:O})})}return o.jsx("main",{className:"auth-gate",children:o.jsxs("section",{className:"auth-gate__card","aria-labelledby":"auth-gate-title",children:[o.jsx("span",{"aria-hidden":"true",className:"auth-gate__mark"}),o.jsx("h1",{id:"auth-gate-title",children:"ClinkX field station"}),f.enrolled?o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"Use your passkey to open the run monitor."}),o.jsx("button",{type:"button",disabled:b!==null,onClick:L,children:b==="login"?"Waiting for passkey…":"Sign in"})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"Register the first passkey with the one-time enrollment code."}),o.jsx("label",{htmlFor:"enrollment-code",children:"Enrollment code"}),o.jsx("input",{id:"enrollment-code",value:m,disabled:b!==null,autoComplete:"off",autoCapitalize:"off",spellCheck:!1,onChange:O=>{v.current=O.target.value,g(O.target.value),N!=null&&C(null)}}),o.jsx("button",{type:"button",disabled:b!==null,onClick:()=>R(!1),children:b==="register"?"Waiting for passkey…":"Register this device"})]}),N==null?null:o.jsx("p",{className:"auth-gate__error",role:"alert",children:N})]})})}const P1=/^[A-Za-z0-9_-]{43}$/;function eA({onSubmit:n}){const[a,i]=j.useState(""),[r,u]=j.useState(null),[f,p]=j.useState(!1),m=j.useId(),g=j.useId(),v=y=>{if(y.preventDefault(),f)return;const b=a.trim();if(!P1.test(b)){u("Enter the 43-character access token from the launch output.");return}u(null),p(!0),n(b).then(T=>{T||(u("That token was rejected. Check the launch output and try again."),p(!1))},()=>{u("Could not reach the dashboard. Is it still running?"),p(!1)})};return o.jsx("main",{className:"login",children:o.jsxs("section",{className:"login__card","aria-labelledby":"login-title",children:[o.jsx("span",{"aria-hidden":"true",className:"login__mark",children:o.jsx("span",{className:"login__mark-dot"})}),o.jsx("h1",{className:"login__title",id:"login-title",children:"ClinkX field station"}),o.jsx("p",{className:"login__lede",children:"Paste the access token printed when the dashboard started to open the run monitor."}),o.jsxs("form",{className:"login__form",onSubmit:v,noValidate:!0,children:[o.jsx("label",{className:"login__label op-caption",htmlFor:m,children:"Access token"}),o.jsx("input",{id:m,className:"login__input",type:"password",autoComplete:"off",autoCapitalize:"off",spellCheck:!1,autoFocus:!0,value:a,disabled:f,"aria-invalid":r!==null,...r===null?{}:{"aria-describedby":g},onChange:y=>{i(y.target.value),r!==null&&u(null)}}),r===null?null:o.jsx("p",{className:"login__error op-caption",id:g,role:"alert",children:r}),o.jsx("button",{className:"login__submit",type:"submit",disabled:f,children:f?"Opening…":"Open dashboard"})]})]})})}function tA(n,a=window.location.origin){return n.mode==="local"&&!n.authenticated&&Fi(a)}const V_=document.getElementById("root");if(!V_)throw new Error("Root element #root not found");const Yo=ox.createRoot(V_),nA=Zv(),Pd=()=>{Yo.render(o.jsx(j.StrictMode,{children:o.jsx(L_,{})}))},aA=async n=>{if(!p0(n))return!1;try{return(await Qv()).authenticated?(Pd(),!0):(Vd(),!1)}catch(a){const i=m0();if(Vd(),i)throw a;return!1}},qd=()=>{Yo.render(o.jsx(j.StrictMode,{children:o.jsx(eA,{onSubmit:aA})}))},$d=()=>tA(h0(),window.location.origin),sA=()=>{if(cf("bearer"),$d()){qd();return}Qv().then(()=>$d()?qd():Pd(),()=>$d()?qd():Pd())},Av=B_();Y1(Av,nA.mode==="remote").then(n=>{if(n==="passkey"){cf("passkey"),Yo.render(o.jsx(j.StrictMode,{children:o.jsx(W1,{api:Av})}));return}sA()},()=>{Yo.render(o.jsx(j.StrictMode,{children:o.jsx("main",{className:"auth-gate",children:o.jsxs("section",{className:"auth-gate__card",role:"alert",children:[o.jsx("h1",{children:"ClinkX field station"}),o.jsx("p",{children:"Could not load dashboard authentication status."})]})})}))});