@synnaxlabs/pluto 0.27.0 → 0.28.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Animated-CqT7-gZp.js → Animated-C6We8oGt.js} +2 -2
- package/dist/{Animated-CZ63NC05.cjs → Animated-CPJOHwpl.cjs} +1 -1
- package/dist/{Keyboard-BIXxwSvF.cjs → Keyboard-Dw9MQvaJ.cjs} +1 -1
- package/dist/{Keyboard-fZbH7UAB.js → Keyboard-fQ7JpUW9.js} +2 -2
- package/dist/{LinePlot-Cc3CIgai.js → LinePlot-CS2iDNHW.js} +1839 -1840
- package/dist/{LinePlot-C6UR06-e.cjs → LinePlot-DNgFi7SV.cjs} +9 -9
- package/dist/{Link-BDA_zOS7.js → Link-2gkxmnh_.js} +1 -1
- package/dist/{Link-CYHWDE13.cjs → Link-hLjXIZ1T.cjs} +1 -1
- package/dist/List-B60FZ4Be.js +22 -0
- package/dist/List-Ce67Og-K.cjs +1 -0
- package/dist/Pack-BNnq0Pnk.cjs +1 -0
- package/dist/Pack-CcDPYCmE.js +132 -0
- package/dist/{Toggle-DBbZoe_A.cjs → Toggle-GfklnU2t.cjs} +39 -39
- package/dist/{Toggle-0_fgC0fe.js → Toggle-Q3wJPeGh.js} +6752 -6724
- package/dist/{Video-Breqk8IV.js → Video-CA6Au-LV.js} +1 -1
- package/dist/{Video-yUL4iEVD.cjs → Video-Ch_mMn__.cjs} +1 -1
- package/dist/aggregator-C5NNOlCt.cjs +57 -0
- package/dist/{aggregator-BQAqJzjZ.js → aggregator-J7DZKy5x.js} +2445 -2233
- package/dist/align.cjs +1 -1
- package/dist/align.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/color.cjs +1 -1
- package/dist/color.js +1 -1
- package/dist/{css-Dic6npsA.js → css-BHfxGWOW.js} +1 -1
- package/dist/{css-B7TifAVb.cjs → css-C4GOlJsi.cjs} +1 -1
- package/dist/css.cjs +1 -1
- package/dist/css.js +2 -2
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/ether.cjs +1 -1
- package/dist/ether.js +5 -5
- package/dist/{external-BWE1zUh9.js → external-2nFcIpzY.js} +11 -11
- package/dist/external-5YOxaVIG.js +259 -0
- package/dist/external-B0OT9sXv.js +127 -0
- package/dist/{external-DrJrhKqG.cjs → external-BCVvWczs.cjs} +1 -1
- package/dist/{external-o0TYQr9r.cjs → external-BRvjJOyT.cjs} +1 -1
- package/dist/external-BS_kvhV-.cjs +1 -0
- package/dist/{external-DR0u7Ium.cjs → external-BU8-3fqq.cjs} +1 -1
- package/dist/external-C1Pb6QsR.cjs +1 -0
- package/dist/{external-CVzm1emB.js → external-C6Z7BnOm.js} +4 -4
- package/dist/{external-69Ao7j7k.js → external-C6mP_Zl1.js} +10 -10
- package/dist/{external-DddErJ4X.cjs → external-CRCXQIg6.cjs} +1 -1
- package/dist/{external-BjLjce7d.js → external-CVJXZvQB.js} +2 -2
- package/dist/{external-By-puR46.js → external-C_sBb_mC.js} +3 -3
- package/dist/{external-C3c1BoRE.cjs → external-Cly1pTAH.cjs} +1 -1
- package/dist/{external-B4OSNdH_.cjs → external-CqxHdgvr.cjs} +1 -1
- package/dist/{external-DH3sAQ0c.js → external-Cv1PHg1z.js} +1 -1
- package/dist/{external-DA_ZnqPs.js → external-CvQxCzBO.js} +110 -107
- package/dist/{external-CNTzwgmW.js → external-CvWOg3Wh.js} +6 -6
- package/dist/{external-mBw4Opva.cjs → external-DLWdjzgl.cjs} +1 -1
- package/dist/{external-CpUUO6Ja.cjs → external-DfXrhUoK.cjs} +1 -1
- package/dist/{external-CPUf0VYV.js → external-QN9xgtCT.js} +2 -2
- package/dist/{external-DeMvP0U_.js → external-UQ_KRv4U.js} +5 -5
- package/dist/external-Xze9tWIL.cjs +1 -0
- package/dist/{external-CHYxZzhb.cjs → external-bcUzt2-X.cjs} +1 -1
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3541 -3440
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/src/aether/main.d.ts.map +1 -1
- package/dist/src/alamos/aether/alamos.d.ts +4 -4
- package/dist/src/align/Pack.d.ts +2 -0
- package/dist/src/align/Pack.d.ts.map +1 -1
- package/dist/src/align/Space.d.ts +2 -0
- package/dist/src/align/Space.d.ts.map +1 -1
- package/dist/src/breadcrumb/Breadcrumb.d.ts +31 -0
- package/dist/src/breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/dist/src/breadcrumb/index.d.ts +2 -0
- package/dist/src/breadcrumb/index.d.ts.map +1 -0
- package/dist/src/button/Button.d.ts +1 -1
- package/dist/src/button/Button.d.ts.map +1 -1
- package/dist/src/css/css.d.ts +1 -0
- package/dist/src/css/css.d.ts.map +1 -1
- package/dist/src/dropdown/Dropdown.d.ts.map +1 -1
- package/dist/src/form/Field.d.ts +5 -1
- package/dist/src/form/Field.d.ts.map +1 -1
- package/dist/src/form/Form.d.ts +17 -6
- package/dist/src/form/Form.d.ts.map +1 -1
- package/dist/src/header/Header.d.ts +0 -4
- package/dist/src/header/Header.d.ts.map +1 -1
- package/dist/src/icon/Icon.d.ts +3 -0
- package/dist/src/icon/Icon.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/input/DateTime.d.ts +2 -1
- package/dist/src/input/DateTime.d.ts.map +1 -1
- package/dist/src/input/Numeric.d.ts.map +1 -1
- package/dist/src/input/Text.d.ts +0 -3
- package/dist/src/input/Text.d.ts.map +1 -1
- package/dist/src/input/types.d.ts +3 -1
- package/dist/src/input/types.d.ts.map +1 -1
- package/dist/src/list/Core.d.ts +1 -1
- package/dist/src/list/Core.d.ts.map +1 -1
- package/dist/src/list/Search.d.ts.map +1 -1
- package/dist/src/mosaic/tree.d.ts.map +1 -1
- package/dist/src/observe/use.d.ts.map +1 -1
- package/dist/src/ranger/TimeRangeChip.d.ts +2 -1
- package/dist/src/ranger/TimeRangeChip.d.ts.map +1 -1
- package/dist/src/select/Button.d.ts +3 -2
- package/dist/src/select/Button.d.ts.map +1 -1
- package/dist/src/select/List.d.ts.map +1 -1
- package/dist/src/synnax/Provider.d.ts +1 -0
- package/dist/src/synnax/Provider.d.ts.map +1 -1
- package/dist/src/synnax/aether/provider.d.ts +45 -0
- package/dist/src/synnax/aether/provider.d.ts.map +1 -1
- package/dist/src/tag/Tag.d.ts +1 -1
- package/dist/src/tag/Tag.d.ts.map +1 -1
- package/dist/src/telem/control/aether/controller.d.ts +2 -1
- package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
- package/dist/src/text/core/types.d.ts +2 -1
- package/dist/src/text/core/types.d.ts.map +1 -1
- package/dist/src/theming/core/theme.d.ts +148 -147
- package/dist/src/theming/core/theme.d.ts.map +1 -1
- package/dist/src/tree/Tree.d.ts.map +1 -1
- package/dist/src/vis/diagram/aether/Diagram.d.ts +12 -12
- package/dist/src/vis/lineplot/Axis.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/LinePlot.d.ts +8 -8
- package/dist/src/vis/lineplot/range/aether/provider.d.ts +4 -4
- package/dist/style.css +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text.cjs +1 -1
- package/dist/text.js +2 -2
- package/dist/theming.cjs +1 -1
- package/dist/theming.js +2 -2
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/triggers.cjs +1 -1
- package/dist/triggers.js +1 -1
- package/dist/{units-Bq69s424.cjs → units-CKv8dczK.cjs} +1 -1
- package/dist/{units-BynnjwvA.js → units-t-SdMRna.js} +1 -1
- package/dist/video.cjs +1 -1
- package/dist/video.js +1 -1
- package/package.json +7 -7
- package/dist/List-DS2DLWjR.js +0 -22
- package/dist/List-qhbpsD-f.cjs +0 -1
- package/dist/Pack--3w90epp.cjs +0 -1
- package/dist/Pack-B7_4Xpi5.js +0 -125
- package/dist/aggregator-Bs9fTewE.cjs +0 -51
- package/dist/external-3Q2dzLIL.cjs +0 -1
- package/dist/external-BUFyYRiR.js +0 -129
- package/dist/external-BnJhvG1t.cjs +0 -1
- package/dist/external-CAS1RuN6.cjs +0 -1
- package/dist/external-vJteyGA3.js +0 -241
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var bo=Object.defineProperty;var vo=(e,t,s)=>t in e?bo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var ge=(e,t,s)=>vo(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-DBbZoe_A.cjs"),l=require("./css-B7TifAVb.cjs"),He=require("./external-C3c1BoRE.cjs"),v=require("./aggregator-Bs9fTewE.cjs"),D=require("./Pack--3w90epp.cjs"),wo=require("./external-DrJrhKqG.cjs"),To=require("./external-B4OSNdH_.cjs"),ko=require("./Animated-CZ63NC05.cjs"),p=require("./LinePlot-C6UR06-e.cjs"),le=require("zod"),kt=require("./external-o0TYQr9r.cjs"),ae=require("./external-3Q2dzLIL.cjs"),Pt=require("./external-CHYxZzhb.cjs"),Po=require("./external-CpUUO6Ja.cjs"),Lt=require("react-dom"),$e=require("./external-DddErJ4X.cjs"),fs=require("./units-Bq69s424.cjs"),me=require("./external-BnJhvG1t.cjs"),J=require("./external-mBw4Opva.cjs"),Lo=require("./external-DR0u7Ium.cjs"),Mo=require("./external-CAS1RuN6.cjs"),$o=require("./Video-yUL4iEVD.cjs"),hs=({variant:e,...t})=>n.jsxRuntimeExports.jsx(c.j0.Circle,{color:c.variantColors[e],...t}),_o=({status:{key:e,time:t,count:s,message:o,description:r,variant:i},silence:a,actions:u,className:d,children:j,...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(hs,{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:()=>a(e),children:n.jsxRuntimeExports.jsx(c.j0.Close,{})})]}),n.jsxRuntimeExports.jsxs(D.Space,{direction:"y",align:"start",className:l.CSS(l.CSS.BE("notification","content")),size:"small",children:[j??n.jsxRuntimeExports.jsx(c.Text,{className:l.CSS(l.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:o}),r!=null&&n.jsxRuntimeExports.jsx(c.Text,{className:l.CSS(l.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:r})]}),u!=null&&n.jsxRuntimeExports.jsx(D.Space,{direction:"x",align:"center",justify:"end",className:l.CSS(l.CSS.BE("notification","actions")),children:v.A(u).map(f=>n.jsxRuntimeExports.jsx(No,{action:f},f.key))})]},t.toString()),No=({action:e})=>{if(!x.isValidElement(e)){const t=e;return n.jsxRuntimeExports.jsx(c.Button,{...t})}return e},Bo=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:c.Aggregator,Circle:hs,Notification:_o,Text:c.Text$2,VARIANTS:v.VARIANTS,specZ:v.specZ$1,useAggregator:c.useAggregator,useContext:c.useContext$2,useNotifications:c.useNotifications,variantZ:v.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"})),Xe=e=>e.preventDefault(),lt=x.forwardRef(({location:e,style:t,size:s,className:o,children:r,onDragStart:i,sizeUnits:a="px",showHandle:u=!0,...d},j)=>{const m=l.J.construct(e),f=l.J.direction(m),g=l.g.dimension(f);return n.jsxRuntimeExports.jsxs("div",{className:l.CSS(l.CSS.B("resize"),l.CSS.loc(m),l.CSS.dir(f),o),style:{[g]:`${s}${a}`,...t},ref:j,...d,children:[r,u&&n.jsxRuntimeExports.jsx("div",{draggable:!0,className:l.CSS(l.CSS.BE("resize","handle"),l.CSS.bordered(l.J.swap(m))),onDragStart:i,onDrag:Xe,onDragEnd:Xe})]})});lt.displayName="Resize.Core";const Mt=({onResize:e,count:t,initialSizes:s=[],minSize:o=100,direction:r="x"})=>{const i=x.useRef(null),[a,u]=x.useState({sizeDistribution:Do(s,t),root:null}),d=x.useCallback((f,g,h)=>{if(i.current==null)return;const R=l.To.dim(l.To.construct(i.current),r);u(E=>ft(E,R,f,o,g,h))},[o,u,r]);x.useEffect(()=>e==null?void 0:e(a.sizeDistribution),[a.sizeDistribution,e]);const j=x.useCallback((f,g)=>{f.preventDefault();const h=r==="x"?"clientX":"clientY",R=P=>d(g,P[h]),E=()=>{u(P=>({...P,root:null})),document.removeEventListener("mousemove",R)};u(P=>({...P,root:f[h]})),document.addEventListener("mousemove",R),document.addEventListener("mouseup",E,{once:!0})},[u,r,ft]);return{setSize:x.useCallback((f,g)=>d(f,void 0,g),[ft]),props:{direction:r,sizeDistribution:a.sizeDistribution,onDragHandle:j,ref:i}}},it=x.forwardRef(({direction:e="x",children:t,sizeDistribution:s,onDragHandle:o,className:r,...i},a)=>{const u=l.g.construct(e),d=x.Children.toArray(t);return s=Oo(s),n.jsxRuntimeExports.jsx(D.Space,{...i,ref:a,direction:u,className:l.CSS(l.CSS.B("resize-multiple"),r),empty:!0,grow:!0,children:d.map((j,m)=>n.jsxRuntimeExports.jsx(lt,{onDragStart:f=>o(f,m),location:l.g.location(u),size:s[m]*100,sizeUnits:"%",showHandle:m!==d.length-1,children:j},m))})});it.displayName="Resize.Multiple";const Do=(e,t)=>{const s=e.reduce((r,i)=>r+i,0),o=t-e.length;if(o<=0)return e.slice(0,t).map(r=>r/s);if(e.every(r=>r<=1)){const r=1-s;return[...e,...Array(o).fill(r/o)]}return e.map(()=>1/t)},jt=.001,Oo=e=>e.every(t=>l.C$1.closeTo(t,1/e.length),jt)?e.map((t,s)=>s%2===0?t+jt:s===e.length-1?t:t-jt):e,ft=(e,t,s,o,r,i)=>{const a=gs(e,t,s,r,i),[u,d]=Ao(e.sizeDistribution,s,a,o/t),j=d?r??null:e.root;return{...e,sizeDistribution:u,root:j}},gs=(e,t,s,o,r)=>{let i;if(r!=null)r>1&&(r=r/t),i=r-e.sizeDistribution[s];else if(o!=null){if(e.root===null)throw new Error("resize root is null during handle drag");i=(o-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return i},Ao=(e,t,s,o)=>{let r=t;for(;r>0&&e[r]+s<=o;)r--;const i=e[r]+s,a=Vo(r,e,o,s),u=e[a]-s;return i<o||u<o?[e,!1]:[e.map((d,j)=>j===r?i:j===a?u:d),!0]},Vo=(e,t,s,o)=>(e===t.length-1?Zo:Io)(e,t,s,o),Io=(e,t,s,o)=>{let r=e+1;for(;r<t.length-1&&t[r]-o<=s;)r++;return r},Zo=(e,t,s,o)=>{let r=e-1;for(;r>0&&t[r]-o<=s;)r--;return r},ct=({onMove:e,onStart:t,onEnd:s})=>x.useCallback(o=>{o.preventDefault();const r=l.q.construct(o),i=c.mouseKey(o.button);t==null||t(r,i,o);const a=d=>{if(d.buttons===0)return u(d);const j=l.q.construct(d);e==null||e(l.To.construct(r,j),i,d)};window.addEventListener("mousemove",a);const u=d=>{window.removeEventListener("mousemove",a);const j=l.q.construct(d);s==null||s(l.To.construct(r,j),i,d)};window.addEventListener("mouseup",u,{once:!0})},[e,t,s]),ht=2,Ss=({onCollapse:e,onResize:t,location:s="left",minSize:o=100,maxSize:r=1/0,initialSize:i=200,collapseThreshold:a=1/0,className:u,...d})=>{const[j,m]=x.useState(l.j(i,o,r)),f=x.useRef(null),g=l.J.construct(s),h=x.useCallback(S=>{if(f.current===null)return 0;const C=l.To.dim(S,l.J.direction(g),!0)*(1-2*Number(["bottom","right"].includes(g))),y=f.current+C,T=l.j(y,o,r);return(T-y)/o>a?ht:T},[g,o,r,a]),R=x.useRef(null),E=x.useCallback(S=>{const C=h(S);m(C),R.current!=null&&(t==null||t(C,l.To.construct(R.current)))},[t,h]),P=x.useCallback(()=>m(S=>(f.current=S,S)),[m]),M=x.useCallback(S=>h(S)===ht&&(e==null?void 0:e()),[e,h]);x.useEffect(()=>m(S=>{const C=l.j(S,o,r);return f.current=C,C}),[o,r]);const $=ct({onMove:E,onStart:P,onEnd:M});return n.jsxRuntimeExports.jsx(lt,{ref:R,location:g,size:j,onDragStart:$,className:l.clsx(u,l.CSS.expanded(j!==ht)),...d})},Fo=Object.freeze(Object.defineProperty({__proto__:null,Core:lt,Multiple:it,Single:Ss,calculateDiffPercentage:gs,useMultiple:Mt},Symbol.toStringTag,{value:"Module"})),Ge="y",ts=28,qo=32,Yo=40,Ho=.5,Go=({data:e,...t})=>{const{setSize:s,props:{sizeDistribution:o,ref:r,...i}}=Mt({direction:Ge,count:e.length,minSize:ts}),a=u=>{if(r.current==null)return;const d=l.To.dim(l.To.construct(r.current),Ge);o[u]<Yo/d?s(u,e[u].initialSize??Ho):s(u,ts+1)};return n.jsxRuntimeExports.jsx(it,{empty:!0,className:l.CSS.B("accordion"),sizeDistribution:o,ref:r,...t,...i,children:e.map((u,d)=>x.createElement(Xo,{...u,key:u.key,index:d,direction:Ge,onExpand:a,parent:r,size:o[d]}))})},Uo=n.jsxRuntimeExports.jsx(c.j0.Caret.Down,{"aria-label":"contract"}),Wo=n.jsxRuntimeExports.jsx(c.j0.Caret.Right,{"aria-label":"expand"}),Xo=({index:e,name:t,content:s,actions:o,size:r,parent:i,onExpand:a})=>{let u=!0;if(i.current!=null){const j=l.To.dim(l.To.construct(i.current),Ge);u=r*j>qo}const d=u?Uo:Wo;return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsxs(He.Header,{level:"p",className:l.CSS.expanded(u),empty:!0,children:[n.jsxRuntimeExports.jsx(He.ButtonTitle,{startIcon:d,onClick:()=>a(e),children:t}),o!=null&&n.jsxRuntimeExports.jsx(He.Actions,{children:o})]}),s]})},Ko=Object.freeze(Object.defineProperty({__proto__:null,Accordion:Go},Symbol.toStringTag,{value:"Module"})),$t=x.createContext(p.ZERO_CONTEXT_VALUE),fe=()=>x.useContext($t).synnax,Jo=()=>x.useContext($t).state,ss={connected:"success",connecting:"info",disconnected:"info",failed:"error"},Es=c.wrap$1(p.Provider.TYPE,({aetherKey:e,connParams:t,children:s})=>{const[o,r,i]=c.useCombinedStateAndRef(p.ZERO_CONTEXT_VALUE),[{path:a},,u]=c.use$3({aetherKey:e,type:p.Provider.TYPE,schema:p.Provider.stateZ,initialState:{props:t??null,state:null}}),d=c.useAggregator(),j=x.useCallback(m=>{i.current.state.status!==m.status&&d({variant:ss[m.status],message:m.message??l._.capitalize(m.status)}),r(f=>({...f,state:m}))},[d]);return c.useAsyncEffect(async()=>{if(o.synnax!=null&&o.synnax.close(),t==null)return r(p.ZERO_CONTEXT_VALUE);const m=new v.ly({...t,connectivityPollFrequency:v.N.seconds(5)});r({synnax:m,state:{clusterKey:"",status:"connecting",message:"Connecting..."}});const f=await m.connectivity.check();return r({synnax:m,state:f}),d({variant:ss[f.status],message:f.message??f.status.toUpperCase()}),m.connectivity.onChange(j),u({props:t,state:f}),()=>{m.close(),r(p.ZERO_CONTEXT_VALUE),u({props:null,state:null})}},[t,j]),n.jsxRuntimeExports.jsx($t.Provider,{value:o,children:n.jsxRuntimeExports.jsx(c.Composite,{path:a,children:s})})}),Qo=Object.freeze(Object.defineProperty({__proto__:null,Provider:Es,use:fe,useConnectionState:Jo},Symbol.toStringTag,{value:"Module"})),_e=x.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),Rs=()=>x.useContext(_e),Cs=e=>{const{aliases:t}=x.useContext(_e);return t[e]??null},at=()=>{const{aliases:e}=x.useContext(_e);return e},ut=(e,t="")=>{const{getName:s}=x.useContext(_e),[o,r]=x.useState(t);return c.useAsyncEffect(async()=>{const i=await s(e);i!=null&&r(i)},[e,s]),o??t},_t=()=>{const{activeRange:e}=x.useContext(_e);return e??void 0},ys=({activeRange:e,children:t})=>{const s=fe(),[o,r]=x.useState({}),i=x.useCallback(d=>{r(j=>{const m={...j};return d.forEach(({variant:f,key:g,value:h})=>{const R=Number(g.split("---")[1]);f==="delete"?delete m[R]:m[h.channel]=h.alias}),m})},[r]),a=x.useCallback(async(d,j)=>{if(s==null||e==null)return;await(await s.ranges.retrieve(e)).setAlias(d,j)},[s,e]),u=x.useCallback(async d=>{if(s==null||d===0)return;const j=o[d];return j??(await s.channels.retrieve(d)).name},[o,s]);return c.useAsyncEffect(async()=>{if(s==null||e==null){r({});return}const d=await s.ranges.retrieve(e),j=await d.listAliases();r(j);const m=await d.openAliasTracker(),f=m.onChange(i);return()=>{f(),m.close()}},[s,e]),n.jsxRuntimeExports.jsx(_e.Provider,{value:{aliases:o,activeRange:e,setAlias:e!=null?a:null,getName:u},children:t})},el=({channelKey:e,value:t,shadow:s,className:o,...r})=>{const[i,a]=x.useState(!1),{setAlias:u}=Rs(),d=Cs(e),j=ut(e);let m=n.jsxRuntimeExports.jsx(c.j0.Rename,{});i?m=n.jsxRuntimeExports.jsx(c.j0.Loading,{}):d===t&&(m=n.jsxRuntimeExports.jsx(c.j0.Check,{}));const f=u!=null&&!i&&d!==t&&e!==0,g=()=>{f&&(async()=>(a(!0),await u(e,t),a(!1)))()},h=()=>{var E;d!=null&&((E=r.onChange)==null||E.call(r,d))},R=()=>e===0?n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):u==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 ",j," with this label"]});return n.jsxRuntimeExports.jsxs(c.Text$1,{value:t,...r,children:[f&&n.jsxRuntimeExports.jsx(c.Icon,{onClick:h,tooltip:n.jsxRuntimeExports.jsxs(c.Text,{level:"small",children:["Set ",j," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:n.jsxRuntimeExports.jsx(c.j0.Sync,{})}),n.jsxRuntimeExports.jsx(c.Icon,{onClick:g,disabled:!f,tooltip:n.jsxRuntimeExports.jsx(R,{}),tooltipLocation:{y:"top"},variant:"outlined",children:m})]})},Se="channel",tl=Object.freeze(Object.defineProperty({__proto__:null,Canvas:p.Canvas,axisStateZ:p.axisStateZ,newTickFactory:p.newTickFactory,tickFactoryProps:p.tickFactoryProps,tickType:p.tickType},Symbol.toStringTag,{value:"Module"})),sl=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:p.AcquireChannelControl,AuthoritySource:p.AuthoritySource,Chip:p.Chip,Controller:p.Controller$1,Indicator:p.Indicator,Legend:p.Legend,REGISTRY:p.REGISTRY$3,STATUSES:p.STATUSES,SetChannelValue:p.SetChannelValue,StateProvider:p.StateProvider,acquireChannelControl:p.acquireChannelControl,acquireChannelControlPropsZ:p.acquireChannelControlPropsZ,authoritySource:p.authoritySource,authoritySourceProps:p.authoritySourceProps,chipStateZ:p.chipStateZ,controllerStateZ:p.controllerStateZ,indicatorStateZ:p.indicatorStateZ,legendStateZ:p.legendStateZ,setChannelValue:p.setChannelValue,setChannelValuePropsZ:p.setChannelValuePropsZ,stateProviderStateZ:p.stateProviderStateZ,statusZ:p.statusZ,sugaredStateZ:p.sugaredStateZ},Symbol.toStringTag,{value:"Module"}));var pe;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(pe||(pe={}));function nl({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 rl({color:e,radius:t}){return x.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const ol={[pe.Dots]:"#91919a",[pe.Lines]:"#eee",[pe.Cross]:"#e2e2e2"},ll={[pe.Dots]:1,[pe.Lines]:1,[pe.Cross]:6},il=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function bs({id:e,variant:t=pe.Dots,gap:s=20,size:o,lineWidth:r=1,offset:i=2,color:a,style:u,className:d}){const j=x.useRef(null),{transform:m,patternId:f}=p.useStore(il,p.shallow$1),g=a||ol[t],h=o||ll[t],R=t===pe.Dots,E=t===pe.Cross,P=Array.isArray(s)?s:[s,s],M=[P[0]*m[2]||1,P[1]*m[2]||1],$=h*m[2],S=E?[$,$]:M,C=R?[$/i,$/i]:[S[0]/i,S[1]/i];return x.createElement("svg",{className:p.cc(["react-flow__background",d]),style:{...u,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:j,"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(-${C[0]},-${C[1]})`},R?x.createElement(rl,{color:g,radius:$/i}):x.createElement(nl,{dimensions:S,color:g,lineWidth:r})),x.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`}))}bs.displayName="Background";var cl=x.memo(bs);const al={region:l.To.ZERO,dpr:1,os:v.w$1.getOS()},ul={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},xl=c.wrap$1(p.Canvas$1.TYPE,({children:e,resizeDebounce:t=100,aetherKey:s,className:o,...r})=>{const[{path:i},{bootstrapped:a,dpr:u},d]=c.use$3({aetherKey:s,type:p.Canvas$1.TYPE,schema:p.canvasStateZ,initialState:al}),j=x.useRef({...ul}),m=x.useCallback(h=>{j.current.bootstrapped&&d(()=>({bootstrapped:!0,region:h,dpr:window.devicePixelRatio,os:v.w$1.getOS({default:"Windows"})}))},[d]),f=c.useResize(m,{debounce:t});x.useEffect(()=>{const h=()=>{window.devicePixelRatio!==u&&d(R=>({...R,dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",h,{once:!0})},[u]),x.useEffect(()=>{window.addEventListener("focus",()=>d(h=>({...h}))),window.addEventListener("blur",()=>d(h=>({...h})))},[d]);const g=x.useCallback(h=>{if(f(h),h==null)return;h.className.includes("gl")?j.current.gl=h:h.className.includes("upper2d")?j.current.upper2d=h:j.current.lower2d=h;const{gl:R,lower2d:E,upper2d:P,bootstrapped:M}=j.current;if(R==null||E==null||P==null||M)return;j.current.bootstrapped=!0;const $=R.transferControlToOffscreen(),S=P.transferControlToOffscreen(),C=E.transferControlToOffscreen();d({glCanvas:$,upper2dCanvas:S,lower2dCanvas:C,bootstrap:!0,bootstrapped:!1,region:l.To.construct(R),dpr:window.devicePixelRatio,os:v.w$1.getOS({default:"Windows"})},[$,S,C])},[d]);return n.jsxRuntimeExports.jsxs("div",{className:l.CSS(l.CSS.B("canvas-container"),o),...r,children:[n.jsxRuntimeExports.jsx("canvas",{ref:g,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","lower2d"))}),n.jsxRuntimeExports.jsx("canvas",{ref:g,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","gl"))}),n.jsxRuntimeExports.jsx("canvas",{ref:g,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","upper2d"))}),n.jsxRuntimeExports.jsx(c.Composite,{path:i,children:a&&e})]})}),Nt=(e,t)=>c.useResize(x.useCallback((s,o)=>{const r=document.querySelector(".pluto-canvas--lower2d");r!=null&&e(l.k.XY.translate(l.q.scale(l.To.topLeft(r),-1)).box(s),o)},[e]),t),dl=Object.freeze(Object.defineProperty({__proto__:null,Canvas:xl,useRegion:Nt},Symbol.toStringTag,{value:"Module"})),vs=x.createContext(null),Re=e=>{const t=x.useContext(vs);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},ws=e=>{const t=Re("Viewport"),{addViewportHandler:s}=t;x.useEffect(()=>s(e),[s,e])},xt=(e,t)=>{const{setGridEntry:s,removeGridEntry:o}=Re(t),{key:r}=e;return c.useEffectCompare(()=>{l.J.outer.parse(e.loc),s(e)},([u],[d])=>v._.equal(u,d),[e]),x.useEffect(()=>()=>o(r),[]),{gridArea:l.g.swap(l.J.direction(e.loc))==="x"?`axis-start-${r} / plot-start / axis-end-${r} / plot-end`:`plot-start / axis-start-${r} / plot-end / axis-end-${r}`}},Ts=c.wrap$1("LinePlot",({aetherKey:e,style:t,resizeDebounce:s=0,clearOverScan:o=l.q.ZERO,children:r,hold:i=!1,onHold:a,...u})=>{const[d,j]=x.useState([]),m=c.useMemoDeepEqualProps({clearOverScan:o,hold:i}),[{path:f},{grid:g},h]=c.use$3({aetherKey:e,type:p.LinePlot.TYPE,schema:p.linePlotStateZ,initialState:{container:l.To.ZERO,viewport:l.To.DECIMAL,grid:{},...m}});x.useEffect(()=>h(b=>({...b,...m})),[m]);const R=x.useRef(new Map),E=x.useCallback(b=>(R.current.set(b,null),()=>R.current.delete(b)),[R]),P=x.useCallback(b=>{const{mode:L,box:w,stage:z}=b;(L==="pan"&&z!=="start"||L==="zoom"||L==="zoomReset"&&z==="start")&&h(V=>({...V,viewport:w})),R.current.forEach((V,G)=>G(b))},[h]),M=x.useCallback(b=>h(L=>({...L,container:b})),[h]),$=Nt(M,{debounce:s}),S=x.useCallback(b=>h(L=>({...L,grid:{...L.grid,[b.key]:b}})),[h]),C=x.useCallback(b=>h(L=>{const{[b]:w,...z}=L.grid;return{...L,grid:z}}),[h]),y=x.useCallback(b=>{j(L=>[...L.filter(({key:w})=>w!==b.key),b])},[j,P]),T=x.useCallback(b=>j(L=>L.filter(({key:w})=>w!==b)),[y]),B=x.useMemo(()=>ml(g),[g]),_=x.useCallback(b=>{h(L=>({...L,hold:b})),a==null||a(b)},[h,a]),N=x.useMemo(()=>({lines:d,setGridEntry:S,removeGridEntry:C,setLine:y,removeLine:T,setViewport:P,addViewportHandler:E,setHold:_}),[d,S,C,y,T,P,E,_]);return n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("line-plot"),style:{...t,...B},ref:$,...u,children:n.jsxRuntimeExports.jsx(vs.Provider,{value:N,children:n.jsxRuntimeExports.jsx(c.Composite,{path:f,children:r})})})}),ml=e=>{const t=l.CSS.newGridBuilder();return p.filterGridEntries("top",e).forEach(({key:s,size:o})=>t.row(`axis-start-${s}`,`axis-end-${s}`,o)),t.row("plot-start","plot-end","minmax(0, 1fr)"),p.filterGridEntries("bottom",e).forEach(({key:s,size:o})=>t.row(`axis-start-${s}`,`axis-end-${s}`,o)),p.filterGridEntries("left",e).forEach(({key:s,size:o})=>t.col(`axis-start-${s}`,`axis-end-${s}`,o)),t.col("plot-start","plot-end","minmax(0, 1fr)"),p.filterGridEntries("right",e).forEach(({key:s,size:o})=>t.col(`axis-start-${s}`,`axis-end-${s}`,o)),t.build()},Bt=e=>{const t=e==="x"?"bottom":"left",s=e==="x"?p.XAxis.TYPE:p.YAxis.TYPE,o=`${e}-axis`;return c.wrap$1(s,({aetherKey:r,children:i,location:a=t,label:u="",labelLevel:d="small",labelDirection:j=e,onLabelChange:m,color:f,labelSize:g,showGrid:h,type:R,bounds:E,className:P,tickSpacing:M,autoBounds:$,autoBoundUpdateInterval:S,onAutoBoundsChange:C,style:y,...T})=>{const B=((u==null?void 0:u.length)??0)>0,_=c.useMemoDeepEqualProps({location:a,showGrid:h,type:R,bounds:E,label:u,labelDirection:j,tickSpacing:M,autoBounds:$,autoBoundUpdateInterval:S}),[{path:N},{size:b,labelSize:L,...w},z]=c.use$3({aetherKey:r,type:s,schema:p.coreAxisStateZ,initialState:_});x.useEffect(()=>z(F=>({...F,..._})),[_]),x.useEffect(()=>{const{lower:F,upper:O}=p.parseAutoBounds(w.autoBounds);w.bounds!=null&&(F&&(E==null?void 0:E.lower)!==w.bounds.lower||O&&(E==null?void 0:E.upper)!==w.bounds.upper)&&(C==null||C(w.bounds))},[w.autoBounds,w.bounds]);const V=xt({loc:a,key:`${s}-${r}`,size:b+L,order:"last"},"XAxis"),G=c.useTypography(d).toString(),I=x.useRef(0);return x.useEffect(()=>{if(e==="y"){if(u==null)return;let O=v.dimensions(u,G)[l.g.dimension(l.g.construct(j))];O>0&&(O+=6),z(ee=>({...ee,labelSize:O}))}else{const O=v.dimensions(u,G).height+12,ee=I.current;p.withinSizeThreshold(ee,O)||(I.current=O,z(se=>({...se,labelSize:O})))}},[u,j,G]),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(P,l.CSS.B("axis"),l.CSS.B(o),l.CSS.loc(a)),style:{...y,...V},align:"center",justify:e==="x"?"end":"start",direction:l.g.swap(e),...T,children:B&&n.jsxRuntimeExports.jsx(c.MaybeEditable,{className:l.CSS(l.CSS.BE("axis","label"),l.CSS.dir(j)),value:u,onChange:m,level:d})}),n.jsxRuntimeExports.jsx(c.Composite,{path:N,children:i})]})})},ks=Bt("x"),Ps=Bt("y"),Ls=l.q.xy.extend({root:l.J.corner,units:le.z.object({x:le.z.enum(["px","decimal"]),y:le.z.enum(["px","decimal"])})}),pl=Ls.partial({root:!0,units:!0}),jl=e=>{var s,o,r,i;const t={};return t[((s=e.root)==null?void 0:s.x)??"left"]=((o=e==null?void 0:e.units)==null?void 0:o.x)==="px"?`${e.x}px`:`${e.x*100}%`,t[((r=e.root)==null?void 0:r.y)??"top"]=((i=e==null?void 0:e.units)==null?void 0:i.y)==="px"?`${e.y}px`:`${e.y*100}%`,t},fl=(e,t)=>{var i,a,u,d,j,m;const s={x:e.x,y:e.y};if(t.current==null)return s;const o=l.To.construct(t.current),r=l.To.construct(t.current.parentElement);return((i=e.units)==null?void 0:i.x)==="decimal"?((a=e.root)==null?void 0:a.x)==="right"&&(s.x=1-e.x):((u=e.root)==null?void 0:u.x)==="right"?s.x=1-(e.x+l.To.width(o))/l.To.width(r):s.x/=l.To.width(r),((d=e.units)==null?void 0:d.y)==="decimal"?((j=e.root)==null?void 0:j.y)==="bottom"&&(s.y=1-e.y):((m=e.root)==null?void 0:m.y)==="bottom"?s.y=1-(e.y+l.To.height(o))/l.To.height(r):s.y/=l.To.height(r),s},Ms=(e,t)=>{if(t.current==null)return null;const s=l.To.construct(t.current.parentElement),o=l.To.construct(t.current),r={x:e.x,y:e.y,root:{...l.J.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(r.x=(1-e.x)*l.To.width(s)-l.To.width(o),r.root.x="right"):e.x<.2?r.x=e.x*l.To.width(s):r.units.x="decimal",e.y>.8?(r.y=(1-e.y)*l.To.height(s)-l.To.height(o),r.root.y="bottom"):e.y<.2?r.y=e.y*l.To.height(s):r.units.y="decimal",r.x=Math.round(r.x*100)/100,{...r,...l.q.truncate(r,3)}},ns=l.To.reRoot(l.To.DECIMAL,l.J.TOP_LEFT),zt=x.memo(({className:e,value:t,onChange:s,style:o,draggable:r=!0,...i})=>{const[a,u]=v.usePurePassthrough({value:t,onChange:s,initial:{x:.1,y:.1,root:l.J.TOP_LEFT,units:{x:"decimal",y:"decimal"}}}),d=x.useRef(a),j=c.useSyncedRef(r===!1),m=x.useRef(null);a!==null&&(o={...o,...jl(a)});const f=x.useCallback(h=>{var C;if(((C=m.current)==null?void 0:C.parentElement)==null)return d.current;const R=l.To.construct(m.current.parentElement),E=l.k.XY.scale(R).scale(ns),P=E.box(l.To.construct(m.current)),M=l.k.XY.clamp(l.To.construct(l.To.topLeft(ns),{width:1-l.To.width(P),height:1-l.To.height(P)})),$=l.q.translate(l.q.construct(d.current),l.To.signedDims(E.box(h))),S=M.pos($);return Ms(S,m)},[]),g=ct({onStart:x.useCallback(()=>{d.current=fl(d.current,m)},[]),onMove:x.useCallback(h=>{if(j.current)return;const R=f(h);R!==null&&u(R)},[]),onEnd:x.useCallback(h=>{if(j.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:o,onDragStart:g,draggable:r,ref:m,...i,onDrag:Xe,onDragEnd:Xe,empty:!0})});zt.displayName="Legend.Container";const Dt=({data:e=[],onEntryChange:t,position:s,onPositionChange:o,...r})=>{const[i,a]=x.useState(!1);return e.length===0?null:n.jsxRuntimeExports.jsx(zt,{...r,draggable:!i,value:s,onChange:o,children:e.sort((u,d)=>u.label.localeCompare(d.label)).map(({key:u,color:d,label:j})=>n.jsxRuntimeExports.jsxs(D.Space,{style:{cursor:"pointer"},direction:"x",align:"center",size:"small",children:[n.jsxRuntimeExports.jsx(kt.Swatch,{value:d,onChange:m=>t==null?void 0:t({key:u,color:m,label:j}),onVisibleChange:a,draggable:!1,size:"small"}),n.jsxRuntimeExports.jsx(c.MaybeEditable,{level:"small",value:j,onChange:m=>t==null?void 0:t({key:u,color:d,label:m}),noWrap:!0})]},u))})},hl=Object.freeze(Object.defineProperty({__proto__:null,Container:zt,Simple:Dt,calcStickyPos:Ms,completeStickyXYz:Ls,stickyXYz:pl},Symbol.toStringTag,{value:"Module"})),$s=({className:e,style:t,onLineChange:s,...o})=>{const{lines:r}=Re("Legend");return Re("Legend"),n.jsxRuntimeExports.jsx(Dt,{data:r,onEntryChange:s,...o})},_s=c.wrap$1("Line",({aetherKey:e,...t})=>{const[,,s]=c.use$3({aetherKey:e,type:p.Line.TYPE,schema:p.stateZ,initialState:t}),o=c.useMemoDeepEqualProps(t);return x.useLayoutEffect(()=>s(o),[o]),null}),gl=Object.freeze(Object.defineProperty({__proto__:null,Line:_s},Symbol.toStringTag,{value:"Module"})),Ot=c.wrap$1("Line",({aetherKey:e,color:t,label:s="",...o})=>{const{setLine:r,removeLine:i}=Re("Line");return x.useEffect(()=>(r({key:e,color:t,label:s}),()=>i(e)),[s,t]),n.jsxRuntimeExports.jsx(_s,{aetherKey:e,color:t,label:s,...o})}),Ns=({level:e="h2",...t})=>{const s=c.useUniqueKey(),o=c.useTypography(e),r=xt({key:s,size:(o.lineHeight+2)*o.baseSize,loc:"top",order:"first"},"Title");return n.jsxRuntimeExports.jsx(D.Space,{justify:"center",align:"center",style:r,children:n.jsxRuntimeExports.jsx(c.MaybeEditable,{...t,level:e})})},Bs=c.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=c.use$3({aetherKey:e,type:p.Tooltip.TYPE,schema:p.tooltipStateZ,initialState:{position:null}}),s=x.useRef(null),o=x.useCallback(i=>{const a=document.querySelector(".pluto-canvas-container");if(a==null)return;const u=l.To.topLeft(a);t({position:l.q.translation(u,l.q.construct(i))})},[t]),r=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",o),i.addEventListener("mouseleave",r),()=>{i.removeEventListener("mousemove",o),i.removeEventListener("mouseleave",r)}},[o]),n.jsxRuntimeExports.jsx("span",{ref:s})}),Sl=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:Bs},Symbol.toStringTag,{value:"Module"})),El={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},At=x.forwardRef(({className:e,mode:t,maskBox:s,children:o,style:r,...i},a)=>n.jsxRuntimeExports.jsxs("div",{ref:a,className:l.CSS(l.CSS.noSelect,l.CSS.BE("viewport-mask","container"),e),style:{cursor:El[t],...r},...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")}),o]}));At.displayName="ZoomPanMask";const Rl=new Set([v.d.UUID,v.d.JSON]),Cl=v.d.ALL.filter(e=>e!==v.d.UNKNOWN).map(e=>({key:e.toString(),name:Rl.has(e)?e.toString().toUpperCase():l._.capitalize(e.toString())})),yl=[{key:"name",name:"Name"}],bl=e=>n.jsxRuntimeExports.jsx(ae.DropdownButton,{...e,data:Cl,columns:yl,entryRenderKey:"name"}),vl=[{key:"x",icon:n.jsxRuntimeExports.jsx(c.j0.Arrow.Right,{})},{key:"y",icon:n.jsxRuntimeExports.jsx(c.j0.Arrow.Down,{})}],wl=({key:e,entry:t,onClick:s,selected:o})=>n.jsxRuntimeExports.jsx(c.Icon,{variant:o?"filled":"outlined",onClick:s,children:t.icon},e),Tl=({children:e=wl,...t})=>n.jsxRuntimeExports.jsx(ae.Button,{...t,allowMultiple:!1,data:vl,children:e}),zs=e=>n.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS.BE("select","clear"),variant:"outlined",...e,children:n.jsxRuntimeExports.jsx(c.j0.Close,{"aria-label":"clear"})}),ye=({onChange:e,value:t,entryRenderKey:s="key",columns:o,data:r,emptyContent:i,inputProps:a,allowNone:u=!0,searcher:d,className:j,variant:m,hideColumnHeader:f=!1,disabled:g,omit:h,children:R,dropdownVariant:E="connected",placeholder:P=dt,inputPlaceholder:M=P,triggerTooltip:$,dropdownZIndex:S,filter:C,actions:y,...T})=>{const{visible:B,open:_,close:N,toggle:b}=c.use$1(),[L,w]=x.useState(null),z=d!=null;c.useAsyncEffect(async()=>{if(c.selectValueIsZero(t))return w(null);if((L==null?void 0:L.key)===t)return;let O=null;if(z)try{[O]=await d.retrieve([t])}finally{O??(O=null)}else r!=null&&(O=r.find(ee=>ee.key===t)??null);w(O)},[d,t,r]);const V=x.useCallback((O,ee)=>{Array.isArray(O)||(w(O==null?null:ee.entries[0]),N(),e(O,ee))},[e,u]),G=x.useMemo(()=>z?c.Search:$e.Filter,[z]),I=n.jsxRuntimeExports.jsx(G,{searcher:d,filter:C,children:({onChange:O})=>n.jsxRuntimeExports.jsx(kl,{autoFocus:E==="modal",variant:m,onChange:O,onFocus:_,selected:L,entryRenderKey:s,visible:B,allowNone:u,className:j,disabled:g,placeholder:M,children:y})}),F=n.jsxRuntimeExports.jsx(c.Button,{tooltip:$,variant:"outlined",onClick:b,disabled:g,children:L!=null?Ds(s,L):P});return n.jsxRuntimeExports.jsx(ae.Core,{close:N,zIndex:S,open:_,data:r,omit:h,emptyContent:i,allowMultiple:!1,visible:B,value:t,hideColumnHeader:f,onChange:V,allowNone:u,columns:o,listItem:R,variant:E,trigger:E!=="modal"?I:F,extraDialogContent:E==="modal"?I:void 0,keepMounted:!1,...T})},dt="Select",Ds=(e,t)=>t==null?"":typeof e=="function"?e(t):t[e].toString(),kl=({entryRenderKey:e,selected:t,visible:s,onChange:o,onFocus:r,allowNone:i=!0,placeholder:a=dt,className:u,disabled:d,...j})=>{const{clear:m}=c.useSelectionUtils(),[f,g]=x.useState("");x.useEffect(()=>{if(!s){if(v.S(t==null?void 0:t.key))return g("");t!=null&&g(Ds(e,t))}},[t,s,e]);const h=M=>{o(M),g(M)},R=()=>{g(""),r==null||r()},E=M=>{s||(M.preventDefault(),r==null||r())},P=()=>{g(""),m==null||m()};return n.jsxRuntimeExports.jsx(c.Text$1,{className:l.CSS(l.CSS.BE("select","input"),u),value:f,onChange:h,onFocus:R,onKeyDown:c.matchCallback([["Enter"]],M=>{M.preventDefault(),!s&&(r==null||r())}),style:{flexGrow:1},onClick:E,placeholder:a,disabled:d,...j,children:i&&n.jsxRuntimeExports.jsx(zs,{onClick:P,disabled:d})})},Ve=({children:e="",size:t="medium",color:s,icon:o,onClose:r,className:i,onDragStart:a,...u})=>{const d=l.cssString(s);o==null&&s!=null&&(o=n.jsxRuntimeExports.jsx(c.j0.Circle,{fill:d}));const j=r==null?void 0:n.jsxRuntimeExports.jsx(c.Icon,{"aria-label":"close",size:"small",className:l.CSS.BE("tag","close"),onClick:m=>{m.stopPropagation(),r()},children:n.jsxRuntimeExports.jsx(c.j0.Close,{})});return n.jsxRuntimeExports.jsx(c.WithIcon,{startIcon:o,endIcon:j,className:l.CSS(i,l.CSS.B("tag"),r!=null&&l.CSS.BM("tag","closeable")),level:v.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:a,...u,children:e})},Pl=Object.freeze(Object.defineProperty({__proto__:null,Tag:Ve},Symbol.toStringTag,{value:"Module"})),Ne=({onChange:e,value:t,className:s,data:o,columns:r=[],entryRenderKey:i="key",emptyContent:a,searcher:u,renderTag:d=c.componentRenderProp(Os),placeholder:j,onTagDragStart:m,allowMultiple:f,allowNone:g,replaceOnSingle:h,onTagDragEnd:R,style:E,addPlaceholder:P="Add",children:M,dropdownVariant:$="connected",actions:S,...C})=>{const{visible:y,open:T,close:B}=c.use$1(),[_,N]=x.useState([]),[b,L]=x.useState(!1),w=u!=null;c.useAsyncEffect(async()=>{L(!0),c.selectValueIsZero(t)&&N([]);const F=_.map(se=>se.key),O=v.A(t);if(v.E.unorderedPrimitiveArrays(F,O)===v.E.EQUAL)return;let ee=[];if(w)try{ee=await u.retrieve(O)}finally{L(!1)}else o!=null&&(ee=o.filter(se=>O.includes(se.key)));N(ee)},[u,w,t,o]);const z=x.useCallback((F,O)=>{F!=null&&(N(O.entries),e(v.A(F),O))},[e]),V=x.useMemo(()=>w?c.Search:$e.Filter,[w]);let G,I;if($==="connected")I=n.jsxRuntimeExports.jsx(V,{searcher:u,children:({onChange:F,value:O})=>n.jsxRuntimeExports.jsx(Ll,{value:O,selectedKeys:t,className:s,onChange:F,loading:b,selected:_,onFocus:T,entryRenderKey:i,visible:y,renderTag:d,placeholder:j,onTagDragStart:m,onTagDragEnd:R,style:E,children:S})});else{const F=v.A(t);I=n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",grow:!0,style:E,size:"small",children:[F.map(O=>{const ee=_.find(se=>se.key===O);return d({key:O,entryKey:O,entryRenderKey:i,loading:b,entry:ee,onClose:()=>{const se=F.filter(qe=>qe!==O);e(se,{clicked:null,clickedIndex:-1,entries:[]})},onDragStart:se=>m==null?void 0:m(se,O),onDragEnd:se=>R==null?void 0:R(se,O)})}),F.length>0?n.jsxRuntimeExports.jsx(c.Icon,{onClick:T,children:n.jsxRuntimeExports.jsx(c.j0.Add,{style:{color:"var(--pluto-gray-l7)"}})}):n.jsxRuntimeExports.jsx(c.Button,{onClick:T,shade:7,startIcon:n.jsxRuntimeExports.jsx(c.j0.Add,{}),variant:"text",children:P})]}),G=n.jsxRuntimeExports.jsx(V,{searcher:u,children:O=>n.jsxRuntimeExports.jsx(c.Text$1,{autoFocus:!0,placeholder:"Search",...O,children:S})})}return n.jsxRuntimeExports.jsx(ae.Core,{close:B,open:T,data:o,emptyContent:a,visible:y,value:t,onChange:z,allowNone:g,replaceOnSingle:h,columns:r,allowMultiple:!0,listItem:M,trigger:I,extraDialogContent:G,variant:$,...C})},Ll=({selectedKeys:e,loading:t,selected:s,onChange:o,onFocus:r,visible:i,entryRenderKey:a,renderTag:u,placeholder:d=dt,onTagDragStart:j,onTagDragEnd:m,value:f,className:g,children:h,...R})=>{const{onSelect:E,clear:P}=c.useSelectionUtils(),M=x.useRef(null);x.useLayoutEffect(()=>{var y;i&&((y=M.current)==null||y.focus())},[i,s]);const $=()=>{i||o(""),r==null||r()},S=()=>{i||r==null||r()},C=()=>{i||o("")};return n.jsxRuntimeExports.jsxs(c.Text$1,{ref:M,className:l.CSS(l.CSS.BE("select-multiple","input"),l.CSS.visible(i),g),onBlur:C,placeholder:d,value:f,onChange:o,onFocus:$,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:S,...R,children:[n.jsxRuntimeExports.jsx(D.Space,{direction:"x",className:l.CSS.BE("select-multiple","tags"),align:"center",grow:!0,size:"small",children:v.A(e).map(y=>{const T=s.find(B=>B.key===y);return u({key:y,entryKey:y,entryRenderKey:a,loading:t,entry:T,onClose:()=>E==null?void 0:E(y),onDragStart:B=>j==null?void 0:j(B,y),onDragEnd:B=>m==null?void 0:m(B,y)})})}),h,n.jsxRuntimeExports.jsx(zs,{onClick:P})]})},Os=({entryKey:e,entryRenderKey:t,entry:s,loading:o,...r})=>{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&&!o&&l.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...r,key:e.toString()},v.L(i))},Ml=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:ae.BaseButton,Button:ae.Button,DEFAULT_PLACEHOLDER:dt,DataType:bl,Direction:Tl,DropdownButton:ae.DropdownButton,Multiple:Ne,MultipleTag:Os,Single:ye,defaultButton:ae.defaultButton},Symbol.toStringTag,{value:"Module"})),Ue=6,$l=2,rs=5,_l=e=>l.To.width(e)<rs&&l.To.height(e)<rs,Nl=["zoom","pan","select","zoomReset"],Ae=[...Nl,"click"],Bl=le.z.enum(Ae),As=["zoom","select"],We={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},Vs={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},Is={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},Vt={zoom:We,pan:Vs,select:Is,zoomReset:We,click:We},zl=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([s,o])=>s==="defaultMode"?[s,o]:[s,o.map(r=>r.filter(i=>i!=="MouseLeft")).filter(r=>r.length>0)]))},Dl=l.To.construct(0,0,1,1,l.J.TOP_LEFT),Ol={width:30,height:50},Zs=({onChange:e,triggers:t,initial:s=Dl,threshold:o=Ol,ref:r})=>{const i=(t==null?void 0:t.defaultMode)??"zoom",[a,u]=x.useState(l.To.ZERO),[d,j]=x.useState(i),[m,f]=c.useStateRef(s),g=x.useRef(l.q.ZERO),h=x.useRef(null),R=l._$1.construct(o);x.useEffect(()=>f(()=>l.To.truncate(s,Ue)),[s]),x.useEffect(()=>j(i),[i]);const[E,P,M,$]=c.useMemoCompare(()=>{const _={...Vt[i],...t},N=c.flattenConfig(_),b=zl(_);return[_,N,b,c.flattenConfig(b)]},c.compareModeConfigs,[t]),S=x.useCallback(({box:_,triggers:N,stage:b,cursor:L})=>{if(h.current==null)return;const w=c.determineMode(E,N),z=l.To.construct(h.current);if(w==null)return;if(w==="zoomReset")return u(l.To.ZERO),e==null||e({box:l.To.DECIMAL,mode:w,stage:b,cursor:L}),f(l.To.DECIMAL);const V=_l(_);if(b==="end"){if(V){w==="zoom"&&u(l.To.ZERO),e==null||e({box:m.current,mode:"click",stage:b,cursor:L});return}return f(I=>{if(w==="pan"){const O=os(_,I,z);return O===null||l.To.equals(O,I)?I:(e==null||e({box:O,mode:w,stage:b,cursor:L}),O)}const F=C(_,I,z);return F===null?I:(e==null||e({box:F,mode:w,stage:b,cursor:L}),w==="zoom"?(u(l.To.ZERO),F):l.To.truncate(I,Ue))})}if(As.includes(w))return V?void 0:u(l.k.XY.scale(z).clamp(z).translate({x:-l.To.left(z),y:-l.To.top(z)}).box(ls(R,_,z)));if(u(I=>l.To.areaIsZero(I)?I:l.To.ZERO),l.q.distance(L,g.current)<$l)return;g.current=L;const G=os(_,m.current,z);e==null||e({box:G,mode:w,stage:b,cursor:L})},[u,j,e,E,o.height,o.width,f,h]);x.useImperativeHandle(r,()=>({reset:()=>{u(l.To.ZERO),f(l.To.DECIMAL),e==null||e({box:l.To.DECIMAL,mode:"zoomReset",stage:"start",cursor:l.q.ZERO})}}),[e]);const C=x.useCallback((_,N,b)=>l.To.truncate(Ct(N,b).box(ls(R,_,b)),Ue),[o]),y=c.useHeldRef({triggers:[["Control"]]}),T=c.useHeldRef({triggers:[["Alt"]]});x.useEffect(()=>{const _=N=>{if(h.current==null)return;let b=1;N.deltaY<0?b-=.035:b+=.035;const L=l.To.construct(h.current),w=l.q.construct(N);if(!l.To.contains(L,w)||N.target!==h.current)return;const V=Ct(m.current,l.To.construct(h.current)).pos(l.q.construct(N));let I=l.k.XY.magnify({x:y.current.held?1:b,y:T.current.held?1:b}).box(m.current);I=l.To.translate(I,{x:y.current.held?0:V.x*(1-b),y:T.current.held?0:V.y*(1-b)}),f(I),e==null||e({stage:"end",box:I,cursor:l.q.construct(N),mode:"zoom"})};return window.addEventListener("wheel",_),()=>window.removeEventListener("wheel",_)},[f,e]),Pt.useDrag({bound:h,onDrag:S,triggers:P,loose:!0});const B=x.useCallback(({triggers:_,stage:N})=>{if(N==="end")return j(i);const b=c.determineMode(M,_);b!=null&&j(b)},[M,i,e]);return c.use$2({triggers:$,callback:B,region:h}),{maskBox:a,ref:h,mode:d}},Ct=(e,t)=>l.k.XY.scale(t).clamp(t).scale(e),os=(e,t,s)=>{let o=l.To.signedDims(Ct(t,s).box(e));return o={signedWidth:-o.signedWidth,signedHeight:-o.signedHeight},l.To.truncate(l.k.XY.translate(l.q.construct(o)).box(t),Ue)},ls=(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,Al=({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(Pt.Text,{trigger:t[0],level:"small"})]}),Vl={zoom:n.jsxRuntimeExports.jsx(c.j0.Zoom,{}),pan:n.jsxRuntimeExports.jsx(c.j0.Pan,{}),select:n.jsxRuntimeExports.jsx(c.j0.Selection,{}),zoomReset:n.jsxRuntimeExports.jsx(c.j0.Expand,{}),click:n.jsxRuntimeExports.jsx(c.j0.Bolt,{})},Il=({triggers:e,disable:t=["zoomReset","click"],...s})=>{const o=Object.entries(e).filter(([r])=>!t.includes(r)&&Ae.includes(r)).map(([r,i])=>({key:r,icon:Vl[r],tooltip:n.jsxRuntimeExports.jsx(Al,{mode:r,triggers:i})})).sort((r,i)=>Ae.indexOf(r.key)-Ae.indexOf(i.key));return n.jsxRuntimeExports.jsx(ae.Button,{...s,data:o,entryRenderKey:"icon",children:({title:r,entry:i,...a})=>x.createElement(c.Icon,{...a,key:i.key,variant:a.selected?"filled":"text",size:"medium",tooltip:i.tooltip,tooltipLocation:{x:"right",y:"top"}},i.icon)})},Zl=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:Vt,MASK_MODES:As,MODES:Ae,Mask:At,PAN_DEFAULT_TRIGGERS:Vs,SELECT_DEFAULT_TRIGGERS:Is,SelectMode:Il,ZOOM_DEFAULT_TRIGGERS:We,modeZ:Bl,use:Zs},Symbol.toStringTag,{value:"Module"})),Fs=e=>e==null?null:document.querySelectorAll(".pluto-line-plot__viewport")[0]??null,It=x.forwardRef(({children:e,initial:t=l.To.DECIMAL,onChange:s,...o},r)=>{const{setViewport:i}=Re("Viewport");x.useLayoutEffect(()=>{i({box:t,mode:"zoom",cursor:l.q.ZERO,stage:"start"})},[i,t]);const a=x.useCallback(d=>{i(d),s==null||s(d)},[s,i]),u=Zs({onChange:a,initial:t,ref:r,...o});return n.jsxRuntimeExports.jsx(At,{className:l.CSS.BE("line-plot","viewport"),...u,children:e})});It.displayName="Viewport";const Fl=Object.freeze(Object.defineProperty({__proto__:null,Legend:$s,Line:Ot,LinePlot:Ts,Title:Ns,Tooltip:Sl,Viewport:It,XAxis:ks,YAxis:Ps,axisFactory:Bt,selectViewportEl:Fs,useContext:Re,useGridEntry:xt,useViewport:ws},Symbol.toStringTag,{value:"Module"})),ql=c.wrap$1("Tooltip",({aetherKey:e,...t})=>(c.use$3({aetherKey:e,type:p.Annotation.TYPE,schema:p.annotationStateZ,initialState:t}),null)),qs=c.wrap$1("Annotation.Provider",({aetherKey:e,menu:t,...s})=>{const{setViewport:o,setHold:r}=Re("Range.Provider"),[,{hovered:i,count:a},u]=c.use$3({aetherKey:e,type:p.Provider$1.TYPE,schema:p.providerStateZ,initialState:{...s,cursor:null,hovered:null,count:0}}),d=xt({key:e,loc:"top",size:a>0?32:0,order:"last"},"Annotation.Provider"),j=c.useContextMenu(),m=c.useSyncedRef(j.visible),f=x.useCallback(g=>{const h=E=>{u(P=>({...P,cursor:{x:E.clientX,y:E.clientY}}))},R=g.currentTarget;R.addEventListener("mousemove",h),R.addEventListener("mouseleave",()=>{R.removeEventListener("mousemove",h),m.current||u(E=>({...E,cursor:null}))},{once:!0})},[u]);return n.jsxRuntimeExports.jsx(c.ContextMenu,{style:{...d,cursor:i!=null?"pointer":"default"},...j,menu:()=>t==null||i==null?null:t(i),children:n.jsxRuntimeExports.jsx(D.Space,{style:{width:"100%",height:"100%"},onClick:()=>{i!=null&&(o({box:l.To.construct({x:i.viewport.lower,y:0},{x:i.viewport.upper,y:1}),mode:"zoom",cursor:l.q.ZERO,stage:"start"}),r(!0))},onMouseEnter:f})})}),Yl=Object.freeze(Object.defineProperty({__proto__:null,Annotation:ql,Provider:qs},Symbol.toStringTag,{value:"Module"})),Ys={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},Hl=c.flattenConfig(Ys),Hs=c.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=c.use$3({aetherKey:e,type:p.Measure.TYPE,schema:p.measureStateZ,initialState:{hover:null,one:null,two:null}}),s=x.useRef(null),o=c.useHeldRef({triggers:Hl,loose:!0}),r=x.useCallback(({mode:u,cursor:d})=>{if(u==="click"){const j=c.determineMode(Ys,o.current.triggers,!0);if(["one","two"].includes(j))return t(m=>({...m,[j]:d}));t(j==="clear"?m=>({...m,one:null,two:null}):m=>({...m,one:m.one??d,two:m.one!==null?d:m.two}))}},[t,o]);ws(r);const i=x.useCallback(u=>t(d=>({...d,hover:l.q.construct(u)})),[t]),a=x.useCallback(()=>{t(u=>({...u,hover:null}))},[t]);return x.useEffect(()=>{if(s.current===null)return;const u=s.current.parentElement;if(u!=null)return u.addEventListener("mousemove",i),u.addEventListener("mouseleave",a),()=>{u.removeEventListener("mousemove",i),u.removeEventListener("mouseleave",a)}},[r]),n.jsxRuntimeExports.jsx("span",{ref:s})}),Gl=Object.freeze(Object.defineProperty({__proto__:null,Measure:Hs},Symbol.toStringTag,{value:"Module"})),Zt=c.wrap$1("Rule",({aetherKey:e,label:t,position:s,onLabelChange:o,onPositionChange:r,units:i="",color:a,lineWidth:u,lineDash:d})=>{const[j,m]=v.usePurePassthrough({value:t,onChange:o,initial:""}),[,{position:f,pixelPosition:g},h]=c.use$3({aetherKey:e,type:p.Rule.TYPE,schema:p.ruleStateZ,initialState:{color:a,dragging:!1,position:s,lineWidth:u,lineDash:d}});x.useEffect(()=>{if(f==null)return;if(s==null)return r==null?void 0:r(f);const C=l.R.construct(f+.01,f-.01);s!=null&&!l.R.contains(C,s)&&(r==null||r(Math.trunc(f*100)/100))},[f]);const R=x.useRef(g);g!==R.current&&(R.current=g);const E=x.useRef(g);x.useEffect(()=>{h(C=>({...C,position:s,color:a,lineWidth:u,lineDash:d}))},[s,a,u,d]);const P=ct({onStart:x.useCallback(()=>{h(C=>({...C,dragging:!0})),E.current=R.current},[]),onMove:C=>{h(y=>({...y,pixelPosition:(E.current??0)+l.To.signedHeight(C)}))},onEnd:x.useCallback(()=>{h(C=>({...C,dragging:!1})),E.current=g},[])}),M=x.useRef(null);if(f==null||g==null)return null;const $=Fs(M==null?void 0:M.current),S=n.jsxRuntimeExports.jsxs("div",{ref:M,className:l.CSS.B("rule"),style:{top:`calc(${g}px - 0.5rem)`},children:[n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("rule","drag-handle"),onDragStart:P,draggable:!0}),n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",style:{marginLeft:"2rem"},children:[n.jsxRuntimeExports.jsx(c.Editable,{level:"p",value:j,onChange:m}),n.jsxRuntimeExports.jsx(c.Text,{level:"p",style:{padding:"0.25rem 0",width:"fit-content"},children:`${f.toFixed(2)} ${i}`})]})]});return $==null?S:Lt.createPortal(S,$)}),Ul=Object.freeze(Object.defineProperty({__proto__:null,Rule:Zt},Symbol.toStringTag,{value:"Module"})),Gs=c.canDropOfType(Se),Wl=({lines:e,axes:t,showTitle:s=!0,title:o="",onTitleChange:r,showLegend:i=!0,legendPosition:a,onLegendPositionChange:u,titleLevel:d="h4",onLineChange:j,onRuleChange:m,onAxisChannelDrop:f,onAxisChange:g,rules:h,enableTooltip:R=!0,enableMeasure:E=!1,initialViewport:P=l.To.DECIMAL,onViewportChange:M,viewportTriggers:$,annotationProvider:S,...C})=>{var N;const y=t.filter(({location:b})=>l.J.isY(b)),T=x.useRef(),B=c.usePrevious(e.length),_=c.usePrevious(C.hold);return(B===0&&e.length!==0||_===!0&&C.hold===!1)&&((N=T.current)==null||N.reset()),n.jsxRuntimeExports.jsxs(Ts,{...C,children:[y.map((b,L)=>{const w=e.filter(G=>G.axes.x===b.key),z=t.filter(({location:G})=>l.J.isX(G)),V=h==null?void 0:h.filter(G=>[...z.map(({key:I})=>I),b.key].includes(G.axis));return n.jsxRuntimeExports.jsx(Xl,{axis:b,index:L,lines:w,yAxes:z,rules:V,onAxisChannelDrop:f,onAxisChange:g,annotationProvider:S},b.key)}),i&&n.jsxRuntimeExports.jsx($s,{onLineChange:j,position:a,onPositionChange:u}),s&&n.jsxRuntimeExports.jsx(Ns,{value:o,onChange:r,level:d}),n.jsxRuntimeExports.jsxs(It,{initial:P,onChange:M,triggers:$,ref:T,children:[R&&n.jsxRuntimeExports.jsx(Bs,{}),E&&n.jsxRuntimeExports.jsx(Hs,{})]})]})},Xl=({yAxes:e,lines:t,index:s,rules:o,onRuleChange:r,onAxisChannelDrop:i,onAxisChange:a,axis:{location:u,key:d,showGrid:j,...m},annotationProvider:f})=>{const g=c.useDrop({type:"Channel.LinePlot.XAxis",canDrop:Gs,onDrop:x.useCallback(({items:E})=>{const P=c.filterByType(Se,E);return i==null||i(d,P.map(({key:M})=>M)),P},[d,i])}),h=o==null?void 0:o.filter(E=>E.axis===d),R=c.useDraggingState();return n.jsxRuntimeExports.jsxs(ks,{...m,...g,location:u,showGrid:j??s===0,className:l.CSS(l.CSS.dropRegion(c.canDropOfType(Se)(R))),onAutoBoundsChange:E=>a==null?void 0:a({key:d,bounds:E}),children:[e.map((E,P)=>{const M=t.filter(S=>S.axes.y===E.key),$=o==null?void 0:o.filter(S=>S.axis===E.key);return n.jsxRuntimeExports.jsx(Jl,{axis:{...E,showGrid:j??(s===0&&P===0)},lines:M,rules:$,onRuleChange:r,onAxisChannelDrop:i,onAxisChange:a},E.key)}),h==null?void 0:h.map(E=>x.createElement(Zt,{aetherKey:E.key,...E,key:E.key,onLabelChange:P=>r==null?void 0:r({key:E.key,label:P}),onPositionChange:P=>r==null?void 0:r({key:E.key,position:P})})),n.jsxRuntimeExports.jsx(qs,{...f})]})},Kl=({channels:{x:e,y:t}})=>`${e??0}-${t}`,Jl=({lines:e,rules:t,onRuleChange:s,onAxisChannelDrop:o,onAxisChange:r,axis:{key:i,location:a,...u}})=>{const d=c.useDrop({type:"Channel.LinePlot.YAxis",canDrop:Gs,onDrop:x.useCallback(({items:m})=>{const f=c.filterByType(Se,m);return o==null||o(i,f.map(({key:g})=>g)),f},[i,o])}),j=c.useDraggingState();return n.jsxRuntimeExports.jsxs(Ps,{...u,...d,location:a,className:l.CSS(l.CSS.dropRegion(c.canDropOfType(Se)(j))),onAutoBoundsChange:m=>r==null?void 0:r({key:i,bounds:m}),children:[e.map(m=>n.jsxRuntimeExports.jsx(Ql,{line:m},Kl(m))),t==null?void 0:t.map(m=>x.createElement(Zt,{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})}))]})},Ql=({line:e})=>e.variant==="static"?n.jsxRuntimeExports.jsx(ti,{line:e}):n.jsxRuntimeExports.jsx(ei,{line:e}),ei=({line:{key:e,timeSpan:t,channels:{x:s,y:o},...r}})=>{const i=Number(t.valueOf())*3,a=p.streamChannelData({timeSpan:t,channel:o,keepFor:i}),u=s!=null&&s!==0,d=p.streamChannelData({timeSpan:t,channel:u?s:o,useIndexOfChannel:!u,keepFor:i});return n.jsxRuntimeExports.jsx(Ot,{aetherKey:e,y:a,x:d,...r})},ti=({line:{timeRange:e,key:t,channels:{x:s,y:o},...r}})=>{const i=p.channelData({timeRange:e,channel:o}),a=s!=null&&s!==0,u=p.channelData({timeRange:e,channel:a?s:o,useIndexOfChannel:!a});return n.jsxRuntimeExports.jsx(Ot,{aetherKey:t,y:i,x:u,...r})},is=[{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"}],Ke=({items:e},t)=>{const s=c.filterByType(Se,e);return s.length>0&&!s.every(o=>t.includes(o.key))},Us=["name","alias"],Ws=e=>{const t=at();return x.useMemo(()=>e.length===0?is:is.filter(s=>e.includes(s.key)),[e,t])},si=({columns:e=Us,onChange:t,className:s,value:o,searchOptions:r,...i})=>{const a=fe(),u=at(),d=Ws(e),j=_t(),m=c.useMemoDeepEqualProps(r),f=x.useMemo(()=>a==null?void 0:a.channels.newSearcherWithOptions({rangeKey:j,internal:!1,...m}),[a,j,m]),g=a!=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(C=>Ke(C,v.A(o)),[o]),onDrop:x.useCallback(({items:C})=>{const y=c.filterByType(Se,C);if(y.length===0)return[];const T=v.n([...v.A(o),...y.map(B=>B.key)]);return t(T,{clickedIndex:null,clicked:null,entries:[]}),y},[t,o])}),P=c.useDraggingState(),M=x.useCallback(({dropped:C})=>{t(v.A(o).filter(y=>!C.some(T=>T.key===y)),{clickedIndex:null,clicked:null,entries:[]})},[t,o]),$=x.useCallback((C,y)=>h([{key:y,type:Se}],M),[h,M]),S=x.useCallback(C=>u[C.key]??C.name,[u]);return n.jsxRuntimeExports.jsx(Ne,{className:l.CSS(s,l.CSS.dropRegion(Ke(P,v.A(o)))),value:o,onTagDragStart:$,onTagDragEnd:R,searcher:f,onChange:t,columns:d,emptyContent:g,entryRenderKey:S,...E,...i})},Ce=({columns:e=Us,onChange:t,value:s,className:o,data:r,searchOptions:i,...a})=>{const u=fe(),d=at(),j=Ws(e),m=_t(),f=c.useMemoDeepEqualProps(i),g=x.useMemo(()=>{if(!(r!=null&&r.length>0))return u==null?void 0:u.channels.newSearcherWithOptions({rangeKey:m,internal:!1,...f})},[u,m,r==null?void 0:r.length,f]),h=u!=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:P,onDragEnd:M,...$}=c.useDragAndDrop({type:"Channel.SelectSingle",canDrop:x.useCallback(T=>Ke(T,v.o(s)),[s]),onDrop:x.useCallback(({items:T})=>{const B=c.filterByType(Se,T);return B.length===0?[]:(t(B[0].key,{clickedIndex:null,clicked:null,entries:[]}),B)},[E,t])}),S=c.useDraggingState(),C=x.useCallback(()=>s!=null&&P([{type:Se,key:s}]),[P,s]),y=x.useCallback(T=>d[T.key]??T.name,[d]);return n.jsxRuntimeExports.jsx(ye,{data:r,className:l.CSS(o,l.CSS.dropRegion(Ke(S,v.o(s)))),value:s,onDragStart:C,onDragEnd:M,onChange:t,searcher:g,columns:j,emptyContent:h,entryRenderKey:y,...$,...a})},ni=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:el,AliasProvider:ys,LinePlot:Wl,SelectMultiple:si,SelectSingle:Ce,useActiveRange:_t,useAlias:Cs,useAliases:at,useContext:Rs,useName:ut},Symbol.toStringTag,{value:"Module"})),Xs=e=>v.c(e,(t,s,o)=>{const r=s===o.length-1,i=!isNaN(parseInt(t)),a=!isNaN(parseInt(o[s+1]));return i&&(t="element"),r||a?t:[t,"shape"]}),cs=(e,t)=>{if(e==null)return null;const s=e[t];return s==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:s},ri=(e,t,s)=>v.u(cs(e,"shape"),Xs(t),{...s,getter:cs}),oi=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:ri,getFieldSchemaPath:Xs},Symbol.toStringTag,{value:"Module"})),Te=({path:e,optional:t=!1,onChange:s})=>{const o=be(),{get:r,bind:i,set:a,setStatus:u}=o,[d,j]=x.useState(r(e,{optional:t}));x.useEffect(()=>(j(r(e,{optional:t})),i({path:e,onChange:j,listenToChildren:!1})),[e,s,i,r]);const m=x.useCallback(g=>{s==null||s(g,{...o,path:e}),a(e,g)},[e,a,s]),f=x.useCallback(g=>u(e,g),[e,u]);if(d==null){if(!t)throw new Error(`Field state is null: ${e}`);return null}return{onChange:m,setStatus:f,...d}},Ks=(e,t=!1,s)=>{const{get:o,bind:r}=be(s),[,i]=x.useState(0);return x.useEffect(()=>(i(a=>a+1),r({path:e,onChange:()=>i(a=>a+1)})),[e,r]),o(e,{optional:t})??null},li=(e,t=!1,s)=>{var a;const{get:o,bind:r}=be(s),[,i]=x.useState(0);return x.useEffect(()=>(i(u=>u+1),r({path:e,onChange:()=>i(u=>u+1)})),[e,r]),((a=o(e,{optional:t}))==null?void 0:a.value)??null},ii=e=>{var t,s;return((s=(t=Ks(e,!0))==null?void 0:t.status)==null?void 0:s.variant)==="success"},ci=({path:e,ctx:t,onChange:s})=>{const o=be(t);x.useEffect(()=>o.bind({path:e,onChange:r=>s(r,o),listenToChildren:!1}),[e,o])},ai=({path:e,optional:t=!1})=>{const{bind:s,get:o}=be(),[r,i]=x.useState(o(e,{optional:t}));if(x.useEffect(()=>(i(o(e,{optional:t})),s({path:e,onChange:a=>i({...a,value:v.C(a.value)}),listenToChildren:!0})),[e,s,o]),r==null&&!t)throw new Error("Field state is null");return(r==null?void 0:r.value)??null},Js=(e,t)=>({add:(s,o)=>{const r=v.C(e.get(t).value);r.splice(o,0,...v.A(s)),e.set(t,r,{validateChildren:!1})},push:(s,o)=>{const r=v.C(e.get(t).value);r.push(...v.A(s)),o!=null&&r.sort(o),e.set(t,r,{validateChildren:!1})},remove:s=>{const o=e.get(t).value,r=new Set(v.A(s));e.set(t,o.filter((i,a)=>!r.has(a)))},keepOnly:s=>{const o=e.get(t).value,r=new Set(v.A(s));e.set(t,o.filter((i,a)=>r.has(a)))},set:s=>e.set(t,v.executeSetter(s,e.get(t).value)),sort:s=>{const o=v.C(e.get(t).value);o.sort(s),e.set(t,o)}}),ui=({path:e,updateOnChildren:t=!1,ctx:s})=>{const o=be(s),{bind:r,get:i}=o,[a,u]=x.useState(i(e).value);return x.useEffect(()=>(u(i(e).value),r({path:e,onChange:d=>{u(v.C(d.value))},listenToChildren:t})),[e,r,i,u]),x.useMemo(()=>({value:a,...Js(o,e)}),[a,o,e])},Ft=x.createContext({bind:()=>()=>{},set:()=>{},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(Ft);return e??t},as=e=>({key:e,variant:"success",message:""}),xi=e=>e.code===le.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",Qs=({values:e,sync:t=!1,schema:s,onChange:o})=>{const r=x.useRef({state:e,statuses:new Map,touched:new Set,listeners:new Map,parentListeners:new Map}),i=c.useSyncedRef(s),a=c.useSyncedRef(o),u=x.useCallback(({path:S,onChange:C,listenToChildren:y=!1})=>{var N;const{parentListeners:T,listeners:B}=r.current,_=y?T:B;return _.has(S)||_.set(S,new Set),(N=_.get(S))==null||N.add(C),()=>{var b;return(b=_.get(S))==null?void 0:b.delete(C)}},[]),d=x.useCallback((S,{optional:C}={optional:!1})=>{const{state:y,statuses:T,touched:B}=r.current,_=v._.get(y,S,{optional:C});if(_==null)return null;const N={value:_,status:T.get(S)??as(S),touched:B.has(S),required:!1};if(i.current==null)return N;const b=i.current,L=oi.getFieldSchema(b,S,{optional:!0});return L==null||(N.required=!L.isOptional()),N},[]),j=x.useCallback(S=>{const{state:C,statuses:y,touched:T,listeners:B,parentListeners:_}=r.current;v._.remove(C,S),y.delete(S),T.delete(S),B.delete(S),_.delete(S)},[]),m=x.useCallback(S=>{var T;const{listeners:C}=r.current,y=d(S,{optional:!0});y!=null&&((T=C.get(S))==null||T.forEach(B=>B(y)))},[]),f=x.useCallback(S=>{const{listeners:C,parentListeners:y}=r.current,T=C.get(S);if(S==""&&([...C.keys()].forEach(N=>{var L;const b=d(N,{optional:!0});b!=null&&((L=C.get(N))==null||L.forEach(w=>{w(b)}))}),[...y.keys()].forEach(N=>{var L;const b=d(N,{optional:!0});b!=null&&((L=y.get(N))==null||L.forEach(w=>{w(b)}))})),T!=null){const B=d(S,{optional:!0});B!=null&&T.forEach(_=>{_(B)})}y.forEach((B,_)=>{if(v._.pathsMatch(S,_)){const b=d(_,{optional:!0});b!=null&&B.forEach(L=>{L(b)})}})},[]),g=x.useCallback((S,C="",y=!0)=>{const{statuses:T,listeners:B,touched:_}=r.current;if(S.success){const w=[...T.keys()];return T.clear(),w.forEach(z=>m(z)),!0}let N=!0;const b=new Set(S.error.issues.map(w=>w.path.join(".")));let L=(w,z)=>w===z;return y&&(L=(w,z)=>v._.pathsMatch(w,z)),S.error.issues.forEach(w=>{var F;const{message:z}=w,V=w.path.join(".");if(!L(V,C))return;const G=xi(w);G!=="warning"&&(N=!1),T.set(V,{key:V,variant:G,message:z}),_.add(V);let I=d(V,{optional:!0});I==null&&(I={value:void 0,status:T.get(V)??as(V),touched:!1,required:!1}),(F=B.get(V))==null||F.forEach(O=>O(I))}),T.forEach((w,z)=>{b.has(z)||(T.delete(z),m(z))}),N},[]),h=x.useCallback((S,C)=>{if(i.current==null)return!0;const{state:y}=r.current,T=i.current.safeParse(y);return g(T,S,C)},[g]),R=x.useCallback(async(S,C)=>{if(i.current==null)return!0;const{state:y}=r.current,T=await i.current.safeParseAsync(y);return g(T,S,C)},[g]),E=x.useCallback((S,C,y={})=>{const T=v._.get(r.current.state,S,{optional:!0}),{validateChildren:B=!0}=y,{state:_,touched:N}=r.current;N.add(S),S.length===0?r.current.state=C:v._.set(_,S,C),f(S),(async()=>{var L;let b;try{b=h(S,B)}catch{b=await R(S,B)}(L=a.current)==null||L.call(a,{values:r.current.state,path:S,prev:T,valid:b})})()},[]),P=x.useCallback(S=>v._.has(r.current.state,S),[]),M=x.useCallback((S,C)=>{r.current.statuses.set(S,C),r.current.touched.add(S),m(S)},[]),$=x.useCallback(()=>{const{statuses:S}=r.current;S.clear(),S.forEach((C,y)=>m(y))},[]);return x.useEffect(()=>{if(!t)return;const{listeners:S}=r.current;r.current.state=e,S.forEach((C,y)=>{const T=d(y,{optional:!0});T!=null&&C.forEach(B=>B(T))})},[t,e]),x.useMemo(()=>({bind:u,set:E,get:d,validate:h,validateAsync:R,value:()=>r.current.state,has:P,remove:j,setStatus:M,clearStatuses:$}),[])},di=e=>n.jsxRuntimeExports.jsx(Ft.Provider,{value:e,children:e.children}),mi=c.componentRenderProp(c.Text$1),je=({path:e,children:t=mi,label:s,padHelpText:o=!0,visible:r=!0,hideIfNull:i=!1,optional:a,onChange:u,className:d,...j})=>{const m=Te({path:e,optional:a??i,onChange:u}),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(v._.element(e,-1))),r=typeof r=="function"?r(m,f):r,!r)return null;const g=m.status.message,{onChange:h,value:R}=m;return n.jsxRuntimeExports.jsx(me.Item,{padHelpText:o,helpText:g,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)),...j,children:t({onChange:h,value:R})})},ke=e=>({fieldKey:t,fieldProps:s,inputProps:o})=>{const r=({inputProps:i,path:a,fieldKey:u=t,...d})=>n.jsxRuntimeExports.jsx(je,{...s,...d,path:u?`${a}.${u}`:a,children:j=>n.jsxRuntimeExports.jsx(e,{...j,...o,...i})});return r.displayName=e.displayName,r},en=ke(c.Numeric),pi=en({}),tn=ke(c.Text$1),ji=tn({}),sn=ke(c.Switch$1),fi=sn({}),hi=ke(ye),gi=ke(Ne),Si=ke(ae.DropdownButton),qt=({key:e,open:t,onChange:s})=>{const o=c.useMemoPrimitiveArray(e);c.useAsyncEffect(async()=>{if(t==null)return;const r=await t();if(r!=null)return r.onChange(s),async()=>await r.close()},[t==null,o])},Ei=({fetchInitialValue:e,...t})=>{const[s,o]=x.useState(void 0);return c.useAsyncEffect(async()=>{o(await e())},[e]),qt({...t,onChange:o}),s},Ri=Object.freeze(Object.defineProperty({__proto__:null,useListener:qt,useState:Ei},Symbol.toStringTag,{value:"Module"})),Ci=({key:e,name:t,queryFn:s,values:o,openObservable:r,applyChanges:i,applyObservable:a,...u})=>{const d=fe(),j=c.useAggregator(),m=c.useMemoPrimitiveArray(e),f=Qs({values:o,...u,sync:!1,onChange:R=>{d!=null&&(async()=>{try{await(i==null?void 0:i({...R,client:d}))}catch(E){j({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){j({variant:"error",message:`Failed to retrieve ${t}`,description:R.message})}},[m,d==null?void 0:d.key]);const g=x.useCallback(async()=>{if(d!=null)return await(r==null?void 0:r(d))},[m,d==null?void 0:d.key]),h=x.useCallback(R=>a==null?void 0:a({changes:R,ctx:f}),[m,a]);return qt({key:m,open:g,onChange:h}),f},yi=Object.freeze(Object.defineProperty({__proto__:null,Context:Ft,Field:je,Form:di,NumericField:pi,SwitchField:fi,TextField:ji,buildDropdownButtonSelectField:Si,buildNumericField:en,buildSelectMultiField:gi,buildSelectSingleField:hi,buildSwitchField:sn,buildTextField:tn,fieldArrayUtils:Js,fieldBuilder:ke,use:Qs,useChildFieldValues:ai,useContext:be,useField:Te,useFieldArray:ui,useFieldListener:ci,useFieldState:Ks,useFieldValid:ii,useFieldValue:li,useSynced:Ci},Symbol.toStringTag,{value:"Module"})),bi=[{key:"name",name:"Name"},{key:"location",name:"Location"}],vi=({searchOptions:e,...t})=>{const s=fe();let o=s==null?void 0:s.hardware.devices;return e!=null&&s!=null&&(o=s.hardware.devices.newSearcherWithOptions(e)),n.jsxRuntimeExports.jsx(ye,{columns:bi,searcher:o,entryRenderKey:"name",...t})},wi=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:vi},Symbol.toStringTag,{value:"Module"})),Ye=(e,t)=>x.cloneElement(e,{className:l.CSS(e.props.className,l.CSS.B("sub"),l.CSS.M(t))}),nn=({topRight:e,topLeft:t,bottomLeft:s,bottomRight:o,children:r,className:i,...a})=>n.jsxRuntimeExports.jsxs("div",{className:l.CSS(i,l.CSS.B("icon")),...a,children:[e&&Ye(e,"topRight"),t&&Ye(t,"topLeft"),s&&Ye(s,"bottomLeft"),o&&Ye(o,"bottomRight"),r]}),Ti=e=>n.jsxRuntimeExports.jsx(nn,{topRight:n.jsxRuntimeExports.jsx(c.j0.Add,{}),...e}),ki=Object.freeze(Object.defineProperty({__proto__:null,Create:Ti,Icon:nn},Symbol.toStringTag,{value:"Module"})),Le="label",Yt=[{key:"color",name:"Color",render:({entry:e})=>n.jsxRuntimeExports.jsx(c.j0.Circle,{name:"circle",color:e.color,style:{height:"2.5rem",width:"2.5rem"}})},{key:"name",name:"Name"}],Je=({items:e},t)=>{const s=c.filterByType(Le,e);return s.length>0&&!s.every(o=>t.includes(o.key))},Pi=({entry:e,loading:t,entryKey:s,entryRenderKey:o,...r})=>n.jsxRuntimeExports.jsx(Ve,{color:e==null?void 0:e.color,...r,children:e==null?void 0:e.name}),Li=c.componentRenderProp(Pi),Mi=({onChange:e,className:t,value:s,...o})=>{const r=fe(),i=r!=null?void 0:n.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:a,onDragEnd:u,...d}=c.useDragAndDrop({type:"Label.SelectMultiple",canDrop:x.useCallback(g=>Je(g,v.A(s)),[s]),onDrop:x.useCallback(({items:g})=>{const h=c.filterByType(Le,g);if(h.length===0)return[];const R=v.n([...v.A(s),...h.map(E=>E.key)]);return e(R,{clickedIndex:null,clicked:null,entries:[]}),h},[e,s])}),j=c.useDraggingState(),m=x.useCallback(({dropped:g})=>{e(v.A(s).filter(h=>!g.some(R=>R.key===h)),{clickedIndex:null,clicked:null,entries:[]})},[e,s]),f=x.useCallback((g,h)=>a([{key:h,type:Le}],m),[a,m]);return n.jsxRuntimeExports.jsx(Ne,{className:l.CSS(t,l.CSS.dropRegion(Je(j,v.A(s)))),value:s,onTagDragStart:f,onTagDragEnd:u,searcher:r==null?void 0:r.labels,onChange:e,columns:Yt,emptyContent:i,renderTag:Li,addPlaceholder:"Label",...d,...o})},rn=({value:e,onChange:t})=>{const s=fe(),o=s!=null?void 0:n.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),r=x.useId(),i=x.useMemo(()=>({key:r,type:"Label.SelectMultiple"}),[r]),a=c.useDragAndDrop({type:"Label.SelectSingle",canDrop:x.useCallback(j=>Je(j,v.o(e)),[e]),onDrop:x.useCallback(({items:j})=>{const m=c.filterByType(Le,j);return m.length===0?[]:(t(m[0].key,{clickedIndex:null,clicked:null,entries:[]}),m)},[i,t])}),u=c.useDraggingState(),d=x.useCallback(()=>e!=null&&a.startDrag([{type:Le,key:e}]),[a.startDrag,e]);return{emptyContent:o,dragging:u,...a,onDragStart:d,searcher:s==null?void 0:s.labels}},$i=({onChange:e,value:t,className:s,data:o,...r})=>{const{dragging:i,...a}=rn({value:t,onChange:e});return n.jsxRuntimeExports.jsx(ye,{data:o,className:l.CSS(s,l.CSS.dropRegion(Je(i,v.o(t)))),value:t,onChange:e,columns:Yt,entryRenderKey:"name",...a,...r})},_i=({data:e,value:t,onChange:s,...o})=>{const{dragging:r,...i}=rn({value:t,onChange:s});return n.jsxRuntimeExports.jsx(ye,{data:e,value:t,onChange:s,columns:Yt,entryRenderKey:"name",...i,...o})},Ni=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:Le,SelectButton:_i,SelectMultiple:Mi,SelectSingle:$i},Symbol.toStringTag,{value:"Module"})),Bi=({visible:e,children:t,close:s,style:o,...r})=>{const i=x.useRef(null);return c.useClickOutside({ref:i,exclude:a=>c.findParent(a.target,d=>d.getAttribute("role")==="dialog")!=null,onClickOutside:s}),c.use$2({triggers:[["Escape"]],callback:s,loose:!0}),Lt.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,...r,style:{zIndex:11,...o},children:n.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(l.CSS.BE("modal","content")),empty:!0,children:t})})}),c.getRootElement())},zi=Object.freeze(Object.defineProperty({__proto__:null,Modal:Bi},Symbol.toStringTag,{value:"Module"})),Ht=new Error("Tab not found"),Di=new Error("Invalid Mosaic"),on=(e,t,s="center",o)=>{var d;if(e=Pe(e),o===void 0)return yt(e,t);const r=xn(e,o);if(s==="center")return(d=r.tabs)==null||d.push(t),r.selected=t.tabKey,e;if(r.tabs==null||r.tabs.length===0)return e;const[i,a,u]=Vi(s);if(r.direction=u,r[i]={key:0,tabs:[t],selected:t.tabKey},r[a]={key:0,tabs:r.tabs,selected:r.selected},r.first==null||r.last==null)throw Di;return r.first.key=r.key*2,r.last.key=r.key*2+1,r.tabs=void 0,r.size=void 0,r.selected=void 0,e},yt=(e,t)=>(e=Pe(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=yt(e.first,t):e.last!=null&&(e.last=yt(e.last,t)),e)),Qe=e=>{e=Pe(e);const t=[];if(e.tabs!=null&&(e.selected=J.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[s,o]=Qe(e.first);e.first=s,t.push(...o)}if(e.last!=null){const[s,o]=Qe(e.last);e.last=s,t.push(...o)}return[e,t]},Gt=(e,t)=>{var r;e=Pe(e);const[,s]=Me(e,t);if(s==null)return[e,null];s.tabs=(r=s.tabs)==null?void 0:r.filter(i=>i.tabKey!==t),s.selected=J.resetSelection(s.selected,s.tabs),e=Ai(e);const o=s.selected??et(e);return[e,o]},et=e=>e.selected!=null?e.selected:e.first!=null?et(e.first):e.last!=null?et(e.last):null,ln=(e,t)=>{e=Pe(e);const[s,o]=Me(e,t);if(s==null||o==null)throw Ht;return o.selected=t,e},cn=(e,t,s,o)=>{e=Pe(e);const[r,i]=Me(e,t);if(r==null||i==null)throw Ht;const[a,u]=Gt(e,t);return[on(a,r,s,o),u]},bt=(e,t)=>{if(e.tabs!=null)return e.tabs.some(s=>s.tabKey===t)?e:void 0;if(e.first!=null){const s=bt(e.first,t);if(s!=null)return s}if(e.last!=null){const s=bt(e.last,t);if(s!=null)return s}},an=(e,t,s)=>{const o=tt(e,t);if(o==null)throw new Error("Node not found");return o.size=s,e},un=(e,t,s)=>{e=Pe(e);const[,o]=Me(e,t);if((o==null?void 0:o.tabs)==null)throw Ht;return o.tabs=J.rename(t,s,(o==null?void 0:o.tabs)??[]),e},Oi=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,xn=(e,t)=>{const s=tt(e,t);if(s!=null)return s;const o=Math.floor(t/2);return o===0?e:xn(e,o)},Ai=e=>{let t=!0;for(;t;)[e,t]=vt(e);return e.first==null&&e.last==null&&(e.key=1),e},vt=e=>{if(e.first==null||e.last==null)return[e,!1];if(xs(e.first))return[us(e.last,!0),!0];if(xs(e.last))return[us(e.first,!1),!0];let[t,s]=[!1,!1];return[e.first,t]=vt(e.first),[e.last,s]=vt(e.last),[e,t||s]},us=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),xs=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),Me=(e,t)=>{if(e.tabs!=null){const a=e.tabs.find(u=>u.tabKey===t);if(a!=null)return[a,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[s,o]=Me(e.first,t);if(s!=null&&o!=null)return[s,o];const[r,i]=Me(e.last,t);return[r,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)},Vi=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=>v._.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),wt=(e,t)=>{t(e),e.first!=null&&wt(e.first,t),e.last!=null&&wt(e.last,t)};class Ii{constructor(t={}){ge(this,"parent");ge(this,"stub");ge(this,"el");this.el=document.createElement("div"),Object.entries(t).forEach(([s,o])=>this.el.setAttribute(s,o))}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 Zi=({node:e})=>{const t=x.createRef(),s=x.useRef(e);return x.useEffect(()=>{const o=t.current;if(o==null)return;const r=o.parentNode;if(r!=null)return e.mount(r,o),()=>{t.current!=null&&e.unmount(t.current)}},[]),x.useEffect(()=>{s.current!=null&&e!==s.current&&(s.current.unmount(t.current),s.current=e);const o=t.current;if(o==null)return;const r=o.parentNode;r!=null&&e.mount(r,o)},[e]),n.jsxRuntimeExports.jsx("div",{ref:t})},Fi=({node:e,children:t})=>Lt.createPortal(t,e.el),dn=x.memo(({children:e,...t})=>{const s=x.useRef(new Map),o=new Set,r=st(t.root,i=>{var d;if(i.selected==null)return null;let a=s.current.get(i.selected);const u=(d=i.tabs)==null?void 0:d.find(j=>j.tabKey===i.selected);return u==null?null:(a==null&&(a=new Ii({style:"width: 100%; height: 100%; position: relative;"}),a.el.addEventListener("click",()=>{var j;return(j=t.onSelect)==null?void 0:j.call(t,u.tabKey)}),s.current.set(i.selected,a)),o.add(i.selected),n.jsxRuntimeExports.jsx(Fi,{node:a,children:e(u)},u.tabKey))});return s.current.forEach((i,a)=>!o.has(a)&&s.current.delete(a)),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[r,n.jsxRuntimeExports.jsx(nt,{portalNodes:s,...t})]})}),nt=x.memo(e=>{const{onResize:t,...s}=e,{root:{tabs:o,direction:r,first:i,last:a,key:u,size:d},emptyContent:j,...m}=s,f=x.useCallback(([R])=>t(u,R),[t]),{props:g}=Mt({direction:r,onResize:f,count:2,initialSizes:d!=null?[d]:void 0});let h;return o!==void 0?h=n.jsxRuntimeExports.jsx(mn,{emptyContent:j,...s}):i!=null&&a!=null?h=n.jsxRuntimeExports.jsxs(it,{align:"stretch",className:l.CSS.BE("mosaic","resize"),...g,children:[n.jsxRuntimeExports.jsx(nt,{...m,root:i,onResize:t},i.key),n.jsxRuntimeExports.jsx(nt,{...m,root:a,onResize:t},a.key)]}):(h=null,console.warn("Mosaic tree is malformed")),u===1?n.jsxRuntimeExports.jsx(c.Provider$2,{children:h}):h});dn.displayName="Mosaic";nt.displayName="Mosaic";const rt="pluto-mosaic-tab-drop",Ut="pluto-mosaic-tab-create",qi=(e,t,s)=>{if(c.filterByType(c.FILE_TYPE,t).length>0&&s)return!0;const r=c.filterByType(rt,t).map(u=>u.key),i=e.filter(u=>!r.includes(u.tabKey)).length>0;return c.filterByType(Ut,t).length>0||r.length>0&&(i||e.length===0)},mn=x.memo(({root:e,onDrop:t,onCreate:s,portalNodes:o,activeTab:r,onFileDrop:i,...a})=>{const{key:u,tabs:d}=e,[j,m]=x.useState(null),f=i!=null,g=x.useCallback(({items:y})=>qi(d,y,f),[d,f]),h=x.useCallback(({items:y,event:T})=>{if(T==null)return[];m(null);const B=c.filterByType(c.FILE_TYPE,y).length>0,_=d.length===0?"center":ms(ds(T));if(B)return i==null||i(u,_,T),y;const N=c.filterByType(rt,y);if(N.length>0){const L=N.map(({key:w})=>w)[0];t(u,L,_)}const b=c.filterByType(Ut,y);if(b.length>0){const L=b.map(({key:w})=>w);s==null||s(u,_,L)}return N},[t,d.length]),R=x.useCallback(({event:y})=>{if(y==null)return;const T=d.length===0?"center":ms(ds(y));m(T)},[d.length]),{startDrag:E,...P}=c.useDragAndDrop({type:"Mosaic",canDrop:g,onDrop:h,onDragOver:R}),M=g(c.useDraggingState()),$=x.useCallback(()=>m(null),[]),S=x.useCallback((y,{tabKey:T})=>{E([{key:T,type:rt,elementID:y.currentTarget.id}])},[E]),C=x.useCallback(()=>s==null?void 0:s(u,"center"),[u]);return n.jsxRuntimeExports.jsxs("div",{className:l.CSS.BE("mosaic","leaf"),children:[n.jsxRuntimeExports.jsxs(J.Tabs,{id:`tab-${u}`,tabs:d,onDragLeave:$,selected:e.selected,selectedAltColor:r===e.selected,onDragStart:S,onCreate:C,...a,...P,children:[n.jsxRuntimeExports.jsx(Zi,{node:o.current.get(e.selected)}),M&&n.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}})]}),j!=null&&n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("mosaic","mask"),style:Yi[j]})]})});mn.displayName="MosaicTabLeaf";const Yi={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%"}},ds=e=>{const t=e.currentTarget.getBoundingClientRect(),s=e.clientX-t.left,o=e.clientY-t.top;return o<24?{px:.5,py:.5}:{px:s/t.width,py:o/t.height}},Hi=e=>e,Gi=e=>1-e,ms=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[s,o]=[Hi(e),Gi(e)];if(t>s&&t>o)return"bottom";if(t<s&&t<o)return"top";if(t>s&&t<o)return"left";if(t<s&&t>o)return"right";throw new Error("[bug] - invalid insert position")},Ui=le.z.object({key:le.z.number(),tabs:le.z.array(J.tabZ).optional(),selected:le.z.string().optional(),direction:l.g.direction.optional(),size:le.z.number().optional()}),Tt=Ui.extend({first:le.z.lazy(()=>Tt).optional(),last:le.z.lazy(()=>Tt).optional()}),Wi=({allowRename:e=!1,initialTree:t})=>{const[s,o]=x.useState(t);return x.useEffect(()=>o(Qe(t)[0]),[t]),{root:s,onDrop:(j,m,f)=>o(g=>cn(g,m,f,j)[0]),onClose:j=>o(m=>Gt(m,j)[0]),onSelect:j=>o(m=>ln(m,j)),onResize:(j,m)=>o(f=>an(f,j,m)),onRename:e?(j,m)=>o(f=>un(f,j,m)):void 0}},Xi=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Ut,HAUL_DROP_TYPE:rt,Mosaic:dn,autoSelectTabs:Qe,findSelected:et,findTabNode:bt,forEachNode:wt,insertTab:on,isEmpty:Oi,mapNodes:st,moveTab:cn,nodeZ:Tt,removeTab:Gt,renameTab:un,resizeNode:an,selectTab:ln,use:Wi},Symbol.toStringTag,{value:"Module"})),Ki=({location:e="left",size:t="9rem",className:s,style:o,...r})=>{const i=l.J.construct(e),a=l.J.direction(i),u=l.g.swap(a);return n.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(l.CSS.B("navbar"),l.CSS.bordered(l.J.swap(i)),l.CSS.dir(u),l.CSS.loc(i),s),direction:u,style:{[l.g.dimension(a)]:t,...o},align:"center",empty:!0,...r})},Ze=e=>({bordered:t=!1,className:s,...o})=>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",...o}),pn=Ze("start");pn.displayName="NavbarStart";const jn=Ze("end");jn.displayName="NavbarEnd";const fn=Ze("center");fn.displayName="NavbarCenter";const hn=Ze("");hn.displayName="NavbarContent";const gn=Ze("absolute-center");gn.displayName="NavbarAbsoluteCenter";const Be=Ki;Be.Start=pn;Be.Center=fn;Be.End=jn;Be.AbsoluteCenter=gn;Be.Content=hn;const Wt=({aetherKey:e})=>{const[,{region:t},s]=c.use$3({aetherKey:e,type:p.Eraser$1.TYPE,schema:p.eraserStateZ,initialState:{region:l.To.ZERO,enabled:!0}}),o=c.useSyncedRef(t),r=x.useCallback(a=>{l.To.equals(a,o.current)||s(u=>({...u,region:a}))},[s]);return{setEnabled:x.useCallback(a=>s(u=>({...u,enabled:a})),[s]),erase:r}},Ji=c.wrap$1(p.Eraser$1.TYPE,({aetherKey:e,children:t})=>{const{erase:s}=Wt({aetherKey:e}),o=c.useResize(s);return n.jsxRuntimeExports.jsx("div",{ref:o,className:l.CSS(l.CSS.inheritDims()),children:t})}),Qi=Object.freeze(Object.defineProperty({__proto__:null,Eraser:Ji,use:Wt},Symbol.toStringTag,{value:"Module"})),ec=({items:e,initialKey:t})=>{const[s,o]=x.useState(t),r=a=>o(a===s?void 0:a),i=e.find(a=>a.key===s);return{onSelect:r,activeItem:i}},tc=c.wrap$1("Nav.Drawer",({aetherKey:e,activeItem:t,children:s,onSelect:o,location:r="left",collapseThreshold:i=.65,className:a,onResize:u,...d})=>{const j=l.J.direction(r),m=x.useCallback(()=>t!=null&&(o==null?void 0:o(t.key)),[o,t==null?void 0:t.key]),{erase:f,setEnabled:g}=Wt({aetherKey:e}),h=x.useCallback((M,$)=>{u==null||u(M,$),f($)},[u,f]);if(x.useLayoutEffect(()=>{g(t!=null)},[t,g]),t==null)return null;const{content:R,key:E,...P}=t;return n.jsxRuntimeExports.jsx(Ss,{className:l.CSS(l.CSS.BE("navdrawer","content"),l.CSS.dir(j),a),collapseThreshold:i,onCollapse:m,location:r,onResize:h,...P,...d,children:t.content},E)}),sc=Object.freeze(Object.defineProperty({__proto__:null,Bar:Be,Drawer:tc,useDrawer:ec},Symbol.toStringTag,{value:"Module"})),nc=({variant:e,className:t,children:s,...o})=>n.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(t,l.CSS.B("note"),l.CSS.M(e)),align:"stretch",empty:!0,...o,children:s}),rc=Object.freeze(Object.defineProperty({__proto__:null,Note:nc},Symbol.toStringTag,{value:"Module"})),gt={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"})]})},oc=({disabled:e=[],className:t,focused:s=!0,onMinimize:o,onMaximize:r,onFullscreen:i,onClose:a,...u})=>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),...u,children:[n.jsxRuntimeExports.jsx(St,{onClick:a,className:l.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:gt.Close}),n.jsxRuntimeExports.jsx(St,{onClick:o,className:l.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:gt.Minimize}),n.jsxRuntimeExports.jsx(St,{onClick:i,className:l.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:gt.Maximize})]}),St=({className:e,disabled:t,...s})=>n.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("macos-control"),l.CSS.disabled(t),e),tabIndex:-1,disabled:t,size:"",...s}),Et=({disabled:e=[],onMinimize:t,onMaximize:s,onClose:o,onFullscreen:r,focused:i,...a})=>n.jsxRuntimeExports.jsxs(D.Pack,{...a,children:[n.jsxRuntimeExports.jsx(Rt,{className:l.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:n.jsxRuntimeExports.jsx(c.j0.Subtract,{})}),n.jsxRuntimeExports.jsx(Rt,{className:l.CSS.BM("windows-control","maximize"),onClick:s,disabled:e.includes("maximize"),children:n.jsxRuntimeExports.jsx(c.j0.Box,{})}),n.jsxRuntimeExports.jsx(Rt,{onClick:o,className:l.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:n.jsxRuntimeExports.jsx(c.j0.Close,{})})]}),Rt=({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}),Sn=e=>v.w$1.getOS(e),lc={MacOS:oc,Windows:Et,Linux:Et,Docker:Et},ic="Windows",cc=({forceOS:e,visibleIfOS:t,...s})=>{const o=Sn({force:e,default:ic}),r=lc[o];return t!=null&&t!==o?null:n.jsxRuntimeExports.jsx(r,{...s})},ac=Object.freeze(Object.defineProperty({__proto__:null,Controls:cc,use:Sn},Symbol.toStringTag,{value:"Module"}));x.createContext({instrumentation:v.B.NOOP});const uc=c.wrap$1(p.Provider$2.TYPE,({aetherKey:e,children:t,...s})=>{const o=c.useMemoDeepEqualProps(s),[{path:r},,i]=c.use$3({aetherKey:e,type:p.Provider$2.TYPE,schema:p.providerStateZ$1,initialState:o});return x.useEffect(()=>{i(o)},[o,i]),n.jsxRuntimeExports.jsx(c.Composite,{path:r,children:t})}),xc="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjQgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",En=c.wrap$1(p.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:s}]=c.use$3({aetherKey:t,type:p.BaseProvider.TYPE,schema:p.providerStateZ$2,initialState:{}});return n.jsxRuntimeExports.jsx(c.Composite,{path:s,children:e})}),dc=Object.freeze(Object.defineProperty({__proto__:null,Provider:En},Symbol.toStringTag,{value:"Module"})),mc=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)===v.By.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)"}}},Rn=c.wrap$1("Chip",({aetherKey:e,source:t,sink:s,className:o,...r})=>{const i=c.useMemoDeepEqualProps({source:t,sink:s}),[,{status:a},u]=c.use$3({aetherKey:e,type:p.Chip.TYPE,schema:p.chipStateZ,initialState:{triggered:!1,...i,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:v.m.now()}}});x.useEffect(()=>{u(h=>({...h,...i}))},[i,u]);const d=x.useCallback(()=>u(h=>({...h,triggered:!h.triggered})),[u]),{message:j,chipColor:m,buttonStyle:f,disabled:g}=mc(a);return n.jsxRuntimeExports.jsx(c.Icon,{variant:"text",className:l.CSS(l.CSS.B("control-chip"),o),disabled:g,onClick:d,tooltip:n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:j}),style:f,...r,children:n.jsxRuntimeExports.jsx(c.j0.Circle,{color:m})})}),Cn=x.createContext({needsControlOf:[]}),yn=()=>x.useContext(Cn),pc=c.wrap$1(p.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:s,...o})=>{const r=c.useMemoDeepEqualProps(o),[{path:i},{status:a,needsControlOf:u},d]=c.use$3({aetherKey:e,type:p.Controller$1.TYPE,schema:p.controllerStateZ,initialState:r});return x.useEffect(()=>{a!=null&&(s==null||s(a))},[a,s]),x.useEffect(()=>{d(j=>({...j,...r}))},[r,d]),x.useEffect(()=>()=>s==null?void 0:s("released"),[]),n.jsxRuntimeExports.jsxs(Cn.Provider,{value:{needsControlOf:u},children:[n.jsxRuntimeExports.jsx(c.Composite,{path:i,children:t}),";"]})}),bn=c.wrap$1(p.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:s})=>{var d;const o=c.useMemoDeepEqualProps({colorSource:t,statusSource:s}),[,{color:r,status:i},a]=c.use$3({aetherKey:e,type:p.Indicator.TYPE,initialState:{...o,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:v.m.now()}},schema:p.indicatorStateZ});x.useEffect(()=>{a(j=>({...j,...o}))},[o,a]);let u;return((d=i.data)==null?void 0:d.color)!=null?u=l.Color.z.parse(i.data.color):r!=null&&!r.isZero?u=r:u="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(u),flexGrow:1}})]})}),jc=c.wrap$1(p.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:s}=yn(),[,{states:o},r]=c.use$3({aetherKey:e,type:p.Legend.TYPE,schema:p.legendStateZ,initialState:{states:[],needsControlOf:s}});x.useEffect(()=>{r(u=>({...u,needsControlOf:s}))},[s]);const a=v.n(o.map(u=>u.subject.key)).map(u=>{const d=o.find(j=>j.subject.key===u);if(d==null)throw new v.Se("Legend subject not found");return{key:d.subject.key,label:d.subject.name,color:d.subjectColor}});return n.jsxRuntimeExports.jsx(Dt,{data:a,...t})}),vn=c.wrap$1(p.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:s}]=c.use$3({aetherKey:e,type:p.StateProvider.TYPE,schema:p.stateProviderStateZ,initialState:{}});return n.jsxRuntimeExports.jsx(c.Composite,{path:s,children:t})}),fc=Object.freeze(Object.defineProperty({__proto__:null,Chip:Rn,Controller:pc,Indicator:bn,Legend:jc,StateProvider:vn,useContext:yn},Symbol.toStringTag,{value:"Module"})),wn=e=>{const t=({disabled:s=!1,...o})=>s?o.children:n.jsxRuntimeExports.jsx(e,{...o});return t.displayName=e.displayName,t},hc=wn(En),gc=wn(c.Provider$3),Sc=({children:e,connParams:t,workerEnabled:s=!0,workerURL:o,theming:r,tooltip:i,triggers:a,alamos:u,haul:d,channelAlias:j,telem:m})=>n.jsxRuntimeExports.jsx(c.Provider$1,{...a,children:n.jsxRuntimeExports.jsx(c.Config,{...i,children:n.jsxRuntimeExports.jsx(c.Provider$2,{...d,children:n.jsxRuntimeExports.jsx(c.Provider$4,{url:o??xc,enabled:s,children:n.jsxRuntimeExports.jsx(gc,{workerKey:"vis",children:n.jsxRuntimeExports.jsx(uc,{...u,children:n.jsxRuntimeExports.jsx(c.Aggregator,{children:n.jsxRuntimeExports.jsx(Es,{connParams:t,children:n.jsxRuntimeExports.jsx(ys,{...j,children:n.jsxRuntimeExports.jsx(hc,{...m,children:n.jsxRuntimeExports.jsx(c.Provider,{...r,children:n.jsxRuntimeExports.jsx(vn,{children:e})})})})})})})})})})})}),Ec=Object.freeze(Object.defineProperty({__proto__:null,Provider:Sc},Symbol.toStringTag,{value:"Module"})),Rc=({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}%`}})}),Cc=Object.freeze(Object.defineProperty({__proto__:null,Progress:Rc},Symbol.toStringTag,{value:"Module"})),Ie="range",Xt=[{key:"name",name:"Name"}],ot=({items:e},t)=>{const s=c.filterByType(Ie,e);return s.length>0&&!s.every(o=>t.includes(o.key))},yc=({onChange:e,className:t,value:s,...o})=>{const r=fe(),i=r!=null?void 0:n.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:a,onDragEnd:u,...d}=c.useDragAndDrop({type:"Ranger.SelectMultiple",canDrop:x.useCallback(g=>ot(g,v.A(s)),[s]),onDrop:x.useCallback(({items:g})=>{const h=c.filterByType(Ie,g);if(h.length===0)return[];const R=v.n([...v.A(s),...h.map(E=>E.key)]);return e(R,{clickedIndex:null,clicked:null,entries:[]}),h},[e,s])}),j=c.useDraggingState(),m=x.useCallback(({dropped:g})=>{e(v.A(s).filter(h=>!g.some(R=>R.key===h)),{clickedIndex:null,clicked:null,entries:[]})},[e,s]),f=x.useCallback((g,h)=>a([{key:h,type:Ie}],m),[a,m]);return n.jsxRuntimeExports.jsx(Ne,{className:l.CSS(t,l.CSS.dropRegion(ot(j,v.A(s)))),value:s,onTagDragStart:f,onTagDragEnd:u,searcher:r==null?void 0:r.ranges,onChange:e,columns:Xt,emptyContent:i,entryRenderKey:"name",...d,...o})},Tn=({value:e,onChange:t})=>{const s=fe(),o=s!=null?void 0:n.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),r=x.useId(),i=x.useMemo(()=>({key:r,type:"Ranger.SelectMultiple"}),[r]),{startDrag:a,...u}=c.useDragAndDrop({type:"Ranger.SelectSingle",canDrop:x.useCallback(m=>ot(m,v.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(),j=x.useCallback(()=>e!=null&&a([{type:Ie,key:e}]),[a,e]);return{emptyContent:o,dragging:d,...u,onDragStart:j,searcher:s==null?void 0:s.ranges}},bc=({onChange:e,value:t,className:s,data:o,...r})=>{const{dragging:i,...a}=Tn({value:t,onChange:e});return n.jsxRuntimeExports.jsx(ye,{data:o,className:l.CSS(s,l.CSS.dropRegion(ot(i,v.o(t)))),value:t,onChange:e,columns:Xt,entryRenderKey:"name",...a,...r})},vc=({data:e,value:t,onChange:s,...o})=>{const{dragging:r,...i}=Tn({value:t,onChange:s});return n.jsxRuntimeExports.jsx(ye,{data:e,value:t,onChange:s,columns:Xt,entryRenderKey:"name",...i,...o})},wc=[{key:"color",name:"Color",width:50,render:e=>n.jsxRuntimeExports.jsx(c.j0.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],Tc=e=>{const t=fe();return n.jsxRuntimeExports.jsx(Ne,{...e,searcher:t==null?void 0:t.labels,columns:wc,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})})},kc=({timeRange:e,level:t="p",shade:s=7,...o})=>{const r=new v.m(e.start),i=r.isToday?"time":"dateTime",a=new v.m(e.end),u=a.equals(v.m.MAX),d=a.span(r)<v.w.DAY?"time":"dateTime";return n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",size:"small",className:l.CSS(l.CSS.B("time-range-chip")),align:"center",...o,children:[r.isToday&&n.jsxRuntimeExports.jsx(c.Text,{level:t,shade:s,weight:450,children:"Today"}),n.jsxRuntimeExports.jsx(c.DateTime,{level:t,displayTZ:"local",format:i,shade:s,weight:450,children:r}),n.jsxRuntimeExports.jsx(c.j0.Arrow.Right,{color:"var(--pluto-text-color)"}),u?n.jsxRuntimeExports.jsx(c.Text,{level:t,children:"Now"}):n.jsxRuntimeExports.jsx(c.DateTime,{level:t,displayTZ:"local",format:d,shade:s,weight:450,children:a})]})},Pc=Object.freeze(Object.defineProperty({__proto__:null,SelectButton:vc,SelectLabels:Tc,SelectMultiple:yc,SelectSingle:bc,TimeRangeChip:kc},Symbol.toStringTag,{value:"Module"})),Lc=({steps:e,value:t,onChange:s,...o})=>{const r=e.findIndex(i=>i.key===t);return n.jsxRuntimeExports.jsx(D.Space,{direction:"x",align:"center",className:l.CSS.B("steps"),...o,children:e.map((i,a)=>n.jsxRuntimeExports.jsxs(x.Fragment,{children:[n.jsxRuntimeExports.jsxs(c.Button,{onClick:()=>s(i.key),variant:"outlined",disabled:a>r,children:[a+1,". ",i.title]},i.key),a!==e.length-1&&n.jsxRuntimeExports.jsx(c.j0.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},i.key))})},Mc=Object.freeze(Object.defineProperty({__proto__:null,Steps:Lc},Symbol.toStringTag,{value:"Module"})),$c=(e,t="x")=>{if(e.length===0)return[];const s=l.J.construct(t),o=l.J.swap(s);return e.sort((r,i)=>l.To.loc(r.box,s)-l.To.loc(i.box,s)),e.forEach((r,i)=>{if(i===0)return;const u=e[i-1].handles.find(h=>h.orientation===o),d=r.handles.find(h=>h.orientation===s);if(u==null||d==null)return;const j=u.absolutePosition,m=d.absolutePosition,f=l.q.set(l.q.translation(m,j),t,0),g=l.q.translate(l.To.topLeft(r.box),f);r.box=l.To.construct(g,l.To.dims(r.box))}),e},Kt=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=Kt(t),o=e.getNodes().find(r=>r.id===t);if(o==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return l.To.construct(o.position,l.To.dims(l.To.construct(s)))},_c=(e,t)=>mt.fromFlow(e,t);class kn{constructor(t,s){ge(this,"node_",null);ge(this,"position");ge(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 mt{constructor(t,s,o){ge(this,"key");ge(this,"box");ge(this,"handles");this.key=t,this.box=s,this.handles=o,o.forEach(r=>r.node=this)}static fromFlow(t,s){const o=oe(s,t),r=Kt(t),i=r.getElementsByClassName("react-flow__handle"),a=l.To.construct(r),u=Array.from(i).map(d=>{const j=l.To.center(l.To.construct(d)),m=l.q.translation(l.To.topLeft(a),j),f=d.className.match(/react-flow__handle-(\w+)/);if(f==null)throw new Error("[schematic] - cannot find handle orientation");const g=l.J.construct(f[0]);return new kn(m,g)});return new mt(t,o,u)}}const Nc=({fromX:e,fromY:t,toX:s,toY:o,fromPosition:r,toPosition:i,fromNode:a,connectionLineStyle:u,connectionStatus:d})=>{const j=document.querySelector(".react-flow__handle-connecting"),m=j==null?void 0:j.className.match(/react-flow__handle-(\w+)/);if(m!=null){const R=l.J.outer.safeParse(m[1]);R.success&&(i=R.data)}const f=p.buildNew({sourcePos:l.q.construct(e,t),targetPos:l.q.construct(s,o),sourceOrientation:r,targetOrientation:i,sourceBox:oe(p.useReactFlow(),(a==null?void 0:a.id)??""),targetBox:oe(p.useReactFlow(),(a==null?void 0:a.id)??"")}),g=p.useReactFlow(),h=p.segmentsToPoints(l.q.construct(e,t),f,g.getZoom(),!1);return n.jsxRuntimeExports.jsx(p.BaseEdge,{path:Pn(h),style:{...u,stroke:l.cssString(d==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},Bc=({id:e,source:t,target:s,sourcePosition:o,targetHandleId:r,targetPosition:i,style:a,segments:u=[],onSegmentsChange:d,color:j="var(--pluto-gray-l9)",selected:m=!1,...f})=>{const g=l.q.construct(f.sourceX,f.sourceY),h=x.useRef(g),R=l.q.equals(g,h.current),E=l.q.construct(f.targetX,f.targetY),P=x.useRef(E),M=l.q.equals(E,P.current),$=p.useReactFlow(),[S,C,y]=c.useCombinedStateAndRef(()=>u.length>0?u:p.buildNew({sourcePos:g,targetPos:E,sourceOrientation:o,targetOrientation:i,sourceBox:oe($,t),targetBox:oe($,s)})),T=x.useRef(i),B=x.useRef(o),_=c.useDebouncedCallback(d,100,[d]);if(!R||!M){let w=S;const z=l.q.translation(h.current,g),V=l.q.translation(E,P.current);l.q.equals(z,l.q.scale(V,-1),.001)?(h.current=g,P.current=E):(R?M||(w=p.moveTargetNode({delta:V,segments:w}),T.current!==i&&(T.current=i,w=p.buildNew({sourcePos:g,targetPos:E,sourceOrientation:o,targetOrientation:i,sourceBox:oe($,t),targetBox:oe($,s)})),p.checkIntegrity({sourcePos:g,targetPos:E,next:w,prev:S})||(w=p.buildNew({sourcePos:g,targetPos:E,sourceOrientation:o,targetOrientation:i,sourceBox:oe($,t),targetBox:oe($,s)})),P.current=E):(w=p.moveSourceNode({delta:z,segments:w}),B.current!==o&&(B.current=o,w=p.buildNew({sourcePos:g,targetPos:E,sourceOrientation:o,targetOrientation:i,sourceBox:oe($,t),targetBox:oe($,s)})),p.checkIntegrity({sourcePos:g,targetPos:E,next:w,prev:S})||(w=p.buildNew({sourcePos:g,targetPos:E,sourceOrientation:o,targetOrientation:i,sourceBox:oe($,t),targetBox:oe($,s)})),h.current=g),_(w),C(w))}const N=x.useRef(null),b=ct({onStart:x.useCallback((w,z,V)=>{N.current={index:Number(V.currentTarget.id.split("-")[1]),segments:[...y.current]}},[]),onMove:x.useCallback(w=>{if(N.current==null)return;const z=p.dragSegment({segments:N.current.segments,index:N.current.index,magnitude:l.To.dim(w,l.g.swap(N.current.segments[N.current.index].direction),!0)/$.getZoom()});C(z)},[]),onEnd:x.useCallback(()=>d(y.current),[d])}),L=p.segmentsToPoints(g,S,$.getZoom(),!0);return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(p.BaseEdge,{path:Pn(L),style:{...a,stroke:l.cssString(j)},...f}),m&&zc(L).map((w,z)=>{const V=S[z].direction,G=l.g.swap(V),I={[l.g.dimension(V)]:"18px",[l.g.dimension(G)]:"4px"},F={[V]:w[V]-9,[G]:w[G]-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,...F,rx:"2px",ry:"2px"}),n.jsxRuntimeExports.jsx("foreignObject",{x:w.x-9,y:w.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(V)),draggable:!0,onDragStart:b})})]},z)})]})},Pn=e=>{let t="";const o=e.length+-1;for(let r=0;r<o;r++){const i=e[r%e.length],a=e[(r+1)%e.length],u=Math.min(6/Math.hypot(a.x-i.x,a.y-i.y),.5);r>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-u)+a.x*u},${i.y*(1-u)+a.y*u}`),r===0?t+=`M${i.x},${i.y}`:r===0&&(t+=`M${i.x*(1-u)+a.x*u},${i.y*(1-u)+a.y*u}`),r===o-1?t+=`L${a.x},${a.y}`:r<o-1&&(t+=`L${i.x*u+a.x*(1-u)},${i.y*u+a.y*(1-u)}`)}return t},zc=e=>e.slice(1).map((t,s)=>{const o=e[s];return l.q.construct((t.x+o.x)/2,(t.y+o.y)/2)}),Dc=({initialNodes:e,initialEdges:t,allowEdit:s=!0,initialViewport:o={position:l.q.ZERO,zoom:1}})=>{const[r,i]=x.useState(s),[a,u]=x.useState(e),[d,j]=x.useState(t),[m,f]=x.useState(o),[g,h]=x.useState(!1);return{viewport:m,onViewportChange:f,edges:d,nodes:a,onNodesChange:u,onEdgesChange:j,editable:r,onEditableChange:i,fitViewOnResize:g,setFitViewOnResize:h}},Oc=e=>e.source!==e.target,Ac={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1},Vc={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},Ln={padding:0,maxZoom:1,minZoom:.5},Ic={hideAttribution:!0},Mn=x.createContext({editable:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),Fe=()=>x.useContext(Mn),$n=x.memo(({children:e})=>{const{registerNodeRenderer:t}=Fe();return x.useEffect(()=>t(e),[t,e]),null});$n.displayName="NodeRenderer";const Zc=["Backspace","Delete"],Fc=c.wrap$1(p.Diagram$1.TYPE,({aetherKey:e,children:t,onNodesChange:s,onEdgesChange:o,nodes:r,edges:i,onEditableChange:a,editable:u,viewport:d,triggers:j,onViewportChange:m,fitViewOnResize:f,setFitViewOnResize:g,...h})=>{const[{path:R},,E]=c.use$3({aetherKey:e,type:p.Diagram$1.TYPE,schema:p.diagramStateZ,initialState:{position:d.position,region:l.To.ZERO,zoom:d.zoom}}),P=c.use().colors.gray.l9.hex,M=c.useMemoCompare(()=>j??Vt.zoom,c.compareModeConfigs,[j]),{fitView:$}=p.useReactFlow(),S=Nt(x.useCallback(Z=>{f&&$({maxZoom:1}),E(X=>({...X,region:Z}))},[E,$,f])),C=x.useRef(null),y=x.useCallback(Z=>{const X=C.current;X!=null&&X.x===Z.x&&X.y===Z.y&&X.zoom===Z.zoom||(C.current=Z,E(re=>({...re,position:Z,zoom:Z.zoom})),m(p.translateViewportBackward(Z)))},[E,m]);p.useOnViewportChange({onStart:y,onChange:y,onEnd:y});const[T,B]=x.useState(()=>()=>null),_=x.useCallback(Z=>B(()=>Z),[]),N=x.useMemo(()=>({custom:({id:Z,xPos:X,yPos:re,selected:Oe})=>T({symbolKey:Z,position:{x:X,y:re},selected:Oe})}),[T]),b=x.useRef(i),L=x.useMemo(()=>(b.current=i,p.translateEdgesForward(i)),[i]),w=x.useRef(r),z=x.useMemo(()=>(w.current=r,p.translateNodesForward(r)),[r]),V=x.useCallback(Z=>s(p.nodeConverter(w.current,X=>p.applyNodeChanges(Z,X))),[s]),G=x.useCallback(Z=>o(p.edgeConverter(b.current,X=>p.applyEdgeChanges(Z,X),P)),[o,P]),I=x.useCallback((Z,X)=>o(p.edgeConverter(b.current,re=>p.updateEdge(Z,X,re),P)),[]),F=x.useCallback(Z=>{o(p.edgeConverter(b.current,X=>p.addEdge(Z,X),P))},[o,P]),O=x.useCallback((Z,X)=>{const re=[...b.current],Oe=re.findIndex(yo=>yo.key===Z);Oe!==-1&&(re[Oe]={...re[Oe],segments:X},b.current=re,o(re))},[o]),ee=u?Ac:Vc,se=x.useMemo(()=>({default:Z=>n.jsxRuntimeExports.jsx(Bc,{...Z,segments:Z.data.segments,color:Z.data.color,onSegmentsChange:x.useCallback(X=>O(Z.id,X),[Z.id])},Z.id)}),[O]),qe=x.useRef(null);c.use$2({triggers:M.zoomReset,callback:x.useCallback(({stage:Z,cursor:X})=>{const re=qe.current;re==null||Z!=="start"||!l.To.contains(re,X)||$()},[$])});const Qt=c.purgeMouse(M.select)[0]??null,es=c.purgeMouse(M.pan)[0]??null,So=c.purgeMouse(M.zoom)[0]??null,Eo={selectionOnDrag:Qt==null,panOnDrag:es==null,selectionKeyCode:Qt,panActivationKeyCode:es,zoomActivationKeyCode:So},Ro=c.useCombinedRefs(qe,S),Co=x.useMemo(()=>({editable:u,onEditableChange:a,registerNodeRenderer:_,fitViewOnResize:f,setFitViewOnResize:g}),[u,a,_,f]);return n.jsxRuntimeExports.jsx(Mn.Provider,{value:Co,children:n.jsxRuntimeExports.jsx(c.Composite,{path:R,children:n.jsxRuntimeExports.jsx(p.ReactFlow,{...Eo,className:l.CSS(l.CSS.B("diagram"),l.CSS.editable(u)),nodes:z,edges:L,nodeTypes:N,edgeTypes:se,ref:Ro,fitView:!0,onNodesChange:V,onEdgesChange:G,onConnect:F,onEdgeUpdate:I,defaultViewport:p.translateViewportForward(d),connectionLineComponent:Nc,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:Oc,connectionMode:p.ConnectionMode.Loose,snapGrid:[3,3],fitViewOptions:Ln,selectionMode:p.SelectionMode.Partial,proOptions:Ic,deleteKeyCode:Zc,...h,style:{[l.CSS.var("diagram-zoom")]:d.zoom,...h.style},...ee,children:t})})})}),qc=()=>{const{editable:e}=Fe();return e?n.jsxRuntimeExports.jsx(cl,{}):null},Yc=({children:e,...t})=>n.jsxRuntimeExports.jsx(D.Pack,{direction:"y",className:l.CSS.BE("diagram","controls"),...t,children:e}),Hc=({onClick:e,...t})=>{const{editable:s,onEditableChange:o}=Fe();return n.jsxRuntimeExports.jsx(c.ToggleIcon,{onChange:()=>o(!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.j0.EditOff,{}):n.jsxRuntimeExports.jsx(c.j0.Edit,{})})},Gc=({onClick:e,...t})=>{const{fitView:s}=p.useReactFlow(),{fitViewOnResize:o,setFitViewOnResize:r}=Fe();return n.jsxRuntimeExports.jsx(c.ToggleIcon,{onClick:i=>{s(Ln),e==null||e(i)},value:o,onChange:i=>r(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.j0.Expand,{})})},Uc=e=>n.jsxRuntimeExports.jsx(p.ReactFlowProvider,{children:n.jsxRuntimeExports.jsx(Fc,{...e})}),Wc=Object.freeze(Object.defineProperty({__proto__:null,Background:qc,Controls:Yc,Diagram:Uc,FitViewControl:Gc,HandleLayout:kn,NodeLayout:mt,NodeRenderer:$n,ToggleEditControl:Hc,alignNodes:$c,edgeConverter:p.edgeConverter,edgeZ:p.edgeZ,nodeConverter:p.nodeConverter,nodeZ:p.nodeZ,rfEdgeDataZ:p.rfEdgeDataZ,selectNode:Kt,selectNodeBox:oe,selectNodeLayout:_c,translateEdgesBackward:p.translateEdgesBackward,translateEdgesForward:p.translateEdgesForward,translateNodesBackward:p.translateNodesBackward,translateNodesForward:p.translateNodesForward,translateViewportBackward:p.translateViewportBackward,translateViewportForward:p.translateViewportForward,use:Dc,useContext:Fe,viewportZ:p.viewportZ},Symbol.toStringTag,{value:"Module"})),Xc=({value:e,onChange:t})=>{const{inner:s,outer:o}=e,r=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:o==="top",onClick:r({outer:"top"})}),n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[n.jsxRuntimeExports.jsx(Ee,{selected:o==="left",onClick:r({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:r({inner:"top"})}),n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",justify:"center",children:[n.jsxRuntimeExports.jsx(Ee,{selected:s==="left",onClick:r({inner:"left"})}),n.jsxRuntimeExports.jsx(Ee,{selected:s==="right",onClick:r({inner:"right"})})]}),n.jsxRuntimeExports.jsx(Ee,{className:l.CSS(l.CSS.dir("y")),selected:s==="bottom",onClick:r({inner:"bottom"})})]}),n.jsxRuntimeExports.jsx(Ee,{selected:o==="right",onClick:r({outer:"right"})})]}),n.jsxRuntimeExports.jsx(Ee,{selected:o==="bottom",onClick:r({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"})}),pt=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],ie=({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(je,{label:"Orientation",padHelpText:!1,...e,children:({value:t,onChange:s})=>{var o;return n.jsxRuntimeExports.jsx(Xc,{value:{inner:t.orientation??"top",outer:((o=t.label)==null?void 0:o.orientation)??"top"},onChange:r=>s({...t,orientation:r.inner,label:{...t.label,orientation:r.outer}})})}}),we=({path:e})=>n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(je,{path:e+".label",label:"Label",padHelpText:!1,grow:!0,children:t=>n.jsxRuntimeExports.jsx(c.Text$1,{selectOnFocus:!0,...t})}),n.jsxRuntimeExports.jsx(je,{path:e+".level",label:"Label Size",padHelpText:!1,children:t=>n.jsxRuntimeExports.jsx(ae.SelectLevel,{...t})})]}),ze=e=>n.jsxRuntimeExports.jsx(je,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:s,...o})=>n.jsxRuntimeExports.jsx(kt.Swatch,{value:t??l.ZERO.setAlpha(1).rgba255,onChange:r=>s(r.rgba255),...o})}),_n=({path:e})=>{var j,m;const{value:t,onChange:s}=Te({path:e}),o=p.sourcePipelinePropsZ.parse((j=t.source)==null?void 0:j.props),r=p.sinkPipelinePropsZ.parse((m=t.sink)==null?void 0:m.props),i=p.streamChannelValuePropsZ.parse(o.segments.valueStream.props),a=p.setChannelValuePropsZ.parse(r.segments.setter.props),u=f=>{f=f??0;const g=p.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:p.streamChannelValue({channel:f}),threshold:p.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});s({...t,source:g})},d=f=>{f=f??0;const g=p.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:p.setChannelValue({channel:f}),setpoint:p.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),h=p.authoritySource({channel:f}),R=p.acquireChannelControl({channel:f,authority:255});s({...t,sink:g,control:{...t.control,showChip:!0,chip:{sink:R,source:h},showIndicator:!0,indicator:{statusSource:h}}})};return n.jsxRuntimeExports.jsxs(ie,{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:u})}),n.jsxRuntimeExports.jsx(me.Item,{label:"Command Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Ce,{value:a.channel,onChange:d})})]})},he=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(_n,{path:""});default:return n.jsxRuntimeExports.jsxs(ie,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(we,{path:"label"}),n.jsxRuntimeExports.jsx(ze,{path:"color",hideIfNull:!0,optional:!0})]}),n.jsxRuntimeExports.jsx(ve,{path:""})]})}},[]),t=J.useStatic({tabs:pt,content:e});return n.jsxRuntimeExports.jsx(J.Tabs,{...t})},Kc=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(_n,{path:""});default:return n.jsxRuntimeExports.jsxs(ie,{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(ze,{path:"color"}),n.jsxRuntimeExports.jsx(je,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,children:o=>n.jsxRuntimeExports.jsx(c.Switch$1,{...o})})]})]}),n.jsxRuntimeExports.jsx(ve,{path:""})]})}},[]),t=J.useStatic({tabs:pt,content:e});return n.jsxRuntimeExports.jsx(J.Tabs,{...t})},ue=()=>n.jsxRuntimeExports.jsxs(ie,{direction:"x",children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(we,{path:"label"}),n.jsxRuntimeExports.jsx(ze,{path:"color"})]}),n.jsxRuntimeExports.jsx(ve,{path:""})]}),ps={y:2,x:.25},js={lower:0,upper:2e3},Jc=()=>n.jsxRuntimeExports.jsxs(ie,{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(ze,{path:"color"}),n.jsxRuntimeExports.jsx(je,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>n.jsxRuntimeExports.jsx(c.Numeric,{value:e??200,dragScale:ps,bounds:js,...t})}),n.jsxRuntimeExports.jsx(je,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>n.jsxRuntimeExports.jsx(c.Numeric,{value:e??200,dragScale:ps,bounds:js,...t})})]})]}),n.jsxRuntimeExports.jsx(ve,{path:""})]}),Nn=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],Qc=({path:e})=>{var f;const{value:t,onChange:s}=Te({path:e}),o=p.sourcePipelinePropsZ.parse((f=t.telem)==null?void 0:f.props),r=p.streamChannelValuePropsZ.parse(o.segments.valueStream.props),i=p.stringifyNumberProps.parse(o.segments.stringifier.props),a=p.rollingAverageProps.parse(o.segments.rollingAverage.props),u=g=>{const h=p.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:p.streamChannelValue({channel:g??0}),stringifier:p.stringifyNumber({precision:i.precision??2}),rollingAverage:p.rollingAverage({windowSize:a.windowSize??1})},outlet:"stringifier"});s({...t,telem:h})},d=g=>{const h=p.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:p.streamChannelValue({channel:r.channel}),stringifier:p.stringifyNumber({precision:g}),rollingAverage:p.rollingAverage({windowSize:a.windowSize})},outlet:"stringifier"});s({...t,telem:h})},j=g=>{const h=p.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{stringifier:p.stringifyNumber({precision:i.precision??2}),valueStream:p.streamChannelValue({channel:r.channel}),rollingAverage:p.rollingAverage({windowSize:g})},outlet:"stringifier"});s({...t,telem:h})},m=ut(r.channel);return x.useEffect(()=>{s({...t,tooltip:[m]})},[m]),n.jsxRuntimeExports.jsxs(ie,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(me.Item,{label:"Input Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Ce,{value:r.channel,onChange:u})}),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:a.windowSize??1,bounds:{lower:1,upper:100},onChange:j})})]})},ea=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"telemetry":return n.jsxRuntimeExports.jsx(Qc,{path:""});default:return n.jsxRuntimeExports.jsxs(ie,{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(ze,{path:"color"}),n.jsxRuntimeExports.jsx(je,{path:"units",label:"Units",align:"start",padHelpText:!1,children:o=>n.jsxRuntimeExports.jsx(c.Text$1,{...o})})]})]}),n.jsxRuntimeExports.jsx(ve,{path:""})]})}},[]),t=J.useStatic({tabs:Nn,content:e});return n.jsxRuntimeExports.jsx(J.Tabs,{...t})},ta=({path:e})=>{var u;const{value:t,onChange:s}=Te({path:e}),o=p.sourcePipelinePropsZ.parse((u=t.source)==null?void 0:u.props),r=p.streamChannelValuePropsZ.parse(o.segments.valueStream.props),i=d=>{d=d??0;const j=p.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:p.streamChannelValue({channel:d}),threshold:p.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});s({...t,source:j})},a=ut(r.channel);return x.useEffect(()=>{s({...t})},[a]),n.jsxRuntimeExports.jsx(ie,{direction:"x",align:"stretch",children:n.jsxRuntimeExports.jsx(me.Item,{label:"Input Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Ce,{value:r.channel,onChange:i})})})},sa=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"telemetry":return n.jsxRuntimeExports.jsx(ta,{path:""});default:return n.jsxRuntimeExports.jsxs(ie,{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(ze,{path:"color"})})]}),n.jsxRuntimeExports.jsx(ve,{path:""})]})}},[]),t=J.useStatic({tabs:Nn,content:e});return n.jsxRuntimeExports.jsx(J.Tabs,{...t})},na=({path:e})=>{var a;const{value:t,onChange:s}=Te({path:e}),o=p.sinkPipelinePropsZ.parse((a=t.sink)==null?void 0:a.props),r=p.setChannelValuePropsZ.parse(o.segments.setter.props),i=u=>{const d=p.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:p.setChannelValue({channel:u}),setpoint:p.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),j=p.authoritySource({channel:u}),m=p.acquireChannelControl({channel:u,authority:255});s({...t,sink:d,control:{...t.control,showChip:!0,chip:{sink:m,source:j},showIndicator:!0,indicator:{statusSource:j}}})};return n.jsxRuntimeExports.jsx(ie,{direction:"y",children:n.jsxRuntimeExports.jsx(me.Item,{label:"Output Channel",children:n.jsxRuntimeExports.jsx(Ce,{value:r.channel,onChange:i})})})},ra=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(na,{path:""});default:return n.jsxRuntimeExports.jsxs(ie,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(D.Space,{direction:"y",grow:!0,children:n.jsxRuntimeExports.jsx(we,{path:"label"})}),n.jsxRuntimeExports.jsx(ve,{path:""})]})}},[]),t=J.useStatic({tabs:pt,content:e});return n.jsxRuntimeExports.jsx(J.Tabs,{...t})},oa=({path:e})=>{var j,m;const{value:t,onChange:s}=Te({path:e}),o=p.sourcePipelinePropsZ.parse((j=t.source)==null?void 0:j.props),r=p.sinkPipelinePropsZ.parse((m=t.sink)==null?void 0:m.props),i=p.streamChannelValuePropsZ.parse(o.segments.valueStream.props),a=p.setChannelValuePropsZ.parse(r.segments.setter.props),u=f=>{f=f??0;const g=p.sourcePipeline("number",{connections:[],segments:{valueStream:p.streamChannelValue({channel:f})},outlet:"valueStream"});s({...t,source:g})},d=f=>{f=f??0;const g=p.sinkPipeline("number",{connections:[],segments:{setter:p.setChannelValue({channel:f})},inlet:"setter"}),h=p.authoritySource({channel:f}),R=p.acquireChannelControl({channel:f,authority:255});s({...t,sink:g,control:{...t.control,showChip:!0,chip:{sink:R,source:h},showIndicator:!0,indicator:{statusSource:h}}})};return n.jsxRuntimeExports.jsxs(ie,{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:u})}),n.jsxRuntimeExports.jsx(me.Item,{label:"Command Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Ce,{value:a.channel,onChange:d})})]})},la=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(oa,{path:""});default:return n.jsxRuntimeExports.jsxs(ie,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(we,{path:"label"}),n.jsxRuntimeExports.jsx(je,{path:"units",label:"Units",align:"start",padHelpText:!1,children:o=>n.jsxRuntimeExports.jsx(c.Text$1,{...o})})]}),n.jsxRuntimeExports.jsx(ve,{path:""})]})}},[]),t=J.useStatic({tabs:pt,content:e});return n.jsxRuntimeExports.jsx(J.Tabs,{...t})},ia=({aetherKey:e,sink:t})=>{const s=c.useMemoDeepEqualProps({sink:t}),[,,o]=c.use$3({aetherKey:e,type:p.Button.TYPE,schema:p.buttonStateZ,initialState:{trigger:0,sink:t}});return x.useEffect(()=>{o(i=>({...i,...s}))},[s]),{click:x.useCallback(()=>{o(i=>({...i,trigger:i.trigger+1}))},[o])}},q=x.forwardRef(({label:e="",onChange:t,level:s="p",children:o,orientation:r="top",style:i,className:a,...u},d)=>n.jsxRuntimeExports.jsxs(D.Space,{style:{marginRight:r==="right"?1:0,marginTop:r==="top"?1:0,...i},size:2/3,direction:r,ref:d,className:l.CSS(l.CSS.B("symbol"),a),align:"center",justify:"center",...u,children:[e.length>0&&n.jsxRuntimeExports.jsx(c.Editable,{className:l.CSS.BE("symbol","label"),value:e,onChange:x.useCallback(j=>t({label:{label:j,level:s,orientation:r}}),[t,s]),level:s}),o]}));q.displayName="Labeled";const A=e=>n.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),Jt=e=>n.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),De=e=>n.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),te=e=>n.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),ca={left:{left:p.Position.Left,right:p.Position.Right,top:p.Position.Top,bottom:p.Position.Bottom},right:{left:p.Position.Right,right:p.Position.Left,top:p.Position.Bottom,bottom:p.Position.Top},top:{left:p.Position.Bottom,right:p.Position.Top,top:p.Position.Left,bottom:p.Position.Right},bottom:{left:p.Position.Top,right:p.Position.Bottom,top:p.Position.Right,bottom:p.Position.Left}},aa=(e,t)=>ca[t][e],ua=(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},Y=({children:e,orientation:t})=>{let s;try{s=p.useUpdateNodeInternals()}catch{return n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{})}const o=x.useRef(null),r=x.useRef(!0);return x.useEffect(()=>{if(o.current==null)return;if(r.current){r.current=!1;return}const i=o.current.closest(".react-flow__node"),a=i==null?void 0:i.getAttribute("data-id");a!=null&&(s==null||s(a))},[t]),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("span",{ref:o}),e]})},k=({location:e,orientation:t,left:s,top:o,...r})=>{const i=ua(o,s,t);return n.jsxRuntimeExports.jsx(p.Handle$1,{position:aa(e,t),...r,type:"source",onClick:a=>a.stopPropagation(),className:(l.CSS.B("handle"),l.CSS.BE("handle",r.id)),style:{left:`${i.left}%`,top:`${i.top}%`}})},xe=({className:e,enabled:t=!1,triggered:s=!1,orientation:o="left",color:r,...i})=>n.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("symbol-primitive"),l.CSS.B("symbol-primitive-toggle"),o!=null&&l.CSS.loc(o),t&&l.CSS.M("enabled"),s&&l.CSS.M("triggered"),e),color:l.cssString(r),...i}),Q=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:l.CSS(l.CSS.B("symbol-primitive"),e),...t}),xa=.8,W=({dimensions:e,orientation:t="left",children:s,className:o,color:r,style:i={},scale:a=1,...u})=>{e=l.g.construct(t)==="y"?l._$1.swap(e):e;const j=l.cssString(r),m=c.use();return r!=null&&(i[l.CSS.var("symbol-color")]=new l.Color(r).rgbString,i[l.CSS.var("symbol-color-contrast")]=new l.Color(r).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),o),fill:j,stroke:j,...u,style:{aspectRatio:`${e.width} / ${e.height}`,width:l._$1.scale(e,a*xa).width,...i},children:n.jsxRuntimeExports.jsx("g",{children:s})})},Bn=({className:e,orientation:t,scale:s,color:o,...r})=>n.jsxRuntimeExports.jsxs(xe,{...r,orientation:t,className:l.CSS(l.CSS.B("four-way-valve"),e),children:[n.jsxRuntimeExports.jsxs(Y,{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:o,scale:s,children:[n.jsxRuntimeExports.jsx(A,{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(A,{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"})]})]}),zn=({color:e,orientation:t="left",scale:s,...o})=>n.jsxRuntimeExports.jsxs(xe,{...o,className:l.CSS(l.CSS.B("three-way-valve")),orientation:t,children:[n.jsxRuntimeExports.jsxs(Y,{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(A,{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(A,{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"})]})]}),Dn=({orientation:e="left",color:t,scale:s,...o})=>n.jsxRuntimeExports.jsxs(xe,{...o,children:[n.jsxRuntimeExports.jsxs(Y,{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(A,{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"})})]}),On=({className:e,color:t,orientation:s="left",normallyOpen:o=!1,scale:r,...i})=>n.jsxRuntimeExports.jsxs(xe,{className:l.CSS(l.CSS.B("solenoid-valve"),o&&l.CSS.M("normally-open"),e),...i,children:[n.jsxRuntimeExports.jsxs(Y,{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:r,children:[n.jsxRuntimeExports.jsx(A,{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(A,{d:"M43.5 47L43.5 24.6177"}),n.jsxRuntimeExports.jsx(Jt,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),An=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(Q,{orientation:t,className:l.CSS(l.CSS.B("relief-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(Y,{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:o,children:[n.jsxRuntimeExports.jsx(A,{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(A,{d:"M43.5 2L43.5 38",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(A,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(A,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(A,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),Vn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(Q,{orientation:t,className:l.CSS(l.CSS.B("check-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(Y,{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:o,children:[n.jsxRuntimeExports.jsx(A,{d:"M43 2L43 40",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(A,{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"})]})]}),In=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(xe,{...r,orientation:s,className:l.CSS(l.CSS.B("angled-valve"),t),children:[n.jsxRuntimeExports.jsxs(Y,{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:o,children:[n.jsxRuntimeExports.jsx(A,{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(A,{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(A,{d:"M24.3461 18.5709L21.7484 19.88C20.9998 20.2572 20.3887 20.8601 20.0012 21.6035L19.3383 22.8756"})]})]}),Zn=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(xe,{...r,className:l.CSS(l.CSS.B("pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(Y,{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:o,children:[n.jsxRuntimeExports.jsx(De,{cx:"32",cy:"32",r:"30"}),n.jsxRuntimeExports.jsx(te,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(te,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)})]})]}),Fn=({className:e,color:t,orientation:s="left",scale:o,...r})=>{const i=l.cssString(t);return n.jsxRuntimeExports.jsxs(Q,{...r,className:l.CSS(l.CSS.B("symbol"),e),children:[n.jsxRuntimeExports.jsx(Y,{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:o,children:[n.jsxRuntimeExports.jsx(A,{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(A,{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(A,{d:"M33 24H3",strokeLinecap:"round"})]})]})},qn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(Q,{className:l.CSS(l.CSS.B("cap"),e),...r,children:[n.jsxRuntimeExports.jsx(Y,{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:o,children:n.jsxRuntimeExports.jsx(A,{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"})})]}),Yn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(Q,{className:l.CSS(l.CSS.B("manual-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(Y,{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:o,children:[n.jsxRuntimeExports.jsx(te,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),n.jsxRuntimeExports.jsx(A,{d:"M19.64 2L66.68 2",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(A,{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"})]})]}),Hn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(Q,{className:l.CSS(l.CSS.B("filter"),e),...r,children:[n.jsxRuntimeExports.jsxs(Y,{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:o,children:n.jsxRuntimeExports.jsx(A,{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"})})]}),da=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,ma=e=>{const{topLeft:t,topRight:s,bottomLeft:o,bottomRight:r}=e;return`${t.x}% ${s.x}% ${r.x}% ${o.x}% / ${t.y}% ${s.y}% ${r.y}% ${o.y}%`},pa={width:40,height:80},ja={x:50,y:10},Gn=({className:e,dimensions:t=pa,borderRadius:s=ja,color:o,...r})=>{const i=da(s),a=c.use();return n.jsxRuntimeExports.jsx(Q,{className:l.CSS(e,l.CSS.B("tank")),style:{...t,borderRadius:ma(i),borderColor:l.cssString(o??a.colors.gray.l9)},...r,children:n.jsxRuntimeExports.jsxs(Y,{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"})]})})},Un=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(Q,{className:l.CSS(e,l.CSS.B("regulator")),...r,children:[n.jsxRuntimeExports.jsxs(Y,{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:o,children:[n.jsxRuntimeExports.jsx(A,{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(A,{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(te,{x1:"44",y1:"53",x2:"44",y2:"30",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(A,{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"})]})]}),Wn=({className:e,orientation:t="left",scale:s,color:o,...r})=>n.jsxRuntimeExports.jsxs(Q,{className:l.CSS(l.CSS.B("orifice"),e),...r,children:[n.jsxRuntimeExports.jsxs(Y,{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:o,scale:s,children:[n.jsxRuntimeExports.jsx(A,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(A,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),Xn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(Q,{className:l.CSS(l.CSS.B("needle-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(Y,{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:o,children:[n.jsxRuntimeExports.jsx(A,{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(A,{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"})]})]}),Kn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(Q,{orientation:t,className:l.CSS(l.CSS.B("angled-relief-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(Y,{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:o,children:[n.jsxRuntimeExports.jsx(A,{d:"M20.75 2L20.75 38",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(A,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(A,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(A,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(A,{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(A,{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(A,{d:"M24.3461 33.5709L21.7484 34.88C20.9998 35.2572 20.3887 35.8601 20.0012 36.6035L19.3383 37.8756"})]})]}),Jn=({className:e,color:t,dimensions:s,orientation:o,units:r="psi",children:i,...a})=>{const u=l.cssString(t),d=c.use(),j=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(Q,{className:l.CSS(l.CSS.B("value"),e),...a,style:{borderColor:u,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(Y,{orientation:o,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:u},children:n.jsxRuntimeExports.jsx(c.Text,{level:"small",color:j,children:r})})]})},Qn=({enabled:e=!1,onClick:t,orientation:s="left"})=>n.jsxRuntimeExports.jsxs(Q,{orientation:s,children:[n.jsxRuntimeExports.jsx(c.Switch$1,{value:e,onClick:t,onChange:()=>{}}),n.jsxRuntimeExports.jsxs(Y,{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"})]})]}),er=({onClick:e,orientation:t="left",label:s=""})=>n.jsxRuntimeExports.jsxs(Q,{orientation:t,children:[n.jsxRuntimeExports.jsx(c.Button,{onClick:e,children:s}),n.jsxRuntimeExports.jsxs(Y,{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"})]})]}),tr=({orientation:e="left",className:t,onClick:s,children:o,value:r,units:i,onChange:a,...u})=>{const[d,j]=x.useState(r);return n.jsxRuntimeExports.jsxs(Q,{className:l.CSS(l.CSS.B("setpoint"),t),orientation:e,...u,children:[n.jsxRuntimeExports.jsxs(Y,{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:j,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:()=>a(d),children:"Set"})]})]})},sr=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(xe,{...r,className:l.CSS(l.CSS.B("screw-pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(Y,{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:o,children:[n.jsxRuntimeExports.jsx(De,{cx:"32",cy:"32",r:"30"}),n.jsxRuntimeExports.jsx(te,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(te,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(A,{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(A,{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)})]})]}),nr=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(xe,{...r,className:l.CSS(l.CSS.B("vacuum-pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(Y,{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:o,children:[n.jsxRuntimeExports.jsx(De,{cx:"32",cy:"32",r:"30"}),n.jsxRuntimeExports.jsx(te,{x1:"17",y1:"6.0192",x2:"57.9808",y2:"17",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(te,{x1:"17",y1:"57.9808",x2:"57.9808",y2:"47",className:l.CSS(l.CSS.M("detail"),t)})]})]}),rr=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(xe,{...r,className:l.CSS(l.CSS.B("cavity-pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(Y,{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:o,children:[n.jsxRuntimeExports.jsx(De,{cx:"32",cy:"32",r:"30"}),n.jsxRuntimeExports.jsx(te,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(te,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(A,{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)})]})]}),or=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(xe,{...r,className:l.CSS(l.CSS.B("piston-pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(Y,{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:o,children:[n.jsxRuntimeExports.jsx(De,{cx:"32",cy:"32",r:"30"}),n.jsxRuntimeExports.jsx(te,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(te,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(A,{d:"M 23 32, h 16, m 0 -8, v 16",className:l.CSS(l.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),lr=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(Q,{...r,className:l.CSS(l.CSS.B("static-mixer"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(Y,{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:o,children:[n.jsxRuntimeExports.jsx(Jt,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),n.jsxRuntimeExports.jsx(A,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(A,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),ir=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(xe,{...r,className:l.CSS(l.CSS.B("rotary-mixer"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(Y,{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:o,children:[n.jsxRuntimeExports.jsx(A,{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(te,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(te,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(te,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)})]})]}),cr=({className:e,color:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(xe,{...r,className:l.CSS(l.CSS.B("light"),e),children:[n.jsxRuntimeExports.jsxs(Y,{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:o,children:n.jsxRuntimeExports.jsx(De,{cx:"32",cy:"32",r:"30"})})]}),ar=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(Q,{className:l.CSS(e,l.CSS.B("regulator")),...r,children:[n.jsxRuntimeExports.jsxs(Y,{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:o,children:[n.jsxRuntimeExports.jsx(A,{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(Jt,{x:"19",y:"10",width:"50",height:"20",rx:"3",ry:"3"}),n.jsxRuntimeExports.jsx(te,{x1:"44",y1:"53",x2:"44",y2:"30",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(A,{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"})]})]}),fa=({aetherKey:e,source:t,sink:s})=>{const o=c.useMemoDeepEqualProps({source:t,sink:s}),[,{value:r},i]=c.use$3({aetherKey:e,type:p.Setpoint.TYPE,schema:p.setpointStateZ,initialState:{trigger:0,value:0,...o}});return x.useEffect(()=>{i(u=>({...u,...o}))},[o,i]),{set:x.useCallback(u=>i(d=>({...d,trigger:d.trigger+1,command:u})),[i]),value:r}},ce=({aetherKey:e,source:t,sink:s})=>{const o=c.useMemoDeepEqualProps({source:t,sink:s}),[,{triggered:r,enabled:i},a]=c.use$3({aetherKey:e,type:p.Toggle.TYPE,schema:p.toggleStateZ,initialState:{triggered:!1,enabled:!1,...o}});return x.useEffect(()=>{a(d=>({...d,...o}))},[o,a]),{toggle:x.useCallback(()=>a(d=>({...d,triggered:!d.triggered})),[a]),triggered:r,enabled:i}},ha=p.Value.z.omit({font:!0}).partial({color:!0}).extend({level:v.levelZ.optional()}),ur=({aetherKey:e,box:t,telem:s,color:o,precision:r,minWidth:i,level:a="small"})=>{const u=c.useMemoDeepEqualProps({box:t,telem:s,color:o,precision:r,level:a,minWidth:i}),[,d,j]=c.use$3({aetherKey:e,type:p.Value.TYPE,schema:p.Value.z,initialState:u});return x.useLayoutEffect(()=>j(m=>({...m,...u})),[u]),{width:d.width??d.minWidth}},ga=Object.freeze(Object.defineProperty({__proto__:null,corePropsZ:ha,use:ur},Symbol.toStringTag,{value:"Module"})),xr=e=>l.g.construct(e)==="x"?l.J.swap(e):e,Sa=e=>l.g.construct(e)==="y"?l.J.swap(e):e,ne=({showChip:e=!0,showIndicator:t=!0,indicator:s,orientation:o="left",chip:r,children:i,...a})=>n.jsxRuntimeExports.jsxs(D.Space,{direction:l.J.rotate90(o),align:"center",justify:"center",empty:!0,...a,children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:l.g.construct(o),align:"center",className:l.CSS(l.CSS.B("control-state")),size:"small",children:[e&&n.jsxRuntimeExports.jsx(Rn,{size:"small",...r}),t&&n.jsxRuntimeExports.jsx(bn,{...s})]}),i]}),dr=c.wrap$1("ThreeWayValve",({aetherKey:e,label:t,onChange:s,control:o,source:r,sink:i,orientation:a="left",color:u})=>{const{enabled:d,triggered:j,toggle:m}=ce({aetherKey:e,source:r,sink:i});return n.jsxRuntimeExports.jsx(q,{...t,onChange:s,children:n.jsxRuntimeExports.jsx(ne,{...o,orientation:xr(a),children:n.jsxRuntimeExports.jsx(zn,{enabled:d,triggered:j,onClick:m,orientation:a,color:u})})})}),mr=e=>n.jsxRuntimeExports.jsx(zn,{...e}),pr=c.wrap$1("Valve",({control:e,aetherKey:t,label:s,onChange:o,source:r,sink:i,orientation:a,color:u})=>{const{enabled:d,triggered:j,toggle:m}=ce({aetherKey:t,source:r,sink:i});return n.jsxRuntimeExports.jsx(q,{...s,onChange:o,children:n.jsxRuntimeExports.jsx(ne,{...e,orientation:a,children:n.jsxRuntimeExports.jsx(Dn,{enabled:d,triggered:j,onClick:m,orientation:a,color:u})})})}),jr=e=>n.jsxRuntimeExports.jsx(Dn,{...e}),fr=c.wrap$1("SolenoidValve",({aetherKey:e,label:t,onChange:s,orientation:o="left",normallyOpen:r,color:i,source:a,sink:u,control:d})=>{const{enabled:j,triggered:m,toggle:f}=ce({aetherKey:e,source:a,sink:u});return n.jsxRuntimeExports.jsx(q,{...t,onChange:s,children:n.jsxRuntimeExports.jsx(ne,{...d,orientation:Sa(o),children:n.jsxRuntimeExports.jsx(On,{enabled:j,triggered:m,onClick:f,orientation:o,color:i,normallyOpen:r})})})}),hr=e=>n.jsxRuntimeExports.jsx(On,{...e}),gr=c.wrap$1("FourWayValve",({aetherKey:e,control:t,label:s,onChange:o,orientation:r,color:i,source:a,sink:u})=>{const{enabled:d,triggered:j,toggle:m}=ce({aetherKey:e,source:a,sink:u});return n.jsxRuntimeExports.jsx(q,{...s,onChange:o,children:n.jsxRuntimeExports.jsx(ne,{...t,orientation:r,children:n.jsxRuntimeExports.jsx(Bn,{enabled:d,triggered:j,onClick:m,orientation:r,color:i})})})}),Sr=e=>n.jsxRuntimeExports.jsx(Bn,{...e}),Er=c.wrap$1("AngleValve",({aetherKey:e,label:t,control:s,onChange:o,orientation:r="left",color:i,source:a,sink:u})=>{const{enabled:d,triggered:j,toggle:m}=ce({aetherKey:e,source:a,sink:u});return n.jsxRuntimeExports.jsx(q,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:xr(r),children:n.jsxRuntimeExports.jsx(In,{enabled:d,triggered:j,onClick:m,orientation:r,color:i})})})}),Rr=e=>n.jsxRuntimeExports.jsx(In,{...e}),Cr=c.wrap$1("Pump",({aetherKey:e,label:t,control:s,onChange:o,orientation:r,color:i,source:a,sink:u})=>{const{enabled:d,triggered:j,toggle:m}=ce({aetherKey:e,source:a,sink:u});return n.jsxRuntimeExports.jsx(q,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:r,children:n.jsxRuntimeExports.jsx(Zn,{enabled:d,triggered:j,onClick:m,orientation:r,color:i})})})}),yr=e=>n.jsxRuntimeExports.jsx(Zn,{...e}),br=c.wrap$1("Tank",({label:e,onChange:t,orientation:s,color:o,dimensions:r,borderRadius:i})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Gn,{onResize:a=>t({dimensions:a}),orientation:s,color:o,dimensions:r,borderRadius:i})})),vr=e=>n.jsxRuntimeExports.jsx(Gn,{...e,dimensions:{width:25,height:50}}),wr=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(An,{orientation:s,color:o})}),Tr=e=>n.jsxRuntimeExports.jsx(An,{...e}),kr=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Un,{orientation:s,color:o})}),Pr=e=>n.jsxRuntimeExports.jsx(Un,{...e}),Lr=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(ar,{orientation:s,color:o})}),Mr=e=>n.jsxRuntimeExports.jsx(ar,{...e}),$r=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Fn,{orientation:s,color:o})}),_r=e=>n.jsxRuntimeExports.jsx(Fn,{...e}),Nr=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(qn,{orientation:s,color:o})}),Br=e=>n.jsxRuntimeExports.jsx(qn,{...e}),zr=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Yn,{orientation:s,color:o})}),Dr=e=>n.jsxRuntimeExports.jsx(Yn,{...e}),Or=c.wrap$1("Setpoint",({label:e,aetherKey:t,orientation:s,control:o,units:r,source:i,sink:a,onChange:u})=>{const{value:d,set:j}=fa({aetherKey:t,source:i,sink:a});return n.jsxRuntimeExports.jsx(q,{...e,onChange:u,children:n.jsxRuntimeExports.jsx(ne,{...o,className:l.CSS.B("symbol"),orientation:s,children:n.jsxRuntimeExports.jsx(tr,{value:d,onChange:j,units:r,orientation:s})})})}),Ar=e=>n.jsxRuntimeExports.jsx(tr,{value:12,onChange:()=>{},units:"mV",...e,children:n.jsxRuntimeExports.jsx(c.Text,{level:"p",children:"10.0"})}),Vr=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Hn,{orientation:s,color:o})}),Ir=e=>n.jsxRuntimeExports.jsx(Hn,{...e}),Zr=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Xn,{orientation:s,color:o})}),Fr=e=>n.jsxRuntimeExports.jsx(Xn,{...e}),qr=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Vn,{orientation:s,color:o})}),Yr=e=>n.jsxRuntimeExports.jsx(Vn,{...e}),Hr=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Wn,{orientation:s,color:o})}),Gr=e=>n.jsxRuntimeExports.jsx(Wn,{...e}),Ur=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Kn,{orientation:s,color:o})}),Wr=e=>n.jsxRuntimeExports.jsx(Kn,{...e}),Xr=c.wrap$1("Value",({aetherKey:e,label:t,level:s="p",position:o,className:r,textColor:i,color:a,telem:u,units:d,onChange:j,tooltip:m})=>{const f=c.useTypography(s),[g,h]=x.useState({outerBox:l.To.ZERO,labelBox:l.To.ZERO}),R=(f.lineHeight+.5)*f.baseSize+2,E=c.useResize(x.useCallback(S=>{const C=document.querySelector(`.react-flow__node[data-id="${e}"] .pluto-symbol__label`);let y={...l.To.ZERO};C!=null&&(y=l.To.construct(C),y=l.To.resize(y,{width:l.To.width(y),height:l.To.height(y)})),h({outerBox:S,labelBox:y})},[]),{}),{zoom:P}=p.useInitialViewport(),M=Ra({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:o,zoom:P,...g}),{width:$}=ur({aetherKey:e,color:i,level:s,box:M,telem:u,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((S,C)=>n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:S},C))}),n.jsxRuntimeExports.jsx(q,{className:l.CSS(r,l.CSS.B("value-labeled")),ref:E,onChange:j,...t,children:n.jsxRuntimeExports.jsx(Jn,{color:a,dimensions:{height:R,width:$},units:d})})]})}),Ea=.9,Ra=({labelOrientation:e,outerBox:t,labelBox:s,valueBoxHeight:o,position:r,hasLabel:i,zoom:a})=>{const u=l.q.scale(l.To.dims(s),1/(Ea*a));return l.g.construct(e)==="x"&&(r=l.q.translate(r,"y",Math.max((u.y-o)/2-1,0))),i&&e==="left"?r=l.q.translate(r,"x",u.x+4):i&&e==="top"&&(r=l.q.translate(r,"y",u.y+4)),l.To.construct(r.x,r.y,l.To.width(t),o)},Kr=({color:e})=>n.jsxRuntimeExports.jsx(Jn,{color:e,dimensions:{width:60,height:25},units:"psi",children:n.jsxRuntimeExports.jsx(c.Text,{level:"p",children:"50.00"})}),Jr=c.wrap$1("Switch",({aetherKey:e,label:t,control:s,onChange:o,orientation:r,color:i,source:a,sink:u})=>{const{enabled:d,triggered:j,toggle:m}=ce({aetherKey:e,source:a,sink:u});return n.jsxRuntimeExports.jsx(q,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:r,children:n.jsxRuntimeExports.jsx(Qn,{enabled:d,triggered:j,onClick:m,orientation:r,color:i})})})}),Qr=e=>n.jsxRuntimeExports.jsx(Qn,{...e}),eo=c.wrap$1("Button",({aetherKey:e,label:t,orientation:s,sink:o,control:r})=>{const{click:i}=ia({aetherKey:e,sink:o});return n.jsxRuntimeExports.jsx(ne,{...r,className:l.CSS.B("symbol"),orientation:s,children:n.jsxRuntimeExports.jsx(er,{label:t==null?void 0:t.label,onClick:i})})}),to=({label:e,...t})=>n.jsxRuntimeExports.jsx(er,{label:"Button",...t}),so=c.wrap$1("screwPump",({aetherKey:e,label:t,control:s,onChange:o,orientation:r,color:i,source:a,sink:u})=>{const{enabled:d,triggered:j,toggle:m}=ce({aetherKey:e,source:a,sink:u});return n.jsxRuntimeExports.jsx(q,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:r,children:n.jsxRuntimeExports.jsx(sr,{enabled:d,triggered:j,onClick:m,orientation:r,color:i})})})}),no=e=>n.jsxRuntimeExports.jsx(sr,{...e}),ro=c.wrap$1("vacuumPump",({aetherKey:e,label:t,control:s,onChange:o,orientation:r,color:i,source:a,sink:u})=>{const{enabled:d,triggered:j,toggle:m}=ce({aetherKey:e,source:a,sink:u});return n.jsxRuntimeExports.jsx(q,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:r,children:n.jsxRuntimeExports.jsx(nr,{enabled:d,triggered:j,onClick:m,orientation:r,color:i})})})}),oo=e=>n.jsxRuntimeExports.jsx(nr,{...e}),lo=c.wrap$1("progressiveCavityPump",({aetherKey:e,label:t,control:s,onChange:o,orientation:r,color:i,source:a,sink:u})=>{const{enabled:d,triggered:j,toggle:m}=ce({aetherKey:e,source:a,sink:u});return n.jsxRuntimeExports.jsx(q,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:r,children:n.jsxRuntimeExports.jsx(rr,{enabled:d,triggered:j,onClick:m,orientation:r,color:i})})})}),io=e=>n.jsxRuntimeExports.jsx(rr,{...e}),co=c.wrap$1("pistonPump",({aetherKey:e,label:t,control:s,onChange:o,orientation:r,color:i,source:a,sink:u})=>{const{enabled:d,triggered:j,toggle:m}=ce({aetherKey:e,source:a,sink:u});return n.jsxRuntimeExports.jsx(q,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:r,children:n.jsxRuntimeExports.jsx(or,{enabled:d,triggered:j,onClick:m,orientation:r,color:i})})})}),ao=e=>n.jsxRuntimeExports.jsx(or,{...e}),uo=c.wrap$1("statixMixer",({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(lr,{orientation:s,color:o})})),xo=e=>n.jsxRuntimeExports.jsx(lr,{...e}),mo=c.wrap$1("rotaryMixer",({aetherKey:e,label:t,control:s,onChange:o,orientation:r,color:i,source:a,sink:u})=>{const{enabled:d,triggered:j,toggle:m}=ce({aetherKey:e,source:a,sink:u});return n.jsxRuntimeExports.jsx(q,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:r,children:n.jsxRuntimeExports.jsx(ir,{enabled:d,triggered:j,onClick:m,orientation:r,color:i})})})}),po=e=>n.jsxRuntimeExports.jsx(ir,{...e}),jo=c.wrap$1("light",({aetherKey:e,label:t,className:s,orientation:o="left",color:r,source:i,onChange:a})=>{const{enabled:u}=ce({aetherKey:e,source:i});return n.jsxRuntimeExports.jsx(q,{...t,onChange:a,children:n.jsxRuntimeExports.jsx(cr,{color:r,enabled:u,className:s,orientation:o})})}),fo=e=>n.jsxRuntimeExports.jsx(cr,{...e}),U=4,Ca=2,ya=["angledReliefValve","angledValve","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"],ba=le.z.enum(ya),K={orientation:"left"},va={...K,source:p.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:p.streamChannelValue({channel:0}),rollingAverage:p.rollingAverage({windowSize:1}),stringifier:p.stringifyNumber({precision:2})},outlet:"stringifier"})},wa={...K,source:p.sourcePipeline("number",{connections:[],segments:{valueStream:p.streamChannelValue({channel:0})},outlet:"valueStream"})},Ta={...K,sink:p.sinkPipeline("number",{connections:[],segments:{setter:p.setChannelValue({channel:0})},inlet:"setter"})},ho={...K,source:p.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:p.streamChannelValue({channel:0}),threshold:p.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},go={...K,sink:p.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:p.setChannelValue({channel:0}),setpoint:p.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},de={...ho,...go},H=e=>({label:{label:e,level:"p",orientation:"top"}}),ka={name:"Three Way Valve",key:"threeWayValve",Form:he,Symbol:dr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Three Way Valve"),...de}),Preview:mr,zIndex:U},Pa={name:"Valve",key:"valve",Form:he,Symbol:pr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Valve"),...de}),Preview:jr,zIndex:U},La={name:"Solenoid Valve",key:"solenoidValve",Form:Kc,Symbol:fr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Solenoid Valve"),normallyOpen:!1,...de}),Preview:hr,zIndex:U},Ma={name:"Four Way Valve",key:"fourWayValve",Form:he,Symbol:gr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Four Way Valve"),...de}),Preview:Sr,zIndex:U},$a={name:"Angled Valve",key:"angledValve",Form:he,Symbol:Er,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Angled Valve"),...de}),Preview:Rr,zIndex:U},_a={name:"Pump",key:"pump",Form:he,Symbol:Cr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Pump"),...de}),Preview:yr,zIndex:U},Na={name:"Screw Pump",key:"screwPump",Form:he,Symbol:so,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Screw Pump"),...de}),Preview:no,zIndex:U},Ba={name:"Tank",key:"tank",Form:Jc,Symbol:br,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Tank"),dimensions:{width:100,height:200},...K}),Preview:vr,zIndex:Ca},za={name:"Relief Valve",key:"reliefValve",Form:ue,Symbol:wr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Relief Valve"),...K}),Preview:Tr,zIndex:U},Da={name:"Regulator",key:"regulator",Form:ue,Symbol:kr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Regulator"),...K}),Preview:Pr,zIndex:U},Oa={name:"Electric Regulator",key:"electricRegulator",Form:ue,Symbol:Lr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Electric Regulator"),...K}),Preview:Mr,zIndex:U},Aa={name:"Burst Disc",key:"burstDisc",Form:ue,Symbol:$r,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Burst Disc"),...K}),Preview:_r,zIndex:U},Va={name:"Cap",key:"cap",Form:ue,Symbol:Nr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Cap"),...K}),Preview:Br,zIndex:U},Ia={name:"Manual Valve",key:"manualValve",Form:ue,Symbol:zr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Manual Valve"),...K}),Preview:Dr,zIndex:U},Za={name:"Filter",key:"filter",Form:ue,Symbol:Vr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Filter"),...K}),Preview:Ir,zIndex:U},Fa={name:"Needle Valve",key:"needleValve",Form:ue,Symbol:Zr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Needle Valve"),...K}),Preview:Fr,zIndex:U},qa={name:"Check Valve",key:"checkValve",Form:ue,Symbol:qr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Check Valve"),...K}),Preview:Yr,zIndex:U},Ya={name:"Orifice",key:"orifice",Form:ue,Symbol:Hr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Orifice"),...K}),Preview:Gr,zIndex:U},Ha={name:"Angled Relief Valve",key:"angledReliefValve",Form:ue,Symbol:Ur,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Angled Relief Valve"),...K}),Preview:Wr,zIndex:U},Ga={name:"Value",key:"value",Form:ea,Symbol:Xr,Preview:Kr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",...H("Value"),...K,telem:va.source}),zIndex:U},Ua={name:"Button",key:"button",Symbol:eo,Form:ra,Preview:to,defaultProps:()=>({...H("Button"),...go}),zIndex:U},Wa={name:"Switch",key:"switch",Symbol:Jr,Preview:Qr,Form:he,defaultProps:()=>({...H("Switch"),...de}),zIndex:U},Xa={name:"Vacuum Pump",key:"vacuumPump",Symbol:ro,Form:he,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Vacuum Pump"),...de}),Preview:oo,zIndex:U},Ka={name:"Cavity Pump",key:"cavityPump",Symbol:lo,Form:he,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Cavity Pump"),...de}),Preview:io,zIndex:U},Ja={name:"Piston Pump",key:"pistonPump",Symbol:co,Form:he,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Piston Pump"),...de}),Preview:ao,zIndex:U},Qa={name:"Static Mixer",key:"staticMixer",Symbol:uo,Form:ue,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Static Mixer"),...K}),Preview:xo,zIndex:U},eu={name:"Rotary Mixer",key:"rotaryMixer",Symbol:mo,Form:he,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Rotary Mixer"),...de}),Preview:po,zIndex:U},tu={name:"Light",key:"light",Symbol:jo,Form:sa,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...H("Light"),...ho}),Preview:fo,zIndex:U},su={name:"Setpoint",key:"setpoint",Symbol:Or,Form:la,defaultProps:()=>({units:"mV",...H("Setpoint"),...wa,...Ta}),Preview:Ar,zIndex:U},nu={value:Ga,light:tu,switch:Wa,button:Ua,setpoint:su,tank:Ba,valve:Pa,solenoidValve:La,threeWayValve:ka,fourWayValve:Ma,angledValve:$a,manualValve:Ia,needleValve:Fa,reliefValve:za,angledReliefValve:Ha,checkValve:qa,regulator:Da,electricRegulator:Oa,pump:_a,pistonPump:Ja,screwPump:Na,cavityPump:Ka,vacuumPump:Xa,staticMixer:Qa,rotaryMixer:eu,burstDisc:Aa,cap:Va,filter:Za,orifice:Ya},ru=Object.freeze(Object.defineProperty({__proto__:null,AngledReliefValve:Ur,AngledReliefValvePreview:Wr,AngledValve:Er,AngledValvePreview:Rr,BurstDisc:$r,BurstDiscPreview:_r,Button:eo,ButtonPreview:to,Cap:Nr,CapPreview:Br,CavityPump:lo,CavityPumpPreview:io,CheckValve:qr,CheckValvePreview:Yr,ControlState:ne,ElectricRegulator:Lr,ElectricRegulatorPreview:Mr,Filter:Vr,FilterPreview:Ir,FourWayValve:gr,FourWayValvePreview:Sr,Light:jo,LightPreview:fo,ManualValve:zr,ManualValvePreview:Dr,NeedleValve:Zr,NeedleValvePreview:Fr,Orifice:Hr,OrificePreview:Gr,PistonPump:co,PistonPumpPreview:ao,Pump:Cr,PumpPreview:yr,Regulator:kr,RegulatorPreview:Pr,ReliefValve:wr,ReliefValvePreview:Tr,RotaryMixer:mo,RotaryMixerPreview:po,SYMBOLS:nu,ScrewPump:so,ScrewPumpPreview:no,Setpoint:Or,SetpointPreview:Ar,SolenoidValve:fr,SolenoidValvePreview:hr,StaticMixer:uo,StaticMixerPreview:xo,Switch:Jr,SwitchPreview:Qr,Tank:br,TankPreview:vr,ThreeWayValve:dr,ThreeWayValvePreview:mr,VacuumPump:ro,VacuumPumpPreview:oo,Value:Xr,ValuePreview:Kr,Valve:pr,ValvePreview:jr,typeZ:ba},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=v.d;exports.Density=v.I;exports.MultiSeries=v.yt;exports.Rate=v.$;exports.Series=v.N$1;exports.TimeRange=v.U;exports.TimeSpan=v.w;exports.TimeStamp=v.m;exports.state=v.state;exports.Generic=D.Generic;exports.Align=wo.external;exports.Button=To.external;exports.Caret=ko.Animated$1;exports.telem=p.external;exports.Color=kt.external;exports.Text=ae.external;exports.Triggers=Pt.external;exports.Menu=Po.external;exports.List=$e.external;exports.createFilterTransform=$e.createFilterTransform;exports.fuseFilter=$e.fuseFilter;exports.proxyMemo=$e.proxyMemo;exports.createHexOpacityVariants=fs.createHexOpacityVariants;exports.unitProperty=fs.unitProperty;exports.Input=me.external;exports.Tabs=J.external;exports.Theming=Lo.external;exports.Tree=Mo.external;exports.Video=$o.Video;exports.Accordion=Ko;exports.Canvas=dl;exports.Channel=ni;exports.Control=fc;exports.Device=wi;exports.Diagram=Wc;exports.Eraser=Qi;exports.Form=yi;exports.Icon=ki;exports.Label=Ni;exports.Legend=hl;exports.Line=gl;exports.LinePlot=Fl;exports.Measure=Gl;exports.Modal=zi;exports.Mosaic=Xi;exports.Nav=sc;exports.Note=rc;exports.OS=ac;exports.Observe=Ri;exports.Pluto=Ec;exports.Progress=Cc;exports.Range=Yl;exports.Ranger=Pc;exports.Resize=Fo;exports.Rule=Ul;exports.Schematic=ru;exports.Select=Ml;exports.Status=Bo;exports.Steps=Mc;exports.Synnax=Qo;exports.Tag=Pl;exports.Telem=dc;exports.Tooltip=zo;exports.Value=ga;exports.Viewport=Zl;exports.axis=tl;exports.control=sl;
|
|
1
|
+
"use strict";var vo=Object.defineProperty;var wo=(e,t,s)=>t in e?vo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var he=(e,t,s)=>wo(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-GfklnU2t.cjs"),l=require("./css-C4GOlJsi.cjs"),Ye=require("./external-Cly1pTAH.cjs"),C=require("./aggregator-C5NNOlCt.cjs"),z=require("./Pack-BNnq0Pnk.cjs"),To=require("./external-BCVvWczs.cjs"),ko=require("./external-CqxHdgvr.cjs"),Po=require("./Animated-CPJOHwpl.cjs"),j=require("./LinePlot-DNgFi7SV.cjs"),le=require("zod"),Lt=require("./external-BRvjJOyT.cjs"),ae=require("./external-C1Pb6QsR.cjs"),Mt=require("./external-bcUzt2-X.cjs"),Lo=require("./external-DfXrhUoK.cjs"),$t=require("react-dom"),$e=require("./external-CRCXQIg6.cjs"),gs=require("./units-CKv8dczK.cjs"),me=require("./external-BS_kvhV-.cjs"),Q=require("./external-DLWdjzgl.cjs"),Mo=require("./external-BU8-3fqq.cjs"),$o=require("./external-Xze9tWIL.cjs"),_o=require("./Video-Ch_mMn__.cjs"),Es=({variant:e,...t})=>n.jsxRuntimeExports.jsx(c.St.Circle,{color:c.variantColors[e],...t}),No=({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(z.Space,{className:l.CSS(l.CSS.B("notification"),d),direction:"y",empty:!0,...m,children:[n.jsxRuntimeExports.jsxs(z.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[n.jsxRuntimeExports.jsxs(z.Space,{direction:"x",align:"center",size:"small",children:[n.jsxRuntimeExports.jsx(Es,{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(z.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(z.Space,{direction:"x",align:"center",justify:"end",className:l.CSS(l.CSS.BE("notification","actions")),children:C.A(a).map(f=>n.jsxRuntimeExports.jsx(Bo,{action:f},f.key))})]},t.toString()),Bo=({action:e})=>{if(!x.isValidElement(e)){const t=e;return n.jsxRuntimeExports.jsx(c.Button,{...t})}return e},Oo=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:c.Aggregator,Circle:Es,Notification:No,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"})),Do=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"})),Ke=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:Ke,onDragEnd:Ke})]})});it.displayName="Resize.Core";const _t=({onResize:e,count:t,initialSizes:s=[],minSize:r=100,direction:o="x"})=>{const i=x.useRef(null),[u,a]=x.useState({sizeDistribution:zo(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=>St(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,St]);return{setSize:x.useCallback((f,h)=>d(f,void 0,h),[St]),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=Ao(s),n.jsxRuntimeExports.jsx(z.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 zo=(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)},ft=.001,Ao=e=>e.every(t=>l.C$1.closeTo(t,1/e.length),ft)?e.map((t,s)=>s%2===0?t+ft:s===e.length-1?t:t-ft):e,St=(e,t,s,r,o,i)=>{const u=Rs(e,t,s,o,i),[a,d]=Vo(e.sizeDistribution,s,u,r/t),p=d?o??null:e.root;return{...e,sizeDistribution:a,root:p}},Rs=(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},Vo=(e,t,s,r)=>{let o=t;for(;o>0&&e[o]+s<=r;)o--;const i=e[o]+s,u=Io(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]},Io=(e,t,s,r)=>(e===t.length-1?Fo:Zo)(e,t,s,r),Zo=(e,t,s,r)=>{let o=e+1;for(;o<t.length-1&&t[o]-r<=s;)o++;return o},Fo=(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]),ht=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),h=l.J.construct(s),S=x.useCallback(_=>{if(f.current===null)return 0;const T=l.To.dim(_,l.J.direction(h),!0)*(1-2*Number(["bottom","right"].includes(h))),g=f.current+T,v=l.j(g,r,o);return(v-g)/r>u?ht:v},[h,r,o,u]),R=x.useRef(null),E=x.useCallback(_=>{const T=S(_);m(T),R.current!=null&&(t==null||t(T,l.To.construct(R.current)))},[t,S]),w=x.useCallback(()=>m(_=>(f.current=_,_)),[m]),M=x.useCallback(_=>S(_)===ht&&(e==null?void 0:e()),[e,S]);x.useEffect(()=>m(_=>{const T=l.j(_,r,o);return f.current=T,T}),[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!==ht)),...d})},qo=Object.freeze(Object.defineProperty({__proto__:null,Core:it,Multiple:ct,Single:Cs,calculateDiffPercentage:Rs,useMultiple:_t},Symbol.toStringTag,{value:"Module"})),Ge="y",rs=28,Ho=32,Yo=40,Go=.5,Uo=({data:e,...t})=>{const{setSize:s,props:{sizeDistribution:r,ref:o,...i}}=_t({direction:Ge,count:e.length,minSize:rs}),u=a=>{if(o.current==null)return;const d=l.To.dim(l.To.construct(o.current),Ge);r[a]<Yo/d?s(a,e[a].initialSize??Go):s(a,rs+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(Xo,{...a,key:a.key,index:d,direction:Ge,onExpand:u,parent:o,size:r[d]}))})},Wo=n.jsxRuntimeExports.jsx(c.St.Caret.Down,{"aria-label":"contract"}),Ko=n.jsxRuntimeExports.jsx(c.St.Caret.Right,{"aria-label":"expand"}),Xo=({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),Ge);a=o*p>Ho}const d=a?Wo:Ko;return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsxs(Ye.Header,{level:"p",className:l.CSS.expanded(a),empty:!0,children:[n.jsxRuntimeExports.jsx(Ye.ButtonTitle,{startIcon:d,onClick:()=>u(e),children:t}),r!=null&&n.jsxRuntimeExports.jsx(Ye.Actions,{children:r})]}),s]})},Jo=Object.freeze(Object.defineProperty({__proto__:null,Accordion:Uo},Symbol.toStringTag,{value:"Module"})),Qo=({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 S=C._.get(c.St,t);m=n.jsxRuntimeExports.jsx(S,{})}const h=C.A(e).map(S=>S.split(u)).flat().map((S,R)=>[n.jsxRuntimeExports.jsx(c.St.Caret.Right,{style:{transform:"scale(0.8) translateY(1px)",color:l.CSS.shade(s)}},`${S}-${R}`),S]).flat();return d&&h.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,...h]})},el=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:Qo},Symbol.toStringTag,{value:"Module"})),Nt=x.createContext(j.ZERO_CONTEXT_VALUE),fe=()=>x.useContext(Nt).synnax,tl=()=>x.useContext(Nt).state,os={connected:"success",connecting:"info",disconnected:"info",failed:"error"},ys="serverVersionMismatch",sl=(e,t,s)=>`Cluster version ${s!=null?s+" ":""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,bs=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:os[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.Ay({...t,connectivityPollFrequency:C.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:os[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=sl(h,f.clientVersion,f.nodeVersion);d({variant:"warning",message:"Incompatible cluster version",description:S,data:{type:ys,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(Nt.Provider,{value:r,children:n.jsxRuntimeExports.jsx(c.Composite,{path:u,children:s})})}),nl=Object.freeze(Object.defineProperty({__proto__:null,Provider:bs,SERVER_VERSION_MISMATCH:ys,use:fe,useConnectionState:tl},Symbol.toStringTag,{value:"Module"})),_e=x.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),vs=()=>x.useContext(_e),ws=e=>{const{aliases:t}=x.useContext(_e);return t[e]??null},ut=()=>{const{aliases:e}=x.useContext(_e);return e},xt=(e,t="")=>{const{getName:s}=x.useContext(_e),[r,o]=x.useState(t);return c.useAsyncEffect(async()=>{const i=await s(e);i!=null&&o(i)},[e,s]),r??t},Bt=()=>{const{activeRange:e}=x.useContext(_e);return e??void 0},Ts=({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: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(_e.Provider,{value:{aliases:r,activeRange:e,setAlias:e!=null?u:null,getName:a},children:t})},rl=({channelKey:e,value:t,shadow:s,className:r,...o})=>{const[i,u]=x.useState(!1),{setAlias:a}=vs(),d=ws(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})]})},ge="channel",ol=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"})),ll=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 il({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 cl({color:e,radius:t}){return x.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const al={[pe.Dots]:"#91919a",[pe.Lines]:"#eee",[pe.Cross]:"#e2e2e2"},ul={[pe.Dots]:1,[pe.Lines]:1,[pe.Cross]:6},xl=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ks({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(xl,j.shallow$1),h=u||al[t],S=r||ul[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,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(cl,{color:h,radius:$/i}):x.createElement(il,{dimensions:_,color:h,lineWidth:o})),x.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`}))}ks.displayName="Background";var dl=x.memo(ks);const ml={region:l.To.ZERO,dpr:1,os:C.w$1.getOS()},pl={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},jl=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:ml}),p=x.useRef({...pl}),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(),T=E.transferControlToOffscreen();d({glCanvas:$,upper2dCanvas:_,lower2dCanvas:T,bootstrap:!0,bootstrapped:!1,region:l.To.construct(R),dpr:window.devicePixelRatio,os:C.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: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})]})}),Ot=(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),fl=Object.freeze(Object.defineProperty({__proto__:null,Canvas:jl,useRegion:Ot},Symbol.toStringTag,{value:"Module"})),Ps=x.createContext(null),Re=e=>{const t=x.useContext(Ps);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},Ls=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}`}},Ms=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:P,box:b,stage:O}=y;(P==="pan"&&O!=="start"||P==="zoom"||P==="zoomReset"&&O==="start")&&S(A=>({...A,viewport:b})),R.current.forEach((A,Z)=>Z(y))},[S]),M=x.useCallback(y=>S(P=>({...P,container:y})),[S]),$=Ot(M,{debounce:s}),_=x.useCallback(y=>S(P=>({...P,grid:{...P.grid,[y.key]:y}})),[S]),T=x.useCallback(y=>S(P=>{const{[y]:b,...O}=P.grid;return{...P,grid:O}}),[S]),g=x.useCallback(y=>{p(P=>[...P.filter(({key:b})=>b!==y.key),y])},[p,w]),v=x.useCallback(y=>p(P=>P.filter(({key:b})=>b!==y)),[g]),B=x.useMemo(()=>Sl(h),[h]),L=x.useCallback(y=>{S(P=>({...P,hold:y})),u==null||u(y)},[S,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(Ps.Provider,{value:N,children:n.jsxRuntimeExports.jsx(c.Composite,{path:f,children:o})})})}),Sl=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()},Dt=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:T,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:P,...b},O]=c.use$3({aetherKey:o,type:s,schema:j.coreAxisStateZ,initialState:L});x.useEffect(()=>O(q=>({...q,...L})),[L]),x.useEffect(()=>{const{lower:q,upper:D}=j.parseAutoBounds(b.autoBounds);b.bounds!=null&&(q&&(E==null?void 0:E.lower)!==b.bounds.lower||D&&(E==null?void 0:E.upper)!==b.bounds.upper)&&(T==null||T(b.bounds))},[b.autoBounds,b.bounds]);const A=dt({loc:u,key:`${s}-${o}`,size:y+P,order:"last"},"XAxis"),Z=c.useTypography(d).toString(),I=x.useRef(0);return x.useEffect(()=>{if(e==="y"){if(a==null)return;let D=C.dimensions(a,Z)[l.g.dimension(l.g.construct(p))];D>0&&(D+=9),O(X=>({...X,labelSize:D}))}else{let D=C.dimensions(a,Z).height*1.3;D>0&&(D+=12);const X=I.current;j.withinSizeThreshold(X,D)||(I.current=D,O(ee=>({...ee,labelSize:D})))}},[a,p,Z]),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(z.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=Dt("x"),_s=Dt("y"),Ns=l.q.xy.extend({root:l.J.corner,units:le.z.object({x:le.z.enum(["px","decimal"]),y:le.z.enum(["px","decimal"])})}),hl=Ns.partial({root:!0,units:!0}),gl=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},El=(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},Bs=(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)}},ls=l.To.reRoot(l.To.DECIMAL,l.J.TOP_LEFT),zt=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,...gl(u)});const f=x.useCallback(S=>{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(ls),w=E.box(l.To.construct(m.current)),M=l.k.XY.clamp(l.To.construct(l.To.topLeft(ls),{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 Bs(_,m)},[]),h=at({onStart:x.useCallback(()=>{d.current=El(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(z.Space,{className:l.CSS(e,l.CSS.B("legend")),bordered:!0,rounded:!0,style:r,onDragStart:h,draggable:o,ref:m,...i,onDrag:Ke,onDragEnd:Ke,empty:!0})});zt.displayName="Legend.Container";const At=({data:e=[],onEntryChange:t,position:s,onPositionChange:r,...o})=>{const[i,u]=x.useState(!1);return e.length===0?null:n.jsxRuntimeExports.jsx(zt,{...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(z.Space,{style:{cursor:"pointer"},direction:"x",align:"center",size:"small",children:[n.jsxRuntimeExports.jsx(Lt.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))})},Rl=Object.freeze(Object.defineProperty({__proto__:null,Container:zt,Simple:At,calcStickyPos:Bs,completeStickyXYz:Ns,stickyXYz:hl},Symbol.toStringTag,{value:"Module"})),Os=({className:e,style:t,onLineChange:s,...r})=>{const{lines:o}=Re("Legend");return Re("Legend"),n.jsxRuntimeExports.jsx(At,{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}),Cl=Object.freeze(Object.defineProperty({__proto__:null,Line:Ds},Symbol.toStringTag,{value:"Module"})),Vt=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})}),zs=({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(z.Space,{justify:"center",align:"center",style:o,children:n.jsxRuntimeExports.jsx(c.MaybeEditable,{...t,level:e})})},As=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})}),yl=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:As},Symbol.toStringTag,{value:"Module"})),bl={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},It=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:bl[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]}));It.displayName="ZoomPanMask";const vl=new Set([C.d.UUID,C.d.JSON]),wl=C.d.ALL.filter(e=>e!==C.d.UNKNOWN).map(e=>({key:e.toString(),name:vl.has(e)?e.toString().toUpperCase():l._.capitalize(e.toString())})),Tl=[{key:"name",name:"Name"}],kl=e=>n.jsxRuntimeExports.jsx(ae.DropdownButton,{...e,data:wl,columns:Tl,entryRenderKey:"name"}),Pl=[{key:"x",icon:n.jsxRuntimeExports.jsx(c.St.Arrow.Right,{})},{key:"y",icon:n.jsxRuntimeExports.jsx(c.St.Arrow.Down,{})}],Ll=({key:e,entry:t,onClick:s,selected:r})=>n.jsxRuntimeExports.jsx(c.Icon,{variant:r?"filled":"outlined",onClick:s,children:t.icon},e),Ml=({children:e=Ll,...t})=>n.jsxRuntimeExports.jsx(ae.Button,{...t,allowMultiple:!1,data:Pl,children:e}),Vs=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:T,actions:g,...v})=>{const{visible:B,open:L,close:N,toggle:y}=c.use$1(),[P,b]=x.useState(null),O=d!=null;c.useAsyncEffect(async()=>{if(c.selectValueIsZero(t))return b(null);if((P==null?void 0:P.key)===t)return;let D=null;if(O)try{[D]=await d.retrieve([t])}finally{D??(D=null)}else o!=null&&(D=o.find(X=>X.key===t)??null);b(D)},[d,t,o]);const A=x.useCallback((D,X)=>{Array.isArray(D)||(b(D==null?null:X.entries[0]),N(),e(D,X))},[e,a]),Z=x.useMemo(()=>O?c.Search:$e.Filter,[O]),I=n.jsxRuntimeExports.jsx(Z,{searcher:d,filter:T,children:({onChange:D})=>n.jsxRuntimeExports.jsx($l,{autoFocus:E==="modal",variant:m,onChange:D,onFocus:L,selected:P,entryRenderKey:s,visible:B,allowNone:a,className:p,disabled:h,placeholder:M,children:g})}),q=n.jsxRuntimeExports.jsx(c.Button,{tooltip:$,variant:"outlined",onClick:y,disabled:h,children:P!=null?Is(s,P):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:A,allowNone:a,columns:r,listItem:R,variant:E,trigger:E!=="modal"?I:q,extraDialogContent:E==="modal"?I:void 0,keepMounted:!1,...v})},mt="Select",Is=(e,t)=>t==null?"":typeof e=="function"?e(t):t[e].toString(),$l=({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(t==null?void 0:t.key))return h("");t!=null&&h(Is(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(Vs,{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:C.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:u,...a,children:e})},_l=Object.freeze(Object.defineProperty({__proto__:null,Tag:Ve},Symbol.toStringTag,{value:"Module"})),Ne=({onChange:e,value:t,className:s,data:r,columns:o=[],entryRenderKey:i="key",emptyContent:u,searcher:a,renderTag:d=c.componentRenderProp(Zs),placeholder:p,onTagDragStart:m,allowMultiple:f,allowNone:h,replaceOnSingle:S,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([]),[y,P]=x.useState(!1),b=a!=null;c.useAsyncEffect(async()=>{P(!0),c.selectValueIsZero(t)&&N([]);const q=L.map(ee=>ee.key),D=C.A(t);if(C.y.unorderedPrimitiveArrays(q,D)===C.y.EQUAL)return;let X=[];if(b)try{X=await a.retrieve(D)}finally{P(!1)}else r!=null&&(X=r.filter(ee=>D.includes(ee.key)));N(X)},[a,b,t,r]);const O=x.useCallback((q,D)=>{q!=null&&(N(D.entries),e(C.A(q),D))},[e]),A=x.useMemo(()=>b?c.Search:$e.Filter,[b]);let Z,I;if($==="connected")I=n.jsxRuntimeExports.jsx(A,{searcher:a,children:({onChange:q,value:D})=>n.jsxRuntimeExports.jsx(Nl,{value:D,selectedKeys:t,className:s,onChange:q,loading:y,selected:L,onFocus:v,entryRenderKey:i,visible:g,renderTag:d,placeholder:p,onTagDragStart:m,onTagDragEnd:R,style:E,children:_})});else{const q=C.A(t);I=n.jsxRuntimeExports.jsxs(z.Space,{direction:"x",align:"center",grow:!0,style:E,size:"small",children:[q.map(D=>{const X=L.find(ee=>ee.key===D);return d({key:D,entryKey:D,entryRenderKey:i,loading:y,entry:X,onClose:()=>{const ee=q.filter(qe=>qe!==D);e(ee,{clicked:null,clickedIndex:-1,entries:[]})},onDragStart:ee=>m==null?void 0:m(ee,D),onDragEnd:ee=>R==null?void 0:R(ee,D)})}),q.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:D=>n.jsxRuntimeExports.jsx(c.Text$1,{autoFocus:!0,placeholder:"Search",...D,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:$,...T})},Nl=({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()},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),h),onBlur:T,placeholder:d,value:f,onChange:r,onFocus:$,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:_,...R,children:[n.jsxRuntimeExports.jsx(z.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(Vs,{onClick:w})]})},Zs=({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()},C.B(i))},Bl=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:ae.BaseButton,Button:ae.Button,DEFAULT_PLACEHOLDER:mt,DataType:kl,Direction:Ml,DropdownButton:ae.DropdownButton,Multiple:Ne,MultipleTag:Zs,Single:ye,defaultButton:ae.defaultButton},Symbol.toStringTag,{value:"Module"})),Ue=6,Ol=2,is=5,Dl=e=>l.To.width(e)<is&&l.To.height(e)<is,zl=["zoom","pan","select","zoomReset"],Ae=[...zl,"click"],Al=le.z.enum(Ae),Fs=["zoom","select"],We={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},qs={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},Hs={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},Zt={zoom:We,pan:qs,select:Hs,zoomReset:We,click:We},Vl=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)]))},Il=l.To.construct(0,0,1,1,l.J.TOP_LEFT),Zl={width:30,height:50},Ys=({onChange:e,triggers:t,initial:s=Il,threshold:r=Zl,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,Ue)),[s]),x.useEffect(()=>p(i),[i]);const[E,w,M,$]=c.useMemoCompare(()=>{const L={...Zt[i],...t},N=c.flattenConfig(L),y=Vl(L);return[L,N,y,c.flattenConfig(y)]},c.compareModeConfigs,[t]),_=x.useCallback(({box:L,triggers:N,stage:y,cursor:P})=>{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:P}),f(l.To.DECIMAL);const A=Dl(L);if(y==="end"){if(A){b==="zoom"&&a(l.To.ZERO),e==null||e({box:m.current,mode:"click",stage:y,cursor:P});return}return f(I=>{if(b==="pan"){const D=cs(L,I,O);return D===null||l.To.equals(D,I)?I:(e==null||e({box:D,mode:b,stage:y,cursor:P}),D)}const q=T(L,I,O);return q===null?I:(e==null||e({box:q,mode:b,stage:y,cursor:P}),b==="zoom"?(a(l.To.ZERO),q):l.To.truncate(I,Ue))})}if(Fs.includes(b))return A?void 0:a(l.k.XY.scale(O).clamp(O).translate({x:-l.To.left(O),y:-l.To.top(O)}).box(as(R,L,O)));if(a(I=>l.To.areaIsZero(I)?I:l.To.ZERO),l.q.distance(P,h.current)<Ol)return;h.current=P;const Z=cs(L,m.current,O);e==null||e({box:Z,mode:b,stage:y,cursor:P})},[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 T=x.useCallback((L,N,y)=>l.To.truncate(yt(N,y).box(as(R,L,y)),Ue),[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 P=l.To.construct(S.current),b=l.q.construct(N);if(!l.To.contains(P,b)||N.target!==S.current)return;const A=yt(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:A.x*(1-y),y:v.current.held?0:A.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]),Mt.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}},yt=(e,t)=>l.k.XY.scale(t).clamp(t).scale(e),cs=(e,t,s)=>{let r=l.To.signedDims(yt(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),Ue)},as=(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,Fl=({mode:e,triggers:t})=>n.jsxRuntimeExports.jsxs(z.Space,{direction:"x",align:"center",children:[n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:l._.capitalize(e)}),n.jsxRuntimeExports.jsx(Mt.Text,{trigger:t[0],level:"small"})]}),ql={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,{})},Hl=({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:ql[o],tooltip:n.jsxRuntimeExports.jsx(Fl,{mode:o,triggers:i})})).sort((o,i)=>Ae.indexOf(o.key)-Ae.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)})},Yl=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:Zt,MASK_MODES:Fs,MODES:Ae,Mask:It,PAN_DEFAULT_TRIGGERS:qs,SELECT_DEFAULT_TRIGGERS:Hs,SelectMode:Hl,ZOOM_DEFAULT_TRIGGERS:We,modeZ:Al,use:Ys},Symbol.toStringTag,{value:"Module"})),Gs=e=>e==null?null:document.querySelectorAll(".pluto-line-plot__viewport")[0]??null,Ft=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=Ys({onChange:u,initial:t,ref:o,...r});return n.jsxRuntimeExports.jsx(It,{className:l.CSS.BE("line-plot","viewport"),...a,children:e})});Ft.displayName="Viewport";const Gl=Object.freeze(Object.defineProperty({__proto__:null,Legend:Os,Line:Vt,LinePlot:Ms,Title:zs,Tooltip:yl,Viewport:Ft,XAxis:$s,YAxis:_s,axisFactory:Dt,selectViewportEl:Gs,useContext:Re,useGridEntry:dt,useViewport:Ls},Symbol.toStringTag,{value:"Module"})),Ul=c.wrap$1("Tooltip",({aetherKey:e,...t})=>(c.use$3({aetherKey:e,type:j.Annotation.TYPE,schema:j.annotationStateZ,initialState:t}),null)),Us=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(z.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})})}),Wl=Object.freeze(Object.defineProperty({__proto__:null,Annotation:Ul,Provider:Us},Symbol.toStringTag,{value:"Module"})),Ws={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},Kl=c.flattenConfig(Ws),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:Kl,loose:!0}),o=x.useCallback(({mode:a,cursor:d})=>{if(a==="click"){const p=c.determineMode(Ws,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]);Ls(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})}),Xl=Object.freeze(Object.defineProperty({__proto__:null,Measure:Ks},Symbol.toStringTag,{value:"Module"})),qt=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 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(h);h!==R.current&&(R.current=h);const E=x.useRef(h);x.useEffect(()=>{S(T=>({...T,position:s,color:u,lineWidth:a,lineDash:d}))},[s,u,a,d]);const w=at({onStart:x.useCallback(()=>{S(T=>({...T,dragging:!0})),E.current=R.current},[]),onMove:T=>{S(g=>({...g,pixelPosition:(E.current??0)+l.To.signedHeight(T)}))},onEnd:x.useCallback(()=>{S(T=>({...T,dragging:!1})),E.current=h},[])}),M=x.useRef(null);if(f==null||h==null)return null;const $=Gs(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(z.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?_:$t.createPortal(_,$)}),Jl=Object.freeze(Object.defineProperty({__proto__:null,Rule:qt},Symbol.toStringTag,{value:"Module"})),Xs=c.canDropOfType(ge),Ql=({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:_,...T})=>{var N;const g=t.filter(({location:y})=>l.J.isY(y)),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(Ms,{...T,children:[g.map((y,P)=>{const b=e.filter(Z=>Z.axes.x===y.key),O=t.filter(({location:Z})=>l.J.isX(Z)),A=S==null?void 0:S.filter(Z=>[...O.map(({key:I})=>I),y.key].includes(Z.axis));return n.jsxRuntimeExports.jsx(ei,{axis:y,index:P,lines:b,yAxes:O,rules:A,onAxisChannelDrop:f,onAxisChange:h,annotationProvider:_},y.key)}),i&&n.jsxRuntimeExports.jsx(Os,{onLineChange:p,position:u,onPositionChange:a}),s&&n.jsxRuntimeExports.jsx(zs,{value:r,onChange:o,level:d}),n.jsxRuntimeExports.jsxs(Ft,{initial:w,onChange:M,triggers:$,ref:v,children:[R&&n.jsxRuntimeExports.jsx(As,{}),E&&n.jsxRuntimeExports.jsx(Ks,{})]})]})},ei=({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:Xs,onDrop:x.useCallback(({items:E})=>{const w=c.filterByType(ge,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($s,{...m,...h,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(si,{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(qt,{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(Us,{...f})]})},ti=({channels:{x:e,y:t}})=>`${e??0}-${t}`,si=({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:Xs,onDrop:x.useCallback(({items:m})=>{const f=c.filterByType(ge,m);return r==null||r(i,f.map(({key:h})=>h)),f},[i,r])}),p=c.useDraggingState();return n.jsxRuntimeExports.jsxs(_s,{...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(ni,{line:m},ti(m))),t==null?void 0:t.map(m=>x.createElement(qt,{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})}))]})},ni=({line:e})=>e.variant==="static"?n.jsxRuntimeExports.jsx(oi,{line:e}):n.jsxRuntimeExports.jsx(ri,{line:e}),ri=({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(Vt,{aetherKey:e,y:u,x:d,...o})},oi=({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(Vt,{aetherKey:t,y:i,x:a,...o})},us=[{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(ge,e);return s.length>0&&!s.every(r=>t.includes(r.key))},Js=["name","alias"],Qs=e=>{const t=ut();return x.useMemo(()=>e.length===0?us:us.filter(s=>e.includes(s.key)),[e,t])},li=({columns:e=Js,onChange:t,className:s,value:r,searchOptions:o,...i})=>{const u=fe(),a=ut(),d=Qs(e),p=Bt(),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(T=>Xe(T,C.A(r)),[r]),onDrop:x.useCallback(({items:T})=>{const g=c.filterByType(ge,T);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:T})=>{t(C.A(r).filter(g=>!T.some(v=>v.key===g)),{clickedIndex:null,clicked:null,entries:[]})},[t,r]),$=x.useCallback((T,g)=>S([{key:g,type:ge}],M),[S,M]),_=x.useCallback(T=>a[T.key]??T.name,[a]);return n.jsxRuntimeExports.jsx(Ne,{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=Js,onChange:t,value:s,className:r,data:o,searchOptions:i,...u})=>{const a=fe(),d=ut(),p=Qs(e),m=Bt(),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(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(ye,{data:o,className:l.CSS(r,l.CSS.dropRegion(Xe(_,C.o(s)))),value:s,onDragStart:T,onDragEnd:M,onChange:t,searcher:h,columns:p,emptyContent:S,entryRenderKey:g,...$,...u})},ii=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:rl,AliasProvider:Ts,LinePlot:Ql,SelectMultiple:li,SelectSingle:Ce,useActiveRange:Bt,useAlias:ws,useAliases:ut,useContext:vs,useName:xt},Symbol.toStringTag,{value:"Module"})),en=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"]}),xs=(e,t)=>{if(e==null)return null;const s=e[t];return s==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:s},ci=(e,t,s)=>C.u(xs(e,"shape"),en(t),{...s,getter:xs}),ai=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:ci,getFieldSchemaPath:en},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(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}},tn=(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},ui=(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},xi=e=>{var t,s;return((s=(t=tn(e,!0))==null?void 0:t.status)==null?void 0:s.variant)==="success"},di=({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])},mi=({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},sn=(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)}}),pi=({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,...sn(r,e)}),[u,r,e])},Ht=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(Ht);return e??t},ds=e=>({key:e,variant:"success",message:""}),ji=e=>e.code===le.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",nn=({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,y=B?L:N;return y.has(g)||y.set(g,new Set),(P=y.get(g))==null||P.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 P={value:y,status:L.get(g)??ds(g),touched:N.has(g),required:!1};if(u.current==null)return P;const b=u.current,O=ai.getFieldSchema(b,g,{optional:!0});return O==null||(P.required=!O.isOptional()),P},[]),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(P=>{var O;const b=p(P,{optional:!0});b!=null&&((O=v.get(P))==null||O.forEach(A=>{A(b)}))}),[...B.keys()].forEach(P=>{var O;const b=p(P,{optional:!0});b!=null&&((O=B.get(P))==null||O.forEach(A=>{A(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 A=[...L.keys()];return L.clear(),A.forEach(Z=>h(Z)),!0}let P=!0;const b=new Set(g.error.issues.map(A=>A.path.join(".")));let O=(A,Z)=>A===Z;return B&&(O=(A,Z)=>C._.pathsMatch(A,Z)),g.error.issues.forEach(A=>{var X;const{message:Z}=A,I=A.path.join(".");if(!O(I,v))return;const q=ji(A);q!=="warning"&&(P=!1),L.set(I,{key:I,variant:q,message:Z}),y.add(I);let D=p(I,{optional:!0});D==null&&(D={value:void 0,status:L.get(I)??ds(I),touched:!1,required:!1}),(X=N.get(I))==null||X.forEach(ee=>ee(D))}),L.forEach((A,Z)=>{b.has(Z)||(L.delete(Z),h(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=C._.get(i.current.state,g,{optional:!0}),{validateChildren:N=!0}=B,{state:y,touched:P}=i.current;P.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)},[]),T=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:T,reset:f}),[d,M,p,E,w,$,m,_,T,f,r])},fi=e=>n.jsxRuntimeExports.jsx(Ht.Provider,{value:e,children:e.children}),Si=c.componentRenderProp(c.Text$1),je=({path:e,children:t=Si,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(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)})},ke=e=>({fieldKey:t,fieldProps:s,inputProps:r})=>{const o=({inputProps:i,path:u,fieldKey:a=t,...d})=>n.jsxRuntimeExports.jsx(je,{...s,...d,path:a?`${u}.${a}`:u,children:p=>n.jsxRuntimeExports.jsx(e,{...p,...r,...i})});return o.displayName=e.displayName,o},rn=ke(c.Numeric),hi=rn({}),on=ke(c.Text$1),gi=on({}),ln=ke(c.Switch$1),Ei=ln({}),Ri=ke(ye),Ci=ke(Ne),yi=ke(ae.DropdownButton),Yt=({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])},bi=({fetchInitialValue:e,...t})=>{const[s,r]=x.useState(void 0);return c.useAsyncEffect(async()=>{r(await e())},[e]),Yt({...t,onChange:r}),s},vi=Object.freeze(Object.defineProperty({__proto__:null,useListener:Yt,useState:bi},Symbol.toStringTag,{value:"Module"})),wi=({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=nn({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 Yt({key:m,open:h,onChange:S}),f},Ti=Object.freeze(Object.defineProperty({__proto__:null,Context:Ht,Field:je,Form:fi,NumericField:hi,SwitchField:Ei,TextField:gi,buildDropdownButtonSelectField:yi,buildNumericField:rn,buildSelectMultiField:Ci,buildSelectSingleField:Ri,buildSwitchField:ln,buildTextField:on,fieldArrayUtils:sn,fieldBuilder:ke,use:nn,useChildFieldValues:mi,useContext:be,useField:Te,useFieldArray:pi,useFieldListener:di,useFieldState:tn,useFieldValid:xi,useFieldValue:ui,useSynced:wi},Symbol.toStringTag,{value:"Module"})),ki=[{key:"name",name:"Name"},{key:"location",name:"Location"}],Pi=({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(ye,{columns:ki,searcher:r,entryRenderKey:"name",...t})},Li=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:Pi},Symbol.toStringTag,{value:"Module"})),He=(e,t)=>x.cloneElement(e,{className:l.CSS(e.props.className,l.CSS.B("sub"),l.CSS.M(t))}),Gt=({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]}),Mi=e=>n.jsxRuntimeExports.jsx(Gt,{topRight:n.jsxRuntimeExports.jsx(c.St.Add,{}),...e}),$i=e=>n.jsxRuntimeExports.jsx(Gt,{topRight:n.jsxRuntimeExports.jsx(c.St.Import,{}),...e}),_i=Object.freeze(Object.defineProperty({__proto__:null,Create:Mi,Icon:Gt,Import:$i},Symbol.toStringTag,{value:"Module"})),Le="label",Ut=[{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"}],Je=({items:e},t)=>{const s=c.filterByType(Le,e);return s.length>0&&!s.every(r=>t.includes(r.key))},Ni=({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}),Bi=c.componentRenderProp(Ni),Oi=({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(h=>Je(h,C.A(s)),[s]),onDrop:x.useCallback(({items:h})=>{const S=c.filterByType(Le,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:Le}],m),[u,m]);return n.jsxRuntimeExports.jsx(Ne,{className:l.CSS(t,l.CSS.dropRegion(Je(p,C.A(s)))),value:s,onTagDragStart:f,onTagDragEnd:a,searcher:o==null?void 0:o.labels,onChange:e,columns:Ut,emptyContent:i,renderTag:Bi,addPlaceholder:"Label",...d,...r})},cn=({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=>Je(p,C.o(e)),[e]),onDrop:x.useCallback(({items:p})=>{const m=c.filterByType(Le,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:Le,key:e}]),[u.startDrag,e]);return{emptyContent:r,dragging:a,...u,onDragStart:d,searcher:s==null?void 0:s.labels}},Di=({onChange:e,value:t,className:s,data:r,...o})=>{const{dragging:i,...u}=cn({value:t,onChange:e});return n.jsxRuntimeExports.jsx(ye,{data:r,className:l.CSS(s,l.CSS.dropRegion(Je(i,C.o(t)))),value:t,onChange:e,columns:Ut,entryRenderKey:"name",...u,...o})},zi=({data:e,value:t,onChange:s,...r})=>{const{dragging:o,...i}=cn({value:t,onChange:s});return n.jsxRuntimeExports.jsx(ye,{data:e,value:t,onChange:s,columns:Ut,entryRenderKey:"name",...i,...r})},Ai=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:Le,SelectButton:zi,SelectMultiple:Oi,SelectSingle:Di},Symbol.toStringTag,{value:"Module"})),Vi=({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}),$t.createPortal(n.jsxRuntimeExports.jsx(z.Space,{className:l.CSS(l.CSS.BE("modal","bg"),l.CSS.visible(e)),empty:!0,align:"center",children:n.jsxRuntimeExports.jsx(z.Space,{className:l.CSS(l.CSS.BE("modal","dialog")),role:"dialog",empty:!0,ref:i,...o,style:{zIndex:11,...r},children:n.jsxRuntimeExports.jsx(z.Space,{className:l.CSS(l.CSS.BE("modal","content")),empty:!0,children:t})})}),c.getRootElement())},Ii=Object.freeze(Object.defineProperty({__proto__:null,Modal:Vi},Symbol.toStringTag,{value:"Module"})),Wt=new Error("Tab not found"),Zi=new Error("Invalid Mosaic"),Qe=(e,t,s="center",r)=>{var f;if(e=Pe(e),r===void 0)return bt(e,t);const o=wt(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(wt(e,a).key!==o.key)return Qe(e,t,"center",a);if(o.tabs==null||o.tabs.length===0)return Qe(e,t,"center",r);const[d,p,m]=Hi(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 Zi;return o.first.key=i,o.last.key=u,o.tabs=void 0,o.size=void 0,o.selected=void 0,e},bt=(e,t)=>(e=Pe(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=bt(e.first,t):e.last!=null&&(e.last=bt(e.last,t)),e)),et=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]=et(e.first);e.first=s,t.push(...r)}if(e.last!=null){const[s,r]=et(e.last);e.last=s,t.push(...r)}return[e,t]},Kt=(e,t)=>{var o;e=Pe(e);const[,s]=Me(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=qi(e);const r=s.selected??tt(e);return[e,r]},tt=e=>e.selected!=null?e.selected:e.first!=null?tt(e.first):e.last!=null?tt(e.last):null,an=(e,t)=>{e=Pe(e);const[s,r]=Me(e,t);if(s==null||r==null)throw Wt;return r.selected=t,e},un=(e,t,s,r)=>{e=Pe(e);const[o,i]=Me(e,t);if(o==null||i==null)throw Wt;const[u,a]=Kt(e,t);return[Qe(u,o,s,r),a]},vt=(e,t)=>{if(e.tabs!=null)return e.tabs.some(s=>s.tabKey===t)?e:void 0;if(e.first!=null){const s=vt(e.first,t);if(s!=null)return s}if(e.last!=null){const s=vt(e.last,t);if(s!=null)return s}},xn=(e,t,s)=>{const r=st(e,t);if(r==null)throw new Error("Node not found");return r.size=s,e},dn=(e,t,s)=>{e=Pe(e);const[,r]=Me(e,t);if((r==null?void 0:r.tabs)==null)throw Wt;return r.tabs=Q.rename(t,s,(r==null?void 0:r.tabs)??[]),e},Fi=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,wt=(e,t)=>{const s=st(e,t);if(s!=null)return s;const r=Math.floor(t/2);return r===0?e:wt(e,r)},qi=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(ps(e.first))return[ms(e.last,!0),!0];if(ps(e.last))return[ms(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]},ms=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),ps=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),Me=(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]=Me(e.first,t);if(s!=null&&r!=null)return[s,r];const[o,i]=Me(e.last,t);return[o,i]},st=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const s=st(e.first,t);return s??st(e.last,t)},Hi=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),nt=(e,t,s=[])=>(s.push(t(e)),e.first!=null&&nt(e.first,t,s),e.last!=null&&nt(e.last,t,s),s),kt=(e,t)=>{t(e),e.first!=null&&kt(e.first,t),e.last!=null&&kt(e.last,t)};class Yi{constructor(t={}){he(this,"parent");he(this,"stub");he(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 Gi=({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})},Ui=({node:e,children:t})=>$t.createPortal(t,e.el),mn=x.memo(({children:e,...t})=>{const s=x.useRef(new Map),r=new Set,o=nt(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 Yi({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(Ui,{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(rt,{portalNodes:s,...t})]})}),rt=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}=_t({direction:o,onResize:f,count:2,initialSizes:d!=null?[d]:void 0});let S;return r!==void 0?S=n.jsxRuntimeExports.jsx(pn,{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(rt,{...m,root:i,onResize:t},i.key),n.jsxRuntimeExports.jsx(rt,{...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});mn.displayName="Mosaic";rt.displayName="Mosaic";const ot="pluto-mosaic-tab-drop",Xt="pluto-mosaic-tab-create",Wi=(e,t,s)=>{if(c.filterByType(c.FILE_TYPE,t).length>0&&s)return!0;const o=c.filterByType(ot,t).map(a=>a.key),i=e.filter(a=>!o.includes(a.tabKey)).length>0;return c.filterByType(Xt,t).length>0||o.length>0&&(i||e.length===0)},pn=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})=>Wi(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":fs(js(v));if(B)return i==null||i(a,L,v),g;const N=c.filterByType(ot,g);if(N.length>0){const P=N.map(({key:b})=>b)[0];t(a,P,L)}const y=c.filterByType(Xt,g);if(y.length>0){const P=y.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":fs(js(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:ot,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(Gi,{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:Ki[p]})]})});pn.displayName="MosaicTabLeaf";const Ki={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%"}},js=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}},Xi=e=>e,Ji=e=>1-e,fs=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[s,r]=[Xi(e),Ji(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")},Qi=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()}),Pt=Qi.extend({first:le.z.lazy(()=>Pt).optional(),last:le.z.lazy(()=>Pt).optional()}),ec=({allowRename:e=!1,initialTree:t})=>{const[s,r]=x.useState(t);return x.useEffect(()=>r(et(t)[0]),[t]),{root:s,onDrop:(p,m,f)=>r(h=>un(h,m,f,p)[0]),onClose:p=>r(m=>Kt(m,p)[0]),onSelect:p=>r(m=>an(m,p)),onResize:(p,m)=>r(f=>xn(f,p,m)),onRename:e?(p,m)=>r(f=>dn(f,p,m)):void 0}},tc=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Xt,HAUL_DROP_TYPE:ot,Mosaic:mn,autoSelectTabs:et,findSelected:tt,findTabNode:vt,forEachNode:kt,insertTab:Qe,isEmpty:Fi,mapNodes:nt,moveTab:un,nodeZ:Pt,removeTab:Kt,renameTab:dn,resizeNode:xn,selectTab:an,use:ec},Symbol.toStringTag,{value:"Module"})),sc=({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(z.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(z.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}),jn=Ze("start");jn.displayName="NavbarStart";const fn=Ze("end");fn.displayName="NavbarEnd";const Sn=Ze("center");Sn.displayName="NavbarCenter";const hn=Ze("");hn.displayName="NavbarContent";const gn=Ze("absolute-center");gn.displayName="NavbarAbsoluteCenter";const Be=sc;Be.Start=jn;Be.Center=Sn;Be.End=fn;Be.AbsoluteCenter=gn;Be.Content=hn;const Jt=({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}},nc=c.wrap$1(j.Eraser$1.TYPE,({aetherKey:e,children:t})=>{const{erase:s}=Jt({aetherKey:e}),r=c.useResize(s);return n.jsxRuntimeExports.jsx("div",{ref:r,className:l.CSS(l.CSS.inheritDims()),children:t})}),rc=Object.freeze(Object.defineProperty({__proto__:null,Eraser:nc,use:Jt},Symbol.toStringTag,{value:"Module"})),oc=({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}},lc=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}=Jt({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(Cs,{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)}),ic=Object.freeze(Object.defineProperty({__proto__:null,Bar:Be,Drawer:lc,useDrawer:oc},Symbol.toStringTag,{value:"Module"})),cc=({variant:e,className:t,children:s,...r})=>n.jsxRuntimeExports.jsx(z.Space,{className:l.CSS(t,l.CSS.B("note"),l.CSS.M(e)),align:"stretch",empty:!0,...r,children:s}),ac=Object.freeze(Object.defineProperty({__proto__:null,Note:cc},Symbol.toStringTag,{value:"Module"})),gt={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"})]})},uc=({disabled:e=[],className:t,focused:s=!0,onMinimize:r,onMaximize:o,onFullscreen:i,onClose:u,...a})=>n.jsxRuntimeExports.jsxs(z.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(Et,{onClick:u,className:l.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:gt.Close}),n.jsxRuntimeExports.jsx(Et,{onClick:r,className:l.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:gt.Minimize}),n.jsxRuntimeExports.jsx(Et,{onClick:i,className:l.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:gt.Maximize})]}),Et=({className:e,disabled:t,...s})=>n.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("macos-control"),l.CSS.disabled(t),e),tabIndex:-1,disabled:t,size:"",...s}),Rt=({disabled:e=[],onMinimize:t,onMaximize:s,onClose:r,onFullscreen:o,focused:i,...u})=>n.jsxRuntimeExports.jsxs(z.Pack,{...u,children:[n.jsxRuntimeExports.jsx(Ct,{className:l.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:n.jsxRuntimeExports.jsx(c.St.Subtract,{})}),n.jsxRuntimeExports.jsx(Ct,{className:l.CSS.BM("windows-control","maximize"),onClick:s,disabled:e.includes("maximize"),children:n.jsxRuntimeExports.jsx(c.St.Box,{})}),n.jsxRuntimeExports.jsx(Ct,{onClick:r,className:l.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:n.jsxRuntimeExports.jsx(c.St.Close,{})})]}),Ct=({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}),En=e=>C.w$1.getOS(e),xc={MacOS:uc,Windows:Rt,Linux:Rt,Docker:Rt},dc="Windows",mc=({forceOS:e,visibleIfOS:t,...s})=>{const r=En({force:e,default:dc}),o=xc[r];return t!=null&&t!==r?null:n.jsxRuntimeExports.jsx(o,{...s})},pc=Object.freeze(Object.defineProperty({__proto__:null,Controls:mc,use:En},Symbol.toStringTag,{value:"Module"}));x.createContext({instrumentation:C.B$1.NOOP});const jc=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})}),fc="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjQgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",Rn=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})}),Sc=Object.freeze(Object.defineProperty({__proto__:null,Provider:Rn},Symbol.toStringTag,{value:"Module"})),hc=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.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: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}=hc(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})})}),yn=x.createContext({needsControlOf:[]}),bn=()=>x.useContext(yn),gc=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(yn.Provider,{value:{needsControlOf:a},children:[n.jsxRuntimeExports.jsx(c.Composite,{path:i,children:t}),";"]})}),vn=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}})]})}),Ec=c.wrap$1(j.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:s}=bn(),[,{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(At,{data:u,...t})}),wn=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})}),Rc=Object.freeze(Object.defineProperty({__proto__:null,Chip:Cn,Controller:gc,Indicator:vn,Legend:Ec,StateProvider:wn,useContext:bn},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},Cc=Tn(Rn),yc=Tn(c.Provider$3),bc=({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??fc,enabled:s,children:n.jsxRuntimeExports.jsx(yc,{workerKey:"vis",children:n.jsxRuntimeExports.jsx(jc,{...a,children:n.jsxRuntimeExports.jsx(c.Aggregator,{children:n.jsxRuntimeExports.jsx(bs,{connParams:t,children:n.jsxRuntimeExports.jsx(Ts,{...p,children:n.jsxRuntimeExports.jsx(Cc,{...m,children:n.jsxRuntimeExports.jsx(c.Provider,{...o,children:n.jsxRuntimeExports.jsx(wn,{children:e})})})})})})})})})})})}),vc=Object.freeze(Object.defineProperty({__proto__:null,Provider:bc},Symbol.toStringTag,{value:"Module"})),wc=({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}%`}})}),Tc=Object.freeze(Object.defineProperty({__proto__:null,Progress:wc},Symbol.toStringTag,{value:"Module"})),Ie="range",Qt=[{key:"name",name:"Name"}],lt=({items:e},t)=>{const s=c.filterByType(Ie,e);return s.length>0&&!s.every(r=>t.includes(r.key))},kc=({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(h=>lt(h,C.A(s)),[s]),onDrop:x.useCallback(({items:h})=>{const S=c.filterByType(Ie,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:Ie}],m),[u,m]);return n.jsxRuntimeExports.jsx(Ne,{className:l.CSS(t,l.CSS.dropRegion(lt(p,C.A(s)))),value:s,onTagDragStart:f,onTagDragEnd:a,searcher:o==null?void 0:o.ranges,onChange:e,columns:Qt,emptyContent:i,entryRenderKey:"name",...d,...r})},kn=({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=>lt(m,C.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}},Pc=({onChange:e,value:t,className:s,data:r,...o})=>{const{dragging:i,...u}=kn({value:t,onChange:e});return n.jsxRuntimeExports.jsx(ye,{data:r,className:l.CSS(s,l.CSS.dropRegion(lt(i,C.o(t)))),value:t,onChange:e,columns:Qt,entryRenderKey:"name",...u,...o})},Lc=({data:e,value:t,onChange:s,...r})=>{const{dragging:o,...i}=kn({value:t,onChange:s});return n.jsxRuntimeExports.jsx(ye,{data:e,value:t,onChange:s,columns:Qt,entryRenderKey:"name",...i,...r})},Mc=[{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"}],$c=e=>{const t=fe();return n.jsxRuntimeExports.jsx(Ne,{...e,searcher:t==null?void 0:t.labels,columns:Mc,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})})},_c=({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(z.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(),")"]})]})},Nc=Object.freeze(Object.defineProperty({__proto__:null,SelectButton:Lc,SelectLabels:$c,SelectMultiple:kc,SelectSingle:Pc,TimeRangeChip:_c},Symbol.toStringTag,{value:"Module"})),Bc=({steps:e,value:t,onChange:s,...r})=>{const o=e.findIndex(i=>i.key===t);return n.jsxRuntimeExports.jsx(z.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))})},Oc=Object.freeze(Object.defineProperty({__proto__:null,Steps:Bc},Symbol.toStringTag,{value:"Module"})),Dc=(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},es=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=es(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)))},zc=(e,t)=>pt.fromFlow(e,t);class Pn{constructor(t,s){he(this,"node_",null);he(this,"position");he(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){he(this,"key");he(this,"box");he(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=es(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 Pn(m,h)});return new pt(t,r,a)}}const Ac=({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)??"")}),h=j.useReactFlow(),S=j.segmentsToPoints(l.q.construct(e,t),f,h.getZoom(),!1);return n.jsxRuntimeExports.jsx(j.BaseEdge,{path:Ln(S),style:{...a,stroke:l.cssString(d==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},Vc=({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(),[_,T,g]=c.useCombinedStateAndRef(()=>a.length>0?a:j.buildNew({sourcePos:h,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 O=l.q.translation(S.current,h),A=l.q.translation(E,w.current);l.q.equals(O,l.q.scale(A,-1),.001)?(S.current=h,w.current=E):(R?M||(b=j.moveTargetNode({delta:A,segments:b}),v.current!==i&&(v.current=i,b=j.buildNew({sourcePos:h,targetPos:E,sourceOrientation:r,targetOrientation:i,sourceBox:oe($,t),targetBox:oe($,s)})),j.checkIntegrity({sourcePos:h,targetPos:E,next:b,prev:_})||(b=j.buildNew({sourcePos:h,targetPos:E,sourceOrientation:r,targetOrientation:i,sourceBox:oe($,t),targetBox:oe($,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:oe($,t),targetBox:oe($,s)})),j.checkIntegrity({sourcePos:h,targetPos:E,next:b,prev:_})||(b=j.buildNew({sourcePos:h,targetPos:E,sourceOrientation:r,targetOrientation:i,sourceBox:oe($,t),targetBox:oe($,s)})),S.current=h),L(b),T(b))}const N=x.useRef(null),y=at({onStart:x.useCallback((b,O,A)=>{N.current={index:Number(A.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()});T(O)},[]),onEnd:x.useCallback(()=>d(g.current),[d])}),P=j.segmentsToPoints(h,_,$.getZoom(),!0);return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(j.BaseEdge,{path:Ln(P),style:{...u,stroke:l.cssString(p)},...f}),m&&Ic(P).map((b,O)=>{const A=_[O].direction,Z=l.g.swap(A),I={[l.g.dimension(A)]:"18px",[l.g.dimension(Z)]:"4px"},q={[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,...q,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(A)),draggable:!0,onDragStart:y})})]},O)})]})},Ln=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},Ic=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)}),Zc=({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}},Fc=e=>e.source!==e.target,qc={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1},Hc={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},Mn={padding:0,maxZoom:1,minZoom:.5},Yc={hideAttribution:!0},$n=x.createContext({editable:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),Fe=()=>x.useContext($n),_n=x.memo(({children:e})=>{const{registerNodeRenderer:t}=Fe();return x.useEffect(()=>t(e),[t,e]),null});_n.displayName="NodeRenderer";const Gc=["Backspace","Delete"],Uc=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??Zt.zoom,c.compareModeConfigs,[p]),{fitView:$}=j.useReactFlow(),_=Ot(x.useCallback(F=>{f&&$({maxZoom:1}),E(K=>({...K,region:F}))},[E,$,f])),T=x.useRef(null),g=x.useCallback(F=>{const K=T.current;K!=null&&K.x===F.x&&K.y===F.y&&K.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:K,yPos:re,selected:ze})=>v({symbolKey:F,position:{x:K,y:re},selected:ze})}),[v]),y=x.useRef(i),P=x.useMemo(()=>(y.current=i,j.translateEdgesForward(i)),[i]),b=x.useRef(o),O=x.useMemo(()=>(b.current=o,j.translateNodesForward(o)),[o]),A=x.useCallback(F=>s(j.nodeConverter(b.current,K=>j.applyNodeChanges(F,K))),[s]),Z=x.useCallback(F=>r(j.edgeConverter(y.current,K=>j.applyEdgeChanges(F,K),w)),[r,w]),I=x.useCallback((F,K)=>r(j.edgeConverter(y.current,re=>j.updateEdge(F,K,re),w)),[]),q=x.useCallback(F=>{r(j.edgeConverter(y.current,K=>j.addEdge(F,K),w))},[r,w]),D=x.useCallback((F,K)=>{const re=[...y.current],ze=re.findIndex(bo=>bo.key===F);ze!==-1&&(re[ze]={...re[ze],segments:K},y.current=re,r(re))},[r]),X=a?qc:Hc,ee=x.useMemo(()=>({default:F=>n.jsxRuntimeExports.jsx(Vc,{...F,segments:F.data.segments,color:F.data.color,onSegmentsChange:x.useCallback(K=>D(F.id,K),[F.id])},F.id)}),[D]),qe=x.useRef(null);c.use$2({triggers:M.zoomReset,callback:x.useCallback(({stage:F,cursor:K})=>{const re=qe.current;re==null||F!=="start"||!l.To.contains(re,K)||$()},[$])});const ss=c.purgeMouse(M.select)[0]??null,ns=c.purgeMouse(M.pan)[0]??null,Eo=c.purgeMouse(M.zoom)[0]??null,Ro={selectionOnDrag:ss==null,panOnDrag:ns==null,selectionKeyCode:ss,panActivationKeyCode:ns,zoomActivationKeyCode:Eo},Co=c.useCombinedRefs(qe,_),yo=x.useMemo(()=>({editable:a,onEditableChange:u,registerNodeRenderer:L,fitViewOnResize:f,setFitViewOnResize:h}),[a,u,L,f]);return n.jsxRuntimeExports.jsx($n.Provider,{value:yo,children:n.jsxRuntimeExports.jsx(c.Composite,{path:R,children:n.jsxRuntimeExports.jsx(j.ReactFlow,{...Ro,className:l.CSS(l.CSS.B("diagram"),l.CSS.editable(a)),nodes:O,edges:P,nodeTypes:N,edgeTypes:ee,ref:Co,fitView:!0,onNodesChange:A,onEdgesChange:Z,onConnect:q,onEdgeUpdate:I,defaultViewport:j.translateViewportForward(d),connectionLineComponent:Ac,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:Fc,connectionMode:j.ConnectionMode.Loose,snapGrid:[3,3],fitViewOptions:Mn,selectionMode:j.SelectionMode.Partial,proOptions:Yc,deleteKeyCode:Gc,...S,style:{[l.CSS.var("diagram-zoom")]:d.zoom,...S.style},...X,children:t})})})}),Wc=()=>{const{editable:e}=Fe();return e?n.jsxRuntimeExports.jsx(dl,{}):null},Kc=({children:e,...t})=>n.jsxRuntimeExports.jsx(z.Pack,{direction:"y",className:l.CSS.BE("diagram","controls"),...t,children:e}),Xc=({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,{})})},Jc=({onClick:e,...t})=>{const{fitView:s}=j.useReactFlow(),{fitViewOnResize:r,setFitViewOnResize:o}=Fe();return n.jsxRuntimeExports.jsx(c.ToggleIcon,{onClick:i=>{s(Mn),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,{})})},Qc=e=>n.jsxRuntimeExports.jsx(j.ReactFlowProvider,{children:n.jsxRuntimeExports.jsx(Uc,{...e})}),ea=Object.freeze(Object.defineProperty({__proto__:null,Background:Wc,Controls:Kc,Diagram:Qc,FitViewControl:Jc,HandleLayout:Pn,NodeLayout:pt,NodeRenderer:_n,ToggleEditControl:Xc,alignNodes:Dc,edgeConverter:j.edgeConverter,edgeZ:j.edgeZ,nodeConverter:j.nodeConverter,nodeZ:j.nodeZ,rfEdgeDataZ:j.rfEdgeDataZ,selectNode:es,selectNodeBox:oe,selectNodeLayout:zc,translateEdgesBackward:j.translateEdgesBackward,translateEdgesForward:j.translateEdgesForward,translateNodesBackward:j.translateNodesBackward,translateNodesForward:j.translateNodesForward,translateViewportBackward:j.translateViewportBackward,translateViewportForward:j.translateViewportForward,use:Zc,useContext:Fe,viewportZ:j.viewportZ},Symbol.toStringTag,{value:"Module"})),ta=({value:e,onChange:t})=>{const{inner:s,outer:r}=e,o=i=>()=>t({...e,...i});return n.jsxRuntimeExports.jsxs(z.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(z.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[n.jsxRuntimeExports.jsx(Ee,{selected:r==="left",onClick:o({outer:"left"})}),n.jsxRuntimeExports.jsxs(z.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(z.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"})}),jt=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],ie=({className:e,direction:t,...s})=>n.jsxRuntimeExports.jsx(z.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(je,{label:"Orientation",padHelpText:!1,...e,children:({value:t,onChange:s})=>{var r;return n.jsxRuntimeExports.jsx(ta,{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(z.Space,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(je,{path:e+".label",label:"Label",padHelpText:!1,grow:!0,children:t=>n.jsxRuntimeExports.jsx(c.Text$1,{selectOnFocus:!0,...t})}),n.jsxRuntimeExports.jsx(je,{path:e+".level",label:"Label Size",padHelpText:!1,children:t=>n.jsxRuntimeExports.jsx(ae.SelectLevel,{...t})})]}),Oe=e=>n.jsxRuntimeExports.jsx(je,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:s,variant:r,...o})=>n.jsxRuntimeExports.jsx(Lt.Swatch,{value:t??l.ZERO.setAlpha(1).rgba255,onChange:i=>s(i.rgba255),...o})}),Nn=({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 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(ie,{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})})]})},Se=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(Nn,{path:""});default:return n.jsxRuntimeExports.jsxs(ie,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(z.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(we,{path:"label"}),n.jsxRuntimeExports.jsx(Oe,{path:"color",hideIfNull:!0,optional:!0})]}),n.jsxRuntimeExports.jsx(ve,{path:""})]})}},[]),t=Q.useStatic({tabs:jt,content:e});return n.jsxRuntimeExports.jsx(Q.Tabs,{...t})},sa=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(Nn,{path:""});default:return n.jsxRuntimeExports.jsxs(ie,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(z.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(we,{path:"label"}),n.jsxRuntimeExports.jsxs(z.Space,{direction:"x",children:[n.jsxRuntimeExports.jsx(Oe,{path:"color"}),n.jsxRuntimeExports.jsx(je,{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:jt,content:e});return n.jsxRuntimeExports.jsx(Q.Tabs,{...t})},ue=()=>n.jsxRuntimeExports.jsxs(ie,{direction:"x",children:[n.jsxRuntimeExports.jsxs(z.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(we,{path:"label"}),n.jsxRuntimeExports.jsx(Oe,{path:"color"})]}),n.jsxRuntimeExports.jsx(ve,{path:""})]}),Ss={y:2,x:.25},hs={lower:0,upper:2e3},na=()=>n.jsxRuntimeExports.jsxs(ie,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(z.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(we,{path:"label"}),n.jsxRuntimeExports.jsxs(z.Space,{direction:"x",children:[n.jsxRuntimeExports.jsx(Oe,{path:"color"}),n.jsxRuntimeExports.jsx(je,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>n.jsxRuntimeExports.jsx(c.Numeric,{value:e??200,dragScale:Ss,bounds:hs,...t})}),n.jsxRuntimeExports.jsx(je,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>n.jsxRuntimeExports.jsx(c.Numeric,{value:e??200,dragScale:Ss,bounds:hs,...t})})]})]}),n.jsxRuntimeExports.jsx(ve,{path:""})]}),Bn=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],ra=({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=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(ie,{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})})]})},oa=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"telemetry":return n.jsxRuntimeExports.jsx(ra,{path:""});default:return n.jsxRuntimeExports.jsxs(ie,{direction:"x",children:[n.jsxRuntimeExports.jsxs(z.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(we,{path:"label"}),n.jsxRuntimeExports.jsxs(z.Space,{direction:"x",children:[n.jsxRuntimeExports.jsx(Oe,{path:"color"}),n.jsxRuntimeExports.jsx(je,{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:Bn,content:e});return n.jsxRuntimeExports.jsx(Q.Tabs,{...t})},la=({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=xt(o.channel);return x.useEffect(()=>{s({...t})},[u]),n.jsxRuntimeExports.jsx(ie,{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})})})},ia=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"telemetry":return n.jsxRuntimeExports.jsx(la,{path:""});default:return n.jsxRuntimeExports.jsxs(ie,{direction:"x",children:[n.jsxRuntimeExports.jsxs(z.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(we,{path:"label"}),n.jsxRuntimeExports.jsx(z.Space,{direction:"x",children:n.jsxRuntimeExports.jsx(Oe,{path:"color"})})]}),n.jsxRuntimeExports.jsx(ve,{path:""})]})}},[]),t=Q.useStatic({tabs:Bn,content:e});return n.jsxRuntimeExports.jsx(Q.Tabs,{...t})},ca=({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=>{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(ie,{direction:"y",children:n.jsxRuntimeExports.jsx(me.Item,{label:"Output Channel",children:n.jsxRuntimeExports.jsx(Ce,{value:o.channel,onChange:i})})})},aa=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(ca,{path:""});default:return n.jsxRuntimeExports.jsxs(ie,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(z.Space,{direction:"y",grow:!0,children:n.jsxRuntimeExports.jsx(we,{path:"label"})}),n.jsxRuntimeExports.jsx(ve,{path:""})]})}},[]),t=Q.useStatic({tabs:jt,content:e});return n.jsxRuntimeExports.jsx(Q.Tabs,{...t})},ua=({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 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(ie,{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})})]})},xa=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(ua,{path:""});default:return n.jsxRuntimeExports.jsxs(ie,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(z.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(we,{path:"label"}),n.jsxRuntimeExports.jsx(je,{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:jt,content:e});return n.jsxRuntimeExports.jsx(Q.Tabs,{...t})},da=({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])}},H=x.forwardRef(({label:e="",onChange:t,level:s="p",children:r,orientation:o="top",style:i,className:u,...a},d)=>n.jsxRuntimeExports.jsxs(z.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]}));H.displayName="Labeled";const V=e=>n.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),ts=e=>n.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),De=e=>n.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),se=e=>n.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),ma={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}},pa=(e,t)=>ma[t][e],ja=(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},Y=({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=ja(r,s,t);return n.jsxRuntimeExports.jsx(j.Handle$1,{position:pa(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}%`}})},xe=({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}),fa=.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*fa).width,...i},children:n.jsxRuntimeExports.jsx("g",{children:s})})},On=({className:e,orientation:t,scale:s,color:r,...o})=>n.jsxRuntimeExports.jsxs(xe,{...o,orientation:t,className:l.CSS(l.CSS.B("four-way-valve"),e),children:[n.jsxRuntimeExports.jsxs(Y,{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"})]})]}),Dn=({color:e,orientation:t="left",scale:s,...r})=>n.jsxRuntimeExports.jsxs(xe,{...r,className:l.CSS(l.CSS.B("three-way-valve")),orientation:t,children:[n.jsxRuntimeExports.jsxs(Y,{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"})]})]}),zn=({orientation:e="left",color:t,scale:s,...r})=>n.jsxRuntimeExports.jsxs(xe,{...r,children:[n.jsxRuntimeExports.jsxs(Y,{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"})})]}),An=({className:e,color:t,orientation:s="left",normallyOpen:r=!1,scale:o,...i})=>n.jsxRuntimeExports.jsxs(xe,{className:l.CSS(l.CSS.B("solenoid-valve"),r&&l.CSS.M("normally-open"),e),...i,children:[n.jsxRuntimeExports.jsxs(Y,{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(ts,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),Vn=({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(Y,{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"})]})]}),In=({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(Y,{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"})]})]}),Zn=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(xe,{...o,orientation:s,className:l.CSS(l.CSS.B("angled-valve"),t),children:[n.jsxRuntimeExports.jsxs(Y,{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"})]})]}),Fn=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(xe,{...o,className:l.CSS(l.CSS.B("pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(Y,{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(De,{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)})]})]}),qn=({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(Y,{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"})]})]})},Hn=({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(Y,{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"})})]}),Yn=({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(Y,{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"})]})]}),Gn=({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(Y,{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"})})]}),Sa=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,ha=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}%`},ga={width:40,height:80},Ea={x:50,y:10},Un=({className:e,dimensions:t=ga,borderRadius:s=Ea,color:r,...o})=>{const i=Sa(s),u=c.use();return n.jsxRuntimeExports.jsx(te,{className:l.CSS(e,l.CSS.B("tank")),style:{...t,borderRadius:ha(i),borderColor:l.cssString(r??u.colors.gray.l9)},...o,children:n.jsxRuntimeExports.jsxs(Y,{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"})]})})},Wn=({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(Y,{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"})]})]}),Kn=({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(Y,{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"})]})]}),Xn=({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(Y,{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"})]})]}),Jn=({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(Y,{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"})]})]}),Qn=({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(Y,{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})})]})},er=({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(Y,{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"})]})]}),tr=({onClick:e,orientation:t="left",label:s=""})=>n.jsxRuntimeExports.jsxs(te,{orientation:t,children:[n.jsxRuntimeExports.jsx(c.Button,{onClick:e,children:s}),n.jsxRuntimeExports.jsxs(Y,{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"})]})]}),sr=({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(Y,{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"})]})]})},nr=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(xe,{...o,className:l.CSS(l.CSS.B("screw-pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(Y,{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(De,{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)})]})]}),rr=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(xe,{...o,className:l.CSS(l.CSS.B("vacuum-pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(Y,{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(De,{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)})]})]}),or=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(xe,{...o,className:l.CSS(l.CSS.B("cavity-pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(Y,{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(De,{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)})]})]}),lr=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(xe,{...o,className:l.CSS(l.CSS.B("piston-pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(Y,{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(De,{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"})]})]}),ir=({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(Y,{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(ts,{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"})]})]}),cr=({color:e,className:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(xe,{...o,className:l.CSS(l.CSS.B("rotary-mixer"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(Y,{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)})]})]}),ar=({className:e,color:t,orientation:s="left",scale:r,...o})=>n.jsxRuntimeExports.jsxs(xe,{...o,className:l.CSS(l.CSS.B("light"),e),children:[n.jsxRuntimeExports.jsxs(Y,{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(De,{cx:"32",cy:"32",r:"30"})})]}),ur=({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(Y,{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(ts,{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"})]})]}),Ra=({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}},ce=({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}},Ca=j.Value.z.omit({font:!0}).partial({color:!0}).extend({level:C.levelZ.optional()}),xr=({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}},ya=Object.freeze(Object.defineProperty({__proto__:null,corePropsZ:Ca,use:xr},Symbol.toStringTag,{value:"Module"})),dr=e=>l.g.construct(e)==="x"?l.J.swap(e):e,ba=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(z.Space,{direction:l.J.rotate90(r),align:"center",justify:"center",empty:!0,...u,children:[n.jsxRuntimeExports.jsxs(z.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(vn,{...s})]}),i]}),mr=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}=ce({aetherKey:e,source:o,sink:i});return n.jsxRuntimeExports.jsx(H,{...t,onChange:s,children:n.jsxRuntimeExports.jsx(ne,{...r,orientation:dr(u),children:n.jsxRuntimeExports.jsx(Dn,{enabled:d,triggered:p,onClick:m,orientation:u,color:a})})})}),pr=e=>n.jsxRuntimeExports.jsx(Dn,{...e}),jr=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}=ce({aetherKey:t,source:o,sink:i});return n.jsxRuntimeExports.jsx(H,{...s,onChange:r,children:n.jsxRuntimeExports.jsx(ne,{...e,orientation:u,children:n.jsxRuntimeExports.jsx(zn,{enabled:d,triggered:p,onClick:m,orientation:u,color:a})})})}),fr=e=>n.jsxRuntimeExports.jsx(zn,{...e}),Sr=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}=ce({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(H,{...t,onChange:s,children:n.jsxRuntimeExports.jsx(ne,{...d,orientation:ba(r),children:n.jsxRuntimeExports.jsx(An,{enabled:p,triggered:m,onClick:f,orientation:r,color:i,normallyOpen:o})})})}),hr=e=>n.jsxRuntimeExports.jsx(An,{...e}),gr=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}=ce({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(H,{...s,onChange:r,children:n.jsxRuntimeExports.jsx(ne,{...t,orientation:o,children:n.jsxRuntimeExports.jsx(On,{enabled:d,triggered:p,onClick:m,orientation:o,color:i})})})}),Er=e=>n.jsxRuntimeExports.jsx(On,{...e}),Rr=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}=ce({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:dr(o),children:n.jsxRuntimeExports.jsx(Zn,{enabled:d,triggered:p,onClick:m,orientation:o,color:i})})})}),Cr=e=>n.jsxRuntimeExports.jsx(Zn,{...e}),yr=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}=ce({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:o,children:n.jsxRuntimeExports.jsx(Fn,{enabled:d,triggered:p,onClick:m,orientation:o,color:i})})})}),br=e=>n.jsxRuntimeExports.jsx(Fn,{...e}),vr=c.wrap$1("Tank",({label:e,onChange:t,orientation:s,color:r,dimensions:o,borderRadius:i})=>n.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Un,{onResize:u=>t({dimensions:u}),orientation:s,color:r,dimensions:o,borderRadius:i})})),wr=e=>n.jsxRuntimeExports.jsx(Un,{...e,dimensions:{width:25,height:50}}),Tr=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Vn,{orientation:s,color:r})}),kr=e=>n.jsxRuntimeExports.jsx(Vn,{...e}),Pr=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Wn,{orientation:s,color:r})}),Lr=e=>n.jsxRuntimeExports.jsx(Wn,{...e}),Mr=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(ur,{orientation:s,color:r})}),$r=e=>n.jsxRuntimeExports.jsx(ur,{...e}),_r=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(qn,{orientation:s,color:r})}),Nr=e=>n.jsxRuntimeExports.jsx(qn,{...e}),Br=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Hn,{orientation:s,color:r})}),Or=e=>n.jsxRuntimeExports.jsx(Hn,{...e}),Dr=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Yn,{orientation:s,color:r})}),zr=e=>n.jsxRuntimeExports.jsx(Yn,{...e}),Ar=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}=Ra({aetherKey:t,source:i,sink:u});return n.jsxRuntimeExports.jsx(H,{...e,onChange:a,children:n.jsxRuntimeExports.jsx(ne,{...r,className:l.CSS.B("symbol"),orientation:s,children:n.jsxRuntimeExports.jsx(sr,{value:d,onChange:p,units:o,orientation:s})})})}),Vr=e=>n.jsxRuntimeExports.jsx(sr,{value:12,onChange:()=>{},units:"mV",...e,children:n.jsxRuntimeExports.jsx(c.Text,{level:"p",children:"10.0"})}),Ir=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Gn,{orientation:s,color:r})}),Zr=e=>n.jsxRuntimeExports.jsx(Gn,{...e}),Fr=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Xn,{orientation:s,color:r})}),qr=e=>n.jsxRuntimeExports.jsx(Xn,{...e}),Hr=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(In,{orientation:s,color:r})}),Yr=e=>n.jsxRuntimeExports.jsx(In,{...e}),Gr=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Kn,{orientation:s,color:r})}),Ur=e=>n.jsxRuntimeExports.jsx(Kn,{...e}),Wr=({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Jn,{orientation:s,color:r})}),Kr=e=>n.jsxRuntimeExports.jsx(Jn,{...e}),Xr=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 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)})),S({outerBox:_,labelBox:g})},[]),{}),{zoom:w}=j.useInitialViewport(),M=wa({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:$}=xr({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(z.Space,{direction:"y",children:m==null?void 0:m.map((_,T)=>n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:_},T))}),n.jsxRuntimeExports.jsx(H,{className:l.CSS(o,l.CSS.B("value-labeled")),ref:E,onChange:p,...t,children:n.jsxRuntimeExports.jsx(Qn,{color:u,dimensions:{height:R,width:$},units:d})})]})}),va=.9,wa=({labelOrientation:e,outerBox:t,labelBox:s,valueBoxHeight:r,position:o,hasLabel:i,zoom:u})=>{const a=l.q.scale(l.To.dims(s),1/(va*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)},Jr=({color:e})=>n.jsxRuntimeExports.jsx(Qn,{color:e,dimensions:{width:60,height:25},units:"psi",children:n.jsxRuntimeExports.jsx(c.Text,{level:"p",children:"50.00"})}),Qr=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}=ce({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:o,children:n.jsxRuntimeExports.jsx(er,{enabled:d,triggered:p,onClick:m,orientation:o,color:i})})})}),eo=e=>n.jsxRuntimeExports.jsx(er,{...e}),to=c.wrap$1("Button",({aetherKey:e,label:t,orientation:s,sink:r,control:o})=>{const{click:i}=da({aetherKey:e,sink:r});return n.jsxRuntimeExports.jsx(ne,{...o,className:l.CSS.B("symbol"),orientation:s,children:n.jsxRuntimeExports.jsx(tr,{label:t==null?void 0:t.label,onClick:i})})}),so=({label:e,...t})=>n.jsxRuntimeExports.jsx(tr,{label:"Button",...t}),no=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}=ce({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:o,children:n.jsxRuntimeExports.jsx(nr,{enabled:d,triggered:p,onClick:m,orientation:o,color:i})})})}),ro=e=>n.jsxRuntimeExports.jsx(nr,{...e}),oo=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}=ce({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:n.jsxRuntimeExports.jsx(ne,{...s,orientation:o,children:n.jsxRuntimeExports.jsx(rr,{enabled:d,triggered:p,onClick:m,orientation:o,color:i})})})}),lo=e=>n.jsxRuntimeExports.jsx(rr,{...e}),io=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}=ce({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(H,{...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("pistonPump",({aetherKey:e,label:t,control:s,onChange:r,orientation:o,color:i,source:u,sink:a})=>{const{enabled:d,triggered:p,toggle:m}=ce({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(H,{...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("statixMixer",({label:e,onChange:t,orientation:s,color:r})=>n.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(ir,{orientation:s,color:r})})),mo=e=>n.jsxRuntimeExports.jsx(ir,{...e}),po=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}=ce({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(H,{...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("light",({aetherKey:e,label:t,className:s,orientation:r="left",color:o,source:i,onChange:u})=>{const{enabled:a}=ce({aetherKey:e,source:i});return n.jsxRuntimeExports.jsx(H,{...t,onChange:u,children:n.jsxRuntimeExports.jsx(ar,{color:o,enabled:a,className:s,orientation:r})})}),So=e=>n.jsxRuntimeExports.jsx(ar,{...e}),U=4,Ta=2,ka=["angledReliefValve","angledValve","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"],Pa=le.z.enum(ka),J={orientation:"left"},La={...J,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"})},Ma={...J,source:j.sourcePipeline("number",{connections:[],segments:{valueStream:j.streamChannelValue({channel:0})},outlet:"valueStream"})},$a={...J,sink:j.sinkPipeline("number",{connections:[],segments:{setter:j.setChannelValue({channel:0})},inlet:"setter"})},ho={...J,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"})},go={...J,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={...ho,...go},G=e=>({label:{label:e,level:"p",orientation:"top"}}),_a={name:"Three Way Valve",key:"threeWayValve",Form:Se,Symbol:mr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Three Way Valve"),...de}),Preview:pr,zIndex:U},Na={name:"Valve",key:"valve",Form:Se,Symbol:jr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Valve"),...de}),Preview:fr,zIndex:U},Ba={name:"Solenoid Valve",key:"solenoidValve",Form:sa,Symbol:Sr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Solenoid Valve"),normallyOpen:!1,...de}),Preview:hr,zIndex:U},Oa={name:"Four Way Valve",key:"fourWayValve",Form:Se,Symbol:gr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Four Way Valve"),...de}),Preview:Er,zIndex:U},Da={name:"Angled Valve",key:"angledValve",Form:Se,Symbol:Rr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Angled Valve"),...de}),Preview:Cr,zIndex:U},za={name:"Pump",key:"pump",Form:Se,Symbol:yr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Pump"),...de}),Preview:br,zIndex:U},Aa={name:"Screw Pump",key:"screwPump",Form:Se,Symbol:no,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Screw Pump"),...de}),Preview:ro,zIndex:U},Va={name:"Tank",key:"tank",Form:na,Symbol:vr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Tank"),dimensions:{width:100,height:200},...J}),Preview:wr,zIndex:Ta},Ia={name:"Relief Valve",key:"reliefValve",Form:ue,Symbol:Tr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Relief Valve"),...J}),Preview:kr,zIndex:U},Za={name:"Regulator",key:"regulator",Form:ue,Symbol:Pr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Regulator"),...J}),Preview:Lr,zIndex:U},Fa={name:"Electric Regulator",key:"electricRegulator",Form:ue,Symbol:Mr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Electric Regulator"),...J}),Preview:$r,zIndex:U},qa={name:"Burst Disc",key:"burstDisc",Form:ue,Symbol:_r,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Burst Disc"),...J}),Preview:Nr,zIndex:U},Ha={name:"Cap",key:"cap",Form:ue,Symbol:Br,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Cap"),...J}),Preview:Or,zIndex:U},Ya={name:"Manual Valve",key:"manualValve",Form:ue,Symbol:Dr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Manual Valve"),...J}),Preview:zr,zIndex:U},Ga={name:"Filter",key:"filter",Form:ue,Symbol:Ir,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Filter"),...J}),Preview:Zr,zIndex:U},Ua={name:"Needle Valve",key:"needleValve",Form:ue,Symbol:Fr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Needle Valve"),...J}),Preview:qr,zIndex:U},Wa={name:"Check Valve",key:"checkValve",Form:ue,Symbol:Hr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Check Valve"),...J}),Preview:Yr,zIndex:U},Ka={name:"Orifice",key:"orifice",Form:ue,Symbol:Gr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Orifice"),...J}),Preview:Ur,zIndex:U},Xa={name:"Angled Relief Valve",key:"angledReliefValve",Form:ue,Symbol:Wr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Angled Relief Valve"),...J}),Preview:Kr,zIndex:U},Ja={name:"Value",key:"value",Form:oa,Symbol:Xr,Preview:Jr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",...G("Value"),...J,telem:La.source}),zIndex:U},Qa={name:"Button",key:"button",Symbol:to,Form:aa,Preview:so,defaultProps:()=>({...G("Button"),...go}),zIndex:U},eu={name:"Switch",key:"switch",Symbol:Qr,Preview:eo,Form:Se,defaultProps:()=>({...G("Switch"),...de}),zIndex:U},tu={name:"Vacuum Pump",key:"vacuumPump",Symbol:oo,Form:Se,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Vacuum Pump"),...de}),Preview:lo,zIndex:U},su={name:"Cavity Pump",key:"cavityPump",Symbol:io,Form:Se,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Cavity Pump"),...de}),Preview:co,zIndex:U},nu={name:"Piston Pump",key:"pistonPump",Symbol:ao,Form:Se,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Piston Pump"),...de}),Preview:uo,zIndex:U},ru={name:"Static Mixer",key:"staticMixer",Symbol:xo,Form:ue,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Static Mixer"),...J}),Preview:mo,zIndex:U},ou={name:"Rotary Mixer",key:"rotaryMixer",Symbol:po,Form:Se,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Rotary Mixer"),...de}),Preview:jo,zIndex:U},lu={name:"Light",key:"light",Symbol:fo,Form:ia,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...G("Light"),...ho}),Preview:So,zIndex:U},iu={name:"Setpoint",key:"setpoint",Symbol:Ar,Form:xa,defaultProps:()=>({units:"mV",...G("Setpoint"),...Ma,...$a}),Preview:Vr,zIndex:U},cu={value:Ja,light:lu,switch:eu,button:Qa,setpoint:iu,tank:Va,valve:Na,solenoidValve:Ba,threeWayValve:_a,fourWayValve:Oa,angledValve:Da,manualValve:Ya,needleValve:Ua,reliefValve:Ia,angledReliefValve:Xa,checkValve:Wa,regulator:Za,electricRegulator:Fa,pump:za,pistonPump:nu,screwPump:Aa,cavityPump:su,vacuumPump:tu,staticMixer:ru,rotaryMixer:ou,burstDisc:qa,cap:Ha,filter:Ga,orifice:Ka},au=Object.freeze(Object.defineProperty({__proto__:null,AngledReliefValve:Wr,AngledReliefValvePreview:Kr,AngledValve:Rr,AngledValvePreview:Cr,BurstDisc:_r,BurstDiscPreview:Nr,Button:to,ButtonPreview:so,Cap:Br,CapPreview:Or,CavityPump:io,CavityPumpPreview:co,CheckValve:Hr,CheckValvePreview:Yr,ControlState:ne,ElectricRegulator:Mr,ElectricRegulatorPreview:$r,Filter:Ir,FilterPreview:Zr,FourWayValve:gr,FourWayValvePreview:Er,Light:fo,LightPreview:So,ManualValve:Dr,ManualValvePreview:zr,NeedleValve:Fr,NeedleValvePreview:qr,Orifice:Gr,OrificePreview:Ur,PistonPump:ao,PistonPumpPreview:uo,Pump:yr,PumpPreview:br,Regulator:Pr,RegulatorPreview:Lr,ReliefValve:Tr,ReliefValvePreview:kr,RotaryMixer:po,RotaryMixerPreview:jo,SYMBOLS:cu,ScrewPump:no,ScrewPumpPreview:ro,Setpoint:Ar,SetpointPreview:Vr,SolenoidValve:Sr,SolenoidValvePreview:hr,StaticMixer:xo,StaticMixerPreview:mo,Switch:Qr,SwitchPreview:eo,Tank:vr,TankPreview:wr,ThreeWayValve:mr,ThreeWayValvePreview:pr,VacuumPump:oo,VacuumPumpPreview:lo,Value:Xr,ValuePreview:Jr,Valve:jr,ValvePreview:fr,typeZ:Pa},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=Ye.external;exports.DataType=C.d;exports.Density=C.I;exports.MultiSeries=C.yt;exports.Rate=C.$;exports.Series=C.N$1;exports.TimeRange=C.U;exports.TimeSpan=C.w;exports.TimeStamp=C.m;exports.state=C.state;exports.Generic=z.Generic;exports.Align=To.external;exports.Button=ko.external;exports.Caret=Po.Animated$1;exports.telem=j.external;exports.Color=Lt.external;exports.Text=ae.external;exports.Triggers=Mt.external;exports.Menu=Lo.external;exports.List=$e.external;exports.createFilterTransform=$e.createFilterTransform;exports.fuseFilter=$e.fuseFilter;exports.proxyMemo=$e.proxyMemo;exports.createHexOpacityVariants=gs.createHexOpacityVariants;exports.unitProperty=gs.unitProperty;exports.Input=me.external;exports.Tabs=Q.external;exports.Theming=Mo.external;exports.Tree=$o.external;exports.Video=_o.Video;exports.Accordion=Jo;exports.Breadcrumb=el;exports.Canvas=fl;exports.Channel=ii;exports.Control=Rc;exports.Device=Li;exports.Diagram=ea;exports.Eraser=rc;exports.Form=Ti;exports.Icon=_i;exports.Label=Ai;exports.Legend=Rl;exports.Line=Cl;exports.LinePlot=Gl;exports.Measure=Xl;exports.Modal=Ii;exports.Mosaic=tc;exports.Nav=ic;exports.Note=ac;exports.OS=pc;exports.Observe=vi;exports.Pluto=vc;exports.Progress=Tc;exports.Range=Wl;exports.Ranger=Nc;exports.Resize=qo;exports.Rule=Jl;exports.Schematic=au;exports.Select=Bl;exports.Status=Oo;exports.Steps=Oc;exports.Synnax=nl;exports.Tag=_l;exports.Telem=Sc;exports.Tooltip=Do;exports.Value=ya;exports.Viewport=Yl;exports.axis=ol;exports.control=ll;
|