@aeolus-fleet/console 0.30.1 → 0.31.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 (185) hide show
  1. package/.next/standalone/packages/console/.next/BUILD_ID +1 -1
  2. package/.next/standalone/packages/console/.next/build-manifest.json +3 -3
  3. package/.next/standalone/packages/console/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/[cause]/page/server-reference-manifest.json +14 -14
  5. package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/[cause]/page.js.nft.json +1 -1
  6. package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/[cause]/page_client-reference-manifest.js +1 -1
  7. package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/page/server-reference-manifest.json +14 -14
  8. package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/page.js.nft.json +1 -1
  9. package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/page_client-reference-manifest.js +1 -1
  10. package/.next/standalone/packages/console/.next/server/app/(console)/inbox/page/server-reference-manifest.json +14 -14
  11. package/.next/standalone/packages/console/.next/server/app/(console)/inbox/page.js.nft.json +1 -1
  12. package/.next/standalone/packages/console/.next/server/app/(console)/inbox/page_client-reference-manifest.js +1 -1
  13. package/.next/standalone/packages/console/.next/server/app/(console)/labels/page/server-reference-manifest.json +14 -14
  14. package/.next/standalone/packages/console/.next/server/app/(console)/labels/page.js.nft.json +1 -1
  15. package/.next/standalone/packages/console/.next/server/app/(console)/labels/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/packages/console/.next/server/app/(console)/needs-attention/page/server-reference-manifest.json +14 -14
  17. package/.next/standalone/packages/console/.next/server/app/(console)/needs-attention/page.js.nft.json +1 -1
  18. package/.next/standalone/packages/console/.next/server/app/(console)/needs-attention/page_client-reference-manifest.js +1 -1
  19. package/.next/standalone/packages/console/.next/server/app/(console)/needs-crew/page/server-reference-manifest.json +14 -14
  20. package/.next/standalone/packages/console/.next/server/app/(console)/needs-crew/page.js.nft.json +1 -1
  21. package/.next/standalone/packages/console/.next/server/app/(console)/needs-crew/page_client-reference-manifest.js +1 -1
  22. package/.next/standalone/packages/console/.next/server/app/(console)/network/page/server-reference-manifest.json +14 -14
  23. package/.next/standalone/packages/console/.next/server/app/(console)/network/page.js.nft.json +1 -1
  24. package/.next/standalone/packages/console/.next/server/app/(console)/network/page_client-reference-manifest.js +1 -1
  25. package/.next/standalone/packages/console/.next/server/app/(console)/page/react-loadable-manifest.json +2 -2
  26. package/.next/standalone/packages/console/.next/server/app/(console)/page/server-reference-manifest.json +14 -14
  27. package/.next/standalone/packages/console/.next/server/app/(console)/page.js.nft.json +1 -1
  28. package/.next/standalone/packages/console/.next/server/app/(console)/page_client-reference-manifest.js +1 -1
  29. package/.next/standalone/packages/console/.next/server/app/(console)/settings/page/server-reference-manifest.json +14 -14
  30. package/.next/standalone/packages/console/.next/server/app/(console)/settings/page.js.nft.json +1 -1
  31. package/.next/standalone/packages/console/.next/server/app/(console)/settings/page_client-reference-manifest.js +1 -1
  32. package/.next/standalone/packages/console/.next/server/app/(console)/ships/[shipId]/page/react-loadable-manifest.json +1 -1
  33. package/.next/standalone/packages/console/.next/server/app/(console)/ships/[shipId]/page/server-reference-manifest.json +14 -14
  34. package/.next/standalone/packages/console/.next/server/app/(console)/ships/[shipId]/page.js.nft.json +1 -1
  35. package/.next/standalone/packages/console/.next/server/app/(console)/ships/[shipId]/page_client-reference-manifest.js +1 -1
  36. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/[squadronId]/page/server-reference-manifest.json +14 -14
  37. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/[squadronId]/page.js.nft.json +1 -1
  38. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/[squadronId]/page_client-reference-manifest.js +1 -1
  39. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/blueprints/[name]/page/react-loadable-manifest.json +2 -2
  40. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/blueprints/[name]/page/server-reference-manifest.json +14 -14
  41. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/blueprints/[name]/page.js.nft.json +1 -1
  42. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/blueprints/[name]/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/page/react-loadable-manifest.json +2 -2
  44. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/page/server-reference-manifest.json +14 -14
  45. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/page.js.nft.json +1 -1
  46. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/page_client-reference-manifest.js +1 -1
  47. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/templates/[name]/page/server-reference-manifest.json +14 -14
  48. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/templates/[name]/page.js.nft.json +1 -1
  49. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/templates/[name]/page_client-reference-manifest.js +1 -1
  50. package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/[shipId]/page/server-reference-manifest.json +14 -14
  51. package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/[shipId]/page.js.nft.json +1 -1
  52. package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/[shipId]/page_client-reference-manifest.js +1 -1
  53. package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/page/server-reference-manifest.json +14 -14
  54. package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/page.js.nft.json +1 -1
  55. package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/page_client-reference-manifest.js +1 -1
  56. package/.next/standalone/packages/console/.next/server/app/_global-error.html +1 -1
  57. package/.next/standalone/packages/console/.next/server/app/_global-error.rsc +1 -1
  58. package/.next/standalone/packages/console/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  59. package/.next/standalone/packages/console/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  60. package/.next/standalone/packages/console/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  61. package/.next/standalone/packages/console/.next/server/app/_not-found/page.js.nft.json +1 -1
  62. package/.next/standalone/packages/console/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  63. package/.next/standalone/packages/console/.next/server/app/api/reads/[read]/route.js.nft.json +1 -1
  64. package/.next/standalone/packages/console/.next/server/app/sign-in/argo/confirm/page.js.nft.json +1 -1
  65. package/.next/standalone/packages/console/.next/server/app/sign-in/argo/confirm/page_client-reference-manifest.js +1 -1
  66. package/.next/standalone/packages/console/.next/server/app/sign-in/argo/out/route.js.nft.json +1 -1
  67. package/.next/standalone/packages/console/.next/server/app/sign-in/argo/refused/page.js.nft.json +1 -1
  68. package/.next/standalone/packages/console/.next/server/app/sign-in/argo/refused/page_client-reference-manifest.js +1 -1
  69. package/.next/standalone/packages/console/.next/server/app/sign-in/argo/route.js.nft.json +1 -1
  70. package/.next/standalone/packages/console/.next/server/app/sign-in/failed/page.js.nft.json +1 -1
  71. package/.next/standalone/packages/console/.next/server/app/sign-in/failed/page_client-reference-manifest.js +1 -1
  72. package/.next/standalone/packages/console/.next/server/app/sign-in/no-rights/page.js.nft.json +1 -1
  73. package/.next/standalone/packages/console/.next/server/app/sign-in/no-rights/page_client-reference-manifest.js +1 -1
  74. package/.next/standalone/packages/console/.next/server/app/sign-in/nothing-to-manage/page.js.nft.json +1 -1
  75. package/.next/standalone/packages/console/.next/server/app/sign-in/nothing-to-manage/page_client-reference-manifest.js +1 -1
  76. package/.next/standalone/packages/console/.next/server/app/sign-in/page.js.nft.json +1 -1
  77. package/.next/standalone/packages/console/.next/server/app/sign-in/page_client-reference-manifest.js +1 -1
  78. package/.next/standalone/packages/console/.next/server/app/sign-in/unreachable/page.js.nft.json +1 -1
  79. package/.next/standalone/packages/console/.next/server/app/sign-in/unreachable/page_client-reference-manifest.js +1 -1
  80. package/.next/standalone/packages/console/.next/server/app/version/route.js.nft.json +1 -1
  81. package/.next/standalone/packages/console/.next/server/chunks/[root-of-the-server]__0-b_d8j._.js +1 -1
  82. package/.next/standalone/packages/console/.next/server/chunks/[root-of-the-server]__0w4s32w._.js +1 -1
  83. package/.next/standalone/packages/console/.next/server/chunks/[root-of-the-server]__1c0qgbj._.js +1 -1
  84. package/.next/standalone/packages/console/.next/server/chunks/_1uqphll._.js +1 -1
  85. package/.next/standalone/packages/console/.next/server/chunks/ssr/{_1ia6sfj._.js → _022r12n._.js} +1 -1
  86. package/.next/standalone/packages/console/.next/server/chunks/ssr/_02sf-6u._.js +1 -1
  87. package/.next/standalone/packages/console/.next/server/chunks/ssr/{_20ltycf._.js → _05noh6w._.js} +2 -2
  88. package/.next/standalone/packages/console/.next/server/chunks/ssr/_07_cqry._.js +1 -1
  89. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0bdsmu0._.js +1 -1
  90. package/.next/standalone/packages/console/.next/server/chunks/ssr/{_18owi6c._.js → _0is0iyt._.js} +2 -2
  91. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0j-afyt._.js +3 -0
  92. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0nbjb5h._.js +1 -1
  93. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0qux6-9._.js +1 -1
  94. package/.next/standalone/packages/console/.next/server/chunks/ssr/{_135805g._.js → _0sravq5._.js} +2 -2
  95. package/.next/standalone/packages/console/.next/server/chunks/ssr/_14ww2ld._.js +1 -1
  96. package/.next/standalone/packages/console/.next/server/chunks/ssr/_15whprd._.js +3 -0
  97. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1bc8get._.js +1 -1
  98. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1bmxy9n._.js +3 -0
  99. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1e2tdd6._.js +1 -1
  100. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1fthxzz._.js +3 -0
  101. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1hsu1v2._.js +1 -1
  102. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1u0h4gj._.js +1 -1
  103. package/.next/standalone/packages/console/.next/server/chunks/ssr/{_0h-jnay._.js → _1vleg6y._.js} +1 -1
  104. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1ymusis._.js +1 -1
  105. package/.next/standalone/packages/console/.next/server/chunks/ssr/_20j7vun._.js +1 -1
  106. package/.next/standalone/packages/console/.next/server/chunks/ssr/node_modules_zod_v4_classic_external_15fmmz3.js +1 -1
  107. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_03-f8b4._.js +1 -1
  108. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_10js6wa._.js +1 -1
  109. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_00qg_s6._.js +1 -1
  110. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_02v53na._.js +1 -1
  111. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_02wkudy._.js +1 -1
  112. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_04rox65._.js +1 -1
  113. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_05zitd2._.js +1 -1
  114. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_065nea1._.js +1 -1
  115. package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_1qi485p._.js → packages_console_0d8_fed._.js} +1 -1
  116. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0h_376h._.js +1 -1
  117. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0ko_ogs._.js +1 -1
  118. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0sr2-oa._.js +1 -1
  119. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0ysbad7._.js +1 -1
  120. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_108sez2._.js +1 -1
  121. package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_1k1crw1._.js → packages_console_11f_j7c._.js} +1 -1
  122. package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_1e33jj3._.js → packages_console_16ys_pd._.js} +1 -1
  123. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1jy5-0g._.js +1 -1
  124. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1n8w8x0._.js +1 -1
  125. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1oz8iu7._.js +1 -1
  126. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1rdu3gt._.js +1 -1
  127. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1yfimad._.js +1 -1
  128. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_fleet-health_page_tsx_0vcosw1._.js +1 -1
  129. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_network_network-page_tsx_0qc3h-9._.js +1 -1
  130. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_ships_[shipId]_ship-page_tsx_0oahz0r._.js +1 -1
  131. package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_components_organisms_crew-line-dialog_tsx_11y3we6._.js → packages_console_components_organisms_crew-line-dialog_tsx_1l818ht._.js} +1 -1
  132. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_features_ship_ui_organisms_message-sheet_tsx_08bg9ly._.js +1 -1
  133. package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_features_squadrons_organisms_form-squadron-dialog_tsx_04jnwy5._.js → packages_console_features_squadrons_organisms_form-squadron-dialog_tsx_06m8azk._.js} +1 -1
  134. package/.next/standalone/packages/console/.next/server/middleware-build-manifest.js +3 -3
  135. package/.next/standalone/packages/console/.next/server/pages/500.html +1 -1
  136. package/.next/standalone/packages/console/.next/server/server-reference-manifest.js +1 -1
  137. package/.next/standalone/packages/console/.next/server/server-reference-manifest.json +15 -15
  138. package/.next/standalone/packages/console/.next/static/chunks/0_3x64wrf-bcc.js +1 -0
  139. package/.next/standalone/packages/console/.next/static/chunks/{3v8kvo897cw7g.js → 0kcev3l5eyvux.js} +1 -1
  140. package/.next/standalone/packages/console/.next/static/chunks/{09i8egz-ukq1h.js → 19h1iu002omr_.js} +1 -1
  141. package/.next/standalone/packages/console/.next/static/chunks/{23rmynijvqsdw.js → 1b36z114mad41.js} +1 -1
  142. package/.next/standalone/packages/console/.next/static/chunks/1odi-st5n0w9h.js +1 -0
  143. package/.next/standalone/packages/console/.next/static/chunks/{1z-37z24uifp1.js → 1sm_yeexx288v.js} +1 -1
  144. package/.next/standalone/packages/console/.next/static/chunks/{26lqmfd6v4qb4.js → 1tjv8rgwrbbg_.js} +1 -1
  145. package/.next/standalone/packages/console/.next/static/chunks/{0tzezbiiera4t.js → 1u5mjrw1qk334.js} +1 -1
  146. package/.next/standalone/packages/console/.next/static/chunks/{1q730nbf90lr2.js → 1z1jqbwrruy4-.js} +1 -1
  147. package/.next/standalone/packages/console/.next/static/chunks/{180jsws8b9eq6.js → 1z9u9wh2b5l6y.js} +1 -1
  148. package/.next/standalone/packages/console/.next/static/chunks/21xp9ny7yw3ug.js +1 -0
  149. package/.next/standalone/packages/console/.next/static/chunks/{2pkfao79haew9.js → 24yl55yxkaeaf.js} +1 -1
  150. package/.next/standalone/packages/console/.next/static/chunks/27qi3k10y-0hf.js +2 -0
  151. package/.next/standalone/packages/console/.next/static/chunks/2_qyhoh1hlhcy.js +1 -0
  152. package/.next/standalone/packages/console/.next/static/chunks/{0742dltqxo7l5.js → 2bid6ecbjoe6s.js} +1 -1
  153. package/.next/standalone/packages/console/.next/static/chunks/{0b8-il10o0ca2.js → 2bqxl5_u1hjjb.js} +1 -1
  154. package/.next/standalone/packages/console/.next/static/chunks/2cfixbtwii9hq.js +1 -0
  155. package/.next/standalone/packages/console/.next/static/chunks/2dkqrqvxmerj9.css +3 -0
  156. package/.next/standalone/packages/console/.next/static/chunks/2ggf3qa9xixed.js +1 -0
  157. package/.next/standalone/packages/console/.next/static/chunks/{3dqw9msbsb0t0.js → 2h98d1zd2s_t5.js} +1 -1
  158. package/.next/standalone/packages/console/.next/static/chunks/{19p4i84gnm2q6.js → 2l01iyjlu686-.js} +1 -1
  159. package/.next/standalone/packages/console/.next/static/chunks/{0rynbs46ao8hb.js → 2qicmwwvgn33n.js} +1 -1
  160. package/.next/standalone/packages/console/.next/static/chunks/{0jy978bstmu2h.js → 2tl2a2wz8thbf.js} +1 -1
  161. package/.next/standalone/packages/console/.next/static/chunks/{06v0wink6h9wc.js → 2xwbclmo1ptlk.js} +1 -1
  162. package/.next/standalone/packages/console/.next/static/chunks/{2u9g6rfau6qkb.js → 3a0odbvtvug2f.js} +1 -1
  163. package/.next/standalone/packages/console/.next/static/chunks/3q-rob7jfhbps.js +1 -0
  164. package/.next/standalone/packages/console/.next/static/chunks/{12tpena_m0td3.js → 3rm6d-05q8id3.js} +1 -1
  165. package/.next/standalone/packages/console/.next/static/chunks/{14t6zl5-m6-cv.js → 3v5kypqchkulb.js} +1 -1
  166. package/.next/standalone/packages/console/.next/static/chunks/{0lerfeqv17y3h.js → 3wn51b0ga8x5c.js} +1 -1
  167. package/.next/standalone/packages/console/.next/static/chunks/{20zd_xtfl07ru.js → 3ydi8zqssypls.js} +1 -1
  168. package/.next/standalone/packages/console/package.json +3 -3
  169. package/package.json +3 -3
  170. package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console_features_trierarchs_ui_organisms_clear-worktree-dialog_tsx_1cj5i3d._.js +0 -3
  171. package/.next/standalone/packages/console/.next/server/chunks/ssr/_085nqa_._.js +0 -3
  172. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0rdbxnq._.js +0 -3
  173. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1lrul1q._.js +0 -3
  174. package/.next/standalone/packages/console/.next/static/chunks/046j0y9wgycm0.js +0 -1
  175. package/.next/standalone/packages/console/.next/static/chunks/0bnl87gj176h5.js +0 -1
  176. package/.next/standalone/packages/console/.next/static/chunks/0mcbp_1hunti9.js +0 -1
  177. package/.next/standalone/packages/console/.next/static/chunks/0ofpruu2tcm_6.js +0 -1
  178. package/.next/standalone/packages/console/.next/static/chunks/194ocbg7a-yfj.js +0 -2
  179. package/.next/standalone/packages/console/.next/static/chunks/2_x-45vq7prtl.js +0 -1
  180. package/.next/standalone/packages/console/.next/static/chunks/2tj5-rkl0ps53.js +0 -1
  181. package/.next/standalone/packages/console/.next/static/chunks/3m5g2od7yc5cq.js +0 -1
  182. package/.next/standalone/packages/console/.next/static/chunks/3pbm8tp2tq5mv.css +0 -3
  183. /package/.next/standalone/packages/console/.next/static/{FhQ486AZAouB_wqS1YEzn → M3UCCsD3-uSl8HVucbFrh}/_buildManifest.js +0 -0
  184. /package/.next/standalone/packages/console/.next/static/{FhQ486AZAouB_wqS1YEzn → M3UCCsD3-uSl8HVucbFrh}/_clientMiddlewareManifest.js +0 -0
  185. /package/.next/standalone/packages/console/.next/static/{FhQ486AZAouB_wqS1YEzn → M3UCCsD3-uSl8HVucbFrh}/_ssgManifest.js +0 -0
