@synnaxlabs/pluto 0.28.4 → 0.29.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 (141) hide show
  1. package/README.md +1 -1
  2. package/dist/{Animated-e4uMRKwj.js → Animated-BRUqvVsW.js} +2 -2
  3. package/dist/{Animated-E__GTTTG.cjs → Animated-DbOFofnA.cjs} +1 -1
  4. package/dist/{Keyboard-BhVmFFcl.js → Keyboard-BpXlLck_.js} +2 -2
  5. package/dist/{Keyboard-D3mL0Zj8.cjs → Keyboard-X_-hpfg9.cjs} +1 -1
  6. package/dist/LinePlot-B51qhAb1.cjs +66 -0
  7. package/dist/{LinePlot-BK8esSwO.js → LinePlot-CtIZPK_F.js} +2292 -2247
  8. package/dist/{Link-5Ul3dBhL.js → Link-CrB722xh.js} +1 -1
  9. package/dist/{Link-DacxhXPG.cjs → Link-TUMI2ARc.cjs} +1 -1
  10. package/dist/{List-BF7beadf.js → List-BI_89AyO.js} +2 -2
  11. package/dist/{List-UfPZeEyc.cjs → List-Cgx098Ae.cjs} +1 -1
  12. package/dist/{Pack-BNnq0Pnk.cjs → Pack-BgzS2BHo.cjs} +1 -1
  13. package/dist/{Pack-CcDPYCmE.js → Pack-l3j3YWpE.js} +4 -2
  14. package/dist/{Toggle-B5c5wLIa.js → Toggle-3WohopP9.js} +7899 -7847
  15. package/dist/Toggle-B8cAGDWx.cjs +143 -0
  16. package/dist/{Video-CA6Au-LV.js → Video-Ciw4h8eF.js} +1 -1
  17. package/dist/{Video-Ch_mMn__.cjs → Video-JYqTPKDk.cjs} +1 -1
  18. package/dist/{aggregator-J7DZKy5x.js → aggregator-BpQMir30.js} +1971 -1975
  19. package/dist/{aggregator-C5NNOlCt.cjs → aggregator-CoVqjgd_.cjs} +28 -28
  20. package/dist/align.cjs +1 -1
  21. package/dist/align.js +1 -1
  22. package/dist/button.cjs +1 -1
  23. package/dist/button.js +1 -1
  24. package/dist/color.cjs +1 -1
  25. package/dist/color.js +1 -1
  26. package/dist/css-Cc1vb61S.cjs +1 -0
  27. package/dist/{css-BHfxGWOW.js → css-CiSR0WsA.js} +10 -10
  28. package/dist/css.cjs +1 -1
  29. package/dist/css.js +2 -2
  30. package/dist/dropdown.cjs +1 -1
  31. package/dist/dropdown.js +1 -1
  32. package/dist/ether.cjs +1 -1
  33. package/dist/ether.js +33 -32
  34. package/dist/{external-BNK-Ar1a.cjs → external--UUIWzFw.cjs} +1 -1
  35. package/dist/{external-D8Ek2KlK.cjs → external-Ahp3C6QS.cjs} +1 -1
  36. package/dist/{external-1UbQK-gE.js → external-B4LzaEYW.js} +4 -4
  37. package/dist/{external-D6UV0Kg7.cjs → external-BFldRd_W.cjs} +1 -1
  38. package/dist/{external-BKdSRjD9.js → external-BICFLjgD.js} +5 -5
  39. package/dist/{external-DQ3_QbC3.cjs → external-BXXNOCb0.cjs} +1 -1
  40. package/dist/{external-Cv1PHg1z.js → external-B_mVlkww.js} +1 -1
  41. package/dist/{external-BCVvWczs.cjs → external-Clb-pmsS.cjs} +1 -1
  42. package/dist/{external-D4LqxMnz.js → external-CnWUVmQS.js} +2 -2
  43. package/dist/{external-CKnDDP8u.cjs → external-CqQG_X0V.cjs} +1 -1
  44. package/dist/{external-NPFKR0s7.cjs → external-D1HsngQj.cjs} +1 -1
  45. package/dist/{external-DSaMHj0l.js → external-D1KK9_Hu.js} +2 -2
  46. package/dist/{external-COUlw2hk.js → external-D8r96cqI.js} +5 -5
  47. package/dist/{external-BaQx1Ppf.js → external-DMdyqHe5.js} +4 -4
  48. package/dist/{external-CVIiAxAn.cjs → external-DY38DhOK.cjs} +1 -1
  49. package/dist/{external-BtMF07eP.js → external-DYr-TNbF.js} +7 -7
  50. package/dist/{external-Cn3ddBfz.cjs → external-Dckibeci.cjs} +1 -1
  51. package/dist/{external-UXw3IMWv.js → external-DmgHQYvn.js} +4 -4
  52. package/dist/{external-BH8CIUWK.js → external-DnVHgC7D.js} +3 -3
  53. package/dist/{external-CbeV5FZI.js → external-Dst1oSuM.js} +7 -7
  54. package/dist/{external-CEUEDiz0.cjs → external-GQjdWsOX.cjs} +1 -1
  55. package/dist/{external-DQczkG9j.cjs → external-Lmkzu-RE.cjs} +1 -1
  56. package/dist/{external-BpF04wV3.js → external-rB_b8uvo.js} +4 -4
  57. package/dist/{external-CkJO9AWA.cjs → external-tnXiEaTc.cjs} +1 -1
  58. package/dist/header.cjs +1 -1
  59. package/dist/header.js +1 -1
  60. package/dist/index.cjs +1 -1
  61. package/dist/index.js +2341 -2265
  62. package/dist/input.cjs +1 -1
  63. package/dist/input.js +1 -1
  64. package/dist/list.cjs +1 -1
  65. package/dist/list.js +1 -1
  66. package/dist/menu.cjs +1 -1
  67. package/dist/menu.js +1 -1
  68. package/dist/src/aether/aether/aether.d.ts.map +1 -1
  69. package/dist/src/align/Pack.d.ts.map +1 -1
  70. package/dist/src/breadcrumb/Breadcrumb.d.ts +6 -1
  71. package/dist/src/breadcrumb/Breadcrumb.d.ts.map +1 -1
  72. package/dist/src/icon/Icon.d.ts +1 -1
  73. package/dist/src/input/DragButton.d.ts.map +1 -1
  74. package/dist/src/menu/ContextMenu.d.ts +2 -2
  75. package/dist/src/menu/ContextMenu.d.ts.map +1 -1
  76. package/dist/src/pluto/aether/pluto.d.ts.map +1 -1
  77. package/dist/src/status/aether/aggregator.d.ts.map +1 -1
  78. package/dist/src/status/aether/types.d.ts.map +1 -1
  79. package/dist/src/synnax/aether/provider.d.ts +18 -18
  80. package/dist/src/synnax/aether/provider.d.ts.map +1 -1
  81. package/dist/src/telem/aether/remote.d.ts.map +1 -1
  82. package/dist/src/telem/aether/transformers.d.ts.map +1 -1
  83. package/dist/src/telem/control/aether/chip.d.ts +12 -12
  84. package/dist/src/telem/control/aether/chip.d.ts.map +1 -1
  85. package/dist/src/telem/control/aether/indicator.d.ts.map +1 -1
  86. package/dist/src/telem/control/aether/legend.d.ts.map +1 -1
  87. package/dist/src/telem/control/aether/state.d.ts.map +1 -1
  88. package/dist/src/tooltip/wrap.d.ts.map +1 -1
  89. package/dist/src/triggers/Text.d.ts.map +1 -1
  90. package/dist/src/vis/canvas/aether/canvas.d.ts.map +1 -1
  91. package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
  92. package/dist/src/vis/diagram/aether/Diagram.d.ts.map +1 -1
  93. package/dist/src/vis/diagram/aether/types.d.ts.map +1 -1
  94. package/dist/src/vis/diagram/edge/connector/connector.d.ts.map +1 -1
  95. package/dist/src/vis/draw2d/canvas.d.ts +1 -1
  96. package/dist/src/vis/draw2d/canvas.d.ts.map +1 -1
  97. package/dist/src/vis/eraser/aether/eraser.d.ts.map +1 -1
  98. package/dist/src/vis/legend/Container.d.ts.map +1 -1
  99. package/dist/src/vis/light/aether/index.d.ts +2 -0
  100. package/dist/src/vis/light/aether/index.d.ts.map +1 -0
  101. package/dist/src/vis/light/aether/light.d.ts +112 -0
  102. package/dist/src/vis/light/aether/light.d.ts.map +1 -0
  103. package/dist/src/vis/light/index.d.ts +2 -0
  104. package/dist/src/vis/light/index.d.ts.map +1 -0
  105. package/dist/src/vis/light/use.d.ts +9 -0
  106. package/dist/src/vis/light/use.d.ts.map +1 -0
  107. package/dist/src/vis/lineplot/aether/LinePlot.d.ts.map +1 -1
  108. package/dist/src/vis/lineplot/aether/axis.d.ts.map +1 -1
  109. package/dist/src/vis/lineplot/range/aether/annotation.d.ts.map +1 -1
  110. package/dist/src/vis/lineplot/range/aether/provider.d.ts +40 -40
  111. package/dist/src/vis/lineplot/range/aether/provider.d.ts.map +1 -1
  112. package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts.map +1 -1
  113. package/dist/src/vis/measure/aether/measure.d.ts.map +1 -1
  114. package/dist/src/vis/schematic/Forms.d.ts +1 -5
  115. package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
  116. package/dist/src/vis/schematic/Symbols.d.ts +15 -14
  117. package/dist/src/vis/schematic/Symbols.d.ts.map +1 -1
  118. package/dist/src/vis/schematic/primitives/Primitives.d.ts +13 -16
  119. package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +1 -1
  120. package/dist/src/vis/schematic/registry.d.ts.map +1 -1
  121. package/dist/src/vis/value/aether/value.d.ts.map +1 -1
  122. package/dist/src/vis/value/use.d.ts.map +1 -1
  123. package/dist/style.css +1 -1
  124. package/dist/tabs.cjs +1 -1
  125. package/dist/tabs.js +1 -1
  126. package/dist/text.cjs +1 -1
  127. package/dist/text.js +2 -2
  128. package/dist/theming.cjs +1 -1
  129. package/dist/theming.js +2 -2
  130. package/dist/tree.cjs +1 -1
  131. package/dist/tree.js +1 -1
  132. package/dist/triggers.cjs +1 -1
  133. package/dist/triggers.js +1 -1
  134. package/dist/{units-t-SdMRna.js → units-BAK8qzqy.js} +1 -1
  135. package/dist/{units-CKv8dczK.cjs → units-C59nowP2.cjs} +1 -1
  136. package/dist/video.cjs +1 -1
  137. package/dist/video.js +1 -1
  138. package/package.json +20 -20
  139. package/dist/LinePlot-D-BHnuDg.cjs +0 -66
  140. package/dist/Toggle-C-n_Itw1.cjs +0 -143
  141. package/dist/css-C4GOlJsi.cjs +0 -1
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var Lo=Object.defineProperty;var Mo=(e,t,s)=>t in e?Lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var Se=(e,t,s)=>Mo(e,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-Cek9Ww4S.cjs"),x=require("react"),c=require("./Toggle-C-n_Itw1.cjs"),l=require("./css-C4GOlJsi.cjs"),Ue=require("./external-D6UV0Kg7.cjs"),y=require("./aggregator-C5NNOlCt.cjs"),D=require("./Pack-BNnq0Pnk.cjs"),$o=require("./external-BCVvWczs.cjs"),_o=require("./external-BNK-Ar1a.cjs"),No=require("./Animated-E__GTTTG.cjs"),j=require("./LinePlot-D-BHnuDg.cjs"),le=require("zod"),_t=require("./external-CEUEDiz0.cjs"),ue=require("./external-CKnDDP8u.cjs"),Nt=require("./external-Cn3ddBfz.cjs"),Bo=require("./external-DQczkG9j.cjs"),Bt=require("react-dom"),_e=require("./external-CVIiAxAn.cjs"),Es=require("./units-CKv8dczK.cjs"),pe=require("./external-DQ3_QbC3.cjs"),Q=require("./external-NPFKR0s7.cjs"),zo=require("./external-D8Ek2KlK.cjs"),Oo=require("./external-CkJO9AWA.cjs"),Do=require("./Video-Ch_mMn__.cjs"),Rs=({variant:e,...t})=>n.jsxRuntimeExports.jsx(c.St.Circle,{color:c.variantColors[e],...t}),Ao=({status:{key:e,time:t,count:s,message:r,description:o,variant:i},silence:u,actions:a,className:d,children:p,...m})=>n.jsxRuntimeExports.jsxs(D.Space,{className:l.CSS(l.CSS.B("notification"),d),direction:"y",empty:!0,...m,children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",size:"small",children:[n.jsxRuntimeExports.jsx(Rs,{style:{height:"2.25rem",width:"2.5rem"},variant:i}),n.jsxRuntimeExports.jsx(c.Text,{level:"small",shade:7,children:`x${s}`}),n.jsxRuntimeExports.jsx(c.DateTime,{className:l.CSS(l.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),n.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS(l.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>u(e),children:n.jsxRuntimeExports.jsx(c.St.Close,{})})]}),n.jsxRuntimeExports.jsxs(D.Space,{direction:"y",align:"start",className:l.CSS(l.CSS.BE("notification","content")),size:"small",children:[p??n.jsxRuntimeExports.jsx(c.Text,{className:l.CSS(l.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:r}),o!=null&&n.jsxRuntimeExports.jsx(c.Text,{className:l.CSS(l.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:o})]}),a!=null&&n.jsxRuntimeExports.jsx(D.Space,{direction:"x",align:"center",justify:"end",className:l.CSS(l.CSS.BE("notification","actions")),children:y.A(a).map(f=>n.jsxRuntimeExports.jsx(Vo,{action:f},f.key))})]},t.toString()),Vo=({action:e})=>{if(!x.isValidElement(e)){const t=e;return n.jsxRuntimeExports.jsx(c.Button,{...t})}return e},Io=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:c.Aggregator,Circle:Rs,Notification:Ao,Text:c.Text$2,VARIANTS:y.VARIANTS,specZ:y.specZ$1,useAggregator:c.useAggregator,useContext:c.useContext$2,useNotifications:c.useNotifications,variantZ:y.variantZ},Symbol.toStringTag,{value:"Module"})),Zo=Object.freeze(Object.defineProperty({__proto__:null,Config:c.Config,Context:c.Context,Dialog:c.Dialog$1,chooseLocation:c.chooseLocation,formatTip:c.formatTip,useConfig:c.useConfig,wrap:c.wrap},Symbol.toStringTag,{value:"Module"})),Je=e=>e.preventDefault(),at=x.forwardRef(({location:e,style:t,size:s,className:r,children:o,onDragStart:i,sizeUnits:u="px",showHandle:a=!0,...d},p)=>{const m=l.J.construct(e),f=l.J.direction(m),S=l.g.dimension(f);return n.jsxRuntimeExports.jsxs("div",{className:l.CSS(l.CSS.B("resize"),l.CSS.loc(m),l.CSS.dir(f),r),style:{[S]:`${s}${u}`,...t},ref:p,...d,children:[o,a&&n.jsxRuntimeExports.jsx("div",{draggable:!0,className:l.CSS(l.CSS.BE("resize","handle"),l.CSS.bordered(l.J.swap(m))),onDragStart:i,onDrag:Je,onDragEnd:Je})]})});at.displayName="Resize.Core";const zt=({onResize:e,count:t,initialSizes:s=[],minSize:r=100,direction:o="x"})=>{const i=x.useRef(null),[u,a]=x.useState({sizeDistribution:Fo(s,t),root:null}),d=x.useCallback((f,S,h)=>{if(i.current==null)return;const R=l.To.dim(l.To.construct(i.current),o);a(E=>Et(E,R,f,r,S,h))},[r,a,o]);x.useEffect(()=>e==null?void 0:e(u.sizeDistribution),[u.sizeDistribution,e]);const p=x.useCallback((f,S)=>{f.preventDefault();const h=o==="x"?"clientX":"clientY",R=w=>d(S,w[h]),E=()=>{a(w=>({...w,root:null})),document.removeEventListener("mousemove",R)};a(w=>({...w,root:f[h]})),document.addEventListener("mousemove",R),document.addEventListener("mouseup",E,{once:!0})},[a,o,Et]);return{setSize:x.useCallback((f,S)=>d(f,void 0,S),[Et]),props:{direction:o,sizeDistribution:u.sizeDistribution,onDragHandle:p,ref:i}}},ut=x.forwardRef(({direction:e="x",children:t,sizeDistribution:s,onDragHandle:r,className:o,...i},u)=>{const a=l.g.construct(e),d=x.Children.toArray(t);return s=qo(s),n.jsxRuntimeExports.jsx(D.Space,{...i,ref:u,direction:a,className:l.CSS(l.CSS.B("resize-multiple"),o),empty:!0,grow:!0,children:d.map((p,m)=>n.jsxRuntimeExports.jsx(at,{onDragStart:f=>r(f,m),location:l.g.location(a),size:s[m]*100,sizeUnits:"%",showHandle:m!==d.length-1,children:p},m))})});ut.displayName="Resize.Multiple";const Fo=(e,t)=>{const s=e.reduce((o,i)=>o+i,0),r=t-e.length;if(r<=0)return e.slice(0,t).map(o=>o/s);if(e.every(o=>o<=1)){const o=1-s;return[...e,...Array(r).fill(o/r)]}return e.map(()=>1/t)},gt=.001,qo=e=>e.every(t=>l.C$1.closeTo(t,1/e.length),gt)?e.map((t,s)=>s%2===0?t+gt:s===e.length-1?t:t-gt):e,Et=(e,t,s,r,o,i)=>{const u=ys(e,t,s,o,i),[a,d]=Ho(e.sizeDistribution,s,u,r/t),p=d?o??null:e.root;return{...e,sizeDistribution:a,root:p}},ys=(e,t,s,r,o)=>{let i;if(o!=null)o>1&&(o=o/t),i=o-e.sizeDistribution[s];else if(r!=null){if(e.root===null)throw new Error("resize root is null during handle drag");i=(r-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return i},Ho=(e,t,s,r)=>{let o=t;for(;o>0&&e[o]+s<=r;)o--;const i=e[o]+s,u=Yo(o,e,r,s),a=e[u]-s;return i<r||a<r?[e,!1]:[e.map((d,p)=>p===o?i:p===u?a:d),!0]},Yo=(e,t,s,r)=>(e===t.length-1?Uo:Go)(e,t,s,r),Go=(e,t,s,r)=>{let o=e+1;for(;o<t.length-1&&t[o]-r<=s;)o++;return o},Uo=(e,t,s,r)=>{let o=e-1;for(;o>0&&t[o]-r<=s;)o--;return o},xt=({onMove:e,onStart:t,onEnd:s})=>x.useCallback(r=>{r.preventDefault();const o=l.q.construct(r),i=c.mouseKey(r.button);t==null||t(o,i,r);const u=d=>{if(d.buttons===0)return a(d);const p=l.q.construct(d);e==null||e(l.To.construct(o,p),i,d)};window.addEventListener("mousemove",u);const a=d=>{window.removeEventListener("mousemove",u);const p=l.q.construct(d);s==null||s(l.To.construct(o,p),i,d)};window.addEventListener("mouseup",a,{once:!0})},[e,t,s]),Rt=2,Cs=({onCollapse:e,onResize:t,location:s="left",minSize:r=100,maxSize:o=1/0,initialSize:i=200,collapseThreshold:u=1/0,className:a,...d})=>{const[p,m]=x.useState(l.j(i,r,o)),f=x.useRef(null),S=l.J.construct(s),h=x.useCallback(_=>{if(f.current===null)return 0;const T=l.To.dim(_,l.J.direction(S),!0)*(1-2*Number(["bottom","right"].includes(S))),g=f.current+T,v=l.j(g,r,o);return(v-g)/r>u?Rt:v},[S,r,o,u]),R=x.useRef(null),E=x.useCallback(_=>{const T=h(_);m(T),R.current!=null&&(t==null||t(T,l.To.construct(R.current)))},[t,h]),w=x.useCallback(()=>m(_=>(f.current=_,_)),[m]),M=x.useCallback(_=>h(_)===Rt&&(e==null?void 0:e()),[e,h]);x.useEffect(()=>m(_=>{const T=l.j(_,r,o);return f.current=T,T}),[r,o]);const $=xt({onMove:E,onStart:w,onEnd:M});return n.jsxRuntimeExports.jsx(at,{ref:R,location:S,size:p,onDragStart:$,className:l.clsx(a,l.CSS.expanded(p!==Rt)),...d})},Wo=Object.freeze(Object.defineProperty({__proto__:null,Core:at,Multiple:ut,Single:Cs,calculateDiffPercentage:ys,useMultiple:zt},Symbol.toStringTag,{value:"Module"})),We="y",is=28,Xo=32,Ko=40,Jo=.5,Qo=({data:e,...t})=>{const{setSize:s,props:{sizeDistribution:r,ref:o,...i}}=zt({direction:We,count:e.length,minSize:is}),u=a=>{if(o.current==null)return;const d=l.To.dim(l.To.construct(o.current),We);r[a]<Ko/d?s(a,e[a].initialSize??Jo):s(a,is+1)};return n.jsxRuntimeExports.jsx(ut,{empty:!0,className:l.CSS.B("accordion"),sizeDistribution:r,ref:o,...t,...i,children:e.map((a,d)=>x.createElement(sl,{...a,key:a.key,index:d,direction:We,onExpand:u,parent:o,size:r[d]}))})},el=n.jsxRuntimeExports.jsx(c.St.Caret.Down,{"aria-label":"contract"}),tl=n.jsxRuntimeExports.jsx(c.St.Caret.Right,{"aria-label":"expand"}),sl=({index:e,name:t,content:s,actions:r,size:o,parent:i,onExpand:u})=>{let a=!0;if(i.current!=null){const p=l.To.dim(l.To.construct(i.current),We);a=o*p>Xo}const d=a?el:tl;return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsxs(Ue.Header,{level:"p",className:l.CSS.expanded(a),empty:!0,children:[n.jsxRuntimeExports.jsx(Ue.ButtonTitle,{startIcon:d,onClick:()=>u(e),children:t}),r!=null&&n.jsxRuntimeExports.jsx(Ue.Actions,{children:r})]}),s]})},nl=Object.freeze(Object.defineProperty({__proto__:null,Accordion:Qo},Symbol.toStringTag,{value:"Module"})),rl=({children:e,icon:t,shade:s=7,weight:r=450,size:o=.5,level:i="p",separator:u=".",className:a,hideFirst:d=!1,...p})=>{let m;if(t)if(c.isValidElement(t))m=t;else{const h=y._.get(c.St,t);m=n.jsxRuntimeExports.jsx(h,{})}const S=y.A(e).map(h=>h.split(u)).flat().map((h,R)=>[n.jsxRuntimeExports.jsx(c.St.Caret.Right,{style:{transform:"scale(0.8) translateY(1px)",color:l.CSS.shade(s)}},`${h}-${R}`),h]).flat();return d&&S.shift(),n.jsxRuntimeExports.jsxs(c.WithIcon,{className:l.CSS(a,l.CSS.B("breadcrumb")),level:i,shade:s,weight:r,size:o,...p,children:[m,...S]})},ol=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:rl},Symbol.toStringTag,{value:"Module"})),Ot=x.createContext(j.ZERO_CONTEXT_VALUE),fe=()=>x.useContext(Ot).synnax,ll=()=>x.useContext(Ot).state,cs={connected:"success",connecting:"info",disconnected:"info",failed:"error"},bs="serverVersionMismatch",il=(e,t,s)=>`Cluster version ${s!=null?s+" ":""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,vs=c.wrap$1(j.Provider.TYPE,({aetherKey:e,connParams:t,children:s})=>{const[r,o,i]=c.useCombinedStateAndRef(j.ZERO_CONTEXT_VALUE),[{path:u},,a]=c.use$3({aetherKey:e,type:j.Provider.TYPE,schema:j.Provider.stateZ,initialState:{props:t??null,state:null}}),d=c.useAggregator(),p=x.useCallback(m=>{i.current.state.status!==m.status&&d({variant:cs[m.status],message:m.message??l._.capitalize(m.status)}),o(f=>({...f,state:m}))},[d]);return c.useAsyncEffect(async()=>{if(r.synnax!=null&&r.synnax.close(),t==null)return o(j.ZERO_CONTEXT_VALUE);const m=new y.Ay({...t,connectivityPollFrequency:y.N.seconds(5)});o({synnax:m,state:{clusterKey:"",status:"connecting",message:"Connecting...",clientServerCompatible:!1,clientVersion:m.clientVersion}});const f=await m.connectivity.check();if(o({synnax:m,state:f}),d({variant:cs[f.status],message:f.message??f.status.toUpperCase()}),f.status==="connected"&&!f.clientServerCompatible){const S=f.nodeVersion==null||y.W.semVerOlder(f.nodeVersion,f.clientVersion),h=il(S,f.clientVersion,f.nodeVersion);d({variant:"warning",message:"Incompatible cluster version",description:h,data:{type:bs,oldServer:S,nodeVersion:f.nodeVersion,clientVersion:f.clientVersion}})}return m.connectivity.onChange(p),a({props:t,state:f}),()=>{m.close(),o(j.ZERO_CONTEXT_VALUE),a({props:null,state:null})}},[t,p]),n.jsxRuntimeExports.jsx(Ot.Provider,{value:r,children:n.jsxRuntimeExports.jsx(c.Composite,{path:u,children:s})})}),cl=Object.freeze(Object.defineProperty({__proto__:null,Provider:vs,SERVER_VERSION_MISMATCH:bs,use:fe,useConnectionState:ll},Symbol.toStringTag,{value:"Module"})),Ne=x.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),ws=()=>x.useContext(Ne),Ts=e=>{const{aliases:t}=x.useContext(Ne);return t[e]??null},dt=()=>{const{aliases:e}=x.useContext(Ne);return e},mt=(e,t="")=>{const{getName:s}=x.useContext(Ne),[r,o]=x.useState(t);return c.useAsyncEffect(async()=>{const i=await s(e);i!=null&&o(i)},[e,s]),r??t},Dt=()=>{const{activeRange:e}=x.useContext(Ne);return e??void 0},ks=({activeRange:e,children:t})=>{const s=fe(),[r,o]=x.useState({}),i=x.useCallback(d=>{o(p=>{const m={...p};return d.forEach(({variant:f,key:S,value:h})=>{const R=Number(S.split("---")[1]);f==="delete"?delete m[R]:m[h.channel]=h.alias}),m})},[o]),u=x.useCallback(async(d,p)=>{if(s==null||e==null)return;await(await s.ranges.retrieve(e)).setAlias(d,p)},[s,e]),a=x.useCallback(async d=>{if(s==null||d===0)return;const p=r[d];return p??(await s.channels.retrieve(d)).name},[r,s]);return c.useAsyncEffect(async()=>{if(s==null||e==null){o({});return}const d=await s.ranges.retrieve(e),p=await d.listAliases();o(p);const m=await d.openAliasTracker(),f=m.onChange(i);return()=>{f(),m.close()}},[s,e]),n.jsxRuntimeExports.jsx(Ne.Provider,{value:{aliases:r,activeRange:e,setAlias:e!=null?u:null,getName:a},children:t})},al=({channelKey:e,value:t,shadow:s,className:r,...o})=>{const[i,u]=x.useState(!1),{setAlias:a}=ws(),d=Ts(e),p=mt(e);let m=n.jsxRuntimeExports.jsx(c.St.Rename,{});i?m=n.jsxRuntimeExports.jsx(c.St.Loading,{}):d===t&&(m=n.jsxRuntimeExports.jsx(c.St.Check,{}));const f=a!=null&&!i&&d!==t&&e!==0,S=()=>{f&&(async()=>(u(!0),await a(e,t),u(!1)))()},h=()=>{var E;d!=null&&((E=o.onChange)==null||E.call(o,d))},R=()=>e===0?n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):a==null?n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):d===t?n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Alias synced with this label"}):n.jsxRuntimeExports.jsxs(c.Text,{level:"small",children:["Sync alias for ",p," with this label"]});return n.jsxRuntimeExports.jsxs(c.Text$1,{value:t,...o,children:[f&&n.jsxRuntimeExports.jsx(c.Icon,{onClick:h,tooltip:n.jsxRuntimeExports.jsxs(c.Text,{level:"small",children:["Set ",p," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:n.jsxRuntimeExports.jsx(c.St.Sync,{})}),n.jsxRuntimeExports.jsx(c.Icon,{onClick:S,disabled:!f,tooltip:n.jsxRuntimeExports.jsx(R,{}),tooltipLocation:{y:"top"},variant:"outlined",children:m})]})},ge="channel",ul=Object.freeze(Object.defineProperty({__proto__:null,Canvas:j.Canvas,axisStateZ:j.axisStateZ,newTickFactory:j.newTickFactory,tickFactoryProps:j.tickFactoryProps,tickType:j.tickType},Symbol.toStringTag,{value:"Module"})),xl=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:j.AcquireChannelControl,AuthoritySource:j.AuthoritySource,Chip:j.Chip,Controller:j.Controller$1,Indicator:j.Indicator,Legend:j.Legend,REGISTRY:j.REGISTRY$3,STATUSES:j.STATUSES,SetChannelValue:j.SetChannelValue,StateProvider:j.StateProvider,acquireChannelControl:j.acquireChannelControl,acquireChannelControlPropsZ:j.acquireChannelControlPropsZ,authoritySource:j.authoritySource,authoritySourceProps:j.authoritySourceProps,chipStateZ:j.chipStateZ,controllerStateZ:j.controllerStateZ,indicatorStateZ:j.indicatorStateZ,legendStateZ:j.legendStateZ,setChannelValue:j.setChannelValue,setChannelValuePropsZ:j.setChannelValuePropsZ,stateProviderStateZ:j.stateProviderStateZ,statusZ:j.statusZ,sugaredStateZ:j.sugaredStateZ},Symbol.toStringTag,{value:"Module"}));var je;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(je||(je={}));function dl({color:e,dimensions:t,lineWidth:s}){return x.createElement("path",{stroke:e,strokeWidth:s,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function ml({color:e,radius:t}){return x.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const pl={[je.Dots]:"#91919a",[je.Lines]:"#eee",[je.Cross]:"#e2e2e2"},jl={[je.Dots]:1,[je.Lines]:1,[je.Cross]:6},fl=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Ps({id:e,variant:t=je.Dots,gap:s=20,size:r,lineWidth:o=1,offset:i=2,color:u,style:a,className:d}){const p=x.useRef(null),{transform:m,patternId:f}=j.useStore(fl,j.shallow$1),S=u||pl[t],h=r||jl[t],R=t===je.Dots,E=t===je.Cross,w=Array.isArray(s)?s:[s,s],M=[w[0]*m[2]||1,w[1]*m[2]||1],$=h*m[2],_=E?[$,$]:M,T=R?[$/i,$/i]:[_[0]/i,_[1]/i];return x.createElement("svg",{className:j.cc(["react-flow__background",d]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:p,"data-testid":"rf__background"},x.createElement("pattern",{id:f+e,x:m[0]%M[0],y:m[1]%M[1],width:M[0],height:M[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`},R?x.createElement(ml,{color:S,radius:$/i}):x.createElement(dl,{dimensions:_,color:S,lineWidth:o})),x.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`}))}Ps.displayName="Background";var hl=x.memo(Ps);const Sl={region:l.To.ZERO,dpr:1,os:y.w$1.getOS()},gl={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},El=c.wrap$1(j.Canvas$1.TYPE,({children:e,resizeDebounce:t=100,aetherKey:s,className:r,...o})=>{const[{path:i},{bootstrapped:u,dpr:a},d]=c.use$3({aetherKey:s,type:j.Canvas$1.TYPE,schema:j.canvasStateZ,initialState:Sl}),p=x.useRef({...gl}),m=x.useCallback(h=>{p.current.bootstrapped&&d(()=>({bootstrapped:!0,region:h,dpr:window.devicePixelRatio,os:y.w$1.getOS({default:"Windows"})}))},[d]),f=c.useResize(m,{debounce:t});x.useEffect(()=>{const h=()=>{window.devicePixelRatio!==a&&d(R=>({...R,dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",h,{once:!0})},[a]),x.useEffect(()=>{window.addEventListener("focus",()=>d(h=>({...h}))),window.addEventListener("blur",()=>d(h=>({...h})))},[d]);const S=x.useCallback(h=>{if(f(h),h==null)return;h.className.includes("gl")?p.current.gl=h:h.className.includes("upper2d")?p.current.upper2d=h:p.current.lower2d=h;const{gl:R,lower2d:E,upper2d:w,bootstrapped:M}=p.current;if(R==null||E==null||w==null||M)return;p.current.bootstrapped=!0;const $=R.transferControlToOffscreen(),_=w.transferControlToOffscreen(),T=E.transferControlToOffscreen();d({glCanvas:$,upper2dCanvas:_,lower2dCanvas:T,bootstrap:!0,bootstrapped:!1,region:l.To.construct(R),dpr:window.devicePixelRatio,os:y.w$1.getOS({default:"Windows"})},[$,_,T])},[d]);return n.jsxRuntimeExports.jsxs("div",{className:l.CSS(l.CSS.B("canvas-container"),r),...o,children:[n.jsxRuntimeExports.jsx("canvas",{ref:S,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","lower2d"))}),n.jsxRuntimeExports.jsx("canvas",{ref:S,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","gl"))}),n.jsxRuntimeExports.jsx("canvas",{ref:S,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","upper2d"))}),n.jsxRuntimeExports.jsx(c.Composite,{path:i,children:u&&e})]})}),At=(e,t)=>c.useResize(x.useCallback((s,r)=>{const o=document.querySelector(".pluto-canvas--lower2d");o!=null&&e(l.k.XY.translate(l.q.scale(l.To.topLeft(o),-1)).box(s),r)},[e]),t),Rl=Object.freeze(Object.defineProperty({__proto__:null,Canvas:El,useRegion:At},Symbol.toStringTag,{value:"Module"})),Ls=x.createContext(null),Re=e=>{const t=x.useContext(Ls);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},Ms=e=>{const t=Re("Viewport"),{addViewportHandler:s}=t;x.useEffect(()=>s(e),[s,e])},pt=(e,t)=>{const{setGridEntry:s,removeGridEntry:r}=Re(t),{key:o}=e;return c.useEffectCompare(()=>{l.J.outer.parse(e.loc),s(e)},([a],[d])=>y._.equal(a,d),[e]),x.useEffect(()=>()=>r(o),[]),{gridArea:l.g.swap(l.J.direction(e.loc))==="x"?`axis-start-${o} / plot-start / axis-end-${o} / plot-end`:`plot-start / axis-start-${o} / plot-end / axis-end-${o}`}},$s=c.wrap$1("LinePlot",({aetherKey:e,style:t,resizeDebounce:s=0,clearOverScan:r=l.q.ZERO,children:o,hold:i=!1,onHold:u,...a})=>{const[d,p]=x.useState([]),m=c.useMemoDeepEqualProps({clearOverScan:r,hold:i}),[{path:f},{grid:S},h]=c.use$3({aetherKey:e,type:j.LinePlot.TYPE,schema:j.linePlotStateZ,initialState:{container:l.To.ZERO,viewport:l.To.DECIMAL,grid:{},...m}});x.useEffect(()=>h(C=>({...C,...m})),[m]);const R=x.useRef(new Map),E=x.useCallback(C=>(R.current.set(C,null),()=>R.current.delete(C)),[R]),w=x.useCallback(C=>{const{mode:P,box:b,stage:z}=C;(P==="pan"&&z!=="start"||P==="zoom"||P==="zoomReset"&&z==="start")&&h(A=>({...A,viewport:b})),R.current.forEach((A,Z)=>Z(C))},[h]),M=x.useCallback(C=>h(P=>({...P,container:C})),[h]),$=At(M,{debounce:s}),_=x.useCallback(C=>h(P=>({...P,grid:{...P.grid,[C.key]:C}})),[h]),T=x.useCallback(C=>h(P=>{const{[C]:b,...z}=P.grid;return{...P,grid:z}}),[h]),g=x.useCallback(C=>{p(P=>[...P.filter(({key:b})=>b!==C.key),C])},[p,w]),v=x.useCallback(C=>p(P=>P.filter(({key:b})=>b!==C)),[g]),B=x.useMemo(()=>yl(S),[S]),L=x.useCallback(C=>{h(P=>({...P,hold:C})),u==null||u(C)},[h,u]),N=x.useMemo(()=>({lines:d,setGridEntry:_,removeGridEntry:T,setLine:g,removeLine:v,setViewport:w,addViewportHandler:E,setHold:L}),[d,_,T,g,v,w,E,L]);return n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("line-plot"),style:{...t,...B},ref:$,...a,children:n.jsxRuntimeExports.jsx(Ls.Provider,{value:N,children:n.jsxRuntimeExports.jsx(c.Composite,{path:f,children:o})})})}),yl=e=>{const t=l.CSS.newGridBuilder();return j.filterGridEntries("top",e).forEach(({key:s,size:r})=>t.row(`axis-start-${s}`,`axis-end-${s}`,r)),t.row("plot-start","plot-end","minmax(0, 1fr)"),j.filterGridEntries("bottom",e).forEach(({key:s,size:r})=>t.row(`axis-start-${s}`,`axis-end-${s}`,r)),j.filterGridEntries("left",e).forEach(({key:s,size:r})=>t.col(`axis-start-${s}`,`axis-end-${s}`,r)),t.col("plot-start","plot-end","minmax(0, 1fr)"),j.filterGridEntries("right",e).forEach(({key:s,size:r})=>t.col(`axis-start-${s}`,`axis-end-${s}`,r)),t.build()},Vt=e=>{const t=e==="x"?"bottom":"left",s=e==="x"?j.XAxis.TYPE:j.YAxis.TYPE,r=`${e}-axis`;return c.wrap$1(s,({aetherKey:o,children:i,location:u=t,label:a="",labelLevel:d="small",labelDirection:p=e,onLabelChange:m,color:f,labelSize:S,showGrid:h,type:R,bounds:E,className:w,tickSpacing:M,autoBounds:$,autoBoundUpdateInterval:_,onAutoBoundsChange:T,style:g,...v})=>{const B=((a==null?void 0:a.length)??0)>0,L=c.useMemoDeepEqualProps({location:u,showGrid:h,type:R,bounds:E,label:a,labelDirection:p,tickSpacing:M,autoBounds:$,autoBoundUpdateInterval:_}),[{path:N},{size:C,labelSize:P,...b},z]=c.use$3({aetherKey:o,type:s,schema:j.coreAxisStateZ,initialState:L});x.useEffect(()=>z(Y=>({...Y,...L})),[L]),x.useEffect(()=>{const{lower:Y,upper:O}=j.parseAutoBounds(b.autoBounds);b.bounds!=null&&(Y&&(E==null?void 0:E.lower)!==b.bounds.lower||O&&(E==null?void 0:E.upper)!==b.bounds.upper)&&(T==null||T(b.bounds))},[b.autoBounds,b.bounds]);const A=pt({loc:u,key:`${s}-${o}`,size:C+P,order:"last"},"XAxis"),Z=c.useTypography(d).toString(),I=x.useRef(0);return x.useEffect(()=>{if(e==="y"){if(a==null)return;let O=y.dimensions(a,Z)[l.g.dimension(l.g.construct(p))];O>0&&(O+=9),z(J=>({...J,labelSize:O}))}else{let O=y.dimensions(a,Z).height*1.3;O>0&&(O+=12);const J=I.current;j.withinSizeThreshold(J,O)||(I.current=O,z(ee=>({...ee,labelSize:O})))}},[a,p,Z]),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(w,l.CSS.B("axis"),l.CSS.B(r),l.CSS.loc(u)),style:{...g,...A},align:"center",justify:u!=="left"?"end":"start",direction:l.g.swap(e),...v,children:B&&n.jsxRuntimeExports.jsx(c.MaybeEditable,{className:l.CSS(l.CSS.BE("axis","label"),l.CSS.dir(p)),value:a,onChange:m,level:d})}),n.jsxRuntimeExports.jsx(c.Composite,{path:N,children:i})]})})},_s=Vt("x"),Ns=Vt("y"),Bs=l.q.xy.extend({root:l.J.corner,units:le.z.object({x:le.z.enum(["px","decimal"]),y:le.z.enum(["px","decimal"])})}),Cl=Bs.partial({root:!0,units:!0}),bl=e=>{var s,r,o,i;const t={};return t[((s=e.root)==null?void 0:s.x)??"left"]=((r=e==null?void 0:e.units)==null?void 0:r.x)==="px"?`${e.x}px`:`${e.x*100}%`,t[((o=e.root)==null?void 0:o.y)??"top"]=((i=e==null?void 0:e.units)==null?void 0:i.y)==="px"?`${e.y}px`:`${e.y*100}%`,t},vl=(e,t)=>{var i,u,a,d,p,m;const s={x:e.x,y:e.y};if(t.current==null)return s;const r=l.To.construct(t.current),o=l.To.construct(t.current.parentElement);return((i=e.units)==null?void 0:i.x)==="decimal"?((u=e.root)==null?void 0:u.x)==="right"&&(s.x=1-e.x):((a=e.root)==null?void 0:a.x)==="right"?s.x=1-(e.x+l.To.width(r))/l.To.width(o):s.x/=l.To.width(o),((d=e.units)==null?void 0:d.y)==="decimal"?((p=e.root)==null?void 0:p.y)==="bottom"&&(s.y=1-e.y):((m=e.root)==null?void 0:m.y)==="bottom"?s.y=1-(e.y+l.To.height(r))/l.To.height(o):s.y/=l.To.height(o),s},zs=(e,t)=>{if(t.current==null)return null;const s=l.To.construct(t.current.parentElement),r=l.To.construct(t.current),o={x:e.x,y:e.y,root:{...l.J.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(o.x=(1-e.x)*l.To.width(s)-l.To.width(r),o.root.x="right"):e.x<.2?o.x=e.x*l.To.width(s):o.units.x="decimal",e.y>.8?(o.y=(1-e.y)*l.To.height(s)-l.To.height(r),o.root.y="bottom"):e.y<.2?o.y=e.y*l.To.height(s):o.units.y="decimal",o.x=Math.round(o.x*100)/100,{...o,...l.q.truncate(o,3)}},as=l.To.reRoot(l.To.DECIMAL,l.J.TOP_LEFT),It=x.memo(({className:e,value:t,onChange:s,style:r,draggable:o=!0,...i})=>{const[u,a]=y.usePurePassthrough({value:t,onChange:s,initial:{x:.1,y:.1,root:l.J.TOP_LEFT,units:{x:"decimal",y:"decimal"}}}),d=x.useRef(u),p=c.useSyncedRef(o===!1),m=x.useRef(null);u!==null&&(r={...r,...bl(u)});const f=x.useCallback(h=>{var T;if(((T=m.current)==null?void 0:T.parentElement)==null)return d.current;const R=l.To.construct(m.current.parentElement),E=l.k.XY.scale(R).scale(as),w=E.box(l.To.construct(m.current)),M=l.k.XY.clamp(l.To.construct(l.To.topLeft(as),{width:1-l.To.width(w),height:1-l.To.height(w)})),$=l.q.translate(l.q.construct(d.current),l.To.signedDims(E.box(h))),_=M.pos($);return zs(_,m)},[]),S=xt({onStart:x.useCallback(()=>{d.current=vl(d.current,m)},[]),onMove:x.useCallback(h=>{if(p.current)return;const R=f(h);R!==null&&a(R)},[]),onEnd:x.useCallback(h=>{if(p.current)return;const R=f(h);R!==null&&(d.current=R)},[])});return n.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(e,l.CSS.B("legend")),bordered:!0,rounded:!0,style:r,onDragStart:S,draggable:o,ref:m,...i,onDrag:Je,onDragEnd:Je,empty:!0})});It.displayName="Legend.Container";const Zt=({data:e=[],onEntryChange:t,position:s,onPositionChange:r,...o})=>{const[i,u]=x.useState(!1);return e.length===0?null:n.jsxRuntimeExports.jsx(It,{...o,draggable:!i,value:s,onChange:r,children:e.sort((a,d)=>a.label.localeCompare(d.label)).map(({key:a,color:d,label:p})=>n.jsxRuntimeExports.jsxs(D.Space,{style:{cursor:"pointer"},direction:"x",align:"center",size:"small",children:[n.jsxRuntimeExports.jsx(_t.Swatch,{value:d,onChange:m=>t==null?void 0:t({key:a,color:m,label:p}),onVisibleChange:u,draggable:!1,size:"small"}),n.jsxRuntimeExports.jsx(c.MaybeEditable,{level:"small",value:p,onChange:m=>t==null?void 0:t({key:a,color:d,label:m}),noWrap:!0})]},a))})},wl=Object.freeze(Object.defineProperty({__proto__:null,Container:It,Simple:Zt,calcStickyPos:zs,completeStickyXYz:Bs,stickyXYz:Cl},Symbol.toStringTag,{value:"Module"})),Os=({className:e,style:t,onLineChange:s,...r})=>{const{lines:o}=Re("Legend");return Re("Legend"),n.jsxRuntimeExports.jsx(Zt,{data:o,onEntryChange:s,...r})},Ds=c.wrap$1("Line",({aetherKey:e,...t})=>{const[,,s]=c.use$3({aetherKey:e,type:j.Line.TYPE,schema:j.stateZ,initialState:t}),r=c.useMemoDeepEqualProps(t);return x.useLayoutEffect(()=>s(r),[r]),null}),Tl=Object.freeze(Object.defineProperty({__proto__:null,Line:Ds},Symbol.toStringTag,{value:"Module"})),Ft=c.wrap$1("Line",({aetherKey:e,color:t,label:s="",...r})=>{const{setLine:o,removeLine:i}=Re("Line");return x.useEffect(()=>(o({key:e,color:t,label:s}),()=>i(e)),[s,t]),n.jsxRuntimeExports.jsx(Ds,{aetherKey:e,color:t,label:s,...r})}),As=({level:e="h2",...t})=>{const s=c.useUniqueKey(),r=c.useTypography(e),o=pt({key:s,size:(r.lineHeight+2)*r.baseSize,loc:"top",order:"first"},"Title");return n.jsxRuntimeExports.jsx(D.Space,{justify:"center",align:"center",style:o,children:n.jsxRuntimeExports.jsx(c.MaybeEditable,{...t,level:e})})},Vs=c.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=c.use$3({aetherKey:e,type:j.Tooltip.TYPE,schema:j.tooltipStateZ,initialState:{position:null}}),s=x.useRef(null),r=x.useCallback(i=>{const u=document.querySelector(".pluto-canvas-container");if(u==null)return;const a=l.To.topLeft(u);t({position:l.q.translation(a,l.q.construct(i))})},[t]),o=x.useCallback(()=>t({position:null}),[t]);return x.useEffect(()=>{if(s.current===null)return;const i=s.current.parentElement;if(i!=null)return i.addEventListener("mousemove",r),i.addEventListener("mouseleave",o),()=>{i.removeEventListener("mousemove",r),i.removeEventListener("mouseleave",o)}},[r]),n.jsxRuntimeExports.jsx("span",{ref:s})}),kl=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:Vs},Symbol.toStringTag,{value:"Module"})),Pl={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},qt=x.forwardRef(({className:e,mode:t,maskBox:s,children:r,style:o,...i},u)=>n.jsxRuntimeExports.jsxs("div",{ref:u,className:l.CSS(l.CSS.noSelect,l.CSS.BE("viewport-mask","container"),e),style:{cursor:Pl[t],...o},...i,children:[n.jsxRuntimeExports.jsx("div",{style:{...l.To.css(s),display:l.To.areaIsZero(s)?"none":"block"},className:l.CSS.BE("viewport-mask","selection")}),r]}));qt.displayName="ZoomPanMask";const Ll=new Set([y.d.UUID,y.d.JSON]),Ml=y.d.ALL.filter(e=>e!==y.d.UNKNOWN).map(e=>({key:e.toString(),name:Ll.has(e)?e.toString().toUpperCase():l._.capitalize(e.toString())})),$l=[{key:"name",name:"Name"}],_l=e=>n.jsxRuntimeExports.jsx(ue.DropdownButton,{...e,data:Ml,columns:$l,entryRenderKey:"name"}),Nl=[{key:"x",icon:n.jsxRuntimeExports.jsx(c.St.Arrow.Right,{})},{key:"y",icon:n.jsxRuntimeExports.jsx(c.St.Arrow.Down,{})}],Bl=({key:e,entry:t,onClick:s,selected:r})=>n.jsxRuntimeExports.jsx(c.Icon,{variant:r?"filled":"outlined",onClick:s,children:t.icon},e),zl=({children:e=Bl,...t})=>n.jsxRuntimeExports.jsx(ue.Button,{...t,allowMultiple:!1,data:Nl,children:e}),Is=e=>n.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS.BE("select","clear"),variant:"outlined",...e,children:n.jsxRuntimeExports.jsx(c.St.Close,{"aria-label":"clear"})}),Ce=({onChange:e,value:t,entryRenderKey:s="key",columns:r,data:o,emptyContent:i,inputProps:u,allowNone:a=!0,searcher:d,className:p,variant:m,hideColumnHeader:f=!1,disabled:S,omit:h,children:R,dropdownVariant:E="connected",placeholder:w=jt,inputPlaceholder:M=w,triggerTooltip:$,dropdownZIndex:_,filter:T,actions:g,...v})=>{const{visible:B,open:L,close:N,toggle:C}=c.use$1(),[P,b]=x.useState(null),z=d!=null;c.useAsyncEffect(async()=>{if(c.selectValueIsZero(t))return b(null);if((P==null?void 0:P.key)===t)return;let O=null;if(z)try{[O]=await d.retrieve([t])}finally{O??(O=null)}else o!=null&&(O=o.find(J=>J.key===t)??null);b(O)},[d,t,o]);const A=x.useCallback((O,J)=>{Array.isArray(O)||(b(O==null?null:J.entries[0]),N(),e(O,J))},[e,a]),Z=x.useMemo(()=>z?c.Search:_e.Filter,[z]),I=n.jsxRuntimeExports.jsx(Z,{searcher:d,filter:T,children:({onChange:O})=>n.jsxRuntimeExports.jsx(Ol,{autoFocus:E==="modal",variant:m,onChange:O,onFocus:L,selected:P,entryRenderKey:s,visible:B,allowNone:a,className:p,disabled:S,placeholder:M,children:g})}),Y=n.jsxRuntimeExports.jsx(c.Button,{tooltip:$,variant:"outlined",onClick:C,disabled:S,children:P!=null?Zs(s,P):w});return n.jsxRuntimeExports.jsx(ue.Core,{close:N,zIndex:_,open:L,data:o,omit:h,emptyContent:i,allowMultiple:!1,visible:B,value:t,hideColumnHeader:f,onChange:A,allowNone:a,columns:r,listItem:R,variant:E,trigger:E!=="modal"?I:Y,extraDialogContent:E==="modal"?I:void 0,keepMounted:!1,...v})},jt="Select",Zs=(e,t)=>t==null?"":typeof e=="function"?e(t):t[e].toString(),Ol=({entryRenderKey:e,selected:t,visible:s,onChange:r,onFocus:o,allowNone:i=!0,placeholder:u=jt,className:a,disabled:d,...p})=>{const{clear:m}=c.useSelectionUtils(),[f,S]=x.useState("");x.useEffect(()=>{if(!s){if(y.S(t==null?void 0:t.key))return S("");t!=null&&S(Zs(e,t))}},[t,s,e]);const h=M=>{r(M),S(M)},R=()=>{f===""&&r(""),S(""),o==null||o()},E=M=>{s||(M.preventDefault(),o==null||o())},w=()=>{S(""),m==null||m()};return n.jsxRuntimeExports.jsx(c.Text$1,{className:l.CSS(l.CSS.BE("select","input"),a),value:f,onChange:h,onFocus:R,onKeyDown:c.matchCallback([["Enter"]],M=>{M.preventDefault(),!s&&(o==null||o())}),style:{flexGrow:1},onClick:E,placeholder:u,disabled:d,...p,children:i&&n.jsxRuntimeExports.jsx(Is,{onClick:w,disabled:d})})},Ve=({children:e="",size:t="medium",color:s,icon:r,onClose:o,className:i,onDragStart:u,...a})=>{const d=l.cssString(s);r==null&&s!=null&&(r=n.jsxRuntimeExports.jsx(c.St.Circle,{fill:d}));const p=o==null?void 0:n.jsxRuntimeExports.jsx(c.Icon,{"aria-label":"close",size:"small",className:l.CSS.BE("tag","close"),onClick:m=>{m.stopPropagation(),o()},children:n.jsxRuntimeExports.jsx(c.St.Close,{})});return n.jsxRuntimeExports.jsx(c.WithIcon,{startIcon:r,endIcon:p,className:l.CSS(i,l.CSS.B("tag"),o!=null&&l.CSS.BM("tag","closeable")),level:y.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:u,...a,children:e})},Dl=Object.freeze(Object.defineProperty({__proto__:null,Tag:Ve},Symbol.toStringTag,{value:"Module"})),Be=({onChange:e,value:t,className:s,data:r,columns:o=[],entryRenderKey:i="key",emptyContent:u,searcher:a,renderTag:d=c.componentRenderProp(Fs),placeholder:p,onTagDragStart:m,allowMultiple:f,allowNone:S,replaceOnSingle:h,onTagDragEnd:R,style:E,addPlaceholder:w="Add",children:M,dropdownVariant:$="connected",actions:_,...T})=>{const{visible:g,open:v,close:B}=c.use$1(),[L,N]=x.useState([]),[C,P]=x.useState(!1),b=a!=null;c.useAsyncEffect(async()=>{P(!0),c.selectValueIsZero(t)&&N([]);const Y=L.map(ee=>ee.key),O=y.A(t);if(y.y.unorderedPrimitiveArrays(Y,O)===y.y.EQUAL)return;let J=[];if(b)try{J=await a.retrieve(O)}finally{P(!1)}else r!=null&&(J=r.filter(ee=>O.includes(ee.key)));N(J)},[a,b,t,r]);const z=x.useCallback((Y,O)=>{Y!=null&&(N(O.entries),e(y.A(Y),O))},[e]),A=x.useMemo(()=>b?c.Search:_e.Filter,[b]);let Z,I;if($==="connected")I=n.jsxRuntimeExports.jsx(A,{searcher:a,children:({onChange:Y,value:O})=>n.jsxRuntimeExports.jsx(Al,{value:O,selectedKeys:t,className:s,onChange:Y,loading:C,selected:L,onFocus:v,entryRenderKey:i,visible:g,renderTag:d,placeholder:p,onTagDragStart:m,onTagDragEnd:R,style:E,children:_})});else{const Y=y.A(t);I=n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",grow:!0,style:E,size:"small",children:[Y.map(O=>{const J=L.find(ee=>ee.key===O);return d({key:O,entryKey:O,entryRenderKey:i,loading:C,entry:J,onClose:()=>{const ee=Y.filter(qe=>qe!==O);e(ee,{clicked:null,clickedIndex:-1,entries:[]})},onDragStart:ee=>m==null?void 0:m(ee,O),onDragEnd:ee=>R==null?void 0:R(ee,O)})}),Y.length>0?n.jsxRuntimeExports.jsx(c.Icon,{onClick:v,children:n.jsxRuntimeExports.jsx(c.St.Add,{style:{color:"var(--pluto-gray-l7)"}})}):n.jsxRuntimeExports.jsx(c.Button,{onClick:v,shade:7,startIcon:n.jsxRuntimeExports.jsx(c.St.Add,{}),variant:"text",children:w})]}),Z=n.jsxRuntimeExports.jsx(A,{searcher:a,children:O=>n.jsxRuntimeExports.jsx(c.Text$1,{autoFocus:!0,placeholder:"Search",...O,children:_})})}return n.jsxRuntimeExports.jsx(ue.Core,{close:B,open:v,data:r,emptyContent:u,visible:g,value:t,onChange:z,allowNone:S,replaceOnSingle:h,columns:o,allowMultiple:!0,listItem:M,trigger:I,extraDialogContent:Z,variant:$,...T})},Al=({selectedKeys:e,loading:t,selected:s,onChange:r,onFocus:o,visible:i,entryRenderKey:u,renderTag:a,placeholder:d=jt,onTagDragStart:p,onTagDragEnd:m,value:f,className:S,children:h,...R})=>{const{onSelect:E,clear:w}=c.useSelectionUtils(),M=x.useRef(null);x.useLayoutEffect(()=>{var g;i&&((g=M.current)==null||g.focus())},[i,s]);const $=()=>{i||r(""),o==null||o()},_=()=>{i||o==null||o()},T=()=>{i||r("")};return n.jsxRuntimeExports.jsxs(c.Text$1,{ref:M,className:l.CSS(l.CSS.BE("select-multiple","input"),l.CSS.visible(i),S),onBlur:T,placeholder:d,value:f,onChange:r,onFocus:$,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:_,...R,children:[n.jsxRuntimeExports.jsx(D.Space,{direction:"x",className:l.CSS.BE("select-multiple","tags"),align:"center",grow:!0,size:"small",children:y.A(e).map(g=>{const v=s.find(B=>B.key===g);return a({key:g,entryKey:g,entryRenderKey:u,loading:t,entry:v,onClose:()=>E==null?void 0:E(g),onDragStart:B=>p==null?void 0:p(B,g),onDragEnd:B=>m==null?void 0:m(B,g)})})}),h,n.jsxRuntimeExports.jsx(Is,{onClick:w})]})},Fs=({entryKey:e,entryRenderKey:t,entry:s,loading:r,...o})=>{let i=e;return s!=null&&(i=typeof t=="function"?t(s):s[t]),x.createElement(Ve,{size:"small",variant:"outlined",className:l.CSS(s==null&&!r&&l.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...o,key:e.toString()},y.B(i))},Vl=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:ue.BaseButton,Button:ue.Button,DEFAULT_PLACEHOLDER:jt,DataType:_l,Direction:zl,DropdownButton:ue.DropdownButton,Multiple:Be,MultipleTag:Fs,Single:Ce,defaultButton:ue.defaultButton},Symbol.toStringTag,{value:"Module"})),Xe=6,Il=2,us=5,Zl=e=>l.To.width(e)<us&&l.To.height(e)<us,Fl=["zoom","pan","select","zoomReset"],Ae=[...Fl,"click"],ql=le.z.enum(Ae),qs=["zoom","select"],Ke={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},Hs={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},Ys={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},Ht={zoom:Ke,pan:Hs,select:Ys,zoomReset:Ke,click:Ke},Hl=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([s,r])=>s==="defaultMode"?[s,r]:[s,r.map(o=>o.filter(i=>i!=="MouseLeft")).filter(o=>o.length>0)]))},Yl=l.To.construct(0,0,1,1,l.J.TOP_LEFT),Gl={width:30,height:50},Gs=({onChange:e,triggers:t,initial:s=Yl,threshold:r=Gl,ref:o})=>{const i=(t==null?void 0:t.defaultMode)??"zoom",[u,a]=x.useState(l.To.ZERO),[d,p]=x.useState(i),[m,f]=c.useStateRef(s),S=x.useRef(l.q.ZERO),h=x.useRef(null),R=l._$1.construct(r);x.useEffect(()=>f(()=>l.To.truncate(s,Xe)),[s]),x.useEffect(()=>p(i),[i]);const[E,w,M,$]=c.useMemoCompare(()=>{const L={...Ht[i],...t},N=c.flattenConfig(L),C=Hl(L);return[L,N,C,c.flattenConfig(C)]},c.compareModeConfigs,[t]),_=x.useCallback(({box:L,triggers:N,stage:C,cursor:P})=>{if(h.current==null)return;const b=c.determineMode(E,N),z=l.To.construct(h.current);if(b==null)return;if(b==="zoomReset")return a(l.To.ZERO),e==null||e({box:l.To.DECIMAL,mode:b,stage:C,cursor:P}),f(l.To.DECIMAL);const A=Zl(L);if(C==="end"){if(A){b==="zoom"&&a(l.To.ZERO),e==null||e({box:m.current,mode:"click",stage:C,cursor:P});return}return f(I=>{if(b==="pan"){const O=xs(L,I,z);return O===null||l.To.equals(O,I)?I:(e==null||e({box:O,mode:b,stage:C,cursor:P}),O)}const Y=T(L,I,z);return Y===null?I:(e==null||e({box:Y,mode:b,stage:C,cursor:P}),b==="zoom"?(a(l.To.ZERO),Y):l.To.truncate(I,Xe))})}if(qs.includes(b))return A?void 0:a(l.k.XY.scale(z).clamp(z).translate({x:-l.To.left(z),y:-l.To.top(z)}).box(ds(R,L,z)));if(a(I=>l.To.areaIsZero(I)?I:l.To.ZERO),l.q.distance(P,S.current)<Il)return;S.current=P;const Z=xs(L,m.current,z);e==null||e({box:Z,mode:b,stage:C,cursor:P})},[a,p,e,E,r.height,r.width,f,h]);x.useImperativeHandle(o,()=>({reset:()=>{a(l.To.ZERO),f(l.To.DECIMAL),e==null||e({box:l.To.DECIMAL,mode:"zoomReset",stage:"start",cursor:l.q.ZERO})}}),[e]);const T=x.useCallback((L,N,C)=>l.To.truncate(wt(N,C).box(ds(R,L,C)),Xe),[r]),g=c.useHeldRef({triggers:[["Control"]]}),v=c.useHeldRef({triggers:[["Alt"]]});x.useEffect(()=>{const L=N=>{if(h.current==null)return;let C=1;N.deltaY<0?C-=.035:C+=.035;const P=l.To.construct(h.current),b=l.q.construct(N);if(!l.To.contains(P,b)||N.target!==h.current)return;const A=wt(m.current,l.To.construct(h.current)).pos(l.q.construct(N));let I=l.k.XY.magnify({x:g.current.held?1:C,y:v.current.held?1:C}).box(m.current);I=l.To.translate(I,{x:g.current.held?0:A.x*(1-C),y:v.current.held?0:A.y*(1-C)}),f(I),e==null||e({stage:"end",box:I,cursor:l.q.construct(N),mode:"zoom"})};return window.addEventListener("wheel",L),()=>window.removeEventListener("wheel",L)},[f,e]),Nt.useDrag({bound:h,onDrag:_,triggers:w,loose:!0});const B=x.useCallback(({triggers:L,stage:N})=>{if(N==="end")return p(i);const C=c.determineMode(M,L);C!=null&&p(C)},[M,i,e]);return c.use$2({triggers:$,callback:B,region:h}),{maskBox:u,ref:h,mode:d}},wt=(e,t)=>l.k.XY.scale(t).clamp(t).scale(e),xs=(e,t,s)=>{let r=l.To.signedDims(wt(t,s).box(e));return r={signedWidth:-r.signedWidth,signedHeight:-r.signedHeight},l.To.truncate(l.k.XY.translate(l.q.construct(r)).box(t),Xe)},ds=(e,t,s)=>l.To.height(t)<=e.height?l.To.construct(l.To.left(t),l.To.top(s),l.To.width(t),l.To.height(s)):l.To.width(t)<=e.width?l.To.construct(l.To.left(s),l.To.top(t),l.To.width(s),l.To.height(t)):t,Ul=({mode:e,triggers:t})=>n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",children:[n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:l._.capitalize(e)}),n.jsxRuntimeExports.jsx(Nt.Text,{trigger:t[0],level:"small"})]}),Wl={zoom:n.jsxRuntimeExports.jsx(c.St.Zoom,{}),pan:n.jsxRuntimeExports.jsx(c.St.Pan,{}),select:n.jsxRuntimeExports.jsx(c.St.Selection,{}),zoomReset:n.jsxRuntimeExports.jsx(c.St.Expand,{}),click:n.jsxRuntimeExports.jsx(c.St.Bolt,{})},Xl=({triggers:e,disable:t=["zoomReset","click"],...s})=>{const r=Object.entries(e).filter(([o])=>!t.includes(o)&&Ae.includes(o)).map(([o,i])=>({key:o,icon:Wl[o],tooltip:n.jsxRuntimeExports.jsx(Ul,{mode:o,triggers:i})})).sort((o,i)=>Ae.indexOf(o.key)-Ae.indexOf(i.key));return n.jsxRuntimeExports.jsx(ue.Button,{...s,data:r,entryRenderKey:"icon",children:({title:o,entry:i,...u})=>x.createElement(c.Icon,{...u,key:i.key,variant:u.selected?"filled":"text",size:"medium",tooltip:i.tooltip,tooltipLocation:{x:"right",y:"top"}},i.icon)})},Kl=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:Ht,MASK_MODES:qs,MODES:Ae,Mask:qt,PAN_DEFAULT_TRIGGERS:Hs,SELECT_DEFAULT_TRIGGERS:Ys,SelectMode:Xl,ZOOM_DEFAULT_TRIGGERS:Ke,modeZ:ql,use:Gs},Symbol.toStringTag,{value:"Module"})),Us=e=>e==null?null:document.querySelectorAll(".pluto-line-plot__viewport")[0]??null,Yt=x.forwardRef(({children:e,initial:t=l.To.DECIMAL,onChange:s,...r},o)=>{const{setViewport:i}=Re("Viewport");x.useLayoutEffect(()=>{i({box:t,mode:"zoom",cursor:l.q.ZERO,stage:"start"})},[i,t]);const u=x.useCallback(d=>{i(d),s==null||s(d)},[s,i]),a=Gs({onChange:u,initial:t,ref:o,...r});return n.jsxRuntimeExports.jsx(qt,{className:l.CSS.BE("line-plot","viewport"),...a,children:e})});Yt.displayName="Viewport";const Jl=Object.freeze(Object.defineProperty({__proto__:null,Legend:Os,Line:Ft,LinePlot:$s,Title:As,Tooltip:kl,Viewport:Yt,XAxis:_s,YAxis:Ns,axisFactory:Vt,selectViewportEl:Us,useContext:Re,useGridEntry:pt,useViewport:Ms},Symbol.toStringTag,{value:"Module"})),Ql=c.wrap$1("Tooltip",({aetherKey:e,...t})=>(c.use$3({aetherKey:e,type:j.Annotation.TYPE,schema:j.annotationStateZ,initialState:t}),null)),Ws=c.wrap$1("Annotation.Provider",({aetherKey:e,menu:t,...s})=>{const{setViewport:r,setHold:o}=Re("Range.Provider"),[,{hovered:i,count:u},a]=c.use$3({aetherKey:e,type:j.Provider$1.TYPE,schema:j.providerStateZ,initialState:{...s,cursor:null,hovered:null,count:0}}),d=pt({key:e,loc:"top",size:u>0?32:0,order:"last"},"Annotation.Provider"),p=c.useContextMenu(),m=c.useSyncedRef(p.visible),f=x.useCallback(S=>{const h=E=>{a(w=>({...w,cursor:{x:E.clientX,y:E.clientY}}))},R=S.currentTarget;R.addEventListener("mousemove",h),R.addEventListener("mouseleave",()=>{R.removeEventListener("mousemove",h),m.current||a(E=>({...E,cursor:null}))},{once:!0})},[a]);return n.jsxRuntimeExports.jsx(c.ContextMenu,{style:{...d,cursor:i!=null?"pointer":"default"},...p,menu:()=>t==null||i==null?null:t(i),children:n.jsxRuntimeExports.jsx(D.Space,{style:{width:"100%",height:"100%"},onClick:()=>{i!=null&&(r({box:l.To.construct({x:i.viewport.lower,y:0},{x:i.viewport.upper,y:1}),mode:"zoom",cursor:l.q.ZERO,stage:"start"}),o(!0))},onMouseEnter:f})})}),ei=Object.freeze(Object.defineProperty({__proto__:null,Annotation:Ql,Provider:Ws},Symbol.toStringTag,{value:"Module"})),Xs={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},ti=c.flattenConfig(Xs),Ks=c.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=c.use$3({aetherKey:e,type:j.Measure.TYPE,schema:j.measureStateZ,initialState:{hover:null,one:null,two:null}}),s=x.useRef(null),r=c.useHeldRef({triggers:ti,loose:!0}),o=x.useCallback(({mode:a,cursor:d})=>{if(a==="click"){const p=c.determineMode(Xs,r.current.triggers,!0);if(["one","two"].includes(p))return t(m=>({...m,[p]:d}));t(p==="clear"?m=>({...m,one:null,two:null}):m=>({...m,one:m.one??d,two:m.one!==null?d:m.two}))}},[t,r]);Ms(o);const i=x.useCallback(a=>t(d=>({...d,hover:l.q.construct(a)})),[t]),u=x.useCallback(()=>{t(a=>({...a,hover:null}))},[t]);return x.useEffect(()=>{if(s.current===null)return;const a=s.current.parentElement;if(a!=null)return a.addEventListener("mousemove",i),a.addEventListener("mouseleave",u),()=>{a.removeEventListener("mousemove",i),a.removeEventListener("mouseleave",u)}},[o]),n.jsxRuntimeExports.jsx("span",{ref:s})}),si=Object.freeze(Object.defineProperty({__proto__:null,Measure:Ks},Symbol.toStringTag,{value:"Module"})),Gt=c.wrap$1("Rule",({aetherKey:e,label:t,position:s,onLabelChange:r,onPositionChange:o,units:i="",color:u,lineWidth:a,lineDash:d})=>{const[p,m]=y.usePurePassthrough({value:t,onChange:r,initial:""}),[,{position:f,pixelPosition:S},h]=c.use$3({aetherKey:e,type:j.Rule.TYPE,schema:j.ruleStateZ,initialState:{color:u,dragging:!1,position:s,lineWidth:a,lineDash:d}});x.useEffect(()=>{if(f==null)return;if(s==null)return o==null?void 0:o(f);const T=l.R.construct(f+.01,f-.01);s!=null&&!l.R.contains(T,s)&&(o==null||o(Math.trunc(f*100)/100))},[f]);const R=x.useRef(S);S!==R.current&&(R.current=S);const E=x.useRef(S);x.useEffect(()=>{h(T=>({...T,position:s,color:u,lineWidth:a,lineDash:d}))},[s,u,a,d]);const w=xt({onStart:x.useCallback(()=>{h(T=>({...T,dragging:!0})),E.current=R.current},[]),onMove:T=>{h(g=>({...g,pixelPosition:(E.current??0)+l.To.signedHeight(T)}))},onEnd:x.useCallback(()=>{h(T=>({...T,dragging:!1})),E.current=S},[])}),M=x.useRef(null);if(f==null||S==null)return null;const $=Us(M==null?void 0:M.current),_=n.jsxRuntimeExports.jsxs("div",{ref:M,className:l.CSS.B("rule"),style:{top:`calc(${S}px - 0.5rem)`},children:[n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("rule","drag-handle"),onDragStart:w,draggable:!0}),n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",style:{marginLeft:"2rem"},children:[n.jsxRuntimeExports.jsx(c.Editable,{level:"p",value:p,onChange:m}),n.jsxRuntimeExports.jsx(c.Text,{level:"p",style:{padding:"0.25rem 0",width:"fit-content"},children:`${f.toFixed(2)} ${i}`})]})]});return $==null?_:Bt.createPortal(_,$)}),ni=Object.freeze(Object.defineProperty({__proto__:null,Rule:Gt},Symbol.toStringTag,{value:"Module"})),Js=c.canDropOfType(ge),ri=({lines:e,axes:t,showTitle:s=!0,title:r="",onTitleChange:o,showLegend:i=!0,legendPosition:u,onLegendPositionChange:a,titleLevel:d="h4",onLineChange:p,onRuleChange:m,onAxisChannelDrop:f,onAxisChange:S,rules:h,enableTooltip:R=!0,enableMeasure:E=!1,initialViewport:w=l.To.DECIMAL,onViewportChange:M,viewportTriggers:$,annotationProvider:_,...T})=>{var N;const g=t.filter(({location:C})=>l.J.isY(C)),v=x.useRef(),B=c.usePrevious(e.length),L=c.usePrevious(T.hold);return(B===0&&e.length!==0||L===!0&&T.hold===!1)&&((N=v.current)==null||N.reset()),n.jsxRuntimeExports.jsxs($s,{...T,children:[g.map((C,P)=>{const b=e.filter(Z=>Z.axes.x===C.key),z=t.filter(({location:Z})=>l.J.isX(Z)),A=h==null?void 0:h.filter(Z=>[...z.map(({key:I})=>I),C.key].includes(Z.axis));return n.jsxRuntimeExports.jsx(oi,{axis:C,index:P,lines:b,yAxes:z,rules:A,onAxisChannelDrop:f,onAxisChange:S,annotationProvider:_},C.key)}),i&&n.jsxRuntimeExports.jsx(Os,{onLineChange:p,position:u,onPositionChange:a}),s&&n.jsxRuntimeExports.jsx(As,{value:r,onChange:o,level:d}),n.jsxRuntimeExports.jsxs(Yt,{initial:w,onChange:M,triggers:$,ref:v,children:[R&&n.jsxRuntimeExports.jsx(Vs,{}),E&&n.jsxRuntimeExports.jsx(Ks,{})]})]})},oi=({yAxes:e,lines:t,index:s,rules:r,onRuleChange:o,onAxisChannelDrop:i,onAxisChange:u,axis:{location:a,key:d,showGrid:p,...m},annotationProvider:f})=>{const S=c.useDrop({type:"Channel.LinePlot.XAxis",canDrop:Js,onDrop:x.useCallback(({items:E})=>{const w=c.filterByType(ge,E);return i==null||i(d,w.map(({key:M})=>M)),w},[d,i])}),h=r==null?void 0:r.filter(E=>E.axis===d),R=c.useDraggingState();return n.jsxRuntimeExports.jsxs(_s,{...m,...S,location:a,showGrid:p??s===0,className:l.CSS(l.CSS.dropRegion(c.canDropOfType(ge)(R))),onAutoBoundsChange:E=>u==null?void 0:u({key:d,bounds:E}),children:[e.map((E,w)=>{const M=t.filter(_=>_.axes.y===E.key),$=r==null?void 0:r.filter(_=>_.axis===E.key);return n.jsxRuntimeExports.jsx(ii,{axis:{...E,showGrid:p??(s===0&&w===0)},lines:M,rules:$,onRuleChange:o,onAxisChannelDrop:i,onAxisChange:u},E.key)}),h==null?void 0:h.map(E=>x.createElement(Gt,{aetherKey:E.key,...E,key:E.key,onLabelChange:w=>o==null?void 0:o({key:E.key,label:w}),onPositionChange:w=>o==null?void 0:o({key:E.key,position:w})})),n.jsxRuntimeExports.jsx(Ws,{...f})]})},li=({channels:{x:e,y:t}})=>`${e??0}-${t}`,ii=({lines:e,rules:t,onRuleChange:s,onAxisChannelDrop:r,onAxisChange:o,axis:{key:i,location:u,...a}})=>{const d=c.useDrop({type:"Channel.LinePlot.YAxis",canDrop:Js,onDrop:x.useCallback(({items:m})=>{const f=c.filterByType(ge,m);return r==null||r(i,f.map(({key:S})=>S)),f},[i,r])}),p=c.useDraggingState();return n.jsxRuntimeExports.jsxs(Ns,{...a,...d,location:u,className:l.CSS(l.CSS.dropRegion(c.canDropOfType(ge)(p))),onAutoBoundsChange:m=>o==null?void 0:o({key:i,bounds:m}),children:[e.map(m=>n.jsxRuntimeExports.jsx(ci,{line:m},li(m))),t==null?void 0:t.map(m=>x.createElement(Gt,{aetherKey:m.key,...m,key:m.key,onLabelChange:f=>s==null?void 0:s({key:m.key,label:f}),onPositionChange:f=>s==null?void 0:s({key:m.key,position:f})}))]})},ci=({line:e})=>e.variant==="static"?n.jsxRuntimeExports.jsx(ui,{line:e}):n.jsxRuntimeExports.jsx(ai,{line:e}),ai=({line:{key:e,timeSpan:t,channels:{x:s,y:r},...o}})=>{const i=Number(t.valueOf())*3,u=j.streamChannelData({timeSpan:t,channel:r,keepFor:i}),a=s!=null&&s!==0,d=j.streamChannelData({timeSpan:t,channel:a?s:r,useIndexOfChannel:!a,keepFor:i});return n.jsxRuntimeExports.jsx(Ft,{aetherKey:e,y:u,x:d,...o})},ui=({line:{timeRange:e,key:t,channels:{x:s,y:r},...o}})=>{const i=j.channelData({timeRange:e,channel:r}),u=s!=null&&s!==0,a=j.channelData({timeRange:e,channel:u?s:r,useIndexOfChannel:!u});return n.jsxRuntimeExports.jsx(Ft,{aetherKey:t,y:i,x:a,...o})},ms=[{key:"name",name:"Name"},{key:"alias",name:"Alias"},{key:"rate",name:"Rate"},{key:"dataType",name:"Data Type"},{key:"index",name:"Index"},{key:"key",name:"Key"},{key:"isIndex",name:"Is Index"}],Qe=({items:e},t)=>{const s=c.filterByType(ge,e);return s.length>0&&!s.every(r=>t.includes(r.key))},Qs=["name","alias"],en=e=>{const t=dt();return x.useMemo(()=>e.length===0?ms:ms.filter(s=>e.includes(s.key)),[e,t])},xi=({columns:e=Qs,onChange:t,className:s,value:r,searchOptions:o,...i})=>{const u=fe(),a=dt(),d=en(e),p=Dt(),m=c.useMemoDeepEqualProps(o),f=x.useMemo(()=>u==null?void 0:u.channels.newSearcherWithOptions({rangeKey:p,internal:!1,...m}),[u,p,m]),S=u!=null?void 0:n.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:h,onDragEnd:R,...E}=c.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:x.useCallback(T=>Qe(T,y.A(r)),[r]),onDrop:x.useCallback(({items:T})=>{const g=c.filterByType(ge,T);if(g.length===0)return[];const v=y.n([...y.A(r),...g.map(B=>B.key)]);return t(v,{clickedIndex:null,clicked:null,entries:[]}),g},[t,r])}),w=c.useDraggingState(),M=x.useCallback(({dropped:T})=>{t(y.A(r).filter(g=>!T.some(v=>v.key===g)),{clickedIndex:null,clicked:null,entries:[]})},[t,r]),$=x.useCallback((T,g)=>h([{key:g,type:ge}],M),[h,M]),_=x.useCallback(T=>a[T.key]??T.name,[a]);return n.jsxRuntimeExports.jsx(Be,{className:l.CSS(s,l.CSS.dropRegion(Qe(w,y.A(r)))),value:r,onTagDragStart:$,onTagDragEnd:R,searcher:f,onChange:t,columns:d,emptyContent:S,entryRenderKey:_,...E,...i})},ye=({columns:e=Qs,onChange:t,value:s,className:r,data:o,searchOptions:i,...u})=>{const a=fe(),d=dt(),p=en(e),m=Dt(),f=c.useMemoDeepEqualProps(i),S=x.useMemo(()=>{if(!(o!=null&&o.length>0))return a==null?void 0:a.channels.newSearcherWithOptions({rangeKey:m,internal:!1,...f})},[a,m,o==null?void 0:o.length,f]),h=a!=null?void 0:n.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),R=x.useId(),E=x.useMemo(()=>({key:R,type:"Channel.SelectMultiple"}),[R]),{startDrag:w,onDragEnd:M,...$}=c.useDragAndDrop({type:"Channel.SelectSingle",canDrop:x.useCallback(v=>Qe(v,y.o(s)),[s]),onDrop:x.useCallback(({items:v})=>{const B=c.filterByType(ge,v);return B.length===0?[]:(t(B[0].key,{clickedIndex:null,clicked:null,entries:[]}),B)},[E,t])}),_=c.useDraggingState(),T=x.useCallback(()=>s!=null&&w([{type:ge,key:s}]),[w,s]),g=x.useCallback(v=>d[v.key]??v.name,[d]);return n.jsxRuntimeExports.jsx(Ce,{data:o,className:l.CSS(r,l.CSS.dropRegion(Qe(_,y.o(s)))),value:s,onDragStart:T,onDragEnd:M,onChange:t,searcher:S,columns:p,emptyContent:h,entryRenderKey:g,...$,...u})},di=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:al,AliasProvider:ks,LinePlot:ri,SelectMultiple:xi,SelectSingle:ye,useActiveRange:Dt,useAlias:Ts,useAliases:dt,useContext:ws,useName:mt},Symbol.toStringTag,{value:"Module"})),tn=e=>y.c(e,(t,s,r)=>{const o=s===r.length-1,i=!isNaN(parseInt(t)),u=!isNaN(parseInt(r[s+1]));return i&&(t="element"),o||u?t:[t,"shape"]}),ps=(e,t)=>{if(e==null)return null;const s=e[t];return s==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:s},mi=(e,t,s)=>y.u(ps(e,"shape"),tn(t),{...s,getter:ps}),pi=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:mi,getFieldSchemaPath:tn},Symbol.toStringTag,{value:"Module"})),Te=({path:e,optional:t=!1,onChange:s})=>{const r=be(),{get:o,bind:i,set:u,setStatus:a}=r,[d,p]=x.useState(o(e,{optional:t}));x.useEffect(()=>(p(o(e,{optional:t})),i({path:e,onChange:p,listenToChildren:!1})),[e,s,i,o]);const m=x.useCallback(h=>{s==null||s(h,{...r,path:e}),u(e,h)},[e,u,s]),f=x.useCallback(h=>a(e,h),[e,a]);if(d==null){if(!t)throw new Error(`Field state is null: ${e}`);return null}let S;return r.mode==="preview"&&(S="preview"),{onChange:m,setStatus:f,variant:S,...d}},sn=(e,t=!1,s)=>{const{get:r,bind:o}=be(s),[,i]=x.useState(0);return x.useEffect(()=>(i(u=>u+1),o({path:e,onChange:()=>i(u=>u+1)})),[e,o]),r(e,{optional:t})??null},ji=(e,t=!1,s)=>{var u;const{get:r,bind:o}=be(s),[,i]=x.useState(0);return x.useEffect(()=>(i(a=>a+1),o({path:e,onChange:()=>i(a=>a+1)})),[e,o]),((u=r(e,{optional:t}))==null?void 0:u.value)??null},fi=e=>{var t,s;return((s=(t=sn(e,!0))==null?void 0:t.status)==null?void 0:s.variant)==="success"},hi=({path:e,ctx:t,onChange:s})=>{const r=be(t);x.useEffect(()=>r.bind({path:e,onChange:o=>s(o,r),listenToChildren:!1}),[e,r])},Si=({path:e,optional:t=!1})=>{const{bind:s,get:r}=be(),[o,i]=x.useState(r(e,{optional:t}));if(x.useEffect(()=>(i(r(e,{optional:t})),s({path:e,onChange:u=>i({...u,value:y.H(u.value)}),listenToChildren:!0})),[e,s,r]),o==null&&!t)throw new Error("Field state is null");return(o==null?void 0:o.value)??null},nn=(e,t)=>({add:(s,r)=>{const o=y.H(e.get(t).value);o.splice(r,0,...y.A(s)),e.set(t,o,{validateChildren:!1})},push:(s,r)=>{const o=y.H(e.get(t).value);o.push(...y.A(s)),r!=null&&o.sort(r),e.set(t,o,{validateChildren:!1})},remove:s=>{const r=e.get(t).value,o=new Set(y.A(s));e.set(t,r.filter((i,u)=>!o.has(u)))},keepOnly:s=>{const r=e.get(t).value,o=new Set(y.A(s));e.set(t,r.filter((i,u)=>o.has(u)))},set:s=>e.set(t,y.executeSetter(s,e.get(t).value)),sort:s=>{const r=y.H(e.get(t).value);r.sort(s),e.set(t,r)}}),gi=({path:e,updateOnChildren:t=!1,ctx:s})=>{const r=be(s),{bind:o,get:i}=r,[u,a]=x.useState(i(e).value);return x.useEffect(()=>(a(i(e).value),o({path:e,onChange:d=>{a(y.H(d.value))},listenToChildren:t})),[e,o,i,a]),x.useMemo(()=>({value:u,...nn(r,e)}),[u,r,e])},Ut=x.createContext({mode:"normal",bind:()=>()=>{},set:()=>{},reset:()=>{},remove:()=>{},get:()=>({value:void 0,status:{key:"",variant:"success",message:""},touched:!1,required:!1}),validate:()=>!1,validateAsync:()=>Promise.resolve(!1),value:()=>({}),has:()=>!1,setStatus:()=>{},clearStatuses:()=>{}}),be=e=>{const t=x.useContext(Ut);return e??t},js=e=>({key:e,variant:"success",message:""}),Ei=e=>e.code===le.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",rn=({values:e,sync:t=!1,schema:s,mode:r="normal",onChange:o})=>{const i=x.useRef({state:e,statuses:new Map,touched:new Set,listeners:new Map,parentListeners:new Map}),u=c.useSyncedRef(s),a=c.useSyncedRef(o),d=x.useCallback(({path:g,onChange:v,listenToChildren:B=!1})=>{var P;const{parentListeners:L,listeners:N}=i.current,C=B?L:N;return C.has(g)||C.set(g,new Set),(P=C.get(g))==null||P.add(v),()=>{var b;return(b=C.get(g))==null?void 0:b.delete(v)}},[]),p=x.useCallback((g,{optional:v}={optional:!1})=>{const{state:B,statuses:L,touched:N}=i.current,C=y._.get(B,g,{optional:v});if(C==null)return null;const P={value:C,status:L.get(g)??js(g),touched:N.has(g),required:!1};if(u.current==null)return P;const b=u.current,z=pi.getFieldSchema(b,g,{optional:!0});return z==null||(P.required=!z.isOptional()),P},[]),m=x.useCallback(g=>{const{state:v,statuses:B,touched:L,listeners:N,parentListeners:C}=i.current;y._.remove(v,g),B.delete(g),L.delete(g),N.delete(g),C.delete(g)},[]),f=x.useCallback(g=>{const{statuses:v,touched:B}=i.current;i.current.state=g,h(""),v.clear(),B.clear()},[]),S=x.useCallback(g=>{var L;const{listeners:v}=i.current,B=p(g,{optional:!0});B!=null&&((L=v.get(g))==null||L.forEach(N=>N(B)))},[]),h=x.useCallback(g=>{const{listeners:v,parentListeners:B}=i.current,L=v.get(g);if(g==""&&([...v.keys()].forEach(P=>{var z;const b=p(P,{optional:!0});b!=null&&((z=v.get(P))==null||z.forEach(A=>{A(b)}))}),[...B.keys()].forEach(P=>{var z;const b=p(P,{optional:!0});b!=null&&((z=B.get(P))==null||z.forEach(A=>{A(b)}))})),L!=null){const N=p(g,{optional:!0});N!=null&&L.forEach(C=>{C(N)})}B.forEach((N,C)=>{if(y._.pathsMatch(g,C)){const b=p(C,{optional:!0});b!=null&&N.forEach(z=>{z(b)})}})},[]),R=x.useCallback((g,v="",B=!0)=>{const{statuses:L,listeners:N,touched:C}=i.current;if(g.success){const A=[...L.keys()];return L.clear(),A.forEach(Z=>S(Z)),!0}let P=!0;const b=new Set(g.error.issues.map(A=>A.path.join(".")));let z=(A,Z)=>A===Z;return B&&(z=(A,Z)=>y._.pathsMatch(A,Z)),g.error.issues.forEach(A=>{var J;const{message:Z}=A,I=A.path.join(".");if(!z(I,v))return;const Y=Ei(A);Y!=="warning"&&(P=!1),L.set(I,{key:I,variant:Y,message:Z}),C.add(I);let O=p(I,{optional:!0});O==null&&(O={value:void 0,status:L.get(I)??js(I),touched:!1,required:!1}),(J=N.get(I))==null||J.forEach(ee=>ee(O))}),L.forEach((A,Z)=>{b.has(Z)||(L.delete(Z),S(Z))}),P},[]),E=x.useCallback((g,v)=>{if(u.current==null)return!0;const{state:B}=i.current,L=u.current.safeParse(B);return R(L,g,v)},[R]),w=x.useCallback(async(g,v)=>{if(u.current==null)return!0;const{state:B}=i.current,L=await u.current.safeParseAsync(B);return R(L,g,v)},[R]),M=x.useCallback((g,v,B={})=>{const L=y._.get(i.current.state,g,{optional:!0}),{validateChildren:N=!0}=B,{state:C,touched:P}=i.current;P.add(g),g.length===0?i.current.state=v:y._.set(C,g,v),h(g),(async()=>{var z;let b;try{b=E(g,N)}catch{b=await w(g,N)}(z=a.current)==null||z.call(a,{values:i.current.state,path:g,prev:L,valid:b})})()},[]),$=x.useCallback(g=>y._.has(i.current.state,g),[]),_=x.useCallback((g,v)=>{i.current.statuses.set(g,v),i.current.touched.add(g),S(g)},[]),T=x.useCallback(()=>{const{statuses:g}=i.current;g.clear(),g.forEach((v,B)=>S(B))},[]);return x.useEffect(()=>{if(!t)return;const{listeners:g}=i.current;i.current.state=e,g.forEach((v,B)=>{const L=p(B,{optional:!0});L!=null&&v.forEach(N=>N(L))})},[t,e]),x.useMemo(()=>({bind:d,set:M,get:p,mode:r,validate:E,validateAsync:w,value:()=>i.current.state,has:$,remove:m,setStatus:_,clearStatuses:T,reset:f}),[d,M,p,E,w,$,m,_,T,f,r])},Ri=e=>n.jsxRuntimeExports.jsx(Ut.Provider,{value:e,children:e.children}),yi=c.componentRenderProp(c.Text$1),ie=({path:e,children:t=yi,label:s,padHelpText:r=!0,visible:o=!0,hideIfNull:i=!1,optional:u,onChange:a,className:d,...p})=>{const m=Te({path:e,optional:u??i,onChange:a}),f=be();if(m==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(s==null&&(s=l._.capitalize(y._.element(e,-1))),o=typeof o=="function"?o(m,f):o,!o)return null;const S=m.status.message,{onChange:h,value:R}=m,E={onChange:h,value:R};return m.variant!=null&&(E.variant=m.variant),n.jsxRuntimeExports.jsx(pe.Item,{padHelpText:r,helpText:S,helpTextVariant:m.status.variant,label:s,required:m.required,className:l.CSS(d,l.CSS.BE("field",e.split(".").join("-")),l.CSS.M(m.status.variant)),...p,children:t(E)})},ke=e=>({fieldKey:t,fieldProps:s,inputProps:r})=>{const o=({inputProps:i,path:u,fieldKey:a=t,...d})=>n.jsxRuntimeExports.jsx(ie,{...s,...d,path:a?`${u}.${a}`:u,children:p=>n.jsxRuntimeExports.jsx(e,{...p,...r,...i})});return o.displayName=e.displayName,o},on=ke(c.Numeric),Ci=on({}),ln=ke(c.Text$1),bi=ln({}),cn=ke(c.Switch$1),vi=cn({}),wi=ke(Ce),Ti=ke(Be),ki=ke(ue.DropdownButton),Wt=({key:e,open:t,onChange:s})=>{const r=c.useMemoPrimitiveArray(e);c.useAsyncEffect(async()=>{if(t==null)return;const o=await t();if(o!=null)return o.onChange(s),async()=>await o.close()},[t==null,r])},Pi=({fetchInitialValue:e,...t})=>{const[s,r]=x.useState(void 0);return c.useAsyncEffect(async()=>{r(await e())},[e]),Wt({...t,onChange:r}),s},Li=Object.freeze(Object.defineProperty({__proto__:null,useListener:Wt,useState:Pi},Symbol.toStringTag,{value:"Module"})),Mi=({key:e,name:t,queryFn:s,values:r,openObservable:o,applyChanges:i,applyObservable:u,...a})=>{const d=fe(),p=c.useAggregator(),m=c.useMemoPrimitiveArray(e),f=rn({values:r,...a,sync:!1,onChange:R=>{d!=null&&(async()=>{try{await(i==null?void 0:i({...R,client:d}))}catch(E){p({variant:"error",message:`Failed to save ${t}`,description:E.message})}})()}});c.useAsyncEffect(async()=>{if(d!=null)try{const R=await s({client:d});f.set("",R)}catch(R){p({variant:"error",message:`Failed to retrieve ${t}`,description:R.message})}},[m,d==null?void 0:d.key]);const S=x.useCallback(async()=>{if(d!=null)return await(o==null?void 0:o(d))},[m,d==null?void 0:d.key]),h=x.useCallback(R=>u==null?void 0:u({changes:R,ctx:f}),[m,u]);return Wt({key:m,open:S,onChange:h}),f},$i=Object.freeze(Object.defineProperty({__proto__:null,Context:Ut,Field:ie,Form:Ri,NumericField:Ci,SwitchField:vi,TextField:bi,buildDropdownButtonSelectField:ki,buildNumericField:on,buildSelectMultiField:Ti,buildSelectSingleField:wi,buildSwitchField:cn,buildTextField:ln,fieldArrayUtils:nn,fieldBuilder:ke,use:rn,useChildFieldValues:Si,useContext:be,useField:Te,useFieldArray:gi,useFieldListener:hi,useFieldState:sn,useFieldValid:fi,useFieldValue:ji,useSynced:Mi},Symbol.toStringTag,{value:"Module"})),_i=[{key:"name",name:"Name"},{key:"location",name:"Location"}],Ni=({searchOptions:e,...t})=>{const s=fe();let r=s==null?void 0:s.hardware.devices;return e!=null&&s!=null&&(r=s.hardware.devices.newSearcherWithOptions(e)),n.jsxRuntimeExports.jsx(Ce,{columns:_i,searcher:r,entryRenderKey:"name",...t})},Bi=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:Ni},Symbol.toStringTag,{value:"Module"})),He=(e,t)=>x.cloneElement(e,{className:l.CSS(e.props.className,l.CSS.B("sub"),l.CSS.M(t))}),Xt=({topRight:e,topLeft:t,bottomLeft:s,bottomRight:r,children:o,className:i,...u})=>n.jsxRuntimeExports.jsxs("div",{className:l.CSS(i,l.CSS.B("icon")),...u,children:[e&&He(e,"topRight"),t&&He(t,"topLeft"),s&&He(s,"bottomLeft"),r&&He(r,"bottomRight"),o]}),zi=e=>n.jsxRuntimeExports.jsx(Xt,{topRight:n.jsxRuntimeExports.jsx(c.St.Add,{}),...e}),Oi=e=>n.jsxRuntimeExports.jsx(Xt,{topRight:n.jsxRuntimeExports.jsx(c.St.Import,{}),...e}),Di=Object.freeze(Object.defineProperty({__proto__:null,Create:zi,Icon:Xt,Import:Oi},Symbol.toStringTag,{value:"Module"})),Me="label",Kt=[{key:"color",name:"Color",render:({entry:e})=>n.jsxRuntimeExports.jsx(c.St.Circle,{name:"circle",color:e.color,style:{height:"2.5rem",width:"2.5rem"}})},{key:"name",name:"Name"}],et=({items:e},t)=>{const s=c.filterByType(Me,e);return s.length>0&&!s.every(r=>t.includes(r.key))},Ai=({entry:e,loading:t,entryKey:s,entryRenderKey:r,...o})=>n.jsxRuntimeExports.jsx(Ve,{color:e==null?void 0:e.color,...o,children:e==null?void 0:e.name}),Vi=c.componentRenderProp(Ai),Ii=({onChange:e,className:t,value:s,...r})=>{const o=fe(),i=o!=null?void 0:n.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:u,onDragEnd:a,...d}=c.useDragAndDrop({type:"Label.SelectMultiple",canDrop:x.useCallback(S=>et(S,y.A(s)),[s]),onDrop:x.useCallback(({items:S})=>{const h=c.filterByType(Me,S);if(h.length===0)return[];const R=y.n([...y.A(s),...h.map(E=>E.key)]);return e(R,{clickedIndex:null,clicked:null,entries:[]}),h},[e,s])}),p=c.useDraggingState(),m=x.useCallback(({dropped:S})=>{e(y.A(s).filter(h=>!S.some(R=>R.key===h)),{clickedIndex:null,clicked:null,entries:[]})},[e,s]),f=x.useCallback((S,h)=>u([{key:h,type:Me}],m),[u,m]);return n.jsxRuntimeExports.jsx(Be,{className:l.CSS(t,l.CSS.dropRegion(et(p,y.A(s)))),value:s,onTagDragStart:f,onTagDragEnd:a,searcher:o==null?void 0:o.labels,onChange:e,columns:Kt,emptyContent:i,renderTag:Vi,addPlaceholder:"Label",...d,...r})},an=({value:e,onChange:t})=>{const s=fe(),r=s!=null?void 0:n.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),o=x.useId(),i=x.useMemo(()=>({key:o,type:"Label.SelectMultiple"}),[o]),u=c.useDragAndDrop({type:"Label.SelectSingle",canDrop:x.useCallback(p=>et(p,y.o(e)),[e]),onDrop:x.useCallback(({items:p})=>{const m=c.filterByType(Me,p);return m.length===0?[]:(t(m[0].key,{clickedIndex:null,clicked:null,entries:[]}),m)},[i,t])}),a=c.useDraggingState(),d=x.useCallback(()=>e!=null&&u.startDrag([{type:Me,key:e}]),[u.startDrag,e]);return{emptyContent:r,dragging:a,...u,onDragStart:d,searcher:s==null?void 0:s.labels}},Zi=({onChange:e,value:t,className:s,data:r,...o})=>{const{dragging:i,...u}=an({value:t,onChange:e});return n.jsxRuntimeExports.jsx(Ce,{data:r,className:l.CSS(s,l.CSS.dropRegion(et(i,y.o(t)))),value:t,onChange:e,columns:Kt,entryRenderKey:"name",...u,...o})},Fi=({data:e,value:t,onChange:s,...r})=>{const{dragging:o,...i}=an({value:t,onChange:s});return n.jsxRuntimeExports.jsx(Ce,{data:e,value:t,onChange:s,columns:Kt,entryRenderKey:"name",...i,...r})},qi=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:Me,SelectButton:Fi,SelectMultiple:Ii,SelectSingle:Zi},Symbol.toStringTag,{value:"Module"})),Hi=({visible:e,children:t,close:s,style:r,...o})=>{const i=x.useRef(null);return c.useClickOutside({ref:i,exclude:u=>c.findParent(u.target,d=>d.getAttribute("role")==="dialog")!=null,onClickOutside:s}),c.use$2({triggers:[["Escape"]],callback:s,loose:!0}),Bt.createPortal(n.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(l.CSS.BE("modal","bg"),l.CSS.visible(e)),empty:!0,align:"center",children:n.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(l.CSS.BE("modal","dialog")),role:"dialog",empty:!0,ref:i,...o,style:{zIndex:11,...r},children:n.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(l.CSS.BE("modal","content")),empty:!0,children:t})})}),c.getRootElement())},Yi=Object.freeze(Object.defineProperty({__proto__:null,Modal:Hi},Symbol.toStringTag,{value:"Module"})),Jt=new Error("Tab not found"),Gi=new Error("Invalid Mosaic"),tt=(e,t,s="center",r)=>{var f;if(e=Pe(e),r===void 0)return Tt(e,t);const o=Pt(e,r);if(s==="center")return(f=o.tabs)==null||f.push(t),o.selected=t.tabKey,e;const i=o.key*2,u=o.key*2+1,a=s==="top"||s==="left"?i:u;if(Pt(e,a).key!==o.key)return tt(e,t,"center",a);if(o.tabs==null||o.tabs.length===0)return tt(e,t,"center",r);const[d,p,m]=Xi(s);if(o.direction=m,o[d]={key:0,tabs:[t],selected:t.tabKey},o[p]={key:0,tabs:o.tabs,selected:o.selected},o.first==null||o.last==null)throw Gi;return o.first.key=i,o.last.key=u,o.tabs=void 0,o.size=void 0,o.selected=void 0,e},Tt=(e,t)=>(e=Pe(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=Tt(e.first,t):e.last!=null&&(e.last=Tt(e.last,t)),e)),st=e=>{e=Pe(e);const t=[];if(e.tabs!=null&&(e.selected=Q.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[s,r]=st(e.first);e.first=s,t.push(...r)}if(e.last!=null){const[s,r]=st(e.last);e.last=s,t.push(...r)}return[e,t]},Qt=(e,t)=>{var o;e=Pe(e);const[,s]=$e(e,t);if(s==null)return[e,null];s.tabs=(o=s.tabs)==null?void 0:o.filter(i=>i.tabKey!==t),s.selected=Q.resetSelection(s.selected,s.tabs),e=Wi(e);const r=s.selected??nt(e);return[e,r]},nt=e=>e.selected!=null?e.selected:e.first!=null?nt(e.first):e.last!=null?nt(e.last):null,un=(e,t)=>{e=Pe(e);const[s,r]=$e(e,t);if(s==null||r==null)throw Jt;return r.selected=t,e},xn=(e,t,s,r)=>{e=Pe(e);const[o,i]=$e(e,t);if(o==null||i==null)throw Jt;const[u,a]=Qt(e,t);return[tt(u,o,s,r),a]},kt=(e,t)=>{if(e.tabs!=null)return e.tabs.some(s=>s.tabKey===t)?e:void 0;if(e.first!=null){const s=kt(e.first,t);if(s!=null)return s}if(e.last!=null){const s=kt(e.last,t);if(s!=null)return s}},dn=(e,t,s)=>{const r=rt(e,t);if(r==null)throw new Error("Node not found");return r.size=s,e},mn=(e,t,s)=>{e=Pe(e);const[,r]=$e(e,t);if((r==null?void 0:r.tabs)==null)throw Jt;return r.tabs=Q.rename(t,s,(r==null?void 0:r.tabs)??[]),e},Ui=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,Pt=(e,t)=>{const s=rt(e,t);if(s!=null)return s;const r=Math.floor(t/2);return r===0?e:Pt(e,r)},Wi=e=>{let t=!0;for(;t;)[e,t]=Lt(e);return e.first==null&&e.last==null&&(e.key=1),e},Lt=e=>{if(e.first==null||e.last==null)return[e,!1];if(hs(e.first))return[fs(e.last,!0),!0];if(hs(e.last))return[fs(e.first,!1),!0];let[t,s]=[!1,!1];return[e.first,t]=Lt(e.first),[e.last,s]=Lt(e.last),[e,t||s]},fs=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),hs=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),$e=(e,t)=>{if(e.tabs!=null){const u=e.tabs.find(a=>a.tabKey===t);if(u!=null)return[u,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[s,r]=$e(e.first,t);if(s!=null&&r!=null)return[s,r];const[o,i]=$e(e.last,t);return[o,i]},rt=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const s=rt(e.first,t);return s??rt(e.last,t)},Xi=e=>{switch(e){case"top":return["first","last","y"];case"left":return["first","last","x"];case"bottom":return["last","first","y"];case"right":return["last","first","x"];case"center":throw new Error("cannot split a center placed tab")}},Pe=e=>y._.copy(e),ot=(e,t,s=[])=>(s.push(t(e)),e.first!=null&&ot(e.first,t,s),e.last!=null&&ot(e.last,t,s),s),Mt=(e,t)=>{t(e),e.first!=null&&Mt(e.first,t),e.last!=null&&Mt(e.last,t)};class Ki{constructor(t={}){Se(this,"parent");Se(this,"stub");Se(this,"el");this.el=document.createElement("div"),Object.entries(t).forEach(([s,r])=>this.el.setAttribute(s,r))}mount(t,s){s!==this.stub&&(this.unmount(null),t.replaceChild(this.el,s),this.parent=t,this.stub=s)}unmount(t){t!=null&&t!==this.stub||this.parent==null||this.stub==null||(this.parent.replaceChild(this.stub,this.el),this.parent=void 0,this.stub=void 0)}}const Ji=({node:e})=>{const t=x.createRef(),s=x.useRef(e);return x.useEffect(()=>{const r=t.current;if(r==null)return;const o=r.parentNode;if(o!=null)return e.mount(o,r),()=>{t.current!=null&&e.unmount(t.current)}},[]),x.useEffect(()=>{s.current!=null&&e!==s.current&&(s.current.unmount(t.current),s.current=e);const r=t.current;if(r==null)return;const o=r.parentNode;o!=null&&e.mount(o,r)},[e]),n.jsxRuntimeExports.jsx("div",{ref:t})},Qi=({node:e,children:t})=>Bt.createPortal(t,e.el),pn=x.memo(({children:e,...t})=>{const s=x.useRef(new Map),r=new Set,o=ot(t.root,i=>{var d;if(i.selected==null)return null;let u=s.current.get(i.selected);const a=(d=i.tabs)==null?void 0:d.find(p=>p.tabKey===i.selected);return a==null?null:(u==null&&(u=new Ki({style:"width: 100%; height: 100%; position: relative;"}),u.el.addEventListener("click",()=>{var p;return(p=t.onSelect)==null?void 0:p.call(t,a.tabKey)}),s.current.set(i.selected,u)),r.add(i.selected),n.jsxRuntimeExports.jsx(Qi,{node:u,children:e(a)},a.tabKey))});return s.current.forEach((i,u)=>!r.has(u)&&s.current.delete(u)),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[o,n.jsxRuntimeExports.jsx(lt,{portalNodes:s,...t})]})}),lt=x.memo(e=>{const{onResize:t,...s}=e,{root:{tabs:r,direction:o,first:i,last:u,key:a,size:d},emptyContent:p,...m}=s,f=x.useCallback(([R])=>t(a,R),[t]),{props:S}=zt({direction:o,onResize:f,count:2,initialSizes:d!=null?[d]:void 0});let h;return r!==void 0?h=n.jsxRuntimeExports.jsx(jn,{emptyContent:p,...s}):i!=null&&u!=null?h=n.jsxRuntimeExports.jsxs(ut,{align:"stretch",className:l.CSS.BE("mosaic","resize"),...S,children:[n.jsxRuntimeExports.jsx(lt,{...m,root:i,onResize:t},i.key),n.jsxRuntimeExports.jsx(lt,{...m,root:u,onResize:t},u.key)]}):(h=null,console.warn("Mosaic tree is malformed")),a===1?n.jsxRuntimeExports.jsx(c.Provider$2,{children:h}):h});pn.displayName="Mosaic";lt.displayName="Mosaic";const it="pluto-mosaic-tab-drop",es="pluto-mosaic-tab-create",ec=(e,t,s)=>{if(c.filterByType(c.FILE_TYPE,t).length>0&&s)return!0;const o=c.filterByType(it,t).map(a=>a.key),i=e.filter(a=>!o.includes(a.tabKey)).length>0;return c.filterByType(es,t).length>0||o.length>0&&(i||e.length===0)},jn=x.memo(({root:e,onDrop:t,onCreate:s,portalNodes:r,activeTab:o,onFileDrop:i,...u})=>{const{key:a,tabs:d}=e,[p,m]=x.useState(null),f=i!=null,S=x.useCallback(({items:g})=>ec(d,g,f),[d,f]),h=x.useCallback(({items:g,event:v})=>{if(v==null)return[];m(null);const B=c.filterByType(c.FILE_TYPE,g).length>0,L=d.length===0?"center":gs(Ss(v));if(B)return i==null||i(a,L,v),g;const N=c.filterByType(it,g);if(N.length>0){const P=N.map(({key:b})=>b)[0];t(a,P,L)}const C=c.filterByType(es,g);if(C.length>0){const P=C.map(({key:b})=>b);s==null||s(a,L,P)}return N},[t,d.length]),R=x.useCallback(({event:g})=>{if(g==null)return;const v=d.length===0?"center":gs(Ss(g));m(v)},[d.length]),{startDrag:E,...w}=c.useDragAndDrop({type:"Mosaic",canDrop:S,onDrop:h,onDragOver:R}),M=S(c.useDraggingState()),$=x.useCallback(()=>m(null),[]),_=x.useCallback((g,{tabKey:v})=>{E([{key:v,type:it,elementID:g.currentTarget.id}])},[E]),T=x.useCallback(()=>s==null?void 0:s(a,"center"),[a]);return n.jsxRuntimeExports.jsxs("div",{className:l.CSS.BE("mosaic","leaf"),children:[n.jsxRuntimeExports.jsxs(Q.Tabs,{id:`tab-${a}`,tabs:d,onDragLeave:$,selected:e.selected,selectedAltColor:o===e.selected,onDragStart:_,onCreate:T,...u,...w,children:[n.jsxRuntimeExports.jsx(Ji,{node:r.current.get(e.selected)}),M&&n.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}})]}),p!=null&&n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("mosaic","mask"),style:tc[p]})]})});jn.displayName="MosaicTabLeaf";const tc={top:{left:"0%",top:"0%",width:"100%",height:"50%"},bottom:{left:"0%",top:"50%",width:"100%",height:"50%"},left:{left:"0%",top:"0%",width:"50%",height:"100%"},right:{left:"50%",top:"0%",width:"50%",height:"100%"},center:{left:"0%",top:"0%",width:"100%",height:"100%"}},Ss=e=>{const t=e.currentTarget.getBoundingClientRect(),s=e.clientX-t.left,r=e.clientY-t.top;return r<24?{px:.5,py:.5}:{px:s/t.width,py:r/t.height}},sc=e=>e,nc=e=>1-e,gs=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[s,r]=[sc(e),nc(e)];if(t>s&&t>r)return"bottom";if(t<s&&t<r)return"top";if(t>s&&t<r)return"left";if(t<s&&t>r)return"right";throw new Error("[bug] - invalid insert position")},rc=le.z.object({key:le.z.number(),tabs:le.z.array(Q.tabZ).optional(),selected:le.z.string().optional(),direction:l.g.direction.optional(),size:le.z.number().optional()}),$t=rc.extend({first:le.z.lazy(()=>$t).optional(),last:le.z.lazy(()=>$t).optional()}),oc=({allowRename:e=!1,initialTree:t})=>{const[s,r]=x.useState(t);return x.useEffect(()=>r(st(t)[0]),[t]),{root:s,onDrop:(p,m,f)=>r(S=>xn(S,m,f,p)[0]),onClose:p=>r(m=>Qt(m,p)[0]),onSelect:p=>r(m=>un(m,p)),onResize:(p,m)=>r(f=>dn(f,p,m)),onRename:e?(p,m)=>r(f=>mn(f,p,m)):void 0}},lc=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:es,HAUL_DROP_TYPE:it,Mosaic:pn,autoSelectTabs:st,findSelected:nt,findTabNode:kt,forEachNode:Mt,insertTab:tt,isEmpty:Ui,mapNodes:ot,moveTab:xn,nodeZ:$t,removeTab:Qt,renameTab:mn,resizeNode:dn,selectTab:un,use:oc},Symbol.toStringTag,{value:"Module"})),ic=({location:e="left",size:t="9rem",className:s,style:r,...o})=>{const i=l.J.construct(e),u=l.J.direction(i),a=l.g.swap(u);return n.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(l.CSS.B("navbar"),l.CSS.bordered(l.J.swap(i)),l.CSS.dir(a),l.CSS.loc(i),s),direction:a,style:{[l.g.dimension(u)]:t,...r},align:"center",empty:!0,...o})},Ze=e=>({bordered:t=!1,className:s,...r})=>n.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(l.CSS.BE("navbar","content"),e==="absolute-center"?l.CSS.M(e):l.CSS.align(e),e!==""&&t&&l.CSS.bordered(e),s),align:"center",...r}),fn=Ze("start");fn.displayName="NavbarStart";const hn=Ze("end");hn.displayName="NavbarEnd";const Sn=Ze("center");Sn.displayName="NavbarCenter";const gn=Ze("");gn.displayName="NavbarContent";const En=Ze("absolute-center");En.displayName="NavbarAbsoluteCenter";const ze=ic;ze.Start=fn;ze.Center=Sn;ze.End=hn;ze.AbsoluteCenter=En;ze.Content=gn;const ts=({aetherKey:e})=>{const[,{region:t},s]=c.use$3({aetherKey:e,type:j.Eraser$1.TYPE,schema:j.eraserStateZ,initialState:{region:l.To.ZERO,enabled:!0}}),r=c.useSyncedRef(t),o=x.useCallback(u=>{l.To.equals(u,r.current)||s(a=>({...a,region:u}))},[s]);return{setEnabled:x.useCallback(u=>s(a=>({...a,enabled:u})),[s]),erase:o}},cc=c.wrap$1(j.Eraser$1.TYPE,({aetherKey:e,children:t})=>{const{erase:s}=ts({aetherKey:e}),r=c.useResize(s);return n.jsxRuntimeExports.jsx("div",{ref:r,className:l.CSS(l.CSS.inheritDims()),children:t})}),ac=Object.freeze(Object.defineProperty({__proto__:null,Eraser:cc,use:ts},Symbol.toStringTag,{value:"Module"})),uc=({items:e,initialKey:t})=>{const[s,r]=x.useState(t),o=u=>r(u===s?void 0:u),i=e.find(u=>u.key===s);return{onSelect:o,activeItem:i}},xc=c.wrap$1("Nav.Drawer",({aetherKey:e,activeItem:t,children:s,onSelect:r,location:o="left",collapseThreshold:i=.65,className:u,onResize:a,...d})=>{const p=l.J.direction(o),m=x.useCallback(()=>t!=null&&(r==null?void 0:r(t.key)),[r,t==null?void 0:t.key]),{erase:f,setEnabled:S}=ts({aetherKey:e}),h=x.useCallback((M,$)=>{a==null||a(M,$),f($)},[a,f]);if(x.useLayoutEffect(()=>{S(t!=null)},[t,S]),t==null)return null;const{content:R,key:E,...w}=t;return n.jsxRuntimeExports.jsx(Cs,{className:l.CSS(l.CSS.BE("navdrawer","content"),l.CSS.dir(p),u),collapseThreshold:i,onCollapse:m,location:o,onResize:h,...w,...d,children:t.content},E)}),dc=Object.freeze(Object.defineProperty({__proto__:null,Bar:ze,Drawer:xc,useDrawer:uc},Symbol.toStringTag,{value:"Module"})),mc=({variant:e,className:t,children:s,...r})=>n.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(t,l.CSS.B("note"),l.CSS.M(e)),align:"stretch",empty:!0,...r,children:s}),pc=Object.freeze(Object.defineProperty({__proto__:null,Note:mc},Symbol.toStringTag,{value:"Module"})),yt={Close:n.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),n.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:n.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:n.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsxRuntimeExports.jsx("path",{d:"M108.242 32.8833C108.797 32.8817 109.247 33.3317 109.245 33.8862L109.092 87.5891C109.09 88.4786 108.014 88.9223 107.385 88.2933L53.8351 34.7432C53.2061 34.1142 53.6499 33.0387 54.5394 33.0361L108.242 32.8833Z",fill:"#0B650D"}),n.jsxRuntimeExports.jsx("path",{d:"M33.8862 109.245C33.3317 109.247 32.8818 108.797 32.8833 108.242L33.0361 54.5394C33.0387 53.6499 34.1142 53.2061 34.7432 53.8351L88.2934 107.385C88.9223 108.014 88.4786 109.09 87.5891 109.092L33.8862 109.245Z",fill:"#0B650D"})]})},jc=({disabled:e=[],className:t,focused:s=!0,onMinimize:r,onMaximize:o,onFullscreen:i,onClose:u,...a})=>n.jsxRuntimeExports.jsxs(D.Space,{size:1.5,direction:"x",className:l.CSS(l.CSS.B("macos-controls"),!s&&l.CSS.BM("macos-controls","blurred"),t),...a,children:[n.jsxRuntimeExports.jsx(Ct,{onClick:u,className:l.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:yt.Close}),n.jsxRuntimeExports.jsx(Ct,{onClick:r,className:l.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:yt.Minimize}),n.jsxRuntimeExports.jsx(Ct,{onClick:i,className:l.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:yt.Maximize})]}),Ct=({className:e,disabled:t,color:s,...r})=>n.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("macos-control"),l.CSS.disabled(t),e),tabIndex:-1,disabled:t,size:"",...r}),bt=({disabled:e=[],onMinimize:t,onMaximize:s,onClose:r,onFullscreen:o,focused:i,...u})=>n.jsxRuntimeExports.jsxs(D.Pack,{...u,children:[n.jsxRuntimeExports.jsx(vt,{className:l.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:n.jsxRuntimeExports.jsx(c.St.Subtract,{})}),n.jsxRuntimeExports.jsx(vt,{className:l.CSS.BM("windows-control","maximize"),onClick:s,disabled:e.includes("maximize"),children:n.jsxRuntimeExports.jsx(c.St.Box,{})}),n.jsxRuntimeExports.jsx(vt,{onClick:r,className:l.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:n.jsxRuntimeExports.jsx(c.St.Close,{})})]}),vt=({disabled:e=!1,className:t,...s})=>e?null:n.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS(l.CSS.B("windows-control"),t),tabIndex:-1,...s}),Rn=e=>y.w$1.getOS(e),fc={MacOS:jc,Windows:bt,Linux:bt,Docker:bt},hc="Windows",Sc=({forceOS:e,visibleIfOS:t,...s})=>{const r=Rn({force:e,default:hc}),o=fc[r];return t!=null&&t!==r?null:n.jsxRuntimeExports.jsx(o,{...s})},gc=Object.freeze(Object.defineProperty({__proto__:null,Controls:Sc,use:Rn},Symbol.toStringTag,{value:"Module"}));x.createContext({instrumentation:y.B$1.NOOP});const Ec=c.wrap$1(j.Provider$2.TYPE,({aetherKey:e,children:t,...s})=>{const r=c.useMemoDeepEqualProps(s),[{path:o},,i]=c.use$3({aetherKey:e,type:j.Provider$2.TYPE,schema:j.providerStateZ$1,initialState:r});return x.useEffect(()=>{i(r)},[r,i]),n.jsxRuntimeExports.jsx(c.Composite,{path:o,children:t})}),Rc="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjQgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",yn=c.wrap$1(j.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:s}]=c.use$3({aetherKey:t,type:j.BaseProvider.TYPE,schema:j.providerStateZ$2,initialState:{}});return n.jsxRuntimeExports.jsx(c.Composite,{path:s,children:e})}),yc=Object.freeze(Object.defineProperty({__proto__:null,Provider:yn},Symbol.toStringTag,{value:"Module"})),Cc=e=>{var t,s;switch(e.variant){case"disabled":return((t=e.data)==null?void 0:t.valid)===!0?{message:"Uncontrolled. Click to take control.",chipColor:"var(--pluto-gray-l10)"}:{message:"No channel connected",chipColor:"var(--pluto-gray-l5)",disabled:!0};case"error":return{message:"Not controlled by you. Click to take absolute control.",chipColor:"var(--pluto-error-z)"};case"success":return((s=e.data)==null?void 0:s.authority)===y.sd.Authority.Absolute.valueOf()?{message:"You have absolute control. Click to release.",chipColor:"var(--pluto-secondary-z)",buttonStyle:{background:"var(--pluto-secondary-z-30)"}}:{message:"You're in control. Release P&ID to release control.",chipColor:"var(--pluto-primary-z)"};default:return{message:"Unexpected status.",chipColor:"var(--pluto-error-z)"}}},Cn=c.wrap$1("Chip",({aetherKey:e,source:t,sink:s,className:r,...o})=>{const i=c.useMemoDeepEqualProps({source:t,sink:s}),[,{status:u},a]=c.use$3({aetherKey:e,type:j.Chip.TYPE,schema:j.chipStateZ,initialState:{triggered:!1,...i,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:y.m.now()}}});x.useEffect(()=>{a(h=>({...h,...i}))},[i,a]);const d=x.useCallback(()=>a(h=>({...h,triggered:!h.triggered})),[a]),{message:p,chipColor:m,buttonStyle:f,disabled:S}=Cc(u);return n.jsxRuntimeExports.jsx(c.Icon,{variant:"text",className:l.CSS(l.CSS.B("control-chip"),r),disabled:S,onClick:d,tooltip:n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:p}),style:f,...o,children:n.jsxRuntimeExports.jsx(c.St.Circle,{color:m})})}),bn=x.createContext({needsControlOf:[]}),vn=()=>x.useContext(bn),bc=c.wrap$1(j.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:s,...r})=>{const o=c.useMemoDeepEqualProps(r),[{path:i},{status:u,needsControlOf:a},d]=c.use$3({aetherKey:e,type:j.Controller$1.TYPE,schema:j.controllerStateZ,initialState:o});return x.useEffect(()=>{u!=null&&(s==null||s(u))},[u,s]),x.useEffect(()=>{d(p=>({...p,...o}))},[o,d]),x.useEffect(()=>()=>s==null?void 0:s("released"),[]),n.jsxRuntimeExports.jsxs(bn.Provider,{value:{needsControlOf:a},children:[n.jsxRuntimeExports.jsx(c.Composite,{path:i,children:t}),";"]})}),wn=c.wrap$1(j.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:s})=>{var d;const r=c.useMemoDeepEqualProps({colorSource:t,statusSource:s}),[,{color:o,status:i},u]=c.use$3({aetherKey:e,type:j.Indicator.TYPE,initialState:{...r,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:y.m.now()}},schema:j.indicatorStateZ});x.useEffect(()=>{u(p=>({...p,...r}))},[r,u]);let a;return((d=i.data)==null?void 0:d.color)!=null?a=l.Color.z.parse(i.data.color):o!=null&&!o.isZero?a=o:a="var(--pluto-gray-l8)",n.jsxRuntimeExports.jsxs(c.Dialog$1,{location:{x:"center",y:"bottom"},children:[n.jsxRuntimeExports.jsx(c.Text,{level:"p",children:i.message}),n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("indicator"),style:{backgroundColor:l.cssString(a),flexGrow:1}})]})}),vc=c.wrap$1(j.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:s}=vn(),[,{states:r},o]=c.use$3({aetherKey:e,type:j.Legend.TYPE,schema:j.legendStateZ,initialState:{states:[],needsControlOf:s}});x.useEffect(()=>{o(a=>({...a,needsControlOf:s}))},[s]);const u=y.n(r.map(a=>a.subject.key)).map(a=>{const d=r.find(p=>p.subject.key===a);if(d==null)throw new y.Se("Legend subject not found");return{key:d.subject.key,label:d.subject.name,color:d.subjectColor}});return n.jsxRuntimeExports.jsx(Zt,{data:u,...t})}),Tn=c.wrap$1(j.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:s}]=c.use$3({aetherKey:e,type:j.StateProvider.TYPE,schema:j.stateProviderStateZ,initialState:{}});return n.jsxRuntimeExports.jsx(c.Composite,{path:s,children:t})}),wc=Object.freeze(Object.defineProperty({__proto__:null,Chip:Cn,Controller:bc,Indicator:wn,Legend:vc,StateProvider:Tn,useContext:vn},Symbol.toStringTag,{value:"Module"})),kn=e=>{const t=({disabled:s=!1,...r})=>s?r.children:n.jsxRuntimeExports.jsx(e,{...r});return t.displayName=e.displayName,t},Tc=kn(yn),kc=kn(c.Provider$3),Pc=({children:e,connParams:t,workerEnabled:s=!0,workerURL:r,theming:o,tooltip:i,triggers:u,alamos:a,haul:d,channelAlias:p,telem:m})=>n.jsxRuntimeExports.jsx(c.Provider$1,{...u,children:n.jsxRuntimeExports.jsx(c.Config,{...i,children:n.jsxRuntimeExports.jsx(c.Provider$2,{...d,children:n.jsxRuntimeExports.jsx(c.Provider$4,{url:r??Rc,enabled:s,children:n.jsxRuntimeExports.jsx(kc,{workerKey:"vis",children:n.jsxRuntimeExports.jsx(Ec,{...a,children:n.jsxRuntimeExports.jsx(c.Aggregator,{children:n.jsxRuntimeExports.jsx(vs,{connParams:t,children:n.jsxRuntimeExports.jsx(ks,{...p,children:n.jsxRuntimeExports.jsx(Tc,{...m,children:n.jsxRuntimeExports.jsx(c.Provider,{...o,children:n.jsxRuntimeExports.jsx(Tn,{children:e})})})})})})})})})})})}),Lc=Object.freeze(Object.defineProperty({__proto__:null,Provider:Pc},Symbol.toStringTag,{value:"Module"})),Mc=({value:e})=>n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("progress"),children:n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("progress-bar"),style:{width:`${e}%`}})}),$c=Object.freeze(Object.defineProperty({__proto__:null,Progress:Mc},Symbol.toStringTag,{value:"Module"})),Ie="range",ss=[{key:"name",name:"Name"}],ct=({items:e},t)=>{const s=c.filterByType(Ie,e);return s.length>0&&!s.every(r=>t.includes(r.key))},_c=({onChange:e,className:t,value:s,...r})=>{const o=fe(),i=o!=null?void 0:n.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:u,onDragEnd:a,...d}=c.useDragAndDrop({type:"Ranger.SelectMultiple",canDrop:x.useCallback(S=>ct(S,y.A(s)),[s]),onDrop:x.useCallback(({items:S})=>{const h=c.filterByType(Ie,S);if(h.length===0)return[];const R=y.n([...y.A(s),...h.map(E=>E.key)]);return e(R,{clickedIndex:null,clicked:null,entries:[]}),h},[e,s])}),p=c.useDraggingState(),m=x.useCallback(({dropped:S})=>{e(y.A(s).filter(h=>!S.some(R=>R.key===h)),{clickedIndex:null,clicked:null,entries:[]})},[e,s]),f=x.useCallback((S,h)=>u([{key:h,type:Ie}],m),[u,m]);return n.jsxRuntimeExports.jsx(Be,{className:l.CSS(t,l.CSS.dropRegion(ct(p,y.A(s)))),value:s,onTagDragStart:f,onTagDragEnd:a,searcher:o==null?void 0:o.ranges,onChange:e,columns:ss,emptyContent:i,entryRenderKey:"name",...d,...r})},Pn=({value:e,onChange:t})=>{const s=fe(),r=s!=null?void 0:n.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),o=x.useId(),i=x.useMemo(()=>({key:o,type:"Ranger.SelectMultiple"}),[o]),{startDrag:u,...a}=c.useDragAndDrop({type:"Ranger.SelectSingle",canDrop:x.useCallback(m=>ct(m,y.o(e)),[e]),onDrop:x.useCallback(({items:m})=>{const f=c.filterByType(Ie,m);return f.length===0?[]:(t(f[0].key,{clickedIndex:null,clicked:null,entries:[]}),f)},[i,t])}),d=c.useDraggingState(),p=x.useCallback(()=>e!=null&&u([{type:Ie,key:e}]),[u,e]);return{emptyContent:r,dragging:d,...a,onDragStart:p,searcher:s==null?void 0:s.ranges}},Nc=({onChange:e,value:t,className:s,data:r,...o})=>{const{dragging:i,...u}=Pn({value:t,onChange:e});return n.jsxRuntimeExports.jsx(Ce,{data:r,className:l.CSS(s,l.CSS.dropRegion(ct(i,y.o(t)))),value:t,onChange:e,columns:ss,entryRenderKey:"name",...u,...o})},Bc=({data:e,value:t,onChange:s,...r})=>{const{dragging:o,...i}=Pn({value:t,onChange:s});return n.jsxRuntimeExports.jsx(Ce,{data:e,value:t,onChange:s,columns:ss,entryRenderKey:"name",...i,...r})},zc=[{key:"color",name:"Color",width:50,render:e=>n.jsxRuntimeExports.jsx(c.St.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],Oc=e=>{const t=fe();return n.jsxRuntimeExports.jsx(Be,{...e,searcher:t==null?void 0:t.labels,columns:zc,renderTag:s=>s.entry==null?n.jsxRuntimeExports.jsx(Ve,{color:"gray",children:s.entryKey}):n.jsxRuntimeExports.jsx(Ve,{color:s.entry.color,children:s.entry.name})})},Dc=({timeRange:e,level:t="p",shade:s=7,showSpan:r=!1,...o})=>{const i=new y.m(e.start),u=i.isToday?"time":"dateTime",a=new y.m(e.end),d=a.equals(y.m.MAX),p=a.span(i)<y.w.DAY?"time":"dateTime",m=i.span(a);return n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",size:"small",className:l.CSS(l.CSS.B("time-range-chip")),align:"center",...o,children:[i.isToday&&n.jsxRuntimeExports.jsx(c.Text,{level:t,shade:s,weight:450,children:"Today"}),n.jsxRuntimeExports.jsx(c.DateTime,{level:t,displayTZ:"local",format:u,shade:s,weight:450,children:i}),n.jsxRuntimeExports.jsx(c.St.Arrow.Right,{color:"var(--pluto-text-color)"}),d?n.jsxRuntimeExports.jsx(c.Text,{level:t,children:"Now"}):n.jsxRuntimeExports.jsx(c.DateTime,{level:t,displayTZ:"local",format:p,shade:s,weight:450,children:a}),!m.isZero&&r&&n.jsxRuntimeExports.jsxs(c.Text,{level:t,shade:s,weight:450,children:["(",i.span(a).truncate(y.w.MILLISECOND).toString(),")"]})]})},Ac=Object.freeze(Object.defineProperty({__proto__:null,SelectButton:Bc,SelectLabels:Oc,SelectMultiple:_c,SelectSingle:Nc,TimeRangeChip:Dc},Symbol.toStringTag,{value:"Module"})),Vc=({steps:e,value:t,onChange:s,...r})=>{const o=e.findIndex(i=>i.key===t);return n.jsxRuntimeExports.jsx(D.Space,{direction:"x",align:"center",className:l.CSS.B("steps"),...r,children:e.map((i,u)=>n.jsxRuntimeExports.jsxs(x.Fragment,{children:[n.jsxRuntimeExports.jsxs(c.Button,{onClick:()=>s(i.key),variant:"outlined",disabled:u>o,children:[u+1,". ",i.title]},i.key),u!==e.length-1&&n.jsxRuntimeExports.jsx(c.St.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},i.key))})},Ic=Object.freeze(Object.defineProperty({__proto__:null,Steps:Vc},Symbol.toStringTag,{value:"Module"})),Zc=(e,t="x")=>{if(e.length===0)return[];const s=l.J.construct(t),r=l.J.swap(s);return e.sort((o,i)=>l.To.loc(o.box,s)-l.To.loc(i.box,s)),e.forEach((o,i)=>{if(i===0)return;const a=e[i-1].handles.find(h=>h.orientation===r),d=o.handles.find(h=>h.orientation===s);if(a==null||d==null)return;const p=a.absolutePosition,m=d.absolutePosition,f=l.q.set(l.q.translation(m,p),t,0),S=l.q.translate(l.To.topLeft(o.box),f);o.box=l.To.construct(S,l.To.dims(o.box))}),e},ns=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},oe=(e,t)=>{const s=ns(t),r=e.getNodes().find(o=>o.id===t);if(r==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return l.To.construct(r.position,l.To.dims(l.To.construct(s)))},Fc=(e,t)=>ft.fromFlow(e,t);class Ln{constructor(t,s){Se(this,"node_",null);Se(this,"position");Se(this,"orientation");this.position=t,this.orientation=s}set node(t){this.node_=t}get node(){if(this.node_==null)throw new Error("[schematic] - handle has no node");return this.node_}get absolutePosition(){return l.q.translate(l.To.topLeft(this.node.box),this.position)}}class ft{constructor(t,s,r){Se(this,"key");Se(this,"box");Se(this,"handles");this.key=t,this.box=s,this.handles=r,r.forEach(o=>o.node=this)}static fromFlow(t,s){const r=oe(s,t),o=ns(t),i=o.getElementsByClassName("react-flow__handle"),u=l.To.construct(o),a=Array.from(i).map(d=>{const p=l.To.center(l.To.construct(d)),m=l.q.translation(l.To.topLeft(u),p),f=d.className.match(/react-flow__handle-(\w+)/);if(f==null)throw new Error("[schematic] - cannot find handle orientation");const S=l.J.construct(f[0]);return new Ln(m,S)});return new ft(t,r,a)}}const qc=({fromX:e,fromY:t,toX:s,toY:r,fromPosition:o,toPosition:i,fromNode:u,connectionLineStyle:a,connectionStatus:d})=>{const p=document.querySelector(".react-flow__handle-connecting"),m=p==null?void 0:p.className.match(/react-flow__handle-(\w+)/);if(m!=null){const R=l.J.outer.safeParse(m[1]);R.success&&(i=R.data)}const f=j.buildNew({sourcePos:l.q.construct(e,t),targetPos:l.q.construct(s,r),sourceOrientation:o,targetOrientation:i,sourceBox:oe(j.useReactFlow(),(u==null?void 0:u.id)??""),targetBox:oe(j.useReactFlow(),(u==null?void 0:u.id)??"")}),S=j.useReactFlow(),h=j.segmentsToPoints(l.q.construct(e,t),f,S.getZoom(),!1);return n.jsxRuntimeExports.jsx(j.BaseEdge,{path:Mn(h),style:{...a,stroke:l.cssString(d==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},Hc=({id:e,source:t,target:s,sourcePosition:r,targetHandleId:o,targetPosition:i,style:u,segments:a=[],onSegmentsChange:d,color:p="var(--pluto-gray-l9)",selected:m=!1,...f})=>{const S=l.q.construct(f.sourceX,f.sourceY),h=x.useRef(S),R=l.q.equals(S,h.current),E=l.q.construct(f.targetX,f.targetY),w=x.useRef(E),M=l.q.equals(E,w.current),$=j.useReactFlow(),[_,T,g]=c.useCombinedStateAndRef(()=>a.length>0?a:j.buildNew({sourcePos:S,targetPos:E,sourceOrientation:r,targetOrientation:i,sourceBox:oe($,t),targetBox:oe($,s)})),v=x.useRef(i),B=x.useRef(r),L=c.useDebouncedCallback(d,100,[d]);if(!R||!M){let b=_;const z=l.q.translation(h.current,S),A=l.q.translation(E,w.current);l.q.equals(z,l.q.scale(A,-1),.001)?(h.current=S,w.current=E):(R?M||(b=j.moveTargetNode({delta:A,segments:b}),v.current!==i&&(v.current=i,b=j.buildNew({sourcePos:S,targetPos:E,sourceOrientation:r,targetOrientation:i,sourceBox:oe($,t),targetBox:oe($,s)})),j.checkIntegrity({sourcePos:S,targetPos:E,next:b,prev:_})||(b=j.buildNew({sourcePos:S,targetPos:E,sourceOrientation:r,targetOrientation:i,sourceBox:oe($,t),targetBox:oe($,s)})),w.current=E):(b=j.moveSourceNode({delta:z,segments:b}),B.current!==r&&(B.current=r,b=j.buildNew({sourcePos:S,targetPos:E,sourceOrientation:r,targetOrientation:i,sourceBox:oe($,t),targetBox:oe($,s)})),j.checkIntegrity({sourcePos:S,targetPos:E,next:b,prev:_})||(b=j.buildNew({sourcePos:S,targetPos:E,sourceOrientation:r,targetOrientation:i,sourceBox:oe($,t),targetBox:oe($,s)})),h.current=S),L(b),T(b))}const N=x.useRef(null),C=xt({onStart:x.useCallback((b,z,A)=>{N.current={index:Number(A.currentTarget.id.split("-")[1]),segments:[...g.current]}},[]),onMove:x.useCallback(b=>{if(N.current==null)return;const z=j.dragSegment({segments:N.current.segments,index:N.current.index,magnitude:l.To.dim(b,l.g.swap(N.current.segments[N.current.index].direction),!0)/$.getZoom()});T(z)},[]),onEnd:x.useCallback(()=>d(g.current),[d])}),P=j.segmentsToPoints(S,_,$.getZoom(),!0);return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(j.BaseEdge,{path:Mn(P),style:{...u,stroke:l.cssString(p)},...f}),m&&Yc(P).map((b,z)=>{const A=_[z].direction,Z=l.g.swap(A),I={[l.g.dimension(A)]:"18px",[l.g.dimension(Z)]:"4px"},Y={[A]:b[A]-9,[Z]:b[Z]-2};return n.jsxRuntimeExports.jsxs(x.Fragment,{children:[n.jsxRuntimeExports.jsx("rect",{className:l.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...I,...Y,rx:"2px",ry:"2px"}),n.jsxRuntimeExports.jsx("foreignObject",{x:b.x-9,y:b.y-9,width:"18px",height:"18px",children:n.jsxRuntimeExports.jsx("div",{id:`handle-${z}`,className:l.CSS(l.CSS.BE("diagram-edge-handle","dragger"),l.CSS.dir(A)),draggable:!0,onDragStart:C})})]},z)})]})},Mn=e=>{let t="";const r=e.length+-1;for(let o=0;o<r;o++){const i=e[o%e.length],u=e[(o+1)%e.length],a=Math.min(6/Math.hypot(u.x-i.x,u.y-i.y),.5);o>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-a)+u.x*a},${i.y*(1-a)+u.y*a}`),o===0?t+=`M${i.x},${i.y}`:o===0&&(t+=`M${i.x*(1-a)+u.x*a},${i.y*(1-a)+u.y*a}`),o===r-1?t+=`L${u.x},${u.y}`:o<r-1&&(t+=`L${i.x*a+u.x*(1-a)},${i.y*a+u.y*(1-a)}`)}return t},Yc=e=>e.slice(1).map((t,s)=>{const r=e[s];return l.q.construct((t.x+r.x)/2,(t.y+r.y)/2)}),Gc=({initialNodes:e,initialEdges:t,allowEdit:s=!0,initialViewport:r={position:l.q.ZERO,zoom:1}})=>{const[o,i]=x.useState(s),[u,a]=x.useState(e),[d,p]=x.useState(t),[m,f]=x.useState(r),[S,h]=x.useState(!1);return{viewport:m,onViewportChange:f,edges:d,nodes:u,onNodesChange:a,onEdgesChange:p,editable:o,onEditableChange:i,fitViewOnResize:S,setFitViewOnResize:h}},Uc=e=>e.source!==e.target,Wc={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1},Xc={connectionRadius:0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnDoubleClick:!1,zoomOnPinch:!1,edgesFocusable:!1,edgesUpdatable:!1,nodesFocusable:!1,edgeUpdaterRadius:0},$n={padding:0,maxZoom:1,minZoom:.5},Kc={hideAttribution:!0},_n=x.createContext({editable:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),Fe=()=>x.useContext(_n),Nn=x.memo(({children:e})=>{const{registerNodeRenderer:t}=Fe();return x.useEffect(()=>t(e),[t,e]),null});Nn.displayName="NodeRenderer";const Jc=["Backspace","Delete"],Qc=c.wrap$1(j.Diagram$1.TYPE,({aetherKey:e,children:t,onNodesChange:s,onEdgesChange:r,nodes:o,edges:i,onEditableChange:u,editable:a,viewport:d,triggers:p,onViewportChange:m,fitViewOnResize:f,setFitViewOnResize:S,...h})=>{const[{path:R},,E]=c.use$3({aetherKey:e,type:j.Diagram$1.TYPE,schema:j.diagramStateZ,initialState:{position:d.position,region:l.To.ZERO,zoom:d.zoom}}),w=c.use().colors.gray.l9.hex,M=c.useMemoCompare(()=>p??Ht.zoom,c.compareModeConfigs,[p]),{fitView:$}=j.useReactFlow(),_=At(x.useCallback(F=>{f&&$({maxZoom:1}),E(X=>({...X,region:F}))},[E,$,f])),T=x.useRef(null),g=x.useCallback(F=>{const X=T.current;X!=null&&X.x===F.x&&X.y===F.y&&X.zoom===F.zoom||(T.current=F,E(re=>({...re,position:F,zoom:F.zoom})),m(j.translateViewportBackward(F)))},[E,m]);j.useOnViewportChange({onStart:g,onChange:g,onEnd:g});const[v,B]=x.useState(()=>()=>null),L=x.useCallback(F=>B(()=>F),[]),N=x.useMemo(()=>({custom:({id:F,xPos:X,yPos:re,selected:De})=>v({symbolKey:F,position:{x:X,y:re},selected:De})}),[v]),C=x.useRef(i),P=x.useMemo(()=>(C.current=i,j.translateEdgesForward(i)),[i]),b=x.useRef(o),z=x.useMemo(()=>(b.current=o,j.translateNodesForward(o)),[o]),A=x.useCallback(F=>s(j.nodeConverter(b.current,X=>j.applyNodeChanges(F,X))),[s]),Z=x.useCallback(F=>r(j.edgeConverter(C.current,X=>j.applyEdgeChanges(F,X),w)),[r,w]),I=x.useCallback((F,X)=>r(j.edgeConverter(C.current,re=>j.updateEdge(F,X,re),w)),[]),Y=x.useCallback(F=>{r(j.edgeConverter(C.current,X=>j.addEdge(F,X),w))},[r,w]),O=x.useCallback((F,X)=>{const re=[...C.current],De=re.findIndex(Po=>Po.key===F);De!==-1&&(re[De]={...re[De],segments:X},C.current=re,r(re))},[r]),J=a?Wc:Xc,ee=x.useMemo(()=>({default:F=>n.jsxRuntimeExports.jsx(Hc,{...F,segments:F.data.segments,color:F.data.color,onSegmentsChange:x.useCallback(X=>O(F.id,X),[F.id])},F.id)}),[O]),qe=x.useRef(null);c.use$2({triggers:M.zoomReset,callback:x.useCallback(({stage:F,cursor:X})=>{const re=qe.current;re==null||F!=="start"||!l.To.contains(re,X)||$()},[$])});const os=c.purgeMouse(M.select)[0]??null,ls=c.purgeMouse(M.pan)[0]??null,vo=c.purgeMouse(M.zoom)[0]??null,wo={selectionOnDrag:os==null,panOnDrag:ls==null,selectionKeyCode:os,panActivationKeyCode:ls,zoomActivationKeyCode:vo},To=c.useCombinedRefs(qe,_),ko=x.useMemo(()=>({editable:a,onEditableChange:u,registerNodeRenderer:L,fitViewOnResize:f,setFitViewOnResize:S}),[a,u,L,f]);return n.jsxRuntimeExports.jsx(_n.Provider,{value:ko,children:n.jsxRuntimeExports.jsx(c.Composite,{path:R,children:n.jsxRuntimeExports.jsx(j.ReactFlow,{...wo,className:l.CSS(l.CSS.B("diagram"),l.CSS.editable(a)),nodes:z,edges:P,nodeTypes:N,edgeTypes:ee,ref:To,fitView:!0,onNodesChange:A,onEdgesChange:Z,onConnect:Y,onEdgeUpdate:I,defaultViewport:j.translateViewportForward(d),connectionLineComponent:qc,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:Uc,connectionMode:j.ConnectionMode.Loose,snapGrid:[3,3],fitViewOptions:$n,selectionMode:j.SelectionMode.Partial,proOptions:Kc,deleteKeyCode:Jc,...h,style:{[l.CSS.var("diagram-zoom")]:d.zoom,...h.style},...J,children:t})})})}),ea=()=>{const{editable:e}=Fe();return e?n.jsxRuntimeExports.jsx(hl,{}):null},ta=({children:e,...t})=>n.jsxRuntimeExports.jsx(D.Pack,{direction:"y",className:l.CSS.BE("diagram","controls"),...t,children:e}),sa=({onClick:e,...t})=>{const{editable:s,onEditableChange:r}=Fe();return n.jsxRuntimeExports.jsx(c.ToggleIcon,{onChange:()=>r(!s),value:s,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:l.J.RIGHT_CENTER,tooltip:s?n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Disable edit mode"}):n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Enable edit mode"}),...t,children:s?n.jsxRuntimeExports.jsx(c.St.EditOff,{}):n.jsxRuntimeExports.jsx(c.St.Edit,{})})},na=({onClick:e,...t})=>{const{fitView:s}=j.useReactFlow(),{fitViewOnResize:r,setFitViewOnResize:o}=Fe();return n.jsxRuntimeExports.jsx(c.ToggleIcon,{onClick:i=>{s($n),e==null||e(i)},value:r,onChange:i=>o(i),rightClickToggle:!0,tooltip:n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:l.J.RIGHT_CENTER,variant:"outlined",...t,children:n.jsxRuntimeExports.jsx(c.St.Expand,{})})},ra=e=>n.jsxRuntimeExports.jsx(j.ReactFlowProvider,{children:n.jsxRuntimeExports.jsx(Qc,{...e})}),oa=Object.freeze(Object.defineProperty({__proto__:null,Background:ea,Controls:ta,Diagram:ra,FitViewControl:na,HandleLayout:Ln,NodeLayout:ft,NodeRenderer:Nn,ToggleEditControl:sa,alignNodes:Zc,edgeConverter:j.edgeConverter,edgeZ:j.edgeZ,nodeConverter:j.nodeConverter,nodeZ:j.nodeZ,rfEdgeDataZ:j.rfEdgeDataZ,selectNode:ns,selectNodeBox:oe,selectNodeLayout:Fc,translateEdgesBackward:j.translateEdgesBackward,translateEdgesForward:j.translateEdgesForward,translateNodesBackward:j.translateNodesBackward,translateNodesForward:j.translateNodesForward,translateViewportBackward:j.translateViewportBackward,translateViewportForward:j.translateViewportForward,use:Gc,useContext:Fe,viewportZ:j.viewportZ},Symbol.toStringTag,{value:"Module"})),la=({value:e,onChange:t})=>{const{inner:s,outer:r}=e,o=i=>()=>t({...e,...i});return n.jsxRuntimeExports.jsxs(D.Space,{className:l.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[n.jsxRuntimeExports.jsx(Ee,{selected:r==="top",onClick:o({outer:"top"})}),n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[n.jsxRuntimeExports.jsx(Ee,{selected:r==="left",onClick:o({outer:"left"})}),n.jsxRuntimeExports.jsxs(D.Space,{className:l.CSS.B("value"),direction:"y",align:"center",justify:"center",empty:!0,children:[n.jsxRuntimeExports.jsx(Ee,{className:l.CSS(l.CSS.dir("y")),selected:s==="top",onClick:o({inner:"top"})}),n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",justify:"center",children:[n.jsxRuntimeExports.jsx(Ee,{selected:s==="left",onClick:o({inner:"left"})}),n.jsxRuntimeExports.jsx(Ee,{selected:s==="right",onClick:o({inner:"right"})})]}),n.jsxRuntimeExports.jsx(Ee,{className:l.CSS(l.CSS.dir("y")),selected:s==="bottom",onClick:o({inner:"bottom"})})]}),n.jsxRuntimeExports.jsx(Ee,{selected:r==="right",onClick:o({outer:"right"})})]}),n.jsxRuntimeExports.jsx(Ee,{selected:r==="bottom",onClick:o({outer:"bottom"})})]})},Ee=({selected:e,className:t,...s})=>n.jsxRuntimeExports.jsx(c.Icon,{variant:"text",className:l.CSS(t,l.CSS.selected(e)),...s,children:n.jsxRuntimeExports.jsx("div",{className:"symbol"})}),ht=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],ce=({className:e,direction:t,...s})=>n.jsxRuntimeExports.jsx(D.Space,{direction:t,align:"stretch",className:l.CSS(l.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...s}),ve=e=>n.jsxRuntimeExports.jsx(ie,{label:"Orientation",padHelpText:!1,...e,children:({value:t,onChange:s})=>{var r;return n.jsxRuntimeExports.jsx(la,{value:{inner:t.orientation??"top",outer:((r=t.label)==null?void 0:r.orientation)??"top"},onChange:o=>s({...t,orientation:o.inner,label:{...t.label,orientation:o.outer}})})}}),we=({path:e})=>n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(ie,{path:e+".label",label:"Label",padHelpText:!1,grow:!0,children:t=>n.jsxRuntimeExports.jsx(c.Text$1,{selectOnFocus:!0,...t})}),n.jsxRuntimeExports.jsx(ie,{path:e+".level",label:"Label Size",padHelpText:!1,children:t=>n.jsxRuntimeExports.jsx(ue.SelectLevel,{...t})})]}),Le=e=>n.jsxRuntimeExports.jsx(ie,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:s,variant:r,...o})=>n.jsxRuntimeExports.jsx(_t.Swatch,{value:t??l.ZERO.setAlpha(1).rgba255,onChange:i=>s(i.rgba255),...o})}),Bn=({path:e})=>{var p,m;const{value:t,onChange:s}=Te({path:e}),r=j.sourcePipelinePropsZ.parse((p=t.source)==null?void 0:p.props),o=j.sinkPipelinePropsZ.parse((m=t.sink)==null?void 0:m.props),i=j.streamChannelValuePropsZ.parse(r.segments.valueStream.props),u=j.setChannelValuePropsZ.parse(o.segments.setter.props),a=f=>{f=f??0;const S=j.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:j.streamChannelValue({channel:f}),threshold:j.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});s({...t,source:S})},d=f=>{f=f??0;const S=j.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:j.setChannelValue({channel:f}),setpoint:j.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),h=j.authoritySource({channel:f}),R=j.acquireChannelControl({channel:f,authority:255});s({...t,sink:S,control:{...t.control,showChip:!0,chip:{sink:R,source:h},showIndicator:!0,indicator:{statusSource:h}}})};return n.jsxRuntimeExports.jsxs(ce,{direction:"x",grow:!0,align:"stretch",children:[n.jsxRuntimeExports.jsx(pe.Item,{label:"State Channel",grow:!0,children:n.jsxRuntimeExports.jsx(ye,{value:i.channel,onChange:a})}),n.jsxRuntimeExports.jsx(pe.Item,{label:"Command Channel",grow:!0,children:n.jsxRuntimeExports.jsx(ye,{value:u.channel,onChange:d})})]})},he=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(Bn,{path:""});default:return n.jsxRuntimeExports.jsxs(ce,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(we,{path:"label"}),n.jsxRuntimeExports.jsx(Le,{path:"color",hideIfNull:!0,optional:!0})]}),n.jsxRuntimeExports.jsx(ve,{path:""})]})}},[]),t=Q.useStatic({tabs:ht,content:e});return n.jsxRuntimeExports.jsx(Q.Tabs,{...t})},ia=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(Bn,{path:""});default:return n.jsxRuntimeExports.jsxs(ce,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(we,{path:"label"}),n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",children:[n.jsxRuntimeExports.jsx(Le,{path:"color"}),n.jsxRuntimeExports.jsx(ie,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,children:r=>n.jsxRuntimeExports.jsx(c.Switch$1,{...r})})]})]}),n.jsxRuntimeExports.jsx(ve,{path:""})]})}},[]),t=Q.useStatic({tabs:ht,content:e});return n.jsxRuntimeExports.jsx(Q.Tabs,{...t})},xe=()=>n.jsxRuntimeExports.jsxs(ce,{direction:"x",children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(we,{path:"label"}),n.jsxRuntimeExports.jsx(Le,{path:"color"})]}),n.jsxRuntimeExports.jsx(ve,{path:""})]}),Ye={y:2,x:.25},Ge={lower:0,upper:2e3},zn=({includeBorderRadius:e=!1})=>n.jsxRuntimeExports.jsxs(ce,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(we,{path:"label"}),n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",children:[n.jsxRuntimeExports.jsx(Le,{path:"color"}),e&&n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(ie,{path:"borderRadius.x",label:"X Border Radius",grow:!0,children:({value:t,...s})=>n.jsxRuntimeExports.jsx(c.Numeric,{value:t,dragScale:Ye,bounds:Ge,...s})}),n.jsxRuntimeExports.jsx(ie,{path:"borderRadius.y",label:"Y Border Radius",grow:!0,children:({value:t,...s})=>n.jsxRuntimeExports.jsx(c.Numeric,{value:t,dragScale:Ye,bounds:Ge,...s})})]}),n.jsxRuntimeExports.jsx(ie,{path:"dimensions.width",label:"Width",grow:!0,children:({value:t,...s})=>n.jsxRuntimeExports.jsx(c.Numeric,{value:t??200,dragScale:Ye,bounds:Ge,...s})}),n.jsxRuntimeExports.jsx(ie,{path:"dimensions.height",label:"Height",grow:!0,children:({value:t,...s})=>n.jsxRuntimeExports.jsx(c.Numeric,{value:t??200,dragScale:Ye,bounds:Ge,...s})})]})]}),n.jsxRuntimeExports.jsx(ve,{path:""})]}),On=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],ca=({path:e})=>{var f;const{value:t,onChange:s}=Te({path:e}),r=j.sourcePipelinePropsZ.parse((f=t.telem)==null?void 0:f.props),o=j.streamChannelValuePropsZ.parse(r.segments.valueStream.props),i=j.stringifyNumberProps.parse(r.segments.stringifier.props),u=j.rollingAverageProps.parse(r.segments.rollingAverage.props),a=S=>{const h=j.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:j.streamChannelValue({channel:S??0}),stringifier:j.stringifyNumber({precision:i.precision??2}),rollingAverage:j.rollingAverage({windowSize:u.windowSize??1})},outlet:"stringifier"});s({...t,telem:h})},d=S=>{const h=j.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:j.streamChannelValue({channel:o.channel}),stringifier:j.stringifyNumber({precision:S}),rollingAverage:j.rollingAverage({windowSize:u.windowSize})},outlet:"stringifier"});s({...t,telem:h})},p=S=>{const h=j.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{stringifier:j.stringifyNumber({precision:i.precision??2}),valueStream:j.streamChannelValue({channel:o.channel}),rollingAverage:j.rollingAverage({windowSize:S})},outlet:"stringifier"});s({...t,telem:h})},m=mt(o.channel);return x.useEffect(()=>{s({...t,tooltip:[m]})},[m]),n.jsxRuntimeExports.jsxs(ce,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(pe.Item,{label:"Input Channel",grow:!0,children:n.jsxRuntimeExports.jsx(ye,{value:o.channel,onChange:a})}),n.jsxRuntimeExports.jsx(pe.Item,{label:"Precision",align:"start",children:n.jsxRuntimeExports.jsx(c.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:d})}),n.jsxRuntimeExports.jsx(pe.Item,{label:"Averaging Window",align:"start",children:n.jsxRuntimeExports.jsx(c.Numeric,{value:u.windowSize??1,bounds:{lower:1,upper:100},onChange:p})})]})},aa=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"telemetry":return n.jsxRuntimeExports.jsx(ca,{path:""});default:return n.jsxRuntimeExports.jsxs(ce,{direction:"x",children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(we,{path:"label"}),n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",children:[n.jsxRuntimeExports.jsx(Le,{path:"color"}),n.jsxRuntimeExports.jsx(ie,{path:"units",label:"Units",align:"start",padHelpText:!1,children:r=>n.jsxRuntimeExports.jsx(c.Text$1,{...r})})]})]}),n.jsxRuntimeExports.jsx(ve,{path:""})]})}},[]),t=Q.useStatic({tabs:On,content:e});return n.jsxRuntimeExports.jsx(Q.Tabs,{...t})},ua=({path:e})=>{var a;const{value:t,onChange:s}=Te({path:e}),r=j.sourcePipelinePropsZ.parse((a=t.source)==null?void 0:a.props),o=j.streamChannelValuePropsZ.parse(r.segments.valueStream.props),i=d=>{d=d??0;const p=j.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:j.streamChannelValue({channel:d}),threshold:j.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});s({...t,source:p})},u=mt(o.channel);return x.useEffect(()=>{s({...t})},[u]),n.jsxRuntimeExports.jsx(ce,{direction:"x",align:"stretch",children:n.jsxRuntimeExports.jsx(pe.Item,{label:"Input Channel",grow:!0,children:n.jsxRuntimeExports.jsx(ye,{value:o.channel,onChange:i})})})},xa=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"telemetry":return n.jsxRuntimeExports.jsx(ua,{path:""});default:return n.jsxRuntimeExports.jsxs(ce,{direction:"x",children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(we,{path:"label"}),n.jsxRuntimeExports.jsx(D.Space,{direction:"x",children:n.jsxRuntimeExports.jsx(Le,{path:"color"})})]}),n.jsxRuntimeExports.jsx(ve,{path:""})]})}},[]),t=Q.useStatic({tabs:On,content:e});return n.jsxRuntimeExports.jsx(Q.Tabs,{...t})},da=({path:e})=>{var u;const{value:t,onChange:s}=Te({path:e}),r=j.sinkPipelinePropsZ.parse((u=t.sink)==null?void 0:u.props),o=j.setChannelValuePropsZ.parse(r.segments.setter.props),i=a=>{a=a??0;const d=j.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:j.setChannelValue({channel:a}),setpoint:j.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),p=j.authoritySource({channel:a}),m=j.acquireChannelControl({channel:a,authority:255});s({...t,sink:d,control:{...t.control,showChip:!0,chip:{sink:m,source:p},showIndicator:!0,indicator:{statusSource:p}}})};return n.jsxRuntimeExports.jsx(ce,{direction:"y",children:n.jsxRuntimeExports.jsx(pe.Item,{label:"Output Channel",children:n.jsxRuntimeExports.jsx(ye,{value:o.channel,onChange:i})})})},ma=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(da,{path:""});default:return n.jsxRuntimeExports.jsxs(ce,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(we,{path:"label"}),n.jsxRuntimeExports.jsx(D.Space,{direction:"x",children:n.jsxRuntimeExports.jsx(Le,{path:"color"})})]}),n.jsxRuntimeExports.jsx(ve,{path:""})]})}},[]),t=Q.useStatic({tabs:ht,content:e});return n.jsxRuntimeExports.jsx(Q.Tabs,{...t})},pa=({path:e})=>{var p,m;const{value:t,onChange:s}=Te({path:e}),r=j.sourcePipelinePropsZ.parse((p=t.source)==null?void 0:p.props),o=j.sinkPipelinePropsZ.parse((m=t.sink)==null?void 0:m.props),i=j.streamChannelValuePropsZ.parse(r.segments.valueStream.props),u=j.setChannelValuePropsZ.parse(o.segments.setter.props),a=f=>{f=f??0;const S=j.sourcePipeline("number",{connections:[],segments:{valueStream:j.streamChannelValue({channel:f})},outlet:"valueStream"});s({...t,source:S})},d=f=>{f=f??0;const S=j.sinkPipeline("number",{connections:[],segments:{setter:j.setChannelValue({channel:f})},inlet:"setter"}),h=j.authoritySource({channel:f}),R=j.acquireChannelControl({channel:f,authority:255});s({...t,sink:S,control:{...t.control,showChip:!0,chip:{sink:R,source:h},showIndicator:!0,indicator:{statusSource:h}}})};return n.jsxRuntimeExports.jsxs(ce,{direction:"x",grow:!0,align:"stretch",children:[n.jsxRuntimeExports.jsx(pe.Item,{label:"State Channel",grow:!0,children:n.jsxRuntimeExports.jsx(ye,{value:i.channel,onChange:a})}),n.jsxRuntimeExports.jsx(pe.Item,{label:"Command Channel",grow:!0,children:n.jsxRuntimeExports.jsx(ye,{value:u.channel,onChange:d})})]})},ja=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(pa,{path:""});default:return n.jsxRuntimeExports.jsxs(ce,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(we,{path:"label"}),n.jsxRuntimeExports.jsx(ie,{path:"units",label:"Units",align:"start",padHelpText:!1,children:r=>n.jsxRuntimeExports.jsx(c.Text$1,{...r})})]}),n.jsxRuntimeExports.jsx(ve,{path:""})]})}},[]),t=Q.useStatic({tabs:ht,content:e});return n.jsxRuntimeExports.jsx(Q.Tabs,{...t})},V=e=>n.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),rs=e=>n.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Oe=e=>n.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),se=e=>n.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),fa={left:{left:j.Position.Left,right:j.Position.Right,top:j.Position.Top,bottom:j.Position.Bottom},right:{left:j.Position.Right,right:j.Position.Left,top:j.Position.Bottom,bottom:j.Position.Top},top:{left:j.Position.Bottom,right:j.Position.Top,top:j.Position.Left,bottom:j.Position.Right},bottom:{left:j.Position.Top,right:j.Position.Bottom,top:j.Position.Right,bottom:j.Position.Left}},ha=(e,t)=>fa[t][e],Sa=(e,t,s)=>s==="left"?{top:e,left:t}:s==="right"?{top:100-e,left:100-t}:s==="top"?{top:100-t,left:e}:{top:t,left:100-e},G=({children:e,orientation:t})=>{let s;try{s=j.useUpdateNodeInternals()}catch{return n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{})}const r=x.useRef(null),o=x.useRef(!0);return x.useEffect(()=>{if(r.current==null)return;if(o.current){o.current=!1;return}const i=r.current.closest(".react-flow__node"),u=i==null?void 0:i.getAttribute("data-id");u!=null&&(s==null||s(u))},[t]),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("span",{ref:r}),e]})},k=({location:e,orientation:t,left:s,top:r,...o})=>{const i=Sa(r,s,t);return n.jsxRuntimeExports.jsx(j.Handle$1,{position:ha(e,t),...o,type:"source",onClick:u=>u.stopPropagation(),className:(l.CSS.B("handle"),l.CSS.BE("handle",o.id)),style:{left:`${i.left}%`,top:`${i.top}%`}})},de=({className:e,enabled:t=!1,triggered:s=!1,orientation:r="left",color:o,...i})=>n.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("symbol-primitive"),l.CSS.B("symbol-primitive-toggle"),r!=null&&l.CSS.loc(r),t&&l.CSS.M("enabled"),s&&l.CSS.M("triggered"),e),color:l.cssString(o),...i}),te=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:l.CSS(l.CSS.B("symbol-primitive"),e),...t}),ga=.8,W=({dimensions:e,orientation:t="left",children:s,className:r,color:o,style:i={},scale:u=1,...a})=>{e=l.g.construct(t)==="y"?l._$1.swap(e):e;const p=l.cssString(o),m=c.use();return o!=null&&(i[l.CSS.var("symbol-color")]=new l.Color(o).rgbString,i[l.CSS.var("symbol-color-contrast")]=new l.Color(o).pickByContrast(m.colors.gray.l0,m.colors.gray.l10).rgbString),n.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:l._$1.svgViewBox(e),className:l.CSS(l.CSS.loc(t),r),fill:p,stroke:p,...a,style:{aspectRatio:`${e.width} / ${e.height}`,width:l._$1.scale(e,u*ga).width,...i},children:n.jsxRuntimeExports.jsx("g",{children:s})})},Dn=({className:e,orientation:t,scale:s,color:r,...o})=>n.jsxRuntimeExports.jsxs(de,{...o,orientation:t,className:l.CSS(l.CSS.B("four-way-valve"),e),children:[n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:"left",left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:"left",left:100,top:50,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:"left",left:50,top:0,id:"3"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:"left",left:50,top:100,id:"4"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:87,height:87},color:r,scale:s,children:[n.jsxRuntimeExports.jsx(V,{d:"M43.5 43.5L6.35453 24.7035C4.35901 23.6937 2 25.1438 2 27.3803V59.6197C2 61.8562 4.35901 63.3063 6.35453 62.2965L43.5 43.5ZM43.5 43.5L80.6455 24.7035C82.641 23.6937 85 25.1438 85 27.3803V59.6197C85 61.8562 82.641 63.3063 80.6455 62.2965L43.5 43.5Z"}),n.jsxRuntimeExports.jsx(V,{d:"M43.5 43.5L24.7035 80.6455C23.6937 82.641 25.1438 85 27.3803 85H59.6197C61.8562 85 63.3063 82.641 62.2965 80.6455L43.5 43.5ZM43.5 43.5L24.7035 6.35453C23.6937 4.35901 25.1438 2 27.3803 2H59.6197C61.8562 2 63.3063 4.35901 62.2965 6.35453L43.5 43.5Z"})]})]}),An=({color:e,orientation:t="left",scale:s,...r})=>n.jsxRuntimeExports.jsxs(de,{...r,className:l.CSS(l.CSS.B("three-way-valve")),orientation:t,children:[n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:t,left:50,top:100,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:0,top:33,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:100,top:33,id:"3"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:87,height:64},color:e,orientation:t,scale:s,children:[n.jsxRuntimeExports.jsx(V,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),n.jsxRuntimeExports.jsx(V,{d:"M44.3923 22.3611C44.0222 21.6298 42.9778 21.6298 42.6077 22.3611L24.7035 57.7433C23.6937 59.7388 25.1438 62.0978 27.3803 62.0978L59.6197 62.0978C61.8562 62.0978 63.3063 59.7388 62.2965 57.7433L44.3923 22.3611Z"})]})]}),Vn=({orientation:e="left",color:t,scale:s,...r})=>n.jsxRuntimeExports.jsxs(de,{...r,children:[n.jsxRuntimeExports.jsxs(G,{orientation:e,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:e,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:e,left:100,top:50,id:"2"})]}),n.jsxRuntimeExports.jsx(W,{dimensions:{width:87,height:42},color:t,orientation:e,scale:s,children:n.jsxRuntimeExports.jsx(V,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"})})]}),In=({className:e,color:t,orientation:s="left",normallyOpen:r=!1,scale:o,...i})=>n.jsxRuntimeExports.jsxs(de,{className:l.CSS(l.CSS.B("solenoid-valve"),r&&l.CSS.M("normally-open"),e),...i,children:[n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:1,top:69,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:99,top:69,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:87,height:69},color:t,orientation:s,scale:o,children:[n.jsxRuntimeExports.jsx(V,{className:l.CSS.B("body"),d:"M43.5 48L6.35453 29.2035C4.35901 28.1937 2 29.6438 2 31.8803V64.1197C2 66.3562 4.35901 67.8063 6.35453 66.7965L43.5 48ZM43.5 48L80.6455 29.2035C82.641 28.1937 85 29.6438 85 31.8803V64.1197C85 66.3562 82.641 67.8063 80.6455 66.7965L43.5 48Z"}),n.jsxRuntimeExports.jsx(V,{d:"M43.5 47L43.5 24.6177"}),n.jsxRuntimeExports.jsx(rs,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),Zn=({className:e,orientation:t="left",color:s,scale:r,...o})=>n.jsxRuntimeExports.jsxs(te,{orientation:t,className:l.CSS(l.CSS.B("relief-valve"),e),...o,children:[n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:1,top:66,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:99,top:66,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:87,height:58},color:s,orientation:t,scale:r,children:[n.jsxRuntimeExports.jsx(V,{d:"M43.5 37L6.35453 18.2035C4.35901 17.1937 2 18.6438 2 20.8803V53.1197C2 55.3562 4.35901 56.8063 6.35453 55.7965L43.5 37ZM43.5 37L80.6455 18.2035C82.641 17.1937 85 18.6438 85 20.8803V53.1197C85 55.3562 82.641 56.8063 80.6455 55.7965L43.5 37Z"}),n.jsxRuntimeExports.jsx(V,{d:"M43.5 2L43.5 38",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),Fn=({className:e,orientation:t="left",color:s,scale:r,...o})=>n.jsxRuntimeExports.jsxs(te,{orientation:t,className:l.CSS(l.CSS.B("check-valve"),e),...o,children:[n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:99,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:45,height:43},color:s,orientation:t,scale:r,children:[n.jsxRuntimeExports.jsx(V,{d:"M43 2L43 40",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M41.6607 21.8946C42.3917 21.5238 42.3906 20.4794 41.6589 20.1101L6.25889 2.2412C4.26237 1.23341 1.90481 2.68589 1.90704 4.92235L1.93925 37.1617C1.94148 39.3982 4.30194 40.846 6.29644 39.8342L41.6607 21.8946Z"})]})]}),qn=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(de,{...o,orientation:s,className:l.CSS(l.CSS.B("angled-valve"),t),children:[n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:s,left:33,top:100,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:100,top:35,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:64,height:64},color:e,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(V,{d:"M22.3611 20.1077C21.6298 20.4778 21.6298 21.5222 22.3611 21.8923L57.7433 39.7965C59.7388 40.8063 62.0978 39.3562 62.0978 37.1197L62.0978 4.88029C62.0978 2.64384 59.7388 1.19372 57.7433 2.2035L22.3611 20.1077Z"}),n.jsxRuntimeExports.jsx(V,{d:"M21.8923 22.3611C21.5222 21.6298 20.4778 21.6298 20.1077 22.3611L2.20349 57.7433C1.19372 59.7388 2.64384 62.0978 4.8803 62.0978L37.1197 62.0978C39.3562 62.0978 40.8063 59.7388 39.7965 57.7433L21.8923 22.3611Z"}),n.jsxRuntimeExports.jsx(V,{d:"M24.3461 18.5709L21.7484 19.88C20.9998 20.2572 20.3887 20.8601 20.0012 21.6035L19.3383 22.8756"})]})]}),Hn=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(de,{...o,className:l.CSS(l.CSS.B("pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:2,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:64,height:64},color:e,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(Oe,{cx:"32",cy:"32",r:"30"}),n.jsxRuntimeExports.jsx(se,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(se,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)})]})]}),Yn=({className:e,color:t,orientation:s="left",scale:r,...o})=>{const i=l.cssString(t);return n.jsxRuntimeExports.jsxs(te,{...o,className:l.CSS(l.CSS.B("symbol"),e),children:[n.jsxRuntimeExports.jsx(G,{orientation:s,children:n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:2,top:50,id:"1"})}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:40,height:48},color:t,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(V,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"}),n.jsxRuntimeExports.jsx(V,{d:"M37.9706 23.2076C38.4906 23.6079 38.4906 24.3921 37.9706 24.7924L33.86 27.9568C33.2024 28.463 32.25 27.9942 32.25 27.1644V20.8356C32.25 20.0058 33.2024 19.537 33.86 20.0432L37.9706 23.2076Z",fill:i}),n.jsxRuntimeExports.jsx(V,{d:"M33 24H3",strokeLinecap:"round"})]})]})},Gn=({className:e,orientation:t="left",color:s,scale:r,...o})=>n.jsxRuntimeExports.jsxs(te,{className:l.CSS(l.CSS.B("cap"),e),...o,children:[n.jsxRuntimeExports.jsx(G,{orientation:t,children:n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:0,top:50,id:"1"})}),n.jsxRuntimeExports.jsx(W,{color:s,dimensions:{width:26,height:48},orientation:t,scale:r,children:n.jsxRuntimeExports.jsx(V,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"})})]}),Un=({className:e,orientation:t="left",color:s,scale:r,...o})=>n.jsxRuntimeExports.jsxs(te,{className:l.CSS(l.CSS.B("manual-valve"),e),...o,children:[n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:1,top:58,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:99,top:58,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:87,height:48},color:s,orientation:t,scale:r,children:[n.jsxRuntimeExports.jsx(se,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),n.jsxRuntimeExports.jsx(V,{d:"M19.64 2L66.68 2",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M43.5 27L6.35453 8.20349C4.35901 7.19372 2 8.64384 2 10.8803V43.1197C2 45.3562 4.35901 46.8063 6.35453 45.7965L43.5 27ZM43.5 27L80.6455 8.20349C82.641 7.19372 85 8.64384 85 10.8803V43.1197C85 45.3562 82.641 46.8063 80.6455 45.7965L43.5 27Z"})]})]}),Wn=({className:e,orientation:t="left",color:s,scale:r,...o})=>n.jsxRuntimeExports.jsxs(te,{className:l.CSS(l.CSS.B("filter"),e),...o,children:[n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:2,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsx(W,{dimensions:{width:52,height:34},orientation:t,color:s,scale:r,children:n.jsxRuntimeExports.jsx(V,{d:"M6 17L24.8 2.9C25.5111 2.36667 26.4889 2.36667 27.2 2.9L46 17M6 17L24.8 31.1C25.5111 31.6333 26.4889 31.6333 27.2 31.1L46 17M6 17H1M46 17H51"})})]}),Ea=e=>typeof e=="number"?{topLeft:l.q.construct(e),topRight:l.q.construct(e),bottomLeft:l.q.construct(e),bottomRight:l.q.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:l.q.construct(e.topLeft),topRight:l.q.construct(e.topRight),bottomLeft:l.q.construct(e.bottomLeft),bottomRight:l.q.construct(e.bottomRight)}:e,Ra=e=>{const{topLeft:t,topRight:s,bottomLeft:r,bottomRight:o}=e;return`${t.x}% ${s.x}% ${o.x}% ${r.x}% / ${t.y}% ${s.y}% ${o.y}% ${r.y}%`},ya={width:40,height:80},Xn={x:50,y:10},St=({className:e,dimensions:t=ya,borderRadius:s=Xn,color:r,...o})=>{const i=Ea(s),u=c.use();return n.jsxRuntimeExports.jsx(te,{className:l.CSS(e,l.CSS.B("tank")),style:{...t,borderRadius:Ra(i),borderColor:l.cssString(r??u.colors.gray.l9)},...o,children:n.jsxRuntimeExports.jsxs(G,{children:[n.jsxRuntimeExports.jsx(k,{location:"top",orientation:"left",left:50,top:0,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:"left",left:-.5,top:i.topLeft.y-1,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:"left",left:101,top:i.topRight.y-1,id:"3"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:"left",left:50,top:100,id:"4"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:"left",left:-.5,top:100-i.bottomLeft.y+1,id:"5"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:"left",left:101,top:100-i.bottomRight.y+1,id:"6"}),n.jsxRuntimeExports.jsx(k,{location:"left",orientation:"left",left:-.5,top:50,id:"7"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:"left",left:101,top:50,id:"8"})]})})},Kn=({className:e,orientation:t="left",color:s,scale:r,...o})=>n.jsxRuntimeExports.jsxs(te,{className:l.CSS(e,l.CSS.B("regulator")),...o,children:[n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:0,top:66,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:100,top:66,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:88,height:80},orientation:t,color:s,scale:r,children:[n.jsxRuntimeExports.jsx(V,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),n.jsxRuntimeExports.jsx(V,{d:"M61 30C62.6569 30 64.0231 28.6494 63.7755 27.0111C63.141 22.8129 61.181 18.8968 58.1421 15.8579C54.3914 12.1071 49.3043 10 44 10C38.6957 10 33.6086 12.1071 29.8579 15.8579C26.819 18.8968 24.859 22.8129 24.2245 27.0111C23.9769 28.6494 25.3431 30 27 30L44 30H61Z"}),n.jsxRuntimeExports.jsx(se,{x1:"44",y1:"53",x2:"44",y2:"30",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M44 10.5V8C44 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44 53"})]})]}),Jn=({className:e,orientation:t="left",scale:s,color:r,...o})=>n.jsxRuntimeExports.jsxs(te,{className:l.CSS(l.CSS.B("orifice"),e),...o,children:[n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:100,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:70,height:34},orientation:t,color:r,scale:s,children:[n.jsxRuntimeExports.jsx(V,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),Qn=({className:e,orientation:t="left",color:s,scale:r,...o})=>n.jsxRuntimeExports.jsxs(te,{className:l.CSS(l.CSS.B("needle-valve"),e),...o,children:[n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:99,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:87,height:42},orientation:t,color:s,scale:r,children:[n.jsxRuntimeExports.jsx(V,{d:"M43.0152 21.5391L38.237 2.62245C38.1573 2.30658 38.396 2 38.7218 2L48.2782 2C48.604 2 48.8427 2.30658 48.763 2.62245L43.9848 21.5391C43.8576 22.0425 43.1424 22.0425 43.0152 21.5391Z",fill:l.cssString(s)}),n.jsxRuntimeExports.jsx(V,{d:"M43.5 21.5L6.35453 2.70349C4.35901 1.69372 2 3.14384 2 5.38029V37.6197C2 39.8562 4.35901 41.3063 6.35453 40.2965L43.5 21.5ZM43.5 21.5L80.6455 2.70349C82.641 1.69372 85 3.14384 85 5.3803V37.6197C85 39.8562 82.641 41.3063 80.6455 40.2965L43.5 21.5Z"})]})]}),er=({className:e,orientation:t="left",color:s,scale:r,...o})=>n.jsxRuntimeExports.jsxs(te,{orientation:t,className:l.CSS(l.CSS.B("angled-relief-valve"),e),...o,children:[n.jsxRuntimeExports.jsxs(G,{children:[n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:t,left:33,top:100,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:100,top:45,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:64,height:79},orientation:t,color:s,scale:r,children:[n.jsxRuntimeExports.jsx(V,{d:"M20.75 2L20.75 38",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M22.3611 35.1077C21.6298 35.4778 21.6298 36.5222 22.3611 36.8923L57.7433 54.7965C59.7388 55.8063 62.0978 54.3562 62.0978 52.1197L62.0978 19.8803C62.0978 17.6438 59.7388 16.1937 57.7433 17.2035L22.3611 35.1077Z"}),n.jsxRuntimeExports.jsx(V,{d:"M21.8923 37.3611C21.5222 36.6298 20.4778 36.6298 20.1077 37.3611L2.20349 72.7433C1.19372 74.7388 2.64384 77.0978 4.8803 77.0978H37.1197C39.3562 77.0978 40.8063 74.7388 39.7965 72.7433L21.8923 37.3611Z"}),n.jsxRuntimeExports.jsx(V,{d:"M24.3461 33.5709L21.7484 34.88C20.9998 35.2572 20.3887 35.8601 20.0012 36.6035L19.3383 37.8756"})]})]}),tr=({className:e,color:t,dimensions:s,orientation:r,units:o="psi",children:i,...u})=>{const a=l.cssString(t),d=c.use(),p=t==null?"var(--pluto-gray-l0)":l.cssString(new l.Color(t).pickByContrast(d.colors.gray.l0,d.colors.gray.l9));return n.jsxRuntimeExports.jsxs(te,{className:l.CSS(l.CSS.B("value"),e),...u,style:{borderColor:a,height:s==null?void 0:s.height,width:"100%"},children:[n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("value","content"),style:{flexGrow:1,minWidth:s==null?void 0:s.width,inlineSize:80},children:i}),n.jsxRuntimeExports.jsxs(G,{orientation:r,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:"left",left:-2,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:"left",left:102,top:50,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("value","units"),style:{background:a},children:n.jsxRuntimeExports.jsx(c.Text,{level:"small",color:p,children:o})})]})},sr=({enabled:e=!1,onClick:t,orientation:s="left"})=>n.jsxRuntimeExports.jsxs(te,{orientation:s,children:[n.jsxRuntimeExports.jsx(c.Switch$1,{value:e,onClick:t,onChange:()=>{}}),n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:100,top:50,id:"2"})]})]}),nr=({onClick:e,orientation:t="left",label:s="",color:r,size:o,level:i})=>n.jsxRuntimeExports.jsxs(te,{orientation:t,children:[n.jsxRuntimeExports.jsx(c.Button,{onClick:e,color:r,size:o,level:i,children:s}),n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:100,top:50,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:t,left:50,top:0,id:"3"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),rr=({orientation:e="left",className:t,onClick:s,children:r,value:o,units:i,onChange:u,...a})=>{const[d,p]=x.useState(o);return n.jsxRuntimeExports.jsxs(te,{className:l.CSS(l.CSS.B("setpoint"),t),orientation:e,...a,children:[n.jsxRuntimeExports.jsxs(G,{orientation:e,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:e,left:-2,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:e,left:102,top:50,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:e,left:50,top:-2,id:"3"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),n.jsxRuntimeExports.jsxs(c.Numeric,{size:"small",value:d,onChange:p,showDragHandle:!1,selectOnFocus:!0,children:[i!=""&&n.jsxRuntimeExports.jsx(c.Text,{className:l.CSS.B("units"),noWrap:!0,level:"small",children:i}),n.jsxRuntimeExports.jsx(c.Button,{variant:"outlined",size:"small",onClick:()=>u(d),children:"Set"})]})]})},or=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(de,{...o,className:l.CSS(l.CSS.B("screw-pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:2,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:64,height:64},color:e,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(Oe,{cx:"32",cy:"32",r:"30"}),n.jsxRuntimeExports.jsx(se,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(se,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(V,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(32, 32)",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(V,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(42, 32)",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)})]})]}),lr=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(de,{...o,className:l.CSS(l.CSS.B("vacuum-pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:64,height:64},color:e,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(Oe,{cx:"32",cy:"32",r:"30"}),n.jsxRuntimeExports.jsx(se,{x1:"17",y1:"6.0192",x2:"57.9808",y2:"17",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(se,{x1:"17",y1:"57.9808",x2:"57.9808",y2:"47",className:l.CSS(l.CSS.M("detail"),t)})]})]}),ir=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(de,{...o,className:l.CSS(l.CSS.B("cavity-pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:64,height:64},color:e,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(Oe,{cx:"32",cy:"32",r:"30"}),n.jsxRuntimeExports.jsx(se,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(se,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(V,{d:"M 17 26 C 17 20.6667 23 20.6667 23 26 C 23 31.3333 29 31.3333 29 26 C 29 20.6667 35 20.6667 35 26",strokeLinecap:"round",transform:"translate(6, 6)",className:l.CSS(l.CSS.M("detail"),t)})]})]}),cr=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(de,{...o,className:l.CSS(l.CSS.B("piston-pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:64,height:64},color:e,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(Oe,{cx:"32",cy:"32",r:"30"}),n.jsxRuntimeExports.jsx(se,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(se,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(V,{d:"M 23 32, h 16, m 0 -8, v 16",className:l.CSS(l.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),ar=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(te,{...o,className:l.CSS(l.CSS.B("static-mixer"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:99,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:66,height:31},color:e,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(rs,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),n.jsxRuntimeExports.jsx(V,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),ur=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(de,{...o,className:l.CSS(l.CSS.B("rotary-mixer"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:99,top:48,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:50,height:33},color:e,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(V,{d:"M1 30V2C1 1.44772 1.44772 1 2 1H35.4545C35.7434 1 36.0181 1.12487 36.208 1.34247L48.4262 15.3425C48.7549 15.7192 48.7549 16.2808 48.4262 16.6575L36.208 30.6575C36.0181 30.8751 35.7434 31 35.4545 31H2C1.44772 31 1 30.5523 1 30Z"}),n.jsxRuntimeExports.jsx(se,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(se,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(se,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)})]})]}),xr=({className:e,color:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(de,{...o,className:l.CSS(l.CSS.B("light"),e),children:[n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:100,top:50,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:s,left:50,top:0,id:"3"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:s,left:50,top:100,id:"4"})]}),n.jsxRuntimeExports.jsx(W,{dimensions:{width:64,height:64},color:t,orientation:s,scale:r,children:n.jsxRuntimeExports.jsx(Oe,{cx:"32",cy:"32",r:"30"})})]}),dr=({className:e,orientation:t="left",color:s,scale:r,...o})=>n.jsxRuntimeExports.jsxs(te,{className:l.CSS(e,l.CSS.B("regulator")),...o,children:[n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:5,top:66,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:99,top:66,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:88,height:80},orientation:t,color:s,scale:r,children:[n.jsxRuntimeExports.jsx(V,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),n.jsxRuntimeExports.jsx(rs,{x:"19",y:"10",width:"50",height:"20",rx:"3",ry:"3"}),n.jsxRuntimeExports.jsx(se,{x1:"44",y1:"53",x2:"44",y2:"30",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M44 10.5V8C44 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44 53"})]})]}),Ca=({aetherKey:e,sink:t})=>{const s=c.useMemoDeepEqualProps({sink:t}),[,,r]=c.use$3({aetherKey:e,type:j.Button.TYPE,schema:j.buttonStateZ,initialState:{trigger:0,sink:t}});return x.useEffect(()=>{r(i=>({...i,...s}))},[s]),{click:x.useCallback(()=>{r(i=>({...i,trigger:i.trigger+1}))},[r])}},q=x.forwardRef(({label:e="",onChange:t,level:s="p",children:r,orientation:o="top",style:i,className:u,...a},d)=>n.jsxRuntimeExports.jsxs(D.Space,{style:{marginRight:o==="right"?1:0,marginTop:o==="top"?1:0,...i},size:2/3,direction:o,ref:d,className:l.CSS(l.CSS.B("symbol"),u),align:"center",justify:"center",...a,children:[e.length>0&&n.jsxRuntimeExports.jsx(c.Editable,{className:l.CSS.BE("symbol","label"),value:e,onChange:x.useCallback(p=>t({label:{label:p,level:s,orientation:o}}),[t,s]),level:s}),r]}));q.displayName="Labeled";const ba=({aetherKey:e,source:t,sink:s})=>{const r=c.useMemoDeepEqualProps({source:t,sink:s}),[,{value:o},i]=c.use$3({aetherKey:e,type:j.Setpoint.TYPE,schema:j.setpointStateZ,initialState:{trigger:0,value:0,...r}});return x.useEffect(()=>{i(a=>({...a,...r}))},[r,i]),{set:x.useCallback(a=>i(d=>({...d,trigger:d.trigger+1,command:a})),[i]),value:o}},ae=({aetherKey:e,source:t,sink:s})=>{const r=c.useMemoDeepEqualProps({source:t,sink:s}),[,{triggered:o,enabled:i},u]=c.use$3({aetherKey:e,type:j.Toggle.TYPE,schema:j.toggleStateZ,initialState:{triggered:!1,enabled:!1,...r}});return x.useEffect(()=>{u(d=>({...d,...r}))},[r,u]),{toggle:x.useCallback(()=>u(d=>({...d,triggered:!d.triggered})),[u]),triggered:o,enabled:i}},va=j.Value.z.omit({font:!0}).partial({color:!0}).extend({level:y.levelZ.optional()}),mr=({aetherKey:e,box:t,telem:s,color:r,precision:o,minWidth:i,level:u="small"})=>{const a=c.useMemoDeepEqualProps({box:t,telem:s,color:r,precision:o,level:u,minWidth:i}),[,d,p]=c.use$3({aetherKey:e,type:j.Value.TYPE,schema:j.Value.z,initialState:a});return x.useLayoutEffect(()=>p(m=>({...m,...a})),[a]),{width:d.width??d.minWidth}},wa=Object.freeze(Object.defineProperty({__proto__:null,corePropsZ:va,use:mr},Symbol.toStringTag,{value:"Module"})),pr=e=>l.g.construct(e)==="x"?l.J.swap(e):e,Ta=e=>l.g.construct(e)==="y"?l.J.swap(e):e,ne=({showChip:e=!0,showIndicator:t=!0,indicator:s,orientation:r="left",chip:o,children:i,...u})=>n.jsxRuntimeExports.jsxs(D.Space,{direction:l.J.rotate90(r),align:"center",justify:"center",empty:!0,...u,children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:l.g.construct(r),align:"center",className:l.CSS(l.CSS.B("control-state")),size:"small",children:[e&&n.jsxRuntimeExports.jsx(Cn,{size:"small",...o}),t&&n.jsxRuntimeExports.jsx(wn,{...s})]}),i]}),jr=c.wrap$1("ThreeWayValve",({aetherKey:e,label:t,onChange:s,control:r,source:o,sink:i,orientation:u="left",color:a})=>{const{enabled:d,triggered:p,toggle:m}=ae({aetherKey:e,source:o,sink:i});return n.jsxRuntimeExports.jsx(q,{...t,onChange:s,children:n.jsxRuntimeExports.jsx(ne,{...r,orientation:pr(u),children:n.jsxRuntimeExports.jsx(An,{enabled:d,triggered:p,onClick:m,orientation:u,color:a})})})}),fr=e=>n.jsxRuntimeExports.jsx(An,{...e}),hr=c.wrap$1("Valve",({control:e,aetherKey:t,label:s,onChange:r,source:o,sink:i,orientation:u,color:a})=>{const{enabled:d,triggered:p,toggle:m}=ae({aetherKey:t,source:o,sink:i});return n.jsxRuntimeExports.jsx(q,{...s,onChange:r,children:n.jsxRuntimeExports.jsx(ne,{...e,orientation:u,children:n.jsxRuntimeExports.jsx(Vn,{enabled:d,triggered:p,onClick:m,orientation:u,color:a})})})}),Sr=e=>n.jsxRuntimeExports.jsx(Vn,{...e}),gr=c.wrap$1("SolenoidValve",({aetherKey:e,label:t,onChange:s,orientation:r="left",normallyOpen:o,color:i,source:u,sink:a,control:d})=>{const{enabled:p,triggered:m,toggle:f}=ae({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(q,{...t,onChange:s,children:n.jsxRuntimeExports.jsx(ne,{...d,orientation:Ta(r),children:n.jsxRuntimeExports.jsx(In,{enabled:p,triggered:m,onClick:f,orientation:r,color:i,normallyOpen:o})})})}),Er=e=>n.jsxRuntimeExports.jsx(In,{...e}),Rr=c.wrap$1("FourWayValve",({aetherKey:e,control:t,label:s,onChange:r,orientation:o,color:i,source:u,sink:a})=>{const{enabled:d,triggered:p,toggle:m}=ae({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(q,{...s,onChange:r,children:n.jsxRuntimeExports.jsx(ne,{...t,orientation:o,children:n.jsxRuntimeExports.jsx(Dn,{enabled:d,triggered:p,onClick:m,orientation:o,color:i})})})}),yr=e=>n.jsxRuntimeExports.jsx(Dn,{...e}),Cr=c.wrap$1("AngleValve",({aetherKey:e,label:t,control:s,onChange:r,orientation:o="left",color:i,source:u,sink:a})=>{const{enabled:d,triggered:p,toggle:m}=ae({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(q,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:pr(o),children:n.jsxRuntimeExports.jsx(qn,{enabled:d,triggered:p,onClick:m,orientation:o,color:i})})})}),br=e=>n.jsxRuntimeExports.jsx(qn,{...e}),vr=c.wrap$1("Pump",({aetherKey:e,label:t,control:s,onChange:r,orientation:o,color:i,source:u,sink:a})=>{const{enabled:d,triggered:p,toggle:m}=ae({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(q,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:o,children:n.jsxRuntimeExports.jsx(Hn,{enabled:d,triggered:p,onClick:m,orientation:o,color:i})})})}),wr=e=>n.jsxRuntimeExports.jsx(Hn,{...e}),Tr=c.wrap$1("Tank",({label:e,onChange:t,orientation:s,color:r,dimensions:o,borderRadius:i})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(St,{onResize:u=>t({dimensions:u}),orientation:s,color:r,dimensions:o,borderRadius:i})})),kr=e=>n.jsxRuntimeExports.jsx(St,{...e,dimensions:{width:25,height:50}}),Pr=c.wrap$1("Box",({label:e,onChange:t,orientation:s,color:r,dimensions:o})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(St,{onResize:i=>t({dimensions:i}),orientation:s,color:r,dimensions:o,borderRadius:3})})),Lr=e=>n.jsxRuntimeExports.jsx(St,{...e,dimensions:{width:25,height:50},borderRadius:0}),Mr=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Zn,{orientation:s,color:r})}),$r=e=>n.jsxRuntimeExports.jsx(Zn,{...e}),_r=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Kn,{orientation:s,color:r})}),Nr=e=>n.jsxRuntimeExports.jsx(Kn,{...e}),Br=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(dr,{orientation:s,color:r})}),zr=e=>n.jsxRuntimeExports.jsx(dr,{...e}),Or=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Yn,{orientation:s,color:r})}),Dr=e=>n.jsxRuntimeExports.jsx(Yn,{...e}),Ar=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Gn,{orientation:s,color:r})}),Vr=e=>n.jsxRuntimeExports.jsx(Gn,{...e}),Ir=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Un,{orientation:s,color:r})}),Zr=e=>n.jsxRuntimeExports.jsx(Un,{...e}),Fr=c.wrap$1("Setpoint",({label:e,aetherKey:t,orientation:s,control:r,units:o,source:i,sink:u,onChange:a})=>{const{value:d,set:p}=ba({aetherKey:t,source:i,sink:u});return n.jsxRuntimeExports.jsx(q,{...e,onChange:a,children:n.jsxRuntimeExports.jsx(ne,{...r,className:l.CSS.B("symbol"),orientation:s,children:n.jsxRuntimeExports.jsx(rr,{value:d,onChange:p,units:o,orientation:s})})})}),qr=e=>n.jsxRuntimeExports.jsx(rr,{value:12,onChange:()=>{},units:"mV",...e,children:n.jsxRuntimeExports.jsx(c.Text,{level:"p",children:"10.0"})}),Hr=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Wn,{orientation:s,color:r})}),Yr=e=>n.jsxRuntimeExports.jsx(Wn,{...e}),Gr=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Qn,{orientation:s,color:r})}),Ur=e=>n.jsxRuntimeExports.jsx(Qn,{...e}),Wr=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Fn,{orientation:s,color:r})}),Xr=e=>n.jsxRuntimeExports.jsx(Fn,{...e}),Kr=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Jn,{orientation:s,color:r})}),Jr=e=>n.jsxRuntimeExports.jsx(Jn,{...e}),Qr=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(er,{orientation:s,color:r})}),eo=e=>n.jsxRuntimeExports.jsx(er,{...e}),to=c.wrap$1("Value",({aetherKey:e,label:t,level:s="p",position:r,className:o,textColor:i,color:u,telem:a,units:d,onChange:p,tooltip:m})=>{const f=c.useTypography(s),[S,h]=x.useState({outerBox:l.To.ZERO,labelBox:l.To.ZERO}),R=(f.lineHeight+.5)*f.baseSize+2,E=c.useResize(x.useCallback(_=>{const T=document.querySelector(`.react-flow__node[data-id="${e}"] .pluto-symbol__label`);let g={...l.To.ZERO};T!=null&&(g=l.To.construct(T),g=l.To.resize(g,{width:l.To.width(g),height:l.To.height(g)})),h({outerBox:_,labelBox:g})},[]),{}),{zoom:w}=j.useInitialViewport(),M=Pa({labelOrientation:(t==null?void 0:t.orientation)??"top",hasLabel:(t==null?void 0:t.label)!=null&&(t==null?void 0:t.label.length)>0,valueBoxHeight:R,position:r,zoom:w,...S}),{width:$}=mr({aetherKey:e,color:i,level:s,box:M,telem:a,minWidth:60});return n.jsxRuntimeExports.jsxs(c.Dialog$1,{location:{y:"top"},hide:m==null||m.length===0,children:[n.jsxRuntimeExports.jsx(D.Space,{direction:"y",children:m==null?void 0:m.map((_,T)=>n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:_},T))}),n.jsxRuntimeExports.jsx(q,{className:l.CSS(o,l.CSS.B("value-labeled")),ref:E,onChange:p,...t,children:n.jsxRuntimeExports.jsx(tr,{color:u,dimensions:{height:R,width:$},units:d})})]})}),ka=.9,Pa=({labelOrientation:e,outerBox:t,labelBox:s,valueBoxHeight:r,position:o,hasLabel:i,zoom:u})=>{const a=l.q.scale(l.To.dims(s),1/(ka*u));return l.g.construct(e)==="x"&&(o=l.q.translate(o,"y",Math.max((a.y-r)/2-1,0))),i&&e==="left"?o=l.q.translate(o,"x",a.x+4):i&&e==="top"&&(o=l.q.translate(o,"y",a.y+4)),l.To.construct(o.x,o.y,l.To.width(t),r)},so=({color:e})=>n.jsxRuntimeExports.jsx(tr,{color:e,dimensions:{width:60,height:25},units:"psi",children:n.jsxRuntimeExports.jsx(c.Text,{level:"p",children:"50.00"})}),no=c.wrap$1("Switch",({aetherKey:e,label:t,control:s,onChange:r,orientation:o,color:i,source:u,sink:a})=>{const{enabled:d,triggered:p,toggle:m}=ae({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(q,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:o,children:n.jsxRuntimeExports.jsx(sr,{enabled:d,triggered:p,onClick:m,orientation:o,color:i})})})}),ro=e=>n.jsxRuntimeExports.jsx(sr,{...e}),oo=c.wrap$1("Button",({aetherKey:e,label:t,orientation:s,sink:r,control:o,color:i})=>{const{click:u}=Ca({aetherKey:e,sink:r});return n.jsxRuntimeExports.jsx(ne,{...o,className:l.CSS.B("symbol"),orientation:s,children:n.jsxRuntimeExports.jsx(nr,{label:t==null?void 0:t.label,onClick:u,color:i,level:t==null?void 0:t.level})})}),lo=({label:e,...t})=>n.jsxRuntimeExports.jsx(nr,{label:"Button",...t}),io=c.wrap$1("screwPump",({aetherKey:e,label:t,control:s,onChange:r,orientation:o,color:i,source:u,sink:a})=>{const{enabled:d,triggered:p,toggle:m}=ae({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(q,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:o,children:n.jsxRuntimeExports.jsx(or,{enabled:d,triggered:p,onClick:m,orientation:o,color:i})})})}),co=e=>n.jsxRuntimeExports.jsx(or,{...e}),ao=c.wrap$1("vacuumPump",({aetherKey:e,label:t,control:s,onChange:r,orientation:o,color:i,source:u,sink:a})=>{const{enabled:d,triggered:p,toggle:m}=ae({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(q,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:o,children:n.jsxRuntimeExports.jsx(lr,{enabled:d,triggered:p,onClick:m,orientation:o,color:i})})})}),uo=e=>n.jsxRuntimeExports.jsx(lr,{...e}),xo=c.wrap$1("progressiveCavityPump",({aetherKey:e,label:t,control:s,onChange:r,orientation:o,color:i,source:u,sink:a})=>{const{enabled:d,triggered:p,toggle:m}=ae({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(q,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:o,children:n.jsxRuntimeExports.jsx(ir,{enabled:d,triggered:p,onClick:m,orientation:o,color:i})})})}),mo=e=>n.jsxRuntimeExports.jsx(ir,{...e}),po=c.wrap$1("pistonPump",({aetherKey:e,label:t,control:s,onChange:r,orientation:o,color:i,source:u,sink:a})=>{const{enabled:d,triggered:p,toggle:m}=ae({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(q,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:o,children:n.jsxRuntimeExports.jsx(cr,{enabled:d,triggered:p,onClick:m,orientation:o,color:i})})})}),jo=e=>n.jsxRuntimeExports.jsx(cr,{...e}),fo=c.wrap$1("statixMixer",({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(ar,{orientation:s,color:r})})),ho=e=>n.jsxRuntimeExports.jsx(ar,{...e}),So=c.wrap$1("rotaryMixer",({aetherKey:e,label:t,control:s,onChange:r,orientation:o,color:i,source:u,sink:a})=>{const{enabled:d,triggered:p,toggle:m}=ae({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(q,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:o,children:n.jsxRuntimeExports.jsx(ur,{enabled:d,triggered:p,onClick:m,orientation:o,color:i})})})}),go=e=>n.jsxRuntimeExports.jsx(ur,{...e}),Eo=c.wrap$1("light",({aetherKey:e,label:t,className:s,orientation:r="left",color:o,source:i,onChange:u})=>{const{enabled:a}=ae({aetherKey:e,source:i});return n.jsxRuntimeExports.jsx(q,{...t,onChange:u,children:n.jsxRuntimeExports.jsx(xr,{color:o,enabled:a,className:s,orientation:r})})}),Ro=e=>n.jsxRuntimeExports.jsx(xr,{...e}),U=4,yo=2,La=["angledReliefValve","angledValve","box","burstDisc","button","cap","cavityPump","checkValve","electricRegulator","filter","fourWayValve","setpoint","light","manualValve","needleValve","orifice","pistonPump","pump","regulator","reliefValve","rotaryMixer","screwPump","solenoidValve","staticMixer","switch","tank","threeWayValve","vacuumPump","value","valve"],Ma=le.z.enum(La),K={orientation:"left"},$a={...K,source:j.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:j.streamChannelValue({channel:0}),rollingAverage:j.rollingAverage({windowSize:1}),stringifier:j.stringifyNumber({precision:2})},outlet:"stringifier"})},_a={...K,source:j.sourcePipeline("number",{connections:[],segments:{valueStream:j.streamChannelValue({channel:0})},outlet:"valueStream"})},Na={...K,sink:j.sinkPipeline("number",{connections:[],segments:{setter:j.setChannelValue({channel:0})},inlet:"setter"})},Co={...K,source:j.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:j.streamChannelValue({channel:0}),threshold:j.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},bo={...K,sink:j.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:j.setChannelValue({channel:0}),setpoint:j.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},me={...Co,...bo},H=e=>({label:{label:e,level:"p",orientation:"top"}}),Ba={name:"Three Way Valve",key:"threeWayValve",Form:he,Symbol:jr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Three Way Valve"),...me}),Preview:fr,zIndex:U},za={name:"Valve",key:"valve",Form:he,Symbol:hr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Valve"),...me}),Preview:Sr,zIndex:U},Oa={name:"Solenoid Valve",key:"solenoidValve",Form:ia,Symbol:gr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Solenoid Valve"),normallyOpen:!1,...me}),Preview:Er,zIndex:U},Da={name:"Four Way Valve",key:"fourWayValve",Form:he,Symbol:Rr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Four Way Valve"),...me}),Preview:yr,zIndex:U},Aa={name:"Angled Valve",key:"angledValve",Form:he,Symbol:Cr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Angled Valve"),...me}),Preview:br,zIndex:U},Va={name:"Pump",key:"pump",Form:he,Symbol:vr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Pump"),...me}),Preview:wr,zIndex:U},Ia={name:"Screw Pump",key:"screwPump",Form:he,Symbol:io,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Screw Pump"),...me}),Preview:co,zIndex:U},Za={name:"Tank",key:"tank",Form:()=>zn({includeBorderRadius:!0}),Symbol:Tr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Tank"),dimensions:{width:100,height:200},borderRadius:Xn,...K}),Preview:kr,zIndex:yo},Fa={name:"Box",key:"box",Form:zn,Symbol:Pr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Box"),dimensions:{width:100,height:200},...K}),Preview:Lr,zIndex:yo},qa={name:"Relief Valve",key:"reliefValve",Form:xe,Symbol:Mr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Relief Valve"),...K}),Preview:$r,zIndex:U},Ha={name:"Regulator",key:"regulator",Form:xe,Symbol:_r,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Regulator"),...K}),Preview:Nr,zIndex:U},Ya={name:"Electric Regulator",key:"electricRegulator",Form:xe,Symbol:Br,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Electric Regulator"),...K}),Preview:zr,zIndex:U},Ga={name:"Burst Disc",key:"burstDisc",Form:xe,Symbol:Or,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Burst Disc"),...K}),Preview:Dr,zIndex:U},Ua={name:"Cap",key:"cap",Form:xe,Symbol:Ar,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Cap"),...K}),Preview:Vr,zIndex:U},Wa={name:"Manual Valve",key:"manualValve",Form:xe,Symbol:Ir,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Manual Valve"),...K}),Preview:Zr,zIndex:U},Xa={name:"Filter",key:"filter",Form:xe,Symbol:Hr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Filter"),...K}),Preview:Yr,zIndex:U},Ka={name:"Needle Valve",key:"needleValve",Form:xe,Symbol:Gr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Needle Valve"),...K}),Preview:Ur,zIndex:U},Ja={name:"Check Valve",key:"checkValve",Form:xe,Symbol:Wr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Check Valve"),...K}),Preview:Xr,zIndex:U},Qa={name:"Orifice",key:"orifice",Form:xe,Symbol:Kr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Orifice"),...K}),Preview:Jr,zIndex:U},eu={name:"Angled Relief Valve",key:"angledReliefValve",Form:xe,Symbol:Qr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Angled Relief Valve"),...K}),Preview:eo,zIndex:U},tu={name:"Value",key:"value",Form:aa,Symbol:to,Preview:so,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",...H("Value"),...K,telem:$a.source}),zIndex:U},su={name:"Button",key:"button",Symbol:oo,Form:ma,Preview:lo,defaultProps:e=>({color:e.colors.primary.z.rgba255,...H("Button"),...bo}),zIndex:U},nu={name:"Switch",key:"switch",Symbol:no,Preview:ro,Form:he,defaultProps:()=>({...H("Switch"),...me}),zIndex:U},ru={name:"Vacuum Pump",key:"vacuumPump",Symbol:ao,Form:he,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Vacuum Pump"),...me}),Preview:uo,zIndex:U},ou={name:"Cavity Pump",key:"cavityPump",Symbol:xo,Form:he,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Cavity Pump"),...me}),Preview:mo,zIndex:U},lu={name:"Piston Pump",key:"pistonPump",Symbol:po,Form:he,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Piston Pump"),...me}),Preview:jo,zIndex:U},iu={name:"Static Mixer",key:"staticMixer",Symbol:fo,Form:xe,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Static Mixer"),...K}),Preview:ho,zIndex:U},cu={name:"Rotary Mixer",key:"rotaryMixer",Symbol:So,Form:he,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Rotary Mixer"),...me}),Preview:go,zIndex:U},au={name:"Light",key:"light",Symbol:Eo,Form:xa,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Light"),...Co}),Preview:Ro,zIndex:U},uu={name:"Setpoint",key:"setpoint",Symbol:Fr,Form:ja,defaultProps:()=>({units:"mV",...H("Setpoint"),..._a,...Na}),Preview:qr,zIndex:U},xu={value:tu,light:au,switch:nu,button:su,setpoint:uu,tank:Za,box:Fa,valve:za,solenoidValve:Oa,threeWayValve:Ba,fourWayValve:Da,angledValve:Aa,manualValve:Wa,needleValve:Ka,reliefValve:qa,angledReliefValve:eu,checkValve:Ja,regulator:Ha,electricRegulator:Ya,pump:Va,pistonPump:lu,screwPump:Ia,cavityPump:ou,vacuumPump:ru,staticMixer:iu,rotaryMixer:cu,burstDisc:Ga,cap:Ua,filter:Xa,orifice:Qa},du=Object.freeze(Object.defineProperty({__proto__:null,AngledReliefValve:Qr,AngledReliefValvePreview:eo,AngledValve:Cr,AngledValvePreview:br,Box:Pr,BoxPreview:Lr,BurstDisc:Or,BurstDiscPreview:Dr,Button:oo,ButtonPreview:lo,Cap:Ar,CapPreview:Vr,CavityPump:xo,CavityPumpPreview:mo,CheckValve:Wr,CheckValvePreview:Xr,ControlState:ne,ElectricRegulator:Br,ElectricRegulatorPreview:zr,Filter:Hr,FilterPreview:Yr,FourWayValve:Rr,FourWayValvePreview:yr,Light:Eo,LightPreview:Ro,ManualValve:Ir,ManualValvePreview:Zr,NeedleValve:Gr,NeedleValvePreview:Ur,Orifice:Kr,OrificePreview:Jr,PistonPump:po,PistonPumpPreview:jo,Pump:vr,PumpPreview:wr,Regulator:_r,RegulatorPreview:Nr,ReliefValve:Mr,ReliefValvePreview:$r,RotaryMixer:So,RotaryMixerPreview:go,SYMBOLS:xu,ScrewPump:io,ScrewPumpPreview:co,Setpoint:Fr,SetpointPreview:qr,SolenoidValve:gr,SolenoidValvePreview:Er,StaticMixer:fo,StaticMixerPreview:ho,Switch:no,SwitchPreview:ro,Tank:Tr,TankPreview:kr,ThreeWayValve:jr,ThreeWayValvePreview:fr,VacuumPump:ao,VacuumPumpPreview:uo,Value:to,ValuePreview:so,Valve:hr,ValvePreview:Sr,typeZ:Ma},Symbol.toStringTag,{value:"Module"}));exports.Aether=c.main;exports.Dialog=c.use$4;exports.Divider=c.Divider$1;exports.Dropdown=c.Dropdown;exports.Haul=c.Haul;exports.Worker=c.Context$1;exports.compareArrayDeps=c.compareArrayDeps;exports.componentRenderProp=c.componentRenderProp;exports.isRenderProp=c.isRenderProp;exports.useAsyncEffect=c.useAsyncEffect;exports.useClickOutside=c.useClickOutside;exports.useCombinedRefs=c.useCombinedRefs;exports.useCombinedStateAndRef=c.useCombinedStateAndRef;exports.useDebouncedCallback=c.useDebouncedCallback;exports.useEffectCompare=c.useEffectCompare;exports.useMemoCompare=c.useMemoCompare;exports.useMemoDeepEqualProps=c.useMemoDeepEqualProps;exports.useMemoPrimitiveArray=c.useMemoPrimitiveArray;exports.usePrevious=c.usePrevious;exports.useResize=c.useResize;exports.useStateRef=c.useStateRef;exports.useSyncedRef=c.useSyncedRef;exports.useTransforms=c.useTransforms;exports.CSS=l.CSS;exports.newBEM=l.newBEM;exports.Header=Ue.external;exports.DataType=y.d;exports.Density=y.I;exports.MultiSeries=y.yt;exports.Rate=y.$;exports.Series=y.N$1;exports.TimeRange=y.U;exports.TimeSpan=y.w;exports.TimeStamp=y.m;exports.state=y.state;exports.Generic=D.Generic;exports.Align=$o.external;exports.Button=_o.external;exports.Caret=No.Animated$1;exports.telem=j.external;exports.Color=_t.external;exports.Text=ue.external;exports.Triggers=Nt.external;exports.Menu=Bo.external;exports.List=_e.external;exports.createFilterTransform=_e.createFilterTransform;exports.fuseFilter=_e.fuseFilter;exports.proxyMemo=_e.proxyMemo;exports.createHexOpacityVariants=Es.createHexOpacityVariants;exports.unitProperty=Es.unitProperty;exports.Input=pe.external;exports.Tabs=Q.external;exports.Theming=zo.external;exports.Tree=Oo.external;exports.Video=Do.Video;exports.Accordion=nl;exports.Breadcrumb=ol;exports.Canvas=Rl;exports.Channel=di;exports.Control=wc;exports.Device=Bi;exports.Diagram=oa;exports.Eraser=ac;exports.Form=$i;exports.Icon=Di;exports.Label=qi;exports.Legend=wl;exports.Line=Tl;exports.LinePlot=Jl;exports.Measure=si;exports.Modal=Yi;exports.Mosaic=lc;exports.Nav=dc;exports.Note=pc;exports.OS=gc;exports.Observe=Li;exports.Pluto=Lc;exports.Progress=$c;exports.Range=ei;exports.Ranger=Ac;exports.Resize=Wo;exports.Rule=ni;exports.Schematic=du;exports.Select=Vl;exports.Status=Io;exports.Steps=Ic;exports.Synnax=cl;exports.Tag=Dl;exports.Telem=yc;exports.Tooltip=Zo;exports.Value=wa;exports.Viewport=Kl;exports.axis=ul;exports.control=xl;
1
+ "use strict";var Mo=Object.defineProperty;var _o=(e,t,s)=>t in e?Mo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var Se=(e,t,s)=>_o(e,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-Cek9Ww4S.cjs"),x=require("react"),c=require("./Toggle-B8cAGDWx.cjs"),l=require("./css-Cc1vb61S.cjs"),He=require("./external-BFldRd_W.cjs"),C=require("./aggregator-CoVqjgd_.cjs"),A=require("./Pack-BgzS2BHo.cjs"),$o=require("./external-Clb-pmsS.cjs"),No=require("./external--UUIWzFw.cjs"),Bo=require("./Animated-DbOFofnA.cjs"),j=require("./LinePlot-B51qhAb1.cjs"),ce=require("zod"),_t=require("./external-GQjdWsOX.cjs"),ae=require("./external-CqQG_X0V.cjs"),$t=require("./external-Dckibeci.cjs"),Oo=require("./external-Lmkzu-RE.cjs"),Nt=require("react-dom"),Le=require("./external-DY38DhOK.cjs"),Es=require("./units-C59nowP2.cjs"),me=require("./external-BXXNOCb0.cjs"),se=require("./external-D1HsngQj.cjs"),zo=require("./external-Ahp3C6QS.cjs"),Do=require("./external-tnXiEaTc.cjs"),Ao=require("./Video-JYqTPKDk.cjs"),Rs=e=>C.c(e,(t,s,r)=>{const o=s===r.length-1,i=!isNaN(parseInt(t)),u=!isNaN(parseInt(r[s+1]));return i&&(t="element"),o||u?t:[t,"shape"]}),is=(e,t)=>{if(e==null)return null;const s=e[t];return s==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:s},Vo=(e,t,s)=>C.u(is(e,"shape"),Rs(t),{...s,getter:is}),Io=(e,t)=>s=>{const r=t.find(o=>o.safeParse(s).success);return r==null?null:e(r.parse(s))},Zo=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:Vo,getFieldSchemaPath:Rs,transformer:Io},Symbol.toStringTag,{value:"Module"})),Cs=({variant:e,...t})=>n.jsxRuntimeExports.jsx(c.St.Circle,{color:c.variantColors[e],...t}),Fo=({status:{key:e,time:t,count:s,message:r,description:o,variant:i},silence:u,actions:a,className:d,children:p,...m})=>n.jsxRuntimeExports.jsxs(A.Space,{className:l.CSS(l.CSS.B("notification"),d),direction:"y",empty:!0,...m,children:[n.jsxRuntimeExports.jsxs(A.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[n.jsxRuntimeExports.jsxs(A.Space,{direction:"x",align:"center",size:"small",children:[n.jsxRuntimeExports.jsx(Cs,{style:{height:"2.25rem",width:"2.5rem"},variant:i}),n.jsxRuntimeExports.jsx(c.Text,{level:"small",shade:7,children:`x${s}`}),n.jsxRuntimeExports.jsx(c.DateTime,{className:l.CSS(l.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),n.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS(l.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>u(e),children:n.jsxRuntimeExports.jsx(c.St.Close,{})})]}),n.jsxRuntimeExports.jsxs(A.Space,{direction:"y",align:"start",className:l.CSS(l.CSS.BE("notification","content")),size:"small",children:[p??n.jsxRuntimeExports.jsx(c.Text,{className:l.CSS(l.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:r}),o!=null&&n.jsxRuntimeExports.jsx(c.Text,{className:l.CSS(l.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:o})]}),a!=null&&n.jsxRuntimeExports.jsx(A.Space,{direction:"x",align:"center",justify:"end",className:l.CSS(l.CSS.BE("notification","actions")),children:C.A(a).map(f=>n.jsxRuntimeExports.jsx(qo,{action:f},f.key))})]},t.toString()),qo=({action:e})=>{if(!x.isValidElement(e)){const t=e;return n.jsxRuntimeExports.jsx(c.Button,{...t})}return e},Ho=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:c.Aggregator,Circle:Cs,Notification:Fo,Text:c.Text$2,VARIANTS:C.VARIANTS,specZ:C.specZ$1,useAggregator:c.useAggregator,useContext:c.useContext$2,useNotifications:c.useNotifications,variantZ:C.variantZ},Symbol.toStringTag,{value:"Module"})),Yo=Object.freeze(Object.defineProperty({__proto__:null,Config:c.Config,Context:c.Context,Dialog:c.Dialog$1,chooseLocation:c.chooseLocation,formatTip:c.formatTip,useConfig:c.useConfig,wrap:c.wrap},Symbol.toStringTag,{value:"Module"})),We=e=>e.preventDefault(),it=x.forwardRef(({location:e,style:t,size:s,className:r,children:o,onDragStart:i,sizeUnits:u="px",showHandle:a=!0,...d},p)=>{const m=l.J.construct(e),f=l.J.direction(m),h=l.g.dimension(f);return n.jsxRuntimeExports.jsxs("div",{className:l.CSS(l.CSS.B("resize"),l.CSS.loc(m),l.CSS.dir(f),r),style:{[h]:`${s}${u}`,...t},ref:p,...d,children:[o,a&&n.jsxRuntimeExports.jsx("div",{draggable:!0,className:l.CSS(l.CSS.BE("resize","handle"),l.CSS.bordered(l.J.swap(m))),onDragStart:i,onDrag:We,onDragEnd:We})]})});it.displayName="Resize.Core";const Bt=({onResize:e,count:t,initialSizes:s=[],minSize:r=100,direction:o="x"})=>{const i=x.useRef(null),[u,a]=x.useState({sizeDistribution:Go(s,t),root:null}),d=x.useCallback((f,h,S)=>{if(i.current==null)return;const R=l.To.dim(l.To.construct(i.current),o);a(E=>gt(E,R,f,r,h,S))},[r,a,o]);x.useEffect(()=>e==null?void 0:e(u.sizeDistribution),[u.sizeDistribution,e]);const p=x.useCallback((f,h)=>{f.preventDefault();const S=o==="x"?"clientX":"clientY",R=w=>d(h,w[S]),E=()=>{a(w=>({...w,root:null})),document.removeEventListener("mousemove",R)};a(w=>({...w,root:f[S]})),document.addEventListener("mousemove",R),document.addEventListener("mouseup",E,{once:!0})},[a,o,gt]);return{setSize:x.useCallback((f,h)=>d(f,void 0,h),[gt]),props:{direction:o,sizeDistribution:u.sizeDistribution,onDragHandle:p,ref:i}}},ct=x.forwardRef(({direction:e="x",children:t,sizeDistribution:s,onDragHandle:r,className:o,...i},u)=>{const a=l.g.construct(e),d=x.Children.toArray(t);return s=Uo(s),n.jsxRuntimeExports.jsx(A.Space,{...i,ref:u,direction:a,className:l.CSS(l.CSS.B("resize-multiple"),o),empty:!0,grow:!0,children:d.map((p,m)=>n.jsxRuntimeExports.jsx(it,{onDragStart:f=>r(f,m),location:l.g.location(a),size:s[m]*100,sizeUnits:"%",showHandle:m!==d.length-1,children:p},m))})});ct.displayName="Resize.Multiple";const Go=(e,t)=>{const s=e.reduce((o,i)=>o+i,0),r=t-e.length;if(r<=0)return e.slice(0,t).map(o=>o/s);if(e.every(o=>o<=1)){const o=1-s;return[...e,...Array(r).fill(o/r)]}return e.map(()=>1/t)},ht=.001,Uo=e=>e.every(t=>l.C.closeTo(t,1/e.length),ht)?e.map((t,s)=>s%2===0?t+ht:s===e.length-1?t:t-ht):e,gt=(e,t,s,r,o,i)=>{const u=ys(e,t,s,o,i),[a,d]=Wo(e.sizeDistribution,s,u,r/t),p=d?o??null:e.root;return{...e,sizeDistribution:a,root:p}},ys=(e,t,s,r,o)=>{let i;if(o!=null)o>1&&(o=o/t),i=o-e.sizeDistribution[s];else if(r!=null){if(e.root===null)throw new Error("resize root is null during handle drag");i=(r-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return i},Wo=(e,t,s,r)=>{let o=t;for(;o>0&&e[o]+s<=r;)o--;const i=e[o]+s,u=Xo(o,e,r,s),a=e[u]-s;return i<r||a<r?[e,!1]:[e.map((d,p)=>p===o?i:p===u?a:d),!0]},Xo=(e,t,s,r)=>(e===t.length-1?Jo:Ko)(e,t,s,r),Ko=(e,t,s,r)=>{let o=e+1;for(;o<t.length-1&&t[o]-r<=s;)o++;return o},Jo=(e,t,s,r)=>{let o=e-1;for(;o>0&&t[o]-r<=s;)o--;return o},at=({onMove:e,onStart:t,onEnd:s})=>x.useCallback(r=>{r.preventDefault();const o=l.q.construct(r),i=c.mouseKey(r.button);t==null||t(o,i,r);const u=d=>{if(d.buttons===0)return a(d);const p=l.q.construct(d);e==null||e(l.To.construct(o,p),i,d)};window.addEventListener("mousemove",u);const a=d=>{window.removeEventListener("mousemove",u);const p=l.q.construct(d);s==null||s(l.To.construct(o,p),i,d)};window.addEventListener("mouseup",a,{once:!0})},[e,t,s]),Et=2,bs=({onCollapse:e,onResize:t,location:s="left",minSize:r=100,maxSize:o=1/0,initialSize:i=200,collapseThreshold:u=1/0,className:a,...d})=>{const[p,m]=x.useState(l.j(i,r,o)),f=x.useRef(null),h=l.J.construct(s),S=x.useCallback($=>{if(f.current===null)return 0;const P=l.To.dim($,l.J.direction(h),!0)*(1-2*Number(["bottom","right"].includes(h))),g=f.current+P,v=l.j(g,r,o);return(v-g)/r>u?Et:v},[h,r,o,u]),R=x.useRef(null),E=x.useCallback($=>{const P=S($);m(P),R.current!=null&&(t==null||t(P,l.To.construct(R.current)))},[t,S]),w=x.useCallback(()=>m($=>(f.current=$,$)),[m]),M=x.useCallback($=>S($)===Et&&(e==null?void 0:e()),[e,S]);x.useEffect(()=>m($=>{const P=l.j($,r,o);return f.current=P,P}),[r,o]);const _=at({onMove:E,onStart:w,onEnd:M});return n.jsxRuntimeExports.jsx(it,{ref:R,location:h,size:p,onDragStart:_,className:l.clsx(a,l.CSS.expanded(p!==Et)),...d})},Qo=Object.freeze(Object.defineProperty({__proto__:null,Core:it,Multiple:ct,Single:bs,calculateDiffPercentage:ys,useMultiple:Bt},Symbol.toStringTag,{value:"Module"})),Ye="y",cs=28,el=32,tl=40,sl=.5,nl=({data:e,...t})=>{const{setSize:s,props:{sizeDistribution:r,ref:o,...i}}=Bt({direction:Ye,count:e.length,minSize:cs}),u=a=>{if(o.current==null)return;const d=l.To.dim(l.To.construct(o.current),Ye);r[a]<tl/d?s(a,e[a].initialSize??sl):s(a,cs+1)};return n.jsxRuntimeExports.jsx(ct,{empty:!0,className:l.CSS.B("accordion"),sizeDistribution:r,ref:o,...t,...i,children:e.map((a,d)=>x.createElement(ll,{...a,key:a.key,index:d,direction:Ye,onExpand:u,parent:o,size:r[d]}))})},rl=n.jsxRuntimeExports.jsx(c.St.Caret.Down,{"aria-label":"contract"}),ol=n.jsxRuntimeExports.jsx(c.St.Caret.Right,{"aria-label":"expand"}),ll=({index:e,name:t,content:s,actions:r,size:o,parent:i,onExpand:u})=>{let a=!0;if(i.current!=null){const p=l.To.dim(l.To.construct(i.current),Ye);a=o*p>el}const d=a?rl:ol;return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsxs(He.Header,{level:"p",className:l.CSS.expanded(a),empty:!0,children:[n.jsxRuntimeExports.jsx(He.ButtonTitle,{startIcon:d,onClick:()=>u(e),children:t}),r!=null&&n.jsxRuntimeExports.jsx(He.Actions,{children:r})]}),s]})},il=Object.freeze(Object.defineProperty({__proto__:null,Accordion:nl},Symbol.toStringTag,{value:"Module"})),vs=(e,t,s)=>C.A(e).map(i=>i.split(t)).flat().map((i,u)=>[n.jsxRuntimeExports.jsx(c.St.Caret.Right,{style:{transform:"scale(0.8) translateY(1px)",color:l.CSS.shade(s)}},`${i}-${u}`),i]).flat(),cl=({children:e,icon:t,shade:s=7,weight:r=450,size:o=.5,url:i,level:u="p",separator:a=".",className:d,hideFirst:p=!1,...m})=>{i!=null&&(e=i);let f;if(t)if(c.isValidElement(t))f=t;else{const S=C._.get(c.St,t);f=n.jsxRuntimeExports.jsx(S,{})}const h=vs(e,a,s);return p&&h.shift(),n.jsxRuntimeExports.jsxs(c.WithIcon,{className:l.CSS(d,l.CSS.B("breadcrumb")),level:u,shade:s,weight:r,size:o,...m,children:[f,...h]})},al=({url:e,className:t,level:s="p",separator:r=".",shade:o=7})=>{const i=vs(e,r,o);return n.jsxRuntimeExports.jsx(A.Space,{className:l.CSS(t,l.CSS.B("breadcrumb")),direction:"x",size:"small",align:"center",children:i.map((u,a)=>{if(c.isValidElement(u))return u;if(u==null)return null;const p=e.split(r).indexOf(u);let m=e.split(r).slice(0,p+1).join("/");return m="/"+m,n.jsxRuntimeExports.jsx(c.Link,{level:s,href:m,children:u.split("-").map(f=>l._.capitalize(f)).join(" ")},a)})})},ul=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:cl,URL:al},Symbol.toStringTag,{value:"Module"})),Ot=x.createContext(j.ZERO_CONTEXT_VALUE),je=()=>x.useContext(Ot).synnax,xl=()=>x.useContext(Ot).state,as={connected:"success",connecting:"info",disconnected:"info",failed:"error"},ws="serverVersionMismatch",dl=(e,t,s)=>`Cluster version ${s!=null?s+" ":""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,Ps=c.wrap$1(j.Provider.TYPE,({aetherKey:e,connParams:t,children:s})=>{const[r,o,i]=c.useCombinedStateAndRef(j.ZERO_CONTEXT_VALUE),[{path:u},,a]=c.use$3({aetherKey:e,type:j.Provider.TYPE,schema:j.Provider.stateZ,initialState:{props:t??null,state:null}}),d=c.useAggregator(),p=x.useCallback(m=>{i.current.state.status!==m.status&&d({variant:as[m.status],message:m.message??l._.capitalize(m.status)}),o(f=>({...f,state:m}))},[d]);return c.useAsyncEffect(async()=>{if(r.synnax!=null&&r.synnax.close(),t==null)return o(j.ZERO_CONTEXT_VALUE);const m=new C.$y({...t,connectivityPollFrequency:C.S.seconds(5)});o({synnax:m,state:{clusterKey:"",status:"connecting",message:"Connecting...",clientServerCompatible:!1,clientVersion:m.clientVersion}});const f=await m.connectivity.check();if(o({synnax:m,state:f}),d({variant:as[f.status],message:f.message??f.status.toUpperCase()}),f.status==="connected"&&!f.clientServerCompatible){const h=f.nodeVersion==null||C.W.semVerOlder(f.nodeVersion,f.clientVersion),S=dl(h,f.clientVersion,f.nodeVersion);d({variant:"warning",message:"Incompatible cluster version",description:S,data:{type:ws,oldServer:h,nodeVersion:f.nodeVersion,clientVersion:f.clientVersion}})}return m.connectivity.onChange(p),a({props:t,state:f}),()=>{m.close(),o(j.ZERO_CONTEXT_VALUE),a({props:null,state:null})}},[t,p]),n.jsxRuntimeExports.jsx(Ot.Provider,{value:r,children:n.jsxRuntimeExports.jsx(c.Composite,{path:u,children:s})})}),ml=Object.freeze(Object.defineProperty({__proto__:null,Provider:Ps,SERVER_VERSION_MISMATCH:ws,use:je,useConnectionState:xl},Symbol.toStringTag,{value:"Module"})),Me=x.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),ks=()=>x.useContext(Me),Ts=e=>{const{aliases:t}=x.useContext(Me);return t[e]??null},ut=()=>{const{aliases:e}=x.useContext(Me);return e},xt=(e,t="")=>{const{getName:s}=x.useContext(Me),[r,o]=x.useState(t);return c.useAsyncEffect(async()=>{const i=await s(e);i!=null&&o(i)},[e,s]),r??t},zt=()=>{const{activeRange:e}=x.useContext(Me);return e??void 0},Ls=({activeRange:e,children:t})=>{const s=je(),[r,o]=x.useState({}),i=x.useCallback(d=>{o(p=>{const m={...p};return d.forEach(({variant:f,key:h,value:S})=>{const R=Number(h.split("---")[1]);f==="delete"?delete m[R]:m[S.channel]=S.alias}),m})},[o]),u=x.useCallback(async(d,p)=>{if(s==null||e==null)return;await(await s.ranges.retrieve(e)).setAlias(d,p)},[s,e]),a=x.useCallback(async d=>{if(s==null||d===0)return;const p=r[d];return p??(await s.channels.retrieve(d)).name},[r,s]);return c.useAsyncEffect(async()=>{if(s==null||e==null){o({});return}const d=await s.ranges.retrieve(e),p=await d.listAliases();o(p);const m=await d.openAliasTracker(),f=m.onChange(i);return()=>{f(),m.close()}},[s,e]),n.jsxRuntimeExports.jsx(Me.Provider,{value:{aliases:r,activeRange:e,setAlias:e!=null?u:null,getName:a},children:t})},pl=({channelKey:e,value:t,shadow:s,className:r,...o})=>{const[i,u]=x.useState(!1),{setAlias:a}=ks(),d=Ts(e),p=xt(e);let m=n.jsxRuntimeExports.jsx(c.St.Rename,{});i?m=n.jsxRuntimeExports.jsx(c.St.Loading,{}):d===t&&(m=n.jsxRuntimeExports.jsx(c.St.Check,{}));const f=a!=null&&!i&&d!==t&&e!==0,h=()=>{f&&(async()=>(u(!0),await a(e,t),u(!1)))()},S=()=>{var E;d!=null&&((E=o.onChange)==null||E.call(o,d))},R=()=>e===0?n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):a==null?n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):d===t?n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Alias synced with this label"}):n.jsxRuntimeExports.jsxs(c.Text,{level:"small",children:["Sync alias for ",p," with this label"]});return n.jsxRuntimeExports.jsxs(c.Text$1,{value:t,...o,children:[f&&n.jsxRuntimeExports.jsx(c.Icon,{onClick:S,tooltip:n.jsxRuntimeExports.jsxs(c.Text,{level:"small",children:["Set ",p," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:n.jsxRuntimeExports.jsx(c.St.Sync,{})}),n.jsxRuntimeExports.jsx(c.Icon,{onClick:h,disabled:!f,tooltip:n.jsxRuntimeExports.jsx(R,{}),tooltipLocation:{y:"top"},variant:"outlined",children:m})]})},he="channel",jl=Object.freeze(Object.defineProperty({__proto__:null,Canvas:j.Canvas,axisStateZ:j.axisStateZ,newTickFactory:j.newTickFactory,tickFactoryProps:j.tickFactoryProps,tickType:j.tickType},Symbol.toStringTag,{value:"Module"})),fl=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:j.AcquireChannelControl,AuthoritySource:j.AuthoritySource,Chip:j.Chip,Controller:j.Controller$1,Indicator:j.Indicator,Legend:j.Legend,REGISTRY:j.REGISTRY$3,STATUSES:j.STATUSES,SetChannelValue:j.SetChannelValue,StateProvider:j.StateProvider,acquireChannelControl:j.acquireChannelControl,acquireChannelControlPropsZ:j.acquireChannelControlPropsZ,authoritySource:j.authoritySource,authoritySourceProps:j.authoritySourceProps,chipStateZ:j.chipStateZ,controllerStateZ:j.controllerStateZ,indicatorStateZ:j.indicatorStateZ,legendStateZ:j.legendStateZ,setChannelValue:j.setChannelValue,setChannelValuePropsZ:j.setChannelValuePropsZ,stateProviderStateZ:j.stateProviderStateZ,statusZ:j.statusZ,sugaredStateZ:j.sugaredStateZ},Symbol.toStringTag,{value:"Module"}));var pe;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(pe||(pe={}));function Sl({color:e,dimensions:t,lineWidth:s}){return x.createElement("path",{stroke:e,strokeWidth:s,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function hl({color:e,radius:t}){return x.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const gl={[pe.Dots]:"#91919a",[pe.Lines]:"#eee",[pe.Cross]:"#e2e2e2"},El={[pe.Dots]:1,[pe.Lines]:1,[pe.Cross]:6},Rl=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Ms({id:e,variant:t=pe.Dots,gap:s=20,size:r,lineWidth:o=1,offset:i=2,color:u,style:a,className:d}){const p=x.useRef(null),{transform:m,patternId:f}=j.useStore(Rl,j.shallow$1),h=u||gl[t],S=r||El[t],R=t===pe.Dots,E=t===pe.Cross,w=Array.isArray(s)?s:[s,s],M=[w[0]*m[2]||1,w[1]*m[2]||1],_=S*m[2],$=E?[_,_]:M,P=R?[_/i,_/i]:[$[0]/i,$[1]/i];return x.createElement("svg",{className:j.cc(["react-flow__background",d]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:p,"data-testid":"rf__background"},x.createElement("pattern",{id:f+e,x:m[0]%M[0],y:m[1]%M[1],width:M[0],height:M[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${P[0]},-${P[1]})`},R?x.createElement(hl,{color:h,radius:_/i}):x.createElement(Sl,{dimensions:$,color:h,lineWidth:o})),x.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`}))}Ms.displayName="Background";var Cl=x.memo(Ms);const yl={region:l.To.ZERO,dpr:1,os:C.w$1.getOS()},bl={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},vl=c.wrap$1(j.Canvas$1.TYPE,({children:e,resizeDebounce:t=100,aetherKey:s,className:r,...o})=>{const[{path:i},{bootstrapped:u,dpr:a},d]=c.use$3({aetherKey:s,type:j.Canvas$1.TYPE,schema:j.canvasStateZ,initialState:yl}),p=x.useRef({...bl}),m=x.useCallback(S=>{p.current.bootstrapped&&d(()=>({bootstrapped:!0,region:S,dpr:window.devicePixelRatio,os:C.w$1.getOS({default:"Windows"})}))},[d]),f=c.useResize(m,{debounce:t});x.useEffect(()=>{const S=()=>{window.devicePixelRatio!==a&&d(R=>({...R,dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",S,{once:!0})},[a]),x.useEffect(()=>{window.addEventListener("focus",()=>d(S=>({...S}))),window.addEventListener("blur",()=>d(S=>({...S})))},[d]);const h=x.useCallback(S=>{if(f(S),S==null)return;S.className.includes("gl")?p.current.gl=S:S.className.includes("upper2d")?p.current.upper2d=S:p.current.lower2d=S;const{gl:R,lower2d:E,upper2d:w,bootstrapped:M}=p.current;if(R==null||E==null||w==null||M)return;p.current.bootstrapped=!0;const _=R.transferControlToOffscreen(),$=w.transferControlToOffscreen(),P=E.transferControlToOffscreen();d({glCanvas:_,upper2dCanvas:$,lower2dCanvas:P,bootstrap:!0,bootstrapped:!1,region:l.To.construct(R),dpr:window.devicePixelRatio,os:C.w$1.getOS({default:"Windows"})},[_,$,P])},[d]);return n.jsxRuntimeExports.jsxs("div",{className:l.CSS(l.CSS.B("canvas-container"),r),...o,children:[n.jsxRuntimeExports.jsx("canvas",{ref:h,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","lower2d"))}),n.jsxRuntimeExports.jsx("canvas",{ref:h,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","gl"))}),n.jsxRuntimeExports.jsx("canvas",{ref:h,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","upper2d"))}),n.jsxRuntimeExports.jsx(c.Composite,{path:i,children:u&&e})]})}),Dt=(e,t)=>c.useResize(x.useCallback((s,r)=>{const o=document.querySelector(".pluto-canvas--lower2d");o!=null&&e(l.k.XY.translate(l.q.scale(l.To.topLeft(o),-1)).box(s),r)},[e]),t),wl=Object.freeze(Object.defineProperty({__proto__:null,Canvas:vl,useRegion:Dt},Symbol.toStringTag,{value:"Module"})),_s=x.createContext(null),Re=e=>{const t=x.useContext(_s);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},$s=e=>{const t=Re("Viewport"),{addViewportHandler:s}=t;x.useEffect(()=>s(e),[s,e])},dt=(e,t)=>{const{setGridEntry:s,removeGridEntry:r}=Re(t),{key:o}=e;return c.useEffectCompare(()=>{l.J.outer.parse(e.loc),s(e)},([a],[d])=>C._.equal(a,d),[e]),x.useEffect(()=>()=>r(o),[]),{gridArea:l.g.swap(l.J.direction(e.loc))==="x"?`axis-start-${o} / plot-start / axis-end-${o} / plot-end`:`plot-start / axis-start-${o} / plot-end / axis-end-${o}`}},Ns=c.wrap$1("LinePlot",({aetherKey:e,style:t,resizeDebounce:s=0,clearOverScan:r=l.q.ZERO,children:o,hold:i=!1,onHold:u,...a})=>{const[d,p]=x.useState([]),m=c.useMemoDeepEqualProps({clearOverScan:r,hold:i}),[{path:f},{grid:h},S]=c.use$3({aetherKey:e,type:j.LinePlot.TYPE,schema:j.linePlotStateZ,initialState:{container:l.To.ZERO,viewport:l.To.DECIMAL,grid:{},...m}});x.useEffect(()=>S(y=>({...y,...m})),[m]);const R=x.useRef(new Map),E=x.useCallback(y=>(R.current.set(y,null),()=>R.current.delete(y)),[R]),w=x.useCallback(y=>{const{mode:T,box:b,stage:O}=y;(T==="pan"&&O!=="start"||T==="zoom"||T==="zoomReset"&&O==="start")&&S(D=>({...D,viewport:b})),R.current.forEach((D,Z)=>Z(y))},[S]),M=x.useCallback(y=>S(T=>({...T,container:y})),[S]),_=Dt(M,{debounce:s}),$=x.useCallback(y=>S(T=>({...T,grid:{...T.grid,[y.key]:y}})),[S]),P=x.useCallback(y=>S(T=>{const{[y]:b,...O}=T.grid;return{...T,grid:O}}),[S]),g=x.useCallback(y=>{p(T=>[...T.filter(({key:b})=>b!==y.key),y])},[p,w]),v=x.useCallback(y=>p(T=>T.filter(({key:b})=>b!==y)),[g]),B=x.useMemo(()=>Pl(h),[h]),L=x.useCallback(y=>{S(T=>({...T,hold:y})),u==null||u(y)},[S,u]),N=x.useMemo(()=>({lines:d,setGridEntry:$,removeGridEntry:P,setLine:g,removeLine:v,setViewport:w,addViewportHandler:E,setHold:L}),[d,$,P,g,v,w,E,L]);return n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("line-plot"),style:{...t,...B},ref:_,...a,children:n.jsxRuntimeExports.jsx(_s.Provider,{value:N,children:n.jsxRuntimeExports.jsx(c.Composite,{path:f,children:o})})})}),Pl=e=>{const t=l.CSS.newGridBuilder();return j.filterGridEntries("top",e).forEach(({key:s,size:r})=>t.row(`axis-start-${s}`,`axis-end-${s}`,r)),t.row("plot-start","plot-end","minmax(0, 1fr)"),j.filterGridEntries("bottom",e).forEach(({key:s,size:r})=>t.row(`axis-start-${s}`,`axis-end-${s}`,r)),j.filterGridEntries("left",e).forEach(({key:s,size:r})=>t.col(`axis-start-${s}`,`axis-end-${s}`,r)),t.col("plot-start","plot-end","minmax(0, 1fr)"),j.filterGridEntries("right",e).forEach(({key:s,size:r})=>t.col(`axis-start-${s}`,`axis-end-${s}`,r)),t.build()},At=e=>{const t=e==="x"?"bottom":"left",s=e==="x"?j.XAxis.TYPE:j.YAxis.TYPE,r=`${e}-axis`;return c.wrap$1(s,({aetherKey:o,children:i,location:u=t,label:a="",labelLevel:d="small",labelDirection:p=e,onLabelChange:m,color:f,labelSize:h,showGrid:S,type:R,bounds:E,className:w,tickSpacing:M,autoBounds:_,autoBoundUpdateInterval:$,onAutoBoundsChange:P,style:g,...v})=>{const B=((a==null?void 0:a.length)??0)>0,L=c.useMemoDeepEqualProps({location:u,showGrid:S,type:R,bounds:E,label:a,labelDirection:p,tickSpacing:M,autoBounds:_,autoBoundUpdateInterval:$}),[{path:N},{size:y,labelSize:T,...b},O]=c.use$3({aetherKey:o,type:s,schema:j.coreAxisStateZ,initialState:L});x.useEffect(()=>O(Y=>({...Y,...L})),[L]),x.useEffect(()=>{const{lower:Y,upper:z}=j.parseAutoBounds(b.autoBounds);b.bounds!=null&&(Y&&(E==null?void 0:E.lower)!==b.bounds.lower||z&&(E==null?void 0:E.upper)!==b.bounds.upper)&&(P==null||P(b.bounds))},[b.autoBounds,b.bounds]);const D=dt({loc:u,key:`${s}-${o}`,size:y+T,order:"last"},"XAxis"),Z=c.useTypography(d).toString(),I=x.useRef(0);return x.useEffect(()=>{if(e==="y"){if(a==null)return;let z=C.dimensions(a,Z)[l.g.dimension(l.g.construct(p))];z>0&&(z+=9),O(J=>({...J,labelSize:z}))}else{let z=C.dimensions(a,Z).height*1.3;z>0&&(z+=12);const J=I.current;j.withinSizeThreshold(J,z)||(I.current=z,O(te=>({...te,labelSize:z})))}},[a,p,Z]),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(A.Space,{className:l.CSS(w,l.CSS.B("axis"),l.CSS.B(r),l.CSS.loc(u)),style:{...g,...D},align:"center",justify:u!=="left"?"end":"start",direction:l.g.swap(e),...v,children:B&&n.jsxRuntimeExports.jsx(c.MaybeEditable,{className:l.CSS(l.CSS.BE("axis","label"),l.CSS.dir(p)),value:a,onChange:m,level:d})}),n.jsxRuntimeExports.jsx(c.Composite,{path:N,children:i})]})})},Bs=At("x"),Os=At("y"),zs=l.q.xy.extend({root:l.J.corner,units:ce.z.object({x:ce.z.enum(["px","decimal"]),y:ce.z.enum(["px","decimal"])})}),kl=zs.partial({root:!0,units:!0}),Tl=e=>{var s,r,o,i;const t={};return t[((s=e.root)==null?void 0:s.x)??"left"]=((r=e==null?void 0:e.units)==null?void 0:r.x)==="px"?`${e.x}px`:`${e.x*100}%`,t[((o=e.root)==null?void 0:o.y)??"top"]=((i=e==null?void 0:e.units)==null?void 0:i.y)==="px"?`${e.y}px`:`${e.y*100}%`,t},Ll=(e,t)=>{var i,u,a,d,p,m;const s={x:e.x,y:e.y};if(t.current==null)return s;const r=l.To.construct(t.current),o=l.To.construct(t.current.parentElement);return((i=e.units)==null?void 0:i.x)==="decimal"?((u=e.root)==null?void 0:u.x)==="right"&&(s.x=1-e.x):((a=e.root)==null?void 0:a.x)==="right"?s.x=1-(e.x+l.To.width(r))/l.To.width(o):s.x/=l.To.width(o),((d=e.units)==null?void 0:d.y)==="decimal"?((p=e.root)==null?void 0:p.y)==="bottom"&&(s.y=1-e.y):((m=e.root)==null?void 0:m.y)==="bottom"?s.y=1-(e.y+l.To.height(r))/l.To.height(o):s.y/=l.To.height(o),s},Ds=(e,t)=>{if(t.current==null)return null;const s=l.To.construct(t.current.parentElement),r=l.To.construct(t.current),o={x:e.x,y:e.y,root:{...l.J.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(o.x=(1-e.x)*l.To.width(s)-l.To.width(r),o.root.x="right"):e.x<.2?o.x=e.x*l.To.width(s):o.units.x="decimal",e.y>.8?(o.y=(1-e.y)*l.To.height(s)-l.To.height(r),o.root.y="bottom"):e.y<.2?o.y=e.y*l.To.height(s):o.units.y="decimal",o.x=Math.round(o.x*100)/100,{...o,...l.q.truncate(o,3)}},us=l.To.reRoot(l.To.DECIMAL,l.J.TOP_LEFT),Vt=x.memo(({className:e,value:t,onChange:s,style:r,draggable:o=!0,...i})=>{const[u,a]=C.usePurePassthrough({value:t,onChange:s,initial:{x:.1,y:.1,root:l.J.TOP_LEFT,units:{x:"decimal",y:"decimal"}}}),d=x.useRef(u),p=c.useSyncedRef(o===!1),m=x.useRef(null);u!==null&&(r={...r,...Tl(u)});const f=x.useCallback(S=>{var P;if(((P=m.current)==null?void 0:P.parentElement)==null)return d.current;const R=l.To.construct(m.current.parentElement),E=l.k.XY.scale(R).scale(us),w=E.box(l.To.construct(m.current)),M=l.k.XY.clamp(l.To.construct(l.To.topLeft(us),{width:1-l.To.width(w),height:1-l.To.height(w)})),_=l.q.translate(l.q.construct(d.current),l.To.signedDims(E.box(S))),$=M.pos(_);return Ds($,m)},[]),h=at({onStart:x.useCallback(()=>{d.current=Ll(d.current,m)},[]),onMove:x.useCallback(S=>{if(p.current)return;const R=f(S);R!==null&&a(R)},[]),onEnd:x.useCallback(S=>{if(p.current)return;const R=f(S);R!==null&&(d.current=R)},[])});return n.jsxRuntimeExports.jsx(A.Space,{className:l.CSS(e,l.CSS.B("legend")),bordered:!0,rounded:!0,style:r,onDragStart:h,draggable:o,ref:m,...i,onDrag:We,onDragEnd:We,empty:!0})});Vt.displayName="Legend.Container";const It=({data:e=[],onEntryChange:t,position:s,onPositionChange:r,...o})=>{const[i,u]=x.useState(!1);return e.length===0?null:n.jsxRuntimeExports.jsx(Vt,{...o,draggable:!i,value:s,onChange:r,children:e.sort((a,d)=>a.label.localeCompare(d.label)).map(({key:a,color:d,label:p})=>n.jsxRuntimeExports.jsxs(A.Space,{style:{cursor:"pointer"},direction:"x",align:"center",size:"small",children:[n.jsxRuntimeExports.jsx(_t.Swatch,{value:d,onChange:m=>t==null?void 0:t({key:a,color:m,label:p}),onVisibleChange:u,draggable:!1,size:"small"}),n.jsxRuntimeExports.jsx(c.MaybeEditable,{level:"small",value:p,onChange:m=>t==null?void 0:t({key:a,color:d,label:m}),noWrap:!0})]},a))})},Ml=Object.freeze(Object.defineProperty({__proto__:null,Container:Vt,Simple:It,calcStickyPos:Ds,completeStickyXYz:zs,stickyXYz:kl},Symbol.toStringTag,{value:"Module"})),As=({className:e,style:t,onLineChange:s,...r})=>{const{lines:o}=Re("Legend");return Re("Legend"),n.jsxRuntimeExports.jsx(It,{data:o,onEntryChange:s,...r})},Vs=c.wrap$1("Line",({aetherKey:e,...t})=>{const[,,s]=c.use$3({aetherKey:e,type:j.Line.TYPE,schema:j.stateZ,initialState:t}),r=c.useMemoDeepEqualProps(t);return x.useLayoutEffect(()=>s(r),[r]),null}),_l=Object.freeze(Object.defineProperty({__proto__:null,Line:Vs},Symbol.toStringTag,{value:"Module"})),Zt=c.wrap$1("Line",({aetherKey:e,color:t,label:s="",...r})=>{const{setLine:o,removeLine:i}=Re("Line");return x.useEffect(()=>(o({key:e,color:t,label:s}),()=>i(e)),[s,t]),n.jsxRuntimeExports.jsx(Vs,{aetherKey:e,color:t,label:s,...r})}),Is=({level:e="h2",...t})=>{const s=c.useUniqueKey(),r=c.useTypography(e),o=dt({key:s,size:(r.lineHeight+2)*r.baseSize,loc:"top",order:"first"},"Title");return n.jsxRuntimeExports.jsx(A.Space,{justify:"center",align:"center",style:o,children:n.jsxRuntimeExports.jsx(c.MaybeEditable,{...t,level:e})})},Zs=c.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=c.use$3({aetherKey:e,type:j.Tooltip.TYPE,schema:j.tooltipStateZ,initialState:{position:null}}),s=x.useRef(null),r=x.useCallback(i=>{const u=document.querySelector(".pluto-canvas-container");if(u==null)return;const a=l.To.topLeft(u);t({position:l.q.translation(a,l.q.construct(i))})},[t]),o=x.useCallback(()=>t({position:null}),[t]);return x.useEffect(()=>{if(s.current===null)return;const i=s.current.parentElement;if(i!=null)return i.addEventListener("mousemove",r),i.addEventListener("mouseleave",o),()=>{i.removeEventListener("mousemove",r),i.removeEventListener("mouseleave",o)}},[r]),n.jsxRuntimeExports.jsx("span",{ref:s})}),$l=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:Zs},Symbol.toStringTag,{value:"Module"})),Nl={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},Ft=x.forwardRef(({className:e,mode:t,maskBox:s,children:r,style:o,...i},u)=>n.jsxRuntimeExports.jsxs("div",{ref:u,className:l.CSS(l.CSS.noSelect,l.CSS.BE("viewport-mask","container"),e),style:{cursor:Nl[t],...o},...i,children:[n.jsxRuntimeExports.jsx("div",{style:{...l.To.css(s),display:l.To.areaIsZero(s)?"none":"block"},className:l.CSS.BE("viewport-mask","selection")}),r]}));Ft.displayName="ZoomPanMask";const Bl=new Set([C.d.UUID,C.d.JSON]),Ol=C.d.ALL.filter(e=>e!==C.d.UNKNOWN).map(e=>({key:e.toString(),name:Bl.has(e)?e.toString().toUpperCase():l._.capitalize(e.toString())})),zl=[{key:"name",name:"Name"}],Dl=e=>n.jsxRuntimeExports.jsx(ae.DropdownButton,{...e,data:Ol,columns:zl,entryRenderKey:"name"}),Al=[{key:"x",icon:n.jsxRuntimeExports.jsx(c.St.Arrow.Right,{})},{key:"y",icon:n.jsxRuntimeExports.jsx(c.St.Arrow.Down,{})}],Vl=({key:e,entry:t,onClick:s,selected:r})=>n.jsxRuntimeExports.jsx(c.Icon,{variant:r?"filled":"outlined",onClick:s,children:t.icon},e),Il=({children:e=Vl,...t})=>n.jsxRuntimeExports.jsx(ae.Button,{...t,allowMultiple:!1,data:Al,children:e}),Fs=e=>n.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS.BE("select","clear"),variant:"outlined",...e,children:n.jsxRuntimeExports.jsx(c.St.Close,{"aria-label":"clear"})}),ye=({onChange:e,value:t,entryRenderKey:s="key",columns:r,data:o,emptyContent:i,inputProps:u,allowNone:a=!0,searcher:d,className:p,variant:m,hideColumnHeader:f=!1,disabled:h,omit:S,children:R,dropdownVariant:E="connected",placeholder:w=mt,inputPlaceholder:M=w,triggerTooltip:_,dropdownZIndex:$,filter:P,actions:g,...v})=>{const{visible:B,open:L,close:N,toggle:y}=c.use$1(),[T,b]=x.useState(null),O=d!=null;c.useAsyncEffect(async()=>{if(c.selectValueIsZero(t))return b(null);if((T==null?void 0:T.key)===t)return;let z=null;if(O)try{[z]=await d.retrieve([t])}finally{z??(z=null)}else o!=null&&(z=o.find(J=>J.key===t)??null);b(z)},[d,t,o]);const D=x.useCallback((z,J)=>{Array.isArray(z)||(b(z==null?null:J.entries[0]),N(),e(z,J))},[e,a]),Z=x.useMemo(()=>O?c.Search:Le.Filter,[O]),I=n.jsxRuntimeExports.jsx(Z,{searcher:d,filter:P,children:({onChange:z})=>n.jsxRuntimeExports.jsx(Zl,{autoFocus:E==="modal",variant:m,onChange:z,onFocus:L,selected:T,entryRenderKey:s,visible:B,allowNone:a,className:p,disabled:h,placeholder:M,children:g})}),Y=n.jsxRuntimeExports.jsx(c.Button,{tooltip:_,variant:"outlined",onClick:y,disabled:h,children:T!=null?qs(s,T):w});return n.jsxRuntimeExports.jsx(ae.Core,{close:N,zIndex:$,open:L,data:o,omit:S,emptyContent:i,allowMultiple:!1,visible:B,value:t,hideColumnHeader:f,onChange:D,allowNone:a,columns:r,listItem:R,variant:E,trigger:E!=="modal"?I:Y,extraDialogContent:E==="modal"?I:void 0,keepMounted:!1,...v})},mt="Select",qs=(e,t)=>t==null?"":typeof e=="function"?e(t):t[e].toString(),Zl=({entryRenderKey:e,selected:t,visible:s,onChange:r,onFocus:o,allowNone:i=!0,placeholder:u=mt,className:a,disabled:d,...p})=>{const{clear:m}=c.useSelectionUtils(),[f,h]=x.useState("");x.useEffect(()=>{if(!s){if(C.S$1(t==null?void 0:t.key))return h("");t!=null&&h(qs(e,t))}},[t,s,e]);const S=M=>{r(M),h(M)},R=()=>{f===""&&r(""),h(""),o==null||o()},E=M=>{s||(M.preventDefault(),o==null||o())},w=()=>{h(""),m==null||m()};return n.jsxRuntimeExports.jsx(c.Text$1,{className:l.CSS(l.CSS.BE("select","input"),a),value:f,onChange:S,onFocus:R,onKeyDown:c.matchCallback([["Enter"]],M=>{M.preventDefault(),!s&&(o==null||o())}),style:{flexGrow:1},onClick:E,placeholder:u,disabled:d,...p,children:i&&n.jsxRuntimeExports.jsx(Fs,{onClick:w,disabled:d})})},Ae=({children:e="",size:t="medium",color:s,icon:r,onClose:o,className:i,onDragStart:u,...a})=>{const d=l.cssString(s);r==null&&s!=null&&(r=n.jsxRuntimeExports.jsx(c.St.Circle,{fill:d}));const p=o==null?void 0:n.jsxRuntimeExports.jsx(c.Icon,{"aria-label":"close",size:"small",className:l.CSS.BE("tag","close"),onClick:m=>{m.stopPropagation(),o()},children:n.jsxRuntimeExports.jsx(c.St.Close,{})});return n.jsxRuntimeExports.jsx(c.WithIcon,{startIcon:r,endIcon:p,className:l.CSS(i,l.CSS.B("tag"),o!=null&&l.CSS.BM("tag","closeable")),level:C.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:u,...a,children:e})},Fl=Object.freeze(Object.defineProperty({__proto__:null,Tag:Ae},Symbol.toStringTag,{value:"Module"})),_e=({onChange:e,value:t,className:s,data:r,columns:o=[],entryRenderKey:i="key",emptyContent:u,searcher:a,renderTag:d=c.componentRenderProp(Hs),placeholder:p,onTagDragStart:m,allowMultiple:f,allowNone:h,replaceOnSingle:S,onTagDragEnd:R,style:E,addPlaceholder:w="Add",children:M,dropdownVariant:_="connected",actions:$,...P})=>{const{visible:g,open:v,close:B}=c.use$1(),[L,N]=x.useState([]),[y,T]=x.useState(!1),b=a!=null;c.useAsyncEffect(async()=>{T(!0),c.selectValueIsZero(t)&&N([]);const Y=L.map(te=>te.key),z=C.A(t);if(C.y.unorderedPrimitiveArrays(Y,z)===C.y.EQUAL)return;let J=[];if(b)try{J=await a.retrieve(z)}finally{T(!1)}else r!=null&&(J=r.filter(te=>z.includes(te.key)));N(J)},[a,b,t,r]);const O=x.useCallback((Y,z)=>{Y!=null&&(N(z.entries),e(C.A(Y),z))},[e]),D=x.useMemo(()=>b?c.Search:Le.Filter,[b]);let Z,I;if(_==="connected")I=n.jsxRuntimeExports.jsx(D,{searcher:a,children:({onChange:Y,value:z})=>n.jsxRuntimeExports.jsx(ql,{value:z,selectedKeys:t,className:s,onChange:Y,loading:y,selected:L,onFocus:v,entryRenderKey:i,visible:g,renderTag:d,placeholder:p,onTagDragStart:m,onTagDragEnd:R,style:E,children:$})});else{const Y=C.A(t);I=n.jsxRuntimeExports.jsxs(A.Space,{direction:"x",align:"center",grow:!0,style:E,size:"small",children:[Y.map(z=>{const J=L.find(te=>te.key===z);return d({key:z,entryKey:z,entryRenderKey:i,loading:y,entry:J,onClose:()=>{const te=Y.filter(Fe=>Fe!==z);e(te,{clicked:null,clickedIndex:-1,entries:[]})},onDragStart:te=>m==null?void 0:m(te,z),onDragEnd:te=>R==null?void 0:R(te,z)})}),Y.length>0?n.jsxRuntimeExports.jsx(c.Icon,{onClick:v,children:n.jsxRuntimeExports.jsx(c.St.Add,{style:{color:"var(--pluto-gray-l7)"}})}):n.jsxRuntimeExports.jsx(c.Button,{onClick:v,shade:7,startIcon:n.jsxRuntimeExports.jsx(c.St.Add,{}),variant:"text",children:w})]}),Z=n.jsxRuntimeExports.jsx(D,{searcher:a,children:z=>n.jsxRuntimeExports.jsx(c.Text$1,{autoFocus:!0,placeholder:"Search",...z,children:$})})}return n.jsxRuntimeExports.jsx(ae.Core,{close:B,open:v,data:r,emptyContent:u,visible:g,value:t,onChange:O,allowNone:h,replaceOnSingle:S,columns:o,allowMultiple:!0,listItem:M,trigger:I,extraDialogContent:Z,variant:_,...P})},ql=({selectedKeys:e,loading:t,selected:s,onChange:r,onFocus:o,visible:i,entryRenderKey:u,renderTag:a,placeholder:d=mt,onTagDragStart:p,onTagDragEnd:m,value:f,className:h,children:S,...R})=>{const{onSelect:E,clear:w}=c.useSelectionUtils(),M=x.useRef(null);x.useLayoutEffect(()=>{var g;i&&((g=M.current)==null||g.focus())},[i,s]);const _=()=>{i||r(""),o==null||o()},$=()=>{i||o==null||o()},P=()=>{i||r("")};return n.jsxRuntimeExports.jsxs(c.Text$1,{ref:M,className:l.CSS(l.CSS.BE("select-multiple","input"),l.CSS.visible(i),h),onBlur:P,placeholder:d,value:f,onChange:r,onFocus:_,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:$,...R,children:[n.jsxRuntimeExports.jsx(A.Space,{direction:"x",className:l.CSS.BE("select-multiple","tags"),align:"center",grow:!0,size:"small",children:C.A(e).map(g=>{const v=s.find(B=>B.key===g);return a({key:g,entryKey:g,entryRenderKey:u,loading:t,entry:v,onClose:()=>E==null?void 0:E(g),onDragStart:B=>p==null?void 0:p(B,g),onDragEnd:B=>m==null?void 0:m(B,g)})})}),S,n.jsxRuntimeExports.jsx(Fs,{onClick:w})]})},Hs=({entryKey:e,entryRenderKey:t,entry:s,loading:r,...o})=>{let i=e;return s!=null&&(i=typeof t=="function"?t(s):s[t]),x.createElement(Ae,{size:"small",variant:"outlined",className:l.CSS(s==null&&!r&&l.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...o,key:e.toString()},C.B(i))},Hl=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:ae.BaseButton,Button:ae.Button,DEFAULT_PLACEHOLDER:mt,DataType:Dl,Direction:Il,DropdownButton:ae.DropdownButton,Multiple:_e,MultipleTag:Hs,Single:ye,defaultButton:ae.defaultButton},Symbol.toStringTag,{value:"Module"})),Ge=6,Yl=2,xs=5,Gl=e=>l.To.width(e)<xs&&l.To.height(e)<xs,Ul=["zoom","pan","select","zoomReset"],De=[...Ul,"click"],Wl=ce.z.enum(De),Ys=["zoom","select"],Ue={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},Gs={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},Us={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},qt={zoom:Ue,pan:Gs,select:Us,zoomReset:Ue,click:Ue},Xl=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([s,r])=>s==="defaultMode"?[s,r]:[s,r.map(o=>o.filter(i=>i!=="MouseLeft")).filter(o=>o.length>0)]))},Kl=l.To.construct(0,0,1,1,l.J.TOP_LEFT),Jl={width:30,height:50},Ws=({onChange:e,triggers:t,initial:s=Kl,threshold:r=Jl,ref:o})=>{const i=(t==null?void 0:t.defaultMode)??"zoom",[u,a]=x.useState(l.To.ZERO),[d,p]=x.useState(i),[m,f]=c.useStateRef(s),h=x.useRef(l.q.ZERO),S=x.useRef(null),R=l._$1.construct(r);x.useEffect(()=>f(()=>l.To.truncate(s,Ge)),[s]),x.useEffect(()=>p(i),[i]);const[E,w,M,_]=c.useMemoCompare(()=>{const L={...qt[i],...t},N=c.flattenConfig(L),y=Xl(L);return[L,N,y,c.flattenConfig(y)]},c.compareModeConfigs,[t]),$=x.useCallback(({box:L,triggers:N,stage:y,cursor:T})=>{if(S.current==null)return;const b=c.determineMode(E,N),O=l.To.construct(S.current);if(b==null)return;if(b==="zoomReset")return a(l.To.ZERO),e==null||e({box:l.To.DECIMAL,mode:b,stage:y,cursor:T}),f(l.To.DECIMAL);const D=Gl(L);if(y==="end"){if(D){b==="zoom"&&a(l.To.ZERO),e==null||e({box:m.current,mode:"click",stage:y,cursor:T});return}return f(I=>{if(b==="pan"){const z=ds(L,I,O);return z===null||l.To.equals(z,I)?I:(e==null||e({box:z,mode:b,stage:y,cursor:T}),z)}const Y=P(L,I,O);return Y===null?I:(e==null||e({box:Y,mode:b,stage:y,cursor:T}),b==="zoom"?(a(l.To.ZERO),Y):l.To.truncate(I,Ge))})}if(Ys.includes(b))return D?void 0:a(l.k.XY.scale(O).clamp(O).translate({x:-l.To.left(O),y:-l.To.top(O)}).box(ms(R,L,O)));if(a(I=>l.To.areaIsZero(I)?I:l.To.ZERO),l.q.distance(T,h.current)<Yl)return;h.current=T;const Z=ds(L,m.current,O);e==null||e({box:Z,mode:b,stage:y,cursor:T})},[a,p,e,E,r.height,r.width,f,S]);x.useImperativeHandle(o,()=>({reset:()=>{a(l.To.ZERO),f(l.To.DECIMAL),e==null||e({box:l.To.DECIMAL,mode:"zoomReset",stage:"start",cursor:l.q.ZERO})}}),[e]);const P=x.useCallback((L,N,y)=>l.To.truncate(vt(N,y).box(ms(R,L,y)),Ge),[r]),g=c.useHeldRef({triggers:[["Control"]]}),v=c.useHeldRef({triggers:[["Alt"]]});x.useEffect(()=>{const L=N=>{if(S.current==null)return;let y=1;N.deltaY<0?y-=.035:y+=.035;const T=l.To.construct(S.current),b=l.q.construct(N);if(!l.To.contains(T,b)||N.target!==S.current)return;const D=vt(m.current,l.To.construct(S.current)).pos(l.q.construct(N));let I=l.k.XY.magnify({x:g.current.held?1:y,y:v.current.held?1:y}).box(m.current);I=l.To.translate(I,{x:g.current.held?0:D.x*(1-y),y:v.current.held?0:D.y*(1-y)}),f(I),e==null||e({stage:"end",box:I,cursor:l.q.construct(N),mode:"zoom"})};return window.addEventListener("wheel",L),()=>window.removeEventListener("wheel",L)},[f,e]),$t.useDrag({bound:S,onDrag:$,triggers:w,loose:!0});const B=x.useCallback(({triggers:L,stage:N})=>{if(N==="end")return p(i);const y=c.determineMode(M,L);y!=null&&p(y)},[M,i,e]);return c.use$2({triggers:_,callback:B,region:S}),{maskBox:u,ref:S,mode:d}},vt=(e,t)=>l.k.XY.scale(t).clamp(t).scale(e),ds=(e,t,s)=>{let r=l.To.signedDims(vt(t,s).box(e));return r={signedWidth:-r.signedWidth,signedHeight:-r.signedHeight},l.To.truncate(l.k.XY.translate(l.q.construct(r)).box(t),Ge)},ms=(e,t,s)=>l.To.height(t)<=e.height?l.To.construct(l.To.left(t),l.To.top(s),l.To.width(t),l.To.height(s)):l.To.width(t)<=e.width?l.To.construct(l.To.left(s),l.To.top(t),l.To.width(s),l.To.height(t)):t,Ql=({mode:e,triggers:t})=>n.jsxRuntimeExports.jsxs(A.Space,{direction:"x",align:"center",children:[n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:l._.capitalize(e)}),n.jsxRuntimeExports.jsx($t.Text,{trigger:t[0],level:"small"})]}),ei={zoom:n.jsxRuntimeExports.jsx(c.St.Zoom,{}),pan:n.jsxRuntimeExports.jsx(c.St.Pan,{}),select:n.jsxRuntimeExports.jsx(c.St.Selection,{}),zoomReset:n.jsxRuntimeExports.jsx(c.St.Expand,{}),click:n.jsxRuntimeExports.jsx(c.St.Bolt,{})},ti=({triggers:e,disable:t=["zoomReset","click"],...s})=>{const r=Object.entries(e).filter(([o])=>!t.includes(o)&&De.includes(o)).map(([o,i])=>({key:o,icon:ei[o],tooltip:n.jsxRuntimeExports.jsx(Ql,{mode:o,triggers:i})})).sort((o,i)=>De.indexOf(o.key)-De.indexOf(i.key));return n.jsxRuntimeExports.jsx(ae.Button,{...s,data:r,entryRenderKey:"icon",children:({title:o,entry:i,...u})=>x.createElement(c.Icon,{...u,key:i.key,variant:u.selected?"filled":"text",size:"medium",tooltip:i.tooltip,tooltipLocation:{x:"right",y:"top"}},i.icon)})},si=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:qt,MASK_MODES:Ys,MODES:De,Mask:Ft,PAN_DEFAULT_TRIGGERS:Gs,SELECT_DEFAULT_TRIGGERS:Us,SelectMode:ti,ZOOM_DEFAULT_TRIGGERS:Ue,modeZ:Wl,use:Ws},Symbol.toStringTag,{value:"Module"})),Xs=e=>e==null?null:document.querySelectorAll(".pluto-line-plot__viewport")[0]??null,Ht=x.forwardRef(({children:e,initial:t=l.To.DECIMAL,onChange:s,...r},o)=>{const{setViewport:i}=Re("Viewport");x.useLayoutEffect(()=>{i({box:t,mode:"zoom",cursor:l.q.ZERO,stage:"start"})},[i,t]);const u=x.useCallback(d=>{i(d),s==null||s(d)},[s,i]),a=Ws({onChange:u,initial:t,ref:o,...r});return n.jsxRuntimeExports.jsx(Ft,{className:l.CSS.BE("line-plot","viewport"),...a,children:e})});Ht.displayName="Viewport";const ni=Object.freeze(Object.defineProperty({__proto__:null,Legend:As,Line:Zt,LinePlot:Ns,Title:Is,Tooltip:$l,Viewport:Ht,XAxis:Bs,YAxis:Os,axisFactory:At,selectViewportEl:Xs,useContext:Re,useGridEntry:dt,useViewport:$s},Symbol.toStringTag,{value:"Module"})),ri=c.wrap$1("Tooltip",({aetherKey:e,...t})=>(c.use$3({aetherKey:e,type:j.Annotation.TYPE,schema:j.annotationStateZ,initialState:t}),null)),Ks=c.wrap$1("Annotation.Provider",({aetherKey:e,menu:t,...s})=>{const{setViewport:r,setHold:o}=Re("Range.Provider"),[,{hovered:i,count:u},a]=c.use$3({aetherKey:e,type:j.Provider$1.TYPE,schema:j.providerStateZ,initialState:{...s,cursor:null,hovered:null,count:0}}),d=dt({key:e,loc:"top",size:u>0?32:0,order:"last"},"Annotation.Provider"),p=c.useContextMenu(),m=c.useSyncedRef(p.visible),f=x.useCallback(h=>{const S=E=>{a(w=>({...w,cursor:{x:E.clientX,y:E.clientY}}))},R=h.currentTarget;R.addEventListener("mousemove",S),R.addEventListener("mouseleave",()=>{R.removeEventListener("mousemove",S),m.current||a(E=>({...E,cursor:null}))},{once:!0})},[a]);return n.jsxRuntimeExports.jsx(c.ContextMenu,{style:{...d,cursor:i!=null?"pointer":"default"},...p,menu:()=>t==null||i==null?null:t(i),children:n.jsxRuntimeExports.jsx(A.Space,{style:{width:"100%",height:"100%"},onClick:()=>{i!=null&&(r({box:l.To.construct({x:i.viewport.lower,y:0},{x:i.viewport.upper,y:1}),mode:"zoom",cursor:l.q.ZERO,stage:"start"}),o(!0))},onMouseEnter:f})})}),oi=Object.freeze(Object.defineProperty({__proto__:null,Annotation:ri,Provider:Ks},Symbol.toStringTag,{value:"Module"})),Js={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},li=c.flattenConfig(Js),Qs=c.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=c.use$3({aetherKey:e,type:j.Measure.TYPE,schema:j.measureStateZ,initialState:{hover:null,one:null,two:null}}),s=x.useRef(null),r=c.useHeldRef({triggers:li,loose:!0}),o=x.useCallback(({mode:a,cursor:d})=>{if(a==="click"){const p=c.determineMode(Js,r.current.triggers,!0);if(["one","two"].includes(p))return t(m=>({...m,[p]:d}));t(p==="clear"?m=>({...m,one:null,two:null}):m=>({...m,one:m.one??d,two:m.one!==null?d:m.two}))}},[t,r]);$s(o);const i=x.useCallback(a=>t(d=>({...d,hover:l.q.construct(a)})),[t]),u=x.useCallback(()=>{t(a=>({...a,hover:null}))},[t]);return x.useEffect(()=>{if(s.current===null)return;const a=s.current.parentElement;if(a!=null)return a.addEventListener("mousemove",i),a.addEventListener("mouseleave",u),()=>{a.removeEventListener("mousemove",i),a.removeEventListener("mouseleave",u)}},[o]),n.jsxRuntimeExports.jsx("span",{ref:s})}),ii=Object.freeze(Object.defineProperty({__proto__:null,Measure:Qs},Symbol.toStringTag,{value:"Module"})),Yt=c.wrap$1("Rule",({aetherKey:e,label:t,position:s,onLabelChange:r,onPositionChange:o,units:i="",color:u,lineWidth:a,lineDash:d})=>{const[p,m]=C.usePurePassthrough({value:t,onChange:r,initial:""}),[,{position:f,pixelPosition:h},S]=c.use$3({aetherKey:e,type:j.Rule.TYPE,schema:j.ruleStateZ,initialState:{color:u,dragging:!1,position:s,lineWidth:a,lineDash:d}});x.useEffect(()=>{if(f==null)return;if(s==null)return o==null?void 0:o(f);const P=l.R.construct(f+.01,f-.01);s!=null&&!l.R.contains(P,s)&&(o==null||o(Math.trunc(f*100)/100))},[f]);const R=x.useRef(h);h!==R.current&&(R.current=h);const E=x.useRef(h);x.useEffect(()=>{S(P=>({...P,position:s,color:u,lineWidth:a,lineDash:d}))},[s,u,a,d]);const w=at({onStart:x.useCallback(()=>{S(P=>({...P,dragging:!0})),E.current=R.current},[]),onMove:P=>{S(g=>({...g,pixelPosition:(E.current??0)+l.To.signedHeight(P)}))},onEnd:x.useCallback(()=>{S(P=>({...P,dragging:!1})),E.current=h},[])}),M=x.useRef(null);if(f==null||h==null)return null;const _=Xs(M==null?void 0:M.current),$=n.jsxRuntimeExports.jsxs("div",{ref:M,className:l.CSS.B("rule"),style:{top:`calc(${h}px - 0.5rem)`},children:[n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("rule","drag-handle"),onDragStart:w,draggable:!0}),n.jsxRuntimeExports.jsxs(A.Space,{direction:"x",align:"center",style:{marginLeft:"2rem"},children:[n.jsxRuntimeExports.jsx(c.Editable,{level:"p",value:p,onChange:m}),n.jsxRuntimeExports.jsx(c.Text,{level:"p",style:{padding:"0.25rem 0",width:"fit-content"},children:`${f.toFixed(2)} ${i}`})]})]});return _==null?$:Nt.createPortal($,_)}),ci=Object.freeze(Object.defineProperty({__proto__:null,Rule:Yt},Symbol.toStringTag,{value:"Module"})),en=c.canDropOfType(he),ai=({lines:e,axes:t,showTitle:s=!0,title:r="",onTitleChange:o,showLegend:i=!0,legendPosition:u,onLegendPositionChange:a,titleLevel:d="h4",onLineChange:p,onRuleChange:m,onAxisChannelDrop:f,onAxisChange:h,rules:S,enableTooltip:R=!0,enableMeasure:E=!1,initialViewport:w=l.To.DECIMAL,onViewportChange:M,viewportTriggers:_,annotationProvider:$,...P})=>{var N;const g=t.filter(({location:y})=>l.J.isY(y)),v=x.useRef(),B=c.usePrevious(e.length),L=c.usePrevious(P.hold);return(B===0&&e.length!==0||L===!0&&P.hold===!1)&&((N=v.current)==null||N.reset()),n.jsxRuntimeExports.jsxs(Ns,{...P,children:[g.map((y,T)=>{const b=e.filter(Z=>Z.axes.x===y.key),O=t.filter(({location:Z})=>l.J.isX(Z)),D=S==null?void 0:S.filter(Z=>[...O.map(({key:I})=>I),y.key].includes(Z.axis));return n.jsxRuntimeExports.jsx(ui,{axis:y,index:T,lines:b,yAxes:O,rules:D,onAxisChannelDrop:f,onAxisChange:h,annotationProvider:$},y.key)}),i&&n.jsxRuntimeExports.jsx(As,{onLineChange:p,position:u,onPositionChange:a}),s&&n.jsxRuntimeExports.jsx(Is,{value:r,onChange:o,level:d}),n.jsxRuntimeExports.jsxs(Ht,{initial:w,onChange:M,triggers:_,ref:v,children:[R&&n.jsxRuntimeExports.jsx(Zs,{}),E&&n.jsxRuntimeExports.jsx(Qs,{})]})]})},ui=({yAxes:e,lines:t,index:s,rules:r,onRuleChange:o,onAxisChannelDrop:i,onAxisChange:u,axis:{location:a,key:d,showGrid:p,...m},annotationProvider:f})=>{const h=c.useDrop({type:"Channel.LinePlot.XAxis",canDrop:en,onDrop:x.useCallback(({items:E})=>{const w=c.filterByType(he,E);return i==null||i(d,w.map(({key:M})=>M)),w},[d,i])}),S=r==null?void 0:r.filter(E=>E.axis===d),R=c.useDraggingState();return n.jsxRuntimeExports.jsxs(Bs,{...m,...h,location:a,showGrid:p??s===0,className:l.CSS(l.CSS.dropRegion(c.canDropOfType(he)(R))),onAutoBoundsChange:E=>u==null?void 0:u({key:d,bounds:E}),children:[e.map((E,w)=>{const M=t.filter($=>$.axes.y===E.key),_=r==null?void 0:r.filter($=>$.axis===E.key);return n.jsxRuntimeExports.jsx(di,{axis:{...E,showGrid:p??(s===0&&w===0)},lines:M,rules:_,onRuleChange:o,onAxisChannelDrop:i,onAxisChange:u},E.key)}),S==null?void 0:S.map(E=>x.createElement(Yt,{aetherKey:E.key,...E,key:E.key,onLabelChange:w=>o==null?void 0:o({key:E.key,label:w}),onPositionChange:w=>o==null?void 0:o({key:E.key,position:w})})),n.jsxRuntimeExports.jsx(Ks,{...f})]})},xi=({channels:{x:e,y:t}})=>`${e??0}-${t}`,di=({lines:e,rules:t,onRuleChange:s,onAxisChannelDrop:r,onAxisChange:o,axis:{key:i,location:u,...a}})=>{const d=c.useDrop({type:"Channel.LinePlot.YAxis",canDrop:en,onDrop:x.useCallback(({items:m})=>{const f=c.filterByType(he,m);return r==null||r(i,f.map(({key:h})=>h)),f},[i,r])}),p=c.useDraggingState();return n.jsxRuntimeExports.jsxs(Os,{...a,...d,location:u,className:l.CSS(l.CSS.dropRegion(c.canDropOfType(he)(p))),onAutoBoundsChange:m=>o==null?void 0:o({key:i,bounds:m}),children:[e.map(m=>n.jsxRuntimeExports.jsx(mi,{line:m},xi(m))),t==null?void 0:t.map(m=>x.createElement(Yt,{aetherKey:m.key,...m,key:m.key,onLabelChange:f=>s==null?void 0:s({key:m.key,label:f}),onPositionChange:f=>s==null?void 0:s({key:m.key,position:f})}))]})},mi=({line:e})=>e.variant==="static"?n.jsxRuntimeExports.jsx(ji,{line:e}):n.jsxRuntimeExports.jsx(pi,{line:e}),pi=({line:{key:e,timeSpan:t,channels:{x:s,y:r},...o}})=>{const i=Number(t.valueOf())*3,u=j.streamChannelData({timeSpan:t,channel:r,keepFor:i}),a=s!=null&&s!==0,d=j.streamChannelData({timeSpan:t,channel:a?s:r,useIndexOfChannel:!a,keepFor:i});return n.jsxRuntimeExports.jsx(Zt,{aetherKey:e,y:u,x:d,...o})},ji=({line:{timeRange:e,key:t,channels:{x:s,y:r},...o}})=>{const i=j.channelData({timeRange:e,channel:r}),u=s!=null&&s!==0,a=j.channelData({timeRange:e,channel:u?s:r,useIndexOfChannel:!u});return n.jsxRuntimeExports.jsx(Zt,{aetherKey:t,y:i,x:a,...o})},ps=[{key:"name",name:"Name"},{key:"alias",name:"Alias"},{key:"rate",name:"Rate"},{key:"dataType",name:"Data Type"},{key:"index",name:"Index"},{key:"key",name:"Key"},{key:"isIndex",name:"Is Index"}],Xe=({items:e},t)=>{const s=c.filterByType(he,e);return s.length>0&&!s.every(r=>t.includes(r.key))},tn=["name","alias"],sn=e=>{const t=ut();return x.useMemo(()=>e.length===0?ps:ps.filter(s=>e.includes(s.key)),[e,t])},fi=({columns:e=tn,onChange:t,className:s,value:r,searchOptions:o,...i})=>{const u=je(),a=ut(),d=sn(e),p=zt(),m=c.useMemoDeepEqualProps(o),f=x.useMemo(()=>u==null?void 0:u.channels.newSearcherWithOptions({rangeKey:p,internal:!1,...m}),[u,p,m]),h=u!=null?void 0:n.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:S,onDragEnd:R,...E}=c.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:x.useCallback(P=>Xe(P,C.A(r)),[r]),onDrop:x.useCallback(({items:P})=>{const g=c.filterByType(he,P);if(g.length===0)return[];const v=C.n([...C.A(r),...g.map(B=>B.key)]);return t(v,{clickedIndex:null,clicked:null,entries:[]}),g},[t,r])}),w=c.useDraggingState(),M=x.useCallback(({dropped:P})=>{t(C.A(r).filter(g=>!P.some(v=>v.key===g)),{clickedIndex:null,clicked:null,entries:[]})},[t,r]),_=x.useCallback((P,g)=>S([{key:g,type:he}],M),[S,M]),$=x.useCallback(P=>a[P.key]??P.name,[a]);return n.jsxRuntimeExports.jsx(_e,{className:l.CSS(s,l.CSS.dropRegion(Xe(w,C.A(r)))),value:r,onTagDragStart:_,onTagDragEnd:R,searcher:f,onChange:t,columns:d,emptyContent:h,entryRenderKey:$,...E,...i})},Ce=({columns:e=tn,onChange:t,value:s,className:r,data:o,searchOptions:i,...u})=>{const a=je(),d=ut(),p=sn(e),m=zt(),f=c.useMemoDeepEqualProps(i),h=x.useMemo(()=>{if(!(o!=null&&o.length>0))return a==null?void 0:a.channels.newSearcherWithOptions({rangeKey:m,internal:!1,...f})},[a,m,o==null?void 0:o.length,f]),S=a!=null?void 0:n.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),R=x.useId(),E=x.useMemo(()=>({key:R,type:"Channel.SelectMultiple"}),[R]),{startDrag:w,onDragEnd:M,..._}=c.useDragAndDrop({type:"Channel.SelectSingle",canDrop:x.useCallback(v=>Xe(v,C.o(s)),[s]),onDrop:x.useCallback(({items:v})=>{const B=c.filterByType(he,v);return B.length===0?[]:(t(B[0].key,{clickedIndex:null,clicked:null,entries:[]}),B)},[E,t])}),$=c.useDraggingState(),P=x.useCallback(()=>s!=null&&w([{type:he,key:s}]),[w,s]),g=x.useCallback(v=>d[v.key]??v.name,[d]);return n.jsxRuntimeExports.jsx(ye,{data:o,className:l.CSS(r,l.CSS.dropRegion(Xe($,C.o(s)))),value:s,onDragStart:P,onDragEnd:M,onChange:t,searcher:h,columns:p,emptyContent:S,entryRenderKey:g,..._,...u})},Si=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:pl,AliasProvider:Ls,LinePlot:ai,SelectMultiple:fi,SelectSingle:Ce,useActiveRange:zt,useAlias:Ts,useAliases:ut,useContext:ks,useName:xt},Symbol.toStringTag,{value:"Module"})),ve=({path:e,optional:t=!1,onChange:s})=>{const r=be(),{get:o,bind:i,set:u,setStatus:a}=r,[d,p]=x.useState(o(e,{optional:t}));x.useEffect(()=>(p(o(e,{optional:t})),i({path:e,onChange:p,listenToChildren:!1})),[e,s,i,o]);const m=x.useCallback(S=>{s==null||s(S,{...r,path:e}),u(e,S)},[e,u,s]),f=x.useCallback(S=>a(e,S),[e,a]);if(d==null){if(!t)throw new Error(`Field state is null: ${e}`);return null}let h;return r.mode==="preview"&&(h="preview"),{onChange:m,setStatus:f,variant:h,...d}},nn=(e,t=!1,s)=>{const{get:r,bind:o}=be(s),[,i]=x.useState(0);return x.useEffect(()=>(i(u=>u+1),o({path:e,onChange:()=>i(u=>u+1)})),[e,o]),r(e,{optional:t})??null},hi=(e,t=!1,s)=>{var u;const{get:r,bind:o}=be(s),[,i]=x.useState(0);return x.useEffect(()=>(i(a=>a+1),o({path:e,onChange:()=>i(a=>a+1)})),[e,o]),((u=r(e,{optional:t}))==null?void 0:u.value)??null},gi=e=>{var t,s;return((s=(t=nn(e,!0))==null?void 0:t.status)==null?void 0:s.variant)==="success"},Ei=({path:e,ctx:t,onChange:s})=>{const r=be(t);x.useEffect(()=>r.bind({path:e,onChange:o=>s(o,r),listenToChildren:!1}),[e,r])},Ri=({path:e,optional:t=!1})=>{const{bind:s,get:r}=be(),[o,i]=x.useState(r(e,{optional:t}));if(x.useEffect(()=>(i(r(e,{optional:t})),s({path:e,onChange:u=>i({...u,value:C.H(u.value)}),listenToChildren:!0})),[e,s,r]),o==null&&!t)throw new Error("Field state is null");return(o==null?void 0:o.value)??null},rn=(e,t)=>({add:(s,r)=>{const o=C.H(e.get(t).value);o.splice(r,0,...C.A(s)),e.set(t,o,{validateChildren:!1})},push:(s,r)=>{const o=C.H(e.get(t).value);o.push(...C.A(s)),r!=null&&o.sort(r),e.set(t,o,{validateChildren:!1})},remove:s=>{const r=e.get(t).value,o=new Set(C.A(s));e.set(t,r.filter((i,u)=>!o.has(u)))},keepOnly:s=>{const r=e.get(t).value,o=new Set(C.A(s));e.set(t,r.filter((i,u)=>o.has(u)))},set:s=>e.set(t,C.executeSetter(s,e.get(t).value)),sort:s=>{const r=C.H(e.get(t).value);r.sort(s),e.set(t,r)}}),Ci=({path:e,updateOnChildren:t=!1,ctx:s})=>{const r=be(s),{bind:o,get:i}=r,[u,a]=x.useState(i(e).value);return x.useEffect(()=>(a(i(e).value),o({path:e,onChange:d=>{a(C.H(d.value))},listenToChildren:t})),[e,o,i,a]),x.useMemo(()=>({value:u,...rn(r,e)}),[u,r,e])},Gt=x.createContext({mode:"normal",bind:()=>()=>{},set:()=>{},reset:()=>{},remove:()=>{},get:()=>({value:void 0,status:{key:"",variant:"success",message:""},touched:!1,required:!1}),validate:()=>!1,validateAsync:()=>Promise.resolve(!1),value:()=>({}),has:()=>!1,setStatus:()=>{},clearStatuses:()=>{}}),be=e=>{const t=x.useContext(Gt);return e??t},js=e=>({key:e,variant:"success",message:""}),yi=e=>e.code===ce.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",on=({values:e,sync:t=!1,schema:s,mode:r="normal",onChange:o})=>{const i=x.useRef({state:e,statuses:new Map,touched:new Set,listeners:new Map,parentListeners:new Map}),u=c.useSyncedRef(s),a=c.useSyncedRef(o),d=x.useCallback(({path:g,onChange:v,listenToChildren:B=!1})=>{var T;const{parentListeners:L,listeners:N}=i.current,y=B?L:N;return y.has(g)||y.set(g,new Set),(T=y.get(g))==null||T.add(v),()=>{var b;return(b=y.get(g))==null?void 0:b.delete(v)}},[]),p=x.useCallback((g,{optional:v}={optional:!1})=>{const{state:B,statuses:L,touched:N}=i.current,y=C._.get(B,g,{optional:v});if(y==null)return null;const T={value:y,status:L.get(g)??js(g),touched:N.has(g),required:!1};if(u.current==null)return T;const b=u.current,O=Zo.getFieldSchema(b,g,{optional:!0});return O==null||(T.required=!O.isOptional()),T},[]),m=x.useCallback(g=>{const{state:v,statuses:B,touched:L,listeners:N,parentListeners:y}=i.current;C._.remove(v,g),B.delete(g),L.delete(g),N.delete(g),y.delete(g)},[]),f=x.useCallback(g=>{const{statuses:v,touched:B}=i.current;i.current.state=g,S(""),v.clear(),B.clear()},[]),h=x.useCallback(g=>{var L;const{listeners:v}=i.current,B=p(g,{optional:!0});B!=null&&((L=v.get(g))==null||L.forEach(N=>N(B)))},[]),S=x.useCallback(g=>{const{listeners:v,parentListeners:B}=i.current,L=v.get(g);if(g==""&&([...v.keys()].forEach(T=>{var O;const b=p(T,{optional:!0});b!=null&&((O=v.get(T))==null||O.forEach(D=>{D(b)}))}),[...B.keys()].forEach(T=>{var O;const b=p(T,{optional:!0});b!=null&&((O=B.get(T))==null||O.forEach(D=>{D(b)}))})),L!=null){const N=p(g,{optional:!0});N!=null&&L.forEach(y=>{y(N)})}B.forEach((N,y)=>{if(C._.pathsMatch(g,y)){const b=p(y,{optional:!0});b!=null&&N.forEach(O=>{O(b)})}})},[]),R=x.useCallback((g,v="",B=!0)=>{const{statuses:L,listeners:N,touched:y}=i.current;if(g.success){const D=[...L.keys()];return L.clear(),D.forEach(Z=>h(Z)),!0}let T=!0;const b=new Set(g.error.issues.map(D=>D.path.join(".")));let O=(D,Z)=>D===Z;return B&&(O=(D,Z)=>C._.pathsMatch(D,Z)),g.error.issues.forEach(D=>{var J;const{message:Z}=D,I=D.path.join(".");if(!O(I,v))return;const Y=yi(D);Y!=="warning"&&(T=!1),L.set(I,{key:I,variant:Y,message:Z}),y.add(I);let z=p(I,{optional:!0});z==null&&(z={value:void 0,status:L.get(I)??js(I),touched:!1,required:!1}),(J=N.get(I))==null||J.forEach(te=>te(z))}),L.forEach((D,Z)=>{b.has(Z)||(L.delete(Z),h(Z))}),T},[]),E=x.useCallback((g,v)=>{if(u.current==null)return!0;const{state:B}=i.current,L=u.current.safeParse(B);return R(L,g,v)},[R]),w=x.useCallback(async(g,v)=>{if(u.current==null)return!0;const{state:B}=i.current,L=await u.current.safeParseAsync(B);return R(L,g,v)},[R]),M=x.useCallback((g,v,B={})=>{const L=C._.get(i.current.state,g,{optional:!0}),{validateChildren:N=!0}=B,{state:y,touched:T}=i.current;T.add(g),g.length===0?i.current.state=v:C._.set(y,g,v),S(g),(async()=>{var O;let b;try{b=E(g,N)}catch{b=await w(g,N)}(O=a.current)==null||O.call(a,{values:i.current.state,path:g,prev:L,valid:b})})()},[]),_=x.useCallback(g=>C._.has(i.current.state,g),[]),$=x.useCallback((g,v)=>{i.current.statuses.set(g,v),i.current.touched.add(g),h(g)},[]),P=x.useCallback(()=>{const{statuses:g}=i.current;g.clear(),g.forEach((v,B)=>h(B))},[]);return x.useEffect(()=>{if(!t)return;const{listeners:g}=i.current;i.current.state=e,g.forEach((v,B)=>{const L=p(B,{optional:!0});L!=null&&v.forEach(N=>N(L))})},[t,e]),x.useMemo(()=>({bind:d,set:M,get:p,mode:r,validate:E,validateAsync:w,value:()=>i.current.state,has:_,remove:m,setStatus:$,clearStatuses:P,reset:f}),[d,M,p,E,w,_,m,$,P,f,r])},bi=e=>n.jsxRuntimeExports.jsx(Gt.Provider,{value:e,children:e.children}),vi=c.componentRenderProp(c.Text$1),ne=({path:e,children:t=vi,label:s,padHelpText:r=!0,visible:o=!0,hideIfNull:i=!1,optional:u,onChange:a,className:d,...p})=>{const m=ve({path:e,optional:u??i,onChange:a}),f=be();if(m==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(s==null&&(s=l._.capitalize(C._.element(e,-1))),o=typeof o=="function"?o(m,f):o,!o)return null;const h=m.status.message,{onChange:S,value:R}=m,E={onChange:S,value:R};return m.variant!=null&&(E.variant=m.variant),n.jsxRuntimeExports.jsx(me.Item,{padHelpText:r,helpText:h,helpTextVariant:m.status.variant,label:s,required:m.required,className:l.CSS(d,l.CSS.BE("field",e.split(".").join("-")),l.CSS.M(m.status.variant)),...p,children:t(E)})},we=e=>({fieldKey:t,fieldProps:s,inputProps:r})=>{const o=({inputProps:i,path:u,fieldKey:a=t,...d})=>n.jsxRuntimeExports.jsx(ne,{...s,...d,path:a?`${u}.${a}`:u,children:p=>n.jsxRuntimeExports.jsx(e,{...p,...r,...i})});return o.displayName=e.displayName,o},ln=we(c.Numeric),wi=ln({}),cn=we(c.Text$1),Pi=cn({}),an=we(c.Switch$1),ki=an({}),Ti=we(ye),Li=we(_e),Mi=we(ae.DropdownButton),Ut=({key:e,open:t,onChange:s})=>{const r=c.useMemoPrimitiveArray(e);c.useAsyncEffect(async()=>{if(t==null)return;const o=await t();if(o!=null)return o.onChange(s),async()=>await o.close()},[t==null,r])},_i=({fetchInitialValue:e,...t})=>{const[s,r]=x.useState(void 0);return c.useAsyncEffect(async()=>{r(await e())},[e]),Ut({...t,onChange:r}),s},$i=Object.freeze(Object.defineProperty({__proto__:null,useListener:Ut,useState:_i},Symbol.toStringTag,{value:"Module"})),Ni=({key:e,name:t,queryFn:s,values:r,openObservable:o,applyChanges:i,applyObservable:u,...a})=>{const d=je(),p=c.useAggregator(),m=c.useMemoPrimitiveArray(e),f=on({values:r,...a,sync:!1,onChange:R=>{d!=null&&(async()=>{try{await(i==null?void 0:i({...R,client:d}))}catch(E){p({variant:"error",message:`Failed to save ${t}`,description:E.message})}})()}});c.useAsyncEffect(async()=>{if(d!=null)try{const R=await s({client:d});f.set("",R)}catch(R){p({variant:"error",message:`Failed to retrieve ${t}`,description:R.message})}},[m,d==null?void 0:d.key]);const h=x.useCallback(async()=>{if(d!=null)return await(o==null?void 0:o(d))},[m,d==null?void 0:d.key]),S=x.useCallback(R=>u==null?void 0:u({changes:R,ctx:f}),[m,u]);return Ut({key:m,open:h,onChange:S}),f},Bi=Object.freeze(Object.defineProperty({__proto__:null,Context:Gt,Field:ne,Form:bi,NumericField:wi,SwitchField:ki,TextField:Pi,buildDropdownButtonSelectField:Mi,buildNumericField:ln,buildSelectMultiField:Li,buildSelectSingleField:Ti,buildSwitchField:an,buildTextField:cn,fieldArrayUtils:rn,fieldBuilder:we,use:on,useChildFieldValues:Ri,useContext:be,useField:ve,useFieldArray:Ci,useFieldListener:Ei,useFieldState:nn,useFieldValid:gi,useFieldValue:hi,useSynced:Ni},Symbol.toStringTag,{value:"Module"})),Oi=[{key:"name",name:"Name"},{key:"location",name:"Location"}],zi=({searchOptions:e,...t})=>{const s=je();let r=s==null?void 0:s.hardware.devices;return e!=null&&s!=null&&(r=s.hardware.devices.newSearcherWithOptions(e)),n.jsxRuntimeExports.jsx(ye,{columns:Oi,searcher:r,entryRenderKey:"name",...t})},Di=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:zi},Symbol.toStringTag,{value:"Module"})),qe=(e,t)=>x.cloneElement(e,{className:l.CSS(e.props.className,l.CSS.B("sub"),l.CSS.M(t))}),Wt=({topRight:e,topLeft:t,bottomLeft:s,bottomRight:r,children:o,className:i,...u})=>n.jsxRuntimeExports.jsxs("div",{className:l.CSS(i,l.CSS.B("icon")),...u,children:[e&&qe(e,"topRight"),t&&qe(t,"topLeft"),s&&qe(s,"bottomLeft"),r&&qe(r,"bottomRight"),o]}),Ai=e=>n.jsxRuntimeExports.jsx(Wt,{topRight:n.jsxRuntimeExports.jsx(c.St.Add,{}),...e}),Vi=e=>n.jsxRuntimeExports.jsx(Wt,{topRight:n.jsxRuntimeExports.jsx(c.St.Import,{}),...e}),Ii=Object.freeze(Object.defineProperty({__proto__:null,Create:Ai,Icon:Wt,Import:Vi},Symbol.toStringTag,{value:"Module"})),ke="label",Xt=[{key:"color",name:"Color",render:({entry:e})=>n.jsxRuntimeExports.jsx(c.St.Circle,{name:"circle",color:e.color,style:{height:"2.5rem",width:"2.5rem"}})},{key:"name",name:"Name"}],Ke=({items:e},t)=>{const s=c.filterByType(ke,e);return s.length>0&&!s.every(r=>t.includes(r.key))},Zi=({entry:e,loading:t,entryKey:s,entryRenderKey:r,...o})=>n.jsxRuntimeExports.jsx(Ae,{color:e==null?void 0:e.color,...o,children:e==null?void 0:e.name}),Fi=c.componentRenderProp(Zi),qi=({onChange:e,className:t,value:s,...r})=>{const o=je(),i=o!=null?void 0:n.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:u,onDragEnd:a,...d}=c.useDragAndDrop({type:"Label.SelectMultiple",canDrop:x.useCallback(h=>Ke(h,C.A(s)),[s]),onDrop:x.useCallback(({items:h})=>{const S=c.filterByType(ke,h);if(S.length===0)return[];const R=C.n([...C.A(s),...S.map(E=>E.key)]);return e(R,{clickedIndex:null,clicked:null,entries:[]}),S},[e,s])}),p=c.useDraggingState(),m=x.useCallback(({dropped:h})=>{e(C.A(s).filter(S=>!h.some(R=>R.key===S)),{clickedIndex:null,clicked:null,entries:[]})},[e,s]),f=x.useCallback((h,S)=>u([{key:S,type:ke}],m),[u,m]);return n.jsxRuntimeExports.jsx(_e,{className:l.CSS(t,l.CSS.dropRegion(Ke(p,C.A(s)))),value:s,onTagDragStart:f,onTagDragEnd:a,searcher:o==null?void 0:o.labels,onChange:e,columns:Xt,emptyContent:i,renderTag:Fi,addPlaceholder:"Label",...d,...r})},un=({value:e,onChange:t})=>{const s=je(),r=s!=null?void 0:n.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),o=x.useId(),i=x.useMemo(()=>({key:o,type:"Label.SelectMultiple"}),[o]),u=c.useDragAndDrop({type:"Label.SelectSingle",canDrop:x.useCallback(p=>Ke(p,C.o(e)),[e]),onDrop:x.useCallback(({items:p})=>{const m=c.filterByType(ke,p);return m.length===0?[]:(t(m[0].key,{clickedIndex:null,clicked:null,entries:[]}),m)},[i,t])}),a=c.useDraggingState(),d=x.useCallback(()=>e!=null&&u.startDrag([{type:ke,key:e}]),[u.startDrag,e]);return{emptyContent:r,dragging:a,...u,onDragStart:d,searcher:s==null?void 0:s.labels}},Hi=({onChange:e,value:t,className:s,data:r,...o})=>{const{dragging:i,...u}=un({value:t,onChange:e});return n.jsxRuntimeExports.jsx(ye,{data:r,className:l.CSS(s,l.CSS.dropRegion(Ke(i,C.o(t)))),value:t,onChange:e,columns:Xt,entryRenderKey:"name",...u,...o})},Yi=({data:e,value:t,onChange:s,...r})=>{const{dragging:o,...i}=un({value:t,onChange:s});return n.jsxRuntimeExports.jsx(ye,{data:e,value:t,onChange:s,columns:Xt,entryRenderKey:"name",...i,...r})},Gi=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:ke,SelectButton:Yi,SelectMultiple:qi,SelectSingle:Hi},Symbol.toStringTag,{value:"Module"})),Ui=({visible:e,children:t,close:s,style:r,...o})=>{const i=x.useRef(null);return c.useClickOutside({ref:i,exclude:u=>c.findParent(u.target,d=>d.getAttribute("role")==="dialog")!=null,onClickOutside:s}),c.use$2({triggers:[["Escape"]],callback:s,loose:!0}),Nt.createPortal(n.jsxRuntimeExports.jsx(A.Space,{className:l.CSS(l.CSS.BE("modal","bg"),l.CSS.visible(e)),empty:!0,align:"center",children:n.jsxRuntimeExports.jsx(A.Space,{className:l.CSS(l.CSS.BE("modal","dialog")),role:"dialog",empty:!0,ref:i,...o,style:{zIndex:11,...r},children:n.jsxRuntimeExports.jsx(A.Space,{className:l.CSS(l.CSS.BE("modal","content")),empty:!0,children:t})})}),c.getRootElement())},Wi=Object.freeze(Object.defineProperty({__proto__:null,Modal:Ui},Symbol.toStringTag,{value:"Module"})),Kt=new Error("Tab not found"),Xi=new Error("Invalid Mosaic"),Je=(e,t,s="center",r)=>{var f;if(e=Pe(e),r===void 0)return wt(e,t);const o=kt(e,r);if(s==="center")return(f=o.tabs)==null||f.push(t),o.selected=t.tabKey,e;const i=o.key*2,u=o.key*2+1,a=s==="top"||s==="left"?i:u;if(kt(e,a).key!==o.key)return Je(e,t,"center",a);if(o.tabs==null||o.tabs.length===0)return Je(e,t,"center",r);const[d,p,m]=Qi(s);if(o.direction=m,o[d]={key:0,tabs:[t],selected:t.tabKey},o[p]={key:0,tabs:o.tabs,selected:o.selected},o.first==null||o.last==null)throw Xi;return o.first.key=i,o.last.key=u,o.tabs=void 0,o.size=void 0,o.selected=void 0,e},wt=(e,t)=>(e=Pe(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=wt(e.first,t):e.last!=null&&(e.last=wt(e.last,t)),e)),Qe=e=>{e=Pe(e);const t=[];if(e.tabs!=null&&(e.selected=se.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[s,r]=Qe(e.first);e.first=s,t.push(...r)}if(e.last!=null){const[s,r]=Qe(e.last);e.last=s,t.push(...r)}return[e,t]},Jt=(e,t)=>{var o;e=Pe(e);const[,s]=Te(e,t);if(s==null)return[e,null];s.tabs=(o=s.tabs)==null?void 0:o.filter(i=>i.tabKey!==t),s.selected=se.resetSelection(s.selected,s.tabs),e=Ji(e);const r=s.selected??et(e);return[e,r]},et=e=>e.selected!=null?e.selected:e.first!=null?et(e.first):e.last!=null?et(e.last):null,xn=(e,t)=>{e=Pe(e);const[s,r]=Te(e,t);if(s==null||r==null)throw Kt;return r.selected=t,e},dn=(e,t,s,r)=>{e=Pe(e);const[o,i]=Te(e,t);if(o==null||i==null)throw Kt;const[u,a]=Jt(e,t);return[Je(u,o,s,r),a]},Pt=(e,t)=>{if(e.tabs!=null)return e.tabs.some(s=>s.tabKey===t)?e:void 0;if(e.first!=null){const s=Pt(e.first,t);if(s!=null)return s}if(e.last!=null){const s=Pt(e.last,t);if(s!=null)return s}},mn=(e,t,s)=>{const r=tt(e,t);if(r==null)throw new Error("Node not found");return r.size=s,e},pn=(e,t,s)=>{e=Pe(e);const[,r]=Te(e,t);if((r==null?void 0:r.tabs)==null)throw Kt;return r.tabs=se.rename(t,s,(r==null?void 0:r.tabs)??[]),e},Ki=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,kt=(e,t)=>{const s=tt(e,t);if(s!=null)return s;const r=Math.floor(t/2);return r===0?e:kt(e,r)},Ji=e=>{let t=!0;for(;t;)[e,t]=Tt(e);return e.first==null&&e.last==null&&(e.key=1),e},Tt=e=>{if(e.first==null||e.last==null)return[e,!1];if(Ss(e.first))return[fs(e.last,!0),!0];if(Ss(e.last))return[fs(e.first,!1),!0];let[t,s]=[!1,!1];return[e.first,t]=Tt(e.first),[e.last,s]=Tt(e.last),[e,t||s]},fs=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),Ss=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),Te=(e,t)=>{if(e.tabs!=null){const u=e.tabs.find(a=>a.tabKey===t);if(u!=null)return[u,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[s,r]=Te(e.first,t);if(s!=null&&r!=null)return[s,r];const[o,i]=Te(e.last,t);return[o,i]},tt=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const s=tt(e.first,t);return s??tt(e.last,t)},Qi=e=>{switch(e){case"top":return["first","last","y"];case"left":return["first","last","x"];case"bottom":return["last","first","y"];case"right":return["last","first","x"];case"center":throw new Error("cannot split a center placed tab")}},Pe=e=>C._.copy(e),st=(e,t,s=[])=>(s.push(t(e)),e.first!=null&&st(e.first,t,s),e.last!=null&&st(e.last,t,s),s),Lt=(e,t)=>{t(e),e.first!=null&&Lt(e.first,t),e.last!=null&&Lt(e.last,t)};class ec{constructor(t={}){Se(this,"parent");Se(this,"stub");Se(this,"el");this.el=document.createElement("div"),Object.entries(t).forEach(([s,r])=>this.el.setAttribute(s,r))}mount(t,s){s!==this.stub&&(this.unmount(null),t.replaceChild(this.el,s),this.parent=t,this.stub=s)}unmount(t){t!=null&&t!==this.stub||this.parent==null||this.stub==null||(this.parent.replaceChild(this.stub,this.el),this.parent=void 0,this.stub=void 0)}}const tc=({node:e})=>{const t=x.createRef(),s=x.useRef(e);return x.useEffect(()=>{const r=t.current;if(r==null)return;const o=r.parentNode;if(o!=null)return e.mount(o,r),()=>{t.current!=null&&e.unmount(t.current)}},[]),x.useEffect(()=>{s.current!=null&&e!==s.current&&(s.current.unmount(t.current),s.current=e);const r=t.current;if(r==null)return;const o=r.parentNode;o!=null&&e.mount(o,r)},[e]),n.jsxRuntimeExports.jsx("div",{ref:t})},sc=({node:e,children:t})=>Nt.createPortal(t,e.el),jn=x.memo(({children:e,...t})=>{const s=x.useRef(new Map),r=new Set,o=st(t.root,i=>{var d;if(i.selected==null)return null;let u=s.current.get(i.selected);const a=(d=i.tabs)==null?void 0:d.find(p=>p.tabKey===i.selected);return a==null?null:(u==null&&(u=new ec({style:"width: 100%; height: 100%; position: relative;"}),u.el.addEventListener("click",()=>{var p;return(p=t.onSelect)==null?void 0:p.call(t,a.tabKey)}),s.current.set(i.selected,u)),r.add(i.selected),n.jsxRuntimeExports.jsx(sc,{node:u,children:e(a)},a.tabKey))});return s.current.forEach((i,u)=>!r.has(u)&&s.current.delete(u)),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[o,n.jsxRuntimeExports.jsx(nt,{portalNodes:s,...t})]})}),nt=x.memo(e=>{const{onResize:t,...s}=e,{root:{tabs:r,direction:o,first:i,last:u,key:a,size:d},emptyContent:p,...m}=s,f=x.useCallback(([R])=>t(a,R),[t]),{props:h}=Bt({direction:o,onResize:f,count:2,initialSizes:d!=null?[d]:void 0});let S;return r!==void 0?S=n.jsxRuntimeExports.jsx(fn,{emptyContent:p,...s}):i!=null&&u!=null?S=n.jsxRuntimeExports.jsxs(ct,{align:"stretch",className:l.CSS.BE("mosaic","resize"),...h,children:[n.jsxRuntimeExports.jsx(nt,{...m,root:i,onResize:t},i.key),n.jsxRuntimeExports.jsx(nt,{...m,root:u,onResize:t},u.key)]}):(S=null,console.warn("Mosaic tree is malformed")),a===1?n.jsxRuntimeExports.jsx(c.Provider$2,{children:S}):S});jn.displayName="Mosaic";nt.displayName="Mosaic";const rt="pluto-mosaic-tab-drop",Qt="pluto-mosaic-tab-create",nc=(e,t,s)=>{if(c.filterByType(c.FILE_TYPE,t).length>0&&s)return!0;const o=c.filterByType(rt,t).map(a=>a.key),i=e.filter(a=>!o.includes(a.tabKey)).length>0;return c.filterByType(Qt,t).length>0||o.length>0&&(i||e.length===0)},fn=x.memo(({root:e,onDrop:t,onCreate:s,portalNodes:r,activeTab:o,onFileDrop:i,...u})=>{const{key:a,tabs:d}=e,[p,m]=x.useState(null),f=i!=null,h=x.useCallback(({items:g})=>nc(d,g,f),[d,f]),S=x.useCallback(({items:g,event:v})=>{if(v==null)return[];m(null);const B=c.filterByType(c.FILE_TYPE,g).length>0,L=d.length===0?"center":gs(hs(v));if(B)return i==null||i(a,L,v),g;const N=c.filterByType(rt,g);if(N.length>0){const T=N.map(({key:b})=>b)[0];t(a,T,L)}const y=c.filterByType(Qt,g);if(y.length>0){const T=y.map(({key:b})=>b);s==null||s(a,L,T)}return N},[t,d.length]),R=x.useCallback(({event:g})=>{if(g==null)return;const v=d.length===0?"center":gs(hs(g));m(v)},[d.length]),{startDrag:E,...w}=c.useDragAndDrop({type:"Mosaic",canDrop:h,onDrop:S,onDragOver:R}),M=h(c.useDraggingState()),_=x.useCallback(()=>m(null),[]),$=x.useCallback((g,{tabKey:v})=>{E([{key:v,type:rt,elementID:g.currentTarget.id}])},[E]),P=x.useCallback(()=>s==null?void 0:s(a,"center"),[a]);return n.jsxRuntimeExports.jsxs("div",{className:l.CSS.BE("mosaic","leaf"),children:[n.jsxRuntimeExports.jsxs(se.Tabs,{id:`tab-${a}`,tabs:d,onDragLeave:_,selected:e.selected,selectedAltColor:o===e.selected,onDragStart:$,onCreate:P,...u,...w,children:[n.jsxRuntimeExports.jsx(tc,{node:r.current.get(e.selected)}),M&&n.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}})]}),p!=null&&n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("mosaic","mask"),style:rc[p]})]})});fn.displayName="MosaicTabLeaf";const rc={top:{left:"0%",top:"0%",width:"100%",height:"50%"},bottom:{left:"0%",top:"50%",width:"100%",height:"50%"},left:{left:"0%",top:"0%",width:"50%",height:"100%"},right:{left:"50%",top:"0%",width:"50%",height:"100%"},center:{left:"0%",top:"0%",width:"100%",height:"100%"}},hs=e=>{const t=e.currentTarget.getBoundingClientRect(),s=e.clientX-t.left,r=e.clientY-t.top;return r<24?{px:.5,py:.5}:{px:s/t.width,py:r/t.height}},oc=e=>e,lc=e=>1-e,gs=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[s,r]=[oc(e),lc(e)];if(t>s&&t>r)return"bottom";if(t<s&&t<r)return"top";if(t>s&&t<r)return"left";if(t<s&&t>r)return"right";throw new Error("[bug] - invalid insert position")},ic=ce.z.object({key:ce.z.number(),tabs:ce.z.array(se.tabZ).optional(),selected:ce.z.string().optional(),direction:l.g.direction.optional(),size:ce.z.number().optional()}),Mt=ic.extend({first:ce.z.lazy(()=>Mt).optional(),last:ce.z.lazy(()=>Mt).optional()}),cc=({allowRename:e=!1,initialTree:t})=>{const[s,r]=x.useState(t);return x.useEffect(()=>r(Qe(t)[0]),[t]),{root:s,onDrop:(p,m,f)=>r(h=>dn(h,m,f,p)[0]),onClose:p=>r(m=>Jt(m,p)[0]),onSelect:p=>r(m=>xn(m,p)),onResize:(p,m)=>r(f=>mn(f,p,m)),onRename:e?(p,m)=>r(f=>pn(f,p,m)):void 0}},ac=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Qt,HAUL_DROP_TYPE:rt,Mosaic:jn,autoSelectTabs:Qe,findSelected:et,findTabNode:Pt,forEachNode:Lt,insertTab:Je,isEmpty:Ki,mapNodes:st,moveTab:dn,nodeZ:Mt,removeTab:Jt,renameTab:pn,resizeNode:mn,selectTab:xn,use:cc},Symbol.toStringTag,{value:"Module"})),uc=({location:e="left",size:t="9rem",className:s,style:r,...o})=>{const i=l.J.construct(e),u=l.J.direction(i),a=l.g.swap(u);return n.jsxRuntimeExports.jsx(A.Space,{className:l.CSS(l.CSS.B("navbar"),l.CSS.bordered(l.J.swap(i)),l.CSS.dir(a),l.CSS.loc(i),s),direction:a,style:{[l.g.dimension(u)]:t,...r},align:"center",empty:!0,...o})},Ie=e=>({bordered:t=!1,className:s,...r})=>n.jsxRuntimeExports.jsx(A.Space,{className:l.CSS(l.CSS.BE("navbar","content"),e==="absolute-center"?l.CSS.M(e):l.CSS.align(e),e!==""&&t&&l.CSS.bordered(e),s),align:"center",...r}),Sn=Ie("start");Sn.displayName="NavbarStart";const hn=Ie("end");hn.displayName="NavbarEnd";const gn=Ie("center");gn.displayName="NavbarCenter";const En=Ie("");En.displayName="NavbarContent";const Rn=Ie("absolute-center");Rn.displayName="NavbarAbsoluteCenter";const $e=uc;$e.Start=Sn;$e.Center=gn;$e.End=hn;$e.AbsoluteCenter=Rn;$e.Content=En;const es=({aetherKey:e})=>{const[,{region:t},s]=c.use$3({aetherKey:e,type:j.Eraser$1.TYPE,schema:j.eraserStateZ,initialState:{region:l.To.ZERO,enabled:!0}}),r=c.useSyncedRef(t),o=x.useCallback(u=>{l.To.equals(u,r.current)||s(a=>({...a,region:u}))},[s]);return{setEnabled:x.useCallback(u=>s(a=>({...a,enabled:u})),[s]),erase:o}},xc=c.wrap$1(j.Eraser$1.TYPE,({aetherKey:e,children:t})=>{const{erase:s}=es({aetherKey:e}),r=c.useResize(s);return n.jsxRuntimeExports.jsx("div",{ref:r,className:l.CSS(l.CSS.inheritDims()),children:t})}),dc=Object.freeze(Object.defineProperty({__proto__:null,Eraser:xc,use:es},Symbol.toStringTag,{value:"Module"})),mc=({items:e,initialKey:t})=>{const[s,r]=x.useState(t),o=u=>r(u===s?void 0:u),i=e.find(u=>u.key===s);return{onSelect:o,activeItem:i}},pc=c.wrap$1("Nav.Drawer",({aetherKey:e,activeItem:t,children:s,onSelect:r,location:o="left",collapseThreshold:i=.65,className:u,onResize:a,...d})=>{const p=l.J.direction(o),m=x.useCallback(()=>t!=null&&(r==null?void 0:r(t.key)),[r,t==null?void 0:t.key]),{erase:f,setEnabled:h}=es({aetherKey:e}),S=x.useCallback((M,_)=>{a==null||a(M,_),f(_)},[a,f]);if(x.useLayoutEffect(()=>{h(t!=null)},[t,h]),t==null)return null;const{content:R,key:E,...w}=t;return n.jsxRuntimeExports.jsx(bs,{className:l.CSS(l.CSS.BE("navdrawer","content"),l.CSS.dir(p),u),collapseThreshold:i,onCollapse:m,location:o,onResize:S,...w,...d,children:t.content},E)}),jc=Object.freeze(Object.defineProperty({__proto__:null,Bar:$e,Drawer:pc,useDrawer:mc},Symbol.toStringTag,{value:"Module"})),fc=({variant:e,className:t,children:s,...r})=>n.jsxRuntimeExports.jsx(A.Space,{className:l.CSS(t,l.CSS.B("note"),l.CSS.M(e)),align:"stretch",empty:!0,...r,children:s}),Sc=Object.freeze(Object.defineProperty({__proto__:null,Note:fc},Symbol.toStringTag,{value:"Module"})),Rt={Close:n.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),n.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:n.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:n.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsxRuntimeExports.jsx("path",{d:"M108.242 32.8833C108.797 32.8817 109.247 33.3317 109.245 33.8862L109.092 87.5891C109.09 88.4786 108.014 88.9223 107.385 88.2933L53.8351 34.7432C53.2061 34.1142 53.6499 33.0387 54.5394 33.0361L108.242 32.8833Z",fill:"#0B650D"}),n.jsxRuntimeExports.jsx("path",{d:"M33.8862 109.245C33.3317 109.247 32.8818 108.797 32.8833 108.242L33.0361 54.5394C33.0387 53.6499 34.1142 53.2061 34.7432 53.8351L88.2934 107.385C88.9223 108.014 88.4786 109.09 87.5891 109.092L33.8862 109.245Z",fill:"#0B650D"})]})},hc=({disabled:e=[],className:t,focused:s=!0,onMinimize:r,onMaximize:o,onFullscreen:i,onClose:u,...a})=>n.jsxRuntimeExports.jsxs(A.Space,{size:1.5,direction:"x",className:l.CSS(l.CSS.B("macos-controls"),!s&&l.CSS.BM("macos-controls","blurred"),t),...a,children:[n.jsxRuntimeExports.jsx(Ct,{onClick:u,className:l.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:Rt.Close}),n.jsxRuntimeExports.jsx(Ct,{onClick:r,className:l.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:Rt.Minimize}),n.jsxRuntimeExports.jsx(Ct,{onClick:i,className:l.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:Rt.Maximize})]}),Ct=({className:e,disabled:t,color:s,...r})=>n.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("macos-control"),l.CSS.disabled(t),e),tabIndex:-1,disabled:t,size:"",...r}),yt=({disabled:e=[],onMinimize:t,onMaximize:s,onClose:r,onFullscreen:o,focused:i,...u})=>n.jsxRuntimeExports.jsxs(A.Pack,{...u,children:[n.jsxRuntimeExports.jsx(bt,{className:l.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:n.jsxRuntimeExports.jsx(c.St.Subtract,{})}),n.jsxRuntimeExports.jsx(bt,{className:l.CSS.BM("windows-control","maximize"),onClick:s,disabled:e.includes("maximize"),children:n.jsxRuntimeExports.jsx(c.St.Box,{})}),n.jsxRuntimeExports.jsx(bt,{onClick:r,className:l.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:n.jsxRuntimeExports.jsx(c.St.Close,{})})]}),bt=({disabled:e=!1,className:t,...s})=>e?null:n.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS(l.CSS.B("windows-control"),t),tabIndex:-1,...s}),Cn=e=>C.w$1.getOS(e),gc={MacOS:hc,Windows:yt,Linux:yt,Docker:yt},Ec="Windows",Rc=({forceOS:e,visibleIfOS:t,...s})=>{const r=Cn({force:e,default:Ec}),o=gc[r];return t!=null&&t!==r?null:n.jsxRuntimeExports.jsx(o,{...s})},Cc=Object.freeze(Object.defineProperty({__proto__:null,Controls:Rc,use:Cn},Symbol.toStringTag,{value:"Module"}));x.createContext({instrumentation:C.B$1.NOOP});const yc=c.wrap$1(j.Provider$2.TYPE,({aetherKey:e,children:t,...s})=>{const r=c.useMemoDeepEqualProps(s),[{path:o},,i]=c.use$3({aetherKey:e,type:j.Provider$2.TYPE,schema:j.providerStateZ$1,initialState:r});return x.useEffect(()=>{i(r)},[r,i]),n.jsxRuntimeExports.jsx(c.Composite,{path:o,children:t})}),bc="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjQgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",yn=c.wrap$1(j.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:s}]=c.use$3({aetherKey:t,type:j.BaseProvider.TYPE,schema:j.providerStateZ$2,initialState:{}});return n.jsxRuntimeExports.jsx(c.Composite,{path:s,children:e})}),vc=Object.freeze(Object.defineProperty({__proto__:null,Provider:yn},Symbol.toStringTag,{value:"Module"})),wc=e=>{var t,s;switch(e.variant){case"disabled":return((t=e.data)==null?void 0:t.valid)===!0?{message:"Uncontrolled. Click to take control.",chipColor:"var(--pluto-gray-l10)"}:{message:"No channel connected",chipColor:"var(--pluto-gray-l5)",disabled:!0};case"error":return{message:"Not controlled by you. Click to take absolute control.",chipColor:"var(--pluto-error-z)"};case"success":return((s=e.data)==null?void 0:s.authority)===C.id.Authority.Absolute.valueOf()?{message:"You have absolute control. Click to release.",chipColor:"var(--pluto-secondary-z)",buttonStyle:{background:"var(--pluto-secondary-z-30)"}}:{message:"You're in control. Release P&ID to release control.",chipColor:"var(--pluto-primary-z)"};default:return{message:"Unexpected status.",chipColor:"var(--pluto-error-z)"}}},bn=c.wrap$1("Chip",({aetherKey:e,source:t,sink:s,className:r,...o})=>{const i=c.useMemoDeepEqualProps({source:t,sink:s}),[,{status:u},a]=c.use$3({aetherKey:e,type:j.Chip.TYPE,schema:j.chipStateZ,initialState:{triggered:!1,...i,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:C.m.now()}}});x.useEffect(()=>{a(S=>({...S,...i}))},[i,a]);const d=x.useCallback(()=>a(S=>({...S,triggered:!S.triggered})),[a]),{message:p,chipColor:m,buttonStyle:f,disabled:h}=wc(u);return n.jsxRuntimeExports.jsx(c.Icon,{variant:"text",className:l.CSS(l.CSS.B("control-chip"),r),disabled:h,onClick:d,tooltip:n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:p}),style:f,...o,children:n.jsxRuntimeExports.jsx(c.St.Circle,{color:m})})}),vn=x.createContext({needsControlOf:[]}),wn=()=>x.useContext(vn),Pc=c.wrap$1(j.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:s,...r})=>{const o=c.useMemoDeepEqualProps(r),[{path:i},{status:u,needsControlOf:a},d]=c.use$3({aetherKey:e,type:j.Controller$1.TYPE,schema:j.controllerStateZ,initialState:o});return x.useEffect(()=>{u!=null&&(s==null||s(u))},[u,s]),x.useEffect(()=>{d(p=>({...p,...o}))},[o,d]),x.useEffect(()=>()=>s==null?void 0:s("released"),[]),n.jsxRuntimeExports.jsxs(vn.Provider,{value:{needsControlOf:a},children:[n.jsxRuntimeExports.jsx(c.Composite,{path:i,children:t}),";"]})}),Pn=c.wrap$1(j.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:s})=>{var d;const r=c.useMemoDeepEqualProps({colorSource:t,statusSource:s}),[,{color:o,status:i},u]=c.use$3({aetherKey:e,type:j.Indicator.TYPE,initialState:{...r,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:C.m.now()}},schema:j.indicatorStateZ});x.useEffect(()=>{u(p=>({...p,...r}))},[r,u]);let a;return((d=i.data)==null?void 0:d.color)!=null?a=l.Color.z.parse(i.data.color):o!=null&&!o.isZero?a=o:a="var(--pluto-gray-l8)",n.jsxRuntimeExports.jsxs(c.Dialog$1,{location:{x:"center",y:"bottom"},children:[n.jsxRuntimeExports.jsx(c.Text,{level:"p",children:i.message}),n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("indicator"),style:{backgroundColor:l.cssString(a),flexGrow:1}})]})}),kc=c.wrap$1(j.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:s}=wn(),[,{states:r},o]=c.use$3({aetherKey:e,type:j.Legend.TYPE,schema:j.legendStateZ,initialState:{states:[],needsControlOf:s}});x.useEffect(()=>{o(a=>({...a,needsControlOf:s}))},[s]);const u=C.n(r.map(a=>a.subject.key)).map(a=>{const d=r.find(p=>p.subject.key===a);if(d==null)throw new C.Se("Legend subject not found");return{key:d.subject.key,label:d.subject.name,color:d.subjectColor}});return n.jsxRuntimeExports.jsx(It,{data:u,...t})}),kn=c.wrap$1(j.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:s}]=c.use$3({aetherKey:e,type:j.StateProvider.TYPE,schema:j.stateProviderStateZ,initialState:{}});return n.jsxRuntimeExports.jsx(c.Composite,{path:s,children:t})}),Tc=Object.freeze(Object.defineProperty({__proto__:null,Chip:bn,Controller:Pc,Indicator:Pn,Legend:kc,StateProvider:kn,useContext:wn},Symbol.toStringTag,{value:"Module"})),Tn=e=>{const t=({disabled:s=!1,...r})=>s?r.children:n.jsxRuntimeExports.jsx(e,{...r});return t.displayName=e.displayName,t},Lc=Tn(yn),Mc=Tn(c.Provider$3),_c=({children:e,connParams:t,workerEnabled:s=!0,workerURL:r,theming:o,tooltip:i,triggers:u,alamos:a,haul:d,channelAlias:p,telem:m})=>n.jsxRuntimeExports.jsx(c.Provider$1,{...u,children:n.jsxRuntimeExports.jsx(c.Config,{...i,children:n.jsxRuntimeExports.jsx(c.Provider$2,{...d,children:n.jsxRuntimeExports.jsx(c.Provider$4,{url:r??bc,enabled:s,children:n.jsxRuntimeExports.jsx(Mc,{workerKey:"vis",children:n.jsxRuntimeExports.jsx(yc,{...a,children:n.jsxRuntimeExports.jsx(c.Aggregator,{children:n.jsxRuntimeExports.jsx(Ps,{connParams:t,children:n.jsxRuntimeExports.jsx(Ls,{...p,children:n.jsxRuntimeExports.jsx(Lc,{...m,children:n.jsxRuntimeExports.jsx(c.Provider,{...o,children:n.jsxRuntimeExports.jsx(kn,{children:e})})})})})})})})})})})}),$c=Object.freeze(Object.defineProperty({__proto__:null,Provider:_c},Symbol.toStringTag,{value:"Module"})),Nc=({value:e})=>n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("progress"),children:n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("progress-bar"),style:{width:`${e}%`}})}),Bc=Object.freeze(Object.defineProperty({__proto__:null,Progress:Nc},Symbol.toStringTag,{value:"Module"})),Ve="range",ts=[{key:"name",name:"Name"}],ot=({items:e},t)=>{const s=c.filterByType(Ve,e);return s.length>0&&!s.every(r=>t.includes(r.key))},Oc=({onChange:e,className:t,value:s,...r})=>{const o=je(),i=o!=null?void 0:n.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:u,onDragEnd:a,...d}=c.useDragAndDrop({type:"Ranger.SelectMultiple",canDrop:x.useCallback(h=>ot(h,C.A(s)),[s]),onDrop:x.useCallback(({items:h})=>{const S=c.filterByType(Ve,h);if(S.length===0)return[];const R=C.n([...C.A(s),...S.map(E=>E.key)]);return e(R,{clickedIndex:null,clicked:null,entries:[]}),S},[e,s])}),p=c.useDraggingState(),m=x.useCallback(({dropped:h})=>{e(C.A(s).filter(S=>!h.some(R=>R.key===S)),{clickedIndex:null,clicked:null,entries:[]})},[e,s]),f=x.useCallback((h,S)=>u([{key:S,type:Ve}],m),[u,m]);return n.jsxRuntimeExports.jsx(_e,{className:l.CSS(t,l.CSS.dropRegion(ot(p,C.A(s)))),value:s,onTagDragStart:f,onTagDragEnd:a,searcher:o==null?void 0:o.ranges,onChange:e,columns:ts,emptyContent:i,entryRenderKey:"name",...d,...r})},Ln=({value:e,onChange:t})=>{const s=je(),r=s!=null?void 0:n.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),o=x.useId(),i=x.useMemo(()=>({key:o,type:"Ranger.SelectMultiple"}),[o]),{startDrag:u,...a}=c.useDragAndDrop({type:"Ranger.SelectSingle",canDrop:x.useCallback(m=>ot(m,C.o(e)),[e]),onDrop:x.useCallback(({items:m})=>{const f=c.filterByType(Ve,m);return f.length===0?[]:(t(f[0].key,{clickedIndex:null,clicked:null,entries:[]}),f)},[i,t])}),d=c.useDraggingState(),p=x.useCallback(()=>e!=null&&u([{type:Ve,key:e}]),[u,e]);return{emptyContent:r,dragging:d,...a,onDragStart:p,searcher:s==null?void 0:s.ranges}},zc=({onChange:e,value:t,className:s,data:r,...o})=>{const{dragging:i,...u}=Ln({value:t,onChange:e});return n.jsxRuntimeExports.jsx(ye,{data:r,className:l.CSS(s,l.CSS.dropRegion(ot(i,C.o(t)))),value:t,onChange:e,columns:ts,entryRenderKey:"name",...u,...o})},Dc=({data:e,value:t,onChange:s,...r})=>{const{dragging:o,...i}=Ln({value:t,onChange:s});return n.jsxRuntimeExports.jsx(ye,{data:e,value:t,onChange:s,columns:ts,entryRenderKey:"name",...i,...r})},Ac=[{key:"color",name:"Color",width:50,render:e=>n.jsxRuntimeExports.jsx(c.St.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],Vc=e=>{const t=je();return n.jsxRuntimeExports.jsx(_e,{...e,searcher:t==null?void 0:t.labels,columns:Ac,renderTag:s=>s.entry==null?n.jsxRuntimeExports.jsx(Ae,{color:"gray",children:s.entryKey}):n.jsxRuntimeExports.jsx(Ae,{color:s.entry.color,children:s.entry.name})})},Ic=({timeRange:e,level:t="p",shade:s=7,showSpan:r=!1,...o})=>{const i=new C.m(e.start),u=i.isToday?"time":"dateTime",a=new C.m(e.end),d=a.equals(C.m.MAX),p=a.span(i)<C.w.DAY?"time":"dateTime",m=i.span(a);return n.jsxRuntimeExports.jsxs(A.Space,{direction:"x",size:"small",className:l.CSS(l.CSS.B("time-range-chip")),align:"center",...o,children:[i.isToday&&n.jsxRuntimeExports.jsx(c.Text,{level:t,shade:s,weight:450,children:"Today"}),n.jsxRuntimeExports.jsx(c.DateTime,{level:t,displayTZ:"local",format:u,shade:s,weight:450,children:i}),n.jsxRuntimeExports.jsx(c.St.Arrow.Right,{color:"var(--pluto-text-color)"}),d?n.jsxRuntimeExports.jsx(c.Text,{level:t,children:"Now"}):n.jsxRuntimeExports.jsx(c.DateTime,{level:t,displayTZ:"local",format:p,shade:s,weight:450,children:a}),!m.isZero&&r&&n.jsxRuntimeExports.jsxs(c.Text,{level:t,shade:s,weight:450,children:["(",i.span(a).truncate(C.w.MILLISECOND).toString(),")"]})]})},Zc=Object.freeze(Object.defineProperty({__proto__:null,SelectButton:Dc,SelectLabels:Vc,SelectMultiple:Oc,SelectSingle:zc,TimeRangeChip:Ic},Symbol.toStringTag,{value:"Module"})),Fc=({steps:e,value:t,onChange:s,...r})=>{const o=e.findIndex(i=>i.key===t);return n.jsxRuntimeExports.jsx(A.Space,{direction:"x",align:"center",className:l.CSS.B("steps"),...r,children:e.map((i,u)=>n.jsxRuntimeExports.jsxs(x.Fragment,{children:[n.jsxRuntimeExports.jsxs(c.Button,{onClick:()=>s(i.key),variant:"outlined",disabled:u>o,children:[u+1,". ",i.title]},i.key),u!==e.length-1&&n.jsxRuntimeExports.jsx(c.St.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},i.key))})},qc=Object.freeze(Object.defineProperty({__proto__:null,Steps:Fc},Symbol.toStringTag,{value:"Module"})),Hc=(e,t="x")=>{if(e.length===0)return[];const s=l.J.construct(t),r=l.J.swap(s);return e.sort((o,i)=>l.To.loc(o.box,s)-l.To.loc(i.box,s)),e.forEach((o,i)=>{if(i===0)return;const a=e[i-1].handles.find(S=>S.orientation===r),d=o.handles.find(S=>S.orientation===s);if(a==null||d==null)return;const p=a.absolutePosition,m=d.absolutePosition,f=l.q.set(l.q.translation(m,p),t,0),h=l.q.translate(l.To.topLeft(o.box),f);o.box=l.To.construct(h,l.To.dims(o.box))}),e},ss=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},le=(e,t)=>{const s=ss(t),r=e.getNodes().find(o=>o.id===t);if(r==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return l.To.construct(r.position,l.q.scale(l.To.dims(l.To.construct(s)),1/e.getZoom()))},Yc=(e,t)=>pt.fromFlow(e,t);class Mn{constructor(t,s){Se(this,"node_",null);Se(this,"position");Se(this,"orientation");this.position=t,this.orientation=s}set node(t){this.node_=t}get node(){if(this.node_==null)throw new Error("[schematic] - handle has no node");return this.node_}get absolutePosition(){return l.q.translate(l.To.topLeft(this.node.box),this.position)}}class pt{constructor(t,s,r){Se(this,"key");Se(this,"box");Se(this,"handles");this.key=t,this.box=s,this.handles=r,r.forEach(o=>o.node=this)}static fromFlow(t,s){const r=le(s,t),o=ss(t),i=o.getElementsByClassName("react-flow__handle"),u=l.To.construct(o),a=Array.from(i).map(d=>{const p=l.To.center(l.To.construct(d)),m=l.q.translation(l.To.topLeft(u),p),f=d.className.match(/react-flow__handle-(\w+)/);if(f==null)throw new Error("[schematic] - cannot find handle orientation");const h=l.J.construct(f[0]);return new Mn(m,h)});return new pt(t,r,a)}}const Gc=({fromX:e,fromY:t,toX:s,toY:r,fromPosition:o,toPosition:i,fromNode:u,connectionLineStyle:a,connectionStatus:d})=>{const p=document.querySelector(".react-flow__handle-connecting"),m=p==null?void 0:p.className.match(/react-flow__handle-(\w+)/);if(m!=null){const R=l.J.outer.safeParse(m[1]);R.success&&(i=R.data)}const f=j.buildNew({sourcePos:l.q.construct(e,t),targetPos:l.q.construct(s,r),sourceOrientation:o,targetOrientation:i,sourceBox:le(j.useReactFlow(),(u==null?void 0:u.id)??""),targetBox:le(j.useReactFlow(),(u==null?void 0:u.id)??"")}),h=j.useReactFlow(),S=j.segmentsToPoints(l.q.construct(e,t),f,h.getZoom(),!1);return n.jsxRuntimeExports.jsx(j.BaseEdge,{path:_n(S),style:{...a,stroke:l.cssString(d==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},Uc=({id:e,source:t,target:s,sourcePosition:r,targetHandleId:o,targetPosition:i,style:u,segments:a=[],onSegmentsChange:d,color:p="var(--pluto-gray-l9)",selected:m=!1,...f})=>{const h=l.q.construct(f.sourceX,f.sourceY),S=x.useRef(h),R=l.q.equals(h,S.current),E=l.q.construct(f.targetX,f.targetY),w=x.useRef(E),M=l.q.equals(E,w.current),_=j.useReactFlow(),[$,P,g]=c.useCombinedStateAndRef(()=>a.length>0?a:j.buildNew({sourcePos:h,targetPos:E,sourceOrientation:r,targetOrientation:i,sourceBox:le(_,t),targetBox:le(_,s)})),v=x.useRef(i),B=x.useRef(r),L=c.useDebouncedCallback(d,100,[d]);if(!R||!M){let b=$;const O=l.q.translation(S.current,h),D=l.q.translation(E,w.current);l.q.equals(O,l.q.scale(D,-1),.001)?(S.current=h,w.current=E):(R?M||(b=j.moveTargetNode({delta:D,segments:b}),v.current!==i&&(v.current=i,b=j.buildNew({sourcePos:h,targetPos:E,sourceOrientation:r,targetOrientation:i,sourceBox:le(_,t),targetBox:le(_,s)})),j.checkIntegrity({sourcePos:h,targetPos:E,next:b,prev:$})||(b=j.buildNew({sourcePos:h,targetPos:E,sourceOrientation:r,targetOrientation:i,sourceBox:le(_,t),targetBox:le(_,s)})),w.current=E):(b=j.moveSourceNode({delta:O,segments:b}),B.current!==r&&(B.current=r,b=j.buildNew({sourcePos:h,targetPos:E,sourceOrientation:r,targetOrientation:i,sourceBox:le(_,t),targetBox:le(_,s)})),j.checkIntegrity({sourcePos:h,targetPos:E,next:b,prev:$})||(b=j.buildNew({sourcePos:h,targetPos:E,sourceOrientation:r,targetOrientation:i,sourceBox:le(_,t),targetBox:le(_,s)})),S.current=h),L(b),P(b))}const N=x.useRef(null),y=at({onStart:x.useCallback((b,O,D)=>{N.current={index:Number(D.currentTarget.id.split("-")[1]),segments:[...g.current]}},[]),onMove:x.useCallback(b=>{if(N.current==null)return;const O=j.dragSegment({segments:N.current.segments,index:N.current.index,magnitude:l.To.dim(b,l.g.swap(N.current.segments[N.current.index].direction),!0)/_.getZoom()});P(O)},[]),onEnd:x.useCallback(()=>d(g.current),[d])}),T=j.segmentsToPoints(h,$,_.getZoom(),!0);return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(j.BaseEdge,{path:_n(T),style:{...u,stroke:l.cssString(p)},...f}),m&&Wc(T).map((b,O)=>{const D=$[O].direction,Z=l.g.swap(D),I={[l.g.dimension(D)]:"18px",[l.g.dimension(Z)]:"4px"},Y={[D]:b[D]-9,[Z]:b[Z]-2};return n.jsxRuntimeExports.jsxs(x.Fragment,{children:[n.jsxRuntimeExports.jsx("rect",{className:l.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...I,...Y,rx:"2px",ry:"2px"}),n.jsxRuntimeExports.jsx("foreignObject",{x:b.x-9,y:b.y-9,width:"18px",height:"18px",children:n.jsxRuntimeExports.jsx("div",{id:`handle-${O}`,className:l.CSS(l.CSS.BE("diagram-edge-handle","dragger"),l.CSS.dir(D)),draggable:!0,onDragStart:y})})]},O)})]})},_n=e=>{let t="";const r=e.length+-1;for(let o=0;o<r;o++){const i=e[o%e.length],u=e[(o+1)%e.length],a=Math.min(6/Math.hypot(u.x-i.x,u.y-i.y),.5);o>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-a)+u.x*a},${i.y*(1-a)+u.y*a}`),o===0?t+=`M${i.x},${i.y}`:o===0&&(t+=`M${i.x*(1-a)+u.x*a},${i.y*(1-a)+u.y*a}`),o===r-1?t+=`L${u.x},${u.y}`:o<r-1&&(t+=`L${i.x*a+u.x*(1-a)},${i.y*a+u.y*(1-a)}`)}return t},Wc=e=>e.slice(1).map((t,s)=>{const r=e[s];return l.q.construct((t.x+r.x)/2,(t.y+r.y)/2)}),Xc=({initialNodes:e,initialEdges:t,allowEdit:s=!0,initialViewport:r={position:l.q.ZERO,zoom:1}})=>{const[o,i]=x.useState(s),[u,a]=x.useState(e),[d,p]=x.useState(t),[m,f]=x.useState(r),[h,S]=x.useState(!1);return{viewport:m,onViewportChange:f,edges:d,nodes:u,onNodesChange:a,onEdgesChange:p,editable:o,onEditableChange:i,fitViewOnResize:h,setFitViewOnResize:S}},Kc=e=>e.source!==e.target,Jc={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1},Qc={connectionRadius:0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnDoubleClick:!1,zoomOnPinch:!1,edgesFocusable:!1,edgesUpdatable:!1,nodesFocusable:!1,edgeUpdaterRadius:0},$n={padding:0,maxZoom:1,minZoom:.5},ea={hideAttribution:!0},Nn=x.createContext({editable:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),Ze=()=>x.useContext(Nn),Bn=x.memo(({children:e})=>{const{registerNodeRenderer:t}=Ze();return x.useEffect(()=>t(e),[t,e]),null});Bn.displayName="NodeRenderer";const ta=["Backspace","Delete"],sa=c.wrap$1(j.Diagram$1.TYPE,({aetherKey:e,children:t,onNodesChange:s,onEdgesChange:r,nodes:o,edges:i,onEditableChange:u,editable:a,viewport:d,triggers:p,onViewportChange:m,fitViewOnResize:f,setFitViewOnResize:h,...S})=>{const[{path:R},,E]=c.use$3({aetherKey:e,type:j.Diagram$1.TYPE,schema:j.diagramStateZ,initialState:{position:d.position,region:l.To.ZERO,zoom:d.zoom}}),w=c.use().colors.gray.l9.hex,M=c.useMemoCompare(()=>p??qt.zoom,c.compareModeConfigs,[p]),{fitView:_}=j.useReactFlow(),$=Dt(x.useCallback(F=>{f&&_({maxZoom:1}),E(X=>({...X,region:F}))},[E,_,f])),P=x.useRef(null),g=x.useCallback(F=>{const X=P.current;X!=null&&X.x===F.x&&X.y===F.y&&X.zoom===F.zoom||(P.current=F,E(oe=>({...oe,position:F,zoom:F.zoom})),m(j.translateViewportBackward(F)))},[E,m]);j.useOnViewportChange({onStart:g,onChange:g,onEnd:g});const[v,B]=x.useState(()=>()=>null),L=x.useCallback(F=>B(()=>F),[]),N=x.useMemo(()=>({custom:({id:F,xPos:X,yPos:oe,selected:Be})=>v({symbolKey:F,position:{x:X,y:oe},selected:Be})}),[v]),y=x.useRef(i),T=x.useMemo(()=>(y.current=i,j.translateEdgesForward(i)),[i]),b=x.useRef(o),O=x.useMemo(()=>(b.current=o,j.translateNodesForward(o)),[o]),D=x.useCallback(F=>s(j.nodeConverter(b.current,X=>j.applyNodeChanges(F,X))),[s]),Z=x.useCallback(F=>r(j.edgeConverter(y.current,X=>j.applyEdgeChanges(F,X),w)),[r,w]),I=x.useCallback((F,X)=>r(j.edgeConverter(y.current,oe=>j.updateEdge(F,X,oe),w)),[]),Y=x.useCallback(F=>{r(j.edgeConverter(y.current,X=>j.addEdge(F,X),w))},[r,w]),z=x.useCallback((F,X)=>{const oe=[...y.current],Be=oe.findIndex(Lo=>Lo.key===F);Be!==-1&&(oe[Be]={...oe[Be],segments:X},y.current=oe,r(oe))},[r]),J=a?Jc:Qc,te=x.useMemo(()=>({default:F=>n.jsxRuntimeExports.jsx(Uc,{...F,segments:F.data.segments,color:F.data.color,onSegmentsChange:x.useCallback(X=>z(F.id,X),[F.id])},F.id)}),[z]),Fe=x.useRef(null);c.use$2({triggers:M.zoomReset,callback:x.useCallback(({stage:F,cursor:X})=>{const oe=Fe.current;oe==null||F!=="start"||!l.To.contains(oe,X)||_()},[_])});const os=c.purgeMouse(M.select)[0]??null,ls=c.purgeMouse(M.pan)[0]??null,wo=c.purgeMouse(M.zoom)[0]??null,Po={selectionOnDrag:os==null,panOnDrag:ls==null,selectionKeyCode:os,panActivationKeyCode:ls,zoomActivationKeyCode:wo},ko=c.useCombinedRefs(Fe,$),To=x.useMemo(()=>({editable:a,onEditableChange:u,registerNodeRenderer:L,fitViewOnResize:f,setFitViewOnResize:h}),[a,u,L,f]);return n.jsxRuntimeExports.jsx(Nn.Provider,{value:To,children:n.jsxRuntimeExports.jsx(c.Composite,{path:R,children:n.jsxRuntimeExports.jsx(j.ReactFlow,{...Po,className:l.CSS(l.CSS.B("diagram"),l.CSS.editable(a)),nodes:O,edges:T,nodeTypes:N,edgeTypes:te,ref:ko,fitView:!0,onNodesChange:D,onEdgesChange:Z,onConnect:Y,onEdgeUpdate:I,defaultViewport:j.translateViewportForward(d),connectionLineComponent:Gc,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:Kc,connectionMode:j.ConnectionMode.Loose,snapGrid:[3,3],fitViewOptions:$n,selectionMode:j.SelectionMode.Partial,proOptions:ea,deleteKeyCode:ta,...S,style:{[l.CSS.var("diagram-zoom")]:d.zoom,...S.style},...J,children:t})})})}),na=()=>{const{editable:e}=Ze();return e?n.jsxRuntimeExports.jsx(Cl,{}):null},ra=({children:e,...t})=>n.jsxRuntimeExports.jsx(A.Pack,{direction:"y",borderShade:4,className:l.CSS.BE("diagram","controls"),...t,children:e}),oa=({onClick:e,...t})=>{const{editable:s,onEditableChange:r}=Ze();return n.jsxRuntimeExports.jsx(c.ToggleIcon,{onChange:()=>r(!s),value:s,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:l.J.RIGHT_CENTER,tooltip:s?n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Disable edit mode"}):n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Enable edit mode"}),...t,children:s?n.jsxRuntimeExports.jsx(c.St.EditOff,{}):n.jsxRuntimeExports.jsx(c.St.Edit,{})})},la=({onClick:e,...t})=>{const{fitView:s}=j.useReactFlow(),{fitViewOnResize:r,setFitViewOnResize:o}=Ze();return n.jsxRuntimeExports.jsx(c.ToggleIcon,{onClick:i=>{s($n),e==null||e(i)},value:r,onChange:i=>o(i),rightClickToggle:!0,tooltip:n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:l.J.RIGHT_CENTER,variant:"outlined",...t,children:n.jsxRuntimeExports.jsx(c.St.Expand,{})})},ia=e=>n.jsxRuntimeExports.jsx(j.ReactFlowProvider,{children:n.jsxRuntimeExports.jsx(sa,{...e})}),ca=Object.freeze(Object.defineProperty({__proto__:null,Background:na,Controls:ra,Diagram:ia,FitViewControl:la,HandleLayout:Mn,NodeLayout:pt,NodeRenderer:Bn,ToggleEditControl:oa,alignNodes:Hc,edgeConverter:j.edgeConverter,edgeZ:j.edgeZ,nodeConverter:j.nodeConverter,nodeZ:j.nodeZ,rfEdgeDataZ:j.rfEdgeDataZ,selectNode:ss,selectNodeBox:le,selectNodeLayout:Yc,translateEdgesBackward:j.translateEdgesBackward,translateEdgesForward:j.translateEdgesForward,translateNodesBackward:j.translateNodesBackward,translateNodesForward:j.translateNodesForward,translateViewportBackward:j.translateViewportBackward,translateViewportForward:j.translateViewportForward,use:Xc,useContext:Ze,viewportZ:j.viewportZ},Symbol.toStringTag,{value:"Module"})),aa=({value:e,onChange:t})=>{const{inner:s,outer:r}=e,o=i=>()=>t({...e,...i});return n.jsxRuntimeExports.jsxs(A.Space,{className:l.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[n.jsxRuntimeExports.jsx(Ee,{selected:r==="top",onClick:o({outer:"top"})}),n.jsxRuntimeExports.jsxs(A.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[n.jsxRuntimeExports.jsx(Ee,{selected:r==="left",onClick:o({outer:"left"})}),n.jsxRuntimeExports.jsxs(A.Space,{className:l.CSS.B("value"),direction:"y",align:"center",justify:"center",empty:!0,children:[n.jsxRuntimeExports.jsx(Ee,{className:l.CSS(l.CSS.dir("y")),selected:s==="top",onClick:o({inner:"top"})}),n.jsxRuntimeExports.jsxs(A.Space,{direction:"x",align:"center",justify:"center",children:[n.jsxRuntimeExports.jsx(Ee,{selected:s==="left",onClick:o({inner:"left"})}),n.jsxRuntimeExports.jsx(Ee,{selected:s==="right",onClick:o({inner:"right"})})]}),n.jsxRuntimeExports.jsx(Ee,{className:l.CSS(l.CSS.dir("y")),selected:s==="bottom",onClick:o({inner:"bottom"})})]}),n.jsxRuntimeExports.jsx(Ee,{selected:r==="right",onClick:o({outer:"right"})})]}),n.jsxRuntimeExports.jsx(Ee,{selected:r==="bottom",onClick:o({outer:"bottom"})})]})},Ee=({selected:e,className:t,...s})=>n.jsxRuntimeExports.jsx(c.Icon,{variant:"text",className:l.CSS(t,l.CSS.selected(e)),...s,children:n.jsxRuntimeExports.jsx("div",{className:"symbol"})}),ge=({className:e,direction:t,...s})=>n.jsxRuntimeExports.jsx(A.Space,{direction:t,align:"stretch",className:l.CSS(l.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...s}),jt=e=>n.jsxRuntimeExports.jsx(ne,{label:"Orientation",padHelpText:!1,...e,children:({value:t,onChange:s})=>{var r;return n.jsxRuntimeExports.jsx(aa,{value:{inner:t.orientation??"top",outer:((r=t.label)==null?void 0:r.orientation)??"top"},onChange:o=>s({...t,orientation:o.inner,label:{...t.label,orientation:o.outer}})})}}),ft=({path:e})=>n.jsxRuntimeExports.jsxs(A.Space,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(ne,{path:e+".label",label:"Label",padHelpText:!1,grow:!0,children:t=>n.jsxRuntimeExports.jsx(c.Text$1,{selectOnFocus:!0,...t})}),n.jsxRuntimeExports.jsx(ne,{path:e+".level",label:"Label Size",padHelpText:!1,children:t=>n.jsxRuntimeExports.jsx(ae.SelectLevel,{...t})})]}),lt=e=>n.jsxRuntimeExports.jsx(ne,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:s,variant:r,...o})=>n.jsxRuntimeExports.jsx(_t.Swatch,{value:t??l.ZERO.setAlpha(1).rgba255,onChange:i=>s(i.rgba255),...o,bordered:!0})}),ua=e=>n.jsxRuntimeExports.jsx(ne,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:t=>n.jsxRuntimeExports.jsx(c.Numeric,{dragScale:1,bounds:{lower:.5,upper:10},...t})}),re=()=>n.jsxRuntimeExports.jsxs(ge,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(A.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(ft,{path:"label"}),n.jsxRuntimeExports.jsxs(A.Space,{direction:"x",grow:!0,children:[n.jsxRuntimeExports.jsx(lt,{path:"color",optional:!0}),n.jsxRuntimeExports.jsx(ne,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:e=>n.jsxRuntimeExports.jsx(c.Switch$1,{...e})}),n.jsxRuntimeExports.jsx(ua,{path:"scale"})]})]}),n.jsxRuntimeExports.jsx(jt,{path:""})]}),xa=({path:e})=>{var p,m;const{value:t,onChange:s}=ve({path:e}),r=j.sourcePipelinePropsZ.parse((p=t.source)==null?void 0:p.props),o=j.sinkPipelinePropsZ.parse((m=t.sink)==null?void 0:m.props),i=j.streamChannelValuePropsZ.parse(r.segments.valueStream.props),u=j.setChannelValuePropsZ.parse(o.segments.setter.props),a=f=>{f=f??0;const h=j.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:j.streamChannelValue({channel:f}),threshold:j.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});s({...t,source:h})},d=f=>{f=f??0;const h=j.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:j.setChannelValue({channel:f}),setpoint:j.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),S=j.authoritySource({channel:f}),R=j.acquireChannelControl({channel:f,authority:255});s({...t,sink:h,control:{...t.control,showChip:!0,chip:{sink:R,source:S},showIndicator:!0,indicator:{statusSource:S}}})};return n.jsxRuntimeExports.jsxs(ge,{direction:"x",grow:!0,align:"stretch",children:[n.jsxRuntimeExports.jsx(me.Item,{label:"State Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Ce,{value:i.channel,onChange:a})}),n.jsxRuntimeExports.jsx(me.Item,{label:"Command Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Ce,{value:u.channel,onChange:d})})]})},ns=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],ue=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(xa,{path:""});default:return n.jsxRuntimeExports.jsx(re,{})}},[]),t=se.useStatic({tabs:ns,content:e});return n.jsxRuntimeExports.jsx(se.Tabs,{...t})},Oe={y:2,x:.25},ze={lower:0,upper:2e3},On=({includeBorderRadius:e=!1})=>n.jsxRuntimeExports.jsxs(ge,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(A.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(ft,{path:"label"}),n.jsxRuntimeExports.jsxs(A.Space,{direction:"x",children:[n.jsxRuntimeExports.jsx(lt,{path:"color"}),n.jsxRuntimeExports.jsx(lt,{path:"backgroundColor",label:"Background Color"}),n.jsxRuntimeExports.jsx(ne,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:({value:t,...s})=>n.jsxRuntimeExports.jsx(c.Numeric,{value:t,dragScale:Oe,bounds:ze,...s})}),n.jsxRuntimeExports.jsx(ne,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:({value:t,...s})=>n.jsxRuntimeExports.jsx(c.Numeric,{value:t,dragScale:Oe,bounds:ze,...s})}),e&&n.jsxRuntimeExports.jsx(ne,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:({value:t,...s})=>n.jsxRuntimeExports.jsx(c.Numeric,{value:t,dragScale:Oe,bounds:ze,...s})}),n.jsxRuntimeExports.jsx(ne,{path:"dimensions.width",label:"Width",grow:!0,children:({value:t,...s})=>n.jsxRuntimeExports.jsx(c.Numeric,{value:t??200,dragScale:Oe,bounds:ze,...s})}),n.jsxRuntimeExports.jsx(ne,{path:"dimensions.height",label:"Height",grow:!0,children:({value:t,...s})=>n.jsxRuntimeExports.jsx(c.Numeric,{value:t??200,dragScale:Oe,bounds:ze,...s})})]})]}),n.jsxRuntimeExports.jsx(jt,{path:""})]}),zn=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],da=({path:e})=>{var f;const{value:t,onChange:s}=ve({path:e}),r=j.sourcePipelinePropsZ.parse((f=t.telem)==null?void 0:f.props),o=j.streamChannelValuePropsZ.parse(r.segments.valueStream.props),i=j.stringifyNumberProps.parse(r.segments.stringifier.props),u=j.rollingAverageProps.parse(r.segments.rollingAverage.props),a=h=>{const S=j.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:j.streamChannelValue({channel:h??0}),stringifier:j.stringifyNumber({precision:i.precision??2}),rollingAverage:j.rollingAverage({windowSize:u.windowSize??1})},outlet:"stringifier"});s({...t,telem:S})},d=h=>{const S=j.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:j.streamChannelValue({channel:o.channel}),stringifier:j.stringifyNumber({precision:h}),rollingAverage:j.rollingAverage({windowSize:u.windowSize})},outlet:"stringifier"});s({...t,telem:S})},p=h=>{const S=j.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{stringifier:j.stringifyNumber({precision:i.precision??2}),valueStream:j.streamChannelValue({channel:o.channel}),rollingAverage:j.rollingAverage({windowSize:h})},outlet:"stringifier"});s({...t,telem:S})},m=xt(o.channel);return x.useEffect(()=>{s({...t,tooltip:[m]})},[m]),n.jsxRuntimeExports.jsxs(ge,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(me.Item,{label:"Input Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Ce,{value:o.channel,onChange:a})}),n.jsxRuntimeExports.jsx(me.Item,{label:"Precision",align:"start",children:n.jsxRuntimeExports.jsx(c.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:d})}),n.jsxRuntimeExports.jsx(me.Item,{label:"Averaging Window",align:"start",children:n.jsxRuntimeExports.jsx(c.Numeric,{value:u.windowSize??1,bounds:{lower:1,upper:100},onChange:p})})]})},ma=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"telemetry":return n.jsxRuntimeExports.jsx(da,{path:""});default:return n.jsxRuntimeExports.jsxs(ge,{direction:"x",children:[n.jsxRuntimeExports.jsxs(A.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(ft,{path:"label"}),n.jsxRuntimeExports.jsxs(A.Space,{direction:"x",children:[n.jsxRuntimeExports.jsx(lt,{path:"color"}),n.jsxRuntimeExports.jsx(ne,{path:"units",label:"Units",align:"start",padHelpText:!1,children:r=>n.jsxRuntimeExports.jsx(c.Text$1,{...r})})]})]}),n.jsxRuntimeExports.jsx(jt,{path:""})]})}},[]),t=se.useStatic({tabs:zn,content:e});return n.jsxRuntimeExports.jsx(se.Tabs,{...t})},pa=({path:e})=>{var a;const{value:t,onChange:s}=ve({path:e}),r=j.sourcePipelinePropsZ.parse((a=t.source)==null?void 0:a.props),o=j.streamChannelValuePropsZ.parse(r.segments.valueStream.props),i=d=>{d=d??0;const p=j.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:j.streamChannelValue({channel:d}),threshold:j.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});s({...t,source:p})},u=xt(o.channel);return x.useEffect(()=>s({...t}),[u]),n.jsxRuntimeExports.jsx(ge,{direction:"x",align:"stretch",children:n.jsxRuntimeExports.jsx(me.Item,{label:"Input Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Ce,{value:o.channel,onChange:i})})})},ja=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"telemetry":return n.jsxRuntimeExports.jsx(pa,{path:""});default:return n.jsxRuntimeExports.jsx(re,{})}},[]),t=se.useStatic({tabs:zn,content:e});return n.jsxRuntimeExports.jsx(se.Tabs,{...t})},fa=({path:e})=>{var u;const{value:t,onChange:s}=ve({path:e}),r=j.sinkPipelinePropsZ.parse((u=t.sink)==null?void 0:u.props),o=j.setChannelValuePropsZ.parse(r.segments.setter.props),i=a=>{a=a??0;const d=j.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:j.setChannelValue({channel:a}),setpoint:j.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),p=j.authoritySource({channel:a}),m=j.acquireChannelControl({channel:a,authority:255});s({...t,sink:d,control:{...t.control,showChip:!0,chip:{sink:m,source:p},showIndicator:!0,indicator:{statusSource:p}}})};return n.jsxRuntimeExports.jsx(ge,{direction:"y",children:n.jsxRuntimeExports.jsx(me.Item,{label:"Output Channel",children:n.jsxRuntimeExports.jsx(Ce,{value:o.channel,onChange:i})})})},Sa=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(fa,{path:""});default:return n.jsxRuntimeExports.jsx(re,{})}},[]),t=se.useStatic({tabs:ns,content:e});return n.jsxRuntimeExports.jsx(se.Tabs,{...t})},ha=({path:e})=>{var p,m;const{value:t,onChange:s}=ve({path:e}),r=j.sourcePipelinePropsZ.parse((p=t.source)==null?void 0:p.props),o=j.sinkPipelinePropsZ.parse((m=t.sink)==null?void 0:m.props),i=j.streamChannelValuePropsZ.parse(r.segments.valueStream.props),u=j.setChannelValuePropsZ.parse(o.segments.setter.props),a=f=>{f=f??0;const h=j.sourcePipeline("number",{connections:[],segments:{valueStream:j.streamChannelValue({channel:f})},outlet:"valueStream"});s({...t,source:h})},d=f=>{f=f??0;const h=j.sinkPipeline("number",{connections:[],segments:{setter:j.setChannelValue({channel:f})},inlet:"setter"}),S=j.authoritySource({channel:f}),R=j.acquireChannelControl({channel:f,authority:255});s({...t,sink:h,control:{...t.control,showChip:!0,chip:{sink:R,source:S},showIndicator:!0,indicator:{statusSource:S}}})};return n.jsxRuntimeExports.jsxs(ge,{direction:"x",grow:!0,align:"stretch",children:[n.jsxRuntimeExports.jsx(me.Item,{label:"State Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Ce,{value:i.channel,onChange:a})}),n.jsxRuntimeExports.jsx(me.Item,{label:"Command Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Ce,{value:u.channel,onChange:d})})]})},ga=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(ha,{path:""});default:return n.jsxRuntimeExports.jsxs(ge,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(A.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(ft,{path:"label"}),n.jsxRuntimeExports.jsx(ne,{path:"units",label:"Units",align:"start",padHelpText:!1,children:r=>n.jsxRuntimeExports.jsx(c.Text$1,{...r})})]}),n.jsxRuntimeExports.jsx(jt,{path:""})]})}},[]),t=se.useStatic({tabs:ns,content:e});return n.jsxRuntimeExports.jsx(se.Tabs,{...t})},V=e=>n.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),rs=e=>n.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Ne=e=>n.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),Q=e=>n.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),Ea={left:{left:j.Position.Left,right:j.Position.Right,top:j.Position.Top,bottom:j.Position.Bottom},right:{left:j.Position.Right,right:j.Position.Left,top:j.Position.Bottom,bottom:j.Position.Top},top:{left:j.Position.Bottom,right:j.Position.Top,top:j.Position.Left,bottom:j.Position.Right},bottom:{left:j.Position.Top,right:j.Position.Bottom,top:j.Position.Right,bottom:j.Position.Left}},Ra=(e,t)=>Ea[t][e],Ca=(e,t,s)=>s==="left"?{top:e,left:t}:s==="right"?{top:100-e,left:100-t}:s==="top"?{top:100-t,left:e}:{top:t,left:100-e},G=({children:e,orientation:t})=>{let s;try{s=j.useUpdateNodeInternals()}catch{return n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{})}const r=x.useRef(null),o=x.useRef(!0);return x.useEffect(()=>{if(r.current==null)return;if(o.current){o.current=!1;return}const i=r.current.closest(".react-flow__node"),u=i==null?void 0:i.getAttribute("data-id");u!=null&&(s==null||s(u))},[t]),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("span",{ref:r}),e]})},k=({location:e,orientation:t,left:s,top:r,...o})=>{const i=Ca(r,s,t);return n.jsxRuntimeExports.jsx(j.Handle$1,{position:Ra(e,t),...o,type:"source",onClick:u=>u.stopPropagation(),className:(l.CSS.B("handle"),l.CSS.BE("handle",o.id)),style:{left:`${i.left}%`,top:`${i.top}%`}})},fe=({className:e,enabled:t=!1,triggered:s=!1,orientation:r="left",color:o,...i})=>n.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("symbol-primitive"),l.CSS.B("symbol-primitive-toggle"),r!=null&&l.CSS.loc(r),t&&l.CSS.M("enabled"),s&&l.CSS.M("triggered"),e),color:l.cssString(o),...i}),ee=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:l.CSS(l.CSS.B("symbol-primitive"),e),...t}),ya=.8,W=({dimensions:e,orientation:t="left",children:s,className:r,color:o,style:i={},scale:u=1,...a})=>{e=l.g.construct(t)==="y"?l._$1.swap(e):e;const p=l.cssString(o),m=c.use();return o!=null&&(i[l.CSS.var("symbol-color")]=new l.Color(o).rgbString,i[l.CSS.var("symbol-color-contrast")]=new l.Color(o).pickByContrast(m.colors.gray.l0,m.colors.gray.l10).rgbString),n.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:l._$1.svgViewBox(e),className:l.CSS(l.CSS.loc(t),r),fill:p,stroke:p,...a,style:{aspectRatio:`${e.width} / ${e.height}`,width:l._$1.scale(e,u*ya).width,...i},children:n.jsxRuntimeExports.jsx("g",{children:s})})},Dn=({className:e,orientation:t,scale:s,color:r,...o})=>n.jsxRuntimeExports.jsxs(fe,{...o,orientation:t,className:l.CSS(l.CSS.B("four-way-valve"),e),children:[n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:"left",left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:"left",left:100,top:50,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:"left",left:50,top:0,id:"3"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:"left",left:50,top:100,id:"4"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:87,height:87},color:r,scale:s,children:[n.jsxRuntimeExports.jsx(V,{d:"M43.5 43.5L6.35453 24.7035C4.35901 23.6937 2 25.1438 2 27.3803V59.6197C2 61.8562 4.35901 63.3063 6.35453 62.2965L43.5 43.5ZM43.5 43.5L80.6455 24.7035C82.641 23.6937 85 25.1438 85 27.3803V59.6197C85 61.8562 82.641 63.3063 80.6455 62.2965L43.5 43.5Z"}),n.jsxRuntimeExports.jsx(V,{d:"M43.5 43.5L24.7035 80.6455C23.6937 82.641 25.1438 85 27.3803 85H59.6197C61.8562 85 63.3063 82.641 62.2965 80.6455L43.5 43.5ZM43.5 43.5L24.7035 6.35453C23.6937 4.35901 25.1438 2 27.3803 2H59.6197C61.8562 2 63.3063 4.35901 62.2965 6.35453L43.5 43.5Z"})]})]}),An=({color:e,orientation:t="left",scale:s,...r})=>n.jsxRuntimeExports.jsxs(fe,{...r,className:l.CSS(l.CSS.B("three-way-valve")),orientation:t,children:[n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:t,left:50,top:100,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:0,top:33,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:100,top:33,id:"3"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:87,height:64},color:e,orientation:t,scale:s,children:[n.jsxRuntimeExports.jsx(V,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),n.jsxRuntimeExports.jsx(V,{d:"M44.3923 22.3611C44.0222 21.6298 42.9778 21.6298 42.6077 22.3611L24.7035 57.7433C23.6937 59.7388 25.1438 62.0978 27.3803 62.0978L59.6197 62.0978C61.8562 62.0978 63.3063 59.7388 62.2965 57.7433L44.3923 22.3611Z"})]})]}),Vn=({orientation:e="left",color:t,scale:s,...r})=>n.jsxRuntimeExports.jsxs(fe,{...r,children:[n.jsxRuntimeExports.jsxs(G,{orientation:e,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:e,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:e,left:100,top:50,id:"2"})]}),n.jsxRuntimeExports.jsx(W,{dimensions:{width:87,height:42},color:t,orientation:e,scale:s,children:n.jsxRuntimeExports.jsx(V,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"})})]}),In=({className:e,color:t,orientation:s="left",normallyOpen:r=!1,scale:o,...i})=>n.jsxRuntimeExports.jsxs(fe,{className:l.CSS(l.CSS.B("solenoid-valve"),r&&l.CSS.M("normally-open"),e),...i,children:[n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:1,top:69,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:99,top:69,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:87,height:69},color:t,orientation:s,scale:o,children:[n.jsxRuntimeExports.jsx(V,{className:l.CSS.B("body"),d:"M43.5 48L6.35453 29.2035C4.35901 28.1937 2 29.6438 2 31.8803V64.1197C2 66.3562 4.35901 67.8063 6.35453 66.7965L43.5 48ZM43.5 48L80.6455 29.2035C82.641 28.1937 85 29.6438 85 31.8803V64.1197C85 66.3562 82.641 67.8063 80.6455 66.7965L43.5 48Z"}),n.jsxRuntimeExports.jsx(V,{d:"M43.5 47L43.5 24.6177"}),n.jsxRuntimeExports.jsx(rs,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),Zn=({className:e,orientation:t="left",color:s,scale:r,...o})=>n.jsxRuntimeExports.jsxs(ee,{orientation:t,className:l.CSS(l.CSS.B("relief-valve"),e),...o,children:[n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:1,top:66,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:99,top:66,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:87,height:58},color:s,orientation:t,scale:r,children:[n.jsxRuntimeExports.jsx(V,{d:"M43.5 37L6.35453 18.2035C4.35901 17.1937 2 18.6438 2 20.8803V53.1197C2 55.3562 4.35901 56.8063 6.35453 55.7965L43.5 37ZM43.5 37L80.6455 18.2035C82.641 17.1937 85 18.6438 85 20.8803V53.1197C85 55.3562 82.641 56.8063 80.6455 55.7965L43.5 37Z"}),n.jsxRuntimeExports.jsx(V,{d:"M43.5 2 L43.5 37",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),Fn=({className:e,orientation:t="left",color:s,scale:r,...o})=>n.jsxRuntimeExports.jsxs(ee,{orientation:t,className:l.CSS(l.CSS.B("check-valve"),e),...o,children:[n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:99,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:45,height:43},color:s,orientation:t,scale:r,children:[n.jsxRuntimeExports.jsx(Q,{x1:"42.3917",y1:"2",x2:"42.3917",y2:"40",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M41.6607 21.8946C42.3917 21.5238 42.3906 20.4794 41.6589 20.1101L6.25889 2.2412C4.26237 1.23341 1.90481 2.68589 1.90704 4.92235L1.93925 37.1617C1.94148 39.3982 4.30194 40.846 6.29644 39.8342L41.6607 21.8946Z"})]})]}),qn=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(fe,{...o,orientation:s,className:l.CSS(l.CSS.B("angled-valve"),t),children:[n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:s,left:33,top:100,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:100,top:35,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:64,height:64},color:e,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(V,{d:"M22.3611 20.1077C21.6298 20.4778 21.6298 21.5222 22.3611 21.8923L57.7433 39.7965C59.7388 40.8063 62.0978 39.3562 62.0978 37.1197L62.0978 4.88029C62.0978 2.64384 59.7388 1.19372 57.7433 2.2035L22.3611 20.1077Z"}),n.jsxRuntimeExports.jsx(V,{d:"M21.8923 22.3611C21.5222 21.6298 20.4778 21.6298 20.1077 22.3611L2.20349 57.7433C1.19372 59.7388 2.64384 62.0978 4.8803 62.0978L37.1197 62.0978C39.3562 62.0978 40.8063 59.7388 39.7965 57.7433L21.8923 22.3611Z"})]})]}),Hn=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(fe,{...o,className:l.CSS(l.CSS.B("pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:2,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:64,height:64},color:e,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(Ne,{cx:"32",cy:"32",r:"30"}),n.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)})]})]}),Yn=({className:e,color:t,orientation:s="left",scale:r,...o})=>{const i=l.cssString(t);return n.jsxRuntimeExports.jsxs(ee,{...o,className:l.CSS(l.CSS.B("symbol"),e),children:[n.jsxRuntimeExports.jsx(G,{orientation:s,children:n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:2,top:50,id:"1"})}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:40,height:48},color:t,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(V,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"}),n.jsxRuntimeExports.jsx(V,{d:"M37.9706 23.2076C38.4906 23.6079 38.4906 24.3921 37.9706 24.7924L33.86 27.9568C33.2024 28.463 32.25 27.9942 32.25 27.1644V20.8356C32.25 20.0058 33.2024 19.537 33.86 20.0432L37.9706 23.2076Z",fill:i}),n.jsxRuntimeExports.jsx(V,{d:"M33 24H3",strokeLinecap:"round"})]})]})},Gn=({className:e,orientation:t="left",color:s,scale:r,...o})=>n.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("cap"),e),...o,children:[n.jsxRuntimeExports.jsx(G,{orientation:t,children:n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:0,top:50,id:"1"})}),n.jsxRuntimeExports.jsx(W,{color:s,dimensions:{width:26,height:48},orientation:t,scale:r,children:n.jsxRuntimeExports.jsx(V,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"})})]}),Un=({className:e,orientation:t="left",color:s,scale:r,...o})=>n.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("manual-valve"),e),...o,children:[n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:1,top:58,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:99,top:58,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:87,height:48},color:s,orientation:t,scale:r,children:[n.jsxRuntimeExports.jsx(Q,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),n.jsxRuntimeExports.jsx(V,{d:"M19.64 1 L66.68 1",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M43.5 27L6.35453 8.20349C4.35901 7.19372 2 8.64384 2 10.8803V43.1197C2 45.3562 4.35901 46.8063 6.35453 45.7965L43.5 27ZM43.5 27L80.6455 8.20349C82.641 7.19372 85 8.64384 85 10.8803V43.1197C85 45.3562 82.641 46.8063 80.6455 45.7965L43.5 27Z"})]})]}),Wn=({className:e,orientation:t="left",color:s,scale:r,...o})=>n.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("filter"),e),...o,children:[n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:2,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsx(W,{dimensions:{width:52,height:34},orientation:t,color:s,scale:r,children:n.jsxRuntimeExports.jsx(V,{d:"M6 17L24.8 2.9C25.5111 2.36667 26.4889 2.36667 27.2 2.9L46 17M6 17L24.8 31.1C25.5111 31.6333 26.4889 31.6333 27.2 31.1L46 17M6 17H1M46 17H51"})})]}),ba=e=>typeof e=="number"?{topLeft:l.q.construct(e),topRight:l.q.construct(e),bottomLeft:l.q.construct(e),bottomRight:l.q.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:l.q.construct(e.topLeft),topRight:l.q.construct(e.topRight),bottomLeft:l.q.construct(e.bottomLeft),bottomRight:l.q.construct(e.bottomRight)}:e,va=e=>{const{topLeft:t,topRight:s,bottomLeft:r,bottomRight:o}=e;return`${t.x}% ${s.x}% ${o.x}% ${r.x}% / ${t.y}% ${s.y}% ${o.y}% ${r.y}%`},wa={width:40,height:80},Xn={x:50,y:10},St=({className:e,dimensions:t=wa,borderRadius:s=Xn,boxBorderRadius:r,color:o,backgroundColor:i,...u})=>{const a=ba(s),d=r==null,p=c.use();return n.jsxRuntimeExports.jsx(ee,{className:l.CSS(e,l.CSS.B("tank")),style:{...t,borderRadius:r??va(a),borderColor:l.cssString(o??p.colors.gray.l9),backgroundColor:i==null?i:l.cssString(i)},...u,children:n.jsxRuntimeExports.jsxs(G,{children:[n.jsxRuntimeExports.jsx(k,{location:"top",orientation:"left",left:50,top:0,id:"1"}),d&&n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(k,{location:"top",orientation:"left",left:-.5,top:a.topLeft.y-1,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:"left",left:101,top:a.topRight.y-1,id:"3"})]}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:"left",left:50,top:100,id:"4"}),d&&n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:"left",left:-.5,top:100-a.bottomLeft.y+1,id:"5"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:"left",left:101,top:100-a.bottomRight.y+1,id:"6"})]}),n.jsxRuntimeExports.jsx(k,{location:"left",orientation:"left",left:-.5,top:50,id:"7"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:"left",left:101,top:50,id:"8"})]})})},Kn=({className:e,orientation:t="left",color:s,scale:r,...o})=>n.jsxRuntimeExports.jsxs(ee,{className:l.CSS(e,l.CSS.B("regulator")),...o,children:[n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:0,top:66,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:100,top:66,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:88,height:80},orientation:t,color:s,scale:r,children:[n.jsxRuntimeExports.jsx(V,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),n.jsxRuntimeExports.jsx(V,{d:"M61 30C62.6569 30 64.0231 28.6494 63.7755 27.0111C63.141 22.8129 61.181 18.8968 58.1421 15.8579C54.3914 12.1071 49.3043 10 44 10C38.6957 10 33.6086 12.1071 29.8579 15.8579C26.819 18.8968 24.859 22.8129 24.2245 27.0111C23.9769 28.6494 25.3431 30 27 30L44 30H61Z"}),n.jsxRuntimeExports.jsx(Q,{x1:"44",y1:"53",x2:"44",y2:"30",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M44 10.5V8C44 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44 53"})]})]}),Jn=({className:e,orientation:t="left",scale:s,color:r,...o})=>n.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("orifice"),e),...o,children:[n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:100,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:70,height:34},orientation:t,color:r,scale:s,children:[n.jsxRuntimeExports.jsx(V,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),Qn=({className:e,orientation:t="left",color:s,scale:r,...o})=>n.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("needle-valve"),e),...o,children:[n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:99,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:87,height:42},orientation:t,color:s,scale:r,children:[n.jsxRuntimeExports.jsx(V,{d:"M43.0152 21.5391L38.237 2.62245C38.1573 2.30658 38.396 2 38.7218 2L48.2782 2C48.604 2 48.8427 2.30658 48.763 2.62245L43.9848 21.5391C43.8576 22.0425 43.1424 22.0425 43.0152 21.5391Z",fill:l.cssString(s)}),n.jsxRuntimeExports.jsx(V,{d:"M43.5 21.5L6.35453 2.70349C4.35901 1.69372 2 3.14384 2 5.38029V37.6197C2 39.8562 4.35901 41.3063 6.35453 40.2965L43.5 21.5ZM43.5 21.5L80.6455 2.70349C82.641 1.69372 85 3.14384 85 5.3803V37.6197C85 39.8562 82.641 41.3063 80.6455 40.2965L43.5 21.5Z"})]})]}),er=({className:e,orientation:t="left",color:s,scale:r,...o})=>n.jsxRuntimeExports.jsxs(ee,{orientation:t,className:l.CSS(l.CSS.B("angled-relief-valve"),e),...o,children:[n.jsxRuntimeExports.jsxs(G,{children:[n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:t,left:33,top:100,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:100,top:45,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:64,height:79},orientation:t,color:s,scale:r,children:[n.jsxRuntimeExports.jsx(Q,{x1:21,y1:2,x2:21,y2:36.7,strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M22.3611 35.1077C21.6298 35.4778 21.6298 36.5222 22.3611 36.8923L57.7433 54.7965C59.7388 55.8063 62.0978 54.3562 62.0978 52.1197L62.0978 19.8803C62.0978 17.6438 59.7388 16.1937 57.7433 17.2035L22.3611 35.1077Z"}),n.jsxRuntimeExports.jsx(V,{d:"M21.8923 37.3611C21.5222 36.6298 20.4778 36.6298 20.1077 37.3611L2.20349 72.7433C1.19372 74.7388 2.64384 77.0978 4.8803 77.0978H37.1197C39.3562 77.0978 40.8063 74.7388 39.7965 72.7433L21.8923 37.3611Z"})]})]}),tr=({className:e,color:t,dimensions:s,orientation:r,units:o="psi",children:i,...u})=>{const a=l.cssString(t),d=c.use(),p=t==null?"var(--pluto-gray-l0)":l.cssString(new l.Color(t).pickByContrast(d.colors.gray.l0,d.colors.gray.l9));return n.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("value"),e),...u,style:{borderColor:a,height:s==null?void 0:s.height,width:"100%"},children:[n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("value","content"),style:{flexGrow:1,minWidth:s==null?void 0:s.width,inlineSize:80},children:i}),n.jsxRuntimeExports.jsxs(G,{orientation:r,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:"left",left:-2,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:"left",left:102,top:50,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("value","units"),style:{background:a},children:n.jsxRuntimeExports.jsx(c.Text,{level:"small",color:p,children:o})})]})},sr=({enabled:e=!1,onClick:t,orientation:s="left"})=>n.jsxRuntimeExports.jsxs(ee,{orientation:s,children:[n.jsxRuntimeExports.jsx(c.Switch$1,{value:e,onClick:t,onChange:()=>{}}),n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:100,top:50,id:"2"})]})]}),nr=({onClick:e,orientation:t="left",label:s="",color:r,size:o,level:i})=>n.jsxRuntimeExports.jsxs(ee,{orientation:t,children:[n.jsxRuntimeExports.jsx(c.Button,{onClick:e,color:r,size:o,level:i,children:s}),n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:100,top:50,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:t,left:50,top:0,id:"3"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),rr=({orientation:e="left",className:t,onClick:s,children:r,value:o,units:i,onChange:u,...a})=>{const[d,p]=x.useState(o);return n.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("setpoint"),t),orientation:e,...a,children:[n.jsxRuntimeExports.jsxs(G,{orientation:e,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:e,left:-2,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:e,left:102,top:50,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:e,left:50,top:-2,id:"3"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),n.jsxRuntimeExports.jsxs(c.Numeric,{size:"small",value:d,onChange:p,showDragHandle:!1,selectOnFocus:!0,children:[i!=""&&n.jsxRuntimeExports.jsx(c.Text,{className:l.CSS.B("units"),noWrap:!0,level:"small",children:i}),n.jsxRuntimeExports.jsx(c.Button,{variant:"outlined",size:"small",onClick:()=>u(d),children:"Set"})]})]})},or=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(fe,{...o,className:l.CSS(l.CSS.B("screw-pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:2,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:64,height:64},color:e,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(Ne,{cx:"32",cy:"32",r:"30"}),n.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(V,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(32, 32)",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(V,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(42, 32)",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)})]})]}),lr=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(fe,{...o,className:l.CSS(l.CSS.B("vacuum-pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:64,height:64},color:e,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(Ne,{cx:"32",cy:"32",r:"30"}),n.jsxRuntimeExports.jsx(Q,{x1:"17",y1:"6.0192",x2:"57.9808",y2:"17",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(Q,{x1:"17",y1:"57.9808",x2:"57.9808",y2:"47",className:l.CSS(l.CSS.M("detail"),t)})]})]}),ir=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(fe,{...o,className:l.CSS(l.CSS.B("cavity-pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:64,height:64},color:e,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(Ne,{cx:"32",cy:"32",r:"30"}),n.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(V,{d:"M 17 26 C 17 20.6667 23 20.6667 23 26 C 23 31.3333 29 31.3333 29 26 C 29 20.6667 35 20.6667 35 26",strokeLinecap:"round",transform:"translate(6, 6)",className:l.CSS(l.CSS.M("detail"),t)})]})]}),cr=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(fe,{...o,className:l.CSS(l.CSS.B("piston-pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:64,height:64},color:e,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(Ne,{cx:"32",cy:"32",r:"30"}),n.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(V,{d:"M 23 32, h 16, m 0 -8, v 16",className:l.CSS(l.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),ar=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(ee,{...o,className:l.CSS(l.CSS.B("static-mixer"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:99,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:66,height:31},color:e,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(rs,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),n.jsxRuntimeExports.jsx(V,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),ur=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(fe,{...o,className:l.CSS(l.CSS.B("rotary-mixer"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:99,top:48,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:50,height:33},color:e,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(V,{d:"M1 30V2C1 1.44772 1.44772 1 2 1H35.4545C35.7434 1 36.0181 1.12487 36.208 1.34247L48.4262 15.3425C48.7549 15.7192 48.7549 16.2808 48.4262 16.6575L36.208 30.6575C36.0181 30.8751 35.7434 31 35.4545 31H2C1.44772 31 1 30.5523 1 30Z"}),n.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)})]})]}),xr=({className:e,color:t,orientation:s="left",enabled:r,scale:o,...i})=>n.jsxRuntimeExports.jsxs(ee,{...i,orientation:s,className:l.CSS(l.CSS.B("light"),r&&l.CSS.M("enabled"),e),children:[n.jsxRuntimeExports.jsxs(G,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:3.125,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:96.875,top:50,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:s,left:50,top:3.125,id:"3"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:s,left:50,top:96.75,id:"4"})]}),n.jsxRuntimeExports.jsx(W,{dimensions:{width:64,height:64},color:t,orientation:s,scale:o,children:n.jsxRuntimeExports.jsx(Ne,{cx:"32",cy:"32",r:"30"})})]}),dr=({className:e,orientation:t="left",color:s,scale:r,...o})=>n.jsxRuntimeExports.jsxs(ee,{className:l.CSS(e,l.CSS.B("regulator")),...o,children:[n.jsxRuntimeExports.jsxs(G,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:5,top:66,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:99,top:66,id:"2"})]}),n.jsxRuntimeExports.jsxs(W,{dimensions:{width:88,height:80},orientation:t,color:s,scale:r,children:[n.jsxRuntimeExports.jsx(V,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),n.jsxRuntimeExports.jsx(rs,{x:"19",y:"10",width:"50",height:"20",rx:"3",ry:"3"}),n.jsxRuntimeExports.jsx(Q,{x1:"44",y1:"53",x2:"44",y2:"30",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(V,{d:"M44 10.5V8C44 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44 53"})]})]}),Pa=({aetherKey:e,sink:t})=>{const s=c.useMemoDeepEqualProps({sink:t}),[,,r]=c.use$3({aetherKey:e,type:j.Button.TYPE,schema:j.buttonStateZ,initialState:{trigger:0,sink:t}});return x.useEffect(()=>{r(i=>({...i,...s}))},[s]),{click:x.useCallback(()=>{r(i=>({...i,trigger:i.trigger+1}))},[r])}},ka=({aetherKey:e,source:t})=>{const s=c.useMemoDeepEqualProps({source:t}),[,{enabled:r},o]=c.use$3({aetherKey:e,type:j.Light.TYPE,schema:j.lightStateZ,initialState:{enabled:!1,...s}});return console.log("use.ts: enabled",r),x.useEffect(()=>o(i=>({...i,...s})),[s,o]),{enabled:r}},q=x.forwardRef(({label:e="",onChange:t,level:s="p",children:r,orientation:o="top",style:i,className:u,...a},d)=>n.jsxRuntimeExports.jsxs(A.Space,{style:{marginRight:o==="right"?1:0,marginTop:o==="top"?1:0,...i},size:2/3,direction:o,ref:d,className:l.CSS(l.CSS.B("symbol"),u),align:"center",justify:"center",...a,children:[e.length>0&&n.jsxRuntimeExports.jsx(c.Editable,{className:l.CSS.BE("symbol","label"),value:e,onChange:x.useCallback(p=>t({label:{label:p,level:s,orientation:o}}),[t,s]),level:s}),r]}));q.displayName="Labeled";const Ta=({aetherKey:e,source:t,sink:s})=>{const r=c.useMemoDeepEqualProps({source:t,sink:s}),[,{value:o},i]=c.use$3({aetherKey:e,type:j.Setpoint.TYPE,schema:j.setpointStateZ,initialState:{trigger:0,value:0,...r}});return x.useEffect(()=>{i(a=>({...a,...r}))},[r,i]),{set:x.useCallback(a=>i(d=>({...d,trigger:d.trigger+1,command:a})),[i]),value:o}},xe=({aetherKey:e,source:t,sink:s})=>{const r=c.useMemoDeepEqualProps({source:t,sink:s}),[,{triggered:o,enabled:i},u]=c.use$3({aetherKey:e,type:j.Toggle.TYPE,schema:j.toggleStateZ,initialState:{triggered:!1,enabled:!1,...r}});return x.useEffect(()=>{u(d=>({...d,...r}))},[r,u]),{toggle:x.useCallback(()=>u(d=>({...d,triggered:!d.triggered})),[u]),triggered:o,enabled:i}},La=j.Value.z.omit({font:!0}).partial({color:!0}).extend({level:C.levelZ.optional()}),mr=({aetherKey:e,box:t,telem:s,color:r,precision:o,minWidth:i,level:u="small"})=>{const a=c.useMemoDeepEqualProps({box:t,telem:s,color:r,precision:o,level:u,minWidth:i}),[,d,p]=c.use$3({aetherKey:e,type:j.Value.TYPE,schema:j.Value.z,initialState:a});return x.useLayoutEffect(()=>p(m=>({...m,...a})),[a]),{width:d.width??d.minWidth}},Ma=Object.freeze(Object.defineProperty({__proto__:null,corePropsZ:La,use:mr},Symbol.toStringTag,{value:"Module"})),pr=e=>l.g.construct(e)==="x"?l.J.swap(e):e,_a=e=>l.g.construct(e)==="y"?l.J.swap(e):e,ie=({showChip:e=!0,showIndicator:t=!0,indicator:s,orientation:r="left",chip:o,children:i,...u})=>n.jsxRuntimeExports.jsxs(A.Space,{direction:l.J.rotate90(r),align:"center",justify:"center",empty:!0,...u,children:[n.jsxRuntimeExports.jsxs(A.Space,{direction:l.g.construct(r),align:"center",className:l.CSS(l.CSS.B("control-state")),size:"small",children:[e&&n.jsxRuntimeExports.jsx(bn,{size:"small",...o}),t&&n.jsxRuntimeExports.jsx(Pn,{...s})]}),i]}),jr=c.wrap$1("ThreeWayValve",({aetherKey:e,label:t,onChange:s,control:r,source:o,sink:i,orientation:u="left",...a})=>{const{enabled:d,triggered:p,toggle:m}=xe({aetherKey:e,source:o,sink:i});return n.jsxRuntimeExports.jsx(q,{...t,onChange:s,children:n.jsxRuntimeExports.jsx(ie,{...r,orientation:pr(u),children:n.jsxRuntimeExports.jsx(An,{enabled:d,triggered:p,onClick:m,orientation:u,...a})})})}),fr=e=>n.jsxRuntimeExports.jsx(An,{...e}),Sr=c.wrap$1("Valve",({control:e,aetherKey:t,label:s,onChange:r,source:o,sink:i,orientation:u,...a})=>{const{enabled:d,triggered:p,toggle:m}=xe({aetherKey:t,source:o,sink:i});return n.jsxRuntimeExports.jsx(q,{...s,onChange:r,children:n.jsxRuntimeExports.jsx(ie,{...e,orientation:u,children:n.jsxRuntimeExports.jsx(Vn,{enabled:d,triggered:p,onClick:m,orientation:u,...a})})})}),hr=e=>n.jsxRuntimeExports.jsx(Vn,{...e}),gr=c.wrap$1("SolenoidValve",({aetherKey:e,label:t,onChange:s,orientation:r="left",normallyOpen:o,source:i,sink:u,control:a,...d})=>{const{enabled:p,triggered:m,toggle:f}=xe({aetherKey:e,source:i,sink:u});return n.jsxRuntimeExports.jsx(q,{...t,onChange:s,children:n.jsxRuntimeExports.jsx(ie,{...a,orientation:_a(r),children:n.jsxRuntimeExports.jsx(In,{enabled:p,triggered:m,onClick:f,orientation:r,normallyOpen:o,...d})})})}),Er=e=>n.jsxRuntimeExports.jsx(In,{...e}),Rr=c.wrap$1("FourWayValve",({aetherKey:e,control:t,label:s,onChange:r,orientation:o,source:i,sink:u,...a})=>{const{enabled:d,triggered:p,toggle:m}=xe({aetherKey:e,source:i,sink:u});return n.jsxRuntimeExports.jsx(q,{...s,onChange:r,children:n.jsxRuntimeExports.jsx(ie,{...t,orientation:o,children:n.jsxRuntimeExports.jsx(Dn,{enabled:d,triggered:p,onClick:m,orientation:o,...a})})})}),Cr=e=>n.jsxRuntimeExports.jsx(Dn,{...e}),yr=c.wrap$1("AngleValve",({aetherKey:e,label:t,control:s,onChange:r,orientation:o="left",source:i,sink:u,...a})=>{const{enabled:d,triggered:p,toggle:m}=xe({aetherKey:e,source:i,sink:u});return n.jsxRuntimeExports.jsx(q,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ie,{...s,orientation:pr(o),children:n.jsxRuntimeExports.jsx(qn,{enabled:d,triggered:p,onClick:m,orientation:o,...a})})})}),br=e=>n.jsxRuntimeExports.jsx(qn,{...e}),vr=c.wrap$1("Pump",({aetherKey:e,label:t,control:s,onChange:r,orientation:o,source:i,sink:u,...a})=>{const{enabled:d,triggered:p,toggle:m}=xe({aetherKey:e,source:i,sink:u});return n.jsxRuntimeExports.jsx(q,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ie,{...s,orientation:o,children:n.jsxRuntimeExports.jsx(Hn,{enabled:d,triggered:p,onClick:m,orientation:o,...a})})})}),wr=e=>n.jsxRuntimeExports.jsx(Hn,{...e}),Pr=c.wrap$1("Tank",({backgroundColor:e,label:t,onChange:s,orientation:r,color:o,dimensions:i,borderRadius:u})=>n.jsxRuntimeExports.jsx(q,{...t,onChange:s,children:n.jsxRuntimeExports.jsx(St,{onResize:a=>s({dimensions:a}),orientation:r,color:o,dimensions:i,borderRadius:u,backgroundColor:e})})),kr=e=>n.jsxRuntimeExports.jsx(St,{...e,dimensions:{width:25,height:50}}),Tr=c.wrap$1("Box",({backgroundColor:e,borderRadius:t,label:s,onChange:r,orientation:o,color:i,dimensions:u})=>n.jsxRuntimeExports.jsx(q,{...s,onChange:r,children:n.jsxRuntimeExports.jsx(St,{onResize:a=>r({dimensions:a}),orientation:o,color:i,dimensions:u,boxBorderRadius:t,backgroundColor:e})})),Lr=e=>n.jsxRuntimeExports.jsx(St,{...e,dimensions:{width:25,height:50},borderRadius:0}),Mr=({label:e,onChange:t,...s})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Zn,{...s})}),_r=e=>n.jsxRuntimeExports.jsx(Zn,{...e}),$r=({label:e,onChange:t,...s})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Kn,{...s})}),Nr=e=>n.jsxRuntimeExports.jsx(Kn,{...e}),Br=({label:e,onChange:t,...s})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(dr,{...s})}),Or=e=>n.jsxRuntimeExports.jsx(dr,{...e}),zr=({label:e,onChange:t,...s})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Yn,{...s})}),Dr=e=>n.jsxRuntimeExports.jsx(Yn,{...e}),Ar=({label:e,onChange:t,...s})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Gn,{...s})}),Vr=e=>n.jsxRuntimeExports.jsx(Gn,{...e}),Ir=({label:e,onChange:t,...s})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Un,{...s})}),Zr=e=>n.jsxRuntimeExports.jsx(Un,{...e}),Fr=c.wrap$1("Setpoint",({label:e,aetherKey:t,orientation:s,control:r,units:o,source:i,sink:u,onChange:a})=>{const{value:d,set:p}=Ta({aetherKey:t,source:i,sink:u});return n.jsxRuntimeExports.jsx(q,{...e,onChange:a,children:n.jsxRuntimeExports.jsx(ie,{...r,className:l.CSS.B("symbol"),orientation:s,children:n.jsxRuntimeExports.jsx(rr,{value:d,onChange:p,units:o,orientation:s})})})}),qr=e=>n.jsxRuntimeExports.jsx(rr,{value:12,onChange:()=>{},units:"mV",...e,children:n.jsxRuntimeExports.jsx(c.Text,{level:"p",children:"10.0"})}),Hr=({label:e,onChange:t,...s})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Wn,{...s})}),Yr=e=>n.jsxRuntimeExports.jsx(Wn,{...e}),Gr=({label:e,onChange:t,...s})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Qn,{...s})}),Ur=e=>n.jsxRuntimeExports.jsx(Qn,{...e}),Wr=({label:e,onChange:t,...s})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Fn,{...s})}),Xr=e=>n.jsxRuntimeExports.jsx(Fn,{...e}),Kr=({label:e,onChange:t,...s})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Jn,{...s})}),Jr=e=>n.jsxRuntimeExports.jsx(Jn,{...e}),Qr=({label:e,onChange:t,...s})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(er,{...s})}),eo=e=>n.jsxRuntimeExports.jsx(er,{...e}),to=c.wrap$1("Value",({aetherKey:e,label:t,level:s="p",position:r,className:o,textColor:i,color:u,telem:a,units:d,onChange:p,tooltip:m})=>{const f=c.useTypography(s),[h,S]=x.useState({outerBox:l.To.ZERO,labelBox:l.To.ZERO}),R=(f.lineHeight+.5)*f.baseSize+2,E=c.useResize(x.useCallback($=>{const P=document.querySelector(`.react-flow__node[data-id="${e}"] .pluto-symbol__label`);let g={...l.To.ZERO};P!=null&&(g=l.To.construct(P),g=l.To.resize(g,{width:l.To.width(g),height:l.To.height(g)})),S({outerBox:$,labelBox:g})},[]),{}),{zoom:w}=j.useInitialViewport(),M=Na({labelOrientation:(t==null?void 0:t.orientation)??"top",hasLabel:(t==null?void 0:t.label)!=null&&(t==null?void 0:t.label.length)>0,valueBoxHeight:R,position:r,zoom:w,...h}),{width:_}=mr({aetherKey:e,color:i,level:s,box:M,telem:a,minWidth:60});return n.jsxRuntimeExports.jsxs(c.Dialog$1,{location:{y:"top"},hide:m==null||m.length===0,children:[n.jsxRuntimeExports.jsx(A.Space,{direction:"y",children:m==null?void 0:m.map(($,P)=>n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:$},P))}),n.jsxRuntimeExports.jsx(q,{className:l.CSS(o,l.CSS.B("value-labeled")),ref:E,onChange:p,...t,children:n.jsxRuntimeExports.jsx(tr,{color:u,dimensions:{height:R,width:_},units:d})})]})}),$a=.9,Na=({labelOrientation:e,outerBox:t,labelBox:s,valueBoxHeight:r,position:o,hasLabel:i,zoom:u})=>{const a=l.q.scale(l.To.dims(s),1/($a*u));return l.g.construct(e)==="x"&&(o=l.q.translate(o,"y",Math.max((a.y-r)/2-1,0))),i&&e==="left"?o=l.q.translate(o,"x",a.x+4):i&&e==="top"&&(o=l.q.translate(o,"y",a.y+4)),l.To.construct(o.x,o.y,l.To.width(t),r)},so=({color:e})=>n.jsxRuntimeExports.jsx(tr,{color:e,dimensions:{width:60,height:25},units:"psi",children:n.jsxRuntimeExports.jsx(c.Text,{level:"p",children:"50.00"})}),no=c.wrap$1("Switch",({aetherKey:e,label:t,control:s,onChange:r,orientation:o,source:i,sink:u,...a})=>{const{enabled:d,triggered:p,toggle:m}=xe({aetherKey:e,source:i,sink:u});return n.jsxRuntimeExports.jsx(q,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ie,{...s,orientation:o,children:n.jsxRuntimeExports.jsx(sr,{enabled:d,triggered:p,onClick:m,orientation:o,...a})})})}),ro=e=>n.jsxRuntimeExports.jsx(sr,{...e}),oo=c.wrap$1("Button",({aetherKey:e,label:t,orientation:s,sink:r,control:o,...i})=>{const{click:u}=Pa({aetherKey:e,sink:r});return n.jsxRuntimeExports.jsx(ie,{...o,className:l.CSS.B("symbol"),orientation:s,children:n.jsxRuntimeExports.jsx(nr,{...t,onClick:u,...i})})}),lo=({label:e,...t})=>n.jsxRuntimeExports.jsx(nr,{label:"Button",...t}),io=c.wrap$1("screwPump",({aetherKey:e,label:t,control:s,onChange:r,orientation:o,source:i,sink:u,...a})=>{const{enabled:d,triggered:p,toggle:m}=xe({aetherKey:e,source:i,sink:u});return n.jsxRuntimeExports.jsx(q,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ie,{...s,orientation:o,children:n.jsxRuntimeExports.jsx(or,{enabled:d,triggered:p,onClick:m,orientation:o,...a})})})}),co=e=>n.jsxRuntimeExports.jsx(or,{...e}),ao=c.wrap$1("vacuumPump",({aetherKey:e,label:t,control:s,onChange:r,orientation:o,source:i,sink:u,...a})=>{const{enabled:d,triggered:p,toggle:m}=xe({aetherKey:e,source:i,sink:u});return n.jsxRuntimeExports.jsx(q,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ie,{...s,orientation:o,children:n.jsxRuntimeExports.jsx(lr,{enabled:d,triggered:p,onClick:m,orientation:o,...a})})})}),uo=e=>n.jsxRuntimeExports.jsx(lr,{...e}),xo=c.wrap$1("progressiveCavityPump",({aetherKey:e,label:t,control:s,onChange:r,orientation:o,source:i,sink:u,...a})=>{const{enabled:d,triggered:p,toggle:m}=xe({aetherKey:e,source:i,sink:u});return n.jsxRuntimeExports.jsx(q,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ie,{...s,orientation:o,children:n.jsxRuntimeExports.jsx(ir,{enabled:d,triggered:p,onClick:m,orientation:o,...a})})})}),mo=e=>n.jsxRuntimeExports.jsx(ir,{...e}),po=c.wrap$1("pistonPump",({aetherKey:e,label:t,control:s,onChange:r,orientation:o,source:i,sink:u,...a})=>{const{enabled:d,triggered:p,toggle:m}=xe({aetherKey:e,source:i,sink:u});return n.jsxRuntimeExports.jsx(q,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ie,{...s,orientation:o,children:n.jsxRuntimeExports.jsx(cr,{enabled:d,triggered:p,onClick:m,orientation:o,...a})})})}),jo=e=>n.jsxRuntimeExports.jsx(cr,{...e}),fo=c.wrap$1("statixMixer",({label:e,onChange:t,...s})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(ar,{...s})})),So=e=>n.jsxRuntimeExports.jsx(ar,{...e}),ho=c.wrap$1("rotaryMixer",({aetherKey:e,label:t,control:s,onChange:r,orientation:o,source:i,sink:u,...a})=>{const{enabled:d,triggered:p,toggle:m}=xe({aetherKey:e,source:i,sink:u});return n.jsxRuntimeExports.jsx(q,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ie,{...s,orientation:o,children:n.jsxRuntimeExports.jsx(ur,{enabled:d,triggered:p,onClick:m,orientation:o,...a})})})}),go=e=>n.jsxRuntimeExports.jsx(ur,{...e}),Eo=c.wrap$1("light",({aetherKey:e,label:t,source:s,onChange:r,...o})=>{const{enabled:i}=ka({aetherKey:e,source:s});return n.jsxRuntimeExports.jsx(q,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(xr,{enabled:i,...o})})}),Ro=e=>n.jsxRuntimeExports.jsx(xr,{...e}),U=4,Co=2,Ba=["angledReliefValve","angledValve","box","burstDisc","button","cap","cavityPump","checkValve","electricRegulator","filter","fourWayValve","setpoint","light","manualValve","needleValve","orifice","pistonPump","pump","regulator","reliefValve","rotaryMixer","screwPump","solenoidValve","staticMixer","switch","tank","threeWayValve","vacuumPump","value","valve"],Oa=ce.z.enum(Ba),K={orientation:"left",scale:1},za={...K,source:j.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:j.streamChannelValue({channel:0}),rollingAverage:j.rollingAverage({windowSize:1}),stringifier:j.stringifyNumber({precision:2})},outlet:"stringifier"})},Da={...K,source:j.sourcePipeline("number",{connections:[],segments:{valueStream:j.streamChannelValue({channel:0})},outlet:"valueStream"})},Aa={...K,sink:j.sinkPipeline("number",{connections:[],segments:{setter:j.setChannelValue({channel:0})},inlet:"setter"})},yo={...K,source:j.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:j.streamChannelValue({channel:0}),threshold:j.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},bo={...K,sink:j.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:j.setChannelValue({channel:0}),setpoint:j.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},de={...yo,...bo},H=e=>({label:{label:e,level:"p",orientation:"top"}}),Va={width:100,height:100},vo={dimensions:Va,backgroundColor:l.ZERO},Ia=3,Za={name:"Three Way Valve",key:"threeWayValve",Form:ue,Symbol:jr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Three Way Valve"),...de}),Preview:fr,zIndex:U},Fa={name:"Valve",key:"valve",Form:ue,Symbol:Sr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Valve"),...de}),Preview:hr,zIndex:U},qa={name:"Solenoid Valve",key:"solenoidValve",Form:ue,Symbol:gr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Solenoid Valve"),normallyOpen:!1,...de}),Preview:Er,zIndex:U},Ha={name:"Four Way Valve",key:"fourWayValve",Form:ue,Symbol:Rr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Four Way Valve"),...de}),Preview:Cr,zIndex:U},Ya={name:"Angled Valve",key:"angledValve",Form:ue,Symbol:yr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Angled Valve"),...de}),Preview:br,zIndex:U},Ga={name:"Pump",key:"pump",Form:ue,Symbol:vr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Pump"),...de}),Preview:wr,zIndex:U},Ua={name:"Screw Pump",key:"screwPump",Form:ue,Symbol:io,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Screw Pump"),...de}),Preview:co,zIndex:U},Wa={name:"Tank",key:"tank",Form:On,Symbol:Pr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Tank"),borderRadius:Xn,...vo,...K}),Preview:kr,zIndex:Co},Xa={name:"Box",key:"box",Form:()=>On({includeBorderRadius:!0}),Symbol:Tr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Box"),borderRadius:Ia,...vo,...K}),Preview:Lr,zIndex:Co},Ka={name:"Relief Valve",key:"reliefValve",Form:re,Symbol:Mr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Relief Valve"),...K}),Preview:_r,zIndex:U},Ja={name:"Regulator",key:"regulator",Form:re,Symbol:$r,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Regulator"),...K}),Preview:Nr,zIndex:U},Qa={name:"Electric Regulator",key:"electricRegulator",Form:re,Symbol:Br,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Electric Regulator"),...K}),Preview:Or,zIndex:U},eu={name:"Burst Disc",key:"burstDisc",Form:re,Symbol:zr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Burst Disc"),...K}),Preview:Dr,zIndex:U},tu={name:"Cap",key:"cap",Form:re,Symbol:Ar,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Cap"),...K}),Preview:Vr,zIndex:U},su={name:"Manual Valve",key:"manualValve",Form:re,Symbol:Ir,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Manual Valve"),...K}),Preview:Zr,zIndex:U},nu={name:"Filter",key:"filter",Form:re,Symbol:Hr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Filter"),...K}),Preview:Yr,zIndex:U},ru={name:"Needle Valve",key:"needleValve",Form:re,Symbol:Gr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Needle Valve"),...K}),Preview:Ur,zIndex:U},ou={name:"Check Valve",key:"checkValve",Form:re,Symbol:Wr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Check Valve"),...K}),Preview:Xr,zIndex:U},lu={name:"Orifice",key:"orifice",Form:re,Symbol:Kr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Orifice"),...K}),Preview:Jr,zIndex:U},iu={name:"Angled Relief Valve",key:"angledReliefValve",Form:re,Symbol:Qr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Angled Relief Valve"),...K}),Preview:eo,zIndex:U},cu={name:"Value",key:"value",Form:ma,Symbol:to,Preview:so,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",...H("Value"),...K,telem:za.source}),zIndex:U},au={name:"Button",key:"button",Symbol:oo,Form:Sa,Preview:lo,defaultProps:e=>({color:e.colors.primary.z.rgba255,...H("Button"),...bo,scale:null}),zIndex:U},uu={name:"Switch",key:"switch",Symbol:no,Preview:ro,Form:ue,defaultProps:()=>({...H("Switch"),...de,scale:null}),zIndex:U},xu={name:"Vacuum Pump",key:"vacuumPump",Symbol:ao,Form:ue,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Vacuum Pump"),...de}),Preview:uo,zIndex:U},du={name:"Cavity Pump",key:"cavityPump",Symbol:xo,Form:ue,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Cavity Pump"),...de}),Preview:mo,zIndex:U},mu={name:"Piston Pump",key:"pistonPump",Symbol:po,Form:ue,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Piston Pump"),...de}),Preview:jo,zIndex:U},pu={name:"Static Mixer",key:"staticMixer",Symbol:fo,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Static Mixer"),...K}),Preview:So,zIndex:U},ju={name:"Rotary Mixer",key:"rotaryMixer",Symbol:ho,Form:ue,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Rotary Mixer"),...de}),Preview:go,zIndex:U},fu={name:"Light",key:"light",Symbol:Eo,Form:ja,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Light"),...yo}),Preview:Ro,zIndex:U},Su={name:"Setpoint",key:"setpoint",Symbol:Fr,Form:ga,defaultProps:()=>({units:"mV",...H("Setpoint"),...Da,...Aa}),Preview:qr,zIndex:U},hu={value:cu,light:fu,switch:uu,button:au,setpoint:Su,tank:Wa,box:Xa,valve:Fa,solenoidValve:qa,threeWayValve:Za,fourWayValve:Ha,angledValve:Ya,manualValve:su,needleValve:ru,reliefValve:Ka,angledReliefValve:iu,checkValve:ou,regulator:Ja,electricRegulator:Qa,pump:Ga,pistonPump:mu,screwPump:Ua,cavityPump:du,vacuumPump:xu,staticMixer:pu,rotaryMixer:ju,burstDisc:eu,cap:tu,filter:nu,orifice:lu},gu=Object.freeze(Object.defineProperty({__proto__:null,AngledReliefValve:Qr,AngledReliefValvePreview:eo,AngledValve:yr,AngledValvePreview:br,Box:Tr,BoxPreview:Lr,BurstDisc:zr,BurstDiscPreview:Dr,Button:oo,ButtonPreview:lo,Cap:Ar,CapPreview:Vr,CavityPump:xo,CavityPumpPreview:mo,CheckValve:Wr,CheckValvePreview:Xr,ElectricRegulator:Br,ElectricRegulatorPreview:Or,Filter:Hr,FilterPreview:Yr,FourWayValve:Rr,FourWayValvePreview:Cr,Light:Eo,LightPreview:Ro,ManualValve:Ir,ManualValvePreview:Zr,NeedleValve:Gr,NeedleValvePreview:Ur,Orifice:Kr,OrificePreview:Jr,PistonPump:po,PistonPumpPreview:jo,Pump:vr,PumpPreview:wr,Regulator:$r,RegulatorPreview:Nr,ReliefValve:Mr,ReliefValvePreview:_r,RotaryMixer:ho,RotaryMixerPreview:go,SYMBOLS:hu,ScrewPump:io,ScrewPumpPreview:co,Setpoint:Fr,SetpointPreview:qr,SolenoidValve:gr,SolenoidValvePreview:Er,StaticMixer:fo,StaticMixerPreview:So,Switch:no,SwitchPreview:ro,Tank:Pr,TankPreview:kr,ThreeWayValve:jr,ThreeWayValvePreview:fr,VacuumPump:ao,VacuumPumpPreview:uo,Value:to,ValuePreview:so,Valve:Sr,ValvePreview:hr,typeZ:Oa},Symbol.toStringTag,{value:"Module"}));exports.Aether=c.main;exports.Dialog=c.use$4;exports.Divider=c.Divider$1;exports.Dropdown=c.Dropdown;exports.Haul=c.Haul;exports.Worker=c.Context$1;exports.compareArrayDeps=c.compareArrayDeps;exports.componentRenderProp=c.componentRenderProp;exports.isRenderProp=c.isRenderProp;exports.useAsyncEffect=c.useAsyncEffect;exports.useClickOutside=c.useClickOutside;exports.useCombinedRefs=c.useCombinedRefs;exports.useCombinedStateAndRef=c.useCombinedStateAndRef;exports.useDebouncedCallback=c.useDebouncedCallback;exports.useEffectCompare=c.useEffectCompare;exports.useMemoCompare=c.useMemoCompare;exports.useMemoDeepEqualProps=c.useMemoDeepEqualProps;exports.useMemoPrimitiveArray=c.useMemoPrimitiveArray;exports.usePrevious=c.usePrevious;exports.useResize=c.useResize;exports.useStateRef=c.useStateRef;exports.useSyncedRef=c.useSyncedRef;exports.useTransforms=c.useTransforms;exports.CSS=l.CSS;exports.newBEM=l.newBEM;exports.Header=He.external;exports.DataType=C.d;exports.Density=C.I;exports.MultiSeries=C.yt;exports.Rate=C.$;exports.Series=C.N;exports.TimeRange=C.U;exports.TimeSpan=C.w;exports.TimeStamp=C.m;exports.state=C.state;exports.Generic=A.Generic;exports.Align=$o.external;exports.Button=No.external;exports.Caret=Bo.Animated$1;exports.telem=j.external;exports.Color=_t.external;exports.Text=ae.external;exports.Triggers=$t.external;exports.Menu=Oo.external;exports.List=Le.external;exports.createFilterTransform=Le.createFilterTransform;exports.fuseFilter=Le.fuseFilter;exports.proxyMemo=Le.proxyMemo;exports.createHexOpacityVariants=Es.createHexOpacityVariants;exports.unitProperty=Es.unitProperty;exports.Input=me.external;exports.Tabs=se.external;exports.Theming=zo.external;exports.Tree=Do.external;exports.Video=Ao.Video;exports.Accordion=il;exports.Breadcrumb=ul;exports.Canvas=wl;exports.Channel=Si;exports.Control=Tc;exports.Device=Di;exports.Diagram=ca;exports.Eraser=dc;exports.Form=Bi;exports.Icon=Ii;exports.Label=Gi;exports.Legend=Ml;exports.Line=_l;exports.LinePlot=ni;exports.Measure=ii;exports.Modal=Wi;exports.Mosaic=ac;exports.Nav=jc;exports.Note=Sc;exports.OS=Cc;exports.Observe=$i;exports.Pluto=$c;exports.Progress=Bc;exports.Range=oi;exports.Ranger=Zc;exports.Resize=Qo;exports.Rule=ci;exports.Schematic=gu;exports.Select=Hl;exports.Status=Ho;exports.Steps=qc;exports.Synnax=ml;exports.Tag=Fl;exports.Telem=vc;exports.Tooltip=Yo;exports.Value=Ma;exports.Viewport=si;exports.axis=jl;exports.control=fl;