@aeolus-fleet/console 0.41.0 → 0.43.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.
- package/.next/standalone/packages/console/.next/BUILD_ID +1 -1
- package/.next/standalone/packages/console/.next/build-manifest.json +3 -3
- package/.next/standalone/packages/console/.next/prerender-manifest.json +3 -3
- package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/[cause]/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/[cause]/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/[cause]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/inbox/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/inbox/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/inbox/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/labels/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/labels/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/labels/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/messages/[messageId]/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/messages/[messageId]/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/messages/[messageId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/needs-attention/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/needs-attention/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/needs-attention/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/needs-crew/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/needs-crew/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/needs-crew/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/network/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/network/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/network/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/scopes/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/scopes/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/scopes/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/sealing/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/sealing/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/sealing/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/settings/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/settings/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/ships/[shipId]/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/ships/[shipId]/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/ships/[shipId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/[squadronId]/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/[squadronId]/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/[squadronId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/blueprints/[name]/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/blueprints/[name]/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/blueprints/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/templates/[name]/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/templates/[name]/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/templates/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/[shipId]/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/[shipId]/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/[shipId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/mcp-servers/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/mcp-servers/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/mcp-servers/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/usage/page/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/server/app/(console)/usage/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/usage/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/packages/console/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/packages/console/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/packages/console/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/packages/console/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/packages/console/.next/server/app/api/reads/[read]/route.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/version/route.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/packages_console_1wbjk69aa7h5_._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{0ysl_console_features_squadrons_ui_organisms_form-squadron-dialog_tsx_1urthescag5q2._.js → 0ysl_console_features_squadrons_ui_organisms_form-squadron-dialog_tsx_0dci2vlm-uo7-._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_0_lr0u7d083fa._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_0l1epk768ucdg._.js → _0fnv-pmytmqx0._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_1nju5plpg3uw0._.js → _0ml006pqylxs2._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_0wo7e7auz11u_._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_1ioqaj1ie2-9_._.js → _1gn1w31-xhok7._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_1u0h4gj3mw97-._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_1xsy9gcmbo316._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_07x0wbjxji8-x._.js → _20x0oxgyc8det._.js} +2 -2
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0-d3h5nrb9x_b._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_03uumr1db_w78._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_08vk8-385w7uy._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0eqz4sbokz_ho._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_1m9wnu1u4d321._.js → packages_console_0g-yxt7tj_xmg._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_1xnt1dk0iet8-._.js → packages_console_0jd7qdca5s2-i._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_1geo5v87epqjv._.js → packages_console_0k39vxdy8a1k1._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0m2ge775m3dat._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_0-51k_q09xkrb._.js → packages_console_0p2_8odngdeam._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0rs3sw6qymvf1._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0uoqdpx51dbas._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_12-udnsy-cfds._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_1oaf3pw_dtcbg._.js → packages_console_16qzza9cz5u9_._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_19lg059_4kyix._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1a21v1e91ausp._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1amp8eribekyj._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1fwjtqbptzxnd._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1gekpkbmi_zdv._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1m7fa7qlgi_yc._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1o_llozofxu8d._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1pah6f3sj011u._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1pgsmhmup5_bg._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1udbzs9pgm1tm._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1w78yrky65xu4._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1wvgo0qo3-pz6._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1xqz-8nkpk3m5._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1y-8azvar7dfs._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_overview-page_tsx_15siba6r7o4-o._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_ships_[shipId]_ship-page_tsx_0oahz0rct9hdh._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_components_0-gff9pf4u80_._.js → packages_console_components_0v571kizhfodp._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_features_labels_organisms_0xd4isnumtk1z._.js → packages_console_features_labels_organisms_0j8-0aq3npsur._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_features_sealing_ui_organisms_0l30hscm6t01h._.js → packages_console_features_sealing_ui_organisms_026s0y6yxg0zn._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_features_trierarchs_ui_organisms_0gr036_rfi0fk._.js → packages_console_features_trierarchs_ui_organisms_0r5w_7ijm0d19._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_lib_plugin-nav_ts_0bar_w-vfes19._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_lib_squadrons-api_ts_0-ls9zi1hw-2n._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_lib_trierarch-plugin_ts_1yl4g4k1mmd8u._.js +1 -1
- package/.next/standalone/packages/console/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/packages/console/.next/server/pages/500.html +1 -1
- package/.next/standalone/packages/console/.next/server/preview-props.json +3 -3
- package/.next/standalone/packages/console/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/server-reference-manifest.json +18 -18
- package/.next/standalone/packages/console/.next/static/chunks/0bu0rxaueyu1m.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/0zta2iuwvr5j8.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/{3-77dzba98uuj.js → 1dorj3ig2bddc.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{3hjikui0dz-jx.js → 1vpadd7ziji96.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/24ubpn8r9m4k6.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/{3kbvjjaypzbr-.js → 3i9kvqyrohbbi.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{0jppkvbrw3cml.js → 3kc981w76gstx.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/{2f1rt0csmf46b.js → 44gawm0fq5wyv.js} +1 -1
- package/.next/standalone/packages/console/package.json +4 -4
- package/package.json +4 -4
- package/.next/standalone/packages/console/.next/static/chunks/0aevh1_ei_5ng.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/0u-tkgz54c5vn.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/451p343ba4hxl.js +0 -1
- /package/.next/standalone/packages/console/.next/static/{Ppxth9w7MoKCRedaHGIan → 7PPC1fSCaBPCO3tHPkUGW}/_buildManifest.js +0 -0
- /package/.next/standalone/packages/console/.next/static/{Ppxth9w7MoKCRedaHGIan → 7PPC1fSCaBPCO3tHPkUGW}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/packages/console/.next/static/{Ppxth9w7MoKCRedaHGIan → 7PPC1fSCaBPCO3tHPkUGW}/_ssgManifest.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeolus-fleet/console",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.0",
|
|
4
4
|
"description": "The Aeolus console: see every ship, answer your agents and manage the fleet from any device.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agents",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"postpack": "rm LICENSE"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@aeolus-fleet/common": "0.
|
|
44
|
-
"@aeolus-fleet/core": "0.
|
|
45
|
-
"@aeolus-fleet/ui": "0.
|
|
43
|
+
"@aeolus-fleet/common": "0.43.0",
|
|
44
|
+
"@aeolus-fleet/core": "0.43.0",
|
|
45
|
+
"@aeolus-fleet/ui": "0.43.0",
|
|
46
46
|
"@base-ui/react": "^1.8.0",
|
|
47
47
|
"@opentelemetry/api": "^1.9.1",
|
|
48
48
|
"@opentelemetry/exporter-trace-otlp-grpc": "^0.223.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeolus-fleet/console",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.0",
|
|
4
4
|
"description": "The Aeolus console: see every ship, answer your agents and manage the fleet from any device.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agents",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"postpack": "rm LICENSE"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@aeolus-fleet/common": "0.
|
|
44
|
-
"@aeolus-fleet/core": "0.
|
|
45
|
-
"@aeolus-fleet/ui": "0.
|
|
43
|
+
"@aeolus-fleet/common": "0.43.0",
|
|
44
|
+
"@aeolus-fleet/core": "0.43.0",
|
|
45
|
+
"@aeolus-fleet/ui": "0.43.0",
|
|
46
46
|
"@base-ui/react": "^1.8.0",
|
|
47
47
|
"@opentelemetry/api": "^1.9.1",
|
|
48
48
|
"@opentelemetry/exporter-trace-otlp-grpc": "^0.223.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,915860,e=>{"use strict";var t=e.i(843476),n=e.i(618566),s=e.i(271645),i=e.i(590222),a=e.i(748955),r=e.i(456420);let l={name:"arrow-down-left",size:24,node:[["path",{d:"M17 7 7 17",key:"15tmo1"}],["path",{d:"M17 17H7V7",key:"1org7z"}]]};l.node;let d=(0,r.f)(l);var o=e.i(375775),c=e.i(96315),u=e.i(825398),m=e.i(418074),p=e.i(681924),h=e.i(812437),g=e.i(44913),f=e.i(895e3),x=e.i(33479),b=e.i(369693);function v(e,t){return RegExp(`"${t}"\\s*:\\s*"((?:[^"\\\\]|\\\\.)*)"`).exec(e)?.[1]}let j={"application/vnd.aeolus.squadron.check-in+json":()=>"Checked in at its flagship","application/vnd.aeolus.squadron.role+json":e=>{let t=v(e,"role");return void 0===t?"Given its role":`Given the role: ${t}`},"application/vnd.aeolus.squadron.on-station+json":e=>{let t=v(e,"role");return void 0===t?"Took up its role":`Took up the role: ${t}`},"application/vnd.aeolus.squadron.stand-down+json":()=>"Asked to stand down","application/vnd.aeolus.squadron.stood-down+json":()=>"Stood down"};var y=e.i(379369),w=e.i(849635),z=e.i(890135);function k(e,t){return e.sentAt.localeCompare(t.sentAt)||e.id.localeCompare(t.id)}var N=e.i(639124),S=e.i(865713),I=e.i(415168);function C({message:e,shipId:n,now:s,onOpenMessage:i}){let a=e.sender.id===n,r=a?o.f:d,l=new Date(e.sentAt),c=function(e){var t,n;let s;if(!0===e.isPayloadUnreadable)return{text:"Sealed, key not reachable",isCode:!1};let i=j[t=e.contentType,t.split(";")[0]?.trim().toLowerCase()??""];return void 0!==i?{text:i(e.preview),isCode:!1}:(0,b.N)(e.contentType)?{text:0===(s=function(e){let t,n=[],s=0,i=0;for(;i<e.length;){let a=e[i]??"";if('"'===a){let{value:a,end:r}=function(e,t){let n=t+1;for(;n<e.length&&'"'!==e[n];)n+="\\"===e[n]?2:1;return{value:e.slice(t+1,n),end:n+1}}(e,i);1===s&&void 0===t&&e.slice(r).trimStart().startsWith(":")?t=a:1===s&&void 0!==t&&r<=e.length&&'"'===e[r-1]&&(n.push([t,a]),t=void 0),i=r;continue}if("{"===a||"["===a)1===s&&void 0!==t&&(n.push([t,"…"]),t=void 0),s+=1;else if("}"===a||"]"===a)s-=1;else if(1===s&&void 0!==t&&/[-\dtfn]/.test(a)){let s=/^(-?\d[\d.eE+-]*|true|false|null)/.exec(e.slice(i))?.[1];if(void 0!==s){n.push([t,s]),t=void 0,i+=s.length;continue}}i+=1}return n}(n=e.preview)).length?n:s.map(([e,t])=>`${e} ${t}`).join(" · "),isCode:!0}:{text:e.preview,isCode:!1}}(e);return(0,t.jsx)("li",{className:"border-b border-border last:border-b-0",children:(0,t.jsxs)("button",{type:"button","data-testid":"message-row","data-message-id":e.id,"aria-label":`${a?"Sent":"Received"} message: ${c.text}`,className:"flex w-full items-start gap-3 px-3.5 py-3 text-left transition-colors duration-(--duration-fast) hover:bg-accent",onClick:()=>{i(e.id)},children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-md border border-tone-ended-border bg-tone-ended-bg text-tone-ended-fg [&_svg]:size-(--size-icon-sm)",children:(0,t.jsx)(r,{})}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,t.jsxs)("span",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)(N.f,{parts:a?"ship"===e.recipient.kind?[(0,z.n)("To "),(0,z.X)(e.recipient.ship)]:[(0,z.n)(`To ${(0,I.R)(e.recipient)}`)]:[(0,z.n)("From "),(0,z.X)(e.sender)],className:"text-body text-foreground max-sm:text-body-touch"}),(0,t.jsx)(x.T,{status:(0,y.C)(e.delivery)})]}),(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[e.isPayloadSealed?(0,t.jsx)(S.f,{variant:"icon",testId:"message-sealed"}):null,(0,t.jsx)("span",{"data-testid":"message-line",className:(0,h.f)("truncate text-muted-foreground",c.isCode?"font-mono text-id":"text-meta"),children:c.text})]}),(0,t.jsx)("time",{dateTime:e.sentAt,title:(0,w.o)(l),className:"text-meta text-muted-foreground tabular-nums",children:(0,w.W)(l,s)})]})]})})}function $({shipId:e,messages:n,state:s,onRetry:i,more:a,now:r,onOpenMessage:l}){return"loading"===s?(0,t.jsx)(m.f,{variant:"list",rows:3,label:"Loading the messages"}):"error"===s?(0,t.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-3",children:[(0,t.jsx)(f.f,{title:"Couldn’t load the messages",description:"The rest of the page is current. Try again in a moment."}),i?(0,t.jsx)(p.f,{size:"sm",icon:(0,t.jsx)(u.f,{"aria-hidden":!0}),onClick:i,className:"self-start",children:"Try again"}):null]}):0!==n.length||a?(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(function(e){let t=new Map(e.map(e=>[e.id,e])),n=new Map;for(let s of e){let e=function(e,t){let n=new Set([e.id]),s=e,i=null===s.inReplyTo?void 0:t.get(s.inReplyTo);for(;i&&!n.has(i.id);)n.add(i.id),i=null===(s=i).inReplyTo?void 0:t.get(s.inReplyTo);return s}(s,t);n.set(e.id,[...n.get(e.id)??[],s])}return[...n.entries()].map(([e,t])=>{let n=t.toSorted(k);return{id:e,messages:n,lastSentAt:n.at(-1)?.sentAt??""}}).toSorted((e,t)=>t.lastSentAt.localeCompare(e.lastSentAt)||t.id.localeCompare(e.id))})(n).map(n=>(0,t.jsx)("section",{"data-testid":"message-thread","aria-label":`Thread of ${String(n.messages.length)} ${1===n.messages.length?"message":"messages"}`,className:"overflow-hidden rounded-lg border border-border bg-card",children:(0,t.jsx)("ol",{children:n.messages.map(n=>(0,t.jsx)(C,{message:n,shipId:e,now:r,onOpenMessage:l},n.id))})},n.id)),a]}):(0,t.jsx)(g.f,{variant:"section",icon:(0,t.jsx)(c.f,{}),title:"No messages yet",description:"Messages this ship sends or receives appear here as they happen."})}var A=e.i(469477),T=e.i(23824),R=e.i(917540),O=e.i(490262),q=e.i(54492),D=e.i(808041),M=e.i(905387),P=e.i(280581),L=e.i(510921),F=e.i(878608),B=e.i(684156),E=e.i(500265),U=e.i(904084),V=e.i(316984),W=e.i(474544),H=e.i(758925),K=e.i(218964),_=e.i(611568),G=e.i(668997),Q=e.i(457665),X=e.i(395925),J=e.i(586875),Y=e.i(522016),Z=e.i(34512),ee=e.i(866616),et=e.i(912407),en=e.i(695960);let es={request:"Couldn’t request crew",remove:"Couldn’t remove the request",restart:"Couldn’t restart the crew"};function ei({at:e,now:n,children:s}){return(0,t.jsx)("time",{dateTime:e,title:(0,w.o)(new Date(e)),className:"tabular-nums",children:s??(0,w.l)(new Date(e),n)})}function ea({trierarch:e,hasTrierarchs:n}){return(0,t.jsxs)(Y.default,{href:n?`/trierarchs/${e.id}`:`/ships/${e.id}`,"data-testid":"crew-request-trierarch",className:"inline-flex min-w-0 items-center gap-1.5 font-medium text-foreground underline decoration-input underline-offset-3 [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0 [&_svg]:text-muted-foreground",children:[(0,t.jsx)(J.f,{"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate",children:e.name})]})}function er({requestedBy:e,requestedAt:n,now:s}){let i=null===e?null:e.name===z.D?"you":e.name;return(0,t.jsxs)("span",{"data-testid":"crew-request-requested-by",children:[null===i?"Requested ":`Requested by ${i} `,(0,t.jsx)(ei,{at:n,now:s,children:(0,w.W)(new Date(n),s)}),"."]})}let el={note:"border-border bg-muted text-muted-foreground",waiting:"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg",attention:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg"};function ed({tone:e,icon:n,children:s}){return(0,t.jsxs)("div",{role:"attention"===e?"alert":"waiting"===e?"status":"note","data-testid":"crew-request-note",className:`flex items-start gap-2 rounded-lg border px-3 py-2.5 text-meta [&_svg]:mt-0.5 [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0 ${el[e]}`,children:[n,(0,t.jsx)("span",{children:s})]})}function eo({stage:e,now:n}){let s="running"===e.status?e.startedAt:null,i=(0,q.z)(e);return null===s&&void 0===i?null:(0,t.jsxs)("span",{className:"text-meta text-muted-foreground","data-testid":"crew-request-session",children:[null===s?null:(0,t.jsxs)(t.Fragment,{children:["since ",(0,t.jsx)(ei,{at:s,now:n})]}),null!==s&&void 0!==i?" · ":null,i]})}let ec={"Main repository":"crew-request-main-repository","Sub-repositories":"crew-request-sub-repositories"};function eu({label:e,repositories:n}){return(0,t.jsxs)("div",{className:"col-span-full flex min-w-0 flex-col gap-0.5","data-testid":ec[e],children:[(0,t.jsx)("dt",{className:"text-caption font-medium text-muted-foreground",children:e}),(0,t.jsxs)("dd",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[0===n.length?(0,t.jsx)("span",{className:"text-body text-muted-foreground",children:"None"}):null,n.map(({repository:e,ref:n})=>(0,t.jsxs)("span",{"data-testid":"crew-request-repository",className:"inline-flex h-5.5 max-w-full min-w-0 items-center rounded-sm border border-border bg-secondary px-1.5 font-mono text-id whitespace-nowrap text-foreground",children:[(0,t.jsx)("span",{className:"truncate font-medium",children:e}),void 0===n?null:(0,t.jsx)("span",{className:"truncate text-muted-foreground",children:` \xb7 ${n}`})]},e))]})]})}function em({rows:e,machineLabels:n=[]}){return(0,t.jsxs)("dl",{"data-testid":"crew-request-settings",className:"grid grid-cols-[repeat(auto-fill,minmax(8.5rem,1fr))] gap-x-5 gap-y-3 border-t border-border pt-3",children:[e.map(e=>void 0===e.repositories?(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)("dt",{className:"text-caption font-medium text-muted-foreground",children:e.label}),(0,t.jsxs)("dd",{className:"flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-body font-medium",children:[null===e.value?(0,t.jsx)("span",{className:"font-normal text-muted-foreground",children:"None"}):(0,t.jsx)("span",{className:e.isMono?"truncate font-mono text-id":"truncate",children:"Harness"===e.label?(0,ee.f)(e.value):e.value}),void 0===e.meta?null:(0,t.jsx)("span",{className:"text-meta font-normal text-muted-foreground",children:e.meta})]})]},e.label):(0,t.jsx)(eu,{label:e.label,repositories:e.repositories},e.label)),0===n.length?null:(0,t.jsxs)("div",{className:"col-span-full flex min-w-0 flex-col gap-0.5","data-testid":"crew-request-machine-labels",children:[(0,t.jsx)("dt",{className:"text-caption font-medium text-muted-foreground",children:"Machine labels"}),(0,t.jsx)("dd",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:n.map((e,n)=>(0,t.jsxs)(s.Fragment,{children:[0===n?null:(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"and"}),(0,t.jsx)(en.f,{chip:e})]},e.valueId))})]})]})}function ep({login:e}){return(0,t.jsxs)("span",{className:"text-meta","data-testid":"crew-request-login",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"· "}),A.w[e.login],void 0===e.next?null:(0,t.jsxs)(t.Fragment,{children:[","," ",(0,t.jsxs)(et.Tooltip,{children:[(0,t.jsxs)(et.TooltipTrigger,{render:(0,t.jsx)("span",{"data-testid":"crew-request-login-next"}),children:["next: ",A.w[e.next]]}),(0,t.jsx)(et.TooltipContent,{children:A.$})]})]})]})}function eh({keyNotReady:e}){return(0,t.jsxs)(ed,{tone:"attention",icon:(0,t.jsx)(H.f,{"aria-hidden":!0}),children:[(0,t.jsx)("strong",{className:"font-medium",children:A.u[e.key]}),void 0===e.at?null:(0,t.jsxs)(t.Fragment,{children:[" ","since"," ",(0,t.jsx)("time",{dateTime:e.at,title:(0,w.o)(new Date(e.at)),className:"tabular-nums",children:(0,w.w)(new Date(e.at))})]}),". Deliveries wait."]})}function eg({amount:e}){return(0,t.jsxs)(et.Tooltip,{children:[(0,t.jsxs)(et.TooltipTrigger,{render:(0,t.jsx)("span",{"data-testid":"crew-request-spent-on-key",className:"self-start text-meta text-muted-foreground"}),children:["Spent on key ",(0,t.jsx)("span",{className:"font-medium text-foreground tabular-nums",children:(0,A.D)(e)})]}),(0,t.jsx)(et.TooltipContent,{children:A.K})]})}function ef(){return(0,t.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,t.jsx)(K.f,{"aria-hidden":!0,className:"size-(--size-icon) text-muted-foreground"}),(0,t.jsx)("h2",{className:"text-section font-semibold",children:"Crew request"})]})}function ex(e){let{noMachineMatchesReason:n}=(0,Z.x)(),{stage:s,requestedBy:i,now:a,canManage:r,isAwaitingCrew:l,busy:d,error:o}=e,c=void 0===o?null:(0,t.jsx)(f.f,{title:es[o.action],description:`${o.message} Nothing changed.`});if("none"===s.kind)return(0,t.jsxs)("section",{"aria-label":"Crew request","data-testid":"crew-request",className:"flex flex-col gap-2.5 rounded-lg border border-border bg-card px-3 py-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3.5",children:[(0,t.jsx)(ef,{}),(0,t.jsx)("p",{className:"min-w-0 flex-1 text-meta text-muted-foreground",children:e.hasTrierarchs?"No crew request. A crew request keeps this ship crewed: a trierarch starts a session for it and restarts it when it stops.":"No crew request. A crew request puts this ship on your Needs crew list until you crew it by hand."}),r?(0,t.jsx)(p.f,{size:"sm",icon:(0,t.jsx)(K.f,{}),isLoading:"request"===d,onClick:e.onRequest,"data-testid":"crew-request-request",children:"Request crew"}):null]}),c]});let u=(0,q.D)(s),m=void 0!==d;return(0,t.jsxs)("section",{"aria-label":"Crew request","data-testid":"crew-request",className:"flex flex-col gap-2.5 rounded-lg border border-border bg-card px-3 py-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsx)(ef,{}),(0,t.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-2","data-testid":"crew-request-state",children:["assigned"===s.kind?(0,t.jsx)(x.T,{status:s.status}):(0,t.jsx)(x.T,{status:s.kind}),"needsCrew"===s.kind?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:e.hasTrierarchs?"not assigned yet":s.reason??(0,t.jsxs)(t.Fragment,{children:["since ",(0,t.jsx)(ei,{at:s.requestedAt,now:a})]})}):null,"crewedByHand"===s.kind&&null!==s.since?(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:["since ",(0,t.jsx)(ei,{at:s.since,now:a})]}):null,"assigned"===s.kind?(0,t.jsx)(eo,{stage:s,now:a}):null,"assigned"===s.kind&&"releasing"===s.status&&void 0!==e.statusChangedAt?(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:["asked ",(0,t.jsx)(ei,{at:e.statusChangedAt,now:a})]}):null]}),"assigned"===s.kind?(0,t.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-1 text-meta",children:["on ",(0,t.jsx)(ea,{trierarch:s.trierarch,hasTrierarchs:e.hasTrierarchs??!1}),void 0===e.login?null:(0,t.jsx)(ep,{login:e.login})]}):null,(0,t.jsx)("span",{className:"flex-1"}),void 0===e.usageHref?null:(0,t.jsx)(Y.default,{href:e.usageHref,"data-testid":"crew-request-usage",className:"text-meta font-medium text-primary underline underline-offset-3",children:"Usage"}),"assigned"===s.kind&&"releasing"===s.status?(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:["Waiting for ",s.trierarch.name]}):null,r?(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:["remove"===u?(0,t.jsx)(p.f,{size:"sm",variant:"ghost",isLoading:"remove"===d,disabled:m,onClick:e.onRemove,"data-testid":"crew-request-remove",children:"Remove request"}):null,(0,q.Z)(s)?(0,t.jsx)(p.f,{size:"sm",icon:(0,t.jsx)(X.f,{}),isLoading:"restart"===d,disabled:m,onClick:e.onRestart,"data-testid":"crew-request-restart",children:"Restart"}):null,void 0!==e.onEdit&&void 0!==u?(0,t.jsx)(p.f,{size:"sm",icon:(0,t.jsx)(G.f,{}),disabled:m,onClick:e.onEdit,"data-testid":"crew-request-edit",children:"Edit…"}):null,"release"===u?(0,t.jsx)(p.f,{size:"sm",icon:(0,t.jsx)(Q.f,{}),disabled:m,onClick:e.onRelease,"data-testid":"crew-request-release",children:"Release…"}):null,"needsCrew"===s.kind&&l&&!e.hasTrierarchs?(0,t.jsx)(p.f,{size:"sm",variant:"primary",icon:(0,t.jsx)(H.f,{}),disabled:m,onClick:e.onGetStartingPrompt,"data-testid":"crew-request-prompt",children:"Get starting prompt"}):null]}):null]}),"assigned"===s.kind&&e.login?.keyNotReady!==void 0?(0,t.jsx)(eh,{keyNotReady:e.login.keyNotReady}):null,"assigned"===s.kind?function(e,n){let{trierarch:s}=e,i=void 0===n.statusChangedAt?null:(0,t.jsx)(ei,{at:n.statusChangedAt,now:n.now});switch(e.status){case"crewing":return(0,t.jsxs)(ed,{tone:"note",icon:(0,t.jsx)(_.f,{"aria-hidden":!0}),children:[s.name," is starting the session."]});case"running":return null;case"restarting":return(0,t.jsxs)(ed,{tone:"waiting",icon:(0,t.jsx)(X.f,{"aria-hidden":!0}),children:[(0,t.jsx)("strong",{className:"font-medium",children:null===i?"The session stopped.":(0,t.jsxs)(t.Fragment,{children:["The session stopped at ",i,"."]})})," ",s.name," is starting it again. Once its restarts are used up it stops trying and the request shows Crashed."]});case"crashed":return(0,t.jsxs)(ed,{tone:"attention",icon:(0,t.jsx)(V.f,{"aria-hidden":!0}),children:[(0,t.jsx)("strong",{className:"font-medium",children:null===i?"Crashed.":(0,t.jsxs)(t.Fragment,{children:["Crashed at ",i,"."]})})," The session kept stopping and ",s.name," ","stopped trying. The lease still holds, so new deliveries wait in the inbox. Restart crews it again with the same settings."]});case"releasing":return(0,t.jsxs)(ed,{tone:"note",icon:(0,t.jsx)(Q.f,{"aria-hidden":!0}),children:["Releasing: ",s.name," is stopping the session and cleaning up. The request goes away once it confirms."]})}}(s,{statusChangedAt:e.statusChangedAt,now:a}):null,"needsCrew"===s.kind&&e.hasTrierarchs?null===s.reason?(0,t.jsx)(ed,{tone:"note",icon:(0,t.jsx)(_.f,{"aria-hidden":!0}),children:"Waiting for the trierarch plugin to assign a trierarch."}):s.reason===n&&void 0!==e.machineLabels&&e.machineLabels.length>0?(0,t.jsxs)(ed,{tone:"waiting",icon:(0,t.jsx)(W.f,{"aria-hidden":!0}),children:[(0,t.jsx)("strong",{className:"font-medium",children:"No machine matches these labels."})," The plugin places this ship only on a machine with ",(0,F.U)(e.machineLabels),", and none"," ",(0,F.o)(e.machineLabels.length).carries,". It assigns a trierarch as soon as one does; until then this ship is on Needs crew."]}):(0,t.jsxs)(ed,{tone:"waiting",icon:(0,t.jsx)(W.f,{"aria-hidden":!0}),children:[(0,t.jsxs)("strong",{className:"font-medium",children:[(0,z.z)(s.reason),"."]})," The plugin assigns a trierarch as soon as one fits. Until then this ship is on Needs crew."]}):null,c,void 0===e.settingsRows?null:(0,t.jsx)(em,{rows:e.settingsRows,machineLabels:e.machineLabels}),"assigned"===s.kind&&e.login?.spentOnKeyUsd!==void 0?(0,t.jsx)(eg,{amount:e.login.spentOnKeyUsd}):null,(0,t.jsxs)("p",{className:"text-meta text-muted-foreground",children:["needsCrew"!==s.kind||e.hasTrierarchs?null:"On your Needs crew list. Crew it by hand: get a starting prompt and start a session with it. Crewing it fulfils the request; the request stays until you remove it. ","crewedByHand"===s.kind?`${s.crewedBy.name===z.D?"You":s.crewedBy.name} crewed it by hand. The request stands: if the lease ends, the ship is back on Needs crew until you crew it again or release it. `:null,(0,t.jsx)(er,{requestedBy:i,requestedAt:s.requestedAt,now:a}),"assigned"===s.kind&&"releasing"!==s.status?" The trierarch keeps it crewed until you release it.":null]})]})}var eb=e.i(686165),ev=e.i(448695);let ej=(0,R.f)(()=>e.A(823569).then(e=>e.RequestCrewDialog),e=>e.isOpen),ey=(0,R.f)(()=>e.A(705419).then(e=>e.CrewReleaseDialog),e=>e.isOpen),ew=(0,R.f)(()=>e.A(495953).then(e=>e.StartingPromptDialog),e=>e.isOpen);function ez({ship:e,timeline:n,now:i}){let a=(0,O.Q)(),r=(0,E.i)(),l=(0,E.t)(),d=(0,M.a)(),o=(0,M.e)(),c=(0,M.t)(),u=(0,M.F)(),m=(0,M.s)(),[p,h]=(0,s.useState)(),[g,f]=(0,s.useState)(),[x,b]=(0,s.useState)(!1),[v,j]=(0,s.useState)(),[y,w]=(0,s.useState)(!1),[z,k]=(0,s.useState)(),[N]=(0,L.f)(null===e.crewRequest?[]:[e.crewRequest.settings])??[],S=("agent"===e.kind||"trierarch"===e.kind)&&"retired"!==e.status,I=function(e){let n=(0,E.t)(),i=(0,E.W)(),a=i.data??[],r=void 0===n.data||void 0===i.data&&!i.isError,l=(0,eb.U)(),d=(0,ev.p)(),o=(0,M.a)(),c=(0,M.e)(n.data?.map(e=>e.shipId)),[u,m]=(0,s.useState)(),[p,h]=(0,s.useState)(null),[g,f]=(0,s.useState)(),x=(0,D.i)(n.data??[],a),{shipLabelsMax:b}=(0,Z.x)(),v=void 0===c||void 0===n.data?void 0:(0,F.u)(c,{machines:n.data,shipLabelsMax:b}),j=(0,L.f)(e?.heldSettings===void 0?[]:[e.heldSettings]),y=j?.[0]??null,w=(0,D.B)("edit"===u?(0,D.T)(y,{offers:x,enabledModels:a}):(0,D.P)(x)),z=void 0!==u&&void 0!==e&&("edit"!==u||void 0!==j),k=(0,E.J)(z&&!r?null===p?w:p:void 0),N=async t=>{if(void 0!==e&&void 0!==u){o.reset();try{let e=await k.checkNow();if("refused"===e.kind)return void f(new Date)}catch{}o.mutate({shipId:e.shipId,settings:t},{onSuccess:()=>{m(void 0),(0,U.showToast)("edit"===u?{title:`Settings saved for ${e.shipName}`,description:"Its trierarch restarts the session with them.",tone:"success"}:{title:`Crew requested for ${e.shipName}`,description:"The trierarch plugin assigns a trierarch that fits.",tone:"success"})}})}};return{open:e=>{o.reset(),h(null),f(void 0),m(e)},dialog:void 0===e?null:(0,t.jsx)(ej,{shipName:e.shipName,mode:u??"request",state:n.isError?"unreachable":r?"loading":"ready",offers:x,enabledModels:a,heldSettings:y,squadrons:"connected"===l?(d.data??[]).filter(e=>"disbanded"!==e.state).map(e=>e.id):void 0,...void 0===v?{}:{machineLabels:v},check:k.data,refusedAt:g,error:o.error?.message,isPending:o.isPending,isOpen:z,onOpenChange:e=>{e||m(void 0)},onSettingsChange:e=>{h(e),f(void 0)},onSubmit:e=>void N(e),onRetry:()=>{n.refetch(),i.refetch()}})}}(S?{shipId:e.id,shipName:e.name,heldSettings:e.crewRequest?.settings}:void 0);if(!S)return null;let C=(0,q.R)(e),$=e.crewRequest,R="assigned"===C.kind?l.data?.find(e=>e.shipId===C.trierarch.id)?.details:void 0,V="assigned"===C.kind&&null!=R?(0,A.g)(R,{shipId:e.id,harness:N?.harness??e.harness??void 0,isRunning:"running"===C.status}):void 0,W=async(e,t)=>{h(e),f(void 0);try{return await t(),!0}catch(t){return f({action:e,message:t instanceof Error?t.message:String(t)}),!1}finally{h(void 0)}},H=()=>{m.reset(),k((0,B.f)(e)&&e.startingPrompt?{issuedAt:e.startingPrompt.issuedAt}:void 0),w(!0),m.mutate({shipId:e.id})},K=async()=>{await W("request",()=>d.mutateAsync({shipId:e.id,settings:{}}))&&(0,U.showToast)({title:`${e.name} needs crew`,description:"It is on your Needs crew list until you crew it.",tone:"success",..."awaitingCrew"===e.status&&a.canManage?{action:{label:"Get starting prompt",onClick:H}}:{}})},_=async()=>{null===$||"assigned"!==C.kind||await W("restart",()=>d.mutateAsync({shipId:e.id,settings:$.settings}))&&(0,U.showToast)({title:`Restarting ${e.name}`,description:`${C.trierarch.name} starts its session again with the same settings.`,tone:"success"})},G=async t=>{j(void 0);let n=(0,q.Q)(t),s=0;try{for(let t of n)await ("removeCrewRequest"===t?c.mutateAsync({shipId:e.id}):u.mutateAsync({shipId:e.id})),s+=1;b(!1)}catch(t){let e=t instanceof Error?t.message:String(t);j(0===s?`${e} Nothing changed.`:`${e} Its crew request is removed; the session still holds the ship. Try again to end its lease.`)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ex,{stage:C,requestedBy:(0,q.m)(n),statusChangedAt:(0,q.L)(n),now:i,canManage:a.canManage,isAwaitingCrew:"awaitingCrew"===e.status,hasTrierarchs:r,...r?{usageHref:(0,T.f)({ship:e.id})}:{},busy:p,error:g,settingsRows:null===$?void 0:(0,D.O)(N),...void 0===V?{}:{login:V},...null===$||void 0===o?{}:{machineLabels:(0,P.R)((0,F.K)(N),o)},onRequest:()=>{r?I.open("request"):K()},...r?{onEdit:()=>{I.open("edit")}}:{},onRemove:()=>void W("remove",()=>c.mutateAsync({shipId:e.id})),onRelease:()=>{j(void 0),b(!0)},onRestart:()=>void _(),onGetStartingPrompt:H}),I.dialog,"crewedByHand"===C.kind||"assigned"===C.kind?(0,t.jsx)(ey,{shipName:e.name,stage:C,sessionLocation:null===e.location?null:e.location.description??e.location.kind.toLowerCase(),inFlightCount:e.inFlightDeliveries,isOpen:x,onOpenChange:b,isPending:c.isPending||u.isPending,error:v,onConfirm:()=>void G(C)}):null,(0,t.jsx)(ew,{shipName:e.name,state:m.data?"shown":m.isError?"error":"issuing",prompt:m.data?.prompt,crewLines:m.data?.crewLines,replacesUnclaimed:z,error:m.error?.message,isOpen:y,onOpenChange:e=>{e||(m.reset(),w(!1))},onConfirm:()=>{m.mutate({shipId:e.id})}})]})}var ek=e.i(784294),eN=e.i(219249);function eS({label:e,children:n}){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 flex-wrap items-center gap-1.5 text-body text-foreground",children:n})]})}function eI({shipId:e,now:n}){let s=(0,ev.p)(),i=(0,ev.b)(),a=s.data?.find(t=>t.flagship.shipId===e||t.members.some(t=>t.shipId===e));if(!a)return null;let r=(0,t.jsx)(Y.default,{href:`/squadrons/${a.id}`,className:"font-mono hover:underline","data-testid":"ship-squadron-link",children:a.id});if(a.flagship.shipId===e)return(0,t.jsxs)("div",{role:"note","data-testid":"ship-flagship-note",className:"flex flex-wrap items-center gap-3 rounded-lg border border-border bg-muted px-3.5 py-3 text-meta text-foreground",children:[(0,t.jsxs)("span",{className:"grow",children:["Flagship of squadron ",r,": the address for work sent to the team. The squadron manager crews it, so it can’t be released, renamed or retired; it retires when the squadron disbands."]}),(0,t.jsx)(p.f,{size:"xs",nativeButton:!1,render:(0,t.jsx)(Y.default,{href:`/squadrons/${a.id}`}),"data-testid":"ship-open-squadron",children:"Open squadron"})]});let l=a.members.find(t=>t.shipId===e);if(!l)return null;let d=i.data?.blueprints.find(e=>e.repository===a.blueprint.repository&&e.name===a.blueprint.name&&e.version===a.blueprint.version),o=d?.roles.find(e=>e.name===l.role)?.template,c=null===l.crew.lastSeenAt?void 0:(0,w.m)(new Date(l.crew.lastSeenAt),n);return(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:["silent"===l.health&&"disbanded"!==a.state&&(0,t.jsxs)("div",{role:"alert","data-testid":"ship-silent-alert",className:"rounded-lg border border-tone-attention-border bg-tone-attention-bg px-3.5 py-3 text-meta text-foreground",children:[(0,t.jsx)("strong",{className:"font-semibold text-tone-attention-fg",children:void 0===c?"Silent.":`Silent: not seen for ${c}.`})," It checks in"," ",(0,ek.P)(l.checkInMinutes),", so its session has probably stopped. Get a new crew line and start a new session; the old crew line then stops working."]}),(0,t.jsxs)("dl",{"data-testid":"ship-squadron-facts",className:"grid grid-cols-4 gap-px overflow-hidden rounded-lg border border-border bg-border max-sm:grid-cols-2",children:[(0,t.jsxs)(eS,{label:"Squadron",children:[r,(0,t.jsx)(x.T,{status:a.state})]}),(0,t.jsxs)(eS,{label:"Role and template",children:[(0,t.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 font-mono text-id",children:l.role}),o&&(0,t.jsxs)(Y.default,{href:(0,ek.p)(o),className:"font-mono text-meta hover:underline",children:[o.name,"@",o.version]})]}),(0,t.jsx)(eS,{label:"Health",children:(0,t.jsx)(eN._,{health:l.health,detail:"silent"===l.health||"late"===l.health?c:void 0})}),(0,t.jsx)(eS,{label:"Hand-offs",children:d?(0,t.jsx)("span",{className:"text-meta",children:(0,ek.e)((0,ek.S)(d,l.role))}):(0,t.jsx)(Y.default,{href:(0,ek.K)(a.blueprint),className:"text-meta text-muted-foreground hover:underline",children:"See its blueprint"})})]})]})}var eC=e.i(221959),e$=e.i(566297),eA=e.i(876561),eT=e.i(422768),eR=e.i(772382),eO=e.i(810818),eq=e.i(446513),eD=e.i(869309),eM=e.i(765649),eP=e.i(999808),eL=e.i(588671),eF=e.i(705918),eB=e.i(861966),eE=e.i(763481),eU=e.i(676641);function eV({harness:e,model:n,isHarnessUnknown:s=!1,testId:i}){if(null===e&&null===n&&!s)return null;let a=null!==e||s;return(0,t.jsxs)("span",{"data-testid":i,className:"flex min-w-0 flex-wrap items-center gap-x-1 text-meta text-muted-foreground",children:[null===e?null:(0,t.jsx)("span",{children:(0,ee.f)(e)}),null===e&&s?(0,t.jsx)(eU.f,{}):null,a&&null!==n?(0,t.jsx)("span",{"aria-hidden":!0,children:"·"}):null,null===n?null:(0,t.jsx)("span",{className:"truncate font-mono text-id",children:n})]})}var eW=e.i(73330);function eH({ping:e,now:n,testId:s}){return null===e?null:(0,t.jsx)("span",{title:`Pinged ${(0,w.o)(new Date(e.sentAt))}`,"data-testid":s,"data-state":e.state,className:"text-meta text-muted-foreground tabular-nums",children:(0,eW.T)(e,n)})}var eK=e.i(867927),e_=e.i(793361),eG=e.i(591703);function eQ({details:e,bytes:n,version:s,testId:i}){return(0,t.jsxs)("details",{"data-testid":i,className:"group rounded-lg border border-border bg-card",children:[(0,t.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 px-3.5 py-2.5 text-meta text-muted-foreground [&::-webkit-details-marker]:hidden",children:[(0,t.jsx)(eK.f,{"aria-hidden":!0,className:"size-(--size-icon-sm) shrink-0 transition-transform group-open:rotate-90"}),(0,t.jsx)("span",{className:"font-medium text-foreground",children:"Report details"}),(0,t.jsxs)("span",{className:"tabular-nums",children:["· version ",s]})]}),(0,t.jsx)("div",{className:"px-3.5 pb-3.5",children:(0,t.jsx)(eG.f,{label:(0,e_.t)(n),code:(0,e_.e)(e),copyLabel:"Copy report details",codeTestId:`${i}-code`})})]})}function eX({statement:e,testId:n}){return null===e?(0,t.jsx)("span",{"data-testid":n,className:"text-meta text-muted-foreground",children:"No statement"}):"commission"===e.by?(0,t.jsxs)("span",{"data-testid":n,className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-body text-foreground",children:e.note}),(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Commission note, until a crew states one"})]}):(0,t.jsxs)("span",{"data-testid":n,className:"flex min-w-0 flex-col gap-1.5",children:[(0,t.jsx)("span",{className:"text-body text-foreground",children:e.summary}),0===e.capabilities.length?null:(0,t.jsx)("ul",{"aria-label":"Offers",className:"flex min-w-0 flex-col gap-1",children:e.capabilities.map(e=>(0,t.jsxs)("li",{className:"flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-meta",children:[(0,t.jsx)("span",{className:"font-mono text-id text-foreground",children:e.name}),void 0===e.title?null:(0,t.jsx)("span",{className:"text-foreground",children:e.title}),void 0===e.description?null:(0,t.jsx)("span",{className:"text-muted-foreground",children:e.description})]},e.name))}),(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:["Stated by its crew · version ",e.version]})]})}var eJ=e.i(781830),eY=e.i(221980),eZ=e.i(466787);function e0({heading:e,lines:n,testId:s}){return(0,t.jsxs)("section",{"aria-label":e,"data-testid":s,className:"flex flex-col gap-1.5 rounded-lg border border-tone-attention-border bg-tone-attention-bg px-3.5 py-2.5 text-tone-attention-fg",children:[(0,t.jsxs)("h2",{className:"flex items-center gap-1.5 text-meta font-semibold",children:[(0,t.jsx)(eZ.f,{"aria-hidden":!0,className:"size-(--size-icon-sm) shrink-0"}),e]}),n.map(e=>(0,t.jsxs)("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5 text-meta text-foreground",children:[void 0===e.ship?null:(0,t.jsx)("span",{className:"font-semibold",children:e.ship}),""===e.text?null:(0,t.jsx)("span",{children:e.text}),(0,t.jsx)("span",{className:"text-muted-foreground sm:ml-auto",children:e.caption})]},e.key))]})}let e1={"crew-request-unassigned":"Crew request unassigned","delivery-unacknowledged":"Delivery unacknowledged","delivery-overdue":"Delivery overdue","ping-unanswered":"Ping unanswered","report-unchanged":"Report unchanged","task-not-done":"Task not done"};function e2(e){let t=Object.entries(e1).find(([t])=>t===e)?.[1];return void 0===t?e:t.toLowerCase()}var e5=e.i(805236),e6=e.i(539448);function e3({alert:e,now:n}){let s,i,{headline:a,detail:r,caption:l}=(s=new Date(e.since),i=function(e){switch(e.signal){case"crew-request-unassigned":return e.facts.reason;case"delivery-unacknowledged":return e.facts.awaitingCrew?"awaiting crew":null;case"report-unchanged":return`expected within ${String(e.facts.minutes)} min`;case"delivery-overdue":case"ping-unanswered":case"task-not-done":return null}}(e),{headline:`${e1[e.signal]} ${(0,w.m)(s,n)}`,detail:null===i?null:`${i.charAt(0).toUpperCase()}${i.slice(1)}`,caption:[`since ${(0,w.l)(s,n)}`,...null===e.ownerShipId?[]:["owner told"],"clears by itself"].join(" · ")});return(0,t.jsx)(e0,{heading:a,lines:[{key:e.id,text:r??"",caption:l}],testId:"ship-open-alert"})}function e8({label:e,children:n}){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:n})]})}function e4({ship:e,now:n,viewerFleetId:s,labels:i,owner:a,way:r}){let l,d="operator"===e.kind,o=function({reportChangesWithin:e,taskDoneBy:t},{reportTask:n,now:s,viewerFleetId:i}){let a=[];if(e&&a.push({key:"reportChangesWithin",text:`Report changes within ${String(e.minutes)} min`}),t){var r,l;let{label:e,title:d}=(0,e5.X)(t.task,i),o=null===n||!function e(t,n){if(Array.isArray(t)||Array.isArray(n))return Array.isArray(t)&&Array.isArray(n)&&t.length===n.length&&t.every((t,s)=>e(t,n[s]));if("object"==typeof t&&null!==t&&"object"==typeof n&&null!==n){let s=Object.entries(t),i=new Map(Object.entries(n));return s.length===i.size&&s.every(([t,n])=>i.has(t)&&e(n,i.get(t)))}return t===n}(n,t.task),c=`Task ${e} done by ${(r=new Date(t.doneBy),l=s,r.toDateString()===l.toDateString()?(0,w.w)(r):(0,w.B)(r))}`;a.push({key:"taskDoneBy",text:o?`${c} \xb7 lapsed`:c,title:d,isLapsed:o})}return a}(e.expectations,{reportTask:e.report?.task??null,now:n,viewerFleetId:s}),c=null===e.crewedSince?null:new Date(e.crewedSince),u=new Date(e.commissionedAt);return(0,t.jsxs)("dl",{className:"grid grid-cols-4 gap-px overflow-hidden rounded-lg border border-border bg-border max-sm:grid-cols-2",children:[(0,t.jsx)(e8,{label:"Location",children:(0,t.jsxs)("span",{className:"inline-flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)(eE.f,{kind:e.location?.kind??null,description:e.location?.description,size:"md"}),(0,t.jsx)(eV,{harness:e.harness,model:e.model?.id??null,isHarnessUnknown:"agent"===e.kind&&"crewed"===e.status&&null===e.harness,testId:"ship-model"}),null===e.lastSeenAt?null:(0,t.jsx)("time",{dateTime:e.lastSeenAt,title:(0,w.o)(new Date(e.lastSeenAt)),"data-testid":"ship-last-seen",className:"text-meta text-muted-foreground tabular-nums",children:(0,w.V)(new Date(e.lastSeenAt),n)}),(0,t.jsx)(eH,{ping:e.ping,now:n,testId:"ship-ping-status"}),"agent"!==e.kind&&"plugin"!==e.kind&&"trierarch"!==e.kind?null:(0,t.jsx)(eJ.f,{report:e.report,now:n,variant:"full",viewerFleetId:s,testId:"ship-report"}),(0,t.jsx)(eY.f,{activity:e.activity,now:n,variant:"full",testId:"ship-activity"})]})}),(0,t.jsx)(e8,{label:"Crewed since",children:c?(0,t.jsx)("time",{dateTime:e.crewedSince??void 0,title:(0,w.o)(c),className:"tabular-nums",children:(l=n.getTime()-c.getTime()<864e5?(0,w.w)(c):(0,w.B)(c),`${l} \xb7 ${(0,w.m)(c,n)}`)}):(0,t.jsx)("span",{className:"text-muted-foreground",children:"Not crewed"})}),(0,t.jsx)(e8,{label:"Commissioned",children:(0,t.jsx)("time",{dateTime:e.commissionedAt,title:(0,w.o)(u),children:d?`Fleet created ${(0,w.P)(u)}`:(0,w.P)(u)})}),(0,t.jsxs)(e8,{label:"Ship id",children:[(0,t.jsx)("span",{className:"truncate font-mono text-id",children:e.id}),(0,t.jsx)(eB.f,{value:e.id,label:"Copy ship id"})]}),void 0===r?null:(0,t.jsxs)("div",{className:"col-span-4 flex min-w-0 items-start gap-4 bg-card px-3.5 py-2.5 max-sm:col-span-2 max-sm:flex-col max-sm:gap-1.5","data-testid":"ship-delivery",children:[(0,t.jsx)("dt",{className:"shrink-0 text-meta text-muted-foreground",children:"Delivery"}),(0,t.jsx)("dd",{className:"min-w-0 flex-1",children:r})]}),0===o.length?null:(0,t.jsxs)("div",{className:"col-span-4 flex min-w-0 items-start gap-4 bg-card px-3.5 py-2.5 max-sm:col-span-2 max-sm:flex-col max-sm:gap-1.5","data-testid":"ship-expectations",children:[(0,t.jsx)("dt",{className:"shrink-0 text-meta text-muted-foreground",children:"Expectations"}),(0,t.jsx)("dd",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:o.map(e=>"reportChangesWithin"===e.key?(0,t.jsx)("span",{className:"text-body text-foreground",children:e.text},e.key):(0,t.jsx)("span",{title:e.title,className:"text-meta text-muted-foreground tabular-nums",children:e.text},e.key))})]}),void 0===a?null:(0,t.jsxs)("div",{className:"col-span-4 flex min-w-0 items-center gap-4 bg-card px-3.5 py-2.5 max-sm:col-span-2 max-sm:flex-col max-sm:items-start max-sm:gap-1.5","data-testid":"ship-owner",children:[(0,t.jsx)("dt",{className:"shrink-0 text-meta text-muted-foreground",children:"Owner"}),(0,t.jsx)("dd",{className:"min-w-0 flex-1 text-body text-foreground",children:a})]}),d?null:(0,t.jsxs)("div",{className:"col-span-4 flex min-w-0 items-start gap-4 bg-card px-3.5 py-2.5 max-sm:col-span-2 max-sm:flex-col max-sm:gap-1.5",children:[(0,t.jsx)("dt",{className:"shrink-0 text-meta text-muted-foreground",children:"Statement"}),(0,t.jsx)("dd",{className:"min-w-0 flex-1",children:(0,t.jsx)(eX,{statement:e.statement,testId:"ship-statement"})})]}),void 0===i?null:(0,t.jsxs)("div",{className:"col-span-4 flex min-w-0 items-center gap-4 bg-card px-3.5 py-2.5 max-sm:col-span-2 max-sm:flex-col max-sm:items-start max-sm:gap-1.5","data-testid":"ship-labels",children:[(0,t.jsx)("dt",{className:"shrink-0 text-meta text-muted-foreground",children:"Labels"}),(0,t.jsx)("dd",{className:"min-w-0 flex-1",children:i})]})]})}function e7({icon:e,children:n,testId:s}){return(0,t.jsxs)("p",{"data-testid":s,className:"flex items-center gap-2 rounded-lg border border-border bg-muted px-3.5 py-2.5 text-meta text-muted-foreground [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",children:[e,(0,t.jsx)("span",{children:n})]})}function e9({gateway:e}){return void 0===e.shipId?(0,t.jsx)("span",{className:"font-medium text-foreground",children:e.name}):(0,t.jsx)(Y.default,{href:`/ships/${e.shipId}`,className:"font-medium text-foreground underline underline-offset-2",children:e.name})}function te({reader:e}){return(0,t.jsxs)(e7,{icon:(0,t.jsx)(eR.f,{"aria-hidden":!0}),testId:"ship-gateway-mark",children:["The gateway reads this ship’s payloads:"," ","crew"===e.as?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e9,{gateway:e.gateway})," crews it."]}):(0,t.jsxs)(t.Fragment,{children:["it is ",(0,t.jsx)(e9,{gateway:e.gateway}),"’s proxy ship for an outside party."]})]})}function tt({ship:e,shipId:n,state:s,actions:i,permissions:a,crewRequest:r,now:l,viewerFleetId:d,backHref:o="/",labels:c,owner:u,isPluginShip:m=!1,way:f,gatewayReader:x}){if("loading"===s||"ready"===s&&void 0===e)return(0,t.jsxs)("div",{"aria-busy":!0,"data-testid":"ship-header",className:"flex flex-col gap-4",children:[(0,t.jsx)("span",{className:"sr-only",children:"Loading the ship"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(eL.f,{className:"h-8 w-40"}),(0,t.jsx)(eL.f,{className:"h-6 w-20"}),(0,t.jsx)(eL.f,{className:"h-6 w-16"})]}),(0,t.jsx)(eL.f,{className:"h-16 w-full rounded-lg"})]});if("not-found"===s||void 0===e)return(0,t.jsx)("div",{"data-testid":"ship-header",children:(0,t.jsx)(g.f,{variant:"section",icon:(0,t.jsx)(eT.f,{}),title:"Ship not found",description:(0,t.jsxs)(t.Fragment,{children:["No ship with the id ",n?(0,t.jsx)("span",{className:"font-mono text-id",children:n}):"given"," exists in this fleet. The link may be incomplete. Retired ships keep their page."]}),action:(0,t.jsx)(p.f,{size:"sm",nativeButton:!1,render:({children:e,...n})=>(0,t.jsx)(Y.default,{href:o,...n,children:e}),children:"Back to fleet overview"})})});let b="operator"===e.kind,v="retired"===e.status;return(0,t.jsxs)("div",{"data-testid":"ship-header",className:"flex flex-col gap-4 max-sm:gap-3",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 max-sm:flex-col max-sm:items-start max-sm:gap-1.5",children:[(0,t.jsx)("h1",{className:"min-w-0",children:(0,t.jsx)(e6.f,{name:e.name,shipId:e.id,size:"title",isSuffixShown:v})}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(eP.W,{state:e.status}),e.openAlertCount>0?(0,t.jsx)(eP.W,{state:"alert",isBadge:!0}):null,b?(0,t.jsxs)(eF.f,{variant:"kind",children:[(0,t.jsx)(eM.f,{"aria-hidden":!0}),"operator"]}):(0,t.jsxs)(t.Fragment,{children:[m?(0,t.jsxs)(eF.f,{variant:"kind","data-testid":"ship-plugin",children:[(0,t.jsx)(eD.f,{"aria-hidden":!0}),"plugin"]}):null,(0,t.jsx)(eF.f,{variant:"type",children:e.type}),"trierarch"===e.kind?(0,t.jsxs)(eF.f,{variant:"kind","data-testid":"ship-kind",children:[(0,t.jsx)(eq.f,{"aria-hidden":!0}),"Kind: Trierarch"]}):null]}),"awaitingCrew"===e.status&&null===e.startingPrompt?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-meta text-muted-foreground [&_svg]:size-(--size-icon-sm)",children:[(0,t.jsx)(H.f,{"aria-hidden":!0}),"No starting prompt issued"]}):null,"awaitingCrew"===e.status&&null!==e.startingPrompt?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-meta text-muted-foreground [&_svg]:size-(--size-icon-sm)",children:[(0,t.jsx)(H.f,{"aria-hidden":!0}),(0,t.jsxs)("span",{children:["Prompt issued"," ",(0,t.jsx)("time",{dateTime:e.startingPrompt.issuedAt,title:(0,w.o)(new Date(e.startingPrompt.issuedAt)),children:(0,w.W)(new Date(e.startingPrompt.issuedAt),l)}),e.startingPrompt.isClaimed?", claimed":", not claimed yet"]})]}):null]})]}),i&&!v?(0,t.jsx)("div",{className:(0,h.f)("flex flex-wrap items-center gap-2","max-sm:w-full max-sm:[&>*]:flex-1"),children:i}):null]}),b?(0,t.jsx)(e7,{icon:(0,t.jsx)(eO.f,{"aria-hidden":!0}),children:"argo is your ship. This console session crews it. It can’t be released, renamed or retired."}):null,v&&null!==e.retiredAt?(0,t.jsxs)(e7,{icon:(0,t.jsx)(eA.f,{"aria-hidden":!0}),children:["Retired on ",(0,w.o)(new Date(e.retiredAt)),". Read-only."]}):null,void 0===x?null:(0,t.jsx)(te,{reader:x}),r,e.openAlerts.map(e=>(0,t.jsx)(e3,{alert:e,now:l},e.id)),(0,t.jsx)(e4,{ship:e,now:l,viewerFleetId:d,labels:c,owner:u,way:f}),a??("operator"===e.kind||"viewer"===e.kind?null:(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)("h2",{className:"text-section font-semibold",children:"Permissions"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.scopes.map(e=>(0,t.jsx)(eF.f,{variant:"type","data-testid":"ship-fleet-scope",children:e},e))})]})),("agent"===e.kind||"plugin"===e.kind||"trierarch"===e.kind)&&e.report?.details&&null!==e.report.detailsBytes?(0,t.jsx)(eQ,{details:e.report.details,bytes:e.report.detailsBytes,version:e.report.detailsVersion,testId:"ship-report-details"}):null]})}var tn=e.i(749655),ts=e.i(446157);function ti({view:e,onOpenMessage:n}){let{lines:s,oldest:i}=e;return(0,t.jsxs)("ul",{"data-testid":"ship-way","aria-label":"Its side of the way",className:"flex flex-col gap-1",children:[s.map(e=>(0,t.jsx)(ts.Q,{line:e,testId:"ship-way-line"},e.text)),i?(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button","data-testid":"ship-way-oldest","aria-label":`Open the oldest message waiting: ${i.text}`,onClick:()=>{n(i.messageId)},className:"inline-flex flex-wrap items-center gap-1.5 rounded-xs text-left text-meta hover:underline focus-visible:outline-2 focus-visible:outline-ring max-sm:text-body-touch",children:[(0,t.jsx)(x.T,{status:i.status}),i.isOverdue?(0,t.jsx)(tn.f,{"aria-hidden":!0,className:"size-3.5 shrink-0 text-tone-attention-fg"}):null,(0,t.jsx)("span",{className:(0,h.f)(i.isOverdue?"text-tone-attention-fg":"text-muted-foreground"),children:i.text}),(0,t.jsx)(eK.f,{"aria-hidden":!0,className:"size-(--size-icon-sm)"})]})}):null]})}let ta="gateway";var tr=e.i(699261),tl=e.i(689664),td=e.i(716327),to=e.i(456539),tc=e.i(77071),tu=e.i(263676),tm=e.i(770703),tp=e.i(406734);let th=(0,tm.default)(()=>e.A(867858).then(e=>e.LabelPicker),{loadableGenerated:{modules:[259068]},ssr:!1});function tg({chip:e,labelKey:n,isBusy:i,onUnassign:a,onChange:r}){let[l,d]=(0,s.useState)(!1);return(0,t.jsxs)(tp.V,{open:l,onOpenChange:d,children:[(0,t.jsx)(tp.J,{render:(0,t.jsx)("button",{type:"button","aria-label":`Change or remove ${e.key}: ${e.value}`,"data-testid":"ship-label-yours",disabled:i,className:"inline-flex items-center rounded-sm focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-60"}),children:(0,t.jsx)(en.f,{chip:e,trailing:(0,t.jsx)(td.f,{"aria-hidden":!0}),className:"hover:bg-accent"})}),(0,t.jsxs)(tp.T,{align:"start",sideOffset:6,className:"w-72 p-1.5","data-testid":"ship-label-menu",children:[(0,t.jsxs)("span",{className:"flex items-center justify-between px-2 pt-1 pb-1.5 text-meta",children:[(0,t.jsxs)("span",{className:"font-mono",children:[e.key,": ",(0,t.jsx)("span",{className:"text-muted-foreground",children:e.value})]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"Change the value"})]}),(0,t.jsx)("ul",{className:"flex flex-col",children:(n?.values??[]).map(s=>{let i=s.valueId===e.valueId,a=n?.carriedValueIds.includes(s.valueId)??!1;return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",disabled:a,"data-testid":"ship-label-value",className:"flex h-(--size-control-sm) w-full items-center gap-2 rounded-sm px-2 text-left text-body hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring disabled:pointer-events-none [&_svg]:size-(--size-icon-sm)",onClick:()=>{d(!1),r({from:e.valueId,to:s.valueId})},children:[(0,t.jsx)("span",{className:"w-4",children:a?(0,t.jsx)(tl.f,{"aria-hidden":!0}):null}),(0,t.jsx)("span",{className:(0,h.f)("min-w-0 grow truncate font-mono",a&&!i?"text-muted-foreground":void 0),children:s.value}),(0,t.jsx)("span",{className:"text-meta text-muted-foreground tabular-nums",children:a&&!i?"Carried":`${String(s.shipCount)} ${1===s.shipCount?"ship":"ships"}`})]})},s.valueId)})}),(0,t.jsx)("div",{className:"mt-1 border-t border-border pt-1",children:(0,t.jsxs)("button",{type:"button","data-testid":"ship-label-remove",className:"flex h-(--size-control-sm) w-full items-center gap-2 rounded-sm px-2 text-body text-destructive-text hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring [&_svg]:size-(--size-icon-sm)",onClick:()=>{d(!1),a(e.valueId)},children:[(0,t.jsx)(tu.X,{"aria-hidden":!0}),"Remove label"]})})]})]})}function tf({keys:e,isBusy:n,onAssign:i}){let[a,r]=(0,s.useState)(!1);return(0,t.jsxs)(tp.V,{open:a,onOpenChange:r,children:[(0,t.jsx)(tp.J,{render:(0,t.jsx)(p.f,{variant:"ghost",size:"xs",icon:(0,t.jsx)(tc.f,{}),disabled:n,"data-testid":"ship-labels-add"}),children:"Add label"}),(0,t.jsxs)(tp.T,{align:"start",sideOffset:6,className:"w-80 p-2","data-testid":"ship-labels-add-popover",children:[(0,t.jsxs)("span",{className:"flex items-center justify-between px-2 pt-1 pb-2 text-body font-medium",children:["Add a label",(0,t.jsx)("span",{className:"text-meta font-normal text-muted-foreground",children:"Yours"})]}),0===e.length?(0,t.jsx)("p",{className:"px-2 py-2 text-meta text-muted-foreground",children:"You have no labels yet. Define one on the Labels page, then put it on ships here."}):(0,t.jsx)(th,{groups:[{title:"Yours",keys:[...e]}],pickedValueIds:e.flatMap(e=>e.carriedValueIds),pickedWord:"Carried",onPick:e=>{r(!1),i(e)}}),(0,t.jsx)("p",{className:"mt-2 flex items-center justify-between border-t border-border px-2 pt-2 text-meta",children:(0,t.jsx)(Y.default,{href:"/labels",className:"font-medium hover:underline",children:0===e.length?"Define a label":"Manage labels"})})]})]})}function tx({chips:e,keys:n,limit:i,isBusy:a,error:r,onAssign:l,onUnassign:d,onChange:o}){let[c,u]=(0,s.useState)(!1),m=!c&&e.length>3,p=m?e.slice(0,2):e,h=[...new Set(p.filter(e=>"none"!==e.mark).map(e=>e.ownerName))];return(0,t.jsxs)("span",{className:"flex min-w-0 flex-col gap-2","data-testid":"ship-labels-edit",children:[(0,t.jsxs)("span",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[0===e.length?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"No labels"}):null,p.filter(e=>"none"===e.mark).map(e=>(0,t.jsx)(tg,{chip:e,labelKey:n.find(t=>t.labelId===e.labelId),isBusy:a,onUnassign:d,onChange:o},e.valueId)),m?(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:()=>{u(!0)},children:["+",e.length-2]}):null,i.isAtLimit?null:(0,t.jsx)(tf,{keys:n,isBusy:a,onAssign:l}),h.map(e=>(0,t.jsxs)("span",{className:"inline-flex flex-wrap items-center gap-1.5",children:[(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:["by ",e]}),p.filter(t=>"none"!==t.mark&&t.ownerName===e).map(e=>(0,t.jsx)(en.f,{chip:e,testId:"ship-label"},e.valueId))]},e)),c&&e.length>3?(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:()=>{u(!1)},children:[(0,t.jsx)(to.f,{"aria-hidden":!0}),"Show fewer"]}):null,i.isAtLimit?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"At the limit: a ship carries at most 20 labels (decision 0031)."}):null,void 0===i.count?null:(0,t.jsx)("span",{className:"ml-auto text-meta text-muted-foreground tabular-nums","data-testid":"ship-labels-count",children:i.count})]}),void 0===r?null:(0,t.jsx)(f.f,{title:r.title,description:`Refused: ${r.message}. Nothing changed.`})]})}function tb(e,t){for(let n of e){let e=n.values.find(e=>e.valueId===t);if(void 0!==e)return`${n.key}=${e.value}`}return"the label"}function tv({ship:e}){let{shipLabelsMax:n}=(0,Z.x)(),i=(0,M.e)(),a=(0,O.Q)(),r=(0,M.g)(),l=(0,M.j)(),[d,o]=(0,s.useState)(void 0);if(void 0===i)return(0,t.jsx)(eL.f,{className:"h-5.5 w-40"});let c=(0,P.h)(e,i);if(!(0,P.P)(e,a))return(0,t.jsx)(tr.f,{chips:c});let u=(0,P.i)(e,i),m=e=>t=>{o({title:e,message:t.message})};return(0,t.jsx)(tx,{chips:c,keys:u,limit:(0,P.N)(e,n),isBusy:r.isPending||l.isPending,error:d,onAssign:t=>{o(void 0),r.mutate({shipId:e.id,valueId:t},{onError:m(`Couldn’t add ${tb(u,t)}`)})},onUnassign:t=>{o(void 0),l.mutate({shipId:e.id,valueId:t},{onError:m(`Couldn’t remove ${tb(u,t)}`)})},onChange:({from:t,to:n})=>{o(void 0),l.mutate({shipId:e.id,valueId:t},{onSuccess:()=>{r.mutate({shipId:e.id,valueId:n},{onError:s=>{r.mutate({shipId:e.id,valueId:t}),m(`Couldn’t change ${tb(u,t)} to ${tb(u,n)}`)(s)}})},onError:m(`Couldn’t change ${tb(u,t)}`)})}})}var tj=e.i(954616),ty=e.i(266027),tw=e.i(912598),tz=e.i(427702),tk=e.i(653145),tN=e.i(582980);function tS({shipName:e,scopes:n,choices:i,canChange:a,isPending:r,error:l,readError:d,isRetrying:o,onRetry:c,onSave:u}){let[m,h]=(0,s.useState)(r),{control:g,setValue:x,reset:b,handleSubmit:v}=(0,tk.G)({defaultValues:{grant:[],revoke:[]}}),{grant:j=[],revoke:y=[]}=(0,tk.g)({control:g}),w=[...n.filter(e=>!y.includes(e)),...j.filter(e=>!n.includes(e))],[z,k]=(0,s.useState)(""),N=i?.map(e=>({...e,hint:e.isLocked?"You cannot change this permission.":j.includes(e.scope)?"Will add":y.includes(e.scope)?"Will remove":void 0}));return(0,t.jsxs)("section",{className:"flex w-full max-w-200 flex-col gap-3","aria-label":"Permissions","data-testid":"ship-permissions",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("h2",{className:"text-section font-semibold",children:"Permissions"}),a?m?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Editing permissions"}):(0,t.jsx)(p.f,{onClick:()=>{b(),k(""),h(!0)},"data-testid":"ship-permissions-change",children:"Change permissions"}):null]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:n.map(e=>(0,t.jsx)(eF.f,{variant:"type","data-testid":"ship-fleet-scope",children:e},e))}),m?(0,t.jsxs)("form",{onSubmit:e=>{v(e=>{u(e)})(e)},className:"flex flex-col gap-3 rounded-lg border border-border p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("h3",{className:"text-section font-semibold",children:"Change permissions"}),(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:e})]}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Add or remove permissions you may grant."}),void 0!==d||!0===o?(0,t.jsx)(f.f,{title:"Couldn’t read permissions",description:d,onRetry:c,isRetrying:o}):void 0===N?(0,t.jsx)(eL.f,{className:"h-40 w-full"}):(0,t.jsx)(tN.f,{isExpanded:!0,choices:N,picked:w,onPick:e=>{x("grant",e.filter(e=>!n.includes(e))),x("revoke",n.filter(t=>!e.includes(t)))},query:z,onQueryChange:k,isDisabled:r}),void 0===l?null:(0,t.jsx)(f.f,{title:"Permissions not saved",description:l}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[(0,t.jsxs)("p",{className:"mr-auto text-meta text-muted-foreground",role:"status",children:[j.length," permission",1===j.length?"":"s"," added · ",y.length," removed"]}),(0,t.jsx)(p.f,{type:"button",disabled:r,onClick:()=>{b(),h(!1)},"data-testid":"ship-permissions-cancel",children:"Cancel"}),(0,t.jsx)(p.f,{type:"submit",variant:"primary",isLoading:r,disabled:void 0===i||void 0!==d||0===j.length&&0===y.length,"data-testid":"ship-permissions-save",children:r?"Saving permissions":"Save permissions"})]})]}):null]})}function tI({ship:e}){let{savedVersion:n,...i}=function(e){let t=(0,tz.I)(),n=(0,tw.d)(),[i,a]=(0,s.useState)(0),[r,l]=(0,s.useState)(!1),d=(0,ty.f)(t.console.session.queryOptions()),o=(0,ty.f)(t.fleet.scopes.queryOptions()),c=(0,ty.f)(t.fleet.checkManage.queryOptions({shipId:e.id},{enabled:d.data?.scopes.includes("scopes:grant")===!0&&"retired"!==e.status&&"operator"!==e.kind&&"viewer"!==e.kind,retry:!1})),u=(0,tj.f)(t.fleet.grantScopes.mutationOptions({onSuccess:async()=>{await n.invalidateQueries({queryKey:t.fleet.pathKey()}),a(e=>e+1),(0,U.showToast)({title:`Permissions saved for ${e.name}`,tone:"success"})}}));return{...function({ship:e,actor:t,catalogue:n,hasManageReach:s}){let i=t?.scopes.includes("scopes:grant")===!0&&!0===s&&e.id!==t.shipId&&"retired"!==e.status&&"operator"!==e.kind&&"viewer"!==e.kind,a=n?.flatMap(e=>e.scopes.map(n=>({...n,isLocked:"messages:send"===n.scope||"messages:receive"===n.scope||t?.kind!=="operator"&&t?.scopes.includes(n.scope)!==!0&&(t?.shipId===void 0||"plugin"!==e.kind||e.declaredBy?.id!==t.shipId)})));return{canChange:i,choices:void 0===a?void 0:[...a,...e.scopes.filter(e=>!a.some(t=>t.scope===e)).map(e=>({scope:e,description:e,isLocked:!0}))]}}({ship:e,actor:d.data,catalogue:o.data,hasManageReach:c.isSuccess}),savedVersion:i,isPending:u.isPending,error:u.error?.message,readError:o.error?.message,isRetrying:r,onRetry:()=>{l(!0),o.refetch().finally(()=>{l(!1)})},onSave:t=>{u.mutate({shipId:e.id,...t})}}}(e);return(0,t.jsx)(tS,{shipName:e.name,scopes:e.scopes,...i},n)}var tC=e.i(970597),t$=e.i(619273),tA=e.i(621482),tT=e.i(731877),tR=e.i(515281);function tO({owner:e,onChange:n}){return"itself"===e.kind?(0,t.jsx)("span",{"data-testid":"ship-owner-name",children:"Owns itself"}):(0,t.jsxs)("span",{className:"flex min-w-0 flex-wrap items-center gap-x-4 gap-y-1.5",children:[void 0===e.name?(0,t.jsx)(eL.f,{className:"h-5 w-24"}):(0,t.jsx)(Y.default,{href:`/ships/${e.id}`,"data-testid":"ship-owner-name",className:"font-medium text-foreground underline underline-offset-2",children:e.isYou?`${e.name} (you)`:e.name}),void 0===n?null:(0,t.jsxs)(p.f,{type:"button",variant:"ghost",size:"sm",onClick:n,"data-testid":"ship-owner-change",children:[(0,t.jsx)(tR.f,{"aria-hidden":!0}),"Change owner"]})]})}let tq=(0,R.f)(()=>e.A(611251).then(e=>e.ChangeOwnerDialog),e=>e.isOpen);function tD({ship:e}){let[n,i]=(0,s.useState)(!1),{owner:a,canChange:r,choices:l,change:d}=function(e,t){let n=(0,tz.I)(),i=(0,O.Q)(),a=(0,M.U)(),[r,l]=(0,s.useState)(""),d=e.ownerShipId,o=d===e.id,c=(0,ty.f)(n.console.account.queryOptions()),u=(0,ty.f)(n.fleet.ship.queryOptions(null===d||o?t$.V:{shipId:d})),m=i.canChangeOwner&&"retired"!==e.status&&"person"!==e.kind&&null!==d,p=r.trim(),h=(0,tA.f)(n.fleet.list.infiniteQueryOptions({shipKind:["person"],status:["awaitingCrew","crewed"],limit:tT.q,...""===p?{}:{nameQuery:p}},{enabled:t&&m,getNextPageParam:tT.J})),g=(0,ty.f)(n.fleet.list.queryOptions({shipKind:["operator"],limit:1},{enabled:m})),f=c.data?.kind==="operator",x=g.data?.items[0],b=h.isError?h:g.isError?g:void 0;return{owner:null===d?void 0:o?{kind:"itself"}:{kind:"ship",id:d,name:u.data?.name,isYou:f&&void 0!==u.data&&(0,tC.f)(u.data)&&"operator"===u.data.kind},canChange:m,choices:{personShips:h.data?.pages.flatMap(e=>e.items.map(e=>({id:e.id,name:e.name}))),argo:void 0===x?void 0:{id:x.id,name:x.name,isYou:f},onQueryChange:l,hasMore:h.hasNextPage,isLoadingMore:h.isFetchingNextPage,loadMore:()=>{h.fetchNextPage()},...void 0===b?{}:{readFailure:{message:b.error.message,onRetry:()=>{h.refetch(),g.refetch()}}}},change:a}}(e,n);return void 0===a?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tO,{owner:a,...r?{onChange:()=>{d.reset(),l.onQueryChange(""),i(!0)}}:{}}),"ship"===a.kind&&r?(0,t.jsx)(tq,{shipName:e.name,currentOwner:{id:a.id,name:a.name??a.id},personShips:l.personShips,argo:l.argo,onQueryChange:l.onQueryChange,hasMorePersonShips:l.hasMore,isLoadingMorePersonShips:l.isLoadingMore,onLoadMorePersonShips:l.loadMore,...void 0===l.readFailure?{}:{readFailure:l.readFailure},isOpen:n,onOpenChange:i,isPending:d.isPending,...null===d.error?{}:{error:d.error.message},onSubmit:t=>{let n=t===l.argo?.id?l.argo.name:l.personShips?.find(e=>e.id===t)?.name??t;d.mutate({shipId:e.id,ownerShipId:t},{onSuccess:()=>{i(!1),(0,U.showToast)({title:`Owner changed: ${n} owns ${e.name} now.`,tone:"success"})}})}}):null]})}var tM=e.i(987255),tP=e.i(831458);let tL={name:"lock-keyhole",size:24,node:[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]]};tL.node;let tF=(0,r.f)(tL),tB={name:"log-in",size:24,node:[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]};tB.node;let tE=(0,r.f)(tB);var tU=e.i(367784),tV=e.i(25799);let tW={name:"mail-minus",size:24,node:[["path",{d:"M22 15V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8",key:"fuxbkv"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"M16 19h6",key:"xwg31i"}]]};tW.node;let tH=(0,r.f)(tW),tK={name:"mail-x",size:24,node:[["path",{d:"M22 12.532V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8.792",key:"8lpqwp"}],["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["path",{d:"m16.5 16.5 5 5",key:"zc9lw7"}],["path",{d:"m21.5 16.5-5 5",key:"1empo3"}]]};tK.node;let t_=(0,r.f)(tK),tG={name:"message-square-text",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]};tG.node;let tQ=(0,r.f)(tG),tX={name:"package-x",size:24,node:[["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m16.5 14.5 5 5",key:"ozpm51"}],["path",{d:"m16.5 19.5 5-5",key:"syf6b9"}],["path",{d:"M21 10.5V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l.13-.074",key:"isw6gs"}],["path",{d:"M3.29 7 12 12l8.71-5",key:"19ckod"}],["path",{d:"m7.5 4.27 8.997 5.148",key:"9yrvtv"}]]};tX.node;let tJ=(0,r.f)(tX),tY={name:"pen-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],aliases:["edit-3"]};tY.node;let tZ=(0,r.f)(tY),t0={name:"shield-alert",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]};t0.node;let t1=(0,r.f)(t0);var t2=e.i(837817),t5=e.i(127361);function t6(e,t){let n=e.details[t];return"string"==typeof n?n:void 0}function t3(e){return t6(e,"key")??""}function t8(e){return(t6(e,"values")??"").split(",").join(", ")}function t4(e){return e?[(0,z.n)(" by "),(0,z.X)(e)]:[]}let t7={deregistered:"Its session deregistered.",takenOver:"Taken over by a new console session.",signedOut:"The operator signed out.",passwordReset:"Its session ended with the operator password reset.",accountCutOff:"Its session ended: the account signed in as argo was cut off.",retired:"Its session ended: the ship was retired.",restored:"Its session ended: the fleet was restored from a backup."};function t9(e){return e.message?.isPing===!0}function ne(e){return e.message?[(0,z.n)(t9(e)?"a ping from ":"a message from "),(0,z.X)(e.message.sender)]:[(0,z.n)("a message")]}function nt(e){let[t,...n]=ne(e);return t?.kind==="text"?[(0,z.n)((0,z.z)(t.text)),...n]:ne(e)}function nn(e,t){let{shipId:n,verb:s}=t,i=e.actor;return[...null===i||i.id===n?[(0,z.n)((0,z.z)(s))]:[(0,z.X)(i),(0,z.n)(` ${s}`)],(0,z.n)(" "),...ne(e)]}let ns={received:d,sent:o.f,claimed:tE,released:tU.f,prompt:H.f,commissioned:tP.f,acknowledged:tV.f,returned:t2.f,undeliverable:t_,secret:tF,fleet:tM.f,password:t1,retired:eA.f,abandoned:tJ,dismissed:tH,renamed:tZ,reported:tQ},ni={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"},na="flex w-full gap-3 px-3.5 py-3 text-left";function nr({entry:e,shipId:n,now:s,onOpenMessage:i,accountNames:a={}}){let{parts:r,tone:l,icon:d}=function(e,t){switch(e.type){case"FleetInitialised":return{parts:[(0,z.n)("Fleet initialised")],tone:"ended",icon:"fleet"};case"ShipCommissioned":{let t=t6(e,"type");return{parts:[(0,z.n)("Commissioned"),...t4(e.actor),...void 0===t?[]:[(0,z.n)(` as ${t}`)]],tone:"ended",icon:"commissioned"}}case"OwnerSet":let n;return{parts:"inherited"===(n=t6(e,"how"))?[(0,z.n)("Owner set: its commissioner's owner")]:"named"===n?[(0,z.n)("Owner set: named"),...t4(e.actor)]:[(0,z.n)("Owner set: argo by default")],tone:"ended",icon:"commissioned"};case"OwnerChanged":return{parts:"ownerRetired"===t6(e,"why")?[(0,z.n)("Owner retired: argo owns it now")]:[(0,z.n)("Owner changed"),...t4(e.actor)],tone:"ended",icon:"renamed"};case"StartingPromptIssued":return{parts:[(0,z.n)("Starting prompt issued")],tone:"ended",icon:"prompt"};case"ShipClaimed":return{parts:[(0,z.n)(`Claimed by a session on ${function(e){let t=t6(e,"locationDescription");if(void 0!==t&&""!==t)return t;let n=t6(e,"location");return"DEVICE"===n||"CLOUD"===n||"SERVER"===n||"OTHER"===n?(0,t5.f)(n):"an unknown location"}(e)}`)],tone:"ok",icon:"claimed"};case"LeaseRevoked":let s,i;return{parts:[..."released"===(s=t6(e,"reason")??"")?[(0,z.n)("Released"),...t4(e.actor),(0,z.n)(".")]:[(0,z.n)(t7[s]??"Its session ended.")],..."number"==typeof(i=e.details.returnedDeliveries)&&i>0?[(0,z.n)(` ${(0,z.v)(i,{one:"in-flight delivery",many:"in-flight deliveries"})} went back to pending.`)]:[]],tone:"waiting",icon:"released"};case"CredentialRevoked":return{parts:[(0,z.n)("Secret invalidated")],tone:"ended",icon:"secret"};case"OperatorLoginSet":return{parts:[(0,z.n)("Email and password set")],tone:"waiting",icon:"password"};case"OperatorPasswordReset":return{parts:[(0,z.n)("Operator password reset")],tone:"waiting",icon:"password"};case"FleetLimitsChanged":return{parts:[(0,z.n)("Fleet limits changed")],tone:"ended",icon:"fleet"};case"HistoryPruned":return{parts:[(0,z.n)("Finished history past the retention pruned")],tone:"ended",icon:"fleet"};case"FleetSealingTurnedOn":return{parts:[(0,z.n)("Sealing turned on")],tone:"ended",icon:"fleet"};case"FleetPayloadsSealed":return{parts:[(0,z.n)("Every stored payload sealed")],tone:"ended",icon:"fleet"};case"FleetKeyUnavailable":return{parts:[(0,z.n)("Company key not reachable")],tone:"waiting",icon:"fleet"};case"FleetKeyAvailable":return{parts:[(0,z.n)("Company key reachable again")],tone:"ended",icon:"fleet"};case"FleetDataKeyCreated":return{parts:[(0,z.n)("New data key made")],tone:"ended",icon:"fleet"};case"FleetCompanyKeyChanged":return{parts:[(0,z.n)("Company key changed"),...t4(e.actor)],tone:"ended",icon:"fleet"};case"FleetRecoveryKeyChanged":return{parts:[(0,z.n)("Recovery key changed"),...t4(e.actor)],tone:"ended",icon:"fleet"};case"FleetKeysRecovered":return{parts:[(0,z.n)("Data keys recovered"),...t4(e.actor)],tone:"ended",icon:"fleet"};case"AlertRaised":return{parts:[(0,z.n)(`Alert raised: ${e2(t6(e,"signal")??"")}`),...t4(e.actor)],tone:"attention",icon:"undeliverable"};case"AlertCleared":return"retired"===t6(e,"why")?{parts:[(0,z.n)(`Alert cleared: ${e2(t6(e,"signal")??"")}, the ship retired`)],tone:"ended",icon:"acknowledged"}:{parts:[(0,z.n)(`Alert cleared: ${e2(t6(e,"signal")??"")}`),...t4(e.actor)],tone:"ended",icon:"acknowledged"};case"FeatureFlagTurnedOn":return{parts:[(0,z.n)(`Feature flag ${t6(e,"flag")??""} turned on`)],tone:"ended",icon:"fleet"};case"FeatureFlagTurnedOff":return{parts:[(0,z.n)(`Feature flag ${t6(e,"flag")??""} turned off`)],tone:"ended",icon:"fleet"};case"SignInTicketIssued":return{parts:[(0,z.n)("Sign-in ticket issued")],tone:"ended",icon:"password"};case"ViewerSessionStarted":return{parts:[(0,z.n)("Someone started viewing the fleet")],tone:"ended",icon:"password"};case"CrewRequested":return{parts:[(0,z.n)("Crew requested"),...t4(e.actor)],tone:"waiting",icon:"claimed"};case"CrewRequestRemoved":return{parts:[(0,z.n)("Crew request removed"),...t4(e.actor)],tone:"ended",icon:"released"};case"CrewRequestExplained":{let t=t6(e,"reason");return{parts:[(0,z.n)(void 0===t?"Crew request can not be placed yet":`Crew request can not be placed: ${t}`),...t4(e.actor)],tone:"waiting",icon:"reported"}}case"CrewRequestGivenBack":{let t=t6(e,"reason");return{parts:[(0,z.n)(void 0===t?"Crew request given back":`Crew request given back: ${t}`),...t4(e.actor)],tone:"waiting",icon:"released"}}case"WorktreeClearRequested":return{parts:[(0,z.n)(`Clearing of the kept ${t6(e,"repository")??""} worktree requested`),...t4(e.actor)],tone:"waiting",icon:"reported"};case"WorktreeCleared":return{parts:[(0,z.n)("not-kept"===t6(e,"outcome")?`Kept ${t6(e,"repository")??""} worktree cleared (none was kept)`:`Kept ${t6(e,"repository")??""} worktree cleared`),...t4(e.actor)],tone:"ended",icon:"retired"};case"WorktreeClearRemoved":return{parts:[(0,z.n)(`Clearing of the kept ${t6(e,"repository")??""} worktree dropped`),...t4(e.actor)],tone:"ended",icon:"released"};case"CrewAssigned":return{parts:[(0,z.n)("Crew request assigned"),...t4(e.actor)],tone:"waiting",icon:"claimed"};case"CrewStatusChanged":{let t=t6(e,"status");return{parts:[(0,z.n)(void 0===t?"Crew status changed":`Crew ${t}`),...t4(e.actor)],tone:"crashed"===t?"attention":"active",icon:"reported"}}case"LabelDefined":return{parts:[(0,z.n)(`Label ${t3(e)} defined: ${t8(e)}`)],tone:"ended",icon:"reported"};case"LabelValuesChanged":return{parts:[(0,z.n)(`Label ${t3(e)} values changed: ${t8(e)}`)],tone:"ended",icon:"reported"};case"LabelRetired":return{parts:[(0,z.n)(`Label ${t3(e)} retired`)],tone:"ended",icon:"retired"};case"NetworkRulesSet":{let t=e.details.rules,n=String(e.details.version??""),s="number"==typeof t?`Network rules set: ${String(t)} rules`:"Network rules cleared: every ship reaches every ship";return{parts:[(0,z.n)(`${s}, version ${n}`),...t4(e.actor)],tone:"ended",icon:"fleet"}}case"NetworkRulesDraftSaved":{let t=e.details.rules,n="number"==typeof t?`${String(t)} rules`:"every ship reaches every ship";return{parts:[(0,z.n)(`Network rules draft saved: ${n}, against version ${String(e.details.savedAgainstVersion??"")}`),...t4(e.actor)],tone:"ended",icon:"fleet"}}case"NetworkRulesDraftDiscarded":return{parts:[(0,z.n)("Network rules draft discarded"),...t4(e.actor)],tone:"ended",icon:"fleet"};case"NetworkRulesDeclared":{let t=e.details.rules,n="number"==typeof t&&t>0?`Network rules declared: ${String(t)} rules`:"Declared network rules withdrawn";return{parts:[(0,z.n)(n),...t4(e.actor)],tone:"ended",icon:"fleet"}}case"ScopesDeclared":{let t="number"==typeof e.details.scopes?e.details.scopes:0;return{parts:[(0,z.n)(`Scopes declared: namespace ${t6(e,"namespace")??""}, ${String(t)} ${1===t?"scope":"scopes"}`),...t4(e.actor)],tone:"ended",icon:"fleet"}}case"CommissionApproved":return{parts:[(0,z.n)("Commission rights approved"),...t4(e.actor)],tone:"ended",icon:"commissioned"};case"CommissionApprovalWithdrawn":return{parts:[(0,z.n)("Commission approval withdrawn"),...t4(e.actor)],tone:"ended",icon:"commissioned"};case"ScopesChanged":{let t=t6(e,"added")??"",n=t6(e,"removed")??"",s=[...""===t?[]:[`granted ${t}`],...""===n?[]:[`revoked ${n}`]];return{parts:[(0,z.n)(`Scopes changed: ${s.join(", ")}`),...t4(e.actor)],tone:"ended",icon:"fleet"}}case"ScopeDefined":return{parts:[(0,z.n)(`Scope ${t6(e,"scope")??""} defined`),...t4(e.actor)],tone:"ended",icon:"fleet"};case"ScopeDescribed":return{parts:[(0,z.n)(`Scope ${t6(e,"scope")??""} described`),...t4(e.actor)],tone:"ended",icon:"fleet"};case"ScopeRemoved":return{parts:[(0,z.n)(`Scope ${t6(e,"scope")??""} removed`),...t4(e.actor)],tone:"ended",icon:"fleet"};case"PluginConnected":return{parts:[(0,z.n)("Connected as a plugin: reads every ship"),...t4(e.actor)],tone:"ended",icon:"fleet"};case"PluginDisconnected":return{parts:[(0,z.n)(`No longer a connected plugin: ${t6(e,"why")??""}`),...t4(e.actor)],tone:"ended",icon:"fleet"};case"MeetingOpened":{let t=e.details.participants;return{parts:[(0,z.n)(`Opened a meeting of ${"number"==typeof t?(0,z.v)(t,{one:"ship",many:"ships"}):"ships"}`)],tone:"ok",icon:"sent"}}case"ParticipantAdded":return{parts:[(0,z.n)("Joined a meeting"),...e.actor?[(0,z.n)(", added by "),(0,z.X)(e.actor)]:[]],tone:"ok",icon:"received"};case"MicRequested":return{parts:[(0,z.n)("Requested the mic in a meeting")],tone:"ok",icon:"sent"};case"MicRequestWithdrawn":return{parts:[(0,z.n)("Withdrew its mic request in a meeting")],tone:"ok",icon:"sent"};case"MicGiven":return{parts:"fifo"===e.details.pattern?[(0,z.n)("Got the mic in a meeting, first in line")]:[(0,z.n)("Got the mic in a meeting"),...e.actor?[(0,z.n)(", given by "),(0,z.X)(e.actor)]:[]],tone:"ok",icon:"received"};case"MicReleased":return{parts:[(0,z.n)("Released the mic in a meeting")],tone:"ok",icon:"sent"};case"MicTaken":return{parts:[(0,z.n)("Lost the mic in a meeting"),...e.actor?[(0,z.n)(", taken by "),(0,z.X)(e.actor)]:[]],tone:"ok",icon:"received"};case"MicPatternSet":return{parts:[(0,z.n)("fifo"===e.details.pattern?"Set a meeting's mic to first in line":"Set a meeting's mic to the moderator's pick")],tone:"ok",icon:"sent"};case"ParticipantLeft":return{parts:[(0,z.n)("Left a meeting")],tone:"ok",icon:"sent"};case"ParticipantRejoined":return{parts:[(0,z.n)("Rejoined a meeting")],tone:"ok",icon:"sent"};case"ParticipantRevoked":return{parts:[(0,z.n)("Taken off a meeting"),...e.actor?[(0,z.n)(", by "),(0,z.X)(e.actor)]:[]],tone:"ok",icon:"received"};case"OwnershipTransferred":return{parts:[(0,z.n)("Got the ownership of a meeting"),...e.actor?[(0,z.n)(", from "),(0,z.X)(e.actor)]:[]],tone:"ok",icon:"received"};case"ModeratorNamed":return{parts:[(0,z.n)("Became the moderator of a meeting"),...e.actor?[(0,z.n)(", named by "),(0,z.X)(e.actor)]:[]],tone:"ok",icon:"received"};case"MeetingEnded":return{parts:[(0,z.n)("Ended a meeting")],tone:"ok",icon:"sent"};case"ScheduleCreated":return{parts:[(0,z.n)("Scheduled a message")],tone:"ok",icon:"sent"};case"ScheduleCancelled":let a;return{parts:"retired"===(a=t6(e,"reason"))?[(0,z.n)("A scheduled message was cancelled as the ship retired")]:"manager"===a?[(0,z.n)("A scheduled message was cancelled"),...t4(e.actor)]:[(0,z.n)("Cancelled a scheduled message")],tone:"ended",icon:"released"};case"ScheduledSendRefused":return{parts:[(0,z.n)(`A scheduled send was refused: ${t6(e,"code")??"refused"}`)],tone:"waiting",icon:"undeliverable"};case"ScheduledSendMissed":return{parts:[(0,z.n)("A scheduled send time was missed")],tone:"waiting",icon:"undeliverable"};case"SchedulePaused":let r;return{parts:"ship"===(r=t6(e,"reason"))?[(0,z.n)("Paused a scheduled message")]:"manager"===r?[(0,z.n)("A scheduled message was paused"),...t4(e.actor)]:[(0,z.n)("A scheduled message paused after a refused send")],tone:"waiting",icon:"reported"};case"ScheduleResumed":return{parts:[(0,z.n)("Resumed a scheduled message")],tone:"ok",icon:"sent"};case"ScheduleEnded":return{parts:[(0,z.n)("A scheduled message ended")],tone:"ended",icon:"sent"};case"VerifiedFactsRemoved":return{parts:[(0,z.n)(`Verified facts removed: ${String(e.details.facts??"")}, ${"writerRetired"===t6(e,"why")?"their writer retired":"the ship retired"}`)],tone:"ended",icon:"reported"};case"ExpectationsSet":return{parts:[(0,z.n)(null===e.details.reportChangesWithin&&null===e.details.taskDoneBy?"Expectations cleared":"Expectations set"),...t4(e.actor)],tone:"ended",icon:"reported"};case"VerifiedFactsSet":{let t=e.details.facts;return{parts:[(0,z.n)(0===t?"Verified facts withdrawn":`Verified facts set: ${String(t??"")}`),...t4(e.actor)],tone:"ended",icon:"reported"}}case"NetworkPluginRegistered":return{parts:[(0,z.n)(`Networking plugin registered: while unavailable ${t6(e,"whileUnavailable")??""}, version ${String(e.details.version??"")}`),...t4(e.actor)],tone:"ended",icon:"fleet"};case"NetworkPluginUnregistered":return{parts:[(0,z.n)(`Networking plugin unregistered: every ship reaches every ship, version ${String(e.details.version??"")}`),...t4(e.actor)],tone:"ended",icon:"fleet"};case"BuiltInRuleChanged":{let t=t6(e,"verb"),n="viewerRead"===e.details.rule?"viewer read":`${t6(e,"rule")??""}${void 0===t?"":` for ${t}`}`,s=!0===e.details.isOn?"on":"off";return{parts:[(0,z.n)(`Built-in rule ${n} turned ${s}, version ${String(e.details.version??"")}`),...t4(e.actor)],tone:"ended",icon:"fleet"}}case"LabelDeleted":return{parts:[(0,z.n)(`Label ${t3(e)} deleted`)],tone:"ended",icon:"retired"};case"LabelAssigned":return{parts:[(0,z.n)(`Labelled ${t3(e)}=${t6(e,"value")??""}`),...t4(e.actor)],tone:"ended",icon:"reported"};case"LabelUnassigned":return{parts:[(0,z.n)(`Label ${t3(e)}=${t6(e,"value")??""} removed`),...t4(e.actor)],tone:"ended",icon:"reported"};case"MessageAccepted":let l;return{parts:(l=e.message)?t9(e)&&"ship"===l.recipient.kind?l.sender.id===t?[(0,z.n)("Pinged "),(0,z.X)(l.recipient.ship)]:[(0,z.n)("Pinged by "),(0,z.X)(l.sender)]:l.sender.id===t?"ship"===l.recipient.kind?[(0,z.n)("Sent a message to "),(0,z.X)(l.recipient.ship)]:[(0,z.n)(`Sent a message to ${(0,I.R)(l.recipient)}`)]:[(0,z.n)("Received a message from "),(0,z.X)(l.sender)]:[(0,z.n)("A message was sent")],tone:"ended",icon:e.message?.sender.id===t?"sent":"received"};case"LeasePushed":return{parts:[(0,z.n)("Pushed: its trierarch or plugin watcher receives for its session")],tone:"ok",icon:"received"};case"DeliveryReceived":return{parts:nn(e,{shipId:t,verb:!0===e.details.again?"received again":"received"}),tone:"active",icon:"received"};case"DeliveryHanded":return{parts:nn(e,{shipId:t,verb:!0===e.details.onceMore?"took once more":"took"}),tone:"active",icon:"received"};case"DeliveryHandled":return{parts:nn(e,{shipId:t,verb:"handled"}),tone:"ok",icon:"acknowledged"};case"DeliveryNotHandled":return{parts:[...nt(e),(0,z.n)(" was not handled: its turn died twice")],tone:"attention",icon:"undeliverable"};case"DeliveryOverdue":let d,o,c;return{parts:[...nt(e),(0,z.n)(` is overdue: ${(o="number"==typeof(d=e.details.minutes)?`${String(d)} min`:"too long","notConfirmed"===(c=t6(e,"clock"))?`handed, not confirmed for ${o}`:`waiting ${o} while its session is ${"busy"===c?"busy":"idle"}`)}, argo told`)],tone:"attention",icon:"undeliverable"};case"DeliveryAcknowledged":return{parts:"pong"===t6(e,"answer")?[...nn(e,{shipId:t,verb:"answered"}),(0,z.n)(" with pong")]:nn(e,{shipId:t,verb:"acknowledged"}),tone:"ok",icon:"acknowledged"};case"DeliveryReturned":return{parts:[...nt(e),(0,z.n)(" went back to pending")],tone:"waiting",icon:"returned"};case"DeliveryUndeliverable":return{parts:[...nt(e),(0,z.n)(" became undeliverable")],tone:"attention",icon:"undeliverable"};case"ShipRetired":{let t=e.details.abandonedDeliveries;return{parts:[(0,z.n)("Retired"),...t4(e.actor),(0,z.n)("."),..."number"==typeof t&&t>0?[(0,z.n)(` ${(0,z.v)(t,{one:"delivery",many:"deliveries"})} abandoned.`)]:[]],tone:"ended",icon:"retired"}}case"DeliveryAbandoned":return{parts:[...nt(e),(0,z.n)(" was abandoned")],tone:"ended",icon:"abandoned"};case"ShipReported":{let t=t6(e,"state")??"in",n=t6(e,"note");return{parts:[(0,z.n)(void 0===n?`Reported ${t}`:`Reported ${t}: ${n}`)],tone:Object.hasOwn(e_.m,t)?e_.m[t]:"ended",icon:"reported"}}case"StatementSet":return{parts:[(0,z.n)(`Stated what it is and offers: ${String(e.details.capabilities??"")} capabilities, version ${String(e.details.version??"")}`)],tone:"ended",icon:"reported"};case"TurnReported":{let t=t6(e,"turn");return{parts:[(0,z.n)("busy"===t?"Turn started: busy":"Turn ended: idle")],tone:"busy"===t?"active":"ended",icon:"reported"}}case"ShipRenamed":{let t=t6(e,"from"),n=t6(e,"to");return{parts:[(0,z.n)(void 0===t||void 0===n?"Renamed":`Renamed from ${t} to ${n}`),...t4(e.actor)],tone:"ended",icon:"renamed"}}case"DeliveryDismissed":return{parts:[...nt(e),(0,z.n)(" was dismissed"),...t4(e.actor)],tone:"ended",icon:"dismissed"}}}(e,n),o=ns[d],c=new Date(e.occurredAt),u=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":!0,className:(0,h.f)("flex size-7 shrink-0 items-center justify-center rounded-md border [&_svg]:size-(--size-icon-sm)",ni[l]),children:(0,t.jsx)(o,{})}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-col gap-1",children:[(0,t.jsx)(N.f,{parts:r,className:"text-body text-foreground max-sm:text-body-touch"}),(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:[(0,t.jsx)("time",{dateTime:e.occurredAt,title:(0,w.o)(c),className:"tabular-nums",children:(0,w.W)(c,s)}),null===e.signedInAccountId?null:(0,t.jsxs)("span",{"data-testid":"ship-timeline-account",children:[" · by ",a[e.signedInAccountId]??e.signedInAccountId]})]})]})]}),{message:m}=e;return(0,t.jsx)("li",{"data-testid":"ship-timeline-entry","data-type":e.type,className:"border-b border-border last:border-b-0",children:m?(0,t.jsx)("button",{type:"button",className:(0,h.f)(na,"transition-colors duration-(--duration-fast) hover:bg-accent"),onClick:()=>{i(m.id)},children:u}):(0,t.jsx)("div",{className:na,children:u})})}function nl({shipId:e,entries:n,state:s,onRetry:i,more:a,now:r,onOpenMessage:l,accountNames:d}){return"loading"===s?(0,t.jsx)(m.f,{variant:"list",rows:4,label:"Loading the timeline"}):"error"===s?(0,t.jsxs)("div",{"data-testid":"ship-timeline",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-3",children:[(0,t.jsx)(f.f,{title:"Couldn’t load the timeline",description:"The rest of the page is current. Try again in a moment."}),i?(0,t.jsx)(p.f,{size:"sm",icon:(0,t.jsx)(u.f,{"aria-hidden":!0}),onClick:i,className:"self-start",children:"Try again"}):null]}):(0,t.jsxs)("div",{"data-testid":"ship-timeline",className:"overflow-hidden rounded-lg border border-border bg-card",children:[(0,t.jsx)("ol",{"aria-label":"Timeline",children:n.map(n=>(0,t.jsx)(nr,{entry:n,shipId:e,now:r,onOpenMessage:l,accountNames:d},n.id))}),a,n.length<=1&&!a?(0,t.jsx)("p",{className:"border-t border-border px-3.5 py-3 text-center text-meta text-muted-foreground first:border-t-0",children:"Nothing else yet. Claims, releases and messages appear here as they happen."}):null]})}var nd=e.i(632066),no=e.i(298421),nc=e.i(668269),nu=e.i(749092),nm=e.i(976580),np=e.i(994070),nh=e.i(837631),ng=e.i(787964),nf=e.i(46929),nx=e.i(718423),nb=e.i(296676),nv=e.i(743006),nj=e.i(609176),ny=e.i(750980),nw=e.i(278888),nz=e.i(678485),nk=e.i(853573),nN=e.i(285595),nS=e.i(928459),nI=e.i(414732);function nC({party:e}){let n=e.name===z.D;return(0,t.jsx)(e6.f,{name:e.name,shipId:e.id,size:"meta",isOperator:n,isSuffixShown:!n})}function n$({delivery:e}){let{sender:n,recipient:s}=e.message;return(0,t.jsxs)("span",{className:"flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-meta text-muted-foreground",children:[(0,t.jsx)(nC,{party:n}),(0,t.jsx)("span",{"aria-hidden":!0,children:"→"}),(0,t.jsx)("span",{className:"sr-only",children:"to"}),"ship"===s.kind?(0,t.jsx)(nC,{party:s.ship}):(0,t.jsx)("span",{children:(0,I.R)(s)})]})}function nA({delivery:e}){let{payload:n,contentType:s}=e.message;return(0,t.jsx)("span",{className:(0,h.f)("block min-w-0 truncate text-foreground",(0,b.N)(s)?"font-mono text-id":"text-body max-sm:text-body-touch"),title:n,children:n.split("\n")[0]})}function nT(e){var t;return`the message from ${e.message.sender.name} to ${"ship"===(t=e.message.recipient).kind?t.ship.name:(0,I.R)(t)}`}function nR({delivery:e,onResend:n,onDismiss:s,pendingIds:i,layout:a}){let r=i.has(e.deliveryId),l="phone"===a;if(void 0===n&&void 0===s)return null;let d=void 0!==n&&(0,nS.c)(e)?(0,t.jsx)(p.f,{size:l?"touch":"sm",variant:l?"primary":"secondary",icon:(0,t.jsx)(u.f,{"aria-hidden":!0}),isLoading:r,"data-testid":"attention-resend","aria-label":`Resend ${nT(e)}`,onClick:()=>{n(e.deliveryId)},className:l?"flex-1":void 0,children:"Resend"}):null,o=void 0===s?null:(0,t.jsx)(p.f,{size:l?"touch":"sm",variant:l?"secondary":"ghost",disabled:r,"data-testid":"attention-dismiss","aria-label":`Dismiss ${nT(e)}`,onClick:()=>{s(e.deliveryId)},className:l?"flex-1":void 0,children:"Dismiss"});return l?(0,t.jsxs)("div",{className:"flex gap-2 pt-1",children:[o,d]}):(0,t.jsxs)("div",{className:"flex items-center justify-end gap-1.5",children:[d,o]})}function nO({deliveries:e,onOpen:n,now:s,...i}){return(0,t.jsxs)("div",{className:"flex flex-col gap-2 max-sm:hidden",children:[(0,t.jsxs)(nI.s,{"aria-label":"Undeliverable and not handled deliveries",children:[(0,t.jsx)(nI.E,{children:(0,t.jsxs)(nI.N,{children:[(0,t.jsx)(nI.U,{children:"State"}),(0,t.jsx)(nI.U,{children:"Message"}),(0,t.jsx)(nI.U,{children:"Reason"}),(0,t.jsx)(nI.U,{children:"Since"}),(0,t.jsx)(nI.U,{children:"Actions"})]})}),(0,t.jsx)(nI.z,{children:e.map(e=>{let a=new Date(e.since);return(0,t.jsxs)(nI.N,{"data-testid":"attention-row","data-delivery-id":e.deliveryId,children:[(0,t.jsx)(nI.d,{className:"align-top",children:(0,t.jsx)(x.T,{status:e.state})}),(0,t.jsx)(nI.d,{className:"max-w-96 align-top",children:(0,t.jsxs)("button",{type:"button","aria-label":`Open ${nT(e)}`,onClick:()=>{n(e)},className:"flex w-full min-w-0 flex-col gap-0.5 rounded-xs text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",children:[(0,t.jsx)(nA,{delivery:e}),(0,t.jsx)(n$,{delivery:e})]})}),(0,t.jsx)(nI.d,{className:"max-w-48 align-top text-meta whitespace-normal text-muted-foreground",children:(0,nS.g)(e)}),(0,t.jsx)(nI.d,{className:"align-top",children:(0,t.jsxs)("span",{className:"flex flex-col gap-0.5 tabular-nums",children:[(0,t.jsx)("time",{dateTime:e.since,title:(0,w.o)(a),className:"text-body text-foreground",children:(0,w.B)(a)}),(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:[(0,w.m)(a,s)," ago"]})]})}),(0,t.jsx)(nI.d,{className:"align-top",children:(0,t.jsx)(nR,{delivery:e,layout:"table",...i})})]},e.deliveryId)})})]}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Resend creates a new message with the same payload, linked to the original. Dismiss marks the delivery resolved. Abandoned deliveries are not listed here."})]})}function nq({deliveries:e,onOpen:n,now:s,...i}){return(0,t.jsx)("ul",{"aria-label":"Undeliverable and not handled deliveries",className:"flex flex-col gap-3 sm:hidden",children:e.map(e=>{let a=new Date(e.since),r=s.getTime()-a.getTime()<864e5?(0,w.w)(a):(0,w.B)(a);return(0,t.jsxs)("li",{"data-testid":"attention-row","data-delivery-id":e.deliveryId,className:"flex flex-col gap-1.5 rounded-lg border border-border bg-card px-3.5 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)(x.T,{status:e.state}),(0,t.jsxs)("button",{type:"button","aria-label":`Open ${nT(e)}`,onClick:()=>{n(e)},className:"inline-flex items-center gap-1 rounded-xs text-meta text-muted-foreground tabular-nums focus-visible:outline-2 focus-visible:outline-ring [&_svg]:size-(--size-icon-sm)",children:[(0,w.m)(a,s),(0,t.jsx)(eK.f,{"aria-hidden":!0})]})]}),(0,t.jsx)(nA,{delivery:e}),(0,t.jsx)(n$,{delivery:e}),(0,t.jsxs)("p",{className:"text-meta text-muted-foreground",children:[(0,nS.g)(e)," Since"," ",(0,t.jsx)("time",{dateTime:e.since,title:(0,w.o)(a),className:"tabular-nums",children:r}),"."]}),(0,t.jsx)(nR,{delivery:e,layout:"phone",...i})]},e.deliveryId)})})}function nD({deliveries:e,state:n,onRetry:s,...i}){return"loading"===n?(0,t.jsxs)("div",{"data-slot":"needs-attention-list","data-state":"loading",children:[(0,t.jsx)(m.f,{variant:"table",rows:2,label:"Loading Needs attention",className:"max-sm:hidden"}),(0,t.jsx)(m.f,{variant:"list",rows:2,label:"Loading Needs attention",className:"sm:hidden"})]}):"error"===n?(0,t.jsx)("div",{"data-slot":"needs-attention-list","data-state":"error","data-testid":"attention-error",children:(0,t.jsx)(f.f,{variant:"page",title:"Couldn’t load Needs attention",description:"This page couldn’t reach the fleet server. Undeliverable deliveries are kept on the server, so nothing is lost.",onRetry:s})}):0===e.length?(0,t.jsx)("div",{"data-slot":"needs-attention-list","data-state":"empty","data-testid":"attention-empty",children:(0,t.jsx)(g.f,{icon:(0,t.jsx)(nN.f,{className:"text-tone-ok-fg"}),title:"Nothing needs your attention",description:"Undeliverable deliveries show up here as soon as they happen."})}):(0,t.jsxs)("div",{"data-slot":"needs-attention-list","data-state":"ready",className:"flex flex-col gap-3",children:[(0,t.jsx)(nO,{deliveries:e,...i}),(0,t.jsx)(nq,{deliveries:e,...i})]})}function nM({shipId:e}){let i=(0,n.useRouter)(),a=(0,nb.f)(),r=(0,nS.t)({shipId:e,state:"notHandled"}),l=(0,nS.F)(),d=(0,nS.d)(),o=(0,O.Q)(),[c,u]=(0,s.useState)(new Set),m=r.items??[],p=(e,t)=>{u(t=>new Set([...t,e])),t().finally(()=>{u(t=>new Set([...t].filter(t=>t!==e)))})};return 0===m.length?null:(0,t.jsxs)("section",{"aria-labelledby":"ship-not-handled","data-testid":"ship-not-handled",className:"flex flex-col gap-2",children:[(0,t.jsxs)("h2",{id:"ship-not-handled",className:"text-body font-semibold",children:["Not handled (",m.length,")"]}),(0,t.jsx)(nD,{deliveries:m,state:"ready",onRetry:r.retry,onResend:o.canResend?e=>{let t=(0,nS.w)(m,e);p(e,async()=>{try{await l.mutateAsync({deliveryId:e}),t&&(0,U.showToast)({...(0,nS.a)(t),tone:"success"})}catch(e){(0,U.showToast)({title:"Couldn’t resend the message",description:nP(e),tone:"error"})}})}:void 0,onDismiss:o.canResend?e=>{p(e,async()=>{try{await d.mutateAsync({deliveryId:e}),(0,U.showToast)({...nS.Y,tone:"success"})}catch(e){(0,U.showToast)({title:"Couldn’t dismiss the delivery",description:nP(e),tone:"error"})}})}:void 0,onOpen:t=>{i.replace(`/ships/${e}?tab=messages&message=${t.message.id}`,{scroll:!1})},pendingIds:c,now:a}),r.hasMore?(0,t.jsx)(no.f,{what:"more not handled",isLoading:r.isLoadingMore,isFailed:r.isLoadMoreFailed,onLoad:r.loadMore,area:"ship-not-handled"}):null]})}function nP(e){return e instanceof Error?e.message:"Try again in a moment."}let nL="timeline",nF="messages",nB="schedules";var nE=e.i(214126),nU=e.i(282492),nV=e.i(54105),nW=e.i(978056),nH=e.i(477562),nK=e.i(980815),n_=e.i(868217),nG=e.i(411382),nQ=e.i(213056),nX=e.i(488826),nJ=e.i(942203),nY=e.i(383615);let nZ=/^P(?:(\d+)W|(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:\.\d+)?)S)?)?)$/;function n0(e){let t=nZ.exec(e);if(!t||e.endsWith("T"))return;let[,n,s,i,a,r]=t,l=6048e5*Number(n??0)+864e5*Number(s??0)+36e5*Number(i??0)+6e4*Number(a??0)+Math.round(1e3*Number(r??0));return l>0?l:void 0}let n1=nV.z.string().min(1).max(256);var n2=e.i(691113),n5=e.i(722219),n5=n5,n6=e.i(513907),n3=e.i(500901),n8=e.i(606811),n4=e.i(240192),n7=e.i(619877);let n9=nU.z.enum(["working","blocked","idle"]),se=`A note is one line of at most ${String(200)} characters`;new TextEncoder;let st=n4.z.record(nV.z.string(),n7.z.json()),sn=nG.z.object({kind:nV.z.string()}).catchall(n7.z.json()),ss=nG.z.object({at:nW.z.number(),of:nW.z.number()});nG.z.object({state:n9,note:nV.z.string().trim().max(200,se).refine(function(e){return!/[\r\n]/.test(e)},se).optional(),details:st.nullable().optional(),detailsPatch:st.nullable().optional(),task:sn.nullable().optional(),step:ss.nullable().optional()}).refine(e=>void 0===e.details||void 0===e.detailsPatch,{message:"Give details or detailsPatch, not both",path:["detailsPatch"]}),nK.z.strictObject({});let si=nG.z.object({state:n9,note:nV.z.string().nullable(),task:sn.nullable(),taskView:nG.z.object({canOpen:nQ.z.boolean(),fleetName:nV.z.string().nullable()}).optional(),step:ss.nullable(),reportedAt:nE.z.iso.datetime(),reportChangedAt:nE.z.iso.datetime(),detailsVersion:n2.z.int().min(0)}),sa=si.extend({details:st.nullable()});nG.z.object({report:sa.nullable(),previousCrew:sa.nullable()});let sr=nU.z.enum(["crew-request-unassigned","delivery-unacknowledged","delivery-overdue","ping-unanswered","report-unchanged","task-not-done"]),sl=nE.z.iso.datetime({offset:!0}),sd=n2.z.int().min(1),so=nK.z.strictObject({settingsVersion:n2.z.int().min(1),minutes:sd,reason:nV.z.string().nullable()}),sc=nK.z.strictObject({deliveryId:(0,nY.f)("delivery"),messageId:(0,nY.f)("message"),state:nU.z.enum(["pending","received","handed"]),awaitingCrew:nQ.z.boolean(),minutes:sd}),su=nK.z.strictObject({deliveryId:(0,nY.f)("delivery"),messageId:(0,nY.f)("message"),overdueEventId:(0,nY.f)("event")}),sm=nK.z.strictObject({deliveryId:(0,nY.f)("delivery"),messageId:(0,nY.f)("message"),minutes:sd}),sp=nK.z.strictObject({reportChangedAt:sl,state:nU.z.enum(["working","blocked"]),minutes:sd,setBy:(0,nY.f)("ship")}),sh=nK.z.strictObject({task:sn,doneBy:sl,setBy:(0,nY.f)("ship")}),sg=[nG.z.object({signal:n_.z.literal("crew-request-unassigned"),facts:so}),nG.z.object({signal:n_.z.literal("delivery-unacknowledged"),facts:sc}),nG.z.object({signal:n_.z.literal("delivery-overdue"),facts:su}),nG.z.object({signal:n_.z.literal("ping-unanswered"),facts:sm}),nG.z.object({signal:n_.z.literal("report-unchanged"),facts:sp}),nG.z.object({signal:n_.z.literal("task-not-done"),facts:sh})],sf=nH.z.discriminatedUnion("signal",sg);n5.intersection(nG.z.object({alertId:(0,nY.f)("alert"),headline:nV.z.string().min(1).max(80),body:nV.z.string().refine(e=>2048>=(0,n3.y)(e),`A body is at most ${String(2048)} bytes`),ship:nG.z.object({id:(0,nY.f)("ship"),name:nV.z.string()}),fleetId:(0,nY.f)("fleet"),toldAs:nU.z.enum(["owner","setter"]),since:sl,raisedAt:sl}),sf).refine(e=>8192>=(0,n3.y)(JSON.stringify(e)),`An alert message is at most ${String(8192)} bytes`),nG.z.object({shipId:(0,nY.f)("ship"),signal:sr,facts:nX.z.union([so,sc,su,sm,sp,sh]),occurrenceKey:nV.z.string().min(1).max(200),since:sl}).transform(({shipId:e,signal:t,facts:n,occurrenceKey:s,since:i},a)=>{let r=sf.safeParse({signal:t,facts:n});return r.success?{shipId:e,occurrenceKey:s,since:i,...r.data}:(a.addIssue({code:"custom",message:"The facts are not the signal's",path:["facts"]}),n6.z.NEVER)}),nG.z.object({alertId:(0,nY.f)("alert")});let sx=nU.z.enum(["cleared","retired"]),sb=n5.intersection(nG.z.object({id:(0,nY.f)("alert"),ship:nG.z.object({id:(0,nY.f)("ship"),name:nV.z.string()}),occurrenceKey:nV.z.string(),ownerShipId:(0,nY.f)("ship").nullable(),since:nE.z.iso.datetime(),raisedAt:nE.z.iso.datetime(),cleared:nG.z.object({at:nE.z.iso.datetime(),why:sx}).nullable()}),sf);(0,n8.G)((0,nY.f)("alert")).optional(),(0,n8._)(sb,(0,nY.f)("alert"));var sv=e.i(347664);let sj=n2.z.int().min(5).max(10080);nG.z.object({shipId:(0,nY.f)("ship"),reportChangesWithin:sj.nullable().optional(),taskDoneBy:nG.z.object({task:sn,doneBy:nE.z.iso.datetime({offset:!0})}).nullable().optional()}),nK.z.strictObject({});let sy=nH.z.discriminatedUnion("kind",[nG.z.object({kind:n_.z.literal("ship"),shipId:(0,nY.f)("ship")}),nG.z.object({kind:n_.z.literal("account"),accountId:sv.f}),nG.z.object({kind:n_.z.literal("installation")})]),sw=nG.z.object({reportChangesWithin:nG.z.object({minutes:n2.z.int(),setBy:sy,setAt:nE.z.iso.datetime()}).nullable(),taskDoneBy:nG.z.object({task:sn,doneBy:nE.z.iso.datetime(),setBy:sy,setAt:nE.z.iso.datetime()}).nullable()});var sz=n5,sk=e.i(173332),sN=e.i(851756);let sS=nG.z.object({approvalId:(0,nY.f)("commissionApproval"),subjectDigest:nV.z.string().min(1)});nG.z.object({commissionerId:(0,nY.f)("ship"),scopes:nJ.z.array(sk.q),subjectDigest:nV.z.string().min(1)}),nG.z.object({approvalId:(0,nY.f)("commissionApproval")}),nG.z.object({approvalId:(0,nY.f)("commissionApproval")}),nK.z.strictObject({});let sI=nH.z.discriminatedUnion("kind",[nG.z.object({kind:n_.z.literal("ship"),shipId:(0,nY.f)("ship"),signedInAccountId:sv.f.optional()}),nG.z.object({kind:n_.z.literal("account"),accountId:sv.f,throughShipId:(0,nY.f)("ship").nullable()}),nG.z.object({kind:n_.z.literal("installation")}),nG.z.object({kind:n_.z.literal("system")})]);nG.z.object({id:(0,nY.f)("commissionApproval"),fleetId:(0,nY.f)("fleet"),approver:sI,commissionerId:(0,nY.f)("ship"),scopes:nJ.z.array(sk.q),subjectDigest:nV.z.string().min(1),createdAt:sN.z.date(),withdrawnAt:sN.z.date().nullable()});var sC=e.i(367795),s$=e.i(985939),sA=e.i(998648);let sT=nU.z.enum(["text","tool","result","error"]);nG.z.object({intervalSeconds:n2.z.int().min(1).max(86400),activities:nJ.z.array(nG.z.object({shipId:(0,nY.f)("ship"),at:nE.z.iso.datetime(),kind:sT,tool:nV.z.string().trim().min(1).max(100).optional()})).min(1).max(100)}),nG.z.object({refused:nJ.z.array(nG.z.object({shipId:(0,nY.f)("ship"),code:nV.z.string(),message:nV.z.string()}))});let sR=nG.z.object({at:nE.z.iso.datetime(),kind:sT,tool:nV.z.string().nullable(),reportedAt:nE.z.iso.datetime(),intervalSeconds:n2.z.int().min(1)}),sO=nV.z.string().max(sC.Z,sC.o).regex(sC.V,sC.o);nG.z.object({name:sO,type:sO,kind:sk.$.optional(),scopes:nJ.z.array(sk.q).optional(),valueIds:nJ.z.array((0,nY.f)("labelValue")).max(sA.b).optional(),ownerOf:(0,nY.f)("ship").optional(),approval:sS.optional(),owner:(0,nY.f)("ship").optional(),note:nV.z.string().trim().max(500,"A note is at most 500 characters").optional(),idempotencyKey:n1}),nG.z.object({shipId:(0,nY.f)("ship")});let sq=nG.z.object({harness:nV.z.string(),line:nV.z.string()});nG.z.object({shipId:(0,nY.f)("ship"),prompt:nV.z.string(),crewLines:nJ.z.array(sq),secret:nV.z.string()}),nG.z.object({shipId:(0,nY.f)("ship"),prompt:nV.z.string().nullable(),crewLines:nJ.z.array(sq).nullable(),secret:nV.z.string().nullable(),startingPrompt:nG.z.object({issuedAt:nE.z.iso.datetime(),isClaimed:nQ.z.boolean()}).nullable()}),nG.z.object({owner:nG.z.object({id:(0,nY.f)("ship"),name:nV.z.string()}).nullable()}),nG.z.object({shipId:(0,nY.f)("ship")}),nK.z.strictObject({}),nG.z.object({shipId:(0,nY.f)("ship"),name:sO}),nK.z.strictObject({}),nG.z.object({shipId:(0,nY.f)("ship"),ownerShipId:(0,nY.f)("ship")}),nK.z.strictObject({}),nG.z.object({shipId:(0,nY.f)("ship")}),nK.z.strictObject({}),nG.z.object({shipId:(0,nY.f)("ship")}),nG.z.object({abandonedDeliveries:n2.z.int().min(0)}),nG.z.object({shipId:(0,nY.f)("ship")});let sD=nU.z.enum(["waiting","answered","acknowledged","undeliverable"]),sM=nG.z.object({id:(0,nY.f)("ship"),name:nV.z.string(),type:nV.z.string(),kind:sk.v,status:sk.e,startingPrompt:nG.z.object({issuedAt:nE.z.iso.datetime(),isClaimed:nQ.z.boolean()}).nullable(),location:nG.z.object({kind:sk.p,description:nV.z.string().nullable()}).nullable(),lastSeenAt:nE.z.iso.datetime().nullable(),ping:nG.z.object({state:sD,sentAt:nE.z.iso.datetime(),answeredAt:nE.z.iso.datetime().nullable()}).nullable(),harness:nV.z.string().nullable(),model:nG.z.object({id:nV.z.string(),statedAt:nE.z.iso.datetime()}).nullable(),scopes:nJ.z.array(sk.q),report:si.nullable(),activity:sR.nullable(),crewRequest:s$.i.nullable(),labels:nJ.z.array(sA.B),awaitingCrewSince:nE.z.iso.datetime().nullable(),retiredAt:nE.z.iso.datetime().nullable(),ownerShipId:(0,nY.f)("ship").nullable(),openAlertCount:n2.z.int().min(0)}),sP=nG.z.object({id:(0,nY.f)("ship"),name:nV.z.string(),type:nV.z.string(),status:sk.e,isInReadReach:n_.z.literal(!1)});(0,n8._)(nX.z.union([sM,sP]),nV.z.string()),nX.z.union([sM,sP]),nJ.z.array(nG.z.object({kind:sk.v,active:n2.z.int().min(0),crewed:n2.z.int().min(0),awaitingCrew:n2.z.int().min(0),retired:n2.z.int().min(0),needsCrew:nG.z.object({withTrierarchs:n2.z.int().min(0),withoutTrierarchs:n2.z.int().min(0)}),longestWait:nG.z.object({id:(0,nY.f)("ship"),name:nV.z.string(),awaitingCrewSince:nE.z.iso.datetime()}).nullable()})),nG.z.object({lastEventId:nV.z.string().regex(/^\d{1,15}$/,"A position is the number of an event").nullish()});let sL=nG.z.object({seq:nW.z.number().int().positive(),id:(0,nY.f)("event"),type:sk.Q,occurredAt:nE.z.iso.datetime(),actorKind:nU.z.enum(["ship","account","installation","system"]),actorShipId:(0,nY.f)("ship").nullable(),actorAccountId:sv.f.nullable(),actorSignedInAccountId:sv.f.nullable(),shipId:(0,nY.f)("ship").nullable(),messageId:(0,nY.f)("message").nullable(),deliveryId:(0,nY.f)("delivery").nullable()});nH.z.discriminatedUnion("kind",[nG.z.object({kind:n_.z.literal("event"),event:sL}),nG.z.object({kind:n_.z.literal("resync")})]),nG.z.object({ships:nG.z.object({limit:n2.z.int().min(0).nullable(),count:n2.z.int().min(0)}),dailyMessages:nG.z.object({limit:n2.z.int().min(0).nullable(),count:n2.z.int().min(0),resetsAt:nE.z.iso.datetime()}),retention:nG.z.object({days:n2.z.int().min(1).nullable(),keptFrom:nE.z.iso.datetime().nullable()})});let sF="[!#$%&'*+\\-.^_`|~0-9A-Za-z]+",sB="[ \\t]*",sE=RegExp(`^${sF}/${sF}(?:${sB};${sB}(?:${sF}=(?:${sF}|"(?:[\\t \\x21\\x23-\\x5B\\x5D-\\x7E\\x80-\\xFF]|\\\\[\\t \\x21-\\x7E\\x80-\\xFF])*"))?)*$`),sU="A content type is a media type such as text/plain or application/json; charset=utf-8, of at most 256 characters",sV=nV.z.string().max(256,sU).refine(function(e){return sE.test(e)},sU),sW=nV.z.string().trim().min(1,"A model is the exact model id the session runs, such as claude-opus-5-5").max(100,`A model is at most ${String(100)} characters`).regex(/^\S+$/,"A model id has no spaces"),sH=nK.z.strictObject({kind:n_.z.literal("label"),valueIds:nJ.z.array((0,nY.f)("labelValue")).min(1,"A label selection names at least one value id").max(sA.b,`A label selection names at most ${String(sA.b)} value ids, as many as a ship carries`).refine(e=>new Set(e).size===e.length,"A label selection names each value id once")}),sK=nX.z.union([nK.z.strictObject({kind:n_.z.literal("ship"),shipId:(0,nY.f)("ship")}),nK.z.strictObject({kind:n_.z.literal("ship"),name:sO})]),s_=nX.z.union([...sK.options,nK.z.strictObject({kind:n_.z.literal("type"),type:sO}),nK.z.strictObject({kind:n_.z.literal("meeting"),meetingId:(0,nY.f)("meeting")}),sH]),sG=nX.z.union([nK.z.strictObject({kind:n_.z.literal("ship"),shipId:(0,nY.f)("ship")}),nK.z.strictObject({kind:n_.z.literal("ship"),name:sO}),nK.z.strictObject({kind:n_.z.literal("type"),type:sO}),sH]),sQ=nV.z.string().refine(e=>(0,n3.y)(e)<=n3.D,`A payload is at most ${n3.D} bytes (256 KB) in UTF-8`);nG.z.object({selector:s_,payload:sQ,contentType:sV.optional(),model:sW.optional(),idempotencyKey:n1,inReplyTo:(0,nY.f)("message").optional(),isForced:nQ.z.boolean().optional()}),nG.z.object({messageId:(0,nY.f)("message")}),nU.z.enum(["clientIdDocumentDomain","tlsHost","a2aCardDomain","oauthSubject"]);let sX=nV.z.string().min(1).max(255),sJ=nH.z.discriminatedUnion("checked",[nK.z.strictObject({checked:nU.z.enum(["clientIdDocumentDomain","tlsHost","a2aCardDomain"]),value:sX}),nK.z.strictObject({checked:n_.z.literal("oauthSubject"),issuer:nV.z.string().min(1).max(2048),value:sX})]);function sY(e){return JSON.stringify([e.checked,"issuer"in e?e.issuer:null,e.value])}nG.z.object({shipId:(0,nY.f)("ship"),facts:nJ.z.array(sJ).max(10,`A writer holds at most ${String(10)} facts about a ship`).refine(e=>new Set(e.map(sY)).size===e.length,"Each fact once")}),nK.z.strictObject({});let sZ={by:nH.z.discriminatedUnion("kind",[nK.z.strictObject({kind:n_.z.literal("ship"),id:(0,nY.f)("ship"),name:nV.z.string()}),nK.z.strictObject({kind:n_.z.literal("account"),id:sv.f}),nK.z.strictObject({kind:n_.z.literal("installation")})]),at:nE.z.iso.datetime()},s0=nH.z.discriminatedUnion("checked",[sJ.options[0].extend(sZ),sJ.options[1].extend(sZ)]),s1=n4.z.record(nV.z.string(),n7.z.json()),s2=nK.z.strictObject({title:nV.z.string().optional(),readOnlyHint:nQ.z.boolean().optional(),destructiveHint:nQ.z.boolean().optional(),idempotentHint:nQ.z.boolean().optional(),openWorldHint:nQ.z.boolean().optional()}),s5=nJ.z.array(sV).min(1,"Name at least one media type"),s6=nK.z.strictObject({name:nV.z.string().regex(/^[A-Za-z0-9_.-]{1,128}$/,"A capability name is 1 to 128 letters, digits, _, - or ., as MCP names a tool"),title:nV.z.string().optional(),description:nV.z.string().optional(),inputSchema:s1.optional(),outputSchema:s1.optional(),inputModes:s5.optional(),outputModes:s5.optional(),waitMs:n2.z.int().min(0).max(12e4).optional(),deadlineMs:n2.z.int().min(1).max(6048e5).optional(),repeatable:nQ.z.boolean().optional(),scopes:nJ.z.array(sk.q).optional(),annotations:s2.optional()}),s3=new TextEncoder,s8=`A statement is at most ${String(262144)} bytes (256 KB) as JSON in UTF-8`;nK.z.strictObject({summary:nV.z.string().trim().min(1,"A statement has a summary").max(1e3,`A summary is at most ${String(1e3)} characters`),capabilities:nJ.z.array(s6)}).refine(e=>new Set(e.capabilities.map(e=>e.name)).size===e.capabilities.length,{message:"A statement names each capability once",path:["capabilities"]}).refine(e=>s3.encode(JSON.stringify(e)).byteLength<=262144,{message:s8}),nG.z.object({version:n2.z.int().min(1)});let s4=nH.z.discriminatedUnion("by",[nG.z.object({by:n_.z.literal("crew"),version:n2.z.int().min(1),summary:nV.z.string(),capabilities:nJ.z.array(s6)}),nG.z.object({by:n_.z.literal("commission"),note:nV.z.string()})]).nullable();nG.z.object({ships:nJ.z.array(nG.z.object({id:(0,nY.f)("ship"),name:nV.z.string(),type:nV.z.string(),kind:sk.v,status:sk.e,statement:s4,verified:nJ.z.array(s0)})),types:nJ.z.array(nG.z.object({type:nV.z.string(),reachable:n2.z.int().min(1)}))});let s7=nU.z.enum(["idle","busy"]);nG.z.object({turn:s7,at:nE.z.iso.datetime()}),nK.z.strictObject({});let s9=nE.z.iso.datetime(),ie=nG.z.object({id:(0,nY.f)("ship"),name:nV.z.string()}),it=nG.z.object({valueId:(0,nY.f)("labelValue"),key:nV.z.string().nullable(),value:nV.z.string().nullable()}),is=nH.z.discriminatedUnion("kind",[nG.z.object({kind:n_.z.literal("ship"),ship:ie}),nG.z.object({kind:n_.z.literal("type"),type:nV.z.string()}),nG.z.object({kind:n_.z.literal("meeting"),meetingId:(0,nY.f)("meeting")}),nG.z.object({kind:n_.z.literal("label"),values:nJ.z.array(it).readonly()})]),ii=nG.z.object({shipId:(0,nY.f)("ship")}),ia=sM.extend({report:sa.extend({detailsBytes:n2.z.int().min(0).nullable()}).nullable(),crewRequest:s$.M.nullable(),commissionedAt:s9,crewedSince:s9.nullable(),removedAt:s9.nullable(),inFlightDeliveries:n2.z.int().min(0),openDeliveries:n2.z.int().min(0),owner:ie.nullable(),commissionedByShipId:(0,nY.f)("ship").nullable(),statement:s4,openAlerts:nJ.z.array(sb),expectations:sw});nX.z.union([ia,sP]);let ir=nG.z.object({seq:nW.z.number().int().positive(),id:(0,nY.f)("event"),type:sk.Q,occurredAt:s9,actor:ie.nullable(),signedInAccountId:sv.f.nullable(),ship:ie.nullable(),message:nG.z.object({id:(0,nY.f)("message"),sender:ie,recipient:is,contentType:nV.z.string(),isPing:nQ.z.boolean(),model:nV.z.string().nullable()}).nullable(),details:n4.z.record(nV.z.string(),nX.z.union([nV.z.string(),nW.z.number(),nQ.z.boolean(),sz.null()]))});ii.extend((0,n8.G)((0,nY.f)("event")).shape),(0,n8._)(ir,(0,nY.f)("event"));let il=nG.z.object({id:(0,nY.f)("message"),sender:ie,recipient:is,inReplyTo:(0,nY.f)("message").nullable(),sentAt:s9,contentType:nV.z.string(),model:nV.z.string().nullable(),preview:nV.z.string(),isPayloadUnreadable:nQ.z.boolean(),isPayloadSealed:nQ.z.boolean(),delivery:nG.z.object({id:(0,nY.f)("delivery"),state:sk.h,claimedBy:ie.nullable(),isPulled:nQ.z.boolean()})});ii.extend((0,n8.G)((0,nY.f)("message")).shape),(0,n8._)(il,(0,nY.f)("message"));let id=nG.z.object({messageId:(0,nY.f)("message")}),io=nU.z.enum(["notConfirmed","idle","busy"]),ic=nU.z.enum(["released","retired","deregistered","takenOver","signedOut","passwordReset","accountCutOff","restored"]);nU.z.enum(["trierarch","pluginWatcher","personApp","gateway","adapter"]);let iu=nH.z.discriminatedUnion("kind",[nG.z.object({kind:n_.z.literal("trierarch"),trierarch:ie}),nG.z.object({kind:n_.z.literal("pluginWatcher")}),nG.z.object({kind:n_.z.literal("personApp")}),nG.z.object({kind:n_.z.literal("gateway")}),nG.z.object({kind:n_.z.literal("adapter")})]),im=nH.z.discriminatedUnion("kind",[nG.z.object({kind:n_.z.literal("fleet")}),...iu.options,nG.z.object({kind:n_.z.literal("agent")})]),ip=nG.z.object({seq:nW.z.number().int().positive(),type:nU.z.enum(["MessageAccepted","DeliveryReceived","DeliveryHanded","DeliveryReturned","DeliveryAcknowledged","DeliveryHandled","DeliveryNotHandled","DeliveryOverdue","DeliveryUndeliverable","DeliveryAbandoned","DeliveryDismissed"]),occurredAt:s9,ship:ie.nullable(),location:nG.z.object({kind:sk.p,description:nV.z.string().nullable()}).nullable(),harness:nV.z.string().nullable(),attempts:nW.z.number().int().nonnegative().nullable(),by:iu.nullable(),handOverNumber:n2.z.int().min(1).nullable(),channel:nV.z.string().nullable(),isAgain:nQ.z.boolean(),isOnceMore:nQ.z.boolean(),overdue:nG.z.object({clock:io,minutes:n2.z.int().min(1)}).nullable(),leaseEnd:ic.nullable()}),ih=nG.z.object({holder:im.nullable(),since:s9,isPulled:nQ.z.boolean(),overdue:nG.z.object({clock:io,minutes:n2.z.int().min(1),toldAt:s9}).nullable(),lease:nG.z.object({by:iu.nullable(),isEnded:nQ.z.boolean(),turn:nG.z.object({turn:s7,at:s9}).nullable()}).nullable(),crew:nG.z.object({status:s$.u,attempt:n2.z.int().min(0),startedAt:s9.nullable()}).nullable()}),ig=nG.z.object({id:(0,nY.f)("message"),sender:ie,sentAt:s9}),ix=nG.z.object({id:(0,nY.f)("delivery"),ship:ie.nullable(),state:sk.h,since:s9,progress:sa.pick({state:!0,note:!0,step:!0,reportChangedAt:!0}).nullable()});il.omit({preview:!0,delivery:!0}).extend({payload:nV.z.string(),replies:nJ.z.array(ig),delivery:nG.z.object({id:(0,nY.f)("delivery"),state:sk.h,attempts:nW.z.number().int().nonnegative(),claimedBy:ie.nullable(),way:ih,history:nJ.z.array(ip)}),deliveryCount:n2.z.int().min(0),progress:sa.pick({state:!0,note:!0,step:!0,reportChangedAt:!0}).nullable()}),id.extend((0,n8.G)((0,nY.f)("delivery")).shape),(0,n8._)(ix,(0,nY.f)("delivery")),nG.z.object({lease:nG.z.object({by:iu.nullable(),turn:nG.z.object({turn:s7,at:s9}).nullable()}).nullable(),waiting:n2.z.int().min(0),oldest:nG.z.object({messageId:(0,nY.f)("message"),sentAt:s9,contentType:nV.z.string(),delivery:nG.z.object({id:(0,nY.f)("delivery"),state:sk.h,attempts:n2.z.int().min(0),way:ih})}).nullable()});let ib=nE.z.iso.datetime(),iv=["active","paused","ended","cancelled"],ij=nU.z.enum(iv),iy=nU.z.enum(["skip","retry","pause"]),iw=nU.z.enum(["each","once","skip"]),iz=nV.z.string().refine(e=>void 0!==n0(e),"A duration is ISO 8601 of weeks, or days, hours, minutes and seconds, such as PT30M or P1D"),ik=nE.z.iso.datetime({offset:!0}),iN={start:ik.optional(),end:ik.optional(),count:nW.z.number().int().optional()},iS=nH.z.discriminatedUnion("kind",[nK.z.strictObject({kind:n_.z.literal("once"),at:ik}),nK.z.strictObject({kind:n_.z.literal("every"),every:nV.z.string(),...iN}),nK.z.strictObject({kind:n_.z.literal("cron"),cron:nV.z.string(),timeZone:nV.z.string().optional(),...iN})]);nG.z.object({selector:sG,payload:sQ,contentType:sV.optional(),model:sW.optional(),idempotencyKey:n1,inReplyTo:(0,nY.f)("message").optional(),isForced:nQ.z.boolean().optional(),timing:iS,onRefused:iy.optional(),retryWindow:iz.optional(),onMissed:iw.optional(),grace:iz.optional()}),nG.z.object({scheduleId:(0,nY.f)("schedule")});let iI=nH.z.discriminatedUnion("kind",[nG.z.object({kind:n_.z.literal("sent"),messageId:(0,nY.f)("message"),sendTime:ib,at:ib}),nG.z.object({kind:n_.z.literal("refused"),code:nV.z.string(),sendTime:ib,at:ib}),nG.z.object({kind:n_.z.literal("missed"),sendTime:ib,at:ib})]),iC={start:ib.nullable(),end:ib.nullable(),count:nW.z.number().int().nullable()},i$=nH.z.discriminatedUnion("kind",[nG.z.object({kind:n_.z.literal("once"),at:ib}),nG.z.object({kind:n_.z.literal("every"),every:nV.z.string(),...iC}),nG.z.object({kind:n_.z.literal("cron"),cron:nV.z.string(),timeZone:nV.z.string(),...iC})]),iA=nX.z.union([nG.z.object({kind:n_.z.literal("ship"),shipId:(0,nY.f)("ship")}),nG.z.object({kind:n_.z.literal("ship"),name:nV.z.string()}),nG.z.object({kind:n_.z.literal("type"),type:nV.z.string()}),nG.z.object({kind:n_.z.literal("label"),valueIds:nJ.z.array((0,nY.f)("labelValue")),values:nJ.z.array(it).optional()})]),iT=nG.z.object({scheduleId:(0,nY.f)("schedule"),shipId:(0,nY.f)("ship"),state:ij,selector:iA,contentType:nV.z.string(),inReplyTo:(0,nY.f)("message").nullable(),isForced:nQ.z.boolean(),timing:i$,onRefused:iy,retryWindow:nV.z.string(),onMissed:iw,grace:nV.z.string(),nextSendTime:ib.nullable(),lastOutcome:iI.nullable(),createdAt:ib,endedAt:ib.nullable(),cancelledAt:ib.nullable()});function iR(){let e=(0,tz.I)(),t=(0,tw.d)();return async()=>{await Promise.all([t.invalidateQueries(e.fleet.schedules.pathFilter()),t.invalidateQueries(e.fleet.shipTimeline.pathFilter())])}}function iO(e,t){var n,s,i;let a;return{scheduleId:e.scheduleId,state:e.state,recipient:"type"===(n=e.selector).kind?`To ${(0,I.R)(n)}`:"label"===n.kind?`To every ship carrying ${(0,I.L)(n.values??n.valueIds.map(e=>({valueId:e,key:null,value:null})))}`:"name"in n?`To ${n.name}`:`To ${n.shipId}`,timing:"once"===(s=e.timing).kind?`Once, ${(0,w.B)(new Date(s.at))}`:["every"===s.kind?`Every ${void 0===(a=n0(i=s.every))||a<6e4?i:(0,w.m)(new Date(0),new Date(a))}`:`Cron ${s.cron}, ${s.timeZone}`,...null===s.end?[]:[`until ${(0,w.B)(new Date(s.end))}`],...null===s.count?[]:[`at most ${(0,z.v)(s.count,{one:"send",many:"sends"})}`]].join(", "),nextSend:null===e.nextSendTime?void 0:`Next ${(0,w.B)(new Date(e.nextSendTime))}`,lastOutcome:function(e,t){if(null===e)return;let n=(0,w.W)(new Date(e.at),t);switch(e.kind){case"sent":return{text:`Sent ${n}`,messageId:e.messageId};case"refused":return{text:`Refused ${n}: ${e.code}`};case"missed":return{text:`Missed the send time ${(0,w.B)(new Date(e.sendTime))}`}}}(e.lastOutcome,t),canPause:"active"===e.state,canCancel:"active"===e.state||"paused"===e.state}}(0,n8.G)((0,nY.f)("schedule")).extend({states:nJ.z.array(ij).min(1).optional()}).extend({shipId:(0,nY.f)("ship")}),(0,n8._)(iT,(0,nY.f)("schedule")),nG.z.object({scheduleId:(0,nY.f)("schedule")}),nG.z.object({scheduleId:(0,nY.f)("schedule"),state:n_.z.literal("paused")}),nG.z.object({scheduleId:(0,nY.f)("schedule")}),nG.z.object({scheduleId:(0,nY.f)("schedule"),state:nU.z.enum(["active","ended"])}),nG.z.object({scheduleId:(0,nY.f)("schedule")}),nG.z.object({scheduleId:(0,nY.f)("schedule"),state:n_.z.literal("cancelled")});var iq=e.i(368066),iD=e.i(348184);function iM({schedule:e,onOpenChange:n,isPending:s,error:i,onConfirm:a}){return(0,t.jsx)(iq.AlertDialog,{open:void 0!==e,onOpenChange:e=>{s||n(e)},children:(0,t.jsxs)(iq.AlertDialogContent,{"data-testid":"cancel-schedule-dialog",className:iD.f.phoneSheet,children:[(0,t.jsxs)(iq.AlertDialogHeader,{children:[(0,t.jsx)(iq.AlertDialogTitle,{children:"Cancel this schedule?"}),(0,t.jsx)(iq.AlertDialogDescription,{children:void 0===e?null:`${e.recipient}: ${e.timing}. It sends nothing more, and it cannot be resumed: its ship schedules anew to send again.`})]}),void 0===i?null:(0,t.jsx)(f.f,{title:"Couldn’t cancel the schedule",description:`${i}. Nothing changed: try again.`}),(0,t.jsxs)(iq.AlertDialogFooter,{children:[(0,t.jsx)(iq.AlertDialogClose,{render:(0,t.jsx)(p.f,{disabled:s}),children:"Keep it"}),(0,t.jsx)(p.f,{variant:"destructive",isLoading:s,"data-testid":"cancel-schedule-confirm",onClick:a,children:s?"Cancelling…":"Cancel schedule"})]})]})})}var iP=e.i(106501);let iL={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};iL.node;let iF=(0,r.f)(iL);function iB({row:e,isPausing:n,pauseError:s,onPause:i,onCancel:a,onOpenMessage:r}){let l=e.lastOutcome;return(0,t.jsxs)("li",{"data-testid":"ship-schedule","data-schedule-id":e.scheduleId,className:"flex flex-col gap-2 border-b border-border px-3.5 py-3 last:border-b-0",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-body text-foreground max-sm:text-body-touch",children:e.recipient}),(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:e.timing}),(0,t.jsxs)("span",{className:"flex flex-wrap gap-x-3 text-meta text-muted-foreground tabular-nums",children:[void 0===e.nextSend?null:(0,t.jsx)("span",{children:e.nextSend}),void 0===l?(0,t.jsx)("span",{children:"Nothing sent yet"}):void 0===l.messageId?(0,t.jsx)("span",{"data-testid":"ship-schedule-outcome",children:l.text}):(0,t.jsx)("button",{type:"button","data-testid":"ship-schedule-outcome",className:"underline-offset-2 hover:text-foreground hover:underline",onClick:()=>{void 0!==l.messageId&&r(l.messageId)},children:l.text})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(x.T,{status:e.state}),e.canPause?(0,t.jsx)(p.f,{size:"sm",icon:(0,t.jsx)(iF,{"aria-hidden":!0}),isLoading:n,"data-testid":"ship-schedule-pause",onClick:()=>{i(e.scheduleId)},children:n?"Pausing…":"Pause"}):null,e.canCancel?(0,t.jsx)(p.f,{size:"sm",variant:"destructive",icon:(0,t.jsx)(V.f,{"aria-hidden":!0}),disabled:n,"data-testid":"ship-schedule-cancel",onClick:()=>{a(e.scheduleId)},children:"Cancel"}):null]})]}),void 0===s?null:(0,t.jsx)(f.f,{title:"Couldn’t pause the schedule",description:`${s}. Nothing changed: try again.`})]})}function iE({schedules:e,state:n,onRetry:s,more:i,now:a,pausingId:r,pauseError:l,onPause:d,onCancel:o,onOpenMessage:c}){return"loading"===n?(0,t.jsx)(m.f,{variant:"list",rows:3,label:"Loading the schedules"}):"error"===n?(0,t.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-3",children:[(0,t.jsx)(f.f,{title:"Couldn’t load the schedules",description:"The rest of the page is current. Try again in a moment."}),s?(0,t.jsx)(p.f,{size:"sm",icon:(0,t.jsx)(u.f,{"aria-hidden":!0}),onClick:s,className:"self-start",children:"Try again"}):null]}):0!==e.length||i?(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)("ol",{"aria-label":"Schedules",className:"overflow-hidden rounded-lg border border-border bg-card",children:e.map(e=>(0,t.jsx)(iB,{row:iO(e,a),isPausing:r===e.scheduleId,pauseError:l?.scheduleId===e.scheduleId?l.message:void 0,onPause:d,onCancel:o,onOpenMessage:c},e.scheduleId))}),i]}):(0,t.jsx)(g.f,{variant:"section",icon:(0,t.jsx)(iP.f,{}),title:"No schedules",description:"Messages this ship schedules appear here, with what each last sent."})}function iU({shipId:e,now:n,onOpenMessage:i}){let a,r,l,d,o,c=(a=(0,tz.I)(),(0,tT.d)((0,tA.f)(a.fleet.schedules.infiniteQueryOptions({shipId:e,limit:tT.q,states:[...iv]},{getNextPageParam:tT.J})))),u=(r=(0,tz.I)(),l=iR(),(0,tj.f)(r.fleet.pauseSchedule.mutationOptions({onSuccess:l}))),m=(d=(0,tz.I)(),o=iR(),(0,tj.f)(d.fleet.cancelSchedule.mutationOptions({onSuccess:o}))),[p,h]=(0,s.useState)(),[g,f]=(0,s.useState)(),[x,b]=(0,s.useState)(),[v,j]=(0,s.useState)(),y=c.items?.find(e=>e.scheduleId===x);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(iE,{schedules:c.items??[],state:c.isFailed?"error":c.items?"ready":"loading",onRetry:c.retry,more:c.hasMore?(0,t.jsx)(no.f,{what:"older schedules",isLoading:c.isLoadingMore,isFailed:c.isLoadMoreFailed,onLoad:c.loadMore,area:"ship-schedules"}):null,now:n,pausingId:u.isPending?p:void 0,pauseError:g,onPause:e=>{f(void 0),h(e),u.mutate({scheduleId:e},{onSuccess:()=>{(0,U.showToast)({title:"Schedule paused",description:"It sends nothing until its ship resumes it.",tone:"success"})},onError:t=>{f({scheduleId:e,message:t.message})}})},onCancel:e=>{j(void 0),b(e)},onOpenMessage:i}),(0,t.jsx)(iM,{schedule:void 0===y?void 0:iO(y,n),isPending:m.isPending,error:v,onOpenChange:e=>{e||b(void 0)},onConfirm:()=>{void 0!==x&&(j(void 0),m.mutate({scheduleId:x},{onSuccess:()=>{b(void 0),(0,U.showToast)({title:"Schedule cancelled",description:"It sends nothing more.",tone:"success"})},onError:e=>{j(e.message)}}))}})]})}let iV=(0,R.f)(()=>e.A(665030).then(e=>e.MessageSheet),e=>e.isOpen);e.s(["ShipPageFor",0,function({shipId:e,tab:r,messageId:l}){let d,o=(0,n.useRouter)(),c=(0,nb.f)(),u=(0,nv.f)(),m=(0,nj.f)(),p=(0,nk.u)(e),h=(0,nk.l)(e),g=(d=[...new Set((h.items??[]).flatMap(e=>null===e.signedInAccountId?[]:[e.signedInAccountId]))].sort(),(0,nm.f)({queryKey:["account-names",...d],queryFn:()=>(0,np.f)({read:"account-names",input:{accountIds:d}}),enabled:d.length>0}).data??{}),f=(0,nk.e)(e),x=(0,nk.v)(l),b=(0,nk.d)(x.data?.recipient.kind==="label"||x.data?.recipient.kind==="meeting"?x.data.id:void 0),v=(0,nk.j)(e),j=(0,nw.f)(),z=(0,ny._)(),k=(0,nu.f)().data?.retention.keptFrom??null,N=(0,E.t)(),S=(0,nx.f)(),I=(0,ng.y)(),C=(0,ev.p)(),A=(0,O.Q)(),[T,R]=(0,s.useState)();(0,nz.n)([p.error,h.error,f.error,x.error,b.error,S.error]);let q=t=>{let n,s;o.replace((n=new URLSearchParams,t.tab!==nL&&n.set("tab",t.tab),void 0!==t.messageId&&n.set("message",t.messageId),""===(s=n.toString())?`/ships/${e}`:`/ships/${e}?${s}`),{scroll:!1})},D=e=>{q({tab:r,messageId:e})},M="NOT_FOUND"===(0,nf.N)(p.error)||null===p.data,P=v.data&&(p.data?.kind==="agent"||p.data?.kind==="trierarch")?function(e,t){let{now:n,machines:s=[]}=t;if(null===e.lease)return{lines:[],oldest:null};let{by:i,turn:a}=e.lease,r=0===e.waiting?[{icon:"time",tone:"neutral",text:"Nothing waiting"}]:[];return{lines:[null===i?{icon:"pull",tone:"neutral",text:"Pull: nobody wakes it"}:{...(0,y.s)(i),tone:"neutral"},...function(e,t){if(e?.kind!=="trierarch")return[];let n=t.machines.find(t=>t.shipId===e.trierarch.id);if(!n?.isSilent)return[];let s=null===n.lastSeenAt?"":` since ${(0,w.l)(new Date(n.lastSeenAt),t.now)}`;return[{icon:"silent",tone:"attention",text:`Trierarch on ${e.trierarch.name} silent${s}`}]}(i,{now:n,machines:s}),...function(e,t){if(null===e)return[];let n=(0,w.l)(new Date(e.at),t);return"busy"===e.turn?[{icon:"busy",tone:"active",text:`Busy since ${n}`}]:[{icon:"idle",tone:"neutral",text:`Idle since ${n}`}]}(a,n),...r],oldest:function(e,t){let{oldest:n,waiting:s}=e;if(null===n)return null;let{state:i,way:a}=n.delivery,r=[(0,w.W)(new Date(a.since),t).toLowerCase()];return"handed"===i&&r.push(a.isPulled?"not acknowledged":"not confirmed"),a.overdue&&r.push(`argo told at ${String(a.overdue.minutes)} min`),s>1&&r.push(`oldest of ${String(s)}`),{messageId:n.messageId,status:(0,y.C)({state:i,isPulled:a.isPulled}),isOverdue:null!==a.overdue,text:r.join(" · ")}}(e,n)}}(v.data,{now:c,machines:N.data??[]}):void 0,L=p.data?function(e){if(!e.isSealed)return;let{gateway:t}=e;return t?.shipId!==void 0&&"app"===e.ship.kind&&e.ship.commissionedByShipId===t.shipId?{as:"proxyShip",gateway:t}:e.leaseBy?.kind==="gateway"?{as:"crew",gateway:t??{name:ta}}:void 0}({isSealed:void 0!==j.data&&"none"!==j.data.state,ship:p.data,leaseBy:v.data?.lease?.by??null,gateway:function(e){if(void 0!==e&&"none"!==e.state)return null!==e.ship?e.ship:null===e.lastShipId?void 0:{shipId:e.lastShipId,name:ta}}(z.data)}):void 0,F=(0,ek.R)(C.data??[]).get(e),B=r!==nB||A.canManage?r:nL;return(0,t.jsx)(nh.f,{switcher:I.switcher,account:I.account,onCompose:I.onCompose,onSearch:I.onSearch,banner:I.banner,title:p.data?.name??"Ship",parents:F?[{href:"/squadrons",label:"Squadrons"},{href:`/squadrons/${F.squadronId}`,label:F.squadronId}]:[{href:"/",label:"Fleet overview"}],live:S.live,header:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tt,{ship:p.data??void 0,shipId:e,state:M?"not-found":p.data?"ready":"loading",now:c,viewerFleetId:u,actions:p.data?(0,t.jsx)(eC.f,{ship:p.data,compose:a.f,crewLineFlow:e$.R}):void 0,crewRequest:p.data?(0,t.jsx)(ez,{ship:p.data,timeline:h.items??[],now:c}):void 0,labels:p.data?(0,t.jsx)(tv,{ship:p.data}):void 0,permissions:p.data?(0,t.jsx)(tI,{ship:p.data}):void 0,owner:p.data&&null!==p.data.ownerShipId?(0,t.jsx)(tD,{ship:p.data}):void 0,isPluginShip:m.has(e),way:P&&v.data?.lease?(0,t.jsx)(ti,{view:P,onOpenMessage:D}):void 0,gatewayReader:L}),M?null:(0,t.jsx)(eI,{shipId:e,now:c}),M?null:(0,t.jsx)(nM,{shipId:e})]}),sheet:(0,t.jsx)(iV,{message:x.data,messageId:l,state:"NOT_FOUND"===(0,nf.N)(x.error)?"not-found":x.data?"ready":"loading",isOpen:void 0!==l,now:c,machines:N.data??[],deliveries:(0,t.jsx)(nd.f,{deliveries:b.items??[],state:b.isFailed?"error":b.items?"ready":"loading",onRetry:b.retry,more:b.hasMore?(0,t.jsx)(no.f,{what:"more deliveries",isLoading:b.isLoadingMore,isFailed:b.isLoadMoreFailed,onLoad:b.loadMore,area:"message-deliveries"}):null,now:c}),onOpenMessage:D,onOpenChange:e=>{e||q({tab:r})},onReply:A.canSend?e=>{R({messageId:e.id,sender:e.sender})}:void 0}),children:(0,t.jsxs)(t.Fragment,{children:[M?null:(0,t.jsxs)(i.Tabs,{value:B,onValueChange:e=>{var t;q({tab:(t="string"==typeof e?e:void 0)===nF||t===nB?t:nL,messageId:l})},children:[(0,t.jsxs)(i.TabsList,{variant:"line","aria-label":`${p.data?.name??"Ship"} history`,children:[(0,t.jsx)(i.TabsTrigger,{variant:"line",value:nL,children:"Timeline"}),(0,t.jsx)(i.TabsTrigger,{variant:"line",value:nF,children:"Messages"}),A.canManage?(0,t.jsx)(i.TabsTrigger,{variant:"line",value:nB,children:"Schedules"}):null]}),(0,t.jsx)(i.TabsContent,{value:nL,className:"pt-4",children:(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)(nl,{shipId:e,entries:h.items??[],state:h.isFailed?"error":h.items?"ready":"loading",onRetry:h.retry,more:h.hasMore?(0,t.jsx)(no.f,{what:"older events",isLoading:h.isLoadingMore,isFailed:h.isLoadMoreFailed,onLoad:h.loadMore,area:"ship-timeline"}):null,now:c,onOpenMessage:D,accountNames:g}),(0,t.jsx)(nc.f,{keptFrom:k,area:"ship-timeline"})]})}),(0,t.jsx)(i.TabsContent,{value:nF,className:"pt-4",children:(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)($,{shipId:e,messages:f.items??[],state:f.isFailed?"error":f.items?"ready":"loading",onRetry:f.retry,more:f.hasMore?(0,t.jsx)(no.f,{what:"older messages",isLoading:f.isLoadingMore,isFailed:f.isLoadMoreFailed,onLoad:f.loadMore,area:"message-threads"}):null,now:c,onOpenMessage:D}),(0,t.jsx)(nc.f,{keptFrom:k,area:"message-threads"})]})}),A.canManage?(0,t.jsx)(i.TabsContent,{value:nB,className:"pt-4",children:(0,t.jsx)(iU,{shipId:e,now:c,onOpenMessage:D})}):null]}),(0,t.jsx)(a.f,{isOpen:void 0!==T,onOpenChange:e=>{e||R(void 0)},replyTo:T})]})})}],915860)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,242047,e=>{"use strict";var t=e.i(843476),s=e.i(681924),i=e.i(77071),a=e.i(618566),n=e.i(271645),l=e.i(748955),r=e.i(917540),o=e.i(34512),d=e.i(808041),c=e.i(905387),u=e.i(878608),h=e.i(440407),m=e.i(904084),f=e.i(749092),p=e.i(87600),x=e.i(516752),g=e.i(686165),v=e.i(448695),j=e.i(500265),b=e.i(153040),y=e.i(266027),w=e.i(427702),N=e.i(419413),k=e.i(619273);let C=(0,r.f)(()=>e.A(438801).then(e=>e.CommissionDialog),e=>e.isOpen),S=(0,r.f)(()=>e.A(495953).then(e=>e.StartingPromptDialog),e=>e.isOpen);function I({isOpen:e,onOpenChange:a}){let l=(0,f.f)(),r=(0,p.b)(),M=(0,c.Q)(),z=(0,c.a)(),$=(0,c.s)(),q="connected"===(0,j.x)(),O=(0,j.t)(),T=(0,j.W)(),A=(0,g.U)(),F=(0,v.p)(),[V,P]=(0,n.useState)(!1),[L,R]=(0,n.useState)(null),D=(0,d.i)(O.data??[],T.data??[]),U=(0,c.e)(O.data?.map(e=>e.shipId)),{shipLabelsMax:E}=(0,o.x)(),_=function(){var e,t;let s,i,a,l,r=(0,w.I)(),[o,d]=(0,n.useState)(!1),u=(0,y.f)(r.console.session.queryOptions()),h=(0,c.W)(),m=h.error??u.error;return{scopeGroups:void 0===h.data||void 0===u.data?void 0:(e=h.data,t="operator"===u.data.kind?void 0:u.data.scopes,s=new Map(e.filter(({kind:e})=>"core"===e).flatMap(({scopes:e})=>e.map(({scope:e,description:t})=>[e,t]))),i=void 0===t?void 0:new Set(t),a=(t??[...s.keys()]).flatMap(e=>{let t=s.get(e);return void 0===t?[]:[{scope:e,description:t}]}),l=[{title:"Fleet access",namespace:null,scopes:a},...e.flatMap(({namespace:e,kind:t,declaredBy:s,scopes:i})=>"plugin"!==t||null===s||0===i.length?[]:[{title:s.name,namespace:e,scopes:i.map(({scope:e,description:t})=>({scope:e,description:t}))}]),...e.flatMap(({namespace:e,kind:t,scopes:s})=>"fleet"!==t?[]:[{title:"The fleet's own",namespace:e,scopes:s.map(({scope:e,description:t})=>({scope:e,description:t}))}])],void 0!==i?l.map(e=>({...e,scopes:e.scopes.filter(({scope:e})=>i.has(e))})):l),scopeFailure:null!==m||o?{message:null===m?"Reading permissions again. Nothing you typed is lost.":`${m.message} Nothing you typed is lost. Try again.`,isRetrying:o,onRetry:()=>{d(!0),Promise.all([h.refetch(),u.refetch()]).finally(()=>{d(!1)})}}:void 0}}(),H=void 0===U||void 0===O.data?void 0:(0,u.u)(U,{machines:O.data,shipLabelsMax:E}),K=(0,j.J)(e&&q?null===L?(0,d.B)((0,d.P)(D)):L:void 0),Q=(0,b.C)(!1),[W,B]=(0,n.useState)({name:"",type:""}),J=(0,h.f)(W.name),X=(0,b.X)(W.type),G=function(e){var t,s;let i,a=(0,w.I)(),[l,r]=(0,n.useState)(""),[o,d]=(0,n.useState)(!1),c=(0,y.f)(a.console.account.queryOptions()),u=c.data?.kind==="operator",h=l.trim(),m=(0,y.f)(a.fleet.list.queryOptions({shipKind:["person"],limit:N.$,...""===h?{}:{nameQuery:h}},{enabled:e&&u,placeholderData:k.y})),f=(0,y.f)(a.fleet.lastNamedOwner.queryOptions(void 0,{enabled:e&&u}));if(!u)return;let p=m.isError?m:f.isError?f:void 0,x=void 0!==p||o?{failure:{message:p?.error.message??"Reading the person ships again. Nothing you typed is lost.",isRetrying:o,onRetry:()=>{d(!0),Promise.all([...m.isError?[m.refetch()]:[],...f.isError?[f.refetch()]:[]]).finally(()=>{d(!1)})}}}:{};return{choices:(t=m.data?.items,s=f.data?.owner??void 0,i=t?.filter(e=>"retired"!==e.status).map(e=>({id:e.id,name:e.name})),void 0===s||i?.some(e=>e.id===s.id)===!0?i:[...i??[],s]),lastPicked:f.data?.owner?.id,onQueryChange:r,...x}}(e),Y=M.data?.prompt==null?$.data:M.data,Z=Y?"shown":$.isError?"error":"issuing",ee=(e,t)=>{M.mutate(e,{onSuccess:({shipId:s,prompt:i})=>{a(!1);let n=q&&void 0!==t;n||(P(!0),null===i&&$.mutate({shipId:s})),void 0!==t&&z.mutate({shipId:s,settings:t.settings},{onSuccess:()=>{n&&(0,m.showToast)({title:`${e.name} commissioned, crew requested`,description:"The trierarch plugin assigns a trierarch that fits.",tone:"success"})},onError:t=>{(0,m.showToast)({title:`Couldn’t request a crew for ${e.name}`,description:`${t.message} The ship is commissioned; request a crew on its page.`,tone:"error"})}})}})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.f,{variant:"primary",icon:(0,t.jsx)(i.f,{}),"data-testid":"fleet-commission",onClick:()=>{M.reset(),$.reset(),R(null),a(!0)},children:"Commission ship"}),(0,t.jsx)(C,{types:Q??[],taken:{names:!0===J?[W.name]:[],typeShipCounts:new Map(void 0===X?[]:[[W.type,X]])},onTypedChange:B,isOpen:e,onOpenChange:a,isPending:M.isPending,error:M.error?.message,shipLimit:(0,x.u)(l.data),accountUrl:r,...void 0===G?{}:{owner:G},..._,...q?{crewRequest:{offers:D,squadrons:"connected"===A?(F.data??[]).filter(e=>"disbanded"!==e.state).map(e=>e.id):void 0,...void 0===H?{}:{machineLabels:H},check:K.data,onSettingsChange:R}}:{},onSubmit:async(e,t)=>{let s={...e,idempotencyKey:crypto.randomUUID()};if(!q||void 0===t)return ee(s,t),{isOk:!0,value:void 0};let i=await K.checkNow();return"refused"===i.kind?{isOk:!1,error:{kind:"crewRefused",message:`${i.reason} Nothing was commissioned. Update the crew settings and try again.`}}:(ee(s,t),{isOk:!0,value:void 0})}}),(0,t.jsx)(S,{shipName:M.variables?.name??"",state:Z,prompt:Y?.prompt??void 0,crewLines:Y?.crewLines??void 0,error:$.error?.message,isOpen:V&&void 0!==M.data,onOpenChange:e=>{e||(P(!1),M.reset(),$.reset())},onConfirm:()=>{void 0!==M.data&&$.mutate({shipId:M.data.shipId})}})]})}var M=e.i(490262),z=e.i(456420);let $={name:"infinity",size:24,node:[["path",{d:"M6 16c5 0 7-8 12-8a4 4 0 0 1 0 8c-5 0-7-8-12-8a4 4 0 1 0 0 8",key:"18ogeb"}]]};$.node;let q=(0,z.f)($);var O=e.i(730274),T=e.i(749287),A=e.i(812437),F=e.i(33479);let V={ships:{label:"Ships",unit:"ships",Icon:T.f},messages:{label:"Messages today",unit:"messages",Icon:O.f}},P={below:"bg-primary",at:"bg-tone-waiting-fg",over:"bg-tone-attention-fg"},L={at:"at-limit",over:"over-limit"};function R({kind:e,count:s,limit:i,resetsAt:a}){let{label:n,unit:l,Icon:r}=V[e],o=(0,x.o)({count:s,limit:i}),d=L[o],c=(0,x.I)({count:s,limit:i}),u=null===i?0:0===i?1:Math.min(s/i,1);return(0,t.jsxs)("div",{"data-testid":`limit-meter-${e}`,"data-state":o,className:"flex flex-col gap-2 rounded-lg border border-border bg-card p-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-meta font-medium text-muted-foreground",children:[(0,t.jsx)(r,{"aria-hidden":!0,className:"size-(--size-icon-sm)"}),n]}),void 0===d?null:(0,t.jsx)(F.T,{status:d})]}),(0,t.jsxs)("p",{className:"flex items-baseline gap-1.5",children:[(0,t.jsx)("span",{className:"text-metric font-semibold tabular-nums",children:(0,x.U)(s)}),(0,t.jsx)("span",{className:"text-body text-muted-foreground",children:null===i?l:`of ${(0,x.U)(i)} ${l}`})]}),null===i?(0,t.jsxs)("p",{className:"inline-flex items-center gap-1.5 text-meta text-muted-foreground",children:[(0,t.jsx)(q,{"aria-hidden":!0,className:"size-(--size-icon-sm)"}),"No limit"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{role:"meter","aria-label":`${n}: ${String(s)} of ${String(i)}`,"aria-valuenow":s,"aria-valuemin":0,"aria-valuemax":i,className:"block h-1.5 overflow-hidden rounded-full bg-secondary",children:(0,t.jsx)("span",{className:(0,A.f)("block h-full rounded-full","none"===o?void 0:P[o]),style:{width:`${String(100*u)}%`}})}),(0,t.jsxs)("p",{"data-testid":`limit-meter-${e}-caption`,className:"text-caption text-muted-foreground",children:[c,void 0===a?null:` \xb7 resets at ${(0,x.e)(a)}`]})]})]})}function D(){let e=(0,f.f)().data,s=(0,p.b)(),{isViewer:i}=(0,M.Q)();return(0,x.F)(e)?(0,t.jsxs)("section",{"aria-labelledby":"overview-limits-title","data-testid":"overview-limits",className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("h2",{id:"overview-limits-title",className:"text-body font-semibold",children:"Limits"}),void 0===s||i?null:(0,t.jsx)("a",{href:s,"data-testid":"overview-limits-view",className:"text-meta font-medium text-primary underline underline-offset-2",children:"View limits"})]}),(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,t.jsx)(R,{kind:"ships",count:e.ships.count,limit:e.ships.limit}),(0,t.jsx)(R,{kind:"messages",count:e.dailyMessages.count,limit:e.dailyMessages.limit,resetsAt:e.dailyMessages.resetsAt})]}),(0,t.jsx)("p",{"data-testid":"overview-limits-retention",className:"text-meta text-muted-foreground",children:(0,x.d)(e.retention)})]}):null}var U=e.i(44913),E=e.i(336),_=e.i(167648),H=e.i(522016),K=e.i(296676),Q=e.i(609176),W=e.i(743006),B=e.i(784294),J=e.i(621482),X=e.i(731877),G=e.i(42756);function Y(e,t){return e.reduce((e,s)=>e+t(s),0)}function Z(e,t){let s=t.status?.includes("retired")??!1;return{shown:Y(e.view,e=>e.active+(s?e.retired:0)),total:Y(e.fleet,e=>e.active+e.retired),retired:Y(e.fleet,e=>e.retired)}}var ee=e.i(137529);let et=["people","agents","trierarchs","plugins","gateway"],es={operator:"people",person:"people",agent:"agents",trierarch:"trierarchs",plugin:"plugins",app:"gateway",viewer:null};function ei(e){return null===e.lastActivityAt?-1/0:Date.parse(e.lastActivityAt)}function ea(e,t){let s=ee.E.indexOf(e.state)-ee.E.indexOf(t.state),i=ei(t)-ei(e);return s||(Number.isNaN(i)?0:i)||e.name.localeCompare(t.name)}let en=[{state:"working",words:"working"},{state:"idle",words:"idle"},{state:"awaitingCrew",words:"awaiting crew"},{state:"blocked",words:"blocked"},{state:"alert",words:"with an alert"}];function el(){let e=(0,w.I)(),t=(0,y.f)(e.fleet.harbour.queryOptions({limit:1}));return{counts:t.data?.counts??void 0,isFailed:t.isError,error:t.error,retry:()=>{t.refetch()}}}let er={alert:"Alert",awaitingCrew:"Awaiting crew",blocked:"Blocked",working:"Working",idle:"Idle"},eo={mode:"cards",query:"",filters:{state:[],type:[],labelValueIds:[]},sort:null};function ed(e){var t;return[ec("State",(t=e).state.map(e=>er[e])),ec("Type",t.type)].filter(e=>void 0!==e).length+e.labelValueIds.length}function ec(e,t){return 0===t.length?void 0:`${e}: ${t.join(", ")}`}let eu={name:"search-x",size:24,node:[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]};eu.node;let eh=(0,z.f)(eu);var em=e.i(890135);function ef({query:e,hasFilters:i,fleetShips:a,onClear:n}){let l=e.trim();return(0,t.jsxs)("div",{"data-testid":"fleet-no-match",className:"flex flex-col items-center gap-3 rounded-lg border border-border bg-card px-6 py-10 text-center",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"flex size-9 items-center justify-center rounded-lg bg-secondary text-muted-foreground [&_svg]:size-4.5",children:(0,t.jsx)(eh,{})}),(0,t.jsx)("p",{className:"text-body font-semibold text-foreground",children:""===l?"No ships match these filters.":`No ships match “${l}”.`}),void 0===a?null:(0,t.jsxs)("p",{className:"text-meta text-muted-foreground",children:["The fleet has ",(0,em.v)(a,{one:"ship",many:"ships"}),"; none of them is in this view."]}),(0,t.jsx)(s.f,{size:"xs","data-testid":"fleet-clear-filters",onClick:n,children:""===l?"Clear filters":i?"Clear search and filters":"Clear search"})]})}var ep=e.i(566595);let ex={name:"sliders-horizontal",size:24,node:[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]};ex.node;let eg=(0,z.f)(ex);var ev=e.i(263676),ej=e.i(620388),eb=e.i(999808),ey=e.i(527256),ew=e.i(695960),eN=e.i(280581);function ek({label:e,items:s,picked:i,onPickedChange:a,chipClassName:n,testId:l}){return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"text-meta text-muted-foreground",children:e}),(0,t.jsx)("div",{role:"group","aria-label":e,"data-testid":l,className:"flex flex-wrap gap-1.5",children:s.map(({value:e,content:s})=>{let l=i.includes(e);return(0,t.jsx)("button",{type:"button","aria-pressed":l,onClick:()=>{a(l?i.filter(t=>t!==e):[...i,e])},className:(0,A.f)("inline-flex h-10 items-center gap-1.5 rounded-lg border border-border bg-card px-3 text-body-touch font-medium text-foreground outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring aria-pressed:border-tone-active-border aria-pressed:bg-tone-active-bg [&_svg]:size-4",n),children:s},e)})})]})}var eC=e.i(946033);function eS({value:e}){return void 0===e?null:(0,t.jsx)("span",{className:"ml-auto pl-4 text-meta text-muted-foreground tabular-nums",children:e})}function eI({label:e,items:s,picked:i,onPickedChange:a,counts:n,renderItem:l,size:r="sm",valueClassName:o,className:d,testId:c}){let u=function(e,t){let[s]=e;return void 0===s?{kind:"all"}:1===e.length?{kind:"one",word:t[s]??s}:{kind:"several",count:e.length}}(i,s),h=void 0===n?"end":"start";return(0,t.jsxs)(eC.d,{multiple:!0,value:0===i.length?["all"]:[...i],onValueChange:e=>{a(i.length>0&&e.includes("all")?[]:e.filter(e=>"all"!==e))},children:[(0,t.jsx)(eC.P,{size:r,"aria-label":e,"data-testid":c,className:d,children:(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:e}),"several"===u.kind?(0,t.jsxs)("span",{className:"inline-flex size-5 items-center justify-center rounded-full bg-primary text-caption font-semibold text-primary-foreground tabular-nums",children:[u.count,(0,t.jsx)("span",{className:"sr-only",children:" picked"})]}):(0,t.jsx)("span",{className:(0,A.f)("font-medium","one"===u.kind?o:void 0),children:"one"===u.kind?u.word:"All"})]})}),(0,t.jsxs)(eC.r,{className:void 0===n?void 0:"min-w-55",children:[(0,t.jsxs)(eC.T,{value:"all",indicator:h,children:["All",(0,t.jsx)(eS,{value:n?.total})]}),void 0===n?null:(0,t.jsx)("div",{role:"separator",className:"-mx-1 my-1 h-px bg-border"}),Object.entries(s).map(([e,s])=>(0,t.jsxs)(eC.T,{value:e,className:o,indicator:h,children:[void 0===l?s:l(e,s),(0,t.jsx)(eS,{value:n?.of[e]})]},e))]})]})}var eM=e.i(689664),ez=e.i(716327),e$=e.i(406734);let eq="inline-flex h-(--size-control) shrink-0 items-center gap-1.5 rounded-md border border-input bg-card px-2.5 text-meta whitespace-nowrap text-foreground shadow-sm transition-[border-color,box-shadow] duration-(--duration-fast) outline-none hover:bg-accent focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/22 data-popup-open:border-ring [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",eO="flex h-8.5 w-full items-center gap-2.5 rounded-sm pr-2.5 pl-8 text-left text-body outline-none hover:bg-accent focus-visible:bg-accent";function eT({types:e,total:s,picked:i,onPickedChange:a}){let[l,r]=(0,n.useState)(""),o=l.trim().toLowerCase(),d=""===o?e:e.filter(({type:e})=>e.toLowerCase().includes(o)),[c]=i;return(0,t.jsxs)(e$.V,{onOpenChange:e=>{e||r("")},children:[(0,t.jsxs)(e$.J,{"aria-label":"Type","data-testid":"fleet-filter-type",className:eq,children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Type"}),i.length>1?(0,t.jsxs)("span",{className:"inline-flex size-5 items-center justify-center rounded-full bg-primary text-caption font-semibold text-primary-foreground tabular-nums",children:[i.length,(0,t.jsx)("span",{className:"sr-only",children:" picked"})]}):(0,t.jsx)("span",{className:(0,A.f)("font-medium",void 0===c?void 0:"font-mono"),children:c??"All"}),(0,t.jsx)(ez.f,{"aria-hidden":!0,className:"text-muted-foreground"})]}),(0,t.jsxs)(e$.T,{align:"start",sideOffset:4,className:"flex max-h-(--available-height) w-50 flex-col p-1","data-testid":"fleet-filter-type-popover",children:[(0,t.jsxs)("label",{className:"flex h-8.5 items-center gap-2 border-b border-border px-2 text-meta text-muted-foreground [&_svg]:size-(--size-icon-sm)",children:[(0,t.jsx)(ep.f,{"aria-hidden":!0}),(0,t.jsx)("input",{"aria-label":"Find a type",placeholder:"Find a type",value:l,onChange:e=>{r(e.target.value)},className:"min-w-0 flex-1 bg-transparent text-foreground outline-none placeholder:text-muted-foreground"})]}),(0,t.jsxs)("div",{role:"group","aria-label":"Types",className:"flex min-h-0 flex-col overflow-y-auto pt-1",children:[(0,t.jsxs)("button",{type:"button","aria-pressed":0===i.length,className:eO,onClick:()=>{a([])},children:[(0,t.jsx)("span",{className:"flex-1",children:"All"}),(0,t.jsx)("span",{className:"text-meta text-muted-foreground tabular-nums",children:s})]}),(0,t.jsx)("div",{role:"separator",className:"-mx-1 my-1 h-px bg-border"}),d.map(({type:e,ships:s})=>{let n=i.includes(e);return(0,t.jsxs)("button",{type:"button","aria-pressed":n,className:(0,A.f)(eO,"relative"),onClick:()=>{a(n?i.filter(t=>t!==e):[...i,e])},children:[n?(0,t.jsx)(eM.f,{"aria-hidden":!0,className:"absolute left-2.5 size-(--size-icon)"}):null,(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-meta",children:e}),(0,t.jsx)("span",{className:"text-meta text-muted-foreground tabular-nums",children:s})]},e)}),0===d.length?(0,t.jsxs)("p",{className:"px-2.5 py-2 text-meta text-muted-foreground",children:["No type matches “",l.trim(),"”."]}):null]})]})]})}var eA=e.i(373374),eF=e.i(774835);let eV={name:"layout-grid",size:24,node:[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]};eV.node;let eP=(0,z.f)(eV),eL={name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]};eL.node;let eR=[{mode:"cards",word:"Cards",Icon:eP},{mode:"list",word:"List",Icon:(0,z.f)(eL)}];function eD({mode:e,onModeChange:s,size:i="sm"}){let a="touch"===i;return(0,t.jsx)(eA.f,{"aria-label":"View",value:e,onValueChange:e=>{eR.some(({mode:t})=>t===e)&&s(e)},"data-testid":a?"fleet-view-switch-touch":"fleet-view-switch",className:(0,A.f)("inline-flex shrink-0 gap-0.5 border border-border bg-muted p-0.5",a?"rounded-[10px]":"rounded-md"),children:eR.map(({mode:e,word:s,Icon:i})=>(0,t.jsxs)(eF.f.Root,{value:e,"aria-label":a?s:void 0,"data-testid":a?`fleet-view-${e}-touch`:`fleet-view-${e}`,className:(0,A.f)("inline-flex cursor-pointer items-center justify-center text-muted-foreground outline-none hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring data-checked:bg-card data-checked:text-foreground data-checked:shadow-sm",a?"h-9.5 w-10 rounded-lg [&_svg]:size-4.5":"h-6.5 gap-1.5 rounded-sm px-2.5 text-meta leading-none font-medium [&_svg]:size-3.5"),children:[(0,t.jsx)(i,{"aria-hidden":!0}),a?null:s]},e))})}var eU=e.i(980799);function eE({groups:e,picked:s,onPickedChange:i,trigger:a}){let l,r,[o,d]=(0,n.useState)(""),c=s.map(e=>e.valueId),u=(l=o.trim().toLowerCase(),r=e.flatMap(e=>e.keys),""===l?r:r.flatMap(e=>{if(e.key.toLowerCase().includes(l))return[e];let t=e.values.filter(e=>e.value.toLowerCase().includes(l));return 0===t.length?[]:[{...e,values:t}]}));return(0,t.jsxs)(e$.V,{onOpenChange:e=>{e||d("")},children:[(0,t.jsx)(e$.J,{render:a}),(0,t.jsxs)(e$.T,{align:"start",sideOffset:4,className:"flex max-h-(--available-height) w-58 flex-col p-1","data-testid":"fleet-filter-labels-popover",children:[(0,t.jsxs)("label",{className:"flex h-8.5 items-center gap-2 border-b border-border px-2 text-meta text-muted-foreground [&_svg]:size-(--size-icon-sm)",children:[(0,t.jsx)(ep.f,{"aria-hidden":!0}),(0,t.jsx)("input",{"aria-label":"Find a label",placeholder:"Find a label",value:o,onChange:e=>{d(e.target.value)},className:"min-w-0 flex-1 bg-transparent text-foreground outline-none placeholder:text-muted-foreground"})]}),(0,t.jsxs)("div",{className:"flex min-h-0 flex-col overflow-y-auto pt-1",children:[u.map(e=>(0,t.jsxs)("div",{role:"group","aria-label":e.key,className:"flex flex-col",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"px-2.5 pt-2 pb-1 text-caption text-muted-foreground",children:e.key}),e.values.map(({valueId:e,value:s,shipCount:a})=>{let n=c.includes(e);return(0,t.jsxs)("button",{type:"button","aria-pressed":n,className:(0,A.f)(eO,"relative"),onClick:()=>{i(n?c.filter(t=>t!==e):[...c,e])},children:[n?(0,t.jsx)(eM.f,{"aria-hidden":!0,className:"absolute left-2.5 size-(--size-icon)"}):null,(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-meta",children:s}),(0,t.jsx)("span",{className:"text-meta text-muted-foreground tabular-nums",children:a})]},e)})]},e.labelId)),0===u.length?(0,t.jsx)("p",{className:"px-2.5 py-2 text-meta text-muted-foreground",children:""===o.trim()?"No labels yet.":`No label matches “${o.trim()}”.`}):null]})]})]})}function e_({groups:e,picked:s,onPickedChange:i}){return(0,t.jsx)(eE,{groups:e,picked:s,onPickedChange:i,trigger:(0,t.jsxs)("button",{type:"button","data-testid":"fleet-filter-labels",className:eq,children:[(0,t.jsx)(eU.f,{"aria-hidden":!0}),(0,t.jsx)("span",{className:"font-medium",children:"Labels"}),0===s.length?null:(0,t.jsxs)("span",{className:"inline-flex size-5 items-center justify-center rounded-full bg-primary text-caption font-semibold text-primary-foreground tabular-nums",children:[s.length,(0,t.jsx)("span",{className:"sr-only",children:" picked"})]}),(0,t.jsx)(ez.f,{"aria-hidden":!0,className:"text-muted-foreground"})]})})}function eH({groups:e,picked:a,onPickedChange:n,onRemove:l,onClear:r}){return 0===a.length?null:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1.5 text-meta max-sm:hidden","data-testid":"fleet-picked-labels",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Ships with"}),a.map((e,s)=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-2",children:[0===s?null:(0,t.jsx)("span",{className:"text-muted-foreground",children:"and"}),(0,t.jsx)(ew.f,{chip:e,testId:"fleet-picked-label",onRemove:()=>{l(e.valueId)}})]},e.valueId)),(0,t.jsx)(eE,{groups:e,picked:a,onPickedChange:n,trigger:(0,t.jsx)(s.f,{variant:"ghost",size:"xs",icon:(0,t.jsx)(i.f,{}),children:"Add"})}),(0,t.jsx)("span",{"aria-hidden":!0,className:"h-4 w-px bg-border"}),(0,t.jsx)(s.f,{variant:"ghost",size:"xs",onClick:r,"data-testid":"fleet-labels-clear",children:"Clear labels"})]})}function eK(e){return Object.hasOwn(er,e)}function eQ({state:e,isToned:s=!0}){return(0,t.jsx)(eb.W,{state:e,className:s?void 0:"font-normal text-inherit"})}function eW({view:e,counts:s,shown:i,isUpdating:a}){if(a)return(0,t.jsxs)("span",{"aria-live":"polite","data-testid":"fleet-count",className:"inline-flex items-center gap-1.5 text-meta whitespace-nowrap text-muted-foreground",children:[(0,t.jsx)("i",{"aria-hidden":!0,className:"inline-block size-2.5 animate-spin rounded-full border-2 border-border border-t-muted-foreground motion-reduce:animate-none"}),"Updating"]});if(void 0===s||void 0===i)return null;let n=(0,em.v)(s.ships,{one:"ship",many:"ships"});return(0,t.jsx)("span",{"aria-live":"polite","data-testid":"fleet-count",className:"text-meta whitespace-nowrap text-muted-foreground tabular-nums",children:""!==e.query.trim()||ed(e.filters)>0?`${String(i)} of ${n}`:n})}function eB(e,t){return{...e,filters:{...e.filters,...t}}}function eJ(e,t){return eB(e,{labelValueIds:t})}function eX({view:e,onViewChange:s,isTouch:i}){return(0,t.jsx)(ey.e,{type:"search","aria-label":"Search ships by name",placeholder:i?"Search ships":"Search ships by name","data-testid":i?"fleet-search-touch":"fleet-search",value:e.query,onChange:t=>{s({...e,query:t.target.value})},leadingIcon:(0,t.jsx)(ep.f,{}),className:i?"h-(--size-control-touch) text-input-touch":"h-(--size-control) text-meta"})}function eG({view:e,onViewChange:i,labels:a}){let{filters:n}=e,l=void 0===a?[]:(0,eN.R)(n.labelValueIds,a);if(0===n.state.length&&0===n.type.length&&0===l.length)return null;let r=[{key:"state",words:0===n.state.length?null:`State: ${n.state.map(e=>er[e]).join(", ")}`,clear:{state:[]}},{key:"type",words:0===n.type.length?null:`Type: ${n.type.join(", ")}`,clear:{type:[]}}];return(0,t.jsxs)("div",{className:"flex flex-col items-start gap-1.5","data-testid":"fleet-filter-chips",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[r.map(({key:s,words:a,clear:n})=>null===a?null:(0,t.jsxs)("span",{className:"inline-flex h-7 max-w-full items-center gap-1.5 rounded-full bg-secondary pr-1.5 pl-2.5 text-meta text-foreground",children:[(0,t.jsx)("span",{className:"truncate",children:a}),(0,t.jsx)("button",{type:"button","aria-label":`Clear ${s}`,className:"inline-flex size-5 items-center justify-center rounded-full text-muted-foreground outline-none hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring [&_svg]:size-3.5",onClick:()=>{i(eB(e,n))},children:(0,t.jsx)(ev.X,{"aria-hidden":!0})})]},s)),l.map(s=>(0,t.jsx)(ew.f,{chip:s,onRemove:()=>{i(eJ(e,n.labelValueIds.filter(e=>e!==s.valueId)))}},s.valueId))]}),(0,t.jsx)(s.f,{variant:"ghost",size:"xs",onClick:()=>{i({...e,filters:eo.filters})},children:"Clear filters"})]})}function eY({view:e,onViewChange:i,types:a,labels:n,shown:l,isUpdating:r}){let{filters:o}=e,d=ed(o),c=void 0===n?[]:(0,eN.H)(n).flatMap(e=>e.keys.flatMap(e=>e.values.map(t=>({value:t.valueId,content:`${e.key}: ${t.value}`}))));return(0,t.jsxs)(ej.Sheet,{children:[(0,t.jsx)(ej.SheetTrigger,{render:(0,t.jsx)(s.f,{size:"touch",isIconOnly:!0,"aria-label":d>0?`Filter ships, ${String(d)} in force`:"Filter ships","data-testid":"fleet-filters-open",icon:(0,t.jsx)(eg,{}),className:d>0?"w-auto gap-2 px-3":void 0,children:d>0?(0,t.jsx)("span",{"aria-hidden":!0,className:"inline-flex size-5 items-center justify-center rounded-full bg-primary text-caption font-semibold text-primary-foreground tabular-nums",children:d}):null})}),(0,t.jsxs)(ej.SheetContent,{side:"bottom",children:[(0,t.jsx)(ej.SheetHeader,{children:(0,t.jsx)(ej.SheetTitle,{children:"Filters"})}),(0,t.jsxs)(ej.SheetBody,{className:"flex flex-col gap-4 pb-4",children:[(0,t.jsx)(ek,{label:"State",items:Object.keys(er).filter(eK).map(e=>({value:e,content:(0,t.jsx)(eQ,{state:e,isToned:!1})})),picked:o.state,onPickedChange:t=>{i(eB(e,{state:t.filter(eK)}))},testId:"fleet-filter-state-touch"}),0===a.length?null:(0,t.jsx)(ek,{label:"Type",items:a.map(({type:e})=>({value:e,content:e})),picked:o.type,onPickedChange:t=>{i(eB(e,{type:t}))},chipClassName:"font-mono text-meta",testId:"fleet-filter-type-touch"}),0===c.length?null:(0,t.jsx)(ek,{label:"Label",items:c,picked:o.labelValueIds,onPickedChange:t=>{i(eJ(e,c.filter(e=>t.includes(e.value)).map(e=>e.value)))},chipClassName:"font-mono text-meta",testId:"fleet-filter-labels-touch"}),(0,t.jsx)(ej.SheetClose,{render:(0,t.jsx)(s.f,{variant:"primary",size:"touch","data-testid":"fleet-filters-apply"}),children:r||void 0===l?"Show ships":`Show ${(0,em.v)(l,{one:"ship",many:"ships"})}`}),(0,t.jsx)(s.f,{size:"touch","data-testid":"fleet-filters-reset",onClick:()=>{i({...e,filters:eo.filters})},children:"Clear filters"})]})]})]})}function eZ({view:e,onViewChange:i,counts:a,types:n,labels:l,shown:r,isUpdating:o}){let{filters:d}=e,c=t=>{i({...e,mode:t})};return(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"fleet-bar",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3 max-sm:hidden",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2",children:[(0,t.jsx)("div",{className:"w-60",children:(0,t.jsx)(eX,{view:e,onViewChange:i,isTouch:!1})}),(0,t.jsx)(eI,{label:"State",items:er,picked:d.state,onPickedChange:t=>{i(eB(e,{state:t.filter(eK)}))},counts:a&&{total:a.ships,of:a},renderItem:e=>eK(e)?(0,t.jsx)(eQ,{state:e}):e,testId:"fleet-filter-state",className:"h-(--size-control)"}),(0,t.jsx)(eT,{types:n,total:a?.ships,picked:d.type,onPickedChange:t=>{i(eB(e,{type:t}))}}),void 0===l?null:(0,t.jsx)(e_,{groups:(0,eN.H)(l),picked:(0,eN.R)(d.labelValueIds,l),onPickedChange:t=>{i(eJ(e,t))}}),ed(d)>0||""!==e.query.trim()?(0,t.jsx)(s.f,{variant:"ghost",size:"xs",icon:(0,t.jsx)(ev.X,{}),"data-testid":"fleet-filters-clear",className:"text-muted-foreground",onClick:()=>{i({...e,query:"",filters:eo.filters})},children:"Clear filters"}):null]}),(0,t.jsxs)("div",{className:"flex h-(--size-control) shrink-0 items-center gap-3",children:[(0,t.jsx)(eW,{view:e,counts:a,shown:r,isUpdating:o}),(0,t.jsx)(eD,{mode:e.mode,onModeChange:c})]})]}),void 0===l?null:(0,t.jsx)(eH,{groups:(0,eN.H)(l),picked:(0,eN.R)(d.labelValueIds,l),onPickedChange:t=>{i(eJ(e,t))},onRemove:t=>{i(eJ(e,d.labelValueIds.filter(e=>e!==t)))},onClear:()=>{i(eJ(e,[]))}}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:hidden",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)(eX,{view:e,onViewChange:i,isTouch:!0})}),(0,t.jsx)(eY,{view:e,onViewChange:i,types:n,labels:l,shown:r,isUpdating:o}),(0,t.jsx)(eD,{mode:e.mode,onModeChange:c,size:"touch"})]}),(0,t.jsx)(eG,{view:e,onViewChange:i,labels:l})]})]})}(0,e.i(770703).default)(()=>e.A(867858).then(e=>e.LabelPicker),{loadableGenerated:{modules:[259068]},ssr:!1});var e0=e.i(772382),e1=e.i(831458),e2=e.i(869309),e5=e.i(418074),e4=e.i(578099),e3=e.i(895e3),e7=e.i(705918),e8=e.i(414732),e6=e.i(298421);function e9({chips:e,width:s,testId:i,href:a}){if(0===e.length)return null;let{shown:n,folded:l}=0===s?{shown:[],folded:e}:(0,eN.S)(e,s);return(0,t.jsxs)("span",{"data-testid":i,className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[n.map((e,s)=>(0,t.jsx)(ew.f,{chip:e,className:0===s?"min-w-0 shrink":void 0},e.valueId)),0===l.length?null:void 0===a?(0,t.jsxs)("span",{title:l.map(eN.$).join("; "),className:"inline-flex h-5.5 shrink-0 items-center rounded-sm bg-secondary px-1.5 text-caption font-medium text-foreground tabular-nums",children:["+",l.length,(0,t.jsx)("span",{className:"sr-only",children:" more labels"})]}):(0,t.jsxs)(H.default,{href:a,title:l.map(eN.$).join("; "),"aria-label":`View ${l.length} more labels`,className:"inline-flex h-5.5 shrink-0 items-center rounded-sm bg-secondary px-1.5 text-caption font-medium text-foreground tabular-nums hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",children:["+",l.length]})]})}var te=e.i(866616),tt=e.i(127361),ts=e.i(849635),ti=e.i(221980),ta=e.i(763481),tn=e.i(2093),tl=e.i(912407);function tr({model:e,now:s}){let i=(0,tn.U)(e,s);return(0,t.jsxs)(tl.Tooltip,{children:[(0,t.jsxs)(tl.TooltipTrigger,{render:(0,t.jsx)("span",{"data-testid":"fleet-model-hint",className:"min-w-10 truncate font-mono text-id text-muted-foreground"}),children:[e.id,(0,t.jsxs)("span",{className:"sr-only",children:[", ",i]})]}),(0,t.jsx)(tl.TooltipContent,{children:(0,t.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"font-mono",children:e.id}),(0,t.jsx)("span",{children:i})]})})]})}var to=e.i(781830),td=e.i(1935),tc=e.i(539448);function tu({ship:e}){return(0,t.jsx)(e7.f,{variant:"kind","data-testid":"fleet-type",children:e.type})}function th({ship:e,squadron:s,isPluginShip:i}){return"viewer"===e.kind?(0,t.jsxs)(e7.f,{variant:"kind","data-testid":"fleet-viewer",children:[(0,t.jsx)(e0.f,{"aria-hidden":!0}),"viewer"]}):"agent"!==e.kind?(0,t.jsx)(tu,{ship:e}):i?(0,t.jsxs)(e7.f,{variant:"kind","data-testid":"fleet-plugin",children:[(0,t.jsx)(e2.f,{"aria-hidden":!0}),"plugin"]}):(0,t.jsx)(tm,{squadron:s})}function tm({squadron:e}){return e?.role!==null?null:(0,t.jsxs)(e7.f,{variant:"kind","data-testid":"fleet-flagship",children:[(0,t.jsx)(e1.f,{"aria-hidden":!0}),"flagship"]})}function tf({seenAt:e,now:s,testId:i}){return null===e?null:(0,t.jsx)("time",{dateTime:e,title:(0,ts.V)(new Date(e),s),"data-testid":i,className:"text-meta whitespace-nowrap text-muted-foreground",children:(0,e4.f)(e,s)})}function tp({ship:e,now:s}){if("crewed"!==e.status||"viewer"===e.kind)return null;let i="operator"===e.kind?"console":e.harness,a="operator"===e.kind&&null!==e.location?"DEVICE":e.location?.kind,n=[null===i?"agent"===e.kind?"Harness unknown":null:(0,te.f)(i),void 0===a?null:(0,tt.f)(a),null===e.lastSeenAt?null:(0,e4.f)(e.lastSeenAt,s)].filter(e=>null!==e);return(0,t.jsx)("span",{"data-testid":"fleet-runs-on-line",className:"text-meta text-muted-foreground",children:n.join(" · ")})}function tx({ship:e,now:s}){return"crewed"!==e.status||"viewer"===e.kind?null:(0,t.jsxs)("span",{"data-testid":"fleet-runs-on",className:"flex min-w-0 items-center gap-2 overflow-hidden max-sm:flex-wrap max-sm:gap-y-1",children:[(0,t.jsx)(ta.f,{kind:"operator"===e.kind&&null!==e.location?"DEVICE":e.location?.kind??null,description:e.location?.description,harness:"operator"===e.kind?"console":e.harness,isHarnessUnknown:"agent"===e.kind&&null===e.harness,size:"sm",className:"shrink-0"}),"agent"===e.kind&&null!==e.model?(0,t.jsx)(tr,{model:e.model,now:s}):null]})}function tg({ship:e,squadron:s,labels:i}){let a=s?.role===null?void 0:s,n=void 0===i?[]:(0,eN.h)(e,i).filter(e=>void 0===a||("squadron"!==e.key||e.value!==a.squadronId)&&("squadron-role"!==e.key||e.value!==a.role));return void 0===a&&0===n.length?null:(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[void 0===a?null:(0,t.jsx)("span",{className:"min-w-0 shrink",title:null===a.role?a.squadronId:`${a.squadronId} \xb7 ${a.role}`,children:(0,t.jsx)(td.f,{squadronId:a.squadronId,size:"sm"})}),(0,t.jsx)(e9,{chips:n,width:22*(void 0===a),testId:"fleet-labels",href:`/ships/${e.id}`})]})}function tv({ship:e,now:s,viewerFleetId:i,next:a}){let n=("agent"===e.kind||"plugin"===e.kind||"trierarch"===e.kind)&&"crewed"===e.status;return(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2 max-sm:flex-col max-sm:items-stretch [&:has(button)>[data-testid=fleet-report]]:hidden",children:[n?(0,t.jsx)(to.f,{report:e.report,now:s,variant:"row",viewerFleetId:i,isTimeInTitle:!0,testId:"fleet-report"}):null,a]})}function tj({ship:e}){return(0,t.jsx)(tc.f,{name:e.name,shipId:e.id,isSuffixShown:"retired"===e.status,href:"operator"===e.kind?"/inbox":`/ships/${e.id}`,className:"[&_a]:max-sm:whitespace-normal [&_a]:max-sm:break-all [&_a]:max-sm:text-body-touch"})}let tb=[{key:"ship",width:"w-[18%]"},{key:"status",width:"w-[13%]"},{key:"report",width:"w-[20%]"},{key:"squadron-and-labels",width:"w-[15%]"},{key:"runs-on",width:"w-[25%]"},{key:"seen",width:"w-[9%]"},{key:"actions",width:"w-14"}],ty=[{key:"ship",column:"ship",head:"Ship"},{key:"status",column:"status",head:"Status"},{key:"report",column:"report",head:"Report"},{key:"squadronAndLabels",head:"Squadron and labels"},{key:"runsOn",column:"runsOn",head:"Runs on"},{key:"seen",column:"seen",head:"Seen"}];function tw({ships:e,highlightedShipIds:s,now:i,viewerFleetId:a,renderRowActions:n,squadronsOf:l,labels:r,pluginShipIds:o,sort:d,onSort:c,empty:u}){return(0,t.jsx)("div",{className:"max-sm:hidden",children:(0,t.jsxs)(e8.s,{"aria-label":"Ships",className:"w-full table-fixed",children:[(0,t.jsx)("colgroup",{children:tb.map(({key:e,width:s})=>(0,t.jsx)("col",{className:s},e))}),(0,t.jsx)(e8.E,{children:(0,t.jsxs)(e8.N,{children:[ty.map(({key:e,column:s,head:i})=>void 0===c||void 0===s?(0,t.jsx)(e8.U,{children:i},e):(0,t.jsx)(e8.b,{"data-testid":`fleet-sort-${s}`,direction:d?.column===s?d.direction:null,onSort:()=>{c(s)},children:i},e)),(0,t.jsx)(e8.U,{children:(0,t.jsx)("span",{className:"sr-only",children:"Actions"})})]})}),(0,t.jsxs)(e8.z,{children:[0===e.length&&void 0!==u?(0,t.jsx)(e8.N,{className:"hover:bg-transparent",children:(0,t.jsx)(e8.d,{colSpan:ty.length+1,className:"p-3 whitespace-normal",children:u})}):null,e.map(e=>(0,t.jsxs)(e8.N,{"data-testid":`fleet-row-${e.name}`,"data-new":s?.has(e.id)?"":void 0,children:[(0,t.jsx)(e8.d,{children:(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2 whitespace-nowrap",children:[(0,t.jsx)(tj,{ship:e}),(0,t.jsx)(th,{ship:e,squadron:l?.get(e.id),isPluginShip:o?.has(e.id)??!1})]})}),(0,t.jsx)(e8.d,{children:(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(eb.W,{state:e.status}),(0,t.jsx)(tN,{ship:e})]})}),(0,t.jsx)(e8.d,{children:(0,t.jsx)(tv,{ship:e,now:i,viewerFleetId:a,next:n?.(e,"next")})}),(0,t.jsx)(e8.d,{children:(0,t.jsx)(tg,{ship:e,squadron:l?.get(e.id),labels:r})}),(0,t.jsx)(e8.d,{children:(0,t.jsx)(tx,{ship:e,now:i})}),(0,t.jsx)(e8.d,{children:(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(tf,{seenAt:e.lastSeenAt,now:i,testId:"fleet-last-seen"}),(0,t.jsx)(ti.f,{activity:e.activity,now:i,variant:"row",testId:"fleet-activity"})]})}),(0,t.jsx)(e8.d,{className:"w-10 text-right",children:n?.(e,"table")})]},e.id))]})]})})}function tN({ship:e}){return 0===e.openAlertCount?null:(0,t.jsx)("span",{title:(0,em.v)(e.openAlertCount,{one:"open alert",many:"open alerts"}),"data-testid":"fleet-alert",children:(0,t.jsx)(eb.W,{state:"alert",isBadge:!0})})}function tk({ships:e,highlightedShipIds:s,now:i,viewerFleetId:a,renderRowActions:n,squadronsOf:l}){return(0,t.jsx)("ul",{"aria-label":"Ships",className:"overflow-hidden rounded-lg border border-border bg-card sm:hidden",children:e.map(e=>(0,t.jsxs)("li",{"data-testid":`fleet-card-${e.name}`,"data-new":s?.has(e.id)?"":void 0,className:"flex items-start gap-2 border-b border-border px-3.5 py-3 last:border-0 data-new:animate-highlight",children:[(0,t.jsxs)("div",{className:"flex min-w-0 grow flex-col gap-1.5",children:[(0,t.jsx)("div",{className:"text-body-touch",children:(0,t.jsx)(tj,{ship:e})}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(eb.W,{state:e.status}),(0,t.jsx)(tN,{ship:e}),"viewer"===e.kind?(0,t.jsx)(th,{ship:e,squadron:void 0,isPluginShip:!1}):(0,t.jsx)(tu,{ship:e}),(0,t.jsx)(tm,{squadron:"agent"===e.kind?l?.get(e.id):void 0})]}),(0,t.jsx)(tg,{ship:e,squadron:l?.get(e.id)}),(0,t.jsx)(tv,{ship:e,now:i,viewerFleetId:a,next:n?.(e,"next")}),(0,t.jsx)(tp,{ship:e,now:i})]}),n?.(e,"phone")]},e.id))})}function tC({ships:e,isOnlyArgo:s,more:i,sort:a,onSortChange:n,noMatch:l,isUpdating:r=!1,state:o,error:d,highlightedShipIds:c,now:u,viewerFleetId:h,renderRowActions:m,emptyAction:f,squadronsOf:p,labels:x,pluginShipIds:g}){if("loading"===o)return(0,t.jsxs)("div",{"data-slot":"fleet-table","data-state":"loading",className:"flex flex-col gap-3",children:[(0,t.jsx)(e5.f,{variant:"table",rows:6,label:"Loading the fleet",className:"max-sm:hidden"}),(0,t.jsx)(e5.f,{variant:"list",rows:5,label:"Loading the fleet",className:"sm:hidden"})]});if("error"===o)return(0,t.jsx)(e3.f,{variant:"page",title:"Couldn’t load the fleet",description:"This page couldn’t reach the fleet server. Check that the server is running and reachable from this browser, then try again.",detail:d?.detail,onRetry:d?.onRetry});let v={highlightedShipIds:c,now:u,viewerFleetId:h,renderRowActions:m,squadronsOf:p,pluginShipIds:g};if(s){let s=e.filter(e=>"operator"===e.kind);return(0,t.jsxs)("div",{"data-slot":"fleet-table","data-state":"empty",className:"flex flex-col gap-3",children:[(0,t.jsx)(tw,{ships:s,labels:x,...v}),(0,t.jsx)(tk,{ships:s,...v}),(0,t.jsx)(U.f,{icon:(0,t.jsx)(T.f,{}),title:"No ships besides argo yet",description:"argo is your own ship: messages to the operator land in its inbox. Commission a ship to add an agent to the fleet.",action:f})]})}return(0,t.jsxs)("div",{"data-slot":"fleet-table","data-state":"ready","aria-busy":r,className:(0,A.f)("flex flex-col gap-3 transition-opacity duration-(--duration-fast) motion-reduce:transition-none",r?"opacity-55":void 0),children:[(0,t.jsx)(tw,{ships:e,labels:x,sort:a,onSort:e=>{n(a?.column!==e?{column:e,direction:"ascending"}:"ascending"===a.direction?{column:e,direction:"descending"}:null)},empty:l,...v}),0===e.length?(0,t.jsx)("div",{className:"sm:hidden",children:l}):(0,t.jsx)(tk,{ships:e,...v}),i?.hasMore===!0?(0,t.jsx)(e6.f,{what:"more ships",isLoading:i.isLoading,isFailed:i.isFailed,onLoad:i.onLoad,area:"fleet"}):null]})}function tS(e){return e instanceof Error?e.message:void 0}function tI({view:e,onViewChange:s,placedFirstShipIds:i,renderRowActions:a,emptyAction:l}){var r,o,d;let u,h,m=(0,K.f)(),f=(0,W.f)(),p=(0,v.p)(),x=(0,c.e)(),g=(0,Q.f)(),j=(0,b.o)(),C="cards"===e.mode,S=function({query:e,filters:t}){let s=e.trim();return{...""===s?{}:{nameQuery:s},...0===t.state.length?{}:{state:[...t.state]},...0===t.type.length?{}:{type:[...t.type]},...0===t.labelValueIds.length?{}:{valueIds:[...t.labelValueIds]}}}(e),I=el(),M=function(e,t){let s,i=(0,w.I)(),a=(0,J.f)(i.fleet.harbour.infiniteQueryOptions({limit:N.F,filter:e},{enabled:t,getNextPageParam:X.J,placeholderData:k.y})),{hasNextPage:l,isFetching:r,isError:o,fetchNextPage:d}=a;(0,n.useEffect)(()=>{t&&l&&!r&&!o&&d()},[t,l,r,o,d]);let c=void 0===a.data||l?void 0:a.data.pages.flatMap(e=>e.items);return{groups:c&&(s=(0,X.H)(c),et.flatMap(e=>{let t=s.filter(t=>es[t.kind]===e);return 0===t.length?[]:[{kind:e,tiles:t.toSorted(ea)}]})),shown:c?.length,isUpdating:a.isPlaceholderData,isFailed:o,error:a.error,retry:()=>{a.refetch()}}}(S,C),z=(o=C?null:S,d=null===(r=e.sort)?void 0:{column:r.column,direction:r.direction},u=(0,w.I)(),h=(0,X.d)((0,J.f)(u.fleet.list.infiniteQueryOptions({...o,sort:d,limit:X.q},{enabled:null!==o,getNextPageParam:X.J,placeholderData:k.y,refetchInterval:c.L}))),null===o?{...h,items:[],hasMore:!1}:{...h,items:h.items&&(0,G.f)(h.items,o)}),$=function(e){let t=(0,w.I)(),s=(0,y.f)(t.fleet.shipCounts.queryOptions({filter:e??{}},{enabled:null!==e,placeholderData:k.y})),i=(0,y.f)(t.fleet.shipCounts.queryOptions());if(void 0===i.data)return{counts:void 0,isOnlyArgo:!1};let a=0===Y(i.data,e=>"operator"===e.kind?0:e.active);return null===e?{counts:Z({view:[],fleet:i.data},{}),isOnlyArgo:a}:{counts:void 0===s.data?void 0:Z({view:s.data,fleet:i.data},e),isOnlyArgo:a}}(C?null:S).counts,q=I.counts,O=void 0!==q&&q.ships<=1,A=C?M.isUpdating:z.isPlaceholder,F=C?I.isFailed||M.isFailed:z.isFailed,V=void 0!==q&&(C?void 0!==M.groups:void 0!==z.items),P=O||F||!V?null:(0,t.jsx)(eZ,{view:e,onViewChange:s,counts:q,types:j,labels:x,shown:C?M.shown:$?.shown,isUpdating:A}),L=(0,t.jsx)(ef,{query:e.query,hasFilters:ed(e.filters)>0,fleetShips:q?.ships,onClear:()=>{s({...eo,mode:e.mode,sort:e.sort})}}),R=O?(0,t.jsx)(U.f,{icon:(0,t.jsx)(T.f,{}),title:"No ships besides argo yet",description:"argo is your own ship: messages to the operator land in its inbox. Commission a ship to add an agent to the fleet.",action:l}):null;return C?(0,t.jsxs)("section",{"aria-label":"Fleet",className:"flex flex-col gap-3.5","data-testid":"fleet-overview","data-view":"cards",children:[(0,t.jsx)(E.Harbour,{counts:q,groups:M.groups,now:m,hrefOf:e=>`/ships/${e}`,link:({href:e,...s})=>(0,t.jsx)(H.default,{...s,href:e??"/"}),between:P,empty:L,state:F?"error":V?"ready":"loading",errorDetail:tS(M.error??I.error),onRetry:()=>{I.retry(),M.retry()},isUpdating:A}),R]}):(0,t.jsxs)("section",{"aria-label":"Fleet",className:"flex flex-col gap-3.5","data-testid":"fleet-overview","data-view":"list",children:[(0,t.jsx)(_.f,{counts:q}),P,(0,t.jsx)(tC,{ships:z.items??[],isOnlyArgo:O,more:{hasMore:z.hasMore,isLoading:z.isLoadingMore,isFailed:z.isLoadMoreFailed,onLoad:z.loadMore},sort:e.sort,onSortChange:t=>{s({...e,sort:t})},noMatch:L,isUpdating:A,state:z.isFailed?"error":void 0===z.items?"loading":"ready",error:{detail:tS(z.error),onRetry:z.retry},highlightedShipIds:i,now:m,viewerFleetId:f,renderRowActions:a,emptyAction:l,squadronsOf:p.data?(0,B.R)(p.data):void 0,labels:x,pluginShipIds:g})]})}var tM=e.i(278888),tz=e.i(483069),t$=e.i(758925);function tq({title:e,description:s}){return(0,t.jsxs)("div",{role:"status","data-testid":"overview-key-not-reachable",className:"flex gap-2 rounded-lg border border-tone-attention-border bg-tone-attention-bg p-3 text-tone-attention-fg",children:[(0,t.jsx)(t$.f,{"aria-hidden":!0,className:"mt-0.5 size-(--size-icon) shrink-0"}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("p",{className:"text-body font-medium",children:e}),(0,t.jsx)("p",{className:"text-meta text-foreground",children:s}),(0,t.jsx)(H.default,{href:"/sealing",className:"self-start text-meta font-medium text-tone-attention-fg underline underline-offset-2","data-testid":"overview-key-not-reachable-view",children:"View sealing"})]})]})}function tO(){let e=(0,K.f)(),s=function(e,t){if(void 0===e||"none"===e.state||e.keyAvailability.isAvailable)return;let{reason:s,since:i}=e.keyAvailability;return{title:"Company key not reachable",description:`Since ${(0,ts.l)(new Date(i),t)} your KMS answers: ${(0,tz.M)(s)}. Sends and receives in this fleet are refused until it is reachable again. Nothing waiting is lost.`}}((0,tM.f)().data,e);return void 0===s?null:(0,t.jsx)(tq,{...s})}var tT=e.i(221959),tA=e.i(566297),tF=e.i(577435),tV=e.i(509892),tP=e.i(787964),tL=e.i(762687),tR=e.i(386247),tD=e.i(806537),tU=e.i(646013);function tE({canDefineLabels:e,canDefineScopes:i,sealing:a,commission:n}){return(0,t.jsxs)("div",{className:"flex items-center gap-2 max-sm:justify-end",children:[(0,t.jsxs)(tU.DropdownMenu,{children:[(0,t.jsx)(tU.DropdownMenuTrigger,{render:(0,t.jsx)(s.f,{isIconOnly:!0,"aria-label":"More actions",icon:(0,t.jsx)(tR.f,{}),"data-testid":"overview-more"})}),(0,t.jsxs)(tU.DropdownMenuContent,{align:"end",children:[(0,t.jsxs)(tU.DropdownMenuItem,{render:(0,t.jsx)(H.default,{href:"/labels"}),"data-testid":"overview-labels",children:[(0,t.jsx)(eU.f,{"aria-hidden":!0}),e?"Manage labels":"View labels"]}),(0,t.jsxs)(tU.DropdownMenuItem,{render:(0,t.jsx)(H.default,{href:"/scopes"}),"data-testid":"overview-scopes",children:[(0,t.jsx)(t$.f,{"aria-hidden":!0}),i?"Manage scopes":"View scopes"]}),"off"===a?null:(0,t.jsxs)(tU.DropdownMenuItem,{render:(0,t.jsx)(H.default,{href:"/sealing"}),"data-testid":"overview-sealing",children:[(0,t.jsx)(tD.f,{"aria-hidden":!0}),"manage"===a?"Manage sealing":"View sealing"]})]})]}),n]})}var t_=e.i(718423),tH=e.i(678485),tK=e.i(303979);e.s(["OverviewPage",0,function({view:e,isCommissionAsked:r}){var o;let d=(0,a.useRouter)(),c=el(),u=(0,t_.f)(),h=(0,tP.y)(),m=(0,x.W)((0,f.f)().data),g=(0,p.b)(),v=(0,M.Q)(),j=(0,M.t)("sealing"),b=(0,tK.f)(),[y,w]=(0,n.useState)(!1),[N,k]=(0,n.useOptimistic)(e);(0,tH.n)([c.error,u.error]);let C=e=>{let t=(function(e){let t=new URLSearchParams;for(let[s,i]of("list"===e.mode&&t.set("view","list"),""!==e.query&&t.set("q",e.query),[["state",e.filters.state],["type",e.filters.type],["label",e.filters.labelValueIds]]))for(let e of i)t.append(s,e);return null!==e.sort&&(t.set("sort",e.sort.column),"descending"===e.sort.direction&&t.set("order","desc")),t})(e).toString();(0,n.startTransition)(()=>{k(e),d.replace(""===t?"/":`/?${t}`,{scroll:!1})})};return(0,t.jsxs)(tV.f,{...h,title:"Fleet overview",phoneTitle:"Fleet",description:c.counts?function(e,{canCommission:t}){if(e.ships<=1)return t?"Only argo so far. Ships you commission appear here.":"Only argo so far.";let s=en.filter(({state:t})=>e[t]>0).map(({state:t,words:s})=>`${String(e[t])} ${s}`);return`${String(e.ships)} ships: ${s.join(", ")}`}(c.counts,{canCommission:v.canManage}):void 0,isActionInTitleRow:!0,primaryAction:(0,t.jsx)(tE,{canDefineLabels:v.canDefineLabels,canDefineScopes:v.canDefineScopes,sealing:(o={isSealingOn:j,canChangeKeys:v.canChangeKeys}).isSealingOn?o.canChangeKeys?"manage":"view":"off",commission:v.canManage?(0,t.jsx)(I,{isOpen:y||r,onOpenChange:t=>{w(t),!t&&r&&C(e)}}):null}),live:u.live,children:[(0,t.jsx)(tL.f,{active:"ships",needsCrewCount:b.needsCrewCount}),void 0===m?null:(0,t.jsx)(tF.f,{...(0,x.Q)(m),accountUrl:g,testId:"overview-message-limit"}),(0,t.jsx)(tO,{}),(0,t.jsx)(D,{}),(0,t.jsx)(tI,{view:N,onViewChange:C,placedFirstShipIds:u.placedFirstShipIds,emptyAction:v.canManage?(0,t.jsx)(s.f,{variant:"primary",icon:(0,t.jsx)(i.f,{}),"data-testid":"overview-commission-first",onClick:()=>{w(!0)},children:"Commission your first ship"}):null,renderRowActions:(e,s)=>(0,t.jsx)(tT.f,{ship:e,layout:"table"===s?"menu":"phone"===s?"sheet":"next",compose:l.f,crewLineFlow:tA.R})})]})}],242047)}]);
|