@miravo/cli-linux-x64 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/console-dist/assets/{AnimatePresence-BZCmb1bq.js → AnimatePresence-BSSlw02V.js} +3 -3
  2. package/console-dist/assets/{activity-Cn48I9qe.js → activity-Cy_niK56.js} +1 -1
  3. package/console-dist/assets/{api-kPM52mb-.js → api-B2QJEzbS.js} +1 -1
  4. package/console-dist/assets/api-Vq4lny_H.js +1 -0
  5. package/console-dist/assets/arrow-up-right-CwPw_2U1.js +1 -0
  6. package/console-dist/assets/asset-detail-E-TllNHT.js +1 -0
  7. package/console-dist/assets/asset-detail-actions-jjbvaDES.js +1 -0
  8. package/console-dist/assets/asset-panel-DDziFlFl.js +1 -0
  9. package/console-dist/assets/{auth-screen-backdrop-hcEYy3K4.js → auth-screen-backdrop-CEykEbfF.js} +1 -1
  10. package/console-dist/assets/backup-power-BDMAO2bO.js +1 -0
  11. package/console-dist/assets/badge-Bk1DaL6C.js +1 -0
  12. package/console-dist/assets/boiler-CWAR1Nq2.js +1 -0
  13. package/console-dist/assets/by-path-VBqTBdlG.js +1 -0
  14. package/console-dist/assets/catalog-BlkPPAWE.js +1 -0
  15. package/console-dist/assets/catalog-CQopEu5C.js +1 -0
  16. package/console-dist/assets/{catalog-source-2aT9qob-.js → catalog-source-B4L5N-a1.js} +1 -1
  17. package/console-dist/assets/catalog-template-icons-BOSywIKV.js +1 -0
  18. package/console-dist/assets/check-B-yvIfMj.js +1 -0
  19. package/console-dist/assets/checkbox-DEAkDfFr.js +1 -0
  20. package/console-dist/assets/chevron-down-x70Pto6j.js +1 -0
  21. package/console-dist/assets/chevron-left-XHFooLn1.js +1 -0
  22. package/console-dist/assets/chevron-right-CMSQPSEo.js +1 -0
  23. package/console-dist/assets/chiller-BSx8eUMN.js +1 -0
  24. package/console-dist/assets/{circle-x-CGcRflg7.js → circle-x-_o0nl0Rg.js} +1 -1
  25. package/console-dist/assets/combobox-B8h0-NHs.js +1 -0
  26. package/console-dist/assets/commercial-building-CNvi6IZK.js +1 -0
  27. package/console-dist/assets/compressor-D63w6Ir2.js +1 -0
  28. package/console-dist/assets/console-panel-CMDoBJiO.js +1 -0
  29. package/console-dist/assets/control-CBviLxJB.js +1 -0
  30. package/console-dist/assets/control-jNqzZWa9.js +1 -0
  31. package/console-dist/assets/copy-button-CSUP1VjU.js +1 -0
  32. package/console-dist/assets/{dialog-Di9Bs0FH.js → dialog-B5PqrKVw.js} +1 -1
  33. package/console-dist/assets/district-heating-Cr4CrgCA.js +1 -0
  34. package/console-dist/assets/dom-Cm_OH5jc.js +1 -0
  35. package/console-dist/assets/{download-B9e1wNK4.js → download-i8CTJ7oi.js} +1 -1
  36. package/console-dist/assets/{local-flag-CPAqDO-L.js → dropdown-menu-B_MMNbTy.js} +1 -1
  37. package/console-dist/assets/events-D531_1EZ.js +1 -0
  38. package/console-dist/assets/events-RmbRTKFV.js +1 -0
  39. package/console-dist/assets/events-format-C5HTkIsC.js +1 -0
  40. package/console-dist/assets/export-tab-fZDO4r2u.js +1 -0
  41. package/console-dist/assets/factory-C2OucdpQ.js +1 -0
  42. package/console-dist/assets/factory-CgSIjU5V.js +1 -0
  43. package/console-dist/assets/factory-DLE12zAd.js +1 -0
  44. package/console-dist/assets/floor-page-D0mX5OuA.js +1 -0
  45. package/console-dist/assets/floor-page-E-0txA4z.css +1 -0
  46. package/console-dist/assets/format-Bx7DF-TB.js +1 -0
  47. package/console-dist/assets/genset-BRgqR1AT.js +1 -0
  48. package/console-dist/assets/{get-error-message-eGdenTLv.js → get-error-message-dM0BMfdP.js} +1 -1
  49. package/console-dist/assets/index-CrLa65Ur.css +2 -0
  50. package/console-dist/assets/index-CvuwOe37.js +12 -0
  51. package/console-dist/assets/{integration-api-Bg7D1eQc.js → integration-api-D2tA69Yb.js} +1 -1
  52. package/console-dist/assets/integrations-BLG4PT3c.js +1 -0
  53. package/console-dist/assets/integrations-iAjWxaDS.js +1 -0
  54. package/console-dist/assets/{label-DWyy9MeT.js → label-2sIXTEUK.js} +1 -1
  55. package/console-dist/assets/loader-circle-DjgHgHHl.js +1 -0
  56. package/console-dist/assets/{login-BZKYK0yZ.js → login-DpNKicxy.js} +1 -1
  57. package/console-dist/assets/minus-CaT9UaQx.js +1 -0
  58. package/console-dist/assets/model-schemas-3w38IPdc.js +1 -0
  59. package/console-dist/assets/models-CMN9Eppf.js +1 -0
  60. package/console-dist/assets/models-I_V8J5Y0.js +1 -0
  61. package/console-dist/assets/not-found-C4YVKP97.js +1 -0
  62. package/console-dist/assets/pause-CqW7v5Dc.js +1 -0
  63. package/console-dist/assets/pharma-cleanroom-ClJRwROz.js +1 -0
  64. package/console-dist/assets/play-kg50os4l.js +1 -0
  65. package/console-dist/assets/plus-Cl4Ay5Ry.js +1 -0
  66. package/console-dist/assets/protocol-card-ARSwIjkN.js +1 -0
  67. package/console-dist/assets/proxy-CWZabK8f.js +1 -0
  68. package/console-dist/assets/query-fetch-error-CWLZA2L5.js +1 -0
  69. package/console-dist/assets/{radio-DRkzblxj.js → radio-BxpVYiyS.js} +1 -1
  70. package/console-dist/assets/registry-Dau_GjK6.js +2 -0
  71. package/console-dist/assets/{rocket-807Pf7C1.js → rocket-KZ5oHK1G.js} +1 -1
  72. package/console-dist/assets/rtu-D-1lltcO.js +1 -0
  73. package/console-dist/assets/select-BWlrSYlA.js +1 -0
  74. package/console-dist/assets/{select-display-items-D-L3PesO.js → select-display-items-DN2G8DNG.js} +1 -1
  75. package/console-dist/assets/{server-CS2Tw__K.js → server-BVem_egD.js} +1 -1
  76. package/console-dist/assets/sliders-horizontal-BNKmYQgd.js +1 -0
  77. package/console-dist/assets/smart-factory-cem4tLAv.js +1 -0
  78. package/console-dist/assets/{source-host-miravo-D_AecPVc.js → source-host-miravo-B8eM2IHw.js} +1 -1
  79. package/console-dist/assets/stages-hidkaJPI.js +1 -0
  80. package/console-dist/assets/status-CZFZLqVk.js +1 -0
  81. package/console-dist/assets/tabs-BbQkzBZZ.js +1 -0
  82. package/console-dist/assets/tags-BBz30-eV.js +4 -0
  83. package/console-dist/assets/tags-K96jT8PY.js +1 -0
  84. package/console-dist/assets/tank-THHXGdzg.js +1 -0
  85. package/console-dist/assets/tooltip-B3vOB1Vu.js +1 -0
  86. package/console-dist/assets/{transition-nav-link-cn4KZD6W.js → transition-nav-link-B11-gXld.js} +1 -1
  87. package/console-dist/assets/{trash-2-BJ-1df0F.js → trash-2-BH9HDsZv.js} +1 -1
  88. package/console-dist/assets/{triangle-alert-D1AraFcP.js → triangle-alert-DoAwrRgk.js} +1 -1
  89. package/console-dist/assets/use-engine-command-mutation-CHqjOqfS.js +1 -0
  90. package/console-dist/assets/use-transition-navigate-B-nk4aWh.js +2 -0
  91. package/console-dist/assets/useQuery-M9KTdi7Q.js +1 -0
  92. package/console-dist/assets/validation-BkfmaBBi.js +1 -0
  93. package/console-dist/assets/water-treatment-CfVR0p0L.js +1 -0
  94. package/console-dist/index.html +68 -54
  95. package/miravo +2 -2
  96. package/package.json +1 -1
  97. package/console-dist/assets/api-DybIIqOe.js +0 -1
  98. package/console-dist/assets/asset-detail-tmOrYE8x.js +0 -1
  99. package/console-dist/assets/badge-D4jktT8T.js +0 -1
  100. package/console-dist/assets/catalog-DN-klsod.js +0 -1
  101. package/console-dist/assets/catalog-M-k7Y9Sp.js +0 -1
  102. package/console-dist/assets/catalog-template-icons-C7KJdJJX.js +0 -1
  103. package/console-dist/assets/checkbox-AaJhjtZk.js +0 -1
  104. package/console-dist/assets/chevron-down-CAk5w9Wt.js +0 -1
  105. package/console-dist/assets/chevron-right-BfZjrUWh.js +0 -1
  106. package/console-dist/assets/combobox-BFEY6lgO.js +0 -1
  107. package/console-dist/assets/control-CD9UoTvu.js +0 -1
  108. package/console-dist/assets/control-DHa2-a2v.js +0 -1
  109. package/console-dist/assets/copy-button-DHm7RGJ5.js +0 -1
  110. package/console-dist/assets/events-D19CzgoQ.js +0 -1
  111. package/console-dist/assets/events-DmftG8n5.js +0 -1
  112. package/console-dist/assets/export-tab-ouFgYEU_.js +0 -1
  113. package/console-dist/assets/factory-CT2VYi0n.js +0 -1
  114. package/console-dist/assets/factory-DSrBtcG2.js +0 -1
  115. package/console-dist/assets/format-OUFL_tef.js +0 -1
  116. package/console-dist/assets/index-DuJJSpJp.js +0 -12
  117. package/console-dist/assets/index-iEV9hU2I.css +0 -2
  118. package/console-dist/assets/integrations-DWW9HjH0.js +0 -1
  119. package/console-dist/assets/integrations-DoXNrzD5.js +0 -1
  120. package/console-dist/assets/models-CrDBHBV5.js +0 -1
  121. package/console-dist/assets/models-jBVcY8Xd.js +0 -1
  122. package/console-dist/assets/not-found-BqVny4Md.js +0 -1
  123. package/console-dist/assets/play-TTg_EXSa.js +0 -1
  124. package/console-dist/assets/plus-BbVbvFTe.js +0 -1
  125. package/console-dist/assets/protocol-card-B2SpAJKe.js +0 -1
  126. package/console-dist/assets/query-fetch-error-C2Ec4RQS.js +0 -1
  127. package/console-dist/assets/select-Bg6PPro0.js +0 -1
  128. package/console-dist/assets/tabs-bI9sskHy.js +0 -1
  129. package/console-dist/assets/tags-B7e7VYVW.js +0 -1
  130. package/console-dist/assets/tags-DJJKQRZZ.js +0 -4
  131. package/console-dist/assets/use-engine-command-mutation-DMkQxmt9.js +0 -1
  132. package/console-dist/assets/use-transition-navigate-BiV2QCcA.js +0 -2
  133. package/console-dist/assets/validation-q38DYDwu.js +0 -1
  134. /package/console-dist/assets/{chunk-OE4NN4TA-Q4iNR9l9.js → chunk-OE4NN4TA-DBWZidbW.js} +0 -0
  135. /package/console-dist/assets/{dist-CtuJWBnP.js → dist-xY0pK9Wy.js} +0 -0
  136. /package/console-dist/assets/{integration-targets-BehiqWyT.js → integration-targets-Byvdd3Or.js} +0 -0
  137. /package/console-dist/assets/{runtime-link-ChF8TM68.js → runtime-link-vBANRqcD.js} +0 -0
  138. /package/console-dist/assets/{transition-types-049V0Kr0.js → transition-types-BKZuWApE.js} +0 -0
  139. /package/console-dist/assets/{utils-BO2u-wC_.js → utils-XFKvwlFT.js} +0 -0
  140. /package/console-dist/assets/{vendor-table-Br-cHaxY.js → vendor-table-B0Z9e_sn.js} +0 -0