@@ -0,0 +1,2 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,313260,e=>{"use strict";var t=e.i(843476),r=e.i(407921),a=e.i(618566),s=e.i(271645),i=e.i(341880),n=e.i(67874),l=e.i(817981),d=e.i(188393),o=e.i(806537),c=e.i(766390),u=e.i(975867);let h={argo:"You turn it on or off.",rules:"Applying rules turns it off; applying none turns it on again."};function p({rows:e,error:r,onRetry:a,isTurning:s,turnError:i,onViewerReadChange:n}){let m;return m=void 0!==r?(0,t.jsx)(l.InlineError,{title:"Couldn’t read the built-in rules",description:r,onRetry:a}):void 0===e?(0,t.jsx)(d.LoadingSkeleton,{variant:"list",rows:3,label:"Loading the built-in rules"}):(0,t.jsx)("ul",{className:"flex flex-col divide-y divide-border",children:e.map(e=>(0,t.jsxs)("li",{"data-testid":"network-built-in-rule",className:"flex items-start justify-between gap-3 py-2 first:pt-0 last:pb-0",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-body font-medium","data-testid":"network-built-in-rule-name",children:e.name}),(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:[e.meaning," ","never"===e.turnedBy?null:h[e.turnedBy]]})]}),"argo"===e.turnedBy?(0,t.jsx)(u.Switch,{checked:e.isOn,disabled:s,"aria-label":`${e.name}: ${e.isOn?"on":"off"}`,"data-testid":"network-built-in-viewer-read",onCheckedChange:e=>{n(e)}}):(0,t.jsx)(c.Badge,{variant:"outline","data-testid":"network-built-in-rule-state",children:"never"===e.turnedBy?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Lock,{"aria-hidden":!0}),"Never off"]}):e.isOn?"On":"Off"})]},e.key))}),(0,t.jsxs)("section",{"aria-labelledby":"network-built-in","data-testid":"network-built-in",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)("h2",{id:"network-built-in",className:"text-body font-semibold",children:"Built-in rules"}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"The fleet’s own rules, beside yours and the declared ones. They hold before any rule below."}),m,void 0===i?null:(0,t.jsx)(l.InlineError,{variant:"field",title:"Couldn’t turn the viewer reading",description:i})]})}var m=e.i(768877),x=e.i(422768),f=e.i(937338),g=e.i(695960);let y=[{side:"from",label:"From ships with"},{side:"to",label:"To ships with"}];function b({declared:e,error:r,onRetry:a,context:s}){let i;return i=void 0!==r?(0,t.jsx)(l.InlineError,{title:"Couldn’t read the declared rules",description:r,onRetry:a}):void 0===e?(0,t.jsx)(d.LoadingSkeleton,{variant:"list",rows:2,label:"Loading the declared rules"}):0===e.length?(0,t.jsx)(n.EmptyState,{variant:"section",title:"Nothing declares rules."}):(0,t.jsx)("ul",{className:"flex flex-col gap-3",children:e.map(e=>(0,t.jsxs)("li",{"data-testid":"network-declared-plugin",className:"flex flex-col gap-2",children:[(0,t.jsxs)("h3",{className:"text-meta font-medium","data-testid":"network-declared-by",children:["Declared by ",e.declaredBy]}),(0,t.jsx)("ul",{className:"flex flex-col gap-2",children:e.rules.map(e=>(0,t.jsx)("li",{"data-testid":"network-declared-rule",className:"flex flex-col gap-2 rounded-md border border-border p-3 sm:flex-row sm:items-start sm:gap-3",children:y.map(({side:r,label:a})=>(0,t.jsxs)("div",{className:"flex min-w-0 grow basis-0 items-start gap-3",children:["to"===r?(0,t.jsx)("span",{className:"mt-6 shrink-0 text-meta text-muted-foreground","data-testid":"network-declared-rule-verb",children:f.VERB_WORDS[e.verb]}):null,"to"===r?(0,t.jsx)(m.ArrowRight,{"aria-hidden":!0,className:"mt-6 hidden size-(--size-icon) shrink-0 text-muted-foreground sm:block"}):null,(0,t.jsx)(v,{label:a,terms:e[r],context:s,testId:`network-declared-rule-${r}`})]},r))},JSON.stringify(e)))})]},e.declarerId))}),(0,t.jsxs)("section",{"aria-labelledby":"network-declared","data-testid":"network-declared",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)("h2",{id:"network-declared",className:"text-body font-semibold",children:"Declared by plugins and the installation"}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Rules plugins and the installation need on the labels they own. The networking plugin adds them to your rules; while every ship may message every ship, they change nothing. Only their declarer changes them, and switching a plugin off withdraws its rules."}),i]})}function v({label:e,terms:r,context:a,testId:i}){let{chips:n,unknown:l}=(0,f.selectorOf)(r,a);return(0,t.jsxs)("div",{className:"flex flex-col gap-1","data-testid":i,children:[(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:e}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[n.length+l.length===0?(0,t.jsx)("span",{className:"text-body",children:"Every ship"}):null,n.map((e,r)=>(0,t.jsxs)(s.Fragment,{children:[0===r?null:(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"and"}),(0,t.jsx)(g.LabelChip,{chip:e,testId:`${i}-value`,..."string"==typeof e.term?{}:{meaning:f.TERM_MEANINGS[e.term.value]}})]},(0,f.termKeyOf)(e.term))),l.map(e=>(0,t.jsxs)("span",{"data-testid":`${i}-unknown`,title:`${(0,f.termKeyOf)(e)}: no longer in this fleet`,className:"inline-flex h-5.5 items-center gap-1 rounded-sm border border-tone-attention-border bg-tone-attention-bg px-1.5 text-id text-tone-attention-fg [&_svg]:size-3",children:[(0,t.jsx)(x.CircleAlert,{"aria-hidden":!0}),"A removed label"]},(0,f.termKeyOf)(e)))]})]})}var w=e.i(847211),j=e.i(689664),k=e.i(456420);let N={name:"crosshair",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]};N.node;let C=(0,k.default)(N);var R=e.i(566595),S=e.i(574296),O=e.i(965324);function $(e){return e.send.map(e=>e.shipId)}let I=-Math.PI/2,T=2*Math.PI;function E(e){return e.filter(e=>"retired"!==e.status&&"viewer"!==e.kind).map(e=>({id:e.id,name:e.name,isOperator:"operator"===e.kind})).sort((e,t)=>Number(t.isOperator)-Number(e.isOperator)||e.name.localeCompare(t.name))}function A(e){return Math.round(100*e)/100}var B=e.i(133173),L=e.i(60592),P=e.i(165160);let D=["applied","draft"],M={picked:"picked",reached:"may be messaged",unreached:"out of reach"};function V({ships:e,search:r,sailingShipCount:a,pickedShipId:s,reachableShipIds:i,reachError:n,onPick:d,onRetry:o,against:c="applied",onAgainstChange:u}){var h;let p=(h=void 0===s?void 0:{pickedShipId:s,reachableShipIds:void 0===n?i:void 0},e.map((t,r)=>{var a,s;let i=I+T*r/e.length,n=1===e.length;return{ship:t,x:n?50:A(50+38*Math.cos(i)),y:n?50:A(50+38*Math.sin(i)),mark:(a=t.id,void 0===(s=h)?"none":a===s.pickedShipId?"picked":void 0===s.reachableShipIds?"none":s.reachableShipIds.includes(a)?"reached":"unreached")}})),m=p.find(e=>"picked"===e.mark),x=p.filter(e=>"reached"===e.mark);return(0,t.jsxs)("section",{"aria-labelledby":"network-reach","data-testid":"network-reach",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)("h2",{id:"network-reach",className:"text-body font-semibold",children:"Reach"}),(0,t.jsxs)("p",{className:"text-meta text-muted-foreground",children:["draft"===c?"The fleet as the draft would leave it once applied: pick a ship to see which ships the draft lets it message.":"The fleet as it stands now: pick a ship to see which ships the rules let it message."," ","Argo reaches every ship, and every ship reaches argo."]}),void 0===u?null:(0,t.jsx)(L.Tabs,{value:c,onValueChange:e=>{let t=D.find(t=>t===e);void 0!==t&&u(t)},children:(0,t.jsxs)(L.TabsList,{"aria-label":"Explain reach against",children:[(0,t.jsx)(L.TabsTrigger,{value:"applied","data-testid":"network-reach-applied",children:"Applied rules"}),(0,t.jsx)(L.TabsTrigger,{value:"draft","data-testid":"network-reach-draft",children:"Draft"})]})}),void 0===r?null:(0,t.jsx)(B.Combobox,{options:r.ships.map(e=>({value:e.id,label:e.name})),value:null,onValueChange:e=>{let t=r.ships.find(t=>t.id===e);void 0!==t&&d(t.id)},toQuery:P.asHandle,onQueryChange:r.onQueryChange,groupLabel:"Ships",emptyText:e=>`No ship matches "${e}". Retired ships are not listed.`,leadingIcon:(0,t.jsx)(R.Search,{}),placeholder:"Find a ship to pick","aria-label":"Find a ship to pick","data-testid":"network-reach-search"}),(0,t.jsxs)("div",{className:"relative flex flex-wrap gap-2 md:mx-auto md:block md:aspect-square md:w-full md:max-w-xl","data-testid":"network-reach-graph",children:[void 0===m?null:(0,t.jsx)("svg",{"aria-hidden":!0,viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"pointer-events-none absolute inset-0 hidden size-full md:block",children:x.map(e=>(0,t.jsx)("line",{x1:m.x,y1:m.y,x2:e.x,y2:e.y,vectorEffect:"non-scaling-stroke",className:"stroke-muted-foreground",strokeWidth:1.5},e.ship.id))}),p.map(e=>(0,t.jsx)(F,{node:e,onPick:()=>{d("picked"===e.mark?void 0:e.ship.id)}},e.ship.id))]}),void 0===n?(0,t.jsx)("p",{className:"text-body",role:"status","data-testid":"network-reach-summary",children:function(e,t=e.length){let r=e.find(e=>"picked"===e.mark);if(void 0===r)return"Pick a ship to see which ships it may message.";let a=Math.max(t,e.length)-1,s=e.filter(e=>"reached"===e.mark).map(e=>e.ship.name);return e.every(e=>"picked"===e.mark||"none"===e.mark)?0===a?`${r.ship.name} is the only ship of the fleet.`:`Finding the ships ${r.ship.name} may message…`:s.length===a?`${r.ship.name} may message every other ship (${String(a)}).`:0===s.length?`${r.ship.name} may message no other ship.`:`${r.ship.name} may message ${String(s.length)} of ${String(a)} ships: ${s.join(", ")}.`}(p,a)}):(0,t.jsx)(l.InlineError,{title:"Couldn’t explain this ship’s reach",description:n,onRetry:o})]})}function F({node:e,onPick:r}){let{ship:a,mark:s}=e;return(0,t.jsx)(S.Button,{size:"sm",variant:"secondary","aria-pressed":"picked"===s,"aria-label":"none"===s?a.name:`${a.name}, ${M[s]}`,icon:function(e){switch(e){case"picked":return(0,t.jsx)(C,{"aria-hidden":!0});case"reached":return(0,t.jsx)(j.Check,{"aria-hidden":!0});case"unreached":return(0,t.jsx)(w.Ban,{"aria-hidden":!0});case"none":return}}(s),"data-testid":"network-reach-ship","data-mark":s,style:{left:`${String(e.x)}%`,top:`${String(e.y)}%`},className:(0,O.classNames)("md:absolute md:-translate-x-1/2 md:-translate-y-1/2","picked"===s&&"bg-accent ring-2 ring-ring","unreached"===s&&"opacity-45"),onClick:r,children:a.name})}var z=e.i(424010),K=e.i(746675);let Q={apply:{title:"Apply the draft?",description:"Every send, read and manage is checked against the draft from now on, and the rules before it are gone.",action:"Apply draft"},discard:{title:"Discard the draft?",description:"The draft is gone; the applied rules stay as they are.",action:"Discard draft"}};function _({draft:e,appliedVersion:r,isApplying:a,applyError:i,onApply:n,isDiscarding:d,discardError:o,onDiscard:c}){let[u,h]=(0,s.useState)(null),p=a||d;return(0,t.jsxs)("section",{"aria-labelledby":"network-rules-apply","data-testid":"network-rules-apply",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)("h2",{id:"network-rules-apply",className:"text-body font-semibold",children:"Apply"}),null===e?(0,t.jsx)("p",{className:"text-meta text-muted-foreground","data-testid":"network-rules-apply-state",children:"No draft: the applied rules are the ones above. Save a draft to apply it."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"text-body","data-testid":"network-rules-apply-state",children:["A draft is saved. Every send, read and manage is checked against the applied rules, at version ",r,", until it is applied."]}),e.savedAgainstVersion===r?null:(0,t.jsxs)("p",{className:"text-meta text-muted-foreground","data-testid":"network-rules-apply-moved",children:["The settings moved from version ",e.savedAgainstVersion," since the draft was saved."]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(S.Button,{variant:"primary",isLoading:a,disabled:d,"data-testid":"network-rules-apply-open",onClick:()=>{h("apply")},children:"Apply draft"}),(0,t.jsx)(S.Button,{variant:"ghost",isLoading:d,disabled:a,"data-testid":"network-rules-discard-open",onClick:()=>{h("discard")},children:"Discard draft"})]})]}),void 0===i?null:(0,t.jsx)(l.InlineError,{variant:"field",title:"Couldn’t apply the draft",description:i}),void 0===o?null:(0,t.jsx)(l.InlineError,{variant:"field",title:"Couldn’t discard the draft",description:o}),(0,t.jsx)(z.AlertDialog,{open:null!==u,onOpenChange:e=>{e||p||h(null)},children:null===u?null:(0,t.jsxs)(z.AlertDialogContent,{"data-testid":`network-rules-${u}-dialog`,className:K.dialogSurface.phoneSheet,children:[(0,t.jsxs)(z.AlertDialogHeader,{children:[(0,t.jsx)(z.AlertDialogTitle,{children:Q[u].title}),(0,t.jsx)(z.AlertDialogDescription,{children:Q[u].description})]}),(0,t.jsxs)(z.AlertDialogFooter,{children:[(0,t.jsx)(z.AlertDialogClose,{render:(0,t.jsx)(S.Button,{disabled:p}),children:"Cancel"}),(0,t.jsx)(S.Button,{variant:"apply"===u?"primary":"destructive",isLoading:p,"data-testid":`network-rules-${u}-confirm`,onClick:()=>{h(null),"apply"===u?n():c()},children:Q[u].action})]})]})})]})}var q=e.i(711514);let U={argo:"argo",owner:"Owner",answer:"Answer",pluginRead:"Connected plugins read",meeting:"Meeting",viewerRead:"Viewer reads",installation:"Installation manages",open:"Open"};function W(e){switch(e.rule){case"argo":return{key:e.rule,name:U[e.rule],meaning:"argo sends to, reads and manages every ship, and every ship reaches argo.",isOn:e.isOn,turnedBy:"never"};case"owner":return{key:e.rule,name:U[e.rule],meaning:"A ship’s owner sends to, reads and manages the ships it owns.",isOn:e.isOn,turnedBy:"never"};case"answer":return{key:e.rule,name:U[e.rule],meaning:"A ship may always answer the sender of a message it received.",isOn:e.isOn,turnedBy:"never"};case"pluginRead":return{key:e.rule,name:U[e.rule],meaning:"A plugin argo connected reads every ship, whatever the rules.",isOn:e.isOn,turnedBy:"never"};case"meeting":return{key:e.rule,name:U[e.rule],meaning:"The participants of a meeting reach each other in it, whatever the rules: its owner reached each when it joined.",isOn:e.isOn,turnedBy:"never"};case"viewerRead":return{key:e.rule,name:U[e.rule],meaning:"The viewer reads every ship.",isOn:e.isOn,turnedBy:"argo"};case"installation":return{key:e.rule,name:U[e.rule],meaning:"The installation manages person ships and the ships they own, so a leaver is always released.",isOn:e.isOn,turnedBy:"never"};case"open":return{key:e.rule,name:U[e.rule],meaning:"Every ship may send to, read and manage every ship.",isOn:e.isOn,turnedBy:"rules"}}}function G({changes:e,error:r,onRetry:a}){let s;return s=void 0!==r?(0,t.jsx)(l.InlineError,{title:"Couldn’t read what the draft changes",description:r,onRetry:a}):void 0===e?(0,t.jsx)(d.LoadingSkeleton,{variant:"detail",rows:3,label:"Loading what the draft changes"}):e.every(({gained:e,lost:t})=>0===e.length&&0===t.length)?(0,t.jsx)("p",{className:"text-meta text-muted-foreground","data-testid":"network-draft-changes-none",children:"The draft changes no reach."}):e.filter(({gained:e,lost:t})=>e.length+t.length>0).map(({verb:e,gained:r,lost:a})=>(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"network-draft-changes-verb",children:[(0,t.jsx)("h3",{className:"text-meta font-semibold",children:f.VERB_WORDS[e]}),(0,t.jsx)(H,{title:"Gains",rows:r,testId:"network-draft-gained"}),(0,t.jsx)(H,{title:"Loses",rows:a,testId:"network-draft-lost"})]},e)),(0,t.jsxs)("section",{"aria-labelledby":"network-draft-changes","data-testid":"network-draft-changes",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)("h2",{id:"network-draft-changes",className:"text-body font-semibold",children:"What the draft changes"}),s]})}function H({title:e,rows:r,testId:a}){return 0===r.length?null:(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("p",{className:"text-meta text-muted-foreground",children:[e," ",r.length," ",1===r.length?"pair":"pairs"]}),(0,t.jsx)("ul",{className:"flex flex-col gap-1",children:r.map(e=>(0,t.jsxs)("li",{"data-testid":a,className:"flex flex-wrap items-center gap-x-2 text-body",children:[(0,t.jsx)("span",{children:e.from}),(0,t.jsx)(m.ArrowRight,{"aria-label":"to",className:"size-4 text-muted-foreground"}),(0,t.jsx)("span",{children:e.to}),(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:e.rule})]},e.key))})]})}var J=e.i(77071),X=e.i(759659),Y=e.i(280581),Z=e.i(946033),ee=e.i(765649),et=e.i(263676),er=e.i(770703),ea=e.i(522016),es=e.i(406734);let ei=(0,er.default)(()=>e.A(867858).then(e=>e.LabelPicker),{loadableGenerated:{modules:[259068]},ssr:!1});function en({label:e,picked:r,owners:a,ownerChoices:i,unknown:n,groups:l,max:d,isDisabled:o,problem:c,onAdd:u,onRemove:h,testId:p,popoverTestId:m}){let[y,b]=(0,s.useState)(!1),[v,w]=(0,s.useState)(!1),j=r.length+a.length+n.length,k=new Set(a.map(e=>(0,f.termKeyOf)(e.term))),N=[...["*","#"].map(e=>({term:{owner:e},text:f.OWNER_TERM_MEANINGS[e]})),...i.map(e=>({term:{owner:e.shipId},text:e.name}))];return(0,t.jsxs)("div",{className:"flex flex-col gap-1","data-testid":p,children:[(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:e}),(0,t.jsxs)("div",{className:"flex min-h-(--size-control-sm) flex-wrap items-center gap-1.5",children:[0===j?(0,t.jsx)("span",{className:"text-body",children:"Every ship"}):null,r.map((e,r)=>(0,t.jsxs)(s.Fragment,{children:[0===r?null:(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"and"}),(0,t.jsx)(g.LabelChip,{chip:e,testId:`${p}-value`,..."string"==typeof e.term?{}:{meaning:f.TERM_MEANINGS[e.term.value]},...o?{}:{onRemove:()=>{h(e.term)}}})]},(0,f.termKeyOf)(e.term))),a.map((e,a)=>(0,t.jsxs)(s.Fragment,{children:[0===a&&0===r.length?null:(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"and"}),(0,t.jsx)(el,{owner:e,testId:`${p}-owner`,...!0===o?{}:{onRemove:()=>{h(e.term)}}})]},(0,f.termKeyOf)(e.term))),n.map(e=>(0,t.jsxs)("span",{"data-testid":`${p}-unknown`,title:`${(0,f.termKeyOf)(e)}: no longer in this fleet`,className:"inline-flex h-5.5 items-center gap-1 rounded-sm border border-tone-attention-border bg-tone-attention-bg px-1.5 text-id text-tone-attention-fg [&_svg]:size-3",children:[(0,t.jsx)(x.CircleAlert,{"aria-hidden":!0}),"string"!=typeof e&&"owner"in e?"A removed owner":"A removed label",!0===o?null:(0,t.jsx)("button",{type:"button","aria-label":"string"!=typeof e&&"owner"in e?"Remove the removed owner":"Remove the removed label",onClick:()=>{h(e)},className:"-mr-1 ml-0.5 inline-flex size-4 items-center justify-center rounded-xs hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring",children:(0,t.jsx)(et.X,{"aria-hidden":!0})})]},(0,f.termKeyOf)(e))),j>=d?null:(0,t.jsxs)(es.Popover,{open:y,onOpenChange:b,children:[(0,t.jsx)(es.PopoverTrigger,{render:(0,t.jsx)(S.Button,{type:"button",variant:"ghost",size:"xs",icon:(0,t.jsx)(J.Plus,{}),disabled:o,"data-testid":`${p}-add`}),children:"Add label"}),(0,t.jsxs)(es.PopoverContent,{align:"start",sideOffset:6,className:"w-80 p-2","data-testid":m,children:[(0,t.jsx)("span",{className:"block px-2 pt-1 pb-2 text-body font-medium",children:e}),(0,t.jsx)(ei,{groups:l,pickedValueIds:r.flatMap(e=>"string"==typeof e.term?[e.term]:[]),onPick:e=>{b(!1),u(e)},terms:{picked:r.flatMap(e=>"string"==typeof e.term?[]:[e.term]),onPick:e=>{b(!1),u(e)}}}),(0,t.jsxs)("p",{className:"mt-2 flex items-center justify-between gap-2 border-t border-border px-2 pt-2 text-meta text-muted-foreground",children:["All must hold. * is any value, # the same as the other side.",(0,t.jsx)(ea.default,{href:"/labels",className:"font-medium text-foreground hover:underline",children:"Manage labels"})]})]})]}),j>=d?null:(0,t.jsxs)(es.Popover,{open:v,onOpenChange:w,children:[(0,t.jsx)(es.PopoverTrigger,{render:(0,t.jsx)(S.Button,{type:"button",variant:"ghost",size:"xs",icon:(0,t.jsx)(J.Plus,{}),disabled:o,"data-testid":`${p}-owner-add`}),children:"Add owner"}),(0,t.jsxs)(es.PopoverContent,{align:"start",sideOffset:6,className:"w-72 p-2","data-testid":`${m}-owner`,children:[(0,t.jsxs)("span",{className:"block px-2 pt-1 pb-2 text-body font-medium",children:[e," the owner"]}),(0,t.jsx)("ul",{className:"flex flex-col",children:N.map(e=>(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",disabled:k.has((0,f.termKeyOf)(e.term)),"data-testid":`${p}-owner-option`,onClick:()=>{w(!1),u(e.term)},className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-body hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring disabled:text-muted-foreground disabled:hover:bg-transparent",children:[(0,t.jsx)(ee.UserRound,{"aria-hidden":!0,className:"size-(--size-icon) shrink-0 text-muted-foreground"}),e.text]})},(0,f.termKeyOf)(e.term)))}),(0,t.jsx)("p",{className:"mt-2 border-t border-border px-2 pt-2 text-meta text-muted-foreground",children:"An owner is argo or a person’s ship. # is the same owner as the other side."})]})]})]}),void 0===c?null:(0,t.jsx)("p",{role:"status",className:"text-meta text-tone-attention-fg","data-testid":`${p}-problem`,children:c}),0===n.length?null:(0,t.jsx)("p",{role:"alert",className:"text-meta text-tone-attention-fg",children:"A label or owner here was removed from the fleet: this side matches no ship until you remove it."})]})}function el({owner:e,onRemove:r,testId:a}){let{owner:s}=e.term,i="*"===s||"#"===s?`${e.text}. ${f.OWNER_TERM_MEANINGS[s]}`:`${e.text}: ships it owns`;return(0,t.jsxs)("span",{role:"group","aria-label":i,title:i,"data-testid":a,className:"inline-flex h-5.5 max-w-full min-w-0 shrink-0 items-center gap-1 rounded-sm border border-border bg-secondary px-1.5 font-mono text-id whitespace-nowrap text-foreground [&_svg]:size-3 [&_svg]:shrink-0 [&_svg]:text-muted-foreground",children:[(0,t.jsx)(ee.UserRound,{"aria-hidden":!0}),(0,t.jsxs)("span",{className:"truncate",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"owner="}),(0,t.jsx)("span",{className:"font-medium",children:e.text.slice(6)})]}),void 0===r?null:(0,t.jsx)("button",{type:"button","aria-label":`Remove ${e.text}`,onClick:r,className:"-mr-1 ml-0.5 inline-flex size-4 items-center justify-center rounded-xs text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",children:(0,t.jsx)(et.X,{"aria-hidden":!0})})]})}let ed=[{side:"from",label:"From ships with"},{side:"to",label:"To ships with"}],eo=()=>crypto.randomUUID();function ec({rules:e,context:r,limits:a,isSaving:i,saveError:n,savedNote:d,onSave:o}){let[c,u]=(0,s.useState)(()=>(0,f.draftOf)(e,eo)),h=(0,Y.filterGroupsOf)(r),p=(0,f.ownerChoicesOf)(r),x=(0,f.isChanged)(c,e);return(0,t.jsxs)("section",{"aria-labelledby":"network-rules","data-testid":"network-rules",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)("h2",{id:"network-rules",className:"text-body font-semibold",children:"Rules"}),"all-to-all"===c.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-body","data-testid":"network-rules-state",children:"No rules: every ship may send to, read and manage every ship."}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"With rules, a ship may send to, read or manage another only when a rule of that verb or a built-in rule allows it."}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(S.Button,{variant:x?"secondary":"primary",icon:(0,t.jsx)(J.Plus,{"aria-hidden":!0}),disabled:i,"data-testid":"network-rules-on",onClick:()=>{u((0,f.setRulesOn)(c,!0))},children:"Set rules"}),x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(S.Button,{variant:"primary",isLoading:i,"data-testid":"network-rules-save",onClick:()=>{o(null)},children:"Save draft"}),(0,t.jsx)(S.Button,{disabled:i,"data-testid":"network-rules-discard",onClick:()=>{u((0,f.draftOf)(e,eo))},children:"Discard changes"})]}):null]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-body","data-testid":"network-rules-state",children:0===c.rules.length?"No rule allows anything yet: once saved, only the built-in rules hold.":"A ship may send to, read or manage another only when a rule of that verb or a built-in rule allows it."}),0===c.rules.length?null:(0,t.jsx)("ul",{className:"flex flex-col gap-2",children:c.rules.map((e,s)=>(0,t.jsxs)("li",{"data-testid":"network-rule",className:"flex flex-col gap-2 rounded-md border border-border p-3 sm:flex-row sm:items-start sm:gap-3",children:[ed.map(({side:n,label:l})=>{let d,o=(0,f.selectorOf)(e[n],r);return(0,t.jsxs)("div",{className:"flex min-w-0 grow basis-0 items-start gap-3",children:["to"===n?(0,t.jsxs)("div",{className:"flex shrink-0 flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Verb"}),(0,t.jsxs)(Z.Select,{items:f.VERB_WORDS,value:e.verb,disabled:i,onValueChange:t=>{q.NETWORK_VERBS.some(e=>e===t)&&u((0,f.setVerb)(c,{rule:e.key,verb:t}))},children:[(0,t.jsx)(Z.SelectTrigger,{"aria-label":`Verb of rule ${String(s+1)}`,"data-testid":"network-rule-verb",size:"sm",children:(0,t.jsx)(Z.SelectValue,{})}),(0,t.jsx)(Z.SelectContent,{children:q.NETWORK_VERBS.map(e=>(0,t.jsx)(Z.SelectItem,{value:e,children:f.VERB_WORDS[e]},e))})]})]}):null,"to"===n?(0,t.jsx)(m.ArrowRight,{"aria-hidden":!0,className:"mt-6 hidden size-(--size-icon) shrink-0 text-muted-foreground sm:block"}):null,(0,t.jsx)(en,{label:l,picked:o.chips,owners:o.owners,ownerChoices:p,unknown:o.unknown,groups:h,max:a.selectorMax,isDisabled:i,...void 0===(d=(0,f.sameValueProblemOf)(e,{side:n,context:r}))?{}:{problem:d},testId:`network-rule-${n}`,popoverTestId:"network-rule-popover",onAdd:t=>{u((0,f.addTerm)(c,{rule:e.key,side:n,term:t,limits:a}))},onRemove:t=>{u((0,f.removeTerm)(c,{rule:e.key,side:n,term:t}))}})]},n)}),(0,t.jsx)(S.Button,{variant:"ghost",size:"xs",icon:(0,t.jsx)(X.Trash2,{"aria-hidden":!0}),disabled:i,"aria-label":`Remove rule ${String(s+1)}`,"data-testid":"network-rule-remove",onClick:()=>{u((0,f.removeRule)(c,e.key))}})]},e.key))}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c.rules.length>=a.rulesMax?null:(0,t.jsx)(S.Button,{size:"sm",icon:(0,t.jsx)(J.Plus,{"aria-hidden":!0}),disabled:i,"data-testid":"network-rules-add",onClick:()=>{u((0,f.addRule)(c,{newKey:eo,limits:a}))},children:"Add rule"}),(0,t.jsxs)("span",{className:"text-meta text-muted-foreground tabular-nums","data-testid":"network-rules-count",children:[c.rules.length," of ",a.rulesMax," rules"]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-t border-border pt-3",children:[(0,t.jsx)(S.Button,{variant:"primary",isLoading:i,disabled:!x||(0,f.hasSameValueOnOneSide)(c),"data-testid":"network-rules-save",onClick:()=>{o((0,f.rulesOf)(c))},children:"Save draft"}),x?(0,t.jsx)(S.Button,{disabled:i,"data-testid":"network-rules-discard",onClick:()=>{u((0,f.draftOf)(e,eo))},children:"Discard changes"}):null,(0,t.jsx)(S.Button,{variant:"ghost",className:"ml-auto",disabled:i,"data-testid":"network-rules-off",onClick:()=>{u((0,f.setRulesOn)(c,!1))},children:"Remove all rules"})]})]}),void 0===n?null:(0,t.jsx)(l.InlineError,{variant:"field",title:"Couldn’t save the rules",description:n}),void 0===d||x?null:(0,t.jsx)("p",{role:"status",className:"text-meta text-muted-foreground","data-testid":"network-rules-note",children:d})]})}var eu=e.i(285595);let eh={name:"file-up",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]};eh.node;let ep=(0,k.default)(eh);var em=e.i(791727),ex=e.i(443988),ef=e.i(330475);function eg(e){return"label"in e?`${e.label}=${e.value}`:`owner=${e.owner}`}function ey(e){return"ship"===e.kind?`ship:${e.name}`:`${e.kind}:${e.key}`}var eb=e.i(152678);function ev(e){switch(e.kind){case"definer":return`${e.key} is defined by ${e.fleetDefiner} here, by ${e.fileDefiner} in the file`;case"values":return`${e.key} has ${e.fleetValues.join(", ")} here; the file gives ${e.fileValues.join(", ")}`;case"ship":return`No active ship is named ${e.name}`}}function ew({difference:e,choice:r,ships:a,onShipQueryChange:s,isDisabled:i,onChange:n}){let l=ey(e),d=`network-import-difference-${l.replace(":","-")}`;return(0,t.jsxs)("fieldset",{className:"flex flex-col gap-2 rounded-lg border border-border bg-card p-3","data-testid":"network-import-difference",children:[(0,t.jsx)("legend",{className:"sr-only",children:ev(e)}),(0,t.jsx)("p",{className:"text-body font-medium","aria-hidden":!0,children:ev(e)}),(0,t.jsx)(eb.RadioGroup,{value:r?.way,disabled:i,onValueChange:t=>{n({difference:e,way:t})},children:e.ways.map(t=>({way:t,text:function(e,t){switch(e.kind){case"definer":return"useExisting"===t?`Use the label ${e.key} as it is, defined by ${e.fleetDefiner}`:`Drop the rules on ${e.key}`;case"values":return"useExisting"===t?`Use the label ${e.key} as it is: it has every value the rules name`:`Drop the rules naming ${e.missingValues.map(t=>`${e.key}=${t}`).join(", ")}`;case"ship":return"pickShip"===t?`Pick an active ship for ${e.name}`:`Drop the rules naming owner=${e.name}`}}(e,t)})).map(({way:e,text:r})=>(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(eb.RadioGroupItem,{id:`${d}-${e}`,value:e,className:"mt-0.5","data-testid":`network-import-way-${e}`}),(0,t.jsx)("label",{htmlFor:`${d}-${e}`,className:"min-w-0 grow cursor-pointer text-body",children:r})]},e))}),r?.way==="pickShip"?(0,t.jsx)(B.Combobox,{options:a.map(e=>({value:e.id,label:e.name})),value:r.shipId??null,onValueChange:t=>{let r=a.find(e=>e.id===t);n({difference:e,way:"pickShip",...void 0===r?{}:{shipId:r.id}})},onQueryChange:s,groupLabel:"Active ships",placeholder:"Type a ship name","aria-label":`The ship for ${"ship"===e.kind?e.name:""}`,"data-testid":"network-import-pick-ship"}):null]})}let ej=["Attach or paste","Check","Overview","Import"];function ek({current:e}){return(0,t.jsx)("ol",{className:"flex flex-wrap gap-x-3 gap-y-1 text-meta","aria-label":"Import steps","data-testid":"network-import-steps",children:ej.map((r,a)=>(0,t.jsxs)("li",{"aria-current":a===e?"step":void 0,className:a===e?"font-semibold text-foreground":"text-muted-foreground",children:[a+1,". ",r]},r))})}function eN(e){let{checked:r,isChecking:a,checkError:i,onCheck:n,onFileChange:d,ships:o,onShipQueryChange:c,isImporting:u,importError:h,onImport:p}=e,[m,x]=(0,s.useState)(""),[f,g]=(0,s.useState)([]),y=o.find(e=>e.isOperator),[b,v]=(0,s.useState)(y?.id),[w,j]=(0,s.useState)(!1),k=a||u,N=e=>{x(e),g([]),j(!1),d()};if(void 0===r)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ek,{current:+!!a}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(em.Label,{htmlFor:"network-import-attach",children:"Attach the file"}),(0,t.jsx)("input",{id:"network-import-attach",type:"file",accept:"application/json,.json",disabled:k,"data-testid":"network-import-attach",className:"text-body file:mr-3 file:rounded-md file:border file:border-border file:bg-card file:px-3 file:py-1.5",onChange:e=>{let t=e.target.files?.[0];void 0!==t&&t.text().then(N)}})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(em.Label,{htmlFor:"network-import-paste",children:"Or paste it"}),(0,t.jsx)(ex.Textarea,{id:"network-import-paste",isMono:!0,rows:8,value:m,disabled:k,placeholder:'{ "format": "aeolus.network-rules", ... }',"data-testid":"network-import-paste",onChange:e=>{N(e.target.value)}})]}),void 0===i?null:(0,t.jsx)(l.InlineError,{title:"The file doesn’t check",description:`${i}. Nothing changed: fix the file and check it again.`}),(0,t.jsxs)(ef.DialogFooter,{children:[(0,t.jsx)(ef.DialogClose,{render:(0,t.jsx)(S.Button,{type:"button",disabled:k}),children:"Cancel"}),(0,t.jsx)(S.Button,{variant:"primary",isLoading:a,disabled:""===m.trim()||k,"data-testid":"network-import-check",onClick:()=>{n(m)},children:a?"Checking…":"Check file"})]})]});let{file:C,newLabels:R,differences:O}=r,$=C.rules??[],I=O.every(e=>{let t=f.find(t=>ey(t.difference)===ey(e));return void 0!==t&&("pickShip"!==t.way||void 0!==t.shipId)}),T=o.find(e=>e.id===b),E=I&&(0===R.length||void 0!==T)&&!k,A=f.flatMap(e=>(function(e){let{difference:t,way:r}=e;return"ship"===t.kind?"pickShip"===r?void 0===e.shipId?void 0:{kind:"ship",name:t.name,way:r,shipId:e.shipId}:{kind:"ship",name:t.name,way:"dropRules"}:{kind:t.kind,key:t.key,way:"useExisting"===r?"useExisting":"dropRules"}})(e)??[]);return w?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ek,{current:3}),(0,t.jsx)(ef.DialogHeader,{children:(0,t.jsx)(ef.DialogTitle,{children:"Import into the draft?"})}),(0,t.jsxs)("ul",{className:"flex list-disc flex-col gap-1 pl-5 text-body","data-testid":"network-import-consequences",children:[(0,t.jsx)("li",{children:null===C.rules?"The draft becomes all-to-all, every ship reaching every ship.":f.some(e=>"dropRules"===e.way)?`The draft is replaced by the file’s ${String($.length)} rules, less the ones you chose to drop.`:`The draft is replaced by the file’s ${String($.length)} rules.`}),0===R.length?null:(0,t.jsxs)("li",{children:[R.join(", ")," ",1===R.length?"is":"are"," defined for ",T?.name??"argo","."]}),(0,t.jsx)("li",{children:"Nothing is in force until you apply the draft."})]}),void 0===h?null:(0,t.jsx)(l.InlineError,{variant:"section",title:"Couldn’t import the file",description:`${h}. Nothing was written.`,onRetry:()=>{j(!1),n(m)}}),(0,t.jsxs)(ef.DialogFooter,{children:[(0,t.jsx)(S.Button,{type:"button",disabled:k,onClick:()=>{j(!1)},children:"Back"}),(0,t.jsx)(S.Button,{variant:"primary",isLoading:u,disabled:k,"data-testid":"network-import-confirm",onClick:()=>{p({file:m,resolutions:A,...0===R.length||void 0===T||T.isOperator?{}:{definerShipId:T.id}})},children:u?"Importing…":"Import into the draft"})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ek,{current:2}),(0,t.jsxs)("p",{className:"flex items-start gap-2 text-body",role:"status","data-testid":"network-import-checked",children:[(0,t.jsx)(eu.CircleCheck,{"aria-hidden":!0,className:"mt-0.5 size-(--size-icon-sm) shrink-0 text-tone-ok-fg"}),(0,t.jsxs)("span",{children:["The file checks: ",null===C.rules?"all-to-all, no rules":`${String($.length)} rules`," and ",C.labels.length," labels, from ",C.fleet.name," at rules version ",C.rulesVersion,", exported"," ",new Date(C.exportedAt).toLocaleString(),"."]})]}),0===O.length?null:(0,t.jsxs)("section",{"aria-labelledby":"network-import-differences",className:"flex flex-col gap-2","data-testid":"network-import-differences",children:[(0,t.jsx)("h3",{id:"network-import-differences",className:"text-body font-semibold",children:1===O.length?"1 difference to resolve":`${String(O.length)} differences to resolve`}),O.map(e=>{let r=ey(e);return(0,t.jsx)(ew,{difference:e,choice:f.find(e=>ey(e.difference)===r),ships:o,onShipQueryChange:c,isDisabled:k,onChange:e=>{g([...f.filter(e=>ey(e.difference)!==r),e])}},r)})]}),0===R.length?null:(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)(em.Label,{htmlFor:"network-import-definer",children:["Define ",R.join(", ")," for"]}),(0,t.jsx)(B.Combobox,{id:"network-import-definer",options:o.map(e=>({value:e.id,label:e.name})),value:b??null,onValueChange:e=>{v(o.find(t=>t.id===e)?.id)},onQueryChange:c,groupLabel:"Active ships",placeholder:"Type a ship name","data-testid":"network-import-definer"}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"argo never retires, so its labels never go. Another ship must be within your manage reach."})]}),(0,t.jsxs)("section",{"aria-labelledby":"network-import-rules",className:"flex flex-col gap-1.5",children:[(0,t.jsx)("h3",{id:"network-import-rules",className:"text-body font-semibold",children:"Rules in the file"}),0===$.length?(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:null===C.rules?"None: all-to-all.":"None: only the built-in and declared rules."}):(0,t.jsx)("ol",{className:"flex max-h-64 flex-col gap-1 overflow-y-auto font-mono text-code","data-testid":"network-import-rules",children:$.map((e,t)=>{let r,{verb:a,from:s,to:i}=(r=e=>0===e.length?["every ship"]:e.map(eg),{verb:e.verb,from:r(e.from),to:r(e.to)});return{place:t+1,line:`${a}: ${s.join(" ")} → ${i.join(" ")}`}}).map(({place:e,line:r})=>(0,t.jsx)("li",{children:r},e))})]}),(0,t.jsxs)(ef.DialogFooter,{className:"items-center",children:[(0,t.jsx)("span",{className:"mr-auto text-meta text-muted-foreground",children:I?null:"Resolve every difference to import."}),(0,t.jsx)(S.Button,{type:"button",disabled:k,onClick:()=>{N(m)},children:"Back"}),(0,t.jsx)(S.Button,{variant:"primary",disabled:!E,"data-testid":"network-import-open-confirm",onClick:()=>{j(!0)},children:"Import…"})]})]})}function eC(e){let{isOpen:r,onOpenChange:a,isChecking:s,isImporting:i}=e;return(0,t.jsx)(ef.Dialog,{open:r,onOpenChange:e=>{s||i||a(e)},children:(0,t.jsxs)(ef.DialogContent,{size:"md","data-testid":"network-import-dialog",className:K.dialogSurface.phoneFullScreen,children:[(0,t.jsxs)(ef.DialogHeader,{children:[(0,t.jsxs)(ef.DialogTitle,{children:[(0,t.jsx)(ep,{"aria-hidden":!0,className:"mr-2 inline size-(--size-icon-sm)"}),"Import network rules"]}),(0,t.jsx)(ef.DialogDescription,{children:"Rules exported from this fleet or another land in the draft; nothing is in force until you apply it."})]}),r?(0,t.jsx)(eN,{...e}):null]})})}let eR={name:"file-down",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]};eR.node;let eS=(0,k.default)(eR);function eO({isExporting:e,exportError:r,onExport:a,exported:s,canImport:i,onImport:n}){return(0,t.jsxs)("section",{"aria-labelledby":"network-rules-file","data-testid":"network-rules-file",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)("h2",{id:"network-rules-file",className:"text-body font-semibold",children:"Export and import"}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Export writes the applied rules and the labels they use as one file, by name. Import brings a file from this fleet or another into the draft."}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(S.Button,{icon:(0,t.jsx)(eS,{}),isLoading:e,"data-testid":"network-rules-export",onClick:a,children:e?"Exporting…":"Export"}),i?(0,t.jsx)(S.Button,{icon:(0,t.jsx)(ep,{}),disabled:e,"data-testid":"network-rules-import",onClick:n,children:"Import…"}):null]}),void 0===s||0===s.leftOut.length?null:(0,t.jsxs)("div",{role:"status","data-testid":"network-rules-left-out",className:"flex flex-col gap-1 rounded-lg border border-tone-waiting-border bg-tone-waiting-bg px-3.5 py-2.5 text-meta text-tone-waiting-fg",children:[(0,t.jsxs)("p",{children:[s.name," leaves out ",1===s.leftOut.length?"1 applied rule":`${String(s.leftOut.length)} applied rules`,", as each matches no ship:"]}),(0,t.jsx)("ul",{className:"list-disc pl-5",children:s.leftOut.map(({rule:e,reason:r})=>(0,t.jsxs)("li",{children:["rule ",e," ",r]},e))})]}),void 0===r?null:(0,t.jsx)(l.InlineError,{variant:"field",title:"Couldn’t export the rules",description:`${r}. Nothing was downloaded.`})]})}function e$(e){switch(e.kind){case"ship":return e.name;case"account":return`Account ${e.accountId}`;case"installation":return"The installation"}}var eI=e.i(849635);function eT({refusals:e,error:r,onRetry:a,more:s,context:i,now:o}){let c;return c=void 0!==r?(0,t.jsx)(l.InlineError,{title:"Couldn’t read the refusals",description:r,onRetry:a}):void 0===e?(0,t.jsx)(d.LoadingSkeleton,{variant:"list",rows:3,label:"Loading the refusals"}):0!==e.length||s?(0,t.jsx)("ol",{className:"flex flex-col gap-2","data-testid":"network-refusals-list",children:e.map(e=>(0,t.jsx)(eE,{refusal:e,context:i,now:o},e.id))}):(0,t.jsx)(n.EmptyState,{variant:"section",title:"No send has been refused."}),(0,t.jsxs)("section",{"aria-labelledby":"network-refusals","data-testid":"network-refusals",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)("h2",{id:"network-refusals",className:"text-body font-semibold",children:"Refusals"}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"The sends the rules refused, newest first, with both ships’ labels as they were then. The sender was told only that its send was refused."}),c,s]})}function eE({refusal:e,context:r,now:a}){let s=new Date(e.at),{recipient:i}=e,n="ship"===i.kind?[i.ship]:i.ships;return(0,t.jsxs)("li",{"data-testid":"network-refusal",className:"flex flex-col gap-2 rounded-md border border-border px-3 py-2.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-x-3 gap-y-0.5",children:[(0,t.jsx)("p",{className:"text-body font-medium",children:function(e){let{sender:t,recipient:r}=e,a=`${e$(t)} tried to ${"ship"===t.kind?"message":"reach"}`;switch(r.kind){case"ship":return`${a} ${r.ship.name}.`;case"type":return`${a} the type ${r.type}: ${(0,Y.listed)(r.ships.map(e=>e.name))}.`}}(e)}),(0,t.jsx)("time",{dateTime:e.at,title:(0,eI.fullDateTime)(s),className:"text-meta text-muted-foreground tabular-nums",children:(0,eI.relativeTime)(s,a)})]}),(0,t.jsxs)("dl",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(eA,{side:"From",ship:{name:e$(e.sender),labels:"installation"===e.sender.kind?[]:e.sender.labels},context:r}),n.map(e=>(0,t.jsx)(eA,{side:"To",ship:e,context:r},e.id))]}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:`Refused by network settings version ${String(e.settingsVersion)}.`})]})}function eA({side:e,ship:r,context:a}){let s=(0,Y.chipsOf)(r,a);return(0,t.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[(0,t.jsxs)("dt",{className:"text-meta text-muted-foreground",children:[e," ",(0,t.jsx)("span",{className:"font-medium text-foreground",children:r.name})]}),(0,t.jsx)("dd",{className:"flex min-w-0 flex-wrap items-center gap-1",children:0===s.length?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"No labels"}):s.map(e=>(0,t.jsx)(g.LabelChip,{chip:e,testId:"network-refusal-label"},e.valueId))})]})}var eB=e.i(509892),eL=e.i(787964),eP=e.i(490262),eD=e.i(34512),eM=e.i(905387),eV=e.i(970597),eF=e.i(419413),ez=e.i(266027),eK=e.i(427702),eQ=e.i(442111),e_=e.i(487483),eq=e.i(718423),eU=e.i(928459),eW=e.i(954616),eG=e.i(912598);function eH(){let e=(0,eK.useTRPC)(),t=(0,eG.useQueryClient)();return async()=>{await Promise.all([t.invalidateQueries({queryKey:e.fleet.networkRules.queryKey()}),t.invalidateQueries({queryKey:e.fleet.networkRulesDraftChanges.queryKey()}),t.invalidateQueries({queryKey:e.fleet.explainReach.pathKey()})])}}var eJ=e.i(296676),eX=e.i(619273);function eY(e,t="applied"){let r=new URLSearchParams([...void 0===e?[]:[["reach",e]],..."draft"===t?[["against","draft"]]:[]]).toString();return""===r?"/network":`/network?${r}`}var eZ=e.i(621482),e0=e.i(731877),e2=e.i(298421),e1=e.i(678485);e.s(["NetworkPageFor",0,function({pickedShipId:e,against:o}){var c,u,h,m;let x,f,g,y,v,w,j,k,N,C,R,S,O,I,T,A,B,L,P,D,M,F,z,K,Q,H,J=(0,a.useRouter)(),X=(0,eJ.useNow)(),Y=(0,eL.useConsoleFrame)(),Z=(0,eU.useNeedsAttention)(),ee=(0,eq.useLiveFleet)(),et=(0,eP.useAccess)(),er=et.canEditNetwork,ea=(f=(0,eK.useTRPC)(),(0,ez.useQuery)(f.fleet.networkRules.queryOptions(void 0,{enabled:er}))),es=void 0!==ea.data&&null!==ea.data.draft,ei=es?o:"applied",en=(c=er&&es,g=(0,eK.useTRPC)(),(0,ez.useQuery)(g.fleet.networkRulesDraftChanges.queryOptions(void 0,{enabled:c}))),el=(0,eM.useLabelContext)(),ed=(y=(0,eK.useTRPC)(),v=(0,ez.useQuery)(y.fleet.list.queryOptions({shipKind:["operator","person"],limit:eF.PAGE_SIZE_MAX},{enabled:er})),v.data?.items.filter(eV.isInReadReach)),eo=(u=er?e:void 0,w=(0,eK.useTRPC)(),(0,ez.useQuery)({...w.fleet.explainReach.queryOptions(void 0===u?eX.skipToken:{fromShipId:u,against:ei}),select:$})),eu=(j=(0,eK.useTRPC)(),(0,e0.pagedListOf)((0,eZ.useInfiniteQuery)(j.fleet.reachRefusals.infiniteQueryOptions({limit:e0.CONSOLE_PAGE_SIZE},{enabled:er,getNextPageParam:e0.nextCursorOf})))),eh=(k=(0,eK.useTRPC)(),(0,ez.useQuery)(k.fleet.declaredNetworkRules.queryOptions(void 0,{enabled:er}))),ep=(0,eQ.useListedShips)(function(e){let t=e.rules.flatMap(e=>[...e.from,...e.to].flatMap(e=>(0,q.isOwnerTerm)(e)&&e.owner!==q.ANY_LABEL_VALUE&&e.owner!==q.SAME_LABEL_VALUE?[e.owner]:[])),r=e.declarers.flatMap(e=>"ship"===e.kind?[e.shipId]:[]),{draftChanges:a}=e;return[...new Set([...t,...r,...void 0===a?[]:q.NETWORK_VERBS.flatMap(e=>[...a[e].gained,...a[e].lost]).flatMap(e=>[e.fromShipId,e.toShipId]),...void 0===e.pickedShipId?[]:[e.pickedShipId,...e.reachableShipIds??[]]])]}({rules:[...ea.data?.applied.rules??[],...ea.data?.draft?.rules??[]],declarers:eh.data?.map(e=>e.declarer)??[],...void 0===en.data?{}:{draftChanges:en.data},...void 0===e?{}:{pickedShipId:e},...void 0===eo.data?{}:{reachableShipIds:eo.data}})),em=[...ep?.values()??[]],ex=(N=(0,eK.useTRPC)(),C=(0,ez.useQuery)(N.fleet.shipCounts.queryOptions()),C.data?.filter(e=>"viewer"!==e.kind).reduce((e,t)=>e+t.active,0)),[ef,eg]=(0,s.useState)(""),ey=(0,e_.useShipSearch)("",er)??[],eb=(0,e_.useShipSearch)(ef,er)??[],ev=E([...new Map([...ey.slice(0,1),...eb].map(e=>[e.id,e])).values()]),ew=(R=(0,eK.useTRPC)(),(0,ez.useQuery)(R.fleet.builtInRules.queryOptions(void 0,{enabled:er}))),ej=(S=(0,eK.useTRPC)(),O=(0,eG.useQueryClient)(),{setViewerRead:e=>{I.mutate({rule:"viewerRead",isOn:e})},isPending:(I=(0,eW.useMutation)(S.fleet.setBuiltInRule.mutationOptions({onSuccess:()=>O.invalidateQueries({queryKey:S.fleet.builtInRules.queryKey()})}))).isPending,error:I.error?.message}),ek=(T=(0,eK.useTRPC)(),A=eH(),(0,eW.useMutation)(T.fleet.saveNetworkRulesDraft.mutationOptions({onSuccess:A}))),eN=(B=(0,eK.useTRPC)(),L=(0,eG.useQueryClient)(),P=eH(),(0,eW.useMutation)(B.fleet.applyNetworkRules.mutationOptions({onSuccess:async()=>{await Promise.all([P(),L.invalidateQueries({queryKey:B.fleet.builtInRules.queryKey()})])}}))),eR=(D=(0,eK.useTRPC)(),M=eH(),(0,eW.useMutation)(D.fleet.discardNetworkRulesDraft.mutationOptions({onSuccess:M}))),eS=(F=(0,eK.useTRPCClient)(),(0,eW.useMutation)({mutationFn:async()=>{var e;let t,r,a,{file:s,leftOut:i}=await F.fleet.exportNetworkRules.query(),n=(t=s.fleet.name.toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-|-$/g,""),`network-rules-${t}-v${String(s.rulesVersion)}.json`);return e=`${JSON.stringify(s,null,2)}
2
+ `,r=URL.createObjectURL(new Blob([e],{type:"application/json"})),(a=document.createElement("a")).href=r,a.download=n,a.click(),URL.revokeObjectURL(r),{name:n,leftOut:i}}})),e$=(z=(0,eK.useTRPC)(),(0,eW.useMutation)(z.fleet.checkNetworkRulesFile.mutationOptions())),eI=(K=(0,eK.useTRPC)(),Q=(0,eG.useQueryClient)(),H=eH(),(0,eW.useMutation)(K.fleet.importNetworkRules.mutationOptions({onSuccess:async()=>{await Promise.all([H(),Q.invalidateQueries({queryKey:K.fleet.labels.queryKey()})])}}))),[eE,eA]=(0,s.useState)(!1),e3=()=>{e$.reset(),eI.reset()},{networkRulesMax:e5,shipLabelsMax:e4}=(0,eD.useConsoleConstants)();if((0,e1.useSignInWhenSessionEnds)([Z.error,ee.error]),er)if(ea.isError)x=(0,t.jsx)(l.InlineError,{title:"Couldn’t read the network",description:ea.error.message,onRetry:()=>{ea.refetch()}});else if(void 0===ea.data||void 0===el||void 0===ed)x=(0,t.jsx)(d.LoadingSkeleton,{variant:"detail",rows:4,label:"Loading the network"});else{let r,a,s,n={...el,ships:[...em,...ed]};x=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p,{rows:void 0===ew.data?void 0:ew.data.map(W),error:ew.error?.message,onRetry:()=>{ew.refetch()},isTurning:ej.isPending,turnError:ej.error,onViewerReadChange:ej.setViewerRead}),(0,t.jsx)(ec,{rules:(ea.data.draft??ea.data.applied).rules,context:n,limits:{rulesMax:e5,selectorMax:e4},isSaving:ek.isPending,saveError:ek.error?.message,savedNote:void 0===ek.data?void 0:"Draft saved. Nothing changes until it is applied.",onSave:e=>{ek.mutate({rules:e})}},JSON.stringify(ea.data.draft??ea.data.applied)),null===ea.data.draft?null:(0,t.jsx)(G,{changes:void 0===en.data?void 0:(h=en.data,r=new Map(em.map(e=>[e.id,e.name])),a=e=>e.map(({fromShipId:e,toShipId:t,rule:a})=>({key:`${e}>${t}`,from:r.get(e)??e,to:r.get(t)??t,rule:function(e,t){if("builtIn"in e)return`Built-in: ${U[e.builtIn]}`;if("rule"in e)return`Rule ${String(e.rule+1)}`;let r="installation"===e.declared.kind?"the installation":t.get(e.declared.shipId)??e.declared.shipId;return`Declared by ${r}, rule ${String(e.index+1)}`}(a,r)})).sort((e,t)=>e.from.localeCompare(t.from)||e.to.localeCompare(t.to)),q.NETWORK_VERBS.map(e=>({verb:e,gained:a(h[e].gained),lost:a(h[e].lost)}))),error:en.error?.message,onRetry:()=>{en.refetch()}}),(0,t.jsx)(_,{draft:ea.data.draft,appliedVersion:ea.data.applied.version,isApplying:eN.isPending,applyError:eN.error?.message,onApply:()=>{eN.mutate({version:ea.data.applied.version})},isDiscarding:eR.isPending,discardError:eR.error?.message,onDiscard:()=>{eR.mutate()}}),(0,t.jsx)(eO,{isExporting:eS.isPending,exportError:eS.error?.message,exported:eS.data,onExport:()=>{eS.mutate(void 0,{onSuccess:({name:e,leftOut:t})=>{(0,i.showToast)({title:"Rules exported",description:0===t.length?`Saved as ${e}.`:`Saved as ${e}, leaving out ${String(t.length)}: see Export and import.`,tone:"success"})}})},canImport:et.canDefineLabels,onImport:()=>{e3(),eA(!0)}}),(0,t.jsx)(eC,{isOpen:eE,onOpenChange:e=>{eA(e),e||e3()},checked:e$.data,isChecking:e$.isPending,checkError:e$.error?.message,onCheck:e=>{eI.reset(),e$.mutate({file:e})},onFileChange:e3,ships:ev,onShipQueryChange:eg,isImporting:eI.isPending,importError:eI.error?.message,onImport:e=>{eI.mutate(e,{onSuccess:({definedLabels:e})=>{eA(!1),e3(),(0,i.showToast)({title:"Imported into the draft",description:`${0===e.length?"":`Defined ${e.join(", ")}. `}Look at what the draft changes, then apply it.`,tone:"success"})}})}}),(0,t.jsx)(b,{declared:void 0===eh.data?void 0:(m=eh.data,s=new Map(em.map(e=>[e.id,e.name])),m.filter(({rules:e})=>e.length>0).map(({declarer:e,rules:t})=>"installation"===e.kind?{declarerId:"installation",declaredBy:"the installation",rules:t}:{declarerId:e.shipId,declaredBy:s.get(e.shipId)??e.shipId,rules:t}).sort((e,t)=>e.declaredBy.localeCompare(t.declaredBy))),error:eh.error?.message,onRetry:()=>{eh.refetch()},context:n}),(0,t.jsx)(V,{ships:E(em),search:{ships:ev,onQueryChange:eg},...void 0===ex?{}:{sailingShipCount:ex},pickedShipId:e,reachableShipIds:eo.data,reachError:eo.error?.message,onPick:e=>{J.replace(eY(e,ei),{scroll:!1})},against:ei,...es?{onAgainstChange:t=>{J.replace(eY(e,t),{scroll:!1})}}:{},onRetry:()=>{eo.refetch()}}),(0,t.jsx)(eT,{refusals:eu.items,error:eu.isFailed?eu.error?.message:void 0,onRetry:eu.retry,more:eu.hasMore?(0,t.jsx)(e2.LoadMore,{what:"older refusals",isLoading:eu.isLoadingMore,isFailed:eu.isLoadMoreFailed,onLoad:eu.loadMore,area:"network-refusals"}):null,context:n,now:X})]})}else x=(0,t.jsx)(n.EmptyState,{icon:(0,t.jsx)(r.Network,{"aria-hidden":!0}),title:"Only a session holding fleet:network sees the network rules"});return(0,t.jsx)(eB.ListPage,{...Y,title:"Network",description:"Who may send to, read or manage whom. The fleet checks the applied rules on every send; a draft changes nothing until it is applied.",live:ee.live,children:x})}],313260)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,419413,e=>{"use strict";e.s(["PAGE_SIZE_MAX",0,500])},887851,e=>{"use strict";var t=e.i(843476),i=e.i(792150),n=e.i(24071),a=e.i(867927),r=e.i(566595),s=e.i(749287),l=e.i(586875),o=e.i(271645),d=e.i(965324),c=e.i(937338),u=e.i(212470);let m=[{value:"*",testId:"label-picker-any"},{value:"#",testId:"label-picker-same"}],h={"trierarch-plugin":l.ShipWheel,squadrons:i.Boxes,ship:s.Ship};function p(e,t){return`${String(e)} ${1===e?t:`${t}s`}`}e.s(["LabelPicker",0,function({groups:e,pickedValueIds:i,onPick:s,size:l="sm",pickedWord:z="Picked",countWord:b="ship",terms:g}){let[f,v]=(0,o.useState)(""),[y,j]=(0,o.useState)(void 0),k="touch"===l,S=(0,d.classNames)("flex w-full items-center gap-2 rounded-sm px-2 text-left hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50",k?"min-h-(--size-control-touch) text-body-touch":"h-(--size-control-sm) text-body");if(void 0!==y)return(0,t.jsxs)("div",{className:"flex flex-col gap-1","data-testid":"label-picker-values",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[(0,t.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1 rounded-sm px-1 font-mono text-body hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring [&_svg]:size-(--size-icon-sm)",onClick:()=>{j(void 0)},"aria-label":`Back to the keys, from ${y.key}`,children:[(0,t.jsx)(n.ChevronLeft,{"aria-hidden":!0}),y.key,"="]}),(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:["ship"===b?"Ships":"Machines"," with each"]})]}),(0,t.jsxs)("ul",{className:"flex flex-col",children:[void 0===g?null:m.map(({value:e,testId:i})=>{let n=g.picked.some(t=>t.labelId===y.labelId&&t.value===e);return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",className:S,disabled:n,"data-testid":i,onClick:()=>{g.onPick({labelId:y.labelId,value:e}),j(void 0),v("")},children:[(0,t.jsx)("span",{className:"w-3 shrink-0 font-mono",children:e}),(0,t.jsx)("span",{className:"min-w-0 grow truncate",children:c.TERM_MEANINGS[e]}),n?(0,t.jsx)("span",{className:"shrink-0 text-meta text-muted-foreground",children:z}):null]})},e)}),y.values.map(e=>{let n=i.includes(e.valueId);return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",className:S,disabled:n,"data-testid":"label-picker-value",onClick:()=>{s(e.valueId),j(void 0),v("")},children:[(0,t.jsx)("span",{className:"min-w-0 grow truncate font-mono",children:e.value}),(0,t.jsx)("span",{className:"shrink-0 text-meta text-muted-foreground tabular-nums",children:n?z:p(e.shipCount,b)})]})},e.valueId)})]})]});let x=f.trim().toLowerCase(),w=e.map(e=>({...e,keys:e.keys.filter(e=>""===x||e.key.includes(x))})).filter(e=>e.keys.length>0);return(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"label-picker",children:[(0,t.jsx)(u.Input,{type:"search","aria-label":"Find a key",placeholder:"Find a key",size:k?"touch":"md",leadingIcon:(0,t.jsx)(r.Search,{}),value:f,onChange:e=>{v(e.target.value)}}),0===w.length?(0,t.jsx)("p",{className:"px-2 py-3 text-meta text-muted-foreground",children:0===e.length?"The fleet has no labels yet.":`No key matches “${f.trim()}”.`}):w.map(e=>(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("span",{className:"px-2 pt-1 pb-0.5 text-caption text-muted-foreground",children:e.title}),(0,t.jsx)("ul",{className:"flex flex-col",children:e.keys.map(e=>{let i="none"===e.mark?null:h[e.mark];return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",className:(0,d.classNames)(S,"[&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0 [&_svg]:text-muted-foreground"),"data-testid":"label-picker-key",onClick:()=>{j(e)},children:[null===i?null:(0,t.jsx)(i,{"aria-hidden":!0}),(0,t.jsx)("span",{className:"font-mono",children:e.key}),(0,t.jsx)("span",{className:"min-w-0 grow truncate text-meta text-muted-foreground",children:p(e.values.length,"value")}),(0,t.jsx)(a.ChevronRight,{"aria-hidden":!0})]})},e.labelId)})})]},e.title))]})}])},259068,function(e){e.n(e.i(887851))},937338,711514,e=>{"use strict";var t,i=e.i(681307),n=e.i(383615);let a=i.z.enum(["messages:send","messages:receive","messages:force","messages:resend","fleet:read","fleet:commission","fleet:manage","crew:assign","crew:run","labels:define","labels:assign","fleet:network","fleet:on-behalf","fleet:person","fleet:owner","fleet:explain","fleet:connect","labels:any","fleet:verify","scopes:declare","scopes:grant","meetings:open"]),r=["messages","fleet","crew","labels","scopes","meetings"],s="[a-z][a-z0-9-]{0,31}";RegExp(`^${s}$`);let l=RegExp(`^${s}:${s}$`),o=i.z.string().regex(l,"A scope is <namespace>:<action>").refine(e=>{var t;return t=e.slice(0,e.indexOf(":")),!r.some(e=>e===t)||a.safeParse(e).success},"No such core scope");i.z.enum(["messages:resend","fleet:read","fleet:commission","fleet:manage","crew:assign","crew:run","labels:define","labels:assign","fleet:network","fleet:on-behalf","fleet:person","fleet:owner","fleet:explain","fleet:connect","labels:any","fleet:verify","meetings:open"]);let d=i.z.enum(["operator","agent","viewer","person","app","plugin"]);i.z.enum(["agent","person","app","plugin"]),i.z.enum(["DEVICE","CLOUD","SERVER","OTHER"]);let c=i.z.enum(["awaitingCrew","crewed","retired"]);i.z.enum(["ship","type","meeting"]),i.z.enum(["pending","received","handed","acknowledged","handled","notHandled","undeliverable","dismissed","abandoned"]),i.z.enum(["FleetInitialised","ShipCommissioned","OwnerSet","OwnerChanged","ShipClaimed","LeaseRevoked","CredentialRevoked","StartingPromptIssued","OperatorPasswordReset","OperatorLoginSet","MessageAccepted","LeasePushed","DeliveryReceived","DeliveryHanded","DeliveryAcknowledged","DeliveryHandled","DeliveryNotHandled","DeliveryOverdue","DeliveryUndeliverable","DeliveryReturned","ShipRetired","DeliveryAbandoned","DeliveryDismissed","ShipRenamed","ShipReported","StatementSet","TurnReported","SignInTicketIssued","FleetLimitsChanged","ViewerSessionStarted","CrewRequested","CrewRequestRemoved","CrewAssigned","CrewStatusChanged","CrewRequestExplained","CrewRequestGivenBack","LabelDefined","LabelValuesChanged","LabelRetired","LabelAssigned","LabelUnassigned","LabelDeleted","WorktreeClearRequested","WorktreeCleared","WorktreeClearRemoved","NetworkRulesSet","NetworkRulesDeclared","NetworkRulesDraftSaved","NetworkRulesDraftDiscarded","NetworkPluginRegistered","NetworkPluginUnregistered","BuiltInRuleChanged","ScopesDeclared","ScopesChanged","PluginConnected","PluginDisconnected","VerifiedFactsSet","VerifiedFactsRemoved","MeetingOpened","ParticipantAdded","MicRequested","MicRequestWithdrawn","MicGiven","MicReleased","MicTaken","MicPatternSet","ParticipantLeft","ParticipantRejoined","ParticipantRevoked","OwnershipTransferred","ModeratorNamed","MeetingEnded"]);let u=i.z.string().min(1).max(128).brand();i.z.object({iss:i.z.string(),aud:(0,n.idSchema)("fleet"),sub:u,org:i.z.string().min(1),scope:i.z.string(),group:i.z.array(i.z.string()),person_ship:(0,n.idSchema)("ship").optional(),argo:i.z.boolean().optional(),iat:i.z.number(),exp:i.z.number()}).transform((e,t)=>{let n=e.scope.split(" ").filter(e=>""!==e),a=i.z.array(o).safeParse(n);return a.success?{issuer:e.iss,fleetId:e.aud,accountId:e.sub,organisationId:e.org,scopes:a.data,groupValues:e.group,personShipId:e.person_ship??null,isArgoAllowed:e.argo??!1,issuedAt:new Date(1e3*e.iat),endsAt:new Date(1e3*e.exp)}:(t.addIssue({code:"custom",message:"scope holds a malformed or unknown scope",path:["scope"]}),i.z.NEVER)}),new TextEncoder;let m=i.z.record(i.z.string(),i.z.json()),h=["crewing","running","restarting","crashed","releasing"],p=i.z.enum(h),z=["none","needsCrew","crewedByHand",...h],b=i.z.enum(z),g=`A reason is one line of at most ${String(200)} characters`;i.z.object({shipId:(0,n.idSchema)("ship"),settings:m}),i.z.object({settingsVersion:i.z.int().min(1)}),i.z.object({shipId:(0,n.idSchema)("ship")}),i.z.strictObject({}),i.z.object({settingsVersion:i.z.int().min(1),requestedAt:i.z.iso.datetime(),assignedTo:i.z.object({id:(0,n.idSchema)("ship"),name:i.z.string()}).nullable(),status:p.nullable(),reason:i.z.string().nullable(),crewedBy:i.z.object({id:(0,n.idSchema)("ship"),name:i.z.string()}).nullable(),attempt:i.z.int().min(0),startedAt:i.z.iso.datetime().nullable(),givenBack:i.z.array(i.z.object({trierarch:i.z.object({id:(0,n.idSchema)("ship"),name:i.z.string()}),settingsVersion:i.z.int().min(1),reason:i.z.string(),givenBackAt:i.z.iso.datetime()}))}).extend({settings:m}),i.z.object({shipId:(0,n.idSchema)("ship"),trierarchShipId:(0,n.idSchema)("ship")}),i.z.strictObject({}),i.z.object({shipId:(0,n.idSchema)("ship"),status:p,attempt:i.z.int().min(0).optional(),startedAt:i.z.iso.datetime().nullable().optional()}),i.z.strictObject({}),i.z.object({shipId:(0,n.idSchema)("ship")}),i.z.strictObject({}),i.z.array(i.z.object({shipId:(0,n.idSchema)("ship"),settings:m,settingsVersion:i.z.int().min(1),requestedAt:i.z.iso.datetime(),status:p.nullable(),isFinal:i.z.boolean(),ownerShipId:(0,n.idSchema)("ship").nullable(),ownerName:i.z.string().nullable()})),i.z.object({shipId:(0,n.idSchema)("ship"),reason:i.z.string().trim().max(200,g).refine(e=>!/[\r\n]/.test(e),g).nullable()}),i.z.strictObject({}),i.z.object({shipId:(0,n.idSchema)("ship"),settingsVersion:i.z.int().min(1),reason:i.z.string().trim().min(1,g).max(200,g).refine(e=>!/[\r\n]/.test(e),g)}),i.z.strictObject({});var f=e.i(419413);function v(e){return i.z.object({cursor:e.optional(),limit:i.z.int().min(1).max(f.PAGE_SIZE_MAX).optional()})}let y=i.z.string(),j=i.z.object({id:(0,n.idSchema)("labelValue"),value:i.z.string()}),k=i.z.object({labelId:(0,n.idSchema)("label"),key:i.z.string(),valueId:(0,n.idSchema)("labelValue"),value:i.z.string()}),S=i.z.enum(["console","claudeCode","codex","trierarch","plugin","other"]),x=i.z.object({query:i.z.string().optional(),name:i.z.string().optional(),status:i.z.array(c).optional(),type:i.z.array(i.z.string()).optional(),shipKind:i.z.array(d).optional(),crewRequest:i.z.array(b).optional(),assignedTo:i.z.array((0,n.idSchema)("ship")).optional(),needsCrew:i.z.enum(["withTrierarchs","withoutTrierarchs"]).optional(),valueIds:i.z.array((0,n.idSchema)("labelValue")).optional(),shipIds:i.z.array((0,n.idSchema)("ship")).optional(),kind:i.z.array(S).optional(),pluginShipIds:i.z.array((0,n.idSchema)("ship")).optional()});i.z.object({filter:x.optional()}).optional(),i.z.object({status:i.z.array(c).optional()}).optional(),i.z.array(i.z.string());let w=i.z.object({column:i.z.enum(["ship","status","report","runsOn","seen","requested"]),direction:i.z.enum(["ascending","descending"])}),I=i.z.object({isEmpty:i.z.boolean(),value:i.z.string(),name:i.z.string(),id:(0,n.idSchema)("ship")});v(i.z.string().max(4096).transform(function(e){try{let t=atob(e.replaceAll("-","+").replaceAll("_","/"));return JSON.parse(new TextDecoder().decode(Uint8Array.from(t,e=>e.charCodeAt(0))))}catch{return}}).pipe(I)).extend({...x.shape,sort:w.optional()}).optional(),i.z.object({key:y,values:i.z.array(y)}),i.z.object({labelId:(0,n.idSchema)("label"),values:i.z.array(j)}),i.z.object({labelId:(0,n.idSchema)("label"),values:i.z.array(y)}),i.z.object({values:i.z.array(j)}),i.z.object({labelId:(0,n.idSchema)("label")}),i.z.object({key:y,value:y}),i.z.object({labelId:(0,n.idSchema)("label"),valueId:(0,n.idSchema)("labelValue")}),i.z.object({shipId:(0,n.idSchema)("ship"),valueId:(0,n.idSchema)("labelValue")}),i.z.object({});let R=i.z.discriminatedUnion("kind",[i.z.object({kind:i.z.literal("ship"),id:(0,n.idSchema)("ship"),name:i.z.string()}),i.z.object({kind:i.z.literal("installation")})]),N=i.z.object({id:(0,n.idSchema)("label"),key:i.z.string(),values:i.z.array(j),owner:R});i.z.array(N.extend({shipCount:i.z.int().min(0),values:i.z.array(j.extend({shipCount:i.z.int().min(0)}))}));let C=i.z.union([(0,n.idSchema)("labelValue"),i.z.object({labelId:(0,n.idSchema)("label"),value:i.z.enum(["*","#"])}),i.z.object({owner:i.z.union([(0,n.idSchema)("ship"),i.z.enum(["*","#"])])})]);function A(e){return"string"!=typeof e&&"owner"in e}let O=i.z.array(C),E=["send","read","manage"],V=i.z.object({verb:i.z.enum(E),from:O,to:O}),D=i.z.array(V).nullable();i.z.object({rules:D}),i.z.object({savedAgainstVersion:i.z.int().min(0)}),i.z.object({version:i.z.int().min(0)}),i.z.object({applied:i.z.object({rules:D,version:i.z.int().min(0)}),draft:i.z.object({rules:D,savedAt:i.z.iso.datetime(),savedAgainstVersion:i.z.int().min(0)}).nullable()}),i.z.object({});let M=["argo","owner","answer","pluginRead","meeting","viewerRead","installation","open"];i.z.object({rule:i.z.enum(M),isOn:i.z.boolean()});let T=i.z.object({rule:i.z.enum(M),isOn:i.z.boolean()});i.z.array(T),i.z.object({version:i.z.int().min(0)}),i.z.object({rules:i.z.array(V)}),i.z.object({rules:i.z.int().min(0)});let P=i.z.discriminatedUnion("kind",[i.z.object({kind:i.z.literal("ship"),shipId:(0,n.idSchema)("ship")}),i.z.object({kind:i.z.literal("installation")})]);i.z.array(i.z.object({declarer:P,rules:i.z.array(V)}));let L=i.z.object({id:(0,n.idSchema)("ship"),name:i.z.string(),labels:i.z.array(k),owner:i.z.object({id:(0,n.idSchema)("ship"),name:i.z.string()}).nullable()}),_=i.z.discriminatedUnion("kind",[L.extend({kind:i.z.literal("ship")}),i.z.object({kind:i.z.literal("account"),accountId:u,labels:i.z.array(k),personShip:i.z.object({id:(0,n.idSchema)("ship"),name:i.z.string()}).nullable()}),i.z.object({kind:i.z.literal("installation")})]),$=i.z.object({id:(0,n.idSchema)("reachRefusal"),at:i.z.iso.datetime(),sender:_,askedBy:L.nullable(),recipient:i.z.discriminatedUnion("kind",[i.z.object({kind:i.z.literal("ship"),ship:L}),i.z.object({kind:i.z.literal("type"),type:i.z.string(),ships:i.z.array(L)})]),verb:i.z.enum(E),settingsVersion:i.z.int().min(1)});v((0,n.idSchema)("reachRefusal")),t=(0,n.idSchema)("reachRefusal"),i.z.object({items:i.z.array($),nextCursor:t.nullable()}),i.z.object({fromShipId:(0,n.idSchema)("ship"),toShipId:(0,n.idSchema)("ship").optional(),against:i.z.enum(["applied","draft"]).optional()});let B=i.z.union([i.z.object({builtIn:i.z.enum(M)}),i.z.object({rule:i.z.int().min(0)}),i.z.object({declared:P,index:i.z.int().min(0)})]),q=i.z.array(i.z.object({shipId:(0,n.idSchema)("ship"),rule:B}));i.z.object({send:q,read:q,manage:q});let U=i.z.array(i.z.object({fromShipId:(0,n.idSchema)("ship"),toShipId:(0,n.idSchema)("ship"),rule:B}));i.z.object({send:i.z.object({gained:U,lost:U}),read:i.z.object({gained:U,lost:U}),manage:i.z.object({gained:U,lost:U})}),e.s(["ANY_LABEL_VALUE",0,"*","NETWORK_VERBS",0,E,"SAME_LABEL_VALUE",0,"#","isOwnerTerm",0,A],711514);var W=e.i(280581);function F(e){return"all-to-all"===e.kind?null:e.rules.map(e=>({verb:e.verb,from:[...e.from],to:[...e.to]}))}function G(e,t){return"all-to-all"===e.kind?e:{kind:"rules",rules:e.rules.map(e=>e.key===t.key?t.change(e):e)}}function H(e,t){return K(e)===K(t)}function K(e){return"string"==typeof e?e:A(e)?`owner=${e.owner}`:`${e.labelId}=${e.value}`}function J(e,t){let i=e["from"===t?"to":"from"];return e[t].filter(e=>"string"!=typeof e&&!A(e)&&"#"===e.value&&!i.some(t=>H(t,e)))}function X(e,t){let i=e=>e.some(e=>A(e)&&"#"===e.owner);return i(e[t])&&!i(e["from"===t?"to":"from"])}e.s(["OWNER_TERM_MEANINGS",0,{"*":"Any owner","#":"The same owner as the other side"},"TERM_MEANINGS",0,{"*":"Any value","#":"The same value as the other side"},"VERB_WORDS",0,{send:"May send to",read:"May read",manage:"May manage"},"addRule",0,function(e,t){return"all-to-all"===e.kind||e.rules.length>=t.limits.rulesMax?e:{kind:"rules",rules:[...e.rules,{key:t.newKey(),verb:"send",from:[],to:[]}]}},"addTerm",0,function(e,t){return G(e,{key:t.rule,change:e=>{let i=e[t.side];return i.some(e=>H(e,t.term))||i.length>=t.limits.selectorMax?e:{...e,[t.side]:[...i,t.term]}}})},"draftOf",0,function(e,t){return null===e?{kind:"all-to-all"}:{kind:"rules",rules:e.map(e=>({key:t(),verb:e.verb,from:[...e.from],to:[...e.to]}))}},"hasSameValueOnOneSide",0,function(e){return"rules"===e.kind&&e.rules.some(e=>J(e,"from").length+J(e,"to").length>0||X(e,"from")||X(e,"to"))},"isChanged",0,function(e,t){return JSON.stringify(F(e))!==JSON.stringify(t)},"ownerChoicesOf",0,function(e){return e.ships.filter(e=>("operator"===e.kind||"person"===e.kind)&&"retired"!==e.status).map(e=>({shipId:e.id,name:e.name}))},"removeRule",0,function(e,t){return"all-to-all"===e.kind?e:{kind:"rules",rules:e.rules.filter(e=>e.key!==t)}},"removeTerm",0,function(e,t){return G(e,{key:t.rule,change:e=>({...e,[t.side]:e[t.side].filter(e=>!H(e,t.term))})})},"rulesOf",0,F,"sameValueProblemOf",0,function(e,t){let[i]=J(e,t.side);if(void 0===i)return X(e,t.side)?"owner=# needs owner=# on the other side: # matches the same owner there.":void 0;let n=t.context.labels.find(e=>e.id===i.labelId)?.key??i.labelId;return`${n}=# needs ${n}=# on the other side: # matches the same value there.`},"selectorOf",0,function(e,t){let i=[],n=[],a=[];for(let r of e){if(A(r)){let e=function(e,t){if("*"===e.owner||"#"===e.owner)return{term:e,text:`owner=${e.owner}`};let i=t.ships.find(t=>t.id===e.owner);return void 0===i?void 0:{term:e,text:`owner=${i.name}`}}(r,t);void 0===e?a.push(r):n.push(e);continue}let e=function(e,t){if("string"==typeof e){let[i]=(0,W.pickedChips)([e],t);return void 0===i?void 0:{labelId:i.labelId,key:i.key,value:i.value,mark:i.mark,ownerName:i.ownerName,term:e}}let i=t.labels.find(t=>t.id===e.labelId);if(void 0===i)return;let n=t.ownerOf.get(i.id);return{labelId:i.id,key:i.key,value:e.value,mark:n?.mark??"ship",ownerName:n?.name??(0,W.labelOwnerName)(i.owner),term:e}}(r,t);void 0===e?a.push(r):i.push(e)}return{chips:i,owners:n,unknown:a}},"setRulesOn",0,function(e,t){return t?"rules"===e.kind?e:{kind:"rules",rules:[]}:{kind:"all-to-all"}},"setVerb",0,function(e,t){return G(e,{key:t.rule,change:e=>({...e,verb:t.verb})})},"termKeyOf",0,K],937338)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,395530,e=>{"use strict";var t=e.i(271645),a=e.i(828918),s=e.i(838452),i=e.i(673553);e.s(["useCompositeItem",0,function(e={}){let{highlightItemOnHover:n,highlightedIndex:r,onHighlightedIndexChange:l}=(0,s.useCompositeRootContext)(),{ref:d,index:o}=(0,i.useCompositeListItem)(e),c=r===o,u=t.useRef(null),h=(0,a.useMergedRefs)(d,u);return{compositeProps:{tabIndex:c?0:-1,onFocus(){l(o)},onMouseMove(){let e=u.current;if(!n||!e)return;let t=e.hasAttribute("disabled")||"true"===e.ariaDisabled;c||t||e.focus()}},compositeRef:h,index:o}}])},749655,987255,450092,536604,e=>{"use strict";var t=e.i(456420);let a={name:"alarm-clock",size:24,node:[["circle",{cx:"12",cy:"13",r:"8",key:"3y4lt7"}],["path",{d:"M12 9v4l2 2",key:"1c63tq"}],["path",{d:"M5 3 2 6",key:"18tl5t"}],["path",{d:"m22 6-3-3",key:"1opdir"}],["path",{d:"M6.38 18.7 4 21",key:"17xu3x"}],["path",{d:"M17.64 18.67 20 21",key:"kv2oe2"}]]};a.node;let s=(0,t.default)(a);e.s(["AlarmClock",0,s],749655);let i={name:"anchor",size:24,node:[["path",{d:"M12 6v16",key:"nqf5sj"}],["path",{d:"m19 13 2-1a9 9 0 0 1-18 0l2 1",key:"y7qv08"}],["path",{d:"M9 11h6",key:"1fldmi"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}]]};i.node;let n=(0,t.default)(i);e.s(["Anchor",0,n],987255);let r={name:"circle-arrow-right",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m12 16 4-4-4-4",key:"1i9zcv"}],["path",{d:"M8 12h8",key:"1wcyev"}]],aliases:["arrow-right-circle"]};r.node;let l=(0,t.default)(r);e.s(["CircleArrowRight",0,l],450092);let d={name:"circle-check-big",size:24,node:[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],aliases:["check-circle"]};d.node;let o=(0,t.default)(d);e.s(["CircleCheckBig",0,o],536604)},876561,e=>{"use strict";var t=e.i(456420);let a={name:"archive",size:24,node:[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]};a.node;let s=(0,t.default)(a);e.s(["Archive",0,s],876561)},847211,e=>{"use strict";var t=e.i(456420);let a={name:"ban",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]]};a.node;let s=(0,t.default)(a);e.s(["Ban",0,s],847211)},24071,e=>{"use strict";var t=e.i(456420);let a={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};a.node;let s=(0,t.default)(a);e.s(["ChevronLeft",0,s],24071)},867927,e=>{"use strict";var t=e.i(456420);let a={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};a.node;let s=(0,t.default)(a);e.s(["ChevronRight",0,s],867927)},152886,e=>{"use strict";var t=e.i(456420);let a={name:"circle-dashed",size:24,node:[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]};a.node;let s=(0,t.default)(a);e.s(["CircleDashed",0,s],152886)},119002,e=>{"use strict";var t=e.i(456420);let a={name:"circle-pause",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],aliases:["pause-circle"]};a.node;let s=(0,t.default)(a);e.s(["CirclePause",0,s],119002)},832297,426391,519647,710001,25799,e=>{"use strict";var t=e.i(456420);let a={name:"circle-play",size:24,node:[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],aliases:["play-circle"]};a.node;let s=(0,t.default)(a);e.s(["CirclePlay",0,s],832297);let i={name:"circle-dot-dashed",size:24,node:[["path",{d:"M10.1 2.18a9.93 9.93 0 0 1 3.8 0",key:"1qdqn0"}],["path",{d:"M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7",key:"1bq7p6"}],["path",{d:"M21.82 10.1a9.93 9.93 0 0 1 0 3.8",key:"1rlaqf"}],["path",{d:"M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69",key:"1xk03u"}],["path",{d:"M13.9 21.82a9.94 9.94 0 0 1-3.8 0",key:"l7re25"}],["path",{d:"M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7",key:"1v18p6"}],["path",{d:"M2.18 13.9a9.93 9.93 0 0 1 0-3.8",key:"xdo6bj"}],["path",{d:"M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69",key:"1jjmaz"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};i.node;let n=(0,t.default)(i);e.s(["CircleDotDashed",0,n],426391);let r={name:"circle-minus",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],aliases:["minus-circle"]};r.node;let l=(0,t.default)(r);e.s(["CircleMinus",0,l],519647);let d={name:"flag-off",size:24,node:[["path",{d:"M16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1q158e"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M4 22V4",key:"1plyxx"}],["path",{d:"M7.656 2H8c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10.347",key:"xj1b71"}]]};d.node;let o=(0,t.default)(d);e.s(["FlagOff",0,o],710001);let c={name:"mail-check",size:24,node:[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8",key:"12jkf8"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]]};c.node;let u=(0,t.default)(c);e.s(["MailCheck",0,u],25799)},275043,446513,e=>{"use strict";var t=e.i(456420);let a={name:"circle-question-mark",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["help-circle","circle-help"]};a.node;let s=(0,t.default)(a);e.s(["default",0,s],275043);let i={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};i.node;let n=(0,t.default)(i);e.s(["Monitor",0,n],446513)},821048,e=>{"use strict";var t=e.i(456420);let a={name:"circle-slash",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]]};a.node;let s=(0,t.default)(a);e.s(["CircleSlash",0,s],821048)},316984,e=>{"use strict";var t=e.i(456420);let a={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};a.node;let s=(0,t.default)(a);e.s(["CircleX",0,s],316984)},474544,e=>{"use strict";var t=e.i(456420);let a={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};a.node;let s=(0,t.default)(a);e.s(["Clock",0,s],474544)},671028,e=>{"use strict";var t=e.i(456420);let a={name:"gauge",size:24,node:[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]};a.node;let s=(0,t.default)(a);e.s(["Gauge",0,s],671028)},981658,e=>{"use strict";var t=e.i(456420);let a={name:"hourglass",size:24,node:[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]};a.node;let s=(0,t.default)(a);e.s(["Hourglass",0,s],981658)},985512,e=>{"use strict";var t=e.i(456420);let a={name:"octagon-alert",size:24,node:[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],aliases:["alert-octagon"]};a.node;let s=(0,t.default)(a);e.s(["OctagonAlert",0,s],985512)},457665,e=>{"use strict";var t=e.i(456420);let a={name:"power",size:24,node:[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]};a.node;let s=(0,t.default)(a);e.s(["Power",0,s],457665)},395925,485627,e=>{"use strict";var t=e.i(456420);let a={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};a.node;let s=(0,t.default)(a);e.s(["RotateCcw",0,s],395925);let i={name:"sailboat",size:24,node:[["path",{d:"M10 2v15",key:"1qf71f"}],["path",{d:"M7 22a4 4 0 0 1-4-4 1 1 0 0 1 1-1h16a1 1 0 0 1 1 1 4 4 0 0 1-4 4z",key:"1pxcvx"}],["path",{d:"M9.159 2.46a1 1 0 0 1 1.521-.193l9.977 8.98A1 1 0 0 1 20 13H4a1 1 0 0 1-.824-1.567z",key:"5oog16"}]]};i.node;let n=(0,t.default)(i);e.s(["Sailboat",0,n],485627)},566595,e=>{"use strict";var t=e.i(456420);let a={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};a.node;let s=(0,t.default)(a);e.s(["Search",0,s],566595)},819759,e=>{"use strict";var t=e.i(456420);let a={name:"square-pen",size:24,node:[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aliases:["pen-box","edit","pen-square"]};a.node;let s=(0,t.default)(a);e.s(["SquarePen",0,s],819759)},466787,e=>{"use strict";var t=e.i(456420);let a={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};a.node;let s=(0,t.default)(a);e.s(["TriangleAlert",0,s],466787)},594831,e=>{"use strict";var t=e.i(456420);let a={name:"unplug",size:24,node:[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]};a.node;let s=(0,t.default)(a);e.s(["Unplug",0,s],594831)},892870,e=>{"use strict";var t=e.i(456420);let a={name:"user-check",size:24,node:[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};a.node;let s=(0,t.default)(a);e.s(["UserCheck",0,s],892870)},298260,e=>{"use strict";var t=e.i(843476),a=e.i(965324);e.s(["Kbd",0,function({className:e,...s}){return(0,t.jsx)("kbd",{"data-slot":"kbd",className:(0,a.classNames)("inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-xs border border-border bg-muted px-1.25 font-sans text-micro font-medium text-muted-foreground max-sm:hidden",e),...s})}])},638919,e=>{"use strict";var t=e.i(843476),a=e.i(353753),s=e.i(225913),i=e.i(560964),n=e.i(965324),r=e.i(574296);let l=(0,s.cva)("fixed z-50 flex flex-col bg-popover text-body text-popover-foreground shadow-lg outline-none duration-(--duration-slow) ease-(--ease-standard) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",{variants:{side:{right:"inset-y-0 right-0 h-full w-full border-l border-border sm:max-w-(--size-sheet) motion-safe:data-open:slide-in-from-right motion-safe:data-closed:slide-out-to-right",bottom:"inset-x-0 bottom-0 max-h-[90dvh] rounded-t-2xl border-t border-border px-4 pt-2 pb-[max(calc(var(--spacing)*4),env(safe-area-inset-bottom))] motion-safe:data-open:slide-in-from-bottom motion-safe:data-closed:slide-out-to-bottom"}},defaultVariants:{side:"right"}});e.s(["Sheet",0,function(e){return(0,t.jsx)(a.Dialog.Root,{"data-slot":"sheet",...e})},"SheetBody",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sheet-body",className:(0,n.classNames)("min-h-0 flex-1 overflow-y-auto in-data-[side=right]:p-6",e),...a})},"SheetClose",0,function(e){return(0,t.jsx)(a.Dialog.Close,{"data-slot":"sheet-close",...e})},"SheetContent",0,function({className:e,children:s,side:d="right",...o}){return(0,t.jsxs)(a.Dialog.Portal,{children:[(0,t.jsx)(a.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:"fixed inset-0 z-50 bg-overlay duration-(--duration-slow) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0"}),(0,t.jsxs)(a.Dialog.Popup,{"data-slot":"sheet-content","data-side":d,className:(0,n.classNames)(l({side:d}),e),...o,children:["bottom"===d?(0,t.jsx)("div",{"aria-hidden":!0,className:"mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-border"}):(0,t.jsx)(a.Dialog.Close,{"data-slot":"sheet-close",render:(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",isIconOnly:!0,className:"absolute top-4 right-4","aria-label":"Close"}),children:(0,t.jsx)(i.XIcon,{})}),s]})]})},"SheetDescription",0,function({className:e,...s}){return(0,t.jsx)(a.Dialog.Description,{"data-slot":"sheet-description",className:(0,n.classNames)("text-meta text-muted-foreground",e),...s})},"SheetFooter",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sheet-footer",className:(0,n.classNames)("flex flex-col-reverse gap-2 pt-3 in-data-[side=right]:flex-row in-data-[side=right]:justify-end in-data-[side=right]:border-t in-data-[side=right]:px-6 in-data-[side=right]:py-4",e),...a})},"SheetHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,n.classNames)("flex flex-col gap-0.5 in-data-[side=right]:border-b in-data-[side=right]:px-6 in-data-[side=right]:py-5 in-data-[side=right]:pr-14",e),...a})},"SheetTitle",0,function({className:e,...s}){return(0,t.jsx)(a.Dialog.Title,{"data-slot":"sheet-title",className:(0,n.classNames)("text-heading font-semibold text-foreground in-data-[side=bottom]:py-2 in-data-[side=bottom]:text-section",e),...s})},"SheetTrigger",0,function(e){return(0,t.jsx)(a.Dialog.Trigger,{"data-slot":"sheet-trigger",...e})}])},219321,e=>{"use strict";var t=e.i(843476),a=e.i(965324);e.s(["Skeleton",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"skeleton","aria-hidden":!0,className:(0,a.classNames)("animate-pulse rounded-sm bg-secondary [animation-duration:var(--duration-pulse)] motion-reduce:animate-none",e),...s})}])},67874,e=>{"use strict";var t=e.i(843476),a=e.i(965324);e.s(["EmptyState",0,function({title:e,description:s,icon:i,action:n,variant:r="page",className:l}){return"section"===r?(0,t.jsxs)("p",{"data-slot":"empty-state","data-variant":r,className:(0,a.classNames)("rounded-lg border border-border px-4 py-3 text-center text-meta text-muted-foreground",l),children:[e,s?(0,t.jsxs)(t.Fragment,{children:[" ",s]}):null]}):"no-results"===r?(0,t.jsxs)("div",{"data-slot":"empty-state","data-variant":r,className:(0,a.classNames)("flex flex-col items-center gap-2.5 rounded-lg border border-border bg-card px-4 py-6 text-center",l),children:[(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:e}),n]}):(0,t.jsxs)("div",{"data-slot":"empty-state","data-variant":r,className:(0,a.classNames)("flex flex-col items-center gap-3 rounded-lg border border-dashed border-border bg-card px-6 py-10 text-center",l),children:[i?(0,t.jsx)("span",{"aria-hidden":!0,className:"flex size-10 items-center justify-center rounded-lg border border-border bg-muted text-muted-foreground [&_svg]:size-(--size-icon-xl)",children:i}):null,(0,t.jsx)("h2",{className:"text-heading font-semibold text-foreground max-sm:text-heading-touch",children:e}),s?(0,t.jsx)("p",{className:"max-w-96 text-meta text-muted-foreground max-sm:text-body-touch",children:s}):null,n?(0,t.jsx)("div",{className:"mt-1 max-sm:w-full max-sm:[&>*]:w-full",children:n}):null]})}])},188393,e=>{"use strict";var t=e.i(843476),a=e.i(965324),s=e.i(219321);function i(e){return Array.from({length:e},(e,t)=>`row-${String(t)}`)}e.s(["LoadingSkeleton",0,function({variant:e,rows:n=4,label:r="Loading",className:l}){return(0,t.jsxs)("div",{role:"status","data-slot":"loading-skeleton","data-variant":e,className:(0,a.classNames)("w-full",l),children:[(0,t.jsx)("span",{className:"sr-only",children:r}),"table"===e?(0,t.jsxs)("div",{className:"overflow-hidden rounded-lg border border-border bg-card shadow-sm",children:[(0,t.jsx)("div",{className:"h-(--size-row-header) border-b border-border bg-muted"}),i(n).map(e=>(0,t.jsxs)("div",{className:"flex h-(--size-row) items-center gap-8 border-b border-border px-4 last:border-0",children:[(0,t.jsx)(s.Skeleton,{className:"h-2.5 w-24"}),(0,t.jsx)(s.Skeleton,{className:"h-5 w-16"}),(0,t.jsx)(s.Skeleton,{className:"h-5 w-20"}),(0,t.jsx)(s.Skeleton,{className:"h-2.5 w-28"})]},e))]}):null,"cards"===e?(0,t.jsx)("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:i(4).map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)(s.Skeleton,{className:"h-2.5 w-20"}),(0,t.jsx)(s.Skeleton,{className:"h-6 w-10"}),(0,t.jsx)(s.Skeleton,{className:"h-2.5 w-28"})]},e))}):null,"detail"===e?(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)(s.Skeleton,{className:"h-7 w-48"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(s.Skeleton,{className:"h-5 w-20"}),(0,t.jsx)(s.Skeleton,{className:"h-5 w-16"})]}),(0,t.jsx)(s.Skeleton,{className:"h-16 w-full rounded-lg"})]}):null,"list"===e?(0,t.jsx)("div",{className:"overflow-hidden rounded-lg border border-border bg-card",children:i(n).map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-2.5 border-b border-border px-3.5 py-3 last:border-0",children:[(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)(s.Skeleton,{className:"h-3 w-28"}),(0,t.jsx)(s.Skeleton,{className:"h-5 w-16"})]}),(0,t.jsx)(s.Skeleton,{className:"h-2.5 w-44"})]},e))}):null]})}])},78865,e=>{"use strict";var t=e.i(843476),a=e.i(749655),s=e.i(987255),i=e.i(876561),n=e.i(847211),r=e.i(422768),l=e.i(450092),d=e.i(536604),o=e.i(119002),c=e.i(832297),u=e.i(821048),h=e.i(474544),m=e.i(285595),p=e.i(152886),y=e.i(426391),g=e.i(519647),f=e.i(316984),x=e.i(710001),b=e.i(671028),k=e.i(981658),v=e.i(444594),w=e.i(611568),j=e.i(25799),N=e.i(985512),C=e.i(457665),S=e.i(395925),M=e.i(485627),z=e.i(466787),I=e.i(892870),R=e.i(456420);let q={name:"user-round-search",size:24,node:[["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M2 21a8 8 0 0 1 10.434-7.62",key:"1yezr2"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["path",{d:"m22 22-1.9-1.9",key:"1e5ubv"}]]};q.node;let A=(0,R.default)(q);var D=e.i(965324),K=e.i(766390);let L={waiting:"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg",active:"border-tone-active-border bg-tone-active-bg text-tone-active-fg",ok:"border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg",attention:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg",ended:"border-tone-ended-border bg-tone-ended-bg text-tone-ended-fg"},P={awaitingCrew:{tone:"waiting",Icon:p.CircleDashed,label:"Awaiting crew"},crewed:{tone:"ok",Icon:I.UserCheck,label:"Crewed"},retired:{tone:"ended",Icon:i.Archive,label:"Retired"},pending:{tone:"waiting",Icon:k.Hourglass,label:"Pending"},received:{tone:"active",Icon:v.Inbox,label:"Received"},handed:{tone:"active",Icon:l.CircleArrowRight,label:"Handed (pulled)"},handedPushed:{tone:"active",Icon:l.CircleArrowRight,label:"Handed"},overdue:{tone:"attention",Icon:a.AlarmClock,label:"Overdue"},acknowledged:{tone:"ok",Icon:m.CircleCheck,label:"Acknowledged"},handled:{tone:"ok",Icon:d.CircleCheckBig,label:"Handled"},notHandled:{tone:"attention",Icon:r.CircleAlert,label:"Not handled"},undeliverable:{tone:"attention",Icon:f.CircleX,label:"Undeliverable"},dismissed:{tone:"ended",Icon:g.CircleMinus,label:"Dismissed"},abandoned:{tone:"ended",Icon:n.Ban,label:"Abandoned"},forming:{tone:"waiting",Icon:y.CircleDotDashed,label:"Forming"},sailing:{tone:"ok",Icon:M.Sailboat,label:"Sailing"},"standing-down":{tone:"active",Icon:s.Anchor,label:"Standing down"},disbanded:{tone:"ended",Icon:x.FlagOff,label:"Disbanded"},"at-limit":{tone:"waiting",Icon:b.Gauge,label:"At limit"},"over-limit":{tone:"attention",Icon:z.TriangleAlert,label:"Over limit"},needsCrew:{tone:"waiting",Icon:h.Clock,label:"Needs crew"},crewedByHand:{tone:"ok",Icon:I.UserCheck,label:"Crewed by hand"},crewing:{tone:"active",Icon:w.LoaderCircle,label:"Crewing"},running:{tone:"ok",Icon:c.CirclePlay,label:"Running"},restarting:{tone:"waiting",Icon:S.RotateCcw,label:"Restarting"},crashed:{tone:"attention",Icon:f.CircleX,label:"Crashed"},releasing:{tone:"active",Icon:C.Power,label:"Releasing"},stuck:{tone:"attention",Icon:N.OctagonAlert,label:"Stuck"},delivering:{tone:"ok",Icon:j.MailCheck,label:"Delivering"},noShipCanTake:{tone:"attention",Icon:u.CircleSlash,label:"No ship can take"},waitingForCrew:{tone:"waiting",Icon:A,label:"Waiting for crew"},stalledInFlight:{tone:"waiting",Icon:o.CirclePause,label:"Stalled in flight"}};e.s(["StatusBadge",0,function({status:e,className:a}){let{tone:s,Icon:i,label:n}=P[e];return(0,t.jsxs)(K.Badge,{variant:"outline","data-slot":"status-badge","data-status":e,className:(0,D.classNames)(L[s],"abandoned"===e?"border-dashed":void 0,a),children:[(0,t.jsx)(i,{"aria-hidden":!0}),n]})},"statusLabel",0,function(e){return P[e].label}],78865)},577880,485538,e=>{"use strict";var t=e.i(843476),a=e.i(566595),s=e.i(374368),i=e.i(574296),n=e.i(298260),r=e.i(704974),l=e.i(965324);function d({switcher:e,account:o,onSearch:c,searchLabel:u="Search or jump to",children:h,actions:m,className:p}){return(0,t.jsxs)("header",{"data-slot":"app-header",className:(0,l.classNames)("sticky top-0 z-30 flex h-(--size-header) shrink-0 items-center justify-between gap-4 border-b border-border bg-background px-6",p),children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[void 0===e?(0,t.jsx)("span",{"data-testid":"app-switcher-loading","aria-hidden":!0,className:"h-4 w-36 shrink-0 animate-pulse rounded bg-muted motion-reduce:animate-none"}):(0,t.jsx)(s.AppSwitcher,{switcher:e,layout:"full",className:"shrink-0"}),h]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-3",children:[m,c?(0,t.jsxs)(i.Button,{size:"sm",icon:(0,t.jsx)(a.Search,{"aria-hidden":!0}),"data-testid":"header-search",className:"w-60 justify-start font-normal text-muted-foreground max-lg:w-auto",onClick:c,children:[(0,t.jsx)("span",{className:"grow text-left max-lg:sr-only",children:u}),(0,t.jsx)(n.Kbd,{children:"⌘K"})]}):null,(0,t.jsx)(r.AvatarMenu,{...o})]})]})}var o=e.i(867927),c=e.i(819759),u=e.i(522016);let h={live:{label:"Live",dot:"bg-tone-ok-fg"},reconnecting:{label:"Reconnecting",dot:"bg-tone-waiting-fg"},offline:{label:"Offline",dot:"bg-tone-attention-fg"}};function m({state:e,className:a}){let{label:s,dot:i}=h[e];return(0,t.jsxs)("span",{"data-slot":"live-status","data-state":e,"aria-live":"polite",className:(0,l.classNames)("inline-flex items-center gap-1.5 text-meta text-muted-foreground",a),children:[(0,t.jsx)("span",{"aria-hidden":!0,className:(0,l.classNames)("size-2 shrink-0 rounded-full",i)}),s]})}e.s(["Header",0,function({breadcrumb:e,parents:a=[],live:s,switcher:n,account:r,onCompose:l,onSearch:h}){return(0,t.jsxs)(d,{switcher:n,account:r,onSearch:h,searchLabel:"Search ships or jump to",className:"hidden sm:flex",actions:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m,{state:s}),l?(0,t.jsx)(i.Button,{size:"sm",icon:(0,t.jsx)(c.SquarePen,{"aria-hidden":!0}),"data-testid":"header-compose",onClick:l,children:"Compose"}):null]}),children:[(0,t.jsx)(o.ChevronRight,{"aria-hidden":!0,className:"size-3.5 shrink-0 text-muted-foreground"}),(0,t.jsx)("nav",{"aria-label":"Breadcrumb","data-testid":"header-breadcrumb",className:"min-w-0 text-body",children:(0,t.jsxs)("ol",{className:"flex min-w-0 items-center gap-1.5",children:[a.map(e=>(0,t.jsxs)("li",{className:"flex shrink-0 items-center gap-1.5",children:[(0,t.jsx)(u.default,{href:e.href,className:"text-muted-foreground hover:text-foreground hover:underline",children:e.label}),(0,t.jsx)(o.ChevronRight,{"aria-hidden":!0,className:"size-3.5 text-muted-foreground"})]},e.href)),(0,t.jsx)("li",{"aria-current":"page",className:"truncate font-medium text-foreground",children:e})]})})]})}],577880);var p=e.i(24071);e.s(["TopBar",0,function({title:e,live:n,actions:l,back:d,switcher:o,account:c,onSearch:h}){let y=h&&!d?h:void 0;return(0,t.jsxs)("header",{"data-slot":"top-bar","data-mode":d?"detail":"root",className:"sticky top-0 z-30 flex h-(--size-header) items-center gap-2.5 border-b border-border bg-background px-4 sm:hidden",children:[d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.default,{href:d.href,className:"-ml-1.5 inline-flex h-(--size-control-touch) shrink-0 items-center gap-0.5 rounded-md pr-2 text-body-touch text-foreground focus-visible:outline-2 focus-visible:outline-ring [&_svg]:size-(--size-icon)",children:[(0,t.jsx)(p.ChevronLeft,{"aria-hidden":!0}),d.label]}),(0,t.jsx)("p",{className:"min-w-0 flex-1 truncate text-center text-body-touch font-semibold text-foreground",children:e})]}):o?(0,t.jsx)(s.AppSwitcher,{switcher:o,layout:"compact",className:"min-w-0"}):(0,t.jsx)("p",{className:"truncate px-1.5 text-title-touch font-semibold text-foreground",children:"Console"}),(0,t.jsx)(m,{state:n}),l||y||c&&!d?(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[y?(0,t.jsx)(i.Button,{variant:"ghost",size:"touch",isIconOnly:!0,"aria-label":"Search ships or jump to","data-testid":"top-bar-search",onClick:y,children:(0,t.jsx)(a.Search,{"aria-hidden":!0})}):null,l,c&&!d?(0,t.jsx)(r.AvatarMenuSheet,{...c}):null]}):null]})}],485538)},718423,e=>{"use strict";var t=e.i(912598),a=e.i(905861),s=e.i(271645),i=e.i(586413),n=e.i(123938),r=e.i(427702);let l=new Set(["FleetInitialised","ShipCommissioned","ShipClaimed","LeaseRevoked","CredentialRevoked","StartingPromptIssued","ShipRetired","DeliveryAcknowledged","DeliveryUndeliverable","ShipReported","CrewRequested","CrewRequestRemoved","CrewAssigned","CrewStatusChanged","CrewRequestExplained","CrewRequestGivenBack","LabelAssigned","LabelUnassigned","LabelRetired"]);function d(e,t){return e.pages.some(e=>e.items.some(e=>e.id===t))}let o=new Set(["LabelDefined","LabelValuesChanged","LabelRetired","LabelAssigned","LabelUnassigned","LabelDeleted"]),c=new Set(["DeliveryUndeliverable","DeliveryNotHandled","DeliveryDismissed"]),u=new Set(["NetworkRulesSet","NetworkRulesDraftSaved","NetworkRulesDraftDiscarded","NetworkRulesDeclared","BuiltInRuleChanged"]);e.s(["useLiveFleet",0,function(){let e=(0,r.useTRPC)(),h=(0,t.useQueryClient)(),[m,p]=(0,s.useState)(new Set),y=(0,n.useIsReopening)(),[g]=(0,s.useState)(()=>{let t,a,s,n;return function(e){var t;let a,s,n,{trpc:r,queryClient:h,reload:m}=e,p=[...r.fleet.list.infiniteQueryKey()],y=()=>h.getQueriesData({queryKey:p}).flatMap(([,e])=>void 0===e?[]:[e]),g=(t={readRow:e=>h.query({...r.fleet.listedShip.queryOptions({shipId:e}),staleTime:0}),writeRow:t=>{let a=y().some(e=>!d(e,t.id));h.setQueriesData({queryKey:p},e=>e&&function(e,t){if(d(e,t.id))return{...e,pages:e.pages.map(e=>{var a;return{...e,items:(a=e.items,a.map(e=>e.id===t.id?t:e))}})};let[a,...s]=e.pages;return void 0===a?e:{...e,pages:[{...a,items:[t,...a.items]},...s]}}(e,t)),a&&e.onPlacedFirst(t.id)}},a=new Set,s=new Set,n=async e=>{a.add(e);try{do s.delete(e),t.writeRow(await t.readRow(e));while(s.has(e))}catch{}finally{a.delete(e),s.delete(e)}},e=>{a.has(e)?s.add(e):n(e)}),f=()=>{m(r.fleet.stuckCount.queryKey()),m(r.fleet.stuckSummary.queryKey()),m(r.fleet.stuck.pathKey())};return e=>{var t,a,s,n,d;if("resync"===e.kind){m(r.fleet.pathKey()),m(i.INBOX_KEY);return}let{event:h}=e;for(let e of new Set([h.shipId,h.actorShipId]))null!==e&&(m(r.fleet.ship.queryKey({shipId:e})),m(r.fleet.shipTimeline.infiniteQueryKey({shipId:e})),m(r.fleet.shipWay.queryKey({shipId:e})));if(null!==h.messageId&&(m(r.fleet.shipMessages.pathKey()),m(r.fleet.shipWay.pathKey()),m(r.fleet.message.queryKey({messageId:h.messageId})),m(r.fleet.inbox.pathKey()),m(r.fleet.inboxCount.queryKey()),m(i.INBOX_KEY),f()),"DeliveryAcknowledged"===h.type&&m(r.fleet.acknowledged.queryKey()),t=h.type,c.has(t)&&m(r.fleet.needsAttention.pathKey()),a=h.type,o.has(a)&&m(r.fleet.labels.queryKey()),"NetworkRulesDeclared"===h.type&&m(r.fleet.declaredNetworkRules.queryKey()),("BuiltInRuleChanged"===(s=h.type)||"NetworkRulesSet"===s)&&m(r.fleet.builtInRules.queryKey()),n=h.type,u.has(n)&&(m(r.fleet.networkRules.queryKey()),m(r.fleet.networkRulesDraftChanges.queryKey()),m(r.fleet.explainReach.pathKey())),d=h.type,l.has(d)){if(y().length>0)for(let e of new Set([h.shipId,h.actorShipId]))null!==e&&g(e);m(r.fleet.shipCounts.pathKey()),f()}}}({trpc:e,queryClient:h,reload:(t=new Set,a=new Set,s=e=>h.invalidateQueries({queryKey:e,exact:!0},{cancelRefetch:!1}),n=async e=>{t.add(e.queryHash);let i=e.isBehind;try{for(await s(e.queryKey);i||a.delete(e.queryHash);)i=!1,await s(e.queryKey)}finally{t.delete(e.queryHash)}},e=>{for(let s of h.getQueryCache().findAll({queryKey:e}))t.has(s.queryHash)?a.add(s.queryHash):n({queryHash:s.queryHash,queryKey:s.queryKey,isBehind:"fetching"===s.state.fetchStatus})}),onPlacedFirst:e=>{p(t=>new Set([...t,e]))}})}),f=(0,a.useSubscription)(e.fleet.events.subscriptionOptions({lastEventId:null},{onData:({data:e})=>{g(e)}}));return{live:"connecting"===f.status&&y?"live":function(e){switch(e){case"pending":return"live";case"connecting":return"reconnecting";case"idle":case"error":return"offline"}}(f.status),placedFirstShipIds:m,error:f.error}}])},928459,e=>{"use strict";var t=e.i(621482),a=e.i(954616),s=e.i(912598),i=e.i(731877),n=e.i(427702);function r(e){let t=String(e.attempts-1);return e.isPushed?`Handed ${t} times, never confirmed; fifth refused: undeliverable.`:`Handed (pulled) ${t} times, never acknowledged; fifth receive refused: undeliverable.`}let l="Acknowledged, then its turn died; handed once more, and that turn died too: not handled.";function d(){let e=(0,n.useTRPC)(),t=(0,s.useQueryClient)();return()=>t.invalidateQueries({queryKey:e.fleet.pathKey()})}e.s(["DISMISSED_TOAST",0,{title:"Delivery dismissed",description:"It stays in the timelines as dismissed."},"attentionReason",0,function(e){switch(e.state){case"undeliverable":return r(e);case"notHandled":return null===e.reason?l:`${l} Its crew said: ${e.reason}.`}},"canResend",0,function(e){return!e.message.isPing},"deliveryWithId",0,function(e,t){return e?.find(e=>e.deliveryId===t)},"resentToast",0,function(e){return{title:"Message resent",description:`A new message went to ${function(e){let{recipient:t}=e.message;return"ship"===t.kind?t.ship.name:`any ship of type ${t.type}`}(e)}. The original is dismissed.`}},"undeliverableReason",0,r,"useDismissDelivery",0,function(){let e=(0,n.useTRPC)(),t=d();return(0,a.useMutation)(e.fleet.dismiss.mutationOptions({onSuccess:t}))},"useNeedsAttention",0,function(e={}){let a=(0,n.useTRPC)();return(0,i.pagedListOf)((0,t.useInfiniteQuery)(a.fleet.needsAttention.infiniteQueryOptions({...e,limit:i.CONSOLE_PAGE_SIZE},{getNextPageParam:i.nextCursorOf})))},"useResendDelivery",0,function(){let e=(0,n.useTRPC)(),t=d();return(0,a.useMutation)(e.fleet.resend.mutationOptions({onSuccess:t}))}])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,395530,e=>{"use strict";var t=e.i(271645),a=e.i(828918),s=e.i(838452),i=e.i(673553);e.s(["useCompositeItem",0,function(e={}){let{highlightItemOnHover:n,highlightedIndex:r,onHighlightedIndexChange:l}=(0,s.useCompositeRootContext)(),{ref:d,index:o}=(0,i.useCompositeListItem)(e),c=r===o,u=t.useRef(null),h=(0,a.useMergedRefs)(d,u);return{compositeProps:{tabIndex:c?0:-1,onFocus(){l(o)},onMouseMove(){let e=u.current;if(!n||!e)return;let t=e.hasAttribute("disabled")||"true"===e.ariaDisabled;c||t||e.focus()}},compositeRef:h,index:o}}])},749655,987255,450092,536604,e=>{"use strict";var t=e.i(456420);let a={name:"alarm-clock",size:24,node:[["circle",{cx:"12",cy:"13",r:"8",key:"3y4lt7"}],["path",{d:"M12 9v4l2 2",key:"1c63tq"}],["path",{d:"M5 3 2 6",key:"18tl5t"}],["path",{d:"m22 6-3-3",key:"1opdir"}],["path",{d:"M6.38 18.7 4 21",key:"17xu3x"}],["path",{d:"M17.64 18.67 20 21",key:"kv2oe2"}]]};a.node;let s=(0,t.default)(a);e.s(["AlarmClock",0,s],749655);let i={name:"anchor",size:24,node:[["path",{d:"M12 6v16",key:"nqf5sj"}],["path",{d:"m19 13 2-1a9 9 0 0 1-18 0l2 1",key:"y7qv08"}],["path",{d:"M9 11h6",key:"1fldmi"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}]]};i.node;let n=(0,t.default)(i);e.s(["Anchor",0,n],987255);let r={name:"circle-arrow-right",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m12 16 4-4-4-4",key:"1i9zcv"}],["path",{d:"M8 12h8",key:"1wcyev"}]],aliases:["arrow-right-circle"]};r.node;let l=(0,t.default)(r);e.s(["CircleArrowRight",0,l],450092);let d={name:"circle-check-big",size:24,node:[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],aliases:["check-circle"]};d.node;let o=(0,t.default)(d);e.s(["CircleCheckBig",0,o],536604)},876561,e=>{"use strict";var t=e.i(456420);let a={name:"archive",size:24,node:[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]};a.node;let s=(0,t.default)(a);e.s(["Archive",0,s],876561)},847211,e=>{"use strict";var t=e.i(456420);let a={name:"ban",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]]};a.node;let s=(0,t.default)(a);e.s(["Ban",0,s],847211)},24071,e=>{"use strict";var t=e.i(456420);let a={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};a.node;let s=(0,t.default)(a);e.s(["ChevronLeft",0,s],24071)},867927,e=>{"use strict";var t=e.i(456420);let a={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};a.node;let s=(0,t.default)(a);e.s(["ChevronRight",0,s],867927)},152886,e=>{"use strict";var t=e.i(456420);let a={name:"circle-dashed",size:24,node:[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]};a.node;let s=(0,t.default)(a);e.s(["CircleDashed",0,s],152886)},119002,e=>{"use strict";var t=e.i(456420);let a={name:"circle-pause",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],aliases:["pause-circle"]};a.node;let s=(0,t.default)(a);e.s(["CirclePause",0,s],119002)},832297,426391,519647,710001,25799,e=>{"use strict";var t=e.i(456420);let a={name:"circle-play",size:24,node:[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],aliases:["play-circle"]};a.node;let s=(0,t.default)(a);e.s(["CirclePlay",0,s],832297);let i={name:"circle-dot-dashed",size:24,node:[["path",{d:"M10.1 2.18a9.93 9.93 0 0 1 3.8 0",key:"1qdqn0"}],["path",{d:"M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7",key:"1bq7p6"}],["path",{d:"M21.82 10.1a9.93 9.93 0 0 1 0 3.8",key:"1rlaqf"}],["path",{d:"M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69",key:"1xk03u"}],["path",{d:"M13.9 21.82a9.94 9.94 0 0 1-3.8 0",key:"l7re25"}],["path",{d:"M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7",key:"1v18p6"}],["path",{d:"M2.18 13.9a9.93 9.93 0 0 1 0-3.8",key:"xdo6bj"}],["path",{d:"M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69",key:"1jjmaz"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};i.node;let n=(0,t.default)(i);e.s(["CircleDotDashed",0,n],426391);let r={name:"circle-minus",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],aliases:["minus-circle"]};r.node;let l=(0,t.default)(r);e.s(["CircleMinus",0,l],519647);let d={name:"flag-off",size:24,node:[["path",{d:"M16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1q158e"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M4 22V4",key:"1plyxx"}],["path",{d:"M7.656 2H8c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10.347",key:"xj1b71"}]]};d.node;let o=(0,t.default)(d);e.s(["FlagOff",0,o],710001);let c={name:"mail-check",size:24,node:[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8",key:"12jkf8"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]]};c.node;let u=(0,t.default)(c);e.s(["MailCheck",0,u],25799)},275043,446513,e=>{"use strict";var t=e.i(456420);let a={name:"circle-question-mark",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["help-circle","circle-help"]};a.node;let s=(0,t.default)(a);e.s(["default",0,s],275043);let i={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};i.node;let n=(0,t.default)(i);e.s(["Monitor",0,n],446513)},821048,e=>{"use strict";var t=e.i(456420);let a={name:"circle-slash",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]]};a.node;let s=(0,t.default)(a);e.s(["CircleSlash",0,s],821048)},316984,e=>{"use strict";var t=e.i(456420);let a={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};a.node;let s=(0,t.default)(a);e.s(["CircleX",0,s],316984)},474544,e=>{"use strict";var t=e.i(456420);let a={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};a.node;let s=(0,t.default)(a);e.s(["Clock",0,s],474544)},671028,e=>{"use strict";var t=e.i(456420);let a={name:"gauge",size:24,node:[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]};a.node;let s=(0,t.default)(a);e.s(["Gauge",0,s],671028)},981658,e=>{"use strict";var t=e.i(456420);let a={name:"hourglass",size:24,node:[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]};a.node;let s=(0,t.default)(a);e.s(["Hourglass",0,s],981658)},985512,e=>{"use strict";var t=e.i(456420);let a={name:"octagon-alert",size:24,node:[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],aliases:["alert-octagon"]};a.node;let s=(0,t.default)(a);e.s(["OctagonAlert",0,s],985512)},457665,e=>{"use strict";var t=e.i(456420);let a={name:"power",size:24,node:[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]};a.node;let s=(0,t.default)(a);e.s(["Power",0,s],457665)},395925,485627,e=>{"use strict";var t=e.i(456420);let a={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};a.node;let s=(0,t.default)(a);e.s(["RotateCcw",0,s],395925);let i={name:"sailboat",size:24,node:[["path",{d:"M10 2v15",key:"1qf71f"}],["path",{d:"M7 22a4 4 0 0 1-4-4 1 1 0 0 1 1-1h16a1 1 0 0 1 1 1 4 4 0 0 1-4 4z",key:"1pxcvx"}],["path",{d:"M9.159 2.46a1 1 0 0 1 1.521-.193l9.977 8.98A1 1 0 0 1 20 13H4a1 1 0 0 1-.824-1.567z",key:"5oog16"}]]};i.node;let n=(0,t.default)(i);e.s(["Sailboat",0,n],485627)},566595,e=>{"use strict";var t=e.i(456420);let a={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};a.node;let s=(0,t.default)(a);e.s(["Search",0,s],566595)},819759,e=>{"use strict";var t=e.i(456420);let a={name:"square-pen",size:24,node:[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aliases:["pen-box","edit","pen-square"]};a.node;let s=(0,t.default)(a);e.s(["SquarePen",0,s],819759)},466787,e=>{"use strict";var t=e.i(456420);let a={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};a.node;let s=(0,t.default)(a);e.s(["TriangleAlert",0,s],466787)},594831,e=>{"use strict";var t=e.i(456420);let a={name:"unplug",size:24,node:[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]};a.node;let s=(0,t.default)(a);e.s(["Unplug",0,s],594831)},892870,e=>{"use strict";var t=e.i(456420);let a={name:"user-check",size:24,node:[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};a.node;let s=(0,t.default)(a);e.s(["UserCheck",0,s],892870)},298260,e=>{"use strict";var t=e.i(843476),a=e.i(965324);e.s(["Kbd",0,function({className:e,...s}){return(0,t.jsx)("kbd",{"data-slot":"kbd",className:(0,a.classNames)("inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-xs border border-border bg-muted px-1.25 font-sans text-micro font-medium text-muted-foreground max-sm:hidden",e),...s})}])},638919,e=>{"use strict";var t=e.i(843476),a=e.i(353753),s=e.i(225913),i=e.i(560964),n=e.i(965324),r=e.i(574296);let l=(0,s.cva)("fixed z-50 flex flex-col bg-popover text-body text-popover-foreground shadow-lg outline-none duration-(--duration-slow) ease-(--ease-standard) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",{variants:{side:{right:"inset-y-0 right-0 h-full w-full border-l border-border sm:max-w-(--size-sheet) motion-safe:data-open:slide-in-from-right motion-safe:data-closed:slide-out-to-right",bottom:"inset-x-0 bottom-0 max-h-[90dvh] rounded-t-2xl border-t border-border px-4 pt-2 pb-[max(calc(var(--spacing)*4),env(safe-area-inset-bottom))] motion-safe:data-open:slide-in-from-bottom motion-safe:data-closed:slide-out-to-bottom"}},defaultVariants:{side:"right"}});e.s(["Sheet",0,function(e){return(0,t.jsx)(a.Dialog.Root,{"data-slot":"sheet",...e})},"SheetBody",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sheet-body",className:(0,n.classNames)("min-h-0 flex-1 overflow-y-auto in-data-[side=right]:p-6",e),...a})},"SheetClose",0,function(e){return(0,t.jsx)(a.Dialog.Close,{"data-slot":"sheet-close",...e})},"SheetContent",0,function({className:e,children:s,side:d="right",...o}){return(0,t.jsxs)(a.Dialog.Portal,{children:[(0,t.jsx)(a.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:"fixed inset-0 z-50 bg-overlay duration-(--duration-slow) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0"}),(0,t.jsxs)(a.Dialog.Popup,{"data-slot":"sheet-content","data-side":d,className:(0,n.classNames)(l({side:d}),e),...o,children:["bottom"===d?(0,t.jsx)("div",{"aria-hidden":!0,className:"mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-border"}):(0,t.jsx)(a.Dialog.Close,{"data-slot":"sheet-close",render:(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",isIconOnly:!0,className:"absolute top-4 right-4","aria-label":"Close"}),children:(0,t.jsx)(i.XIcon,{})}),s]})]})},"SheetDescription",0,function({className:e,...s}){return(0,t.jsx)(a.Dialog.Description,{"data-slot":"sheet-description",className:(0,n.classNames)("text-meta text-muted-foreground",e),...s})},"SheetFooter",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sheet-footer",className:(0,n.classNames)("flex flex-col-reverse gap-2 pt-3 in-data-[side=right]:flex-row in-data-[side=right]:justify-end in-data-[side=right]:border-t in-data-[side=right]:px-6 in-data-[side=right]:py-4",e),...a})},"SheetHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,n.classNames)("flex flex-col gap-0.5 in-data-[side=right]:border-b in-data-[side=right]:px-6 in-data-[side=right]:py-5 in-data-[side=right]:pr-14",e),...a})},"SheetTitle",0,function({className:e,...s}){return(0,t.jsx)(a.Dialog.Title,{"data-slot":"sheet-title",className:(0,n.classNames)("text-heading font-semibold text-foreground in-data-[side=bottom]:py-2 in-data-[side=bottom]:text-section",e),...s})},"SheetTrigger",0,function(e){return(0,t.jsx)(a.Dialog.Trigger,{"data-slot":"sheet-trigger",...e})}])},219321,e=>{"use strict";var t=e.i(843476),a=e.i(965324);e.s(["Skeleton",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"skeleton","aria-hidden":!0,className:(0,a.classNames)("animate-pulse rounded-sm bg-secondary [animation-duration:var(--duration-pulse)] motion-reduce:animate-none",e),...s})}])},67874,e=>{"use strict";var t=e.i(843476),a=e.i(965324);e.s(["EmptyState",0,function({title:e,description:s,icon:i,action:n,variant:r="page",className:l}){return"section"===r?(0,t.jsxs)("p",{"data-slot":"empty-state","data-variant":r,className:(0,a.classNames)("rounded-lg border border-border px-4 py-3 text-center text-meta text-muted-foreground",l),children:[e,s?(0,t.jsxs)(t.Fragment,{children:[" ",s]}):null]}):"no-results"===r?(0,t.jsxs)("div",{"data-slot":"empty-state","data-variant":r,className:(0,a.classNames)("flex flex-col items-center gap-2.5 rounded-lg border border-border bg-card px-4 py-6 text-center",l),children:[(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:e}),n]}):(0,t.jsxs)("div",{"data-slot":"empty-state","data-variant":r,className:(0,a.classNames)("flex flex-col items-center gap-3 rounded-lg border border-dashed border-border bg-card px-6 py-10 text-center",l),children:[i?(0,t.jsx)("span",{"aria-hidden":!0,className:"flex size-10 items-center justify-center rounded-lg border border-border bg-muted text-muted-foreground [&_svg]:size-(--size-icon-xl)",children:i}):null,(0,t.jsx)("h2",{className:"text-heading font-semibold text-foreground max-sm:text-heading-touch",children:e}),s?(0,t.jsx)("p",{className:"max-w-96 text-meta text-muted-foreground max-sm:text-body-touch",children:s}):null,n?(0,t.jsx)("div",{className:"mt-1 max-sm:w-full max-sm:[&>*]:w-full",children:n}):null]})}])},188393,e=>{"use strict";var t=e.i(843476),a=e.i(965324),s=e.i(219321);function i(e){return Array.from({length:e},(e,t)=>`row-${String(t)}`)}e.s(["LoadingSkeleton",0,function({variant:e,rows:n=4,label:r="Loading",className:l}){return(0,t.jsxs)("div",{role:"status","data-slot":"loading-skeleton","data-variant":e,className:(0,a.classNames)("w-full",l),children:[(0,t.jsx)("span",{className:"sr-only",children:r}),"table"===e?(0,t.jsxs)("div",{className:"overflow-hidden rounded-lg border border-border bg-card shadow-sm",children:[(0,t.jsx)("div",{className:"h-(--size-row-header) border-b border-border bg-muted"}),i(n).map(e=>(0,t.jsxs)("div",{className:"flex h-(--size-row) items-center gap-8 border-b border-border px-4 last:border-0",children:[(0,t.jsx)(s.Skeleton,{className:"h-2.5 w-24"}),(0,t.jsx)(s.Skeleton,{className:"h-5 w-16"}),(0,t.jsx)(s.Skeleton,{className:"h-5 w-20"}),(0,t.jsx)(s.Skeleton,{className:"h-2.5 w-28"})]},e))]}):null,"cards"===e?(0,t.jsx)("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:i(4).map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)(s.Skeleton,{className:"h-2.5 w-20"}),(0,t.jsx)(s.Skeleton,{className:"h-6 w-10"}),(0,t.jsx)(s.Skeleton,{className:"h-2.5 w-28"})]},e))}):null,"detail"===e?(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)(s.Skeleton,{className:"h-7 w-48"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(s.Skeleton,{className:"h-5 w-20"}),(0,t.jsx)(s.Skeleton,{className:"h-5 w-16"})]}),(0,t.jsx)(s.Skeleton,{className:"h-16 w-full rounded-lg"})]}):null,"list"===e?(0,t.jsx)("div",{className:"overflow-hidden rounded-lg border border-border bg-card",children:i(n).map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-2.5 border-b border-border px-3.5 py-3 last:border-0",children:[(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)(s.Skeleton,{className:"h-3 w-28"}),(0,t.jsx)(s.Skeleton,{className:"h-5 w-16"})]}),(0,t.jsx)(s.Skeleton,{className:"h-2.5 w-44"})]},e))}):null]})}])},78865,e=>{"use strict";var t=e.i(843476),a=e.i(749655),s=e.i(987255),i=e.i(876561),n=e.i(847211),r=e.i(422768),l=e.i(450092),d=e.i(536604),o=e.i(119002),c=e.i(832297),u=e.i(821048),h=e.i(474544),m=e.i(285595),p=e.i(152886),y=e.i(426391),g=e.i(519647),f=e.i(316984),x=e.i(710001),b=e.i(671028),k=e.i(981658),v=e.i(444594),w=e.i(611568),j=e.i(25799),N=e.i(985512),C=e.i(457665),S=e.i(395925),M=e.i(485627),z=e.i(466787),I=e.i(892870),R=e.i(456420);let q={name:"user-round-search",size:24,node:[["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M2 21a8 8 0 0 1 10.434-7.62",key:"1yezr2"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["path",{d:"m22 22-1.9-1.9",key:"1e5ubv"}]]};q.node;let A=(0,R.default)(q);var D=e.i(965324),K=e.i(766390);let L={waiting:"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg",active:"border-tone-active-border bg-tone-active-bg text-tone-active-fg",ok:"border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg",attention:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg",ended:"border-tone-ended-border bg-tone-ended-bg text-tone-ended-fg"},P={awaitingCrew:{tone:"waiting",Icon:p.CircleDashed,label:"Awaiting crew"},crewed:{tone:"ok",Icon:I.UserCheck,label:"Crewed"},retired:{tone:"ended",Icon:i.Archive,label:"Retired"},pending:{tone:"waiting",Icon:k.Hourglass,label:"Pending"},received:{tone:"active",Icon:v.Inbox,label:"Received"},handed:{tone:"active",Icon:l.CircleArrowRight,label:"Handed (pulled)"},handedPushed:{tone:"active",Icon:l.CircleArrowRight,label:"Handed"},overdue:{tone:"attention",Icon:a.AlarmClock,label:"Overdue"},acknowledged:{tone:"ok",Icon:m.CircleCheck,label:"Acknowledged"},handled:{tone:"ok",Icon:d.CircleCheckBig,label:"Handled"},notHandled:{tone:"attention",Icon:r.CircleAlert,label:"Not handled"},undeliverable:{tone:"attention",Icon:f.CircleX,label:"Undeliverable"},dismissed:{tone:"ended",Icon:g.CircleMinus,label:"Dismissed"},abandoned:{tone:"ended",Icon:n.Ban,label:"Abandoned"},forming:{tone:"waiting",Icon:y.CircleDotDashed,label:"Forming"},sailing:{tone:"ok",Icon:M.Sailboat,label:"Sailing"},"standing-down":{tone:"active",Icon:s.Anchor,label:"Standing down"},disbanded:{tone:"ended",Icon:x.FlagOff,label:"Disbanded"},"at-limit":{tone:"waiting",Icon:b.Gauge,label:"At limit"},"over-limit":{tone:"attention",Icon:z.TriangleAlert,label:"Over limit"},needsCrew:{tone:"waiting",Icon:h.Clock,label:"Needs crew"},crewedByHand:{tone:"ok",Icon:I.UserCheck,label:"Crewed by hand"},crewing:{tone:"active",Icon:w.LoaderCircle,label:"Crewing"},running:{tone:"ok",Icon:c.CirclePlay,label:"Running"},restarting:{tone:"waiting",Icon:S.RotateCcw,label:"Restarting"},crashed:{tone:"attention",Icon:f.CircleX,label:"Crashed"},releasing:{tone:"active",Icon:C.Power,label:"Releasing"},stuck:{tone:"attention",Icon:N.OctagonAlert,label:"Stuck"},delivering:{tone:"ok",Icon:j.MailCheck,label:"Delivering"},noShipCanTake:{tone:"attention",Icon:u.CircleSlash,label:"No ship can take"},waitingForCrew:{tone:"waiting",Icon:A,label:"Waiting for crew"},stalledInFlight:{tone:"waiting",Icon:o.CirclePause,label:"Stalled in flight"}};e.s(["StatusBadge",0,function({status:e,className:a}){let{tone:s,Icon:i,label:n}=P[e];return(0,t.jsxs)(K.Badge,{variant:"outline","data-slot":"status-badge","data-status":e,className:(0,D.classNames)(L[s],"abandoned"===e?"border-dashed":void 0,a),children:[(0,t.jsx)(i,{"aria-hidden":!0}),n]})},"statusLabel",0,function(e){return P[e].label}],78865)},577880,485538,e=>{"use strict";var t=e.i(843476),a=e.i(566595),s=e.i(374368),i=e.i(574296),n=e.i(298260),r=e.i(704974),l=e.i(965324);function d({switcher:e,account:o,onSearch:c,searchLabel:u="Search or jump to",children:h,actions:m,className:p}){return(0,t.jsxs)("header",{"data-slot":"app-header",className:(0,l.classNames)("sticky top-0 z-30 flex h-(--size-header) shrink-0 items-center justify-between gap-4 border-b border-border bg-background px-6",p),children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[void 0===e?(0,t.jsx)("span",{"data-testid":"app-switcher-loading","aria-hidden":!0,className:"h-4 w-36 shrink-0 animate-pulse rounded bg-muted motion-reduce:animate-none"}):(0,t.jsx)(s.AppSwitcher,{switcher:e,layout:"full",className:"shrink-0"}),h]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-3",children:[m,c?(0,t.jsxs)(i.Button,{size:"sm",icon:(0,t.jsx)(a.Search,{"aria-hidden":!0}),"data-testid":"header-search",className:"w-60 justify-start font-normal text-muted-foreground max-lg:w-auto",onClick:c,children:[(0,t.jsx)("span",{className:"grow text-left max-lg:sr-only",children:u}),(0,t.jsx)(n.Kbd,{children:"⌘K"})]}):null,(0,t.jsx)(r.AvatarMenu,{...o})]})]})}var o=e.i(867927),c=e.i(819759),u=e.i(522016);let h={live:{label:"Live",dot:"bg-tone-ok-fg"},reconnecting:{label:"Reconnecting",dot:"bg-tone-waiting-fg"},offline:{label:"Offline",dot:"bg-tone-attention-fg"}};function m({state:e,className:a}){let{label:s,dot:i}=h[e];return(0,t.jsxs)("span",{"data-slot":"live-status","data-state":e,"aria-live":"polite",className:(0,l.classNames)("inline-flex items-center gap-1.5 text-meta text-muted-foreground",a),children:[(0,t.jsx)("span",{"aria-hidden":!0,className:(0,l.classNames)("size-2 shrink-0 rounded-full",i)}),s]})}e.s(["Header",0,function({breadcrumb:e,parents:a=[],live:s,switcher:n,account:r,onCompose:l,onSearch:h}){return(0,t.jsxs)(d,{switcher:n,account:r,onSearch:h,searchLabel:"Search ships or jump to",className:"hidden sm:flex",actions:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m,{state:s}),l?(0,t.jsx)(i.Button,{size:"sm",icon:(0,t.jsx)(c.SquarePen,{"aria-hidden":!0}),"data-testid":"header-compose",onClick:l,children:"Compose"}):null]}),children:[(0,t.jsx)(o.ChevronRight,{"aria-hidden":!0,className:"size-3.5 shrink-0 text-muted-foreground"}),(0,t.jsx)("nav",{"aria-label":"Breadcrumb","data-testid":"header-breadcrumb",className:"min-w-0 text-body",children:(0,t.jsxs)("ol",{className:"flex min-w-0 items-center gap-1.5",children:[a.map(e=>(0,t.jsxs)("li",{className:"flex shrink-0 items-center gap-1.5",children:[(0,t.jsx)(u.default,{href:e.href,className:"text-muted-foreground hover:text-foreground hover:underline",children:e.label}),(0,t.jsx)(o.ChevronRight,{"aria-hidden":!0,className:"size-3.5 text-muted-foreground"})]},e.href)),(0,t.jsx)("li",{"aria-current":"page",className:"truncate font-medium text-foreground",children:e})]})})]})}],577880);var p=e.i(24071);e.s(["TopBar",0,function({title:e,live:n,actions:l,back:d,switcher:o,account:c,onSearch:h}){let y=h&&!d?h:void 0;return(0,t.jsxs)("header",{"data-slot":"top-bar","data-mode":d?"detail":"root",className:"sticky top-0 z-30 flex h-(--size-header) items-center gap-2.5 border-b border-border bg-background px-4 sm:hidden",children:[d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.default,{href:d.href,className:"-ml-1.5 inline-flex h-(--size-control-touch) shrink-0 items-center gap-0.5 rounded-md pr-2 text-body-touch text-foreground focus-visible:outline-2 focus-visible:outline-ring [&_svg]:size-(--size-icon)",children:[(0,t.jsx)(p.ChevronLeft,{"aria-hidden":!0}),d.label]}),(0,t.jsx)("p",{className:"min-w-0 flex-1 truncate text-center text-body-touch font-semibold text-foreground",children:e})]}):o?(0,t.jsx)(s.AppSwitcher,{switcher:o,layout:"compact",className:"min-w-0"}):(0,t.jsx)("p",{className:"truncate px-1.5 text-title-touch font-semibold text-foreground",children:"Console"}),(0,t.jsx)(m,{state:n}),l||y||c&&!d?(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[y?(0,t.jsx)(i.Button,{variant:"ghost",size:"touch",isIconOnly:!0,"aria-label":"Search ships or jump to","data-testid":"top-bar-search",onClick:y,children:(0,t.jsx)(a.Search,{"aria-hidden":!0})}):null,l,c&&!d?(0,t.jsx)(r.AvatarMenuSheet,{...c}):null]}):null]})}],485538)},718423,e=>{"use strict";var t=e.i(912598),a=e.i(905861),s=e.i(271645),i=e.i(586413),n=e.i(123938),r=e.i(427702);let l=new Set(["FleetInitialised","ShipCommissioned","ShipClaimed","LeaseRevoked","CredentialRevoked","StartingPromptIssued","ShipRetired","DeliveryAcknowledged","DeliveryUndeliverable","ShipReported","CrewRequested","CrewRequestRemoved","CrewAssigned","CrewStatusChanged","CrewRequestExplained","CrewRequestGivenBack","LabelAssigned","LabelUnassigned","LabelRetired"]);function d(e,t){return e.pages.some(e=>e.items.some(e=>e.id===t))}let o=new Set(["LabelDefined","LabelValuesChanged","LabelRetired","LabelAssigned","LabelUnassigned","LabelDeleted"]),c=new Set(["DeliveryUndeliverable","DeliveryNotHandled","DeliveryDismissed"]),u=new Set(["NetworkRulesSet","NetworkRulesDraftSaved","NetworkRulesDraftDiscarded","NetworkRulesDeclared","BuiltInRuleChanged"]);e.s(["useLiveFleet",0,function(){let e=(0,r.useTRPC)(),h=(0,t.useQueryClient)(),[m,p]=(0,s.useState)(new Set),y=(0,n.useIsReopening)(),[g]=(0,s.useState)(()=>{let t,a,s,n;return function(e){var t;let a,s,n,{trpc:r,queryClient:h,reload:m}=e,p=[...r.fleet.list.infiniteQueryKey()],y=()=>h.getQueriesData({queryKey:p}).flatMap(([,e])=>void 0===e?[]:[e]),g=(t={readRow:e=>h.query({...r.fleet.listedShip.queryOptions({shipId:e}),staleTime:0}),writeRow:t=>{let a=y().some(e=>!d(e,t.id));h.setQueriesData({queryKey:p},e=>e&&function(e,t){if(d(e,t.id))return{...e,pages:e.pages.map(e=>{var a;return{...e,items:(a=e.items,a.map(e=>e.id===t.id?t:e))}})};let[a,...s]=e.pages;return void 0===a?e:{...e,pages:[{...a,items:[t,...a.items]},...s]}}(e,t)),a&&e.onPlacedFirst(t.id)}},a=new Set,s=new Set,n=async e=>{a.add(e);try{do s.delete(e),t.writeRow(await t.readRow(e));while(s.has(e))}catch{}finally{a.delete(e),s.delete(e)}},e=>{a.has(e)?s.add(e):n(e)}),f=()=>{m(r.fleet.stuckCount.queryKey()),m(r.fleet.stuckSummary.queryKey()),m(r.fleet.stuck.pathKey())};return e=>{var t,a,s,n,d;if("resync"===e.kind){m(r.fleet.pathKey()),m(i.INBOX_KEY);return}let{event:h}=e;for(let e of new Set([h.shipId,h.actorShipId]))null!==e&&(m(r.fleet.ship.queryKey({shipId:e})),m(r.fleet.shipTimeline.infiniteQueryKey({shipId:e})),m(r.fleet.shipWay.queryKey({shipId:e})));if(null!==h.messageId&&(m(r.fleet.shipMessages.pathKey()),m(r.fleet.shipWay.pathKey()),m(r.fleet.message.queryKey({messageId:h.messageId})),m(r.fleet.inbox.pathKey()),m(r.fleet.inboxCount.queryKey()),m(i.INBOX_KEY),f()),"DeliveryAcknowledged"===h.type&&m(r.fleet.acknowledged.queryKey()),t=h.type,c.has(t)&&m(r.fleet.needsAttention.pathKey()),a=h.type,o.has(a)&&m(r.fleet.labels.queryKey()),"NetworkRulesDeclared"===h.type&&m(r.fleet.declaredNetworkRules.queryKey()),("BuiltInRuleChanged"===(s=h.type)||"NetworkRulesSet"===s)&&m(r.fleet.builtInRules.queryKey()),n=h.type,u.has(n)&&(m(r.fleet.networkRules.queryKey()),m(r.fleet.networkRulesDraftChanges.queryKey()),m(r.fleet.explainReach.pathKey())),d=h.type,l.has(d)){if(y().length>0)for(let e of new Set([h.shipId,h.actorShipId]))null!==e&&g(e);m(r.fleet.shipCounts.pathKey()),f()}}}({trpc:e,queryClient:h,reload:(t=new Set,a=new Set,s=e=>h.invalidateQueries({queryKey:e,exact:!0},{cancelRefetch:!1}),n=async e=>{t.add(e.queryHash);let i=e.isBehind;try{for(await s(e.queryKey);i||a.delete(e.queryHash);)i=!1,await s(e.queryKey)}finally{t.delete(e.queryHash)}},e=>{for(let s of h.getQueryCache().findAll({queryKey:e}))t.has(s.queryHash)?a.add(s.queryHash):n({queryHash:s.queryHash,queryKey:s.queryKey,isBehind:"fetching"===s.state.fetchStatus})}),onPlacedFirst:e=>{p(t=>new Set([...t,e]))}})}),f=(0,a.useSubscription)(e.fleet.events.subscriptionOptions({lastEventId:null},{onData:({data:e})=>{g(e)}}));return{live:"connecting"===f.status&&y?"live":function(e){switch(e){case"pending":return"live";case"connecting":return"reconnecting";case"idle":case"error":return"offline"}}(f.status),placedFirstShipIds:m,error:f.error}}])},928459,415168,e=>{"use strict";var t=e.i(621482),a=e.i(954616),s=e.i(912598),i=e.i(731877),n=e.i(427702);function r(e){switch(e.kind){case"type":return`any ship of type ${e.type}`;case"meeting":return`every other participant of meeting ${e.meetingId}`}}function l(e){let t=String(e.attempts-1);return e.isPushed?`Handed ${t} times, never confirmed; fifth refused: undeliverable.`:`Handed (pulled) ${t} times, never acknowledged; fifth receive refused: undeliverable.`}e.s(["recipientGroupWords",0,r],415168);let d="Acknowledged, then its turn died; handed once more, and that turn died too: not handled.";function o(){let e=(0,n.useTRPC)(),t=(0,s.useQueryClient)();return()=>t.invalidateQueries({queryKey:e.fleet.pathKey()})}e.s(["DISMISSED_TOAST",0,{title:"Delivery dismissed",description:"It stays in the timelines as dismissed."},"attentionReason",0,function(e){switch(e.state){case"undeliverable":return l(e);case"notHandled":return null===e.reason?d:`${d} Its crew said: ${e.reason}.`}},"canResend",0,function(e){return!e.message.isPing},"deliveryWithId",0,function(e,t){return e?.find(e=>e.deliveryId===t)},"resentToast",0,function(e){return{title:"Message resent",description:`A new message went to ${function(e){let{recipient:t}=e.message;return"ship"===t.kind?t.ship.name:r(t)}(e)}. The original is dismissed.`}},"undeliverableReason",0,l,"useDismissDelivery",0,function(){let e=(0,n.useTRPC)(),t=o();return(0,a.useMutation)(e.fleet.dismiss.mutationOptions({onSuccess:t}))},"useNeedsAttention",0,function(e={}){let a=(0,n.useTRPC)();return(0,i.pagedListOf)((0,t.useInfiniteQuery)(a.fleet.needsAttention.infiniteQueryOptions({...e,limit:i.CONSOLE_PAGE_SIZE},{getNextPageParam:i.nextCursorOf})))},"useResendDelivery",0,function(){let e=(0,n.useTRPC)(),t=o();return(0,a.useMutation)(e.fleet.resend.mutationOptions({onSuccess:t}))}],928459)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,792150,e=>{"use strict";var t=e.i(456420);let s={name:"boxes",size:24,node:[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]};s.node;let n=(0,t.default)(s);e.s(["Boxes",0,n],792150)},569644,269846,e=>{"use strict";var t=e.i(456420);let s={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};s.node;let n=(0,t.default)(s);e.s(["FolderOpen",0,n],569644);let i={name:"git-branch",size:24,node:[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]};i.node;let a=(0,t.default)(i);e.s(["GitBranch",0,a],269846)},77071,e=>{"use strict";var t=e.i(456420);let s={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};s.node;let n=(0,t.default)(s);e.s(["Plus",0,n],77071)},759659,e=>{"use strict";var t=e.i(456420);let s={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};s.node;let n=(0,t.default)(s);e.s(["Trash2",0,n],759659)},419413,e=>{"use strict";e.s(["PAGE_SIZE_MAX",0,500])},177096,e=>{"use strict";var t=e.i(843476),s=e.i(271645),n=e.i(422768),i=e.i(316984),a=e.i(456420);let r={name:"folder-x",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"m9.5 10.5 5 5",key:"ra9qjz"}],["path",{d:"m14.5 10.5-5 5",key:"l2rkpq"}]]};r.node;let l=(0,a.default)(r);var d=e.i(611568),o=e.i(749287),c=e.i(586875),u=e.i(759659),h=e.i(522016),m=e.i(54492),p=e.i(849635),x=e.i(574296),g=e.i(861966),f=e.i(219321),j=e.i(615385),v=e.i(67874),w=e.i(699261),b=e.i(763481),y=e.i(78865),k=e.i(36556);function N({spot:e,now:s}){let n="running"===e.status?e.startedAt:null,i=(0,m.restartWords)(e);return null===n&&void 0===i?null:(0,t.jsxs)("span",{className:"text-meta text-muted-foreground","data-testid":"machine-spot-session",children:[null===n?null:(0,t.jsxs)(t.Fragment,{children:["since"," ",(0,t.jsx)("time",{dateTime:n,title:(0,p.fullDateTime)(new Date(n)),className:"tabular-nums",children:(0,p.sinceTime)(new Date(n),s)})]}),null!==n&&void 0!==i?" · ":null,i]})}function S({label:e,children:s}){return(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-1 bg-card px-3.5 py-3",children:[(0,t.jsx)("dt",{className:"text-meta text-muted-foreground",children:e}),(0,t.jsx)("dd",{className:"flex min-w-0 items-center gap-1.5 text-body text-foreground",children:s})]})}function C({title:e,count:s,note:n,children:i}){return(0,t.jsxs)("section",{"aria-label":e,className:"flex flex-col gap-2.5",children:[(0,t.jsxs)("h2",{className:"flex items-baseline gap-2 text-section font-semibold",children:[e,void 0===s?null:(0,t.jsx)("span",{className:"text-meta font-normal text-muted-foreground tabular-nums",children:s}),void 0===n?null:(0,t.jsx)("span",{className:"text-meta font-normal text-muted-foreground",children:n})]}),i]})}function A({icon:e,name:s,meta:n,action:i}){return(0,t.jsxs)("li",{className:"flex items-start gap-2 px-3.5 py-2.5 [&_svg]:mt-0.5 [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0 [&_svg]:text-muted-foreground",children:[e,(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"truncate font-mono text-id",children:s}),(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:n})]}),i]})}function T({kept:e,shipName:s,isBeingCleared:n,onClear:i}){let a=n?(0,t.jsx)(I,{}):void 0===i?void 0:(0,t.jsx)(x.Button,{size:"xs",variant:"ghost",icon:(0,t.jsx)(u.Trash2,{"aria-hidden":!0}),"aria-label":`Delete the kept ${e.repository} worktree of ${s}`,"data-testid":"machine-worktree-delete",onClick:()=>{i({...e,shipName:s})},children:"Delete"});return(0,t.jsx)(A,{icon:(0,t.jsx)(l,{"aria-hidden":!0}),name:`${e.repository}/${s}`,meta:"Kept after release, with uncommitted changes",action:a})}function I(){return(0,t.jsxs)("span",{"data-testid":"machine-worktree-clearing",className:"inline-flex shrink-0 items-center gap-1 rounded-md border border-tone-waiting-border bg-tone-waiting-bg px-1.5 py-0.5 text-meta text-tone-waiting-fg [&_svg]:mt-0 [&_svg]:text-tone-waiting-fg",children:[(0,t.jsx)(d.LoaderCircle,{"aria-hidden":!0}),"Clearing"]})}function z({machine:e,state:s,spots:a,location:r,labels:d,now:u,shipNames:m,clearRequests:I=[],onClearKept:q}){if("loading"===s||"ready"===s&&void 0===e)return(0,t.jsxs)("div",{"aria-busy":!0,"data-testid":"machine-detail",className:"flex flex-col gap-4",children:[(0,t.jsx)("span",{className:"sr-only",children:"Loading the machine"}),(0,t.jsx)(f.Skeleton,{className:"h-8 w-48"}),(0,t.jsx)(f.Skeleton,{className:"h-16 w-full rounded-lg"}),(0,t.jsx)(f.Skeleton,{className:"h-40 w-full rounded-lg"})]});if("not-found"===s||void 0===e)return(0,t.jsx)("div",{"data-testid":"machine-detail",children:(0,t.jsx)(v.EmptyState,{variant:"section",icon:(0,t.jsx)(n.CircleAlert,{}),title:"Machine not found",description:"The trierarch plugin lists no machine with this ship id. The link may be incomplete.",action:(0,t.jsx)(x.Button,{size:"sm",nativeButton:!1,render:(0,t.jsx)(h.default,{href:"/trierarchs"}),children:"Back to Trierarchs"})})});let{details:M,report:$}=e,_=null===$?null:new Date($.reportedAt),B=e.isSilent&&null!==e.lastSeenAt,R=B&&null!==_?`As of ${(0,p.clockTime)(_)}`:void 0;return(0,t.jsxs)("div",{"data-testid":"machine-detail",className:"flex flex-col gap-5 max-sm:gap-3.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2.5",children:[(0,t.jsxs)("h1",{className:"inline-flex items-center gap-2 text-title font-semibold [&_svg]:size-(--size-icon-lg) [&_svg]:text-muted-foreground",children:[(0,t.jsx)(c.ShipWheel,{"aria-hidden":!0}),e.name]}),(0,t.jsx)(k.MachineLiveness,{machine:e,now:u})]}),(0,t.jsx)(x.Button,{size:"xs",icon:(0,t.jsx)(o.Ship,{"aria-hidden":!0}),nativeButton:!1,render:(0,t.jsx)(h.default,{href:`/ships/${e.shipId}`}),"data-testid":"machine-ship-page",children:"Ship page"})]}),(0,t.jsxs)("dl",{className:"grid grid-cols-5 gap-px overflow-hidden rounded-lg border border-border bg-border max-lg:grid-cols-2",children:[(0,t.jsx)(S,{label:"Capacity",children:(0,t.jsx)(j.CapacityBar,{spots:a,caps:M?.caps,unknownText:null===_?"Unknown until it answers":`Unknown since ${(0,p.clockTime)(_)}`})}),(0,t.jsx)(S,{label:"Machine",children:(0,t.jsx)(b.LocationTag,{kind:r?.kind??null,description:r?.description,size:"md"})}),(0,t.jsx)(S,{label:"Version",children:null===M?(0,t.jsx)("span",{className:"text-muted-foreground",children:"Unknown"}):(0,t.jsxs)("span",{className:"font-mono text-id",children:["@aeolus-fleet/trierarch@",M.version]})}),(0,t.jsx)(S,{label:"Last answer",children:null===_?(0,t.jsx)("span",{className:"text-muted-foreground",children:"None yet"}):(0,t.jsx)("time",{dateTime:$?.reportedAt,title:(0,p.fullDateTime)(_),className:"tabular-nums",children:(0,k.lastAnswer)(_,u)})}),(0,t.jsxs)(S,{label:"Ship id",children:[(0,t.jsx)("span",{className:"truncate font-mono text-id",children:e.shipId}),(0,t.jsx)(g.CopyButton,{value:e.shipId,label:"Copy ship id"})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5","data-testid":"machine-labels-row",children:[(0,t.jsx)("span",{className:"text-caption font-medium text-muted-foreground",children:"Labels"}),void 0===d?(0,t.jsx)(f.Skeleton,{className:"h-5.5 w-40"}):(0,t.jsx)(w.ShipLabels,{chips:d}),(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Read-only here. Crew requests that ask for machine labels go only to machines carrying all of them."})]}),B&&null!==e.lastSeenAt?(0,t.jsxs)("p",{role:"alert","data-testid":"machine-silent",className:"flex gap-2 rounded-lg border border-tone-attention-border bg-tone-attention-bg px-3.5 py-2.5 text-meta text-tone-attention-fg [&_svg]:mt-0.5 [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",children:[(0,t.jsx)(i.CircleX,{"aria-hidden":!0}),(0,t.jsxs)("span",{children:[(0,t.jsxs)("strong",{className:"font-medium",children:[e.name," has not answered since ",(0,p.clockTime)(new Date(e.lastSeenAt)),"."]})," ","It is probably not running",r?.description?` on ${r.description}`:"",". Until it answers, nothing restarts its sessions; everything below is its last answer."]})]}):null,(0,t.jsx)(C,{title:"Running here",count:a.length,note:R,children:0===a.length?(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"No ship is assigned to this trierarch."}):(0,t.jsx)("ul",{className:"divide-y divide-border rounded-lg border border-border bg-card","data-testid":"machine-spots",children:a.map(e=>(0,t.jsxs)("li",{className:"flex items-center justify-between gap-3 px-3.5 py-2.5",children:[(0,t.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,t.jsx)(h.default,{href:`/ships/${e.shipId}`,className:"truncate text-body font-medium hover:underline",children:e.name}),void 0===e.workspace?null:(0,t.jsxs)("span",{className:"truncate text-meta text-muted-foreground","data-testid":"machine-spot-workspace",children:[(0,t.jsx)("span",{className:"sr-only",children:"Workspace: "}),(0,t.jsx)("span",{className:"font-mono text-id",children:e.workspace.name})," · ","worktree"===e.workspace.kind?"new worktree":"folder, as it is"]})]}),(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-2.5",children:[(0,t.jsx)(N,{spot:e,now:u}),(0,t.jsx)(y.StatusBadge,{status:e.status})]})]},e.shipId))})}),(0,t.jsx)(C,{title:"Harnesses",count:M?.harnesses.length,note:R,children:null===M?(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Unknown until it answers."}):(0,t.jsx)("div",{className:"rounded-lg border border-border bg-card px-3.5 py-3",children:M.harnesses.map(e=>(0,t.jsx)(k.HarnessOffer,{harness:e,now:u},e.harness))})}),(0,t.jsx)(C,{title:"Workspaces",count:null===M?void 0:M.workspaces.repositories.length+M.workspaces.folders.length,children:null===M?(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Unknown until it answers."}):(0,t.jsx)("div",{className:"rounded-lg border border-border bg-card px-3.5 py-3",children:(0,t.jsx)(k.WorkspaceOffer,{workspaces:M.workspaces})})}),null===M||0===M.kept.length&&0===M.orphans.length?null:(0,t.jsxs)(C,{title:"Worktrees",children:[(0,t.jsxs)("ul",{className:"divide-y divide-border rounded-lg border border-border bg-card","data-testid":"machine-worktrees",children:[M.kept.map(s=>{var n;return(0,t.jsx)(T,{kept:s,shipName:m?.get(s.shipId)??s.shipId,isBeingCleared:(n={trierarchShipId:e.shipId,...s},I.some(e=>e.trierarchShipId===n.trierarchShipId&&e.shipId===n.shipId&&e.repository===n.repository)),onClear:q},`${s.shipId}/${s.repository}`)}),M.orphans.map(e=>(0,t.jsx)(A,{icon:(0,t.jsx)(l,{"aria-hidden":!0}),name:`${e.repository}/${e.name}`,meta:"No crew request"},`${e.repository}/${e.name}`))]}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"The trierarch never deletes these on its own."})]})]})}var q=e.i(835114),M=e.i(837631),$=e.i(787964),_=e.i(917540),B=e.i(490262),R=e.i(458155),L=e.i(954616),O=e.i(266027),W=e.i(912598),D=e.i(427702),E=e.i(905387),H=e.i(442111),U=e.i(280581),P=e.i(718423),F=e.i(510921),V=e.i(714695),K=e.i(928459),Z=e.i(296676),G=e.i(678485),J=e.i(853573),Q=e.i(500265);let X=(0,_.lazyDialog)(()=>e.A(551212).then(e=>e.ClearWorktreeDialog),e=>void 0!==e.worktree);e.s(["default",0,function({params:e}){let n,i,a,{shipId:r}=(0,s.use)(e),l=(0,Z.useNow)(),d=(0,$.useConsoleFrame)(),o=(0,K.useNeedsAttention)(),c=(0,P.useLiveFleet)(),u=(0,Q.useTrierarchPluginConnection)(),h=(0,Q.useMachines)(),m=(0,B.useAccess)(),[p,x]=(0,s.useState)(void 0),g=(n=(0,D.useTRPC)(),(0,O.useQuery)(n.fleet.clearRequests.queryOptions(void 0,{refetchInterval:1e4}))),f=(i=(0,D.useTRPC)(),a=(0,W.useQueryClient)(),(0,L.useMutation)(i.fleet.clearWorktree.mutationOptions({onSuccess:()=>a.invalidateQueries({queryKey:i.fleet.clearRequests.queryKey()})})));(0,G.useSignInWhenSessionEnds)([o.error,c.error]);let j=h.data?.find(e=>e.shipId===r),v=(0,R.useAssignedShips)(void 0===j?void 0:[j.shipId])??[],w=void 0===j?[]:(0,V.spotsOf)(j,v),b=(0,H.useListedShips)([...void 0===j?[]:[j.shipId],...j?.details?.kept.map(e=>e.shipId)??[]]),y=(0,E.useLabelContext)(),k=void 0===j?void 0:b?.get(j.shipId),N=[...(0,J.useShips)(w.map(e=>e.shipId))].flatMap(([e,t])=>null===t.crewRequest?[]:[{id:e,settings:t.crewRequest.settings}]),S=(0,F.useCrewSettings)(N.map(e=>e.settings)),C=new Map(N.map((e,t)=>[e.id,S?.[t]??null]));return(0,t.jsx)(M.DetailPage,{switcher:d.switcher,account:d.account,onCompose:d.onCompose,onSearch:d.onSearch,banner:d.banner,title:j?.name??"Machine",parents:[{href:"/trierarchs",label:"Trierarchs"}],live:c.live,header:"connected"!==u||h.isError?(0,t.jsx)(q.MachineList,{connection:u,machines:h.data,ships:v,error:h.isError?h.error.message:void 0,onRetry:()=>{h.refetch()},now:l}):(0,t.jsx)(z,{machine:j,state:void 0===h.data?"loading":void 0===j?"not-found":"ready",spots:(0,V.withWorkspaces)(w,C),location:k?.location??null,...void 0===y||void 0===k?{}:{labels:(0,U.chipsOf)(k,y)},now:l,shipNames:new Map([...b?.values()??[]].map(e=>[e.id,e.name])),clearRequests:g.data??[],...m.canManage&&void 0!==j?{onClearKept:e=>{f.reset(),x({...e,trierarchShipId:j.shipId,machineName:j.name})}}:{}}),children:(0,t.jsx)(X,{worktree:p,onOpenChange:e=>{e||x(void 0)},isPending:f.isPending,...null===f.error?{}:{error:f.error.message},onClear:()=>{void 0!==p&&f.mutate({trierarchShipId:p.trierarchShipId,shipId:p.shipId,repository:p.repository},{onSuccess:()=>{x(void 0)}})}})})}],177096)},695960,e=>{"use strict";var t=e.i(843476),s=e.i(792150),n=e.i(749287),i=e.i(586875),a=e.i(456420);let r={name:"tag-x",size:24,node:[["path",{d:"m16.5 6.5-3.914-3.914A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.43 2.43 0 0 0 3.42 0l1.79-1.79",key:"hu94c9"}],["path",{d:"m16.5 10.5 5 5",key:"1jo8bf"}],["path",{d:"m21.5 10.5-5 5",key:"jzei60"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]};r.node;let l=(0,a.default)(r);var d=e.i(263676),o=e.i(965324),c=e.i(280581);let u={"trierarch-plugin":i.ShipWheel,squadrons:s.Boxes,ship:n.Ship,gone:l};e.s(["LabelChip",0,function({chip:e,onRemove:s,testId:n,className:i,trailing:a,meaning:r}){let l="none"===e.mark?null:u[e.mark],h=`${e.key}=${e.value}`,m=void 0===r?(0,c.chipTitleOf)(e):`${(0,c.chipTitleOf)(e)}. ${r}`;return(0,t.jsxs)("span",{role:"group","aria-label":m,"data-slot":"label-chip","data-testid":n,title:m,className:(0,o.classNames)("inline-flex h-5.5 max-w-full min-w-0 shrink-0 items-center gap-1 rounded-sm border border-border bg-secondary px-1.5 font-mono text-id whitespace-nowrap text-foreground [&_svg]:size-3 [&_svg]:shrink-0 [&_svg]:text-muted-foreground","gone"===e.mark?"border-dashed":null,i),children:[null===l?null:(0,t.jsx)(l,{"aria-hidden":!0}),(0,t.jsxs)("span",{className:"truncate",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[e.key,"="]}),(0,t.jsx)("span",{className:"font-medium",children:e.value})]}),a,void 0===s?null:(0,t.jsx)("button",{type:"button","aria-label":`Remove ${h}`,onClick:s,className:"-mr-1 ml-0.5 inline-flex size-4 items-center justify-center rounded-xs text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",children:(0,t.jsx)(d.X,{"aria-hidden":!0})})]})}],695960)},699261,456539,e=>{"use strict";var t=e.i(843476),s=e.i(456420);let n={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};n.node;let i=(0,s.default)(n);e.s(["ChevronUp",0,i],456539);var a=e.i(271645),r=e.i(695960);e.s(["ShipLabels",0,function({chips:e}){let[s,n]=(0,a.useState)(!1);return 0===e.length?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"No labels"}):!s&&e.length>2?(0,t.jsxs)("span",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[e.slice(0,2).map(e=>(0,t.jsx)(r.LabelChip,{chip:e,testId:"ship-label"},e.valueId)),(0,t.jsxs)("button",{type:"button","aria-label":`Show all ${String(e.length)} labels`,"data-testid":"ship-labels-more",className:"inline-flex h-5.5 items-center rounded-sm bg-secondary px-1.5 text-caption font-medium tabular-nums hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring",onClick:()=>{n(!0)},children:["+",e.length-2]})]}):(0,t.jsxs)("span",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[(function(e){let t=[];for(let s of e){let e="none"===s.mark?null:s.ownerName,n=t.find(t=>t.owner===e);void 0===n?t.push({owner:e,chips:[s]}):n.chips.push(s)}return t})(e).map(e=>(0,t.jsxs)("span",{className:"inline-flex flex-wrap items-center gap-1.5",children:[null===e.owner?null:(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:["by ",e.owner]}),e.chips.map(e=>(0,t.jsx)(r.LabelChip,{chip:e,testId:"ship-label"},e.valueId))]},e.owner??"")),e.length>2?(0,t.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1 rounded-sm px-1 text-meta hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring [&_svg]:size-(--size-icon-sm)",onClick:()=>{n(!1)},children:[(0,t.jsx)(i,{"aria-hidden":!0}),"Show fewer"]}):null]})}],699261)},458155,e=>{"use strict";var t=e.i(970597),s=e.i(419413),n=e.i(266027);async function i(e){let t,s=[];do{let n=await e(t);if("refused"===n.kind)return n;s.push(...n.data.items),t=n.data.nextCursor??void 0}while(void 0!==t)return{kind:"answered",data:s}}var a=e.i(905387),r=e.i(502660),l=e.i(427702);e.s(["useAssignedShips",0,function(e){let d=(0,l.useTRPC)(),o=(0,l.useTRPCClient)(),c=[...new Set(e)].toSorted(),u=(0,n.useQuery)({queryKey:d.fleet.list.queryKey({assignedTo:c}),queryFn:async()=>(0,r.dataOf)(await i(async e=>({kind:"answered",data:await o.fleet.list.query({assignedTo:c,cursor:e,limit:s.PAGE_SIZE_MAX})}))),enabled:void 0!==e&&c.length>0,refetchInterval:a.LAST_SEEN_REFRESH_MS,select:e=>e.filter(t.isInReadReach)});return void 0!==e&&0===c.length?[]:u.data}],458155)},615385,e=>{"use strict";var t=e.i(843476),s=e.i(965324),n=e.i(714695);let i={running:"bg-tone-ok-fg",crewing:"bg-tone-active-fg",releasing:"bg-tone-active-fg",restarting:"bg-tone-waiting-fg",crashed:"bg-tone-attention-fg"};e.s(["CapacityBar",0,function({spots:e,caps:a,unknownText:r="Unknown",testId:l}){let d=(0,n.capacityLine)(e,a);if(void 0===a||void 0===d)return(0,t.jsx)("span",{"data-testid":l,className:"text-meta text-muted-foreground",children:r});let o=Math.max(0,a.ships-e.length);return(0,t.jsxs)("span",{role:"img","aria-label":d,"data-testid":l,className:"inline-flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[(0,t.jsxs)("span",{"aria-hidden":!0,className:"inline-flex shrink-0 gap-0.5",children:[e.map((e,n)=>(0,t.jsx)("span",{title:`Spot ${String(n+1)}: ${e.name}, ${e.status}`,className:(0,s.classNames)("h-2 w-3 rounded-xs",i[e.status])},e.shipId)),Array.from({length:o},(s,n)=>(0,t.jsx)("span",{title:`Spot ${String(e.length+n+1)}: vacant`,className:"h-2 w-3 rounded-xs border border-input"},`free-${String(n)}`))]}),(0,t.jsx)("span",{className:"text-meta tabular-nums",children:d})]})}])},36556,e=>{"use strict";var t=e.i(843476),s=e.i(271567),n=e.i(152886),i=e.i(569644),a=e.i(269846),r=e.i(586875),l=e.i(466787),d=e.i(522016),o=e.i(866616),c=e.i(714695),u=e.i(849635),h=e.i(766390),m=e.i(615385),p=e.i(763481);let x={alive:"border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg",silent:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg","not-started":"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg"},g={alive:"Alive",silent:"Not answering","not-started":"Not started"};function f({machine:e,now:s}){let i=(0,c.machineLiveness)(e),a=null===e.lastSeenAt?null:new Date(e.lastSeenAt);return(0,t.jsxs)("span",{className:"inline-flex flex-wrap items-center gap-x-2 gap-y-1 text-meta","data-testid":"machine-liveness","data-liveness":i,children:[(0,t.jsxs)(h.Badge,{variant:"outline",className:x[i],children:["alive"===i?(0,t.jsx)(r.ShipWheel,{"aria-hidden":!0}):(0,t.jsx)(n.CircleDashed,{"aria-hidden":!0}),g[i]]}),null===a?(0,t.jsx)("span",{className:"text-muted-foreground",children:"· run its setup line on the machine"}):(0,t.jsxs)("time",{dateTime:e.lastSeenAt??void 0,title:(0,u.fullDateTime)(a),className:"text-muted-foreground tabular-nums",children:["· ","silent"===i?`since ${(0,u.clockTime)(a)}`:(0,u.lastSeen)(a,s).replace("Last seen","seen")]})]})}function j(e,t){let s=(0,u.relativeTime)(e,t);return"Just now"===s?"just now":s}function v({title:e,children:s,className:n}){return(0,t.jsxs)("div",{className:`flex min-w-0 flex-col gap-2 px-4.5 py-4 ${n??""}`,children:[(0,t.jsx)("span",{className:"text-caption font-medium text-muted-foreground",children:e}),s]})}function w({harness:e,now:n}){let i=(0,o.harnessDetection)(e,n);return(0,t.jsxs)("div",{className:"flex flex-col gap-1.5 border-t border-border py-2.5 first-of-type:border-t-0 first-of-type:pt-0",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-body font-medium [&_svg]:size-(--size-icon-sm) [&_svg]:text-muted-foreground",children:[(0,t.jsx)(s.Bot,{"aria-hidden":!0}),(0,o.harnessWord)(e.harness),void 0===i?null:(0,t.jsx)("span",{className:"font-normal text-meta text-muted-foreground",children:i})]}),(0,c.harnessOptions)(e.options).map(e=>(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1 text-meta",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:e.name}),e.values.map(s=>(0,t.jsxs)("span",{className:"font-mono text-id whitespace-nowrap",children:[s,s===e.defaultValue?(0,t.jsx)("span",{className:"font-sans text-muted-foreground",children:" (default)"}):null]},s))]},e.name)),0===e.flags.length?null:(0,t.jsx)("span",{className:"flex flex-wrap items-center gap-1.5",children:e.flags.map(s=>e.riskyFlags?.includes(s)===!0?(0,t.jsxs)("code",{"data-testid":"machine-risky-flag",title:"Risky: every launch runs without its harness's safeguards",className:"inline-flex items-center gap-1 rounded-sm border border-tone-waiting-border bg-tone-waiting-bg px-1.5 font-mono text-id text-tone-waiting-fg [&_svg]:size-(--size-icon-sm)",children:[(0,t.jsx)(l.TriangleAlert,{"aria-hidden":!0}),s,(0,t.jsx)("span",{className:"sr-only",children:" (risky)"})]},s):(0,t.jsx)("code",{className:"rounded-sm bg-muted px-1.5 font-mono text-id",children:s},s))})]})}function b({title:e,icon:s,names:n}){return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-caption text-muted-foreground",children:e}),0===n.length?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"None"}):n.map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-meta [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0 [&_svg]:text-muted-foreground",children:[s,e]},e))]})}function y({workspaces:e}){return(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)(b,{title:"Repositories · a new worktree per ship",icon:(0,t.jsx)(a.GitBranch,{"aria-hidden":!0}),names:e.repositories}),(0,t.jsx)(b,{title:"Folders · used as they are",icon:(0,t.jsx)(i.FolderOpen,{"aria-hidden":!0}),names:e.folders})]})}e.s(["HarnessOffer",0,w,"MachineCard",0,function({machine:e,spots:s,location:n,now:i}){let{details:a,report:l}=e,o=null===l?null:new Date(l.reportedAt);return(0,t.jsxs)("section",{"aria-label":e.name,"data-testid":"machine-card",className:"grid grid-cols-[minmax(0,18.75rem)_minmax(0,1.25fr)_minmax(0,1fr)] divide-x divide-border rounded-lg border border-border bg-card shadow-sm max-lg:grid-cols-1 max-lg:divide-x-0 max-lg:divide-y",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-2.5 px-4.5 py-4",children:[(0,t.jsxs)(d.default,{href:`/trierarchs/${e.shipId}`,"data-testid":"machine-card-name",className:"inline-flex items-center gap-2 text-section font-semibold hover:underline [&_svg]:size-(--size-icon) [&_svg]:text-muted-foreground",children:[(0,t.jsx)(r.ShipWheel,{"aria-hidden":!0}),e.name]}),(0,t.jsx)(f,{machine:e,now:i}),(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5 text-meta text-muted-foreground",children:[(0,t.jsx)(p.LocationTag,{kind:n?.kind??null,description:n?.description}),null===a?null:(0,t.jsxs)("span",{className:"font-mono text-id",children:["· trierarch ",a.version]})]}),(0,t.jsx)("div",{role:"separator",className:"h-px bg-border"}),(0,t.jsx)("span",{className:"text-caption font-medium text-muted-foreground",children:"Capacity"}),(0,t.jsx)(m.CapacityBar,{spots:s,caps:a?.caps,testId:"machine-card-capacity",unknownText:null===o?"Unknown until it answers":`Unknown since ${(0,u.clockTime)(o)}`}),null===o?null:(0,t.jsxs)("time",{dateTime:l?.reportedAt,title:(0,u.fullDateTime)(o),className:"text-meta text-muted-foreground",children:["Last answer ",j(o,i)]})]}),(0,t.jsx)(v,{title:"Harnesses, options and flags",children:null===a?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Unknown until it answers"}):a.harnesses.map(e=>(0,t.jsx)(w,{harness:e,now:i},e.harness))}),(0,t.jsx)(v,{title:"Workspaces",children:null===a?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Unknown until it answers"}):(0,t.jsx)(y,{workspaces:a.workspaces})})]})},"MachineLiveness",0,f,"WorkspaceOffer",0,y,"lastAnswer",0,j])},835114,e=>{"use strict";var t=e.i(843476),s=e.i(77071),n=e.i(586875),i=e.i(594831),a=e.i(522016),r=e.i(714695),l=e.i(574296),d=e.i(67874),o=e.i(817981),c=e.i(188393),u=e.i(36556);e.s(["MachineList",0,function({connection:e,machines:h,ships:m,error:p,onRetry:x,onJoin:g,now:f}){return"none"===e?(0,t.jsx)(d.EmptyState,{icon:(0,t.jsx)(n.ShipWheel,{"aria-hidden":!0}),title:"The trierarch plugin is not set up for this fleet",description:"Crew requests work without it: they wait on Needs crew and you crew each ship by hand with its starting prompt. With the plugin, trierarchs on your machines start, restart and stop those sessions for you.",action:(0,t.jsx)(l.Button,{nativeButton:!1,render:({children:e,...s})=>(0,t.jsx)("a",{href:"https://github.com/ThomasHendrickx/aeolus-fleet-trierarch-plugin/tree/main/packages/trierarch-plugin#readme",target:"_blank",rel:"noreferrer",...s,children:e}),"data-testid":"trierarchs-setup",children:"How to set up the trierarch plugin"})}):"not-connected"===e?(0,t.jsx)(d.EmptyState,{icon:(0,t.jsx)(i.Unplug,{"aria-hidden":!0}),title:"The trierarch plugin is not connected",description:"Connect it in Settings; its machines show up here then.",action:(0,t.jsx)(l.Button,{nativeButton:!1,render:(0,t.jsx)(a.default,{href:"/settings"}),"data-testid":"trierarchs-open-settings",children:"Open Settings"})}):void 0!==p?(0,t.jsx)(o.InlineError,{variant:"page",title:"Couldn’t read the machines",description:"Nothing changed.",detail:p,onRetry:x}):void 0===h||"unknown"===e?(0,t.jsx)(c.LoadingSkeleton,{variant:"cards",rows:2,label:"Loading the machines"}):0===h.length?(0,t.jsx)(d.EmptyState,{icon:(0,t.jsx)(n.ShipWheel,{"aria-hidden":!0}),title:"No machines yet",description:"Join a machine: its trierarch then starts sessions there for the crew requests the plugin gives it.",action:g?(0,t.jsx)(l.Button,{variant:"primary",icon:(0,t.jsx)(s.Plus,{"aria-hidden":!0}),onClick:g,"data-testid":"trierarchs-join-empty",children:"Join a machine"}):void 0}):(0,t.jsx)("div",{className:"flex flex-col gap-4","data-testid":"machine-list",children:h.map(e=>(0,t.jsx)(u.MachineCard,{machine:e,spots:(0,r.spotsOf)(e,m),location:m.find(t=>t.id===e.shipId)?.location??null,now:f},e.shipId))})}])},54492,e=>{"use strict";e.s(["crewRequestAction",0,function(e){switch(e.kind){case"none":return;case"needsCrew":return"remove";case"crewedByHand":return"release";case"assigned":return"releasing"===e.status?void 0:"release"}},"crewRequestStage",0,function(e){let t=e.crewRequest;return null===t?{kind:"none"}:null!==t.assignedTo?{kind:"assigned",requestedAt:t.requestedAt,trierarch:t.assignedTo,status:t.status??"crewing",attempt:t.attempt,startedAt:t.startedAt}:null!==t.crewedBy?{kind:"crewedByHand",requestedAt:t.requestedAt,crewedBy:t.crewedBy,since:e.crewedSince??null}:{kind:"needsCrew",requestedAt:t.requestedAt,reason:t.reason}},"isRestartable",0,function(e){return"assigned"===e.kind&&"crashed"===e.status},"releaseSteps",0,function(e){return"crewedByHand"===e.kind?["removeCrewRequest","release"]:["removeCrewRequest"]},"requestedBy",0,function(e){return e.find(e=>"CrewRequested"===e.type)?.actor??null},"restartWords",0,function({status:e,attempt:t}){let s=`${String(t)} ${1===t?"restart":"restarts"}`;switch(e){case"restarting":return`attempt ${String(t)}`;case"crashed":return s;case"running":return 0===t?void 0:s;case"crewing":case"releasing":return}},"statusChangedAt",0,function(e){return e.find(e=>"CrewStatusChanged"===e.type)?.occurredAt}])},510921,e=>{"use strict";var t=e.i(976580),s=e.i(994070);e.s(["useCrewSettings",0,function(e){let n=(0,t.useConsoleRead)({queryKey:["crew-settings",JSON.stringify(e)],queryFn:()=>(0,s.fetchConsoleRead)({read:"crew-settings",input:{settings:[...e]}}),enabled:e.length>0,staleTime:1/0});return 0===e.length?[]:n.data}])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,792150,e=>{"use strict";var t=e.i(456420);let s={name:"boxes",size:24,node:[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]};s.node;let n=(0,t.default)(s);e.s(["Boxes",0,n],792150)},569644,269846,e=>{"use strict";var t=e.i(456420);let s={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};s.node;let n=(0,t.default)(s);e.s(["FolderOpen",0,n],569644);let i={name:"git-branch",size:24,node:[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]};i.node;let a=(0,t.default)(i);e.s(["GitBranch",0,a],269846)},77071,e=>{"use strict";var t=e.i(456420);let s={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};s.node;let n=(0,t.default)(s);e.s(["Plus",0,n],77071)},759659,e=>{"use strict";var t=e.i(456420);let s={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};s.node;let n=(0,t.default)(s);e.s(["Trash2",0,n],759659)},419413,e=>{"use strict";e.s(["PAGE_SIZE_MAX",0,500])},177096,e=>{"use strict";var t=e.i(843476),s=e.i(271645),n=e.i(422768),i=e.i(316984),a=e.i(456420);let r={name:"folder-x",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"m9.5 10.5 5 5",key:"ra9qjz"}],["path",{d:"m14.5 10.5-5 5",key:"l2rkpq"}]]};r.node;let l=(0,a.default)(r);var d=e.i(611568),o=e.i(749287),c=e.i(586875),u=e.i(759659),h=e.i(522016),m=e.i(54492),p=e.i(849635),x=e.i(574296),g=e.i(861966),f=e.i(219321),j=e.i(615385),v=e.i(67874),w=e.i(699261),b=e.i(763481),y=e.i(78865),k=e.i(36556);function N({spot:e,now:s}){let n="running"===e.status?e.startedAt:null,i=(0,m.restartWords)(e);return null===n&&void 0===i?null:(0,t.jsxs)("span",{className:"text-meta text-muted-foreground","data-testid":"machine-spot-session",children:[null===n?null:(0,t.jsxs)(t.Fragment,{children:["since"," ",(0,t.jsx)("time",{dateTime:n,title:(0,p.fullDateTime)(new Date(n)),className:"tabular-nums",children:(0,p.sinceTime)(new Date(n),s)})]}),null!==n&&void 0!==i?" · ":null,i]})}function S({label:e,children:s}){return(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-1 bg-card px-3.5 py-3",children:[(0,t.jsx)("dt",{className:"text-meta text-muted-foreground",children:e}),(0,t.jsx)("dd",{className:"flex min-w-0 items-center gap-1.5 text-body text-foreground",children:s})]})}function C({title:e,count:s,note:n,children:i}){return(0,t.jsxs)("section",{"aria-label":e,className:"flex flex-col gap-2.5",children:[(0,t.jsxs)("h2",{className:"flex items-baseline gap-2 text-section font-semibold",children:[e,void 0===s?null:(0,t.jsx)("span",{className:"text-meta font-normal text-muted-foreground tabular-nums",children:s}),void 0===n?null:(0,t.jsx)("span",{className:"text-meta font-normal text-muted-foreground",children:n})]}),i]})}function A({icon:e,name:s,meta:n,action:i}){return(0,t.jsxs)("li",{className:"flex items-start gap-2 px-3.5 py-2.5 [&_svg]:mt-0.5 [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0 [&_svg]:text-muted-foreground",children:[e,(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"truncate font-mono text-id",children:s}),(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:n})]}),i]})}function T({kept:e,shipName:s,isBeingCleared:n,onClear:i}){let a=n?(0,t.jsx)(I,{}):void 0===i?void 0:(0,t.jsx)(x.Button,{size:"xs",variant:"ghost",icon:(0,t.jsx)(u.Trash2,{"aria-hidden":!0}),"aria-label":`Delete the kept ${e.repository} worktree of ${s}`,"data-testid":"machine-worktree-delete",onClick:()=>{i({...e,shipName:s})},children:"Delete"});return(0,t.jsx)(A,{icon:(0,t.jsx)(l,{"aria-hidden":!0}),name:`${e.repository}/${s}`,meta:"Kept after release, with uncommitted changes",action:a})}function I(){return(0,t.jsxs)("span",{"data-testid":"machine-worktree-clearing",className:"inline-flex shrink-0 items-center gap-1 rounded-md border border-tone-waiting-border bg-tone-waiting-bg px-1.5 py-0.5 text-meta text-tone-waiting-fg [&_svg]:mt-0 [&_svg]:text-tone-waiting-fg",children:[(0,t.jsx)(d.LoaderCircle,{"aria-hidden":!0}),"Clearing"]})}function z({machine:e,state:s,spots:a,location:r,labels:d,now:u,shipNames:m,clearRequests:I=[],onClearKept:_}){if("loading"===s||"ready"===s&&void 0===e)return(0,t.jsxs)("div",{"aria-busy":!0,"data-testid":"machine-detail",className:"flex flex-col gap-4",children:[(0,t.jsx)("span",{className:"sr-only",children:"Loading the machine"}),(0,t.jsx)(f.Skeleton,{className:"h-8 w-48"}),(0,t.jsx)(f.Skeleton,{className:"h-16 w-full rounded-lg"}),(0,t.jsx)(f.Skeleton,{className:"h-40 w-full rounded-lg"})]});if("not-found"===s||void 0===e)return(0,t.jsx)("div",{"data-testid":"machine-detail",children:(0,t.jsx)(v.EmptyState,{variant:"section",icon:(0,t.jsx)(n.CircleAlert,{}),title:"Machine not found",description:"The trierarch plugin lists no machine with this ship id. The link may be incomplete.",action:(0,t.jsx)(x.Button,{size:"sm",nativeButton:!1,render:(0,t.jsx)(h.default,{href:"/trierarchs"}),children:"Back to Trierarchs"})})});let{details:q,report:M}=e,R=null===M?null:new Date(M.reportedAt),$=e.isSilent&&null!==e.lastSeenAt,B=$&&null!==R?`As of ${(0,p.clockTime)(R)}`:void 0;return(0,t.jsxs)("div",{"data-testid":"machine-detail",className:"flex flex-col gap-5 max-sm:gap-3.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2.5",children:[(0,t.jsxs)("h1",{className:"inline-flex items-center gap-2 text-title font-semibold [&_svg]:size-(--size-icon-lg) [&_svg]:text-muted-foreground",children:[(0,t.jsx)(c.ShipWheel,{"aria-hidden":!0}),e.name]}),(0,t.jsx)(k.MachineLiveness,{machine:e,now:u})]}),(0,t.jsx)(x.Button,{size:"xs",icon:(0,t.jsx)(o.Ship,{"aria-hidden":!0}),nativeButton:!1,render:(0,t.jsx)(h.default,{href:`/ships/${e.shipId}`}),"data-testid":"machine-ship-page",children:"Ship page"})]}),(0,t.jsxs)("dl",{className:"grid grid-cols-5 gap-px overflow-hidden rounded-lg border border-border bg-border max-lg:grid-cols-2",children:[(0,t.jsx)(S,{label:"Capacity",children:(0,t.jsx)(j.CapacityBar,{spots:a,caps:q?.caps,unknownText:null===R?"Unknown until it answers":`Unknown since ${(0,p.clockTime)(R)}`})}),(0,t.jsx)(S,{label:"Machine",children:(0,t.jsx)(b.LocationTag,{kind:r?.kind??null,description:r?.description,size:"md"})}),(0,t.jsx)(S,{label:"Version",children:null===q?(0,t.jsx)("span",{className:"text-muted-foreground",children:"Unknown"}):(0,t.jsxs)("span",{className:"font-mono text-id",children:["@aeolus-fleet/trierarch@",q.version]})}),(0,t.jsx)(S,{label:"Last answer",children:null===R?(0,t.jsx)("span",{className:"text-muted-foreground",children:"None yet"}):(0,t.jsx)("time",{dateTime:M?.reportedAt,title:(0,p.fullDateTime)(R),className:"tabular-nums",children:(0,k.lastAnswer)(R,u)})}),(0,t.jsxs)(S,{label:"Ship id",children:[(0,t.jsx)("span",{className:"truncate font-mono text-id",children:e.shipId}),(0,t.jsx)(g.CopyButton,{value:e.shipId,label:"Copy ship id"})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5","data-testid":"machine-labels-row",children:[(0,t.jsx)("span",{className:"text-caption font-medium text-muted-foreground",children:"Labels"}),void 0===d?(0,t.jsx)(f.Skeleton,{className:"h-5.5 w-40"}):(0,t.jsx)(w.ShipLabels,{chips:d}),(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Read-only here. Crew requests that ask for machine labels go only to machines carrying all of them."})]}),$&&null!==e.lastSeenAt?(0,t.jsxs)("p",{role:"alert","data-testid":"machine-silent",className:"flex gap-2 rounded-lg border border-tone-attention-border bg-tone-attention-bg px-3.5 py-2.5 text-meta text-tone-attention-fg [&_svg]:mt-0.5 [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",children:[(0,t.jsx)(i.CircleX,{"aria-hidden":!0}),(0,t.jsxs)("span",{children:[(0,t.jsxs)("strong",{className:"font-medium",children:[e.name," has not answered since ",(0,p.clockTime)(new Date(e.lastSeenAt)),"."]})," ","It is probably not running",r?.description?` on ${r.description}`:"",". Until it answers, nothing restarts its sessions; everything below is its last answer."]})]}):null,(0,t.jsx)(C,{title:"Running here",count:a.length,note:B,children:0===a.length?(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"No ship is assigned to this trierarch."}):(0,t.jsx)("ul",{className:"divide-y divide-border rounded-lg border border-border bg-card","data-testid":"machine-spots",children:a.map(e=>(0,t.jsxs)("li",{className:"flex items-center justify-between gap-3 px-3.5 py-2.5",children:[(0,t.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,t.jsx)(h.default,{href:`/ships/${e.shipId}`,className:"truncate text-body font-medium hover:underline",children:e.name}),void 0===e.workspace?null:(0,t.jsxs)("span",{className:"truncate text-meta text-muted-foreground","data-testid":"machine-spot-workspace",children:[(0,t.jsx)("span",{className:"sr-only",children:"Workspace: "}),(0,t.jsx)("span",{className:"font-mono text-id",children:e.workspace.name})," · ","worktree"===e.workspace.kind?"new worktree":"folder, as it is"]})]}),(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-2.5",children:[(0,t.jsx)(N,{spot:e,now:u}),(0,t.jsx)(y.StatusBadge,{status:e.status})]})]},e.shipId))})}),(0,t.jsx)(C,{title:"Harnesses",count:q?.harnesses.length,note:B,children:null===q?(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Unknown until it answers."}):(0,t.jsx)("div",{className:"rounded-lg border border-border bg-card px-3.5 py-3",children:q.harnesses.map(e=>(0,t.jsx)(k.HarnessOffer,{harness:e,now:u},e.harness))})}),(0,t.jsx)(C,{title:"Workspaces",count:null===q?void 0:q.workspaces.repositories.length+q.workspaces.folders.length,children:null===q?(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Unknown until it answers."}):(0,t.jsx)("div",{className:"rounded-lg border border-border bg-card px-3.5 py-3",children:(0,t.jsx)(k.WorkspaceOffer,{workspaces:q.workspaces})})}),null===q||0===q.kept.length&&0===q.orphans.length?null:(0,t.jsxs)(C,{title:"Worktrees",children:[(0,t.jsxs)("ul",{className:"divide-y divide-border rounded-lg border border-border bg-card","data-testid":"machine-worktrees",children:[q.kept.map(s=>{var n;return(0,t.jsx)(T,{kept:s,shipName:m?.get(s.shipId)??s.shipId,isBeingCleared:(n={trierarchShipId:e.shipId,...s},I.some(e=>e.trierarchShipId===n.trierarchShipId&&e.shipId===n.shipId&&e.repository===n.repository)),onClear:_},`${s.shipId}/${s.repository}`)}),q.orphans.map(e=>(0,t.jsx)(A,{icon:(0,t.jsx)(l,{"aria-hidden":!0}),name:`${e.repository}/${e.name}`,meta:"No crew request"},`${e.repository}/${e.name}`))]}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"The trierarch never deletes these on its own."})]})]})}var _=e.i(835114),q=e.i(837631),M=e.i(787964),R=e.i(917540),$=e.i(490262),B=e.i(458155),L=e.i(954616),O=e.i(266027),W=e.i(912598),E=e.i(427702),D=e.i(905387),H=e.i(442111),U=e.i(280581),P=e.i(718423),F=e.i(510921),V=e.i(714695),K=e.i(928459),Z=e.i(296676),G=e.i(678485),J=e.i(853573),Q=e.i(500265);let X=(0,R.lazyDialog)(()=>e.A(551212).then(e=>e.ClearWorktreeDialog),e=>void 0!==e.worktree);e.s(["default",0,function({params:e}){let n,i,a,{shipId:r}=(0,s.use)(e),l=(0,Z.useNow)(),d=(0,M.useConsoleFrame)(),o=(0,K.useNeedsAttention)(),c=(0,P.useLiveFleet)(),u=(0,Q.useTrierarchPluginConnection)(),h=(0,Q.useMachines)(),m=(0,$.useAccess)(),[p,x]=(0,s.useState)(void 0),g=(n=(0,E.useTRPC)(),(0,O.useQuery)(n.fleet.clearRequests.queryOptions(void 0,{refetchInterval:1e4}))),f=(i=(0,E.useTRPC)(),a=(0,W.useQueryClient)(),(0,L.useMutation)(i.fleet.clearWorktree.mutationOptions({onSuccess:()=>a.invalidateQueries({queryKey:i.fleet.clearRequests.queryKey()})})));(0,G.useSignInWhenSessionEnds)([o.error,c.error]);let j=h.data?.find(e=>e.shipId===r),v=(0,B.useAssignedShips)(void 0===j?void 0:[j.shipId])??[],w=void 0===j?[]:(0,V.spotsOf)(j,v),b=(0,H.useListedShips)([...void 0===j?[]:[j.shipId],...j?.details?.kept.map(e=>e.shipId)??[]]),y=(0,D.useLabelContext)(),k=void 0===j?void 0:b?.get(j.shipId),N=[...(0,J.useShips)(w.map(e=>e.shipId))].flatMap(([e,t])=>null===t.crewRequest?[]:[{id:e,settings:t.crewRequest.settings}]),S=(0,F.useCrewSettings)(N.map(e=>e.settings)),C=new Map(N.map((e,t)=>[e.id,S?.[t]??null]));return(0,t.jsx)(q.DetailPage,{switcher:d.switcher,account:d.account,onCompose:d.onCompose,onSearch:d.onSearch,banner:d.banner,title:j?.name??"Machine",parents:[{href:"/trierarchs",label:"Trierarchs"}],live:c.live,header:"connected"!==u||h.isError?(0,t.jsx)(_.MachineList,{connection:u,machines:h.data,ships:v,error:h.isError?h.error.message:void 0,onRetry:()=>{h.refetch()},now:l}):(0,t.jsx)(z,{machine:j,state:void 0===h.data?"loading":void 0===j?"not-found":"ready",spots:(0,V.withWorkspaces)(w,C),location:k?.location??null,...void 0===y||void 0===k?{}:{labels:(0,U.chipsOf)(k,y)},now:l,shipNames:new Map([...b?.values()??[]].map(e=>[e.id,e.name])),clearRequests:g.data??[],...m.canManage&&void 0!==j?{onClearKept:e=>{f.reset(),x({...e,trierarchShipId:j.shipId,machineName:j.name})}}:{}}),children:(0,t.jsx)(X,{worktree:p,onOpenChange:e=>{e||x(void 0)},isPending:f.isPending,...null===f.error?{}:{error:f.error.message},onClear:()=>{void 0!==p&&f.mutate({trierarchShipId:p.trierarchShipId,shipId:p.shipId,repository:p.repository},{onSuccess:()=>{x(void 0)}})}})})}],177096)},695960,e=>{"use strict";var t=e.i(843476),s=e.i(792150),n=e.i(749287),i=e.i(586875),a=e.i(456420);let r={name:"tag-x",size:24,node:[["path",{d:"m16.5 6.5-3.914-3.914A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.43 2.43 0 0 0 3.42 0l1.79-1.79",key:"hu94c9"}],["path",{d:"m16.5 10.5 5 5",key:"1jo8bf"}],["path",{d:"m21.5 10.5-5 5",key:"jzei60"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]};r.node;let l=(0,a.default)(r);var d=e.i(263676),o=e.i(965324),c=e.i(280581);let u={"trierarch-plugin":i.ShipWheel,squadrons:s.Boxes,ship:n.Ship,gone:l};e.s(["LabelChip",0,function({chip:e,onRemove:s,testId:n,className:i,trailing:a,meaning:r}){let l="none"===e.mark?null:u[e.mark],h=`${e.key}=${e.value}`,m=void 0===r?(0,c.chipTitleOf)(e):`${(0,c.chipTitleOf)(e)}. ${r}`;return(0,t.jsxs)("span",{role:"group","aria-label":m,"data-slot":"label-chip","data-testid":n,title:m,className:(0,o.classNames)("inline-flex h-5.5 max-w-full min-w-0 shrink-0 items-center gap-1 rounded-sm border border-border bg-secondary px-1.5 font-mono text-id whitespace-nowrap text-foreground [&_svg]:size-3 [&_svg]:shrink-0 [&_svg]:text-muted-foreground","gone"===e.mark?"border-dashed":null,i),children:[null===l?null:(0,t.jsx)(l,{"aria-hidden":!0}),(0,t.jsxs)("span",{className:"truncate",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[e.key,"="]}),(0,t.jsx)("span",{className:"font-medium",children:e.value})]}),a,void 0===s?null:(0,t.jsx)("button",{type:"button","aria-label":`Remove ${h}`,onClick:s,className:"-mr-1 ml-0.5 inline-flex size-4 items-center justify-center rounded-xs text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",children:(0,t.jsx)(d.X,{"aria-hidden":!0})})]})}],695960)},721039,e=>{"use strict";var t=e.i(843476),s=e.i(466787),n=e.i(866616),i=e.i(714695);e.s(["NotOfferedLine",0,function({harness:e,reason:a}){return(0,t.jsxs)("p",{"data-testid":"not-offered",className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5 text-meta text-tone-attention-fg [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0 [&_svg]:self-center",children:[(0,t.jsx)(s.TriangleAlert,{"aria-hidden":!0}),(0,t.jsxs)("span",{className:"font-medium",children:[(0,n.harnessWord)(e)," not offered"]}),(0,t.jsxs)("span",{children:[a,"."]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:i.NOT_OFFERED_CLEARS})]})}])},699261,456539,e=>{"use strict";var t=e.i(843476),s=e.i(456420);let n={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};n.node;let i=(0,s.default)(n);e.s(["ChevronUp",0,i],456539);var a=e.i(271645),r=e.i(695960);e.s(["ShipLabels",0,function({chips:e}){let[s,n]=(0,a.useState)(!1);return 0===e.length?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"No labels"}):!s&&e.length>2?(0,t.jsxs)("span",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[e.slice(0,2).map(e=>(0,t.jsx)(r.LabelChip,{chip:e,testId:"ship-label"},e.valueId)),(0,t.jsxs)("button",{type:"button","aria-label":`Show all ${String(e.length)} labels`,"data-testid":"ship-labels-more",className:"inline-flex h-5.5 items-center rounded-sm bg-secondary px-1.5 text-caption font-medium tabular-nums hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring",onClick:()=>{n(!0)},children:["+",e.length-2]})]}):(0,t.jsxs)("span",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[(function(e){let t=[];for(let s of e){let e="none"===s.mark?null:s.ownerName,n=t.find(t=>t.owner===e);void 0===n?t.push({owner:e,chips:[s]}):n.chips.push(s)}return t})(e).map(e=>(0,t.jsxs)("span",{className:"inline-flex flex-wrap items-center gap-1.5",children:[null===e.owner?null:(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:["by ",e.owner]}),e.chips.map(e=>(0,t.jsx)(r.LabelChip,{chip:e,testId:"ship-label"},e.valueId))]},e.owner??"")),e.length>2?(0,t.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1 rounded-sm px-1 text-meta hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring [&_svg]:size-(--size-icon-sm)",onClick:()=>{n(!1)},children:[(0,t.jsx)(i,{"aria-hidden":!0}),"Show fewer"]}):null]})}],699261)},458155,e=>{"use strict";var t=e.i(970597),s=e.i(419413),n=e.i(266027);async function i(e){let t,s=[];do{let n=await e(t);if("refused"===n.kind)return n;s.push(...n.data.items),t=n.data.nextCursor??void 0}while(void 0!==t)return{kind:"answered",data:s}}var a=e.i(905387),r=e.i(502660),l=e.i(427702);e.s(["useAssignedShips",0,function(e){let d=(0,l.useTRPC)(),o=(0,l.useTRPCClient)(),c=[...new Set(e)].toSorted(),u=(0,n.useQuery)({queryKey:d.fleet.list.queryKey({assignedTo:c}),queryFn:async()=>(0,r.dataOf)(await i(async e=>({kind:"answered",data:await o.fleet.list.query({assignedTo:c,cursor:e,limit:s.PAGE_SIZE_MAX})}))),enabled:void 0!==e&&c.length>0,refetchInterval:a.LAST_SEEN_REFRESH_MS,select:e=>e.filter(t.isInReadReach)});return void 0!==e&&0===c.length?[]:u.data}],458155)},615385,e=>{"use strict";var t=e.i(843476),s=e.i(965324),n=e.i(714695);let i={running:"bg-tone-ok-fg",crewing:"bg-tone-active-fg",releasing:"bg-tone-active-fg",restarting:"bg-tone-waiting-fg",crashed:"bg-tone-attention-fg"};e.s(["CapacityBar",0,function({spots:e,caps:a,unknownText:r="Unknown",testId:l}){let d=(0,n.capacityLine)(e,a);if(void 0===a||void 0===d)return(0,t.jsx)("span",{"data-testid":l,className:"text-meta text-muted-foreground",children:r});let o=Math.max(0,a.ships-e.length);return(0,t.jsxs)("span",{role:"img","aria-label":d,"data-testid":l,className:"inline-flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[(0,t.jsxs)("span",{"aria-hidden":!0,className:"inline-flex shrink-0 gap-0.5",children:[e.map((e,n)=>(0,t.jsx)("span",{title:`Spot ${String(n+1)}: ${e.name}, ${e.status}`,className:(0,s.classNames)("h-2 w-3 rounded-xs",i[e.status])},e.shipId)),Array.from({length:o},(s,n)=>(0,t.jsx)("span",{title:`Spot ${String(e.length+n+1)}: vacant`,className:"h-2 w-3 rounded-xs border border-input"},`free-${String(n)}`))]}),(0,t.jsx)("span",{className:"text-meta tabular-nums",children:d})]})}])},36556,e=>{"use strict";var t=e.i(843476),s=e.i(271567),n=e.i(152886),i=e.i(569644),a=e.i(269846),r=e.i(586875),l=e.i(466787),d=e.i(522016),o=e.i(866616),c=e.i(714695),u=e.i(849635),h=e.i(766390),m=e.i(615385),p=e.i(721039),x=e.i(763481);let g={alive:"border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg",silent:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg","not-started":"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg"},f={alive:"Alive",silent:"Not answering","not-started":"Not started"};function j({machine:e,now:s}){let i=(0,c.machineLiveness)(e),a=null===e.lastSeenAt?null:new Date(e.lastSeenAt);return(0,t.jsxs)("span",{className:"inline-flex flex-wrap items-center gap-x-2 gap-y-1 text-meta","data-testid":"machine-liveness","data-liveness":i,children:[(0,t.jsxs)(h.Badge,{variant:"outline",className:g[i],children:["alive"===i?(0,t.jsx)(r.ShipWheel,{"aria-hidden":!0}):(0,t.jsx)(n.CircleDashed,{"aria-hidden":!0}),f[i]]}),null===a?(0,t.jsx)("span",{className:"text-muted-foreground",children:"· run its setup line on the machine"}):(0,t.jsxs)("time",{dateTime:e.lastSeenAt??void 0,title:(0,u.fullDateTime)(a),className:"text-muted-foreground tabular-nums",children:["· ","silent"===i?`since ${(0,u.clockTime)(a)}`:(0,u.lastSeen)(a,s).replace("Last seen","seen")]})]})}function v(e,t){let s=(0,u.relativeTime)(e,t);return"Just now"===s?"just now":s}function w({title:e,children:s,className:n}){return(0,t.jsxs)("div",{className:`flex min-w-0 flex-col gap-2 px-4.5 py-4 ${n??""}`,children:[(0,t.jsx)("span",{className:"text-caption font-medium text-muted-foreground",children:e}),s]})}function b({harness:e,now:n}){let i=(0,o.harnessDetection)(e,n);return(0,t.jsxs)("div",{className:"flex flex-col gap-1.5 border-t border-border py-2.5 first-of-type:border-t-0 first-of-type:pt-0",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-body font-medium [&_svg]:size-(--size-icon-sm) [&_svg]:text-muted-foreground",children:[(0,t.jsx)(s.Bot,{"aria-hidden":!0}),(0,o.harnessWord)(e.harness),void 0===i?null:(0,t.jsx)("span",{className:"font-normal text-meta text-muted-foreground",children:i})]}),(0,c.harnessOptions)(e.options).map(e=>(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1 text-meta",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:e.name}),e.values.map(s=>(0,t.jsxs)("span",{className:"font-mono text-id whitespace-nowrap",children:[s,s===e.defaultValue?(0,t.jsx)("span",{className:"font-sans text-muted-foreground",children:" (default)"}):null]},s))]},e.name)),0===e.flags.length?null:(0,t.jsx)("span",{className:"flex flex-wrap items-center gap-1.5",children:e.flags.map(s=>e.riskyFlags?.includes(s)===!0?(0,t.jsxs)("code",{"data-testid":"machine-risky-flag",title:"Risky: every launch runs without its harness's safeguards",className:"inline-flex items-center gap-1 rounded-sm border border-tone-waiting-border bg-tone-waiting-bg px-1.5 font-mono text-id text-tone-waiting-fg [&_svg]:size-(--size-icon-sm)",children:[(0,t.jsx)(l.TriangleAlert,{"aria-hidden":!0}),s,(0,t.jsx)("span",{className:"sr-only",children:" (risky)"})]},s):(0,t.jsx)("code",{className:"rounded-sm bg-muted px-1.5 font-mono text-id",children:s},s))})]})}function y({title:e,icon:s,names:n}){return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-caption text-muted-foreground",children:e}),0===n.length?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"None"}):n.map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-meta [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0 [&_svg]:text-muted-foreground",children:[s,e]},e))]})}function k({workspaces:e}){return(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)(y,{title:"Repositories · a new worktree per ship",icon:(0,t.jsx)(a.GitBranch,{"aria-hidden":!0}),names:e.repositories}),(0,t.jsx)(y,{title:"Folders · used as they are",icon:(0,t.jsx)(i.FolderOpen,{"aria-hidden":!0}),names:e.folders})]})}e.s(["HarnessOffer",0,b,"MachineCard",0,function({machine:e,spots:s,location:n,now:i}){let{details:a,report:l}=e,o=null===l?null:new Date(l.reportedAt);return(0,t.jsxs)("section",{"aria-label":e.name,"data-testid":"machine-card",className:"grid grid-cols-[minmax(0,18.75rem)_minmax(0,1.25fr)_minmax(0,1fr)] divide-x divide-border rounded-lg border border-border bg-card shadow-sm max-lg:grid-cols-1 max-lg:divide-x-0 max-lg:divide-y",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-2.5 px-4.5 py-4",children:[(0,t.jsxs)(d.default,{href:`/trierarchs/${e.shipId}`,"data-testid":"machine-card-name",className:"inline-flex items-center gap-2 text-section font-semibold hover:underline [&_svg]:size-(--size-icon) [&_svg]:text-muted-foreground",children:[(0,t.jsx)(r.ShipWheel,{"aria-hidden":!0}),e.name]}),(0,t.jsx)(j,{machine:e,now:i}),(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5 text-meta text-muted-foreground",children:[(0,t.jsx)(x.LocationTag,{kind:n?.kind??null,description:n?.description}),null===a?null:(0,t.jsxs)("span",{className:"font-mono text-id",children:["· trierarch ",a.version]})]}),(0,t.jsx)("div",{role:"separator",className:"h-px bg-border"}),(0,t.jsx)("span",{className:"text-caption font-medium text-muted-foreground",children:"Capacity"}),(0,t.jsx)(m.CapacityBar,{spots:s,caps:a?.caps,testId:"machine-card-capacity",unknownText:null===o?"Unknown until it answers":`Unknown since ${(0,u.clockTime)(o)}`}),null===o?null:(0,t.jsxs)("time",{dateTime:l?.reportedAt,title:(0,u.fullDateTime)(o),className:"text-meta text-muted-foreground",children:["Last answer ",v(o,i)]})]}),(0,t.jsxs)(w,{title:"Harnesses, options and flags",children:[a?.notOffered?.map(({harness:e,reason:s})=>(0,t.jsx)(p.NotOfferedLine,{harness:e,reason:s},e)),null===a?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Unknown until it answers"}):a.harnesses.map(e=>(0,t.jsx)(b,{harness:e,now:i},e.harness))]}),(0,t.jsx)(w,{title:"Workspaces",children:null===a?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Unknown until it answers"}):(0,t.jsx)(k,{workspaces:a.workspaces})})]})},"MachineLiveness",0,j,"WorkspaceOffer",0,k,"lastAnswer",0,v])},835114,e=>{"use strict";var t=e.i(843476),s=e.i(77071),n=e.i(586875),i=e.i(594831),a=e.i(522016),r=e.i(714695),l=e.i(574296),d=e.i(67874),o=e.i(817981),c=e.i(188393),u=e.i(36556);e.s(["MachineList",0,function({connection:e,machines:h,ships:m,error:p,onRetry:x,onJoin:g,now:f}){return"none"===e?(0,t.jsx)(d.EmptyState,{icon:(0,t.jsx)(n.ShipWheel,{"aria-hidden":!0}),title:"The trierarch plugin is not set up for this fleet",description:"Crew requests work without it: they wait on Needs crew and you crew each ship by hand with its starting prompt. With the plugin, trierarchs on your machines start, restart and stop those sessions for you.",action:(0,t.jsx)(l.Button,{nativeButton:!1,render:({children:e,...s})=>(0,t.jsx)("a",{href:"https://github.com/ThomasHendrickx/aeolus-fleet-trierarch-plugin/tree/main/packages/trierarch-plugin#readme",target:"_blank",rel:"noreferrer",...s,children:e}),"data-testid":"trierarchs-setup",children:"How to set up the trierarch plugin"})}):"not-connected"===e?(0,t.jsx)(d.EmptyState,{icon:(0,t.jsx)(i.Unplug,{"aria-hidden":!0}),title:"The trierarch plugin is not connected",description:"Connect it in Settings; its machines show up here then.",action:(0,t.jsx)(l.Button,{nativeButton:!1,render:(0,t.jsx)(a.default,{href:"/settings"}),"data-testid":"trierarchs-open-settings",children:"Open Settings"})}):void 0!==p?(0,t.jsx)(o.InlineError,{variant:"page",title:"Couldn’t read the machines",description:"Nothing changed.",detail:p,onRetry:x}):void 0===h||"unknown"===e?(0,t.jsx)(c.LoadingSkeleton,{variant:"cards",rows:2,label:"Loading the machines"}):0===h.length?(0,t.jsx)(d.EmptyState,{icon:(0,t.jsx)(n.ShipWheel,{"aria-hidden":!0}),title:"No machines yet",description:"Join a machine: its trierarch then starts sessions there for the crew requests the plugin gives it.",action:g?(0,t.jsx)(l.Button,{variant:"primary",icon:(0,t.jsx)(s.Plus,{"aria-hidden":!0}),onClick:g,"data-testid":"trierarchs-join-empty",children:"Join a machine"}):void 0}):(0,t.jsx)("div",{className:"flex flex-col gap-4","data-testid":"machine-list",children:h.map(e=>(0,t.jsx)(u.MachineCard,{machine:e,spots:(0,r.spotsOf)(e,m),location:m.find(t=>t.id===e.shipId)?.location??null,now:f},e.shipId))})}])},54492,e=>{"use strict";e.s(["crewRequestAction",0,function(e){switch(e.kind){case"none":return;case"needsCrew":return"remove";case"crewedByHand":return"release";case"assigned":return"releasing"===e.status?void 0:"release"}},"crewRequestStage",0,function(e){let t=e.crewRequest;return null===t?{kind:"none"}:null!==t.assignedTo?{kind:"assigned",requestedAt:t.requestedAt,trierarch:t.assignedTo,status:t.status??"crewing",attempt:t.attempt,startedAt:t.startedAt}:null!==t.crewedBy?{kind:"crewedByHand",requestedAt:t.requestedAt,crewedBy:t.crewedBy,since:e.crewedSince??null}:{kind:"needsCrew",requestedAt:t.requestedAt,reason:t.reason}},"isRestartable",0,function(e){return"assigned"===e.kind&&"crashed"===e.status},"releaseSteps",0,function(e){return"crewedByHand"===e.kind?["removeCrewRequest","release"]:["removeCrewRequest"]},"requestedBy",0,function(e){return e.find(e=>"CrewRequested"===e.type)?.actor??null},"restartWords",0,function({status:e,attempt:t}){let s=`${String(t)} ${1===t?"restart":"restarts"}`;switch(e){case"restarting":return`attempt ${String(t)}`;case"crashed":return s;case"running":return 0===t?void 0:s;case"crewing":case"releasing":return}},"statusChangedAt",0,function(e){return e.find(e=>"CrewStatusChanged"===e.type)?.occurredAt}])},510921,e=>{"use strict";var t=e.i(976580),s=e.i(994070);e.s(["useCrewSettings",0,function(e){let n=(0,t.useConsoleRead)({queryKey:["crew-settings",JSON.stringify(e)],queryFn:()=>(0,s.fetchConsoleRead)({read:"crew-settings",input:{settings:[...e]}}),enabled:e.length>0,staleTime:1/0});return 0===e.length?[]:n.data}])}]);