@miravo/cli-linux-x64 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/console-dist/assets/catalog-BKhsnMBa.js +1 -0
  2. package/console-dist/assets/catalog-Ia1pbi0U.js +1 -0
  3. package/console-dist/assets/control-M9POk7sD.js +1 -0
  4. package/console-dist/assets/control-xSKU0dgF.js +1 -0
  5. package/console-dist/assets/copy-button-BK3jqKBZ.js +1 -0
  6. package/console-dist/assets/deploy-tab-zi4NXsfj.js +1 -0
  7. package/console-dist/assets/events-BRekhc6s.js +1 -0
  8. package/console-dist/assets/{events-40FcPI5G.js → events-CfrhnDG_.js} +1 -1
  9. package/console-dist/assets/fleet-Bk6J6tiE.js +1 -0
  10. package/console-dist/assets/{fleet-CcWeGysy.js → fleet-CcdFCWOI.js} +1 -1
  11. package/console-dist/assets/{index-0Q8wjuZr.js → index-DVW3M0iW.js} +5 -5
  12. package/console-dist/assets/instance-detail-bpv-KYmO.js +1 -0
  13. package/console-dist/assets/{login-B9bEXW-9.js → login-DV1Fd0nK.js} +1 -1
  14. package/console-dist/assets/models-BOPuZsyi.js +1 -0
  15. package/console-dist/assets/models-BbWAxRFR.js +1 -0
  16. package/console-dist/assets/platforms-Dq6BGck6.js +1 -0
  17. package/console-dist/assets/platforms-H2Z4z-EX.js +1 -0
  18. package/console-dist/assets/route-preload-CMl-AryU.js +2 -0
  19. package/console-dist/assets/tabs-BgPF8MSY.js +1 -0
  20. package/console-dist/assets/tags-DZpOeuyx.js +4 -0
  21. package/console-dist/assets/tags-nAOAgZzI.js +1 -0
  22. package/console-dist/assets/{transition-nav-link-CuWixOOd.js → transition-nav-link-B89fDRXR.js} +1 -1
  23. package/console-dist/assets/use-engine-command-mutation-DTvKLMBg.js +1 -0
  24. package/console-dist/assets/use-platform-stream-BZTQlkbS.js +2 -0
  25. package/console-dist/assets/{use-transition-navigate-C3Y3EWRr.js → use-transition-navigate-CG8tHeYN.js} +1 -1
  26. package/console-dist/assets/validation-CyzCfw_2.js +1 -0
  27. package/console-dist/icon.png +0 -0
  28. package/console-dist/index.html +19 -19
  29. package/miravo +0 -0
  30. package/package.json +1 -1
  31. package/console-dist/assets/catalog-CurT8GX7.js +0 -1
  32. package/console-dist/assets/catalog-Dq3afUeM.js +0 -1
  33. package/console-dist/assets/control-DbOdtp7Q.js +0 -1
  34. package/console-dist/assets/control-O0UYo7WO.js +0 -1
  35. package/console-dist/assets/deploy-tab-BjWxHSsV.js +0 -1
  36. package/console-dist/assets/dialog-DD0yn-KA.js +0 -1
  37. package/console-dist/assets/events-Dq2kZb5H.js +0 -1
  38. package/console-dist/assets/fleet-C4qL3Z_E.js +0 -1
  39. package/console-dist/assets/instance-detail-4xiHIeF2.js +0 -1
  40. package/console-dist/assets/models-6X-8K2W2.js +0 -1
  41. package/console-dist/assets/models-wWuV5zGw.js +0 -1
  42. package/console-dist/assets/platforms-C5DxJAky.js +0 -1
  43. package/console-dist/assets/platforms-DrizMC87.js +0 -1
  44. package/console-dist/assets/route-preload-Dz8gP8hl.js +0 -2
  45. package/console-dist/assets/tabs-Bwhx891Q.js +0 -1
  46. package/console-dist/assets/tags-CbYqG-S1.js +0 -1
  47. package/console-dist/assets/tags-Z8A51KqE.js +0 -4
  48. package/console-dist/assets/use-engine-command-mutation-CQc8tXfc.js +0 -1
  49. package/console-dist/assets/use-platform-stream-7982hIDJ.js +0 -2
  50. package/console-dist/assets/validation-4FJlp2qx.js +0 -1
  51. package/console-dist/favicon.svg +0 -1
  52. package/console-dist/miravo-logo.png +0 -0
@@ -5,7 +5,7 @@
5
5
  <link rel="preload" href="/assets/schibsted-grotesk-latin-wght-normal-Bb8VGrTG.woff2" as="font" type="font/woff2" crossorigin="anonymous">
6
6
 
7
7
  <meta charset="UTF-8" />
8
- <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
8
+ <link rel="icon" type="image/png" href="/icon.png" />
9
9
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
10
10
  <meta name="theme-color" content="#0b0f12" />
11
11
  <style>
@@ -21,7 +21,7 @@
21
21
  }
22
22
  </style>
23
23
  <title>Miravo</title>
24
- <script type="module" crossorigin src="/assets/index-0Q8wjuZr.js"></script>
24
+ <script type="module" crossorigin src="/assets/index-DVW3M0iW.js"></script>
25
25
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-COnpUsM8.js">
26
26
  <link rel="modulepreload" crossorigin href="/assets/vendor-charts-CAZdaPlq.js">
27
27
  <link rel="modulepreload" crossorigin href="/assets/chunk-OE4NN4TA-m2UhO8Q2.js">
@@ -36,42 +36,42 @@
36
36
  <link rel="modulepreload" crossorigin href="/assets/arrow-right-DrKCU9WM.js">
37
37
  <link rel="modulepreload" crossorigin href="/assets/select-4wihIkEE.js">
38
38
  <link rel="modulepreload" crossorigin href="/assets/platform-targets-BbVxaqAc.js">
39
- <link rel="modulepreload" crossorigin href="/assets/dialog-DD0yn-KA.js">
40
- <link rel="modulepreload" crossorigin href="/assets/tooltip-TtanriwA.js">
41
- <link rel="modulepreload" crossorigin href="/assets/tabs-Bwhx891Q.js">
39
+ <link rel="modulepreload" crossorigin href="/assets/tabs-BgPF8MSY.js">
42
40
  <link rel="modulepreload" crossorigin href="/assets/circle-question-mark-Q_q7JZnT.js">
41
+ <link rel="modulepreload" crossorigin href="/assets/tooltip-TtanriwA.js">
42
+ <link rel="modulepreload" crossorigin href="/assets/copy-button-BK3jqKBZ.js">
43
43
  <link rel="modulepreload" crossorigin href="/assets/checkbox-Xly18Uyz.js">
44
44
  <link rel="modulepreload" crossorigin href="/assets/triangle-alert-DPtblpQC.js">
45
45
  <link rel="modulepreload" crossorigin href="/assets/badge-tnWgSITj.js">
46
46
  <link rel="modulepreload" crossorigin href="/assets/label-xIWEC6lW.js">
47
- <link rel="modulepreload" crossorigin href="/assets/use-platform-stream-7982hIDJ.js">
47
+ <link rel="modulepreload" crossorigin href="/assets/use-platform-stream-BZTQlkbS.js">
48
48
  <link rel="modulepreload" crossorigin href="/assets/catalog-template-icons-b6a6Gty-.js">
49
49
  <link rel="modulepreload" crossorigin href="/assets/server-D7sb2mj5.js">
50
50
  <link rel="modulepreload" crossorigin href="/assets/dist-jROhexoH.js">
51
51
  <link rel="modulepreload" crossorigin href="/assets/skeleton-C6iEH-9E.js">
52
52
  <link rel="modulepreload" crossorigin href="/assets/query-keys-Co1J4HmV.js">
53
- <link rel="modulepreload" crossorigin href="/assets/platforms-DrizMC87.js">
53
+ <link rel="modulepreload" crossorigin href="/assets/platforms-Dq6BGck6.js">
54
54
  <link rel="modulepreload" crossorigin href="/assets/vendor-table-wd8JuMmT.js">
55
55
  <link rel="modulepreload" crossorigin href="/assets/arrow-up-down-CBuv2TSF.js">
56
56
  <link rel="modulepreload" crossorigin href="/assets/download-BPgKzo-_.js">
57
57
  <link rel="modulepreload" crossorigin href="/assets/engine-store-BUO-9Dsh.js">
58
58
  <link rel="modulepreload" crossorigin href="/assets/auth-screen-backdrop-OrOL41MR.js">
59
59
  <link rel="modulepreload" crossorigin href="/assets/combobox-gGNWoksU.js">
60
- <link rel="modulepreload" crossorigin href="/assets/tags-Z8A51KqE.js">
61
- <link rel="modulepreload" crossorigin href="/assets/deploy-tab-BjWxHSsV.js">
62
- <link rel="modulepreload" crossorigin href="/assets/use-engine-command-mutation-CQc8tXfc.js">
63
- <link rel="modulepreload" crossorigin href="/assets/models-6X-8K2W2.js">
64
- <link rel="modulepreload" crossorigin href="/assets/validation-4FJlp2qx.js">
60
+ <link rel="modulepreload" crossorigin href="/assets/tags-DZpOeuyx.js">
61
+ <link rel="modulepreload" crossorigin href="/assets/deploy-tab-zi4NXsfj.js">
62
+ <link rel="modulepreload" crossorigin href="/assets/use-engine-command-mutation-DTvKLMBg.js">
63
+ <link rel="modulepreload" crossorigin href="/assets/models-BbWAxRFR.js">
64
+ <link rel="modulepreload" crossorigin href="/assets/validation-CyzCfw_2.js">
65
65
  <link rel="modulepreload" crossorigin href="/assets/shallow-ODRQsuRf.js">
66
- <link rel="modulepreload" crossorigin href="/assets/route-preload-Dz8gP8hl.js">
67
- <link rel="modulepreload" crossorigin href="/assets/use-transition-navigate-C3Y3EWRr.js">
68
- <link rel="modulepreload" crossorigin href="/assets/transition-nav-link-CuWixOOd.js">
69
- <link rel="modulepreload" crossorigin href="/assets/control-DbOdtp7Q.js">
70
- <link rel="modulepreload" crossorigin href="/assets/catalog-CurT8GX7.js">
66
+ <link rel="modulepreload" crossorigin href="/assets/route-preload-CMl-AryU.js">
67
+ <link rel="modulepreload" crossorigin href="/assets/use-transition-navigate-CG8tHeYN.js">
68
+ <link rel="modulepreload" crossorigin href="/assets/transition-nav-link-B89fDRXR.js">
69
+ <link rel="modulepreload" crossorigin href="/assets/control-xSKU0dgF.js">
70
+ <link rel="modulepreload" crossorigin href="/assets/catalog-Ia1pbi0U.js">
71
71
  <link rel="modulepreload" crossorigin href="/assets/select-display-items-DUJCelf2.js">
72
72
  <link rel="modulepreload" crossorigin href="/assets/transition-types-CMW7IObN.js">
73
- <link rel="modulepreload" crossorigin href="/assets/fleet-CcWeGysy.js">
74
- <link rel="modulepreload" crossorigin href="/assets/events-40FcPI5G.js">
73
+ <link rel="modulepreload" crossorigin href="/assets/fleet-CcdFCWOI.js">
74
+ <link rel="modulepreload" crossorigin href="/assets/events-CfrhnDG_.js">
75
75
  <link rel="stylesheet" crossorigin href="/assets/index-BswNf6_7.css">
76
76
  </head>
77
77
  <body>
