@miravo/cli-linux-x64 0.7.8 → 0.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/console-dist/assets/api-Bf6pFRhP.js +1 -0
- package/console-dist/assets/api-wyOH3ffs.js +1 -0
- package/console-dist/assets/{badge-eIn_7YrK.js → badge-i00PiRCo.js} +1 -1
- package/console-dist/assets/catalog-CTpesUtM.js +1 -0
- package/console-dist/assets/catalog-DqOwOydE.js +1 -0
- package/console-dist/assets/catalog-source-W3TI0pmx.js +1 -0
- package/console-dist/assets/{checkbox-C_4HRnS_.js → checkbox-C84IyqEB.js} +1 -1
- package/console-dist/assets/{combobox-BCaV1Wbo.js → combobox-BJecIYHE.js} +1 -1
- package/console-dist/assets/control-BLUTBbet.js +1 -0
- package/console-dist/assets/control-UqwbqlvO.js +1 -0
- package/console-dist/assets/{copy-button-BvU3RDZa.js → copy-button-DnGsXbVV.js} +1 -1
- package/console-dist/assets/events-BTqDmbVu.js +1 -0
- package/console-dist/assets/events-Z0rGFYfs.js +1 -0
- package/console-dist/assets/fleet-BNba_zGa.js +1 -0
- package/console-dist/assets/fleet-C20wXA8E.js +1 -0
- package/console-dist/assets/{format-CshN6yEB.js → format-B9CcV2dj.js} +1 -1
- package/console-dist/assets/{get-error-message-SEo0k4qf.js → get-error-message-yQcVJ-Ja.js} +1 -1
- package/console-dist/assets/index-B_Xu4s7C.js +12 -0
- package/console-dist/assets/instance-detail-STqgvf7K.js +1 -0
- package/console-dist/assets/{login-B6QpC1oU.js → login-BJaFYYGh.js} +2 -2
- package/console-dist/assets/models-2VnPNXiF.js +1 -0
- package/console-dist/assets/models-DhRo1Ytd.js +1 -0
- package/console-dist/assets/{not-found-D0nX2nrf.js → not-found-BbQLiHmm.js} +1 -1
- package/console-dist/assets/platforms-DbzXekvY.js +1 -0
- package/console-dist/assets/platforms-DrKstIAm.js +1 -0
- package/console-dist/assets/query-fetch-error-BqiDQT2r.js +1 -0
- package/console-dist/assets/{select-CmlY1M1a.js → select-CMOnuEoT.js} +1 -1
- package/console-dist/assets/tabs-CCixnxMe.js +1 -0
- package/console-dist/assets/tags-CNJIRrPw.js +1 -0
- package/console-dist/assets/tags-DAJ-rQYR.js +4 -0
- package/console-dist/assets/transition-nav-link-Bf02_OAE.js +1 -0
- package/console-dist/assets/use-engine-command-mutation-RvjgD8uv.js +1 -0
- package/console-dist/assets/use-platform-stream-BVf5gGJM.js +2 -0
- package/console-dist/assets/use-transition-navigate-DtyJz2Z1.js +2 -0
- package/console-dist/assets/validation-_QtRYqIT.js +1 -0
- package/console-dist/index.html +31 -33
- package/miravo +0 -0
- package/package.json +1 -1
- package/console-dist/assets/api-DGtW0Fh4.js +0 -1
- package/console-dist/assets/catalog-DDHh7IxX.js +0 -1
- package/console-dist/assets/catalog-DZz3a6vE.js +0 -1
- package/console-dist/assets/catalog-source-DT5WAB9u.js +0 -1
- package/console-dist/assets/control-Br_1NEB0.js +0 -1
- package/console-dist/assets/control-DmjNAhq5.js +0 -1
- package/console-dist/assets/engine-store-DMULdR_V.js +0 -1
- package/console-dist/assets/events-CJIyikQE.js +0 -1
- package/console-dist/assets/events-DMpCBVAp.js +0 -1
- package/console-dist/assets/fleet-BYJ4DFYn.js +0 -1
- package/console-dist/assets/fleet-pSpdGZnr.js +0 -1
- package/console-dist/assets/index-YW1mEMDX.js +0 -12
- package/console-dist/assets/instance-detail-CVOl1-Oc.js +0 -1
- package/console-dist/assets/models-DdNy8e5C.js +0 -1
- package/console-dist/assets/models-EaysA2Qw.js +0 -1
- package/console-dist/assets/platforms-BsyqlJKi.js +0 -1
- package/console-dist/assets/platforms-DFoAeG0R.js +0 -1
- package/console-dist/assets/query-fetch-error-C6Lt-RSI.js +0 -1
- package/console-dist/assets/route-preload-CbmrjLlI.js +0 -2
- package/console-dist/assets/tabs-4SeH2unv.js +0 -1
- package/console-dist/assets/tags-CNF5b2a7.js +0 -4
- package/console-dist/assets/tags-DH-gdxLz.js +0 -1
- package/console-dist/assets/transition-nav-link-CbbvCaF1.js +0 -1
- package/console-dist/assets/use-engine-command-mutation-BJnaKdCX.js +0 -1
- package/console-dist/assets/use-platform-stream-D2Hnc-qx.js +0 -2
- package/console-dist/assets/use-transition-navigate-DHgJJMdL.js +0 -1
- package/console-dist/assets/validation-CCol1kXN.js +0 -1
- /package/console-dist/assets/{auth-screen-backdrop-Cr8qBSXP.js → auth-screen-backdrop-CgwRhIbi.js} +0 -0
- /package/console-dist/assets/{dropdown-menu-CrPXVXpG.js → dropdown-menu-82O7jPU6.js} +0 -0
- /package/console-dist/assets/{label-CMBWxUhA.js → label-DTHSKF2S.js} +0 -0
- /package/console-dist/assets/{runtime-link-PMxeHxd6.js → runtime-link-D-uJbw97.js} +0 -0
- /package/console-dist/assets/{select-display-items-Bqb6Sbg6.js → select-display-items-y2L7MHmk.js} +0 -0
- /package/console-dist/assets/{transition-types-2i1blGlR.js → transition-types-CPlGtM8w.js} +0 -0
- /package/console-dist/assets/{vendor-table-BAHQgdwg.js → vendor-table-SVvT6QrW.js} +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{at as n}from"./vendor-ui-CWUk2ulb.js";import{S as r,o as i,pt as a,rt as o,v as s}from"./api-Bf6pFRhP.js";import{i as c,t as l}from"./query-fetch-error-BqiDQT2r.js";import{i as u,n as d,t as f}from"./dist-xY0pK9Wy.js";import{n as p}from"./chunk-OE4NN4TA-DBWZidbW.js";import{a as m,i as h,n as g,o as _,r as v,s as y,t as b}from"./copy-button-DnGsXbVV.js";import{C as x,S,T as C,b as ee,d as w,l as T,s as E,y as te}from"./format-B9CcV2dj.js";import{n as D,t as ne}from"./utils-XFKvwlFT.js";import{t as O}from"./arrow-up-down-C1oJAmrw.js";import{c as re,i as k,l as ie,n as A,s as j,t as M}from"./select-CMOnuEoT.js";import{a as ae,n as N,r as P}from"./platform-targets-BIQ1lKOg.js";import{t as oe}from"./download-DmUZKo9N.js";import{i as F,n as I,t as L}from"./tooltip-D1ydB4g3.js";import{n as se}from"./auth-screen-backdrop-CgwRhIbi.js";import{a as ce,i as le,n as ue,o as de,r as fe,s as pe,t as me}from"./dropdown-menu-82O7jPU6.js";import{t as R}from"./label-DTHSKF2S.js";import{n as he}from"./get-error-message-yQcVJ-Ja.js";import{a as z,i as B,n as V,o as ge,r as H,s as _e,t as ve}from"./combobox-BJecIYHE.js";import{a as ye,i as be,n as xe,o as Se,r as Ce,t as we}from"./vendor-table-SVvT6QrW.js";var Te=D(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Ee=D(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),De=D(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),Oe=D(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),ke=D(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),Ae=D(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),je=D(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),U=e(t(),1),W={mqtt:`MQTT Client`,opcua:`OPC UA Client Advanced`,modbus:`Modbus TCP`},G={Boolean:`bool`,Int32:`int32`,UInt16:`uint16`,UInt32:`uint32`,Float:`float32`,Double:`float64`,String:`string`},Me={float32:`float32`,int32:`int32`,uint32:`uint32`,uint16:`word`,boolean:`word`},Ne=`deviceId,deviceName,driverName,name,tagName,description,valueType,registerId,publishCoV,tagFormula,metaData,Retain,Qos,address,count,pollingInterval,endianness`;function K(e,t,n){let r=[Ne];for(let i of n){let n=W[i]??i;for(let a of e){let e=a.protocols[i];e&&r.push(q(i,{deviceName:t,driverName:n,memberName:a.member,browsePath:a.browsePath,dataType:a.dataType,protocolData:e,unit:a.unit,euRange:a.euRange,model:a.model,instance:a.instance,access:a.access}))}}return`${r.join(`
|
|
2
|
+
`)}\n`}function q(e,t){switch(e){case`mqtt`:return Pe(t);case`opcua`:return Fe(t);case`modbus`:return Ie(t);default:throw Error(`Unsupported LE export protocol: "${e}"`)}}function Pe(e){let t=typeof e.protocolData?.topic==`string`?e.protocolData.topic:`${e.browsePath}/${e.memberName}`;return[``,J(e.deviceName),J(e.driverName),J(t),J(e.memberName),``,`string`,``,`false`,``,Y(e),`Disable`,`0`,``,``,``,``].join(`,`)}function Fe(e){let t=typeof e.protocolData?.nodeId==`string`?e.protocolData.nodeId:`ns=1;s=${e.browsePath}/${e.memberName}`,n=G[e.dataType]??`string`;return[``,J(e.deviceName),J(e.driverName),J(t),J(e.memberName),``,n,``,`false`,``,Y(e),``,``,``,``,``,``].join(`,`)}function Ie(e){let t=Me[String(e.protocolData?.registerType??``)]??Le(e.dataType),n=e.protocolData?.address;return[``,J(e.deviceName),J(e.driverName),`H`,J(e.memberName),``,t,``,`false`,``,Y(e),``,``,typeof n==`number`?String(n):`0`,`1`,`1.0000000000`,`AB CD`].join(`,`)}function Le(e){switch(e){case`Double`:case`Float`:return`float32`;case`Int32`:return`int32`;case`UInt32`:return`uint32`;case`Boolean`:case`UInt16`:return`word`;default:return`float32`}}function J(e){return e.includes(`,`)||e.includes(`"`)||e.includes(`
|
|
3
|
+
`)?`"${e.replace(/"/g,`""`)}"`:e}function Y(e){let t={uns_path:e.browsePath?`${e.browsePath}/${e.memberName}`:e.memberName,model:e.model,instance:e.instance,access:e.access};return e.unit!=null&&(t.unit=e.unit),e.euRange!=null&&(t.eu_range_min=String(e.euRange[0]),t.eu_range_max=String(e.euRange[1])),J(JSON.stringify(t))}var X=n(),Re={mqtt:`MQTT`,opcua:`OPC UA`,modbus:`Modbus`},ze=[{id:P.id,label:P.label}];function Be({open:e,onOpenChange:t,tags:n,totalTags:r,enabledProtocols:i,selectedInstance:a}){let[o,s]=(0,U.useState)(`litmus-edge`),[c,l]=(0,U.useState)(``),[u,d]=(0,U.useState)(``),f=(0,U.useRef)(null),p=(0,U.useRef)(!1);(0,U.useEffect)(()=>{e&&!p.current&&(s(P.id),l(a??``),d(i[0]??``),setTimeout(()=>f.current?.focus(),80)),p.current=e},[e,i,a]);let b=c.trim()!==``&&u!==``,C=o===P.id?b:!1,ee=(0,U.useCallback)(()=>{if(o===P.id){let e=K(n,c.trim(),[u]),r=new Blob([e],{type:`text/csv`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${c.trim()}-litmus-edge-tags.csv`,a.click(),URL.revokeObjectURL(i),t(!1)}},[o,c,n,u,t]),w=n.length<r,T=(0,U.useMemo)(()=>[...ze.map(e=>({value:e.id,label:e.label})),...N.map(e=>({value:e.id,label:e.label}))],[]),E=(0,U.useMemo)(()=>i.map(e=>({value:e,label:Re[e]??e.toUpperCase()})),[i]);return(0,X.jsx)(g,{open:e,onOpenChange:t,children:(0,X.jsxs)(v,{className:`sm:max-w-lg`,children:[(0,X.jsxs)(_,{children:[(0,X.jsx)(y,{children:`Export for Platform`}),(0,X.jsx)(h,{children:w?`Exporting ${n.length} of ${r} tags based on current table filters.`:`Exporting all ${n.length} tags. Use table filters to narrow scope.`})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-4 py-1`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(R,{className:`text-sm`,children:`Platform`}),(0,X.jsxs)(M,{value:o,onValueChange:e=>e&&s(e),items:T,children:[(0,X.jsx)(j,{className:`w-full text-sm`,children:(0,X.jsx)(re,{placeholder:`Select platform`})}),(0,X.jsxs)(A,{children:[ze.map(e=>(0,X.jsx)(k,{value:e.id,children:e.label},e.id)),N.map(e=>(0,X.jsx)(k,{value:e.id,disabled:!0,children:e.label},e.id))]})]})]}),o===P.id&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(R,{htmlFor:`device-name`,className:`text-sm`,children:[`Device name `,(0,X.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,X.jsx)(S,{id:`device-name`,ref:f,placeholder:`e.g. DTW-FAB-PLC`,value:c,onChange:e=>l(e.target.value),onKeyDown:e=>e.key===`Enter`&&C&&ee(),className:`font-mono text-sm`})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(R,{className:`text-sm`,children:`Protocol`}),(0,X.jsxs)(M,{value:u||void 0,onValueChange:e=>e&&d(e),items:E,children:[(0,X.jsx)(j,{className:`w-full text-sm`,children:(0,X.jsx)(re,{placeholder:`Select a protocol`})}),(0,X.jsx)(A,{children:i.map(e=>(0,X.jsx)(k,{value:e,children:Re[e]??e.toUpperCase()},e))})]})]})]})]}),(0,X.jsxs)(m,{children:[(0,X.jsx)(x,{variant:`outline`,size:`sm`,onClick:()=>t(!1),children:`Cancel`}),(0,X.jsxs)(x,{size:`sm`,className:`gap-1.5`,disabled:!C,onClick:ee,children:[(0,X.jsx)(oe,{className:`size-3.5`}),`Download CSV`]})]})]})})}var Ve=`border-border/70 bg-popover/98 font-body text-sm shadow-xl ring-1 ring-foreground/12 backdrop-blur-sm supports-backdrop-filter:bg-popover/90 p-1.5`,He=`px-2 pb-1 font-heading text-[9px] font-semibold tracking-[0.14em] text-muted-foreground uppercase`,Ue=`h-8 gap-1.5 border-border/80 bg-background/80 text-xs font-medium shadow-sm transition-colors hover:border-primary/35 hover:bg-accent/40`,We=`gap-2.5 rounded-[var(--miravo-radius-tight)] py-2 pl-2 pr-2 text-[13px] data-[highlighted]:bg-sidebar-accent data-[highlighted]:text-sidebar-accent-foreground`;function Ge({protocol:e,instance:t,model:n,member:r,enabledProtocols:i,hasFilters:a,memberSearchRef:o,onProtocolChange:s,onInstanceChange:c,onModelChange:l,onMemberChange:u,onClearFilters:d,onInstanceSearch:f,onModelSearch:p,filteredInstanceOptions:m,filteredModelOptions:h}){let g=(0,U.useMemo)(()=>[{value:`all`,label:`All protocols`},...i.map(e=>({value:e,label:e.toUpperCase()}))],[i]);return(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(M,{value:e||`all`,onValueChange:e=>s(!e||e===`all`?``:e),items:g,children:[(0,X.jsx)(j,{className:`h-8 w-[140px]`,"aria-label":`Protocol filter`,children:(0,X.jsx)(re,{placeholder:`All protocols`})}),(0,X.jsxs)(A,{alignItemWithTrigger:!1,align:`start`,children:[(0,X.jsx)(k,{value:`all`,children:`All protocols`}),i.map(e=>(0,X.jsx)(k,{value:e,children:e.toUpperCase()},e))]})]}),(0,X.jsxs)(ve,{value:t?{value:t,label:E(t)}:null,onValueChange:e=>c(e?.value??``),isItemEqualToValue:(e,t)=>e?.value===t?.value,onInputValueChange:f,children:[(0,X.jsx)(H,{placeholder:`All instances`,className:`h-8 w-[200px]`,showClear:!!t}),(0,X.jsx)(V,{children:(0,X.jsxs)(z,{children:[m.map(([e,t])=>(0,X.jsxs)(B,{value:{value:e,label:E(e)},children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:`${T(e)} (${e})`,children:E(e)}),(0,X.jsxs)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:[`(`,t,`)`]})]},e)),m.length===0&&(0,X.jsx)(`p`,{className:`py-2 text-center text-xs text-muted-foreground`,children:`No instances found`})]})})]}),(0,X.jsxs)(ve,{value:n?{value:n,label:w(n)}:null,onValueChange:e=>l(e?.value??``),isItemEqualToValue:(e,t)=>e?.value===t?.value,onInputValueChange:p,children:[(0,X.jsx)(H,{placeholder:`All models`,className:`h-8 w-[200px]`,showClear:!!n}),(0,X.jsx)(V,{children:(0,X.jsxs)(z,{children:[h.map(([e,t])=>(0,X.jsxs)(B,{value:{value:e,label:w(e)},children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:w(e)}),(0,X.jsxs)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:[`(`,t,`)`]})]},e)),h.length===0&&(0,X.jsx)(`p`,{className:`py-2 text-center text-xs text-muted-foreground`,children:`No models found`})]})})]}),(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(S,{ref:o,placeholder:`Search member…`,className:`h-8 w-[160px] pr-7`,value:r,onChange:e=>u(e.target.value)}),!r&&(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:`/`})]}),a&&(0,X.jsxs)(x,{variant:`ghost`,size:`sm`,className:`h-8 gap-1 text-xs`,onClick:d,children:[(0,X.jsx)(C,{className:`size-3`}),`Clear`]})]})}function Z({sorted:e}){return e===`asc`?(0,X.jsx)(Ee,{className:`ml-1 inline size-3`}):e===`desc`?(0,X.jsx)(Te,{className:`ml-1 inline size-3`}):(0,X.jsx)(O,{className:`ml-1 inline size-3 opacity-30`})}function Q(e,t=1,n=2){let r=e.split(`/`);return r.length<=t+n+1?e:[...r.slice(0,t),`...`,...r.slice(-n)].join(`/`)}function $({label:e,value:t,collapsible:n}){let r=n?Q(t):t;return(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground`,children:e}),(0,X.jsx)(b,{value:t,label:`Copy ${e}`,tooltipSide:`top`,render:({icon:e})=>(0,X.jsxs)(`button`,{type:`button`,className:`mt-0.5 flex items-start gap-1 font-mono text-xs hover:text-foreground`,children:[n?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`break-all lg:hidden`,children:r}),(0,X.jsx)(`span`,{className:`hidden break-all lg:inline`,children:t})]}):(0,X.jsx)(`span`,{className:`break-all`,children:t}),(0,X.jsx)(`span`,{className:`mt-0.5 shrink-0 text-muted-foreground`,children:e})]})})]})}function Ke({tag:e,enabledProtocols:t}){let n=`${e.browsePath}/${e.member}`,r=e.protocols.opcua,i=e.protocols.modbus,a=e.access===`readwrite`?`rw`:e.access;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-3 text-xs`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-x-10 gap-y-2.5`,children:[(0,X.jsx)($,{label:`Topic / UNS`,value:n,collapsible:!0}),t.includes(`opcua`)&&typeof r?.nodeId==`string`&&(0,X.jsx)($,{label:`OPC UA NodeId`,value:r.nodeId,collapsible:!0}),t.includes(`modbus`)&&i?.address!=null&&(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground`,children:`Modbus`}),(0,X.jsxs)(`p`,{className:`mt-0.5 font-mono`,children:[`addr=`,String(i.address),` regs=`,String(i.count),` `,String(i.registerType)]})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-muted-foreground`,children:[(0,X.jsxs)(L,{children:[(0,X.jsx)(F,{className:`font-mono`,render:(0,X.jsx)(`span`,{}),children:e.dataType}),(0,X.jsx)(I,{side:`top`,children:`Data type`})]}),e.unit&&(0,X.jsxs)(L,{children:[(0,X.jsx)(F,{className:`font-mono`,render:(0,X.jsx)(`span`,{}),children:e.unit}),(0,X.jsx)(I,{side:`top`,children:`Unit`})]}),(0,X.jsxs)(L,{children:[(0,X.jsx)(F,{className:`font-mono`,render:(0,X.jsx)(`span`,{}),children:a}),(0,X.jsx)(I,{side:`top`,children:`Access: r / w / rw`})]}),e.euRange&&(0,X.jsxs)(L,{children:[(0,X.jsxs)(F,{className:`font-mono`,render:(0,X.jsx)(`span`,{}),children:[`[`,e.euRange[0],`, `,e.euRange[1],`]`]}),(0,X.jsx)(I,{side:`top`,children:`EU range (min, max)`})]}),(0,X.jsxs)(L,{children:[(0,X.jsxs)(F,{render:(0,X.jsx)(p,{to:`/instance/${e.instance}`,className:`inline-flex items-center gap-1 text-primary underline-offset-4 hover:underline`,"aria-label":`Open instance`}),children:[`View instance`,(0,X.jsx)(Ae,{className:`size-3`})]}),(0,X.jsx)(I,{side:`top`,children:`Open instance`})]})]})]})}var qe=[{id:`expand`,meta:{cellClass:`!pl-2 !pr-0 w-0`},header:()=>(0,X.jsx)(`span`,{className:`sr-only`,children:`Expand row`}),enableSorting:!1,cell:({row:e})=>(0,X.jsx)(`button`,{type:`button`,className:`inline-flex size-5 items-center justify-center rounded-[var(--miravo-radius-tight)] text-muted-foreground hover:text-foreground`,"aria-label":e.getIsExpanded()?`Collapse row`:`Expand row`,"aria-expanded":e.getIsExpanded(),onClick:t=>{t.stopPropagation(),e.toggleExpanded()},children:(0,X.jsx)(ie,{className:`size-3.5 transition-transform ${e.getIsExpanded()?`rotate-0`:`-rotate-90`}`})})},{accessorKey:`instance`,header:({column:e})=>(0,X.jsxs)(`button`,{type:`button`,className:`inline-flex items-center`,onClick:e.getToggleSortingHandler(),children:[`Instance`,(0,X.jsx)(Z,{sorted:e.getIsSorted()})]}),cell:({getValue:e})=>(0,X.jsx)(`span`,{className:`block max-w-[18rem] truncate font-mono text-xs`,title:e(),children:e()})},{accessorKey:`member`,header:({column:e})=>(0,X.jsxs)(`button`,{type:`button`,className:`inline-flex items-center`,onClick:e.getToggleSortingHandler(),children:[`Member`,(0,X.jsx)(Z,{sorted:e.getIsSorted()})]}),cell:({getValue:e})=>(0,X.jsx)(`span`,{className:`block max-w-[20rem] truncate font-mono text-xs`,title:e(),children:e()})},{accessorKey:`model`,header:({column:e})=>(0,X.jsxs)(`button`,{type:`button`,className:`inline-flex items-center`,onClick:e.getToggleSortingHandler(),children:[`Model`,(0,X.jsx)(Z,{sorted:e.getIsSorted()})]}),cell:({getValue:e})=>(0,X.jsx)(`span`,{className:`block max-w-[18rem] truncate text-xs`,title:e(),children:e()})},{accessorKey:`dataType`,meta:{hideClass:`hidden lg:table-cell`},header:({column:e})=>(0,X.jsxs)(`button`,{type:`button`,className:`inline-flex items-center`,onClick:e.getToggleSortingHandler(),children:[`Type`,(0,X.jsx)(Z,{sorted:e.getIsSorted()})]}),cell:({getValue:e})=>(0,X.jsx)(`span`,{className:`font-mono text-xs`,children:e()})},{accessorKey:`unit`,meta:{hideClass:`hidden lg:table-cell`},header:`Unit`,enableSorting:!1,cell:({getValue:e})=>(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e()??`—`})},{accessorKey:`access`,meta:{hideClass:`hidden lg:table-cell`},header:`Access`,enableSorting:!1,cell:({getValue:e})=>{let t=e();return(0,X.jsx)(`span`,{className:`font-mono text-xs`,children:t===`readwrite`?`rw`:t})}}];function Je(e,t){let n=new Blob([e],{type:`text/csv`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=t,i.click(),URL.revokeObjectURL(r)}var Ye=[10,15,25,50,100],Xe=15,Ze=100;function Qe(e){return Ye.includes(e)?e:Xe}function $e(e){return/[",\r\n]/.test(e)?`"${e.replaceAll(`"`,`""`)}"`:e}function et(){let[e,t]=(0,U.useState)(!1),n=(0,U.useRef)(null);(0,U.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(),n.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let[m,h]=u(`protocol`,d.withDefault(``)),[g,_]=u(`instance`,d.withDefault(``)),[v,y]=u(`model`,d.withDefault(``)),[b,S]=u(`member`,d.withDefault(``)),[C,w]=u(`perPage`,f.withDefault(Xe)),T=Qe(C),E=o(e=>e.instanceCount),D=c({queryKey:s.tags.manifest(E),queryFn:()=>i(`/manifest`,r.manifest),placeholderData:a}),O=D.data??null,N=D.isError,P=D.isPending&&!O&&!N,F=he(D.error,`Failed to fetch manifest.`),I=O?.tags??[],L=O?.summary?.enabledProtocols??[],R=(0,U.useDeferredValue)(b),z=(0,U.useMemo)(()=>I.filter(e=>e.kind===`variable`),[I]),B=(0,U.useMemo)(()=>{let e=new Map;for(let t of z)e.set(t.instance,(e.get(t.instance)??0)+1);return[...e.entries()].sort((e,t)=>e[0].localeCompare(t[0]))},[z]),V=(0,U.useMemo)(()=>{let e=new Map;for(let t of z)e.set(t.model,(e.get(t.model)??0)+1);return[...e.entries()].sort((e,t)=>e[0].localeCompare(t[0]))},[z]),H=(0,U.useMemo)(()=>{let e=R.trim().toLowerCase();if(!m&&!g&&!v&&!e)return z;let t=[];for(let n of z)m&&n.protocols[m]==null||g&&n.instance!==g||v&&n.model!==v||e&&!n.member.toLowerCase().includes(e)||t.push(n);return t},[z,m,g,v,R]),[ve,Te]=(0,U.useState)([]),[Ee,Ae]=(0,U.useState)({}),[W,G]=(0,U.useState)(0),Me=m!==``||g!==``||v!==``||b!==``,Ne=(0,U.useCallback)(()=>{h(``),_(``),y(``),S(``),G(0)},[h,_,y,S]),K=xe({data:H,columns:qe,getCoreRowModel:Ce(),getSortedRowModel:Se(),getExpandedRowModel:be(),getRowCanExpand:()=>!0,getPaginationRowModel:ye(),onSortingChange:Te,onExpandedChange:Ae,onPaginationChange:e=>{let t=typeof e==`function`?e({pageIndex:W,pageSize:T}):e;G(t.pageIndex),w(t.pageSize)},state:{sorting:ve,expanded:Ee,pagination:{pageIndex:W,pageSize:T}}}),q=Math.ceil(H.length/T);(0,U.useEffect)(()=>{C!==T&&w(T)},[T,C,w]),(0,U.useEffect)(()=>{q>0&&W>=q&&G(q-1)},[q,W]);let Pe=(0,U.useCallback)(e=>{G(0),w(e)},[w]),Fe=(0,U.useCallback)(e=>{G(0),h(e)},[h]),Ie=(0,U.useCallback)(e=>{G(0),_(e)},[_]),Le=(0,U.useCallback)(e=>{G(0),y(e)},[y]),J=(0,U.useCallback)(e=>{G(0),S(e)},[S]),[Y,Re]=(0,U.useState)(``),[ze,Z]=(0,U.useState)(``),Q=(0,U.useDeferredValue)(Y),$=(0,U.useDeferredValue)(ze),et=(0,U.useMemo)(()=>(Q?B.filter(([e])=>te(e,Q)):B).slice(0,Ze),[B,Q]),tt=(0,U.useMemo)(()=>($?V.filter(([e])=>ee(e,$)):V).slice(0,Ze),[V,$]),nt=K.getRowModel().rows,rt=nt.length,it=rt===0||H.length===0?0:W*T+1,at=rt===0||H.length===0?0:W*T+rt,ot=q,st=H.length===0||ot===0?0:W+1,ct=(0,U.useCallback)(()=>{let e=m?[m]:L,t=[`instance`,`member`,`model`,`dataType`,`unit`,`access`,`browsePath`,...e.includes(`mqtt`)?[`mqtt_topic`]:[],...e.includes(`opcua`)?[`opcua_nodeId`]:[],...e.includes(`modbus`)?[`modbus_address`,`modbus_count`,`modbus_encoding`]:[]],n=H.map(t=>{let n=t.protocols.mqtt,r=t.protocols.opcua,i=t.protocols.modbus;return[t.instance,t.member,t.model,t.dataType,t.unit??``,t.access,t.browsePath,...e.includes(`mqtt`)?[String(n?.topic??``)]:[],...e.includes(`opcua`)?[String(r?.nodeId??``)]:[],...e.includes(`modbus`)?[String(i?.address??``),String(i?.count??``),String(i?.registerType??``)]:[]]});Je([t.map($e).join(`,`),...n.map(e=>e.map($e).join(`,`))].join(`
|
|
4
|
+
`),`miravo-tags.csv`)},[H,m,L]);return N&&!O?(0,X.jsx)(se,{className:`min-h-full`,children:(0,X.jsx)(`div`,{className:`flex min-h-[40vh] flex-col items-center justify-center p-6 sm:p-12`,children:(0,X.jsx)(`div`,{className:`w-full max-w-md`,children:(0,X.jsx)(l,{message:F,onRetry:()=>void D.refetch(),isRetrying:D.isFetching})})})}):(0,X.jsxs)(`div`,{className:`mx-auto flex w-full max-w-screen-2xl flex-col gap-5 p-4 sm:gap-6 sm:p-6`,children:[N&&O?(0,X.jsx)(l,{message:`${F} Showing cached tags.`,onRetry:()=>void D.refetch(),isRetrying:D.isFetching}):null,(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsx)(`h1`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Tag Explorer`}),(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:P?`Loading tag manifest...`:`${O?.summary?.totalInstances??0} instances · ${L.length} protocols`})]}),(0,X.jsxs)(me,{children:[(0,X.jsxs)(pe,{render:(0,X.jsx)(x,{variant:`outline`,size:`sm`,className:ne(Ue,`px-3`)}),children:[(0,X.jsx)(oe,{className:`size-3.5 opacity-90`,"aria-hidden":!0}),`Export`,(0,X.jsx)(ie,{className:`size-3 opacity-60`,"aria-hidden":!0})]}),(0,X.jsx)(ue,{align:`end`,sideOffset:6,className:ne(`min-w-[13.5rem]`,Ve),children:(0,X.jsxs)(fe,{children:[(0,X.jsx)(ce,{className:He,children:`Export`}),(0,X.jsx)(de,{className:`bg-border/60`}),(0,X.jsxs)(le,{onClick:ct,className:We,children:[(0,X.jsx)(je,{className:`size-3.5 shrink-0 text-primary`,"aria-hidden":!0}),`Download CSV`]}),(0,X.jsxs)(le,{onClick:()=>t(!0),className:We,children:[(0,X.jsx)(De,{className:`size-3.5 shrink-0 text-primary`,"aria-hidden":!0}),`Export for Platform…`]})]})})]})]}),(0,X.jsx)(Ge,{protocol:m,instance:g,model:v,member:b,enabledProtocols:L,hasFilters:Me,memberSearchRef:n,onProtocolChange:Fe,onInstanceChange:Ie,onModelChange:Le,onMemberChange:J,onClearFilters:Ne,onInstanceSearch:Re,onModelSearch:Z,filteredInstanceOptions:et,filteredModelOptions:tt}),H.length!==z.length&&z.length>0&&(0,X.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Showing`,` `,(0,X.jsx)(`span`,{className:`font-medium tabular-nums text-foreground`,children:H.length}),` of`,` `,(0,X.jsx)(`span`,{className:`tabular-nums`,children:z.length}),` tags`]}),(0,X.jsx)(ge,{className:`min-w-0 py-0`,children:(0,X.jsx)(_e,{className:`p-0`,children:(0,X.jsx)(`div`,{className:`min-w-0 overflow-auto`,children:(0,X.jsxs)(`table`,{className:`w-full caption-bottom text-sm`,children:[(0,X.jsx)(`thead`,{className:`sticky top-0 z-10 border-b bg-background [&_tr]:border-b`,children:K.getHeaderGroups().map(e=>(0,X.jsx)(`tr`,{className:`border-b transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,children:e.headers.map(e=>{let t=e.column.columnDef.meta;return(0,X.jsx)(`th`,{className:`h-10 whitespace-nowrap px-1.5 text-left text-xs font-medium text-muted-foreground sm:px-4 ${t?.hideClass??``} ${t?.cellClass??``}`,children:e.isPlaceholder?null:we(e.column.columnDef.header,e.getContext())},e.id)})},e.id))}),(0,X.jsx)(`tbody`,{className:`[&_tr:last-child]:border-0`,children:P?null:nt.length>0?nt.map(e=>{let t=e.getIsExpanded(),n=e.getVisibleCells();return(0,X.jsxs)(U.Fragment,{children:[(0,X.jsx)(`tr`,{"aria-expanded":t,tabIndex:0,className:`cursor-pointer border-b transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent focus-visible:outline-none`,onClick:()=>e.toggleExpanded(),onKeyDown:t=>{t.key!==`Enter`&&t.key!==` `||(t.preventDefault(),e.toggleExpanded())},children:n.map(e=>{let t=e.column.columnDef.meta;return(0,X.jsx)(`td`,{className:`whitespace-nowrap px-1.5 py-1.5 text-left sm:px-4 ${t?.hideClass??``} ${t?.cellClass??``}`,children:we(e.column.columnDef.cell,e.getContext())},e.id)})}),t&&(0,X.jsx)(`tr`,{children:(0,X.jsx)(`td`,{colSpan:n.length,className:`p-0`,children:(0,X.jsx)(`div`,{className:`border-b`,children:(0,X.jsx)(`div`,{className:`px-1.5 py-3 pl-6 sm:px-4 sm:pl-10`,children:(0,X.jsx)(Ke,{tag:e.original,enabledProtocols:L})})})})})]},e.id)}):(0,X.jsx)(`tr`,{children:(0,X.jsx)(`td`,{colSpan:qe.length,className:`h-32 px-2 text-center sm:px-4`,children:z.length===0?(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,X.jsx)(ke,{className:`size-8 text-muted-foreground`}),(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No tags available`}),(0,X.jsx)(p,{to:`/catalog`,className:`text-xs text-primary underline-offset-4 hover:underline`,children:`Start an environment from the Catalog to generate tags`})]}):(0,X.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No matching tags.`,` `,(0,X.jsx)(`span`,{className:`text-xs`,children:`Try adjusting your filters.`})]})})})})]})})})}),(0,X.jsx)(`div`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3 sm:justify-start sm:gap-5`,children:[(0,X.jsxs)(`p`,{className:`min-w-0 leading-tight`,children:[(0,X.jsx)(`span`,{className:`font-medium tabular-nums text-foreground`,children:it===0?`0`:`${it}\u2013${at}`}),` `,(0,X.jsxs)(`span`,{className:`text-muted-foreground`,children:[`of `,H.length,` tags`]})]}),(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 whitespace-nowrap`,children:[(0,X.jsxs)(M,{value:String(T),onValueChange:e=>e&&Pe(Number(e)),children:[(0,X.jsx)(j,{className:`h-8 w-[4.25rem]`,"aria-label":`Rows per page`,children:(0,X.jsx)(re,{})}),(0,X.jsx)(A,{children:Ye.map(e=>(0,X.jsx)(k,{value:String(e),children:e},e))})]}),(0,X.jsx)(`span`,{className:`hidden text-muted-foreground sm:inline`,children:`per page`})]})]}),(0,X.jsxs)(`nav`,{className:`flex items-center justify-center gap-2 border-border/60 border-t pt-2 sm:justify-end sm:border-0 sm:pt-0`,"aria-label":`Table pages`,children:[(0,X.jsx)(x,{variant:`outline`,size:`sm`,className:`h-8 w-8 shrink-0 p-0`,disabled:!K.getCanPreviousPage(),onClick:()=>K.previousPage(),"aria-label":`Previous page`,children:(0,X.jsx)(Oe,{className:`size-3.5`})}),(0,X.jsxs)(`span`,{className:`min-w-[5ch] text-center text-sm font-medium tabular-nums whitespace-nowrap text-foreground`,children:[st,` / `,ot]}),(0,X.jsx)(x,{variant:`outline`,size:`sm`,className:`h-8 w-8 shrink-0 p-0`,disabled:!K.getCanNextPage(),onClick:()=>K.nextPage(),"aria-label":`Next page`,children:(0,X.jsx)(ae,{className:`size-3.5`})})]})]})}),(0,X.jsx)(Be,{open:e,onOpenChange:t,tags:H,totalTags:I.length,enabledProtocols:L,selectedInstance:g||void 0})]})}export{et as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{at as e}from"./vendor-ui-CWUk2ulb.js";import{r as t}from"./chunk-OE4NN4TA-DBWZidbW.js";import{n,t as r}from"./use-transition-navigate-DtyJz2Z1.js";var i=e();function a(e){return e.button===0&&!e.metaKey&&!e.altKey&&!e.ctrlKey&&!e.shiftKey}function o({to:e,transitionType:o,preloadOnIntent:s=!0,onClick:c,...l}){let u=r();return(0,i.jsx)(t,{...l,to:e,onMouseEnter:t=>{l.onMouseEnter?.(t),s&&n(e)},onFocus:t=>{l.onFocus?.(t),s&&n(e)},onClick:t=>{c?.(t),!t.defaultPrevented&&(l.reloadDocument||l.target&&l.target!==`_self`||l.download||a(t)&&(t.preventDefault(),u(e,{transitionType:o})))}})}export{o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{C as n,c as r,d as i,n as a,rt as o,y as s}from"./api-Bf6pFRhP.js";import{l as c}from"./copy-button-DnGsXbVV.js";import{n as l}from"./utils-XFKvwlFT.js";import{n as u,r as d,t as f}from"./runtime-link-D-uJbw97.js";var p=l(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),m=`group relative border border-solid border-border transition-colors hover:border-muted-foreground/25`,h=`group relative border border-solid border-border`,g=`blueprint-card ${m} overflow-hidden rounded-[var(--miravo-radius-stadium-sm)]`,_=`${h} w-full min-w-0 overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] bg-transparent`,v=`${h} w-full min-w-0 overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] bg-transparent`,y=`blueprint-card catalog-card-frame group relative border border-solid overflow-hidden rounded-[var(--miravo-radius-stadium-sm)]`,b=y,x=`border-border bg-muted/40 text-primary shadow-none hover:border-muted-foreground/30 hover:bg-muted/60 hover:text-primary focus-visible:border-ring border-border bg-muted/30 hover:border-muted-foreground/35 hover:bg-muted/45 [&_svg]:text-primary`,S=e(t(),1),C=new Set([`spawn`,`removeInstance`,`loadTemplate`,`unloadTemplateRun`,`resetEnvironment`,`enableAdapter`,`disableAdapter`]);function w(e){if(e instanceof f){c.error(`Command not sent`,{description:e.detail});return}if(e instanceof a){c.error(e.result.message,{description:e.result.error});return}if(n.is(e)){c.error(e.message,{description:e.hint});return}if(e instanceof TypeError){if(typeof navigator<`u`&&navigator.onLine===!1){c.error(`Command not sent`,{description:`This browser is offline — reconnect to the network and try again.`});return}let{connectionState:e}=o.getState(),t=d(e);if(t){c.error(`Command not sent`,{description:t});return}c.error(`Command failed`,{description:`Could not reach the Miravo server — it may have stopped or restarted.`});return}c.error(`Command failed`,{description:e instanceof Error?e.message:`Unknown error.`})}async function T(){try{let e=await r();s.setQueryData([`bootstrap`],e),e.authenticated?o.getState().replaceRuntime(e.runtime,{allowSameRevision:!0,allowRevisionRewind:!0}):o.getState().markUnauthenticated()}catch{}finally{s.invalidateQueries({queryKey:[`bootstrap`]})}}function E(){let[e,t]=(0,S.useState)(!1);return{mutate:(0,S.useCallback)(e=>{try{u(o.getState().connectionState)}catch(e){w(e);return}t(!0),i(e).then(t=>{if(c.success(t.message),C.has(e.type))return T()}).catch(w).finally(()=>{t(!1)})},[]),mutateAsync:(0,S.useCallback)(async e=>{try{u(o.getState().connectionState)}catch(e){throw w(e),e}t(!0);try{let t=await i(e);return c.success(t.message),C.has(e.type)&&await T(),t}catch(e){throw w(e),e}finally{t(!1)}},[]),isPending:e}}export{v as a,p as c,y as i,x as n,_ as o,g as r,b as s,E as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{at as n}from"./vendor-ui-CWUk2ulb.js";import{A as r,C as i,S as a,T as o,f as s,m as c,p as l,t as u,w as d}from"./api-Bf6pFRhP.js";import{t as f,u as p}from"./proxy-Be4WzmcS.js";import{t as m}from"./AnimatePresence-CPmH1DMY.js";import{a as h,i as g,l as _,n as v,o as ee,r as te,s as ne,t as y}from"./copy-button-DnGsXbVV.js";import{C as b,E as x,S,T as C}from"./format-B9CcV2dj.js";import{n as w,t as T}from"./utils-XFKvwlFT.js";import{a as E,c as re,i as D,l as ie,n as O,o as ae,r as oe,s as k,t as A}from"./select-CMOnuEoT.js";import{i as j,n as M,r as N,t as P}from"./platform-targets-BIQ1lKOg.js";import{a as se,c as F,o as I,s as L}from"./tabs-CCixnxMe.js";import{t as ce}from"./circle-question-mark-CJvcT6V6.js";import{i as R,n as z,r as le,t as ue}from"./checkbox-C84IyqEB.js";import{t as B}from"./triangle-alert-BXrJNk3g.js";import{i as V,n as H,t as U}from"./tooltip-D1ydB4g3.js";import{t as W}from"./badge-i00PiRCo.js";import{t as G}from"./label-DTHSKF2S.js";import{n as de,t as fe}from"./get-error-message-yQcVJ-Ja.js";var pe=w(`ban`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]),K=w(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),me=w(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),he=w(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),ge=w(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),_e=w(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),ve=w(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),ye=w(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),be=w(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),xe=w(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Se=w(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Ce=w(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),q=e(t(),1),J=n();function Y({className:e,...t}){return(0,J.jsx)(`div`,{"data-slot":`skeleton`,className:T(`animate-pulse rounded-[var(--miravo-radius-tight)] bg-muted`,e),...t})}var we=[`devices`,`models`,`instances`],Te=[`instances`,`models`,`devices`],Ee={label:`Alias policy`,value:`Miravo hyphens, LE underscores`},De=[{label:`Protocol`,value:`Template defaults`},Ee],Oe={devices:`DeviceHub devices`,models:`Digital Twins models`,instances:`Digital Twins instances`},ke={devices:{apply:`DeviceHub device records and settings on Litmus Edge.`,cleanup:`Remove DeviceHub device records managed from Miravo.`},models:{apply:`Digital Twins model definitions synced to the platform.`,cleanup:`Remove Digital Twins model definitions created by Miravo.`},instances:{apply:`Digital Twins instances bound to DeviceHub devices.`,cleanup:`Remove Digital Twins instances deployed for this target.`}},Ae=`Miravo calls this API.`;function je(e){return e.length>120?`Use at most 120 characters.`:/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e)?null:`Use lowercase letters, numbers, and hyphens only (e.g. motor-001).`}function Me(e){return e.length>120?`Use at most 120 characters.`:/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e)?null:`Use lowercase letters, numbers, and hyphens only (e.g. env-a or line-1).`}function Ne(e){let t=e?.trim().toLowerCase();if(t)return r(t)}function Pe(e){return e.replace(/-/g,`_`)}function Fe({targetId:e,model:t,protocol:n,result:r}){return{targetId:e,model:t,protocol:n,scope:r.scope,deviceName:r.deviceName,ifUnmanaged:r.ifUnmanaged}}function Ie({targetId:e,template:t,result:n,protocol:r}){return{targetId:e,template:t,...r?{protocol:r}:{},scope:n.scope,namePrefix:n.namePrefix,ifUnmanaged:n.ifUnmanaged}}function Le({targetId:e,template:t,allManaged:n,result:r}){return{targetId:e,...n?{allManaged:!0}:{template:t},scope:r.scope}}var X=`Source host (Miravo)`,Re=`Address Litmus Edge uses to reach your running Miravo environment.`;function ze({open:e,onOpenChange:t,type:n,label:r,targetLabel:i,hostname:a,sourceHostname:o,onConfirm:s,defaultDeviceName:c,defaultNamePrefix:l,metadata:u=[],applyPreview:d,cleanupPreview:p}){let m=n===`apply`?we:Te,[_,ee]=(0,q.useState)(new Set(m)),[y,x]=(0,q.useState)(!1),[C,w]=(0,q.useState)(!1),[E,re]=(0,q.useState)(``),[D,O]=(0,q.useState)(null),[ae,oe]=(0,q.useState)(``),[k,A]=(0,q.useState)(null),[j,M]=(0,q.useState)(`fail`),N=(0,q.useId)(),P=(0,q.useId)(),se=(0,q.useId)(),F=`if-unmanaged-${se}`,I=n===`apply`,L=Ne(l),R=I&&c!==void 0&&c!==``,z=I&&!R&&L!==void 0,B=(E.trim()===``?c??``:E.trim().toLowerCase()).trim(),W=(ae.trim()===``?L??``:ae.trim().toLowerCase()).trim(),de=B?Pe(B):``;(0,q.useEffect)(()=>{e&&(ee(new Set(m)),x(!1),O(null),A(null),re(R?c??``:``),oe(z?L??``:``),M(`fail`),w(!1))},[e,m,R,c,z,L]);let fe={instances:`models`},pe=e=>{ee(t=>{let n=new Set(t);if(n.has(e)){n.delete(e);for(let[t,r]of Object.entries(fe))r===e&&n.delete(t)}else{n.add(e);let t=fe[e];t&&n.add(t)}return n})},K=I?d:p,me=()=>{let e=m.filter(e=>_.has(e));if(e.length===0)return null;if(R){let t=B,n=je(t);return n?(O(n),null):(O(null),A(null),{scope:e,deviceName:t,ifUnmanaged:j})}if(z){let t=W,n=Me(t);return n?(A(n),null):(A(null),{scope:e,namePrefix:t,ifUnmanaged:j})}return{scope:e,ifUnmanaged:j}},he=e=>{K?.onPreview(e),t(!1)};return(0,J.jsx)(v,{open:e,onOpenChange:t,children:(0,J.jsxs)(te,{showCloseButton:!0,className:`flex max-h-[90vh] min-h-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-120`,children:[(0,J.jsxs)(`div`,{className:`shrink-0 border-b border-border/60 px-5 pb-3 pt-5`,children:[(0,J.jsxs)(ne,{className:`flex items-center gap-2 text-sm font-semibold leading-snug`,children:[I?(0,J.jsx)(le,{className:`size-3.5 shrink-0 text-primary`,"aria-hidden":!0}):(0,J.jsx)(Ce,{className:`size-3.5 shrink-0 text-destructive`,"aria-hidden":!0}),I?`Apply to Litmus Edge`:`Clean up Litmus Edge`]}),(0,J.jsx)(g,{className:`sr-only`,children:I?`Review connection details and scope before applying.`:`Review target and cleanup scope before confirming.`})]}),(0,J.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain px-5 pt-4 pb-3`,children:(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-5`,children:[(0,J.jsx)(`div`,{className:`text-xs leading-snug`,children:(0,J.jsxs)(`dl`,{className:`flex flex-col gap-0`,children:[(0,J.jsxs)(`div`,{className:`grid grid-cols-2 items-start gap-x-4 border-b border-border/35 py-2.5 first:pt-0`,children:[(0,J.jsx)(`dt`,{className:`min-w-0 pt-px text-[11px] font-medium text-muted-foreground`,children:I?`Resource`:`Target`}),(0,J.jsx)(`dd`,{className:`min-w-0 wrap-break-word font-medium text-foreground`,children:r})]}),(0,J.jsxs)(`div`,{className:`grid grid-cols-2 items-start gap-x-4 border-b border-border/35 py-2.5`,children:[(0,J.jsx)(`dt`,{className:`min-w-0 pt-px text-[11px] font-medium text-muted-foreground`,children:`Target`}),(0,J.jsx)(`dd`,{className:`min-w-0 wrap-break-word font-medium text-foreground`,children:i})]}),(0,J.jsxs)(`div`,{className:`grid grid-cols-2 items-start gap-x-4 border-b border-border/35 py-2.5`,children:[(0,J.jsx)(`dt`,{className:`min-w-0 pt-px`,children:(0,J.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1`,children:[(0,J.jsx)(`span`,{className:`text-[11px] font-medium leading-snug text-muted-foreground`,children:`Litmus Edge API`}),(0,J.jsxs)(U,{children:[(0,J.jsx)(V,{type:`button`,className:`inline-flex size-5 shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":`About Litmus Edge API`,children:(0,J.jsx)(ce,{className:`size-3`,"aria-hidden":!0})}),(0,J.jsx)(H,{side:`top`,align:`start`,className:`max-w-xs text-left`,children:Ae})]})]})}),(0,J.jsx)(`dd`,{className:`min-w-0`,children:(0,J.jsx)(`span`,{className:`break-all font-mono text-[11px] leading-normal text-foreground/90`,children:a})})]}),(0,J.jsxs)(`div`,{className:`grid grid-cols-2 items-start gap-x-4 border-b border-border/35 py-2.5`,children:[(0,J.jsx)(`dt`,{className:`min-w-0 pt-px`,children:(0,J.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1`,children:[(0,J.jsx)(`span`,{className:`text-[11px] font-medium leading-snug text-muted-foreground`,children:X}),(0,J.jsxs)(U,{children:[(0,J.jsx)(V,{type:`button`,className:`inline-flex size-5 shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":`About ${X}`,children:(0,J.jsx)(ce,{className:`size-3`,"aria-hidden":!0})}),(0,J.jsx)(H,{side:`top`,align:`start`,className:`max-w-xs text-left`,children:Re})]})]})}),(0,J.jsx)(`dd`,{className:`min-w-0`,children:(0,J.jsx)(`span`,{className:`break-all font-mono text-[11px] leading-normal text-foreground/90`,children:o})})]}),R&&B?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`grid grid-cols-2 items-start gap-x-4 border-b border-border/35 py-2.5`,children:[(0,J.jsx)(`dt`,{className:`min-w-0 pt-px text-[11px] font-medium text-muted-foreground`,children:`Miravo instance ID`}),(0,J.jsx)(`dd`,{className:`min-w-0 break-all font-mono text-[11px] leading-normal text-foreground/90`,children:B})]}),(0,J.jsxs)(`div`,{className:`grid grid-cols-2 items-start gap-x-4 border-b border-border/35 py-2.5`,children:[(0,J.jsx)(`dt`,{className:`min-w-0 pt-px text-[11px] font-medium text-muted-foreground`,children:`Litmus Edge alias`}),(0,J.jsx)(`dd`,{className:`min-w-0 break-all font-mono text-[11px] leading-normal text-foreground/90`,children:de})]})]}):null,u.map(e=>(0,J.jsxs)(`div`,{className:`grid grid-cols-2 items-start gap-x-4 border-b border-border/35 py-2.5`,children:[(0,J.jsx)(`dt`,{className:`min-w-0 pt-px text-[11px] font-medium text-muted-foreground`,children:e.label}),(0,J.jsx)(`dd`,{className:`min-w-0 wrap-break-word font-medium text-foreground`,children:e.value})]},`${e.label}:${e.value}`))]})}),K?(0,J.jsxs)(G,{className:T(`flex cursor-pointer items-center gap-2.5 text-[11px] font-medium leading-snug`,K.disabled&&`pointer-events-none opacity-50`),children:[(0,J.jsx)(`span`,{className:`flex shrink-0 items-center`,children:(0,J.jsx)(ue,{checked:C,onCheckedChange:e=>w(e===!0),disabled:K.disabled})}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 leading-snug`,children:I?`Dry run only — preview the plan without deploying`:`Dry run only — preview the plan without removing resources`})]}):null,R?(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,J.jsx)(G,{htmlFor:N,className:`text-[11px] font-medium`,children:`Miravo instance ID`}),(0,J.jsx)(S,{id:N,value:E,maxLength:120,onChange:e=>{let t=e.target.value;re(t),O(je((t.trim()===``?c??``:t.trim().toLowerCase()).trim()))},placeholder:c,autoComplete:`off`,spellCheck:!1,className:T(`h-9 min-w-0 font-mono text-xs`,D&&`border-destructive`),"aria-invalid":D!=null,"aria-describedby":`${N}-hint`}),(0,J.jsx)(`p`,{id:`${N}-hint`,className:`min-w-0 wrap-break-word text-[11px] leading-snug text-foreground/76`,children:`Same instance ID on a later run updates this asset; hyphens stay in Miravo.`}),de?(0,J.jsxs)(`p`,{className:`min-w-0 wrap-break-word text-[11px] leading-snug text-foreground/76`,children:[`LE alias`,` `,(0,J.jsxs)(`span`,{className:`break-all font-mono text-foreground`,children:[B,` -> `,de]})]}):null,D?(0,J.jsx)(`p`,{className:`text-[11px] text-destructive`,children:D}):null]}):null,z?(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,J.jsx)(G,{htmlFor:P,className:`text-[11px] font-medium`,children:`Name prefix`}),(0,J.jsx)(S,{id:P,value:ae,maxLength:120,onChange:e=>{let t=e.target.value;oe(t),A(Me((t.trim()===``?L??``:t.trim().toLowerCase()).trim()))},placeholder:L,autoComplete:`off`,spellCheck:!1,className:T(`h-9 min-w-0 font-mono text-xs`,k&&`border-destructive`),"aria-invalid":k!=null,"aria-describedby":`${P}-hint`}),(0,J.jsxs)(`p`,{id:`${P}-hint`,className:`min-w-0 wrap-break-word text-[11px] leading-snug text-foreground/76`,children:[`Generated aliases use this prefix. Example`,` `,(0,J.jsxs)(`span`,{className:`break-all font-mono text-foreground`,children:[W||L,`-pump-001 ->`,` `,Pe(`${W||L}-pump-001`)]})]}),k?(0,J.jsx)(`p`,{className:`text-[11px] text-destructive`,children:k}):null]}):null,(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`button`,{type:`button`,className:`group flex w-full items-center justify-between gap-2 rounded-[var(--miravo-radius-tight)] bg-muted/40 px-2.5 py-2 text-left text-[11px] font-medium text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground aria-expanded:bg-muted/55 aria-expanded:text-foreground`,onClick:()=>x(e=>!e),"aria-expanded":y,children:[`Advanced`,(0,J.jsx)(ie,{className:T(`size-3.5 shrink-0 text-muted-foreground transition-transform ease-out group-hover:text-foreground/80`,y?`duration-500 rotate-180 text-foreground/80`:`duration-280`),"aria-hidden":!0})]}),(0,J.jsxs)(f.div,{initial:!1,animate:{maxHeight:y?520:0,opacity:+!!y},transition:{maxHeight:{duration:y?.52:.28,ease:y?[.16,1,.3,1]:[.4,0,.2,1]},opacity:{duration:y?.42:.24,ease:y?[.16,1,.3,1]:[.4,0,.2,1]}},className:T(`overflow-hidden`,!y&&`pointer-events-none`),"aria-hidden":!y,inert:!y,children:[(0,J.jsx)(`div`,{className:`flex flex-col gap-1 pt-px`,children:m.map(e=>{let t=Object.entries(fe).find(([t,n])=>n===e)?.[0],n=t!==void 0&&_.has(t),r=I?ke[e].apply:ke[e].cleanup;return(0,J.jsxs)(G,{htmlFor:`scope-${e}`,className:T(`flex min-h-9 cursor-pointer items-start gap-2 rounded-[var(--miravo-radius-tight)] border border-border/40 bg-muted/10 px-2.5 py-1.5 text-[11px] transition-colors`,n?`opacity-95`:`hover:bg-muted/25`),children:[(0,J.jsx)(`span`,{className:`pt-0.5`,children:(0,J.jsx)(ue,{id:`scope-${e}`,checked:_.has(e),disabled:n,onCheckedChange:()=>pe(e)})}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-1 leading-snug`,children:[(0,J.jsx)(`span`,{className:`font-medium text-foreground`,children:Oe[e]}),(0,J.jsx)(`span`,{className:`mt-0.5 block text-[11px] font-normal leading-tight text-muted-foreground`,children:r})]}),n?(0,J.jsx)(`span`,{className:`shrink-0 self-start rounded-[var(--miravo-radius-tight)] border border-primary/35 bg-primary/10 px-1.5 py-px text-[10px] font-semibold uppercase tracking-wide text-primary`,title:`Required when Digital Twins instances are selected (models must stay in scope).`,children:`Required`}):null]},e)})}),I&&(0,J.jsxs)(`div`,{className:`mt-2.5 space-y-1.5 border-t border-border/40 pt-2`,children:[(0,J.jsx)(`p`,{id:`${se}-legend`,className:`text-[11px] font-medium uppercase tracking-wide text-foreground/80`,children:`Collision policy`}),(0,J.jsxs)(`div`,{role:`radiogroup`,"aria-labelledby":`${se}-legend`,className:`flex flex-col gap-1`,children:[(0,J.jsxs)(G,{htmlFor:`if-unmanaged-fail`,className:T(`flex cursor-pointer items-start gap-2 rounded-[var(--miravo-radius-tight)] border px-2.5 py-2 text-[11px] transition-colors`,j===`fail`?`border-primary/45 bg-primary/8`:`border-border/40 bg-muted/10 hover:bg-muted/25`),children:[(0,J.jsx)(`input`,{id:`if-unmanaged-fail`,type:`radio`,name:F,value:`fail`,checked:j===`fail`,onChange:()=>M(`fail`),className:`mt-0.5 size-3.5 shrink-0 accent-primary`}),(0,J.jsxs)(`span`,{className:`min-w-0`,children:[(0,J.jsx)(`span`,{className:`font-medium text-foreground`,children:`Fail if unmanaged exists`}),(0,J.jsx)(`span`,{className:`mt-px block text-[11px] leading-tight text-foreground/74`,children:`Stop if the target has unmanaged resources.`})]})]}),(0,J.jsxs)(G,{htmlFor:`if-unmanaged-skip`,className:T(`flex cursor-pointer items-start gap-2 rounded-[var(--miravo-radius-tight)] border px-2.5 py-2 text-[11px] transition-colors`,j===`skip`?`border-primary/45 bg-primary/8`:`border-border/40 bg-muted/10 hover:bg-muted/25`),children:[(0,J.jsx)(`input`,{id:`if-unmanaged-skip`,type:`radio`,name:F,value:`skip`,checked:j===`skip`,onChange:()=>M(`skip`),className:`mt-0.5 size-3.5 shrink-0 accent-primary`}),(0,J.jsxs)(`span`,{className:`min-w-0`,children:[(0,J.jsx)(`span`,{className:`font-medium text-foreground`,children:`Skip unmanaged resources`}),(0,J.jsx)(`span`,{className:`mt-px block text-[11px] leading-tight text-foreground/74`,children:`Only update resources managed by Miravo.`})]})]})]})]})]}),_.size===0&&!(C&&K)?(0,J.jsx)(`p`,{className:`text-[11px] text-destructive`,children:`Select at least one scope or reopen to reset.`}):null]})]})}),(0,J.jsxs)(h,{className:`mx-0 mb-0 shrink-0 flex flex-col gap-2 border-t border-border/60 px-5 py-4 sm:flex-row sm:justify-end`,children:[(0,J.jsx)(b,{type:`button`,variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,J.jsx)(b,{type:`button`,variant:I||C&&p?`default`:`destructive`,onClick:()=>{let e=me();if(e){if(C&&K){he(e);return}s(e)}},disabled:C&&K?K.disabled||K.planLoading:_.size===0,children:I?C&&d?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(be,{className:`size-3`,"aria-hidden":!0}),`Preview changes`]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(le,{className:`size-3`,"aria-hidden":!0}),`Apply`]}):C&&p?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(be,{className:`size-3`,"aria-hidden":!0}),`Preview changes`]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Ce,{className:`size-3`,"aria-hidden":!0}),`Clean up`]})})]})]})})}var Be={initial:{scale:0,opacity:0},animate:{scale:1,opacity:1,originY:0},exit:{scale:0,opacity:0},transition:{type:`spring`,stiffness:350,damping:40}},Ve={initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{type:`tween`,duration:.22,ease:[.16,1,.3,1]}};function He({children:e,variant:t=`default`}){let n=t===`default`;return(0,J.jsx)(f.div,{...n?Be:Ve,layout:n,className:`mx-auto w-full`,children:e})}var Ue=q.memo(({children:e,className:t,delay:n=1e3,...r})=>{let[i,a]=(0,q.useState)(0),o=(0,q.useMemo)(()=>q.Children.toArray(e),[e]);(0,q.useEffect)(()=>{let e=null;return i<o.length-1&&(e=setTimeout(()=>{a(e=>(e+1)%o.length)},n)),()=>{e!==null&&clearTimeout(e)}},[i,n,o.length]);let s=(0,q.useMemo)(()=>o.slice(0,i+1).reverse(),[i,o]);return(0,J.jsx)(`div`,{className:T(`flex flex-col items-center gap-4`,t),...r,children:(0,J.jsx)(m,{children:s.map(e=>(0,J.jsx)(He,{children:e},e.key))})})});Ue.displayName=`AnimatedList`;function We({type:e,errorMessage:t,className:n}){return null}var Ge=`text-destructive hover:bg-destructive/25 hover:text-foreground`,Ke={device:`Devices`,tags:`Tags`,model:`Models`,instance:`Instances`,"param-sync":`Parameters`};function qe(e){return Ke[e]??e}function Je(e){switch(e){case`create`:return`border border-success/30 bg-success/15 text-success`;case`update`:return`border border-chart-3/30 bg-chart-3/15 text-chart-3`;case`replace`:return`border border-warning/30 bg-warning/15 text-warning`;case`delete`:return`border border-destructive/30 bg-destructive/15 text-destructive`;case`noop`:return`border border-border/60 bg-muted/70 text-foreground/75`;default:return`border border-border/50 bg-muted/80 text-foreground/85`}}function Ye(e){return e===`noop`?`no-op`:e}function Xe({status:e}){switch(e){case`success`:return(0,J.jsx)(F,{className:`size-3.5 shrink-0 text-success`});case`failed`:return(0,J.jsx)(L,{className:`size-3.5 shrink-0 text-destructive`});case`pending`:return(0,J.jsx)(I,{className:`size-3.5 shrink-0 animate-spin text-primary/90`})}}function Ze({status:e}){switch(e){case`done`:return(0,J.jsx)(F,{className:`size-3.5 text-success`});case`active`:return(0,J.jsx)(I,{className:`size-3.5 animate-spin text-primary`});case`pending`:return(0,J.jsx)(he,{className:`size-3.5 text-foreground/55`})}}function Qe({entry:e}){let[t,n]=(0,q.useState)(!1);return(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,J.jsxs)(`button`,{type:`button`,className:T(`flex items-center gap-2 rounded-[var(--miravo-radius-tight)] px-2 py-1 text-left transition-colors`,e.error?`cursor-pointer hover:bg-muted/40`:`cursor-default`),onClick:()=>e.error&&n(!t),disabled:!e.error,children:[(0,J.jsx)(Xe,{status:e.status}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[11px] text-foreground`,children:e.name}),(0,J.jsx)(`span`,{className:T(`inline-flex rounded-[var(--miravo-radius-tight)] px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-wider`,Je(e.action)),children:Ye(e.action)}),e.error&&(0,J.jsx)(ie,{className:T(`size-3 text-foreground/75 transition-transform`,t&&`rotate-180`)})]}),(0,J.jsx)(m,{initial:!1,children:t&&e.error&&(0,J.jsxs)(f.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.18},className:`overflow-hidden`,children:[(0,J.jsxs)(`div`,{className:`mb-0 flex min-w-0 w-full items-center gap-1.5 rounded-[var(--miravo-radius-tight)] border border-destructive/40 bg-destructive/15 px-2.5 py-1.5 text-[10px] font-medium leading-relaxed`,children:[(0,J.jsx)(`p`,{className:`min-w-0 flex-1 text-left whitespace-normal break-words text-destructive [overflow-wrap:anywhere]`,children:e.error}),(0,J.jsx)(y,{value:e.error,label:`Copy error`,className:T(Ge,`shrink-0`)})]}),(0,J.jsx)(We,{type:`apply`,errorMessage:e.error,className:`mb-1 mt-2.5 w-full min-w-0`})]})})]})}function $e({phase:e,open:t,onOpenChange:n}){let r=e.resources.length,i=r===e.total,a=e.resources.length>0;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,J.jsxs)(`button`,{type:`button`,className:T(`flex w-full items-center gap-2 rounded-[var(--miravo-radius-tight)] px-1 py-1 text-left transition-colors`,a&&`hover:bg-muted/40`,!a&&`cursor-default`),disabled:!a,"aria-expanded":a?t:void 0,onClick:()=>a&&n(!t),children:[(0,J.jsx)(Ze,{status:e.status}),(0,J.jsx)(`span`,{className:`text-xs font-medium tracking-wide text-foreground`,children:qe(e.name)}),(0,J.jsxs)(`span`,{className:`font-mono text-[10px] text-foreground/70`,children:[r,`/`,e.total]}),(0,J.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[i&&e.status===`done`&&(0,J.jsx)(F,{className:`size-3 text-success`}),a&&(0,J.jsx)(ie,{className:T(`size-3 text-foreground/75 transition-transform`,!t&&`-rotate-90`),"aria-hidden":!0})]})]}),(0,J.jsx)(m,{initial:!1,children:a&&t&&(0,J.jsx)(f.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.25,ease:[.16,1,.3,1]},className:`overflow-hidden`,children:(0,J.jsx)(`div`,{className:`ml-2 flex min-w-0 flex-col border-l border-border/55 pl-2.5 pr-1.5 pb-1 pt-0.5`,children:(0,J.jsx)(p.Provider,{value:null,children:e.resources.map((e,t)=>(0,J.jsx)(He,{variant:`subtle`,children:(0,J.jsx)(Qe,{entry:e})},`${e.name}-${t}`))})})})})]})}function et({operation:e}){let t=e.status===`complete`,n=e.status===`cancelled`,r=e.failed>0,i=e.totalPlanned>0?Math.min(100,nt(e)/e.totalPlanned*100):0;return(0,J.jsx)(`div`,{className:`h-1 w-full overflow-hidden rounded-full bg-muted/55`,role:`progressbar`,"aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":`Operation progress`,children:(0,J.jsx)(f.div,{"aria-hidden":`true`,className:T(`h-full rounded-full transition-colors duration-500`,n?`bg-foreground/30`:t&&!r?`bg-success`:`bg-warning`),initial:{width:`0%`},animate:{width:`${i}%`},transition:{duration:.4,ease:[.25,.1,.25,1]}})})}function tt(e){return e.duration==null?(Date.now()-e.startedAt)/1e3:e.duration/1e3}function nt(e){let t=e.applied+e.failed;return e.totalPlanned>0?Math.min(t,e.totalPlanned):t}function rt(e,t){let n=e.label;return t?.length?t.find(e=>e.id===n)?.name??n:n}var it={complete:{Icon:F,className:`size-4 text-success`},partial:{Icon:me,className:`size-4 text-warning`},cancelled:{Icon:pe,className:`size-4 text-foreground/65`},error:{Icon:L,className:`size-4 text-destructive`},running:{Icon:I,className:`size-4 animate-spin text-warning`}};function at({icon:e,className:t}){return(0,J.jsx)(f.div,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:`spring`,stiffness:500,damping:30},className:`shrink-0`,children:(0,J.jsx)(e,{className:t})})}function ot({operation:e,sourceLabel:t,isAllExpanded:n,onToggleAll:r}){let i=tt(e),a=nt(e),o=e.status===`complete`,s=e.status===`cancelled`,c=e.status===`error`,l=e.failed>0,u=o&&!l?`complete`:o&&l?`partial`:s?`cancelled`:c?`error`:`running`,d=it[u];return(0,J.jsxs)(`div`,{className:T(`sticky top-0 z-10 flex min-w-0 w-full flex-col gap-1.5 rounded-[var(--miravo-radius-stadium-sm)] border px-3 pt-2.5 pb-3.5 backdrop-blur-sm transition-colors duration-500`,o&&!l&&`border-success/30 bg-success/5`,o&&l&&`border-warning/30 bg-warning/5`,s&&`border-border/60 bg-muted/50`,c&&`border-destructive/30 bg-destructive/5`,!o&&!s&&!c&&`border-warning/20 bg-warning/5`),children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,J.jsx)(m,{mode:`wait`,initial:!1,children:(0,J.jsx)(at,{icon:d.Icon,className:d.className},u)}),(0,J.jsx)(`span`,{className:`text-xs font-medium leading-none text-foreground`,children:s?`Cancelled`:o?l?`Completed with errors`:`Complete`:c?`Failed`:e.retryPending?`Failed, retrying attempt ${e.attempt?e.attempt+1:2}/${e.maxAttempts} in ${e.retryDelayMs?e.retryDelayMs/1e3:3}s...`:e.attempt&&e.maxAttempts&&e.attempt>1?`Retrying attempt ${e.attempt}/${e.maxAttempts}...`:e.type===`apply`?`Applying...`:`Cleaning up...`}),(0,J.jsxs)(`span`,{className:`w-full min-w-0 text-[10px] leading-tight text-foreground/78`,children:[(0,J.jsx)(`span`,{className:`font-sans break-words`,children:t}),(0,J.jsx)(`span`,{className:`font-mono break-words`,children:` → ${e.environment}`})]})]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,J.jsx)(W,{variant:`secondary`,className:`h-5 min-h-5 gap-0 overflow-hidden border border-border/50 bg-muted/70 px-1.5 !py-0 font-mono text-[10px] leading-none text-foreground shadow-sm [&>span]:inline-flex [&>span]:items-center`,children:(0,J.jsxs)(`span`,{className:`gap-1`,children:[(0,J.jsx)(m,{mode:`popLayout`,initial:!1,children:(0,J.jsx)(f.span,{initial:{opacity:0,y:-6},animate:{opacity:1,y:0},exit:{opacity:0,y:6},transition:{type:`spring`,stiffness:500,damping:35},className:`inline tabular-nums`,children:a},a)}),`/`,e.totalPlanned,(0,J.jsx)(`span`,{className:`text-foreground/72`,children:e.type===`apply`?`applied`:`deleted`})]})}),(0,J.jsx)(m,{initial:!1,children:e.failed>0&&(0,J.jsx)(f.div,{className:`inline-flex items-center`,initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{type:`spring`,stiffness:500,damping:30},children:(0,J.jsxs)(W,{variant:`destructive`,className:`h-5 min-h-5 gap-0 border border-destructive/35 bg-destructive/20 px-1.5 !py-0 font-mono text-[10px] font-semibold leading-none text-destructive`,children:[e.failed,` failed`]})})})]}),(0,J.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-mono text-[10px] leading-none text-foreground/75`,children:[(0,J.jsx)(_e,{className:`size-3 shrink-0 block text-foreground/65`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`tabular-nums leading-none`,children:typeof i==`number`?`${i.toFixed(1)}s`:`...`})]}),r&&(0,J.jsx)(`div`,{className:`flex items-center border-l border-border/40 pl-2`,children:(0,J.jsx)(`button`,{type:`button`,onClick:r,className:`flex size-4.5 items-center justify-center rounded-[var(--miravo-radius-tight)] text-foreground/55 transition-colors hover:bg-muted/60 hover:text-foreground`,"aria-label":n?`Collapse all phases`:`Expand all phases`,title:n?`Collapse all`:`Expand all`,children:(0,J.jsx)(K,{className:T(`size-3.5 transition-transform duration-300`,!n&&`opacity-70 scale-y-[-1]`)})})})]})]}),(0,J.jsx)(et,{operation:e})]})]})}function st(e){return e?e.closest(`[data-edge-op-scroll]`)??e.closest(`.overflow-y-auto`):null}var ct=350;function Z(e){e?.scrollIntoView({block:`end`,behavior:`auto`,inline:`nearest`})}function lt(e){let t=()=>Z(e);t(),requestAnimationFrame(t),requestAnimationFrame(()=>requestAnimationFrame(t)),window.setTimeout(t,0),window.setTimeout(t,48),window.setTimeout(t,120)}function ut({logs:e}){return e.length===0?null:(0,J.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1.5 px-2 pb-2`,children:e.map(e=>(0,J.jsxs)(`div`,{className:T(`flex min-w-0 items-start gap-2 rounded-[var(--miravo-radius-tight)] border px-2.5 py-2 text-xs`,e.level===`error`?`border-destructive/35 bg-destructive/12 text-destructive`:e.level===`warn`?`border-warning/35 bg-warning/12 text-warning`:`border-primary/25 bg-primary/8 text-foreground/82`),children:[e.level===`info`?(0,J.jsx)(R,{className:`mt-0.5 size-3.5 shrink-0 text-primary`,"aria-hidden":!0}):(0,J.jsx)(me,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`min-w-0 wrap-anywhere`,children:e.message})]},e.id))})}function dt({operation:e,catalogTemplates:t,logs:n}){let r=(0,q.useRef)(null),i=(0,q.useRef)(null),a=(0,q.useRef)(!0),o=(0,q.useRef)(e.status);o.current=e.status;let s=(0,q.useRef)(!1),[c,l]=(0,q.useState)(new Set),u=(0,q.useMemo)(()=>rt(e,t),[e,t]);(0,q.useLayoutEffect)(()=>{let e=st(r.current);if(!e)return;let t=()=>{a.current=e.scrollHeight-e.scrollTop-e.clientHeight<ct};return e.addEventListener(`scroll`,t,{passive:!0}),t(),()=>{e.removeEventListener(`scroll`,t)}},[]),(0,q.useLayoutEffect)(()=>{if(e.status===`running`){a.current&&Z(i.current),s.current=!0;return}s.current&&=(lt(i.current),!1)},[e.status,e.applied,e.failed,e.phases]),(0,q.useEffect)(()=>{if(e.status!==`running`)return;let t=r.current;if(!t)return;let n=0,s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=requestAnimationFrame(()=>{o.current===`running`&&a.current&&Z(i.current)})});return s.observe(t),a.current&&Z(i.current),()=>{s.disconnect(),cancelAnimationFrame(n)}},[e.status]);let d=e.phases.length>0,p=c.size===0;return(0,J.jsxs)(`div`,{ref:r,className:`flex min-w-0 w-full flex-col gap-2`,children:[(0,J.jsx)(ot,{operation:e,sourceLabel:u,isAllExpanded:p,onToggleAll:d?()=>{l(p?new Set(e.phases.map(e=>e.name)):new Set)}:void 0}),(0,J.jsx)(`div`,{className:`flex flex-col gap-1 px-2 pt-2 pb-4`,children:e.phases.map(e=>(0,J.jsx)(`div`,{children:(0,J.jsx)($e,{phase:e,open:!c.has(e.name),onOpenChange:t=>{l(n=>{let r=new Set(n);return t?r.delete(e.name):r.add(e.name),r})}})},e.name))}),(0,J.jsx)(m,{initial:!1,children:e.error&&e.retryPending&&(0,J.jsxs)(f.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:`sticky bottom-2 z-20 mx-2 mt-auto mb-2 flex items-center gap-2 overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-destructive/40 bg-destructive/15 px-3 py-2 text-xs font-medium text-destructive shadow-md backdrop-blur-md`,children:[(0,J.jsx)(I,{className:`size-4 shrink-0 animate-spin`}),(0,J.jsx)(`span`,{className:`truncate`,children:e.error})]})}),(0,J.jsx)(m,{initial:!1,children:e.error&&e.status===`error`&&(0,J.jsxs)(f.div,{initial:{opacity:0,height:0,marginTop:0},animate:{opacity:1,height:`auto`,marginTop:8},exit:{opacity:0,height:0,marginTop:0},transition:{duration:.2},className:`mx-2 mb-4 flex min-w-0 flex-col gap-0 overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-destructive/40 bg-destructive/15 px-3 py-2 text-xs font-medium`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(`p`,{className:`min-w-0 flex-1 text-left wrap-anywhere text-destructive`,children:e.error}),(0,J.jsx)(y,{value:e.error,label:`Copy error`,className:T(Ge,`shrink-0`)})]}),(0,J.jsx)(We,{type:e.type,errorMessage:e.error,className:`mt-3 w-full min-w-0`})]})}),n&&n.length>0?(0,J.jsx)(ut,{logs:n}):null,(0,J.jsx)(`div`,{ref:i,className:`h-px w-full shrink-0`,"aria-hidden":!0})]})}function ft({format:e,kind:t}){return e===`source-yaml`?t===`model`?`Raw twin model definition. Edit locally, version-control, or use as input for the CLI.`:`Raw environment definition with topology and namespace. Edit, share, or apply via CLI.`:e===`litmus-edge`?t===`model`?`Litmus Edge Digital Twin JSON for manual import via the LE UI or GraphQL API.`:`Litmus Edge template JSON (DeviceHub devices + Digital Twins). Import directly via the Litmus Edge UI.`:`Select a format to download.`}function pt({children:e,className:t}){return(0,J.jsx)(`div`,{className:T(`max-h-[min(36rem,75vh)] min-h-0 overflow-y-auto rounded-[var(--miravo-radius-stadium-sm)] border border-border/60 p-4 sm:p-5`,t),children:e})}function mt({title:e,subtitle:t,footerAction:n,canDismiss:r=!0,onDismiss:i,children:a}){return(0,q.useEffect)(()=>{function e(e){e.key===`Escape`&&r&&i()}return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[r,i]),(0,J.jsx)(f.div,{initial:{opacity:0,y:24},animate:{opacity:1,y:0},exit:{opacity:0,y:16},transition:{type:`spring`,stiffness:380,damping:30},className:`pointer-events-none fixed bottom-4 left-4 right-4 z-[60] sm:left-auto sm:w-full sm:max-w-md`,children:(0,J.jsxs)(pt,{className:`pointer-events-auto flex flex-col overflow-hidden border-border/70 bg-background p-0 shadow-lg shadow-black/15 ring-1 ring-border/50 backdrop-blur-sm sm:p-0 bg-background shadow-black/50`,children:[(0,J.jsxs)(`div`,{className:`flex shrink-0 items-start gap-2 border-b border-border/45 p-2.5 pb-2 sm:p-3 sm:pb-2`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,J.jsx)(se,{className:`size-4 shrink-0 text-primary`,"aria-hidden":!0}),(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(`p`,{className:`font-heading text-xs font-semibold tracking-tight text-foreground`,children:e}),t?(0,J.jsx)(`p`,{className:`text-[11px] leading-snug text-foreground/80`,children:t}):null]})]}),r?(0,J.jsx)(b,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`shrink-0 text-foreground/70 hover:bg-muted/80 hover:text-foreground`,onClick:i,"aria-label":`Dismiss operation panel`,children:(0,J.jsx)(C,{className:`size-3.5`,"aria-hidden":!0})}):null]}),(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-2.5 pt-2.5 sm:px-3 sm:pt-3`,"data-edge-op-scroll":``,children:a}),n?(0,J.jsx)(`div`,{className:`flex w-full shrink-0 min-w-0 items-center gap-2 border-t border-border/40 bg-muted/15 p-2.5 sm:p-3`,children:n}):null]})})}var ht={...Object.fromEntries(j.map(e=>[e.id,e.exportLabel])),"source-yaml":`Source YAML`};function gt(e){return e==null||e===``?`Select platform`:typeof e==`string`?ht[e]??e:`Select platform`}function _t(e){return j.find(t=>t.id===e)?.label??e}function Q({id:e,label:t,hint:n,className:r,labelAdornment:i,children:a}){return(0,J.jsxs)(`div`,{className:T(`flex flex-col gap-2`,r),children:[(0,J.jsxs)(`div`,{className:`space-y-1`,children:[(0,J.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1`,children:[(0,J.jsx)(G,{htmlFor:e,className:`text-[11px] font-medium text-foreground`,children:t}),i]}),n?(0,J.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:n}):null]}),a]})}function vt({open:e,editing:t,platformId:n,form:r,showToken:i,saving:a,testing:o,canTestConnection:s,onOpenChange:c,onPlatformChange:l,onFormChange:u,onShowTokenChange:d,onSave:f,onTestConnection:p,onCancelInFlight:m}){let _=n===N.id,y=t?`Edit Target`:`Add Target`,x=t?`Update the deployment connection.`:`Add the target used for platform deploys.`,C=t?`Leave empty to keep the current token.`:`Required for the first save and connection test.`;return(0,J.jsx)(v,{open:e,onOpenChange:e=>{e||m(),c(e)},children:(0,J.jsxs)(te,{showCloseButton:!0,className:`flex max-h-[min(84vh,38rem)] min-h-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-[38rem]`,children:[(0,J.jsxs)(ee,{className:`shrink-0 border-b border-border/60 px-4 pb-3.5 pt-4 pr-12 sm:px-5 sm:pr-14`,children:[(0,J.jsx)(ne,{className:`text-base tracking-tight`,children:y}),(0,J.jsx)(g,{className:`max-w-xl text-sm leading-relaxed`,children:x})]}),(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-4 sm:px-5`,style:{scrollbarGutter:`stable`},children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[t?(0,J.jsx)(Q,{label:`Platform`,children:(0,J.jsx)(`div`,{className:`flex h-9 items-center rounded-[var(--miravo-radius-stadium-sm)] border border-input bg-input/30 px-3 text-sm text-foreground`,children:_t(n)})}):(0,J.jsx)(Q,{label:`Platform`,children:(0,J.jsxs)(A,{value:n,onValueChange:e=>l(e),children:[(0,J.jsx)(k,{className:`h-9 w-full text-sm data-placeholder:text-muted-foreground/55`,"aria-label":`Platform type`,children:(0,J.jsx)(re,{placeholder:`Select platform`,children:e=>gt(e)})}),(0,J.jsxs)(O,{children:[(0,J.jsxs)(oe,{children:[(0,J.jsx)(E,{children:`Available`}),P.map(e=>(0,J.jsx)(D,{value:e.id,children:e.label},e.id))]}),(0,J.jsx)(ae,{}),(0,J.jsxs)(oe,{children:[(0,J.jsx)(E,{children:`Coming soon`}),M.map(e=>(0,J.jsx)(D,{value:e.id,children:e.label},e.id))]})]})]})}),_?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Q,{id:`env-label`,label:`Label`,children:(0,J.jsx)(S,{id:`env-label`,placeholder:`Production`,value:r.label,onChange:e=>u({...r,label:e.currentTarget.value}),autoComplete:`off`,className:`h-9 placeholder:text-muted-foreground/55`})}),(0,J.jsx)(Q,{id:`env-hostname`,label:`Hostname`,children:(0,J.jsx)(S,{id:`env-hostname`,placeholder:`192.168.1.100`,value:r.hostname,onChange:e=>u({...r,hostname:e.currentTarget.value}),autoCapitalize:`none`,autoComplete:`off`,spellCheck:!1,className:`h-9 font-mono text-[13px] placeholder:text-muted-foreground/55`})}),(0,J.jsx)(Q,{id:`env-source`,label:X,labelAdornment:(0,J.jsxs)(U,{children:[(0,J.jsx)(V,{type:`button`,className:`inline-flex size-5 shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":`About ${X}`,children:(0,J.jsx)(ce,{className:`size-3`,"aria-hidden":!0})}),(0,J.jsx)(H,{side:`top`,align:`start`,className:`max-w-xs text-left`,children:Re})]}),children:(0,J.jsx)(S,{id:`env-source`,placeholder:`host.docker.internal`,value:r.sourceHostname,onChange:e=>u({...r,sourceHostname:e.currentTarget.value}),autoCapitalize:`none`,autoComplete:`off`,spellCheck:!1,className:`h-9 font-mono text-[13px] placeholder:text-muted-foreground/55`})}),(0,J.jsx)(Q,{id:`env-token`,label:`API token`,labelAdornment:(0,J.jsxs)(U,{children:[(0,J.jsx)(V,{type:`button`,className:`inline-flex size-5 shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":`About API token`,children:(0,J.jsx)(ce,{className:`size-3`,"aria-hidden":!0})}),(0,J.jsx)(H,{side:`top`,align:`start`,className:`max-w-xs text-left`,children:C})]}),children:(0,J.jsxs)(`div`,{className:`relative`,children:[(0,J.jsx)(S,{id:`env-token`,type:i?`text`:`password`,placeholder:t?`••••••••`:`Enter API token`,value:r.apiToken,onChange:e=>u({...r,apiToken:e.currentTarget.value}),autoCapitalize:`none`,autoComplete:`off`,spellCheck:!1,className:`h-9 pr-11 font-mono text-[13px] placeholder:text-muted-foreground/55`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>d(!i),"aria-label":i?`Hide token`:`Show token`,"aria-pressed":i,className:`absolute inset-y-0 right-0 flex w-11 items-center justify-center rounded-r-[var(--miravo-radius-stadium-sm)] text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:i?(0,J.jsx)(ve,{className:`size-3.5`,"aria-hidden":!0}):(0,J.jsx)(ye,{className:`size-3.5`,"aria-hidden":!0})})]})})]}):(0,J.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-stadium-sm)] border border-dashed border-border/70 px-4 py-3 text-sm text-muted-foreground`,children:[_t(n),` setup is not available yet. Switch back to Litmus Edge to finish target setup now.`]})]})}),(0,J.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:o&&_?`Checking connection to Litmus Edge…`:``}),(0,J.jsxs)(h,{className:`mx-0 mb-0 shrink-0 flex-col gap-2 border-t border-border/60 bg-background px-4 py-3 sm:flex-row sm:justify-end sm:px-5`,children:[(0,J.jsx)(b,{type:`button`,variant:`outline`,size:`lg`,className:`w-full justify-center sm:mr-auto sm:w-auto`,disabled:a||o||!s,"aria-busy":o,onClick:p,children:o?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(I,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),`Testing connection`]}):`Test connection`}),(0,J.jsxs)(`div`,{className:`flex w-full flex-col gap-2 sm:w-auto sm:flex-row`,children:[(0,J.jsx)(b,{variant:`outline`,size:`lg`,className:`w-full sm:w-auto`,onClick:()=>{m(),c(!1)},disabled:a,children:`Cancel`}),(0,J.jsx)(b,{size:`lg`,className:`w-full sm:w-auto`,onClick:f,disabled:a||!_,children:a?`Saving...`:t?`Save Target`:`Add Target`})]})]})]})})}var yt=`flex size-7 shrink-0 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border border-border/35 bg-muted/25 text-primary`;function bt({targets:e,value:t,onValueChange:n,size:r=`default`,disabled:i,loading:a=!1,className:o,preferredTargetId:s,onAddNew:c}){return(0,q.useEffect)(()=>{if(t||e.length===0)return;let r=(s?e.find(e=>e.id===s):void 0)??e[0];r&&n(r.id)},[t,e,s,n]),a?(0,J.jsx)(`div`,{className:T(`flex h-9 min-h-9 w-full items-center rounded-[var(--miravo-radius-stadium-sm)] border border-input bg-input/25 px-3 text-xs text-muted-foreground`,o),children:`Loading targets...`}):e.length===0&&c?(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,J.jsx)(`span`,{children:`No targets configured.`}),(0,J.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 text-primary hover:underline`,onClick:c,children:[(0,J.jsx)(xe,{className:`inline size-3`}),` Add target`]})]}):(0,J.jsxs)(A,{value:t,onValueChange:e=>e&&n(e),disabled:i,children:[(0,J.jsx)(k,{size:r,className:T(`w-full`,r===`sm`&&`h-9! min-h-9 py-0`,r===`default`&&`h-auto! min-h-9 py-2 **:data-[slot=select-value]:line-clamp-none`,o),children:(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,J.jsx)(`span`,{className:yt,"aria-hidden":!0,children:(0,J.jsx)(z,{className:`size-3.5`})}),(0,J.jsx)(re,{placeholder:`Select target`,className:`min-w-0 flex-1`,children:t=>{let n=e.find(e=>e.id===t);return n?r===`sm`?n.label:(0,J.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,J.jsx)(`span`,{className:`text-xs font-medium leading-tight`,children:n.label}),(0,J.jsx)(`span`,{className:`font-mono text-[11px] leading-none text-muted-foreground`,children:n.hostname})]}):`Select target`}})]})}),(0,J.jsx)(O,{className:`rounded-[var(--miravo-radius-stadium-sm)] p-1.5`,children:e.map(e=>(0,J.jsxs)(D,{value:e.id,className:`h-auto items-center gap-2 rounded-[var(--miravo-radius-stadium-sm)] py-2 pr-8 pl-2`,children:[(0,J.jsx)(`span`,{className:yt,"aria-hidden":!0,children:(0,J.jsx)(z,{className:`size-3.5`})}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5 text-left`,children:[(0,J.jsx)(`span`,{className:`truncate text-xs font-medium leading-tight text-foreground`,children:e.label}),(0,J.jsx)(`span`,{className:`truncate font-mono text-[11px] leading-none text-muted-foreground`,children:e.hostname})]})]},e.id))})]})}async function xt(){return(await l(`/platforms/le/targets`,a.platformTargets)).targets}function St(e){return l(`/platforms/le/targets`,a.platformTargetCreate,{body:e})}function Ct(e,t){return l(`/platforms/le/targets/${e}`,a.platformTargetById,{body:t})}function wt(e){return l(`/platforms/le/targets/${e}`,a.platformTargetDelete)}function Tt(e,t){return l(`/platforms/le/targets/test`,a.platformConnectionTest,{body:e,init:{signal:t?.signal}})}function Et(e,t){return l(`/platforms/le/plan`,a.platformPlan,{body:e,init:{signal:t?.signal}})}function Dt(e,t){return l(`/platforms/le/cleanup/plan`,a.platformCleanupPlan,{body:e,init:{signal:t?.signal}})}function Ot(e={}){let t=new URLSearchParams;e.type&&t.set(`type`,e.type),e.targetId&&t.set(`targetId`,e.targetId),typeof e.limit==`number`&&t.set(`limit`,String(e.limit)),typeof e.offset==`number`&&t.set(`offset`,String(e.offset));let n=t.toString();return l(n?`/platforms/le/operations?${n}`:`/platforms/le/operations`,a.platformOperations)}async function kt(e){try{return await l(`/platforms/le/operations/${e}/cancel`,a.platformOperationCancel),!0}catch(e){if(i.is(e)&&e.status===404)return!1;throw e}}function At(e,t,n){return Mt(`/platforms/le/apply/stream`,a.platformApplyStream,e,t,n)}function jt(e,t,n){return Mt(`/platforms/le/cleanup/stream`,a.platformCleanupStream,e,t,n)}function Mt(e,t,n,r,a){let l=new AbortController;return(async()=>{try{let a=t.body.safeParse(n);if(!a.success)throw Error(`Invalid request for ${t.method} ${t.path}: ${a.error.message}`);let f=await fetch(c(u,e),{method:t.method,headers:{"content-type":`application/json`},credentials:`include`,body:JSON.stringify(a.data),signal:l.signal});if(f.status===401&&t.auth===`required`)throw s(),Error(`Session expired`);if(!f.ok){let e=`HTTP ${f.status}`;try{let e=await f.json(),t=d.safeParse(e);if(t.success)throw new i({code:t.data.code,status:f.status,message:t.data.message,hint:t.data.hint})}catch(e){if(e instanceof i)throw e}throw Error(e)}if(!f.body)throw Error(`No response body`);let p=f.body.getReader(),m=new TextDecoder,h=``,g=``,_=``,v=!1;for(;;){let{done:e,value:t}=await p.read();if(e)break;h+=m.decode(t,{stream:!0});let n=h.split(`
|
|
2
|
+
`);h=n.pop()??``;for(let e of n)if(e.startsWith(`event: `))g=e.slice(7).trim();else if(e.startsWith(`data: `))_=e.slice(6);else if(e===``&&g&&_){let e=!1;try{let t=JSON.parse(_),n=o.safeParse({event:g,data:t});n.success&&((n.data.event===`complete`||n.data.event===`cancelled`||n.data.event===`error`)&&(v=!0,e=!0),r(n.data))}catch{}if(g=``,_=``,e){await p.cancel();return}}}if(!v&&!l.signal.aborted)throw Error(`Connection to server was lost unexpectedly`)}catch(e){if(l.signal.aborted)return;a(e instanceof Error?e:Error(String(e)))}})(),l}function Nt(e){return e.status===`running`?e.operation?e.operation.type===`apply`?`Apply`:`Cleanup`:`Connecting`:e.status===`error`?`Failed`:e.operation&&e.status===`complete`?e.operation.status===`cancelled`?`Cancelled`:`Complete`:null}function Pt(e){let t=e.operation,n=t?.type===`apply`?`apply`:`cleanup`;switch(e.status){case`running`:return{title:`Operation in progress`,subtitle:`Streaming ${n} steps to Litmus Edge`};case`complete`:return t?.status===`cancelled`?{title:`Operation cancelled`,subtitle:`Stopped — resources created so far remain in Litmus Edge.`}:{title:`Operation complete`,subtitle:n===`apply`?`Apply finished — review the summary below.`:`Cleanup finished — review the summary below.`};case`error`:return{title:`Operation failed`,subtitle:e.error??t?.error??`The operation ended with an error.`};default:return{title:`Operation`,subtitle:``}}}function Ft(e){let t=e.trim();if(t.length===0)return{message:`Connection test failed with no details from the server.`};let n=t.toLowerCase();if(t.includes(`timed out`))return{message:`Litmus Edge did not respond in time.`,description:`Check the hostname, VPN or firewall, and that the device is online.`};if(/\b401\b/.test(t)||/\b403\b/.test(t)||n.includes(`unauthorized`))return{message:`The API token was rejected.`,description:`Create or copy a valid token in Litmus Edge and paste it into the API token field.`};if(/\b404\b/.test(t)&&(n.includes(`sysinfo`)||n.includes(`/sysinfo/`)))return{message:`This Litmus Edge host or version does not expose the system info API.`,description:`Confirm the hostname and that Litmus Edge is running a build with GET /sysinfo/devinfo.`};if(n.includes(`econnrefused`)||n.includes(`connection refused`)||n.includes(`enotfound`)||n.includes(`getaddrinfo`)||n.includes(`failed`)&&n.includes(`fetch`))return{message:`Could not reach the Litmus Edge host.`,description:`Check the hostname or IP, TLS, and that this computer can reach the edge network.`};if(t.includes(`Session expired`))return{message:`Your session expired. Sign in again, then retry the connection test.`};if(n.includes(`environment not found`))return{message:`That target was removed. Close the dialog and refresh the list.`};if(n.includes(`unsupported platform`)&&n.includes(`connection`))return{message:`This platform type does not support connection tests yet.`,description:`Use Litmus Edge for remote apply and connection testing.`};if(n.includes(`invalid request body`)||n.includes(`api token is required`))return{message:`Some required fields are missing or invalid.`,description:`Fill in hostname, source host (Miravo), and API token (for new targets).`};let r=t.replace(/^LE\s+\S+\s+/i,``).trim();return{message:`Could not verify the connection to Litmus Edge.`,description:r.length>0&&r.length<=220?r:It(t,200)}}function It(e,t){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:`${n.slice(0,t-1)}…`}function Lt(e){if(e.connected){let t=e.litmusEdgeVersion?` Litmus Edge v${e.litmusEdgeVersion}.`:``;if(e.warning){_.warning(`Connected to ${e.hostname}.${t}`,{description:e.warning});return}_.success(`Connected to ${e.hostname}.${t}`);return}let{message:t,description:n}=Ft(e.error);_.error(t,n?{description:n}:void 0)}function Rt(e){let{message:t,description:n}=Ft(e instanceof Error?e.message:String(e));_.error(t,n?{description:n}:void 0)}function zt(e){return!!(typeof DOMException<`u`&&e instanceof DOMException&&e.name===`AbortError`||e instanceof Error&&(e.name===`AbortError`||/aborted/i.test(e.message)))}function Bt(){let[e,t]=(0,q.useState)(!1),n=(0,q.useRef)(null),r=(0,q.useCallback)(()=>{n.current?.abort()},[]);return{testing:e,runTest:(0,q.useCallback)(async e=>{let r=new AbortController;n.current=r,t(!0);try{Lt(await Tt(e,{signal:r.signal}))}catch(e){if(zt(e))return;Rt(e)}finally{n.current===r&&(n.current=null),t(!1)}},[]),cancelInFlight:r}}function Vt(e){return e instanceof DOMException&&e.name===`AbortError`||e instanceof Error&&e.name===`AbortError`}function Ht(e){return e.map(e=>e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join(`, `)}function Ut({onCloseTable:e,planKind:t=`apply`}){return(0,J.jsx)(`div`,{className:`border-b border-border/40 px-3 py-3 sm:px-4`,children:(0,J.jsxs)(`div`,{className:`flex gap-3`,children:[(0,J.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-muted/15`,children:(0,J.jsx)(ge,{className:`size-4 text-muted-foreground`,"aria-hidden":!0})}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-1 pt-0.5 sm:gap-2`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,J.jsx)(`p`,{className:`font-heading text-[11px] font-semibold uppercase tracking-[0.14em] text-foreground`,children:t===`cleanup`?`Expected removals`:`Expected changes`}),(0,J.jsx)(`span`,{className:`rounded-[var(--miravo-radius-tight)] border border-primary/25 bg-primary/5 px-1.5 py-px font-mono text-[9px] uppercase tracking-wider text-primary/90`,children:`Draft`})]}),(0,J.jsx)(`p`,{className:`mt-1.5 max-w-prose text-[10px] leading-relaxed text-muted-foreground`,children:t===`cleanup`?`Preview only — nothing runs until you confirm cleanup.`:`Preview only — nothing runs until you confirm deploy.`})]}),e&&(0,J.jsx)(b,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8 shrink-0 text-muted-foreground hover:text-foreground`,onClick:e,"aria-label":`Close table`,children:(0,J.jsx)(C,{className:`size-4`,"aria-hidden":!0})})]})]})})}var Wt={create:`border-success/30 bg-success/12 text-success`,update:`border-info/30 bg-info/12 text-info`,replace:`border-chart-2/30 bg-chart-2/12 text-chart-2`,delete:`border-destructive/30 bg-destructive/12 text-destructive`,noop:`border-border/50 bg-muted/50 text-foreground/75`,blocked:`border-warning/30 bg-warning/12 text-warning`};function Gt({plan:e,planKind:t}){let n=t===`apply`&&e.sourceHostname!=null&&e.sourceHostname!==``;return(0,J.jsx)(`div`,{className:`border-b border-border/35 bg-muted/10 px-3 py-2 sm:px-4`,children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-[10px] leading-snug sm:flex-row sm:flex-wrap sm:items-baseline sm:gap-x-4 sm:gap-y-1`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,J.jsx)(`span`,{className:`shrink-0 font-mono text-[9px] uppercase tracking-wider text-muted-foreground/85`,children:`Target LE`}),(0,J.jsx)(`span`,{className:`font-mono text-foreground/90 wrap-anywhere`,children:e.targetHost})]}),n?(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5 sm:border-l sm:border-border/50 sm:pl-4`,children:[(0,J.jsx)(`span`,{className:`shrink-0 font-mono text-[9px] uppercase tracking-wider text-muted-foreground/85`,children:X}),(0,J.jsx)(`span`,{className:`font-mono text-foreground/90 wrap-anywhere`,children:e.sourceHostname})]}):null]})})}function Kt({entries:e}){let t=e.reduce((e,t)=>(e[t.action]++,e),{create:0,update:0,replace:0,delete:0,noop:0,blocked:0});return(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border/35 px-3 py-2.5 sm:px-4`,children:[(0,J.jsx)(`span`,{className:`sr-only`,children:`Summary of planned actions`}),(0,J.jsx)(`span`,{className:`font-mono text-[9px] uppercase tracking-[0.18em] text-muted-foreground`,children:`Manifest`}),(0,J.jsx)(`span`,{className:`hidden h-3 w-px bg-border/60 sm:block`,"aria-hidden":!0}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-2`,children:[t.create>0&&(0,J.jsxs)(`span`,{className:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-success/25 bg-success/10 px-2 py-0.5 font-mono text-[10px] tabular-nums text-success`,children:[`+`,t.create,` new`]}),t.update>0&&(0,J.jsxs)(`span`,{className:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-info/25 bg-info/10 px-2 py-0.5 font-mono text-[10px] tabular-nums text-info`,children:[`~`,t.update,` update`]}),t.replace>0&&(0,J.jsxs)(`span`,{className:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-chart-2/25 bg-chart-2/10 px-2 py-0.5 font-mono text-[10px] tabular-nums text-chart-2`,children:[`↺`,t.replace,` replace`]}),t.delete>0&&(0,J.jsxs)(`span`,{className:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-destructive/25 bg-destructive/10 px-2 py-0.5 font-mono text-[10px] tabular-nums text-destructive`,children:[`−`,t.delete,` remove`]}),t.noop>0&&(0,J.jsxs)(`span`,{className:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-border/50 bg-muted/50 px-2 py-0.5 font-mono text-[10px] tabular-nums text-foreground/75`,children:[`=`,t.noop,` unchanged`]}),t.blocked>0&&(0,J.jsxs)(`span`,{className:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-warning/25 bg-warning/10 px-2 py-0.5 font-mono text-[10px] tabular-nums text-warning`,children:[t.blocked,` skipped`]})]})]})}function qt({plan:e,onCloseTable:t,planKind:n=`apply`}){return e.entries.length===0?(0,J.jsxs)(`div`,{className:`overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-dashed border-border/55`,children:[(0,J.jsx)(Ut,{onCloseTable:t,planKind:n}),(0,J.jsx)(Gt,{plan:e,planKind:n}),(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-3 px-4 py-10 text-center`,children:[(0,J.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border border-border/50`,children:(0,J.jsx)(ge,{className:`size-6 text-muted-foreground/45`,"aria-hidden":!0})}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`font-heading text-sm font-semibold tracking-tight text-foreground`,children:n===`cleanup`?`Nothing to remove`:`Nothing to change`}),(0,J.jsx)(`p`,{className:`mx-auto mt-2 max-w-sm text-[11px] leading-relaxed text-muted-foreground`,children:n===`cleanup`?`No Miravo-managed resources matched this cleanup scope on the environment — nothing would be deleted.`:`This environment already matches what is on the target — no create or update steps.`})]})]})]}):(0,J.jsxs)(`div`,{className:`overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-border/45`,children:[(0,J.jsx)(Ut,{onCloseTable:t,planKind:n}),(0,J.jsx)(Gt,{plan:e,planKind:n}),(0,J.jsx)(Kt,{entries:e.entries}),(0,J.jsx)(`div`,{className:`overflow-x-auto`,children:(0,J.jsxs)(`table`,{className:`w-full min-w-lg text-xs`,children:[(0,J.jsx)(`caption`,{className:`sr-only`,children:n===`cleanup`?`Detailed list of planned cleanup actions in deletion order`:`Detailed list of create, update, and delete actions in deployment order`}),(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{className:`border-b border-border/45`,children:[(0,J.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left font-heading text-[9px] font-semibold uppercase tracking-[0.14em] text-muted-foreground sm:px-3.5`,children:`Action`}),(0,J.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left font-heading text-[9px] font-semibold uppercase tracking-[0.14em] text-muted-foreground sm:px-3.5`,children:`Type`}),(0,J.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left font-heading text-[9px] font-semibold uppercase tracking-[0.14em] text-muted-foreground sm:px-3.5`,children:`Name`}),(0,J.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 hidden bg-background px-3 py-2 text-left font-heading text-[9px] font-semibold uppercase tracking-[0.14em] text-muted-foreground sm:table-cell sm:px-3.5`,children:`Protocol`}),(0,J.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 hidden bg-background px-3 py-2 text-left font-heading text-[9px] font-semibold uppercase tracking-[0.14em] text-muted-foreground md:table-cell md:px-3.5`,children:`Detail`})]})}),(0,J.jsx)(`tbody`,{children:e.entries.map((e,t)=>(0,J.jsxs)(`tr`,{className:T(`border-b border-border/25 transition-colors`,t%2==1?`bg-muted/35`:`bg-transparent`,`hover:bg-primary/4`),children:[(0,J.jsx)(`td`,{className:`px-3 py-2 align-middle sm:px-3.5`,children:(0,J.jsx)(W,{variant:`outline`,className:T(`border px-1.5 py-0 font-mono text-[10px] uppercase tracking-wide`,Wt[e.action]),children:e.action})}),(0,J.jsx)(`td`,{className:`px-3 py-2 align-middle font-mono text-[11px] text-foreground sm:px-3.5`,children:e.resourceType}),(0,J.jsx)(`td`,{className:`max-w-[min(16rem,28vw)] truncate px-3 py-2 align-middle font-mono text-[11px] text-foreground sm:max-w-xs sm:px-3.5`,children:e.name}),(0,J.jsx)(`td`,{className:`hidden px-3 py-2 align-middle font-mono text-[11px] text-muted-foreground sm:table-cell sm:px-3.5`,children:e.protocol??`—`}),(0,J.jsx)(`td`,{className:`hidden max-w-xs truncate px-3 py-2 align-middle text-[11px] text-muted-foreground md:table-cell md:px-3.5`,children:e.blockReason??e.detail??`—`})]},`${e.action}-${e.resourceType}-${e.name}-${e.protocol??``}-${e.detail??e.blockReason??``}`))})]})}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-border/40 px-3 py-3 text-[10px] text-muted-foreground sm:flex-row sm:items-center sm:justify-between sm:gap-4 sm:px-4`,children:[(0,J.jsxs)(`span`,{children:[(0,J.jsx)(`span`,{className:`font-mono tabular-nums text-foreground/90`,children:e.entries.length}),` `,(0,J.jsxs)(`span`,{className:`text-muted-foreground/90`,children:[e.entries.length===1?`action`:`actions`,` queued`]})]}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 font-mono text-[10px] wrap-anywhere`,children:[(0,J.jsx)(`span`,{className:`shrink-0 text-[9px] uppercase tracking-wider text-muted-foreground/80`,children:`Scope`}),(0,J.jsx)(`span`,{className:`min-w-0 text-foreground/90`,children:Ht(e.scope)})]})]})]})}var Jt=[`s1`,`s2`,`s3`,`s4`];function Yt(){return(0,J.jsxs)(`div`,{className:`overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-border/45`,role:`status`,"aria-busy":`true`,"aria-live":`polite`,children:[(0,J.jsx)(`span`,{className:`sr-only`,children:`Loading plan preview`}),(0,J.jsx)(`div`,{className:`border-b border-border/40 px-3 py-3 sm:px-4`,children:(0,J.jsxs)(`div`,{className:`flex gap-3`,children:[(0,J.jsx)(Y,{className:`size-10 shrink-0 rounded-[var(--miravo-radius-stadium-sm)]`}),(0,J.jsx)(`div`,{className:`flex min-w-0 flex-1 items-start gap-1 pt-0.5 sm:gap-2`,children:(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,J.jsx)(Y,{className:`h-3.5 w-40`}),(0,J.jsx)(Y,{className:`h-4 w-11 rounded-[var(--miravo-radius-tight)] border`})]}),(0,J.jsx)(Y,{className:`mt-1.5 h-3 max-w-prose`})]})})]})}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border/35 px-3 py-2.5 sm:px-4`,children:[(0,J.jsx)(Y,{className:`h-2.5 w-14`}),(0,J.jsx)(Y,{className:`hidden h-3 w-px shrink-0 sm:block`}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-2`,children:[(0,J.jsx)(Y,{className:`h-5 w-18 rounded-[var(--miravo-radius-tight)]`}),(0,J.jsx)(Y,{className:`h-5 w-24 rounded-[var(--miravo-radius-tight)]`}),(0,J.jsx)(Y,{className:`h-5 w-20 rounded-[var(--miravo-radius-tight)]`})]})]}),(0,J.jsx)(`div`,{className:`overflow-x-auto`,children:(0,J.jsxs)(`table`,{className:`w-full min-w-lg text-xs`,"aria-hidden":!0,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{className:`border-b border-border/45`,children:[(0,J.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left sm:px-3.5`,children:(0,J.jsx)(Y,{className:`h-2.5 w-12`})}),(0,J.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left sm:px-3.5`,children:(0,J.jsx)(Y,{className:`h-2.5 w-9`})}),(0,J.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left sm:px-3.5`,children:(0,J.jsx)(Y,{className:`h-2.5 w-10`})}),(0,J.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 hidden bg-background px-3 py-2 text-left sm:table-cell sm:px-3.5`,children:(0,J.jsx)(Y,{className:`h-2.5 w-14`})}),(0,J.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 hidden bg-background px-3 py-2 text-left md:table-cell md:px-3.5`,children:(0,J.jsx)(Y,{className:`h-2.5 w-11`})})]})}),(0,J.jsx)(`tbody`,{children:Jt.map((e,t)=>(0,J.jsxs)(`tr`,{className:T(`border-b border-border/25 transition-colors`,t%2==1?`bg-muted/35`:`bg-transparent`,`hover:bg-primary/4`),children:[(0,J.jsx)(`td`,{className:`px-3 py-2 align-middle sm:px-3.5`,children:(0,J.jsx)(Y,{className:`h-5 w-13 rounded-[var(--miravo-radius-tight)]`})}),(0,J.jsx)(`td`,{className:`px-3 py-2 align-middle sm:px-3.5`,children:(0,J.jsx)(Y,{className:`h-3.5 w-16 font-mono`})}),(0,J.jsx)(`td`,{className:`max-w-[min(16rem,28vw)] px-3 py-2 align-middle sm:max-w-xs sm:px-3.5`,children:(0,J.jsx)(Y,{className:`h-3.5 w-full max-w-48 font-mono`})}),(0,J.jsx)(`td`,{className:`hidden px-3 py-2 align-middle sm:table-cell sm:px-3.5`,children:(0,J.jsx)(Y,{className:`h-3.5 w-10 font-mono`})}),(0,J.jsx)(`td`,{className:`hidden max-w-xs px-3 py-2 align-middle md:table-cell md:px-3.5`,children:(0,J.jsx)(Y,{className:`h-3.5 w-full max-w-40`})})]},e))})]})}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-border/40 px-3 py-3 text-[10px] text-muted-foreground sm:flex-row sm:items-center sm:justify-between sm:gap-4 sm:px-4`,children:[(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,J.jsx)(Y,{className:`inline-block h-3 w-6 rounded-[var(--miravo-radius-tight)]`}),(0,J.jsx)(Y,{className:`inline-block h-3 w-28`})]}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 font-mono text-[10px] wrap-anywhere`,children:[(0,J.jsx)(Y,{className:`h-2.5 w-8 shrink-0`}),(0,J.jsx)(Y,{className:`h-6 min-w-32 rounded-[var(--miravo-radius-tight)] border border-border/50 px-2 py-0.5`}),(0,J.jsx)(Y,{className:`h-1 w-1 shrink-0 rounded-full`}),(0,J.jsx)(Y,{className:`h-2.5 w-10 shrink-0`}),(0,J.jsx)(Y,{className:`h-3 min-w-16 max-w-56 flex-1`})]})]})]})}function Xt({stream:e,className:t}){let n=Nt(e);if(!n)return null;let r=e.status===`running`,i=e.status===`error`,a=e.status===`complete`&&e.operation?.status===`cancelled`,o=e.status===`complete`&&!a;return(0,J.jsxs)(`span`,{className:T(`inline-flex h-6 w-fit min-w-0 shrink-0 items-center justify-center gap-1 rounded-full border px-2 py-0`,`text-xs font-medium leading-none tracking-wide uppercase shadow-[inset_0_1px_0_0_rgba(255,255,255,0.05)]`,t,o&&`border-success/45 bg-success/[0.1] text-success`,a&&`border-muted-foreground/30 bg-muted/[0.1] text-muted-foreground shadow-none`,i&&`border-destructive/50 bg-destructive/[0.1] text-destructive shadow-none`,r&&`border-primary/40 bg-primary/[0.1] text-primary border-primary/35`),children:[o?(0,J.jsx)(x,{className:`size-3 shrink-0 opacity-95`,strokeWidth:2.5,"aria-hidden":!0}):a?(0,J.jsx)(pe,{className:`size-3 shrink-0 opacity-95`,"aria-hidden":!0}):i?(0,J.jsx)(B,{className:`size-3 shrink-0 opacity-95`,"aria-hidden":!0}):(0,J.jsx)(I,{className:`size-3 shrink-0 animate-spin`,"aria-hidden":!0}),n]})}var Zt={status:`idle`,operation:null,error:null,logs:[],cancelRequested:!1},Qt=200;function $t(){let[e,t]=(0,q.useState)(Zt),n=(0,q.useRef)(null),r=(0,q.useRef)(0),i=(0,q.useRef)(0),a=(0,q.useCallback)(e=>{let n=de(e,`Platform operation failed.`),r=fe(e),i=r?`${n} ${r}`:n;t(e=>({...e,status:`error`,cancelRequested:!1,error:i,operation:e.operation?{...e.operation,status:`error`,error:i}:null}))},[]),o=(0,q.useCallback)(e=>{switch(e.event){case`accepted`:en(e.data,t);break;case`log`:nn({...e.data,id:`log-${r.current++}`},t);break;case`started`:rn(e.data,t);break;case`phase`:an(e.data,t);break;case`resource`:on(e.data,t);break;case`complete`:sn(e.data,t);break;case`cancelled`:ln(e.data,t);break;case`retrying`:un(e.data,t);break;case`error`:a(Error(e.data.message));break}},[a]),s=(0,q.useCallback)(e=>{let s=++i.current;n.current?.abort(),r.current=0,t({status:`running`,operation:null,error:null,logs:[],cancelRequested:!1}),n.current=At(e,e=>{i.current===s&&(o(e),dn(e)&&(n.current?.abort(),n.current=null))},e=>{i.current===s&&(n.current=null,a(e))})},[o,a]),c=(0,q.useCallback)(e=>{let s=++i.current;n.current?.abort(),r.current=0,t({status:`running`,operation:null,error:null,logs:[],cancelRequested:!1}),n.current=jt(e,e=>{i.current===s&&(o(e),dn(e)&&(n.current?.abort(),n.current=null))},e=>{i.current===s&&(n.current=null,a(e))})},[o,a]),l=(0,q.useCallback)(()=>{i.current++,n.current?.abort(),n.current=null,t(Zt)},[]),u=(0,q.useCallback)(async()=>{let n=e.operation?.operationId;if(!(!n||e.status!==`running`||e.cancelRequested)){t(e=>cn(e,n));try{await kt(n)||a(Error(`Operation finished before cancellation was accepted.`))}catch(e){a(e instanceof Error?e:Error(`Cancellation failed.`))}}},[e.operation?.operationId,e.status,e.cancelRequested,a]);return(0,q.useEffect)(()=>()=>{i.current++,n.current?.abort(),n.current=null},[]),{...e,startApply:s,startCleanup:c,reset:l,cancel:u}}function en(e,t){t(t=>({...t,status:`running`,cancelRequested:!1,error:null,operation:{operationId:e.operationId,type:e.type,label:e.template??e.model??(e.type===`apply`?`Preparing apply`:`Preparing cleanup`),environment:e.targetId??`Resolving target`,totalPlanned:0,phases:[],applied:0,failed:0,status:`running`,startedAt:Date.now()}}))}function tn(e){return(e.template??e.model)||(e.type===`cleanup`?`All managed resources`:`unknown`)}function nn(e,t){t(t=>({...t,logs:[...t.logs,e].slice(-Qt)}))}function rn(e,t){t(t=>({...t,status:`running`,cancelRequested:!1,error:null,operation:{operationId:e.operationId,type:e.type,label:tn(e),environment:e.environment,totalPlanned:e.totalPlanned,phases:[],applied:0,failed:0,status:`running`,startedAt:Date.now(),attempt:e.attempt,maxAttempts:e.maxAttempts}}))}function an(e,t){t(t=>{if(!$(t,e.operationId))return t;let n=t.operation.phases.map(e=>e.status===`active`?{...e,status:`done`}:e),r=n.findIndex(t=>t.name===e.phase),i=r>=0?n.map((t,n)=>n===r?{...t,status:`active`,total:e.total}:t):[...n,{name:e.phase,total:e.total,resources:[],status:`active`}];return{...t,operation:{...t.operation,phases:i}}})}function on(e,t){t(t=>{if(!$(t,e.operationId))return t;let n={name:e.name,action:e.action,status:e.status,error:e.error},r=t.operation.phases.map(t=>t.name===e.phase&&t.status===`active`?{...t,resources:[...t.resources,n]}:t);return{...t,operation:{...t.operation,phases:r,applied:t.operation.applied+ +(e.status===`success`&&e.action!==`noop`),failed:t.operation.failed+ +(e.status===`failed`)}}})}function sn(e,t){t(t=>{if(!$(t,e.operationId))return t;let n=t.operation.phases.map(e=>e.status===`active`?{...e,status:`done`}:e);return{...t,status:`complete`,cancelRequested:!1,error:null,operation:{...t.operation,phases:n,applied:e.applied??e.deleted??0,failed:e.failed,duration:e.duration,status:`complete`}}})}function cn(e,t){return!$(e,t)||e.status!==`running`?e:{...e,cancelRequested:!0}}function ln(e,t){t(t=>{if(!$(t,e.operationId))return t;let n=t.operation.phases.map(e=>e.status===`active`?{...e,status:`done`}:e);return{...t,status:`complete`,cancelRequested:!1,error:null,operation:{...t.operation,phases:n,applied:e.applied??e.deleted??0,failed:e.failed,duration:e.duration,status:`cancelled`}}})}function un(e,t){t(t=>$(t,e.operationId)?{...t,status:`running`,cancelRequested:!1,error:null,operation:{...t.operation,status:`running`,retryPending:!0,retryDelayMs:e.delayMs,attempt:e.attempt,maxAttempts:e.maxAttempts,error:e.error,applied:0,failed:0,phases:[]}}:t)}function $(e,t){return e.operation?.operationId===t}function dn(e){return e.event===`complete`||e.event===`cancelled`||e.event===`error`}export{Ce as A,Re as C,Le as D,Ie as E,he as F,xe as M,be as N,Ee as O,ye as P,ze as S,Fe as T,mt as _,Vt as a,dt as b,St as c,xt as d,Dt as f,vt as g,bt as h,Yt as i,Se as j,De as k,wt as l,Ct as m,Xt as n,Bt as o,Et as p,qt as r,Pt as s,$t as t,Ot as u,pt as v,X as w,We as x,ft as y};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/fleet-BNba_zGa.js","assets/fleet-C20wXA8E.js","assets/rolldown-runtime-COnpUsM8.js","assets/chunk-OE4NN4TA-DBWZidbW.js","assets/vendor-charts-95ykyDlI.js","assets/api-Bf6pFRhP.js","assets/vendor-ui-CWUk2ulb.js","assets/format-B9CcV2dj.js","assets/utils-XFKvwlFT.js","assets/arrow-right-BjBb4z7g.js","assets/arrow-up-down-C1oJAmrw.js","assets/select-CMOnuEoT.js","assets/circle-question-mark-CJvcT6V6.js","assets/dist-xY0pK9Wy.js","assets/shallow-Cin0mLuv.js","assets/badge-i00PiRCo.js","assets/combobox-BJecIYHE.js","assets/select-display-items-y2L7MHmk.js","assets/tooltip-D1ydB4g3.js","assets/transition-types-CPlGtM8w.js","assets/catalog-CTpesUtM.js","assets/catalog-DqOwOydE.js","assets/query-fetch-error-BqiDQT2r.js","assets/AnimatePresence-CPmH1DMY.js","assets/proxy-Be4WzmcS.js","assets/use-platform-stream-BVf5gGJM.js","assets/platform-targets-BIQ1lKOg.js","assets/tabs-CCixnxMe.js","assets/copy-button-DnGsXbVV.js","assets/checkbox-C84IyqEB.js","assets/triangle-alert-BXrJNk3g.js","assets/label-DTHSKF2S.js","assets/get-error-message-yQcVJ-Ja.js","assets/catalog-template-icons-3S8RvUxD.js","assets/catalog-source-W3TI0pmx.js","assets/download-DmUZKo9N.js","assets/use-engine-command-mutation-RvjgD8uv.js","assets/runtime-link-D-uJbw97.js","assets/models-2VnPNXiF.js","assets/models-DhRo1Ytd.js","assets/activity-Cy_niK56.js","assets/events-Z0rGFYfs.js","assets/events-BTqDmbVu.js","assets/auth-screen-backdrop-CgwRhIbi.js","assets/control-UqwbqlvO.js","assets/control-BLUTBbet.js","assets/validation-_QtRYqIT.js","assets/layers-1figUpjG.js","assets/transition-nav-link-Bf02_OAE.js","assets/tags-CNJIRrPw.js","assets/tags-DAJ-rQYR.js","assets/vendor-table-SVvT6QrW.js","assets/dropdown-menu-82O7jPU6.js","assets/platforms-DrKstIAm.js","assets/platforms-DbzXekvY.js","assets/instance-detail-STqgvf7K.js","assets/login-BJaFYYGh.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{c as n,d as r}from"./chunk-OE4NN4TA-DBWZidbW.js";var i=e(t(),1),a=[{test:e=>e===`/`,load:()=>r(()=>import(`./fleet-BNba_zGa.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))},{test:e=>e===`/catalog`,load:()=>r(()=>import(`./catalog-CTpesUtM.js`),__vite__mapDeps([20,21,2,5,4,6,22,7,8,23,24,25,11,26,27,12,28,18,29,30,15,31,32,33,34,35,36,37]))},{test:e=>e===`/models`,load:()=>r(()=>import(`./models-2VnPNXiF.js`),__vite__mapDeps([38,39,2,5,4,6,22,7,8,23,24,40,25,11,26,27,12,28,18,29,30,15,31,32,34,35,36,37]))},{test:e=>e===`/events`,load:()=>r(()=>import(`./events-Z0rGFYfs.js`),__vite__mapDeps([41,42,2,3,4,5,6,22,7,8,23,24,11,43,15,16,17,32,37,19]))},{test:e=>e===`/control`,load:()=>r(()=>import(`./control-UqwbqlvO.js`),__vite__mapDeps([44,45,2,5,4,6,7,8,23,24,40,9,11,27,28,18,46,29,47,36,37,30,13,14,48,3,15,16,31]))},{test:e=>e===`/tags`,load:()=>r(()=>import(`./tags-CNJIRrPw.js`),__vite__mapDeps([49,50,2,3,4,5,6,22,7,8,51,10,11,26,28,18,35,13,43,16,52,31,32]))},{test:e=>e===`/platforms`,load:()=>r(()=>import(`./platforms-DrKstIAm.js`),__vite__mapDeps([53,54,2,3,4,5,6,22,7,8,23,24,40,9,25,11,26,27,12,28,18,29,30,15,31,32,33,47,13,52]))},{test:e=>e.startsWith(`/instance/`),load:()=>r(()=>import(`./instance-detail-STqgvf7K.js`),__vite__mapDeps([55,2,3,4,5,6,22,7,8,24,40,27,28,18,46,36,37,30,13,43,15,32,19]))},{test:e=>e===`/login`,load:()=>r(()=>import(`./login-BJaFYYGh.js`),__vite__mapDeps([56,2,5,4,6,48,3,32]))}],o=new Set;function s(e){if(!e.startsWith(`/`))return null;let t=e.indexOf(`?`),n=e.indexOf(`#`),r=t===-1?n===-1?e.length:n:n===-1?t:Math.min(t,n);return e.slice(0,r)}function c(e){let t=s(e);if(!t||o.has(t))return;let n=a.find(e=>e.test(t));n&&(o.add(t),n.load().catch(()=>{o.delete(t)}))}function l(){let e=n();return(0,i.useCallback)((t,n)=>{n?.preload!==!1&&c(t),(0,i.startTransition)(()=>{n?.transitionType&&(0,i.addTransitionType)(n.transitionType),e(t,{replace:n?.replace})})},[e])}export{c as n,l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{at as e,et as t}from"./vendor-ui-CWUk2ulb.js";import{J as n,X as r,j as i,q as a}from"./api-Bf6pFRhP.js";import{l as o}from"./copy-button-DnGsXbVV.js";import{n as s,t as c}from"./utils-XFKvwlFT.js";import"./tabs-CCixnxMe.js";var l=s(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),u=s(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),d=e();function f({className:e,orientation:n=`horizontal`,...r}){return(0,d.jsx)(t,{"data-slot":`separator`,orientation:n,className:c(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...r})}function p(){return r().trim().optional().refine(e=>e===void 0||e===``||e.length<=120,{message:`Use at most 120 characters.`}).refine(e=>e===void 0||e===``||i(e)===null,{message:`Use letters, numbers, underscores, and hyphens only.`})}var m=n({multiplier:a({message:`Speed multiplier must be a number.`}).positive(`Speed multiplier must be positive.`).finite(`Speed multiplier must be finite.`).max(1e3,`Speed multiplier cannot exceed 1000.`)}),h=n({model:r().min(1,`Model is required.`),count:a({message:`Count must be a number.`}).int(`Count must be a whole number.`).positive(`Count must be at least 1.`).max(100,`Count cannot exceed 100.`),instanceName:p(),instancePrefix:p()}),g=n({instanceId:r().min(1,`Instance is required.`),fault:r().min(1,`Fault name is required.`)}),_=n({instanceId:r().min(1,`Instance is required.`)});function v(e,t,n){if(!t.trim())return o.error(`Argument "${e}" is required.`),null;switch(n){case`Double`:case`Float`:{let n=Number(t);return Number.isFinite(n)?{value:n}:(o.error(`"${e}" must be a valid number.`),null)}case`Int32`:case`UInt16`:case`UInt32`:{let r=Number(t);return!Number.isFinite(r)||!Number.isSafeInteger(r)?(o.error(`"${e}" must be a valid integer.`),null):(n===`UInt16`||n===`UInt32`)&&r<0?(o.error(`"${e}" must be non-negative.`),null):{value:r}}case`Boolean`:return t!==`true`&&t!==`false`?(o.error(`"${e}" must be "true" or "false".`),null):{value:t===`true`};case`String`:return{value:t};default:return{value:t}}}function y(e,t){let n=e.safeParse(t);return n.success?n.data:(o.error(n.error.issues[0]?.message??`Validation error.`),null)}export{y as a,u as c,h as i,l,_ as n,v as o,m as r,f as s,g as t};
|
package/console-dist/index.html
CHANGED
|
@@ -21,58 +21,56 @@
|
|
|
21
21
|
}
|
|
22
22
|
</style>
|
|
23
23
|
<title>Miravo</title>
|
|
24
|
-
<script type="module" crossorigin src="/assets/index-
|
|
24
|
+
<script type="module" crossorigin src="/assets/index-B_Xu4s7C.js"></script>
|
|
25
25
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-COnpUsM8.js">
|
|
26
26
|
<link rel="modulepreload" crossorigin href="/assets/vendor-charts-95ykyDlI.js">
|
|
27
27
|
<link rel="modulepreload" crossorigin href="/assets/chunk-OE4NN4TA-DBWZidbW.js">
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/assets/api-
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/assets/api-Bf6pFRhP.js">
|
|
29
29
|
<link rel="modulepreload" crossorigin href="/assets/vendor-ui-CWUk2ulb.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/assets/utils-XFKvwlFT.js">
|
|
31
|
-
<link rel="modulepreload" crossorigin href="/assets/format-
|
|
32
|
-
<link rel="modulepreload" crossorigin href="/assets/query-fetch-error-
|
|
31
|
+
<link rel="modulepreload" crossorigin href="/assets/format-B9CcV2dj.js">
|
|
32
|
+
<link rel="modulepreload" crossorigin href="/assets/query-fetch-error-BqiDQT2r.js">
|
|
33
33
|
<link rel="modulepreload" crossorigin href="/assets/proxy-Be4WzmcS.js">
|
|
34
34
|
<link rel="modulepreload" crossorigin href="/assets/AnimatePresence-CPmH1DMY.js">
|
|
35
35
|
<link rel="modulepreload" crossorigin href="/assets/activity-Cy_niK56.js">
|
|
36
36
|
<link rel="modulepreload" crossorigin href="/assets/arrow-right-BjBb4z7g.js">
|
|
37
|
-
<link rel="modulepreload" crossorigin href="/assets/select-
|
|
37
|
+
<link rel="modulepreload" crossorigin href="/assets/select-CMOnuEoT.js">
|
|
38
38
|
<link rel="modulepreload" crossorigin href="/assets/platform-targets-BIQ1lKOg.js">
|
|
39
|
-
<link rel="modulepreload" crossorigin href="/assets/tabs-
|
|
39
|
+
<link rel="modulepreload" crossorigin href="/assets/tabs-CCixnxMe.js">
|
|
40
40
|
<link rel="modulepreload" crossorigin href="/assets/circle-question-mark-CJvcT6V6.js">
|
|
41
41
|
<link rel="modulepreload" crossorigin href="/assets/tooltip-D1ydB4g3.js">
|
|
42
|
-
<link rel="modulepreload" crossorigin href="/assets/copy-button-
|
|
43
|
-
<link rel="modulepreload" crossorigin href="/assets/checkbox-
|
|
42
|
+
<link rel="modulepreload" crossorigin href="/assets/copy-button-DnGsXbVV.js">
|
|
43
|
+
<link rel="modulepreload" crossorigin href="/assets/checkbox-C84IyqEB.js">
|
|
44
44
|
<link rel="modulepreload" crossorigin href="/assets/triangle-alert-BXrJNk3g.js">
|
|
45
|
-
<link rel="modulepreload" crossorigin href="/assets/badge-
|
|
46
|
-
<link rel="modulepreload" crossorigin href="/assets/label-
|
|
47
|
-
<link rel="modulepreload" crossorigin href="/assets/get-error-message-
|
|
48
|
-
<link rel="modulepreload" crossorigin href="/assets/use-platform-stream-
|
|
45
|
+
<link rel="modulepreload" crossorigin href="/assets/badge-i00PiRCo.js">
|
|
46
|
+
<link rel="modulepreload" crossorigin href="/assets/label-DTHSKF2S.js">
|
|
47
|
+
<link rel="modulepreload" crossorigin href="/assets/get-error-message-yQcVJ-Ja.js">
|
|
48
|
+
<link rel="modulepreload" crossorigin href="/assets/use-platform-stream-BVf5gGJM.js">
|
|
49
49
|
<link rel="modulepreload" crossorigin href="/assets/catalog-template-icons-3S8RvUxD.js">
|
|
50
50
|
<link rel="modulepreload" crossorigin href="/assets/layers-1figUpjG.js">
|
|
51
51
|
<link rel="modulepreload" crossorigin href="/assets/dist-xY0pK9Wy.js">
|
|
52
|
-
<link rel="modulepreload" crossorigin href="/assets/dropdown-menu-
|
|
53
|
-
<link rel="modulepreload" crossorigin href="/assets/platforms-
|
|
54
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-table-
|
|
52
|
+
<link rel="modulepreload" crossorigin href="/assets/dropdown-menu-82O7jPU6.js">
|
|
53
|
+
<link rel="modulepreload" crossorigin href="/assets/platforms-DbzXekvY.js">
|
|
54
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-table-SVvT6QrW.js">
|
|
55
55
|
<link rel="modulepreload" crossorigin href="/assets/arrow-up-down-C1oJAmrw.js">
|
|
56
56
|
<link rel="modulepreload" crossorigin href="/assets/download-DmUZKo9N.js">
|
|
57
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
58
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
59
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
60
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
61
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
62
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
63
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
64
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
65
|
-
<link rel="modulepreload" crossorigin href="/assets/validation-CCol1kXN.js">
|
|
57
|
+
<link rel="modulepreload" crossorigin href="/assets/auth-screen-backdrop-CgwRhIbi.js">
|
|
58
|
+
<link rel="modulepreload" crossorigin href="/assets/combobox-BJecIYHE.js">
|
|
59
|
+
<link rel="modulepreload" crossorigin href="/assets/tags-DAJ-rQYR.js">
|
|
60
|
+
<link rel="modulepreload" crossorigin href="/assets/catalog-source-W3TI0pmx.js">
|
|
61
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-link-D-uJbw97.js">
|
|
62
|
+
<link rel="modulepreload" crossorigin href="/assets/use-engine-command-mutation-RvjgD8uv.js">
|
|
63
|
+
<link rel="modulepreload" crossorigin href="/assets/models-DhRo1Ytd.js">
|
|
64
|
+
<link rel="modulepreload" crossorigin href="/assets/validation-_QtRYqIT.js">
|
|
66
65
|
<link rel="modulepreload" crossorigin href="/assets/shallow-Cin0mLuv.js">
|
|
67
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
68
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
69
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
70
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
71
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
72
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
73
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
74
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
75
|
-
<link rel="modulepreload" crossorigin href="/assets/events-DMpCBVAp.js">
|
|
66
|
+
<link rel="modulepreload" crossorigin href="/assets/use-transition-navigate-DtyJz2Z1.js">
|
|
67
|
+
<link rel="modulepreload" crossorigin href="/assets/transition-nav-link-Bf02_OAE.js">
|
|
68
|
+
<link rel="modulepreload" crossorigin href="/assets/control-BLUTBbet.js">
|
|
69
|
+
<link rel="modulepreload" crossorigin href="/assets/catalog-DqOwOydE.js">
|
|
70
|
+
<link rel="modulepreload" crossorigin href="/assets/select-display-items-y2L7MHmk.js">
|
|
71
|
+
<link rel="modulepreload" crossorigin href="/assets/transition-types-CPlGtM8w.js">
|
|
72
|
+
<link rel="modulepreload" crossorigin href="/assets/fleet-C20wXA8E.js">
|
|
73
|
+
<link rel="modulepreload" crossorigin href="/assets/events-BTqDmbVu.js">
|
|
76
74
|
<link rel="stylesheet" crossorigin href="/assets/index-DmjK3skd.css">
|
|
77
75
|
</head>
|
|
78
76
|
<body>
|
package/miravo
CHANGED
|
Binary file
|