@@ -0,0 +1 @@
1
+ import{r as e}from"./api-B2QJEzbS.js";export{e as changePassword};
@@ -0,0 +1 @@
1
+ import{n as e}from"./utils-XFKvwlFT.js";var t=e(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{a as t,c as n,i as r,n as i,o as a,r as o,t as s}from"./vendor-charts-95ykyDlI.js";import{ot as c}from"./vendor-ui-D8j69UH4.js";import{S as l,o as u,ot as d,v as f}from"./api-B2QJEzbS.js";import{t as p}from"./useQuery-M9KTdi7Q.js";import{t as m}from"./proxy-CWZabK8f.js";import{i as h,r as ee}from"./dist-xY0pK9Wy.js";import{c as te,l as ne}from"./chunk-OE4NN4TA-DBWZidbW.js";import{n as g,o as _,r as v,t as y}from"./dialog-B5PqrKVw.js";import{C as re,_ as b,a as x,b as S,c as C,f as w,g as T,i as E,n as D,p as ie,r as O,s as ae,u as k}from"./format-Bx7DF-TB.js";import{n as A,t as j}from"./utils-XFKvwlFT.js";import{t as M}from"./activity-Cy_niK56.js";import{t as N}from"./copy-button-CSUP1VjU.js";import{n as oe,t as se}from"./sliders-horizontal-BNKmYQgd.js";import{t as P}from"./radio-BxpVYiyS.js";import{n as ce,t as le}from"./query-fetch-error-CWLZA2L5.js";import{t as F}from"./triangle-alert-DoAwrRgk.js";import{i as I,n as L,t as R}from"./tooltip-B3vOB1Vu.js";import{t as z}from"./badge-Bk1DaL6C.js";import{t as ue}from"./transition-types-BKZuWApE.js";import{n as B}from"./auth-screen-backdrop-CEykEbfF.js";import{n as de}from"./get-error-message-dM0BMfdP.js";import{n as V,r as fe}from"./use-engine-command-mutation-CHqjOqfS.js";import{i as H,n as U,r as pe,t as me}from"./tabs-BbQkzBZZ.js";import{i as he,n as ge,r as _e,t as ve}from"./asset-detail-actions-jjbvaDES.js";var ye=A(`layers-2`,[[`path`,{d:`M13 13.74a2 2 0 0 1-2 0L2.5 8.87a1 1 0 0 1 0-1.74L11 2.26a2 2 0 0 1 2 0l8.5 4.87a1 1 0 0 1 0 1.74z`,key:`15q6uc`}],[`path`,{d:`m20 14.285 1.5.845a1 1 0 0 1 0 1.74L13 21.74a2 2 0 0 1-2 0l-8.5-4.87a1 1 0 0 1 0-1.74l1.5-.845`,key:`byia6g`}]]),be=A(`signal`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}],[`path`,{d:`M12 20v-8`,key:`i3yub9`}],[`path`,{d:`M17 20V8`,key:`1tkaf5`}],[`path`,{d:`M22 4v16`,key:`sih9yq`}]]),xe=A(`timer`,[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]),W=e(n(),1),G=c();function K({detail:e,tick:t,activeFaults:n,memberValues:r,onBack:i}){let a=n.length,o=e.isQuarantined,s=`OK`,c=`ok`;a>0?(s=`FAULT`,c=`bad`):o&&(s=`QRTN`,c=`warn`);let l=0;if(r)for(let e of r.values())e.quality!==`good`&&l++;let u=Object.keys(e.members).length,d=r?.get(`availability_state`)?.value,f=e.members.availability_state?.value,p=typeof d==`string`?d:typeof f==`string`?f:`unknown`,m=p===`running`?{dot:`bg-success`,pulse:`bg-success/60`,animate:!0}:p===`faulted`?{dot:`bg-destructive`,pulse:`bg-destructive/60`,animate:!0}:p===`stopped`?{dot:`bg-warning`,pulse:`bg-warning/60`,animate:!0}:{dot:`bg-muted-foreground/60`,pulse:`bg-muted-foreground/50`,animate:!1},h=p===`running`?`Availability state is running — the asset is available and in service.`:p===`faulted`?`Availability state is faulted — the asset is unavailable because a fault is active.`:p===`stopped`?`Availability state is stopped — the asset is available but not running.`:`Availability state is not available for this asset yet.`;return(0,G.jsxs)(`header`,{className:j(fe,`flex w-full min-w-0 flex-col`),children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 px-5 py-4 sm:flex-row sm:items-start sm:justify-between sm:gap-4`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:i,className:`transition-colors hover:text-foreground`,children:`Assets`}),(0,G.jsx)(`span`,{"aria-hidden":!0,children:`/`}),(0,G.jsx)(`span`,{className:`truncate`,children:k(e.assetType)})]}),(0,G.jsx)(W.ViewTransition,{name:`asset-${e.id}`,default:`none`,children:(0,G.jsx)(`h1`,{className:`font-heading mt-1 text-2xl font-semibold uppercase leading-tight tracking-wide`,children:ae(e.id)})}),(0,G.jsxs)(`div`,{className:`mt-1.5 flex min-w-0 items-center gap-1.5`,children:[(0,G.jsx)(`p`,{className:`m-0 min-w-0 flex-1 font-mono text-[10px] leading-tight tracking-tight text-muted-foreground`,children:(0,G.jsx)(`span`,{className:`break-all`,children:e.browsePath.join(` / `)})}),(0,G.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,G.jsx)(N,{value:x(e.browsePath),label:`Copy Topic / UNS path`})})]})]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 self-end font-mono text-xs sm:self-start`,children:[(0,G.jsx)(P,{className:`size-3.5 animate-pulse text-primary`,"aria-hidden":!0}),(0,G.jsx)(`span`,{className:`font-medium text-primary`,children:`LIVE`}),(0,G.jsxs)(`span`,{className:`tabular-nums text-muted-foreground`,children:[`t=`,t]}),(0,G.jsxs)(R,{children:[(0,G.jsx)(I,{render:(0,G.jsx)(`span`,{className:`inline-flex size-3.5 items-center justify-center outline-none focus-visible:ring-2 focus-visible:ring-ring`}),children:(0,G.jsxs)(`span`,{"aria-hidden":!0,className:`relative flex size-1.5 shrink-0 items-center justify-center`,children:[(0,G.jsx)(`span`,{className:j(`relative inline-flex size-1.5 rounded-full`,m.dot)}),m.animate&&(0,G.jsx)(`span`,{className:j(`absolute inline-flex size-2.5 animate-ping rounded-full opacity-75`,m.pulse)})]})}),(0,G.jsx)(L,{side:`top`,align:`end`,children:(0,G.jsxs)(`span`,{className:`block max-w-[16rem] text-[11px] leading-snug`,children:[(0,G.jsx)(`span`,{className:`font-medium uppercase tracking-[0.08em]`,children:`Availability`}),` `,(0,G.jsxs)(`span`,{className:`text-muted-foreground`,children:[`— `,h]})]})})]})]})]}),(0,G.jsxs)(`fieldset`,{"aria-label":`Asset status`,className:`m-0 flex flex-col border-0 border-t border-border/50 p-0`,children:[(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-px bg-transparent`,children:[(0,G.jsx)(q,{variant:`primary`,icon:M,label:`Health`,value:s,tone:c,tooltip:`Rolls up active faults and quarantine into a single status — OK when nothing is asserted, FAULT when any fault is active, QRTN when the asset is excluded from the running factory.`}),(0,G.jsx)(q,{variant:`primary`,icon:F,label:`Active faults`,labelCompact:`Faults`,value:String(a),tone:a>0?`bad`:`neutral`,tooltip:`Fault codes currently asserted on this asset. Clear or inject faults from the Alarms section below.`})]}),(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-px border-t border-border/50 bg-transparent sm:grid-cols-4`,children:[(0,G.jsx)(q,{variant:`compact`,icon:ye,label:`Lifecycle`,labelCompact:`Life`,value:C(e.lifecycleStage),tone:S(e.lifecycleStage),tooltip:`Where this asset sits in its operational lifecycle (e.g. commissioning, operating, maintenance, retired).`}),(0,G.jsx)(q,{variant:`compact`,icon:oe,label:`Tags`,value:String(u),tone:`neutral`,tooltip:`Total members exposed by this asset — process variables, state flags, counters, commands, and reference fields combined.`}),(0,G.jsx)(q,{variant:`compact`,icon:be,label:`Bad quality`,value:String(l),tone:l>0?`warn`:`neutral`,tooltip:`Members whose quality stamp is anything other than good (uncertain or bad). A healthy asset reads 0.`}),(0,G.jsx)(q,{variant:`compact`,icon:xe,label:`Operating age`,value:ie(e.operatingHours),tone:`neutral`,tooltip:`Total operating age on this asset, including any factory-seeded starting hours plus simulated runtime elapsed in this session.`})]})]})]})}function q({icon:e,label:t,labelCompact:n,value:r,suffix:i,tone:a,variant:o=`compact`,tooltip:s}){let c=o===`primary`;return(0,G.jsxs)(`div`,{className:j(`relative flex min-w-0 flex-col justify-center`,c?`min-h-20 gap-1.5 px-4 py-4 sm:min-h-24 sm:px-6 sm:py-5 lg:min-h-28 lg:px-8`:`min-h-12 gap-1 px-3 py-2.5 sm:min-h-13 sm:px-4 lg:min-h-14 lg:px-5`),children:[(0,G.jsx)(`div`,{className:`flex min-h-0 min-w-0 items-center gap-2`,children:(0,G.jsxs)(R,{children:[(0,G.jsxs)(I,{className:`flex min-h-0 min-w-0 flex-1 cursor-default items-center gap-2 text-left`,render:(0,G.jsx)(`div`,{}),children:[(0,G.jsx)(e,{className:j(`shrink-0 text-muted-foreground`,c?`size-4`:`size-3.5`),"aria-hidden":!0}),(0,G.jsxs)(`span`,{className:j(`min-w-0 flex-1 font-medium tracking-wide text-muted-foreground uppercase 2xl:tracking-wider`,c?`text-[11px] leading-snug sm:text-[12px]`:`text-[9px] leading-snug sm:text-[10px]`),children:[(0,G.jsx)(`span`,{className:`block wrap-break-word 2xl:hidden`,children:n??t}),(0,G.jsx)(`span`,{className:`hidden wrap-break-word 2xl:block`,children:t})]})]}),(0,G.jsx)(L,{side:`top`,align:`start`,sideOffset:6,className:`max-w-xs`,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`span`,{className:`font-medium text-foreground`,children:t}),(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:s??t})]})})]})}),(0,G.jsxs)(`p`,{className:j(`min-w-0 wrap-break-word font-mono font-semibold leading-tight tracking-tight tabular-nums`,c?`text-2xl sm:text-3xl lg:text-4xl`:`text-base lg:text-lg`,a===`ok`&&`text-success`,a===`warn`&&`text-warning`,a===`bad`&&`text-destructive`,a===`neutral`&&`text-foreground`),children:[r,i?(0,G.jsx)(`span`,{className:j(`ml-0.5 font-medium text-muted-foreground`,c?`text-base lg:text-lg`:`text-xs lg:text-sm`),children:i}):null]})]})}function J({title:e,subtitle:t,children:n,className:r,id:i}){return(0,G.jsxs)(`section`,{id:i,className:j(V,r),children:[(0,G.jsxs)(`div`,{className:`border-b border-border/60 px-4 py-3`,children:[(0,G.jsx)(`h2`,{className:`blueprint-title text-foreground`,children:e}),t?(0,G.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:t}):null]}),(0,G.jsx)(`div`,{className:`overflow-hidden p-0`,children:n})]})}var Se=new Set([`pu`,`h`]),Ce=[`_reference`,`_baseline`,`_setpoint`,`_command`],Y=`var(--color-primary)`,we=`var(--color-background)`,Te=60,Ee=1e-4;function X(e,t,n){let r=e?.get(t);return{value:r?.value??n.value,quality:r?.quality??n.quality}}function De(e){return Object.entries(e.members).filter(([e,t])=>t.meta.kind===`variable`&&t.meta.access===`read`&&t.meta.dataType===`Double`&&t.meta.euRange!==null&&!Se.has(t.meta.unit??``)&&!Ce.some(t=>e.endsWith(t)))}function Oe(e,t){if(e.length<2)return!1;let n=t-Te,r;for(let t of e)if(!(t.tick<n)){if(r===void 0){r=t.value;continue}if(Math.abs(t.value-r)>Ee)return!0}return!1}function ke({data:e,chartHeight:n=34,live:c=!1}){let l=(0,W.useId)(),[u,d]=(0,W.useState)(null),f=1/0,p=-1/0;for(let t of e)t.value<f&&(f=t.value),t.value>p&&(p=t.value);let m=e[e.length-1];return(0,G.jsxs)(`div`,{className:`flex min-h-0 w-full flex-col overflow-hidden`,style:{height:n+14},children:[(0,G.jsx)(`div`,{style:{height:n,width:`100%`},children:(0,G.jsx)(t,{width:`100%`,height:n,children:(0,G.jsxs)(s,{data:e,margin:{top:3,right:4,bottom:2,left:0},onMouseMove:e=>{let t=e?.activePayload?.[0]?.value;typeof t==`number`&&d(t)},onMouseLeave:()=>d(null),children:[(0,G.jsx)(`defs`,{children:(0,G.jsxs)(`linearGradient`,{id:l,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,G.jsx)(`stop`,{offset:`0%`,stopColor:Y,stopOpacity:.32}),(0,G.jsx)(`stop`,{offset:`100%`,stopColor:Y,stopOpacity:0})]})}),(0,G.jsx)(i,{domain:[`auto`,`auto`],hide:!0}),(0,G.jsx)(a,{content:()=>null,cursor:!1}),(0,G.jsx)(o,{type:`monotone`,dataKey:`value`,stroke:Y,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`url(#${l})`,isAnimationActive:!1,dot:!1,activeDot:{r:3,fill:Y,stroke:we,strokeWidth:1}}),m?(0,G.jsx)(r,{x:m.tick,y:m.value,r:2.25,fill:Y,stroke:we,strokeWidth:1.25,isFront:!0,ifOverflow:`extendDomain`}):null]})})}),(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[10px] leading-none tabular-nums text-muted-foreground`,children:[c?(0,G.jsxs)(`span`,{"aria-hidden":!0,className:`relative inline-flex size-1.5 shrink-0 items-center justify-center`,children:[(0,G.jsx)(`span`,{className:`absolute inline-flex size-2 animate-ping rounded-full bg-primary/50`}),(0,G.jsx)(`span`,{className:`relative inline-flex size-1.5 rounded-full bg-primary`})]}):null,u===null?(0,G.jsxs)(`span`,{children:[w(f),`–`,w(p)]}):(0,G.jsx)(`span`,{className:`font-medium text-primary`,children:w(u)})]})]})}function Ae({detail:e,processVariables:t,memberValues:n,historyRef:r,tick:i,showQuality:a}){let{liveMap:o,orderedVariables:s}=(0,W.useMemo)(()=>{let e=new Map,n=[],a=[];for(let o of t){let t=Oe(r.current.get(o[0])??[],i);e.set(o[0],t),(t?n:a).push(o)}return{liveMap:e,orderedVariables:[...n,...a]}},[t,n,i,r]);return t.length===0?(0,G.jsx)(J,{title:`Process`,subtitle:`No continuous analog readings defined for this asset`,className:`opacity-90`,children:(0,G.jsx)(`p`,{className:`px-4 py-6 text-center text-sm text-muted-foreground`,children:`This asset exposes no continuous process variables. Discrete states, flags, and commands are available in the Tags section below.`})}):(0,G.jsx)(J,{title:`Process`,subtitle:`Live tag readings — trend is ~2 min at 1 Hz`,children:(0,G.jsx)(`ul`,{className:`divide-y divide-border/40`,children:s.map(([t,i])=>{let{value:s,quality:c}=X(n,t,i),l=r.current.get(t)??[],u=E(e.browsePath,t),d=o.get(t)??!1,f=l.length>=2,p=b(i.meta.unit),h=T(t);return(0,G.jsxs)(m.li,{layout:`position`,transition:{duration:.36,ease:[.22,1,.36,1]},className:`flex flex-col gap-2.5 bg-background px-4 py-3 sm:flex-row sm:items-center sm:gap-5 sm:py-3.5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 sm:w-44 sm:shrink-0`,children:[(0,G.jsxs)(R,{children:[(0,G.jsx)(I,{className:`min-w-0 flex-1 cursor-default truncate text-left text-[11px] font-medium uppercase tracking-[var(--miravo-tracking-eyebrow)] text-muted-foreground`,render:(0,G.jsx)(`span`,{}),children:h}),(0,G.jsx)(L,{side:`top`,align:`start`,className:`max-w-xs`,children:h})]}),(0,G.jsx)(N,{value:u,label:`Copy Topic / UNS path`})]}),(0,G.jsxs)(`div`,{className:`relative h-[56px] min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{"aria-hidden":!0,className:`absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-border/30`}),f?(0,G.jsx)(ke,{data:l,chartHeight:42,live:d}):(0,G.jsx)(`p`,{className:`flex h-full items-center text-[10px] uppercase tracking-widest text-muted-foreground`,children:`Collecting trend…`})]}),(0,G.jsxs)(`div`,{className:`flex items-baseline gap-2 sm:min-w-36 sm:shrink-0 sm:justify-end`,children:[(0,G.jsx)(`span`,{className:`blueprint-stat text-2xl font-semibold leading-none tabular-nums text-foreground`,children:typeof s==`number`?w(s):String(s)}),p&&(0,G.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:p}),a&&c!==`good`&&(0,G.jsx)(z,{variant:c===`uncertain`?`secondary`:`destructive`,className:`shrink-0 text-[10px]`,children:c})]})]},t)})})})}function je({name:e,value:t,dataType:n,unit:r,access:i}){let a=T(e),o=i===`readwrite`;if(n===`Boolean`||typeof t==`boolean`||r===`pu`&&(t===0||t===1)){let n=t===!0||t===`true`||t===1,r=e.includes(`fault`);return(0,G.jsxs)(`div`,{className:`flex min-h-9 min-w-0 items-center justify-between gap-2 rounded-[var(--miravo-radius-tight)] border px-2 py-1 ${r&&n?`border-destructive/30 bg-transparent`:``}`,children:[(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-left text-[10px] leading-snug text-muted-foreground`,children:[a,o&&(0,G.jsx)(`span`,{className:`ml-1 text-[8px] text-primary`,children:`CMD`})]}),(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-xs font-medium tabular-nums ${r&&n?`text-destructive`:n?`text-success`:`text-muted-foreground`}`,children:n?`ON`:`OFF`})]})}if(n===`String`){let n=String(t),r=n===`none`||n===``,i=D.has(n)||e.includes(`fault_code`)&&!r,o=!i&&O.has(n);return(0,G.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-col justify-center gap-1 rounded-[var(--miravo-radius-tight)] border px-2 py-2 ${i?`border-destructive/30 bg-transparent`:o?`border-warning/30 bg-warning/5`:``}`,children:[(0,G.jsx)(`span`,{className:`wrap-break-word text-[10px] leading-tight text-muted-foreground`,children:a}),r?(0,G.jsx)(`span`,{className:`wrap-break-word font-mono text-sm font-medium leading-snug text-muted-foreground`,children:`—`}):(0,G.jsx)(`span`,{title:n,className:`wrap-break-word font-mono text-sm font-medium leading-snug ${i?`text-destructive`:o?`text-warning`:`text-foreground`}`,children:C(n)})]})}return(0,G.jsxs)(`div`,{className:`flex min-h-9 min-w-0 items-center justify-between gap-2 rounded-[var(--miravo-radius-tight)] border px-2 py-1`,children:[(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-left text-[10px] leading-snug text-muted-foreground`,children:[a,o&&(0,G.jsx)(`span`,{className:`ml-1 text-[8px] text-primary`,children:`CMD`})]}),(0,G.jsxs)(`span`,{className:`shrink-0 text-right font-mono text-xs font-medium tabular-nums`,children:[typeof t==`number`?w(t):String(t),r&&(0,G.jsx)(`span`,{className:`ml-1 text-[10px] text-muted-foreground`,children:b(r)})]})]})}function Me(e){return[...e].sort((e,t)=>{let n=e[1].meta.access===`readwrite`;return n===(t[1].meta.access===`readwrite`)?e[0].localeCompare(t[0]):n?-1:1})}function Ne({stringEnumMembers:e,nonStringOperationalMembers:t,memberValues:n,className:r}){let i=(0,W.useMemo)(()=>Me(e),[e]),a=(0,W.useMemo)(()=>Me(t),[t]),o=`grid min-w-0 gap-2 [grid-template-columns:repeat(auto-fill,minmax(min(100%,12.5rem),1fr))]`;return(0,G.jsx)(J,{title:`Tags`,subtitle:`Mode, status flags, and control tags`,className:r,children:(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-5 p-4`,children:[i.length>0&&(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[a.length>0&&(0,G.jsx)(`h3`,{className:`blueprint-title text-muted-foreground`,children:`States`}),(0,G.jsx)(`div`,{className:o,children:i.map(([e,t])=>{let{value:r}=X(n,e,t);return(0,G.jsx)(je,{name:e,value:r,dataType:t.meta.dataType,unit:t.meta.unit,access:t.meta.access},e)})})]}),a.length>0&&(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[i.length>0&&(0,G.jsx)(`h3`,{className:`blueprint-title text-muted-foreground`,children:`Flags & commands`}),(0,G.jsx)(`div`,{className:o,children:a.map(([e,t])=>{let{value:r}=X(n,e,t);return(0,G.jsx)(je,{name:e,value:r,dataType:t.meta.dataType,unit:t.meta.unit,access:t.meta.access},e)})})]})]})})}function Z({className:e,counters:t,memberValues:n}){return(0,G.jsx)(J,{title:`Counters`,subtitle:`Totals, hours, and accumulators`,className:e,children:(0,G.jsx)(`div`,{className:`flex flex-col gap-2 p-4`,children:t.map(([e,t])=>{let{value:r}=X(n,e,t);return(0,G.jsxs)(`div`,{className:`flex items-center justify-between rounded-[var(--miravo-radius-tight)] border border-border/60 bg-transparent px-3 py-2`,children:[(0,G.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:T(e)}),(0,G.jsxs)(`span`,{className:`blueprint-stat text-sm font-medium`,children:[typeof r==`number`?w(r):String(r),t.meta.unit&&(0,G.jsx)(`span`,{className:`ml-1 text-[10px] text-muted-foreground`,children:b(t.meta.unit)})]})]},e)})})})}function Q({className:e,detail:t,referenceMembers:n,memberValues:r}){let i=Object.keys(t.parameters).length>0,a=n.length>0;return!i&&!a?null:(0,G.jsx)(J,{title:`Nameplate & configuration`,subtitle:`Design parameters, identity, and reference values`,className:e,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[i&&(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-3`,children:Object.entries(t.parameters).map(([e,t])=>(0,G.jsxs)(`div`,{className:`flex flex-col gap-0.5 py-1.5`,children:[(0,G.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:T(e)}),(0,G.jsxs)(`span`,{className:`font-mono text-sm font-medium`,children:[typeof t.value==`number`?w(t.value):String(t.value),t.unit&&(0,G.jsx)(`span`,{className:`ml-1 text-[10px] text-muted-foreground`,children:b(t.unit)})]})]},e))}),a&&(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-3`,children:n.map(([e,t])=>{let{value:n}=X(r,e,t);return(0,G.jsxs)(`div`,{className:`flex flex-col gap-0.5 rounded-[var(--miravo-radius-tight)] border border-border/60 bg-transparent p-2`,children:[(0,G.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:T(e)}),(0,G.jsxs)(`span`,{className:`font-mono text-sm font-medium`,children:[typeof n==`number`?w(n):String(n),t.meta.unit&&(0,G.jsx)(`span`,{className:`ml-1 text-[10px] text-muted-foreground`,children:b(t.meta.unit)})]})]},e)})})]})})}function Pe({detail:e,memberValues:t}){if(!e.members.state_label)return null;let n=n=>t?.get(n)?.value??e.members[n]?.value;return(0,G.jsxs)(`section`,{className:`flex flex-wrap items-center gap-3 text-sm`,"aria-label":`Station production`,children:[(0,G.jsx)(z,{variant:`secondary`,children:String(n(`state_label`)??`idle`)}),(0,G.jsxs)(`span`,{children:[`Good: `,w(Number(n(`good_count`)??0))]}),(0,G.jsxs)(`span`,{children:[`Scrap: `,w(Number(n(`scrap_count`)??0))]}),n(`stop_reason`)&&(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:String(n(`stop_reason`))})]})}var Fe=120,Ie=`gap-4 sm:gap-5 lg:gap-x-6 lg:gap-y-5 xl:gap-x-8`,$=`asset-detail-page relative isolate mx-auto flex min-h-full w-full max-w-screen-2xl flex-col gap-6 p-4 sm:gap-8 sm:p-6`;function Le(e){return e instanceof Error&&`code`in e&&e.code===`NOT_FOUND`?!0:e instanceof Error&&/^404\b/.test(e.message.trim())}function Re(){let{id:e}=ne(),t=te(),n=(0,W.useCallback)(()=>{(0,W.startTransition)(()=>{(0,W.addTransitionType)(ue),t(`/?tab=assets`)})},[t]),[r,i]=(0,W.useState)(!1),[a,o]=h(`tab`,ee([`hmi`,`operate`,`data`,`operations`]).withDefault(`hmi`)),s=a===`data`||a===`operations`?`operate`:a;(0,W.useEffect)(()=>{(a===`data`||a===`operations`)&&o(`operate`)},[a,o]);let c=(0,W.useCallback)(e=>{o(`operate`),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.getElementById(e)?.scrollIntoView({behavior:`smooth`,block:`start`})})})},[o]);(0,W.useEffect)(()=>{let e=null,t=!1,r=()=>{t=!1,e&&=(clearTimeout(e),null)},a=a=>{if(a.metaKey||a.ctrlKey||a.altKey)return;let o=a.target;if(o){let e=o.tagName;if(e===`INPUT`||e===`TEXTAREA`||e===`SELECT`||o.isContentEditable)return}if(t){a.key===`f`?(c(`faults`),a.preventDefault()):a.key===`c`&&(c(`commands`),a.preventDefault()),r();return}if(a.key===`g`){t=!0,e=setTimeout(r,1200);return}a.key===`b`&&!a.shiftKey?(n(),a.preventDefault()):a.key===`?`&&(i(!0),a.preventDefault())};return window.addEventListener(`keydown`,a),()=>{window.removeEventListener(`keydown`,a),r()}},[n,c]);let g=p({queryKey:f.assets.detail(e??``),queryFn:()=>u(`/assets/${e}`,l.assetDetail),enabled:e!==void 0}),_=(0,W.useDeferredValue)(g.data??null),v=g.isError,y=d(t=>e?t.memberValues.get(e):void 0),b=d(e=>e.models),x=d(e=>e.assets),S=(0,W.useMemo)(()=>x.find(t=>t.id===e),[x,e]),C=S?.activeFaults,w=(0,W.useRef)(new Map),T=d(e=>e.tick);(0,W.useEffect)(()=>{if(!y||!e)return;let t=w.current;for(let[e,n]of y){if(typeof n.value!=`number`)continue;let r=t.get(e)??[];if(r[r.length-1]?.tick===T)continue;let i=r.length>=Fe?r.slice(r.length-Fe+1):r;t.set(e,[...i,{value:n.value,tick:T}])}},[y,T,e]);let E=(0,W.useMemo)(()=>_?De(_):[],[_]),D=(0,W.useMemo)(()=>{if(!_)return{operational:[],counters:[],reference:[]};let e=new Set(E.map(([e])=>e)),t=Object.entries(_.members).filter(([t])=>!e.has(t)),n=[],r=[],i=[];for(let e of t){let[,t]=e,a=t.meta.dataType,o=t.meta.kind,s=t.meta.unit,c=s===`pu`&&t.meta.euRange?.[0]===0&&t.meta.euRange?.[1]===1;o===`property`?i.push(e):a===`Boolean`||a===`String`||c?n.push(e):s===`count`||a===`UInt16`||a===`UInt32`?r.push(e):t.meta.access===`readwrite`||Ce.some(t=>e[0].endsWith(t))?n.push(e):s===`pu`||s===`h`?r.push(e):i.push(e)}return{operational:n,counters:r,reference:i}},[_,E]),ie=(0,W.useMemo)(()=>_?b.find(e=>e.name===_.assetType)?.faultNames??[]:[],[_,b]),O=C??_?.activeFaults??[],ae=(0,W.useMemo)(()=>{if(!y)return O.length>0;for(let[,e]of y)if(e.quality!==`good`)return!0;return!1},[y,O.length]),k=(0,W.useMemo)(()=>D.operational.filter(([,e])=>e.meta.dataType===`String`),[D.operational]),A=(0,W.useMemo)(()=>D.operational.filter(([,e])=>e.meta.dataType!==`String`),[D.operational]),M=he(e,_,()=>g.refetch());if(!_)return v?Le(g.error)?(0,G.jsx)(B,{className:`min-h-full`,children:(0,G.jsx)(`div`,{className:`flex min-h-[40vh] items-center justify-center p-6 sm:p-12`,children:(0,G.jsx)(`div`,{className:`w-full max-w-md`,children:(0,G.jsxs)(ce,{eyebrow:`Asset lookup`,stamp:`404`,title:`Asset not found`,detail:e??`Unknown asset id`,detailLabel:`Requested asset`,primaryLabel:`Back to Assets`,onPrimary:n,children:[(0,G.jsx)(`p`,{children:`The requested asset is no longer in the running factory or the URL is wrong.`}),(0,G.jsx)(`p`,{children:`Return to Assets and pick a live asset from the current factory.`})]})})})}):(0,G.jsx)(B,{className:`min-h-full`,children:(0,G.jsxs)(`div`,{className:`flex min-h-[40vh] flex-col items-center justify-center gap-4 p-6 sm:p-12`,children:[(0,G.jsx)(`div`,{className:`w-full max-w-md`,children:(0,G.jsx)(le,{message:de(g.error,`Could not load asset.`),onRetry:()=>void g.refetch(),isRetrying:g.isFetching})}),(0,G.jsx)(re,{variant:`outline`,size:`sm`,onClick:n,children:`Back to Assets`})]})}):S?(0,G.jsx)(`div`,{className:$,children:(0,G.jsx)(K,{detail:{id:S.id,assetType:S.model,browsePath:S.browsePath,lifecycleStage:S.lifecycleStage,operatingHours:S.operatingHours,activeFaults:S.activeFaults,isQuarantined:S.isQuarantined,parameters:{},inputs:{},members:{},methods:{}},tick:T,activeFaults:O,memberValues:y,onBack:n})}):null;let N=D.operational.length>0,P=D.counters.length>0,F=D.reference.length>0||Object.keys(_.parameters).length>0,I=N||P||F,L=Object.keys(_.methods).length>0,R=N&&!P&&!F,z=N&&P&&F;return(0,G.jsxs)(`div`,{className:$,children:[(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 -z-10 hidden select-none overflow-hidden md:block`,children:(0,G.jsx)(`span`,{className:`absolute -top-2 left-0 whitespace-nowrap uppercase leading-none opacity-35 blur-[2px]`,style:{fontFamily:`var(--miravo-font-heading)`,fontSize:`clamp(5rem, 14vw, 12rem)`,fontWeight:`var(--miravo-weight-medium)`,letterSpacing:`var(--miravo-tracking-heading)`,color:`var(--miravo-ghost)`},children:_.assetType.replace(/_/g,` `)})}),(0,G.jsx)(K,{detail:_,tick:T,activeFaults:O,memberValues:y,onBack:n}),(0,G.jsx)(Pe,{detail:_,memberValues:y}),(0,G.jsx)(W.ViewTransition,{enter:`fade-in`,default:`none`,children:(0,G.jsxs)(me,{value:s,onValueChange:e=>{o(e)},className:`min-h-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`shrink-0 overflow-x-auto`,children:(0,G.jsxs)(pe,{variant:`line`,className:`h-10! min-w-max gap-0.5`,children:[(0,G.jsxs)(H,{value:`hmi`,className:`gap-1.5 px-3 text-sm`,children:[(0,G.jsx)(oe,{className:`size-3.5 shrink-0`}),`HMI`]}),(0,G.jsxs)(H,{value:`operate`,className:`gap-1.5 px-3 text-sm`,children:[(0,G.jsx)(se,{className:`size-3.5 shrink-0`}),`Operate`]})]})}),(0,G.jsx)(U,{value:`hmi`,className:`flex-1 py-2`,children:(0,G.jsx)(m.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:`easeOut`},children:(0,G.jsx)(Ae,{detail:_,processVariables:E,memberValues:y,historyRef:w,tick:T,showQuality:ae})},`hmi`)}),(0,G.jsx)(U,{value:`operate`,className:`flex-1 py-2`,children:(0,G.jsxs)(m.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:`easeOut`},className:`flex min-w-0 flex-col gap-4`,children:[I&&(0,G.jsxs)(`section`,{"aria-label":`Data`,className:j(`grid min-w-0 grid-cols-1`,Ie,z&&`lg:grid-cols-2 lg:grid-rows-[auto_auto] lg:items-start`,!z&&N&&(P||F)&&`lg:grid-cols-2 lg:items-start`),children:[N&&(0,G.jsx)(Ne,{stringEnumMembers:k,nonStringOperationalMembers:A,memberValues:y,className:j(`min-h-0 min-w-0 self-stretch`,R&&`lg:col-span-2`,z&&`lg:row-span-2`)}),!N&&P&&F&&(0,G.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-col gap-6 lg:col-span-2`,children:[(0,G.jsx)(Z,{counters:D.counters,memberValues:y}),(0,G.jsx)(Q,{detail:_,referenceMembers:D.reference,memberValues:y})]}),!N&&P&&!F&&(0,G.jsx)(Z,{className:`lg:col-span-2`,counters:D.counters,memberValues:y}),!N&&!P&&F&&(0,G.jsx)(Q,{className:`lg:col-span-2`,detail:_,referenceMembers:D.reference,memberValues:y}),N&&P&&(0,G.jsx)(Z,{className:`min-h-0 min-w-0 self-stretch lg:col-start-2 lg:row-start-1`,counters:D.counters,memberValues:y}),N&&F&&(0,G.jsx)(Q,{className:j(`min-h-0 min-w-0 self-stretch lg:col-start-2`,z?`lg:row-start-2`:`lg:row-start-1`),detail:_,referenceMembers:D.reference,memberValues:y})]}),(0,G.jsxs)(`section`,{"aria-label":`Operations`,className:j(V,`grid grid-cols-1`,L&&`lg:grid-cols-2`),children:[(0,G.jsx)(ge,{activeFaults:O,availableFaults:ie,onTriggerFault:M.triggerFault,onClearFault:M.clearFault}),L&&(0,G.jsx)(`div`,{className:`border-t border-border/50 lg:border-l lg:border-t-0`,children:(0,G.jsx)(ve,{detail:_,methodArgs:M.methodArgs,setMethodArgs:M.setMethodArgs,onInvoke:M.invoke,isPending:M.isPending,pendingMethod:M.pendingMethod})})]}),(0,G.jsx)(_e,{assetId:_.id,onRemoved:n})]},`operate`)})]})}),(0,G.jsx)(ze,{open:r,onOpenChange:i})]})}function ze({open:e,onOpenChange:t}){return(0,G.jsx)(y,{open:e,onOpenChange:t,children:(0,G.jsxs)(g,{children:[(0,G.jsx)(_,{className:`font-heading text-lg font-semibold tracking-tight`,children:`Keyboard shortcuts`}),(0,G.jsx)(v,{className:`text-sm text-muted-foreground`,children:`Navigate this asset without leaving the keyboard.`}),(0,G.jsx)(`ul`,{className:`flex flex-col gap-2 pt-1`,children:[{keys:[`g`,`f`],label:`Jump to Alarms`},{keys:[`g`,`c`],label:`Jump to Commands`},{keys:[`b`],label:`Back to Assets`},{keys:[`?`],label:`Show this sheet`}].map(e=>(0,G.jsxs)(`li`,{className:`flex items-center justify-between gap-4`,children:[(0,G.jsx)(`span`,{className:`text-sm text-foreground`,children:e.label}),(0,G.jsx)(`span`,{className:`flex items-center gap-1`,children:e.keys.map((t,n)=>(0,G.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`kbd`,{className:`rounded-[var(--miravo-radius-tight)] border border-border bg-muted/40 px-1.5 py-0.5 font-mono text-[11px] font-medium text-foreground`,children:t}),n<e.keys.length-1&&(0,G.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`then`})]},`${e.label}-${t}`))})]},e.label))})]})})}export{Re as AssetDetailPage};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{ot as n}from"./vendor-ui-D8j69UH4.js";import{ot as r}from"./api-B2QJEzbS.js";import{i,n as a,o,r as s,t as c}from"./dialog-B5PqrKVw.js";import{C as l,S as u,c as d}from"./format-Bx7DF-TB.js";import{t as f}from"./utils-XFKvwlFT.js";import{n as p,t as m}from"./circle-x-_o0nl0Rg.js";import{t as h}from"./loader-circle-DjgHgHHl.js";import{t as g}from"./play-kg50os4l.js";import{t as _}from"./trash-2-BH9HDsZv.js";import{t as v}from"./triangle-alert-DoAwrRgk.js";import{a as y,i as b}from"./validation-BkfmaBBi.js";import{i as x,n as S,t as C}from"./tooltip-B3vOB1Vu.js";import{t as w}from"./badge-Bk1DaL6C.js";import{t as T}from"./use-engine-command-mutation-CHqjOqfS.js";var E=e(t(),1);function D(e,t,n){let[r,i]=(0,E.useState)({}),[a,o]=(0,E.useState)(null),s=T();(0,E.useEffect)(()=>{s.isPending||o(null)},[s.isPending]);let c=e=>{s.mutateAsync(e).then(n).catch(()=>{})};return{methodArgs:r,setMethodArgs:i,pendingMethod:a,isPending:s.isPending,invoke:n=>{if(!e)return;let i={},a=t?.methods[n];if(a)for(let e of a.inputArguments){let t=r[n]?.[e.name]??``,a=b(e.name,t,e.dataType);if(!a)return;i[e.name]=a.value}o(n),c({type:`invokeMethod`,assetId:e,method:n,arguments:i})},triggerFault:t=>{e&&c({type:`triggerFault`,assetId:e,fault:t})},clearFault:t=>{e&&c({type:`clearFault`,assetId:e,fault:t})}}}var O=n(),k=`bg-transparent bg-transparent`,A=`blueprint-title text-foreground`;function j(e,t){return t.includes(`rpm`)||t.includes(`speed`)?`e.g. 2500`:t.includes(`temp`)?`e.g. 70.0`:t.includes(`pressure`)?`e.g. 4.5`:e===`Boolean`?`true / false`:e===`String`?`value`:`e.g. 100`}function M({detail:e,methodArgs:t,setMethodArgs:n,onInvoke:r,isPending:i=!1,pendingMethod:a=null}){let o=Object.entries(e.methods);if(o.length===0)return null;let s=o.filter(([,e])=>e.inputArguments.length===0),c=o.filter(([,e])=>e.inputArguments.length>0);return(0,O.jsxs)(`div`,{id:`commands`,className:`flex min-w-0 flex-col gap-3 p-4`,children:[(0,O.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,O.jsx)(`h2`,{className:A,children:`Commands`}),(0,O.jsx)(`p`,{className:`text-[10px] text-muted-foreground/75`,children:`Executable methods on this asset`})]}),s.length>0&&(0,O.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:s.map(([e,t])=>{let n=a===e&&i,o=n?h:g;return t.description?(0,O.jsxs)(C,{children:[(0,O.jsx)(x,{render:(0,O.jsxs)(l,{size:`sm`,variant:`outline`,disabled:i,title:e,className:f(`h-8 gap-1.5 font-mono text-xs`,k),onClick:()=>r(e),children:[(0,O.jsx)(o,{className:f(`size-3`,n&&`animate-spin`),"aria-hidden":!0}),d(e)]})}),(0,O.jsx)(S,{side:`bottom`,className:`max-w-xs`,children:t.description})]},e):(0,O.jsxs)(l,{size:`sm`,variant:`outline`,disabled:i,title:e,className:f(`h-8 gap-1.5 font-mono text-xs`,k),onClick:()=>r(e),children:[(0,O.jsx)(o,{className:f(`size-3`,n&&`animate-spin`),"aria-hidden":!0}),d(e)]},e)})}),c.length>0&&s.length>0&&(0,O.jsx)(y,{className:`bg-border/60`}),c.map(([e,o])=>{let s=a===e&&i;return(0,O.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,O.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between`,children:[(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(`p`,{title:e,className:`font-mono text-sm font-medium`,children:d(e)}),o.description&&(0,O.jsx)(`p`,{className:`mt-0.5 text-[10px] text-muted-foreground`,children:o.description})]}),(0,O.jsxs)(l,{size:`sm`,variant:`default`,disabled:i,className:`shrink-0`,onClick:()=>r(e),children:[s?(0,O.jsx)(h,{className:`mr-1 size-3 animate-spin`,"aria-hidden":!0}):(0,O.jsx)(g,{className:`mr-1 size-3`,"aria-hidden":!0}),`Execute`]})]}),(0,O.jsx)(`div`,{className:`mt-3 flex flex-col gap-1.5 border-t border-border/50 pt-3`,children:o.inputArguments.map(r=>(0,O.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,O.jsx)(`span`,{title:r.name,className:`w-28 shrink-0 truncate pt-1.5 font-mono text-[10px] leading-tight text-muted-foreground`,children:d(r.name)}),(0,O.jsx)(u,{className:`h-7 flex-1 font-mono text-xs`,placeholder:j(r.dataType,r.name),value:t[e]?.[r.name]??``,onChange:t=>n(n=>({...n,[e]:{...n[e],[r.name]:t.target.value}}))})]},r.name))})]},e)})]})}function N({activeFaults:e,availableFaults:t,onTriggerFault:n,onClearFault:r}){let u=e.length>0,[h,g]=(0,E.useState)(null);return(0,O.jsxs)(`div`,{id:`faults`,className:`flex min-w-0 flex-col gap-3 p-4`,children:[(0,O.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,O.jsx)(`h2`,{className:A,children:`Alarms`}),(0,O.jsx)(`p`,{className:`text-[10px] text-muted-foreground/75`,children:`Active faults and injectable failure modes (factory)`})]}),u?(0,O.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map(e=>(0,O.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-[var(--miravo-radius-tight)] border border-destructive/30 bg-transparent py-2.5 pl-3 pr-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,O.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,O.jsx)(v,{className:`size-4 shrink-0 text-destructive`}),(0,O.jsx)(`span`,{title:e,className:`font-mono text-sm font-medium text-destructive`,children:d(e)})]}),(0,O.jsxs)(l,{size:`sm`,variant:`outline`,className:f(`h-8 shrink-0 gap-1 border-destructive/30 px-2.5 font-mono text-[0.75rem] text-destructive shadow-none`,`hover:border-destructive/45 hover:bg-destructive/5 hover:text-destructive`,`focus-visible:border-destructive/40 focus-visible:ring-destructive/20`,k),onClick:()=>r(e),children:[(0,O.jsx)(m,{className:`size-3.5`,"aria-hidden":!0}),`Clear`]})]},e))}):(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,O.jsx)(p,{className:`size-4 text-success`}),`All clear — no active faults`]}),t.length>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(y,{className:`bg-border/60`}),(0,O.jsxs)(`div`,{children:[(0,O.jsxs)(`p`,{className:f(A,`mb-2`),children:[`Inject fault`,(0,O.jsxs)(w,{variant:`secondary`,className:`ml-2 text-[10px]`,children:[t.filter(t=>!e.includes(t)).length,` available`]})]}),(0,O.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:t.filter(t=>!e.includes(t)).map(e=>(0,O.jsx)(l,{size:`sm`,variant:`outline`,title:e,className:f(`h-7 font-mono text-[10px]`,k),onClick:()=>g(e),children:d(e)},e))})]})]}),(0,O.jsx)(c,{open:h!==null,onOpenChange:e=>{e||g(null)},children:(0,O.jsxs)(a,{children:[(0,O.jsx)(o,{className:`font-heading text-lg font-semibold tracking-tight`,children:`Inject fault?`}),(0,O.jsxs)(s,{className:`text-sm text-muted-foreground`,children:[`This asserts`,` `,(0,O.jsx)(`span`,{title:h??void 0,className:`font-mono text-foreground`,children:h?d(h):``}),` `,`on the running factory. Downstream consumers will see the fault immediately. Clear it from the active list when you're done.`]}),(0,O.jsxs)(i,{children:[(0,O.jsx)(l,{variant:`outline`,onClick:()=>g(null),children:`Cancel`}),(0,O.jsxs)(l,{variant:`destructive`,onClick:()=>{h&&n(h),g(null)},children:[(0,O.jsx)(v,{className:`mr-1 size-3.5`,"aria-hidden":!0}),`Inject fault`]})]})]})})]})}function P({assetId:e,onRemoved:t}){let[n,u]=(0,E.useState)(!1),[d,f]=(0,E.useState)(!1),p=T(),m=r(t=>t.templates.find(t=>t.assetIds.includes(e))),h=r(t=>t.lines.find(t=>t.stations.some(t=>t.id===e))?.line);return h?(0,O.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-stadium-sm)] border border-dashed border-border p-4`,children:[(0,O.jsx)(`h2`,{className:A,children:`Remove asset`}),(0,O.jsxs)(`p`,{className:`text-[10px] text-muted-foreground/75`,children:[`This asset is a station on line `,h,`. Unload`,` `,m?.templateName??`its template`,` to remove the line.`]})]}):(0,O.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-[var(--miravo-radius-stadium-sm)] border border-dashed border-border p-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(`h2`,{className:A,children:`Remove asset`}),(0,O.jsx)(`p`,{className:`text-[10px] text-muted-foreground/75`,children:m?`Removes this asset from the running factory. ${m.templateName} stays loaded without it.`:`Removes this standalone asset from the running factory.`})]}),(0,O.jsxs)(l,{size:`sm`,variant:`destructive`,className:`shrink-0`,onClick:()=>u(!0),children:[(0,O.jsx)(_,{className:`mr-1 size-3.5`,"aria-hidden":!0}),`Remove`]}),(0,O.jsx)(c,{open:n,onOpenChange:u,children:(0,O.jsxs)(a,{children:[(0,O.jsxs)(o,{className:`font-heading text-lg font-semibold tracking-tight`,children:[`Remove `,e,`?`]}),(0,O.jsx)(s,{className:`text-sm text-muted-foreground`,children:`The asset and its live values are removed from the factory. With persistence on, the change is saved.`}),(0,O.jsxs)(i,{children:[(0,O.jsx)(l,{variant:`outline`,onClick:()=>u(!1),disabled:d,children:`Cancel`}),(0,O.jsx)(l,{variant:`destructive`,onClick:async()=>{f(!0);try{await p.mutateAsync({type:`removeAsset`,assetId:e}),u(!1),t()}catch{}finally{f(!1)}},disabled:d,children:`Remove asset`})]})]})})]})}export{D as i,N as n,P as r,M 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{ot as n}from"./vendor-ui-D8j69UH4.js";import{S as r,o as i,ot as a,v as o}from"./api-B2QJEzbS.js";import{t as s}from"./useQuery-M9KTdi7Q.js";import{n as c}from"./chunk-OE4NN4TA-DBWZidbW.js";import{C as l,_ as u,d,f,g as p,w as m}from"./format-Bx7DF-TB.js";import{t as h}from"./arrow-up-right-CwPw_2U1.js";import{t as g}from"./chevron-left-XHFooLn1.js";import{t as _}from"./model-schemas-3w38IPdc.js";import{i as v,r as y}from"./console-panel-CMDoBJiO.js";import{i as b,n as x,t as S}from"./asset-detail-actions-jjbvaDES.js";var C=e(t(),1),w=n(),T=new Set([`off_shift`,`down_planned`,`stopped`,`idle`,`steady`]),E=new Set([`down`,`fault`,`failed`]);function D(e,t){return t?`fault`:e?e===`running`||e===`filling`?`live`:E.has(e)?`fault`:T.has(e)?`off`:`idle`:`off`}function O(e){return e?e.replace(/_/g,` `):`–`}var k=new Set([`Boolean`,`String`]),A=/_(command|reference|setpoint|sp|target)$/,j=`pu`;function M(e,t=2){if(!e)return[];let n=[];for(let[t,r]of Object.entries(e.members))r.kind!==`variable`||r.access!==`read`||k.has(r.dataType)||A.test(t)||!r.unit||!r.euRange||r.euRange[1]<=r.euRange[0]||n.push({member:t,unit:r.unit,min:r.euRange[0],max:r.euRange[1]});return[...n.filter(e=>e.unit!==j),...n.filter(e=>e.unit===j)].slice(0,t)}function N(e,t,n){let r=(0,C.useRef)(new Map),i=(0,C.useRef)(n);i.current=n;let[,o]=(0,C.useState)(0),s=t.join(`|`);return(0,C.useEffect)(()=>{if(r.current=new Map,!e)return;let t=s.split(`|`).filter(Boolean);return a.subscribe((n,a)=>{if(n.tick===a.tick)return;let s=n.memberValues.get(e);for(let e of t){let t=r.current.get(e)??[],n=s?.get(e)?.value,a=typeof n==`number`?n:t.at(-1)??i.current(e);a!==void 0&&(t.push(a),t.length>90&&t.shift(),r.current.set(e,t))}o(e=>e+1)})},[e,s]),r.current}var P=100,F=22;function I(e,t,n){if(e.length<2)return``;let r=n-t||1,i=90-e.length;return e.map((e,a)=>{let o=(i+a)/89*P,s=F-3-(Math.min(n,Math.max(t,e))-t)/r*(F-6);return`${a?`L`:`M`}${o.toFixed(1)} ${s.toFixed(1)}`}).join(``)}function L({reading:e,value:t,series:n}){let{member:r,unit:i,min:a,max:o}=e,s=t===void 0?0:Math.max(0,Math.min(1,(t-a)/(o-a)));return(0,w.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,w.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,w.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:p(r)}),(0,w.jsxs)(`span`,{className:`shrink-0 font-mono text-sm font-semibold tabular-nums`,children:[t===void 0?`–`:f(t),(0,w.jsx)(`span`,{className:`ml-1 text-[10px] font-medium text-muted-foreground`,children:u(i)})]})]}),(0,w.jsxs)(`svg`,{viewBox:`0 0 ${P} ${F}`,preserveAspectRatio:`none`,className:`h-6 w-full overflow-visible`,role:`img`,"aria-label":`${r} trend`,children:[(0,w.jsx)(`rect`,{x:`0`,y:F-1.2,width:P,height:`1.2`,className:`fill-border`}),(0,w.jsx)(`rect`,{x:`0`,y:F-1.2,width:s*P,height:`1.2`,className:`fill-info/70`}),(0,w.jsx)(`path`,{d:I(n,a,o),className:`fill-none stroke-info`,strokeWidth:`1`,strokeLinejoin:`round`,vectorEffect:`non-scaling-stroke`})]})]})}var R=6;function z({title:e,note:t,children:n}){return(0,w.jsxs)(`section`,{className:`flex flex-col gap-3 border-t border-border/50 px-4 py-4`,children:[(0,w.jsxs)(`header`,{className:`flex items-baseline justify-between gap-3`,children:[(0,w.jsx)(`h3`,{className:`text-[11px] font-semibold uppercase tracking-[0.14em] text-muted-foreground`,children:e}),t?(0,w.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:t}):null]}),n]})}function B({name:e,sub:t,pill:n,onBack:r}){return(0,w.jsxs)(`header`,{className:`flex flex-col gap-2 px-4 pt-3 pb-4`,children:[(0,w.jsxs)(l,{size:`sm`,variant:`ghost`,className:`-ml-2 h-7 w-fit gap-1 px-2 text-xs text-muted-foreground`,onClick:r,children:[(0,w.jsx)(g,{className:`size-3.5`,"aria-hidden":!0}),`Line`]}),(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,w.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,w.jsx)(`h2`,{className:`truncate font-heading text-lg font-medium tracking-tight`,children:e}),(0,w.jsx)(`span`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:t})]}),n]})]})}function V({label:e,value:t}){return(0,w.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,w.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:e}),(0,w.jsx)(`span`,{className:`font-mono text-lg font-semibold tabular-nums`,children:t})]})}function H({thing:e,assetId:t,line:n,basis:l,onBack:u}){let f=s({queryKey:o.assets.detail(t),queryFn:()=>i(`/assets/${t}`,r.assetDetail)}),p=f.data,g=a(e=>e.assets.find(e=>e.id===t)),C=a(e=>e.models),T=a(e=>e.memberValues.get(t)),E=g?.model??p?.assetType,k=M(_(E?[E]:[]).data?.[0],R),A=b(t,p,()=>f.refetch()),j=g?.activeFaults??[],P=C.find(e=>e.name===E)?.faultNames??[],F=n?.stations.find(e=>e.id===t),I=n?.buffers.find(e=>e.after===t),H=T?.get(`availability_state`)?.value,U=F?.state??(l===`availability`&&typeof H==`string`?H:T?.get(`run_command`)?.value===!1?`stopped`:`running`),W=F?.good??0,G=F?.scrap??0,K=e=>{let t=T?.get(e)?.value??p?.members[e]?.value;return typeof t==`number`?t:void 0},q=N(t,k.map(e=>e.member),K);return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(B,{name:e.name,sub:`${t} · ${E??`…`}`,onBack:u,pill:(0,w.jsx)(v,{tone:D(U,j.length>0),children:(0,w.jsx)(y,{children:j.length>0?`fault`:O(U)})})}),F?(0,w.jsx)(z,{title:`Production`,note:I?`buffer ${I.level}/${I.capacity}`:`end of line`,children:(0,w.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,w.jsx)(V,{label:`Good`,value:d(W)}),(0,w.jsx)(V,{label:`Scrap`,value:d(G)}),(0,w.jsx)(V,{label:`Yield`,value:W+G>0?`${(W/(W+G)*100).toFixed(1)}%`:`–`})]})}):null,k.length>0?(0,w.jsx)(z,{title:`Live`,note:`last 90 ticks`,children:(0,w.jsx)(`div`,{className:`flex flex-col gap-3`,children:k.map(e=>(0,w.jsx)(L,{reading:e,value:K(e.member),series:q.get(e.member)??[]},e.member))})}):null,p&&Object.keys(p.methods).length>0?(0,w.jsx)(`div`,{className:`border-t border-border/50 [&>#commands]:px-4`,children:(0,w.jsx)(S,{detail:p,methodArgs:A.methodArgs,setMethodArgs:A.setMethodArgs,onInvoke:A.invoke,isPending:A.isPending,pendingMethod:A.pendingMethod})}):null,(0,w.jsx)(`div`,{className:`border-t border-border/50`,children:(0,w.jsx)(x,{activeFaults:j,availableFaults:P,onTriggerFault:A.triggerFault,onClearFault:A.clearFault})}),(0,w.jsx)(`div`,{className:`border-t border-border/50 px-4 py-3`,children:(0,w.jsxs)(c,{to:`/asset/${encodeURIComponent(t)}`,className:m({size:`sm`,variant:`ghost`,className:`-ml-2 gap-1`}),children:[`Open asset page`,(0,w.jsx)(h,{className:`size-3.5`,"aria-hidden":!0})]})})]})}export{D as i,z as n,O as r,H as t};
@@ -1 +1 @@
1
- import{ot as e}from"./vendor-ui-D8j69UH4.js";import{t}from"./utils-BO2u-wC_.js";var n=e();function r(){return(0,n.jsxs)(`div`,{className:`pointer-events-none absolute inset-0 overflow-hidden`,"aria-hidden":!0,children:[(0,n.jsx)(`div`,{className:`auth-screen-loader__glow auth-screen-loader__glow--amber`}),(0,n.jsx)(`div`,{className:`auth-screen-loader__glow auth-screen-loader__glow--cyan`}),(0,n.jsx)(`div`,{className:`auth-screen-loader__grid`}),(0,n.jsx)(`div`,{className:`auth-screen-loader__vignette`})]})}function i({className:e,children:i}){return(0,n.jsxs)(`div`,{className:t(`relative w-full overflow-hidden bg-background`,e),children:[(0,n.jsx)(r,{}),(0,n.jsx)(`div`,{className:`relative z-10 min-h-0`,children:i})]})}export{i as n,r as t};
1
+ import{ot as e}from"./vendor-ui-D8j69UH4.js";import{t}from"./utils-XFKvwlFT.js";var n=e();function r(){return(0,n.jsxs)(`div`,{className:`pointer-events-none absolute inset-0 overflow-hidden`,"aria-hidden":!0,children:[(0,n.jsx)(`div`,{className:`auth-screen-loader__glow auth-screen-loader__glow--amber`}),(0,n.jsx)(`div`,{className:`auth-screen-loader__glow auth-screen-loader__glow--cyan`}),(0,n.jsx)(`div`,{className:`auth-screen-loader__grid`}),(0,n.jsx)(`div`,{className:`auth-screen-loader__vignette`})]})}function i({className:e,children:i}){return(0,n.jsxs)(`div`,{className:t(`relative w-full overflow-hidden bg-background`,e),children:[(0,n.jsx)(r,{}),(0,n.jsx)(`div`,{className:`relative z-10 min-h-0`,children:i})]})}export{i as n,r 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{ot as n}from"./vendor-ui-D8j69UH4.js";import{b as r,d as i,f as a,l as o,m as s}from"./dom-Cm_OH5jc.js";import{n as c,t as l}from"./by-path-VBqTBdlG.js";import{A as u,D as d,E as f,F as p,H as m,L as h,O as g,P as ee,V as _,X as te,a as v,b as ne,g as re,i as ie,j as ae,k as y,n as oe,o as se,r as ce,t as le}from"./status-CZFZLqVk.js";import{r as ue,t as de}from"./chiller-BSx8eUMN.js";import{n as fe,t as pe}from"./compressor-D63w6Ir2.js";import{a as me,i as b,n as he,o as ge,r as _e,s as ve,t as ye}from"./genset-BRgqR1AT.js";import{i as be,n as xe,r as Se,t as Ce}from"./tank-THHXGdzg.js";import{t as we}from"./stages-hidkaJPI.js";var Te=[[`genA`,`diesel-generator`,`power`,`gensets`,0],[`genB`,`diesel-generator`,`power`,`gensets`,1],[`genC`,`diesel-generator`,`power`,`gensets`,2],[`bulk`,`storage-tank`,`fuel`,`storage`,0],[`day`,`storage-tank`,`fuel`,`storage`,1],[`chillerA`,`industrial-chiller`,`cooling`,`chiller-plant`,0],[`chillerB`,`industrial-chiller`,`cooling`,`chiller-plant`,1],[`pumpA`,`centrifugal-pump`,`cooling`,`chilled-water`,0],[`pumpB`,`centrifugal-pump`,`cooling`,`chilled-water`,1],[`compressor`,`air-compressor`,`support`,`start-air`,0],[`fan`,`ac-induction-motor`,`support`,`ventilation`,0]],Ee=e=>l(Te,e);function De(e){let t=(e,t,n)=>({key:e,assetId:e,name:t,kind:`utility`,area:n});return[t(e.genA,`Genset A (primary)`,`Power`),t(e.genB,`Genset B`,`Power`),t(e.genC,`Genset C (reserve)`,`Power`),t(e.bulk,`Bulk fuel tank`,`Fuel`),t(e.day,`Day tank`,`Fuel`),t(e.chillerA,`Chiller A`,`Cooling`),t(e.chillerB,`Chiller B`,`Cooling`),t(e.pumpA,`Chilled-water pump 1`,`Cooling`),t(e.pumpB,`Chilled-water pump 2`,`Cooling`),t(e.compressor,`Start-air compressor`,`Support`),t(e.fan,`Hall ventilation fan`,`Support`)]}var Oe=e(t(),1),x=64,ke=2.2;function Ae(e,t,n){let{k:r,G:i,P:a,S:o,L:s,D:c,slab:l,cyl:u}=e,d=[],f=t.y+t.d,p=t.x+t.w,m=e=>s(e,{tone:`faint`}),h=[];for(let e=t.x+11;e<p-4;e+=11)h.push(r.segment([e,f,3],[e,f,x-9],a));for(let e=t.y+11;e<f-4;e+=11)h.push(r.segment([p,e,3],[p,e,x-9],a));let g=[];for(let e of[x-7,x-5,x-3])g.push(r.segment([t.x+4,f,e],[p-4,f,e],a)),g.push(r.segment([p,t.y+4,e],[p,f-4,e],a));d.push(l({x:t.x-1.6,y:t.y-1.6,w:t.w+3.2,d:t.d+3.2,r:2},0,3,{tone:`lo`},2,.3)),d.push(o(r.slabOf(t,0,x,a,2,.6),{tone:`lo`,inner:m(h.join(``))+s(g.join(``),{tone:`lo`})+m(r.sideSeam(t,3,a,2))})),d.push(s(r.planOutline(r.insetPlan(t,2),x,a,2),{tone:`lo`}));let ee=(e,t,n,i,o)=>{d.push(l({x:e-1,y:t-1,w:n+2,d:i+2,r:1},x,3,{tone:`lo`},2,.3)),d.push(l({x:e,y:t,w:n,d:i,r:1},x+3,o,{tone:`mid`},2,.3));let c=[];for(let s=x+5;s<x+3+o-1;s+=2.4)c.push(r.segment([e+2,t+i,s],[e+n-2,t+i,s],a));d.push(s(c.join(``),{tone:`faint`}));let u=x+3+o;for(let o of[e+n*.3,e+n*.7]){let e=t+i/2,n=[r.ring(o,e,i*.36,u,a,24),r.ring(o,e,i*.16,u,a,16)];for(let t=0;t<4;t++){let s=t/4*Math.PI*2+.4;n.push(r.segment([o+Math.cos(s)*i*.16,e+Math.sin(s)*i*.16,u],[o+Math.cos(s)*i*.36,e+Math.sin(s)*i*.36,u],a))}d.push(s(n.join(``),{tone:`mid`}))}};ee(t.x+12,t.y+t.d-52,34,18,10),ee(t.x+60,t.y+t.d-44,34,18,10),d.push(u(t.x+t.w-16,t.y+22,4,x,11,{tone:`mid`},20),u(t.x+t.w-16,t.y+22,5,x+10.4,1.6,{tone:`mid`},20),l({x:t.x+14,y:t.y+14,w:14,d:10,r:.8},x,5,{tone:`mid`},2,.3));let _=t.x+6;d.push(l({x:_-1.4,y:f,w:24.8,d:.8,r:.2},0,31.8,{tone:`lo`},2,0),`<g transform="${e.front(f+.9)}"><path class="sf-plate" d="M${_} -30H${_+22}V0H${_}Z"/>${Array.from({length:9},(e,t)=>`<path class="iso-line" data-tone="faint" d="M${_} ${-(3+t*3)}H${_+22}"/>`).join(``)}<path class="iso-line" data-tone="mid" d="M${_} -30H${_+22}V0H${_}Z"/></g>`,l({x:_,y:f+.8,w:22,d:1,r:.2},0,2.4,{tone:`mid`},2,0)),d.push(l({x:_-1,y:f,w:24,d:.9,r:.2},38,16,{tone:`lo`},2,0));let te=[];for(let e=40;e<53.5;e+=1.8)te.push(r.segment([_+.6,f+.9,e],[_+22-.6,f+.9,e],a));d.push(s(te.join(``),{tone:`mid`})),d.push(u(_+22+3.6,f+1.2,1.2,28,2.2,{tone:`mid`},10));let v=t.y+36;d.push(l({x:p,y:v-1.2,w:.9,d:12.4,r:.2},0,25,{tone:`lo`},2,0),l({x:p+.9,y:v,w:.5,d:10,r:.2},0,22.4,{tone:`mid`},2,0),l({x:p,y:v-3,w:4.4,d:16,r:.4},26,1.4,{tone:`mid`},2,.2),u(p+1.4,v+12.4,1.1,14,2,{tone:`mid`},10)),d.push(s(r.segment([p+1.4,v+1.2,13],[p+1.4,v+1.2,19],a)+r.segment([p+1.4,v+2,3],[p+1.4,v+9,3],a),{tone:`hi`}));let ne=t.y+72;d.push(l({x:p,y:ne,w:.9,d:30,r:.2},22,26,{tone:`lo`},2,0));let re=[];for(let e=24;e<47.5;e+=1.8)re.push(r.segment([p+.9,ne+1.4,e],[p+.9,ne+28.6,e],a));d.push(s(re.join(``),{tone:`mid`}));for(let{x:t,z:r,r:s}of n){let n=i.frameAlong([t,f,r],[0,1,0]);d.push(o(i.disc(0,1.2,s+2.8,n,a),{tone:`mid`}),o(i.disc(1.2,ke,s+1.4,n,a),{tone:`mid`}),c([0,1,2,3,4,5].map(n=>e.at([t+Math.cos(n*1.047)*(s+2),f+1.2,r+Math.sin(n*1.047)*(s+2)])),{size:.4}))}return d.join(``)}function je(e,t){let{k:n,P:r,L:i,slab:a}=e,o=[];for(let e of t){o.push(a(e,0,1.4,{tone:`lo`},2,.2));let t=[];if(e.w>=e.d)for(let i=e.x+9;i<e.x+e.w-2;i+=9)t.push(n.lineOnTop([i,e.y+.8],[i,e.y+e.d-.8],1.5,r));else for(let i=e.y+9;i<e.y+e.d-2;i+=9)t.push(n.lineOnTop([e.x+.8,i],[e.x+e.w-.8,i],1.5,r));o.push(i(t.join(``)+n.planOutline(n.insetPlan(e,.8),1.5,r,2),{tone:`faint`}))}return o.join(``)}function Me(e,t,n,r){let{k:i,P:a,S:o,L:s,slab:c}=e,l=[],u=t.y+t.d;for(let e=t.x+14;e<t.x+t.w-4;e+=14)l.push(i.segment([e,u,3],[e,u,n-5],a));let d=[o(i.slabOf(t,0,n,a,2,.4),{tone:`lo`,inner:s(l.join(``)+i.sideSeam(t,4,a,2),{tone:`faint`})}),c({x:t.x-1.5,y:t.y-1.5,w:t.w+3,d:t.d+3,r:.4},n,2.2,{tone:`mid`},2,.2)];for(let t of r){let r=[];for(let e=22;e<=n-12;e+=3)r.push(`<path class="iso-line" data-tone="lo" d="M${t-20} ${-e}H${t+20}"/>`);d.push(`<g transform="${e.front(u+.1)}"><path class="sf-plate" d="M${t-21} ${-(n-9)}H${t+21}V-18H${t-21}Z"/>${r.join(``)}</g>`)}return d.join(``)}function Ne(e,t,n){let{k:r,P:i,slab:a,L:o}=e,s=(n===`back`?[{x:t.x,y:t.y,w:t.w,d:3,r:.4},{x:t.x,y:t.y+3,w:3,d:t.d-6,r:.4}]:[{x:t.x,y:t.y+t.d-3,w:t.w,d:3,r:.4},{x:t.x+t.w-3,y:t.y+3,w:3,d:t.d-6,r:.4}]).map(e=>a(e,0,9,{tone:`mid`},2,.3));return n===`front`&&s.push(o(r.segment([t.x+3,t.y+t.d,4.4],[t.x+t.w,t.y+t.d,4.4],i)+r.segment([t.x+t.w,t.y+3,4.4],[t.x+t.w,t.y+t.d,4.4],i),{tone:`faint`})),s.join(``)}function Pe(e,[t,n,r]){let{G:i,P:a,S:o,cyl:s,slab:c,screws:l}=e,u=i.frameAlong([t,n,r],[0,1,0]);return[o(i.solidOf([[0,3.8],[1.6,5.2],[2.6,5.2],[3.6,4.2],[10.4,4.2],[11.4,5.2],[12.4,5.2],[14,3.8]],u,a),{tone:`mid`}),s(t,n+14/2,2.4,r+3.6,6,{tone:`mid`,crease:`none`},14),c({x:t-4.6,y:n+14/2-3.6,w:9.2,d:7.2,r:1},r+9.6,9,{tone:`mid`},2,.4),s(t,n+14/2,2.6,r+18.6,1.8,{tone:`lo`},14),l([[t-3.4,n+14/2+3.7],[t+3.4,n+14/2+3.7]],r+15)].join(``)}var S=16,C=56,Fe=3;function Ie(e,t,n,r){let{faceRule:i}=e,a=S-3,o=C-12,s=n+1.5,c=`<g transform="${e.front(t)}"><path class="iso-line" data-tone="lo" d="M${s} ${-o}H${s+a}V-5H${s}Z"/>`,l=``;if(r===0)l+=`<path class="sf-plate" d="M${s+2} ${-(o-3)}H${s+a-2}V${-(o-19)}H${s+2}Z"/>`,l+=`<path class="iso-line" data-tone="mid" d="M${s+4} ${-(o-6)}H${s+a/2}M${s+a-4} ${-(o-6)}H${s+a/2}M${s+a/2} ${-(o-6)}V${-(o-16)}"/>`;else if(r===1)for(let e=0;e<3;e++)l+=`<path class="sf-plate" d="M${s+2} ${-(o-4-e*9)}H${s+a-2}V${-(o-10-e*9)}H${s+2}Z"/><path class="iso-line" data-tone="mid" d="M${s+a/2-2} ${-(o-7-e*9)}H${s+a/2+2}"/>`;else for(let e=0;e<8;e++)l+=`<path class="iso-line" data-tone="faint" d="M${s+2} ${-(o-3-e*2.4)}H${s+a-2}"/>`;let u=`<path class="iso-line" data-tone="hi" d="M${s+a-2.6} -19V-27"/>`;return`${c}${l}${u}</g>${i(t,s+2,7,a-4,4)}`}function Le(e,t,n){let{k:r,P:i,L:a,slab:o,cyl:s,screws:c}=e,l=[],u=t.y+t.d;l.push(o({x:t.x-2,y:t.y-2,w:t.w+4,d:t.d+4,r:1},0,2,{tone:`lo`},2,.2));for(let n=0;n<Fe;n++){let d=t.x+n*S,f={x:d,y:t.y,w:S,d:t.d,r:.6};l.push(o(f,2,C-2,{tone:`mid`},2,.4)),l.push(o({x:d+1,y:t.y+1,w:S-2,d:t.d-2,r:.6},C,3,{tone:`mid`},2,.3)),l.push(a(r.segment([d+4,u-4,C+3.2],[d+S-4,u-4,C+3.2],i),{tone:`faint`}),s(d+3,t.y+4,1,C+3,2,{tone:`mid`},10),s(d+S-3,t.y+4,1,C+3,2,{tone:`mid`},10)),l.push(Ie(e,u,d,n)),l.push(c([[d+1.4,u-.2],[d+S-1.4,u-.2]],C-2))}let d=t.x+t.w-8,f=t.y+t.d/2-4,p=C+3.4,m=[];for(let e=d+2;e<n-1;e+=3)m.push(r.segment([e,f+.6,p+.6],[e,f+7.4,p+.6],i));return l.push(o({x:d,y:f,w:n-d,d:.9,r:.2},p,2,{tone:`mid`},2,.1),o({x:d,y:f+7.1,w:n-d,d:.9,r:.2},p,2,{tone:`mid`},2,.1),a(m.join(``),{tone:`mid`}),s(n-6,f+4,.9,0,p,{tone:`mid`,crease:`none`},10),o({x:n-8.6,y:f+1.4,w:5.2,d:5.2,r:.5},0,1.2,{tone:`lo`},2,.1),o({x:n-1.6,y:f-.6,w:1.6,d:9.2,r:.3},p-1,4,{tone:`mid`},2,.1)),l.join(``)}var Re={x:-15,y:0,w:30,d:14,r:1.5},w=30,T=12.5,ze=2.2,E=11;function Be(e,t){let{k:n,G:r,P:i,L:a,D:o,S:s,slab:c,cyl:l,screws:u,faceRule:d}=e,f=[],p=r.frameAlong([0,0,w],[0,1,0]);f.push(c({x:-15,y:0,w:30,d:9,r:1},0,1.4,{tone:`lo`},2,.3)),f.push(u(n.corners({x:-15,y:0,w:30,d:9},1.6),1.4));for(let e of[-11,8])f.push(c({x:e,y:0,w:3,d:7,r:.5},1.4,w-15-1.4+.4,{tone:`mid`},2,.2));f.push(c({x:-14.5,y:0,w:29,d:ze,r:1},w-15,30,{tone:`mid`},2,.3)),f.push(o([[-12.4,13.2],[12.4,13.2],[-12.4,-13.2],[12.4,-13.2]].map(([e=0,t=0])=>n.iso([e,ze+.1,w+t],i)),{size:.45})),f.push(s(r.disc(ze,E,T,p,i),{tone:`mid`}));for(let e of[5.4,8.2])f.push(a(n.sideRing([0,e,w],T,`y`,i,32),{tone:`faint`}));f.push(s(r.disc(E-1.8,E,T+1.2,p,i),{tone:`mid`})),f.push(s(r.disc(E-.4,E,T-1.6,p,i),{tone:`lo`})),f.push(`<path class="gs-blade" data-vfan="0,${E+.3},${w},${T-2.6}" data-top="0,${E},${w+T+4}" data-bearing="0,${E-3},${w+T}" d=""/>`),f.push(s(r.disc(E,E+2.4,3,p,i),{tone:`mid`}),s(r.disc(E+2.2,E+3,1.6,p,i),{tone:`lo`}));let m=[],h=E+1.6;for(let e of[5.5,T-2])m.push(n.sideRing([0,h,w],e,`y`,i,28));for(let e=0;e<8;e++){let t=e/8*Math.PI*2;m.push(n.segment([Math.cos(t)*3,h,w+Math.sin(t)*3],[Math.cos(t)*(T-2),h,w+Math.sin(t)*(T-2)],i))}return f.push(a(m.join(``),{tone:`mid`})),f.push(c({x:-4.5,y:3,w:9,d:6,r:.8},w+T-.6,6,{tone:`mid`},2,.3),l(0,6,1.1,w+T+5.4,2.2,{tone:`mid`},10),d(9.1,-3,w+T+1,6,2.4)),f.join(``)}var Ve=1e3,He={x:-500,y:-395,w:810,d:189,r:8},Ue={x:-380,y:-120,w:680,d:180,r:8},We={x:-520,y:-415,w:850,d:495,r:16},Ge=r([...s(We,-21,-14),...s(He,-14,140),...s(Ue,-14,100)],Ve,620,{pad:22,azimuth:60}),Ke=-300,D=[[-268,Ke],[-108,Ke],[52,Ke]],qe=(e,t)=>[e[0]+t[0],e[1]+t[1],t[2]],Je=e=>qe(D[e]??[0,0],me),Ye=e=>qe(D[e]??[0,0],_e),Xe={x:-340,y:-338,w:470,d:4,r:0},O=[-434,-340],Ze={r:32,h:104,nozzles:[{angle:90,z:14,r:2,role:`outlet`}]},k={x:-486,y:-392,w:104,d:104,r:0},A=[-434,-232],j={r:17,h:62,windowX:8,panelX:-26,nozzles:[{angle:270,z:14,r:2,role:`inlet`},{angle:0,z:7,r:2,role:`outlet`}]},M=A[0],Qe=-284,$e={x:132,y:-330,w:48,d:25,r:1},N={x:204,y:-395,w:104,d:145,r:2},et=[293,N.y+N.d],tt=[-202,-135,0],nt=[[-65,-62],[-169,-62]],rt=[-34,36.6,40],it=[-20,36.6,40],at=[94,-130,0],ot=.8,st=[[47,36],[157,36]],ct=e=>[(e[0]-at[0])*ot,(e[1]-at[1])*ot,e[2]*ot],lt=ct(ee),ut=ct(u),dt=[{x:-318,y:-262,w:462,d:8,r:0},...D.map(([e])=>({x:e-48,y:-290,w:6,d:32,r:0})),{x:137,y:-308,w:6,d:54,r:0}],ft=[-67,-132,0],pt=[-292,-62],mt=[-110,-114,24],ht=we([...D.map((e,t)=>({key:`gen${t}`,at:e,h:126})),{key:`bund-back`,at:[O[0],k.y+2],h:12},{key:`bulk`,at:O,h:Ze.h+12},{key:`bund-front`,at:[O[0],k.y+k.d-2],h:12},{key:`valve`,at:[M,Qe+7],h:30},{key:`day`,at:A,h:j.h+12},{key:`vent`,at:[et[0],et[1]+6],h:50},{key:`lineup`,at:[$e.x+$e.w/2,$e.y+$e.d/2],h:62},{key:`hall`,at:[N.x+N.w/2,N.y+N.d/2],h:76},...nt.map((e,t)=>({key:`chiller${t}`,at:e,h:56})),...st.map((e,t)=>({key:`pump${t}`,at:e,h:45*ot})),{key:`compressor`,at:pt,h:46}],Ge),gt=ht.order,_t=ht.slotDepths,vt=ht.depth,yt=(e,t)=>[e[0]+t[0],e[1]+t[1],t[2]],P=(e,t,n,r)=>[t??e[0],n??e[1],r??e[2]],bt=(e,t,n)=>{let r=e.nozzles[n];return r?yt(t,Se(e,r)):[0,0,0]},F=6,xt=bt(Ze,O,0),St=bt(j,A,0),Ct=bt(j,A,1),I=Ct[1],[wt,Tt,Et]=[0,1,2].map(Je),[L,Dt,Ot]=[0,1,2].map(Ye),kt=Qe+14,At=-366,R=-250,z=L[2],jt=16,Mt=[pt[0]+mt[0]-ft[0],pt[1]+mt[1]-ft[1],mt[2]],Nt=Mt[1]+jt,[B=[0,0],Pt=[0,0]]=nt,[V=[0,0],H=[0,0]]=st,U=e=>yt(e,ut),W=e=>yt(e,lt),G=e=>yt(e,rt),K=e=>yt(e,it),q=W(V)[2],J=B[1]+61,Y=72,X=B[1]+48,Ft=84,It=V[1]-34,Lt=W(H)[0]+13,Rt=W(V)[0]+8,zt=6,Bt=K(B)[0]+40,Vt=N.y+N.d+ke,Ht=[{id:`xfer:a`,medium:`fuel`,r:2,pts:[xt,[M,Qe,14]]},{id:`xfer:b`,medium:`fuel`,r:2,pts:[[M,kt,14],St]},{id:`fuel:all`,medium:`fuel`,r:2,pts:[Ct,[wt[0],I,F]]},{id:`fuel:bc`,medium:`fuel`,r:2,pts:[[wt[0],I,F],[Tt[0],I,F]]},{id:`fuel:c`,medium:`fuel`,r:2,pts:[[Tt[0],I,F],[Et[0],I,F],Et]},{id:`fuel:a`,medium:`fuel`,r:2,pts:[[wt[0],I,F],wt]},{id:`fuel:b`,medium:`fuel`,r:2,pts:[[Tt[0],I,F],Tt]},{id:`air:main`,medium:`air`,r:b,bend:8,pts:[Mt,P(Mt,null,Nt,null),[At,Nt,Mt[2]],[At,Nt,z],[At,R,z],[L[0],R,z]]},{id:`air:ab`,medium:`air`,r:b,pts:[[L[0],R,z],[Dt[0],R,z]]},{id:`air:c`,medium:`air`,r:b,pts:[[Dt[0],R,z],[Ot[0],R,z],Ot]},{id:`air:a`,medium:`air`,r:b,pts:[[L[0],R,z],L]},{id:`air:b`,medium:`air`,r:b,pts:[[Dt[0],R,z],Dt]},{id:`suction`,medium:`coolantret`,r:2.6,pts:[[265,Vt,q],[265,It,q],[Lt,It,q]]},{id:`suction:standby`,medium:`coolantret`,r:2.6,pts:[[Lt,It,q],P(W(H),Lt,null,null),W(H)]},{id:`suction:duty`,medium:`coolantret`,r:2.6,pts:[[Lt,It,q],[Rt,It,q],P(W(V),Rt,null,null),W(V)]},...[[`a`,B],[`b`,Pt]].map(([e,t])=>({id:`out:${e}`,medium:`coolant`,r:2.2,pts:[K(t),P(K(t),null,X,null),P(K(t),null,X,Ft)]})),{id:`chws:b`,medium:`coolant`,r:2.6,blind:[!0,!1],pts:[[K(Pt)[0]-zt,X,Ft],[K(B)[0],X,Ft]]},{id:`chws`,medium:`coolant`,r:2.6,pts:[[K(B)[0],X,Ft],[Bt,X,Ft],[Bt,X,40],[240,X,40],[240,Vt,40]]},...[[`duty`,V],[`standby`,H]].map(([e,t])=>({id:`discharge:${e}`,medium:`coolantret`,r:2.6,fromStub:!0,pts:[U(t),P(U(t),null,null,Y),P(U(t),null,J,Y)]})),{id:`header:standby`,medium:`coolantret`,r:2.6,blind:[!0,!1],pts:[[U(H)[0]+zt,J,Y],[U(V)[0],J,Y]]},{id:`header`,medium:`coolantret`,r:2.6,pts:[[U(V)[0],J,Y],[G(B)[0],J,Y]]},{id:`header:b`,medium:`coolantret`,r:2.6,blind:[!1,!0],pts:[[G(B)[0],J,Y],[G(Pt)[0]-zt,J,Y]]},...[[`a`,B],[`b`,Pt]].map(([e,t])=>({id:`in:${e}`,medium:`coolantret`,r:2.2,pts:[P(G(t),null,J,Y),P(G(t),null,J,null),G(t)]}))],Ut=(e,t)=>[He,Ue].some(n=>e>=n.x&&e<=n.x+n.w&&t>=n.y&&t<=n.y+n.d),Z=(e,t,n,r)=>[e,t,n,r,Ut(e,t)?0:-14],Wt={z:10,flanged:!0,routes:Ht,posts:[...[-395,-330,-215,-60].map(e=>Z(e,I,2,F)),Z(M,-294,2,14),...[-70,-140,-190,R].map(e=>Z(At,e,b,z)),...[-300,-155,10].map(e=>Z(e,R,b,z)),...[-225,-150,-90,-35].map(e=>Z(240,e,2.6,40)),...[-225,-150,-90,-35,20].map(e=>Z(265,e,2.6,q)),...[-20,100,215].map(e=>Z(e,X,2.6,40)),...[-150,-20,130].map(e=>Z(e,J,2.6,Y))]},Q=n(),Gt={x:-248,y:-164,w:92,d:58,r:3},Kt={x:-136,y:-152,w:138,d:40,r:3},qt=xe(Ze),Jt=xe(j),Yt=(e,t)=>p(e,t,`coolantret`,!0),Xt=(e,t)=>be(e,t,Ze),Zt=(e,t)=>be(e,t,j),Qt=(e,t)=>fe(e,t,{barFull:10,dialFull:12}),$t=e=>Ae(e,N,[{x:240,z:40,r:2.6},{x:265,z:lt[2],r:2.6}]),en=e=>Le(e,$e,N.x),tn=e=>Pe(e,[M,Qe,14]),nn=e=>Ne(e,k,`back`),rn=e=>Ne(e,k,`front`);function an({ids:e}){let t=a(),n=f(Wt,vt),r=(0,Oe.useMemo)(()=>h(t,We)+t.plinth(He)+t.plinth(Ue)+je(t,dt)+Me(t,Xe,62,D.map(([e])=>e)),[t]),s=e=>(0,Q.jsx)(i,{html:`${n.layers[e]??``}<g data-flows="${e}" data-depth="${e===0?-1e9:_t[e-1]??0}"></g>`,data:{pipes:``}},`pipes-${e}`),c=[e.genA,e.genB,e.genC],l={"bund-back":(0,Q.jsx)(g,{build:nn,intro:1}),bulk:(0,Q.jsx)(`g`,{className:`fuel-tank`,children:(0,Q.jsx)(d,{to:y(O),children:(0,Q.jsx)(o,{id:e.bulk,plan:qt,intro:2,draw:Xt})})}),"bund-front":(0,Q.jsx)(g,{build:rn,intro:2}),valve:(0,Q.jsx)(g,{build:tn,intro:3}),day:(0,Q.jsx)(`g`,{className:`fuel-tank`,children:(0,Q.jsx)(d,{to:y(A),children:(0,Q.jsx)(o,{id:e.day,plan:Jt,intro:3,draw:Zt})})}),vent:(0,Q.jsx)(d,{to:y(et),children:(0,Q.jsx)(o,{id:e.fan,plan:Re,intro:9,draw:Be})}),lineup:(0,Q.jsx)(g,{build:en,intro:8}),hall:(0,Q.jsx)(g,{build:$t,intro:8}),compressor:(0,Q.jsx)(d,{from:ft,to:y(pt),children:(0,Q.jsx)(o,{id:e.compressor,plan:Kt,intro:13,draw:Qt})})};for(let[e,t]of D.entries())l[`gen${e}`]=(0,Q.jsx)(`g`,{className:`gen-set`,children:(0,Q.jsx)(d,{to:y(t),children:(0,Q.jsx)(o,{id:c[e]??``,plan:ge,intro:4+e,draw:ve})})});for(let[t,n]of nt.entries())l[`chiller${t}`]=(0,Q.jsx)(d,{from:tt,to:y(n),children:(0,Q.jsx)(o,{id:t?e.chillerB:e.chillerA,plan:Gt,intro:10+t,draw:ue})});for(let[t,n]of st.entries())l[`pump${t}`]=(0,Q.jsx)(d,{from:at,to:y(n),scale:ot,children:(0,Q.jsx)(o,{id:t?e.pumpB:e.pumpA,plan:ae,intro:12+t,draw:Yt})});return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(i,{html:r,data:{plinth:``}}),s(0),gt.flatMap((e,t)=>[(0,Q.jsx)(`g`,{children:l[e.key]},e.key),s(t+1)])]})}var $=e=>e>.002?6+26*re(e*2):0,on=e=>{let{svg:t,feed:n,ids:r}=e,i=ne(t),a=ye(e,i),o=Ce(e),s=de(e,i),c=ce(e,i),l=pe(e,i),u=[a,o,s,c,l,he(e,i)],d=ie(e,e=>oe(n,e,`availability`)),f=se(e,{needle:e=>l.needle(e)??s.needle(e)??0,bar:e=>u.reduce((t,n)=>t??n.bar(e),void 0)??0,alertsHigh:()=>!0,ready:()=>!0}),p=()=>{let e=n.param(r.day,`max_inflow_lps`,0);return e>0?re(n.num(r.day,`inflow_rate`)/e):0},m=(...e)=>re(e.reduce((e,t)=>e+a.fuelPu(t),0)),h=()=>c.flowPu(r.pumpA)+c.flowPu(r.pumpB),g=e=>{let t=[r.chillerA,r.chillerB].filter(e=>n.num(e,`coolant_flow_rate`)>0);return t.includes(e)?h()/t.length:0},ee=v(e,({id:e})=>{switch(e){case`xfer:a`:case`xfer:b`:return $(p());case`fuel:all`:return $(m(r.genA,r.genB,r.genC));case`fuel:bc`:return $(m(r.genB,r.genC));case`fuel:c`:return $(m(r.genC));case`fuel:a`:return $(m(r.genA));case`fuel:b`:return $(m(r.genB));case`air:main`:case`air:ab`:case`air:c`:case`air:a`:case`air:b`:return $(l.deliveredPu(r.compressor));case`suction`:case`chws`:case`header`:return $(h());case`suction:duty`:case`discharge:duty`:return $(c.flowPu(r.pumpA));case`suction:standby`:case`discharge:standby`:case`header:standby`:return $(c.flowPu(r.pumpB));case`in:a`:case`out:a`:return $(g(r.chillerA));case`in:b`:case`out:b`:case`header:b`:case`chws:b`:return $(g(r.chillerB));default:return 0}});return{data(e){d.draw(e)},draw({sdt:e,t,introDone:n}){ee.draw(e),f.draw(e,t);for(let r of u)r.draw(e,t,n)},resync(){},status:e=>le(n,e,`availability`)}},sn=_(Ge),cn=m(sn,Wt,vt),ln=te({layout:{width:Ve,height:620,label:`Isometric model of the Backup Power facility: along the back, the fuel yard with its bulk tank in a bund and the day tank, three diesel gen sets side by side with their exhaust stacks and radiators, the electrical lineup and the data hall they back up; along the front, the start-air compressor, two chillers and two chilled-water pumps whose loop runs to the hall. Pipes carry fuel, start air and chilled water between them. Every moving part follows live values from the running engine.`,kit:sn,flows:cn.flows,joints:cn.joints,Scene:an,compose:on},resolve:Ee,things:De,caption:`generation · fuel · cooling`,mismatch:`This floor expects the Backup Power facility: three diesel gensets, the bulk and day fuel tanks, two chillers with two chilled-water pumps, the start-air compressor and the hall ventilation motor, by area and line.`,statusBasis:`availability`,Overview:c,tab:`Plant`});export{ln as backupFloor};
@@ -0,0 +1 @@
1
+ import{at as e,it as t}from"./vendor-ui-D8j69UH4.js";import{E as n}from"./format-Bx7DF-TB.js";import{t as r}from"./utils-XFKvwlFT.js";var i=n(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-[var(--miravo-radius-pill)] border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[background-color,border-color,color] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 bg-destructive/20 focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function a({className:n,variant:a=`default`,render:o,...s}){return t({defaultTagName:`span`,props:e({className:r(i({variant:a}),n)},s),render:o,state:{slot:`badge`,variant:a}})}export{a as t};
@@ -0,0 +1 @@
1
+ import{C as e,a as t,c as n,n as r,s as i}from"./dom-Cm_OH5jc.js";import{C as a,S as o,T as s,_ as c,c as l,g as u,p as d,s as f,w as p,x as m}from"./status-CZFZLqVk.js";var h=26,g=20,_=-58,v=98,y=[-48,0,112],b=6,x=[22,0,h+g+8],S=[-26,0,h+g+8],C={x:-64,y:-24,w:140,d:52,r:3},w=y;function T(e,t,n,r){let{k:i,G:a,P:o,at:s,S:c,L:l,D:u,slab:d,cyl:f,hmi:p,screws:m,dial:C,faceRule:w}=e,T=[];T.push(d({x:-62,y:-22,w:136,d:44,r:2},0,4,{tone:`lo`},3,.4)),T.push(m(i.corners({x:-62,y:-22,w:136,d:44},2.6),4));for(let e of[-40,22])T.push(d({x:e-5,y:-16,w:10,d:32,r:1},4,10,{tone:`mid`},2,.4));let[E,D,O]=y;T.push(f(E,D,b+1.2,h+8,4,{tone:`mid`},28),f(E,D,b,h+12,O-h-14,{tone:`mid`,inner:l([.3,.6].map(e=>i.sideArc(E,D,b,h+12+(O-h)*e,o,24)).join(``),{tone:`faint`})},28),f(E,D,b+1.4,O-2,2,{tone:`mid`},28),r===void 0?`<path class="sf-void" d="${i.pathOf(i.circleRing(E,D,b-.8,28).map(([e,t])=>s([e,t,O])),!0)}"/>`:``);let k=a.frameAlong([_,0,h],[1,0,0]),A=[[0,0],[.8,9,1],[2.4,15,1],[4.4,18.6,1],[7,g],[v-1.4,g],[v-.6,g-.8,1],[v,0]],j=[16,34,52,70,88].map(e=>a.arcOf(k,e,g,o)).join(``);T.push(c(a.solidOf(A,k,o),{tone:`mid`,inner:l(j,{tone:`faint`})})),T.push(d({x:-8,y:g-1.4,w:16,d:1.4,r:.3},h-3,6,{tone:`lo`},2,0));for(let[e,,t]of[S,x])T.push(f(e,0,3.4,h+g-2,t-h-g+.4,{tone:`mid`},20)),T.push(f(e,0,5.4,t-1.6,1.6,{tone:`mid`},24));for(let e of[-4,4])T.push(f(e,-6,2,h+g-1,5,{tone:`mid`},14),f(e,-6,1.2,h+g+4,4,{tone:`mid`},12),f(e,-6,2.2,h+g+8,1.4,{tone:`mid`},14));T.push(f(8,8,1,h+g-2,7,{tone:`mid`,crease:`none`},12)),T.push(C(t,8,8,h+g+5,5));let M=a.frameAlong([_+v,0,h],[1,0,0]);T.push(c(a.disc(0,3,12,M,o),{tone:`mid`}),c(a.disc(3,4.6,14,M,o),{tone:`mid`})),T.push(u(a.dotsOf(M,4.6,12.6,10,o,{all:!0}),{size:.4}));let N=_+v+4.6;T.push(d({x:N,y:-10,w:22,d:20,r:2},h-12,22,{tone:`mid`},3,.5)),T.push(f(N+14,-1,7,h+10,5,{tone:`mid`},28)),T.push(l(i.ring(N+14,-1,4.4,h+15,o,28),{tone:`lo`})),T.push(f(N+6,-13,1.4,4,h-6,{tone:`mid`,crease:`none`},12)),T.push(d({x:N+3,y:-16,w:6,d:6,r:.8},h-14,5,{tone:`mid`},2,.3));let P=N+11,F=h-1,I=a.frameAlong([P,10,F],[0,1,0]);T.push(c(a.disc(0,.8,5.4,I,o),{tone:`mid`})),T.push(u(a.dotsOf(I,.8,4.6,6,o,{all:!0}),{size:.3}));let L=e=>i.pathOf(i.circleRing(P,F,e,24).map(([e,t])=>s([e,10.8,t])),!0);T.push(`<path class="bl-window" d="${L(3.6)}"/>`,`<path class="bl-flame" data-flame="${P},10,${F}" data-plume="${E},${D},${r??O}" data-dial-full="${n}" d="${L(2.5)}"/>`,l(L(3.6),{tone:`lo`}));let R=a.frameAlong([-34,16,9],[1,0,0]);return T.push(c(a.solidOf([[0,4.4],[.6,5],[14,5],[14.6,4.4]],R,o),{tone:`mid`,inner:i.fadedSvg(a.ribsOf(R,1,13,5,12,o,{fade:[.1,.55]}),{tone:`lo`})})),T.push(c(a.disc(15,19,6.4,R,o),{tone:`mid`})),T.push(`<path class="iso-line" data-tone="lo" data-spin="circ" data-shaft="-34,16,9" data-radius="3" data-span="-19.4,-19" d=""/>`),T.push(d({x:30,y:22,w:30,d:6,r:1},0,30,{tone:`mid`},2,.4)),T.push(p(t,28,32,58,12,28)),T.push(w(28,32,4,20,2.4)),T.join(``)}var E=.105,D=7;function O(h,g){let{svg:_,P:v,feed:y}=h,b=(e,t)=>y.num(e,t),x=r(_,`[data-flame]`).map(e=>{let t=f(e),n=a(_,t),o=r(_,`[data-asset="${t}"] [data-spin="circ"]`)[0],[c=0,u=0]=i(o?.dataset.span);return{el:e,id:t,plume:l(e.dataset.plume),dialFull:Number(e.dataset.dialFull)||6,circ:o,circAt:l(o?.dataset.shaft),circR:Number(o?.dataset.radius)||0,c0:c,c1:u,fire:0,rate:0,spin:0,puffs:s(n,9,`circle`,`sf-steam bl-vapour`),heat:m(n,3,3)}}),S=new Map(x.map(e=>[e.id,e])),C=e=>b(e,`running`)>0?u(b(e,`firing_rate`)/100):0;return{draw(r,i,a){let s=h.reducedMotion();for(let l of x){l.fire=c(l.fire,C(l.id),r,1.2,s);let f=a&&p(y,l.id,`flame_instability`),m=s?1:f?Math.max(0,.55+.45*Math.sin(i*23)*Math.sin(i*7.3))*(Math.sin(i*1.7)>.8?.1:1):.92+.08*Math.sin(i*17+l.id.length);l.el.style.opacity=(l.fire>.01?(.35+.65*l.fire)*m:0).toFixed(2);let h=u(b(l.id,`fuel_flow`)/(y.param(l.id,`rated_output_kw`,500)*E)),[_,x,S]=l.plume;for(let n of l.puffs){let r=(i*(.18+.12*h)+n.seed)%1;if(!a||s||h<.02||n.seed>.25+h){t(n.el,`0`);continue}let[c,l]=e([_+r*9+Math.sin(i+n.seed*9)*1.5,x-r*3,S+2+r*26],v);o(n.el,c,l),n.el.setAttribute(`r`,((2+r*7)*v.scale*.5).toFixed(2)),t(n.el,(Math.sin(Math.PI*r)*(.18+.22*h)).toFixed(2))}l.heat.draw(a&&!s&&p(y,l.id,`scale_buildup`)&&l.fire>.05,i,v,[_-3,x,S]),l.rate=c(l.rate,b(l.id,`circulation_pump_running`)>0?D:0,r,.8,s),s||(l.spin+=l.rate*r),l.circ&&n(l.circ,`d`,d(v,`x`,l.circAt,l.circR,l.c0,l.c1,l.spin,6)),g(l.id,a&&!s&&f?.25:0,i)}},bar(e){return S.has(e)?C(e):void 0},needle(e){let t=S.get(e);return t?b(t.id,`system_pressure`)/t.dialFull:void 0},firingPu:C,circulating:e=>b(e,`circulation_pump_running`)>0}}export{x as a,w as i,C as n,T as o,S as r,O as t};
@@ -0,0 +1 @@
1
+ import{ot as e}from"./vendor-ui-D8j69UH4.js";import{ot as t}from"./api-B2QJEzbS.js";import{t as n}from"./utils-XFKvwlFT.js";import{t as r}from"./chevron-right-CMSQPSEo.js";import{n as i,r as a}from"./asset-panel-DDziFlFl.js";var o=e(),s={g:`bg-success`,a:`bg-warning`,r:`bg-destructive`,"":`bg-muted-foreground/50`};function c({label:e,value:t}){return(0,o.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,o.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.14em] text-muted-foreground`,children:e}),(0,o.jsx)(`span`,{className:`font-mono text-lg font-semibold tabular-nums`,children:t})]})}function l({name:e,level:t}){return(0,o.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,o.jsx)(`span`,{className:`w-28 shrink-0 truncate text-xs text-muted-foreground`,children:e}),(0,o.jsx)(`span`,{className:`h-1.5 min-w-0 flex-1 overflow-hidden rounded-full bg-muted`,children:(0,o.jsx)(`span`,{className:`block h-full rounded-full bg-info`,style:{width:`${Math.max(0,Math.min(100,t))}%`}})}),(0,o.jsxs)(`span`,{className:`w-10 shrink-0 text-right font-mono text-[11px] tabular-nums`,children:[t.toFixed(0),` %`]})]})}function u({things:e,status:u,onSelect:d}){let f=t(e=>e.memberValues),p=e.map(e=>({thing:e,status:u(e.key)})),m=p.filter(e=>e.status[1]===`r`).length,h=p.filter(e=>e.status[0]===`stopped`).length,g=p.length-m-h,_=e.flatMap(e=>{let t=f.get(e.assetId)?.get(`level_percent`)?.value;return typeof t==`number`?[{name:e.name,level:t}]:[]}),v=[...new Set(e.map(e=>e.area??``))];return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(`div`,{className:`grid grid-cols-3 gap-3 px-4 pt-4 pb-5`,children:[(0,o.jsx)(c,{label:`Online`,value:String(g)}),(0,o.jsx)(c,{label:`Stopped`,value:String(h)}),(0,o.jsx)(c,{label:`Faulted`,value:String(m)})]}),_.length>0?(0,o.jsx)(i,{title:`Levels`,note:`live`,children:(0,o.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:_.map(e=>(0,o.jsx)(l,{name:e.name,level:e.level},e.name))})}):null,v.map(e=>(0,o.jsx)(i,{title:e,note:`flow order`,children:(0,o.jsx)(`ul`,{className:`-mx-2 flex flex-col`,children:p.filter(t=>(t.thing.area??``)===e).map(({thing:e,status:[t,i]})=>(0,o.jsx)(`li`,{children:(0,o.jsxs)(`button`,{type:`button`,onClick:()=>d(e.key),className:`group flex w-full items-center gap-2.5 rounded-[var(--miravo-radius-tight)] px-2 py-2 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,o.jsx)(`span`,{className:n(`size-1.5 shrink-0 rounded-full`,s[i])}),(0,o.jsx)(`span`,{className:`min-w-0 shrink text-sm`,children:e.name}),(0,o.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-right font-mono text-[11px] text-muted-foreground tabular-nums`,children:a(t)}),(0,o.jsx)(r,{className:`size-3.5 shrink-0 text-muted-foreground/60 transition-transform group-hover:translate-x-0.5`,"aria-hidden":!0})]})},e.key))})},e))]})}function d(e,{template:t,assets:n}){let r=new Set(t.assetIds),i=n.filter(e=>r.has(e.id)),a=new Map;for(let[,t,n,r]of e){let e=`${t}|${n}|${r}`;a.set(e,(a.get(e)??0)+1)}let o={};for(let[t,n,r,s,c]of e){let e=i.filter(e=>e.model===n&&e.browsePath?.[2]===r&&e.browsePath?.[3]===s).map(e=>e.id).sort(),l=e[c];if(!l||e.length!==a.get(`${n}|${r}|${s}`))return{status:`mismatch`};o[t]=l}return{status:`ready`,ids:o}}export{u as n,d 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{ot as n}from"./vendor-ui-D8j69UH4.js";import{S as r,o as i,ot as a,v as o}from"./api-B2QJEzbS.js";import{t as s}from"./useQuery-M9KTdi7Q.js";import{t as c}from"./proxy-CWZabK8f.js";import{t as l}from"./AnimatePresence-BSSlw02V.js";import{c as u,n as d}from"./chunk-OE4NN4TA-DBWZidbW.js";import{a as ee,c as f,i as p,n as m,o as h,r as g,t as _}from"./dialog-B5PqrKVw.js";import{C as v,S as y,u as b,w as x}from"./format-Bx7DF-TB.js";import{n as S,t as C}from"./utils-XFKvwlFT.js";import{n as w,t as T}from"./catalog-template-icons-BOSywIKV.js";import{r as E}from"./source-host-miravo-B8eM2IHw.js";import{t as D}from"./play-kg50os4l.js";import{t as O}from"./query-fetch-error-CWLZA2L5.js";import{t as k}from"./rocket-KZ5oHK1G.js";import{i as A,n as j,r as M,t as N}from"./catalog-source-B4L5N-a1.js";import{t as P}from"./badge-Bk1DaL6C.js";import{n as te}from"./get-error-message-dM0BMfdP.js";import{a as ne,i as F,o as I,t as L}from"./use-engine-command-mutation-CHqjOqfS.js";var R=S(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),z=e(t(),1),B=n(),V=[`builtin`,`personal`];function H(){let[e,t]=(0,z.useState)(``),[n,d]=(0,z.useState)(`all`),[x,S]=(0,z.useState)(null),[T,E]=(0,z.useState)(null),[D,j]=(0,z.useState)(null),N=(0,z.useRef)(null),F=L(),I=u(),R=a(e=>e.templates),H=(0,z.useMemo)(()=>new Set(R.map(e=>e.templateId)),[R]);(0,z.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 W=s({queryKey:o.catalog.templates(),queryFn:()=>i(`/catalog/templates`,r.catalogTemplates)}),K=W.data??[],q=T===null?null:K.find(e=>e.id===T)??null,J=W.isPending&&!W.data,Y=W.isError&&!W.data,X=W.isError&&!!W.data,Z=te(W.error,`Failed to load templates.`),re=(0,z.useCallback)(e=>{j(e)},[]),ie=(0,z.useCallback)(e=>{E(e)},[]),ae=async e=>{S(e);try{return await F.mutateAsync({type:`loadTemplate`,templatePath:e}),f(`Next: connect a client`),I(`/?highlight=${encodeURIComponent(e)}`),!0}catch{return!1}finally{S(null)}},oe=(0,z.useMemo)(()=>{let e={all:K.length};for(let t of V)e[t]=0;for(let t of K){let n=M(t.source);e[n]=(e[n]??0)+1}return e},[K]),Q=e.toLowerCase(),$=K.filter(e=>n===`all`||M(e.source)===n).filter(e=>Q?e.name.toLowerCase().includes(Q)||e.id.toLowerCase().includes(Q)||(e.description?.toLowerCase().includes(Q)??!1):!0);return(0,B.jsxs)(`div`,{className:`@container/templates mx-auto flex w-full max-w-screen-2xl flex-col gap-5 p-4 sm:gap-6 sm:p-6`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(`h1`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Template Catalog`}),(0,B.jsx)(P,{variant:`outline`,className:`text-xs`,children:Y?(0,B.jsx)(`span`,{className:`text-destructive`,children:`Unavailable`}):J&&K.length===0?(0,B.jsx)(B.Fragment,{children:`Loading...`}):(0,B.jsxs)(B.Fragment,{children:[new Set(K.map(e=>e.id)).size,` templates`]})})]}),(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Choose a template to launch a realistic industrial system. Each template includes pre-configured asset models with realistic physics, lifecycle degradation, and fault modes.`})]}),Y&&(0,B.jsx)(O,{message:Z,onRetry:()=>void W.refetch(),isRetrying:W.isFetching}),X&&(0,B.jsx)(O,{message:`${Z} Showing cached templates.`,onRetry:()=>void W.refetch(),isRetrying:W.isFetching}),!Y&&(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,B.jsxs)(`div`,{className:`relative max-w-xs flex-1 min-w-[14rem]`,children:[(0,B.jsx)(A,{className:`absolute left-2.5 top-2.5 size-4 text-muted-foreground`}),(0,B.jsx)(y,{ref:N,placeholder:`Filter templates...`,value:e,onChange:e=>t(e.target.value),className:`pl-9 pr-7`}),!e&&(0,B.jsx)(`kbd`,{className:`pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 rounded-[var(--miravo-radius-tight)] border border-border bg-muted px-1 font-mono text-[10px] text-muted-foreground`,children:`/`})]}),(0,B.jsx)(G,{value:n,counts:oe,onChange:d})]}),(0,B.jsx)(`div`,{className:`grid grid-cols-1 gap-4 @[720px]/templates:grid-cols-2`,"aria-busy":J&&!Y,children:Y?null:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(l,{children:$.map((e,t)=>(0,B.jsx)(c.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,scale:.96,transition:{duration:.15}},transition:{type:`spring`,stiffness:380,damping:30,delay:t*.04},className:`grid`,children:(0,B.jsx)(U,{template:e,launching:x===e.id,loaded:H.has(e.id),onInspect:re,onLaunch:ie})},`${e.source}:${e.id}`))}),$.length===0&&K.length>0&&(0,B.jsx)(`p`,{className:`col-span-full py-8 text-center text-sm text-muted-foreground`,children:`No templates match the current filters.`})]})}),K.length>0&&(0,B.jsx)(`div`,{className:C(ne,`p-0`),children:(0,B.jsx)(`div`,{className:`community-teaser relative overflow-hidden rounded-[inherit]`,children:(0,B.jsx)(`div`,{className:`relative z-10 mx-auto max-w-3xl px-5 py-10 sm:px-10 sm:py-12`,children:(0,B.jsxs)(`div`,{className:`grid items-center gap-10 lg:grid-cols-[minmax(0,1fr)_minmax(0,17rem)]`,children:[(0,B.jsxs)(`div`,{className:`order-2 flex min-w-0 flex-col gap-4 lg:order-1`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[(0,B.jsx)(`p`,{className:`blueprint-title text-primary`,children:`Future channel`}),(0,B.jsx)(`span`,{className:`blueprint-stat text-[10px] text-muted-foreground`,children:`MIRAVO_REGISTRY · NOT_CONNECTED`})]}),(0,B.jsx)(`h2`,{className:`font-heading text-xl font-semibold tracking-tight sm:text-2xl`,children:`Community Templates`}),(0,B.jsx)(`p`,{className:`max-w-xl text-sm leading-relaxed text-muted-foreground`,children:`Share your industrial templates with the Miravo community. Publish custom templates, discover configurations from other engineers, and fork them as your starting point.`}),(0,B.jsx)(`div`,{children:(0,B.jsx)(P,{variant:`outline`,className:`community-teaser-soon border-primary/35 bg-primary/5 text-[10px] text-primary`,children:`Coming Soon`})})]}),(0,B.jsx)(`div`,{className:`order-1 flex justify-center lg:order-2 lg:justify-end`,children:(0,B.jsxs)(`div`,{className:`community-teaser-module relative flex w-full max-w-[14rem] flex-col items-center justify-center gap-3 border border-primary/15 bg-muted/15 py-8 sm:max-w-[15.5rem] sm:py-10`,"aria-hidden":!0,children:[(0,B.jsx)(`div`,{className:`community-teaser-icon-ring relative z-[1] flex size-[4.25rem] items-center justify-center rounded-[var(--miravo-radius-tight)] border border-primary/35 bg-gradient-to-br from-primary/18 to-primary/5`,children:(0,B.jsx)(k,{className:`size-9 text-primary`,"aria-hidden":!0})}),(0,B.jsx)(`span`,{className:`blueprint-stat relative z-[1] text-[9px] tracking-[0.18em] text-muted-foreground`,children:`AWAITING SIGNAL`}),(0,B.jsx)(`span`,{className:`blueprint-stat relative z-[1] text-[9px] text-muted-foreground`,children:`Uplink idle`})]})})]})})})}),(0,B.jsx)(_,{open:T!==null,onOpenChange:e=>{e||E(null)},children:(0,B.jsxs)(m,{className:`min-w-0 sm:max-w-md`,children:[(0,B.jsxs)(ee,{children:[(0,B.jsx)(h,{children:`Launch template?`}),(0,B.jsx)(g,{children:q!==null&&(0,B.jsxs)(B.Fragment,{children:[`This loads`,` `,(0,B.jsx)(`span`,{className:`font-medium text-foreground`,children:b(q.name)}),` `,`into the running factory.`]})})]}),(0,B.jsxs)(p,{children:[(0,B.jsx)(v,{variant:`outline`,disabled:x!==null,onClick:()=>E(null),children:`Cancel`}),(0,B.jsx)(v,{disabled:x!==null||q===null,onClick:async()=>{q!==null&&await ae(q.id)&&E(null)},children:x===q?.id?`Launching...`:`Launch`})]})]})}),(0,B.jsx)(w,{templateId:D?.id??null,onClose:()=>j(null)})]})}var U=(0,z.memo)(function({template:e,launching:t,loaded:n,onInspect:r,onLaunch:i}){return(0,B.jsxs)(`div`,{className:C(I,`flex flex-col gap-4 p-5`),children:[(0,B.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,B.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] bg-primary/10 text-primary`,children:(0,B.jsx)(T,{id:e.id,className:`size-5`})}),(0,B.jsxs)(`div`,{className:`min-w-0 flex flex-col gap-1`,children:[(0,B.jsx)(`span`,{className:`font-heading text-sm font-semibold uppercase tracking-wide`,children:b(e.name)}),(0,B.jsx)(`p`,{className:`line-clamp-3 text-xs leading-relaxed text-foreground/75`,children:e.description??`Industrial template.`}),(0,B.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:e.id})]})]}),(0,B.jsx)(`div`,{className:`px-3 py-2`,children:(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.models.map(e=>(0,B.jsx)(P,{variant:`outline`,className:`h-auto min-h-5 rounded-[var(--miravo-radius-tight)] px-1.5 py-0 font-mono text-[10px] font-normal text-primary`,children:e},e))})}),(0,B.jsxs)(`div`,{className:`mt-auto flex flex-wrap items-center gap-4 font-mono text-[11px] text-muted-foreground`,children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`span`,{className:`text-foreground`,children:e.assetCount}),` assets`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`span`,{className:`text-foreground`,children:e.models.length}),` models`]}),e.memberCount>0&&(0,B.jsxs)(`span`,{children:[`~`,(0,B.jsx)(`span`,{className:`text-foreground`,children:W(e.memberCount)}),` tags/cycle`]}),n&&(0,B.jsx)(P,{variant:`outline`,className:`ml-auto shrink-0 border-success/40 bg-success/10 font-sans text-[10px] font-medium uppercase tracking-wide text-success`,children:`Loaded`}),(0,B.jsx)(P,{variant:`outline`,className:C(`shrink-0 font-sans text-[10px] font-medium uppercase tracking-wide`,!n&&`ml-auto`,N(e.source)),children:j(e.source)})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border/30 pt-3`,children:[(0,B.jsxs)(v,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>r(e),className:F,children:[(0,B.jsx)(E,{className:`size-3.5`,"aria-hidden":!0}),`Inspect`]}),n?(0,B.jsxs)(d,{to:`/`,className:C(x({size:`sm`}),`ml-auto`),children:[(0,B.jsx)(R,{className:`mr-1 size-3`,"aria-hidden":!0}),`Open`]}):(0,B.jsxs)(v,{size:`sm`,className:`ml-auto`,disabled:t,onClick:()=>i(e.id),children:[(0,B.jsx)(D,{className:`mr-1 size-3`}),t?`...`:`Launch`]})]})]})});function W(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function G({value:e,counts:t,onChange:n}){return(0,B.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,role:`radiogroup`,"aria-label":`Filter by source`,children:[{id:`all`,label:`All`},...V.map(e=>({id:e,label:j(e)}))].map(r=>{let i=e===r.id,a=t[r.id]??0,o=r.id!==`all`&&a===0;return(0,B.jsxs)(`label`,{className:C(`inline-flex h-7 items-center gap-1.5 rounded-[var(--miravo-radius-pill)] border px-3 text-xs font-medium transition-colors`,i?`border-primary/60 bg-primary/15 text-primary`:`border-border/60 bg-card/30 text-muted-foreground hover:border-border hover:bg-muted/40 hover:text-foreground`,o?`cursor-not-allowed opacity-40 hover:border-border/60 hover:bg-card/30 hover:text-muted-foreground`:`cursor-pointer`),children:[(0,B.jsx)(`input`,{type:`radio`,name:`catalog-source-filter`,value:r.id,checked:i,disabled:o,onChange:()=>n(r.id),className:`sr-only`}),(0,B.jsx)(`span`,{children:r.label}),(0,B.jsx)(`span`,{className:`font-mono text-[10px] opacity-70`,children:a})]},r.id)})})}export{R as n,H as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./catalog-BlkPPAWE.js";export{e as CatalogPage};
@@ -1 +1 @@
1
- import{n as e}from"./utils-BO2u-wC_.js";var t=e(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),n={builtin:`Built-in`,personal:`Personal`,community:`Community`},r=`border-border/60 bg-muted/40 text-muted-foreground`,i={builtin:r,personal:`border-primary/40 bg-primary/10 text-primary`,community:`border-accent/40 bg-accent/10 text-accent`};function a(e){return e===`cwd`||e===`namespace`?`personal`:e}function o(e){return n[a(e)]??e}function s(e){return i[a(e)]??r}export{t as i,o as n,a as r,s as t};
1
+ import{n as e}from"./utils-XFKvwlFT.js";var t=e(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),n={builtin:`Built-in`,personal:`Personal`,community:`Community`},r=`border-border/60 bg-muted/40 text-muted-foreground`,i={builtin:r,personal:`border-primary/40 bg-primary/10 text-primary`,community:`border-accent/40 bg-accent/10 text-accent`};function a(e){return e===`cwd`||e===`namespace`?`personal`:e}function o(e){return n[a(e)]??e}function s(e){return i[a(e)]??r}export{t as i,o as n,a as r,s 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{ot as n}from"./vendor-ui-D8j69UH4.js";import{S as r,o as i,v as a}from"./api-B2QJEzbS.js";import{t as o}from"./useQuery-M9KTdi7Q.js";import{t as s}from"./proxy-CWZabK8f.js";import{t as c}from"./AnimatePresence-BSSlw02V.js";import{c as l,h as u,s as d}from"./format-Bx7DF-TB.js";import{n as f,t as p}from"./utils-XFKvwlFT.js";import{t as m}from"./chevron-down-x70Pto6j.js";import{t as h}from"./chevron-right-CMSQPSEo.js";import{t as g}from"./copy-button-CSUP1VjU.js";import{t as _}from"./factory-DLE12zAd.js";import{t as v}from"./query-fetch-error-CWLZA2L5.js";import{c as y,d as b,f as x,l as S,s as C,t as w,u as T}from"./export-tab-fZDO4r2u.js";import{t as E}from"./badge-Bk1DaL6C.js";import{n as D}from"./get-error-message-dM0BMfdP.js";import{a as O}from"./use-engine-command-mutation-CHqjOqfS.js";import{i as k,n as A,r as j,t as M}from"./tabs-BbQkzBZZ.js";import{t as N}from"./model-schemas-3w38IPdc.js";var P=f(`building`,[[`path`,{d:`M12 10h.01`,key:`1nrarc`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M12 6h.01`,key:`1vi96p`}],[`path`,{d:`M16 10h.01`,key:`1m94wz`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M16 6h.01`,key:`1x0f13`}],[`path`,{d:`M8 10h.01`,key:`19clt8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M8 6h.01`,key:`1dz90k`}],[`path`,{d:`M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3`,key:`cabbwy`}],[`rect`,{x:`4`,y:`2`,width:`16`,height:`20`,rx:`2`,key:`1uxh74`}]]),ee=f(`droplet`,[[`path`,{d:`M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z`,key:`c7niix`}]]),te=f(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),F=f(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),I=f(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),L=f(`layout-template`,[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]),R=f(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),z=f(`thermometer-sun`,[[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 8a4 4 0 0 0-1.645 7.647`,key:`wz5p04`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 14.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0z`,key:`yu0u2z`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}]]),B=f(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),V=e(t(),1),H=n(),U=20,W=14,G=`flex w-3.5 shrink-0 items-center justify-center`;function K({asset:e,depth:t,area:n,line:r,detail:i}){let[a,o]=(0,V.useState)(!1),[s,c]=(0,V.useState)(!1),l=a?e.tags:e.tags.slice(0,10),u=e.tags.length-10;return(0,H.jsxs)(H.Fragment,{children:[l.map(a=>(0,H.jsx)(q,{member:a,depth:t,area:n,line:r,assetId:e.id,detail:i},a.name)),!a&&u>0&&(0,H.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-1.5 border-t border-border/30 py-2 text-left font-mono text-xs text-muted-foreground hover:bg-muted/40 touch-manipulation sm:min-h-0 sm:py-1.5`,style:{paddingLeft:`${t*14+U}px`},onClick:()=>o(!0),children:[(0,H.jsx)(`span`,{className:G,"aria-hidden":!0}),(0,H.jsxs)(`span`,{children:[`+`,u,` more tags`]})]}),e.properties.length>0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-1.5 border-t border-border/30 py-2 text-left font-mono text-xs text-muted-foreground hover:bg-muted/40 touch-manipulation sm:min-h-0 sm:py-1.5`,style:{paddingLeft:`${t*14+U}px`},onClick:()=>c(e=>!e),children:[(0,H.jsx)(`span`,{className:G,"aria-hidden":!0,children:s?(0,H.jsx)(m,{className:`size-3.5 opacity-60`,"aria-hidden":!0}):(0,H.jsx)(h,{className:`size-3.5 opacity-60`,"aria-hidden":!0})}),(0,H.jsxs)(`span`,{children:[e.properties.length,` properties`]})]}),s&&e.properties.map(a=>(0,H.jsx)(q,{member:a,depth:t,area:n,line:r,assetId:e.id,detail:i},a.name))]})]})}function q({member:e,depth:t,area:n,line:r,assetId:i,detail:a}){let o=e.kind===`property`,s=t*14+U+(o?W:0),c=a.namespace,u=[c?.enterprise?`${c.enterprise}/${c.site??``}`:c?.prefix??``,n,r,i,e.name].filter(Boolean).join(`/`);return(0,H.jsx)(g,{value:u,label:`Copy UNS path`,successMessage:`UNS path copied`,successDescription:u,tooltipSide:`top`,render:()=>(0,H.jsxs)(`button`,{type:`button`,className:p(`flex w-full cursor-pointer flex-col gap-1 border-t border-border/25 py-2 text-left font-mono text-xs hover:bg-muted/35 touch-manipulation sm:min-h-0 sm:flex-row sm:items-center sm:gap-1.5 sm:py-1.5`,o&&`opacity-65`),style:{paddingLeft:`${s}px`},children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:G,"aria-hidden":!0,children:(0,H.jsx)(`span`,{className:p(`size-1 rounded-full ring-1 ring-border/50`,o?`bg-muted-foreground/25`:`bg-primary/50`)})}),(0,H.jsx)(`span`,{title:e.name,className:p(`min-w-0 truncate`,o?`text-muted-foreground`:`text-foreground`),children:l(e.name)}),o&&(0,H.jsx)(`span`,{className:`shrink-0 rounded-[var(--miravo-radius-tight)] bg-muted/60 px-1 py-px text-[10px] text-muted-foreground`,children:`PROP`})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 pl-0 sm:ml-auto sm:flex-1 sm:justify-end sm:pl-0 sm:pr-1`,children:[(0,H.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.dataType}),e.unit&&(0,H.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.unit}),e.euRange&&(0,H.jsxs)(`span`,{className:`ml-auto shrink-0 tabular-nums text-muted-foreground`,children:[`[`,e.euRange[0],`–`,e.euRange[1],`]`]})]})]})})}function J({depth:e,label:t,labelTitle:n,tag:r,tagKind:i,subtitle:a,subtitleTitle:o,count:s,expanded:c,onToggle:l,hasChildren:u}){let d=c?m:h,f=i===`area`?`text-primary`:`text-foreground`;return(0,H.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full flex-col gap-1 border-t border-border/35 py-2 pr-2 text-left text-xs transition-colors touch-manipulation first:border-t-0 hover:bg-muted/40 sm:min-h-0 sm:flex-row sm:flex-wrap sm:items-center sm:gap-1.5 sm:gap-y-0 sm:py-1.5`,style:{paddingLeft:`${12+e*14}px`},onClick:l,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 w-full items-center gap-1.5 sm:w-auto sm:flex-1 sm:flex-wrap sm:items-center`,children:[u?(0,H.jsx)(d,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}):(0,H.jsx)(`span`,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{title:n??void 0,className:p(`min-w-0 flex-1 truncate font-medium`,f),children:t}),(0,H.jsx)(`span`,{className:`shrink-0 text-[10px] tracking-wide text-muted-foreground uppercase`,children:r}),a&&(0,H.jsx)(`span`,{title:o??void 0,className:`hidden min-w-0 max-w-[min(11rem,38vw)] shrink truncate font-mono text-xs text-muted-foreground sm:inline`,children:a}),s!==void 0&&(0,H.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-xs text-muted-foreground`,children:s})]}),a&&(0,H.jsx)(`span`,{title:o??void 0,className:`min-w-0 truncate pl-7 font-mono text-xs text-muted-foreground sm:hidden`,children:a})]})}function Y(e){let t=e.split(/[-_]/).filter(e=>e.length>0);return t[t.length-1]??e}function X(e,t,n){let r=[];for(let i of e){let e=Y(i.model),a=t.get(i.model),o=[],s=[];if(a)for(let[e,t]of Object.entries(a.members)){let n={name:e,kind:t.kind,dataType:t.dataType,unit:t.unit,euRange:t.euRange};t.kind===`property`?s.push(n):o.push(n)}for(let t=0;t<i.count;t++){let t=(n.get(i.model)??0)+1;n.set(i.model,t),r.push({id:`${e}-${String(t).padStart(3,`0`)}`,model:i.model,tags:o,properties:s})}}return r}function Z({detail:e}){let[t,n]=(0,V.useState)(new Set),s=(0,V.useRef)(null),c=(0,V.useMemo)(()=>[...new Set(e.models)],[e.models]),l=c.join(`,`),f=o({queryKey:a.catalog.modelSchemasBatch(l),queryFn:async()=>Promise.all(c.map(e=>i(`/catalog/models/${e}`,r.catalogModelDetail)))}),p=f.isPending&&!f.data,m=(0,V.useMemo)(()=>{let e=new Map;if(!f.data)return e;for(let[t,n]of f.data.entries())e.set(c[t],n);return e},[f.data,c]),h=(0,V.useMemo)(()=>{let t=new Map,n=new Map;for(let r of e.topology)for(let e of r.lines)n.set(`${r.name}/${e.name}`,X(e.assets,m,t));return n},[e.topology,m]);(0,V.useEffect)(()=>{if(p)return;let t=e.name;if(s.current===t)return;let r=new Set;for(let t of e.topology){r.add(`area:${t.name}`);for(let e of t.lines)r.add(`line:${t.name}/${e.name}`)}outer:for(let t of e.topology)for(let e of t.lines){let n=(h.get(`${t.name}/${e.name}`)??[])[0];if(n){r.add(`inst:${t.name}/${e.name}/${n.id}`);break outer}}n(r),s.current=t},[p,e.name,e.topology,h]);let g=(0,V.useCallback)(e=>{n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);return p?null:f.isError&&!f.data?(0,H.jsx)(v,{message:D(f.error,`Failed to load model schemas.`),onRetry:()=>void f.refetch(),isRetrying:f.isFetching&&!f.isPending}):(0,H.jsx)(`div`,{className:`overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 py-2 pl-1 pr-2 touch-manipulation sm:py-2.5 sm:pl-1.5 sm:pr-2.5`,children:e.topology.map(n=>{let r=`area:${n.name}`,i=t.has(r);return(0,H.jsxs)(`div`,{children:[(0,H.jsx)(J,{depth:0,label:u(n.name),labelTitle:n.name,tag:`AREA`,tagKind:`area`,expanded:i,onToggle:()=>g(r),hasChildren:!0}),i&&n.lines.map(r=>{let i=`line:${n.name}/${r.name}`,a=t.has(i),o=h.get(`${n.name}/${r.name}`)??[];return(0,H.jsxs)(`div`,{children:[(0,H.jsx)(J,{depth:1,label:u(r.name),labelTitle:r.name,tag:`LINE`,tagKind:`line`,count:o.length,expanded:a,onToggle:()=>g(i),hasChildren:!0}),a&&o.map(i=>{let a=`inst:${n.name}/${r.name}/${i.id}`,o=t.has(a);return(0,H.jsxs)(`div`,{children:[(0,H.jsx)(J,{depth:2,label:d(i.id),labelTitle:i.id,tag:`INST`,tagKind:`inst`,subtitle:u(i.model),subtitleTitle:i.model,count:i.tags.length+i.properties.length,expanded:o,onToggle:()=>g(a),hasChildren:i.tags.length+i.properties.length>0}),o&&(0,H.jsx)(K,{asset:i,depth:3,area:n.name,line:r.name,detail:e})]},i.id)})]},r.name)})]},n.name)})})}function ne(e){return e.lines.reduce((e,t)=>e+t.assets.reduce((e,t)=>e+t.count,0),0)}function re(e){return Object.values(e.members).filter(e=>e.kind!==`property`).length}function Q(e,t){let n=0;for(let r of e.topology)for(let e of r.lines)for(let r of e.assets){let e=t.get(r.model),i=e?re(e):0;n+=r.count*i}return n}var $=`min-h-10 px-2 py-1 text-xs text-foreground/82 after:bottom-[-3px] data-active:text-foreground sm:min-h-0 sm:px-2.5 sm:py-1`;function ie({templateId:e,onClose:t,actions:n,fallbackTitle:c}){let[l,u]=(0,V.useState)(new Set),d=o({queryKey:a.catalog.templateDetail(e??``),queryFn:()=>i(`/catalog/templates/${e}`,r.catalogTemplateDetail),enabled:e!==null}),f=d.data,p=d.isPending&&!f,m=d.isError,h=D(d.error,`Failed to load template.`),g=N(f?.models??[]),_=(0,V.useMemo)(()=>{if(!f||!g.data)return null;let e=new Map;for(let[t,n]of g.data.entries())e.set(f.models[t],n);return Q(f,e)},[f,g.data]);(0,V.useEffect)(()=>{e&&f&&u(new Set(f.topology.map(e=>e.name)))},[e,f]);let O=(0,V.useCallback)(e=>{u(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);return(0,H.jsx)(C,{open:e!==null,onOpenChange:e=>{e||t()},children:(0,H.jsx)(y,{side:`right`,className:`flex w-full flex-col gap-4 touch-manipulation`,children:p?null:m&&!f&&n?(0,H.jsxs)(T,{className:`gap-2 pb-0 pe-12`,children:[(0,H.jsx)(b,{className:`font-heading text-base uppercase tracking-wide`,children:c}),(0,H.jsx)(`div`,{className:`flex flex-wrap items-center gap-1`,children:n})]}):m&&!f?(0,H.jsx)(`div`,{className:`flex flex-1 flex-col justify-center px-2`,children:(0,H.jsx)(v,{message:h,onRetry:()=>void d.refetch(),isRetrying:d.isFetching})}):f?(0,H.jsxs)(s.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.18},className:`flex min-h-0 flex-1 flex-col gap-4`,children:[(0,H.jsxs)(T,{className:`gap-1 pb-0 pe-12`,children:[(0,H.jsx)(b,{className:`font-heading text-base uppercase tracking-wide`,children:f.name}),f.description&&(0,H.jsx)(S,{className:`text-xs leading-relaxed text-foreground/88`,children:f.description}),n?(0,H.jsx)(`div`,{className:`flex flex-wrap items-center gap-1 pt-1`,children:n}):null]}),(0,H.jsxs)(M,{defaultValue:`overview`,className:`flex min-h-0 flex-1 flex-col gap-1 pt-0`,children:[(0,H.jsxs)(j,{variant:`line`,className:`h-8! shrink-0 gap-0.5 border-b-border/60 px-2 py-0.5`,children:[(0,H.jsx)(k,{value:`overview`,className:$,children:`Overview`}),(0,H.jsx)(k,{value:`uns`,className:$,children:`UNS`}),(0,H.jsx)(k,{value:`export`,className:$,children:`Export`})]}),(0,H.jsx)(A,{value:`overview`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,H.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-2`,children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-2 pb-1 pt-0.5`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsxs)(E,{variant:`outline`,className:`font-mono text-xs`,children:[f.topology.length,` areas`]}),(0,H.jsxs)(E,{variant:`outline`,className:`font-mono text-xs`,children:[f.assetCount,` assets`]}),(0,H.jsxs)(E,{variant:`outline`,className:`font-mono text-xs`,children:[f.models.length,` models`]}),_!==null&&(0,H.jsxs)(E,{variant:`outline`,className:`font-mono text-xs`,children:[_,` tags`]}),f.settings?.tickIntervalMs&&(0,H.jsxs)(E,{variant:`outline`,className:`font-mono text-xs`,children:[`tick `,f.settings.tickIntervalMs,`ms`]}),f.settings?.timeMultiplier&&f.settings.timeMultiplier!==1&&(0,H.jsxs)(E,{variant:`outline`,className:`font-mono text-xs`,children:[f.settings.timeMultiplier,`× speed`]})]}),f.namespace&&(f.namespace.enterprise||f.namespace.site||f.namespace.prefix)&&(0,H.jsxs)(`div`,{className:`min-w-0 overflow-hidden rounded-[var(--miravo-radius-tight)] border border-border/60 px-2.5 py-2`,children:[(0,H.jsx)(`h3`,{className:`font-heading text-xs font-semibold uppercase tracking-[0.12em] text-primary`,children:`Namespace`}),(0,H.jsxs)(`dl`,{className:`mt-1 grid grid-cols-1 gap-x-4 gap-y-1.5 sm:grid-cols-2`,children:[f.namespace.enterprise&&(0,H.jsxs)(`div`,{className:`min-w-0 sm:max-w-[min(100%,16rem)]`,children:[(0,H.jsx)(`dt`,{className:`font-heading text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground`,children:`Enterprise`}),(0,H.jsx)(`dd`,{className:`mt-1 font-mono text-xs leading-snug text-foreground [overflow-wrap:anywhere] break-words`,children:f.namespace.enterprise})]}),f.namespace.site&&(0,H.jsxs)(`div`,{className:`min-w-0 sm:max-w-[min(100%,16rem)]`,children:[(0,H.jsx)(`dt`,{className:`font-heading text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground`,children:`Site`}),(0,H.jsx)(`dd`,{className:`mt-1 font-mono text-xs leading-snug text-foreground [overflow-wrap:anywhere] break-words`,children:f.namespace.site})]}),f.namespace.prefix&&(0,H.jsxs)(`div`,{className:`min-w-0 sm:col-span-2`,children:[(0,H.jsx)(`dt`,{className:`font-heading text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground`,children:`Prefix`}),(0,H.jsx)(`dd`,{className:`mt-1 font-mono text-xs leading-snug text-foreground [overflow-wrap:anywhere] break-words`,children:f.namespace.prefix})]})]})]}),f.topology.map(e=>(0,H.jsx)(ae,{area:e,expanded:l.has(e.name),onToggle:()=>O(e.name)},e.name)),f.settings&&(0,H.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/50 p-2`,children:[(0,H.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 font-heading text-xs font-semibold uppercase tracking-[0.12em] text-warning`,children:[(0,H.jsx)(x,{className:`size-3.5`,"aria-hidden":!0}),(0,H.jsx)(`span`,{children:`Settings`})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 gap-1.5 font-mono text-xs sm:grid-cols-2`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`tick interval`}),(0,H.jsxs)(`span`,{className:`text-foreground`,children:[f.settings.tickIntervalMs??1e3,`ms`]})]}),(0,H.jsxs)(`div`,{className:`flex flex-col`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`time multiplier`}),(0,H.jsxs)(`span`,{className:`text-foreground`,children:[f.settings.timeMultiplier??1,`×`]})]})]})]})]})})})}),(0,H.jsx)(A,{value:`uns`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,H.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-2`,children:(0,H.jsx)(`div`,{className:`pb-1 pt-0.5`,children:(0,H.jsx)(Z,{detail:f})})})})}),(0,H.jsx)(A,{value:`export`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,H.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,H.jsx)(w,{kind:`template`,id:f.id,yamlPath:`/catalog/templates/${f.id}/yaml`,yamlFilename:`${f.id}.miravo.yaml`})})})]})]},f.id):(0,H.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-muted-foreground`,children:`Template not found`})})})}function ae({area:e,expanded:t,onToggle:n}){let r=ne(e);return(0,H.jsxs)(`div`,{className:O,children:[(0,H.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-1.5 px-2.5 py-2 text-left text-xs font-medium transition-colors hover:bg-muted/30 touch-manipulation sm:min-h-0 sm:py-1.5`,onClick:n,children:[(0,H.jsx)(F,{className:`size-3.5 text-primary`}),(0,H.jsx)(`span`,{className:`uppercase tracking-wider text-primary`,children:u(e.name)}),(0,H.jsxs)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,H.jsxs)(E,{variant:`secondary`,className:`text-xs`,children:[r,` assets`]}),(0,H.jsxs)(E,{variant:`secondary`,className:`text-xs`,children:[e.lines.length,` lines`]}),(0,H.jsx)(m,{className:`size-3 text-muted-foreground transition-transform ${t?`rotate-180`:``}`})]})]}),(0,H.jsx)(c,{initial:!1,children:t&&(0,H.jsx)(s.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:`easeOut`},className:`overflow-hidden`,children:(0,H.jsx)(`div`,{className:`flex flex-col gap-1.5 border-t border-border p-2`,children:e.lines.map(e=>(0,H.jsx)(oe,{line:e},e.name))})},`content`)})]})}function oe({line:e}){return(0,H.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/60 bg-muted/10 p-2`,children:[(0,H.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[(0,H.jsx)(R,{className:`size-3.5`}),(0,H.jsx)(`span`,{title:e.name,children:u(e.name)}),(0,H.jsx)(I,{className:`ml-auto size-3.5 text-muted-foreground`}),(0,H.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.assets.reduce((e,t)=>e+t.count,0),` assets`]})]}),(0,H.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.assets.map(e=>(0,H.jsx)(se,{assignment:e},`${e.model}-${e.count}`))})]})}function se({assignment:e}){let t=e.parameters&&Object.keys(e.parameters).length>0;return(0,H.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/30 bg-background/50 px-2.5 py-1.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,H.jsx)(`span`,{className:`font-mono font-medium text-primary`,title:e.model,children:u(e.model)}),(0,H.jsxs)(E,{variant:`secondary`,className:`shrink-0 px-1 py-0 text-xs`,children:[`×`,e.count]}),e.variation>0&&(0,H.jsxs)(`span`,{className:`text-muted-foreground`,children:[`±`,(e.variation*100).toFixed(0),`% variation`]})]}),t&&e.parameters&&(0,H.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-x-4 gap-y-1 border-t border-border/20 pt-1.5 font-mono text-xs`,children:Object.entries(e.parameters).map(([e,t])=>(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:e}),(0,H.jsx)(`span`,{className:`text-foreground`,children:t})]},e))})]})}function ce({id:e,className:t}){let n=p(`shrink-0 text-primary`,t);switch(e){case`smart-factory`:return(0,H.jsx)(_,{className:n,"aria-hidden":!0});case`water-treatment`:return(0,H.jsx)(ee,{className:n,"aria-hidden":!0});case`commercial-building`:return(0,H.jsx)(P,{className:n,"aria-hidden":!0});case`backup-power`:return(0,H.jsx)(B,{className:n,"aria-hidden":!0});case`district-heating`:return(0,H.jsx)(z,{className:n,"aria-hidden":!0});case`pharma-cleanroom`:return(0,H.jsx)(te,{className:n,"aria-hidden":!0});default:return(0,H.jsx)(L,{className:n,"aria-hidden":!0})}}export{I as i,ie as n,B as r,ce as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./utils-XFKvwlFT.js";var t=e(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{_ as e,ot as t,v as n}from"./vendor-ui-D8j69UH4.js";import{t as r}from"./utils-XFKvwlFT.js";import{t as i}from"./check-B-yvIfMj.js";var a=t();function o({className:t,...o}){return(0,a.jsx)(n,{"data-slot":`checkbox`,className:r(`peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary bg-input/30 aria-invalid:border-destructive/50 aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground data-checked:bg-primary`,t),...o,children:(0,a.jsx)(e,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,a.jsx)(i,{})})})}export{o as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./utils-XFKvwlFT.js";var t=e(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./utils-XFKvwlFT.js";var t=e(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./utils-XFKvwlFT.js";var t=e(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{c as e,n as t,s as n}from"./dom-Cm_OH5jc.js";import{C as r,_ as i,c as a,d as o,g as s,h as c,s as l,w as u,y as d}from"./status-CZFZLqVk.js";var f=e=>[`${e}:suction`,`${e}:discharge`],p=[-148.4,-130,44];function m(e,t,n=!1){let r=f(t),{k:i,G:a,P:o,at:s,S:c,L:l,D:u,slab:d,cyl:m,hmi:h,screws:g,dial:_,faceRule:v}=e,y={x:-248,y:-164,w:92,d:58,r:3},b=[d({x:y.x+4,y:y.y+4,w:y.w-8,d:y.d-8,r:2},0,4,{tone:`lo`},3,0)],x=[];for(let e=8;e<=30;e+=4.4)x.push(i.pathOf(i.roundedPlan({x:y.x+6,y:e,w:38,d:1.6,r:.8},3).map(([e,t])=>s([e,y.y+y.d,t])),!0));let S=[];for(let e=y.y+5;e<=y.y+y.d-5;e+=2.2)S.push(i.segment([y.x+y.w,e,6],[y.x+y.w,e,26],o));let C=l(i.sideSeam(y,26,o,4),{tone:`faint`})+l(i.sideSeam(y,6,o,4),{tone:`faint`})+l(x.join(``),{tone:`lo`})+l(S.join(``),{tone:`faint`});b.push(c(i.slabOf(y,4,46,o,4,1),{tone:`mid`,inner:C}));for(let e of[y.x+24,y.x+68])b.push(m(e,y.y+29,15,50,2.4,{tone:`mid`},56)),b.push(l(i.ring(e,y.y+29,13,52.4,o,56),{tone:`lo`})),b.push(`<path class="iso-line" data-tone="mid" data-fan="${e},${y.y+29},52.4,13" d=""/>`),b.push(l([5,9].map(t=>i.ring(e,y.y+29,t,52.4,o,32)).join(``),{tone:`faint`})),b.push(l(i.ring(e,y.y+29,2.4,52.4,o,16),{tone:`mid`})),b.push(`<path class="sf-grime" data-foul="" style="opacity:0" d="${i.pathOf(i.circleRing(e,y.y+29,12.6,40).map(([e,t])=>s([e,t,52.6])),!0)}"/>`),b.push(g([0,1,2,3].map(t=>[e+Math.cos(t*1.571+.785)*14,y.y+29+Math.sin(t*1.571+.785)*14]),52.4));for(let[e,t]of r.entries())b.push(_(t,y.x+(e?60:50),y.y+y.d-6,50,3.6));b.push(h(t,y.y+y.d,y.x+50,y.x+86,9,31)),b.push(v(y.y+y.d,y.x+50,34,22,6)),b.push(g(i.corners(y,3),50)),b.push(`<path class="iso-line" data-chiller="${y.x+50},${y.y+52},54" d=""/>`);for(let e of n?[y.x+12]:[y.x+12,y.x+26]){let t=a.frameAlong([e,y.y+y.d,40],[0,1,0]);b.push(c(a.disc(0,6,3,t,o),{tone:`mid`}),c(a.disc(6,7.6,4.4,t,o),{tone:`mid`})),b.push(u(a.dotsOf(t,7.6,3.5,4,o,{all:!0,phase:.785}),{size:.35}))}if(n){let[,e,t]=p,n=a.frameAlong([y.x+y.w,e,t],[1,0,0]);b.push(c(a.disc(0,6,3,n,o),{tone:`mid`}),c(a.disc(6,7.6,4.4,n,o),{tone:`mid`}),u(a.dotsOf(n,7.6,3.5,4,o,{all:!0,phase:.785}),{size:.35}))}return b.join(``)}var h=10,g=25;function _(f,p){let{svg:m,P:_,feed:v}=f,y=(e,t)=>v.num(e,t),b=t(m,`[data-chiller]`).map(e=>{let i=l(e),o=e=>t(m,`[data-asset="${i}"] ${e}`);return{id:i,leak:a(e.dataset.chiller),fans:o(`[data-fan]`).map(e=>({el:e,at:n(e.dataset.fan)})),foul:o(`[data-foul]`),hiss:d(r(m,i),`frost`),rate:0,fan:0}}),x=new Map(b.map(e=>[e.id,e]));return{draw(t,n,r){let a=f.reducedMotion();for(let s of b){s.rate=i(s.rate,y(s.id,`condenser_fan_tag`),t,1.2,a),a||(s.fan+=s.rate*1.4*c*t);for(let{el:t,at:n}of s.fans)e(t,`d`,o(_,n,s.fan));let l=e=>r&&u(v,s.id,e);s.hiss.draw(l(`refrigerant_leak`)&&!a,n,_,s.leak,[.2,1]);let d=l(`dirty_condenser`)?`1`:`0`;for(let e of s.foul)e.style.opacity=d;p(s.id,a?0:l(`compressor_seizure`)?.5:l(`compressor_failure`)?.25:0,n)}},bar(e){return x.has(e)?s(y(e,`cooling_load_pu`)):void 0},needle(e){let[t=``,n]=e.split(`:`);if(x.has(t))return n===`suction`?y(t,`refrigerant_pressure_suction`)/h:y(t,`refrigerant_pressure_discharge`)/g}}}export{p as n,m as r,_ as t};
@@ -1 +1 @@
1
- import{n as e}from"./utils-BO2u-wC_.js";var t=e(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),n=e(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]);export{t as n,n as t};
1
+ import{n as e}from"./utils-XFKvwlFT.js";var t=e(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),n=e(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]);export{t as n,n as t};
@@ -0,0 +1 @@
1
+ import"./rolldown-runtime-COnpUsM8.js";import{c as e}from"./vendor-charts-95ykyDlI.js";import{C as t,E as n,S as r,T as i,b as a,g as o,h as s,ot as c,w as l,x as u,y as d}from"./vendor-ui-D8j69UH4.js";import{C as f,E as p,S as m,T as h}from"./format-Bx7DF-TB.js";import{t as g}from"./utils-XFKvwlFT.js";import{t as _}from"./check-B-yvIfMj.js";import{t as v}from"./chevron-down-x70Pto6j.js";var y=c();function b({className:e,size:t=`default`,...n}){return(0,y.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:g(`group/card flex flex-col gap-4 overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border bg-card py-4 text-sm text-card-foreground has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-[var(--miravo-radius-stadium-sm)] *:[img:last-child]:rounded-b-[var(--miravo-radius-stadium-sm)]`,e),...n})}function x({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`card-header`,className:g(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-[var(--miravo-radius-stadium-sm)] px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function S({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`card-title`,className:g(`text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function C({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`card-content`,className:g(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}e();function w({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:g(`group/input-group relative flex h-8 w-full min-w-0 items-center gap-1.5 rounded-[var(--miravo-radius-stadium-sm)] border border-input bg-input/30 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 hover:bg-input/50 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-primary/35 has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-primary/22 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var T=p(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-xs font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function E({className:e,align:t=`inline-start`,...n}){return(0,y.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:g(T({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var D=p(`flex items-center gap-2 text-xs shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[var(--miravo-radius-stadium-sm)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[var(--miravo-radius-stadium-sm)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function O({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,y.jsx)(f,{type:t,"data-size":r,variant:n,className:g(D({size:r}),e),...i})}function k({className:e,...t}){return(0,y.jsx)(m,{"data-slot":`input-group-control`,className:g(`min-w-0 flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 hover:bg-transparent disabled:bg-transparent aria-invalid:ring-0 dark:hover:bg-transparent dark:disabled:bg-transparent`,e),...t})}var A=o;function j({className:e,children:t,...r}){return(0,y.jsxs)(n,{"data-slot":`combobox-trigger`,className:g(`[&_svg:not([class*='size-'])]:size-4`,e),...r,children:[t,(0,y.jsx)(v,{className:`pointer-events-none size-4 text-muted-foreground`})]})}function M({className:e,...t}){return(0,y.jsx)(l,{"data-slot":`combobox-clear`,render:(0,y.jsx)(O,{variant:`ghost`,size:`icon-xs`,"aria-label":`Clear selection`}),className:g(e),...t,children:(0,y.jsx)(h,{className:`pointer-events-none`})})}function N({className:e,children:t,disabled:n=!1,showTrigger:r=!0,showClear:a=!1,...o}){return(0,y.jsxs)(w,{className:g(`w-auto`,e),children:[(0,y.jsx)(i,{render:(0,y.jsx)(k,{disabled:n}),...o}),(0,y.jsxs)(E,{align:`inline-end`,children:[r&&(0,y.jsx)(O,{size:`icon-xs`,variant:`ghost`,render:(0,y.jsx)(j,{}),"data-slot":`input-group-button`,className:`group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent`,disabled:n,"aria-label":`Toggle options`}),a&&(0,y.jsx)(M,{disabled:n})]}),t]})}function P({className:e,side:t=`bottom`,sideOffset:n=6,align:i=`start`,alignOffset:o=0,anchor:s,...c}){return(0,y.jsx)(r,{children:(0,y.jsx)(u,{side:t,sideOffset:n,align:i,alignOffset:o,anchor:s,className:`isolate z-50`,children:(0,y.jsx)(a,{"data-slot":`combobox-content`,"data-chips":!!s,className:g(`group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-[var(--miravo-radius-tight)] bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:data-open:duration-0 motion-reduce:data-closed:duration-0`,e),...c})})})}function F({className:e,...n}){return(0,y.jsx)(t,{"data-slot":`combobox-list`,className:g(`no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0`,e),...n})}function I({className:e,children:t,...n}){return(0,y.jsxs)(d,{"data-slot":`combobox-item`,className:g(`relative flex w-full cursor-pointer items-center gap-1.5 rounded-[var(--miravo-radius-tight)] py-1 pr-8 pl-1.5 text-xs outline-hidden select-none data-[highlighted]:bg-sidebar-accent data-[highlighted]:text-sidebar-accent-foreground not-data-[variant=destructive]:data-[highlighted]:**:text-sidebar-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[t,(0,y.jsx)(s,{render:(0,y.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,y.jsx)(_,{className:`pointer-events-none`})})]})}export{F as a,x as c,I as i,S as l,P as n,b as o,N as r,C as s,A 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{ot as n}from"./vendor-ui-D8j69UH4.js";import{C as r,a as i,b as a,c as o,d as s,f as c,l,m as u,n as d,s as f}from"./dom-Cm_OH5jc.js";import{n as p,t as m}from"./by-path-VBqTBdlG.js";import{A as h,D as g,E as _,F as v,H as ee,L as te,N as ne,P as re,T as ie,V as ae,X as oe,a as se,b as ce,g as le,i as ue,j as de,k as fe,n as pe,o as me,r as he,s as ge,t as _e}from"./status-CZFZLqVk.js";import{r as ve,t as ye}from"./chiller-BSx8eUMN.js";import{n as be,o as xe,s as Se,t as Ce}from"./genset-BRgqR1AT.js";import{t as we}from"./stages-hidkaJPI.js";import{a as Te,i as Ee,n as De,o as Oe,s as ke,t as Ae}from"./rtu-D-1lltcO.js";import{a as je,i as Me,n as Ne,o as Pe,r as Fe,t as Ie}from"./boiler-CWAR1Nq2.js";var Le=[[`rtu1`,`hvac-rtu`,`hvac`,`floor-1`,0],[`rtu2`,`hvac-rtu`,`hvac`,`floor-2`,0],[`rtu3`,`hvac-rtu`,`hvac`,`floor-3`,0],[`chiller`,`industrial-chiller`,`chilled-water`,`plant`,0],[`chwPump`,`centrifugal-pump`,`chilled-water`,`plant`,0],[`boiler`,`hot-water-boiler`,`heating`,`boiler-room`,0],[`hwPump`,`centrifugal-pump`,`heating`,`boiler-room`,0],[`fanA`,`ac-induction-motor`,`electrical`,`ahu-fans`,0],[`fanB`,`ac-induction-motor`,`electrical`,`ahu-fans`,1],[`genset`,`diesel-generator`,`electrical`,`emergency-power`,0]],Re=e=>m(Le,e);function ze(e){let t=(e,t,n)=>({key:e,assetId:e,name:t,kind:`utility`,area:n});return[t(e.rtu1,`Rooftop unit · floor 1`,`HVAC`),t(e.rtu2,`Rooftop unit · floor 2`,`HVAC`),t(e.rtu3,`Rooftop unit · floor 3`,`HVAC`),t(e.chiller,`Chiller`,`Chilled water`),t(e.chwPump,`Chilled-water pump`,`Chilled water`),t(e.boiler,`Hot-water boiler`,`Heating`),t(e.hwPump,`Heating circulation pump`,`Heating`),t(e.fanA,`AHU supply fan 1`,`Electrical`),t(e.fanB,`AHU supply fan 2`,`Electrical`),t(e.genset,`Emergency generator`,`Electrical`)]}var y=e(t(),1),b={x:-332,y:-228,w:232,d:74,r:2},Be=29,x=1,Ve={x:-86,y:-192,w:44,d:36,r:1.5},S={x:-79,y:-184,w:30,d:20,r:1.5},C=26,He=-150;function Ue(e){let{k:t,P:n,L:r,slab:i,cyl:a}=e,o=[];for(let e=b.x+Be;e<b.x+b.w-1;e+=Be)o.push(t.segment([e,b.y,x],[e,b.y+b.d,x],n));for(let e=b.y+Be;e<b.y+b.d-1;e+=Be)o.push(t.segment([b.x,e,x],[b.x+b.w,e,x],n));let s=[i(b,0,x,{tone:`mid`,inner:r(o.join(``),{tone:`faint`})},3,.3)];for(let e of[-322,-124])s.push(i({x:e,y:-216,w:22,d:10,r:1},x,5,{tone:`mid`},2,.3),i({x:e+1.6,y:-214.4,w:18.8,d:6.8,r:.6},x+5,.6,{tone:`lo`},2,0));for(let e=-316;e<b.x+b.w-8;e+=46)s.push(a(e,b.y+b.d-4,1.3,x,7,{tone:`mid`},12));return s.join(``)}function We(e,t){let{k:n,P:r,L:i,slab:a}=e,o=Ve.x+Ve.w,s=[];for(let e=o+12;e<t-4;e+=12)s.push(n.segment([e,He-3,.6],[e,He+3,.6],r));return a({x:o,y:He-3.5,w:t-o,d:7,r:.4},0,.6,{tone:`mid`,inner:i(s.join(``),{tone:`faint`})},2,.1)}function Ge(e){let{k:t,P:n,L:r,slab:i,cyl:a}=e,{x:o,y:s,w:c,d:l}=S,u=1.5,d=[];for(let e=1;e<12;e++)d.push(t.segment([o+3+e*2,s+l+5,u+4],[o+3+e*2,s+l+5,C-4],n));let f=[i(Ve,0,u,{tone:`mid`},3,.3),i(S,u,C,{tone:`mid`},2,.5),i({x:o+3,y:s+l,w:c-6,d:5,r:.6},u+3,C-7,{tone:`mid`,inner:r(d.join(``),{tone:`faint`})},2,.2),i({x:o-.8,y:s-.8,w:c+1.6,d:l+1.6,r:1.5},u+C,1.4,{tone:`mid`},2,.2)];for(let e of[o+7,o+15,o+23])f.push(a(e,s+5,1.4,u+C+1.4,7,{tone:`mid`},12),a(e,s+5,2.2,u+C+1.4,1.4,{tone:`mid`},12));for(let e of[s+5,s+10,s+15])f.push(a(o+c-3,e,1,u+C+1.4,3,{tone:`lo`},10));return f.join(``)}function Ke(e,t,n=1.6){let{k:r,P:i,L:a,slab:o,screws:s}=e;return o(t,0,n,{tone:`mid`},3,.4)+a(r.planOutline(r.insetPlan(t,3),n,i,3),{tone:`faint`})+s(r.corners(t,4),n)}function w(e,t,n,r,{louvres:i=[],doors:a=[]}={}){let{k:o,P:s,L:c,slab:l}=e,u=[l(t,0,n,{tone:`mid`},2,.3),l({x:t.x-.6,y:t.y-.6,w:t.w+1.2,d:t.d+1.2,r:.3},n,1.4,{tone:`mid`},2,.2)],d=r===`south`?e.front(t.y+t.d):o.sideMatrix([t.x+t.w,t.y+t.d],0,s,`right`),f=[];for(let[e,t]of i){let[r,i]=[e,t];f.push(`<path class="cr-grille" d="M${r} ${-(n-9)}H${i}V-13H${r}Z"/>`);let a=[];for(let e=16;e<n-9;e+=3)a.push(`M${r+1} ${-e}H${i-1}`);f.push(c(a.join(``),{tone:`lo`}))}for(let[e,t]of a){let[r,i]=[e,t];f.push(`<path class="cr-door" d="M${r} -1H${i}V${-(n-16)}H${r}Z"/>`),f.push(c(`M${r-1.2} 0V${-(n-14.8)}H${i+1.2}V0M${r-1.2} -1H${i+1.2}`,{tone:`lo`})),f.push(`<circle class="sf-screw" cx="${i-2.4}" cy="${-(n/2-4)}" r="0.7"/>`)}return f.length&&u.push(`<g transform="${d}">${f.join(``)}</g>`),u.join(``)}function qe(e,t,n,r){let{k:i,P:a,L:o,slab:s,screws:c}=e,l=t.x+t.w,u=[w(e,t,n,`south`,{doors:[[t.x+8,t.x+22]],louvres:[[t.x+30,t.x+46]]})];u.push(s({x:t.x+t.w-18,y:t.y+8,w:10,d:8,r:.8},n+1.4,4,{tone:`mid`},2,.3));let d=i.sideMatrix([l,t.y+t.d],0,a,`right`),f=t.y+t.d-r.y;return u.push(`<g transform="${d}"><path class="sf-plate" d="M${f-7} ${-(r.z+7)}H${f+7}V${-(r.z-7)}H${f-7}Z"/>${o(`M${f-7} ${-(r.z+7)}H${f+7}V${-(r.z-7)}H${f-7}Z`,{tone:`lo`})}</g>`,c([[l+.05,r.y-5.6],[l+.05,r.y+5.6]],r.z+5.6),c([[l+.05,r.y-5.6],[l+.05,r.y+5.6]],r.z-5.6)),u.join(``)}function Je(e,[t,n],r,i,a,o){let{k:s,P:c,L:l,slab:u,cyl:d}=e,f=[],p=[];for(let e=i+48;e<a-12;e+=48)p.push(e);let m=p.map(e=>s.sideArc(t,n,r,e,c,24)).join(``);f.push(d(t,n,r,i,a-i,{tone:`mid`,inner:l(m,{tone:`faint`})},28));for(let e of p)f.push(d(t,n,r+1.2,e-.8,1.6,{tone:`mid`},28));for(let e of o)f.push(u({x:e.toX,y:n-.9,w:t-r-e.toX,d:1.8,r:.3},e.z-.9,1.8,{tone:`mid`},2,.1),u({x:e.toX-1.2,y:n-3.5,w:1.2,d:7,r:.3},e.z-3.5,7,{tone:`mid`},2,.1),d(t,n,r+.9,e.z-1.1,2.2,{tone:`mid`},28));for(let e of[0,2.1,4.2])f.push(d(t+Math.cos(e)*(r-1.4),n+Math.sin(e)*(r-1.4),.5,a,3,{tone:`lo`,crease:`none`},8));return f.push(d(t,n,r+2.2,a+3,1.2,{tone:`mid`},28)),f.join(``)}var T={x:-300,y:-268,w:290,d:32,r:.6},E=[4,64,124],D=3,Ye=6,O={x:-334,y:-268,w:34,d:32,r:.6},k=e=>(E[e+1]??184)-4,Xe={x:O.x-3,y:T.y-3,w:T.w+O.w+3+7,d:T.d+3+8,r:1.5},A={x:T.x+D,y:T.y+D,w:T.w-D,d:T.d-D,r:0},Ze=A.x+A.w,Qe=A.y+A.d,$e=[-247,-185,-123,-61,-13],et=2.2,j=2.6,M=E[0],N=-247,tt=-255,nt=11,rt=e=>k(e)-nt,it=[-246,-162,-78],at=-251,ot=.8,st=[46*ot,20*ot],ct=e=>[(it[e]??0)-9,(it[e]??0)+9],lt=e=>{let[t,n]=ct(e);return{x:t-5,y:tt-4.5,w:n-t+10,d:9,r:.3}},ut=e=>it.map((e,t)=>t).filter(t=>t<e),dt=4,P=1.6,ft=.6;function pt(e){let{k:t,P:n,L:r,slab:i}=e;return i(Xe,0,M,{tone:`mid`,inner:r(t.planOutline({x:T.x-.5,y:T.y-.5,w:T.w+1,d:T.d+1,r:0},M,n,2),{tone:`faint`})},4,.5)}function mt(e){let{k:t,P:n,L:r,S:i}=e,a=184+Ye-M,o=(e,r,i)=>t.segment([r[0],r[1],E[e]??0],[i[0],i[1],E[e]??0],n),s={x:T.x,y:T.y,w:T.w,d:D,r:.3},c={x:T.x,y:T.y+D,w:D,d:T.d-D,r:.3};return[i(t.slabOf(s,M,a,n,2,.3),{tone:`mid`,inner:r([1,2].map(e=>o(e,[s.x,s.y+s.d],[s.x+s.w,s.y+s.d])).join(``),{tone:`faint`})}),i(t.slabOf(c,M,a,n,2,.3),{tone:`mid`}),ht(e)].join(``)}function ht(e){let{k:t,P:n,L:r,S:i,front:a}=e,o=O.y+O.d,s=O.x+O.w/2,c=[],l=[];for(let[e,t]of E.entries()){for(let e of[s-8,s+.4])c.push(`<path class="cr-door" d="M${e} ${-(t+1)}h7.6v-23h-7.6Z"/>`);l.push(`M${s-9} ${-t}V${-(t+25)}H${s+9}V${-t}`),c.push(`<path class="cr-grille" d="M${s-2.4} ${-(t+28)}h4.8v-2.4h-4.8Z"/>`),e<E.length-1&&l.push(`M${O.x} ${-(k(e)+4)}H${O.x+O.w}`)}return i(t.slabOf(O,M,184-M,n,2,.4),{tone:`mid`})+`<g transform="${a(o)}">${c.join(``)}${r(l.join(``),{tone:`lo`})}</g>`}var gt=Array.from({length:6},(e,t)=>[-284+t*36,-284+t*36+32]),_t=21,vt=8;function yt(e,t){let{k:n,P:r,L:i,front:a}=e,o=(E[t]??0)+_t,s=k(t)-vt,c=(e,n)=>`<path class="bd-win bt-pane" data-occ="${t}" d="M${e} ${-s}H${n}V${-o}H${e}Z"/>`,l=(e,t)=>`M${e-1} ${-(o-1.6)}H${t+1}M${(e+t)/2} ${-s}V${-o}`,u=gt.map(([e,t])=>c(e,t)).join(``),d=gt.map(([e,t])=>l(e,t)).join(``),f=n.sideMatrix([T.x+D,T.y+T.d],0,r,`right`);return`<g transform="${a(T.y+D)}">${u}${i(d,{tone:`lo`})}</g><g transform="${f}">${c(4,20)}${i(l(4,20),{tone:`lo`})}</g>`}function bt(e,t){let{k:n,P:r,L:i,slab:a}=e,o=(E[t]??0)-4,s=[a(A,o,4,{tone:`mid`,inner:i(n.segment([A.x,A.y+A.d,o+1.4],[A.x+A.w,A.y+A.d,o+1.4],r),{tone:`faint`})},2,.4)],c=E[t]??0;for(let e of ut(t)){let t=lt(e);s.push(a({...t,d:P},c,dt,{tone:`mid`},2,.2),a({...t,w:P},c,dt,{tone:`mid`},2,.2))}return s.join(``)}function xt(e,t,n,r){let{cyl:i}=e,a=lt(t),o=(E[n]??0)+dt,s=r===`back`?a.y+ft+.4:a.y+a.d-ft-.4;return[a.x+.8,a.x+a.w-.8].map(e=>i(e,s,ft,o,k(n)-o,{tone:`mid`,crease:`none`},8))}function St(e,t){return ut(t).flatMap(n=>xt(e,n,t,`back`)).join(``)}function Ct(e,t){let{cyl:n,slab:r}=e,i=E[t]??0,a=k(t)-i,o=Qe-j,s=$e.map(e=>n(e,o,et,i,a,{tone:`mid`},14));s.push(n(Ze-j,-251,et,i,a,{tone:`mid`},14));for(let n of ut(t)){let a=lt(n);s.push(r({...a,y:a.y+a.d-P,d:P},i,dt,{tone:`mid`},2,.2),r({...a,x:a.x+a.w-P,w:P},i,dt,{tone:`mid`},2,.2),...xt(e,n,t,`front`))}return s.join(``)}function wt(e){let{k:t,P:n,L:r,S:i,slab:a}=e,o=[.25,.5,.75].map(e=>t.segment([A.x+A.w*e,A.y,184],[A.x+A.w*e,A.y+A.d,184],n)).join(``),s=A.y+A.d,c=A.x+A.w;return[i(t.slabOf(A,180,4,n,2,.4),{tone:`mid`,inner:r(o,{tone:`faint`})}),a({x:A.x,y:s-j,w:A.w,d:j,r:.3},184,Ye-1,{tone:`mid`},2,.3),a({x:c-j,y:A.y,w:j,d:A.d-j,r:.3},184,Ye-1,{tone:`mid`},2,.3),...it.map(e=>a({x:e-st[0]-1.5,y:at-st[1]-1.5,w:st[0]*2+3,d:st[1]*2+3,r:.6},184,3,{tone:`mid`},2,.2)),a({x:O.x+4,y:O.y+8,w:O.w-8,d:O.d-16,r:.6},184,14,{tone:`mid`},2,.3)].join(``)}var Tt={w:16,d:10,h:4},Et=18,Dt=1.8,Ot=[[-190,-100],[-120,-65],[-120,-204]],F={x:-24,y:N,w:16,d:14,h:12,top:32},kt={w:10,d:8,h:4},At=-262,I=-264.4,jt=5.5,Mt=1.5,Nt=1.1,Pt=[-282,-246,-210,-174,-138,-102],Ft=8.5,It=-292,Lt=(e,t)=>[e,N,k(t)-Et+Dt],Rt=[F.x,F.y,F.top+Dt],zt=e=>[ct(e)[1],tt,k(e)-Et+Dt];function Bt(e,t,n,r,i,a,o,s,c){let{k:l,P:u,L:d,D:f,slab:p,cyl:m,at:h}=e,g=o-a,_=[[t-r/2+1.5,n-i/2+1.5],[t+r/2-1.5,n-i/2+1.5],[t-r/2+1.5,n+i/2-1.5],[t+r/2-1.5,n+i/2-1.5]].map(([e=0,t=0])=>m(e,t,.5,o,s-o,{tone:`lo`,crease:`none`},8)),v=[.3,.55,.8].map(e=>l.segment([t-r/2+1.5,n+i/2,g+a*e],[t+r/2-1.5,n+i/2,g+a*e],u)).join(``),ee=[];for(let e=0;e<6;e++)ee.push([t-r/2+2+e*(r-4)/5,n+i/2,g+1.2]);return[..._,p({x:t-r/2,y:n-i/2,w:r,d:i,r:.8},g,a,{tone:`mid`,inner:d(v,{tone:`faint`})},2,.3),m(t,n,Math.min(5.2,i/2-1.2),o,Dt,{tone:`mid`},24),f(ee.map(e=>h(e)),{size:.3}),c?`<g data-diffuser="${t},${n},${g},${r/2}"></g>`:``].join(``)}var Vt=(e,t,n)=>Bt(e,t,N,Tt.w,Tt.d,Tt.h,k(n)-Et,k(n),!0),Ht=e=>Bt(e,F.x,F.y,F.w,F.d,F.h,F.top,k(0),!0),Ut=(e,t)=>Bt(e,ct(t)[1],tt,kt.w,kt.d,kt.h,k(t)-Et,k(t),!1);function Wt(e,t,n){let{k:r,P:i,L:a,slab:o}=e,s=n+11,c=s+Ft,l=-265,u=Array.from({length:7},(e,n)=>r.segment([t+3.5+n*3.5,l+3.6,s+1],[t+3.5+n*3.5,l+3.6,c-1],i)).join(``);return[...[t+5,t+28-5].map(e=>o({x:e-1,y:-265,w:2,d:.9,r:.2},s+2,4,{tone:`lo`},2,0)),o({x:t,y:l,w:28,d:3.6,r:.5},s,Ft,{tone:`mid`,inner:a(u,{tone:`faint`})},2,.3)].join(``)}function Gt(e,t,n){let{G:r,P:i,S:a}=e,o=r.frameAlong([It,t,n],[-1,0,0]);return a(r.disc(0,1.4,Nt+.7,o,i),{tone:`mid`})}function Kt(e,t,n,r,i){let{slab:a,cyl:o,front:s}=e,c=r+8,l=[a({x:t+.8,y:n+.6,w:1.2,d:6.8,r:.2},r,8,{tone:`lo`},2,0),a({x:t+22-2,y:n+.6,w:1.2,d:6.8,r:.2},r,8,{tone:`lo`},2,0),a({x:t,y:n,w:22,d:8,r:.6},c,1.4,{tone:`mid`},2,.3),o(t+22/2,n+8*.4,1.1,c+1.4,2.4,{tone:`lo`,crease:`none`},10),a({x:t+22/2-4.2,y:n+8*.4-.5,w:8.4,d:1,r:.3},c+3.8,5.4,{tone:`lo`},2,0)],u=n+8*.4+.5;return l.push(`<g transform="${s(u)}"><path class="bd-win" data-occ="${i}" d="M${t+22/2-3.6} ${-(c+4.2)}h7.2v-4.4h-7.2Z"/></g>`),l.join(``)}function qt(e,t,n,r){let{slab:i,cyl:a}=e;return[a(t,n,3,r,.8,{tone:`lo`},14),a(t,n,.6,r+.8,3.6,{tone:`lo`,crease:`none`},8),a(t,n,3.2,r+4.4,1.4,{tone:`mid`},16),i({x:t-3,y:n+2.6,w:6,d:.9,r:.3},r+5.6,5.4,{tone:`mid`},2,.2)].join(``)}function Jt(e,t,n,r){let{slab:i}=e;return[Kt(e,t,-249,n,r),Kt(e,t+25,-249,n,r),i({x:t+22.6,y:-249.5,w:1,d:7,r:.2},n+1.2,12,{tone:`mid`},2,.2),qt(e,t+11,-239.6,n),qt(e,t+36,-239.6,n)].join(``)}function Yt(e,t){let{slab:n,cyl:r}=e,i=[],a=-250;i.push(n({x:a,y:-251,w:46,d:8,r:1},t,10,{tone:`mid`},3,.4),n({x:a+36,y:-243,w:10,d:7,r:1},t,10,{tone:`mid`},3,.4),n({x:a-.8,y:-251.8,w:47.6,d:9.6,r:1},t+10,1.4,{tone:`mid`},3,.2),n({x:a+35.2,y:-243.8,w:11.6,d:8.6,r:1},t+10,1.4,{tone:`mid`},3,.2));for(let e of[-170,-144])i.push(n({x:e,y:-250,w:20,d:6,r:.8},t+3.2,3,{tone:`mid`},2,.3),n({x:e,y:-252,w:20,d:2,r:.4},t+6.2,6,{tone:`mid`},2,.2),r(e+2.4,-245.4,.9,t,3.2,{tone:`lo`,crease:`none`},8),r(e+17.6,-245.4,.9,t,3.2,{tone:`lo`,crease:`none`},8));return i.join(``)}function Xt(e,t){let n=E[t]??0,r=Pt.map(t=>Wt(e,t,n));r.push(Gt(e,At,n+jt),Gt(e,I,n+Mt));let i=Ot[t]??[];r.push(St(e,t));for(let n of i)r.push(Vt(e,n,t));if(r.push(Ut(e,t)),t===0)r.push(Yt(e,n));else for(let a of i)r.push(Jt(e,a-23.5,n,t));return r.join(``)}var Zt=1e3,Qt={x:-352,y:-286,w:652,d:170,r:8},$t={x:-14,y:-516,w:314,d:220,r:8},en={x:-374,y:-538,w:690,d:444,r:16},tn=[34,-242],nn=a([...u(en,-21,-14),...u(Qt,-14,20),...u($t,-14,20),...u(Xe,0,214),...u({x:26,y:-250,w:16,d:16,r:0},0,244)],Zt,620,{pad:22,azimuth:60}),rn=-325,an=[70,205],on=Te(100,!0),sn=[-202,-135,0],cn=[-34,36.6,40],ln=[-20,36.6,40],un=[94,-130,0],L=[.55,.5],dn=-385,fn=-462,pn=(e,t)=>[(e[0]-un[0])*t,(e[1]-un[1])*t,e[2]*t],mn=e=>{let t=an[e],n=Oe(100,7),r=e=>[t+e[0],rn+e[1],e[2]];return{supply:r(n.chwSupply),ret:r(n.chwReturn),discharge:r(n.discharge)}},hn=[mn(0),mn(1)],R=[hn[0].supply[0]-ln[0],fn],z=[tn[0]-Me[0],tn[1]],gn=[z[0]+je[0],z[1]+je[1],je[2]],_n=[z[0]+Fe[0],z[1]+Fe[1],Fe[2]],vn=(e,t,n)=>[e-pn(h,L[n])[0],t],yn=[vn(R[0]+cn[0],dn,0),vn(_n[0],-204,1)],bn=(e,t)=>{let[n,r]=yn[e]??[0,0],[i,a,o]=pn(t,L[e]);return[n+i,r+a,o]},xn=[{suction:bn(0,re),riser:bn(0,h)},{suction:bn(1,re),riser:bn(1,h)}],Sn=[190,-150],B={x:24,y:-160,w:56,d:44,r:1},Cn={x:108,y:-192,w:164,d:72,r:2},wn={x:108,y:-194,w:164,d:3,r:.3},Tn={x:108,y:-194,w:3,d:76,r:.3},En=[-49,0,60.8],Dn={x:0,y:-272,w:252,d:76,r:2},On={x:2,y:-270,w:250,d:3,r:.3},kn={x:-10,y:-512,w:306,d:4,r:.3},An={x:-12,y:-512,w:4,d:214,r:.3},jn=we([...yn.map((e,t)=>({key:`pump${t}`,at:e,h:45*L[t]})),{key:`chiller`,at:R,h:56},{key:`boiler`,at:z,h:je[2]-8},{key:`flue`,at:tn,h:236},...an.map((e,t)=>({key:`ahu${t}`,at:[e,rn],h:36})),{key:`xfmr`,at:[S.x+S.w/2,S.y+S.d/2],h:36},{key:`genset`,at:Sn,h:126},{key:`elec`,at:[B.x+B.w/2,B.y+B.d/2],h:46},{key:`gen-back`,at:[wn.x+wn.w/2,wn.y],h:36},{key:`gen-west`,at:[Tn.x,Tn.y+Tn.d/2],h:36}],nn),Mn=jn.order,Nn=E.length,Pn=([e,t])=>e<14&&t>-269&&t<-232,Fn=([e,t])=>e<-8&&t<-269,In=([e,t])=>e<-8&&t<-256.5,Ln=e=>E.filter((t,n)=>n>0&&e>=t).length,Rn={layer:e=>Fn(e)?0:Pn(e)&&e[2]>=184?Nn+1:Pn(e)&&In(e)?zn+Ln(e[2]):Pn(e)?1+Ln(e[2]):Nn+1+jn.depth.layer(e),glide:()=>!0},zn=Nn+1+Mn.length+1,Bn={y:Sn[1],z:26};function Vn(e,t){return[e,...[...E].filter(n=>n>0&&n<e&&n>t).sort((e,t)=>t-e),t]}var Hn=3.2,Un=2.2,Wn=180;function Gn(e,t,n,r){let i=Vn(Wn,n);return i.slice(0,-1).map((n,a)=>{let o=[[t,tt,n],[t,tt,i[a+1]??0]];return a===i.length-2&&o.push(...r),{id:`${e}${a}`,medium:`duct`,r:Hn,bend:2,bare:[a===0,!1],pts:o}})}var Kn=[0,1,2].flatMap(e=>{let t=rt(e),[n,r]=ct(e),i=[...Ot[e]??[]].sort((e,t)=>Math.abs(e-n)-Math.abs(t-n)),a=i[i.length-1]??n,o=i.slice(0,-1).map((n,r)=>({id:`sup${e}-n${r}`,medium:`duct`,r:Un,pts:[[n,N,t],Lt(n,e)]}));return[...Gn(`sup${e}-`,n,t,[[n,N,t],[a,N,t],Lt(a,e)]),...o,...Gn(`ret${e}-`,r,zt(e)[2],[])]}),[V,H]=hn,U=-279,qn=Rt[0],W=40,Jn=[{id:`ahu-a`,medium:`duct`,r:3.5,pts:[V.discharge,[V.discharge[0],U,V.discharge[2]],[V.discharge[0],U,W]]},{id:`ahu-b`,medium:`duct`,r:3.5,pts:[H.discharge,[H.discharge[0],U,H.discharge[2]],[H.discharge[0],U,W],[qn,U,W],[qn,-266.5,W]]},{id:`ahu-in`,medium:`duct`,r:3.5,pts:[[qn,-265,W],[qn,Rt[1],W],Rt]}],G=[R[0]+ln[0],R[1]+ln[1],ln[2]],Yn=[R[0]+cn[0],R[1]+cn[1],cn[2]],[K,q]=xn,Xn=46,Zn=-360,Qn=K.suction[2],$n=K.suction[1],er=V.supply[1],tr=e=>[[e,er,Xn],[e,$n,Xn],[e,$n,Qn]],nr=[{id:`chw-dis`,medium:`coolantret`,r:ne*L[0],fromStub:!0,pts:[K.riser,[K.riser[0],K.riser[1],Yn[2]],Yn]},{id:`chw-sup`,medium:`coolant`,r:2.6,pts:[G,[G[0],er,G[2]],V.supply]},{id:`chw-sup-b`,medium:`coolant`,r:2.6,pts:[[G[0],Zn,G[2]],[H.supply[0],Zn,G[2]],[H.supply[0],er,G[2]],H.supply]},{id:`chw-ret-b`,medium:`coolantret`,r:2.6,pts:[H.ret,...tr(H.ret[0]),K.suction]},{id:`chw-ret`,medium:`coolantret`,r:2.6,pts:[V.ret,...tr(V.ret[0])]}],J=-6,Y=At,rr=-258,ir=-18,ar=-180,or=q.suction[0]+40,sr=70,cr=_n[2]+20,lr=(e,t,n,r,i,a)=>Vn(a,i).slice(0,-1).map((o,s,c)=>{let l=s===c.length-1?i:Vn(a,i)[s+1]??i;return{id:`${e}${s}`,medium:n,r,blind:[s===c.length-1,s===0],pts:[[J,t,l],[J,t,o]]}}),ur=E.flatMap((e,t)=>{let n=e+jt,r=e+Mt;return[{id:`hw-s${t}`,medium:`heat`,r:Nt,blind:[!1,!0],pts:[[J,Y,n],[It,Y,n]]},{id:`hw-r${t}`,medium:`hotret`,r:Nt,blind:[!0,!1],pts:[[It,I,r],[ir,I,r],[ir,rr,r],[J,rr,r]]},...Pt.flatMap((i,a)=>[{id:`hw-st${t}-${a}`,medium:`heat`,r:1,bare:[!1,!0],pts:[[i+28-3,Y,n],[i+28-3,Y,e+11]]},{id:`hw-rt${t}-${a}`,medium:`hotret`,r:1,bare:[!0,!1],pts:[[i+3,I,e+11],[i+3,I,r]]}])]}),dr=[...lr(`hw-sr`,Y,`heat`,2.2,5,E[2]+jt+6),...lr(`hw-rr`,rr,`hotret`,2.2,3,E[2]+Mt+6),{id:`hw-feed-s`,medium:`heat`,r:2.2,pts:[gn,[gn[0],gn[1],sr],[gn[0],Y,sr],[J,Y,sr]]},{id:`hw-feed-r`,medium:`hotret`,r:2.2,pts:[[J,rr,q.suction[2]],[J,ar,q.suction[2]],[or,ar,q.suction[2]],[or,q.suction[1],q.suction[2]],q.suction]},{id:`hw-dis`,medium:`hotret`,r:ne*L[1],fromStub:!0,pts:[q.riser,[q.riser[0],q.riser[1],cr],[_n[0],_n[1],cr],_n]}],X=[Sn[0]+En[0],Sn[1]+En[1],En[2]],fr=B.x+B.w,pr=[{id:`gen-cable`,medium:`cable`,r:1.6,pts:[X,[X[0],X[1],72],[fr+12,X[1],72],[fr+12,X[1],Bn.z],[fr,X[1],Bn.z]]}],mr=[...ur,...Kn,...nr,...Jn,...dr,...pr],Z=(e,t,n,r,i=0)=>[e,t,n,r,i],hr={z:10,flanged:!0,routes:mr,posts:[Z(180,U,3.5,W),Z(60,U,3.5,W),Z(20,U,3.5,W),Z(40,Y,2.2,sr,4),Z(G[0],-416,2.6,G[2]),Z(Yn[0],-405,2.6,G[2]),...[110,150,190].flatMap(e=>[Z(e,Zn,2.6,G[2]),Z(e,$n,2.6,Qn)]),Z(X[0]-20,X[1],1.6,72,1.6)]},Q=n(),gr={x:-248,y:-164,w:92,d:58,r:3},_r=0,vr=(e,t)=>Ee(e,t,`downshot`),yr=(e,t)=>Pe(e,t,7,236-_r),br=(e,t)=>v(e,t,`coolantret`,!0),xr=(e,t)=>v(e,t,`hotret`,!0),Sr=(e,t)=>ke(e,t,100,{humidifier:!1,filterGauge:!1,fanHook:`data-vfan`,stubHalf:7,motor:!0}),Cr=[E[1]-4/2,E[2]-4/2,184-4/2];function wr(e){return te(e,en)+e.plinth(Qt)+e.plinth($t)+Ue(e)+We(e,B.x)+Ke(e,Dn)+Ke(e,Cn)+w(e,On,34,`south`,{louvres:[[30,50],[100,120],[170,190]]})+w(e,kn,64,`south`,{louvres:[[60,90],[130,160],[200,230],[260,290]]})+w(e,An,64,`east`,{doors:[[60,80]]})}var Tr=e=>Je(e,tn,6,112,236,Cr.map(e=>({z:e,toX:Ze}))),Er=e=>qe(e,B,40,Bn),Dr=e=>w(e,wn,36,`south`,{louvres:[[128,158],[200,230]]}),Or=e=>w(e,Tn,36,`east`,{louvres:[[20,50]],doors:[[56,74]]});function kr({ids:e}){let t=c(),n=_(hr,Rn),r=(0,y.useMemo)(()=>wr(t),[t]),i=(0,y.useMemo)(()=>pt(t)+mt(t),[t]),a=e=>(0,Q.jsx)(s,{html:`${n.layers[e]??``}<g data-flows="${e}" data-depth="${e}"></g>`,data:{pipes:``}},`pipes-${e}`),o=[e.rtu1,e.rtu2,e.rtu3],u=[];for(let[n,r]of o.entries())u.push(n>0?(0,Q.jsx)(s,{html:bt(t,n)},`slab${n}`):null,(0,Q.jsx)(s,{html:yt(t,n)},`win${n}`),a(zn+n),(0,Q.jsx)(s,{asset:r,intro:2+n,html:Xt(t,n)},`in${n}`),n===0?(0,Q.jsx)(s,{asset:e.fanA,intro:5,html:Ht(t)},`ahu-box`):null,a(1+n),(0,Q.jsx)(s,{html:Ct(t,n)},`col${n}`));let d={chiller:(0,Q.jsx)(g,{from:sn,to:fe(R),children:(0,Q.jsx)(l,{id:e.chiller,plan:gr,intro:12,draw:ve})}),boiler:(0,Q.jsx)(g,{to:fe(z),children:(0,Q.jsx)(l,{id:e.boiler,plan:Ne,intro:13,draw:yr})}),flue:(0,Q.jsx)(s,{html:(0,y.useMemo)(()=>Tr(t),[t]),intro:13}),xfmr:(0,Q.jsx)(s,{html:(0,y.useMemo)(()=>Ge(t),[t]),intro:16}),elec:(0,Q.jsx)(s,{html:(0,y.useMemo)(()=>Er(t),[t]),intro:16}),"gen-back":(0,Q.jsx)(s,{html:(0,y.useMemo)(()=>Dr(t),[t]),intro:15}),"gen-west":(0,Q.jsx)(s,{html:(0,y.useMemo)(()=>Or(t),[t]),intro:15}),genset:(0,Q.jsx)(`g`,{className:`gen-set`,children:(0,Q.jsx)(g,{to:fe(Sn),children:(0,Q.jsx)(l,{id:e.genset,plan:xe,intro:16,draw:Se})})})};for(let[t,[n,r]]of yn.entries())d[`pump${t}`]=(0,Q.jsx)(g,{from:un,to:fe([n,r]),scale:L[t],children:(0,Q.jsx)(l,{id:t?e.hwPump:e.chwPump,plan:de,intro:14+t,draw:t?xr:br})});for(let[t,n]of an.entries())d[`ahu${t}`]=(0,Q.jsx)(g,{to:fe([n,rn]),children:(0,Q.jsx)(l,{id:t?e.fanB:e.fanA,plan:on,intro:10+t,draw:Sr})});return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(s,{html:r,data:{plinth:``}}),a(0),(0,Q.jsx)(s,{html:i}),u,(0,Q.jsx)(s,{html:wt(t)}),it.map((e,t)=>(0,Q.jsx)(g,{to:[e,at,187],scale:ot,children:(0,Q.jsx)(l,{id:o[t]??``,plan:De,intro:6+t,draw:vr})},e)),a(4),Mn.flatMap((e,t)=>[(0,Q.jsx)(`g`,{children:d[e.key]},e.key),a(5+t)])]})}var Ar=10,jr=17,Mr=.55;function Nr(e,t,n){let{svg:a,P:s,feed:c}=e,l=d(a,`[data-occ]`).map(e=>({el:e,id:t[Number(e.dataset.occ)]??ge(e)})),u=d(a,`[data-diffuser]`).map(e=>({id:ge(e),at:f(e.dataset.diffuser),streaks:ie(e,Ar,`path`,`cr-stream`),phase:0}));return{draw(t,a,d){for(let e of l)o(e.el,`data-on`,c.num(e.id,`occupied`)>0?``:null);let f=e.reducedMotion();for(let e of u){let a=le(n(e.id));e.phase=(e.phase+a*Mr*t)%1;let[c=0,l=0,u=0,p=0]=e.at;for(let[t,n]of e.streaks.entries()){if(!d||f||a<.02||n.seed>.25+a){i(n.el,`0`);continue}let m=(e.phase+n.seed*3.1)%1,h=((t+.5)/Ar-.5)*2*(p-1.5),g=(n.seed-.5)*8,_=u-.5-m*jr,v=[c+h,l+g,_],ee=[c+h,l+g,_-3],[te,ne]=r(v,s),[re,ie]=r(ee,s);o(n.el,`d`,`M${te.toFixed(1)} ${ne.toFixed(1)}L${re.toFixed(1)} ${ie.toFixed(1)}`),i(n.el,(Math.sin(Math.PI*m)*.5).toFixed(2))}}},bar(){}}}var $=e=>e>.002?6+26*le(e*2):0,Pr=e=>{let{svg:t,feed:n,ids:r}=e,i=ce(t),a=Ae(e,i),o=ye(e,i),s=he(e,i),c=Ie(e,i),l=be(e,i),u=Ce(e,i),d=e=>le(n.num(e,`speed_feedback`)/n.param(e,`rated_rpm`,1450)),f=e=>e===r.fanA?(d(r.fanA)+d(r.fanB))/2:a.airPu(e),p=[a,o,s,c,l,u,Nr(e,[r.rtu1,r.rtu2,r.rtu3],f)],m=ue(e,e=>pe(n,e,`availability`)),h=me(e,{needle:e=>o.needle(e)??c.needle(e)??0,bar:e=>p.reduce((t,n)=>t??n.bar(e),void 0)??0,alertsHigh:()=>!0,ready:()=>!0}),g=[r.rtu1,r.rtu2,r.rtu3],_=()=>s.flowPu(r.chwPump),v=()=>s.flowPu(r.hwPump),ee=()=>{let e=n.param(r.genset,`rated_power_kva`,500)*.8;return e>0?le(n.num(r.genset,`load_actual`)/e):0},te=se(e,({id:e})=>{let t=/^(?:sup|ret)(\d)-/.exec(e);if(t)return $(a.airPu(g[Number(t[1])]??``));if(e.startsWith(`hw-s`)||e.startsWith(`hw-r`))return $(/^hw-[sr]\d$/.test(e)?v()/3:v());switch(e){case`ahu-a`:return $(d(r.fanA));case`ahu-b`:return $(d(r.fanB));case`ahu-in`:return $(f(r.fanA));case`chw-dis`:case`chw-sup`:case`chw-ret`:return $(_());case`chw-sup-b`:case`chw-ret-b`:return $(_()/2);case`hw-feed-s`:case`hw-feed-r`:case`hw-dis`:return $(v());case`gen-cable`:return $(ee());default:return 0}});return{data(e){m.draw(e)},draw({sdt:e,t,introDone:n}){te.draw(e),h.draw(e,t);for(let r of p)r.draw(e,t,n)},resync(){},status:e=>_e(n,e,`availability`)}},Fr=ae(nn),Ir=ee(Fr,hr,Rn),Lr=oe({layout:{width:Zt,height:620,label:`Isometric model of the Commercial Building: a three-storey office tower with a rooftop unit on each roof curb whose supply and return ducts drop through a chase to that storey's ceiling diffusers, and a loop of radiators along the back wall; behind it the mechanical room with the chiller, the chilled-water pump and two air handlers with their fan motors; beside it the boiler with its flue stack and heating pump, the transformer, and the standby diesel generator with its feeder to the electrical room. Pipes and ducts carry chilled water, hot water and air between them. Every moving part follows live values from the running engine.`,kit:Fr,flows:Ir.flows,joints:Ir.joints,Scene:kr,compose:Pr},resolve:Re,things:ze,caption:`rooftop units · plant · standby power`,mismatch:`This floor expects the Commercial Building: three rooftop units, the chiller with its chilled-water pump, the hot-water boiler with its heating pump, two air handler fan motors and the standby diesel generator, by area and line.`,statusBasis:`availability`,Overview:p,tab:`Building`});export{Lr as buildingFloor};
@@ -0,0 +1 @@
1
+ import{c as e,n as t,s as n}from"./dom-Cm_OH5jc.js";import{B as r,C as i,_ as a,c as o,g as s,p as c,s as l,w as u,x as d,y as f}from"./status-CZFZLqVk.js";function p(e,t,n={barFull:10,dialFull:20}){let{k:i,G:a,P:o,at:s,S:c,L:l,slab:u,cyl:d,hmi:f,screws:p,dial:m,faceRule:h}=e,g=[],_=-132,v=-132;for(let e of[v+18,v+92-18])g.push(u({x:e-4,y:_-12,w:8,d:24,r:1},0,10,{tone:`mid`},2,.4)),g.push(p([[e-2,_+10],[e+2,_+10]],10));let y=a.frameAlong([v,_,24],[1,0,0]);g.push(c(a.solidOf([[0,0],[1,7,1],[3,11,1],[6,13.4,1],[10,15,1],[14,15.6],[78,15.6],[82,15,1],[86,13.4,1],[89,11,1],[91,7,1],[92,0]],y,o),{tone:`mid`,inner:l(a.arcOf(y,14,15.6,o)+a.arcOf(y,78,15.6,o)+a.arcOf(y,92/2,15.6,o),{tone:`faint`})})),g.push(l(a.arcOf(y,30,15.6,o)+a.arcOf(y,44,15.6,o),{tone:`lo`})),g.push(d(v+92-16,_,1,7.800000000000001,3.4,{tone:`mid`,crease:`none`},12)),g.push(u({x:v+92-19,y:_-2.2,w:6,d:4.4,r:.6},4.199999999999999,3.6,{tone:`mid`},2,.2));let b=s([v+92-15.6,_+2.25,6]);g.push(`<circle class="sf-drain-led" data-drain-led="" cx="${b[0].toFixed(2)}" cy="${b[1].toFixed(2)}" r="0.4"/>`),g.push(`<g class="sf-fx" data-drain="${v+92-13},${_},5"></g>`),g.push(d(v+24,_,2.4,39.4,4,{tone:`mid`},16),d(v+24,_,1.4,43.4,4,{tone:`mid`},12),d(v+24,_,2.2,47.4,1.2,{tone:`mid`},14)),g.push(d(-60,_,2,39.4,8,{tone:`mid`},16)),g.push(m(t,-60,_,47,8)),v+92+6,g.push(u({x:-34,y:_-16,w:32,d:32,r:2},0,8,{tone:`mid`},3,.5)),g.push(p(i.corners({x:-34,y:_-16,w:32,d:32},2.6),8));let x=a.frameAlong([-32,_-2,18],[1,0,0]);g.push(c(a.solidOf([[0,8],[1,9],[24,9],[25,8]],x,o),{tone:`mid`,inner:i.fadedSvg(a.ribsOf(x,1,24,9,20,o,{fade:[.1,.55],seams:!0}),{tone:`lo`})})),g.push(c(a.disc(25,28,7,x,o),{tone:`mid`})),g.push(`<path class="iso-line" data-tone="lo" data-spin="comp" data-shaft="-32,${_-2},18" data-radius="7" data-span="${(-6.699999999999999).toFixed(1)},${(-4.300000000000001).toFixed(1)}" data-header-full="${n.barFull}" data-dial-full="${n.dialFull}" data-relief="${v+24},${_},49" data-crank="-22,${_-2},32" d=""/>`),g.push(u({x:-24,y:_+7,w:10,d:7,r:1},8,6,{tone:`mid`},2,.3)),g.push(d(v+92-12,_,2.2,39,1.4,{tone:`mid`},16)),g.push(r(e,[[-19,_+10.5,14],[-19,_+10.5,52],[-19,_,52],[v+92-12,_,52],[v+92-12,_,40.4]],1,`mid`,4,`air`,[!1,!1])),g.push(u({x:v+30,y:_+18,w:30,d:8,r:1},0,24,{tone:`mid`},2,.4)),g.push(f(t,_+26,v+32,v+58,7,22)),g.push(h(_+26,v+32,3,18,2.4));let S=a.frameAlong([v+22,_+15,24],[0,1,0]);return g.push(c(a.disc(0,2,3,S,o),{tone:`mid`}),c(a.disc(2,3,3.6,S,o),{tone:`mid`})),g.join(``)}var m=9;function h(r,p){let{svg:h,P:g,feed:_}=r,v=(e,t)=>_.num(e,t),y=t(h,`[data-spin="comp"]`).map(e=>{let[t=0,r=0]=n(e.dataset.span),a=l(e),s=i(h,a);return{el:e,id:a,at:o(e.dataset.shaft),relief:o(e.dataset.relief),crank:o(e.dataset.crank),r:Number(e.dataset.radius)||0,s0:t,s1:r,barFull:Number(e.dataset.headerFull)||10,dialFull:Number(e.dataset.dialFull)||20,rate:0,spin:0,hiss:f(s),heat:d(s)}}),b=new Map(y.map(e=>[e.id,e]));return{draw(t,n,i){let o=r.reducedMotion();for(let r of y)r.rate=a(r.rate,v(r.id,`running`)>0?m:0,t,.8,o),o||(r.spin+=r.rate*t),e(r.el,`d`,c(g,`x`,r.at,r.r,r.s0,r.s1,r.spin,8)),i&&(r.hiss.draw(u(_,r.id,`valve_leak`)&&!o,n,g,r.relief,[.3,.8]),r.heat.draw(u(_,r.id,`bearing_wear`,`bearing_seizure`,`oil_degradation`)&&!o,n,g,r.crank),p(r.id,o?0:u(_,r.id,`bearing_seizure`)?.6:u(_,r.id,`bearing_wear`)?.3:0,n))},bar(e){let t=b.get(e);return t?s(v(e,`header_pressure`)/t.barFull):void 0},needle(e){let t=b.get(e);return t?v(t.id,`header_pressure`)/t.dialFull:void 0},deliveredPu(e){let t=_.param(e,`rated_cfm`,0);return t>0?s(v(e,`discharge_flow`)/t):0}}}export{p as n,h as t};
@@ -0,0 +1 @@
1
+ import{ot as e}from"./vendor-ui-D8j69UH4.js";import{t}from"./utils-XFKvwlFT.js";import{a as n}from"./use-engine-command-mutation-CHqjOqfS.js";var r=e(),i=`inline-flex items-center gap-1 rounded-[var(--miravo-radius-tight)] outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,a={live:`bg-success shadow-[0_0_0_1px_color-mix(in_srgb,var(--success)_50%,transparent),0_0_12px_color-mix(in_srgb,var(--success)_42%,transparent)]`,idle:`bg-warning/85 shadow-[0_0_0_1px_color-mix(in_srgb,var(--warning)_50%,transparent),0_0_12px_color-mix(in_srgb,var(--warning)_38%,transparent)]`,fault:`bg-destructive shadow-[0_0_0_1px_color-mix(in_srgb,var(--destructive)_50%,transparent),0_0_12px_color-mix(in_srgb,var(--destructive)_38%,transparent)]`,off:`bg-muted-foreground/55`};function o({tone:e,children:n,className:i}){return(0,r.jsxs)(`div`,{className:t(`flex shrink-0 items-center gap-2 rounded-[var(--miravo-radius-pill)] border border-border/60 bg-background/60 px-2.5 py-1 backdrop-blur-sm`,i),children:[(0,r.jsxs)(`span`,{className:`relative flex size-1.5 items-center justify-center`,children:[(0,r.jsx)(`span`,{className:t(`size-1.5 rounded-full`,a[e])}),e===`live`&&(0,r.jsx)(`span`,{className:`absolute inset-0 animate-ping rounded-full bg-success/60`})]}),(0,r.jsx)(`span`,{className:`text-[11px] leading-none text-muted-foreground`,children:n})]})}function s({children:e}){return(0,r.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.14em]`,children:e})}function c({icon:e,title:i,description:a,aside:o,footer:s,children:c,id:l,className:u,bodyClassName:d}){return(0,r.jsxs)(`section`,{id:l,tabIndex:l?-1:void 0,"aria-label":typeof i==`string`?i:void 0,className:t(n,`flex min-w-0 scroll-mt-4 flex-col outline-none hover:border-border`,u),children:[(0,r.jsxs)(`header`,{className:`flex items-start justify-between gap-3 border-b border-border/60 px-4 py-3`,children:[(0,r.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,r.jsx)(`div`,{className:`mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] border border-border/60 bg-background/70 text-muted-foreground`,"aria-hidden":!0,children:(0,r.jsx)(e,{className:`size-3.5`})}),(0,r.jsxs)(`div`,{className:`min-w-0`,children:[(0,r.jsx)(`h2`,{className:`font-heading text-sm font-semibold tracking-tight text-foreground`,children:i}),a?(0,r.jsx)(`p`,{className:`mt-0.5 text-pretty text-xs text-muted-foreground`,children:a}):null]})]}),o?(0,r.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:o}):null]}),c===void 0?null:(0,r.jsx)(`div`,{className:t(`flex min-w-0 flex-col px-4 py-4`,d),children:c}),s?(0,r.jsx)(`div`,{className:`mt-auto flex min-w-0 flex-wrap items-center gap-x-4 gap-y-2 border-t border-border/60 bg-background/40 px-4 py-2.5 text-xs text-muted-foreground`,children:s}):null]})}export{o as i,i as n,s as r,c as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./control-jNqzZWa9.js";export{e as ControlPage};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{ot as n}from"./vendor-ui-D8j69UH4.js";import{B as r,ot as i}from"./api-B2QJEzbS.js";import{t as a}from"./proxy-CWZabK8f.js";import{t as o}from"./AnimatePresence-BSSlw02V.js";import{i as s,r as c}from"./dist-xY0pK9Wy.js";import{a as l,i as u,n as d,o as f,r as p,t as m}from"./dialog-B5PqrKVw.js";import{n as h,r as g}from"./protocol-card-ARSwIjkN.js";import{C as _,S as ee,d as v,l as te}from"./format-Bx7DF-TB.js";import{n as y,t as b}from"./utils-XFKvwlFT.js";import{n as x}from"./server-BVem_egD.js";import{n as S}from"./circle-x-_o0nl0Rg.js";import{n as C,t as w}from"./sliders-horizontal-BNKmYQgd.js";import{t as T}from"./pause-CqW7v5Dc.js";import{t as E}from"./play-kg50os4l.js";import{t as ne}from"./rocket-KZ5oHK1G.js";import{t as re}from"./triangle-alert-DoAwrRgk.js";import{a as ie,n as ae,r as D,t as O}from"./validation-BkfmaBBi.js";import{i as oe,n as k,t as A}from"./tooltip-B3vOB1Vu.js";import{t as j}from"./badge-Bk1DaL6C.js";import{t as M}from"./label-2sIXTEUK.js";import{a as N,t as P}from"./use-engine-command-mutation-CHqjOqfS.js";import{i as F,n as I,r as L,t as R}from"./tabs-BbQkzBZZ.js";import{i as z,r as B,t as V}from"./console-panel-CMDoBJiO.js";import{a as H,c as U,i as W,l as G,n as K,o as q,r as se,s as J,t as ce}from"./combobox-B8h0-NHs.js";import{c as le,i as ue,n as de,s as fe,t as pe}from"./select-BWlrSYlA.js";var me=y(`octagon-alert`,[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]]),Y=y(`radio-tower`,[[`path`,{d:`M4.9 16.1C1 12.2 1 5.8 4.9 1.9`,key:`s0qx1y`}],[`path`,{d:`M7.8 4.7a6.14 6.14 0 0 0-.8 7.5`,key:`1idnkw`}],[`circle`,{cx:`12`,cy:`9`,r:`2`,key:`1092wv`}],[`path`,{d:`M16.2 4.8c2 2 2.26 5.11.8 7.47`,key:`ojru2q`}],[`path`,{d:`M19.1 1.9a9.96 9.96 0 0 1 0 14.1`,key:`rhi7fg`}],[`path`,{d:`M9.5 18h5`,key:`mfy3pd`}],[`path`,{d:`m8 22 4-11 4 11`,key:`25yftu`}]]),X=e(t(),1),Z=n();function he(){let{assets:e,models:t}=i(g(e=>({assets:e.assets,models:e.models}))),n=P(),[r,s]=(0,X.useState)(``),[c,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(``),f=(0,X.useMemo)(()=>u?e.filter(e=>e.id.toLowerCase().includes(u.toLowerCase())):e,[e,u]),p=(0,X.useMemo)(()=>{let n=e.find(e=>e.id===r);return n?t.find(e=>e.name===n.model)?.faultNames??[]:[]},[r,e,t]),m=(0,X.useMemo)(()=>e.filter(e=>e.activeFaults.length>0),[e]),h=m.reduce((e,t)=>e+t.activeFaults.length,0);return(0,Z.jsxs)(q,{className:`h-full min-w-0`,children:[(0,Z.jsx)(U,{className:`pb-3`,children:(0,Z.jsxs)(G,{className:`flex items-center gap-2 text-xs font-medium uppercase tracking-wider`,children:[(0,Z.jsx)(re,{className:`size-3.5 ${h>0?`text-destructive`:`text-muted-foreground`}`}),`Fault Lab`,(0,Z.jsx)(o,{children:h>0&&(0,Z.jsx)(a.div,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:`spring`,stiffness:500,damping:30},children:(0,Z.jsxs)(j,{variant:`destructive`,className:`text-[10px]`,children:[h,` active`]})},`fault-count`)})]})}),(0,Z.jsxs)(J,{className:`flex flex-1 flex-col gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,Z.jsxs)(ce,{value:r||null,onValueChange:e=>{s(e??``),l(``)},onInputValueChange:d,children:[(0,Z.jsx)(se,{placeholder:`Select asset`,"aria-label":`Fault asset`,className:`h-8 min-h-11 w-full min-w-0 touch-manipulation sm:min-h-8`,showClear:!!r}),(0,Z.jsx)(K,{children:(0,Z.jsxs)(H,{children:[f.map(e=>(0,Z.jsxs)(W,{value:e.id,children:[(0,Z.jsx)(`span`,{className:`font-mono`,children:e.id}),e.activeFaults.length>0&&(0,Z.jsx)(j,{variant:`destructive`,className:`ml-auto text-[10px]`,children:e.activeFaults.length})]},e.id)),f.length===0&&(0,Z.jsx)(`p`,{className:`py-2 text-center text-xs text-muted-foreground`,children:`No assets found`})]})})]}),(0,Z.jsxs)(pe,{value:c,onValueChange:e=>l(e??``),children:[(0,Z.jsx)(fe,{className:`h-8 min-h-11 w-full touch-manipulation sm:min-h-8`,"aria-label":`Fault type`,children:(0,Z.jsx)(le,{placeholder:r?`Select fault`:`Pick asset first`})}),(0,Z.jsx)(de,{alignItemWithTrigger:!1,align:`start`,children:p.map(e=>(0,Z.jsx)(ue,{value:e,children:e},e))})]})]}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Z.jsx)(_,{variant:`destructive`,size:`sm`,className:`h-7 min-h-11 touch-manipulation text-xs sm:min-h-7`,disabled:!r||!c,onClick:()=>{let e=D(O,{assetId:r,fault:c});e&&n.mutate({type:`triggerFault`,...e})},children:`Trigger`}),(0,Z.jsx)(_,{variant:`secondary`,size:`sm`,className:`h-7 min-h-11 touch-manipulation text-xs sm:min-h-7`,disabled:!r||!c,onClick:()=>{let e=D(O,{assetId:r,fault:c});e&&n.mutate({type:`clearFault`,...e})},children:`Clear`})]}),(0,Z.jsx)(ie,{}),(0,Z.jsx)(o,{mode:`wait`,initial:!1,children:m.length>0?(0,Z.jsxs)(a.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Faulted Assets`}),(0,Z.jsx)(o,{initial:!1,children:m.map(e=>(0,Z.jsx)(a.div,{initial:{opacity:0,x:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:6,transition:{duration:.1}},transition:{type:`spring`,stiffness:400,damping:35},children:(0,Z.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full touch-manipulation items-center justify-between rounded-[var(--miravo-radius-tight)] border border-destructive/20 bg-destructive/5 px-2.5 py-1.5 text-left transition-colors hover:bg-destructive/10 sm:min-h-0`,onClick:()=>{s(e.id),l(``)},children:[(0,Z.jsx)(`span`,{className:`truncate font-mono text-xs`,children:e.id}),(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-destructive`,children:e.activeFaults.join(`, `)})]})},e.id))})]},`faulted`):(0,Z.jsxs)(a.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`flex items-center gap-2 py-1 text-xs text-muted-foreground`,children:[(0,Z.jsx)(S,{className:`size-3.5 text-success`}),`All clear — no active faults`]},`all-clear`)})]})]})}function ge(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${i}s`:`${i}s`}function _e(e){if(!Number.isFinite(e)||e<=0)return`0s`;if(e<60)return`${e.toFixed(1)}s`;let t=Math.floor(e),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60),a=t%60;return n>0?r>0?`${n}d ${r}h`:i>0?`${n}d ${i}m`:`${n}d`:r>0?`${r}h ${i}m`:i>0?`${i}m ${a}s`:`${a}s`}function ve({data:e}){let t=(0,X.useMemo)(()=>{if(e.length<2)return null;let t=e.map(e=>e.tps),n=Math.max(...t,.1),r=Math.min(...t,0),i=n-r||1;return{points:t.map((e,n)=>{let a=n/(t.length-1)*200,o=2+(1-(e-r)/i)*28;return`${n===0?`M`:`L`}${a.toFixed(1)},${o.toFixed(1)}`}).join(` `),min:r,max:n}},[e]);return t?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsxs)(`svg`,{viewBox:`0 0 200 32`,className:`h-8 w-full`,preserveAspectRatio:`none`,role:`img`,"aria-label":`TPS trend sparkline`,children:[(0,Z.jsx)(`line`,{x1:`0`,y1:`10.7`,x2:`200`,y2:`10.7`,stroke:`currentColor`,strokeWidth:`0.5`,strokeDasharray:`3,2`,className:`text-border`}),(0,Z.jsx)(`line`,{x1:`0`,y1:`21.3`,x2:`200`,y2:`21.3`,stroke:`currentColor`,strokeWidth:`0.5`,strokeDasharray:`3,2`,className:`text-border`}),(0,Z.jsx)(`path`,{d:t.points,fill:`none`,stroke:`var(--primary)`,strokeWidth:`1.5`})]}),(0,Z.jsxs)(`div`,{className:`flex justify-between text-[9px] text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{children:[`60s ago · `,t.min.toFixed(1)]}),(0,Z.jsxs)(`span`,{children:[t.max.toFixed(1),` · now`]})]})]}):(0,Z.jsx)(`div`,{className:`flex h-8 items-center text-[10px] text-muted-foreground`,children:`Collecting...`})}var ye={running:`bg-success`,paused:`bg-warning`,idle:`bg-muted-foreground`,stopped:`bg-destructive`};function be({state:e}){let t=ye[e]??`bg-muted-foreground`,n=e===`running`;return(0,Z.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,Z.jsxs)(`div`,{className:`relative flex items-center justify-center`,children:[(0,Z.jsx)(`span`,{className:`size-2.5 rounded-full ${t}`}),n&&(0,Z.jsx)(`span`,{className:`absolute size-2.5 animate-ping rounded-full ${t} opacity-40`})]}),(0,Z.jsx)(o,{mode:`wait`,initial:!1,children:(0,Z.jsx)(a.span,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:5},transition:{type:`spring`,stiffness:500,damping:30},className:`font-mono text-lg font-bold uppercase tracking-wider`,children:e},e)})]})}function Q({label:e,tooltip:t,tooltipClassName:n}){return(0,Z.jsxs)(`div`,{className:`inline-flex w-fit min-w-0 max-w-full items-center gap-1`,children:[(0,Z.jsx)(`span`,{className:`blueprint-title min-w-0 shrink text-[11px] leading-tight text-muted-foreground`,children:e}),(0,Z.jsxs)(A,{children:[(0,Z.jsx)(oe,{className:`inline-flex size-4 shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] border-0 bg-transparent p-0 text-muted-foreground shadow-none outline-none hover:text-foreground focus-visible:ring-1 focus-visible:ring-ring`,render:(0,Z.jsx)(`button`,{type:`button`}),"aria-label":`About ${e}`,children:(0,Z.jsx)(x,{className:`size-3`,"aria-hidden":!0})}),(0,Z.jsx)(k,{side:`top`,className:b(`max-w-xs`,n),children:t})]})]})}function $(){let{engineState:e,connectionState:t}=i(g(e=>({engineState:e.engineState,connectionState:e.connectionState}))),n=P();return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(Q,{label:`Run state`,tooltip:(0,Z.jsx)(`p`,{className:`text-[11px] leading-snug`,children:`Whether the scheduler is running, paused, idle, or stopped. Pause freezes simulated time; resume continues from the same tick.`})}),(0,Z.jsx)(be,{state:e}),t===`live`&&(e===`running`||e===`paused`)&&(0,Z.jsx)(`div`,{className:`mt-1 flex items-center gap-2`,children:(0,Z.jsxs)(_,{type:`button`,size:`sm`,variant:e===`paused`?`default`:`outline`,className:b(`h-8 min-h-11 w-fit touch-manipulation gap-1.5 px-3 text-xs sm:min-h-8`,e===`running`&&`border-warning/40 bg-warning/10 text-warning hover:bg-warning/20 hover:text-warning focus-visible:border-warning/50 focus-visible:ring-warning/25 border-warning/35`),onClick:()=>n.mutate({type:e===`paused`?`resume`:`pause`}),children:[e===`paused`?(0,Z.jsx)(E,{className:`size-3`}):(0,Z.jsx)(T,{className:`size-3`}),e===`paused`?`Resume`:`Pause`]})})]})}function xe(){let{speedMultiplier:e,connectionState:t}=i(g(e=>({speedMultiplier:e.speedMultiplier,connectionState:e.connectionState}))),n=P(),[r,a]=(0,X.useState)(String(e)),o=t===`live`;return(0,X.useEffect)(()=>{a(String(e))},[e]),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(Q,{label:`Speed`,tooltip:(0,Z.jsx)(`p`,{className:`text-[11px] leading-snug`,children:`Runs the factory at this multiple of real time. 1× is real time; higher values speed up the model. Change it with the field and Set.`})}),(0,Z.jsxs)(`span`,{className:`w-fit font-mono text-lg font-bold tabular-nums`,children:[e,`x`]}),(0,Z.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Z.jsx)(M,{htmlFor:`speed-multiplier`,className:`sr-only`,children:`Speed multiplier`}),(0,Z.jsx)(ee,{id:`speed-multiplier`,type:`number`,value:r,onChange:e=>a(e.target.value),className:`h-8 min-h-11 w-[4.75rem] touch-manipulation font-mono text-xs tabular-nums sm:min-h-8`,min:`1`,max:`1000`,disabled:!o}),(0,Z.jsx)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-8 min-h-11 touch-manipulation px-3 text-xs sm:min-h-8`,disabled:!o,onClick:()=>{let e=D(ae,{multiplier:Number(r)});e&&n.mutate({type:`setSpeed`,multiplier:e.multiplier})},children:`Set`})]})]})}function Se(){let{tick:e,simulationTime:t,tps:n,tpsHistory:r,uptimeMs:a,assetCount:o,memberValueCount:s}=i(g(e=>({tick:e.tick,simulationTime:e.simulationTime,tps:e.tps,tpsHistory:e.tpsHistory,uptimeMs:e.uptimeMs,assetCount:e.assetCount,memberValueCount:e.memberValueCount})));return(0,Z.jsxs)(`div`,{className:b(N,`px-4 py-3`),children:[(0,Z.jsxs)(`header`,{className:`mb-3 border-b border-border/60 pb-2`,children:[(0,Z.jsx)(`h2`,{className:`font-heading text-sm font-semibold tracking-tight text-foreground`,children:`Engine vitals`}),(0,Z.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:`Scheduler, speed, cycle count, and throughput for this session.`})]}),(0,Z.jsxs)(`div`,{className:`grid min-w-0 grid-cols-2 gap-3 @2xl/main:gap-4 @3xl/main:grid-cols-3 @5xl/main:grid-cols-6`,children:[(0,Z.jsx)($,{}),(0,Z.jsx)(xe,{}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(Q,{label:`Cycle`,tooltipClassName:`flex flex-col items-start gap-2 text-left`,tooltip:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`text-[11px] leading-snug`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:`Cycle`}),` compares simulated progress with wall time: how many steps ran, how much model time advanced, and how long this session has been open.`]}),(0,Z.jsxs)(`p`,{className:`text-[11px] leading-snug`,children:[`The number is `,(0,Z.jsx)(`span`,{className:`font-medium`,children:`tick`}),` count — completed scheduler steps since this run. Each tick refreshes the plant model and live tags.`]}),(0,Z.jsxs)(`p`,{className:`text-[11px] leading-snug`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:`Sim`}),` is simulated elapsed time. Each tick adds (tick interval × speed) to this clock. Generators, lifecycle, and in-model timestamps use Sim, not your system clock. It stops advancing while paused.`]}),(0,Z.jsxs)(`p`,{className:`text-[11px] leading-snug`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:`Real`}),` is wall-clock uptime since the run started (real time).`]})]})}),(0,Z.jsx)(`span`,{className:`w-fit font-mono text-lg font-bold tabular-nums`,children:te(e)}),(0,Z.jsxs)(`div`,{className:`mt-1 flex w-full min-w-0 flex-col gap-0.5 leading-tight`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Z.jsx)(`span`,{className:`w-10 shrink-0 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Sim`}),(0,Z.jsx)(`span`,{className:`min-w-0 font-mono text-[10px] tabular-nums text-muted-foreground`,children:_e(t)})]}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Z.jsx)(`span`,{className:`w-10 shrink-0 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Real`}),(0,Z.jsx)(`span`,{className:`min-w-0 font-mono text-[10px] tabular-nums text-muted-foreground`,children:ge(a)})]})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(Q,{label:`Throughput`,tooltip:(0,Z.jsx)(`p`,{className:`text-[11px] leading-snug`,children:`Ticks per second: how fast the engine is stepping. Rises and falls with workload, speed setting, and CPU headroom.`})}),(0,Z.jsxs)(`span`,{className:`w-fit font-mono text-lg font-bold tabular-nums`,children:[n.toFixed(1),` tps`]}),(0,Z.jsxs)(`span`,{className:`mt-1 text-[10px] text-muted-foreground`,children:[o,` inst · `,v(s),` tags`]})]}),(0,Z.jsxs)(`div`,{className:`col-span-2 flex flex-col gap-2`,children:[(0,Z.jsx)(Q,{label:`TPS Trend`,tooltip:(0,Z.jsx)(`p`,{className:`text-[11px] leading-snug`,children:`Recent ticks-per-second samples over about the last minute. Flat or noisy lines usually mean load or speed changes.`})}),(0,Z.jsx)(ve,{data:r})]})]})]})}function Ce({enabled:e,total:t}){return(0,Z.jsxs)(z,{tone:t===0?`off`:e===0?`idle`:`live`,children:[(0,Z.jsx)(`span`,{className:`font-mono font-semibold tabular-nums text-foreground`,children:e}),(0,Z.jsx)(`span`,{className:`mx-1 text-muted-foreground/60`,children:`/`}),(0,Z.jsx)(`span`,{className:`font-mono tabular-nums`,children:t}),(0,Z.jsx)(`span`,{className:`ml-1.5`}),(0,Z.jsx)(B,{children:`active`})]})}function we(){let{availableAdapters:e,adapterMetrics:t}=i(g(e=>({availableAdapters:e.availableAdapters,adapterMetrics:e.adapterMetrics}))),n=e.filter(e=>e.enabled).length;return(0,Z.jsxs)(V,{icon:Y,title:`Protocol Gateway`,description:`Northbound adapters publishing engine telemetry to external systems.`,aside:(0,Z.jsx)(Ce,{enabled:n,total:e.length}),bodyClassName:`p-0`,children:[e.length>0&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-2 px-4 py-4`,children:(0,Z.jsx)(o,{children:e.map((e,n)=>{let r=t.find(t=>t.name===e.name)?.metrics;return(0,Z.jsx)(a.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0},transition:{type:`spring`,stiffness:380,damping:30,delay:n*.05},children:(0,Z.jsx)(h,{adapter:e,metrics:r})},e.name)})})}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2 border-t border-border/60 bg-background/40 px-4 py-2.5`,role:`status`,"aria-label":`Upcoming protocol adapters`,children:[(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,Z.jsx)(ne,{className:`size-3 text-muted-foreground/70`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:`Roadmap`})]}),(0,Z.jsx)(`span`,{className:`font-mono text-[10px] leading-[15px] tracking-tight text-muted-foreground`,children:`More protocols to come`})]})]})}function Te(){let{assets:e,templates:t}=i(g(e=>({assets:e.assets,templates:e.templates}))),n=P(),[r,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(!1);return(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,Z.jsxs)(q,{className:`min-w-0`,children:[(0,Z.jsx)(U,{className:`pb-3`,children:(0,Z.jsxs)(G,{className:`flex items-center gap-2 text-xs font-medium uppercase tracking-wider`,children:[(0,Z.jsx)(me,{className:`size-3.5 text-muted-foreground`,"aria-hidden":!0}),`Danger Zone`]})}),(0,Z.jsx)(J,{className:`flex flex-1 flex-col`,children:(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-3 rounded-[var(--miravo-radius-stadium-sm)] border border-dashed border-border p-3 @2xl/main:flex-row @2xl/main:items-center @2xl/main:justify-between`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:`Reset factory`}),(0,Z.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Unloads `,t.length,` template`,t.length===1?``:`s`,` and removes`,` `,e.length,` asset`,e.length===1?``:`s`,`, including standalone ones.`]})]}),(0,Z.jsx)(_,{className:`min-h-11 w-full shrink-0 touch-manipulation @2xl/main:w-auto sm:min-h-7`,variant:`destructive`,size:`sm`,onClick:()=>a(!0),children:`Reset`})]})})]}),(0,Z.jsx)(m,{open:r,onOpenChange:a,children:(0,Z.jsxs)(d,{children:[(0,Z.jsxs)(l,{children:[(0,Z.jsx)(f,{children:`Reset Factory`}),(0,Z.jsx)(p,{children:`Unloads every template and removes every asset, including standalone ones. With persistence on, the empty factory is saved and stays empty after a restart.`})]}),(0,Z.jsxs)(u,{children:[(0,Z.jsx)(_,{variant:`outline`,className:`min-h-11 w-full touch-manipulation sm:min-h-8 sm:w-auto`,onClick:()=>a(!1),disabled:o,children:`Cancel`}),(0,Z.jsx)(_,{variant:`destructive`,className:`min-h-11 w-full touch-manipulation sm:min-h-8 sm:w-auto`,disabled:o,onClick:async()=>{s(!0);try{await n.mutateAsync({type:`resetFactory`}),a(!1)}catch{}finally{s(!1)}},children:o?`Resetting...`:`Confirm Reset`})]})]})})]})}function Ee(){let[e,t]=s(`tab`,c([`monitor`,`operate`]).withDefault(`monitor`));return(0,Z.jsxs)(`div`,{className:`mx-auto flex w-full min-w-0 max-w-screen-2xl flex-col gap-5 p-4 sm:gap-6 sm:p-6`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`h1`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Mission Control`}),(0,Z.jsxs)(j,{variant:`outline`,title:`Miravo version ${r}`,className:`font-mono text-[10px] leading-none text-muted-foreground`,children:[`v`,r]})]}),(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Engine telemetry, protocol management, and fault operations.`})]}),(0,Z.jsxs)(R,{value:e,onValueChange:e=>{t(e)},className:`min-h-0 flex-1`,children:[(0,Z.jsx)(`div`,{className:`shrink-0 overflow-x-auto`,children:(0,Z.jsxs)(L,{variant:`line`,className:`h-10! min-w-max gap-0.5`,children:[(0,Z.jsxs)(F,{value:`monitor`,className:`gap-1.5 px-3 text-sm`,children:[(0,Z.jsx)(C,{className:`size-3.5 shrink-0`}),`Monitor`]}),(0,Z.jsxs)(F,{value:`operate`,className:`gap-1.5 px-3 text-sm`,children:[(0,Z.jsx)(w,{className:`size-3.5 shrink-0`}),`Operate`]})]})}),(0,Z.jsx)(I,{value:`monitor`,className:`flex-1 py-2`,children:(0,Z.jsxs)(a.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:`easeOut`},className:`flex flex-col gap-5 sm:gap-6`,children:[(0,Z.jsx)(Se,{}),(0,Z.jsx)(we,{})]},`monitor`)}),(0,Z.jsx)(I,{value:`operate`,className:`flex-1 py-2`,children:(0,Z.jsxs)(a.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:`easeOut`},className:`grid min-h-0 min-w-0 grid-cols-1 items-start gap-5 @2xl/main:grid-cols-2 @2xl/main:gap-4`,children:[(0,Z.jsx)(he,{}),(0,Z.jsx)(Te,{})]},`operate`)})]})]})}export{Y as n,Ee 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{ot as n}from"./vendor-ui-D8j69UH4.js";import{c as r}from"./dialog-B5PqrKVw.js";import{n as i,t as a}from"./utils-XFKvwlFT.js";import{t as o}from"./check-B-yvIfMj.js";import{i as s,n as c,t as l}from"./tooltip-B3vOB1Vu.js";var u=i(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),d=e(t(),1);function f(e,t){if(!t?.body||!t.createElement||typeof t.execCommand!=`function`)return!1;let n=t.createElement(`textarea`),r=t.activeElement;n.value=e,n.setAttribute(`readonly`,``),n.setAttribute(`aria-hidden`,`true`),n.style.position=`fixed`,n.style.top=`0`,n.style.left=`-9999px`,n.style.opacity=`0`,t.body.appendChild(n),n.focus(),n.select(),n.setSelectionRange(0,n.value.length);try{return t.execCommand(`copy`)}finally{t.body.removeChild(n),r?.focus?.()}}async function p(e,t=globalThis){let n=t.navigator?.clipboard?.writeText;if(n)try{await n(e);return}catch{if(f(e,t.document))return;throw Error(`Clipboard write failed`)}if(!f(e,t.document))throw Error(`Clipboard API unavailable`)}var m=n();function h({value:e,label:t=`Copy`,className:n,successMessage:i=`Copied to clipboard`,successDescription:f,tooltipSide:h=`right`,render:g}){let[_,v]=(0,d.useState)(!1),y=(0,d.useRef)(void 0);(0,d.useEffect)(()=>()=>clearTimeout(y.current),[]);let b=(0,d.useCallback)(async t=>{t.stopPropagation();try{await p(e),v(!0),r.success(i,{description:f}),clearTimeout(y.current),y.current=setTimeout(()=>v(!1),1500)}catch{r.error(`Failed to copy`)}},[f,i,e]),x=_?(0,m.jsx)(o,{className:`size-3 text-success`}):(0,m.jsx)(u,{className:`size-3`}),S=g?.({copied:_,icon:x});return(0,m.jsxs)(l,{children:[(0,m.jsx)(s,{className:S?void 0:a(`relative inline-flex size-6 items-center justify-center rounded-[var(--miravo-radius-tight)] text-muted-foreground hover:bg-muted hover:text-foreground before:absolute before:inset-[-10px] before:content-['']`,n),onClick:b,closeOnClick:!1,"aria-label":t,render:S,children:x}),(0,m.jsx)(c,{side:h,children:_?`Copied!`:t})]})}export{h as t};