package/miravo CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miravo/cli-linux-x64",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Miravo platform binary for linux-x64.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";import{at as n}from"./vendor-ui-mizMYESS.js";import{_ as r,a as i}from"./api-Bef9FEIU.js";import{a,n as o,t as s}from"./get-error-message-DhCjoSSJ.js";import{t as c}from"./proxy-CgM57W61.js";import{t as l}from"./AnimatePresence-CVhkybDC.js";import{a as u,i as d,l as f,n as p,o as m,r as h,t as g}from"./dialog-DD0yn-KA.js";import{n as _,t as v}from"./createLucideIcon-Yddw9eHa.js";import{i as y,n as b,t as x}from"./tooltip-TtanriwA.js";import{g as S,m as C,n as w,p as T,t as ee,x as E}from"./input-BCiRHEmc.js";import{C as D,n as O,t as k,w as A}from"./use-platform-stream-7982hIDJ.js";import{t as j}from"./catalog-template-icons-b6a6Gty-.js";import{l as M}from"./select-4wihIkEE.js";import{a as N}from"./platform-targets-BbVxaqAc.js";import{i as P,n as F,r as I,t as L}from"./tabs-Bwhx891Q.js";import{n as te}from"./checkbox-Xly18Uyz.js";import{a as R,c as z,i as B,l as V,n as ne,o as re,r as ie,s as ae,t as oe}from"./deploy-tab-BjWxHSsV.js";import{c as se,i as ce,n as H,r as U,t as W}from"./use-engine-command-mutation-CQc8tXfc.js";import{t as G}from"./badge-tnWgSITj.js";import{t as K}from"./query-keys-Co1J4HmV.js";var le=v(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),ue=v(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),de=v(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),q=e(t(),1),J=n();function fe(e){let t=e.split(/[-_]/).filter(e=>e.length>0);return t[t.length-1]??e}function pe(e,t,n){let r=[];for(let i of e){let e=fe(i.model),a=t.get(i.model),o=[],s=[];if(a)for(let[e,t]of Object.entries(a.members)){let n={name:e,kind:t.kind,dataType:t.dataType,unit:t.unit,euRange:t.euRange};t.kind===`property`?s.push(n):o.push(n)}for(let t=0;t<i.count;t++){let t=(n.get(i.model)??0)+1;n.set(i.model,t),r.push({id:`${e}-${String(t).padStart(3,`0`)}`,model:i.model,tags:o,properties:s})}}return r}function me({detail:e}){let[t,n]=(0,q.useState)(new Set),o=(0,q.useRef)(null),s=(0,q.useMemo)(()=>[...new Set(e.models)],[e.models]),c=s.join(`,`),l=a({queryKey:K.catalog.modelSchemasBatch(c),queryFn:async()=>Promise.all(s.map(e=>i(`/catalog/models/${e}`,r.catalogModelDetail)))}),u=l.isPending&&!l.data,d=(0,q.useMemo)(()=>{let e=new Map;if(!l.data)return e;for(let[t,n]of l.data.entries())e.set(s[t],n);return e},[l.data,s]),p=(0,q.useMemo)(()=>{let t=new Map,n=new Map;for(let r of e.topology)for(let e of r.lines)n.set(`${r.name}/${e.name}`,pe(e.twins,d,t));return n},[e.topology,d]);(0,q.useEffect)(()=>{if(u)return;let t=e.name;if(o.current===t)return;let r=new Set;for(let t of e.topology){r.add(`area:${t.name}`);for(let e of t.lines)r.add(`line:${t.name}/${e.name}`)}outer:for(let t of e.topology)for(let e of t.lines){let n=(p.get(`${t.name}/${e.name}`)??[])[0];if(n){r.add(`inst:${t.name}/${e.name}/${n.id}`);break outer}}n(r),o.current=t},[u,e.name,e.topology,p]);let m=(0,q.useCallback)(e=>{n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),h=(0,q.useCallback)(async(t,n,r,i)=>{let a=e.namespace,o=[a?.enterprise?`${a.enterprise}/${a.site??``}`:a?.prefix??``,t,n,r,i].filter(Boolean).join(`/`);try{await navigator.clipboard.writeText(o),f.success(`UNS path copied`,{description:o})}catch{f.error(`Failed to copy`)}},[e]);return u?null:(0,J.jsx)(`div`,{className:`overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 py-2 pl-1 pr-2 touch-manipulation sm:py-2.5 sm:pl-1.5 sm:pr-2.5`,children:e.topology.map(e=>{let n=`area:${e.name}`,r=t.has(n);return(0,J.jsxs)(`div`,{children:[(0,J.jsx)(Q,{depth:0,label:E(e.name),labelTitle:e.name,tag:`AREA`,tagKind:`area`,expanded:r,onToggle:()=>m(n),hasChildren:!0}),r&&e.lines.map(n=>{let r=`line:${e.name}/${n.name}`,i=t.has(r),a=p.get(`${e.name}/${n.name}`)??[];return(0,J.jsxs)(`div`,{children:[(0,J.jsx)(Q,{depth:1,label:E(n.name),labelTitle:n.name,tag:`LINE`,tagKind:`line`,count:a.length,expanded:i,onToggle:()=>m(r),hasChildren:!0}),i&&a.map(r=>{let i=`inst:${e.name}/${n.name}/${r.id}`,a=t.has(i);return(0,J.jsxs)(`div`,{children:[(0,J.jsx)(Q,{depth:2,label:C(r.id),labelTitle:r.id,tag:`INST`,tagKind:`inst`,subtitle:E(r.model),subtitleTitle:r.model,count:r.tags.length+r.properties.length,expanded:a,onToggle:()=>m(i),hasChildren:r.tags.length+r.properties.length>0}),a&&(0,J.jsx)(ge,{instance:r,depth:3,area:e.name,line:n.name,onCopy:h})]},r.id)})]},n.name)})]},e.name)})})}var Y=20,he=14,X=`flex w-3.5 shrink-0 items-center justify-center`;function ge({instance:e,depth:t,area:n,line:r,onCopy:i}){let[a,o]=(0,q.useState)(!1),[s,c]=(0,q.useState)(!1),l=a?e.tags:e.tags.slice(0,10),u=e.tags.length-10,d=(0,q.useCallback)(t=>i(n,r,e.id,t),[i,n,r,e.id]);return(0,J.jsxs)(J.Fragment,{children:[l.map(e=>(0,J.jsx)(Z,{member:e,depth:t,onCopy:d},e.name)),!a&&u>0&&(0,J.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-1.5 border-t border-border/30 py-2 text-left font-mono text-xs text-muted-foreground hover:bg-muted/40 touch-manipulation sm:min-h-0 sm:py-1.5`,style:{paddingLeft:`${t*14+Y}px`},onClick:()=>o(!0),children:[(0,J.jsx)(`span`,{className:X,"aria-hidden":!0}),(0,J.jsxs)(`span`,{children:[`+`,u,` more tags`]})]}),e.properties.length>0&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-1.5 border-t border-border/30 py-2 text-left font-mono text-xs text-muted-foreground hover:bg-muted/40 touch-manipulation sm:min-h-0 sm:py-1.5`,style:{paddingLeft:`${t*14+Y}px`},onClick:()=>c(e=>!e),children:[(0,J.jsx)(`span`,{className:X,"aria-hidden":!0,children:s?(0,J.jsx)(M,{className:`size-3.5 opacity-60`,"aria-hidden":!0}):(0,J.jsx)(N,{className:`size-3.5 opacity-60`,"aria-hidden":!0})}),(0,J.jsxs)(`span`,{children:[e.properties.length,` properties`]})]}),s&&e.properties.map(e=>(0,J.jsx)(Z,{member:e,depth:t,onCopy:d},e.name))]})]})}function Z({member:e,depth:t,onCopy:n}){let r=e.kind===`property`,i=t*14+Y+(r?he:0);return(0,J.jsxs)(x,{children:[(0,J.jsxs)(y,{render:(0,J.jsx)(`button`,{type:`button`,className:_(`flex w-full cursor-pointer flex-col gap-1 border-t border-border/25 py-2 text-left font-mono text-xs hover:bg-muted/35 touch-manipulation sm:min-h-0 sm:flex-row sm:items-center sm:gap-1.5 sm:py-1.5`,r&&`opacity-65`),style:{paddingLeft:`${i}px`},onClick:()=>n(e.name)}),children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,J.jsx)(`span`,{className:X,"aria-hidden":!0,children:(0,J.jsx)(`span`,{className:_(`size-1 rounded-full ring-1 ring-border/50`,r?`bg-muted-foreground/25`:`bg-primary/50`)})}),(0,J.jsx)(`span`,{title:e.name,className:_(`min-w-0 truncate`,r?`text-muted-foreground`:`text-foreground`),children:T(e.name)}),r&&(0,J.jsx)(`span`,{className:`shrink-0 rounded-[var(--miravo-radius-tight)] bg-muted/60 px-1 py-px text-[10px] text-muted-foreground`,children:`PROP`})]}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 pl-0 sm:ml-auto sm:flex-1 sm:justify-end sm:pl-0 sm:pr-1`,children:[(0,J.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.dataType}),e.unit&&(0,J.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.unit}),e.euRange&&(0,J.jsxs)(`span`,{className:`ml-auto shrink-0 tabular-nums text-muted-foreground`,children:[`[`,e.euRange[0],`–`,e.euRange[1],`]`]})]})]}),(0,J.jsx)(b,{side:`top`,className:`max-w-xs`,children:`Click to copy UNS path`})]})}function Q({depth:e,label:t,labelTitle:n,tag:r,tagKind:i,subtitle:a,subtitleTitle:o,count:s,expanded:c,onToggle:l,hasChildren:u}){let d=c?M:N,f=i===`area`?`text-primary`:`text-foreground`;return(0,J.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full flex-col gap-1 border-t border-border/35 py-2 pr-2 text-left text-xs transition-colors touch-manipulation first:border-t-0 hover:bg-muted/40 sm:min-h-0 sm:flex-row sm:flex-wrap sm:items-center sm:gap-1.5 sm:gap-y-0 sm:py-1.5`,style:{paddingLeft:`${12+e*14}px`},onClick:l,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 w-full items-center gap-1.5 sm:w-auto sm:flex-1 sm:flex-wrap sm:items-center`,children:[u?(0,J.jsx)(d,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}):(0,J.jsx)(`span`,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),(0,J.jsx)(`span`,{title:n??void 0,className:_(`min-w-0 flex-1 truncate font-medium`,f),children:t}),(0,J.jsx)(`span`,{className:`shrink-0 text-[10px] tracking-wide text-muted-foreground uppercase`,children:r}),a&&(0,J.jsx)(`span`,{title:o??void 0,className:`hidden min-w-0 max-w-[min(11rem,38vw)] shrink truncate font-mono text-xs text-muted-foreground sm:inline`,children:a}),s!==void 0&&(0,J.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-xs text-muted-foreground`,children:s})]}),a&&(0,J.jsx)(`span`,{title:o??void 0,className:`min-w-0 truncate pl-7 font-mono text-xs text-muted-foreground sm:hidden`,children:a})]})}function _e(e){return e.lines.reduce((e,t)=>e+t.twins.reduce((e,t)=>e+t.count,0),0)}function ve(e){return Object.values(e.members).filter(e=>e.kind!==`property`).length}function ye(e,t){let n=0;for(let r of e.topology)for(let e of r.lines)for(let r of e.twins){let e=t.get(r.model),i=e?ve(e):0;n+=r.count*i}return n}function be({template:e,onClose:t}){let[n,l]=(0,q.useState)(new Set),u=a({queryKey:K.catalog.templateDetail(e?.id??``),queryFn:()=>i(`/catalog/templates/${e?.id}`,r.catalogTemplateDetail),enabled:e!==null}),d=u.data,f=u.isPending&&!d,p=u.isError,m=s(u.error,`Failed to load environment.`),h=d?.models?.join(`,`)??``,g=a({queryKey:K.catalog.modelSchemasBatch(h),queryFn:async()=>{let e=d?.models??[];return e.length===0?[]:Promise.all(e.map(e=>i(`/catalog/models/${e}`,r.catalogModelDetail)))},enabled:d!==null}),_=(0,q.useMemo)(()=>{if(!d||!g.data)return null;let e=new Map;for(let[t,n]of g.data.entries())e.set(d.models[t],n);return ye(d,e)},[d,g.data]);(0,q.useEffect)(()=>{e&&d&&l(new Set(d.topology.map(e=>e.name)))},[e,d]);let v=(0,q.useCallback)(e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),y=k();return(0,J.jsx)(ne,{open:e!==null,onOpenChange:e=>{e||(y.reset(),t())},children:(0,J.jsx)(ie,{side:`right`,className:`flex w-full flex-col gap-4 touch-manipulation`,children:f?null:p&&!d?(0,J.jsx)(`div`,{className:`flex flex-1 flex-col justify-center px-2`,children:(0,J.jsx)(o,{message:m,onRetry:()=>void u.refetch(),isRetrying:u.isFetching})}):d?(0,J.jsxs)(c.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.18},className:`flex min-h-0 flex-1 flex-col gap-4`,children:[(0,J.jsxs)(R,{className:`gap-1 pb-0 pe-12`,children:[(0,J.jsx)(re,{className:`font-heading text-base uppercase tracking-wide`,children:d.name}),d.description&&(0,J.jsx)(B,{className:`text-xs leading-relaxed text-foreground/88`,children:d.description})]}),(0,J.jsxs)(L,{defaultValue:`overview`,className:`flex min-h-0 flex-1 flex-col gap-1 pt-0`,children:[(0,J.jsxs)(I,{variant:`line`,className:`h-8! shrink-0 gap-0.5 border-b-border/60 px-2 py-0.5`,children:[(0,J.jsx)(P,{value:`overview`,className:`min-h-10 px-2 py-1 text-xs text-foreground/82 after:bottom-[-3px] data-active:text-foreground sm:min-h-0 sm:px-2.5 sm:py-1`,children:`Overview`}),(0,J.jsx)(P,{value:`uns`,className:`min-h-10 px-2 py-1 text-xs text-foreground/82 after:bottom-[-3px] data-active:text-foreground sm:min-h-0 sm:px-2.5 sm:py-1`,children:`UNS`}),(0,J.jsx)(P,{value:`deploy`,className:`min-h-10 px-2 py-1 text-xs text-foreground/82 after:bottom-[-3px] data-active:text-foreground sm:min-h-0 sm:px-2.5 sm:py-1`,children:`Deploy`})]}),(0,J.jsx)(F,{value:`overview`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-2`,children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 pb-1 pt-0.5`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(G,{variant:`outline`,className:`font-mono text-xs`,children:[d.topology.length,` areas`]}),(0,J.jsxs)(G,{variant:`outline`,className:`font-mono text-xs`,children:[d.instanceCount,` twins`]}),(0,J.jsxs)(G,{variant:`outline`,className:`font-mono text-xs`,children:[d.models.length,` models`]}),_!==null&&(0,J.jsxs)(G,{variant:`outline`,className:`font-mono text-xs`,children:[_,` tags`]}),d.settings?.tickIntervalMs&&(0,J.jsxs)(G,{variant:`outline`,className:`font-mono text-xs`,children:[`tick `,d.settings.tickIntervalMs,`ms`]}),d.settings?.timeMultiplier&&d.settings.timeMultiplier!==1&&(0,J.jsxs)(G,{variant:`outline`,className:`font-mono text-xs`,children:[d.settings.timeMultiplier,`× speed`]}),(0,J.jsx)(O,{stream:y})]}),d.namespace&&(d.namespace.enterprise||d.namespace.site||d.namespace.prefix)&&(0,J.jsxs)(`div`,{className:`min-w-0 overflow-hidden rounded-[var(--miravo-radius-tight)] border border-border/60 px-2.5 py-2`,children:[(0,J.jsx)(`h3`,{className:`font-heading text-xs font-semibold uppercase tracking-[0.12em] text-primary`,children:`Namespace`}),(0,J.jsxs)(`dl`,{className:`mt-1 grid grid-cols-1 gap-x-4 gap-y-1.5 sm:grid-cols-2`,children:[d.namespace.enterprise&&(0,J.jsxs)(`div`,{className:`min-w-0 sm:max-w-[min(100%,16rem)]`,children:[(0,J.jsx)(`dt`,{className:`font-heading text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground`,children:`Enterprise`}),(0,J.jsx)(`dd`,{className:`mt-1 font-mono text-xs leading-snug text-foreground [overflow-wrap:anywhere] break-words`,children:d.namespace.enterprise})]}),d.namespace.site&&(0,J.jsxs)(`div`,{className:`min-w-0 sm:max-w-[min(100%,16rem)]`,children:[(0,J.jsx)(`dt`,{className:`font-heading text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground`,children:`Site`}),(0,J.jsx)(`dd`,{className:`mt-1 font-mono text-xs leading-snug text-foreground [overflow-wrap:anywhere] break-words`,children:d.namespace.site})]}),d.namespace.prefix&&(0,J.jsxs)(`div`,{className:`min-w-0 sm:col-span-2`,children:[(0,J.jsx)(`dt`,{className:`font-heading text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground`,children:`Prefix`}),(0,J.jsx)(`dd`,{className:`mt-1 font-mono text-xs leading-snug text-foreground [overflow-wrap:anywhere] break-words`,children:d.namespace.prefix})]})]})]}),d.topology.map(e=>(0,J.jsx)($,{area:e,expanded:n.has(e.name),onToggle:()=>v(e.name)},e.name)),d.settings&&(0,J.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/50 p-2`,children:[(0,J.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 font-heading text-xs font-semibold uppercase tracking-[0.12em] text-warning`,children:[(0,J.jsx)(ae,{className:`size-3.5`,"aria-hidden":!0}),(0,J.jsx)(`span`,{children:`Settings`})]}),(0,J.jsxs)(`div`,{className:`grid grid-cols-1 gap-1.5 font-mono text-xs sm:grid-cols-2`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`tick interval`}),(0,J.jsxs)(`span`,{className:`text-foreground`,children:[d.settings.tickIntervalMs??1e3,`ms`]})]}),(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`time multiplier`}),(0,J.jsxs)(`span`,{className:`text-foreground`,children:[d.settings.timeMultiplier??1,`×`]})]})]})]})]})})})}),(0,J.jsx)(F,{value:`uns`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-2`,children:(0,J.jsx)(`div`,{className:`pb-1 pt-0.5`,children:(0,J.jsx)(me,{detail:d})})})})}),(0,J.jsx)(F,{value:`deploy`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,J.jsx)(oe,{kind:`template`,id:d.id,displayName:d.name,yamlPath:`/catalog/templates/${d.id}/yaml`,yamlFilename:`${d.id}.miravo.yaml`,stream:y})})})]})]},d.id):(0,J.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-muted-foreground`,children:`Environment not found`})})})}function $({area:e,expanded:t,onToggle:n}){let r=_e(e);return(0,J.jsxs)(`div`,{className:U,children:[(0,J.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-1.5 px-2.5 py-2 text-left text-xs font-medium transition-colors hover:bg-muted/30 touch-manipulation sm:min-h-0 sm:py-1.5`,onClick:n,children:[(0,J.jsx)(le,{className:`size-3.5 text-primary`}),(0,J.jsx)(`span`,{className:`uppercase tracking-wider text-primary`,children:E(e.name)}),(0,J.jsxs)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,J.jsxs)(G,{variant:`secondary`,className:`text-xs`,children:[r,` twins`]}),(0,J.jsxs)(G,{variant:`secondary`,className:`text-xs`,children:[e.lines.length,` lines`]}),(0,J.jsx)(M,{className:`size-3 text-muted-foreground transition-transform ${t?`rotate-180`:``}`})]})]}),(0,J.jsx)(l,{initial:!1,children:t&&(0,J.jsx)(c.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:`easeOut`},className:`overflow-hidden`,children:(0,J.jsx)(`div`,{className:`flex flex-col gap-1.5 border-t border-border p-2`,children:e.lines.map(e=>(0,J.jsx)(xe,{line:e},e.name))})},`content`)})]})}function xe({line:e}){return(0,J.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/60 bg-muted/10 p-2`,children:[(0,J.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[(0,J.jsx)(de,{className:`size-3.5`}),(0,J.jsx)(`span`,{title:e.name,children:E(e.name)}),(0,J.jsx)(ue,{className:`ml-auto size-3.5 text-muted-foreground`}),(0,J.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.twins.reduce((e,t)=>e+t.count,0),` twins`]})]}),(0,J.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.twins.map(e=>(0,J.jsx)(Se,{twin:e},`${e.model}-${e.count}`))})]})}function Se({twin:e}){let t=e.parameters&&Object.keys(e.parameters).length>0;return(0,J.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/30 bg-background/50 px-2.5 py-1.5`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,J.jsx)(`span`,{className:`font-mono font-medium text-primary`,title:e.model,children:E(e.model)}),(0,J.jsxs)(G,{variant:`secondary`,className:`shrink-0 px-1 py-0 text-xs`,children:[`×`,e.count]}),e.variation>0&&(0,J.jsxs)(`span`,{className:`text-muted-foreground`,children:[`±`,(e.variation*100).toFixed(0),`% variation`]})]}),t&&e.parameters&&(0,J.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-x-4 gap-y-1 border-t border-border/20 pt-1.5 font-mono text-xs`,children:Object.entries(e.parameters).map(([e,t])=>(0,J.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:e}),(0,J.jsx)(`span`,{className:`text-foreground`,children:t})]},e))})]})}function Ce(){let[e,t]=(0,q.useState)(``),[n,f]=(0,q.useState)({}),[v,y]=(0,q.useState)(null),[b,x]=(0,q.useState)(null),[C,T]=(0,q.useState)(null),E=(0,q.useRef)(null),D=W();(0,q.useEffect)(()=>{let e=e=>{if(e.key!==`/`||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target.tagName;t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||(e.preventDefault(),E.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let O=a({queryKey:K.catalog.templates(),queryFn:()=>i(`/catalog/templates`,r.catalogTemplates)}),k=O.data??[],A=O.isPending&&!O.data,j=O.isError&&!O.data,M=O.isError&&!!O.data,N=s(O.error,`Failed to load environments.`),P=e=>n[e]??1,F=(0,q.useCallback)((e,t)=>{f(n=>({...n,[e]:Math.max(1,Math.min(10,t))}))},[]),I=(0,q.useCallback)(e=>{T(e)},[]),L=(0,q.useCallback)(e=>{x(e)},[]),R=async e=>{y(e);try{return await D.mutateAsync({type:`loadTemplate`,templatePath:e,count:P(e)}),!0}catch{return!1}finally{y(null)}},B=e.toLowerCase(),V=B?k.filter(e=>e.name.toLowerCase().includes(B)||(e.description?.toLowerCase().includes(B)??!1)):k;return(0,J.jsxs)(`div`,{className:`@container/templates mx-auto flex w-full max-w-screen-2xl flex-col gap-5 p-4 sm:gap-6 sm:p-6`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,J.jsx)(`h1`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Environment Catalog`}),(0,J.jsx)(G,{variant:`outline`,className:`text-xs`,children:j?(0,J.jsx)(`span`,{className:`text-destructive`,children:`Unavailable`}):A&&k.length===0?(0,J.jsx)(J.Fragment,{children:`Loading...`}):(0,J.jsxs)(J.Fragment,{children:[k.length,` built-in`]})})]}),(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Choose an environment to launch a realistic industrial system. Each environment includes pre-configured asset models with realistic physics, lifecycle degradation, and fault modes.`})]}),j&&(0,J.jsx)(o,{message:N,onRetry:()=>void O.refetch(),isRetrying:O.isFetching}),M&&(0,J.jsx)(o,{message:`${N} Showing cached environments.`,onRetry:()=>void O.refetch(),isRetrying:O.isFetching}),!j&&(0,J.jsxs)(`div`,{className:`relative max-w-xs`,children:[(0,J.jsx)(z,{className:`absolute left-2.5 top-2.5 size-4 text-muted-foreground`}),(0,J.jsx)(ee,{ref:E,placeholder:`Filter environments...`,value:e,onChange:e=>t(e.target.value),className:`pl-9 pr-7`}),!e&&(0,J.jsx)(`kbd`,{className:`pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 rounded-[var(--miravo-radius-tight)] border border-border bg-muted px-1 font-mono text-[10px] text-muted-foreground`,children:`/`})]}),(0,J.jsx)(`div`,{className:`grid grid-cols-1 gap-4 @[720px]/templates:grid-cols-2`,"aria-busy":A&&!j,children:j?null:(0,J.jsxs)(J.Fragment,{children:[A&&k.length===0&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`}),(0,J.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`}),(0,J.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`}),(0,J.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`})]}),(0,J.jsx)(l,{children:V.map((e,t)=>(0,J.jsx)(c.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,scale:.96,transition:{duration:.15}},transition:{type:`spring`,stiffness:380,damping:30,delay:t*.04},className:`grid`,children:(0,J.jsx)(we,{template:e,count:P(e.name),launching:v===e.name,onCountChange:F,onInspect:I,onLaunch:L})},e.name))}),V.length===0&&k.length>0&&(0,J.jsxs)(`p`,{className:`col-span-full py-8 text-center text-sm text-muted-foreground`,children:[`No environments match “`,e,`”`]})]})}),k.length>0&&(0,J.jsx)(`div`,{className:_(U,`p-0`),children:(0,J.jsx)(`div`,{className:`community-teaser relative overflow-hidden rounded-[inherit]`,children:(0,J.jsx)(`div`,{className:`relative z-10 mx-auto max-w-3xl px-5 py-10 sm:px-10 sm:py-12`,children:(0,J.jsxs)(`div`,{className:`grid items-center gap-10 lg:grid-cols-[minmax(0,1fr)_minmax(0,17rem)]`,children:[(0,J.jsxs)(`div`,{className:`order-2 flex min-w-0 flex-col gap-4 lg:order-1`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[(0,J.jsx)(`p`,{className:`blueprint-title text-primary`,children:`Future channel`}),(0,J.jsx)(`span`,{className:`blueprint-stat text-[10px] text-muted-foreground`,children:`MIRAVO_REGISTRY · NOT_CONNECTED`})]}),(0,J.jsx)(`h2`,{className:`font-heading text-xl font-semibold tracking-tight sm:text-2xl`,children:`Community Environments`}),(0,J.jsx)(`p`,{className:`max-w-xl text-sm leading-relaxed text-muted-foreground`,children:`Share your industrial environments with the Miravo community. Publish custom environments, discover configurations from other engineers, and fork them as your starting point.`}),(0,J.jsx)(`div`,{children:(0,J.jsx)(G,{variant:`outline`,className:`community-teaser-soon border-primary/35 bg-primary/5 text-[10px] text-primary`,children:`Coming Soon`})})]}),(0,J.jsx)(`div`,{className:`order-1 flex justify-center lg:order-2 lg:justify-end`,children:(0,J.jsxs)(`div`,{className:`community-teaser-module relative flex w-full max-w-[14rem] flex-col items-center justify-center gap-3 border border-primary/15 bg-muted/15 py-8 sm:max-w-[15.5rem] sm:py-10`,"aria-hidden":!0,children:[(0,J.jsx)(`div`,{className:`community-teaser-icon-ring relative z-[1] flex size-[4.25rem] items-center justify-center rounded-[var(--miravo-radius-tight)] border border-primary/35 bg-gradient-to-br from-primary/18 to-primary/5`,children:(0,J.jsx)(te,{className:`size-9 text-primary`,"aria-hidden":!0})}),(0,J.jsx)(`span`,{className:`blueprint-stat relative z-[1] text-[9px] tracking-[0.18em] text-muted-foreground`,children:`AWAITING SIGNAL`}),(0,J.jsx)(`span`,{className:`blueprint-stat relative z-[1] text-[9px] text-muted-foreground`,children:`Uplink idle`})]})})]})})})}),(0,J.jsx)(g,{open:b!==null,onOpenChange:e=>{e||x(null)},children:(0,J.jsxs)(p,{children:[(0,J.jsxs)(u,{children:[(0,J.jsx)(m,{children:`Launch environment?`}),(0,J.jsx)(h,{children:b!==null&&(0,J.jsxs)(J.Fragment,{children:[`This adds `,P(b),` instance`,P(b)===1?``:`s`,` of`,` `,(0,J.jsx)(`span`,{className:`font-medium text-foreground`,children:S(b)}),` `,`to the running environment.`]})})]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(w,{variant:`outline`,disabled:v!==null,onClick:()=>x(null),children:`Cancel`}),(0,J.jsx)(w,{disabled:v!==null||b===null,onClick:async()=>{b!==null&&await R(b)&&x(null)},children:v===b?`Launching...`:`Launch`})]})]})}),(0,J.jsx)(be,{template:C,onClose:()=>T(null)})]})}var we=(0,q.memo)(function({template:e,count:t,launching:n,onCountChange:r,onInspect:i,onLaunch:a}){return(0,J.jsxs)(`div`,{className:_(ce,`flex flex-col gap-4 p-5`),children:[(0,J.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,J.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] bg-primary/10 text-primary`,children:(0,J.jsx)(j,{id:e.id,className:`size-5`})}),(0,J.jsxs)(`div`,{className:`min-w-0 flex flex-col gap-0.5`,children:[(0,J.jsx)(`span`,{className:`font-heading text-sm font-semibold uppercase tracking-wide`,children:S(e.name)}),(0,J.jsx)(`span`,{className:`line-clamp-2 text-xs leading-relaxed text-muted-foreground`,children:e.description??`Industrial environment.`})]})]}),(0,J.jsx)(`div`,{className:`px-3 py-2`,children:(0,J.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.models.map(e=>(0,J.jsx)(G,{variant:`outline`,className:`h-auto min-h-5 rounded-[var(--miravo-radius-tight)] px-1.5 py-0 font-mono text-[10px] font-normal text-primary`,children:e},e))})}),(0,J.jsxs)(`div`,{className:`mt-auto flex flex-wrap items-center gap-4 font-mono text-[11px] text-muted-foreground`,children:[(0,J.jsxs)(`span`,{children:[(0,J.jsx)(`span`,{className:`text-foreground`,children:e.instanceCount}),` instances`]}),(0,J.jsxs)(`span`,{children:[(0,J.jsx)(`span`,{className:`text-foreground`,children:e.models.length}),` models`]}),e.memberCount>0&&(0,J.jsxs)(`span`,{children:[`~`,(0,J.jsx)(`span`,{className:`text-foreground`,children:Te(e.memberCount)}),` tags/cycle`]}),(0,J.jsx)(G,{variant:`secondary`,className:`ml-auto shrink-0 font-sans text-[10px] font-medium`,children:e.source})]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border/30 pt-3`,children:[(0,J.jsxs)(`div`,{className:`flex items-center rounded-[var(--miravo-radius-tight)] border bg-muted/30`,children:[(0,J.jsx)(w,{variant:`ghost`,size:`icon`,className:`size-7 rounded-none rounded-l-md`,disabled:t<=1,"aria-label":`Decrease count`,onClick:n=>{n.stopPropagation(),r(e.name,t-1)},children:(0,J.jsx)(V,{className:`size-3`})}),(0,J.jsx)(`span`,{className:`flex size-7 items-center justify-center border-x font-mono text-xs`,children:t}),(0,J.jsx)(w,{variant:`ghost`,size:`icon`,className:`size-7 rounded-none rounded-r-md`,disabled:t>=10,"aria-label":`Increase count`,onClick:n=>{n.stopPropagation(),r(e.name,t+1)},children:(0,J.jsx)(D,{className:`size-3`})})]}),(0,J.jsxs)(w,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>i(e),className:H,children:[(0,J.jsx)(A,{className:`size-3.5`,"aria-hidden":!0}),`Inspect`]}),(0,J.jsxs)(w,{size:`sm`,className:`ml-auto`,disabled:n,onClick:()=>a(e.name),children:[(0,J.jsx)(se,{className:`mr-1 size-3`}),n?`...`:`Launch`]})]})]})});function Te(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}export{Ce as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./catalog-CurT8GX7.js";export{e as CatalogPage};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";import{at as n}from"./vendor-ui-mizMYESS.js";import{A as r,D as i,E as a,M as o,N as s,O as c,S as l,T as u,j as d,k as f,w as p,x as ee}from"./api-Bef9FEIU.js";import{t as m}from"./proxy-CgM57W61.js";import{t as h}from"./AnimatePresence-CVhkybDC.js";import{i as g,r as te}from"./dist-jROhexoH.js";import{a as ne,i as re,n as ie,o as ae,r as oe,t as se}from"./dialog-DD0yn-KA.js";import{t as _}from"./shallow-ODRQsuRf.js";import{n as v,t as y}from"./createLucideIcon-Yddw9eHa.js";import{i as ce,n as le,t as ue}from"./tooltip-TtanriwA.js";import{_ as de,a as fe,g as pe,h as b,n as x,t as S}from"./input-BCiRHEmc.js";import{r as C}from"./engine-store-BUO-9Dsh.js";import{t as me}from"./activity-DP0Us3HU.js";import{t as he}from"./arrow-right-DrKCU9WM.js";import{c as ge,i as _e,l as ve,n as ye,s as be,t as xe}from"./select-4wihIkEE.js";import{a as Se,c as Ce,i as w,l as T,n as E,o as we,r as Te,s as D,t as O}from"./tabs-Bwhx891Q.js";import{a as k,c as Ee,i as De,l as Oe,n as ke,r as Ae,s as A,t as j}from"./validation-4FJlp2qx.js";import{n as je,r as Me,t as Ne}from"./checkbox-Xly18Uyz.js";import{n as Pe,t as M}from"./server-D7sb2mj5.js";import{c as Fe,r as N,t as P}from"./use-engine-command-mutation-CQc8tXfc.js";import{t as F}from"./triangle-alert-DPtblpQC.js";import{t as Ie}from"./transition-nav-link-CuWixOOd.js";import{t as I}from"./badge-tnWgSITj.js";import{t as L}from"./label-xIWEC6lW.js";import{a as R,c as z,i as B,l as V,n as H,o as U,r as W,s as G,t as K}from"./combobox-gGNWoksU.js";var Le=y(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Re=y(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),ze=y(`octagon-alert`,[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]]),Be=y(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),Ve=y(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),He=y(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),q=y(`radio-tower`,[[`path`,{d:`M4.9 16.1C1 12.2 1 5.8 4.9 1.9`,key:`s0qx1y`}],[`path`,{d:`M7.8 4.7a6.14 6.14 0 0 0-.8 7.5`,key:`1idnkw`}],[`circle`,{cx:`12`,cy:`9`,r:`2`,key:`1092wv`}],[`path`,{d:`M16.2 4.8c2 2 2.26 5.11.8 7.47`,key:`ojru2q`}],[`path`,{d:`M19.1 1.9a9.96 9.96 0 0 1 0 14.1`,key:`rhi7fg`}],[`path`,{d:`M9.5 18h5`,key:`mfy3pd`}],[`path`,{d:`m8 22 4-11 4 11`,key:`25yftu`}]]),Ue=y(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),We=y(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ge=y(`trash`,[[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),J=e(t(),1);f({path:d().min(1),name:d().min(1),description:d().optional(),memberCount:c().int().nonnegative(),methodCount:c().int().nonnegative(),faultCount:c().int().nonnegative(),hasLifecycle:u(),lifecycleStageCount:c().int().nonnegative()}),f({path:d().min(1),id:d().min(1),name:d().min(1),description:d().optional(),areaCount:c().int().nonnegative(),twinAssignmentCount:c().int().nonnegative(),inlineModelCount:c().int().nonnegative(),uniqueModelCount:c().int().nonnegative(),modelNames:p(d().min(1)),totalTwinCount:c().int().nonnegative()});var Ke=f({severity:a([`error`,`warning`]),message:d(),fix:d()});f({valid:u(),templatePath:d(),issues:p(Ke)});var qe=d().min(1).max(128).regex(/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/),Je=o([c().finite(),d(),u()]),Ye=f({id:d().min(1),model:d().min(1),browsePath:p(d().min(1)).min(1),parameters:r(d(),Je),lifecycleStage:d().min(1),operatingHours:c().finite().nonnegative(),activeFaults:p(d().min(1)),templateRunId:c().int().positive().optional(),observationState:r(d(),r(d(),s())).optional().default({}),faultState:r(d(),f({remaining:c().int(),elapsed:c().int(),recovering:u(),recoveryElapsed:c().int(),recoveryTicks:c().int()})).optional().default({})}),Xe=f({templateRunId:c().int().positive(),templateName:d().min(1),templatePath:d()}),Ze=f({name:d().min(1),enabled:u(),config:r(d(),s())});f({version:i(1),savedAt:d().min(1),environmentName:qe,models:p(d().min(1)),instances:p(Ye),templateRuns:p(Xe),adapters:p(Ze).default([])});var Y=n(),Qe={mqtt:we,opcua:M,modbus:Re},$e={mqtt:`MQTT`,opcua:`OPC UA`,modbus:`Modbus TCP`},et={mqtt:ee,opcua:l,modbus:502};function tt({adapter:e}){let t=e.pending?`pending`:e.enabled?`enabled`:`disabled`;return(0,Y.jsx)(h,{mode:`wait`,initial:!1,children:(0,Y.jsx)(m.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{type:`spring`,stiffness:500,damping:30},children:e.pending?(0,Y.jsxs)(I,{className:`gap-1 bg-info/20 text-info hover:bg-info/20`,children:[(0,Y.jsx)(D,{className:`size-3 animate-spin`}),e.enabled?`Disabling...`:`Enabling...`]}):e.enabled?(0,Y.jsxs)(I,{className:`gap-1 bg-success/20 text-success hover:bg-success/20`,children:[(0,Y.jsx)(T,{className:`size-3`}),`Enabled`]}):(0,Y.jsxs)(I,{variant:`outline`,className:`gap-1 text-muted-foreground`,children:[(0,Y.jsx)(Le,{className:`size-2`}),`Disabled`]})},t)})}function nt({metrics:e}){return e?e.connected?null:(0,Y.jsxs)(I,{variant:`destructive`,className:`gap-1`,children:[(0,Y.jsx)(Ce,{className:`size-3`}),`Disconnected`]}):null}function rt({health:e}){if(!e)return null;let t={healthy:`bg-success/20 text-success hover:bg-success/20`,busy:`bg-warning/20 text-warning hover:bg-warning/20`,saturated:`bg-destructive/20 text-destructive hover:bg-destructive/20`},n=e.state,r=`size-3 shrink-0`,i=n===`healthy`?(0,Y.jsx)(T,{className:r,"aria-hidden":!0}):n===`busy`?(0,Y.jsx)(me,{className:r,"aria-hidden":!0}):n===`saturated`?(0,Y.jsx)(F,{className:r,"aria-hidden":!0}):null;return(0,Y.jsxs)(I,{className:v(`gap-1`,t[n]??``),children:[i,n]})}function X({label:e,value:t,valueClassName:n}){return(0,Y.jsxs)(`div`,{className:`flex min-h-[3.35rem] flex-col justify-center rounded-[var(--miravo-radius-stadium-sm)] border border-border/55 px-3 py-2 transition-colors hover:border-muted-foreground/25`,children:[(0,Y.jsx)(`span`,{className:`blueprint-title text-[10px] leading-tight text-muted-foreground`,children:e}),(0,Y.jsx)(`span`,{className:v(`mt-1.5 font-mono text-[13px] leading-none tabular-nums tracking-tight text-foreground`,n),children:t})]})}function it({metrics:e}){return(0,Y.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-3`,children:[(0,Y.jsx)(X,{label:`Messages sent`,value:b(e.messagesPublished)}),(0,Y.jsx)(X,{label:`Attempted`,value:b(e.messagesAttempted)}),(0,Y.jsx)(X,{label:`Skipped (unchanged)`,value:b(e.messagesFiltered)}),(0,Y.jsx)(X,{label:`Errors`,value:b(e.errorsCount),valueClassName:e.errorsCount>0?`text-destructive`:void 0}),(0,Y.jsx)(X,{label:`Publish latency`,value:`${e.lastPublishMs.toFixed(1)} ms`}),e.health?(0,Y.jsx)(X,{label:`Queued messages`,value:String(e.health.pendingWorkCount)}):null]})}function at({port:e}){return(0,Y.jsxs)(`div`,{className:`flex gap-2 rounded-[var(--miravo-radius-stadium-sm)] border border-warning/30 bg-warning/10 p-3 text-sm text-warning`,children:[(0,Y.jsx)(F,{className:`mt-0.5 size-4 shrink-0`}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`p`,{className:`font-medium`,children:`Before enabling`}),(0,Y.jsxs)(`p`,{className:`mt-1 text-warning`,children:[`Ensure port `,(0,Y.jsx)(`code`,{className:`font-mono font-bold`,children:e}),` is available on the host.`]}),(0,Y.jsxs)(`ul`,{className:`mt-1 list-inside list-disc space-y-0.5 text-warning`,children:[(0,Y.jsxs)(`li`,{children:[(0,Y.jsx)(`strong`,{children:`Docker:`}),` Restart with`,` `,(0,Y.jsxs)(`code`,{className:`font-mono`,children:[`-p `,e,`:`,e]}),` `,`to expose the port.`]}),(0,Y.jsxs)(`li`,{children:[(0,Y.jsx)(`strong`,{children:`Bare metal:`}),` Run `,(0,Y.jsxs)(`code`,{className:`font-mono`,children:[`lsof -i :`,e]}),` to check availability.`]})]})]})]})}function ot({adapter:e,metrics:t}){let[n,r]=(0,J.useState)(!1),[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(!1),c=P(),l=Qe[e.name]??M,u=$e[e.name]??e.name,d=et[e.name]??0,f=o||e.pending===!0,p=(0,J.useMemo)(()=>{let t=e.config?.port;return typeof t==`number`?t:d},[e.config,d]);return(0,Y.jsxs)(`div`,{className:`protocol-card-art min-w-0 border`,children:[(0,Y.jsxs)(`div`,{className:`relative z-2`,children:[(0,Y.jsxs)(`button`,{type:`button`,"aria-expanded":n,className:`group/row flex w-full min-w-0 cursor-pointer gap-3 px-4 py-3 text-left transition-colors duration-[var(--miravo-duration-base)] ease-[var(--miravo-ease)] hover:bg-muted/35`,onClick:()=>r(!n),children:[(0,Y.jsx)(l,{className:`mt-0.5 size-5 shrink-0 text-muted-foreground transition-[transform,color] duration-[var(--miravo-duration-base)] ease-[var(--miravo-ease)] group-hover/row:-rotate-[8deg] group-hover/row:scale-[1.08] group-hover/row:text-primary motion-reduce:transition-none motion-reduce:group-hover/row:rotate-0 motion-reduce:group-hover/row:scale-100`,"aria-hidden":!0}),(0,Y.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:(0,Y.jsxs)(`div`,{className:`flex w-full min-w-0 flex-wrap items-start justify-between gap-x-3 gap-y-2`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[e.enabled&&!e.pending&&(0,Y.jsx)(`span`,{className:`protocol-card-live-dot`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`whitespace-nowrap font-medium tracking-tight`,children:u}),(0,Y.jsx)(tt,{adapter:e}),e.enabled&&!e.pending&&t&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(nt,{metrics:t}),t.health?(0,Y.jsx)(rt,{health:t.health}):(0,Y.jsxs)(I,{className:`gap-1 bg-success/20 text-success hover:bg-success/20`,children:[(0,Y.jsx)(T,{className:`size-3 shrink-0`,"aria-hidden":!0}),`healthy`]})]})]}),(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[e.enabled&&t&&!e.pending&&(0,Y.jsxs)(`span`,{className:`protocol-card-metric-readout text-muted-foreground`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-normal uppercase tracking-[0.12em] text-muted-foreground`,children:`out`}),` `,(0,Y.jsx)(`span`,{className:`text-foreground`,children:b(t.messagesPublished)}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:` msgs`}),t.errorsCount>0&&(0,Y.jsxs)(`span`,{className:`ml-1.5 text-destructive`,children:[t.errorsCount,` err`]})]}),(0,Y.jsx)(ve,{className:`size-4 shrink-0 text-muted-foreground transition-[transform,color] duration-[var(--miravo-duration-base)] ease-[var(--miravo-ease)] group-hover/row:translate-y-0.5 group-hover/row:text-primary motion-reduce:transition-none motion-reduce:group-hover/row:translate-y-0 ${n?`rotate-180`:``}`})]})]})})]}),e.enabled&&!e.pending&&e.endpoint&&(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 px-4 pb-2 pl-11`,children:[(0,Y.jsx)(`code`,{className:`min-w-0 truncate font-mono text-xs text-muted-foreground`,children:e.endpoint}),(0,Y.jsx)(Se,{value:e.endpoint,label:`Copy endpoint URL`})]})]}),(0,Y.jsx)(h,{initial:!1,children:n&&(0,Y.jsx)(m.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:`easeOut`},className:`overflow-hidden`,children:(0,Y.jsx)(`div`,{className:`protocol-card-art-body border-t`,children:e.enabled&&t?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`section`,{className:`px-4 pb-4 pt-4`,"aria-labelledby":`protocol-telemetry-${e.name}`,children:[(0,Y.jsxs)(`div`,{className:`mb-3 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-3`,children:[(0,Y.jsx)(`h4`,{id:`protocol-telemetry-${e.name}`,className:`blueprint-title shrink-0 text-muted-foreground`,children:`Telemetry`}),(0,Y.jsxs)(Ie,{to:`/tags?protocol=${e.name}`,className:`group/footer-link inline-flex w-full min-h-8 min-w-0 max-w-full shrink-0 items-center justify-start gap-1.5 rounded-[var(--miravo-radius-pill)] border border-primary/25 bg-primary/5 px-2.5 py-1.5 text-xs font-medium leading-tight text-primary transition-colors hover:border-primary/40 hover:bg-primary/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background sm:w-fit`,children:[(0,Y.jsx)(`span`,{className:`whitespace-nowrap`,children:`Browse Tags`}),(0,Y.jsx)(he,{className:`size-3 shrink-0 text-primary transition-transform group-hover/footer-link:translate-x-0.5`})]})]}),(0,Y.jsx)(it,{metrics:t})]}),(0,Y.jsx)(`footer`,{className:`protocol-card-art-footer flex flex-col gap-4 border-t border-border/80 px-4 pb-4 pt-4`,children:(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Y.jsxs)(x,{variant:`destructive`,size:`sm`,className:`gap-1.5`,disabled:f,onClick:async()=>{s(!0);try{await c.mutateAsync({type:`disableAdapter`,adapter:e.name})}catch{}finally{s(!1)}},children:[f?(0,Y.jsx)(D,{className:`size-3.5 animate-spin`}):(0,Y.jsx)(Ve,{className:`size-3.5`}),f?`Disabling...`:`Disable ${u}`]}),!f&&(0,Y.jsx)(`span`,{className:`text-xs leading-snug text-muted-foreground`,children:`Active connections will be dropped.`})]})})]}):(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 px-4 py-4`,children:[!f&&(0,Y.jsx)(at,{port:i&&Number(i)||p}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(L,{htmlFor:`port-${e.name}`,className:`text-xs`,children:`Port`}),(0,Y.jsx)(S,{id:`port-${e.name}`,type:`number`,placeholder:String(p),value:i,onChange:e=>a(e.target.value),className:`w-28`,disabled:f})]}),(0,Y.jsxs)(x,{size:`sm`,className:`gap-1.5`,disabled:f,onClick:async()=>{s(!0);try{let t=i?Number(i):void 0,n={};t&&Number.isFinite(t)&&(n.port=t),await c.mutateAsync({type:`enableAdapter`,adapter:e.name,...Object.keys(n).length>0?{config:n}:{}})}catch{}finally{s(!1)}},children:[f?(0,Y.jsx)(D,{className:`size-3.5 animate-spin`}):(0,Y.jsx)(He,{className:`size-3.5`}),f?`Enabling...`:`Enable ${u}`]})]})]})})},`panel`)})]})}function st(){let{instances:e,models:t,templateRuns:n}=C(_(e=>({instances:e.instances,models:e.models,templateRuns:e.templateRuns}))),r=P(),[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(`1`),[c,l]=(0,J.useState)(``),u=(0,J.useMemo)(()=>c?t.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())):t,[t,c]);return(0,Y.jsxs)(U,{className:`h-full min-w-0`,children:[(0,Y.jsx)(z,{className:`pb-3`,children:(0,Y.jsxs)(V,{className:`flex items-center gap-2 text-xs font-medium uppercase tracking-wider`,children:[(0,Y.jsx)(Pe,{className:`size-3.5 text-muted-foreground`,"aria-hidden":!0}),`Fleet Management`]})}),(0,Y.jsxs)(G,{className:`flex flex-1 flex-col gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Spawn Instances`}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,Y.jsx)(`div`,{className:`min-w-0 w-full sm:min-w-0 sm:flex-1`,children:(0,Y.jsxs)(K,{value:i||null,onValueChange:e=>a(e??``),onInputValueChange:l,children:[(0,Y.jsx)(W,{placeholder:`Select model`,className:`h-8 w-full min-w-0`,showClear:!!i}),(0,Y.jsx)(H,{children:(0,Y.jsxs)(R,{children:[u.map(e=>(0,Y.jsx)(B,{value:e.name,children:e.name},e.name)),u.length===0&&(0,Y.jsx)(`p`,{className:`py-2 text-center text-xs text-muted-foreground`,children:`No models found`})]})})]})}),(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,Y.jsx)(S,{type:`number`,value:o,onChange:e=>s(e.target.value),className:`h-8 w-16 text-xs`,min:`1`,"aria-label":`Number of instances to spawn`}),(0,Y.jsx)(x,{size:`sm`,className:`h-8`,onClick:()=>{let e=k(De,{model:i,count:Number(o)});e&&r.mutate({type:`spawn`,...e})},children:`Spawn`})]})]}),(0,Y.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[t.length,` models · `,e.length,` running`]})]}),n.length>0&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(A,{}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Environment Runs`}),(0,Y.jsx)(h,{initial:!1,children:n.map(e=>(0,Y.jsx)(m.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4,transition:{duration:.12}},transition:{type:`spring`,stiffness:400,damping:30},children:(0,Y.jsxs)(`div`,{className:`flex items-center justify-between rounded-[var(--miravo-radius-tight)] border px-2.5 py-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 overflow-hidden`,children:[(0,Y.jsx)(`span`,{className:`truncate text-xs font-medium`,children:pe(e.templateName)}),(0,Y.jsxs)(I,{variant:`secondary`,className:`shrink-0 text-[10px]`,children:[e.instanceIds.length,` inst`]})]}),(0,Y.jsx)(x,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-1.5 text-destructive hover:text-destructive`,"aria-label":`Unload environment run`,onClick:()=>r.mutate({type:`unloadTemplateRun`,templateRunId:e.templateRunId}),children:(0,Y.jsx)(fe,{className:`size-3`})})]})},e.templateRunId))})]})]})]})]})}function ct(){let{instances:e,models:t}=C(_(e=>({instances:e.instances,models:e.models}))),n=P(),[r,i]=(0,J.useState)(``),[a,o]=(0,J.useState)(``),[s,c]=(0,J.useState)(``),l=(0,J.useMemo)(()=>s?e.filter(e=>e.id.toLowerCase().includes(s.toLowerCase())):e,[e,s]),u=(0,J.useMemo)(()=>{let n=e.find(e=>e.id===r);return n?t.find(e=>e.name===n.model)?.faultNames??[]:[]},[r,e,t]),d=(0,J.useMemo)(()=>e.filter(e=>e.activeFaults.length>0),[e]),f=d.reduce((e,t)=>e+t.activeFaults.length,0);return(0,Y.jsxs)(U,{className:`h-full min-w-0`,children:[(0,Y.jsx)(z,{className:`pb-3`,children:(0,Y.jsxs)(V,{className:`flex items-center gap-2 text-xs font-medium uppercase tracking-wider`,children:[(0,Y.jsx)(F,{className:`size-3.5 ${f>0?`text-destructive`:`text-muted-foreground`}`}),`Fault Lab`,(0,Y.jsx)(h,{children:f>0&&(0,Y.jsx)(m.div,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:`spring`,stiffness:500,damping:30},children:(0,Y.jsxs)(I,{variant:`destructive`,className:`text-[10px]`,children:[f,` active`]})},`fault-count`)})]})}),(0,Y.jsxs)(G,{className:`flex flex-1 flex-col gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,Y.jsxs)(K,{value:r||null,onValueChange:e=>{i(e??``),o(``)},onInputValueChange:c,children:[(0,Y.jsx)(W,{placeholder:`Select instance`,className:`h-8 min-h-11 w-full min-w-0 touch-manipulation sm:min-h-8`,showClear:!!r}),(0,Y.jsx)(H,{children:(0,Y.jsxs)(R,{children:[l.map(e=>(0,Y.jsxs)(B,{value:e.id,children:[(0,Y.jsx)(`span`,{className:`font-mono`,children:e.id}),e.activeFaults.length>0&&(0,Y.jsx)(I,{variant:`destructive`,className:`ml-auto text-[10px]`,children:e.activeFaults.length})]},e.id)),l.length===0&&(0,Y.jsx)(`p`,{className:`py-2 text-center text-xs text-muted-foreground`,children:`No instances found`})]})})]}),(0,Y.jsxs)(xe,{value:a,onValueChange:e=>o(e??``),children:[(0,Y.jsx)(be,{className:`h-8 min-h-11 w-full touch-manipulation sm:min-h-8`,"aria-label":`Fault type`,children:(0,Y.jsx)(ge,{placeholder:r?`Select fault`:`Pick instance first`})}),(0,Y.jsx)(ye,{alignItemWithTrigger:!1,align:`start`,children:u.map(e=>(0,Y.jsx)(_e,{value:e,children:e},e))})]})]}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Y.jsx)(x,{variant:`destructive`,size:`sm`,className:`h-7 min-h-11 touch-manipulation text-xs sm:min-h-7`,disabled:!r||!a,onClick:()=>{let e=k(j,{instanceId:r,fault:a});e&&n.mutate({type:`triggerFault`,...e})},children:`Trigger`}),(0,Y.jsx)(x,{variant:`secondary`,size:`sm`,className:`h-7 min-h-11 touch-manipulation text-xs sm:min-h-7`,disabled:!r||!a,onClick:()=>{let e=k(j,{instanceId:r,fault:a});e&&n.mutate({type:`clearFault`,...e})},children:`Clear`})]}),(0,Y.jsx)(A,{}),(0,Y.jsx)(h,{mode:`wait`,initial:!1,children:d.length>0?(0,Y.jsxs)(m.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`flex flex-col gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Faulted Instances`}),(0,Y.jsx)(h,{initial:!1,children:d.map(e=>(0,Y.jsx)(m.div,{initial:{opacity:0,x:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:6,transition:{duration:.1}},transition:{type:`spring`,stiffness:400,damping:35},children:(0,Y.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full touch-manipulation items-center justify-between rounded-[var(--miravo-radius-tight)] border border-destructive/20 bg-destructive/5 px-2.5 py-1.5 text-left transition-colors hover:bg-destructive/10 sm:min-h-0`,onClick:()=>{i(e.id),o(``)},children:[(0,Y.jsx)(`span`,{className:`truncate font-mono text-xs`,children:e.id}),(0,Y.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-destructive`,children:e.activeFaults.join(`, `)})]})},e.id))})]},`faulted`):(0,Y.jsxs)(m.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`flex items-center gap-2 py-1 text-xs text-muted-foreground`,children:[(0,Y.jsx)(T,{className:`size-3.5 text-success`}),`All clear — no active faults`]},`all-clear`)})]})]})}function lt(){let e=C(e=>e.instances),t=P(),[n,r]=(0,J.useState)(``),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(``),c=(0,J.useMemo)(()=>o?e.filter(e=>e.id.toLowerCase().includes(o.toLowerCase())):e,[e,o]),l=(0,J.useMemo)(()=>e.filter(e=>e.isQuarantined),[e]),u=(0,J.useMemo)(()=>e.filter(e=>!e.isQuarantined&&e.activeFaults.length===0).length,[e]),d=(0,J.useMemo)(()=>e.filter(e=>!e.isQuarantined&&e.activeFaults.length>0).length,[e]);return(0,Y.jsxs)(U,{className:`h-full min-w-0`,children:[(0,Y.jsx)(z,{className:`pb-3`,children:(0,Y.jsxs)(V,{className:`flex items-center gap-2 text-xs font-medium uppercase tracking-wider`,children:[(0,Y.jsx)(Ue,{className:`size-3.5 text-muted-foreground`}),`Instance Actions`]})}),(0,Y.jsxs)(G,{className:`flex flex-1 flex-col gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Remove Instance`}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 sm:flex-row sm:items-start`,children:[(0,Y.jsx)(`div`,{className:`min-w-0 w-full sm:min-w-0 sm:flex-1`,children:(0,Y.jsxs)(K,{value:n||null,onValueChange:e=>{r(e??``),a(!1)},onInputValueChange:s,children:[(0,Y.jsx)(W,{placeholder:`Select instance`,className:`h-8 w-full min-w-0`,showClear:!!n}),(0,Y.jsx)(H,{children:(0,Y.jsxs)(R,{children:[c.map(e=>(0,Y.jsx)(B,{value:e.id,children:(0,Y.jsx)(`span`,{className:`font-mono`,children:e.id})},e.id)),c.length===0&&(0,Y.jsx)(`p`,{className:`py-2 text-center text-xs text-muted-foreground`,children:`No instances found`})]})})]})}),i&&n?(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 sm:shrink-0`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] text-destructive`,children:`Remove?`}),(0,Y.jsx)(x,{size:`sm`,variant:`destructive`,className:`h-7 text-xs`,onClick:()=>{t.mutate({type:`removeInstance`,instanceId:n}),a(!1),r(``)},children:`Confirm`}),(0,Y.jsx)(x,{size:`sm`,variant:`ghost`,className:`h-7 text-xs`,onClick:()=>a(!1),children:`Cancel`})]}):(0,Y.jsxs)(x,{className:`h-8 w-full shrink-0 gap-1.5 sm:w-auto`,variant:`destructive`,size:`sm`,disabled:!n,onClick:()=>{k(ke,{instanceId:n})&&a(!0)},children:[(0,Y.jsx)(Ge,{className:`size-3`}),`Remove`]})]})]}),(0,Y.jsx)(A,{}),(0,Y.jsx)(h,{mode:`wait`,initial:!1,children:l.length>0?(0,Y.jsxs)(m.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-wider text-warning`,children:[`Quarantined`,(0,Y.jsx)(I,{variant:`secondary`,className:`text-[10px] text-warning`,children:l.length})]}),(0,Y.jsx)(h,{initial:!1,children:l.map(e=>(0,Y.jsx)(m.div,{initial:{opacity:0,x:-6},animate:{opacity:1,x:0},exit:{opacity:0,transition:{duration:.1}},transition:{type:`spring`,stiffness:400,damping:35},children:(0,Y.jsxs)(`div`,{className:`flex items-center justify-between rounded-[var(--miravo-radius-tight)] border border-warning/20 bg-warning/5 px-2.5 py-1.5`,children:[(0,Y.jsx)(`span`,{className:`truncate font-mono text-xs`,children:e.id}),(0,Y.jsx)(x,{size:`sm`,variant:`outline`,className:`h-6 shrink-0 text-[10px]`,onClick:()=>t.mutate({type:`unquarantine`,instanceId:e.id}),children:`Unquarantine`})]})},e.id))})]},`quarantined`):(0,Y.jsxs)(m.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`flex flex-col gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Fleet Health`}),(0,Y.jsx)(`div`,{className:`flex items-center gap-4 text-xs`,children:e.length>0?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`size-2 rounded-full bg-success`}),(0,Y.jsx)(`span`,{className:`font-mono tabular-nums`,children:u}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`healthy`})]}),d>0&&(0,Y.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`size-2 rounded-full bg-warning`}),(0,Y.jsx)(`span`,{className:`font-mono tabular-nums`,children:d}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`faulted`})]}),(0,Y.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(We,{className:`size-3 text-success`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`0 quarantined`})]})]}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`No instances running`})})]},`fleet-health`)})]})]})}function ut(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${i}s`:`${i}s`}function dt(e){if(!Number.isFinite(e)||e<=0)return`0s`;if(e<60)return`${e.toFixed(1)}s`;let t=Math.floor(e),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60),a=t%60;return n>0?r>0?`${n}d ${r}h`:i>0?`${n}d ${i}m`:`${n}d`:r>0?`${r}h ${i}m`:i>0?`${i}m ${a}s`:`${a}s`}function ft({data:e}){let t=(0,J.useMemo)(()=>{if(e.length<2)return null;let t=e.map(e=>e.tps),n=Math.max(...t,.1),r=Math.min(...t,0),i=n-r||1;return{points:t.map((e,n)=>{let a=n/(t.length-1)*200,o=2+(1-(e-r)/i)*28;return`${n===0?`M`:`L`}${a.toFixed(1)},${o.toFixed(1)}`}).join(` `),min:r,max:n}},[e]);return t?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsxs)(`svg`,{viewBox:`0 0 200 32`,className:`h-8 w-full`,preserveAspectRatio:`none`,role:`img`,"aria-label":`TPS trend sparkline`,children:[(0,Y.jsx)(`line`,{x1:`0`,y1:`10.7`,x2:`200`,y2:`10.7`,stroke:`currentColor`,strokeWidth:`0.5`,strokeDasharray:`3,2`,className:`text-border`}),(0,Y.jsx)(`line`,{x1:`0`,y1:`21.3`,x2:`200`,y2:`21.3`,stroke:`currentColor`,strokeWidth:`0.5`,strokeDasharray:`3,2`,className:`text-border`}),(0,Y.jsx)(`path`,{d:t.points,fill:`none`,stroke:`var(--primary)`,strokeWidth:`1.5`})]}),(0,Y.jsxs)(`div`,{className:`flex justify-between text-[9px] text-muted-foreground`,children:[(0,Y.jsxs)(`span`,{children:[`60s ago · `,t.min.toFixed(1)]}),(0,Y.jsxs)(`span`,{children:[t.max.toFixed(1),` · now`]})]})]}):(0,Y.jsx)(`div`,{className:`flex h-8 items-center text-[10px] text-muted-foreground`,children:`Collecting...`})}var pt={running:`bg-success`,paused:`bg-warning`,idle:`bg-muted-foreground`,stopped:`bg-destructive`};function mt({state:e}){let t=pt[e]??`bg-muted-foreground`,n=e===`running`;return(0,Y.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,Y.jsxs)(`div`,{className:`relative flex items-center justify-center`,children:[(0,Y.jsx)(`span`,{className:`size-2.5 rounded-full ${t}`}),n&&(0,Y.jsx)(`span`,{className:`absolute size-2.5 animate-ping rounded-full ${t} opacity-40`})]}),(0,Y.jsx)(h,{mode:`wait`,initial:!1,children:(0,Y.jsx)(m.span,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:5},transition:{type:`spring`,stiffness:500,damping:30},className:`font-mono text-lg font-bold uppercase tracking-wider`,children:e},e)})]})}function Z({label:e,tooltip:t,tooltipClassName:n}){return(0,Y.jsxs)(`div`,{className:`inline-flex w-fit min-w-0 max-w-full items-center gap-1`,children:[(0,Y.jsx)(`span`,{className:`blueprint-title min-w-0 shrink text-[11px] leading-tight text-muted-foreground`,children:e}),(0,Y.jsxs)(ue,{children:[(0,Y.jsx)(ce,{className:`inline-flex size-4 shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] border-0 bg-transparent p-0 text-muted-foreground shadow-none outline-none hover:text-foreground focus-visible:ring-1 focus-visible:ring-ring`,render:(0,Y.jsx)(`button`,{type:`button`}),"aria-label":`About ${e}`,children:(0,Y.jsx)(Me,{className:`size-3`,"aria-hidden":!0})}),(0,Y.jsx)(le,{side:`top`,className:v(`max-w-xs`,n),children:t})]})]})}function ht(){let{engineState:e,connectionState:t}=C(_(e=>({engineState:e.engineState,connectionState:e.connectionState}))),n=P();return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(Z,{label:`Run state`,tooltip:(0,Y.jsx)(`p`,{className:`text-[11px] leading-snug`,children:`Whether the scheduler is running, paused, idle, or stopped. Pause freezes simulated time; resume continues from the same tick.`})}),(0,Y.jsx)(mt,{state:e}),t===`live`&&(e===`running`||e===`paused`)&&(0,Y.jsx)(`div`,{className:`mt-1 flex items-center gap-2`,children:(0,Y.jsxs)(x,{type:`button`,size:`sm`,variant:e===`paused`?`default`:`outline`,className:v(`h-8 min-h-11 w-fit touch-manipulation gap-1.5 px-3 text-xs sm:min-h-8`,e===`running`&&`border-warning/40 bg-warning/10 text-warning hover:bg-warning/20 hover:text-warning focus-visible:border-warning/50 focus-visible:ring-warning/25 border-warning/35`),onClick:()=>n.mutate({type:e===`paused`?`resume`:`pause`}),children:[e===`paused`?(0,Y.jsx)(Fe,{className:`size-3`}):(0,Y.jsx)(Be,{className:`size-3`}),e===`paused`?`Resume`:`Pause`]})})]})}function gt(){let{speedMultiplier:e,connectionState:t}=C(_(e=>({speedMultiplier:e.speedMultiplier,connectionState:e.connectionState}))),n=P(),[r,i]=(0,J.useState)(String(e)),a=t===`live`;return(0,J.useEffect)(()=>{i(String(e))},[e]),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(Z,{label:`Speed`,tooltip:(0,Y.jsx)(`p`,{className:`text-[11px] leading-snug`,children:`Runs the environment at this multiple of real time. 1× is real time; higher values speed up the model. Change it with the field and Set.`})}),(0,Y.jsxs)(`span`,{className:`w-fit font-mono text-lg font-bold tabular-nums`,children:[e,`x`]}),(0,Y.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Y.jsx)(L,{htmlFor:`speed-multiplier`,className:`sr-only`,children:`Speed multiplier`}),(0,Y.jsx)(S,{id:`speed-multiplier`,type:`number`,value:r,onChange:e=>i(e.target.value),className:`h-8 min-h-11 w-[4.75rem] touch-manipulation font-mono text-xs tabular-nums sm:min-h-8`,min:`1`,max:`1000`,disabled:!a}),(0,Y.jsx)(x,{type:`button`,size:`sm`,variant:`outline`,className:`h-8 min-h-11 touch-manipulation px-3 text-xs sm:min-h-8`,disabled:!a,onClick:()=>{let e=k(Ae,{multiplier:Number(r)});e&&n.mutate({type:`setSpeed`,multiplier:e.multiplier})},children:`Set`})]})]})}function _t(){let{tick:e,simulationTime:t,tps:n,tpsHistory:r,uptimeMs:i,instanceCount:a,memberValueCount:o}=C(_(e=>({tick:e.tick,simulationTime:e.simulationTime,tps:e.tps,tpsHistory:e.tpsHistory,uptimeMs:e.uptimeMs,instanceCount:e.instanceCount,memberValueCount:e.memberValueCount})));return(0,Y.jsxs)(`div`,{className:v(N,`px-4 py-3`),children:[(0,Y.jsxs)(`header`,{className:`mb-3 border-b border-border/60 pb-2`,children:[(0,Y.jsx)(`h2`,{className:`font-heading text-sm font-semibold tracking-tight text-foreground`,children:`Engine vitals`}),(0,Y.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:`Scheduler, speed, cycle count, and throughput for this session.`})]}),(0,Y.jsxs)(`div`,{className:`grid min-w-0 grid-cols-2 gap-3 @2xl/main:gap-4 @3xl/main:grid-cols-3 @5xl/main:grid-cols-6`,children:[(0,Y.jsx)(ht,{}),(0,Y.jsx)(gt,{}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(Z,{label:`Cycle`,tooltipClassName:`flex flex-col items-start gap-2 text-left`,tooltip:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`text-[11px] leading-snug`,children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:`Cycle`}),` compares simulated progress with wall time: how many steps ran, how much model time advanced, and how long this session has been open.`]}),(0,Y.jsxs)(`p`,{className:`text-[11px] leading-snug`,children:[`The number is `,(0,Y.jsx)(`span`,{className:`font-medium`,children:`tick`}),` count — completed scheduler steps since this run. Each tick refreshes the plant model and live tags.`]}),(0,Y.jsxs)(`p`,{className:`text-[11px] leading-snug`,children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:`Sim`}),` is simulated elapsed time. Each tick adds (tick interval × speed) to this clock. Generators, lifecycle, and in-model timestamps use Sim, not your system clock. It stops advancing while paused.`]}),(0,Y.jsxs)(`p`,{className:`text-[11px] leading-snug`,children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:`Real`}),` is wall-clock uptime since the run started (real time).`]})]})}),(0,Y.jsx)(`span`,{className:`w-fit font-mono text-lg font-bold tabular-nums`,children:b(e)}),(0,Y.jsxs)(`div`,{className:`mt-1 flex w-full min-w-0 flex-col gap-0.5 leading-tight`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Y.jsx)(`span`,{className:`w-10 shrink-0 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Sim`}),(0,Y.jsx)(`span`,{className:`min-w-0 font-mono text-[10px] tabular-nums text-muted-foreground`,children:dt(t)})]}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Y.jsx)(`span`,{className:`w-10 shrink-0 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Real`}),(0,Y.jsx)(`span`,{className:`min-w-0 font-mono text-[10px] tabular-nums text-muted-foreground`,children:ut(i)})]})]})]}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(Z,{label:`Throughput`,tooltip:(0,Y.jsx)(`p`,{className:`text-[11px] leading-snug`,children:`Ticks per second: how fast the engine is stepping. Rises and falls with workload, speed setting, and CPU headroom.`})}),(0,Y.jsxs)(`span`,{className:`w-fit font-mono text-lg font-bold tabular-nums`,children:[n.toFixed(1),` tps`]}),(0,Y.jsxs)(`span`,{className:`mt-1 text-[10px] text-muted-foreground`,children:[a,` inst · `,de(o),` tags`]})]}),(0,Y.jsxs)(`div`,{className:`col-span-2 flex flex-col gap-2`,children:[(0,Y.jsx)(Z,{label:`TPS Trend`,tooltip:(0,Y.jsx)(`p`,{className:`text-[11px] leading-snug`,children:`Recent ticks-per-second samples over about the last minute. Flat or noisy lines usually mean load or speed changes.`})}),(0,Y.jsx)(ft,{data:r})]})]})]})}var Q=[`MQTT Sparkplug B`,`EtherNet/IP`,`Siemens S7`];function vt({enabled:e,total:t}){let n=t===0?`empty`:e===0?`idle`:`live`;return(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 rounded-[var(--miravo-radius-pill)] border border-border/60 bg-background/60 px-2.5 py-1 backdrop-blur-sm`,children:[(0,Y.jsxs)(`span`,{className:`relative flex size-1.5 items-center justify-center`,children:[(0,Y.jsx)(`span`,{className:v(`size-1.5 rounded-full`,n===`live`?`bg-success shadow-[0_0_0_1px_color-mix(in_srgb,var(--success)_50%,transparent),0_0_12px_color-mix(in_srgb,var(--success)_42%,transparent)]`:n===`idle`?`bg-warning/85 shadow-[0_0_0_1px_color-mix(in_srgb,var(--warning)_50%,transparent),0_0_12px_color-mix(in_srgb,var(--warning)_38%,transparent)]`:`bg-muted-foreground/55`)}),n===`live`&&(0,Y.jsx)(`span`,{className:`absolute inset-0 animate-ping rounded-full bg-success/60`})]}),(0,Y.jsxs)(`span`,{className:`text-[11px] leading-none text-muted-foreground`,children:[(0,Y.jsx)(`span`,{className:`font-mono font-semibold tabular-nums text-foreground`,children:e}),(0,Y.jsx)(`span`,{className:`mx-1 text-muted-foreground/60`,children:`/`}),(0,Y.jsx)(`span`,{className:`font-mono tabular-nums`,children:t}),(0,Y.jsx)(`span`,{className:`ml-1.5 text-[10px] uppercase tracking-[0.14em]`,children:`active`})]})]})}function $(){let{availableAdapters:e,adapterMetrics:t}=C(_(e=>({availableAdapters:e.availableAdapters,adapterMetrics:e.adapterMetrics}))),n=e.filter(e=>e.enabled).length;return(0,Y.jsxs)(`section`,{className:v(N,`flex min-w-0 flex-col hover:border-border`),children:[(0,Y.jsxs)(`header`,{className:`flex flex-wrap items-start justify-between gap-3 border-b border-border/60 px-4 py-3`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,Y.jsx)(`div`,{className:`mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] border border-border/60 bg-background/70 text-muted-foreground`,"aria-hidden":!0,children:(0,Y.jsx)(q,{className:`size-3.5`})}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`h3`,{className:`font-heading text-sm font-semibold tracking-tight text-foreground`,children:`Protocol Gateway`}),(0,Y.jsx)(`p`,{className:`mt-0.5 text-pretty text-xs text-muted-foreground`,children:`Northbound adapters publishing engine telemetry to external systems.`})]})]}),(0,Y.jsx)(vt,{enabled:n,total:e.length})]}),e.length>0&&(0,Y.jsx)(`div`,{className:`flex flex-col gap-2 px-4 py-4`,children:(0,Y.jsx)(h,{children:e.map((e,n)=>{let r=t.find(t=>t.name===e.name)?.metrics;return(0,Y.jsx)(m.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0},transition:{type:`spring`,stiffness:380,damping:30,delay:n*.05},children:(0,Y.jsx)(ot,{adapter:e,metrics:r})},e.name)})})}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2 border-t border-border/60 bg-background/40 px-4 py-2.5`,role:`status`,"aria-label":`Upcoming protocol adapters: ${Q.join(`, `)}, and more`,children:[(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,Y.jsx)(je,{className:`size-3 text-muted-foreground/70`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:`Roadmap`})]}),(0,Y.jsxs)(`ul`,{className:`flex min-w-0 flex-wrap items-center gap-1.5`,children:[Q.map(e=>(0,Y.jsx)(`li`,{className:`rounded-[var(--miravo-radius-tight)] border border-dashed border-border/70 bg-background/40 px-2 py-0.5 font-mono text-[10px] leading-[15px] tracking-tight text-muted-foreground`,children:e},e)),(0,Y.jsx)(`li`,{className:`font-mono text-[10px] leading-[15px] tracking-tight text-muted-foreground/75`,children:`+ more`})]})]})]})}function yt(){let e=C(e=>e.instances),t=P(),[n,r]=(0,J.useState)(!1),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(!1);return(0,Y.jsxs)(`div`,{className:`flex h-full min-w-0 flex-col`,children:[(0,Y.jsxs)(U,{className:`h-full min-w-0`,children:[(0,Y.jsx)(z,{className:`pb-3`,children:(0,Y.jsxs)(V,{className:`flex items-center gap-2 text-xs font-medium uppercase tracking-wider`,children:[(0,Y.jsx)(ze,{className:`size-3.5 text-muted-foreground`,"aria-hidden":!0}),`Danger Zone`]})}),(0,Y.jsx)(G,{className:`flex flex-1 flex-col`,children:(0,Y.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-3 rounded-[var(--miravo-radius-stadium-sm)] border border-dashed border-border p-3 @2xl/main:flex-row @2xl/main:items-center @2xl/main:justify-between`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,Y.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:`Reset environment`}),(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Removes `,e.length,` running instance`,e.length===1?``:`s`,` and all loaded environments.`]})]}),(0,Y.jsx)(x,{className:`min-h-11 w-full shrink-0 touch-manipulation @2xl/main:w-auto sm:min-h-7`,variant:`destructive`,size:`sm`,onClick:()=>r(!0),children:`Reset`})]})})]}),(0,Y.jsx)(se,{open:n,onOpenChange:e=>{r(e),e||a(!1)},children:(0,Y.jsxs)(ie,{children:[(0,Y.jsxs)(ne,{children:[(0,Y.jsx)(ae,{children:`Reset Environment`}),(0,Y.jsx)(oe,{children:`Removes all running instances and loaded environments.`})]}),(0,Y.jsx)(`div`,{className:`space-y-3 text-sm`,children:(0,Y.jsx)(`div`,{className:`rounded-[var(--miravo-radius-stadium-sm)] border p-3`,children:(0,Y.jsxs)(L,{htmlFor:`clear-persisted-state`,className:`items-start`,children:[(0,Y.jsx)(Ne,{id:`clear-persisted-state`,checked:i,onCheckedChange:e=>a(e===!0)}),(0,Y.jsxs)(`span`,{className:`space-y-1`,children:[(0,Y.jsx)(`span`,{className:`block font-medium text-foreground`,children:`Also clear persisted state`}),(0,Y.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:`Start empty on the next restart.`})]})]})})}),(0,Y.jsxs)(re,{children:[(0,Y.jsx)(x,{variant:`outline`,className:`min-h-11 w-full touch-manipulation sm:min-h-8 sm:w-auto`,onClick:()=>{r(!1),a(!1)},disabled:o,children:`Cancel`}),(0,Y.jsx)(x,{variant:`destructive`,className:`min-h-11 w-full touch-manipulation sm:min-h-8 sm:w-auto`,disabled:o,onClick:async()=>{s(!0);try{await t.mutateAsync({type:`resetEnvironment`,...i?{clearPersistence:!0}:{}}),r(!1),a(!1)}catch{}finally{s(!1)}},children:o?`Resetting...`:`Confirm Reset`})]})]})})]})}function bt(){let[e,t]=g(`tab`,te([`monitor`,`operate`]).withDefault(`monitor`));return(0,Y.jsxs)(`div`,{className:`mx-auto flex w-full min-w-0 max-w-screen-2xl flex-col gap-5 p-4 sm:gap-6 sm:p-6`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`h1`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Mission Control`}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Engine telemetry, protocol management, and fleet operations.`})]}),(0,Y.jsxs)(O,{value:e,onValueChange:e=>{t(e)},className:`min-h-0 flex-1`,children:[(0,Y.jsx)(`div`,{className:`shrink-0 overflow-x-auto`,children:(0,Y.jsxs)(Te,{variant:`line`,className:`h-10! min-w-max gap-0.5`,children:[(0,Y.jsxs)(w,{value:`monitor`,className:`gap-1.5 px-3 text-sm`,children:[(0,Y.jsx)(Oe,{className:`size-3.5 shrink-0`}),`Monitor`]}),(0,Y.jsxs)(w,{value:`operate`,className:`gap-1.5 px-3 text-sm`,children:[(0,Y.jsx)(Ee,{className:`size-3.5 shrink-0`}),`Operate`]})]})}),(0,Y.jsx)(E,{value:`monitor`,className:`flex-1 py-2`,children:(0,Y.jsxs)(m.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:`easeOut`},className:`flex flex-col gap-5 sm:gap-6`,children:[(0,Y.jsx)(_t,{}),(0,Y.jsx)($,{})]},`monitor`)}),(0,Y.jsx)(E,{value:`operate`,className:`flex-1 py-2`,children:(0,Y.jsxs)(m.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:`easeOut`},className:`grid min-h-0 min-w-0 grid-cols-1 items-stretch gap-5 @2xl/main:grid-cols-2 @2xl/main:gap-4`,children:[(0,Y.jsx)(st,{}),(0,Y.jsx)(lt,{}),(0,Y.jsx)(ct,{}),(0,Y.jsx)(yt,{})]},`operate`)})]})]})}export{q as n,bt as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./control-DbOdtp7Q.js";export{e as ControlPage};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";import{B as n,G as r,H as i,K as a,U as o,V as s,W as c,at as l}from"./vendor-ui-mizMYESS.js";import{_ as u,a as d,i as f,o as ee}from"./api-Bef9FEIU.js";import{a as te,c as ne}from"./get-error-message-DhCjoSSJ.js";import{t as p}from"./proxy-CgM57W61.js";import{t as re}from"./AnimatePresence-CVhkybDC.js";import{a as ie,i as ae,l as m,n as oe,o as se,r as ce,t as le}from"./dialog-DD0yn-KA.js";import{n as h,t as g}from"./createLucideIcon-Yddw9eHa.js";import{a as ue,n as _,t as de}from"./input-BCiRHEmc.js";import{_ as fe,a as pe,b as me,c as he,f as ge,g as _e,i as ve,m as ye,p as be,r as xe,x as Se,y as Ce}from"./use-platform-stream-7982hIDJ.js";import{a as we,c as Te,i as v,n as Ee,o as De,r as Oe,s as ke,t as Ae}from"./select-4wihIkEE.js";import{a as je,i as y,n as Me,r as b,t as Ne}from"./platform-targets-BbVxaqAc.js";import{o as x,s as S}from"./tabs-Bwhx891Q.js";import{t as C}from"./download-BPgKzo-_.js";import{n as Pe}from"./checkbox-Xly18Uyz.js";import{t as Fe}from"./badge-tnWgSITj.js";import{t as w}from"./query-keys-Co1J4HmV.js";import{t as T}from"./label-xIWEC6lW.js";var E=g(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),D=g(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),O=g(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),k=l();function A({...e}){return(0,k.jsx)(s,{"data-slot":`sheet`,...e})}function j({...e}){return(0,k.jsx)(i,{"data-slot":`sheet-portal`,...e})}function M({className:e,...t}){return(0,k.jsx)(a,{"data-slot":`sheet-overlay`,className:h(`fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs`,e),...t})}function N({className:e,children:t,side:n=`right`,showCloseButton:i=!0,...a}){return(0,k.jsxs)(j,{children:[(0,k.jsx)(M,{}),(0,k.jsxs)(o,{"data-slot":`sheet-content`,"data-side":n,className:h(`fixed z-50 flex flex-col gap-4 bg-background bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-[calc(100vw-1rem)] data-[side=left]:max-w-md data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-[calc(100vw-1rem)] data-[side=right]:max-w-xl data-[side=right]:border-l data-[side=right]:pl-1 data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem]`,e),...a,children:[t,i&&(0,k.jsxs)(r,{"data-slot":`sheet-close`,render:(0,k.jsx)(_,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`}),children:[(0,k.jsx)(ue,{}),(0,k.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function P({className:e,...t}){return(0,k.jsx)(`div`,{"data-slot":`sheet-header`,className:h(`flex flex-col gap-0.5 p-2`,e),...t})}function F({className:e,...t}){return(0,k.jsx)(n,{"data-slot":`sheet-title`,className:h(`text-base font-medium text-foreground`,e),...t})}function Ie({className:e,...t}){return(0,k.jsx)(c,{"data-slot":`sheet-description`,className:h(`text-sm text-muted-foreground`,e),...t})}var I=e(t(),1),L=[{value:`opcua`,label:`OPC UA`},{value:`mqtt`,label:`MQTT`},{value:`modbus`,label:`Modbus`}];function Le({value:e,onValueChange:t,labelledBy:n}){return(0,k.jsx)(`fieldset`,{"aria-labelledby":n,className:`min-w-0 border-0 p-0`,children:(0,k.jsx)(`div`,{className:`flex gap-1.5`,children:L.map(n=>{let r=e===n.value;return(0,k.jsx)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>t(n.value),className:h(`flex flex-1 items-center justify-center rounded-[var(--miravo-radius-pill)] border py-1.5 text-center transition-[background-color,border-color,color,box-shadow] duration-200`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/80 focus-visible:ring-offset-2 focus-visible:ring-offset-background`,r?`border-primary/45 bg-primary/10 text-primary shadow-[inset_0_1px_0_0_rgba(255,255,255,0.06),0_0_0_1px_color-mix(in_srgb,var(--primary)_25%,transparent)]`:`border-border/75 bg-background/55 text-foreground/82 hover:border-border/90 hover:bg-background/70 hover:text-foreground/92`),children:(0,k.jsxs)(`span`,{className:`inline-flex items-center justify-center gap-1.5 font-mono text-[11px] font-medium leading-none tracking-wide`,children:[(0,k.jsx)(x,{className:`size-2.5 shrink-0 -translate-y-px opacity-80`,"aria-hidden":!0}),(0,k.jsx)(`span`,{children:n.label})]})},n.value)})})})}var R=`172.17.0.1`;async function Re(e){let t=await d(`/catalog/models/${encodeURIComponent(e)}/le-dt.json`,u.catalogModelLeDt);return JSON.stringify(t,null,2)}async function ze(e,t={host:R}){let n=u.catalogTemplateLeTemplateJson.query;if(!n)throw Error(`Missing query schema for ${u.catalogTemplateLeTemplateJson.method} ${u.catalogTemplateLeTemplateJson.path}`);let r=n.safeParse(t);if(!r.success)throw Error(`Invalid request for ${u.catalogTemplateLeTemplateJson.method} ${u.catalogTemplateLeTemplateJson.path}: ${r.error.message}`);return f(`/catalog/templates/${encodeURIComponent(e)}/le-template.json${Be(r.data)}`,u.catalogTemplateLeTemplateJson)}function Be(e){let t=new URLSearchParams;return e.host&&t.set(`host`,e.host),e.protocol&&t.set(`protocol`,e.protocol),t.size>0?`?${t.toString()}`:``}function z(e){let t=e.split(/[-_]/).filter(e=>e.length>0);return t[t.length-1]??e}function Ve(e){return`${z(e)}-001`}function He(e,t){return[t,...e?.filter(e=>e.id!==t.id)??[]]}async function Ue(e){let t=await e.create();e.onCreated(t);try{await e.refresh()}catch(t){e.onRefreshFailed(t)}}function We(e){return y.find(t=>t.id===e)?.label??e}function Ge(e){return e===`template`?`Litmus Edge Template`:`Litmus Edge Digital Twin`}function Ke({kind:e,id:t,displayName:n,yamlPath:r,yamlFilename:i,stream:a}){let o=ne(),s=te({queryKey:w.platforms.targets(),queryFn:()=>he()}),c=s.data??[],[l,d]=(0,I.useState)(``),[f,g]=(0,I.useState)(`opcua`),[x,E]=(0,I.useState)(`litmus-edge`),[D,O]=(0,I.useState)(!1),[A,j]=(0,I.useState)(!1),[M,N]=(0,I.useState)(b.id),[P,F]=(0,I.useState)({label:``,hostname:``,apiToken:``,sourceHostname:``}),[Ie,L]=(0,I.useState)(!1),[Be,z]=(0,I.useState)(!1),{testing:Ke,runTest:qe,cancelInFlight:Je}=xe(),[Ye,B]=(0,I.useState)(!1),[V,H]=(0,I.useState)(R),[U,Xe]=(0,I.useState)(!1),[W,G]=(0,I.useState)(!1),Ze=(0,I.useId)(),Qe=a.operation?.operationId;(0,I.useEffect)(()=>{G(!1)},[Qe]),(0,I.useEffect)(()=>{A&&(N(b.id),F({label:``,hostname:``,apiToken:``,sourceHostname:``}),L(!1))},[A]);let K=M===b.id&&P.hostname.trim().length>0&&P.sourceHostname.trim().length>0&&P.apiToken.trim().length>0,q=c.find(e=>e.id===l),$e=(0,I.useCallback)(n=>{O(!1),l&&(e===`model`?a.startApply({targetId:l,model:t,protocol:f,scope:n.scope,deviceName:n.deviceName,ifUnmanaged:n.ifUnmanaged}):a.startApply({targetId:l,template:t,scope:n.scope,ifUnmanaged:n.ifUnmanaged}))},[l,t,e,f,a]),et=(0,I.useCallback)(async()=>{if(M!==b.id){m.error(`${We(M)} target setup is coming soon.`);return}if(!P.label||!P.hostname||!P.sourceHostname){m.error(`Label, hostname, and source host are required.`);return}if(!P.apiToken){m.error(`API token is required for new targets.`);return}z(!0);try{await Ue({create:()=>pe({...P,platformId:M}),onCreated:e=>{o.setQueryData(w.platforms.targets(),t=>He(t,e)),d(e.id),j(!1),m.success(`Target added.`)},refresh:async()=>{let e=await s.refetch();if(e.error)throw e.error},onRefreshFailed:e=>{m.error(`Target added, but target list refresh failed.`,{description:e instanceof Error&&e.message?`${e.message} Reload targets before retrying another add.`:`Reload targets before retrying another add.`})}})}catch(e){m.error(e instanceof Error?e.message:`Failed to add target.`)}finally{z(!1)}},[M,P,s,o]),tt=(0,I.useCallback)(()=>{K&&qe({hostname:P.hostname.trim(),sourceHostname:P.sourceHostname.trim(),apiToken:P.apiToken.trim()})},[K,P,qe]),J=x===`source-yaml`,Y=x===`litmus-edge`||J,X=(0,I.useCallback)(async n=>{if(J){try{let t=await ee(r,e===`model`?u.catalogModelYaml:u.catalogTemplateYaml),n=new Blob([t],{type:`text/yaml`}),a=URL.createObjectURL(n),o=document.createElement(`a`);o.href=a,o.download=i,o.click(),URL.revokeObjectURL(a),m.success(`Exported ${i}`)}catch{m.error(`Failed to export YAML`)}return}if(x===`litmus-edge`)try{if(e===`model`){let e=await Re(t),n=new Blob([e],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`${t}.le-dt.json`,i.click(),URL.revokeObjectURL(r),m.success(`Exported ${t}.le-dt.json`)}else{let e=n?.templateHost?.trim()??``,r=e.length>0?e:R,i=`${t}.le-template.json`,a=await ze(t,{host:r,protocol:f}),o=URL.createObjectURL(a),s=document.createElement(`a`);s.href=o,s.download=i,s.click(),URL.revokeObjectURL(o),m.success(`Exported ${i}`)}}catch{m.error(`Failed to export platform format`)}},[x,J,e,t,r,i,f]),nt=(0,I.useCallback)(()=>{if(Y){if(x===`litmus-edge`&&e===`template`){H(R),B(!0);return}X()}},[Y,x,e,X]),rt=(0,I.useCallback)(async()=>{Xe(!0);try{await X({templateHost:V}),B(!1)}finally{Xe(!1)}},[V,X]),Z=a.status===`running`,Q=!!l&&!Z,it=!!a.operation||Z,$=it?ve(a):null;return(0,k.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-6 px-1 py-2`,children:[(0,k.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-2`,children:(0,k.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,k.jsx)(`p`,{className:`font-heading text-[11px] font-semibold uppercase tracking-[0.2em] text-foreground`,children:`Deploy`}),(0,k.jsxs)(`div`,{className:`space-y-2`,children:[(0,k.jsx)(T,{className:`font-heading text-[11px] font-medium uppercase tracking-[0.14em] text-foreground/78`,children:`Target`}),(0,k.jsx)(ge,{targets:c,value:l,onValueChange:d,size:`sm`,className:`min-w-0 w-full border-border/65 bg-background/55 text-xs text-foreground`,onAddNew:()=>j(!0)})]}),e===`model`&&c.length>0&&(0,k.jsxs)(`div`,{className:`space-y-2`,children:[(0,k.jsx)(T,{id:Ze,className:`font-heading text-[11px] font-medium uppercase tracking-[0.14em] text-foreground/78`,children:`Protocol binding`}),(0,k.jsx)(Le,{value:f,onValueChange:g,labelledBy:Ze})]}),c.length>0&&(0,k.jsxs)(`button`,{type:`button`,disabled:!Q,onClick:()=>O(!0),className:h(`group flex w-full min-h-14 min-w-0 items-stretch overflow-hidden rounded-[var(--miravo-radius-stadium-lg)] text-left outline-none`,`transition-[border-color,box-shadow,background-color] duration-200 ease-out`,`focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background`,`disabled:pointer-events-none disabled:opacity-55`,Q?[`border-2 border-primary/40 bg-background`,`bg-linear-to-r from-primary/12 via-background to-background`,`shadow-[inset_0_1px_0_0_rgba(255,255,255,0.025)]`,`hover:border-primary/56 hover:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.025),0_0_14px_-8px_color-mix(in_srgb,var(--primary)_18%,transparent),0_0_22px_-12px_color-mix(in_srgb,var(--primary)_8%,transparent)]`]:[`border border-dashed border-border/65 bg-muted/15`,`hover:bg-muted/22`]),children:[(0,k.jsxs)(`span`,{className:`relative flex w-18 shrink-0 items-center justify-center bg-transparent`,"aria-hidden":!0,children:[(0,k.jsx)(`span`,{className:h(`absolute inset-y-2 -right-px w-px bg-linear-to-b from-transparent via-primary/30 to-transparent opacity-70`,!Q&&`via-border/80`)}),(0,k.jsx)(Pe,{className:h(`relative size-5`,Q?`text-primary`:`text-foreground/75`)})]}),(0,k.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col justify-center gap-0.5 overflow-hidden px-3 py-2.5 sm:px-4`,children:[(0,k.jsx)(`span`,{className:h(`font-heading text-[11px] font-semibold uppercase tracking-[0.16em]`,Q?`text-primary`:`text-foreground/78`),children:Q?`Commit deploy`:Z?`Deploy in progress…`:`Awaiting target`}),(0,k.jsx)(`span`,{className:h(`truncate font-mono text-[13px] leading-tight tracking-tight`,Q?`text-foreground`:`text-foreground/80`),children:q?.label??`Select a target above`})]}),(0,k.jsx)(`span`,{className:h(`flex shrink-0 items-center pr-2.5 sm:pr-3`,Q&&`pl-1`),children:(0,k.jsx)(`span`,{className:h(`flex size-9 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border bg-transparent transition-[border-color,color] duration-200`,Q?`border-primary/40 text-primary group-hover:border-primary/55`:`border-border/75 text-foreground/75`),"aria-hidden":!0,children:(0,k.jsx)(je,{className:`size-4`,strokeWidth:2.25})})})]})]})}),(0,k.jsx)(re,{children:it&&$?(0,k.jsx)(ye,{title:$.title,subtitle:$.subtitle,footerAction:Z&&a.operation?.operationId?(0,k.jsx)(_,{variant:`outline`,size:`sm`,disabled:W,"aria-busy":W,className:h(`ml-auto group h-8 gap-1.5 px-3 text-xs`,W?`cursor-not-allowed`:`hover:bg-destructive/12 hover:text-destructive hover:border-destructive/35`),onClick:async()=>{G(!0);try{await a.cancel()}catch{G(!1)}},children:W?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(S,{className:`size-3.5 shrink-0 animate-spin text-muted-foreground`,"aria-hidden":!0}),(0,k.jsx)(p.span,{animate:{opacity:[1,.72,1]},transition:{duration:1.25,repeat:1/0,ease:`easeInOut`},className:`font-medium text-foreground`,children:`Cancelling…`})]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ue,{className:`size-3.5 shrink-0 text-foreground/65 group-hover:text-destructive`,"aria-hidden":!0}),(0,k.jsx)(p.span,{animate:{opacity:[1,.88,1]},transition:{duration:2.2,repeat:1/0,ease:`easeInOut`},children:`Cancel`})]})}):(0,k.jsx)(`div`,{className:`ml-auto shrink-0 flex items-center`,children:(0,k.jsx)(_,{type:`button`,variant:`secondary`,size:`xs`,className:`h-7 px-3 text-[10px] font-medium`,onClick:a.reset,children:`Close`})}),onDismiss:a.reset,children:a.operation?(0,k.jsx)(fe,{operation:a.operation,catalogTemplates:[{id:t,name:n}]}):(0,k.jsxs)(`div`,{className:`flex flex-col gap-2 py-1`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(S,{className:`size-3.5 animate-spin text-primary`,"aria-hidden":!0}),(0,k.jsx)(`span`,{className:`text-xs text-foreground/88`,children:`Connecting to Litmus Edge…`})]}),(0,k.jsx)(`div`,{className:`h-1 w-full overflow-hidden rounded-full bg-muted/40`,children:(0,k.jsx)(p.div,{className:`h-full w-2/5 rounded-full bg-primary`,animate:{x:[`-100%`,`250%`]},transition:{duration:1.2,repeat:1/0,ease:`easeInOut`}})})]})},`deploy-stream`):null}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-border/40 pt-5`,children:[(0,k.jsx)(`p`,{className:`font-heading text-[11px] font-semibold uppercase tracking-[0.2em] text-foreground`,children:`Export`}),(0,k.jsxs)(`div`,{className:`space-y-2`,children:[(0,k.jsx)(T,{className:`font-heading text-[11px] font-medium uppercase tracking-[0.14em] text-foreground/78`,children:`Format`}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,k.jsxs)(Ae,{value:x,onValueChange:e=>{e&&E(e)},children:[(0,k.jsx)(ke,{size:`sm`,className:`h-9! min-h-9 min-w-0 flex-1 border-border/65 bg-background/55 py-0 text-xs text-foreground`,children:(0,k.jsx)(Te,{placeholder:`Select format`,children:t=>{if(t===`source-yaml`)return`Source YAML`;let n=y.find(e=>e.id===t);return n?.id===`litmus-edge`?Ge(e):n?.exportLabel??`Select format`}})}),(0,k.jsxs)(Ee,{children:[(0,k.jsxs)(Oe,{children:[(0,k.jsx)(we,{children:`Platform`}),Ne.map(t=>(0,k.jsx)(v,{value:t.id,children:t.id===`litmus-edge`?Ge(e):t.exportLabel},t.id)),Me.map(e=>(0,k.jsx)(v,{value:e.id,disabled:!0,children:(0,k.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.exportLabel,(0,k.jsx)(Fe,{variant:`outline`,className:`px-1 py-0 text-[10px] text-foreground/72`,children:`Coming Soon`})]})},e.id))]}),(0,k.jsx)(De,{}),(0,k.jsxs)(Oe,{children:[(0,k.jsx)(we,{children:`Source`}),(0,k.jsxs)(v,{value:`source-yaml`,children:[`Source YAML`,` `,(0,k.jsx)(`span`,{className:`text-foreground/72`,children:e===`model`?`.twin.yaml`:`.miravo.yaml`})]})]})]})]}),(0,k.jsxs)(_,{variant:`outline`,size:`sm`,className:`h-9 min-h-9 shrink-0 gap-1.5 border-border/70 bg-background/50 px-4 text-xs font-medium text-foreground sm:w-auto`,disabled:!Y,onClick:nt,children:[(0,k.jsx)(C,{className:`size-3.5`}),`Download`]})]})]}),(0,k.jsx)(`p`,{className:`text-[11px] leading-snug text-foreground/70`,children:(0,k.jsx)(_e,{format:x,kind:e})})]}),q&&(0,k.jsx)(Ce,{open:D,onOpenChange:O,type:`apply`,label:n,targetLabel:q.label,hostname:q.hostname,sourceHostname:q.sourceHostname,onConfirm:$e,defaultDeviceName:e===`model`?Ve(t):void 0}),(0,k.jsx)(be,{open:A,editing:!1,platformId:M,form:P,showToken:Ie,saving:Be,testing:Ke,canTestConnection:K,onOpenChange:j,onPlatformChange:N,onFormChange:F,onShowTokenChange:L,onSave:()=>void et(),onTestConnection:tt,onCancelInFlight:Je}),(0,k.jsx)(le,{open:Ye,onOpenChange:e=>{B(e),e||H(R)},children:(0,k.jsxs)(oe,{className:`sm:max-w-md`,children:[(0,k.jsxs)(ie,{children:[(0,k.jsx)(se,{children:`Download Litmus Edge Template`}),(0,k.jsx)(ce,{children:me})]}),(0,k.jsxs)(`div`,{className:`space-y-2 py-1`,children:[(0,k.jsx)(T,{htmlFor:`deploy-export-source-host`,children:Se}),(0,k.jsx)(de,{id:`deploy-export-source-host`,value:V,onChange:e=>H(e.target.value),placeholder:R,autoComplete:`off`,className:`font-mono text-sm`}),(0,k.jsxs)(`p`,{className:`text-[11px] leading-snug text-muted-foreground`,children:[`Use an IP or hostname reachable from Litmus Edge (e.g.`,` `,(0,k.jsx)(`span`,{className:`font-mono`,children:R}),` for Docker bridge).`]})]}),(0,k.jsxs)(ae,{className:`gap-2 sm:gap-0`,children:[(0,k.jsx)(_,{type:`button`,variant:`outline`,onClick:()=>B(!1),disabled:U,children:`Cancel`}),(0,k.jsxs)(_,{type:`button`,className:`gap-1.5`,onClick:()=>void rt(),disabled:U,"aria-busy":U,children:[U?(0,k.jsx)(S,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,k.jsx)(C,{className:`size-3.5`,"aria-hidden":!0}),`Download`]})]})]})})]})}export{P as a,D as c,Ie as i,E as l,A as n,F as o,N as r,O as s,Ke as t};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";import{B as n,G as r,H as i,K as a,U as o,V as s,W as c,at as l,ot as u}from"./vendor-ui-mizMYESS.js";import{n as d,t as ee}from"./createLucideIcon-Yddw9eHa.js";import{a as f,n as p}from"./input-BCiRHEmc.js";var m=e(t(),1),te=e(u(),1);function h(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var g=e=>{switch(e){case`success`:return y;case`info`:return x;case`warning`:return b;case`error`:return S;default:return null}},_=Array(12).fill(0),v=({visible:e,className:t})=>m.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},m.createElement(`div`,{className:`sonner-spinner`},_.map((e,t)=>m.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),y=m.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},m.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),b=m.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},m.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),x=m.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},m.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),S=m.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},m.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),C=m.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},m.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),m.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),ne=()=>{let[e,t]=m.useState(document.hidden);return m.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},w=1,T=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:w++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],m.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(D(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!m.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!m.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!m.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!m.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||w++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},E=(e,t)=>{let n=t?.id||w++;return T.addToast({title:e,...t,id:n}),n},D=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,O=Object.assign(E,{success:T.success,info:T.info,warning:T.warning,error:T.error,custom:T.custom,message:T.message,promise:T.promise,dismiss:T.dismiss,loading:T.loading},{getHistory:()=>T.toasts,getToasts:()=>T.getActiveToasts()});h(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function k(e){return e.label!==void 0}var A=3,j=`24px`,re=`16px`,M=4e3,N=356,ie=14,P=45,ae=200;function F(...e){return e.filter(Boolean).join(` `)}function I(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var oe=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:ee,closeButton:f,style:p,cancelButtonStyle:te,actionButtonStyle:h,className:_=``,descriptionClassName:y=``,duration:b,position:x,gap:S,expandByDefault:w,classNames:T,icons:E,closeButtonAriaLabel:D=`Close toast`}=e,[O,A]=m.useState(null),[j,re]=m.useState(null),[N,ie]=m.useState(!1),[oe,L]=m.useState(!1),[se,R]=m.useState(!1),[z,B]=m.useState(!1),[ce,V]=m.useState(!1),[le,H]=m.useState(0),[ue,U]=m.useState(0),W=m.useRef(n.duration||b||M),G=m.useRef(null),K=m.useRef(null),de=c===0,fe=c+1<=o,q=n.type,J=n.dismissible!==!1,pe=n.className||``,me=n.descriptionClassName||``,Y=m.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),he=m.useMemo(()=>n.closeButton??f,[n.closeButton,f]),ge=m.useMemo(()=>n.duration||b||M,[n.duration,b]),X=m.useRef(0),Z=m.useRef(0),_e=m.useRef(0),Q=m.useRef(null),[ve,ye]=x.split(`-`),be=m.useMemo(()=>s.reduce((e,t,n)=>n>=Y?e:e+t.height,0),[s,Y]),xe=ne(),Se=n.invert||t,Ce=q===`loading`;Z.current=m.useMemo(()=>Y*S+be,[Y,be]),m.useEffect(()=>{W.current=ge},[ge]),m.useEffect(()=>{ie(!0)},[]),m.useEffect(()=>{let e=K.current;if(e){let t=e.getBoundingClientRect().height;return U(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),m.useLayoutEffect(()=>{if(!N)return;let e=K.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,U(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[N,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let $=m.useCallback(()=>{L(!0),H(Z.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},ae)},[n,d,a,Z]);m.useEffect(()=>{if(n.promise&&q===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||xe?(()=>{if(_e.current<X.current){let e=new Date().getTime()-X.current;W.current-=e}_e.current=new Date().getTime()})():W.current!==1/0&&(X.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),$()},W.current)),()=>clearTimeout(e)},[u,i,n,q,xe,$]),m.useEffect(()=>{n.delete&&($(),n.onDismiss==null||n.onDismiss.call(n,n))},[$,n.delete]);function we(){return E?.loading?m.createElement(`div`,{className:F(T?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":q===`loading`},E.loading):m.createElement(v,{className:F(T?.loader,n?.classNames?.loader),visible:q===`loading`})}let Te=n.icon||E?.[q]||g(q);return m.createElement(`li`,{tabIndex:0,ref:K,className:F(_,pe,T?.toast,n?.classNames?.toast,T?.default,T?.[q],n?.classNames?.[q]),"data-sonner-toast":``,"data-rich-colors":n.richColors??ee,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":N,"data-promise":!!n.promise,"data-swiped":ce,"data-removed":oe,"data-visible":fe,"data-y-position":ve,"data-x-position":ye,"data-index":c,"data-front":de,"data-swiping":se,"data-dismissible":J,"data-type":q,"data-invert":Se,"data-swipe-out":z,"data-swipe-direction":j,"data-expanded":!!(u||w&&N),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${oe?le:Z.current}px`,"--initial-height":w?`auto`:`${ue}px`,...p,...n.style},onDragEnd:()=>{R(!1),A(null),Q.current=null},onPointerDown:e=>{e.button!==2&&(Ce||!J||(G.current=new Date,H(Z.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(R(!0),Q.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(z||!J)return;Q.current=null;let e=Number(K.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(K.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-G.current?.getTime(),i=O===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=P||a>.11){H(Z.current),n.onDismiss==null||n.onDismiss.call(n,n),re(O===`x`?e>0?`right`:`left`:t>0?`down`:`up`),$(),B(!0);return}else{var o,s;(o=K.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=K.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}V(!1),R(!1),A(null)},onPointerMove:t=>{var n,r;if(!Q.current||!J||window.getSelection()?.toString().length>0)return;let i=t.clientY-Q.current.y,a=t.clientX-Q.current.x,o=e.swipeDirections??I(x);!O&&(Math.abs(a)>1||Math.abs(i)>1)&&A(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(O===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(O===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&V(!0),(n=K.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=K.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},he&&!n.jsx&&q!==`loading`?m.createElement(`button`,{"aria-label":D,"data-disabled":Ce,"data-close-button":!0,onClick:Ce||!J?()=>{}:()=>{$(),n.onDismiss==null||n.onDismiss.call(n,n)},className:F(T?.closeButton,n?.classNames?.closeButton)},E?.close??C):null,(q||n.icon||n.promise)&&n.icon!==null&&(E?.[q]!==null||n.icon)?m.createElement(`div`,{"data-icon":``,className:F(T?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||we():null,n.type===`loading`?null:Te):null,m.createElement(`div`,{"data-content":``,className:F(T?.content,n?.classNames?.content)},m.createElement(`div`,{"data-title":``,className:F(T?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?m.createElement(`div`,{"data-description":``,className:F(y,me,T?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),m.isValidElement(n.cancel)?n.cancel:n.cancel&&k(n.cancel)?m.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||te,onClick:e=>{k(n.cancel)&&J&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),$())},className:F(T?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,m.isValidElement(n.action)?n.action:n.action&&k(n.action)?m.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||h,onClick:e=>{k(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&$())},className:F(T?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function L(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function se(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?re:j;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var R=m.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:ee,duration:f,style:p,visibleToasts:h=A,toastOptions:g,dir:_=L(),gap:v=ie,icons:y,containerAriaLabel:b=`Notifications`}=e,[x,S]=m.useState([]),C=m.useMemo(()=>n?x.filter(e=>e.toasterId===n):x.filter(e=>!e.toasterId),[x,n]),ne=m.useMemo(()=>Array.from(new Set([i].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,i]),[w,E]=m.useState([]),[D,O]=m.useState(!1),[k,j]=m.useState(!1),[re,M]=m.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),P=m.useRef(null),ae=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),F=m.useRef(null),I=m.useRef(!1),R=m.useCallback(e=>{S(t=>(t.find(t=>t.id===e.id)?.delete||T.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return m.useEffect(()=>T.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{S(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{te.flushSync(()=>{S(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[x]),m.useEffect(()=>{if(d!==`system`){M(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?M(`dark`):M(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{M(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{M(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),m.useEffect(()=>{x.length<=1&&O(!1)},[x]),m.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;O(!0),(t=P.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===P.current||P.current?.contains(document.activeElement))&&O(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),m.useEffect(()=>{if(P.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,I.current=!1)}},[P.current]),m.createElement(`section`,{ref:t,"aria-label":`${b} ${ae}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},ne.map((t,n)=>{let[i,a]=t.split(`-`);return C.length?m.createElement(`ol`,{key:t,dir:_===`auto`?L():_,tabIndex:-1,ref:P,className:c,"data-sonner-toaster":!0,"data-sonner-theme":re,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${w[0]?.height||0}px`,"--width":`${N}px`,"--gap":`${v}px`,...p,...se(l,u)},onBlur:e=>{I.current&&!e.currentTarget.contains(e.relatedTarget)&&(I.current=!1,F.current&&=(F.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||I.current||(I.current=!0,F.current=e.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{k||O(!1)},onDragEnd:()=>O(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||j(!0)},onPointerUp:()=>j(!1)},C.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>m.createElement(oe,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:ee,duration:g?.duration??f,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:k,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:R,toasts:C.filter(e=>e.position==n.position),heights:w.filter(e=>e.position==n.position),setHeights:E,expandByDefault:o,gap:v,expanded:D,swipeDirections:e.swipeDirections}))):null}))}),z=ee(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),B=l();function ce({...e}){return(0,B.jsx)(s,{"data-slot":`dialog`,...e})}function V({...e}){return(0,B.jsx)(i,{"data-slot":`dialog-portal`,...e})}function le({className:e,...t}){return(0,B.jsx)(a,{"data-slot":`dialog-overlay`,className:d(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function H({className:e,children:t,showCloseButton:n=!0,...i}){return(0,B.jsxs)(V,{children:[(0,B.jsx)(le,{}),(0,B.jsxs)(o,{"data-slot":`dialog-content`,className:d(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-[var(--miravo-radius-stadium-sm)] bg-background p-4 text-sm ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...i,children:[t,n&&(0,B.jsxs)(r,{"data-slot":`dialog-close`,render:(0,B.jsx)(p,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,B.jsx)(f,{}),(0,B.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function ue({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`dialog-header`,className:d(`flex flex-col gap-2`,e),...t})}function U({className:e,showCloseButton:t=!1,children:n,...i}){return(0,B.jsxs)(`div`,{"data-slot":`dialog-footer`,className:d(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-[var(--miravo-radius-stadium-sm)] border-t p-4 sm:flex-row sm:justify-end`,e),...i,children:[n,t&&(0,B.jsx)(r,{render:(0,B.jsx)(p,{variant:`outline`}),children:`Close`})]})}function W({className:e,...t}){return(0,B.jsx)(n,{"data-slot":`dialog-title`,className:d(`text-base leading-none font-medium`,e),...t})}function G({className:e,...t}){return(0,B.jsx)(c,{"data-slot":`dialog-description`,className:d(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}export{ue as a,R as c,U as i,O as l,H as n,W as o,G as r,z as s,ce as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./events-40FcPI5G.js";export{e as EventsPage};
@@ -1 +0,0 @@
1
- import{t as e}from"./fleet-CcWeGysy.js";export{e as FleetPage};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{a as t,i as n,n as r,r as i,s as a,t as o}from"./vendor-charts-CAZdaPlq.js";import{at as s}from"./vendor-ui-mizMYESS.js";import{_ as c,a as l}from"./api-Bef9FEIU.js";import{a as u,n as d,r as f,t as p}from"./get-error-message-DhCjoSSJ.js";import{t as m}from"./proxy-CgM57W61.js";import{i as ee,r as te}from"./dist-jROhexoH.js";import{c as ne,l as re}from"./chunk-OE4NN4TA-m2UhO8Q2.js";import{i as h,n as g,o as _,r as v,t as y}from"./dialog-DD0yn-KA.js";import{n as b,t as x}from"./createLucideIcon-Yddw9eHa.js";import{i as S,n as C,t as w}from"./tooltip-TtanriwA.js";import{C as T,E,S as D,c as O,d as k,g as ie,l as A,m as j,n as M,p as N,t as P,u as ae,v as F,y as oe}from"./input-BCiRHEmc.js";import{r as I}from"./engine-store-BUO-9Dsh.js";import{t as se}from"./activity-DP0Us3HU.js";import{a as L,c as ce,i as le,l as ue,n as de,o as fe,r as pe,s as R,t as me}from"./tabs-Bwhx891Q.js";import{c as he,l as ge,o as _e,s as z}from"./validation-4FJlp2qx.js";import{a as ve,c as B,o as ye,t as be}from"./use-engine-command-mutation-CQc8tXfc.js";import{t as V}from"./triangle-alert-DPtblpQC.js";import{t as H}from"./badge-tnWgSITj.js";import{t as xe}from"./query-keys-Co1J4HmV.js";import{t as Se}from"./transition-types-CMW7IObN.js";import{n as Ce}from"./auth-screen-backdrop-OrOL41MR.js";var U=x(`layers-2`,[[`path`,{d:`M13 13.74a2 2 0 0 1-2 0L2.5 8.87a1 1 0 0 1 0-1.74L11 2.26a2 2 0 0 1 2 0l8.5 4.87a1 1 0 0 1 0 1.74z`,key:`15q6uc`}],[`path`,{d:`m20 14.285 1.5.845a1 1 0 0 1 0 1.74L13 21.74a2 2 0 0 1-2 0l-8.5-4.87a1 1 0 0 1 0-1.74l1.5-.845`,key:`byia6g`}]]),we=x(`signal`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}],[`path`,{d:`M12 20v-8`,key:`i3yub9`}],[`path`,{d:`M17 20V8`,key:`1tkaf5`}],[`path`,{d:`M22 4v16`,key:`sih9yq`}]]),Te=x(`timer`,[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]),W=e(a(),1),G=s(),K=`bg-transparent bg-transparent`,q=`blueprint-title text-foreground`;function Ee(e,t){return t.includes(`rpm`)||t.includes(`speed`)?`e.g. 2500`:t.includes(`temp`)?`e.g. 70.0`:t.includes(`pressure`)?`e.g. 4.5`:e===`Boolean`?`true / false`:e===`String`?`value`:`e.g. 100`}function De({detail:e,methodArgs:t,setMethodArgs:n,onInvoke:r,isPending:i=!1,pendingMethod:a=null}){let o=Object.entries(e.methods);if(o.length===0)return null;let s=o.filter(([,e])=>e.inputArguments.length===0),c=o.filter(([,e])=>e.inputArguments.length>0);return(0,G.jsxs)(`div`,{id:`commands`,className:`flex min-w-0 flex-col gap-3 p-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,G.jsx)(`h2`,{className:q,children:`Commands`}),(0,G.jsx)(`p`,{className:`text-[10px] text-muted-foreground/75`,children:`Executable methods on this asset`})]}),s.length>0&&(0,G.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:s.map(([e,t])=>{let n=a===e&&i,o=n?R:B;return t.description?(0,G.jsxs)(w,{children:[(0,G.jsx)(S,{render:(0,G.jsxs)(M,{size:`sm`,variant:`outline`,disabled:i,title:e,className:b(`h-8 gap-1.5 font-mono text-xs`,K),onClick:()=>r(e),children:[(0,G.jsx)(o,{className:b(`size-3`,n&&`animate-spin`),"aria-hidden":!0}),N(e)]})}),(0,G.jsx)(C,{side:`bottom`,className:`max-w-xs`,children:t.description})]},e):(0,G.jsxs)(M,{size:`sm`,variant:`outline`,disabled:i,title:e,className:b(`h-8 gap-1.5 font-mono text-xs`,K),onClick:()=>r(e),children:[(0,G.jsx)(o,{className:b(`size-3`,n&&`animate-spin`),"aria-hidden":!0}),N(e)]},e)})}),c.length>0&&s.length>0&&(0,G.jsx)(z,{className:`bg-border/60`}),c.map(([e,o])=>{let s=a===e&&i;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{title:e,className:`font-mono text-sm font-medium`,children:N(e)}),o.description&&(0,G.jsx)(`p`,{className:`mt-0.5 text-[10px] text-muted-foreground`,children:o.description})]}),(0,G.jsxs)(M,{size:`sm`,variant:`default`,disabled:i,className:`shrink-0`,onClick:()=>r(e),children:[s?(0,G.jsx)(R,{className:`mr-1 size-3 animate-spin`,"aria-hidden":!0}):(0,G.jsx)(B,{className:`mr-1 size-3`,"aria-hidden":!0}),`Execute`]})]}),(0,G.jsx)(`div`,{className:`mt-3 flex flex-col gap-1.5 border-t border-border/50 pt-3`,children:o.inputArguments.map(r=>(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(`span`,{title:r.name,className:`w-28 shrink-0 truncate pt-1.5 font-mono text-[10px] leading-tight text-muted-foreground`,children:N(r.name)}),(0,G.jsx)(P,{className:`h-7 flex-1 font-mono text-xs`,placeholder:Ee(r.dataType,r.name),value:t[e]?.[r.name]??``,onChange:t=>n(n=>({...n,[e]:{...n[e],[r.name]:t.target.value}}))})]},r.name))})]},e)})]})}function Oe({activeFaults:e,availableFaults:t,onTriggerFault:n,onClearFault:r}){let i=e.length>0,[a,o]=(0,W.useState)(null);return(0,G.jsxs)(`div`,{id:`faults`,className:`flex min-w-0 flex-col gap-3 p-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,G.jsx)(`h2`,{className:q,children:`Alarms`}),(0,G.jsx)(`p`,{className:`text-[10px] text-muted-foreground/75`,children:`Active faults and injectable failure modes (environment)`})]}),i?(0,G.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map(e=>(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-[var(--miravo-radius-tight)] border border-destructive/30 bg-transparent py-2.5 pl-3 pr-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(V,{className:`size-4 shrink-0 text-destructive`}),(0,G.jsx)(`span`,{title:e,className:`font-mono text-sm font-medium text-destructive`,children:N(e)})]}),(0,G.jsxs)(M,{size:`sm`,variant:`outline`,className:b(`h-8 shrink-0 gap-1 border-destructive/30 px-2.5 font-mono text-[0.75rem] text-destructive shadow-none`,`hover:border-destructive/45 hover:bg-destructive/5 hover:text-destructive`,`focus-visible:border-destructive/40 focus-visible:ring-destructive/20`,K),onClick:()=>r(e),children:[(0,G.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),`Clear`]})]},e))}):(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,G.jsx)(ue,{className:`size-4 text-success`}),`All clear — no active faults`]}),t.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(z,{className:`bg-border/60`}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`p`,{className:b(q,`mb-2`),children:[`Inject fault`,(0,G.jsxs)(H,{variant:`secondary`,className:`ml-2 text-[10px]`,children:[t.filter(t=>!e.includes(t)).length,` available`]})]}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:t.filter(t=>!e.includes(t)).map(e=>(0,G.jsx)(M,{size:`sm`,variant:`outline`,title:e,className:b(`h-7 font-mono text-[10px]`,K),onClick:()=>o(e),children:N(e)},e))})]})]}),(0,G.jsx)(y,{open:a!==null,onOpenChange:e=>{e||o(null)},children:(0,G.jsxs)(g,{children:[(0,G.jsx)(_,{className:`font-heading text-lg font-semibold tracking-tight`,children:`Inject fault?`}),(0,G.jsxs)(v,{className:`text-sm text-muted-foreground`,children:[`This asserts`,` `,(0,G.jsx)(`span`,{title:a??void 0,className:`font-mono text-foreground`,children:a?N(a):``}),` `,`on the running environment. Downstream consumers will see the fault immediately. Clear it from the active list when you're done.`]}),(0,G.jsxs)(h,{children:[(0,G.jsx)(M,{variant:`outline`,onClick:()=>o(null),children:`Cancel`}),(0,G.jsxs)(M,{variant:`destructive`,onClick:()=>{a&&n(a),o(null)},children:[(0,G.jsx)(V,{className:`mr-1 size-3.5`,"aria-hidden":!0}),`Inject fault`]})]})]})})]})}function ke({detail:e,tick:t,activeFaults:n,memberValues:r,onBack:i}){let a=n.length,o=e.isQuarantined,s=`OK`,c=`ok`;a>0?(s=`FAULT`,c=`bad`):o&&(s=`QRTN`,c=`warn`);let l=0;if(r)for(let e of r.values())e.quality!==`good`&&l++;let u=Object.keys(e.members).length,d=r?.get(`availability_state`)?.value,f=e.members.availability_state?.value,p=typeof d==`string`?d:typeof f==`string`?f:`unknown`,m=p===`running`?{dot:`bg-success`,pulse:`bg-success/60`,animate:!0}:p===`faulted`?{dot:`bg-destructive`,pulse:`bg-destructive/60`,animate:!0}:p===`stopped`?{dot:`bg-warning`,pulse:`bg-warning/60`,animate:!0}:{dot:`bg-muted-foreground/60`,pulse:`bg-muted-foreground/50`,animate:!1},ee=p===`running`?`Availability state is running — the asset is available and in service.`:p===`faulted`?`Availability state is faulted — the asset is unavailable because a fault is active.`:p===`stopped`?`Availability state is stopped — the asset is available but not running.`:`Availability state is not available for this asset yet.`;return(0,G.jsxs)(`header`,{className:b(ye,`flex w-full min-w-0 flex-col`),children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 px-5 py-4 sm:flex-row sm:items-start sm:justify-between sm:gap-4`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:i,className:`transition-colors hover:text-foreground`,children:`Fleet`}),(0,G.jsx)(`span`,{"aria-hidden":!0,children:`/`}),(0,G.jsx)(`span`,{className:`truncate`,children:ie(e.assetType)})]}),(0,G.jsx)(W.ViewTransition,{name:`instance-${e.id}`,default:`none`,children:(0,G.jsx)(`h1`,{className:`font-heading mt-1 text-2xl font-semibold uppercase leading-tight tracking-wide`,children:j(e.id)})}),(0,G.jsxs)(`div`,{className:`mt-1.5 flex min-w-0 items-center gap-1.5`,children:[(0,G.jsx)(`p`,{className:`m-0 min-w-0 flex-1 font-mono text-[10px] leading-tight tracking-tight text-muted-foreground`,children:(0,G.jsx)(`span`,{className:`break-all`,children:e.browsePath.join(` / `)})}),(0,G.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,G.jsx)(L,{value:k(e.browsePath),label:`Copy Topic / UNS path`})})]})]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 self-end font-mono text-xs sm:self-start`,children:[(0,G.jsx)(fe,{className:`size-3.5 animate-pulse text-primary`,"aria-hidden":!0}),(0,G.jsx)(`span`,{className:`font-medium text-primary`,children:`LIVE`}),(0,G.jsxs)(`span`,{className:`tabular-nums text-muted-foreground`,children:[`t=`,t]}),(0,G.jsxs)(w,{children:[(0,G.jsx)(S,{render:(0,G.jsx)(`span`,{className:`inline-flex size-3.5 items-center justify-center outline-none focus-visible:ring-2 focus-visible:ring-ring`}),children:(0,G.jsxs)(`span`,{"aria-hidden":!0,className:`relative flex size-1.5 shrink-0 items-center justify-center`,children:[(0,G.jsx)(`span`,{className:b(`relative inline-flex size-1.5 rounded-full`,m.dot)}),m.animate&&(0,G.jsx)(`span`,{className:b(`absolute inline-flex size-2.5 animate-ping rounded-full opacity-75`,m.pulse)})]})}),(0,G.jsx)(C,{side:`top`,align:`end`,children:(0,G.jsxs)(`span`,{className:`block max-w-[16rem] text-[11px] leading-snug`,children:[(0,G.jsx)(`span`,{className:`font-medium uppercase tracking-[0.08em]`,children:`Availability`}),` `,(0,G.jsxs)(`span`,{className:`text-muted-foreground`,children:[`— `,ee]})]})})]})]})]}),(0,G.jsxs)(`fieldset`,{"aria-label":`Instance status`,className:`m-0 flex flex-col border-0 border-t border-border/50 p-0`,children:[(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-px bg-transparent`,children:[(0,G.jsx)(J,{variant:`primary`,icon:se,label:`Health`,value:s,tone:c,tooltip:`Rolls up active faults and quarantine into a single status — OK when nothing is asserted, FAULT when any fault is active, QRTN when the asset is excluded from the running fleet.`}),(0,G.jsx)(J,{variant:`primary`,icon:V,label:`Active faults`,labelCompact:`Faults`,value:String(a),tone:a>0?`bad`:`neutral`,tooltip:`Fault codes currently asserted on this asset. Clear or inject faults from the Alarms section below.`})]}),(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-px border-t border-border/50 bg-transparent sm:grid-cols-4`,children:[(0,G.jsx)(J,{variant:`compact`,icon:U,label:`Lifecycle`,labelCompact:`Life`,value:N(e.lifecycleStage),tone:E(e.lifecycleStage),tooltip:`Where this asset sits in its operational lifecycle (e.g. commissioning, operating, maintenance, retired).`}),(0,G.jsx)(J,{variant:`compact`,icon:ge,label:`Tags`,value:String(u),tone:`neutral`,tooltip:`Total members exposed by this asset — process variables, state flags, counters, commands, and reference fields combined.`}),(0,G.jsx)(J,{variant:`compact`,icon:we,label:`Bad quality`,value:String(l),tone:l>0?`warn`:`neutral`,tooltip:`Members whose quality stamp is anything other than good (uncertain or bad). A healthy asset reads 0.`}),(0,G.jsx)(J,{variant:`compact`,icon:Te,label:`Operating age`,value:oe(e.operatingHours),tone:`neutral`,tooltip:`Total operating age on this asset, including any environment-seeded starting hours plus simulated runtime elapsed in this session.`})]})]})]})}function J({icon:e,label:t,labelCompact:n,value:r,suffix:i,tone:a,variant:o=`compact`,tooltip:s}){let c=o===`primary`;return(0,G.jsxs)(`div`,{className:b(`relative flex min-w-0 flex-col justify-center`,c?`min-h-20 gap-1.5 px-4 py-4 sm:min-h-24 sm:px-6 sm:py-5 lg:min-h-28 lg:px-8`:`min-h-12 gap-1 px-3 py-2.5 sm:min-h-13 sm:px-4 lg:min-h-14 lg:px-5`),children:[(0,G.jsx)(`div`,{className:`flex min-h-0 min-w-0 items-center gap-2`,children:(0,G.jsxs)(w,{children:[(0,G.jsxs)(S,{className:`flex min-h-0 min-w-0 flex-1 cursor-default items-center gap-2 text-left`,render:(0,G.jsx)(`div`,{}),children:[(0,G.jsx)(e,{className:b(`shrink-0 text-muted-foreground`,c?`size-4`:`size-3.5`),"aria-hidden":!0}),(0,G.jsxs)(`span`,{className:b(`min-w-0 flex-1 font-medium tracking-wide text-muted-foreground uppercase 2xl:tracking-wider`,c?`text-[11px] leading-snug sm:text-[12px]`:`text-[9px] leading-snug sm:text-[10px]`),children:[(0,G.jsx)(`span`,{className:`block wrap-break-word 2xl:hidden`,children:n??t}),(0,G.jsx)(`span`,{className:`hidden wrap-break-word 2xl:block`,children:t})]})]}),(0,G.jsx)(C,{side:`top`,align:`start`,sideOffset:6,className:`max-w-xs`,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`span`,{className:`font-medium text-foreground`,children:t}),(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:s??t})]})})]})}),(0,G.jsxs)(`p`,{className:b(`min-w-0 wrap-break-word font-mono font-semibold leading-tight tracking-tight tabular-nums`,c?`text-2xl sm:text-3xl lg:text-4xl`:`text-base lg:text-lg`,a===`ok`&&`text-success`,a===`warn`&&`text-warning`,a===`bad`&&`text-destructive`,a===`neutral`&&`text-foreground`),children:[r,i?(0,G.jsx)(`span`,{className:b(`ml-0.5 font-medium text-muted-foreground`,c?`text-base lg:text-lg`:`text-xs lg:text-sm`),children:i}):null]})]})}function Y({title:e,subtitle:t,children:n,className:r,id:i}){return(0,G.jsxs)(`section`,{id:i,className:b(ve,r),children:[(0,G.jsxs)(`div`,{className:`border-b border-border/60 px-4 py-3`,children:[(0,G.jsx)(`h2`,{className:`blueprint-title text-foreground`,children:e}),t?(0,G.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:t}):null]}),(0,G.jsx)(`div`,{className:`overflow-hidden p-0`,children:n})]})}function X({className:e,counters:t,memberValues:n}){return(0,G.jsx)(Y,{title:`Counters`,subtitle:`Totals, hours, and accumulators`,className:e,children:(0,G.jsx)(`div`,{className:`flex flex-col gap-2 p-4`,children:t.map(([e,t])=>{let r=n?.get(e),i=r?r.value:t.value;return(0,G.jsxs)(`div`,{className:`flex items-center justify-between rounded-[var(--miravo-radius-tight)] border border-border/60 bg-transparent px-3 py-2`,children:[(0,G.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:D(e)}),(0,G.jsxs)(`span`,{className:`blueprint-stat text-sm font-medium`,children:[typeof i==`number`?F(i):String(i),t.meta.unit&&(0,G.jsx)(`span`,{className:`ml-1 text-[10px] text-muted-foreground`,children:T(t.meta.unit)})]})]},e)})})})}function Z({className:e,detail:t,referenceMembers:n,memberValues:r}){let i=Object.keys(t.parameters).length>0,a=n.length>0;return!i&&!a?null:(0,G.jsx)(Y,{title:`Nameplate & configuration`,subtitle:`Design parameters, identity, and reference values`,className:e,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[i&&(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-3`,children:Object.entries(t.parameters).map(([e,t])=>(0,G.jsxs)(`div`,{className:`flex flex-col gap-0.5 py-1.5`,children:[(0,G.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:D(e)}),(0,G.jsxs)(`span`,{className:`font-mono text-sm font-medium`,children:[typeof t.value==`number`?F(t.value):String(t.value),t.unit&&(0,G.jsx)(`span`,{className:`ml-1 text-[10px] text-muted-foreground`,children:T(t.unit)})]})]},e))}),a&&(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-3`,children:n.map(([e,t])=>{let n=r?.get(e),i=n?n.value:t.value;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-0.5 rounded-[var(--miravo-radius-tight)] border border-border/60 bg-transparent p-2`,children:[(0,G.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:D(e)}),(0,G.jsxs)(`span`,{className:`font-mono text-sm font-medium`,children:[typeof i==`number`?F(i):String(i),t.meta.unit&&(0,G.jsx)(`span`,{className:`ml-1 text-[10px] text-muted-foreground`,children:T(t.meta.unit)})]})]},e)})})]})})}var Ae=new Set([`pu`,`h`]),je=[`_reference`,`_baseline`,`_setpoint`,`_command`],Q=`var(--color-primary)`,Me=`var(--color-background)`;function Ne(e){return Object.entries(e.members).filter(([e,t])=>t.meta.kind===`variable`&&t.meta.access===`read`&&t.meta.dataType===`Double`&&t.meta.euRange!==null&&!Ae.has(t.meta.unit??``)&&!je.some(t=>e.endsWith(t)))}function $(e){if(e.length<3)return!1;let t=e[0]?.value??0;return e.some(e=>Math.abs(e.value-t)>.001)}function Pe({data:e,chartHeight:a=34}){let s=(0,W.useId)(),[c,l]=(0,W.useState)(null),u=e.map(e=>e.value),d=Math.min(...u),f=Math.max(...u);return(0,G.jsxs)(`div`,{className:`flex min-h-0 w-full flex-col overflow-hidden`,style:{height:a+14},children:[(0,G.jsx)(`div`,{style:{height:a,width:`100%`},children:(0,G.jsx)(n,{width:`100%`,height:a,children:(0,G.jsxs)(o,{data:e,margin:{top:2,right:2,bottom:2,left:0},onMouseMove:e=>{let t=e?.activePayload?.[0]?.value;typeof t==`number`&&l(t)},onMouseLeave:()=>l(null),children:[(0,G.jsx)(`defs`,{children:(0,G.jsxs)(`linearGradient`,{id:s,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,G.jsx)(`stop`,{offset:`0%`,stopColor:Q,stopOpacity:.3}),(0,G.jsx)(`stop`,{offset:`100%`,stopColor:Q,stopOpacity:0})]})}),(0,G.jsx)(r,{domain:[`auto`,`auto`],hide:!0}),(0,G.jsx)(t,{content:()=>null,cursor:!1}),(0,G.jsx)(i,{type:`monotone`,dataKey:`value`,stroke:Q,strokeWidth:1.5,fill:`url(#${s})`,isAnimationActive:!1,dot:!1,activeDot:{r:3,fill:Q,stroke:Me,strokeWidth:1}})]})})}),(0,G.jsx)(`span`,{className:`text-[10px] leading-none tabular-nums text-muted-foreground`,children:c===null?(0,G.jsxs)(G.Fragment,{children:[F(d),`–`,F(f)]}):(0,G.jsx)(`span`,{className:`font-medium text-primary`,children:F(c)})})]})}function Fe({detail:e,processVariables:t,memberValues:n,historyRef:r,showQuality:i}){let a=(0,W.useMemo)(()=>[...t].sort(([e],[t])=>{let n=r.current.get(e)??[],i=r.current.get(t)??[],a=n.length>2&&$(n);return a===(i.length>2&&$(i))?0:a?-1:1}),[t,n,r]);return t.length===0?(0,G.jsx)(Y,{title:`Process`,subtitle:`No continuous analog readings defined for this asset`,className:`opacity-90`,children:(0,G.jsx)(`p`,{className:`px-4 py-6 text-center text-sm text-muted-foreground`,children:`This asset exposes no continuous process variables. Discrete states, flags, and commands are available in the Tags section below.`})}):(0,G.jsx)(Y,{title:`Process`,subtitle:`Live tag readings — trend is ~2 min at 1 Hz`,children:(0,G.jsx)(`ul`,{className:`divide-y divide-border/40`,children:a.map(([t,a])=>{let o=n?.get(t),s=o?o.value:a.value,c=o?o.quality:a.quality,l=r.current.get(t)??[],u=ae(e.browsePath,t),d=l.length>2&&$(l),f=T(a.meta.unit),p=D(t);return(0,G.jsxs)(m.li,{layout:!0,transition:{duration:.32,ease:[.22,1,.36,1]},className:`flex flex-col gap-2.5 bg-background px-4 py-3 sm:flex-row sm:items-center sm:gap-5 sm:py-3.5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 sm:w-44 sm:shrink-0`,children:[(0,G.jsxs)(w,{children:[(0,G.jsx)(S,{className:`min-w-0 flex-1 cursor-default truncate text-left text-[11px] font-medium uppercase tracking-[var(--miravo-tracking-eyebrow)] text-muted-foreground`,render:(0,G.jsx)(`span`,{}),children:p}),(0,G.jsx)(C,{side:`top`,align:`start`,className:`max-w-xs`,children:p})]}),(0,G.jsx)(L,{value:u,label:`Copy Topic / UNS path`})]}),(0,G.jsxs)(`div`,{className:`relative h-[56px] min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{"aria-hidden":!0,className:`absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-border/30`}),d?(0,G.jsx)(Pe,{data:l,chartHeight:42}):(0,G.jsx)(`p`,{className:`flex h-full items-center text-[10px] uppercase tracking-widest text-muted-foreground`,children:l.length<=2?`Collecting trend…`:`No change (last 2 min)`})]}),(0,G.jsxs)(`div`,{className:`flex items-baseline gap-2 sm:min-w-36 sm:shrink-0 sm:justify-end`,children:[(0,G.jsx)(`span`,{className:`blueprint-stat text-2xl font-semibold leading-none tabular-nums text-foreground`,children:typeof s==`number`?F(s):String(s)}),f&&(0,G.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:f}),i&&c!==`good`&&(0,G.jsx)(H,{variant:c===`uncertain`?`secondary`:`destructive`,className:`shrink-0 text-[10px]`,children:c})]})]},t)})})})}function Ie({name:e,value:t,dataType:n,unit:r,access:i}){let a=D(e),o=i===`readwrite`;if(n===`Boolean`||typeof t==`boolean`||r===`pu`&&(t===0||t===1)){let n=t===!0||t===`true`||t===1,r=e.includes(`fault`);return(0,G.jsxs)(`div`,{className:`flex min-h-9 min-w-0 items-center justify-between gap-2 rounded-[var(--miravo-radius-tight)] border px-2 py-1 ${r&&n?`border-destructive/30 bg-transparent`:``}`,children:[(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-left text-[10px] leading-snug text-muted-foreground`,children:[a,o&&(0,G.jsx)(`span`,{className:`ml-1 text-[8px] text-primary`,children:`CMD`})]}),(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-xs font-medium tabular-nums ${r&&n?`text-destructive`:n?`text-success`:`text-muted-foreground`}`,children:n?`ON`:`OFF`})]})}if(n===`String`){let n=String(t),r=n===`none`||n===``,i=O.has(n)||e.includes(`fault_code`)&&!r,o=!i&&A.has(n);return(0,G.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-col justify-center gap-1 rounded-[var(--miravo-radius-tight)] border px-2 py-2 ${i?`border-destructive/30 bg-transparent`:o?`border-warning/30 bg-warning/5`:``}`,children:[(0,G.jsx)(`span`,{className:`wrap-break-word text-[10px] leading-tight text-muted-foreground`,children:a}),r?(0,G.jsx)(`span`,{className:`wrap-break-word font-mono text-sm font-medium leading-snug text-muted-foreground`,children:`—`}):(0,G.jsx)(`span`,{title:n,className:`wrap-break-word font-mono text-sm font-medium leading-snug ${i?`text-destructive`:o?`text-warning`:`text-foreground`}`,children:N(n)})]})}return(0,G.jsxs)(`div`,{className:`flex min-h-9 min-w-0 items-center justify-between gap-2 rounded-[var(--miravo-radius-tight)] border px-2 py-1`,children:[(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-left text-[10px] leading-snug text-muted-foreground`,children:[a,o&&(0,G.jsx)(`span`,{className:`ml-1 text-[8px] text-primary`,children:`CMD`})]}),(0,G.jsxs)(`span`,{className:`shrink-0 text-right font-mono text-xs font-medium tabular-nums`,children:[typeof t==`number`?F(t):String(t),r&&(0,G.jsx)(`span`,{className:`ml-1 text-[10px] text-muted-foreground`,children:T(r)})]})]})}function Le(e){return[...e].sort((e,t)=>{let n=e[1].meta.access===`readwrite`;return n===(t[1].meta.access===`readwrite`)?e[0].localeCompare(t[0]):n?-1:1})}function Re({stringEnumMembers:e,nonStringOperationalMembers:t,memberValues:n,className:r}){let i=(0,W.useMemo)(()=>Le(e),[e]),a=(0,W.useMemo)(()=>Le(t),[t]),o=`grid min-w-0 gap-2 [grid-template-columns:repeat(auto-fill,minmax(min(100%,12.5rem),1fr))]`;return(0,G.jsx)(Y,{title:`Tags`,subtitle:`Mode, status flags, and control tags`,className:r,children:(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-5 p-4`,children:[i.length>0&&(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[a.length>0&&(0,G.jsx)(`h3`,{className:`blueprint-title text-muted-foreground`,children:`States`}),(0,G.jsx)(`div`,{className:o,children:i.map(([e,t])=>{let r=n?.get(e);return(0,G.jsx)(Ie,{name:e,value:r?r.value:t.value,dataType:t.meta.dataType,unit:t.meta.unit,access:t.meta.access},e)})})]}),a.length>0&&(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[i.length>0&&(0,G.jsx)(`h3`,{className:`blueprint-title text-muted-foreground`,children:`Flags & commands`}),(0,G.jsx)(`div`,{className:o,children:a.map(([e,t])=>{let r=n?.get(e);return(0,G.jsx)(Ie,{name:e,value:r?r.value:t.value,dataType:t.meta.dataType,unit:t.meta.unit,access:t.meta.access},e)})})]})]})})}var ze=120,Be=`gap-4 sm:gap-5 lg:gap-x-6 lg:gap-y-5 xl:gap-x-8`,Ve=`instance-detail-page relative isolate mx-auto flex min-h-full w-full max-w-screen-2xl flex-col gap-6 p-4 sm:gap-8 sm:p-6`;function He(e){return e instanceof Error&&`code`in e&&e.code===`NOT_FOUND`?!0:e instanceof Error&&/^404\b/.test(e.message.trim())}function Ue(){let{id:e}=re(),t=ne(),n=(0,W.useCallback)(()=>{(0,W.startTransition)(()=>{(0,W.addTransitionType)(Se),t(`/`)})},[t]),[r,i]=(0,W.useState)({}),[a,o]=(0,W.useState)(null),[s,h]=(0,W.useState)(!1),[g,_]=ee(`tab`,te([`hmi`,`operate`,`data`,`operations`]).withDefault(`hmi`)),v=g===`data`||g===`operations`?`operate`:g,y=be();(0,W.useEffect)(()=>{y.isPending||o(null)},[y.isPending]),(0,W.useEffect)(()=>{(g===`data`||g===`operations`)&&_(`operate`)},[g,_]);let x=(0,W.useCallback)(e=>{_(`operate`),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.getElementById(e)?.scrollIntoView({behavior:`smooth`,block:`start`})})})},[_]);(0,W.useEffect)(()=>{let e=null,t=!1,r=()=>{t=!1,e&&=(clearTimeout(e),null)},i=i=>{if(i.metaKey||i.ctrlKey||i.altKey)return;let a=i.target;if(a){let e=a.tagName;if(e===`INPUT`||e===`TEXTAREA`||e===`SELECT`||a.isContentEditable)return}if(t){i.key===`f`?(x(`faults`),i.preventDefault()):i.key===`c`&&(x(`commands`),i.preventDefault()),r();return}if(i.key===`g`){t=!0,e=setTimeout(r,1200);return}i.key===`b`&&!i.shiftKey?(n(),i.preventDefault()):i.key===`?`&&(h(!0),i.preventDefault())};return window.addEventListener(`keydown`,i),()=>{window.removeEventListener(`keydown`,i),r()}},[n,x]);let S=u({queryKey:xe.instances.detail(e??``),queryFn:()=>l(`/instances/${e}`,c.instanceDetail),enabled:e!==void 0}),C=(0,W.useDeferredValue)(S.data??null),w=S.isError,T=I(e=>e.memberValues),E=(0,W.useMemo)(()=>e?T.get(e):void 0,[T,e]),D=I(e=>e.models),O=I(e=>e.instances),k=(0,W.useMemo)(()=>O.find(t=>t.id===e),[O,e]),ie=(0,W.useMemo)(()=>k?.activeFaults??[],[k]),A=(0,W.useRef)(new Map),j=I(e=>e.tick);(0,W.useEffect)(()=>{if(!E||!e)return;let t=A.current;for(let[e,n]of E){if(typeof n.value!=`number`)continue;let r=t.get(e);r||(r=[],t.set(e,r)),(r.length===0||r[r.length-1]?.tick!==j)&&(r.push({value:n.value,tick:j}),r.length>ze&&r.shift())}},[E,j,e]);let N=(0,W.useMemo)(()=>C?Ne(C):[],[C]),P=(0,W.useMemo)(()=>{if(!C)return{operational:[],counters:[],reference:[]};let e=new Set(N.map(([e])=>e)),t=Object.entries(C.members).filter(([t])=>!e.has(t)),n=[],r=[],i=[];for(let e of t){let[,t]=e,a=t.meta.dataType,o=t.meta.kind,s=t.meta.unit,c=s===`pu`&&t.meta.euRange?.[0]===0&&t.meta.euRange?.[1]===1;o===`property`?i.push(e):a===`Boolean`||a===`String`||c?n.push(e):s===`count`||a===`UInt16`||a===`UInt32`?r.push(e):t.meta.access===`readwrite`||je.some(t=>e[0].endsWith(t))?n.push(e):s===`pu`||s===`h`?r.push(e):i.push(e)}return{operational:n,counters:r,reference:i}},[C,N]),ae=(0,W.useMemo)(()=>C?D.find(e=>e.name===C.assetType)?.faultNames??[]:[],[C,D]),F=ie??C?.activeFaults??[],oe=(0,W.useMemo)(()=>{if(!E)return F.length>0;for(let[,e]of E)if(e.quality!==`good`)return!0;return!1},[E,F.length]),se=(0,W.useMemo)(()=>P.operational.filter(([,e])=>e.meta.dataType===`String`),[P.operational]),L=(0,W.useMemo)(()=>P.operational.filter(([,e])=>e.meta.dataType!==`String`),[P.operational]),ce=t=>{if(!e)return;let n={},i=C?.methods[t];if(i)for(let e of i.inputArguments){let i=r[t]?.[e.name]??``,a=_e(e.name,i,e.dataType);if(!a)return;n[e.name]=a.value}o(t),y.mutateAsync({type:`invokeMethod`,instanceId:e,method:t,arguments:n}).then(async()=>{await S.refetch()}).catch(()=>{})},ue=t=>{e&&y.mutate({type:`triggerFault`,instanceId:e,fault:t})},fe=t=>{e&&y.mutate({type:`clearFault`,instanceId:e,fault:t})};if(!C)return w?He(S.error)?(0,G.jsx)(Ce,{className:`min-h-full`,children:(0,G.jsx)(`div`,{className:`flex min-h-[40vh] items-center justify-center p-6 sm:p-12`,children:(0,G.jsx)(`div`,{className:`w-full max-w-md`,children:(0,G.jsxs)(f,{eyebrow:`Instance lookup`,stamp:`404`,title:`Instance not found`,detail:e??`Unknown instance id`,detailLabel:`Requested instance`,primaryLabel:`Back to Fleet`,onPrimary:n,children:[(0,G.jsx)(`p`,{children:`The requested asset is no longer in the running fleet or the URL is wrong.`}),(0,G.jsx)(`p`,{children:`Return to Fleet and pick a live instance from the current environment.`})]})})})}):(0,G.jsx)(Ce,{className:`min-h-full`,children:(0,G.jsxs)(`div`,{className:`flex min-h-[40vh] flex-col items-center justify-center gap-4 p-6 sm:p-12`,children:[(0,G.jsx)(`div`,{className:`w-full max-w-md`,children:(0,G.jsx)(d,{message:p(S.error,`Could not load instance.`),onRetry:()=>void S.refetch(),isRetrying:S.isFetching})}),(0,G.jsx)(M,{variant:`outline`,size:`sm`,onClick:n,children:`Back to Fleet`})]})}):k?(0,G.jsx)(`div`,{className:Ve,children:(0,G.jsx)(ke,{detail:{id:k.id,assetType:k.model,browsePath:k.browsePath,lifecycleStage:k.lifecycleStage,operatingHours:k.operatingHours,activeFaults:k.activeFaults,isQuarantined:k.isQuarantined,parameters:{},members:{},methods:{}},tick:j,activeFaults:F,memberValues:E,onBack:n})}):null;let R=P.operational.length>0,z=P.counters.length>0,B=P.reference.length>0||Object.keys(C.parameters).length>0,ye=R||z||B,V=Object.keys(C.methods).length>0,H=R&&!z&&!B,U=R&&z&&B;return(0,G.jsxs)(`div`,{className:Ve,children:[(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 -z-10 hidden select-none overflow-hidden md:block`,children:(0,G.jsx)(`span`,{className:`absolute -top-2 left-0 whitespace-nowrap uppercase leading-none opacity-35 blur-[2px]`,style:{fontFamily:`var(--miravo-font-heading)`,fontSize:`clamp(5rem, 14vw, 12rem)`,fontWeight:`var(--miravo-weight-medium)`,letterSpacing:`var(--miravo-tracking-heading)`,color:`var(--miravo-ghost)`},children:C.assetType.replace(/_/g,` `)})}),(0,G.jsx)(ke,{detail:C,tick:j,activeFaults:F,memberValues:E,onBack:n}),(0,G.jsx)(W.ViewTransition,{enter:`fade-in`,default:`none`,children:(0,G.jsxs)(me,{value:v,onValueChange:e=>{_(e)},className:`min-h-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`shrink-0 overflow-x-auto`,children:(0,G.jsxs)(pe,{variant:`line`,className:`h-10! min-w-max gap-0.5`,children:[(0,G.jsxs)(le,{value:`hmi`,className:`gap-1.5 px-3 text-sm`,children:[(0,G.jsx)(ge,{className:`size-3.5 shrink-0`}),`HMI`]}),(0,G.jsxs)(le,{value:`operate`,className:`gap-1.5 px-3 text-sm`,children:[(0,G.jsx)(he,{className:`size-3.5 shrink-0`}),`Operate`]})]})}),(0,G.jsx)(de,{value:`hmi`,className:`flex-1 py-2`,children:(0,G.jsx)(m.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:`easeOut`},children:(0,G.jsx)(Fe,{detail:C,processVariables:N,memberValues:E,historyRef:A,showQuality:oe})},`hmi`)}),(0,G.jsx)(de,{value:`operate`,className:`flex-1 py-2`,children:(0,G.jsxs)(m.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:`easeOut`},className:`flex min-w-0 flex-col gap-4`,children:[ye&&(0,G.jsxs)(`section`,{"aria-label":`Data`,className:b(`grid min-w-0 grid-cols-1`,Be,U&&`lg:grid-cols-2 lg:grid-rows-[auto_auto] lg:items-start`,!U&&R&&(z||B)&&`lg:grid-cols-2 lg:items-start`),children:[R&&(0,G.jsx)(Re,{stringEnumMembers:se,nonStringOperationalMembers:L,memberValues:E,className:b(`min-h-0 min-w-0 self-stretch`,H&&`lg:col-span-2`,U&&`lg:row-span-2`)}),!R&&z&&B&&(0,G.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-col gap-6 lg:col-span-2`,children:[(0,G.jsx)(X,{counters:P.counters,memberValues:E}),(0,G.jsx)(Z,{detail:C,referenceMembers:P.reference,memberValues:E})]}),!R&&z&&!B&&(0,G.jsx)(X,{className:`lg:col-span-2`,counters:P.counters,memberValues:E}),!R&&!z&&B&&(0,G.jsx)(Z,{className:`lg:col-span-2`,detail:C,referenceMembers:P.reference,memberValues:E}),R&&z&&(0,G.jsx)(X,{className:`min-h-0 min-w-0 self-stretch lg:col-start-2 lg:row-start-1`,counters:P.counters,memberValues:E}),R&&B&&(0,G.jsx)(Z,{className:b(`min-h-0 min-w-0 self-stretch lg:col-start-2`,U?`lg:row-start-2`:`lg:row-start-1`),detail:C,referenceMembers:P.reference,memberValues:E})]}),(0,G.jsxs)(`section`,{"aria-label":`Operations`,className:b(ve,`grid grid-cols-1`,V&&`lg:grid-cols-2`),children:[(0,G.jsx)(Oe,{activeFaults:F,availableFaults:ae,onTriggerFault:ue,onClearFault:fe}),V&&(0,G.jsx)(`div`,{className:`border-t border-border/50 lg:border-l lg:border-t-0`,children:(0,G.jsx)(De,{detail:C,methodArgs:r,setMethodArgs:i,onInvoke:ce,isPending:y.isPending,pendingMethod:a})})]})]},`operate`)})]})}),(0,G.jsx)(We,{open:s,onOpenChange:h})]})}function We({open:e,onOpenChange:t}){return(0,G.jsx)(y,{open:e,onOpenChange:t,children:(0,G.jsxs)(g,{children:[(0,G.jsx)(_,{className:`font-heading text-lg font-semibold tracking-tight`,children:`Keyboard shortcuts`}),(0,G.jsx)(v,{className:`text-sm text-muted-foreground`,children:`Navigate this instance without leaving the keyboard.`}),(0,G.jsx)(`ul`,{className:`flex flex-col gap-2 pt-1`,children:[{keys:[`g`,`f`],label:`Jump to Alarms`},{keys:[`g`,`c`],label:`Jump to Commands`},{keys:[`b`],label:`Back to Fleet`},{keys:[`?`],label:`Show this sheet`}].map(e=>(0,G.jsxs)(`li`,{className:`flex items-center justify-between gap-4`,children:[(0,G.jsx)(`span`,{className:`text-sm text-foreground`,children:e.label}),(0,G.jsx)(`span`,{className:`flex items-center gap-1`,children:e.keys.map((t,n)=>(0,G.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`kbd`,{className:`rounded-[var(--miravo-radius-tight)] border border-border bg-muted/40 px-1.5 py-0.5 font-mono text-[11px] font-medium text-foreground`,children:t}),n<e.keys.length-1&&(0,G.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`then`})]},`${e.label}-${t}`))})]},e.label))})]})})}export{Ue as InstanceDetailPage};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";import{at as n}from"./vendor-ui-mizMYESS.js";import{_ as r,a as i}from"./api-Bef9FEIU.js";import{a,n as o,t as s}from"./get-error-message-DhCjoSSJ.js";import{t as c}from"./proxy-CgM57W61.js";import{t as l}from"./AnimatePresence-CVhkybDC.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./dialog-DD0yn-KA.js";import{n as g,t as _}from"./createLucideIcon-Yddw9eHa.js";import{S as v,g as y,h as b,n as x,p as S,t as C}from"./input-BCiRHEmc.js";import{t as w}from"./activity-DP0Us3HU.js";import{C as T,n as E,t as D,w as O}from"./use-platform-stream-7982hIDJ.js";import{l as k}from"./select-4wihIkEE.js";import{i as A,n as j,r as M,t as N}from"./tabs-Bwhx891Q.js";import{n as ee}from"./checkbox-Xly18Uyz.js";import{a as P,c as F,i as I,l as L,n as R,o as z,r as B,s as V,t as H}from"./deploy-tab-BjWxHSsV.js";import{c as U,n as te,r as ne,s as re,t as ie}from"./use-engine-command-mutation-CQc8tXfc.js";import{t as W}from"./triangle-alert-DPtblpQC.js";import{t as G}from"./badge-tnWgSITj.js";import{t as K}from"./query-keys-Co1J4HmV.js";var q=_(`box`,[[`path`,{d:`M21 8a2 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 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),J=_(`cog`,[[`path`,{d:`M11 10.27 7 3.34`,key:`16pf9h`}],[`path`,{d:`m11 13.73-4 6.93`,key:`794ttg`}],[`path`,{d:`M12 22v-2`,key:`1osdcq`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14 12h8`,key:`4f43i9`}],[`path`,{d:`m17 20.66-1-1.73`,key:`eq3orb`}],[`path`,{d:`m17 3.34-1 1.73`,key:`2wel8s`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`m20.66 17-1.73-1`,key:`sg0v6f`}],[`path`,{d:`m20.66 7-1.73 1`,key:`1ow05n`}],[`path`,{d:`m3.34 17 1.73-1`,key:`nuk764`}],[`path`,{d:`m3.34 7 1.73 1`,key:`1ulond`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`circle`,{cx:`12`,cy:`12`,r:`8`,key:`46899m`}]]),ae=_(`heart-pulse`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}],[`path`,{d:`M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27`,key:`auskq0`}]]),oe=_(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),se=_(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Y=e(t(),1),X=n(),ce=new Set([`fault_active`,`fault_count`,`active_fault_code`,`lifecycle_stage`,`health_state`,`availability_state`]);function le(e){let t=[],n=[],r=[],i=[];for(let[a,o]of Object.entries(e)){let e={name:a,kind:o.kind,dataType:o.dataType,access:o.access,unit:o.unit,euRange:o.euRange};ce.has(a)?i.push(e):o.kind===`property`?t.push(e):o.access===`readwrite`?n.push(e):r.push(e)}let a=[];return t.length>0&&a.push({key:`nameplate`,label:`Nameplate`,icon:(0,X.jsx)(V,{className:`size-3`}),members:t,accentClass:`text-muted-foreground`}),n.length>0&&a.push({key:`commands`,label:`Commands`,icon:(0,X.jsx)(oe,{className:`size-3`}),members:n,accentClass:`text-info`}),r.length>0&&a.push({key:`process`,label:`Process Tags`,icon:(0,X.jsx)(w,{className:`size-3`}),members:r,accentClass:`text-primary`}),i.length>0&&a.push({key:`health`,label:`Health & Status`,icon:(0,X.jsx)(ae,{className:`size-3`}),members:i,accentClass:`text-success`}),a}function ue({modelName:e,onClose:t}){let[n,l]=(0,Y.useState)(new Set([`nameplate`,`process`])),u=a({queryKey:K.catalog.modelSchema(e??``),queryFn:()=>i(`/catalog/models/${e}`,r.catalogModelDetail),enabled:e!==null}),d=u.data,f=u.isPending&&!d,p=u.isError,m=s(u.error,`Failed to load model.`);(0,Y.useEffect)(()=>{e&&l(new Set([`nameplate`,`process`]))},[e]);let h=(0,Y.useMemo)(()=>d?le(d.members):[],[d]),g=(0,Y.useCallback)(e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),_=D(),b=d?Object.keys(d.members).length:0,x=d?Object.keys(d.methods).length:0;return(0,X.jsx)(R,{open:e!==null,onOpenChange:e=>{e||(_.reset(),t())},children:(0,X.jsx)(B,{side:`right`,className:`flex w-full flex-col gap-4 touch-manipulation`,children:f?null:p&&!d?(0,X.jsx)(`div`,{className:`flex flex-1 flex-col justify-center px-2`,children:(0,X.jsx)(o,{message:m,onRetry:()=>void u.refetch(),isRetrying:u.isFetching})}):d?(0,X.jsxs)(c.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.18},className:`flex min-h-0 flex-1 flex-col gap-4`,children:[(0,X.jsxs)(P,{className:`gap-1 pb-0 pe-12`,children:[(0,X.jsx)(z,{className:`font-heading text-base uppercase tracking-wide`,children:y(d.name)}),d.description&&(0,X.jsx)(I,{className:`text-xs leading-relaxed text-foreground/88`,children:d.description}),(0,X.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(G,{variant:`outline`,className:`font-mono text-xs`,children:[b,` members`]}),(0,X.jsxs)(G,{variant:`outline`,className:`font-mono text-xs`,children:[x,` methods`]}),(0,X.jsxs)(G,{variant:`outline`,className:`font-mono text-xs`,children:[d.faults.length,` faults`]}),d.lifecycle&&(0,X.jsxs)(G,{variant:`outline`,className:`font-mono text-xs text-primary`,children:[d.lifecycle.stages.length,`-stage lifecycle`]}),(0,X.jsx)(E,{stream:_})]})]}),(0,X.jsxs)(N,{defaultValue:`overview`,className:`flex min-h-0 flex-1 flex-col gap-1 pt-0`,children:[(0,X.jsxs)(M,{variant:`line`,className:`h-8! shrink-0 gap-0.5 border-b-border/60 px-2 py-0.5`,children:[(0,X.jsx)(A,{value:`overview`,className:`min-h-10 px-2 py-1 text-xs text-foreground/82 after:bottom-[-3px] data-active:text-foreground sm:min-h-0 sm:px-2.5 sm:py-1`,children:`Overview`}),(0,X.jsx)(A,{value:`deploy`,className:`min-h-10 px-2 py-1 text-xs text-foreground/82 after:bottom-[-3px] data-active:text-foreground sm:min-h-0 sm:px-2.5 sm:py-1`,children:`Deploy`})]}),(0,X.jsx)(j,{value:`overview`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,X.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-2`,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5 pb-1 pt-0.5`,children:[h.map(e=>(0,X.jsx)(Z,{sectionKey:e.key,label:e.label,count:e.members.length,icon:e.icon,accentClass:e.accentClass,expanded:n.has(e.key),onToggle:g,children:(0,X.jsx)(`div`,{className:`flex flex-col gap-1`,children:e.members.map(e=>(0,X.jsx)(de,{member:e},e.name))})},e.key)),d.faults.length>0&&(0,X.jsx)(Z,{sectionKey:`faults`,label:`Faults`,count:d.faults.length,icon:(0,X.jsx)(W,{className:`size-3`}),accentClass:`text-warning`,expanded:n.has(`faults`),onToggle:g,children:(0,X.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:d.faults.map(e=>(0,X.jsx)(G,{variant:`secondary`,className:`text-[10px] text-warning`,children:v(e)},e))})}),d.lifecycle&&(0,X.jsx)(Z,{sectionKey:`lifecycle`,label:`Lifecycle`,count:d.lifecycle.stages.length,icon:(0,X.jsx)(J,{className:`size-3`}),accentClass:`text-primary`,expanded:n.has(`lifecycle`),onToggle:g,children:(0,X.jsx)(fe,{lifecycle:d.lifecycle})}),x>0&&(0,X.jsx)(Z,{sectionKey:`methods`,label:`Methods`,count:x,icon:(0,X.jsx)(se,{className:`size-3`}),accentClass:`text-info`,expanded:n.has(`methods`),onToggle:g,children:(0,X.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:Object.entries(d.methods).map(([e,t])=>(0,X.jsx)(pe,{name:e,method:t},e))})})]})})})}),(0,X.jsx)(j,{value:`deploy`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,X.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,X.jsx)(H,{kind:`model`,id:d.name,displayName:y(d.name),yamlPath:`/catalog/models/${d.name}/yaml`,yamlFilename:`${d.name}.twin.yaml`,stream:_})})})]})]},d.name):(0,X.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-muted-foreground`,children:`Model not found`})})})}function Z({sectionKey:e,label:t,count:n,icon:r,accentClass:i,expanded:a,onToggle:o,children:s}){return(0,X.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/50`,children:[(0,X.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-1.5 px-2.5 py-1.5 text-left text-xs font-medium transition-colors hover:bg-muted/30`,onClick:()=>o(e),children:[(0,X.jsx)(`span`,{className:i,children:r}),(0,X.jsx)(`span`,{className:`uppercase tracking-wider`,children:t}),(0,X.jsx)(G,{variant:`secondary`,className:`ml-auto text-[10px]`,children:n}),(0,X.jsx)(k,{className:`size-3 text-muted-foreground transition-transform ${a?`rotate-180`:``}`})]}),(0,X.jsx)(l,{initial:!1,children:a&&(0,X.jsx)(c.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:`easeOut`},className:`overflow-hidden`,children:(0,X.jsx)(`div`,{className:`border-t px-2.5 py-1.5`,children:s})},`content`)})]})}function de({member:e}){return(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 py-0.5 text-xs`,children:[(0,X.jsx)(`span`,{title:e.name,className:`min-w-0 truncate font-mono text-foreground`,children:S(e.name)}),(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:e.dataType}),e.unit&&(0,X.jsx)(G,{variant:`outline`,className:`px-1 py-0 text-[10px]`,children:e.unit}),e.euRange&&(0,X.jsxs)(`span`,{className:`ml-auto font-mono text-xs text-muted-foreground`,children:[`[`,e.euRange[0],`–`,e.euRange[1],`]`]})]})}var Q={healthy:`bg-success`,normal:`bg-success`,degraded:`bg-warning`,critical:`bg-destructive`,failed:`bg-destructive`};function fe({lifecycle:e}){let t=e.stages.length;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`div`,{className:`flex h-2.5 w-full overflow-hidden rounded-full bg-muted`,children:e.stages.map((e,n)=>(0,X.jsx)(`div`,{className:`transition-[background-color] ${Q[e]??`bg-chart-1`} ${n===0?`rounded-l-full`:``} ${n===t-1?`rounded-r-full`:``}`,style:{width:`${100/t}%`}},`${e}-${n}`))}),(0,X.jsx)(`div`,{className:`flex items-center gap-3`,children:e.stages.map((e,t)=>(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,X.jsx)(`span`,{className:`size-2 rounded-full ${Q[e]??`bg-chart-1`}`}),(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:v(e)})]},`${e}-${t}`))}),(0,X.jsxs)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:[`~`,b(e.totalHours),` total hours`]})]})}function pe({name:e,method:t}){return(0,X.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`font-mono text-xs text-foreground`,children:e}),t.inputArguments.length>0&&(0,X.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`(`,t.inputArguments.map(e=>`${e.name}: ${e.dataType}`).join(`, `),`)`]})]}),t.description&&(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t.description})]})}function me(){let[e,t]=(0,Y.useState)(``),[n,_]=(0,Y.useState)({}),[v,b]=(0,Y.useState)(null),[S,w]=(0,Y.useState)(null),[T,E]=(0,Y.useState)(null),D=(0,Y.useRef)(null),O=ie();(0,Y.useEffect)(()=>{let e=e=>{if(e.key!==`/`||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target.tagName;t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||(e.preventDefault(),D.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let k=a({queryKey:K.catalog.models(),queryFn:()=>i(`/catalog/models`,r.catalogModels)}),A=k.data??[],j=k.isPending&&!k.data,M=k.isError&&!k.data,N=k.isError&&!!k.data,P=s(k.error,`Failed to load models.`),I=e=>n[e]??1,L=(0,Y.useCallback)((e,t)=>{_(n=>({...n,[e]:Math.max(1,Math.min(10,t))}))},[]),R=(0,Y.useCallback)(e=>{E(e)},[]),z=(0,Y.useCallback)(e=>{w(e)},[]),B=async e=>{b(e);try{return await O.mutateAsync({type:`spawn`,model:e,count:I(e)}),!0}catch{return!1}finally{b(null)}},V=e?A.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||(t.description?.toLowerCase().includes(e.toLowerCase())??!1)):A;return(0,X.jsxs)(`div`,{className:`@container/models mx-auto flex w-full max-w-screen-2xl flex-col gap-5 p-4 sm:gap-6 sm:p-6`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(`h1`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Asset Model Library`}),(0,X.jsx)(G,{variant:`outline`,className:`text-xs`,children:M?(0,X.jsx)(`span`,{className:`text-destructive`,children:`Unavailable`}):j&&A.length===0?(0,X.jsx)(X.Fragment,{children:`Loading...`}):(0,X.jsxs)(X.Fragment,{children:[A.length,` built-in`]})})]}),(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Canonical twin models with realistic physics, lifecycle degradation, and fault modes. Inspect to explore schema, copy YAML, or export.`})]}),M&&(0,X.jsx)(o,{message:P,onRetry:()=>void k.refetch(),isRetrying:k.isFetching}),N&&(0,X.jsx)(o,{message:`${P} Showing cached models.`,onRetry:()=>void k.refetch(),isRetrying:k.isFetching}),!M&&A.length>6&&(0,X.jsxs)(`div`,{className:`relative max-w-xs`,children:[(0,X.jsx)(F,{className:`absolute left-2.5 top-2.5 size-4 text-muted-foreground`}),(0,X.jsx)(C,{ref:D,placeholder:`Filter models...`,value:e,onChange:e=>t(e.target.value),className:`pl-9 pr-7`}),!e&&(0,X.jsx)(`kbd`,{className:`pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 rounded-[var(--miravo-radius-tight)] border border-border bg-muted px-1 font-mono text-[10px] text-muted-foreground`,children:`/`})]}),(0,X.jsx)(`div`,{className:`grid grid-cols-1 gap-4 @[720px]/models:grid-cols-2 @[1120px]/models:grid-cols-3`,"aria-busy":j&&!M,children:M?null:(0,X.jsxs)(X.Fragment,{children:[j&&A.length===0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`}),(0,X.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`}),(0,X.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`}),(0,X.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`}),(0,X.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`}),(0,X.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`})]}),(0,X.jsx)(l,{children:V.map((e,t)=>(0,X.jsx)(c.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,scale:.96,transition:{duration:.15}},transition:{type:`spring`,stiffness:380,damping:30,delay:t*.04},className:`grid`,children:(0,X.jsx)(he,{model:e,count:I(e.name),spawning:v===e.name,onCountChange:L,onInspect:R,onSpawn:z})},e.name))}),V.length===0&&A.length>0&&(0,X.jsxs)(`p`,{className:`col-span-full py-8 text-center text-sm text-muted-foreground`,children:[`No models match “`,e,`”`]})]})}),A.length>0&&(0,X.jsx)(`div`,{className:g(ne,`p-0`),children:(0,X.jsx)(`div`,{className:`community-teaser relative overflow-hidden rounded-[inherit]`,children:(0,X.jsx)(`div`,{className:`relative z-10 mx-auto max-w-3xl px-5 py-10 sm:px-10 sm:py-12`,children:(0,X.jsxs)(`div`,{className:`grid items-center gap-10 lg:grid-cols-[minmax(0,1fr)_minmax(0,17rem)]`,children:[(0,X.jsxs)(`div`,{className:`order-2 flex min-w-0 flex-col gap-4 lg:order-1`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[(0,X.jsx)(`p`,{className:`blueprint-title text-primary`,children:`Future channel`}),(0,X.jsx)(`span`,{className:`blueprint-stat text-[10px] text-muted-foreground`,children:`MIRAVO_REGISTRY · NOT_CONNECTED`})]}),(0,X.jsx)(`h2`,{className:`font-heading text-xl font-semibold tracking-tight sm:text-2xl`,children:`Community Models`}),(0,X.jsx)(`p`,{className:`max-w-xl text-sm leading-relaxed text-muted-foreground`,children:`Publish your custom twin models to the Miravo registry. Discover equipment models from other engineers, fork them, and adapt parameters for your use case.`}),(0,X.jsx)(`div`,{children:(0,X.jsx)(G,{variant:`outline`,className:`community-teaser-soon border-primary/35 bg-primary/5 text-[10px] text-primary`,children:`Coming Soon`})})]}),(0,X.jsx)(`div`,{className:`order-1 flex justify-center lg:order-2 lg:justify-end`,children:(0,X.jsxs)(`div`,{className:`community-teaser-module relative flex w-full max-w-[14rem] flex-col items-center justify-center gap-3 border border-primary/15 bg-muted/15 py-8 sm:max-w-[15.5rem] sm:py-10`,"aria-hidden":!0,children:[(0,X.jsx)(`div`,{className:`community-teaser-icon-ring relative z-[1] flex size-[4.25rem] items-center justify-center rounded-[var(--miravo-radius-tight)] border border-primary/35 bg-gradient-to-br from-primary/18 to-primary/5`,children:(0,X.jsx)(ee,{className:`size-9 text-primary`,"aria-hidden":!0})}),(0,X.jsx)(`span`,{className:`blueprint-stat relative z-[1] text-[9px] tracking-[0.18em] text-muted-foreground`,children:`AWAITING SIGNAL`}),(0,X.jsx)(`span`,{className:`blueprint-stat relative z-[1] text-[9px] text-muted-foreground`,children:`Uplink idle`})]})})]})})})}),(0,X.jsx)(h,{open:S!==null,onOpenChange:e=>{e||w(null)},children:(0,X.jsxs)(f,{children:[(0,X.jsxs)(u,{children:[(0,X.jsx)(p,{children:`Spawn instances?`}),(0,X.jsx)(m,{children:S!==null&&(0,X.jsxs)(X.Fragment,{children:[`This spawns `,I(S),` instance`,I(S)===1?``:`s`,` of`,` `,(0,X.jsx)(`span`,{className:`font-medium text-foreground`,children:y(S)}),` `,`into the running environment.`]})})]}),(0,X.jsxs)(d,{children:[(0,X.jsx)(x,{variant:`outline`,disabled:v!==null,onClick:()=>w(null),children:`Cancel`}),(0,X.jsx)(x,{disabled:v!==null||S===null,onClick:async()=>{S!==null&&await B(S)&&w(null)},children:v===S?`Spawning...`:`Spawn`})]})]})}),(0,X.jsx)(ue,{modelName:T,onClose:()=>E(null)})]})}var he=(0,Y.memo)(function({model:e,count:t,spawning:n,onCountChange:r,onInspect:i,onSpawn:a}){return(0,X.jsxs)(`div`,{className:g(re,`flex flex-col gap-4 p-5`),children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,X.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] bg-primary/10 text-primary`,children:(0,X.jsx)(q,{className:`size-4`})}),(0,X.jsxs)(`div`,{className:`min-w-0 flex flex-col gap-0.5`,children:[(0,X.jsx)(`span`,{className:`font-heading text-sm font-semibold uppercase tracking-wide`,children:y(e.name)}),e.description&&(0,X.jsx)(`span`,{className:`line-clamp-2 text-xs leading-relaxed text-muted-foreground`,children:e.description})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 font-mono text-[11px] text-muted-foreground`,children:[(0,X.jsx)($,{label:`mbr`,value:e.memberCount}),(0,X.jsx)($,{label:`mth`,value:e.methodCount}),(0,X.jsx)($,{label:`flt`,value:e.faultCount}),e.hasLifecycle&&(0,X.jsxs)(`span`,{className:`flex items-center gap-1 text-primary`,children:[(0,X.jsx)(`span`,{className:`text-[10px]`,children:`◈`}),(0,X.jsxs)(`span`,{children:[e.lifecycleStageCount,`-stage`]})]}),(0,X.jsx)(G,{variant:`secondary`,className:`ml-auto shrink-0 font-sans text-[10px] font-medium`,children:e.source})]}),(0,X.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 border-t border-border/30 pt-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center rounded-[var(--miravo-radius-tight)] border bg-muted/30`,children:[(0,X.jsx)(x,{variant:`ghost`,size:`icon`,className:`size-7 rounded-none rounded-l-md`,disabled:t<=1,"aria-label":`Decrease count`,onClick:n=>{n.stopPropagation(),r(e.name,t-1)},children:(0,X.jsx)(L,{className:`size-3`})}),(0,X.jsx)(`span`,{className:`flex size-7 items-center justify-center border-x font-mono text-xs`,children:t}),(0,X.jsx)(x,{variant:`ghost`,size:`icon`,className:`size-7 rounded-none rounded-r-md`,disabled:t>=10,"aria-label":`Increase count`,onClick:n=>{n.stopPropagation(),r(e.name,t+1)},children:(0,X.jsx)(T,{className:`size-3`})})]}),(0,X.jsxs)(x,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>i(e.name),className:te,children:[(0,X.jsx)(O,{className:`size-3.5`,"aria-hidden":!0}),`Inspect`]}),(0,X.jsxs)(x,{size:`sm`,className:`ml-auto`,disabled:n,onClick:()=>a(e.name),children:[(0,X.jsx)(U,{className:`mr-1 size-3`}),n?`...`:`Spawn`]})]})]})});function $({label:e,value:t}){return(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`span`,{className:`text-foreground`,children:t}),` `,(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:e})]})}export{q as n,me as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./models-6X-8K2W2.js";export{e as ModelsPage};
@@ -1 +0,0 @@
1
- import{t as e}from"./platforms-DrizMC87.js";export{e as PlatformsPage};