@hivemagnus/magnus-ui 1.0.2 → 1.0.3
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/dist/app/apps/dashboard/.next/BUILD_ID +1 -1
- package/dist/app/apps/dashboard/.next/build-manifest.json +3 -3
- package/dist/app/apps/dashboard/.next/prerender-manifest.json +3 -3
- package/dist/app/apps/dashboard/.next/required-server-files.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.html +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api-docs/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api-docs/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/application-operations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/application-operations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/audit/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/installations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/installations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/commands/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/commands/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/cron/page/server-reference-manifest.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/cron/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/cron/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/files/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/files/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-map/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-map/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/governor/operations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/governor/operations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-security/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-security/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/incidents/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/incidents/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/library/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/library/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/login/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/logs/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/logs/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/mission-control/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/mission-control/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/notifications/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/notifications/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/retention/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/retention/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/roles/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/roles/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/rollouts/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/rollouts/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/skills/page/server-reference-manifest.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/skills/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0z6dblsnzx20l._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__10vlrswrzvf4x._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__1cnr5ucuq-tas._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_0gs_s688kgg1i._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_cron_page_tsx_1i3duyygc0_tg._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_skills_page_tsx_0n5zp4xad38in._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_refresh-ccw-dot_1bka5q1p8_fx4.js +1 -1
- package/dist/app/apps/dashboard/.next/server/middleware-build-manifest.js +3 -3
- package/dist/app/apps/dashboard/.next/server/pages/500.html +1 -1
- package/dist/app/apps/dashboard/.next/server/preview-props.json +3 -3
- package/dist/app/apps/dashboard/.next/server/server-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/server-reference-manifest.json +3 -3
- package/dist/app/apps/dashboard/.next/static/chunks/{28q140y6b7-89.js → 15k-qmnbw3cjb.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{07pjhg_to7dzv.js → 1tnd5uxb6jeaw.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{36hoxd3zs7thr.js → 2d4ylz_vuib6b.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{2zfns6xyegode.js → 2zsyn-x33zktn.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{0akep08qly94l.js → 3snkyozidkred.js} +1 -1
- package/dist/app/apps/dashboard/package.json +2 -2
- package/dist/app/apps/dashboard/server.js +1 -1
- package/package.json +2 -2
- /package/dist/app/apps/dashboard/.next/static/{UZn0mscl5hk5YJtZnvSnK → BZlZSgkcAsB8gK9YHwg8e}/_buildManifest.js +0 -0
- /package/dist/app/apps/dashboard/.next/static/{UZn0mscl5hk5YJtZnvSnK → BZlZSgkcAsB8gK9YHwg8e}/_clientMiddlewareManifest.js +0 -0
- /package/dist/app/apps/dashboard/.next/static/{UZn0mscl5hk5YJtZnvSnK → BZlZSgkcAsB8gK9YHwg8e}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,57108,e=>{var r=e.i(43476),t=e.i(46670);e.s(["f",0,function({configuration:e}){if(e?.memoryProvider!=="hivemem")return null;let a=e.hiveMemToken,s=a?.status??"unknown";return(0,r.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5",children:[(0,r.jsxs)(t.t,{variant:"valid"===s?"success":"expiring"===s||"unreachable"===s||"unknown"===s?"warning":"danger",children:["Token ",s]}),a?.expiresAt&&(0,r.jsxs)("time",{dateTime:a.expiresAt,title:"HiveMem token expiration",children:["expires ",new Date(a.expiresAt).toLocaleString()]}),a?.checkedAt&&(0,r.jsxs)("time",{dateTime:a.checkedAt,className:"text-text-muted/70",title:"Last HiveMem authentication check",children:["checked ",new Date(a.checkedAt).toLocaleString()]})]})}])},46670,e=>{var r=e.i(43476),t=e.i(78571);let a={default:"border-border text-text-muted",success:"border-success/40 text-success bg-success/5 shadow-[0_0_6px_rgba(0,255,65,0.15)]",warning:"border-warning/40 text-warning bg-warning/5 shadow-[0_0_6px_rgba(255,179,0,0.15)]",danger:"border-danger/40 text-danger bg-danger/5 shadow-[0_0_6px_rgba(255,23,68,0.15)]",info:"border-info/40 text-info bg-info/5 shadow-[0_0_6px_rgba(0,176,255,0.15)]"},s={default:"bg-text-muted",success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info"};e.s(["t",0,function({children:e,variant:n="default",className:l,dot:i=!1,pulse:o=!1}){return(0,r.jsxs)("span",{className:(0,t.f)("inline-flex items-center gap-1.5 rounded-chip border px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider",a[n],l),children:[i&&(0,r.jsxs)("span",{"aria-hidden":"true",className:"relative inline-flex h-1.5 w-1.5",children:[o&&(0,r.jsx)("span",{className:(0,t.f)("absolute inset-0 rounded-full animate-halo",s[n])}),(0,r.jsx)("span",{className:(0,t.f)("relative inline-flex h-1.5 w-1.5 rounded-full",s[n])})]}),e]})},"k",0,function(e){switch(e.toUpperCase()){case"ONLINE":case"COMPLETED":case"ACTIVE":case"RUNNING":case"INSTALLED":case"HEALTHY":return"success";case"DEGRADED":case"PAUSED":case"QUEUED":case"PENDING":case"INSTALLING":return"warning";case"OFFLINE":case"FAILED":case"ERROR":case"TIMEOUT":case"CANCELLED":case"DECOMMISSIONED":case"CRITICAL":return"danger";case"PROVISIONING":case"UPDATING":return"info";default:return"default"}}])},93999,51196,55427,e=>{var r=e.i(43476);let t=(0,e.i(75254).f)("ArrowDownRight",[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]);var a=e.i(15057),s=e.i(78571),n=e.i(3062),l=e.i(35084);let i={warning:"shadow-[0_0_6px_var(--color-warning)]",danger:"shadow-[0_0_8px_var(--color-danger)]",accent:"shadow-[0_0_6px_var(--color-accent)]",primary:"shadow-[0_0_6px_var(--color-primary)]"},o={xs:"h-1",sm:"h-1.5",md:"h-2"};function c({value:e,max:t=100,tone:a,thresholds:n=l.q,label:d,size:u="xs",showValue:x=!1,valueLabel:h,glow:f,className:m,testId:p}){let g="number"==typeof e&&Number.isFinite(e),v=g?Math.max(0,Math.min(100,e/(t||1)*100)):0,b=a??(g?(0,l.Z)(v,n):"muted"),j=f||!a&&g&&v>=n.warn,y=h??(g?`${v.toFixed(+(v<10&&v>0))}%`:"—");return(0,r.jsxs)("div",{className:(0,s.f)("flex min-w-0 items-center gap-2",m),"data-testid":p,children:[(0,r.jsx)("div",{role:"meter","aria-label":d,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":g?e:void 0,"aria-valuetext":y,className:(0,s.f)("relative flex-1 overflow-hidden rounded-full bg-border/70",o[u]),children:(0,r.jsx)("div",{style:{"--meter":`${v}%`},className:(0,s.f)("h-full w-(--meter) rounded-full transition-[width] duration-700 ease-out-expo starting:w-0",l.H[b],j&&i[b])})}),x&&(0,r.jsx)("span",{className:(0,s.f)("num w-11 shrink-0 text-right text-[11px]",g?l.T[b]:"text-text-muted"),children:y})]})}e.s(["f",0,c],51196);var d=e.i(71645);function u({values:e,tone:t="primary",width:a=160,height:n=32,area:i=!0,max:o,percent:c=!1,threshold:x,live:h=!0,emptyLabel:f="not enough data",className:m,testId:p,label:g,stretch:v=!1}){let b=`spark${(0,d.useId)().replace(/:/g,"")}`;if(e.length<2)return(0,r.jsx)("div",{className:(0,s.f)("flex h-8 items-center text-xs italic text-text-muted",m),"data-testid":p,children:f});let j=l.v[t],y=o??(c?Math.max(100,...e):Math.max(...e,x??0)||1),N=n-4,w=a/(e.length-1),k=e=>2+N-Math.max(0,e)/y*N,_=e.map((e,r)=>[r*w,k(e)]),M=_.map(([e,r])=>`${e.toFixed(1)},${r.toFixed(1)}`).join(" "),S=_[_.length-1];return(0,r.jsxs)("svg",{width:v?"100%":a,height:n,viewBox:`0 0 ${a} ${n}`,preserveAspectRatio:v?"none":void 0,className:(0,s.f)("block overflow-visible",m),"data-testid":p,role:g?"img":void 0,"aria-label":g,"aria-hidden":!g||void 0,children:[i&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("defs",{children:(0,r.jsxs)("linearGradient",{id:b,x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,r.jsx)("stop",{offset:"0%",stopColor:j,stopOpacity:.35}),(0,r.jsx)("stop",{offset:"100%",stopColor:j,stopOpacity:0})]})}),(0,r.jsx)("polygon",{points:`0,${n} ${M} ${a},${n}`,fill:`url(#${b})`})]}),void 0!==x&&(0,r.jsx)("line",{x1:0,x2:a,y1:k(x),y2:k(x),stroke:"var(--color-warning)",strokeOpacity:.5,strokeDasharray:"3 3",strokeWidth:1}),(0,r.jsx)("polyline",{fill:"none",stroke:j,strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round",points:M}),h&&!v&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("circle",{cx:S[0],cy:S[1],r:2.5,fill:j,className:"origin-center animate-halo [transform-box:fill-box]"}),(0,r.jsx)("circle",{cx:S[0],cy:S[1],r:2,fill:j})]})]})}e.s(["f",0,u],55427),e.s(["N",0,function({title:e,description:t,children:a,className:s,action:l,tone:i,corners:o=!1,...c}){return(0,r.jsx)(n.f,{...c,tone:i,corners:o,title:e,description:t,action:l,className:s,children:a})},"n",0,function({label:e,value:i,icon:o,trend:d,spark:x,meter:h,delta:f,tone:m="primary",className:p,testId:g}){let v=!f||f.value>=0===(f.positiveIsGood??!0);return(0,r.jsxs)(n.f,{tone:m,className:(0,s.f)("overflow-hidden",p),testId:g,children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-[0.15em] text-text-muted",children:e}),o&&(0,r.jsx)("span",{className:"text-primary/60",children:o})]}),(0,r.jsxs)("div",{className:"mt-2 flex items-end justify-between gap-2",children:[(0,r.jsx)("div",{className:(0,s.f)("num text-2xl font-bold","primary"===m?"text-primary neon-text":l.T[m]),children:i}),f&&0!==f.value&&(0,r.jsxs)("span",{className:(0,s.f)("num mb-1 inline-flex items-center gap-0.5 text-[11px]",v?"text-success":"text-danger"),children:[f.value>0?(0,r.jsx)(a.f,{className:"h-3 w-3"}):(0,r.jsx)(t,{className:"h-3 w-3"}),Math.abs(f.value).toFixed(+!Number.isInteger(f.value)),f.unit]})]}),d&&(0,r.jsx)("div",{className:(0,s.f)("mt-1 text-[11px]",d.positive?"text-success":"text-danger"),children:d.value}),void 0!==h&&(0,r.jsx)(c,{value:h,className:"mt-3",label:e}),x&&x.length>1&&(0,r.jsx)("div",{className:"-mx-5 -mb-5 mt-3 opacity-80",children:(0,r.jsx)(u,{values:x,tone:m,width:240,height:28,stretch:!0,live:!1})})]})}],93999)},54149,21176,e=>{var r=e.i(43476),t=e.i(71645),a=e.i(78571),s=e.i(35084);e.s(["f",0,function({value:e,max:n=100,label:l,sublabel:i,tone:o,thresholds:c=s.q,higherIsBetter:d=!1,size:u=140,display:x,ticks:h=!0,hideLabel:f=!1,className:m,testId:p}){let g=(0,t.useId)().replace(/:/g,""),v="number"==typeof e&&Number.isFinite(e),b=v?Math.max(0,Math.min(100,e/(n||1)*100)):0,j=o??(v?d?(0,s.Z)(100-b,c):(0,s.Z)(b,c):"muted"),y=Math.max(4,Math.round(u/16)),N=50-y/2-4,w=2*Math.PI*N,k=.75*w,_=k*b/100,M=u>=140,S=x??(v?`${Math.round(b)}%`:"—"),C=h?Array.from({length:11},(e,t)=>{let a=(135+270*t/10)*Math.PI/180,s=50-(t%5==0?4:2.5);return(0,r.jsx)("line",{x1:50+48.5*Math.cos(a),y1:50+48.5*Math.sin(a),x2:50+s*Math.cos(a),y2:50+s*Math.sin(a),stroke:"var(--color-border-strong)",strokeWidth:.8},t)}):null;return(0,r.jsxs)("div",{role:"img","aria-label":`${l}: ${S}`,"data-testid":p,className:(0,a.f)("relative inline-flex flex-col items-center",m),style:{width:u},children:[(0,r.jsxs)("svg",{viewBox:"0 0 100 100",width:u,height:u,"aria-hidden":"true",className:"overflow-visible",children:[M&&(0,r.jsx)("defs",{children:(0,r.jsxs)("filter",{id:`g${g}`,x:"-30%",y:"-30%",width:"160%",height:"160%",children:[(0,r.jsx)("feGaussianBlur",{stdDeviation:"2.2",result:"blur"}),(0,r.jsxs)("feMerge",{children:[(0,r.jsx)("feMergeNode",{in:"blur"}),(0,r.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})}),C,(0,r.jsx)("circle",{cx:50,cy:50,r:N,fill:"none",stroke:"var(--color-border)",strokeWidth:y,strokeLinecap:"round",strokeDasharray:`${k} ${w}`,transform:"rotate(135 50 50)"}),(0,r.jsx)("circle",{cx:50,cy:50,r:N,fill:"none",stroke:s.v[j],strokeWidth:y,strokeLinecap:"round",transform:"rotate(135 50 50)",filter:M?`url(#g${g})`:void 0,style:{"--dash":`${_} ${w}`},className:"[stroke-dasharray:var(--dash)] transition-[stroke-dasharray] duration-1000 ease-out-expo starting:[stroke-dasharray:0_1000]"})]}),(0,r.jsxs)("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center",style:{height:u},children:[(0,r.jsx)("span",{className:(0,a.f)("num font-bold leading-none",s.T[j],M&&s.z[j]),style:{fontSize:Math.max(12,.2*u)},children:S}),i&&(0,r.jsx)("span",{className:"num mt-1 text-text-muted",style:{fontSize:Math.max(9,.075*u)},children:i})]}),!f&&(0,r.jsx)("span",{className:"-mt-[10%] text-center text-[10px] font-medium uppercase tracking-[0.15em] text-text-muted",children:l})]})}],54149);var n=e.i(70703),l=e.i(65369);let i=(0,n.default)(()=>e.A(1321),{loadableGenerated:{modules:[69944]},ssr:!1,loading:()=>(0,r.jsx)(l.l,{className:"h-[180px] w-full"})});e.s(["f",0,i],21176)},3062,e=>{var r=e.i(43476),t=e.i(78571),a=e.i(35084);let s={primary:"[--panel-corner-color:color-mix(in_srgb,var(--color-primary)_60%,transparent)]",accent:"[--panel-corner-color:color-mix(in_srgb,var(--color-accent)_70%,transparent)]",success:"[--panel-corner-color:color-mix(in_srgb,var(--color-success)_60%,transparent)]",warning:"[--panel-corner-color:color-mix(in_srgb,var(--color-warning)_70%,transparent)]",danger:"[--panel-corner-color:color-mix(in_srgb,var(--color-danger)_70%,transparent)]",info:"[--panel-corner-color:color-mix(in_srgb,var(--color-info)_60%,transparent)]",muted:"[--panel-corner-color:var(--color-border-strong)]"},n={primary:"[--glow-hover-color:var(--color-glow)]",accent:"[--glow-hover-color:var(--color-glow-accent)]",success:"[--glow-hover-color:var(--color-glow-success)]",warning:"[--glow-hover-color:var(--color-glow-warning)]",danger:"[--glow-hover-color:var(--color-glow-danger)]",info:"[--glow-hover-color:var(--color-glow)]",muted:"[--glow-hover-color:var(--color-glow)]"},l={primary:"hover:border-primary/30",accent:"hover:border-accent/40",success:"hover:border-success/30",warning:"hover:border-warning/40",danger:"hover:border-danger/40",info:"hover:border-info/30",muted:"hover:border-border-strong"},i={none:"",sm:"p-3",md:"p-5",lg:"p-6"};e.s(["f",0,function({tone:e="primary",corners:o=!0,interactive:c=!0,hero:d=!1,title:u,description:x,icon:h,action:f,as:m="div",padding:p="md",testId:g,className:v,children:b,...j}){return(0,r.jsxs)(m,{...j,"data-testid":g??j["data-testid"],className:(0,t.f)("relative rounded-panel border border-border bg-surface transition-colors duration-300",i[p],o&&"panel-corners",o&&s[e],c&&"glow-hover",c&&n[e],c&&l[e],d&&"grid-bg overflow-hidden bg-surface/80",v),children:[(u||f||h)&&(0,r.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[h&&(0,r.jsx)("span",{className:(0,t.f)("mt-0.5 shrink-0",a.T[e]),children:h}),(0,r.jsxs)("div",{className:"min-w-0",children:[u&&(0,r.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider",children:u}),x&&(0,r.jsx)("p",{className:"mt-0.5 text-[11px] text-text-muted",children:x})]})]}),f]}),b]})}])},65369,e=>{var r=e.i(43476),t=e.i(78571);function a({className:e}){return(0,r.jsx)("div",{"aria-hidden":"true",className:(0,t.f)("skeleton h-3 w-full",e)})}e.s(["l",0,a,"g",0,function({count:e=4,className:s}){return(0,r.jsx)("div",{role:"status","aria-label":"Loading",className:(0,t.f)("grid gap-4 sm:grid-cols-2 lg:grid-cols-4",s),children:Array.from({length:e},(e,t)=>(0,r.jsxs)("div",{className:"panel-corners rounded-panel border border-border bg-surface p-5",children:[(0,r.jsx)(a,{className:"h-2 w-1/2"}),(0,r.jsx)(a,{className:"mt-4 h-7 w-2/3"}),(0,r.jsx)(a,{className:"mt-3 h-1 w-full opacity-60"})]},t))})},"F",0,function({rows:e=5,cols:s=4,className:n}){return(0,r.jsxs)("div",{role:"status","aria-label":"Loading",className:(0,t.f)("overflow-hidden rounded-panel border border-border",n),children:[(0,r.jsx)("div",{className:"flex gap-4 border-b border-border bg-surface px-4 py-3",children:Array.from({length:s},(e,t)=>(0,r.jsx)(a,{className:"h-2 flex-1 opacity-60"},t))}),Array.from({length:e},(e,n)=>(0,r.jsx)("div",{className:"flex gap-4 border-b border-border/50 px-4 py-3 last:border-0",children:Array.from({length:s},(e,s)=>(0,r.jsx)(a,{className:(0,t.f)("h-3 flex-1",(n+s)%3==0&&"max-w-[60%]")},s))},n))]})},"Q",0,function({lines:e=3,className:s}){let n=["w-full","w-11/12","w-4/5","w-2/3","w-3/4"];return(0,r.jsx)("div",{role:"status","aria-label":"Loading",className:(0,t.f)("space-y-2",s),children:Array.from({length:e},(e,t)=>(0,r.jsx)(a,{className:n[t%n.length]},t))})}])},75723,e=>{var r=e.i(43476),t=e.i(78571),a=e.i(46670);let s={success:"bg-success shadow-[0_0_6px_var(--color-success)]",warning:"bg-warning shadow-[0_0_6px_var(--color-warning)]",danger:"bg-danger shadow-[0_0_6px_var(--color-danger)]",info:"bg-info shadow-[0_0_6px_var(--color-info)]",default:"bg-text-muted"},n={success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info",default:"bg-text-muted"},l=new Set(["ONLINE","RUNNING","ACTIVE","HEALTHY","CRITICAL","UPDATING","PROVISIONING"]);e.s(["f",0,function({status:e,pulse:i,size:o="sm",className:c,label:d}){let u=(0,a.k)(e),x=i??l.has(e.toUpperCase()),h="xs"===o?"h-1.5 w-1.5":"h-2 w-2";return(0,r.jsxs)("span",{className:(0,t.f)("relative inline-flex shrink-0",h,c),role:d?"img":void 0,"aria-label":d,"aria-hidden":!d||void 0,children:[x&&(0,r.jsx)("span",{className:(0,t.f)("absolute inset-0 rounded-full animate-halo",n[u])}),(0,r.jsx)("span",{className:(0,t.f)("relative inline-flex rounded-full",h,s[u])})]})}])},71417,e=>{e.s(["L",0,function(e){if(0===e)return"0 B";let r=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,r)).toFixed(1))} ${["B","KB","MB","GB","TB"][r]}`},"C",0,function(e){return e?("string"==typeof e?new Date(e):e).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}])},21218,e=>{let r=(0,e.i(75254).f)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);e.s(["f",0,r],21218)},71689,e=>{let r=(0,e.i(75254).f)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["f",0,r],71689)},15057,e=>{let r=(0,e.i(75254).f)("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);e.s(["f",0,r],15057)},78917,e=>{let r=(0,e.i(75254).f)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["f",0,r],78917)},81203,e=>{let r=(0,e.i(75254).f)("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);e.s(["f",0,r],81203)},12181,14098,e=>{let r=(0,e.i(75254).f)("RefreshCcwDot",[["path",{d:"M3 2v6h6",key:"18ldww"}],["path",{d:"M21 12A9 9 0 0 0 6 5.3L3 8",key:"1pbrqz"}],["path",{d:"M21 22v-6h-6",key:"usdfbe"}],["path",{d:"M3 12a9 9 0 0 0 15 6.7l3-2.7",key:"1hosoe"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);e.s(["f",0,r],12181);var t=e.i(43476),a=e.i(71645),s=e.i(68759),n=e.i(32568),l=e.i(82983),i=e.i(18393),o=e.i(31278);e.s(["E",0,function({open:e,node:r,onClose:c,onSaved:d}){let[u,x]=(0,a.useState)([]),[h,f]=(0,a.useState)(""),[m,p]=(0,a.useState)(!0),[g,v]=(0,a.useState)(!1),[b,j]=(0,a.useState)(""),[y,N]=(0,a.useState)(!1);(0,a.useEffect)(()=>{e&&(j(""),f(r?.role?.id??""),p(!0),N(!0),(async()=>{try{let e=await l.f.roles.list();x(e.data??[])}catch{j("Failed to load roles")}finally{N(!1)}})())},[e,r?.role?.id]);let w=async()=>{if(r){v(!0),j("");try{let e=r.role?.id;e&&e!==h&&await l.f.roles.unassign(e,{nodeIds:[r.id]}),h&&await l.f.roles.assign(h,{nodeIds:[r.id],defer:!m});let t=h?u.find(e=>e.id===h)??null:null;d(t),c()}catch(e){j(e instanceof Error?e.message:"Failed to assign role")}finally{v(!1)}}},k=async()=>{if(r?.role){v(!0),j("");try{await l.f.roles.unassign(r.role.id,{nodeIds:[r.id]}),d(null),c()}catch(e){j(e instanceof Error?e.message:"Failed to unassign role")}finally{v(!1)}}},_=()=>{j(""),v(!1),c()};return(0,t.jsx)(n.n,{open:e,onClose:_,title:r?.role?"Change Role":"Assign Role",description:r?`Node: ${r.name}`:"",icon:(0,t.jsx)(i.f,{className:"h-5 w-5 text-primary"}),children:(0,t.jsxs)("div",{className:"space-y-4",children:[y?(0,t.jsxs)("div",{className:"flex items-center gap-2 py-4 text-xs text-text-muted",children:[(0,t.jsx)(o.f,{className:"h-4 w-4 animate-spin"}),"Loading roles…"]}):0===u.length?(0,t.jsx)("p",{className:"text-xs text-text-muted py-4",children:"No roles found. Create a role first on the Roles page."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.G,{label:"Role",children:(0,t.jsxs)("select",{value:h,onChange:e=>f(e.target.value),className:n.N,children:[(0,t.jsx)("option",{value:"",children:"— No role —"}),u.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})}),h&&(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:m,onChange:e=>p(e.target.checked),className:"rounded border-border"}),"Apply role immediately"]})]}),b&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:b}),(0,t.jsxs)("div",{className:"flex justify-between pt-2",children:[(0,t.jsx)("div",{children:r?.role&&(0,t.jsx)(s.K,{variant:"secondary",size:"sm",onClick:()=>void k(),disabled:g,children:"Unassign Role"})}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(s.K,{variant:"secondary",size:"sm",onClick:_,children:"Cancel"}),(0,t.jsx)(s.K,{size:"sm",onClick:()=>void w(),disabled:g||!h||0===u.length,icon:g?(0,t.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:g?"Saving…":r?.role?"Change Role":"Assign Role"})]})]})]})})},"F",0,function({open:e,node:r,onClose:c,onSaved:d}){let[u,x]=(0,a.useState)(""),[h,f]=(0,a.useState)(""),[m,p]=(0,a.useState)(""),[g,v]=(0,a.useState)(!1),[b,j]=(0,a.useState)("");(0,a.useEffect)(()=>{if(r){x(r.name);try{let e=JSON.parse(r.tags);f(e.join(", "))}catch{f("")}p(r.status),j("")}},[r]);let y=async()=>{if(r&&u.trim()){v(!0),j("");try{let e=h.split(",").map(e=>e.trim()).filter(Boolean);await l.f.nodes.update(r.id,{name:u.trim(),tags:e,status:m.toUpperCase()}),d(),c()}catch(e){j(e instanceof Error?e.message:"Failed to update node")}finally{v(!1)}}},N=()=>{j(""),v(!1),c()};return(0,t.jsx)(n.n,{open:e,onClose:N,title:"Edit Node",description:r?`${r.hostname}`:"",icon:(0,t.jsx)(i.f,{className:"h-5 w-5 text-primary"}),children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(n.G,{label:"Name",required:!0,children:(0,t.jsx)("input",{type:"text",value:u,onChange:e=>x(e.target.value),className:n.W})}),(0,t.jsx)(n.G,{label:"Status",children:(0,t.jsxs)("select",{value:m,onChange:e=>p(e.target.value),className:n.N,children:[(0,t.jsx)("option",{value:"ONLINE",children:"ONLINE"}),(0,t.jsx)("option",{value:"OFFLINE",children:"OFFLINE"}),(0,t.jsx)("option",{value:"DEGRADED",children:"DEGRADED"}),(0,t.jsx)("option",{value:"PROVISIONING",children:"PROVISIONING"}),(0,t.jsx)("option",{value:"MAINTENANCE",children:"MAINTENANCE"})]})}),(0,t.jsxs)(n.G,{label:"Tags",children:[(0,t.jsx)("input",{type:"text",value:h,onChange:e=>f(e.target.value),placeholder:"web, production, us-east",className:n.W}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated list of tags"})]}),b&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:b}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)(s.K,{variant:"secondary",size:"sm",onClick:N,children:"Cancel"}),(0,t.jsx)(s.K,{size:"sm",onClick:()=>void y(),disabled:g||!u.trim(),icon:g?(0,t.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:g?"Saving…":"Save Changes"})]})]})})},"M",0,function({open:e,onClose:r,onRegistered:c}){let[d,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(""),[f,m]=(0,a.useState)("4100"),[p,g]=(0,a.useState)("linux"),[v,b]=(0,a.useState)("x86_64"),[j,y]=(0,a.useState)(""),[N,w]=(0,a.useState)(!1),[k,_]=(0,a.useState)(""),M=async()=>{if(d.trim()&&x.trim()){w(!0),_("");try{let e=j.split(",").map(e=>e.trim()).filter(Boolean);await l.f.nodes.register({name:d.trim(),hostname:x.trim(),ipAddress:x.trim(),port:Number(f)||4100,os:p,arch:v,tags:e,agentVersion:"1.0.2"}),c(),S()}catch(e){_(e instanceof Error?e.message:"Failed to register node")}finally{w(!1)}}},S=()=>{u(""),h(""),m("4100"),g("linux"),b("x86_64"),y(""),_(""),w(!1),r()};return(0,t.jsx)(n.n,{open:e,onClose:S,title:"Register Node",description:"Manually register a node already running the agent",icon:(0,t.jsx)(i.f,{className:"h-5 w-5 text-primary"}),children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(n.G,{label:"Node Name",required:!0,children:(0,t.jsx)("input",{type:"text",value:d,onChange:e=>u(e.target.value),placeholder:"web-server-01",className:n.W,autoFocus:!0})}),(0,t.jsx)(n.G,{label:"FQDN / Hostname",required:!0,children:(0,t.jsx)("input",{type:"text",value:x,onChange:e=>h(e.target.value),placeholder:"node-1.example.com",className:n.W})}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,t.jsx)(n.G,{label:"Port",children:(0,t.jsx)("input",{type:"number",value:f,onChange:e=>m(e.target.value),className:n.W})}),(0,t.jsx)(n.G,{label:"OS",children:(0,t.jsxs)("select",{value:p,onChange:e=>g(e.target.value),className:n.N,children:[(0,t.jsx)("option",{value:"linux",children:"Linux"}),(0,t.jsx)("option",{value:"darwin",children:"macOS"}),(0,t.jsx)("option",{value:"windows",children:"Windows"})]})}),(0,t.jsx)(n.G,{label:"Architecture",children:(0,t.jsxs)("select",{value:v,onChange:e=>b(e.target.value),className:n.N,children:[(0,t.jsx)("option",{value:"x86_64",children:"x86_64"}),(0,t.jsx)("option",{value:"aarch64",children:"aarch64"}),(0,t.jsx)("option",{value:"arm",children:"arm"})]})})]}),(0,t.jsxs)(n.G,{label:"Tags",children:[(0,t.jsx)("input",{type:"text",value:j,onChange:e=>y(e.target.value),placeholder:"web, production, us-east",className:n.W}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated"})]}),k&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:k}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)(s.K,{variant:"secondary",size:"sm",onClick:S,children:"Cancel"}),(0,t.jsx)(s.K,{size:"sm",onClick:()=>void M(),disabled:N||!d.trim()||!x.trim(),icon:N?(0,t.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:N?"Registering…":"Register Node"})]})]})})}],14098)},91810,e=>{let r=(0,e.i(75254).f)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);e.s(["f",0,r],91810)},90317,(e,r,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var a={bindSnapshot:function(){return d},createAsyncLocalStorage:function(){return o},createSnapshot:function(){return u},getOrCreateGlobalAsyncLocalStorage:function(){return c}};for(var s in a)Object.defineProperty(t,s,{enumerable:!0,get:a[s]});let n=Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");class l{disable(){throw n}getStore(){}run(){throw n}exit(){throw n}enterWith(){throw n}static bind(e){return e}}let i="u">typeof globalThis&&globalThis.AsyncLocalStorage;function o(){return i?new i:new l}function c(e){let r=Symbol.for(`@next/${e}@16.4.3`),t=globalThis;return t[r]??=o()}function d(e){return i?i.bind(e):l.bind(e)}function u(){return i?i.snapshot():function(e,...r){return e(...r)}}},42344,(e,r,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return a}});let a=(0,e.r(90317).getOrCreateGlobalAsyncLocalStorage)("work-async-storage")},63599,(e,r,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return a.workAsyncStorageInstance}});let a=e.r(42344)},70703,(e,r,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let a=e.r(55682)._(e.r(69093));function s(e,r){let t={};"function"==typeof e&&(t.loader=e);let s={...t,...r};return(0,a.default)({...s,modules:s.loadableGenerated?.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),r.exports=t.default)},9885,(e,r,t)=>{function a(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"encodeURIPath",{enumerable:!0,get:function(){return a}})},67585,(e,r,t)=>{e.i(47167),Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSRForNextDynamic",{enumerable:!0,get:function(){return l}});let a=e.r(71645),s=e.r(74080);e.r(32061);let n=e.r(49354).createReactBrowserBailoutReason.bind(null,"next/dynamic");function l({children:e}){return(0,a.use)((0,s.browser)(n)),e}},69093,(e,r,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return c}});let a=e.r(43476),s=e.r(71645),n=e.r(67585),l=e.r(52157);function i(e){return{default:e&&"default"in e?e.default:e}}let o={loader:()=>Promise.resolve(i(()=>null)),loading:null,ssr:!0},c=function(e){let r={...o,...e},t=(0,s.lazy)(()=>r.loader().then(i)),c=r.loading;function d(e){let i=c?(0,a.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,o=!r.ssr||!!r.loading,d=o?s.Suspense:s.Fragment,u=r.ssr?(0,a.jsxs)(a.Fragment,{children:["u"<typeof window?(0,a.jsx)(l.PreloadChunks,{moduleIds:r.modules}):null,(0,a.jsx)(t,{...e})]}):(0,a.jsx)(n.BailoutToCSRForNextDynamic,{children:(0,a.jsx)(t,{...e})});return(0,a.jsx)(d,{...o?{fallback:i}:{},children:u})}return d.displayName="LoadableComponent",d}},52157,(e,r,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return o}});let a=e.r(43476),s=e.r(74080),n=e.r(63599),l=e.r(9885),i=e.r(43369);function o({moduleIds:e}){if("u">typeof window)return null;let r=n.workAsyncStorage.getStore();if(void 0===r)return null;let t=[];if(r.reactLoadableManifest&&e){let a=r.reactLoadableManifest;for(let r of e){if(!a[r])continue;let e=a[r].files;t.push(...e)}}if(0===t.length)return null;let c=(0,i.getAssetTokenQuery)();return(0,a.jsx)(a.Fragment,{children:t.map(e=>{let t=`${r.assetPrefix}/_next/${(0,l.encodeURIPath)(e)}${c}`;return e.endsWith(".css")?(0,a.jsx)("link",{precedence:"dynamic",href:t,rel:"stylesheet",as:"style",nonce:r.nonce},e):((0,s.preload)(t,{as:"script",fetchPriority:"low",nonce:r.nonce}),null)})})}},49354,(e,r,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var a={createReactBrowserBailoutReason:function(){return l},getReactBrowserBailoutReason:function(){return i},isNextBrowserBailoutError:function(){return o}};for(var s in a)Object.defineProperty(t,s,{enumerable:!0,get:a[s]});let n=Symbol.for("next.browser-bailout-reason");function l(e){return{$$typeof:n,reason:e}}function i(e){let r=e?.cause;return r?.$$typeof===n?r.reason:void 0}function o(e){return void 0!==i(e)}}])})();
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,57108,e=>{var r=e.i(43476),t=e.i(46670);e.s(["f",0,function({configuration:e}){if(e?.memoryProvider!=="hivemem")return null;let a=e.hiveMemToken,s=a?.status??"unknown";return(0,r.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5",children:[(0,r.jsxs)(t.t,{variant:"valid"===s?"success":"expiring"===s||"unreachable"===s||"unknown"===s?"warning":"danger",children:["Token ",s]}),a?.expiresAt&&(0,r.jsxs)("time",{dateTime:a.expiresAt,title:"HiveMem token expiration",children:["expires ",new Date(a.expiresAt).toLocaleString()]}),a?.checkedAt&&(0,r.jsxs)("time",{dateTime:a.checkedAt,className:"text-text-muted/70",title:"Last HiveMem authentication check",children:["checked ",new Date(a.checkedAt).toLocaleString()]})]})}])},46670,e=>{var r=e.i(43476),t=e.i(78571);let a={default:"border-border text-text-muted",success:"border-success/40 text-success bg-success/5 shadow-[0_0_6px_rgba(0,255,65,0.15)]",warning:"border-warning/40 text-warning bg-warning/5 shadow-[0_0_6px_rgba(255,179,0,0.15)]",danger:"border-danger/40 text-danger bg-danger/5 shadow-[0_0_6px_rgba(255,23,68,0.15)]",info:"border-info/40 text-info bg-info/5 shadow-[0_0_6px_rgba(0,176,255,0.15)]"},s={default:"bg-text-muted",success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info"};e.s(["t",0,function({children:e,variant:n="default",className:l,dot:i=!1,pulse:o=!1}){return(0,r.jsxs)("span",{className:(0,t.f)("inline-flex items-center gap-1.5 rounded-chip border px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider",a[n],l),children:[i&&(0,r.jsxs)("span",{"aria-hidden":"true",className:"relative inline-flex h-1.5 w-1.5",children:[o&&(0,r.jsx)("span",{className:(0,t.f)("absolute inset-0 rounded-full animate-halo",s[n])}),(0,r.jsx)("span",{className:(0,t.f)("relative inline-flex h-1.5 w-1.5 rounded-full",s[n])})]}),e]})},"k",0,function(e){switch(e.toUpperCase()){case"ONLINE":case"COMPLETED":case"ACTIVE":case"RUNNING":case"INSTALLED":case"HEALTHY":return"success";case"DEGRADED":case"PAUSED":case"QUEUED":case"PENDING":case"INSTALLING":return"warning";case"OFFLINE":case"FAILED":case"ERROR":case"TIMEOUT":case"CANCELLED":case"DECOMMISSIONED":case"CRITICAL":return"danger";case"PROVISIONING":case"UPDATING":return"info";default:return"default"}}])},93999,51196,55427,e=>{var r=e.i(43476);let t=(0,e.i(75254).f)("ArrowDownRight",[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]);var a=e.i(15057),s=e.i(78571),n=e.i(3062),l=e.i(35084);let i={warning:"shadow-[0_0_6px_var(--color-warning)]",danger:"shadow-[0_0_8px_var(--color-danger)]",accent:"shadow-[0_0_6px_var(--color-accent)]",primary:"shadow-[0_0_6px_var(--color-primary)]"},o={xs:"h-1",sm:"h-1.5",md:"h-2"};function c({value:e,max:t=100,tone:a,thresholds:n=l.q,label:d,size:u="xs",showValue:x=!1,valueLabel:h,glow:f,className:m,testId:p}){let g="number"==typeof e&&Number.isFinite(e),v=g?Math.max(0,Math.min(100,e/(t||1)*100)):0,b=a??(g?(0,l.Z)(v,n):"muted"),j=f||!a&&g&&v>=n.warn,y=h??(g?`${v.toFixed(+(v<10&&v>0))}%`:"—");return(0,r.jsxs)("div",{className:(0,s.f)("flex min-w-0 items-center gap-2",m),"data-testid":p,children:[(0,r.jsx)("div",{role:"meter","aria-label":d,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":g?e:void 0,"aria-valuetext":y,className:(0,s.f)("relative flex-1 overflow-hidden rounded-full bg-border/70",o[u]),children:(0,r.jsx)("div",{style:{"--meter":`${v}%`},className:(0,s.f)("h-full w-(--meter) rounded-full transition-[width] duration-700 ease-out-expo starting:w-0",l.H[b],j&&i[b])})}),x&&(0,r.jsx)("span",{className:(0,s.f)("num w-11 shrink-0 text-right text-[11px]",g?l.T[b]:"text-text-muted"),children:y})]})}e.s(["f",0,c],51196);var d=e.i(71645);function u({values:e,tone:t="primary",width:a=160,height:n=32,area:i=!0,max:o,percent:c=!1,threshold:x,live:h=!0,emptyLabel:f="not enough data",className:m,testId:p,label:g,stretch:v=!1}){let b=`spark${(0,d.useId)().replace(/:/g,"")}`;if(e.length<2)return(0,r.jsx)("div",{className:(0,s.f)("flex h-8 items-center text-xs italic text-text-muted",m),"data-testid":p,children:f});let j=l.v[t],y=o??(c?Math.max(100,...e):Math.max(...e,x??0)||1),N=n-4,w=a/(e.length-1),k=e=>2+N-Math.max(0,e)/y*N,_=e.map((e,r)=>[r*w,k(e)]),M=_.map(([e,r])=>`${e.toFixed(1)},${r.toFixed(1)}`).join(" "),S=_[_.length-1];return(0,r.jsxs)("svg",{width:v?"100%":a,height:n,viewBox:`0 0 ${a} ${n}`,preserveAspectRatio:v?"none":void 0,className:(0,s.f)("block overflow-visible",m),"data-testid":p,role:g?"img":void 0,"aria-label":g,"aria-hidden":!g||void 0,children:[i&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("defs",{children:(0,r.jsxs)("linearGradient",{id:b,x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,r.jsx)("stop",{offset:"0%",stopColor:j,stopOpacity:.35}),(0,r.jsx)("stop",{offset:"100%",stopColor:j,stopOpacity:0})]})}),(0,r.jsx)("polygon",{points:`0,${n} ${M} ${a},${n}`,fill:`url(#${b})`})]}),void 0!==x&&(0,r.jsx)("line",{x1:0,x2:a,y1:k(x),y2:k(x),stroke:"var(--color-warning)",strokeOpacity:.5,strokeDasharray:"3 3",strokeWidth:1}),(0,r.jsx)("polyline",{fill:"none",stroke:j,strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round",points:M}),h&&!v&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("circle",{cx:S[0],cy:S[1],r:2.5,fill:j,className:"origin-center animate-halo [transform-box:fill-box]"}),(0,r.jsx)("circle",{cx:S[0],cy:S[1],r:2,fill:j})]})]})}e.s(["f",0,u],55427),e.s(["N",0,function({title:e,description:t,children:a,className:s,action:l,tone:i,corners:o=!1,...c}){return(0,r.jsx)(n.f,{...c,tone:i,corners:o,title:e,description:t,action:l,className:s,children:a})},"n",0,function({label:e,value:i,icon:o,trend:d,spark:x,meter:h,delta:f,tone:m="primary",className:p,testId:g}){let v=!f||f.value>=0===(f.positiveIsGood??!0);return(0,r.jsxs)(n.f,{tone:m,className:(0,s.f)("overflow-hidden",p),testId:g,children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-[0.15em] text-text-muted",children:e}),o&&(0,r.jsx)("span",{className:"text-primary/60",children:o})]}),(0,r.jsxs)("div",{className:"mt-2 flex items-end justify-between gap-2",children:[(0,r.jsx)("div",{className:(0,s.f)("num text-2xl font-bold","primary"===m?"text-primary neon-text":l.T[m]),children:i}),f&&0!==f.value&&(0,r.jsxs)("span",{className:(0,s.f)("num mb-1 inline-flex items-center gap-0.5 text-[11px]",v?"text-success":"text-danger"),children:[f.value>0?(0,r.jsx)(a.f,{className:"h-3 w-3"}):(0,r.jsx)(t,{className:"h-3 w-3"}),Math.abs(f.value).toFixed(+!Number.isInteger(f.value)),f.unit]})]}),d&&(0,r.jsx)("div",{className:(0,s.f)("mt-1 text-[11px]",d.positive?"text-success":"text-danger"),children:d.value}),void 0!==h&&(0,r.jsx)(c,{value:h,className:"mt-3",label:e}),x&&x.length>1&&(0,r.jsx)("div",{className:"-mx-5 -mb-5 mt-3 opacity-80",children:(0,r.jsx)(u,{values:x,tone:m,width:240,height:28,stretch:!0,live:!1})})]})}],93999)},54149,21176,e=>{var r=e.i(43476),t=e.i(71645),a=e.i(78571),s=e.i(35084);e.s(["f",0,function({value:e,max:n=100,label:l,sublabel:i,tone:o,thresholds:c=s.q,higherIsBetter:d=!1,size:u=140,display:x,ticks:h=!0,hideLabel:f=!1,className:m,testId:p}){let g=(0,t.useId)().replace(/:/g,""),v="number"==typeof e&&Number.isFinite(e),b=v?Math.max(0,Math.min(100,e/(n||1)*100)):0,j=o??(v?d?(0,s.Z)(100-b,c):(0,s.Z)(b,c):"muted"),y=Math.max(4,Math.round(u/16)),N=50-y/2-4,w=2*Math.PI*N,k=.75*w,_=k*b/100,M=u>=140,S=x??(v?`${Math.round(b)}%`:"—"),C=h?Array.from({length:11},(e,t)=>{let a=(135+270*t/10)*Math.PI/180,s=50-(t%5==0?4:2.5);return(0,r.jsx)("line",{x1:50+48.5*Math.cos(a),y1:50+48.5*Math.sin(a),x2:50+s*Math.cos(a),y2:50+s*Math.sin(a),stroke:"var(--color-border-strong)",strokeWidth:.8},t)}):null;return(0,r.jsxs)("div",{role:"img","aria-label":`${l}: ${S}`,"data-testid":p,className:(0,a.f)("relative inline-flex flex-col items-center",m),style:{width:u},children:[(0,r.jsxs)("svg",{viewBox:"0 0 100 100",width:u,height:u,"aria-hidden":"true",className:"overflow-visible",children:[M&&(0,r.jsx)("defs",{children:(0,r.jsxs)("filter",{id:`g${g}`,x:"-30%",y:"-30%",width:"160%",height:"160%",children:[(0,r.jsx)("feGaussianBlur",{stdDeviation:"2.2",result:"blur"}),(0,r.jsxs)("feMerge",{children:[(0,r.jsx)("feMergeNode",{in:"blur"}),(0,r.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})}),C,(0,r.jsx)("circle",{cx:50,cy:50,r:N,fill:"none",stroke:"var(--color-border)",strokeWidth:y,strokeLinecap:"round",strokeDasharray:`${k} ${w}`,transform:"rotate(135 50 50)"}),(0,r.jsx)("circle",{cx:50,cy:50,r:N,fill:"none",stroke:s.v[j],strokeWidth:y,strokeLinecap:"round",transform:"rotate(135 50 50)",filter:M?`url(#g${g})`:void 0,style:{"--dash":`${_} ${w}`},className:"[stroke-dasharray:var(--dash)] transition-[stroke-dasharray] duration-1000 ease-out-expo starting:[stroke-dasharray:0_1000]"})]}),(0,r.jsxs)("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center",style:{height:u},children:[(0,r.jsx)("span",{className:(0,a.f)("num font-bold leading-none",s.T[j],M&&s.z[j]),style:{fontSize:Math.max(12,.2*u)},children:S}),i&&(0,r.jsx)("span",{className:"num mt-1 text-text-muted",style:{fontSize:Math.max(9,.075*u)},children:i})]}),!f&&(0,r.jsx)("span",{className:"-mt-[10%] text-center text-[10px] font-medium uppercase tracking-[0.15em] text-text-muted",children:l})]})}],54149);var n=e.i(70703),l=e.i(65369);let i=(0,n.default)(()=>e.A(1321),{loadableGenerated:{modules:[69944]},ssr:!1,loading:()=>(0,r.jsx)(l.l,{className:"h-[180px] w-full"})});e.s(["f",0,i],21176)},3062,e=>{var r=e.i(43476),t=e.i(78571),a=e.i(35084);let s={primary:"[--panel-corner-color:color-mix(in_srgb,var(--color-primary)_60%,transparent)]",accent:"[--panel-corner-color:color-mix(in_srgb,var(--color-accent)_70%,transparent)]",success:"[--panel-corner-color:color-mix(in_srgb,var(--color-success)_60%,transparent)]",warning:"[--panel-corner-color:color-mix(in_srgb,var(--color-warning)_70%,transparent)]",danger:"[--panel-corner-color:color-mix(in_srgb,var(--color-danger)_70%,transparent)]",info:"[--panel-corner-color:color-mix(in_srgb,var(--color-info)_60%,transparent)]",muted:"[--panel-corner-color:var(--color-border-strong)]"},n={primary:"[--glow-hover-color:var(--color-glow)]",accent:"[--glow-hover-color:var(--color-glow-accent)]",success:"[--glow-hover-color:var(--color-glow-success)]",warning:"[--glow-hover-color:var(--color-glow-warning)]",danger:"[--glow-hover-color:var(--color-glow-danger)]",info:"[--glow-hover-color:var(--color-glow)]",muted:"[--glow-hover-color:var(--color-glow)]"},l={primary:"hover:border-primary/30",accent:"hover:border-accent/40",success:"hover:border-success/30",warning:"hover:border-warning/40",danger:"hover:border-danger/40",info:"hover:border-info/30",muted:"hover:border-border-strong"},i={none:"",sm:"p-3",md:"p-5",lg:"p-6"};e.s(["f",0,function({tone:e="primary",corners:o=!0,interactive:c=!0,hero:d=!1,title:u,description:x,icon:h,action:f,as:m="div",padding:p="md",testId:g,className:v,children:b,...j}){return(0,r.jsxs)(m,{...j,"data-testid":g??j["data-testid"],className:(0,t.f)("relative rounded-panel border border-border bg-surface transition-colors duration-300",i[p],o&&"panel-corners",o&&s[e],c&&"glow-hover",c&&n[e],c&&l[e],d&&"grid-bg overflow-hidden bg-surface/80",v),children:[(u||f||h)&&(0,r.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[h&&(0,r.jsx)("span",{className:(0,t.f)("mt-0.5 shrink-0",a.T[e]),children:h}),(0,r.jsxs)("div",{className:"min-w-0",children:[u&&(0,r.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider",children:u}),x&&(0,r.jsx)("p",{className:"mt-0.5 text-[11px] text-text-muted",children:x})]})]}),f]}),b]})}])},65369,e=>{var r=e.i(43476),t=e.i(78571);function a({className:e}){return(0,r.jsx)("div",{"aria-hidden":"true",className:(0,t.f)("skeleton h-3 w-full",e)})}e.s(["l",0,a,"g",0,function({count:e=4,className:s}){return(0,r.jsx)("div",{role:"status","aria-label":"Loading",className:(0,t.f)("grid gap-4 sm:grid-cols-2 lg:grid-cols-4",s),children:Array.from({length:e},(e,t)=>(0,r.jsxs)("div",{className:"panel-corners rounded-panel border border-border bg-surface p-5",children:[(0,r.jsx)(a,{className:"h-2 w-1/2"}),(0,r.jsx)(a,{className:"mt-4 h-7 w-2/3"}),(0,r.jsx)(a,{className:"mt-3 h-1 w-full opacity-60"})]},t))})},"F",0,function({rows:e=5,cols:s=4,className:n}){return(0,r.jsxs)("div",{role:"status","aria-label":"Loading",className:(0,t.f)("overflow-hidden rounded-panel border border-border",n),children:[(0,r.jsx)("div",{className:"flex gap-4 border-b border-border bg-surface px-4 py-3",children:Array.from({length:s},(e,t)=>(0,r.jsx)(a,{className:"h-2 flex-1 opacity-60"},t))}),Array.from({length:e},(e,n)=>(0,r.jsx)("div",{className:"flex gap-4 border-b border-border/50 px-4 py-3 last:border-0",children:Array.from({length:s},(e,s)=>(0,r.jsx)(a,{className:(0,t.f)("h-3 flex-1",(n+s)%3==0&&"max-w-[60%]")},s))},n))]})},"Q",0,function({lines:e=3,className:s}){let n=["w-full","w-11/12","w-4/5","w-2/3","w-3/4"];return(0,r.jsx)("div",{role:"status","aria-label":"Loading",className:(0,t.f)("space-y-2",s),children:Array.from({length:e},(e,t)=>(0,r.jsx)(a,{className:n[t%n.length]},t))})}])},75723,e=>{var r=e.i(43476),t=e.i(78571),a=e.i(46670);let s={success:"bg-success shadow-[0_0_6px_var(--color-success)]",warning:"bg-warning shadow-[0_0_6px_var(--color-warning)]",danger:"bg-danger shadow-[0_0_6px_var(--color-danger)]",info:"bg-info shadow-[0_0_6px_var(--color-info)]",default:"bg-text-muted"},n={success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info",default:"bg-text-muted"},l=new Set(["ONLINE","RUNNING","ACTIVE","HEALTHY","CRITICAL","UPDATING","PROVISIONING"]);e.s(["f",0,function({status:e,pulse:i,size:o="sm",className:c,label:d}){let u=(0,a.k)(e),x=i??l.has(e.toUpperCase()),h="xs"===o?"h-1.5 w-1.5":"h-2 w-2";return(0,r.jsxs)("span",{className:(0,t.f)("relative inline-flex shrink-0",h,c),role:d?"img":void 0,"aria-label":d,"aria-hidden":!d||void 0,children:[x&&(0,r.jsx)("span",{className:(0,t.f)("absolute inset-0 rounded-full animate-halo",n[u])}),(0,r.jsx)("span",{className:(0,t.f)("relative inline-flex rounded-full",h,s[u])})]})}])},71417,e=>{e.s(["L",0,function(e){if(0===e)return"0 B";let r=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,r)).toFixed(1))} ${["B","KB","MB","GB","TB"][r]}`},"C",0,function(e){return e?("string"==typeof e?new Date(e):e).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}])},21218,e=>{let r=(0,e.i(75254).f)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);e.s(["f",0,r],21218)},71689,e=>{let r=(0,e.i(75254).f)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["f",0,r],71689)},15057,e=>{let r=(0,e.i(75254).f)("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);e.s(["f",0,r],15057)},78917,e=>{let r=(0,e.i(75254).f)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["f",0,r],78917)},81203,e=>{let r=(0,e.i(75254).f)("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);e.s(["f",0,r],81203)},12181,14098,e=>{let r=(0,e.i(75254).f)("RefreshCcwDot",[["path",{d:"M3 2v6h6",key:"18ldww"}],["path",{d:"M21 12A9 9 0 0 0 6 5.3L3 8",key:"1pbrqz"}],["path",{d:"M21 22v-6h-6",key:"usdfbe"}],["path",{d:"M3 12a9 9 0 0 0 15 6.7l3-2.7",key:"1hosoe"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);e.s(["f",0,r],12181);var t=e.i(43476),a=e.i(71645),s=e.i(68759),n=e.i(32568),l=e.i(82983),i=e.i(18393),o=e.i(31278);e.s(["E",0,function({open:e,node:r,onClose:c,onSaved:d}){let[u,x]=(0,a.useState)([]),[h,f]=(0,a.useState)(""),[m,p]=(0,a.useState)(!0),[g,v]=(0,a.useState)(!1),[b,j]=(0,a.useState)(""),[y,N]=(0,a.useState)(!1);(0,a.useEffect)(()=>{e&&(j(""),f(r?.role?.id??""),p(!0),N(!0),(async()=>{try{let e=await l.f.roles.list();x(e.data??[])}catch{j("Failed to load roles")}finally{N(!1)}})())},[e,r?.role?.id]);let w=async()=>{if(r){v(!0),j("");try{let e=r.role?.id;e&&e!==h&&await l.f.roles.unassign(e,{nodeIds:[r.id]}),h&&await l.f.roles.assign(h,{nodeIds:[r.id],defer:!m});let t=h?u.find(e=>e.id===h)??null:null;d(t),c()}catch(e){j(e instanceof Error?e.message:"Failed to assign role")}finally{v(!1)}}},k=async()=>{if(r?.role){v(!0),j("");try{await l.f.roles.unassign(r.role.id,{nodeIds:[r.id]}),d(null),c()}catch(e){j(e instanceof Error?e.message:"Failed to unassign role")}finally{v(!1)}}},_=()=>{j(""),v(!1),c()};return(0,t.jsx)(n.n,{open:e,onClose:_,title:r?.role?"Change Role":"Assign Role",description:r?`Node: ${r.name}`:"",icon:(0,t.jsx)(i.f,{className:"h-5 w-5 text-primary"}),children:(0,t.jsxs)("div",{className:"space-y-4",children:[y?(0,t.jsxs)("div",{className:"flex items-center gap-2 py-4 text-xs text-text-muted",children:[(0,t.jsx)(o.f,{className:"h-4 w-4 animate-spin"}),"Loading roles…"]}):0===u.length?(0,t.jsx)("p",{className:"text-xs text-text-muted py-4",children:"No roles found. Create a role first on the Roles page."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.G,{label:"Role",children:(0,t.jsxs)("select",{value:h,onChange:e=>f(e.target.value),className:n.N,children:[(0,t.jsx)("option",{value:"",children:"— No role —"}),u.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})}),h&&(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:m,onChange:e=>p(e.target.checked),className:"rounded border-border"}),"Apply role immediately"]})]}),b&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:b}),(0,t.jsxs)("div",{className:"flex justify-between pt-2",children:[(0,t.jsx)("div",{children:r?.role&&(0,t.jsx)(s.K,{variant:"secondary",size:"sm",onClick:()=>void k(),disabled:g,children:"Unassign Role"})}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(s.K,{variant:"secondary",size:"sm",onClick:_,children:"Cancel"}),(0,t.jsx)(s.K,{size:"sm",onClick:()=>void w(),disabled:g||!h||0===u.length,icon:g?(0,t.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:g?"Saving…":r?.role?"Change Role":"Assign Role"})]})]})]})})},"F",0,function({open:e,node:r,onClose:c,onSaved:d}){let[u,x]=(0,a.useState)(""),[h,f]=(0,a.useState)(""),[m,p]=(0,a.useState)(""),[g,v]=(0,a.useState)(!1),[b,j]=(0,a.useState)("");(0,a.useEffect)(()=>{if(r){x(r.name);try{let e=JSON.parse(r.tags);f(e.join(", "))}catch{f("")}p(r.status),j("")}},[r]);let y=async()=>{if(r&&u.trim()){v(!0),j("");try{let e=h.split(",").map(e=>e.trim()).filter(Boolean);await l.f.nodes.update(r.id,{name:u.trim(),tags:e,status:m.toUpperCase()}),d(),c()}catch(e){j(e instanceof Error?e.message:"Failed to update node")}finally{v(!1)}}},N=()=>{j(""),v(!1),c()};return(0,t.jsx)(n.n,{open:e,onClose:N,title:"Edit Node",description:r?`${r.hostname}`:"",icon:(0,t.jsx)(i.f,{className:"h-5 w-5 text-primary"}),children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(n.G,{label:"Name",required:!0,children:(0,t.jsx)("input",{type:"text",value:u,onChange:e=>x(e.target.value),className:n.W})}),(0,t.jsx)(n.G,{label:"Status",children:(0,t.jsxs)("select",{value:m,onChange:e=>p(e.target.value),className:n.N,children:[(0,t.jsx)("option",{value:"ONLINE",children:"ONLINE"}),(0,t.jsx)("option",{value:"OFFLINE",children:"OFFLINE"}),(0,t.jsx)("option",{value:"DEGRADED",children:"DEGRADED"}),(0,t.jsx)("option",{value:"PROVISIONING",children:"PROVISIONING"}),(0,t.jsx)("option",{value:"MAINTENANCE",children:"MAINTENANCE"})]})}),(0,t.jsxs)(n.G,{label:"Tags",children:[(0,t.jsx)("input",{type:"text",value:h,onChange:e=>f(e.target.value),placeholder:"web, production, us-east",className:n.W}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated list of tags"})]}),b&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:b}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)(s.K,{variant:"secondary",size:"sm",onClick:N,children:"Cancel"}),(0,t.jsx)(s.K,{size:"sm",onClick:()=>void y(),disabled:g||!u.trim(),icon:g?(0,t.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:g?"Saving…":"Save Changes"})]})]})})},"M",0,function({open:e,onClose:r,onRegistered:c}){let[d,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(""),[f,m]=(0,a.useState)("4100"),[p,g]=(0,a.useState)("linux"),[v,b]=(0,a.useState)("x86_64"),[j,y]=(0,a.useState)(""),[N,w]=(0,a.useState)(!1),[k,_]=(0,a.useState)(""),M=async()=>{if(d.trim()&&x.trim()){w(!0),_("");try{let e=j.split(",").map(e=>e.trim()).filter(Boolean);await l.f.nodes.register({name:d.trim(),hostname:x.trim(),ipAddress:x.trim(),port:Number(f)||4100,os:p,arch:v,tags:e,agentVersion:"1.0.3"}),c(),S()}catch(e){_(e instanceof Error?e.message:"Failed to register node")}finally{w(!1)}}},S=()=>{u(""),h(""),m("4100"),g("linux"),b("x86_64"),y(""),_(""),w(!1),r()};return(0,t.jsx)(n.n,{open:e,onClose:S,title:"Register Node",description:"Manually register a node already running the agent",icon:(0,t.jsx)(i.f,{className:"h-5 w-5 text-primary"}),children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(n.G,{label:"Node Name",required:!0,children:(0,t.jsx)("input",{type:"text",value:d,onChange:e=>u(e.target.value),placeholder:"web-server-01",className:n.W,autoFocus:!0})}),(0,t.jsx)(n.G,{label:"FQDN / Hostname",required:!0,children:(0,t.jsx)("input",{type:"text",value:x,onChange:e=>h(e.target.value),placeholder:"node-1.example.com",className:n.W})}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,t.jsx)(n.G,{label:"Port",children:(0,t.jsx)("input",{type:"number",value:f,onChange:e=>m(e.target.value),className:n.W})}),(0,t.jsx)(n.G,{label:"OS",children:(0,t.jsxs)("select",{value:p,onChange:e=>g(e.target.value),className:n.N,children:[(0,t.jsx)("option",{value:"linux",children:"Linux"}),(0,t.jsx)("option",{value:"darwin",children:"macOS"}),(0,t.jsx)("option",{value:"windows",children:"Windows"})]})}),(0,t.jsx)(n.G,{label:"Architecture",children:(0,t.jsxs)("select",{value:v,onChange:e=>b(e.target.value),className:n.N,children:[(0,t.jsx)("option",{value:"x86_64",children:"x86_64"}),(0,t.jsx)("option",{value:"aarch64",children:"aarch64"}),(0,t.jsx)("option",{value:"arm",children:"arm"})]})})]}),(0,t.jsxs)(n.G,{label:"Tags",children:[(0,t.jsx)("input",{type:"text",value:j,onChange:e=>y(e.target.value),placeholder:"web, production, us-east",className:n.W}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated"})]}),k&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:k}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)(s.K,{variant:"secondary",size:"sm",onClick:S,children:"Cancel"}),(0,t.jsx)(s.K,{size:"sm",onClick:()=>void M(),disabled:N||!d.trim()||!x.trim(),icon:N?(0,t.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:N?"Registering…":"Register Node"})]})]})})}],14098)},91810,e=>{let r=(0,e.i(75254).f)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);e.s(["f",0,r],91810)},90317,(e,r,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var a={bindSnapshot:function(){return d},createAsyncLocalStorage:function(){return o},createSnapshot:function(){return u},getOrCreateGlobalAsyncLocalStorage:function(){return c}};for(var s in a)Object.defineProperty(t,s,{enumerable:!0,get:a[s]});let n=Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");class l{disable(){throw n}getStore(){}run(){throw n}exit(){throw n}enterWith(){throw n}static bind(e){return e}}let i="u">typeof globalThis&&globalThis.AsyncLocalStorage;function o(){return i?new i:new l}function c(e){let r=Symbol.for(`@next/${e}@16.4.3`),t=globalThis;return t[r]??=o()}function d(e){return i?i.bind(e):l.bind(e)}function u(){return i?i.snapshot():function(e,...r){return e(...r)}}},42344,(e,r,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return a}});let a=(0,e.r(90317).getOrCreateGlobalAsyncLocalStorage)("work-async-storage")},63599,(e,r,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return a.workAsyncStorageInstance}});let a=e.r(42344)},70703,(e,r,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let a=e.r(55682)._(e.r(69093));function s(e,r){let t={};"function"==typeof e&&(t.loader=e);let s={...t,...r};return(0,a.default)({...s,modules:s.loadableGenerated?.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),r.exports=t.default)},9885,(e,r,t)=>{function a(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"encodeURIPath",{enumerable:!0,get:function(){return a}})},67585,(e,r,t)=>{e.i(47167),Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSRForNextDynamic",{enumerable:!0,get:function(){return l}});let a=e.r(71645),s=e.r(74080);e.r(32061);let n=e.r(49354).createReactBrowserBailoutReason.bind(null,"next/dynamic");function l({children:e}){return(0,a.use)((0,s.browser)(n)),e}},69093,(e,r,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return c}});let a=e.r(43476),s=e.r(71645),n=e.r(67585),l=e.r(52157);function i(e){return{default:e&&"default"in e?e.default:e}}let o={loader:()=>Promise.resolve(i(()=>null)),loading:null,ssr:!0},c=function(e){let r={...o,...e},t=(0,s.lazy)(()=>r.loader().then(i)),c=r.loading;function d(e){let i=c?(0,a.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,o=!r.ssr||!!r.loading,d=o?s.Suspense:s.Fragment,u=r.ssr?(0,a.jsxs)(a.Fragment,{children:["u"<typeof window?(0,a.jsx)(l.PreloadChunks,{moduleIds:r.modules}):null,(0,a.jsx)(t,{...e})]}):(0,a.jsx)(n.BailoutToCSRForNextDynamic,{children:(0,a.jsx)(t,{...e})});return(0,a.jsx)(d,{...o?{fallback:i}:{},children:u})}return d.displayName="LoadableComponent",d}},52157,(e,r,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return o}});let a=e.r(43476),s=e.r(74080),n=e.r(63599),l=e.r(9885),i=e.r(43369);function o({moduleIds:e}){if("u">typeof window)return null;let r=n.workAsyncStorage.getStore();if(void 0===r)return null;let t=[];if(r.reactLoadableManifest&&e){let a=r.reactLoadableManifest;for(let r of e){if(!a[r])continue;let e=a[r].files;t.push(...e)}}if(0===t.length)return null;let c=(0,i.getAssetTokenQuery)();return(0,a.jsx)(a.Fragment,{children:t.map(e=>{let t=`${r.assetPrefix}/_next/${(0,l.encodeURIPath)(e)}${c}`;return e.endsWith(".css")?(0,a.jsx)("link",{precedence:"dynamic",href:t,rel:"stylesheet",as:"style",nonce:r.nonce},e):((0,s.preload)(t,{as:"script",fetchPriority:"low",nonce:r.nonce}),null)})})}},49354,(e,r,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var a={createReactBrowserBailoutReason:function(){return l},getReactBrowserBailoutReason:function(){return i},isNextBrowserBailoutError:function(){return o}};for(var s in a)Object.defineProperty(t,s,{enumerable:!0,get:a[s]});let n=Symbol.for("next.browser-bailout-reason");function l(e){return{$$typeof:n,reason:e}}function i(e){let r=e?.cause;return r?.$$typeof===n?r.reason:void 0}function o(e){return void 0!==i(e)}}])})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,47061,e=>{var s=e.i(43476),t=e.i(71645),a=e.i(68759),r=e.i(46670),n=e.i(93999),i=e.i(32568),l=e.i(82983),c=e.i(34479),o=e.i(4050),d=e.i(95187);let x=(0,d.createServerReference)("405a96f27dc54c02b0c324e62deeb4334729f6c217",d.callServer,void 0,d.findSourceMapURL,"scanCron");var m=e.i(78571),h=e.i(63376),u=e.i(88187),p=e.i(16715),f=e.i(55436),j=e.i(3116),g=e.i(18393),v=e.i(64659),b=e.i(63059),N=e.i(69074),w=e.i(31278),y=e.i(68054),k=e.i(87316),S=e.i(78894),_=e.i(95468),C=e.i(73884);e.s(["default",0,function(){let{activeNode:e}=(0,o.l)(),[d,I]=(0,t.useState)([]),[E,$]=(0,t.useState)(!1),[L,D]=(0,t.useState)(null),[M,R]=(0,t.useState)(!1),[T,A]=(0,t.useState)(""),[O,z]=(0,t.useState)(new Set),[U,P]=(0,t.useState)(null),[F,G]=(0,t.useState)("1.0.0"),[W,K]=(0,t.useState)(""),[H,B]=(0,t.useState)(!1),J=(0,t.useCallback)(async()=>{$(!0),I([]),D(null);let s=Date.now();try{let s=await x(e.id);if(s.success&&Array.isArray(s.data)){let e=s.data.map(e=>({...e,status:"error"===e.status?"error":"done"}));I(e);let t=new Set(e.filter(e=>e.jobs.length>0).map(e=>e.nodeId));z(t.size>0?t:new Set(e.map(e=>e.nodeId)))}else D(s.error?.message??"Scan returned unsuccessful response")}catch(s){let e=s instanceof Error?s.message:"Scan request failed";D(e)}finally{let e=Date.now()-s;e<1500&&await new Promise(s=>setTimeout(s,1500-e)),$(!1),R(!0)}},[e]);(0,t.useEffect)(()=>{e&&J()},[e,J]);let V=d.reduce((e,s)=>e+("done"===s.status?s.jobs.length:0),0),q=d.filter(e=>"done"===e.status).length,Q=d.filter(e=>"error"===e.status).length,Y=e=>{if(!T)return!0;let s=T.toLowerCase();return e.name.toLowerCase().includes(s)||e.command.toLowerCase().includes(s)||e.schedule.toLowerCase().includes(s)||(e.user?.toLowerCase().includes(s)??!1)},Z=async()=>{if(U&&F){B(!0);try{let e=JSON.stringify({name:U.job.name,version:F,schedule:U.job.schedule,command:U.job.command,description:W},null,2);await l.f.library.files.create({name:`${U.job.name} v${F}`,fileName:`${U.job.name}-${F}.json`,mimeType:"application/x-magnus-cronjob",content:e,tags:["cronjob","cron"]}),P(null),G("1.0.0"),K("")}catch{}finally{B(!1)}}};return(0,s.jsxs)(h.U,{className:"space-y-6",children:[(0,s.jsx)(h.z,{children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-lg font-bold uppercase tracking-wider",children:"Cron Jobs"}),(0,s.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:"Discover and manage scheduled jobs across your fleet"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[M&&!E&&(0,s.jsxs)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider mr-2",children:[d.length," node",1!==d.length?"s":""," · ",V," job",1!==V?"s":"",Q>0&&` \xb7 ${Q} error${1!==Q?"s":""}`]}),(0,s.jsxs)(a.K,{variant:"secondary",size:"sm",onClick:()=>void J(),disabled:E,children:[(0,s.jsx)(p.f,{className:(0,m.f)("h-3.5 w-3.5 mr-1.5",E&&"animate-spin")}),E?"Scanning...":"Rescan"]})]})]})}),E&&(0,s.jsx)(h.z,{children:(0,s.jsx)(u.f,{title:"Scanning Nodes for Cron Jobs",description:"Probing all online nodes...",nodes:d.map(e=>({nodeId:e.nodeId,nodeName:e.nodeName,status:e.status,error:e.error})),scanning:!0})}),!E&&M&&V>0&&(0,s.jsx)(h.z,{children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(f.f,{className:"absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-text-muted"}),(0,s.jsx)("input",{type:"text",placeholder:"Search jobs by name, command, or schedule...",value:T,onChange:e=>A(e.target.value),className:(0,m.f)(i.W,"pl-9")})]})}),!E&&M&&L&&(0,s.jsx)(h.z,{children:(0,s.jsx)(n.N,{children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,s.jsx)(S.f,{className:"h-10 w-10 text-danger/60 mb-3"}),(0,s.jsx)("p",{className:"text-xs font-bold text-danger mb-1",children:"Scan Failed"}),(0,s.jsx)("p",{className:"text-[11px] text-text-muted max-w-md",children:L}),(0,s.jsxs)(a.K,{variant:"secondary",size:"sm",className:"mt-4",onClick:()=>void J(),children:[(0,s.jsx)(p.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Retry Scan"]})]})})}),!E&&M&&!L&&(0,s.jsxs)(s.Fragment,{children:[0===d.length?(0,s.jsx)(h.z,{children:(0,s.jsx)(n.N,{children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,s.jsx)(g.f,{className:"h-10 w-10 text-text-muted/40 mb-3"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"No online nodes found to scan. Ensure at least one node agent is running and connected."})]})})}):d.map(e=>{let t=O.has(e.nodeId),i=e.jobs.filter(Y);return(0,s.jsx)(h.z,{children:(0,s.jsxs)(n.N,{className:"overflow-hidden",children:[(0,s.jsxs)("button",{onClick:()=>{var s;return s=e.nodeId,void z(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t})},className:"w-full flex items-center gap-4 p-4 text-left hover:bg-surface-hover transition-all",children:[(0,s.jsx)("div",{className:"flex h-9 w-9 items-center justify-center rounded border border-primary/30 bg-primary/5 shrink-0",children:(0,s.jsx)(g.f,{className:"h-4 w-4 text-primary"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider",children:e.nodeName}),"done"===e.status&&(0,s.jsxs)(r.t,{variant:e.jobs.length>0?"success":"default",children:[e.jobs.length," job",1!==e.jobs.length?"s":""]}),"error"===e.status&&((0,c.f)(e.error)?(0,s.jsx)(r.t,{variant:"default",children:"Disabled"}):(0,s.jsx)(r.t,{variant:"danger",children:"Error"}))]}),"error"===e.status&&e.error&&(0,s.jsx)("p",{className:(0,m.f)("text-[11px] mt-0.5 truncate",(0,c.f)(e.error)?"text-text-muted":"text-danger"),children:(0,c.f)(e.error)??e.error}),"done"===e.status&&0===e.jobs.length&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted mt-0.5",children:"No cron jobs found on this node"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:["done"===e.status?(0,s.jsx)(_.f,{className:"h-4 w-4 text-success"}):(0,s.jsx)(C.f,{className:"h-4 w-4 text-danger"}),t?(0,s.jsx)(v.f,{className:"h-4 w-4 text-text-muted"}):(0,s.jsx)(b.f,{className:"h-4 w-4 text-text-muted"})]})]}),t&&"done"===e.status&&(0,s.jsx)("div",{className:"border-t border-border/50 bg-bg/50",children:0===i.length?(0,s.jsx)("div",{className:"flex items-center justify-center py-8 text-center",children:(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:0===e.jobs.length?"No cron jobs found on this node.":"No jobs match your search on this node."})}):(0,s.jsx)("div",{className:"divide-y divide-border/30",children:i.map((t,n)=>(0,s.jsxs)("div",{className:"p-4 space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(j.f,{className:"h-4 w-4 text-primary"}),(0,s.jsx)("span",{className:"text-xs font-bold",children:t.name}),t.user&&(0,s.jsx)(r.t,{variant:"default",children:t.user}),(0,s.jsx)(r.t,{variant:"info",children:t.schedule})]}),(0,s.jsxs)(a.K,{size:"sm",variant:"secondary",onClick:()=>{P({job:t,nodeId:e.nodeId,nodeName:e.nodeName}),G("1.0.0"),K("")},children:[(0,s.jsx)(N.f,{className:"h-3 w-3 mr-1"}),"Publish"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 text-[11px] text-text-muted",children:[(0,s.jsx)(k.f,{className:"h-3 w-3"}),function(e){let s=e.split(/\s+/);if(s.length<5)return e;let[t,a,r,n,i]=s;return"*"===t&&"*"===a&&"*"===r&&"*"===n&&"*"===i?"Every minute":"0"===t&&"*"===a&&"*"===r&&"*"===n&&"*"===i?"Every hour":"0"===t&&"0"===a&&"*"===r&&"*"===n&&"*"===i?"Daily at midnight":t?.startsWith("*/")?`Every ${t.slice(2)} minutes`:a?.startsWith("*/")?`Every ${a.slice(2)} hours`:e}(t.schedule)]}),(0,s.jsxs)("div",{className:"flex items-start gap-2 rounded border border-border bg-surface p-3",children:[(0,s.jsx)(y.f,{className:"h-3.5 w-3.5 text-primary mt-0.5 shrink-0"}),(0,s.jsx)("pre",{className:"text-xs whitespace-pre-wrap break-all flex-1",children:t.command})]})]},`${t.name}-${n}`))})})]})},e.nodeId)}),d.length>0&&(0,s.jsx)(h.z,{children:(0,s.jsxs)("div",{className:"flex items-center justify-between text-[10px] text-text-muted uppercase tracking-wider",children:[(0,s.jsxs)("span",{children:[q," node",1!==q?"s":""," scanned ·"," ",V," job",1!==V?"s":""," discovered"]}),Q>0&&(0,s.jsxs)("span",{className:"text-danger",children:[Q," node",1!==Q?"s":""," unreachable"]})]})})]}),(0,s.jsx)(i.n,{open:!!U,onClose:()=>P(null),title:"Publish to Library",description:U?.job.name??"",icon:(0,s.jsx)(N.f,{className:"h-5 w-5 text-primary"}),children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-[11px] font-bold uppercase tracking-wider mb-1.5",children:["Version ",(0,s.jsx)("span",{className:"text-accent",children:"*"})]}),(0,s.jsx)("input",{type:"text",value:F,onChange:e=>G(e.target.value),placeholder:"1.0.0",className:i.W})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-[11px] font-bold uppercase tracking-wider mb-1.5",children:"Description"}),(0,s.jsx)("input",{type:"text",value:W,onChange:e=>K(e.target.value),placeholder:"What does this cron job do?",className:i.W})]}),U&&(0,s.jsxs)("div",{className:"rounded border border-border bg-bg p-3 text-xs space-y-1",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-text-muted",children:"Source:"})," ",U.nodeName]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-text-muted",children:"Schedule:"})," ",U.job.schedule]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-text-muted",children:"Command:"})," ",(0,s.jsx)("span",{className:"text-primary",children:U.job.command})]})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,s.jsx)(a.K,{variant:"secondary",size:"sm",onClick:()=>P(null),children:"Cancel"}),(0,s.jsx)(a.K,{size:"sm",onClick:()=>void Z(),disabled:H||!F,children:H?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.f,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Publishing..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(N.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Publish"]})})]})]})})]})}],47061)},46670,e=>{var s=e.i(43476),t=e.i(78571);let a={default:"border-border text-text-muted",success:"border-success/40 text-success bg-success/5 shadow-[0_0_6px_rgba(0,255,65,0.15)]",warning:"border-warning/40 text-warning bg-warning/5 shadow-[0_0_6px_rgba(255,179,0,0.15)]",danger:"border-danger/40 text-danger bg-danger/5 shadow-[0_0_6px_rgba(255,23,68,0.15)]",info:"border-info/40 text-info bg-info/5 shadow-[0_0_6px_rgba(0,176,255,0.15)]"},r={default:"bg-text-muted",success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info"};e.s(["t",0,function({children:e,variant:n="default",className:i,dot:l=!1,pulse:c=!1}){return(0,s.jsxs)("span",{className:(0,t.f)("inline-flex items-center gap-1.5 rounded-chip border px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider",a[n],i),children:[l&&(0,s.jsxs)("span",{"aria-hidden":"true",className:"relative inline-flex h-1.5 w-1.5",children:[c&&(0,s.jsx)("span",{className:(0,t.f)("absolute inset-0 rounded-full animate-halo",r[n])}),(0,s.jsx)("span",{className:(0,t.f)("relative inline-flex h-1.5 w-1.5 rounded-full",r[n])})]}),e]})},"k",0,function(e){switch(e.toUpperCase()){case"ONLINE":case"COMPLETED":case"ACTIVE":case"RUNNING":case"INSTALLED":case"HEALTHY":return"success";case"DEGRADED":case"PAUSED":case"QUEUED":case"PENDING":case"INSTALLING":return"warning";case"OFFLINE":case"FAILED":case"ERROR":case"TIMEOUT":case"CANCELLED":case"DECOMMISSIONED":case"CRITICAL":return"danger";case"PROVISIONING":case"UPDATING":return"info";default:return"default"}}])},93999,51196,55427,e=>{var s=e.i(43476);let t=(0,e.i(75254).f)("ArrowDownRight",[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]);var a=e.i(15057),r=e.i(78571),n=e.i(3062),i=e.i(35084);let l={warning:"shadow-[0_0_6px_var(--color-warning)]",danger:"shadow-[0_0_8px_var(--color-danger)]",accent:"shadow-[0_0_6px_var(--color-accent)]",primary:"shadow-[0_0_6px_var(--color-primary)]"},c={xs:"h-1",sm:"h-1.5",md:"h-2"};function o({value:e,max:t=100,tone:a,thresholds:n=i.q,label:d,size:x="xs",showValue:m=!1,valueLabel:h,glow:u,className:p,testId:f}){let j="number"==typeof e&&Number.isFinite(e),g=j?Math.max(0,Math.min(100,e/(t||1)*100)):0,v=a??(j?(0,i.Z)(g,n):"muted"),b=u||!a&&j&&g>=n.warn,N=h??(j?`${g.toFixed(+(g<10&&g>0))}%`:"—");return(0,s.jsxs)("div",{className:(0,r.f)("flex min-w-0 items-center gap-2",p),"data-testid":f,children:[(0,s.jsx)("div",{role:"meter","aria-label":d,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":j?e:void 0,"aria-valuetext":N,className:(0,r.f)("relative flex-1 overflow-hidden rounded-full bg-border/70",c[x]),children:(0,s.jsx)("div",{style:{"--meter":`${g}%`},className:(0,r.f)("h-full w-(--meter) rounded-full transition-[width] duration-700 ease-out-expo starting:w-0",i.H[v],b&&l[v])})}),m&&(0,s.jsx)("span",{className:(0,r.f)("num w-11 shrink-0 text-right text-[11px]",j?i.T[v]:"text-text-muted"),children:N})]})}e.s(["f",0,o],51196);var d=e.i(71645);function x({values:e,tone:t="primary",width:a=160,height:n=32,area:l=!0,max:c,percent:o=!1,threshold:m,live:h=!0,emptyLabel:u="not enough data",className:p,testId:f,label:j,stretch:g=!1}){let v=`spark${(0,d.useId)().replace(/:/g,"")}`;if(e.length<2)return(0,s.jsx)("div",{className:(0,r.f)("flex h-8 items-center text-xs italic text-text-muted",p),"data-testid":f,children:u});let b=i.v[t],N=c??(o?Math.max(100,...e):Math.max(...e,m??0)||1),w=n-4,y=a/(e.length-1),k=e=>2+w-Math.max(0,e)/N*w,S=e.map((e,s)=>[s*y,k(e)]),_=S.map(([e,s])=>`${e.toFixed(1)},${s.toFixed(1)}`).join(" "),C=S[S.length-1];return(0,s.jsxs)("svg",{width:g?"100%":a,height:n,viewBox:`0 0 ${a} ${n}`,preserveAspectRatio:g?"none":void 0,className:(0,r.f)("block overflow-visible",p),"data-testid":f,role:j?"img":void 0,"aria-label":j,"aria-hidden":!j||void 0,children:[l&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("defs",{children:(0,s.jsxs)("linearGradient",{id:v,x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:b,stopOpacity:.35}),(0,s.jsx)("stop",{offset:"100%",stopColor:b,stopOpacity:0})]})}),(0,s.jsx)("polygon",{points:`0,${n} ${_} ${a},${n}`,fill:`url(#${v})`})]}),void 0!==m&&(0,s.jsx)("line",{x1:0,x2:a,y1:k(m),y2:k(m),stroke:"var(--color-warning)",strokeOpacity:.5,strokeDasharray:"3 3",strokeWidth:1}),(0,s.jsx)("polyline",{fill:"none",stroke:b,strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round",points:_}),h&&!g&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("circle",{cx:C[0],cy:C[1],r:2.5,fill:b,className:"origin-center animate-halo [transform-box:fill-box]"}),(0,s.jsx)("circle",{cx:C[0],cy:C[1],r:2,fill:b})]})]})}e.s(["f",0,x],55427),e.s(["N",0,function({title:e,description:t,children:a,className:r,action:i,tone:l,corners:c=!1,...o}){return(0,s.jsx)(n.f,{...o,tone:l,corners:c,title:e,description:t,action:i,className:r,children:a})},"n",0,function({label:e,value:l,icon:c,trend:d,spark:m,meter:h,delta:u,tone:p="primary",className:f,testId:j}){let g=!u||u.value>=0===(u.positiveIsGood??!0);return(0,s.jsxs)(n.f,{tone:p,className:(0,r.f)("overflow-hidden",f),testId:j,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-[0.15em] text-text-muted",children:e}),c&&(0,s.jsx)("span",{className:"text-primary/60",children:c})]}),(0,s.jsxs)("div",{className:"mt-2 flex items-end justify-between gap-2",children:[(0,s.jsx)("div",{className:(0,r.f)("num text-2xl font-bold","primary"===p?"text-primary neon-text":i.T[p]),children:l}),u&&0!==u.value&&(0,s.jsxs)("span",{className:(0,r.f)("num mb-1 inline-flex items-center gap-0.5 text-[11px]",g?"text-success":"text-danger"),children:[u.value>0?(0,s.jsx)(a.f,{className:"h-3 w-3"}):(0,s.jsx)(t,{className:"h-3 w-3"}),Math.abs(u.value).toFixed(+!Number.isInteger(u.value)),u.unit]})]}),d&&(0,s.jsx)("div",{className:(0,r.f)("mt-1 text-[11px]",d.positive?"text-success":"text-danger"),children:d.value}),void 0!==h&&(0,s.jsx)(o,{value:h,className:"mt-3",label:e}),m&&m.length>1&&(0,s.jsx)("div",{className:"-mx-5 -mb-5 mt-3 opacity-80",children:(0,s.jsx)(x,{values:m,tone:p,width:240,height:28,stretch:!0,live:!1})})]})}],93999)},3062,e=>{var s=e.i(43476),t=e.i(78571),a=e.i(35084);let r={primary:"[--panel-corner-color:color-mix(in_srgb,var(--color-primary)_60%,transparent)]",accent:"[--panel-corner-color:color-mix(in_srgb,var(--color-accent)_70%,transparent)]",success:"[--panel-corner-color:color-mix(in_srgb,var(--color-success)_60%,transparent)]",warning:"[--panel-corner-color:color-mix(in_srgb,var(--color-warning)_70%,transparent)]",danger:"[--panel-corner-color:color-mix(in_srgb,var(--color-danger)_70%,transparent)]",info:"[--panel-corner-color:color-mix(in_srgb,var(--color-info)_60%,transparent)]",muted:"[--panel-corner-color:var(--color-border-strong)]"},n={primary:"[--glow-hover-color:var(--color-glow)]",accent:"[--glow-hover-color:var(--color-glow-accent)]",success:"[--glow-hover-color:var(--color-glow-success)]",warning:"[--glow-hover-color:var(--color-glow-warning)]",danger:"[--glow-hover-color:var(--color-glow-danger)]",info:"[--glow-hover-color:var(--color-glow)]",muted:"[--glow-hover-color:var(--color-glow)]"},i={primary:"hover:border-primary/30",accent:"hover:border-accent/40",success:"hover:border-success/30",warning:"hover:border-warning/40",danger:"hover:border-danger/40",info:"hover:border-info/30",muted:"hover:border-border-strong"},l={none:"",sm:"p-3",md:"p-5",lg:"p-6"};e.s(["f",0,function({tone:e="primary",corners:c=!0,interactive:o=!0,hero:d=!1,title:x,description:m,icon:h,action:u,as:p="div",padding:f="md",testId:j,className:g,children:v,...b}){return(0,s.jsxs)(p,{...b,"data-testid":j??b["data-testid"],className:(0,t.f)("relative rounded-panel border border-border bg-surface transition-colors duration-300",l[f],c&&"panel-corners",c&&r[e],o&&"glow-hover",o&&n[e],o&&i[e],d&&"grid-bg overflow-hidden bg-surface/80",g),children:[(x||u||h)&&(0,s.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[h&&(0,s.jsx)("span",{className:(0,t.f)("mt-0.5 shrink-0",a.T[e]),children:h}),(0,s.jsxs)("div",{className:"min-w-0",children:[x&&(0,s.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider",children:x}),m&&(0,s.jsx)("p",{className:"mt-0.5 text-[11px] text-text-muted",children:m})]})]}),u]}),v]})}])},63376,e=>{var s=e.i(43476);e.s(["z",0,function({children:e,className:t}){return(0,s.jsx)("div",{className:`animate-page-in${t?` ${t}`:""}`,children:e})},"U",0,function({children:e,className:t}){return(0,s.jsx)("div",{className:t,children:e})}])},88187,69074,e=>{var s=e.i(43476),t=e.i(32181),a=e.i(31278),r=e.i(95468),n=e.i(73884),i=e.i(63639);e.s(["f",0,function({title:e,description:l,nodes:c,scanning:o}){return(0,s.jsxs)(t.f.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.4,ease:[.16,1,.3,1]},className:"rounded border border-primary/30 bg-surface p-6 relative overflow-hidden",children:[o&&(0,s.jsx)(t.f.div,{className:"absolute inset-0 pointer-events-none",initial:{opacity:0},animate:{opacity:1},children:(0,s.jsx)(t.f.div,{className:"absolute left-0 right-0 h-px bg-gradient-to-r from-transparent via-primary/60 to-transparent",animate:{top:["0%","100%"]},transition:{duration:2,repeat:1/0,ease:"linear"}})}),(0,s.jsx)("div",{className:"absolute inset-0 rounded pointer-events-none",style:{boxShadow:o?"0 0 20px var(--color-glow), inset 0 0 20px rgba(0,229,255,0.03)":"none",transition:"box-shadow 0.5s ease"}}),(0,s.jsxs)("div",{className:"relative z-10",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[o?(0,s.jsx)(t.f.div,{animate:{rotate:360},transition:{duration:2,repeat:1/0,ease:"linear"},children:(0,s.jsx)(i.f,{className:"h-5 w-5 text-primary"})}):(0,s.jsx)(r.f,{className:"h-5 w-5 text-success"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-sm font-bold uppercase tracking-wider",children:o?e:"Scan Complete"}),l&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:l})]})]}),c.length>0&&(0,s.jsx)("div",{className:"space-y-2",children:c.map((e,i)=>(0,s.jsxs)(t.f.div,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:{delay:.05*i,duration:.3},className:"flex items-center gap-3 text-xs",children:["scanning"===e.status&&(0,s.jsx)(a.f,{className:"h-3.5 w-3.5 text-primary animate-spin"}),"done"===e.status&&(0,s.jsx)(r.f,{className:"h-3.5 w-3.5 text-success"}),"error"===e.status&&(0,s.jsx)(n.f,{className:"h-3.5 w-3.5 text-danger"}),(0,s.jsx)("span",{className:"text-text",children:e.nodeName}),"error"===e.status&&e.error&&(0,s.jsx)("span",{className:"text-[10px] text-danger/70 truncate max-w-[200px]",children:e.error})]},e.nodeId))}),0===c.length&&o&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:"Discovering nodes..."})]})]})}],88187);let l=(0,e.i(75254).f)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);e.s(["f",0,l],69074)},15057,e=>{let s=(0,e.i(75254).f)("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);e.s(["f",0,s],15057)},87316,e=>{let s=(0,e.i(75254).f)("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["f",0,s],87316)},95187,(e,s,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var a={callServer:function(){return n.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var r in a)Object.defineProperty(t,r,{enumerable:!0,get:a[r]});let n=e.r(32120),i=e.r(92245),l=e.r(35326)}])})();
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,47061,e=>{var s=e.i(43476),t=e.i(71645),a=e.i(68759),r=e.i(46670),n=e.i(93999),i=e.i(32568),l=e.i(82983),c=e.i(34479),o=e.i(4050),d=e.i(95187);let x=(0,d.createServerReference)("4054c54ac9ff960df5c4a5b1cdf0a0ffb4926401fc",d.callServer,void 0,d.findSourceMapURL,"scanCron");var m=e.i(78571),h=e.i(63376),u=e.i(88187),p=e.i(16715),f=e.i(55436),j=e.i(3116),g=e.i(18393),v=e.i(64659),b=e.i(63059),N=e.i(69074),w=e.i(31278),y=e.i(68054),k=e.i(87316),S=e.i(78894),_=e.i(95468),C=e.i(73884);e.s(["default",0,function(){let{activeNode:e}=(0,o.l)(),[d,I]=(0,t.useState)([]),[E,$]=(0,t.useState)(!1),[L,D]=(0,t.useState)(null),[M,R]=(0,t.useState)(!1),[T,A]=(0,t.useState)(""),[O,z]=(0,t.useState)(new Set),[U,P]=(0,t.useState)(null),[F,G]=(0,t.useState)("1.0.0"),[W,K]=(0,t.useState)(""),[H,B]=(0,t.useState)(!1),J=(0,t.useCallback)(async()=>{$(!0),I([]),D(null);let s=Date.now();try{let s=await x(e.id);if(s.success&&Array.isArray(s.data)){let e=s.data.map(e=>({...e,status:"error"===e.status?"error":"done"}));I(e);let t=new Set(e.filter(e=>e.jobs.length>0).map(e=>e.nodeId));z(t.size>0?t:new Set(e.map(e=>e.nodeId)))}else D(s.error?.message??"Scan returned unsuccessful response")}catch(s){let e=s instanceof Error?s.message:"Scan request failed";D(e)}finally{let e=Date.now()-s;e<1500&&await new Promise(s=>setTimeout(s,1500-e)),$(!1),R(!0)}},[e]);(0,t.useEffect)(()=>{e&&J()},[e,J]);let V=d.reduce((e,s)=>e+("done"===s.status?s.jobs.length:0),0),q=d.filter(e=>"done"===e.status).length,Q=d.filter(e=>"error"===e.status).length,Y=e=>{if(!T)return!0;let s=T.toLowerCase();return e.name.toLowerCase().includes(s)||e.command.toLowerCase().includes(s)||e.schedule.toLowerCase().includes(s)||(e.user?.toLowerCase().includes(s)??!1)},Z=async()=>{if(U&&F){B(!0);try{let e=JSON.stringify({name:U.job.name,version:F,schedule:U.job.schedule,command:U.job.command,description:W},null,2);await l.f.library.files.create({name:`${U.job.name} v${F}`,fileName:`${U.job.name}-${F}.json`,mimeType:"application/x-magnus-cronjob",content:e,tags:["cronjob","cron"]}),P(null),G("1.0.0"),K("")}catch{}finally{B(!1)}}};return(0,s.jsxs)(h.U,{className:"space-y-6",children:[(0,s.jsx)(h.z,{children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-lg font-bold uppercase tracking-wider",children:"Cron Jobs"}),(0,s.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:"Discover and manage scheduled jobs across your fleet"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[M&&!E&&(0,s.jsxs)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider mr-2",children:[d.length," node",1!==d.length?"s":""," · ",V," job",1!==V?"s":"",Q>0&&` \xb7 ${Q} error${1!==Q?"s":""}`]}),(0,s.jsxs)(a.K,{variant:"secondary",size:"sm",onClick:()=>void J(),disabled:E,children:[(0,s.jsx)(p.f,{className:(0,m.f)("h-3.5 w-3.5 mr-1.5",E&&"animate-spin")}),E?"Scanning...":"Rescan"]})]})]})}),E&&(0,s.jsx)(h.z,{children:(0,s.jsx)(u.f,{title:"Scanning Nodes for Cron Jobs",description:"Probing all online nodes...",nodes:d.map(e=>({nodeId:e.nodeId,nodeName:e.nodeName,status:e.status,error:e.error})),scanning:!0})}),!E&&M&&V>0&&(0,s.jsx)(h.z,{children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(f.f,{className:"absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-text-muted"}),(0,s.jsx)("input",{type:"text",placeholder:"Search jobs by name, command, or schedule...",value:T,onChange:e=>A(e.target.value),className:(0,m.f)(i.W,"pl-9")})]})}),!E&&M&&L&&(0,s.jsx)(h.z,{children:(0,s.jsx)(n.N,{children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,s.jsx)(S.f,{className:"h-10 w-10 text-danger/60 mb-3"}),(0,s.jsx)("p",{className:"text-xs font-bold text-danger mb-1",children:"Scan Failed"}),(0,s.jsx)("p",{className:"text-[11px] text-text-muted max-w-md",children:L}),(0,s.jsxs)(a.K,{variant:"secondary",size:"sm",className:"mt-4",onClick:()=>void J(),children:[(0,s.jsx)(p.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Retry Scan"]})]})})}),!E&&M&&!L&&(0,s.jsxs)(s.Fragment,{children:[0===d.length?(0,s.jsx)(h.z,{children:(0,s.jsx)(n.N,{children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,s.jsx)(g.f,{className:"h-10 w-10 text-text-muted/40 mb-3"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"No online nodes found to scan. Ensure at least one node agent is running and connected."})]})})}):d.map(e=>{let t=O.has(e.nodeId),i=e.jobs.filter(Y);return(0,s.jsx)(h.z,{children:(0,s.jsxs)(n.N,{className:"overflow-hidden",children:[(0,s.jsxs)("button",{onClick:()=>{var s;return s=e.nodeId,void z(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t})},className:"w-full flex items-center gap-4 p-4 text-left hover:bg-surface-hover transition-all",children:[(0,s.jsx)("div",{className:"flex h-9 w-9 items-center justify-center rounded border border-primary/30 bg-primary/5 shrink-0",children:(0,s.jsx)(g.f,{className:"h-4 w-4 text-primary"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider",children:e.nodeName}),"done"===e.status&&(0,s.jsxs)(r.t,{variant:e.jobs.length>0?"success":"default",children:[e.jobs.length," job",1!==e.jobs.length?"s":""]}),"error"===e.status&&((0,c.f)(e.error)?(0,s.jsx)(r.t,{variant:"default",children:"Disabled"}):(0,s.jsx)(r.t,{variant:"danger",children:"Error"}))]}),"error"===e.status&&e.error&&(0,s.jsx)("p",{className:(0,m.f)("text-[11px] mt-0.5 truncate",(0,c.f)(e.error)?"text-text-muted":"text-danger"),children:(0,c.f)(e.error)??e.error}),"done"===e.status&&0===e.jobs.length&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted mt-0.5",children:"No cron jobs found on this node"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:["done"===e.status?(0,s.jsx)(_.f,{className:"h-4 w-4 text-success"}):(0,s.jsx)(C.f,{className:"h-4 w-4 text-danger"}),t?(0,s.jsx)(v.f,{className:"h-4 w-4 text-text-muted"}):(0,s.jsx)(b.f,{className:"h-4 w-4 text-text-muted"})]})]}),t&&"done"===e.status&&(0,s.jsx)("div",{className:"border-t border-border/50 bg-bg/50",children:0===i.length?(0,s.jsx)("div",{className:"flex items-center justify-center py-8 text-center",children:(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:0===e.jobs.length?"No cron jobs found on this node.":"No jobs match your search on this node."})}):(0,s.jsx)("div",{className:"divide-y divide-border/30",children:i.map((t,n)=>(0,s.jsxs)("div",{className:"p-4 space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(j.f,{className:"h-4 w-4 text-primary"}),(0,s.jsx)("span",{className:"text-xs font-bold",children:t.name}),t.user&&(0,s.jsx)(r.t,{variant:"default",children:t.user}),(0,s.jsx)(r.t,{variant:"info",children:t.schedule})]}),(0,s.jsxs)(a.K,{size:"sm",variant:"secondary",onClick:()=>{P({job:t,nodeId:e.nodeId,nodeName:e.nodeName}),G("1.0.0"),K("")},children:[(0,s.jsx)(N.f,{className:"h-3 w-3 mr-1"}),"Publish"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 text-[11px] text-text-muted",children:[(0,s.jsx)(k.f,{className:"h-3 w-3"}),function(e){let s=e.split(/\s+/);if(s.length<5)return e;let[t,a,r,n,i]=s;return"*"===t&&"*"===a&&"*"===r&&"*"===n&&"*"===i?"Every minute":"0"===t&&"*"===a&&"*"===r&&"*"===n&&"*"===i?"Every hour":"0"===t&&"0"===a&&"*"===r&&"*"===n&&"*"===i?"Daily at midnight":t?.startsWith("*/")?`Every ${t.slice(2)} minutes`:a?.startsWith("*/")?`Every ${a.slice(2)} hours`:e}(t.schedule)]}),(0,s.jsxs)("div",{className:"flex items-start gap-2 rounded border border-border bg-surface p-3",children:[(0,s.jsx)(y.f,{className:"h-3.5 w-3.5 text-primary mt-0.5 shrink-0"}),(0,s.jsx)("pre",{className:"text-xs whitespace-pre-wrap break-all flex-1",children:t.command})]})]},`${t.name}-${n}`))})})]})},e.nodeId)}),d.length>0&&(0,s.jsx)(h.z,{children:(0,s.jsxs)("div",{className:"flex items-center justify-between text-[10px] text-text-muted uppercase tracking-wider",children:[(0,s.jsxs)("span",{children:[q," node",1!==q?"s":""," scanned ·"," ",V," job",1!==V?"s":""," discovered"]}),Q>0&&(0,s.jsxs)("span",{className:"text-danger",children:[Q," node",1!==Q?"s":""," unreachable"]})]})})]}),(0,s.jsx)(i.n,{open:!!U,onClose:()=>P(null),title:"Publish to Library",description:U?.job.name??"",icon:(0,s.jsx)(N.f,{className:"h-5 w-5 text-primary"}),children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-[11px] font-bold uppercase tracking-wider mb-1.5",children:["Version ",(0,s.jsx)("span",{className:"text-accent",children:"*"})]}),(0,s.jsx)("input",{type:"text",value:F,onChange:e=>G(e.target.value),placeholder:"1.0.0",className:i.W})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-[11px] font-bold uppercase tracking-wider mb-1.5",children:"Description"}),(0,s.jsx)("input",{type:"text",value:W,onChange:e=>K(e.target.value),placeholder:"What does this cron job do?",className:i.W})]}),U&&(0,s.jsxs)("div",{className:"rounded border border-border bg-bg p-3 text-xs space-y-1",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-text-muted",children:"Source:"})," ",U.nodeName]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-text-muted",children:"Schedule:"})," ",U.job.schedule]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-text-muted",children:"Command:"})," ",(0,s.jsx)("span",{className:"text-primary",children:U.job.command})]})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,s.jsx)(a.K,{variant:"secondary",size:"sm",onClick:()=>P(null),children:"Cancel"}),(0,s.jsx)(a.K,{size:"sm",onClick:()=>void Z(),disabled:H||!F,children:H?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.f,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Publishing..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(N.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Publish"]})})]})]})})]})}],47061)},46670,e=>{var s=e.i(43476),t=e.i(78571);let a={default:"border-border text-text-muted",success:"border-success/40 text-success bg-success/5 shadow-[0_0_6px_rgba(0,255,65,0.15)]",warning:"border-warning/40 text-warning bg-warning/5 shadow-[0_0_6px_rgba(255,179,0,0.15)]",danger:"border-danger/40 text-danger bg-danger/5 shadow-[0_0_6px_rgba(255,23,68,0.15)]",info:"border-info/40 text-info bg-info/5 shadow-[0_0_6px_rgba(0,176,255,0.15)]"},r={default:"bg-text-muted",success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info"};e.s(["t",0,function({children:e,variant:n="default",className:i,dot:l=!1,pulse:c=!1}){return(0,s.jsxs)("span",{className:(0,t.f)("inline-flex items-center gap-1.5 rounded-chip border px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider",a[n],i),children:[l&&(0,s.jsxs)("span",{"aria-hidden":"true",className:"relative inline-flex h-1.5 w-1.5",children:[c&&(0,s.jsx)("span",{className:(0,t.f)("absolute inset-0 rounded-full animate-halo",r[n])}),(0,s.jsx)("span",{className:(0,t.f)("relative inline-flex h-1.5 w-1.5 rounded-full",r[n])})]}),e]})},"k",0,function(e){switch(e.toUpperCase()){case"ONLINE":case"COMPLETED":case"ACTIVE":case"RUNNING":case"INSTALLED":case"HEALTHY":return"success";case"DEGRADED":case"PAUSED":case"QUEUED":case"PENDING":case"INSTALLING":return"warning";case"OFFLINE":case"FAILED":case"ERROR":case"TIMEOUT":case"CANCELLED":case"DECOMMISSIONED":case"CRITICAL":return"danger";case"PROVISIONING":case"UPDATING":return"info";default:return"default"}}])},93999,51196,55427,e=>{var s=e.i(43476);let t=(0,e.i(75254).f)("ArrowDownRight",[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]);var a=e.i(15057),r=e.i(78571),n=e.i(3062),i=e.i(35084);let l={warning:"shadow-[0_0_6px_var(--color-warning)]",danger:"shadow-[0_0_8px_var(--color-danger)]",accent:"shadow-[0_0_6px_var(--color-accent)]",primary:"shadow-[0_0_6px_var(--color-primary)]"},c={xs:"h-1",sm:"h-1.5",md:"h-2"};function o({value:e,max:t=100,tone:a,thresholds:n=i.q,label:d,size:x="xs",showValue:m=!1,valueLabel:h,glow:u,className:p,testId:f}){let j="number"==typeof e&&Number.isFinite(e),g=j?Math.max(0,Math.min(100,e/(t||1)*100)):0,v=a??(j?(0,i.Z)(g,n):"muted"),b=u||!a&&j&&g>=n.warn,N=h??(j?`${g.toFixed(+(g<10&&g>0))}%`:"—");return(0,s.jsxs)("div",{className:(0,r.f)("flex min-w-0 items-center gap-2",p),"data-testid":f,children:[(0,s.jsx)("div",{role:"meter","aria-label":d,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":j?e:void 0,"aria-valuetext":N,className:(0,r.f)("relative flex-1 overflow-hidden rounded-full bg-border/70",c[x]),children:(0,s.jsx)("div",{style:{"--meter":`${g}%`},className:(0,r.f)("h-full w-(--meter) rounded-full transition-[width] duration-700 ease-out-expo starting:w-0",i.H[v],b&&l[v])})}),m&&(0,s.jsx)("span",{className:(0,r.f)("num w-11 shrink-0 text-right text-[11px]",j?i.T[v]:"text-text-muted"),children:N})]})}e.s(["f",0,o],51196);var d=e.i(71645);function x({values:e,tone:t="primary",width:a=160,height:n=32,area:l=!0,max:c,percent:o=!1,threshold:m,live:h=!0,emptyLabel:u="not enough data",className:p,testId:f,label:j,stretch:g=!1}){let v=`spark${(0,d.useId)().replace(/:/g,"")}`;if(e.length<2)return(0,s.jsx)("div",{className:(0,r.f)("flex h-8 items-center text-xs italic text-text-muted",p),"data-testid":f,children:u});let b=i.v[t],N=c??(o?Math.max(100,...e):Math.max(...e,m??0)||1),w=n-4,y=a/(e.length-1),k=e=>2+w-Math.max(0,e)/N*w,S=e.map((e,s)=>[s*y,k(e)]),_=S.map(([e,s])=>`${e.toFixed(1)},${s.toFixed(1)}`).join(" "),C=S[S.length-1];return(0,s.jsxs)("svg",{width:g?"100%":a,height:n,viewBox:`0 0 ${a} ${n}`,preserveAspectRatio:g?"none":void 0,className:(0,r.f)("block overflow-visible",p),"data-testid":f,role:j?"img":void 0,"aria-label":j,"aria-hidden":!j||void 0,children:[l&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("defs",{children:(0,s.jsxs)("linearGradient",{id:v,x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:b,stopOpacity:.35}),(0,s.jsx)("stop",{offset:"100%",stopColor:b,stopOpacity:0})]})}),(0,s.jsx)("polygon",{points:`0,${n} ${_} ${a},${n}`,fill:`url(#${v})`})]}),void 0!==m&&(0,s.jsx)("line",{x1:0,x2:a,y1:k(m),y2:k(m),stroke:"var(--color-warning)",strokeOpacity:.5,strokeDasharray:"3 3",strokeWidth:1}),(0,s.jsx)("polyline",{fill:"none",stroke:b,strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round",points:_}),h&&!g&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("circle",{cx:C[0],cy:C[1],r:2.5,fill:b,className:"origin-center animate-halo [transform-box:fill-box]"}),(0,s.jsx)("circle",{cx:C[0],cy:C[1],r:2,fill:b})]})]})}e.s(["f",0,x],55427),e.s(["N",0,function({title:e,description:t,children:a,className:r,action:i,tone:l,corners:c=!1,...o}){return(0,s.jsx)(n.f,{...o,tone:l,corners:c,title:e,description:t,action:i,className:r,children:a})},"n",0,function({label:e,value:l,icon:c,trend:d,spark:m,meter:h,delta:u,tone:p="primary",className:f,testId:j}){let g=!u||u.value>=0===(u.positiveIsGood??!0);return(0,s.jsxs)(n.f,{tone:p,className:(0,r.f)("overflow-hidden",f),testId:j,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-[0.15em] text-text-muted",children:e}),c&&(0,s.jsx)("span",{className:"text-primary/60",children:c})]}),(0,s.jsxs)("div",{className:"mt-2 flex items-end justify-between gap-2",children:[(0,s.jsx)("div",{className:(0,r.f)("num text-2xl font-bold","primary"===p?"text-primary neon-text":i.T[p]),children:l}),u&&0!==u.value&&(0,s.jsxs)("span",{className:(0,r.f)("num mb-1 inline-flex items-center gap-0.5 text-[11px]",g?"text-success":"text-danger"),children:[u.value>0?(0,s.jsx)(a.f,{className:"h-3 w-3"}):(0,s.jsx)(t,{className:"h-3 w-3"}),Math.abs(u.value).toFixed(+!Number.isInteger(u.value)),u.unit]})]}),d&&(0,s.jsx)("div",{className:(0,r.f)("mt-1 text-[11px]",d.positive?"text-success":"text-danger"),children:d.value}),void 0!==h&&(0,s.jsx)(o,{value:h,className:"mt-3",label:e}),m&&m.length>1&&(0,s.jsx)("div",{className:"-mx-5 -mb-5 mt-3 opacity-80",children:(0,s.jsx)(x,{values:m,tone:p,width:240,height:28,stretch:!0,live:!1})})]})}],93999)},3062,e=>{var s=e.i(43476),t=e.i(78571),a=e.i(35084);let r={primary:"[--panel-corner-color:color-mix(in_srgb,var(--color-primary)_60%,transparent)]",accent:"[--panel-corner-color:color-mix(in_srgb,var(--color-accent)_70%,transparent)]",success:"[--panel-corner-color:color-mix(in_srgb,var(--color-success)_60%,transparent)]",warning:"[--panel-corner-color:color-mix(in_srgb,var(--color-warning)_70%,transparent)]",danger:"[--panel-corner-color:color-mix(in_srgb,var(--color-danger)_70%,transparent)]",info:"[--panel-corner-color:color-mix(in_srgb,var(--color-info)_60%,transparent)]",muted:"[--panel-corner-color:var(--color-border-strong)]"},n={primary:"[--glow-hover-color:var(--color-glow)]",accent:"[--glow-hover-color:var(--color-glow-accent)]",success:"[--glow-hover-color:var(--color-glow-success)]",warning:"[--glow-hover-color:var(--color-glow-warning)]",danger:"[--glow-hover-color:var(--color-glow-danger)]",info:"[--glow-hover-color:var(--color-glow)]",muted:"[--glow-hover-color:var(--color-glow)]"},i={primary:"hover:border-primary/30",accent:"hover:border-accent/40",success:"hover:border-success/30",warning:"hover:border-warning/40",danger:"hover:border-danger/40",info:"hover:border-info/30",muted:"hover:border-border-strong"},l={none:"",sm:"p-3",md:"p-5",lg:"p-6"};e.s(["f",0,function({tone:e="primary",corners:c=!0,interactive:o=!0,hero:d=!1,title:x,description:m,icon:h,action:u,as:p="div",padding:f="md",testId:j,className:g,children:v,...b}){return(0,s.jsxs)(p,{...b,"data-testid":j??b["data-testid"],className:(0,t.f)("relative rounded-panel border border-border bg-surface transition-colors duration-300",l[f],c&&"panel-corners",c&&r[e],o&&"glow-hover",o&&n[e],o&&i[e],d&&"grid-bg overflow-hidden bg-surface/80",g),children:[(x||u||h)&&(0,s.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[h&&(0,s.jsx)("span",{className:(0,t.f)("mt-0.5 shrink-0",a.T[e]),children:h}),(0,s.jsxs)("div",{className:"min-w-0",children:[x&&(0,s.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider",children:x}),m&&(0,s.jsx)("p",{className:"mt-0.5 text-[11px] text-text-muted",children:m})]})]}),u]}),v]})}])},63376,e=>{var s=e.i(43476);e.s(["z",0,function({children:e,className:t}){return(0,s.jsx)("div",{className:`animate-page-in${t?` ${t}`:""}`,children:e})},"U",0,function({children:e,className:t}){return(0,s.jsx)("div",{className:t,children:e})}])},88187,69074,e=>{var s=e.i(43476),t=e.i(32181),a=e.i(31278),r=e.i(95468),n=e.i(73884),i=e.i(63639);e.s(["f",0,function({title:e,description:l,nodes:c,scanning:o}){return(0,s.jsxs)(t.f.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.4,ease:[.16,1,.3,1]},className:"rounded border border-primary/30 bg-surface p-6 relative overflow-hidden",children:[o&&(0,s.jsx)(t.f.div,{className:"absolute inset-0 pointer-events-none",initial:{opacity:0},animate:{opacity:1},children:(0,s.jsx)(t.f.div,{className:"absolute left-0 right-0 h-px bg-gradient-to-r from-transparent via-primary/60 to-transparent",animate:{top:["0%","100%"]},transition:{duration:2,repeat:1/0,ease:"linear"}})}),(0,s.jsx)("div",{className:"absolute inset-0 rounded pointer-events-none",style:{boxShadow:o?"0 0 20px var(--color-glow), inset 0 0 20px rgba(0,229,255,0.03)":"none",transition:"box-shadow 0.5s ease"}}),(0,s.jsxs)("div",{className:"relative z-10",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[o?(0,s.jsx)(t.f.div,{animate:{rotate:360},transition:{duration:2,repeat:1/0,ease:"linear"},children:(0,s.jsx)(i.f,{className:"h-5 w-5 text-primary"})}):(0,s.jsx)(r.f,{className:"h-5 w-5 text-success"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-sm font-bold uppercase tracking-wider",children:o?e:"Scan Complete"}),l&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:l})]})]}),c.length>0&&(0,s.jsx)("div",{className:"space-y-2",children:c.map((e,i)=>(0,s.jsxs)(t.f.div,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:{delay:.05*i,duration:.3},className:"flex items-center gap-3 text-xs",children:["scanning"===e.status&&(0,s.jsx)(a.f,{className:"h-3.5 w-3.5 text-primary animate-spin"}),"done"===e.status&&(0,s.jsx)(r.f,{className:"h-3.5 w-3.5 text-success"}),"error"===e.status&&(0,s.jsx)(n.f,{className:"h-3.5 w-3.5 text-danger"}),(0,s.jsx)("span",{className:"text-text",children:e.nodeName}),"error"===e.status&&e.error&&(0,s.jsx)("span",{className:"text-[10px] text-danger/70 truncate max-w-[200px]",children:e.error})]},e.nodeId))}),0===c.length&&o&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:"Discovering nodes..."})]})]})}],88187);let l=(0,e.i(75254).f)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);e.s(["f",0,l],69074)},15057,e=>{let s=(0,e.i(75254).f)("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);e.s(["f",0,s],15057)},87316,e=>{let s=(0,e.i(75254).f)("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["f",0,s],87316)},95187,(e,s,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var a={callServer:function(){return n.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var r in a)Object.defineProperty(t,r,{enumerable:!0,get:a[r]});let n=e.r(32120),i=e.r(92245),l=e.r(35326)}])})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,68288,e=>{var t=e.i(43476),a=e.i(71645),r=e.i(4050),s=e.i(82983);let n=0,i=Date.now(),l=[],o=null,c=!1;function d(e,t){let a;(a=Date.now())-i>=6e4&&(n=0,i=a),n>=20||(n++,l.push({nodeId:"__dashboard__",source:"dashboard",level:"error",message:e,metadata:t,timestamp:new Date().toISOString()}))}async function u(){if(0===l.length)return;let e=l.splice(0,l.length);try{await s.f.logs.ingest(e)}catch{}}var m=e.i(52928),x=e.i(53034),f=e.i(37806),h=e.i(47414);function p({children:e,...r}){let s=(0,a.useContext)(f.f);(r={...s,...r}).transition=(0,x.f)(r.transition,s.transition),r.isStatic=(0,h.f)(()=>r.isStatic);let n=(0,a.useMemo)(()=>r,[JSON.stringify(r.transition),r.transformPagePoint,r.reducedMotion,r.skipAnimations,r.isValidProp]);return(0,t.jsx)(f.f.Provider,{value:n,children:e})}var b=e.i(72603);e.s(["Providers",0,function({children:e}){return(0,a.useEffect)(()=>((0,b.P)(),function(){if(c)return()=>{};c=!0;let e=e=>{d(`Uncaught error: ${e.message}`,{url:window.location.pathname,filename:e.filename??"unknown",lineno:e.lineno??0,colno:e.colno??0})},t=e=>{let t=e.reason,a=t instanceof Error?t.message:String(t);d(`Unhandled rejection: ${a}`,{url:window.location.pathname})};return window.addEventListener("error",e),window.addEventListener("unhandledrejection",t),o=setInterval(()=>void u(),1e4),()=>{window.removeEventListener("error",e),window.removeEventListener("unhandledrejection",t),o&&(clearInterval(o),o=null),u(),c=!1}}()),[]),(0,t.jsx)(p,{reducedMotion:"user",children:(0,t.jsx)(m.N,{children:(0,t.jsx)(r.v,{children:e})})})}],68288)},40073,e=>{var t=e.i(43476),a=e.i(71645),r=e.i(18566),s=e.i(22016),n=e.i(78571),i=e.i(64659),l=e.i(39616),o=e.i(7233),c=e.i(43531),d=e.i(4050),u=e.i(35673),m=e.i(15e3),x=e.i(39430);function f({status:e}){let a="online"===e?"Online":"offline"===e?"Offline":"Checking…";return(0,t.jsx)("span",{role:"status","aria-label":a,className:`inline-block h-2 w-2 shrink-0 rounded-full ${"online"===e?"bg-success":"offline"===e?"bg-danger":"bg-text-muted/40 animate-pulse"}`,title:a})}function h(){let{nodes:e,activeNode:r,switchNode:s,loading:n}=(0,d.l)(),[h,p]=(0,a.useState)(!1),[b,g]=(0,a.useState)(!1),[y,v]=(0,a.useState)(!1),w=(0,a.useRef)(null),[k,j]=(0,a.useState)({}),N=(0,a.useRef)(null),C=(0,a.useMemo)(()=>e.length>0?e:[m.f],[e]),S=(0,a.useCallback)(async()=>{let e={};await Promise.allSettled(C.map(async t=>{try{let a=(0,x.L)(t.url),r=await fetch("/api/proxy/health",{method:"GET",headers:a,signal:AbortSignal.timeout(6e3)});e[t.id]=r.ok?"online":"offline"}catch{e[t.id]="offline"}})),j(e)},[C]);return((0,a.useEffect)(()=>{S()},[S]),(0,a.useEffect)(()=>{if(h)return S(),N.current=setInterval(()=>void S(),3e4),()=>{N.current&&clearInterval(N.current)}},[h,S]),(0,a.useEffect)(()=>{if(h)return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)};function e(e){w.current&&!w.current.contains(e.target)&&p(!1)}function t(e){"Escape"===e.key&&p(!1)}},[h]),n)?(0,t.jsx)("div",{className:"mx-3 mt-2 mb-1 rounded border border-border bg-bg px-3 py-2 text-xs text-text-muted animate-pulse",children:"Loading…"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"relative mx-3 mt-2 mb-1",ref:w,children:[(0,t.jsx)("div",{className:"mb-1 px-0.5 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Node Controller"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)("button",{onClick:()=>p(!h),"aria-expanded":h,"aria-haspopup":"listbox","aria-label":`Node controller: ${r.name}`,className:"flex flex-1 items-center gap-2 rounded border border-border bg-bg px-2.5 py-1.5 text-left transition-all hover:bg-surface-hover min-w-0",children:[(0,t.jsx)(f,{status:k[r.id]??"unknown"}),(0,t.jsx)("span",{className:"flex-1 truncate text-xs font-medium",children:r.name}),(0,t.jsx)(i.f,{className:`h-3.5 w-3.5 shrink-0 text-text-muted transition-transform ${h?"rotate-180":""}`})]}),(0,t.jsx)("button",{onClick:function(){v(!1),g(!0)},className:"rounded border border-border bg-bg p-1.5 text-text-muted transition-all hover:bg-surface-hover hover:text-text",title:"Control Node Settings",children:(0,t.jsx)(l.f,{className:"h-3.5 w-3.5"})})]}),h&&(0,t.jsxs)("div",{className:"absolute left-3 right-3 z-50 mt-1 rounded border border-border bg-surface shadow-xl",children:[(0,t.jsx)("div",{role:"listbox","aria-label":"Control nodes",className:"max-h-48 overflow-y-auto py-1",children:C.map(e=>(0,t.jsxs)("button",{role:"option","aria-selected":e.id===r.id,onClick:()=>{s(e.id),p(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-all hover:bg-surface-hover",children:[(0,t.jsx)(f,{status:k[e.id]??"unknown"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"font-medium truncate",children:e.name}),(0,t.jsx)("div",{className:"text-text-muted truncate text-[10px]",children:e.url})]}),e.id===r.id&&(0,t.jsx)(c.f,{className:"h-3.5 w-3.5 shrink-0 text-primary"})]},e.id))}),(0,t.jsx)("div",{className:"border-t border-border",children:(0,t.jsxs)("button",{onClick:function(){p(!1),v(!0),g(!0)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-primary transition-all hover:bg-surface-hover",children:[(0,t.jsx)(o.f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"font-bold",children:"Add Control Node"})]})})]})]}),(0,t.jsx)(u.f,{open:b,onClose:()=>g(!1),createMode:y})]})}var p=e.i(32181),b=e.i(75254);let g=(0,b.f)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);var y=e.i(18393),v=e.i(68054),w=e.i(3116),k=e.i(78583);let j=(0,b.f)("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);var N=e.i(98919),C=e.i(31245),S=e.i(61911),M=e.i(62421),E=e.i(49582),_=e.i(53305),$=e.i(39312);let A=(0,b.f)("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);var L=e.i(10980);let R=(0,b.f)("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var P=e.i(65157);let T=(0,b.f)("HeartPulse",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"1uw2ng"}]]),O=(0,b.f)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var z=e.i(58041);let I=(0,b.f)("GitCompareArrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),D=(0,b.f)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 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.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),F=(0,b.f)("SquareActivity",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M17 12h-2l-2 5-2-10-2 5H7",key:"15hlnc"}]]);var K=e.i(81418);let U=(0,b.f)("ScanSearch",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);var H=e.i(97625),G=e.i(65261),q=e.i(34981),V=e.i(94827);let W=[{id:"fleet",label:"Fleet",tone:"primary",items:[{href:"/mission-control",label:"Mission Control",icon:R},{href:"/",label:"Overview",icon:g,exact:!0},{href:"/nodes",label:"Nodes",icon:y.f},{href:"/application-operations",label:"Applications",icon:T},{href:"/fleet-readiness",label:"Readiness",icon:V.f},{href:"/fleet-timeline",label:"Timeline",icon:O},{href:"/fleet-map",label:"Fleet Map",icon:A},{href:"/commands",label:"Commands",icon:v.f},{href:"/anomalies",label:"Anomalies",icon:M.f},{href:"/anomalies/remediation",label:"Remediation",icon:$.f},{href:"/governor/operations",label:"Operations",icon:E.f},{href:"/rollouts",label:"Rollouts",icon:D},{href:"/incidents",label:"Incidents",icon:F},{href:"/cron",label:"Cron Jobs",icon:w.f},{href:"/files",label:"Files",icon:k.f},{href:"/logs",label:"Logs",icon:j},{href:"/audit",label:"Audit",icon:N.f},{href:"/webhooks",label:"Webhooks",icon:_.f},{href:"/retention",label:"Retention",icon:z.f},{href:"/api-docs",label:"API Docs",icon:L.f}]},{id:"security",label:"Security",tone:"primary",integration:"securityConsole",items:[{href:"/security-fusion",label:"Fleet summary",icon:U,exact:!0}]},{id:"hermes",label:"Hermes Agent",tone:"accent",integration:"hermes",items:[{href:"/orchestra",label:"Overview",icon:C.f,exact:!0},{href:"/orchestra/installations",label:"Installations",icon:y.f},{href:"/orchestra/profiles",label:"Profiles",icon:S.f},{href:"/hermes-drift",label:"Drift Cockpit",icon:I},{href:"/hermes-security",label:"Proxy Security",icon:K.f},{href:"/orchestra/web-gateway",label:"Web Gateway",icon:P.f}]},{id:"ardent",label:"Magnus Ardent",tone:"primary",items:[{href:"/ardent",label:"Overview",icon:q.f,exact:!0},{href:"/ardent/installations",label:"Installations",icon:y.f},{href:"/ardent/profiles",label:"Profiles",icon:S.f}]},{id:"codex",label:"Codex Agent",tone:"primary",items:[{href:"/codex",label:"Overview",icon:H.f,exact:!0},{href:"/codex/installations",label:"Installations",icon:G.f}]}],B={"/":"Fleet Overview","/mission-control":"Mission Control","/nodes":"Nodes","/application-operations":"Application Operations","/fleet-readiness":"Fleet Readiness","/fleet-timeline":"Fleet Timeline","/fleet-map":"Fleet Map","/commands":"Commands","/anomalies":"Anomalies","/anomalies/remediation":"Auto-Remediation","/governor/operations":"Fleet Operations","/rollouts":"Guided Rollouts","/incidents":"Incident Workspace","/cron":"Cron Jobs","/files":"Files","/logs":"Logs","/audit":"Audit","/webhooks":"Webhooks","/retention":"Retention","/api-docs":"API Docs","/library":"Library","/skills":"Skills","/roles":"Roles","/sync":"Sync","/notifications":"Notification Preferences","/security-fusion":"Security","/orchestra":"Hermes Agent Fleet","/orchestra/installations":"Hermes Installations","/orchestra/profiles":"Hermes Profiles","/orchestra/web-gateway":"Web Gateway","/hermes-drift":"Hermes Drift Cockpit","/hermes-security":"Hermes Proxy Security","/ardent":"Magnus Ardent","/ardent/installations":"Ardent Installations","/ardent/profiles":"Ardent Profiles","/codex":"Codex Agent Fleet","/codex/installations":"Codex Installations"};function J(e,t,a=!1){return"/"===t||a?e===t:e===t||e.startsWith(`${t}/`)}function X(e){let t=null;for(let a of W)for(let r of a.items)!r.external&&J(e,r.href,r.exact)&&(null===t||r.href.length>t.length)&&(t=r.href);return t}var Z=e.i(16141);let Q={security:"from-primary/60 via-accent/20",hermes:"from-accent/50 via-accent/20",ardent:"from-primary/50 via-accent/20",codex:"from-primary/50 via-primary/20"};function Y({group:e,activeHref:a}){let r="accent"===e.tone;return(0,t.jsxs)(t.Fragment,{children:["fleet"!==e.id&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"mx-3 my-1",children:(0,t.jsx)("div",{className:(0,n.f)("h-px bg-gradient-to-r to-transparent",Q[e.id])})}),(0,t.jsx)("div",{className:"px-4 pb-0.5 pt-2",children:(0,t.jsx)("span",{className:(0,n.f)("text-[9px] font-bold uppercase tracking-[0.25em]",r?"text-accent/60":"text-primary/60"),children:e.label})})]}),(0,t.jsx)("nav",{className:(0,n.f)("space-y-0.5 p-3","fleet"!==e.id&&"pt-1"),"aria-label":e.label,children:e.items.map(e=>{let i=e.href===a,l=e.icon;return(0,t.jsxs)(s.default,{href:e.href,prefetch:!1,target:e.external?"_blank":void 0,rel:e.external?"noopener noreferrer":void 0,"aria-current":i?"page":void 0,className:(0,n.f)("group relative flex items-center gap-3 overflow-hidden rounded-chip px-3 py-2 text-xs uppercase tracking-wider transition-colors duration-200","before:pointer-events-none before:absolute before:inset-y-0 before:-left-1/2 before:w-1/2 before:-skew-x-12 before:bg-gradient-to-r before:from-transparent before:to-transparent before:opacity-0 before:transition-[left,opacity] before:duration-500 hover:before:left-full hover:before:opacity-100",r?"before:via-accent/10":"before:via-primary/10",i?(0,n.f)(r?"text-accent":"text-primary",r?"bg-accent/5":"bg-primary/5"):(0,n.f)("text-text-muted",r?"hover:text-accent":"hover:text-primary")),children:[i&&(0,t.jsx)(p.f.span,{layoutId:"sidebar-indicator",className:(0,n.f)("absolute bottom-1 left-0 top-1 w-0.5 rounded-full",r?"bg-accent":"bg-primary"),style:{boxShadow:r?"0 0 8px var(--color-accent), 0 0 16px var(--color-glow-accent)":"0 0 8px var(--color-primary), 0 0 16px var(--color-glow)"},transition:{type:"spring",stiffness:300,damping:30}}),(0,t.jsx)(l,{className:"relative h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"relative truncate",children:e.label})]},e.href)})})]})}function ee(){return(0,t.jsxs)("div",{className:"relative flex h-8 w-8 items-center justify-center animate-flicker",children:[(0,t.jsxs)("svg",{viewBox:"0 0 32 32",className:"h-8 w-8 overflow-visible","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"1",y:"1",width:"30",height:"30",rx:"4",fill:"none",stroke:"var(--color-primary)",strokeOpacity:"0.35"}),(0,t.jsx)("path",{d:"M8 23 V9 L16 18 L24 9 V23",fill:"none",stroke:"var(--color-primary)",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",pathLength:100,style:{"--stroke-length":100,strokeDasharray:100,animation:"draw-stroke 1.4s var(--ease-out-expo) both"},className:"drop-shadow-[0_0_4px_var(--color-primary)]"})]}),(0,t.jsx)("div",{className:"absolute inset-0 rounded shadow-[0_0_12px_var(--color-glow)]"})]})}function et(){let{connected:e}=(0,a.useSyncExternalStore)(Z.f.subscribe,Z.f.getSnapshot,Z.f.getServerSnapshot);return(0,t.jsxs)("span",{className:"flex items-center gap-1.5",title:e?"Live event stream connected":"Live event stream reconnecting",children:[(0,t.jsxs)("span",{className:"relative inline-flex h-1.5 w-1.5",children:[e&&(0,t.jsx)("span",{className:"absolute inset-0 rounded-full bg-success animate-halo"}),(0,t.jsx)("span",{className:(0,n.f)("relative inline-flex h-1.5 w-1.5 rounded-full",e?"bg-success shadow-[0_0_6px_var(--color-success)]":"bg-warning")})]}),(0,t.jsx)("span",{className:e?"text-success/70":"text-warning/70",children:e?"Live":"Offline"})]})}function ea({integrations:e}){let s=X((0,r.usePathname)()),n=(0,a.useMemo)(()=>(function(e,t=W){return t.filter(t=>{var a;return!t.integration||(a=t.integration,"securityConsole"===a?null!==e.securityConsoleUrl:e.hermes)}).map(t=>"security"===t.id&&e.securityConsoleUrl?{...t,items:[{href:e.securityConsoleUrl,label:"Security console ↗",icon:U,external:!0},...t.items]}:t)})(e),[e]);return(0,t.jsxs)("aside",{className:"relative flex h-full w-56 flex-col border-r border-border/50 bg-bg",children:[(0,t.jsx)("div",{className:"absolute bottom-0 right-0 top-0 w-px bg-gradient-to-b from-primary/60 via-primary/20 to-transparent"}),(0,t.jsxs)("div",{className:"flex h-14 items-center gap-3 border-b border-border/30 px-4",children:[(0,t.jsx)(ee,{}),(0,t.jsx)("span",{className:"text-sm font-bold uppercase tracking-[0.2em] text-text",children:"Magnus"})]}),(0,t.jsx)(h,{}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:n.map(e=>(0,t.jsx)(Y,{group:e,activeHref:s},e.id))}),(0,t.jsxs)("div",{className:"flex items-center justify-between border-t border-border/30 p-4 text-[10px] uppercase tracking-widest text-primary/40",children:[(0,t.jsxs)("span",{children:["Magnus v","1.0.2"]}),(0,t.jsx)(et,{})]})]})}var er=e.i(92270),es=e.i(16715);let en=(0,b.f)("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);var ei=e.i(55436),el=e.i(63059);let eo=(0,b.f)("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]),ec=(0,b.f)("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);var ed=e.i(78894),eu=e.i(63032),em=e.i(52571),ex=e.i(9912),ef=e.i(43034),eh=e.i(82983);function ep(){let[e,r]=(0,a.useState)(!1),[i,o]=(0,a.useState)([]),[d,u]=(0,a.useState)(0),[m,x]=(0,a.useState)(!1),f=(0,a.useRef)(null),h=(0,a.useCallback)(async()=>{try{let e=await eh.f.notifications.unreadCount();e.success&&e.data&&u(e.data.count)}catch{}},[]),p=(0,a.useCallback)(async()=>{x(!0);try{let e=await eh.f.notifications.list({pageSize:20});if(e.success&&e.data){let t=e.data;o(t.notifications)}}catch{}finally{x(!1)}},[]);(0,a.useEffect)(()=>{h();let e=setInterval(()=>void h(),15e3);return()=>clearInterval(e)},[h]),(0,a.useEffect)(()=>{e&&p()},[e,p]),(0,a.useEffect)(()=>{if(!e)return;let t=e=>{f.current&&!f.current.contains(e.target)&&r(!1)};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[e]),(0,a.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&r(!1)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]);let b=async e=>{try{await eh.f.notifications.markRead([e]),o(t=>t.map(t=>t.id===e?{...t,isRead:!0}:t)),u(e=>Math.max(0,e-1))}catch{}},g=async()=>{try{await eh.f.notifications.markAllRead(),o(e=>e.map(e=>({...e,isRead:!0}))),u(0),setTimeout(()=>void h(),500)}catch{}};return(0,t.jsxs)("div",{className:"relative",ref:f,children:[(0,t.jsxs)("button",{className:"relative rounded p-2 text-text-muted transition-all hover:bg-surface-hover hover:text-text",title:"Notifications",type:"button","aria-expanded":e,"aria-controls":"notification-panel","aria-label":d>0?`Notifications (${d} unread)`:"Notifications",onClick:()=>r(e=>!e),children:[(0,t.jsx)(eo,{className:"h-4 w-4"}),d>0&&(0,t.jsx)("span",{className:"absolute right-1 top-1 flex h-4 min-w-[1rem] items-center justify-center rounded-full bg-danger px-1 text-[10px] font-bold text-white",children:d>99?"99+":d})]}),e&&(0,t.jsxs)("div",{id:"notification-panel",role:"region","aria-label":"Notifications",className:"absolute right-0 top-full z-50 mt-2 w-96 overflow-hidden rounded border border-border bg-surface shadow-2xl",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[(0,t.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider text-text",children:"Notifications"}),d>0&&(0,t.jsxs)("button",{className:"flex items-center gap-1 rounded px-2 py-1 text-xs text-primary hover:bg-primary/10 transition-all",onClick:()=>void g(),type:"button",children:[(0,t.jsx)(ec,{className:"h-3 w-3"}),"Mark all read"]})]}),(0,t.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[m&&0===i.length&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsx)("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-primary border-t-transparent"})}),!m&&0===i.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-10 text-text-muted",children:[(0,t.jsx)(eo,{className:"mb-2 h-8 w-8 opacity-40"}),(0,t.jsx)("p",{className:"text-xs",children:"No notifications yet"})]}),i.map(e=>(0,t.jsxs)("div",{className:(0,n.f)("group flex items-start gap-3 border-b border-border/50 px-4 py-3 transition-all hover:bg-surface-hover",!e.isRead&&"bg-primary/5"),children:[(0,t.jsx)("div",{className:"mt-0.5 shrink-0",children:function(e){switch(e){case"critical":return(0,t.jsx)(eu.f,{className:"h-4 w-4 text-danger"});case"warning":return(0,t.jsx)(ed.f,{className:"h-4 w-4 text-warning"});default:return(0,t.jsx)(em.f,{className:"h-4 w-4 text-primary"})}}(e.severity)}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[function(e){switch(e){case"node.offline":return(0,t.jsx)(y.f,{className:"h-3.5 w-3.5 text-danger"});case"node.degraded":return(0,t.jsx)(y.f,{className:"h-3.5 w-3.5 text-warning"});case"node.recovered":return(0,t.jsx)(T,{className:"h-3.5 w-3.5 text-success"});case"command.failed":return(0,t.jsx)(v.f,{className:"h-3.5 w-3.5 text-warning"});case"deploy.failed":return(0,t.jsx)(ex.f,{className:"h-3.5 w-3.5 text-danger"});case"upgrade.failed":return(0,t.jsx)(ef.f,{className:"h-3.5 w-3.5 text-danger"});default:return(0,t.jsx)(eo,{className:"h-3.5 w-3.5 text-text-muted"})}}(e.type),(0,t.jsx)("span",{className:(0,n.f)("text-xs font-bold",e.isRead?"text-text-muted":"text-text"),children:e.title})]}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-text-muted line-clamp-2",children:e.message}),(0,t.jsx)("span",{className:"mt-1 block text-[10px] text-text-muted/60",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return"just now";let a=Math.floor(t/60);if(a<60)return`${a}m ago`;let r=Math.floor(a/60);if(r<24)return`${r}h ago`;let s=Math.floor(r/24);return`${s}d ago`}(e.createdAt)})]}),!e.isRead&&(0,t.jsx)("button",{className:"mt-0.5 shrink-0 rounded p-1 text-text-muted opacity-0 transition-all hover:bg-surface-hover hover:text-primary group-hover:opacity-100",title:"Mark as read",type:"button",onClick:()=>void b(e.id),children:(0,t.jsx)(c.f,{className:"h-3.5 w-3.5"})})]},e.id))]}),(0,t.jsx)("div",{className:"border-t border-border px-4 py-2 flex justify-end",children:(0,t.jsxs)(s.default,{href:"/notifications",className:"flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",onClick:()=>r(!1),children:[(0,t.jsx)(l.f,{className:"h-3 w-3"}),"Preferences"]})})]})]})}var eb=e.i(1092);let eg=[{keys:["g","m"],label:"Go to Mission Control",description:"Navigate to unified Mission Control home",action:"navigate",target:"/mission-control",category:"navigation"},{keys:["g","o"],label:"Go to Overview",description:"Navigate to fleet overview",action:"navigate",target:"/",category:"navigation"},{keys:["g","n"],label:"Go to Nodes",description:"Navigate to node list",action:"navigate",target:"/nodes",category:"navigation"},{keys:["g","c"],label:"Go to Commands",description:"Navigate to command console",action:"navigate",target:"/commands",category:"navigation"},{keys:["g","j"],label:"Go to Cron Jobs",description:"Navigate to cron jobs",action:"navigate",target:"/cron",category:"navigation"},{keys:["g","f"],label:"Go to Files",description:"Navigate to file editor",action:"navigate",target:"/files",category:"navigation"},{keys:["g","s"],label:"Go to Skills",description:"Navigate to skill marketplace",action:"navigate",target:"/skills",category:"navigation"},{keys:["g","l"],label:"Go to Logs",description:"Navigate to log explorer",action:"navigate",target:"/logs",category:"navigation"},{keys:["g","a"],label:"Go to Audit",description:"Navigate to audit trail",action:"navigate",target:"/audit",category:"navigation"},{keys:["?"],label:"Show Shortcuts",description:"Show keyboard shortcut reference",action:"command",target:"show-shortcuts",category:"general"}];function ey(){return"u">typeof navigator&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘":"Ctrl"}function ev(){document.body.dispatchEvent(new KeyboardEvent("keydown",{key:"k",ctrlKey:!0,metaKey:!0,bubbles:!0}))}function ew({onMenuToggle:e}){let n=(0,r.usePathname)(),i=(0,r.useRouter)(),{title:l,crumbs:o}=function(e){let t=null;for(let a of Object.keys(B))J(e,a)&&(null===t||a.length>t.length)&&(t=a);let a=t?B[t]:"Magnus",r=X(e),s=r?W.find(e=>e.items.some(e=>e.href===r))?.label??null:null,n=[];if(s&&n.push({label:s}),n.push({label:a,href:t??void 0}),t&&e!==t)for(let a of e.slice("/"===t?1:t.length+1).split("/").filter(Boolean)){let e=decodeURIComponent(a);n.push({label:e.length>18?`${e.slice(0,8)}…${e.slice(-6)}`:e})}return{title:a,group:s,crumbs:n}}(n),[c,d]=(0,a.useState)(null),[u,m]=(0,a.useState)(!1),[x,f]=(0,a.useState)("Ctrl"),h=(0,a.useRef)(null);async function p(e=!1){let t=await fetch(`/api/auth/logout${e?"?all=true":""}`,{method:"POST"}).catch(()=>null);t?.ok?(i.push("/login"),i.refresh()):window.alert("Session revocation unavailable; retry sign out.")}return(0,a.useEffect)(()=>{f(ey()),fetch("/api/auth/me").then(e=>e.ok?e.json():null).then(e=>{e?.username&&d(e.username)}).catch(()=>{})},[]),(0,a.useEffect)(()=>{if(!u)return;let e=e=>{(e instanceof KeyboardEvent?"Escape"!==e.key:h.current?.contains(e.target))||m(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",e)}},[u]),(0,t.jsxs)("header",{className:"relative z-(--z-shell) flex h-14 items-center justify-between gap-3 bg-bg/80 px-3 backdrop-blur-sm sm:px-6",children:[(0,t.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-primary/60 via-accent/40 to-transparent"}),(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 text-xs uppercase tracking-[0.15em] text-text-muted",children:[e&&(0,t.jsx)("button",{className:"mr-1 rounded p-1.5 text-text-muted hover:text-primary md:hidden",onClick:e,type:"button",title:"Toggle menu",children:(0,t.jsx)(en,{className:"h-5 w-5"})}),(0,t.jsx)("span",{className:"text-primary/60",children:">_"}),(0,t.jsx)("nav",{"aria-label":"Breadcrumb",className:"hidden min-w-0 items-center gap-1 sm:flex",children:o.map((e,a)=>{let r=a===o.length-1;return(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[a>0&&(0,t.jsx)(el.f,{className:"h-3 w-3 shrink-0 text-primary/30","aria-hidden":"true"}),e.href&&!r?(0,t.jsx)(s.default,{href:e.href,prefetch:!1,className:"truncate transition-colors hover:text-primary",children:e.label}):(0,t.jsx)("span",{className:r?"truncate text-text":0===a&&o.length>1?"truncate text-text-muted/60":"truncate","aria-current":r?"page":void 0,children:e.label})]},`${e.label}-${a}`)})}),(0,t.jsx)("span",{className:"sr-only sm:hidden",children:l}),(0,t.jsx)("span",{className:"ml-1 hidden h-3.5 w-1.5 shrink-0 bg-primary/80 sm:inline-block",style:{animation:"cursor-blink 1s step-end infinite"}})]}),(0,t.jsx)(eb.J,{className:"hidden max-w-xl flex-1 lg:block"}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1 sm:gap-2",children:[(0,t.jsxs)("button",{type:"button",onClick:ev,className:"hidden items-center gap-2 rounded-chip border border-border bg-surface px-2.5 py-1.5 text-[10px] uppercase tracking-wider text-text-muted transition-colors hover:border-primary/40 hover:text-primary md:flex",title:"Search and jump (command palette)",children:[(0,t.jsx)(ei.f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:"Search"}),(0,t.jsxs)("kbd",{className:"rounded-chip border border-border bg-bg px-1 text-[9px] text-primary/70",children:[x,"+K"]})]}),(0,t.jsx)("button",{className:"rounded p-2 text-text-muted transition-all hover:text-primary hover:drop-shadow-[0_0_6px_var(--color-glow)]",title:"Refresh",onClick:()=>window.location.reload(),type:"button",children:(0,t.jsx)(es.f,{className:"h-4 w-4"})}),(0,t.jsx)(ep,{}),(0,t.jsx)("button",{className:"rounded p-2 text-text-muted transition-all hover:text-danger hover:drop-shadow-[0_0_6px_rgba(255,23,68,0.3)]",title:"Sign Out",onClick:()=>void p(),type:"button",children:(0,t.jsx)(er.f,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{ref:h,className:"relative ml-1",children:[(0,t.jsx)("button",{type:"button",onClick:()=>m(e=>!e),"aria-haspopup":"menu","aria-expanded":u,title:c?`Signed in as ${c}`:"Account",className:"flex h-8 w-8 items-center justify-center rounded border border-accent/40 text-[10px] font-bold uppercase text-accent shadow-[0_0_8px_var(--color-glow-accent)] transition-colors hover:border-accent hover:bg-accent/10",children:c?.[0]??"U"}),u&&(0,t.jsxs)("div",{role:"menu",className:"panel-corners absolute right-0 top-full z-(--z-modal) mt-2 w-60 rounded-panel border border-accent/30 bg-surface/95 p-1 shadow-[0_0_24px_var(--color-glow-accent)] backdrop-blur-sm [--panel-corner-color:var(--color-accent)]",children:[c&&(0,t.jsxs)("div",{className:"border-b border-border px-3 py-2 text-[10px] uppercase tracking-wider text-text-muted",children:["Signed in as ",(0,t.jsx)("span",{className:"text-accent",children:c})]}),(0,t.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>void p(),className:"flex w-full items-center gap-2 rounded-chip px-3 py-2 text-left text-xs text-text-muted transition-colors hover:bg-surface-hover hover:text-text",children:[(0,t.jsx)(er.f,{className:"h-3.5 w-3.5"})," Sign out"]}),(0,t.jsxs)("button",{type:"button",role:"menuitem","aria-label":"Sign out all local sessions",onClick:()=>void p(!0),className:"flex w-full items-center gap-2 rounded-chip px-3 py-2 text-left text-xs text-text-muted transition-colors hover:bg-danger/10 hover:text-danger",children:[(0,t.jsx)(er.f,{className:"h-3.5 w-3.5"})," Sign out all local sessions"]})]})]})]})]})}async function ek(e,t){try{let a=await fetch(e,{signal:t,headers:{accept:"application/json"}});if(!a.ok)return null;return await a.json()}catch{return null}}function ej(e,t){return e.trim()?t.map(t=>({e:t,s:function(e,t){if(!e)return 0;let a=e.toLowerCase(),r=t.toLowerCase(),s=r.indexOf(a);if(-1!==s)return s;let n=0,i=0;for(let e of a){let t=r.indexOf(e,n);if(-1===t)return -1;i+=t-n,n=t+1}return 1e3+i}(e,`${t.label} ${t.sublabel??""}`)})).filter(({s:e})=>e>=0).sort((e,t)=>e.s-t.s).map(({e})=>e):t}async function eN(e,t={}){let{signal:a,limit:r=10}=t;if(e.trim().length<2)return[];let[s,n,i]=await Promise.all([ek("/api/proxy/nodes",a),ek("/api/proxy/orchestra/installations",a),ek("/api/proxy/orchestra/skill-catalog",a)]),l=[];for(let e of s?.data??[])l.push({kind:"node",id:e.id,label:e.name,sublabel:e.status?`Node \xb7 ${e.status}`:"Node",href:`/nodes/${e.id}`});for(let e of n?.data??[])l.push({kind:"installation",id:e.id,label:e.displayName??e.hostname,sublabel:`Hermes \xb7 ${e.status??"unknown"}`,href:"/orchestra/installations"});for(let e of i?.data??[])l.push({kind:"skill",id:e.id,label:e.name,sublabel:e.description??"Skill",href:"/skills"});return ej(e,[{kind:"action",id:"deploy-agent",label:"Deploy agent to host",sublabel:"Action · Operations",href:"/governor/operations"},{kind:"action",id:"open-terminal",label:"Open node terminal",sublabel:"Action · Nodes",href:"/nodes"},{kind:"action",id:"run-fleet-check",label:"Run fleet check",sublabel:"Action · Fleet readiness",href:"/fleet-readiness"},{kind:"action",id:"view-stale-nodes",label:"View stale nodes",sublabel:"Action · Readiness",href:"/fleet-readiness"},{kind:"action",id:"rotate-node-secret",label:"Rotate node secret",sublabel:"Action · Operations",href:"/governor/operations"},{kind:"action",id:"latest-failed-deploy",label:"Open latest failed deploy",sublabel:"Action · Timeline",href:"/fleet-timeline"},...l]).slice(0,r)}var eC=e.i(72520),eS=e.i(77754),eM=e.i(7866);let eE=(0,b.f)("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);var e_=e.i(37727);let e$=(0,b.f)("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);var eA=e.i(31278),eL=e.i(83086),eR=e.i(72603);let eP={"/":g,"/mission-control":R,"/nodes":y.f,"/commands":v.f,"/cron":w.f,"/files":k.f,"/skills":eS.f,"/logs":j,"/audit":N.f,"/library":eM.f},eT={node:y.f,installation:C.f,skill:eS.f,action:eC.f};function eO(){let[e,s]=(0,a.useState)(!1),[n,i]=(0,a.useState)(""),[l,o]=(0,a.useState)(0),[c,d]=(0,a.useState)(!1),[u,m]=(0,a.useState)([]),[x,f]=(0,a.useState)(!1),[h,p]=(0,a.useState)("normal"),b=(0,a.useRef)(null),g=(0,r.useRouter)(),y=(0,a.useRef)([]),v=(0,a.useRef)(void 0),w=(0,a.useRef)(void 0),k=(0,a.useRef)(null),j=(n.trim()?eg.filter(e=>e.label.toLowerCase().includes(n.toLowerCase())||e.description.toLowerCase().includes(n.toLowerCase())):eg).map(e=>({kind:"shortcut",key:`s:${e.keys.join("-")}`,shortcut:e})),N=ej(n,u).map(e=>({kind:"entity",key:`e:${e.kind}:${e.id}`,entity:e})),C=n.trim()?[...N,...j]:j;(0,a.useEffect)(()=>{if(!e)return;let t=n.trim();if(t.length<2){m([]),f(!1);return}w.current&&clearTimeout(w.current),k.current&&k.current.abort();let a=new AbortController;return k.current=a,f(!0),w.current=setTimeout(async()=>{let e=await eN(t,{signal:a.signal,limit:12});a.signal.aborted||(m(e),f(!1))},180),()=>{a.abort(),w.current&&clearTimeout(w.current)}},[n,e]);let S=(0,a.useCallback)(e=>{"navigate"===e.action&&e.target?(g.push(e.target),s(!1),i("")):"show-shortcuts"===e.target&&(d(!0),s(!1),i(""))},[g]),M=(0,a.useCallback)(e=>{"shortcut"===e.kind?S(e.shortcut):(g.push(e.entity.href),s(!1),i(""))},[S,g]);return((0,a.useEffect)(()=>{let t=t=>{let a=t.target,r="INPUT"===a.tagName||"TEXTAREA"===a.tagName||a.isContentEditable;if((t.metaKey||t.ctrlKey)&&"k"===t.key.toLowerCase()){t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),s(e=>!e);return}if("Escape"===t.key){if(e){s(!1),i("");return}return c?void d(!1):void 0}if(!r){if("?"===t.key){t.preventDefault(),d(e=>!e);return}if(1===t.key.length&&!t.metaKey&&!t.ctrlKey&&!t.altKey){for(let e of(clearTimeout(v.current),y.current.push(t.key.toLowerCase()),eg))if(e.keys.length===y.current.length&&e.keys.every((e,t)=>e===y.current[t])){t.preventDefault(),y.current=[],S(e);return}v.current=setTimeout(()=>{y.current=[]},800)}}};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e,c,S]),(0,a.useEffect)(()=>{e&&(o(0),setTimeout(()=>b.current?.focus(),50))},[e]),(0,a.useEffect)(()=>{l>=C.length&&o(Math.max(0,C.length-1))},[C.length,l]),(0,a.useEffect)(()=>{e&&p("low"===document.documentElement.dataset.fx?"low":"normal")},[e]),e||c)?(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsxs)("div",{className:"fixed inset-0 z-(--z-modal) flex items-start justify-center pt-[15vh]","data-testid":"command-palette",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-[2px]",onClick:()=>{s(!1),i("")}}),(0,t.jsxs)("div",{className:"relative z-10 w-full max-w-lg panel-corners rounded-panel border border-primary/30 bg-surface/95 shadow-[0_0_40px_var(--color-glow)]",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 border-b border-border px-4 py-3",children:[(0,t.jsx)(ei.f,{className:"h-5 w-5 text-primary"}),(0,t.jsx)("input",{ref:b,type:"text",placeholder:"Search nodes, agents, runs, users, commands...",className:"flex-1 bg-transparent text-sm text-text placeholder:text-text-muted/70 caret-primary outline-none",value:n,onChange:e=>{i(e.target.value),o(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),o(e=>Math.min(e+1,C.length-1))):"ArrowUp"===e.key?(e.preventDefault(),o(e=>Math.max(e-1,0))):"Enter"===e.key&&C[l]&&(e.preventDefault(),M(C[l]))},"data-testid":"command-palette-input"}),x?(0,t.jsx)(eA.f,{className:"h-4 w-4 animate-spin text-primary"}):(0,t.jsx)("kbd",{className:"rounded-chip border border-border bg-bg px-1.5 py-0.5 text-[10px] text-text-muted",children:"ESC"})]}),(0,t.jsxs)("div",{className:"max-h-96 overflow-y-auto py-2",children:[0===C.length&&!x&&(0,t.jsx)("p",{className:"px-4 py-6 text-center text-xs uppercase tracking-wider text-text-muted",children:"No results found"}),0===C.length&&x&&(0,t.jsx)("p",{className:"px-4 py-6 text-center text-xs uppercase tracking-wider text-text-muted",children:"Searching…"}),C.map((e,a)=>{let r=a===l;if("shortcut"===e.kind){let s=eP[e.shortcut.target??""]??eC.f;return(0,t.jsxs)("button",{className:`flex w-full items-center gap-3 px-4 py-2 text-left text-sm transition-colors ${r?"bg-primary/10 text-primary shadow-[inset_2px_0_0_var(--color-primary)]":"text-text hover:bg-surface-hover"}`,onClick:()=>M(e),onMouseEnter:()=>o(a),"data-testid":"command-palette-item","data-item-kind":"shortcut",children:[(0,t.jsx)(s,{className:"h-4 w-4 shrink-0 opacity-70"}),(0,t.jsx)("span",{className:"flex-1",children:e.shortcut.label}),(0,t.jsx)("span",{className:"text-xs text-text-muted",children:e.shortcut.keys.map(e=>e.toUpperCase()).join(" then ")})]},e.key)}let s=eT[e.entity.kind]??eC.f;return(0,t.jsxs)("button",{className:`flex w-full items-center gap-3 px-4 py-2 text-left text-sm transition-colors ${r?"bg-accent/10 text-accent shadow-[inset_2px_0_0_var(--color-accent)]":"text-text hover:bg-surface-hover"}`,onClick:()=>M(e),onMouseEnter:()=>o(a),"data-testid":"command-palette-item","data-item-kind":"entity","data-entity-kind":e.entity.kind,children:[(0,t.jsx)(s,{className:"h-4 w-4 shrink-0 text-accent/80"}),(0,t.jsxs)("span",{className:"flex-1 truncate",children:[(0,t.jsx)("span",{className:"font-medium",children:e.entity.label}),e.entity.sublabel&&(0,t.jsx)("span",{className:"ml-2 text-xs text-text-muted",children:e.entity.sublabel})]}),(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:e.entity.kind})]},e.key)})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 border-t border-border px-4 py-2 text-[10px] uppercase tracking-wider text-text-muted",children:[(0,t.jsx)("span",{children:"↑↓ navigate"}),(0,t.jsx)("span",{children:"↵ select"}),(0,t.jsx)("span",{children:"esc close"}),(0,t.jsxs)("button",{type:"button",onClick:()=>p((0,eR.W)()),className:"ml-auto flex items-center gap-1 rounded-chip px-1 text-text-muted transition-colors hover:text-primary",title:"Toggle visual effects (scanlines, glow pulses, animated map)","data-testid":"command-palette-fx-toggle",children:[(0,t.jsx)(eL.f,{className:"h-3 w-3"})," fx: ",h]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(e$,{className:"h-3 w-3"})," ",ey(),"+K"]})]})]})]}),c&&(0,t.jsxs)("div",{className:"fixed inset-0 z-(--z-modal) flex items-center justify-center",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-[2px]",onClick:()=>d(!1)}),(0,t.jsxs)("div",{className:"relative z-10 w-full max-w-md panel-corners rounded-panel border border-primary/30 bg-surface/95 p-6 shadow-[0_0_40px_var(--color-glow)]",children:[(0,t.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(eE,{className:"h-5 w-5 text-primary"}),(0,t.jsx)("h2",{className:"text-sm font-bold uppercase tracking-wider text-primary glow-text-primary",children:"Keyboard Shortcuts"})]}),(0,t.jsx)("button",{onClick:()=>d(!1),className:"text-text-muted hover:text-text",children:(0,t.jsx)(e_.X,{className:"h-5 w-5"})})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 text-[10px] font-medium uppercase tracking-[0.2em] text-text-muted",children:"General"}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(ez,{keys:[`${ey()}+K`],label:"Open command palette"}),(0,t.jsx)(ez,{keys:["?"],label:"Show this reference"}),(0,t.jsx)(ez,{keys:["Esc"],label:"Close modal / palette"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 text-[10px] font-medium uppercase tracking-[0.2em] text-text-muted",children:"Fleet Navigation"}),(0,t.jsx)("div",{className:"space-y-1",children:eg.filter(e=>"navigation"===e.category).map(e=>(0,t.jsx)(ez,{keys:e.keys.map(e=>e.toUpperCase()),label:e.label},e.target))})]})]})]})]})]}):null}function ez({keys:e,label:a}){return(0,t.jsxs)("div",{className:"flex items-center justify-between py-1",children:[(0,t.jsx)("span",{className:"text-xs text-text",children:a}),(0,t.jsx)("div",{className:"flex gap-1",children:e.map((a,r)=>(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"rounded-chip border border-border bg-bg px-1.5 py-0.5 text-[11px] text-primary",children:a}),r<e.length-1&&(0,t.jsx)("span",{className:"mx-0.5 text-[10px] text-text-muted/60",children:"then"})]},r))})]})}var eI=e.i(52928);e.s(["DashboardShell",0,function({children:e,integrations:s}){let n=(0,r.usePathname)(),i="/login"===n||n.startsWith("/governor/share/"),[l,o]=(0,a.useState)(!1);!function({enabled:e=!0}={}){let[t,r]=(0,a.useState)(!1),{addToast:s}=(0,eI.d)(),n=(0,a.useRef)(s);n.current=s;let i=(0,a.useRef)(null),l=(0,a.useRef)(null),o=(0,a.useCallback)(()=>{if(!e)return;let t=new EventSource("/api/proxy/events/stream");for(let e of(i.current=t,t.onopen=()=>{r(!0),Z.f.setConnected(!0)},["deploy:status","node:status","command:status","alert:fired"]))t.addEventListener(e,t=>{try{let a=JSON.parse(t.data),r=function(e){let t=e.type??"",a=e.nodeName??"Unknown";switch(t){case"deploy.started":return{title:`Deploying to ${a}`,severity:"info"};case"deploy.completed":return{title:`Deploy complete: ${a}`,severity:"success"};case"deploy.failed":return{title:`Deploy failed: ${a}`,message:e.message??void 0,severity:"error"};case"upgrade.started":return{title:`Upgrading ${a}`,severity:"info"};case"upgrade.completed":return{title:`Upgrade complete: ${a}`,message:`v${e.version}`,severity:"success"};case"upgrade.failed":return{title:`Upgrade failed: ${a}`,message:e.message??void 0,severity:"error"};case"node.recovered":return{title:`${a} back online`,message:`Recovered from ${e.previousStatus}`,severity:"success"};case"command.completed":return{title:"Command completed",message:`${e.command}`,severity:"success"};case"command.failed":return{title:"Command failed",message:`${e.command} (exit ${e.exitCode})`,severity:"error"};case"health.alert":return{title:`Alert: ${e.metric?.replaceAll("_"," ").toUpperCase()} on ${a}`,message:`${e.value?.toFixed(1)}% (threshold: ${e.threshold}%)`,severity:e.severity??"warning"};default:return null}}(a);r&&n.current(r),Z.f.push(r?{...r,channel:e}:{title:String(a.type??e).replaceAll("."," "),message:"string"==typeof a.nodeName?a.nodeName:void 0,severity:"info",channel:e})}catch{}});return t.onerror=()=>{r(!1),Z.f.setConnected(!1),t.close(),fetch("/api/auth/me",{cache:"no-store"}).then(e=>{if(i.current===t){if(401===e.status)return void window.location.replace("/login");l.current=setTimeout(o,5e3)}}).catch(()=>{i.current===t&&(l.current=setTimeout(o,5e3))})},t},[e]);(0,a.useEffect)(()=>{let e=o();return()=>{l.current&&clearTimeout(l.current),e?.close(),i.current?.close(),Z.f.setConnected(!1),i.current=null}},[o])}({enabled:!i}),(0,a.useEffect)(()=>{o(!1)},[n]);let c=(0,a.useCallback)(()=>o(e=>!e),[]);return i?(0,t.jsx)(t.Fragment,{children:e}):(0,t.jsxs)("div",{className:"flex h-screen overflow-hidden",children:[l&&(0,t.jsx)("div",{className:"fixed inset-0 z-40 bg-black/70 backdrop-blur-[2px] md:hidden",onClick:()=>o(!1)}),(0,t.jsx)("div",{className:`
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,68288,e=>{var t=e.i(43476),a=e.i(71645),r=e.i(4050),s=e.i(82983);let n=0,i=Date.now(),l=[],o=null,c=!1;function d(e,t){let a;(a=Date.now())-i>=6e4&&(n=0,i=a),n>=20||(n++,l.push({nodeId:"__dashboard__",source:"dashboard",level:"error",message:e,metadata:t,timestamp:new Date().toISOString()}))}async function u(){if(0===l.length)return;let e=l.splice(0,l.length);try{await s.f.logs.ingest(e)}catch{}}var m=e.i(52928),x=e.i(53034),f=e.i(37806),h=e.i(47414);function p({children:e,...r}){let s=(0,a.useContext)(f.f);(r={...s,...r}).transition=(0,x.f)(r.transition,s.transition),r.isStatic=(0,h.f)(()=>r.isStatic);let n=(0,a.useMemo)(()=>r,[JSON.stringify(r.transition),r.transformPagePoint,r.reducedMotion,r.skipAnimations,r.isValidProp]);return(0,t.jsx)(f.f.Provider,{value:n,children:e})}var b=e.i(72603);e.s(["Providers",0,function({children:e}){return(0,a.useEffect)(()=>((0,b.P)(),function(){if(c)return()=>{};c=!0;let e=e=>{d(`Uncaught error: ${e.message}`,{url:window.location.pathname,filename:e.filename??"unknown",lineno:e.lineno??0,colno:e.colno??0})},t=e=>{let t=e.reason,a=t instanceof Error?t.message:String(t);d(`Unhandled rejection: ${a}`,{url:window.location.pathname})};return window.addEventListener("error",e),window.addEventListener("unhandledrejection",t),o=setInterval(()=>void u(),1e4),()=>{window.removeEventListener("error",e),window.removeEventListener("unhandledrejection",t),o&&(clearInterval(o),o=null),u(),c=!1}}()),[]),(0,t.jsx)(p,{reducedMotion:"user",children:(0,t.jsx)(m.N,{children:(0,t.jsx)(r.v,{children:e})})})}],68288)},40073,e=>{var t=e.i(43476),a=e.i(71645),r=e.i(18566),s=e.i(22016),n=e.i(78571),i=e.i(64659),l=e.i(39616),o=e.i(7233),c=e.i(43531),d=e.i(4050),u=e.i(35673),m=e.i(15e3),x=e.i(39430);function f({status:e}){let a="online"===e?"Online":"offline"===e?"Offline":"Checking…";return(0,t.jsx)("span",{role:"status","aria-label":a,className:`inline-block h-2 w-2 shrink-0 rounded-full ${"online"===e?"bg-success":"offline"===e?"bg-danger":"bg-text-muted/40 animate-pulse"}`,title:a})}function h(){let{nodes:e,activeNode:r,switchNode:s,loading:n}=(0,d.l)(),[h,p]=(0,a.useState)(!1),[b,g]=(0,a.useState)(!1),[y,v]=(0,a.useState)(!1),w=(0,a.useRef)(null),[k,j]=(0,a.useState)({}),N=(0,a.useRef)(null),C=(0,a.useMemo)(()=>e.length>0?e:[m.f],[e]),S=(0,a.useCallback)(async()=>{let e={};await Promise.allSettled(C.map(async t=>{try{let a=(0,x.L)(t.url),r=await fetch("/api/proxy/health",{method:"GET",headers:a,signal:AbortSignal.timeout(6e3)});e[t.id]=r.ok?"online":"offline"}catch{e[t.id]="offline"}})),j(e)},[C]);return((0,a.useEffect)(()=>{S()},[S]),(0,a.useEffect)(()=>{if(h)return S(),N.current=setInterval(()=>void S(),3e4),()=>{N.current&&clearInterval(N.current)}},[h,S]),(0,a.useEffect)(()=>{if(h)return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)};function e(e){w.current&&!w.current.contains(e.target)&&p(!1)}function t(e){"Escape"===e.key&&p(!1)}},[h]),n)?(0,t.jsx)("div",{className:"mx-3 mt-2 mb-1 rounded border border-border bg-bg px-3 py-2 text-xs text-text-muted animate-pulse",children:"Loading…"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"relative mx-3 mt-2 mb-1",ref:w,children:[(0,t.jsx)("div",{className:"mb-1 px-0.5 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Node Controller"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)("button",{onClick:()=>p(!h),"aria-expanded":h,"aria-haspopup":"listbox","aria-label":`Node controller: ${r.name}`,className:"flex flex-1 items-center gap-2 rounded border border-border bg-bg px-2.5 py-1.5 text-left transition-all hover:bg-surface-hover min-w-0",children:[(0,t.jsx)(f,{status:k[r.id]??"unknown"}),(0,t.jsx)("span",{className:"flex-1 truncate text-xs font-medium",children:r.name}),(0,t.jsx)(i.f,{className:`h-3.5 w-3.5 shrink-0 text-text-muted transition-transform ${h?"rotate-180":""}`})]}),(0,t.jsx)("button",{onClick:function(){v(!1),g(!0)},className:"rounded border border-border bg-bg p-1.5 text-text-muted transition-all hover:bg-surface-hover hover:text-text",title:"Control Node Settings",children:(0,t.jsx)(l.f,{className:"h-3.5 w-3.5"})})]}),h&&(0,t.jsxs)("div",{className:"absolute left-3 right-3 z-50 mt-1 rounded border border-border bg-surface shadow-xl",children:[(0,t.jsx)("div",{role:"listbox","aria-label":"Control nodes",className:"max-h-48 overflow-y-auto py-1",children:C.map(e=>(0,t.jsxs)("button",{role:"option","aria-selected":e.id===r.id,onClick:()=>{s(e.id),p(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-all hover:bg-surface-hover",children:[(0,t.jsx)(f,{status:k[e.id]??"unknown"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"font-medium truncate",children:e.name}),(0,t.jsx)("div",{className:"text-text-muted truncate text-[10px]",children:e.url})]}),e.id===r.id&&(0,t.jsx)(c.f,{className:"h-3.5 w-3.5 shrink-0 text-primary"})]},e.id))}),(0,t.jsx)("div",{className:"border-t border-border",children:(0,t.jsxs)("button",{onClick:function(){p(!1),v(!0),g(!0)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-primary transition-all hover:bg-surface-hover",children:[(0,t.jsx)(o.f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"font-bold",children:"Add Control Node"})]})})]})]}),(0,t.jsx)(u.f,{open:b,onClose:()=>g(!1),createMode:y})]})}var p=e.i(32181),b=e.i(75254);let g=(0,b.f)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);var y=e.i(18393),v=e.i(68054),w=e.i(3116),k=e.i(78583);let j=(0,b.f)("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);var N=e.i(98919),C=e.i(31245),S=e.i(61911),M=e.i(62421),E=e.i(49582),_=e.i(53305),$=e.i(39312);let A=(0,b.f)("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);var L=e.i(10980);let R=(0,b.f)("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var P=e.i(65157);let T=(0,b.f)("HeartPulse",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"1uw2ng"}]]),O=(0,b.f)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var z=e.i(58041);let I=(0,b.f)("GitCompareArrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),D=(0,b.f)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 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.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),F=(0,b.f)("SquareActivity",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M17 12h-2l-2 5-2-10-2 5H7",key:"15hlnc"}]]);var K=e.i(81418);let U=(0,b.f)("ScanSearch",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);var H=e.i(97625),G=e.i(65261),q=e.i(34981),V=e.i(94827);let W=[{id:"fleet",label:"Fleet",tone:"primary",items:[{href:"/mission-control",label:"Mission Control",icon:R},{href:"/",label:"Overview",icon:g,exact:!0},{href:"/nodes",label:"Nodes",icon:y.f},{href:"/application-operations",label:"Applications",icon:T},{href:"/fleet-readiness",label:"Readiness",icon:V.f},{href:"/fleet-timeline",label:"Timeline",icon:O},{href:"/fleet-map",label:"Fleet Map",icon:A},{href:"/commands",label:"Commands",icon:v.f},{href:"/anomalies",label:"Anomalies",icon:M.f},{href:"/anomalies/remediation",label:"Remediation",icon:$.f},{href:"/governor/operations",label:"Operations",icon:E.f},{href:"/rollouts",label:"Rollouts",icon:D},{href:"/incidents",label:"Incidents",icon:F},{href:"/cron",label:"Cron Jobs",icon:w.f},{href:"/files",label:"Files",icon:k.f},{href:"/logs",label:"Logs",icon:j},{href:"/audit",label:"Audit",icon:N.f},{href:"/webhooks",label:"Webhooks",icon:_.f},{href:"/retention",label:"Retention",icon:z.f},{href:"/api-docs",label:"API Docs",icon:L.f}]},{id:"security",label:"Security",tone:"primary",integration:"securityConsole",items:[{href:"/security-fusion",label:"Fleet summary",icon:U,exact:!0}]},{id:"hermes",label:"Hermes Agent",tone:"accent",integration:"hermes",items:[{href:"/orchestra",label:"Overview",icon:C.f,exact:!0},{href:"/orchestra/installations",label:"Installations",icon:y.f},{href:"/orchestra/profiles",label:"Profiles",icon:S.f},{href:"/hermes-drift",label:"Drift Cockpit",icon:I},{href:"/hermes-security",label:"Proxy Security",icon:K.f},{href:"/orchestra/web-gateway",label:"Web Gateway",icon:P.f}]},{id:"ardent",label:"Magnus Ardent",tone:"primary",items:[{href:"/ardent",label:"Overview",icon:q.f,exact:!0},{href:"/ardent/installations",label:"Installations",icon:y.f},{href:"/ardent/profiles",label:"Profiles",icon:S.f}]},{id:"codex",label:"Codex Agent",tone:"primary",items:[{href:"/codex",label:"Overview",icon:H.f,exact:!0},{href:"/codex/installations",label:"Installations",icon:G.f}]}],B={"/":"Fleet Overview","/mission-control":"Mission Control","/nodes":"Nodes","/application-operations":"Application Operations","/fleet-readiness":"Fleet Readiness","/fleet-timeline":"Fleet Timeline","/fleet-map":"Fleet Map","/commands":"Commands","/anomalies":"Anomalies","/anomalies/remediation":"Auto-Remediation","/governor/operations":"Fleet Operations","/rollouts":"Guided Rollouts","/incidents":"Incident Workspace","/cron":"Cron Jobs","/files":"Files","/logs":"Logs","/audit":"Audit","/webhooks":"Webhooks","/retention":"Retention","/api-docs":"API Docs","/library":"Library","/skills":"Skills","/roles":"Roles","/sync":"Sync","/notifications":"Notification Preferences","/security-fusion":"Security","/orchestra":"Hermes Agent Fleet","/orchestra/installations":"Hermes Installations","/orchestra/profiles":"Hermes Profiles","/orchestra/web-gateway":"Web Gateway","/hermes-drift":"Hermes Drift Cockpit","/hermes-security":"Hermes Proxy Security","/ardent":"Magnus Ardent","/ardent/installations":"Ardent Installations","/ardent/profiles":"Ardent Profiles","/codex":"Codex Agent Fleet","/codex/installations":"Codex Installations"};function J(e,t,a=!1){return"/"===t||a?e===t:e===t||e.startsWith(`${t}/`)}function X(e){let t=null;for(let a of W)for(let r of a.items)!r.external&&J(e,r.href,r.exact)&&(null===t||r.href.length>t.length)&&(t=r.href);return t}var Z=e.i(16141);let Q={security:"from-primary/60 via-accent/20",hermes:"from-accent/50 via-accent/20",ardent:"from-primary/50 via-accent/20",codex:"from-primary/50 via-primary/20"};function Y({group:e,activeHref:a}){let r="accent"===e.tone;return(0,t.jsxs)(t.Fragment,{children:["fleet"!==e.id&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"mx-3 my-1",children:(0,t.jsx)("div",{className:(0,n.f)("h-px bg-gradient-to-r to-transparent",Q[e.id])})}),(0,t.jsx)("div",{className:"px-4 pb-0.5 pt-2",children:(0,t.jsx)("span",{className:(0,n.f)("text-[9px] font-bold uppercase tracking-[0.25em]",r?"text-accent/60":"text-primary/60"),children:e.label})})]}),(0,t.jsx)("nav",{className:(0,n.f)("space-y-0.5 p-3","fleet"!==e.id&&"pt-1"),"aria-label":e.label,children:e.items.map(e=>{let i=e.href===a,l=e.icon;return(0,t.jsxs)(s.default,{href:e.href,prefetch:!1,target:e.external?"_blank":void 0,rel:e.external?"noopener noreferrer":void 0,"aria-current":i?"page":void 0,className:(0,n.f)("group relative flex items-center gap-3 overflow-hidden rounded-chip px-3 py-2 text-xs uppercase tracking-wider transition-colors duration-200","before:pointer-events-none before:absolute before:inset-y-0 before:-left-1/2 before:w-1/2 before:-skew-x-12 before:bg-gradient-to-r before:from-transparent before:to-transparent before:opacity-0 before:transition-[left,opacity] before:duration-500 hover:before:left-full hover:before:opacity-100",r?"before:via-accent/10":"before:via-primary/10",i?(0,n.f)(r?"text-accent":"text-primary",r?"bg-accent/5":"bg-primary/5"):(0,n.f)("text-text-muted",r?"hover:text-accent":"hover:text-primary")),children:[i&&(0,t.jsx)(p.f.span,{layoutId:"sidebar-indicator",className:(0,n.f)("absolute bottom-1 left-0 top-1 w-0.5 rounded-full",r?"bg-accent":"bg-primary"),style:{boxShadow:r?"0 0 8px var(--color-accent), 0 0 16px var(--color-glow-accent)":"0 0 8px var(--color-primary), 0 0 16px var(--color-glow)"},transition:{type:"spring",stiffness:300,damping:30}}),(0,t.jsx)(l,{className:"relative h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"relative truncate",children:e.label})]},e.href)})})]})}function ee(){return(0,t.jsxs)("div",{className:"relative flex h-8 w-8 items-center justify-center animate-flicker",children:[(0,t.jsxs)("svg",{viewBox:"0 0 32 32",className:"h-8 w-8 overflow-visible","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"1",y:"1",width:"30",height:"30",rx:"4",fill:"none",stroke:"var(--color-primary)",strokeOpacity:"0.35"}),(0,t.jsx)("path",{d:"M8 23 V9 L16 18 L24 9 V23",fill:"none",stroke:"var(--color-primary)",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",pathLength:100,style:{"--stroke-length":100,strokeDasharray:100,animation:"draw-stroke 1.4s var(--ease-out-expo) both"},className:"drop-shadow-[0_0_4px_var(--color-primary)]"})]}),(0,t.jsx)("div",{className:"absolute inset-0 rounded shadow-[0_0_12px_var(--color-glow)]"})]})}function et(){let{connected:e}=(0,a.useSyncExternalStore)(Z.f.subscribe,Z.f.getSnapshot,Z.f.getServerSnapshot);return(0,t.jsxs)("span",{className:"flex items-center gap-1.5",title:e?"Live event stream connected":"Live event stream reconnecting",children:[(0,t.jsxs)("span",{className:"relative inline-flex h-1.5 w-1.5",children:[e&&(0,t.jsx)("span",{className:"absolute inset-0 rounded-full bg-success animate-halo"}),(0,t.jsx)("span",{className:(0,n.f)("relative inline-flex h-1.5 w-1.5 rounded-full",e?"bg-success shadow-[0_0_6px_var(--color-success)]":"bg-warning")})]}),(0,t.jsx)("span",{className:e?"text-success/70":"text-warning/70",children:e?"Live":"Offline"})]})}function ea({integrations:e}){let s=X((0,r.usePathname)()),n=(0,a.useMemo)(()=>(function(e,t=W){return t.filter(t=>{var a;return!t.integration||(a=t.integration,"securityConsole"===a?null!==e.securityConsoleUrl:e.hermes)}).map(t=>"security"===t.id&&e.securityConsoleUrl?{...t,items:[{href:e.securityConsoleUrl,label:"Security console ↗",icon:U,external:!0},...t.items]}:t)})(e),[e]);return(0,t.jsxs)("aside",{className:"relative flex h-full w-56 flex-col border-r border-border/50 bg-bg",children:[(0,t.jsx)("div",{className:"absolute bottom-0 right-0 top-0 w-px bg-gradient-to-b from-primary/60 via-primary/20 to-transparent"}),(0,t.jsxs)("div",{className:"flex h-14 items-center gap-3 border-b border-border/30 px-4",children:[(0,t.jsx)(ee,{}),(0,t.jsx)("span",{className:"text-sm font-bold uppercase tracking-[0.2em] text-text",children:"Magnus"})]}),(0,t.jsx)(h,{}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:n.map(e=>(0,t.jsx)(Y,{group:e,activeHref:s},e.id))}),(0,t.jsxs)("div",{className:"flex items-center justify-between border-t border-border/30 p-4 text-[10px] uppercase tracking-widest text-primary/40",children:[(0,t.jsxs)("span",{children:["Magnus v","1.0.3"]}),(0,t.jsx)(et,{})]})]})}var er=e.i(92270),es=e.i(16715);let en=(0,b.f)("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);var ei=e.i(55436),el=e.i(63059);let eo=(0,b.f)("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]),ec=(0,b.f)("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);var ed=e.i(78894),eu=e.i(63032),em=e.i(52571),ex=e.i(9912),ef=e.i(43034),eh=e.i(82983);function ep(){let[e,r]=(0,a.useState)(!1),[i,o]=(0,a.useState)([]),[d,u]=(0,a.useState)(0),[m,x]=(0,a.useState)(!1),f=(0,a.useRef)(null),h=(0,a.useCallback)(async()=>{try{let e=await eh.f.notifications.unreadCount();e.success&&e.data&&u(e.data.count)}catch{}},[]),p=(0,a.useCallback)(async()=>{x(!0);try{let e=await eh.f.notifications.list({pageSize:20});if(e.success&&e.data){let t=e.data;o(t.notifications)}}catch{}finally{x(!1)}},[]);(0,a.useEffect)(()=>{h();let e=setInterval(()=>void h(),15e3);return()=>clearInterval(e)},[h]),(0,a.useEffect)(()=>{e&&p()},[e,p]),(0,a.useEffect)(()=>{if(!e)return;let t=e=>{f.current&&!f.current.contains(e.target)&&r(!1)};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[e]),(0,a.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&r(!1)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]);let b=async e=>{try{await eh.f.notifications.markRead([e]),o(t=>t.map(t=>t.id===e?{...t,isRead:!0}:t)),u(e=>Math.max(0,e-1))}catch{}},g=async()=>{try{await eh.f.notifications.markAllRead(),o(e=>e.map(e=>({...e,isRead:!0}))),u(0),setTimeout(()=>void h(),500)}catch{}};return(0,t.jsxs)("div",{className:"relative",ref:f,children:[(0,t.jsxs)("button",{className:"relative rounded p-2 text-text-muted transition-all hover:bg-surface-hover hover:text-text",title:"Notifications",type:"button","aria-expanded":e,"aria-controls":"notification-panel","aria-label":d>0?`Notifications (${d} unread)`:"Notifications",onClick:()=>r(e=>!e),children:[(0,t.jsx)(eo,{className:"h-4 w-4"}),d>0&&(0,t.jsx)("span",{className:"absolute right-1 top-1 flex h-4 min-w-[1rem] items-center justify-center rounded-full bg-danger px-1 text-[10px] font-bold text-white",children:d>99?"99+":d})]}),e&&(0,t.jsxs)("div",{id:"notification-panel",role:"region","aria-label":"Notifications",className:"absolute right-0 top-full z-50 mt-2 w-96 overflow-hidden rounded border border-border bg-surface shadow-2xl",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[(0,t.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider text-text",children:"Notifications"}),d>0&&(0,t.jsxs)("button",{className:"flex items-center gap-1 rounded px-2 py-1 text-xs text-primary hover:bg-primary/10 transition-all",onClick:()=>void g(),type:"button",children:[(0,t.jsx)(ec,{className:"h-3 w-3"}),"Mark all read"]})]}),(0,t.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[m&&0===i.length&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsx)("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-primary border-t-transparent"})}),!m&&0===i.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-10 text-text-muted",children:[(0,t.jsx)(eo,{className:"mb-2 h-8 w-8 opacity-40"}),(0,t.jsx)("p",{className:"text-xs",children:"No notifications yet"})]}),i.map(e=>(0,t.jsxs)("div",{className:(0,n.f)("group flex items-start gap-3 border-b border-border/50 px-4 py-3 transition-all hover:bg-surface-hover",!e.isRead&&"bg-primary/5"),children:[(0,t.jsx)("div",{className:"mt-0.5 shrink-0",children:function(e){switch(e){case"critical":return(0,t.jsx)(eu.f,{className:"h-4 w-4 text-danger"});case"warning":return(0,t.jsx)(ed.f,{className:"h-4 w-4 text-warning"});default:return(0,t.jsx)(em.f,{className:"h-4 w-4 text-primary"})}}(e.severity)}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[function(e){switch(e){case"node.offline":return(0,t.jsx)(y.f,{className:"h-3.5 w-3.5 text-danger"});case"node.degraded":return(0,t.jsx)(y.f,{className:"h-3.5 w-3.5 text-warning"});case"node.recovered":return(0,t.jsx)(T,{className:"h-3.5 w-3.5 text-success"});case"command.failed":return(0,t.jsx)(v.f,{className:"h-3.5 w-3.5 text-warning"});case"deploy.failed":return(0,t.jsx)(ex.f,{className:"h-3.5 w-3.5 text-danger"});case"upgrade.failed":return(0,t.jsx)(ef.f,{className:"h-3.5 w-3.5 text-danger"});default:return(0,t.jsx)(eo,{className:"h-3.5 w-3.5 text-text-muted"})}}(e.type),(0,t.jsx)("span",{className:(0,n.f)("text-xs font-bold",e.isRead?"text-text-muted":"text-text"),children:e.title})]}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-text-muted line-clamp-2",children:e.message}),(0,t.jsx)("span",{className:"mt-1 block text-[10px] text-text-muted/60",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return"just now";let a=Math.floor(t/60);if(a<60)return`${a}m ago`;let r=Math.floor(a/60);if(r<24)return`${r}h ago`;let s=Math.floor(r/24);return`${s}d ago`}(e.createdAt)})]}),!e.isRead&&(0,t.jsx)("button",{className:"mt-0.5 shrink-0 rounded p-1 text-text-muted opacity-0 transition-all hover:bg-surface-hover hover:text-primary group-hover:opacity-100",title:"Mark as read",type:"button",onClick:()=>void b(e.id),children:(0,t.jsx)(c.f,{className:"h-3.5 w-3.5"})})]},e.id))]}),(0,t.jsx)("div",{className:"border-t border-border px-4 py-2 flex justify-end",children:(0,t.jsxs)(s.default,{href:"/notifications",className:"flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",onClick:()=>r(!1),children:[(0,t.jsx)(l.f,{className:"h-3 w-3"}),"Preferences"]})})]})]})}var eb=e.i(1092);let eg=[{keys:["g","m"],label:"Go to Mission Control",description:"Navigate to unified Mission Control home",action:"navigate",target:"/mission-control",category:"navigation"},{keys:["g","o"],label:"Go to Overview",description:"Navigate to fleet overview",action:"navigate",target:"/",category:"navigation"},{keys:["g","n"],label:"Go to Nodes",description:"Navigate to node list",action:"navigate",target:"/nodes",category:"navigation"},{keys:["g","c"],label:"Go to Commands",description:"Navigate to command console",action:"navigate",target:"/commands",category:"navigation"},{keys:["g","j"],label:"Go to Cron Jobs",description:"Navigate to cron jobs",action:"navigate",target:"/cron",category:"navigation"},{keys:["g","f"],label:"Go to Files",description:"Navigate to file editor",action:"navigate",target:"/files",category:"navigation"},{keys:["g","s"],label:"Go to Skills",description:"Navigate to skill marketplace",action:"navigate",target:"/skills",category:"navigation"},{keys:["g","l"],label:"Go to Logs",description:"Navigate to log explorer",action:"navigate",target:"/logs",category:"navigation"},{keys:["g","a"],label:"Go to Audit",description:"Navigate to audit trail",action:"navigate",target:"/audit",category:"navigation"},{keys:["?"],label:"Show Shortcuts",description:"Show keyboard shortcut reference",action:"command",target:"show-shortcuts",category:"general"}];function ey(){return"u">typeof navigator&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘":"Ctrl"}function ev(){document.body.dispatchEvent(new KeyboardEvent("keydown",{key:"k",ctrlKey:!0,metaKey:!0,bubbles:!0}))}function ew({onMenuToggle:e}){let n=(0,r.usePathname)(),i=(0,r.useRouter)(),{title:l,crumbs:o}=function(e){let t=null;for(let a of Object.keys(B))J(e,a)&&(null===t||a.length>t.length)&&(t=a);let a=t?B[t]:"Magnus",r=X(e),s=r?W.find(e=>e.items.some(e=>e.href===r))?.label??null:null,n=[];if(s&&n.push({label:s}),n.push({label:a,href:t??void 0}),t&&e!==t)for(let a of e.slice("/"===t?1:t.length+1).split("/").filter(Boolean)){let e=decodeURIComponent(a);n.push({label:e.length>18?`${e.slice(0,8)}…${e.slice(-6)}`:e})}return{title:a,group:s,crumbs:n}}(n),[c,d]=(0,a.useState)(null),[u,m]=(0,a.useState)(!1),[x,f]=(0,a.useState)("Ctrl"),h=(0,a.useRef)(null);async function p(e=!1){let t=await fetch(`/api/auth/logout${e?"?all=true":""}`,{method:"POST"}).catch(()=>null);t?.ok?(i.push("/login"),i.refresh()):window.alert("Session revocation unavailable; retry sign out.")}return(0,a.useEffect)(()=>{f(ey()),fetch("/api/auth/me").then(e=>e.ok?e.json():null).then(e=>{e?.username&&d(e.username)}).catch(()=>{})},[]),(0,a.useEffect)(()=>{if(!u)return;let e=e=>{(e instanceof KeyboardEvent?"Escape"!==e.key:h.current?.contains(e.target))||m(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",e)}},[u]),(0,t.jsxs)("header",{className:"relative z-(--z-shell) flex h-14 items-center justify-between gap-3 bg-bg/80 px-3 backdrop-blur-sm sm:px-6",children:[(0,t.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-primary/60 via-accent/40 to-transparent"}),(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 text-xs uppercase tracking-[0.15em] text-text-muted",children:[e&&(0,t.jsx)("button",{className:"mr-1 rounded p-1.5 text-text-muted hover:text-primary md:hidden",onClick:e,type:"button",title:"Toggle menu",children:(0,t.jsx)(en,{className:"h-5 w-5"})}),(0,t.jsx)("span",{className:"text-primary/60",children:">_"}),(0,t.jsx)("nav",{"aria-label":"Breadcrumb",className:"hidden min-w-0 items-center gap-1 sm:flex",children:o.map((e,a)=>{let r=a===o.length-1;return(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[a>0&&(0,t.jsx)(el.f,{className:"h-3 w-3 shrink-0 text-primary/30","aria-hidden":"true"}),e.href&&!r?(0,t.jsx)(s.default,{href:e.href,prefetch:!1,className:"truncate transition-colors hover:text-primary",children:e.label}):(0,t.jsx)("span",{className:r?"truncate text-text":0===a&&o.length>1?"truncate text-text-muted/60":"truncate","aria-current":r?"page":void 0,children:e.label})]},`${e.label}-${a}`)})}),(0,t.jsx)("span",{className:"sr-only sm:hidden",children:l}),(0,t.jsx)("span",{className:"ml-1 hidden h-3.5 w-1.5 shrink-0 bg-primary/80 sm:inline-block",style:{animation:"cursor-blink 1s step-end infinite"}})]}),(0,t.jsx)(eb.J,{className:"hidden max-w-xl flex-1 lg:block"}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1 sm:gap-2",children:[(0,t.jsxs)("button",{type:"button",onClick:ev,className:"hidden items-center gap-2 rounded-chip border border-border bg-surface px-2.5 py-1.5 text-[10px] uppercase tracking-wider text-text-muted transition-colors hover:border-primary/40 hover:text-primary md:flex",title:"Search and jump (command palette)",children:[(0,t.jsx)(ei.f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:"Search"}),(0,t.jsxs)("kbd",{className:"rounded-chip border border-border bg-bg px-1 text-[9px] text-primary/70",children:[x,"+K"]})]}),(0,t.jsx)("button",{className:"rounded p-2 text-text-muted transition-all hover:text-primary hover:drop-shadow-[0_0_6px_var(--color-glow)]",title:"Refresh",onClick:()=>window.location.reload(),type:"button",children:(0,t.jsx)(es.f,{className:"h-4 w-4"})}),(0,t.jsx)(ep,{}),(0,t.jsx)("button",{className:"rounded p-2 text-text-muted transition-all hover:text-danger hover:drop-shadow-[0_0_6px_rgba(255,23,68,0.3)]",title:"Sign Out",onClick:()=>void p(),type:"button",children:(0,t.jsx)(er.f,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{ref:h,className:"relative ml-1",children:[(0,t.jsx)("button",{type:"button",onClick:()=>m(e=>!e),"aria-haspopup":"menu","aria-expanded":u,title:c?`Signed in as ${c}`:"Account",className:"flex h-8 w-8 items-center justify-center rounded border border-accent/40 text-[10px] font-bold uppercase text-accent shadow-[0_0_8px_var(--color-glow-accent)] transition-colors hover:border-accent hover:bg-accent/10",children:c?.[0]??"U"}),u&&(0,t.jsxs)("div",{role:"menu",className:"panel-corners absolute right-0 top-full z-(--z-modal) mt-2 w-60 rounded-panel border border-accent/30 bg-surface/95 p-1 shadow-[0_0_24px_var(--color-glow-accent)] backdrop-blur-sm [--panel-corner-color:var(--color-accent)]",children:[c&&(0,t.jsxs)("div",{className:"border-b border-border px-3 py-2 text-[10px] uppercase tracking-wider text-text-muted",children:["Signed in as ",(0,t.jsx)("span",{className:"text-accent",children:c})]}),(0,t.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>void p(),className:"flex w-full items-center gap-2 rounded-chip px-3 py-2 text-left text-xs text-text-muted transition-colors hover:bg-surface-hover hover:text-text",children:[(0,t.jsx)(er.f,{className:"h-3.5 w-3.5"})," Sign out"]}),(0,t.jsxs)("button",{type:"button",role:"menuitem","aria-label":"Sign out all local sessions",onClick:()=>void p(!0),className:"flex w-full items-center gap-2 rounded-chip px-3 py-2 text-left text-xs text-text-muted transition-colors hover:bg-danger/10 hover:text-danger",children:[(0,t.jsx)(er.f,{className:"h-3.5 w-3.5"})," Sign out all local sessions"]})]})]})]})]})}async function ek(e,t){try{let a=await fetch(e,{signal:t,headers:{accept:"application/json"}});if(!a.ok)return null;return await a.json()}catch{return null}}function ej(e,t){return e.trim()?t.map(t=>({e:t,s:function(e,t){if(!e)return 0;let a=e.toLowerCase(),r=t.toLowerCase(),s=r.indexOf(a);if(-1!==s)return s;let n=0,i=0;for(let e of a){let t=r.indexOf(e,n);if(-1===t)return -1;i+=t-n,n=t+1}return 1e3+i}(e,`${t.label} ${t.sublabel??""}`)})).filter(({s:e})=>e>=0).sort((e,t)=>e.s-t.s).map(({e})=>e):t}async function eN(e,t={}){let{signal:a,limit:r=10}=t;if(e.trim().length<2)return[];let[s,n,i]=await Promise.all([ek("/api/proxy/nodes",a),ek("/api/proxy/orchestra/installations",a),ek("/api/proxy/orchestra/skill-catalog",a)]),l=[];for(let e of s?.data??[])l.push({kind:"node",id:e.id,label:e.name,sublabel:e.status?`Node \xb7 ${e.status}`:"Node",href:`/nodes/${e.id}`});for(let e of n?.data??[])l.push({kind:"installation",id:e.id,label:e.displayName??e.hostname,sublabel:`Hermes \xb7 ${e.status??"unknown"}`,href:"/orchestra/installations"});for(let e of i?.data??[])l.push({kind:"skill",id:e.id,label:e.name,sublabel:e.description??"Skill",href:"/skills"});return ej(e,[{kind:"action",id:"deploy-agent",label:"Deploy agent to host",sublabel:"Action · Operations",href:"/governor/operations"},{kind:"action",id:"open-terminal",label:"Open node terminal",sublabel:"Action · Nodes",href:"/nodes"},{kind:"action",id:"run-fleet-check",label:"Run fleet check",sublabel:"Action · Fleet readiness",href:"/fleet-readiness"},{kind:"action",id:"view-stale-nodes",label:"View stale nodes",sublabel:"Action · Readiness",href:"/fleet-readiness"},{kind:"action",id:"rotate-node-secret",label:"Rotate node secret",sublabel:"Action · Operations",href:"/governor/operations"},{kind:"action",id:"latest-failed-deploy",label:"Open latest failed deploy",sublabel:"Action · Timeline",href:"/fleet-timeline"},...l]).slice(0,r)}var eC=e.i(72520),eS=e.i(77754),eM=e.i(7866);let eE=(0,b.f)("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);var e_=e.i(37727);let e$=(0,b.f)("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);var eA=e.i(31278),eL=e.i(83086),eR=e.i(72603);let eP={"/":g,"/mission-control":R,"/nodes":y.f,"/commands":v.f,"/cron":w.f,"/files":k.f,"/skills":eS.f,"/logs":j,"/audit":N.f,"/library":eM.f},eT={node:y.f,installation:C.f,skill:eS.f,action:eC.f};function eO(){let[e,s]=(0,a.useState)(!1),[n,i]=(0,a.useState)(""),[l,o]=(0,a.useState)(0),[c,d]=(0,a.useState)(!1),[u,m]=(0,a.useState)([]),[x,f]=(0,a.useState)(!1),[h,p]=(0,a.useState)("normal"),b=(0,a.useRef)(null),g=(0,r.useRouter)(),y=(0,a.useRef)([]),v=(0,a.useRef)(void 0),w=(0,a.useRef)(void 0),k=(0,a.useRef)(null),j=(n.trim()?eg.filter(e=>e.label.toLowerCase().includes(n.toLowerCase())||e.description.toLowerCase().includes(n.toLowerCase())):eg).map(e=>({kind:"shortcut",key:`s:${e.keys.join("-")}`,shortcut:e})),N=ej(n,u).map(e=>({kind:"entity",key:`e:${e.kind}:${e.id}`,entity:e})),C=n.trim()?[...N,...j]:j;(0,a.useEffect)(()=>{if(!e)return;let t=n.trim();if(t.length<2){m([]),f(!1);return}w.current&&clearTimeout(w.current),k.current&&k.current.abort();let a=new AbortController;return k.current=a,f(!0),w.current=setTimeout(async()=>{let e=await eN(t,{signal:a.signal,limit:12});a.signal.aborted||(m(e),f(!1))},180),()=>{a.abort(),w.current&&clearTimeout(w.current)}},[n,e]);let S=(0,a.useCallback)(e=>{"navigate"===e.action&&e.target?(g.push(e.target),s(!1),i("")):"show-shortcuts"===e.target&&(d(!0),s(!1),i(""))},[g]),M=(0,a.useCallback)(e=>{"shortcut"===e.kind?S(e.shortcut):(g.push(e.entity.href),s(!1),i(""))},[S,g]);return((0,a.useEffect)(()=>{let t=t=>{let a=t.target,r="INPUT"===a.tagName||"TEXTAREA"===a.tagName||a.isContentEditable;if((t.metaKey||t.ctrlKey)&&"k"===t.key.toLowerCase()){t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),s(e=>!e);return}if("Escape"===t.key){if(e){s(!1),i("");return}return c?void d(!1):void 0}if(!r){if("?"===t.key){t.preventDefault(),d(e=>!e);return}if(1===t.key.length&&!t.metaKey&&!t.ctrlKey&&!t.altKey){for(let e of(clearTimeout(v.current),y.current.push(t.key.toLowerCase()),eg))if(e.keys.length===y.current.length&&e.keys.every((e,t)=>e===y.current[t])){t.preventDefault(),y.current=[],S(e);return}v.current=setTimeout(()=>{y.current=[]},800)}}};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e,c,S]),(0,a.useEffect)(()=>{e&&(o(0),setTimeout(()=>b.current?.focus(),50))},[e]),(0,a.useEffect)(()=>{l>=C.length&&o(Math.max(0,C.length-1))},[C.length,l]),(0,a.useEffect)(()=>{e&&p("low"===document.documentElement.dataset.fx?"low":"normal")},[e]),e||c)?(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsxs)("div",{className:"fixed inset-0 z-(--z-modal) flex items-start justify-center pt-[15vh]","data-testid":"command-palette",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-[2px]",onClick:()=>{s(!1),i("")}}),(0,t.jsxs)("div",{className:"relative z-10 w-full max-w-lg panel-corners rounded-panel border border-primary/30 bg-surface/95 shadow-[0_0_40px_var(--color-glow)]",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 border-b border-border px-4 py-3",children:[(0,t.jsx)(ei.f,{className:"h-5 w-5 text-primary"}),(0,t.jsx)("input",{ref:b,type:"text",placeholder:"Search nodes, agents, runs, users, commands...",className:"flex-1 bg-transparent text-sm text-text placeholder:text-text-muted/70 caret-primary outline-none",value:n,onChange:e=>{i(e.target.value),o(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),o(e=>Math.min(e+1,C.length-1))):"ArrowUp"===e.key?(e.preventDefault(),o(e=>Math.max(e-1,0))):"Enter"===e.key&&C[l]&&(e.preventDefault(),M(C[l]))},"data-testid":"command-palette-input"}),x?(0,t.jsx)(eA.f,{className:"h-4 w-4 animate-spin text-primary"}):(0,t.jsx)("kbd",{className:"rounded-chip border border-border bg-bg px-1.5 py-0.5 text-[10px] text-text-muted",children:"ESC"})]}),(0,t.jsxs)("div",{className:"max-h-96 overflow-y-auto py-2",children:[0===C.length&&!x&&(0,t.jsx)("p",{className:"px-4 py-6 text-center text-xs uppercase tracking-wider text-text-muted",children:"No results found"}),0===C.length&&x&&(0,t.jsx)("p",{className:"px-4 py-6 text-center text-xs uppercase tracking-wider text-text-muted",children:"Searching…"}),C.map((e,a)=>{let r=a===l;if("shortcut"===e.kind){let s=eP[e.shortcut.target??""]??eC.f;return(0,t.jsxs)("button",{className:`flex w-full items-center gap-3 px-4 py-2 text-left text-sm transition-colors ${r?"bg-primary/10 text-primary shadow-[inset_2px_0_0_var(--color-primary)]":"text-text hover:bg-surface-hover"}`,onClick:()=>M(e),onMouseEnter:()=>o(a),"data-testid":"command-palette-item","data-item-kind":"shortcut",children:[(0,t.jsx)(s,{className:"h-4 w-4 shrink-0 opacity-70"}),(0,t.jsx)("span",{className:"flex-1",children:e.shortcut.label}),(0,t.jsx)("span",{className:"text-xs text-text-muted",children:e.shortcut.keys.map(e=>e.toUpperCase()).join(" then ")})]},e.key)}let s=eT[e.entity.kind]??eC.f;return(0,t.jsxs)("button",{className:`flex w-full items-center gap-3 px-4 py-2 text-left text-sm transition-colors ${r?"bg-accent/10 text-accent shadow-[inset_2px_0_0_var(--color-accent)]":"text-text hover:bg-surface-hover"}`,onClick:()=>M(e),onMouseEnter:()=>o(a),"data-testid":"command-palette-item","data-item-kind":"entity","data-entity-kind":e.entity.kind,children:[(0,t.jsx)(s,{className:"h-4 w-4 shrink-0 text-accent/80"}),(0,t.jsxs)("span",{className:"flex-1 truncate",children:[(0,t.jsx)("span",{className:"font-medium",children:e.entity.label}),e.entity.sublabel&&(0,t.jsx)("span",{className:"ml-2 text-xs text-text-muted",children:e.entity.sublabel})]}),(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:e.entity.kind})]},e.key)})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 border-t border-border px-4 py-2 text-[10px] uppercase tracking-wider text-text-muted",children:[(0,t.jsx)("span",{children:"↑↓ navigate"}),(0,t.jsx)("span",{children:"↵ select"}),(0,t.jsx)("span",{children:"esc close"}),(0,t.jsxs)("button",{type:"button",onClick:()=>p((0,eR.W)()),className:"ml-auto flex items-center gap-1 rounded-chip px-1 text-text-muted transition-colors hover:text-primary",title:"Toggle visual effects (scanlines, glow pulses, animated map)","data-testid":"command-palette-fx-toggle",children:[(0,t.jsx)(eL.f,{className:"h-3 w-3"})," fx: ",h]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(e$,{className:"h-3 w-3"})," ",ey(),"+K"]})]})]})]}),c&&(0,t.jsxs)("div",{className:"fixed inset-0 z-(--z-modal) flex items-center justify-center",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-[2px]",onClick:()=>d(!1)}),(0,t.jsxs)("div",{className:"relative z-10 w-full max-w-md panel-corners rounded-panel border border-primary/30 bg-surface/95 p-6 shadow-[0_0_40px_var(--color-glow)]",children:[(0,t.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(eE,{className:"h-5 w-5 text-primary"}),(0,t.jsx)("h2",{className:"text-sm font-bold uppercase tracking-wider text-primary glow-text-primary",children:"Keyboard Shortcuts"})]}),(0,t.jsx)("button",{onClick:()=>d(!1),className:"text-text-muted hover:text-text",children:(0,t.jsx)(e_.X,{className:"h-5 w-5"})})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 text-[10px] font-medium uppercase tracking-[0.2em] text-text-muted",children:"General"}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(ez,{keys:[`${ey()}+K`],label:"Open command palette"}),(0,t.jsx)(ez,{keys:["?"],label:"Show this reference"}),(0,t.jsx)(ez,{keys:["Esc"],label:"Close modal / palette"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 text-[10px] font-medium uppercase tracking-[0.2em] text-text-muted",children:"Fleet Navigation"}),(0,t.jsx)("div",{className:"space-y-1",children:eg.filter(e=>"navigation"===e.category).map(e=>(0,t.jsx)(ez,{keys:e.keys.map(e=>e.toUpperCase()),label:e.label},e.target))})]})]})]})]})]}):null}function ez({keys:e,label:a}){return(0,t.jsxs)("div",{className:"flex items-center justify-between py-1",children:[(0,t.jsx)("span",{className:"text-xs text-text",children:a}),(0,t.jsx)("div",{className:"flex gap-1",children:e.map((a,r)=>(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"rounded-chip border border-border bg-bg px-1.5 py-0.5 text-[11px] text-primary",children:a}),r<e.length-1&&(0,t.jsx)("span",{className:"mx-0.5 text-[10px] text-text-muted/60",children:"then"})]},r))})]})}var eI=e.i(52928);e.s(["DashboardShell",0,function({children:e,integrations:s}){let n=(0,r.usePathname)(),i="/login"===n||n.startsWith("/governor/share/"),[l,o]=(0,a.useState)(!1);!function({enabled:e=!0}={}){let[t,r]=(0,a.useState)(!1),{addToast:s}=(0,eI.d)(),n=(0,a.useRef)(s);n.current=s;let i=(0,a.useRef)(null),l=(0,a.useRef)(null),o=(0,a.useCallback)(()=>{if(!e)return;let t=new EventSource("/api/proxy/events/stream");for(let e of(i.current=t,t.onopen=()=>{r(!0),Z.f.setConnected(!0)},["deploy:status","node:status","command:status","alert:fired"]))t.addEventListener(e,t=>{try{let a=JSON.parse(t.data),r=function(e){let t=e.type??"",a=e.nodeName??"Unknown";switch(t){case"deploy.started":return{title:`Deploying to ${a}`,severity:"info"};case"deploy.completed":return{title:`Deploy complete: ${a}`,severity:"success"};case"deploy.failed":return{title:`Deploy failed: ${a}`,message:e.message??void 0,severity:"error"};case"upgrade.started":return{title:`Upgrading ${a}`,severity:"info"};case"upgrade.completed":return{title:`Upgrade complete: ${a}`,message:`v${e.version}`,severity:"success"};case"upgrade.failed":return{title:`Upgrade failed: ${a}`,message:e.message??void 0,severity:"error"};case"node.recovered":return{title:`${a} back online`,message:`Recovered from ${e.previousStatus}`,severity:"success"};case"command.completed":return{title:"Command completed",message:`${e.command}`,severity:"success"};case"command.failed":return{title:"Command failed",message:`${e.command} (exit ${e.exitCode})`,severity:"error"};case"health.alert":return{title:`Alert: ${e.metric?.replaceAll("_"," ").toUpperCase()} on ${a}`,message:`${e.value?.toFixed(1)}% (threshold: ${e.threshold}%)`,severity:e.severity??"warning"};default:return null}}(a);r&&n.current(r),Z.f.push(r?{...r,channel:e}:{title:String(a.type??e).replaceAll("."," "),message:"string"==typeof a.nodeName?a.nodeName:void 0,severity:"info",channel:e})}catch{}});return t.onerror=()=>{r(!1),Z.f.setConnected(!1),t.close(),fetch("/api/auth/me",{cache:"no-store"}).then(e=>{if(i.current===t){if(401===e.status)return void window.location.replace("/login");l.current=setTimeout(o,5e3)}}).catch(()=>{i.current===t&&(l.current=setTimeout(o,5e3))})},t},[e]);(0,a.useEffect)(()=>{let e=o();return()=>{l.current&&clearTimeout(l.current),e?.close(),i.current?.close(),Z.f.setConnected(!1),i.current=null}},[o])}({enabled:!i}),(0,a.useEffect)(()=>{o(!1)},[n]);let c=(0,a.useCallback)(()=>o(e=>!e),[]);return i?(0,t.jsx)(t.Fragment,{children:e}):(0,t.jsxs)("div",{className:"flex h-screen overflow-hidden",children:[l&&(0,t.jsx)("div",{className:"fixed inset-0 z-40 bg-black/70 backdrop-blur-[2px] md:hidden",onClick:()=>o(!1)}),(0,t.jsx)("div",{className:`
|
|
2
2
|
fixed inset-y-0 left-0 z-50 transform transition-transform duration-200 ease-in-out md:relative md:h-full md:translate-x-0
|
|
3
3
|
${l?"translate-x-0":"-translate-x-full"}
|
|
4
4
|
`,children:(0,t.jsx)(ea,{integrations:s})}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,t.jsx)(ew,{onMenuToggle:c}),(0,t.jsx)("main",{className:"app-backdrop relative flex-1 overflow-y-auto p-3 md:p-6",children:e})]}),(0,t.jsx)(eO,{})]})}],40073)},52928,e=>{var t=e.i(43476),a=e.i(71645),r=e.i(78894),s=e.i(95468),n=e.i(52571),i=e.i(37727),l=e.i(73884);let o=(0,a.createContext)(null),c=0,d={info:{bar:"bg-primary",border:"border-primary/40",text:"text-primary",glow:"shadow-[0_0_20px_var(--color-glow)]",Icon:n.f},success:{bar:"bg-success",border:"border-success/40",text:"text-success",glow:"shadow-[0_0_20px_var(--color-glow-success)]",Icon:s.f},warning:{bar:"bg-warning",border:"border-warning/40",text:"text-warning",glow:"shadow-[0_0_20px_var(--color-glow-warning)]",Icon:r.f},error:{bar:"bg-danger",border:"border-danger/40",text:"text-danger",glow:"shadow-[0_0_20px_var(--color-glow-danger)]",Icon:l.f}};function u({toasts:e,onRemove:a}){return 0===e.length?null:(0,t.jsx)("div",{role:"status","aria-live":"polite",className:"fixed bottom-4 right-4 z-(--z-toast) flex max-w-sm flex-col gap-2",children:e.map(e=>{let r=d[e.severity],s=r.Icon;return(0,t.jsxs)("div",{className:`relative overflow-hidden rounded-panel border ${r.border} ${r.glow} bg-surface/95 py-3 pl-4 pr-3 text-text backdrop-blur-sm animate-toast-in`,children:[(0,t.jsx)("span",{"aria-hidden":"true",className:`absolute inset-y-0 left-0 w-0.5 ${r.bar}`}),(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)(s,{className:`mt-0.5 h-4 w-4 shrink-0 ${r.text}`,"aria-hidden":"true"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:`text-xs font-bold uppercase leading-tight tracking-wider ${r.text}`,children:e.title}),e.message&&(0,t.jsx)("p",{className:"mt-1 line-clamp-2 text-[11px] text-text-muted",children:e.message})]}),(0,t.jsx)("button",{onClick:()=>a(e.id),"aria-label":"Dismiss notification",className:"ml-2 shrink-0 text-text-muted transition-colors hover:text-text",children:(0,t.jsx)(i.X,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("span",{"aria-hidden":"true",className:`absolute bottom-0 left-0 h-px w-full origin-left opacity-60 ${r.bar}`,style:{animation:`toast-progress ${"error"===e.severity?10:6}s linear forwards`}})]},e.id)})})}e.s(["N",0,function({children:e}){let[r,s]=(0,a.useState)([]),n=(0,a.useCallback)(e=>{s(t=>t.filter(t=>t.id!==e))},[]),i=(0,a.useCallback)(e=>{let t=`toast-${++c}`,a={...e,id:t,createdAt:Date.now()};s(e=>[...e.slice(-9),a]),setTimeout(()=>n(t),"error"===e.severity?1e4:6e3)},[n]);return(0,t.jsxs)(o.Provider,{value:{toasts:r,addToast:i,removeToast:n},children:[e,(0,t.jsx)(u,{toasts:r,onRemove:n})]})},"d",0,function(){let e=(0,a.useContext)(o);if(!e)throw Error("useToast must be used within a ToastProvider");return e}])}])})();
|